| | |
| | | public DateTime? Weixintime { get; set; } |
| | | public string HuiyuanId { get; set; } |
| | | public string Customertype { get; set; } |
| | | |
| | | public int? Visittimes { get; set; } |
| | | public string Viscustomer { get; set; } |
| | | } |
| | | |
| | | public class IntentionCustomerDTOSearch : SearchEntity |
| | |
| | | |
| | | public string Customertype { get; set; } |
| | | |
| | | |
| | | public string Visittimes { get; set; } |
| | | } |
| | | } |
| | |
| | | // Yixiangtimeend = Yixiangtimeend.AddDays(1); |
| | | } |
| | | |
| | | int aaaa = 0; |
| | | if (!string.IsNullOrWhiteSpace(searchEntity.Visittimes)) |
| | | { |
| | | int.TryParse(searchEntity.Visittimes, out aaaa); |
| | | } |
| | | |
| | | |
| | | var query = (from a in _context.IntentionCustomers |
| | | join b in listCode.Where(x => x.CodeTable == "IntentionCustomer" && x.CodeField == "khly") |
| | | on a.Khly equals b.CodeSn |
| | |
| | | join g in _context.Areas on a.City equals g.CodeId |
| | | join h in _context.Areas on a.AreaId equals h.CodeId |
| | | |
| | | |
| | | join l in _context.IntentionVisits.Where(x => x.RecStatus == "A").GroupBy(q => new { q.Viscustomer }).Select(q => new |
| | | { |
| | | Viscustomer = q.Key.Viscustomer, |
| | | Visittimes = q.Count(), |
| | | }) |
| | | on a.Id equals l.Viscustomer |
| | | into lsss |
| | | from lll in lsss.DefaultIfEmpty() |
| | | |
| | | where a.RecStatus == "A" |
| | | && (string.IsNullOrWhiteSpace(searchEntity.Createtime) || (a.Createtime >= Createtimestart && a.Createtime <= Createtimeend)) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.Name) || a.Name.Contains(searchEntity.Name.Trim())) |
| | |
| | | |
| | | && (string.IsNullOrWhiteSpace(searchEntity.Yixiangtime) || (a.Yixiangtime >= Yixiangtimestart && a.Yixiangtime <= Yixiangtimeend)) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.Yixiang) || ( a.Yixiang == searchEntity.Yixiang.Trim() && (a.Ywjl == null || a.Ywjl == searchEntity.YwjlYx) )) |
| | | && (aaaa <= 0 || lll.Visittimes >= aaaa) |
| | | |
| | | |
| | | //&& (string.IsNullOrWhiteSpace(searchEntity.Shifouweixin) || a.Shifoutianjiaweixin == searchEntity.Shifouweixin.Trim()) |
| | | select new IntentionCustomerDTO |
| | | { |
| | |
| | | DianxiaozhuanyuanName = fff.UserName, |
| | | Zuijinzhuizongtime = a.Zuijinzhuizongtime, |
| | | ZuijinzhuizongtimeName = a.Zuijinzhuizongtime.HasValue ? a.Zuijinzhuizongtime.Value.ToString("yyyy-MM-dd") : "", |
| | | Visittimes = lll.Visittimes, |
| | | } |
| | | ); |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | if (!string.IsNullOrWhiteSpace(searchEntity.Visittimes)) |
| | | { |
| | | if (searchEntity.ShifouDianhua != "A") |
| | | { |
| | | query = query.Where(a => a.Tel == null || a.Tel == ""); |
| | | } |
| | | else |
| | | { |
| | | query = query.Where(a => a.Tel != null && a.Tel != ""); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | //if (searchEntity.totalrows == 0) |
| | | searchEntity.totalrows = query.Count(); |
| | | var lianlist = query.OrderByDescending(x => x.Modifytime).Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); |
| | | |
| | | |
| | | //foreach (var intentionCustomerDTO in lianlist) |
| | | //{ |
| | | // intentionCustomerDTO.Visittimes = _context.IntentionVisits.Count(x => x.RecStatus == "A" && x.Viscustomer == intentionCustomerDTO.Id); |
| | | //} |
| | | |
| | | |
| | | data.LoadData(searchEntity, lianlist); |
| | | return data; |
| | | } |
| | |
| | | { label: '客户类型', name: 'KhlxName', labtype: 'txt', hidden: false, width: 100}, |
| | | { label: '业务经理', name: 'YwjlName', labtype: 'txt', hidden: false, width: 100 }, |
| | | { |
| | | label: '访问次数', name: 'Visittimes', labtype: 'txt', hidden: false, width: 100, |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | if (cellvalue == null) { |
| | | return "0"; |
| | | } else { |
| | | return cellvalue; |
| | | } |
| | | |
| | | } |
| | | }, |
| | | |
| | | { |
| | | label: '客户访问', name: 'Name111', labtype: 'txt', hidden: false, width: 100, |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | return "<a class='Fangwen' style='display: none;' onclick=\"OpenWindow('新增意向客户拜访','98%','100%', '/IntentionVisit/Edit?id=&Viscustomer=" + rowObject.Id + "')\" >客户访问</a>"; |
| | |
| | | { label: '录入人', name: 'Creater', labtype: 'combox', hidden: false, data: JSON.parse(Creater), cwidth: '5%', cccwidth: '8%' }, |
| | | { label: '是否加微信', name: 'Shifouweixin', labtype: 'combox', hidden: false, data: JSON.parse(shifou), cwidth: '5%', cccwidth: '8%' }, |
| | | { label: '是否录入电话', name: 'ShifouDianhua', labtype: 'combox', hidden: false, data: JSON.parse(shifou), cwidth: '5%', cccwidth: '8%' }, |
| | | |
| | | { label: '访问次数大于', name: 'Visittimes', labtype: 'txt', hidden: false }, |
| | | |
| | | ]; |
| | | var _pageAdd = function () { |
| | |
| | | { |
| | | "ConnectionStrings": { |
| | | "DefaultConnection": "server=.;database=zhengcaioa;uid=sa;pwd=123456;", |
| | | "DefaultConnection": "server=localhost;database=zhengcaioa;uid=sa;pwd=123456;", |
| | | "zcwebConnection": "server=localhost;database=zcweb;uid=sa;pwd=123456;", |
| | | "zcUserInfoNConnection": "server=localhost;database=zcUserInfoN_db;uid=sa;pwd=123456;", |
| | | "WebCrawlerConnection": "server=localhost;database=WebCrawler;uid=sa;pwd=123456;" |