username@email.com
2022-12-28 81ac184ee7fcf0a93eee4d2026edc91f3f3c0070
意向客户的电话次数,展示

查询条件,电话次数大于
4个文件已修改
72 ■■■■ 已修改文件
zhengcaioa/DTO/IntentionCustomerDTO.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/IntentionCustomerService.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/IntentionCustomer/Index.cshtml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/appsettings.Development.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/IntentionCustomerDTO.cs
@@ -64,6 +64,9 @@
        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
@@ -93,7 +96,7 @@
        public string ShifouDianhua { get; set; }
        public string Customertype { get; set; }
        public string Visittimes { get; set; }
    }
}
zhengcaioa/Services/IntentionCustomerService.cs
@@ -206,6 +206,13 @@
               // 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
@@ -227,7 +234,17 @@
                     join g in _context.Areas on a.City equals g.CodeId
                     join h in _context.Areas on a.AreaId equals h.CodeId
                     where a.RecStatus == "A"
                         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.Khly) || a.Khly == searchEntity.Khly.Trim())
@@ -243,6 +260,9 @@
                                
                                    && (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
                     {
@@ -300,7 +320,8 @@
                                 DianxiaozhuanyuanName = fff.UserName,
                                 Zuijinzhuizongtime = a.Zuijinzhuizongtime,
                                 ZuijinzhuizongtimeName = a.Zuijinzhuizongtime.HasValue ? a.Zuijinzhuizongtime.Value.ToString("yyyy-MM-dd") : "",
                             }
                             Visittimes = lll.Visittimes,
                         }
                    );
            if (!string.IsNullOrWhiteSpace(searchEntity.Shifouweixin))
@@ -319,12 +340,32 @@
                }
                
            }
            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)
            }
            //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();
        data.LoadData(searchEntity, lianlist);
            //foreach (var intentionCustomerDTO in lianlist)
            //{
            //    intentionCustomerDTO.Visittimes = _context.IntentionVisits.Count(x => x.RecStatus == "A" && x.Viscustomer == intentionCustomerDTO.Id);
            //}
            data.LoadData(searchEntity, lianlist);
        return data;
    }
zhengcaioa/zhengcaioa/Views/IntentionCustomer/Index.cshtml
@@ -43,6 +43,18 @@
            { 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>";
@@ -65,8 +77,8 @@
            { 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 () {
            OpenWindow("新增意向客户", "98%", "100%", "/IntentionCustomer/Edit/");
zhengcaioa/zhengcaioa/appsettings.Development.json
@@ -1,6 +1,6 @@
{
  "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;"