From 90dd02e591779ead7a79421b610542f00c3a9227 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期一, 03 四月 2023 09:21:13 +0800 Subject: [PATCH] 后台app推送 --- zhengcaioa/zhengcaioa/Views/CooperatecustomCustomer/Edit.cshtml | 28 zhengcaioa/CommonToolsCore/SMSHelper.cs | 16 zhengcaioa/IServices/IIntentionCustomerService.cs | 2 zhengcaioa/Services/CooperatecustomCustomerService.cs | 4 zhengcaioa/Services/IntentionCustomerService.cs | 30 + zhengcaioa/zhengcaioa/Views/IntentionCustomer/Edit.cshtml | 29 + zhengcaioa/zhengcaioa/Timer/TimerGetShopUsersService.cs | 1582 +++++++++++++++++++++++++++++++++-------------------- zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs | 15 8 files changed, 1,106 insertions(+), 600 deletions(-) diff --git a/zhengcaioa/CommonToolsCore/SMSHelper.cs b/zhengcaioa/CommonToolsCore/SMSHelper.cs index a0b2b3a..bb61828 100644 --- a/zhengcaioa/CommonToolsCore/SMSHelper.cs +++ b/zhengcaioa/CommonToolsCore/SMSHelper.cs @@ -132,5 +132,21 @@ string ssss = HttpClientRequest.HttpClientPost(url, "POST", data); return ssss; } + + + /// <summary> + /// 鐭俊瀹炰緥 + /// </summary> + /// <param name="phone"></param> + /// <param name="date"></param> + /// <returns></returns> + public static string PushAppduandu(string conment) + { + + string url = "http://rest-hz.goeasy.io/v2/im/message"; + string data = conment; + string ssss = HttpClientRequest.HttpClientPost(url, "POST", data); + return ssss; + } } } diff --git a/zhengcaioa/IServices/IIntentionCustomerService.cs b/zhengcaioa/IServices/IIntentionCustomerService.cs index 994ff8b..593a77a 100644 --- a/zhengcaioa/IServices/IIntentionCustomerService.cs +++ b/zhengcaioa/IServices/IIntentionCustomerService.cs @@ -40,5 +40,7 @@ ResultEntity saveKhlx(CooperatecustomCustomerDTO cooperatecustomCustomerDTO); + ResultEntity GetZhengfuProjectDTOByTitle(string Name, string Id); + } } diff --git a/zhengcaioa/Services/CooperatecustomCustomerService.cs b/zhengcaioa/Services/CooperatecustomCustomerService.cs index d4ba3a4..b8024a6 100644 --- a/zhengcaioa/Services/CooperatecustomCustomerService.cs +++ b/zhengcaioa/Services/CooperatecustomCustomerService.cs @@ -1158,10 +1158,10 @@ - where a.IsValid == true + where a.IsValid == true && a.Itcode.Length<=20 && a.Itcode.Length > 8 && (string.IsNullOrWhiteSpace(searchEntity.Createtime) || (a.CreateTime >= Createtimestart && a.CreateTime <= Createtimeend)) && (string.IsNullOrWhiteSpace(searchEntity.Name) || a.Name.Contains(searchEntity.Name.Trim())) - && (string.IsNullOrWhiteSpace(searchEntity.Itcode) || a.Name.Contains(searchEntity.Itcode.Trim())) + && (string.IsNullOrWhiteSpace(searchEntity.Itcode) || a.Itcode.Contains(searchEntity.Itcode.Trim())) select new FrameworkUserDTO { diff --git a/zhengcaioa/Services/IntentionCustomerService.cs b/zhengcaioa/Services/IntentionCustomerService.cs index 883d620..5642c5f 100644 --- a/zhengcaioa/Services/IntentionCustomerService.cs +++ b/zhengcaioa/Services/IntentionCustomerService.cs @@ -627,5 +627,35 @@ return resultEntity; } + + + public ResultEntity GetZhengfuProjectDTOByTitle(string Name, string Id) + { + ResultEntity resultEntity = new ResultEntity(); + resultEntity.Result = true; + if (!string.IsNullOrWhiteSpace(Name)) + { + var checkUserSn = _context.IntentionCustomers.Where(r => r.RecStatus == "A" && r.Name == Name).FirstOrDefault(); + if (checkUserSn != null && (string.IsNullOrWhiteSpace(Id) || (!string.IsNullOrWhiteSpace(Id) && checkUserSn.Id != Id))) + { + resultEntity.Result = false; + resultEntity.Message = "璇ユ。妗堝鎴峰凡缁忓瓨鍦�"; + + } + var checkUserSncooper = _context.CooperatecustomCustomers.Where(r => r.RecStatus == "A" && r.Name == Name).FirstOrDefault(); + if (checkUserSncooper != null && (string.IsNullOrWhiteSpace(Id) || (!string.IsNullOrWhiteSpace(Id) && checkUserSncooper.Id != Id))) + { + resultEntity.Result = false; + resultEntity.Message = "璇ュ悎浣滃鎴峰凡缁忓瓨鍦�"; + + } + + } + + + + return resultEntity; + } + } } diff --git a/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs b/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs index d9fdd47..c311230 100644 --- a/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs @@ -952,5 +952,20 @@ return View(); } + + /// <summary> + /// 鑾峰彇椤圭洰鏄惁宸茬粡褰曞叆 + /// </summary> + /// <param name="shengid">甯俰d</param> + /// <returns></returns> + [CheckLogin] + public string getTitle(string Name, string Id) + { + var quxian = _intentionCustomerService.GetZhengfuProjectDTOByTitle(Name,Id); + + return JsonConvert.SerializeObject(quxian); + + } + } } diff --git a/zhengcaioa/zhengcaioa/Timer/TimerGetShopUsersService.cs b/zhengcaioa/zhengcaioa/Timer/TimerGetShopUsersService.cs index 259a77a..e97f527 100644 --- a/zhengcaioa/zhengcaioa/Timer/TimerGetShopUsersService.cs +++ b/zhengcaioa/zhengcaioa/Timer/TimerGetShopUsersService.cs @@ -55,18 +55,20 @@ //stoppingToken.Register(() => File.Create($"E:\\dotnetCore\\Practice\\Practice\\{DateTime.Now.Millisecond}.txt")); DateTime datenow = DateTime.Now; - DateTime datenowfasongxiaoxi = DateTime.Now; + DateTime datenowfasongxiaoxi = DateTime.Now.Date; while (!stoppingToken.IsCancellationRequested) { _logger.LogInformation("TimerGetShopUsersService 寮�濮嬫墽琛�"); _logger.LogInformation(datenow.ToString("yyyy-MM-dd HH:mm:ss")); - if (datenowfasongxiaoxi.Day == DateTime.Now.Day && DateTime.Now.Hour == 12) + _logger.LogInformation("datenowfasongxiaoxi.Day锛�" + datenowfasongxiaoxi.ToString("yyyy-MM-dd HH:mm:ss")); + _logger.LogInformation("DateTime.Now.Hour锛�" + DateTime.Now.Hour); + if (datenowfasongxiaoxi <= DateTime.Now.Date && DateTime.Now.Hour == 12) //if (true) { - + _logger.LogInformation("datenowfasongxiaoxi.Day" + datenowfasongxiaoxi.ToString("yyyy-MM-dd HH:mm:ss")); try { - datenowfasongxiaoxi.AddDays(1); + datenowfasongxiaoxi = DateTime.Now.Date.AddDays(1); this.fasongxiaoxi(); } @@ -112,6 +114,11 @@ //鏌ヨ骞朵笖鍙戦�佺煭淇″拰app娑堟伅缁欏鎴� public void fasongxiaoxi() { + string appkey = "BC-3ed0636563ff4f0f96d6fab0c150e940"; + string huawei = "IM"; + string oppo = "IM"; + string xiaomi = "IM"; + string vivo = "1"; var startdate = DateTime.Now.AddMonths(-3); var projects =_context.Projects.Where(x => x.RecStatus == "A" && x.StartTime >= startdate).ToList(); @@ -528,10 +535,10 @@ projectfasongxiaoxiDTO1.Ywjl = cooperatecustomCustomer.Ywjl; projectfasongxiaoxiDTO1.KhId = cooperatecustomCustomer.Id; projectfasongxiaoxiDTO1.HuiyuanId = cooperatecustomCustomer.HuiyuanId; - projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); + //projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); //鏌ヨ璇ヤ紒涓氫笅鐨勫叾浠栦汉鍛� - var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == cooperatecustomCustomer.Id && x.Huiyuanid != cooperatecustomCustomer.HuiyuanId).ToList(); + var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == cooperatecustomCustomer.Id ).ToList(); if (customerGuanlianhuiyuansqita != null && customerGuanlianhuiyuansqita.Count > 0) { var huiyuanids = new List<Guid>(); @@ -577,10 +584,10 @@ projectfasongxiaoxiDTO1.Ywjl = intentionCustomer.Ywjl; projectfasongxiaoxiDTO1.KhId = intentionCustomer.Id; projectfasongxiaoxiDTO1.HuiyuanId = intentionCustomer.HuiyuanId; - projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); + //projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); //鏌ヨ璇ヤ紒涓氫笅鐨勫叾浠栦汉鍛� - var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == intentionCustomer.Id && x.Huiyuanid != intentionCustomer.HuiyuanId).ToList(); + var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == intentionCustomer.Id ).ToList(); if (customerGuanlianhuiyuansqita != null && customerGuanlianhuiyuansqita.Count > 0) { var huiyuanids = new List<Guid>(); @@ -753,173 +760,247 @@ //鎺ㄩ�丄pp foreach (var ywjl in Ywjl) { - - var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id && x.Tel != null && x.Tel.StartsWith("1")).ToList(); - int j = 0; - while (j * 1000 <= projectfasongxiaoxisywjl.Count) + var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id).ToList(); + for (int i = 0; i < projectfasongxiaoxisywjl.Count; i++) { - j = j + 1; - string numberstring = ""; - string customename = ""; - if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) - { - int countt = (j * 1000); - if (countt > projectfasongxiaoxisywjl.Count) - { - countt = projectfasongxiaoxisywjl.Count; - } - - for (int i = 0; i < countt; i++) - { - if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) - { - continue; - } - numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; - customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; - - } - } - - if (numberstring.EndsWith(",")) - { - numberstring = numberstring.Substring(0, numberstring.Length - 1); - } - if (string.IsNullOrEmpty(numberstring)) - { - continue; - } string conment = "{" - + "\"title\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔"," - + "\"content\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔★紝鐢�3浣嶉��浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ユ爣涔︼紝鏉滅粷搴熸爣 銆佸府鍔╂偍寰楀埌鍏ㄩ儴缁煎悎璇勫寰楀垎锛岀粡鏀块噰鍜ㄨ鍏徃妫�鏌ヨ繃鐨勬爣涔︼紝涓嶅彲鑳借搴熸爣锛岃鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," - + "\"getui_alias\": [" + numberstring + "]," - + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔★紝鐢�3浣嶉��浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ユ爣涔︼紝鏉滅粷搴熸爣 銆佸府鍔╂偍寰楀埌鍏ㄩ儴缁煎悎璇勫寰楀垎锛岀粡鏀块噰鍜ㄨ鍏徃妫�鏌ヨ繃鐨勬爣涔︼紝涓嶅彲鑳借搴熸爣锛岃鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"}," - + "\"force_notification\": true" - + "}"; + + "\"appkey\": \"" + appkey + "\"," + + "\"senderId\": \"" + ywjl.UserSn + "\"," + + "\"senderData\": { \"avatar\": \"\",\"name\": \""+ ywjl.UserName + "\"}," + + "\"to\": { \"type\": \"private\",\"id\": \"" + projectfasongxiaoxisywjl[i].HuiyuanId + "\",\"data\": { \"avatar\": \"\",\"name\": \"\"}}," + + "\"type\": \"text\"," + + "\"payload\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔★紝鐢�3浣嶉��浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ユ爣涔︼紝鏉滅粷搴熸爣 銆佸府鍔╂偍寰楀埌鍏ㄩ儴缁煎悎璇勫寰楀垎锛岀粡鏀块噰鍜ㄨ鍏徃妫�鏌ヨ繃鐨勬爣涔︼紝涓嶅彲鑳借搴熸爣锛岃鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," + + "\"notification\": { \"title\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔� \",\"body\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔� \"," + + "\"vendorOptions\": {\"huawei\": {\"category\": \"" + huawei + "\"},\"oppo\": {\"channel_id\": \"" + oppo + "\"},\"xiaomi\": {\"channel_id\": \"" + xiaomi + "\"},\"vivo\": {\"classification\":"+ vivo + "}}" + + "}" + + "}"; - string result2 = SMSHelper.PushApp(conment); + string result2 = SMSHelper.PushAppduandu(conment); _logger.LogInformation("result2:" + result2); JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); - if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "200") { - var isOK = jobjectresult["isOK"].ToString(); + var projectfasongxiaoxi = new Projectfasongxiaoxi(); + projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + projectfasongxiaoxi.ProjectId = projectfasongxiaoxisywjl[i].ProjectId; + projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; + projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; + projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; + projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; + projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; + projectfasongxiaoxi.RecStatus = "A"; + projectfasongxiaoxi.Createtime = DateTime.Now; + _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) - { - if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) - { - var projectfasongxiaoxi = new Projectfasongxiaoxi(); - projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); - projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; - projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; - projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; - projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; - projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; - projectfasongxiaoxi.RecStatus = "A"; - projectfasongxiaoxi.Createtime = DateTime.Now; - _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - } - } - _context.SaveChanges(); } + _context.SaveChanges(); + _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + projectfasongxiaoxisywjl[i].Khname); - - - _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + customename); } + //var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id && x.Tel != null && x.Tel.StartsWith("1")).ToList(); + //int j = 0; + //while (j * 1000 <= projectfasongxiaoxisywjl.Count) + //{ + // j = j + 1; + // string numberstring = ""; + // string customename = ""; + // if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) + // { + // int countt = (j * 1000); + // if (countt > projectfasongxiaoxisywjl.Count) + // { + // countt = projectfasongxiaoxisywjl.Count; + // } + + // for (int i = 0; i < countt; i++) + // { + // if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) + // { + // continue; + // } + // numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; + // customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; + + // } + // } + + // if (numberstring.EndsWith(",")) + // { + // numberstring = numberstring.Substring(0, numberstring.Length - 1); + // } + // if (string.IsNullOrEmpty(numberstring)) + // { + // continue; + // } + // string conment = "{" + // + "\"title\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔"," + // + "\"content\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔★紝鐢�3浣嶉��浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ユ爣涔︼紝鏉滅粷搴熸爣 銆佸府鍔╂偍寰楀埌鍏ㄩ儴缁煎悎璇勫寰楀垎锛岀粡鏀块噰鍜ㄨ鍏徃妫�鏌ヨ繃鐨勬爣涔︼紝涓嶅彲鑳借搴熸爣锛岃鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," + // + "\"getui_alias\": [" + numberstring + "]," + // + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔★紝鐢�3浣嶉��浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ユ爣涔︼紝鏉滅粷搴熸爣 銆佸府鍔╂偍寰楀埌鍏ㄩ儴缁煎悎璇勫寰楀垎锛岀粡鏀块噰鍜ㄨ鍏徃妫�鏌ヨ繃鐨勬爣涔︼紝涓嶅彲鑳借搴熸爣锛岃鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"}," + // + "\"force_notification\": true" + // + "}"; + + // string result2 = SMSHelper.PushApp(conment); + // _logger.LogInformation("result2:" + result2); + // JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); + + // if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + // { + // var isOK = jobjectresult["isOK"].ToString(); + + // foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) + // { + // if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) + // { + // var projectfasongxiaoxi = new Projectfasongxiaoxi(); + // projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + // projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; + // projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; + // projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; + // projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; + // projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; + // projectfasongxiaoxi.RecStatus = "A"; + // projectfasongxiaoxi.Createtime = DateTime.Now; + // _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); + // } + // } + // _context.SaveChanges(); + // } + + // _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + customename); + //} } //涓氬姟缁忕悊涓虹┖ if (true) { - var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null && x.Tel != null && x.Tel.StartsWith("1")).ToList(); - int j = 0; - while (j * 1000 <= projectfasongxiaoxisywjl.Count) + var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null).ToList(); + for (int i = 0; i < projectfasongxiaoxisywjl.Count; i++) { - j = j + 1; - string numberstring = ""; - string customename = ""; - if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) - { - int countt = (j * 1000); - if (countt > projectfasongxiaoxisywjl.Count) - { - countt = projectfasongxiaoxisywjl.Count; - } - for (int i = 0; i < countt; i++) - { - if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) - { - continue; - } - numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; - customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; - - } - } - - if (numberstring.EndsWith(",")) - { - numberstring = numberstring.Substring(0, numberstring.Length - 1); - } - if (string.IsNullOrEmpty(numberstring)) - { - continue; - } string conment = "{" - + "\"title\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔"," - + "\"content\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔★紝鐢�3浣嶉��浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ユ爣涔︼紝鏉滅粷搴熸爣 銆佸府鍔╂偍寰楀埌鍏ㄩ儴缁煎悎璇勫寰楀垎锛岀粡鏀块噰鍜ㄨ鍏徃妫�鏌ヨ繃鐨勬爣涔︼紝涓嶅彲鑳借搴熸爣锛岃鎯呰鍜ㄨ锛�400-028-8080 \"," - + "\"getui_alias\": [" + numberstring + "]," - + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔★紝鐢�3浣嶉��浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ユ爣涔︼紝鏉滅粷搴熸爣 銆佸府鍔╂偍寰楀埌鍏ㄩ儴缁煎悎璇勫寰楀垎锛岀粡鏀块噰鍜ㄨ鍏徃妫�鏌ヨ繃鐨勬爣涔︼紝涓嶅彲鑳借搴熸爣锛岃鎯呰鍜ㄨ锛�400-028-8080 \"}," - + "\"force_notification\": true" - + "}"; + + "\"appkey\": \"" + appkey + "\"," + + "\"senderId\": \"kehujingli\"," + + "\"senderData\": { \"avatar\": \"\",\"name\": \"瀹㈡埛缁忕悊\"}," + + "\"to\": { \"type\": \"private\",\"id\": \"" + projectfasongxiaoxisywjl[i].HuiyuanId + "\",\"data\": { \"avatar\": \"\",\"name\": \"\"}}," + + "\"type\": \"text\"," + + "\"payload\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔★紝鐢�3浣嶉��浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ユ爣涔︼紝鏉滅粷搴熸爣 銆佸府鍔╂偍寰楀埌鍏ㄩ儴缁煎悎璇勫寰楀垎锛岀粡鏀块噰鍜ㄨ鍏徃妫�鏌ヨ繃鐨勬爣涔︼紝涓嶅彲鑳借搴熸爣锛岃鎯呰鍜ㄨ锛�400-028-8080 \"," + + "\"notification\": { \"title\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔� \",\"body\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔� \"," + + "\"vendorOptions\": {\"huawei\": {\"category\": \"" + huawei + "\"},\"oppo\": {\"channel_id\": \"" + oppo + "\"},\"xiaomi\": {\"channel_id\": \"" + xiaomi + "\"},\"vivo\": {\"classification\":" + vivo + "}}" + + "}" + + "}"; - string result2 = SMSHelper.PushApp(conment); + string result2 = SMSHelper.PushAppduandu(conment); _logger.LogInformation("result2:" + result2); JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); - if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "200") { - var isOK = jobjectresult["isOK"].ToString(); + var projectfasongxiaoxi = new Projectfasongxiaoxi(); + projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + projectfasongxiaoxi.ProjectId = projectfasongxiaoxisywjl[i].ProjectId; + projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; + projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; + projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; + projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; + projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; + projectfasongxiaoxi.RecStatus = "A"; + projectfasongxiaoxi.Createtime = DateTime.Now; + _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) - { - if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) - { - var projectfasongxiaoxi = new Projectfasongxiaoxi(); - projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); - projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; - projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; - projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; - projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; - projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; - projectfasongxiaoxi.RecStatus = "A"; - projectfasongxiaoxi.Createtime = DateTime.Now; - _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - } - } - _context.SaveChanges(); } + _context.SaveChanges(); + _logger.LogInformation("鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴锋帹閫乤pp缁欏鎴�" + projectfasongxiaoxisywjl[i].Khname); - - - _logger.LogInformation("鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴�" + customename); } + + //var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null && x.Tel != null && x.Tel.StartsWith("1")).ToList(); + //int j = 0; + //while (j * 1000 <= projectfasongxiaoxisywjl.Count) + //{ + // j = j + 1; + // string numberstring = ""; + // string customename = ""; + // if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) + // { + // int countt = (j * 1000); + // if (countt > projectfasongxiaoxisywjl.Count) + // { + // countt = projectfasongxiaoxisywjl.Count; + // } + // for (int i = 0; i < countt; i++) + // { + // if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) + // { + // continue; + // } + // numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; + // customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; + + // } + // } + + // if (numberstring.EndsWith(",")) + // { + // numberstring = numberstring.Substring(0, numberstring.Length - 1); + // } + // if (string.IsNullOrEmpty(numberstring)) + // { + // continue; + // } + // string conment = "{" + // + "\"title\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔"," + // + "\"content\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔★紝鐢�3浣嶉��浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ユ爣涔︼紝鏉滅粷搴熸爣 銆佸府鍔╂偍寰楀埌鍏ㄩ儴缁煎悎璇勫寰楀垎锛岀粡鏀块噰鍜ㄨ鍏徃妫�鏌ヨ繃鐨勬爣涔︼紝涓嶅彲鑳借搴熸爣锛岃鎯呰鍜ㄨ锛�400-028-8080 \"," + // + "\"getui_alias\": [" + numberstring + "]," + // + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃鐨勨�滄爣涔﹂璇勫鈥濇湇鍔★紝鐢�3浣嶉��浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ユ爣涔︼紝鏉滅粷搴熸爣 銆佸府鍔╂偍寰楀埌鍏ㄩ儴缁煎悎璇勫寰楀垎锛岀粡鏀块噰鍜ㄨ鍏徃妫�鏌ヨ繃鐨勬爣涔︼紝涓嶅彲鑳借搴熸爣锛岃鎯呰鍜ㄨ锛�400-028-8080 \"}," + // + "\"force_notification\": true" + // + "}"; + + // string result2 = SMSHelper.PushApp(conment); + // _logger.LogInformation("result2:" + result2); + // JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); + + // if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + // { + // var isOK = jobjectresult["isOK"].ToString(); + + // foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) + // { + // if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) + // { + // var projectfasongxiaoxi = new Projectfasongxiaoxi(); + // projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + // projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; + // projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; + // projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; + // projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; + // projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; + // projectfasongxiaoxi.RecStatus = "A"; + // projectfasongxiaoxi.Createtime = DateTime.Now; + // _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); + // } + // } + // _context.SaveChanges(); + // } + + + + // _logger.LogInformation("鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴�" + customename); + //} } - - + + } catch (Exception ex) @@ -989,7 +1070,7 @@ projectfasongxiaoxiDTO.Xiaoxizhonglei = "app"; projectfasongxiaoxiDTO.Gyszl = "2"; projectfasongxiaoxiDTO.Khname = project1.Drhx; - projectfasongxiaoxiDTO.RecStatus = project1.Drhx; + projectfasongxiaoxiDTO.RecStatus = "A"; projectfasongxiaoxiDTO.Createtime = DateTime.Now; projectfasongxiaoxiDTO.Projectname = project1.Name; projectfasongxiaoxiDTOsapp.Add(projectfasongxiaoxiDTO); @@ -1015,8 +1096,8 @@ projectfasongxiaoxiDTO.Xiaoxileixing = "2"; projectfasongxiaoxiDTO.Xiaoxizhonglei = "duanxin"; projectfasongxiaoxiDTO.Gyszl = "3"; - projectfasongxiaoxiDTO.Khname = project1.Drhx; - projectfasongxiaoxiDTO.RecStatus = project1.Drhx; + projectfasongxiaoxiDTO.Khname = project1.Dshx; + projectfasongxiaoxiDTO.RecStatus = "A"; projectfasongxiaoxiDTO.Createtime = DateTime.Now; projectfasongxiaoxiDTO.Projectname = project1.Name; projectfasongxiaoxiDTOsduanxin.Add(projectfasongxiaoxiDTO); @@ -1034,7 +1115,7 @@ projectfasongxiaoxiDTO.Xiaoxileixing = "2"; projectfasongxiaoxiDTO.Xiaoxizhonglei = "app"; projectfasongxiaoxiDTO.Gyszl = "3"; - projectfasongxiaoxiDTO.Khname = project1.Drhx; + projectfasongxiaoxiDTO.Khname = project1.Dshx; projectfasongxiaoxiDTO.RecStatus = "A"; projectfasongxiaoxiDTO.Createtime = DateTime.Now; projectfasongxiaoxiDTO.Projectname = project1.Name; @@ -1181,10 +1262,10 @@ projectfasongxiaoxiDTO1.Ywjl = cooperatecustomCustomer.Ywjl; projectfasongxiaoxiDTO1.KhId = cooperatecustomCustomer.Id; projectfasongxiaoxiDTO1.HuiyuanId = cooperatecustomCustomer.HuiyuanId; - projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); + //projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); //鏌ヨ璇ヤ紒涓氫笅鐨勫叾浠栦汉鍛� - var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == cooperatecustomCustomer.Id && x.Huiyuanid != cooperatecustomCustomer.HuiyuanId).ToList(); + var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == cooperatecustomCustomer.Id).ToList(); if (customerGuanlianhuiyuansqita != null && customerGuanlianhuiyuansqita.Count > 0) { var huiyuanids = new List<Guid>(); @@ -1230,10 +1311,10 @@ projectfasongxiaoxiDTO1.Ywjl = intentionCustomer.Ywjl; projectfasongxiaoxiDTO1.KhId = intentionCustomer.Id; projectfasongxiaoxiDTO1.HuiyuanId = intentionCustomer.HuiyuanId; - projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); + //projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); //鏌ヨ璇ヤ紒涓氫笅鐨勫叾浠栦汉鍛� - var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == intentionCustomer.Id && x.Huiyuanid != intentionCustomer.HuiyuanId).ToList(); + var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == intentionCustomer.Id).ToList(); if (customerGuanlianhuiyuansqita != null && customerGuanlianhuiyuansqita.Count > 0) { var huiyuanids = new List<Guid>(); @@ -1405,90 +1486,165 @@ //鎺ㄩ�丄pp foreach (var ywjl in Ywjl) { - - var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id && x.Tel != null && x.Tel.StartsWith("1")).ToList(); - - + var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id).ToList(); for (int i = 0; i < projectfasongxiaoxisywjl.Count; i++) { string conment = "{" - + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒"," - + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛屽鏋滄偍鍦ㄥ弬鍔犫��" + projectfasongxiaoxisywjl[i].Projectname + "鈥濇姇鏍囧墠鎵炬斂閲囧挩璇㈡鏌ユ爣涔︼紝鑷冲皯鎻愬崌璇勫寰楀垎5-8鍒嗭紝涔熻涓爣鐨勫氨鏄吹鍏徃銆備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," - + "\"getui_alias\": \"" + projectfasongxiaoxisywjl[i].Tel + "\"," - + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛屽鏋滄偍鍦ㄥ弬鍔犫��" + projectfasongxiaoxisywjl[i].Projectname + "鈥濇姇鏍囧墠鎵炬斂閲囧挩璇㈡鏌ユ爣涔︼紝鑷冲皯鎻愬崌璇勫寰楀垎5-8鍒嗭紝涔熻涓爣鐨勫氨鏄吹鍏徃銆備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"}," - + "\"force_notification\": true" + + "\"appkey\": \"" + appkey + "\"," + + "\"senderId\": \"" + ywjl.UserSn + "\"," + + "\"senderData\": { \"avatar\": \"\",\"name\": \"" + ywjl.UserName + "\"}," + + "\"to\": { \"type\": \"private\",\"id\": \"" + projectfasongxiaoxisywjl[i].HuiyuanId + "\",\"data\": { \"avatar\": \"\",\"name\": \"\"}}," + + "\"type\": \"text\"," + + "\"payload\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛屽鏋滄偍鍦ㄥ弬鍔犫��" + projectfasongxiaoxisywjl[i].Projectname + "鈥濇姇鏍囧墠鎵炬斂閲囧挩璇㈡鏌ユ爣涔︼紝鑷冲皯鎻愬崌璇勫寰楀垎5-8鍒嗭紝涔熻涓爣鐨勫氨鏄吹鍏徃銆備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," + + "\"notification\": { \"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�� \",\"body\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�� \"," + + "\"vendorOptions\": {\"huawei\": {\"category\": \"" + huawei + "\"},\"oppo\": {\"channel_id\": \"" + oppo + "\"},\"xiaomi\": {\"channel_id\": \"" + xiaomi + "\"},\"vivo\": {\"classification\":" + vivo + "}}" + + "}" + "}"; - string result2 = SMSHelper.PushApp(conment); + string result2 = SMSHelper.PushAppduandu(conment); _logger.LogInformation("result2:" + result2); JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); - if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "200") { - var isOK = jobjectresult["isOK"].ToString(); + var projectfasongxiaoxi = new Projectfasongxiaoxi(); + projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + projectfasongxiaoxi.ProjectId = projectfasongxiaoxisywjl[i].ProjectId; + projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; + projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; + projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; + projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; + projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; + projectfasongxiaoxi.RecStatus = "A"; + projectfasongxiaoxi.Createtime = DateTime.Now; + _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - - if (isOK.IndexOf(projectfasongxiaoxisywjl[i].Tel) >= 0) - { - var projectfasongxiaoxi = new Projectfasongxiaoxi(); - projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); - projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; - projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; - projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; - projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; - projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; - projectfasongxiaoxi.RecStatus = "A"; - projectfasongxiaoxi.Createtime = DateTime.Now; - _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - } } _context.SaveChanges(); _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + projectfasongxiaoxisywjl[i].Khname); } + //var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id && x.Tel != null && x.Tel.StartsWith("1")).ToList(); + + + //for (int i = 0; i < projectfasongxiaoxisywjl.Count; i++) + //{ + // string conment = "{" + //+ "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒"," + //+ "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛屽鏋滄偍鍦ㄥ弬鍔犫��" + projectfasongxiaoxisywjl[i].Projectname + "鈥濇姇鏍囧墠鎵炬斂閲囧挩璇㈡鏌ユ爣涔︼紝鑷冲皯鎻愬崌璇勫寰楀垎5-8鍒嗭紝涔熻涓爣鐨勫氨鏄吹鍏徃銆備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," + // + "\"getui_alias\": \"" + projectfasongxiaoxisywjl[i].Tel + "\"," + // + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛屽鏋滄偍鍦ㄥ弬鍔犫��" + projectfasongxiaoxisywjl[i].Projectname + "鈥濇姇鏍囧墠鎵炬斂閲囧挩璇㈡鏌ユ爣涔︼紝鑷冲皯鎻愬崌璇勫寰楀垎5-8鍒嗭紝涔熻涓爣鐨勫氨鏄吹鍏徃銆備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"}," + // + "\"force_notification\": true" + // + "}"; + + // string result2 = SMSHelper.PushApp(conment); + // _logger.LogInformation("result2:" + result2); + // JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); + + // if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + // { + // var isOK = jobjectresult["isOK"].ToString(); + + + // if (isOK.IndexOf(projectfasongxiaoxisywjl[i].Tel) >= 0) + // { + // var projectfasongxiaoxi = new Projectfasongxiaoxi(); + // projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + // projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; + // projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; + // projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; + // projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; + // projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; + // projectfasongxiaoxi.RecStatus = "A"; + // projectfasongxiaoxi.Createtime = DateTime.Now; + // _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); + // } + // } + // _context.SaveChanges(); + // _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + projectfasongxiaoxisywjl[i].Khname); + + //} } //涓氬姟缁忕悊涓虹┖ if (true) { - var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null && x.Tel != null && x.Tel.StartsWith("1")).ToList(); + var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null).ToList(); + for (int i = 0; i < projectfasongxiaoxisywjl.Count; i++) + { + string conment = "{" + + "\"appkey\": \"" + appkey + "\"," + + "\"senderId\": \"kehujingli\"," + + "\"senderData\": { \"avatar\": \"\",\"name\": \"瀹㈡埛缁忕悊\"}," + + "\"to\": { \"type\": \"private\",\"id\": \"" + projectfasongxiaoxisywjl[i].HuiyuanId + "\",\"data\": { \"avatar\": \"\",\"name\": \"\"}}," + + "\"type\": \"text\"," + + "\"payload\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛屽鏋滄偍鍦ㄥ弬鍔犫��" + projectfasongxiaoxisywjl[i].Projectname + "鈥濇姇鏍囧墠鎵炬斂閲囧挩璇㈡鏌ユ爣涔︼紝鑷冲皯鎻愬崌璇勫寰楀垎5-8鍒嗭紝涔熻涓爣鐨勫氨鏄吹鍏徃銆備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"," + + "\"notification\": { \"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�� \",\"body\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�� \"," + + "\"vendorOptions\": {\"huawei\": {\"category\": \"" + huawei + "\"},\"oppo\": {\"channel_id\": \"" + oppo + "\"},\"xiaomi\": {\"channel_id\": \"" + xiaomi + "\"},\"vivo\": {\"classification\":" + vivo + "}}" + + "}" + + "}"; - for (int i = 0; i < projectfasongxiaoxisywjl.Count; i++) + string result2 = SMSHelper.PushAppduandu(conment); + _logger.LogInformation("result2:" + result2); + JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); + + if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "200") { - string conment = "{" - + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒"," - + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛屽鏋滄偍鍦ㄥ弬鍔犫��" + projectfasongxiaoxisywjl[i].Projectname + "鈥濇姇鏍囧墠鎵炬斂閲囧挩璇㈡鏌ユ爣涔︼紝鑷冲皯鎻愬崌璇勫寰楀垎5-8鍒嗭紝涔熻涓爣鐨勫氨鏄吹鍏徃銆備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"," - + "\"getui_alias\": \"" + projectfasongxiaoxisywjl[i].Tel + "\"," - + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛屽鏋滄偍鍦ㄥ弬鍔犫��" + projectfasongxiaoxisywjl[i].Projectname + "鈥濇姇鏍囧墠鎵炬斂閲囧挩璇㈡鏌ユ爣涔︼紝鑷冲皯鎻愬崌璇勫寰楀垎5-8鍒嗭紝涔熻涓爣鐨勫氨鏄吹鍏徃銆備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"}," - + "\"force_notification\": true" - + "}"; - - string result2 = SMSHelper.PushApp(conment); - _logger.LogInformation("result2:" + result2); - JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); - - if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") - { - var isOK = jobjectresult["isOK"].ToString(); - - - if (isOK.IndexOf(projectfasongxiaoxisywjl[i].Tel) >= 0) - { - var projectfasongxiaoxi = new Projectfasongxiaoxi(); - projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); - projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; - projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; - projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; - projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; - projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; - projectfasongxiaoxi.RecStatus = "A"; - projectfasongxiaoxi.Createtime = DateTime.Now; - _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - } - } - _context.SaveChanges(); - _logger.LogInformation( "鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴�" + projectfasongxiaoxisywjl[i].Khname); + var projectfasongxiaoxi = new Projectfasongxiaoxi(); + projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + projectfasongxiaoxi.ProjectId = projectfasongxiaoxisywjl[i].ProjectId; + projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; + projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; + projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; + projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; + projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; + projectfasongxiaoxi.RecStatus = "A"; + projectfasongxiaoxi.Createtime = DateTime.Now; + _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); } + _context.SaveChanges(); + _logger.LogInformation("鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴锋帹閫乤pp缁欏鎴�" + projectfasongxiaoxisywjl[i].Khname); + + } + //var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null && x.Tel != null && x.Tel.StartsWith("1")).ToList(); + + // for (int i = 0; i < projectfasongxiaoxisywjl.Count; i++) + // { + // string conment = "{" + // + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒"," + // + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛屽鏋滄偍鍦ㄥ弬鍔犫��" + projectfasongxiaoxisywjl[i].Projectname + "鈥濇姇鏍囧墠鎵炬斂閲囧挩璇㈡鏌ユ爣涔︼紝鑷冲皯鎻愬崌璇勫寰楀垎5-8鍒嗭紝涔熻涓爣鐨勫氨鏄吹鍏徃銆備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"," + // + "\"getui_alias\": \"" + projectfasongxiaoxisywjl[i].Tel + "\"," + // + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛屽鏋滄偍鍦ㄥ弬鍔犫��" + projectfasongxiaoxisywjl[i].Projectname + "鈥濇姇鏍囧墠鎵炬斂閲囧挩璇㈡鏌ユ爣涔︼紝鑷冲皯鎻愬崌璇勫寰楀垎5-8鍒嗭紝涔熻涓爣鐨勫氨鏄吹鍏徃銆備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"}," + // + "\"force_notification\": true" + // + "}"; + + // string result2 = SMSHelper.PushApp(conment); + // _logger.LogInformation("result2:" + result2); + // JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); + + // if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + // { + // var isOK = jobjectresult["isOK"].ToString(); + + + // if (isOK.IndexOf(projectfasongxiaoxisywjl[i].Tel) >= 0) + // { + // var projectfasongxiaoxi = new Projectfasongxiaoxi(); + // projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + // projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; + // projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; + // projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; + // projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; + // projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; + // projectfasongxiaoxi.RecStatus = "A"; + // projectfasongxiaoxi.Createtime = DateTime.Now; + // _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); + // } + // } + // _context.SaveChanges(); + // _logger.LogInformation( "鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴�" + projectfasongxiaoxisywjl[i].Khname); + + // } } @@ -1709,10 +1865,10 @@ projectfasongxiaoxiDTO1.Ywjl = cooperatecustomCustomer.Ywjl; projectfasongxiaoxiDTO1.KhId = cooperatecustomCustomer.Id; projectfasongxiaoxiDTO1.HuiyuanId = cooperatecustomCustomer.HuiyuanId; - projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); + //projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); //鏌ヨ璇ヤ紒涓氫笅鐨勫叾浠栦汉鍛� - var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == cooperatecustomCustomer.Id && x.Huiyuanid != cooperatecustomCustomer.HuiyuanId).ToList(); + var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == cooperatecustomCustomer.Id).ToList(); if (customerGuanlianhuiyuansqita != null && customerGuanlianhuiyuansqita.Count > 0) { var huiyuanids = new List<Guid>(); @@ -1758,10 +1914,10 @@ projectfasongxiaoxiDTO1.Ywjl = intentionCustomer.Ywjl; projectfasongxiaoxiDTO1.KhId = intentionCustomer.Id; projectfasongxiaoxiDTO1.HuiyuanId = intentionCustomer.HuiyuanId; - projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); + //projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); //鏌ヨ璇ヤ紒涓氫笅鐨勫叾浠栦汉鍛� - var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == intentionCustomer.Id && x.Huiyuanid != intentionCustomer.HuiyuanId).ToList(); + var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == intentionCustomer.Id).ToList(); if (customerGuanlianhuiyuansqita != null && customerGuanlianhuiyuansqita.Count > 0) { var huiyuanids = new List<Guid>(); @@ -1934,162 +2090,238 @@ //鎺ㄩ�丄pp foreach (var ywjl in Ywjl) { - - var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id && x.Tel != null && x.Tel.StartsWith("1")).ToList(); - int j = 0; - while (j * 1000 <= projectfasongxiaoxisywjl.Count) + var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id).ToList(); + for (int i = 0; i < projectfasongxiaoxisywjl.Count; i++) { - j = j + 1; - string numberstring = ""; - string customename = ""; - if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) - { - int countt = (j * 1000); - if (countt > projectfasongxiaoxisywjl.Count) - { - countt = projectfasongxiaoxisywjl.Count; - } - - for (int i = 0; i < countt; i++) - { - if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) - { - continue; - } - numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; - customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; - - } - } - - if (numberstring.EndsWith(",")) - { - numberstring = numberstring.Substring(0, numberstring.Length - 1); - } - if (string.IsNullOrEmpty(numberstring)) - { - continue; - } string conment = "{" - + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒"," - + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛岃嚦灏戝姪鎮ㄦ彁鍗囩患鍚堣瘎瀹″緱鍒�5-10鍒嗐�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," - + "\"getui_alias\": [" + numberstring + "]," - + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛岃嚦灏戝姪鎮ㄦ彁鍗囩患鍚堣瘎瀹″緱鍒�5-10鍒嗐�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"}," - + "\"force_notification\": true" - + "}"; + + "\"appkey\": \"" + appkey + "\"," + + "\"senderId\": \"" + ywjl.UserSn + "\"," + + "\"senderData\": { \"avatar\": \"\",\"name\": \"" + ywjl.UserName + "\"}," + + "\"to\": { \"type\": \"private\",\"id\": \"" + projectfasongxiaoxisywjl[i].HuiyuanId + "\",\"data\": { \"avatar\": \"\",\"name\": \"\"}}," + + "\"type\": \"text\"," + + "\"payload\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛岃嚦灏戝姪鎮ㄦ彁鍗囩患鍚堣瘎瀹″緱鍒�5-10鍒嗐�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," + + "\"notification\": { \"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�� \",\"body\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�� \"," + + "\"vendorOptions\": {\"huawei\": {\"category\": \"" + huawei + "\"},\"oppo\": {\"channel_id\": \"" + oppo + "\"},\"xiaomi\": {\"channel_id\": \"" + xiaomi + "\"},\"vivo\": {\"classification\":" + vivo + "}}" + + "}" + + "}"; - string result2 = SMSHelper.PushApp(conment); + string result2 = SMSHelper.PushAppduandu(conment); _logger.LogInformation("result2:" + result2); JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); - if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "200") { - var isOK = jobjectresult["isOK"].ToString(); + var projectfasongxiaoxi = new Projectfasongxiaoxi(); + projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + projectfasongxiaoxi.ProjectId = projectfasongxiaoxisywjl[i].ProjectId; + projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; + projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; + projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; + projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; + projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; + projectfasongxiaoxi.RecStatus = "A"; + projectfasongxiaoxi.Createtime = DateTime.Now; + _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) - { - if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) - { - var projectfasongxiaoxi = new Projectfasongxiaoxi(); - projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); - projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; - projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; - projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; - projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; - projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; - projectfasongxiaoxi.RecStatus = "A"; - projectfasongxiaoxi.Createtime = DateTime.Now; - _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - } - } - _context.SaveChanges(); } + _context.SaveChanges(); + _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + projectfasongxiaoxisywjl[i].Khname); - - - _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + customename); } + //var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id && x.Tel != null && x.Tel.StartsWith("1")).ToList(); + //int j = 0; + //while (j * 1000 <= projectfasongxiaoxisywjl.Count) + //{ + // j = j + 1; + // string numberstring = ""; + // string customename = ""; + // if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) + // { + // int countt = (j * 1000); + // if (countt > projectfasongxiaoxisywjl.Count) + // { + // countt = projectfasongxiaoxisywjl.Count; + // } - + // for (int i = 0; i < countt; i++) + // { + // if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) + // { + // continue; + // } + // numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; + // customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; + + // } + // } + + // if (numberstring.EndsWith(",")) + // { + // numberstring = numberstring.Substring(0, numberstring.Length - 1); + // } + // if (string.IsNullOrEmpty(numberstring)) + // { + // continue; + // } + // string conment = "{" + // + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒"," + // + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛岃嚦灏戝姪鎮ㄦ彁鍗囩患鍚堣瘎瀹″緱鍒�5-10鍒嗐�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," + // + "\"getui_alias\": [" + numberstring + "]," + // + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛岃嚦灏戝姪鎮ㄦ彁鍗囩患鍚堣瘎瀹″緱鍒�5-10鍒嗐�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"}," + // + "\"force_notification\": true" + // + "}"; + + // string result2 = SMSHelper.PushApp(conment); + // _logger.LogInformation("result2:" + result2); + // JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); + + // if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + // { + // var isOK = jobjectresult["isOK"].ToString(); + + // foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) + // { + // if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) + // { + // var projectfasongxiaoxi = new Projectfasongxiaoxi(); + // projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + // projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; + // projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; + // projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; + // projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; + // projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; + // projectfasongxiaoxi.RecStatus = "A"; + // projectfasongxiaoxi.Createtime = DateTime.Now; + // _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); + // } + // } + // _context.SaveChanges(); + // } + + + + // _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + customename); + //} + + + } //涓氬姟缁忕悊涓虹┖ if (true) { - var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null && x.Tel != null && x.Tel.StartsWith("1")).ToList(); - int j = 0; - while (j * 1000 <= projectfasongxiaoxisywjl.Count) + var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null).ToList(); + for (int i = 0; i < projectfasongxiaoxisywjl.Count; i++) { - j = j + 1; - string numberstring = ""; - string customename = ""; - if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) - { - int countt = (j * 1000); - if (countt > projectfasongxiaoxisywjl.Count) - { - countt = projectfasongxiaoxisywjl.Count; - } - - for (int i = 0; i < countt; i++) - { - if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) - { - continue; - } - numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; - customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; - - } - } - - if (numberstring.EndsWith(",")) - { - numberstring = numberstring.Substring(0, numberstring.Length - 1); - } - if (string.IsNullOrEmpty(numberstring)) - { - continue; - } string conment = "{" - + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒"," - + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛岃嚦灏戝姪鎮ㄦ彁鍗囩患鍚堣瘎瀹″緱鍒�5-10鍒嗐�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"," - + "\"getui_alias\": [" + numberstring + "]," - + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛岃嚦灏戝姪鎮ㄦ彁鍗囩患鍚堣瘎瀹″緱鍒�5-10鍒嗐�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"}," - + "\"force_notification\": true" - + "}"; + + "\"appkey\": \"" + appkey + "\"," + + "\"senderId\": \"kehujingli\"," + + "\"senderData\": { \"avatar\": \"\",\"name\": \"瀹㈡埛缁忕悊\"}," + + "\"to\": { \"type\": \"private\",\"id\": \"" + projectfasongxiaoxisywjl[i].HuiyuanId + "\",\"data\": { \"avatar\": \"\",\"name\": \"\"}}," + + "\"type\": \"text\"," + + "\"payload\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛岃嚦灏戝姪鎮ㄦ彁鍗囩患鍚堣瘎瀹″緱鍒�5-10鍒嗐�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"," + + "\"notification\": { \"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�� \",\"body\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�� \"," + + "\"vendorOptions\": {\"huawei\": {\"category\": \"" + huawei + "\"},\"oppo\": {\"channel_id\": \"" + oppo + "\"},\"xiaomi\": {\"channel_id\": \"" + xiaomi + "\"},\"vivo\": {\"classification\":" + vivo + "}}" + + "}" + + "}"; - string result2 = SMSHelper.PushApp(conment); + string result2 = SMSHelper.PushAppduandu(conment); _logger.LogInformation("result2:" + result2); JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); - if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "200") { - var isOK = jobjectresult["isOK"].ToString(); + var projectfasongxiaoxi = new Projectfasongxiaoxi(); + projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + projectfasongxiaoxi.ProjectId = projectfasongxiaoxisywjl[i].ProjectId; + projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; + projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; + projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; + projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; + projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; + projectfasongxiaoxi.RecStatus = "A"; + projectfasongxiaoxi.Createtime = DateTime.Now; + _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) - { - if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) - { - var projectfasongxiaoxi = new Projectfasongxiaoxi(); - projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); - projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; - projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; - projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; - projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; - projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; - projectfasongxiaoxi.RecStatus = "A"; - projectfasongxiaoxi.Createtime = DateTime.Now; - _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - } - } - _context.SaveChanges(); } + _context.SaveChanges(); + _logger.LogInformation("鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴锋帹閫乤pp缁欏鎴�" + projectfasongxiaoxisywjl[i].Khname); - - - _logger.LogInformation( "鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴�" + customename); } + //var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null && x.Tel != null && x.Tel.StartsWith("1")).ToList(); + //int j = 0; + //while (j * 1000 <= projectfasongxiaoxisywjl.Count) + //{ + // j = j + 1; + // string numberstring = ""; + // string customename = ""; + // if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) + // { + // int countt = (j * 1000); + // if (countt > projectfasongxiaoxisywjl.Count) + // { + // countt = projectfasongxiaoxisywjl.Count; + // } + + // for (int i = 0; i < countt; i++) + // { + // if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) + // { + // continue; + // } + // numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; + // customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; + + // } + // } + + // if (numberstring.EndsWith(",")) + // { + // numberstring = numberstring.Substring(0, numberstring.Length - 1); + // } + // if (string.IsNullOrEmpty(numberstring)) + // { + // continue; + // } + // string conment = "{" + // + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒"," + // + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛岃嚦灏戝姪鎮ㄦ彁鍗囩患鍚堣瘎瀹″緱鍒�5-10鍒嗐�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"," + // + "\"getui_alias\": [" + numberstring + "]," + // + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╄瘎瀹′笓瀹舵壘涓嶅嚭涓昏鏂规鎵e垎鐞嗙敱锛岃嚦灏戝姪鎮ㄦ彁鍗囩患鍚堣瘎瀹″緱鍒�5-10鍒嗐�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"}," + // + "\"force_notification\": true" + // + "}"; + + // string result2 = SMSHelper.PushApp(conment); + // _logger.LogInformation("result2:" + result2); + // JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); + + // if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + // { + // var isOK = jobjectresult["isOK"].ToString(); + + // foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) + // { + // if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) + // { + // var projectfasongxiaoxi = new Projectfasongxiaoxi(); + // projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + // projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; + // projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; + // projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; + // projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; + // projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; + // projectfasongxiaoxi.RecStatus = "A"; + // projectfasongxiaoxi.Createtime = DateTime.Now; + // _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); + // } + // } + // _context.SaveChanges(); + // } + + + + // _logger.LogInformation( "鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴�" + customename); + //} } @@ -2303,10 +2535,10 @@ projectfasongxiaoxiDTO1.Ywjl = cooperatecustomCustomer.Ywjl; projectfasongxiaoxiDTO1.KhId = cooperatecustomCustomer.Id; projectfasongxiaoxiDTO1.HuiyuanId = cooperatecustomCustomer.HuiyuanId; - projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); + //projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); //鏌ヨ璇ヤ紒涓氫笅鐨勫叾浠栦汉鍛� - var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == cooperatecustomCustomer.Id && x.Huiyuanid != cooperatecustomCustomer.HuiyuanId).ToList(); + var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == cooperatecustomCustomer.Id).ToList(); if (customerGuanlianhuiyuansqita != null && customerGuanlianhuiyuansqita.Count > 0) { var huiyuanids = new List<Guid>(); @@ -2352,10 +2584,10 @@ projectfasongxiaoxiDTO1.Ywjl = intentionCustomer.Ywjl; projectfasongxiaoxiDTO1.KhId = intentionCustomer.Id; projectfasongxiaoxiDTO1.HuiyuanId = intentionCustomer.HuiyuanId; - projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); + //projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); //鏌ヨ璇ヤ紒涓氫笅鐨勫叾浠栦汉鍛� - var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == intentionCustomer.Id && x.Huiyuanid != intentionCustomer.HuiyuanId).ToList(); + var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == intentionCustomer.Id).ToList(); if (customerGuanlianhuiyuansqita != null && customerGuanlianhuiyuansqita.Count > 0) { var huiyuanids = new List<Guid>(); @@ -2528,81 +2760,119 @@ //鎺ㄩ�丄pp foreach (var ywjl in Ywjl) { - - var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id && x.Tel != null && x.Tel.StartsWith("1")).ToList(); - int j = 0; - while (j * 1000 <= projectfasongxiaoxisywjl.Count) + var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id).ToList(); + for (int i = 0; i < projectfasongxiaoxisywjl.Count; i++) { - j = j + 1; - string numberstring = ""; - string customename = ""; - if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) - { - int countt = (j * 1000); - if (countt > projectfasongxiaoxisywjl.Count) - { - countt = projectfasongxiaoxisywjl.Count; - } - - for (int i = 0; i < countt; i++) - { - if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) - { - continue; - } - numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; - customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; - - } - } - - if (numberstring.EndsWith(",")) - { - numberstring = numberstring.Substring(0, numberstring.Length - 1); - } - if (string.IsNullOrEmpty(numberstring)) - { - continue; - } string conment = "{" - + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒"," - + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╂偍寰楅綈鍏ㄩ儴瀹㈣鍒嗗拰涓昏鍒嗭紝浠庢涓嶅啀涓烘爣涔﹀埗浣滄搷蹇冦�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," - + "\"getui_alias\": [" + numberstring + "]," - + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╂偍寰楅綈鍏ㄩ儴瀹㈣鍒嗗拰涓昏鍒嗭紝浠庢涓嶅啀涓烘爣涔﹀埗浣滄搷蹇冦�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"}," - + "\"force_notification\": true" - + "}"; + + "\"appkey\": \"" + appkey + "\"," + + "\"senderId\": \"" + ywjl.UserSn + "\"," + + "\"senderData\": { \"avatar\": \"\",\"name\": \"" + ywjl.UserName + "\"}," + + "\"to\": { \"type\": \"private\",\"id\": \"" + projectfasongxiaoxisywjl[i].HuiyuanId + "\",\"data\": { \"avatar\": \"\",\"name\": \"\"}}," + + "\"type\": \"text\"," + + "\"payload\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╂偍寰楅綈鍏ㄩ儴瀹㈣鍒嗗拰涓昏鍒嗭紝浠庢涓嶅啀涓烘爣涔﹀埗浣滄搷蹇冦�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," + + "\"notification\": { \"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵� \",\"body\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵� \"," + + "\"vendorOptions\": {\"huawei\": {\"category\": \"" + huawei + "\"},\"oppo\": {\"channel_id\": \"" + oppo + "\"},\"xiaomi\": {\"channel_id\": \"" + xiaomi + "\"},\"vivo\": {\"classification\":" + vivo + "}}" + + "}" + + "}"; - string result2 = SMSHelper.PushApp(conment); + string result2 = SMSHelper.PushAppduandu(conment); _logger.LogInformation("result2:" + result2); JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); - if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "200") { - var isOK = jobjectresult["isOK"].ToString(); + var projectfasongxiaoxi = new Projectfasongxiaoxi(); + projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + projectfasongxiaoxi.ProjectId = projectfasongxiaoxisywjl[i].ProjectId; + projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; + projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; + projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; + projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; + projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; + projectfasongxiaoxi.RecStatus = "A"; + projectfasongxiaoxi.Createtime = DateTime.Now; + _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) - { - if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) - { - var projectfasongxiaoxi = new Projectfasongxiaoxi(); - projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); - projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; - projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; - projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; - projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; - projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; - projectfasongxiaoxi.RecStatus = "A"; - projectfasongxiaoxi.Createtime = DateTime.Now; - _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - } - } - _context.SaveChanges(); } + _context.SaveChanges(); + _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + projectfasongxiaoxisywjl[i].Khname); - - - _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + customename); } + + //var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id && x.Tel != null && x.Tel.StartsWith("1")).ToList(); + //int j = 0; + //while (j * 1000 <= projectfasongxiaoxisywjl.Count) + //{ + // j = j + 1; + // string numberstring = ""; + // string customename = ""; + // if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) + // { + // int countt = (j * 1000); + // if (countt > projectfasongxiaoxisywjl.Count) + // { + // countt = projectfasongxiaoxisywjl.Count; + // } + + // for (int i = 0; i < countt; i++) + // { + // if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) + // { + // continue; + // } + // numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; + // customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; + + // } + // } + + // if (numberstring.EndsWith(",")) + // { + // numberstring = numberstring.Substring(0, numberstring.Length - 1); + // } + // if (string.IsNullOrEmpty(numberstring)) + // { + // continue; + // } + // string conment = "{" + // + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒"," + // + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╂偍寰楅綈鍏ㄩ儴瀹㈣鍒嗗拰涓昏鍒嗭紝浠庢涓嶅啀涓烘爣涔﹀埗浣滄搷蹇冦�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," + // + "\"getui_alias\": [" + numberstring + "]," + // + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╂偍寰楅綈鍏ㄩ儴瀹㈣鍒嗗拰涓昏鍒嗭紝浠庢涓嶅啀涓烘爣涔﹀埗浣滄搷蹇冦�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"}," + // + "\"force_notification\": true" + // + "}"; + + // string result2 = SMSHelper.PushApp(conment); + // _logger.LogInformation("result2:" + result2); + // JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); + + // if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + // { + // var isOK = jobjectresult["isOK"].ToString(); + + // foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) + // { + // if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) + // { + // var projectfasongxiaoxi = new Projectfasongxiaoxi(); + // projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + // projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; + // projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; + // projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; + // projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; + // projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; + // projectfasongxiaoxi.RecStatus = "A"; + // projectfasongxiaoxi.Createtime = DateTime.Now; + // _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); + // } + // } + // _context.SaveChanges(); + // } + + + + // _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + customename); + //} @@ -2610,80 +2880,119 @@ //涓氬姟缁忕悊涓虹┖ if (true) { - var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null && x.Tel != null && x.Tel.StartsWith("1")).ToList(); - int j = 0; - while (j * 1000 <= projectfasongxiaoxisywjl.Count) + var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null).ToList(); + for (int i = 0; i < projectfasongxiaoxisywjl.Count; i++) { - j = j + 1; - string numberstring = ""; - string customename = ""; - if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) - { - int countt = (j * 1000); - if (countt > projectfasongxiaoxisywjl.Count) - { - countt = projectfasongxiaoxisywjl.Count; - } - - for (int i = 0; i < countt; i++) - { - if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) - { - continue; - } - numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; - customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; - - } - } - - if (numberstring.EndsWith(",")) - { - numberstring = numberstring.Substring(0, numberstring.Length - 1); - } - if (string.IsNullOrEmpty(numberstring)) - { - continue; - } string conment = "{" - + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒"," - + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╂偍寰楅綈鍏ㄩ儴瀹㈣鍒嗗拰涓昏鍒嗭紝浠庢涓嶅啀涓烘爣涔﹀埗浣滄搷蹇冦�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"," - + "\"getui_alias\": [" + numberstring + "]," - + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╂偍寰楅綈鍏ㄩ儴瀹㈣鍒嗗拰涓昏鍒嗭紝浠庢涓嶅啀涓烘爣涔﹀埗浣滄搷蹇冦�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"}," - + "\"force_notification\": true" - + "}"; + + "\"appkey\": \"" + appkey + "\"," + + "\"senderId\": \"kehujingli\"," + + "\"senderData\": { \"avatar\": \"\",\"name\": \"瀹㈡埛缁忕悊\"}," + + "\"to\": { \"type\": \"private\",\"id\": \"" + projectfasongxiaoxisywjl[i].HuiyuanId + "\",\"data\": { \"avatar\": \"\",\"name\": \"\"}}," + + "\"type\": \"text\"," + + "\"payload\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╂偍寰楅綈鍏ㄩ儴瀹㈣鍒嗗拰涓昏鍒嗭紝浠庢涓嶅啀涓烘爣涔﹀埗浣滄搷蹇冦�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"," + + "\"notification\": { \"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒",\"body\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒"," + + "\"vendorOptions\": {\"huawei\": {\"category\": \"" + huawei + "\"},\"oppo\": {\"channel_id\": \"" + oppo + "\"},\"xiaomi\": {\"channel_id\": \"" + xiaomi + "\"},\"vivo\": {\"classification\":" + vivo + "}}" + + "}" + + "}"; - string result2 = SMSHelper.PushApp(conment); + string result2 = SMSHelper.PushAppduandu(conment); _logger.LogInformation("result2:" + result2); JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); - if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "200") { - var isOK = jobjectresult["isOK"].ToString(); + var projectfasongxiaoxi = new Projectfasongxiaoxi(); + projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + projectfasongxiaoxi.ProjectId = projectfasongxiaoxisywjl[i].ProjectId; + projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; + projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; + projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; + projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; + projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; + projectfasongxiaoxi.RecStatus = "A"; + projectfasongxiaoxi.Createtime = DateTime.Now; + _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) - { - if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) - { - var projectfasongxiaoxi = new Projectfasongxiaoxi(); - projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); - projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; - projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; - projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; - projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; - projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; - projectfasongxiaoxi.RecStatus = "A"; - projectfasongxiaoxi.Createtime = DateTime.Now; - _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - } - } - _context.SaveChanges(); } + _context.SaveChanges(); + _logger.LogInformation("鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴锋帹閫乤pp缁欏鎴�" + projectfasongxiaoxisywjl[i].Khname); - - - _logger.LogInformation("鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴�" + customename); } + + //var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null && x.Tel != null && x.Tel.StartsWith("1")).ToList(); + //int j = 0; + //while (j * 1000 <= projectfasongxiaoxisywjl.Count) + //{ + // j = j + 1; + // string numberstring = ""; + // string customename = ""; + // if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) + // { + // int countt = (j * 1000); + // if (countt > projectfasongxiaoxisywjl.Count) + // { + // countt = projectfasongxiaoxisywjl.Count; + // } + + // for (int i = 0; i < countt; i++) + // { + // if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) + // { + // continue; + // } + // numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; + // customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; + + // } + // } + + // if (numberstring.EndsWith(",")) + // { + // numberstring = numberstring.Substring(0, numberstring.Length - 1); + // } + // if (string.IsNullOrEmpty(numberstring)) + // { + // continue; + // } + // string conment = "{" + // + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�漒"," + // + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╂偍寰楅綈鍏ㄩ儴瀹㈣鍒嗗拰涓昏鍒嗭紝浠庢涓嶅啀涓烘爣涔﹀埗浣滄搷蹇冦�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"," + // + "\"getui_alias\": [" + numberstring + "]," + // + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟鈥滄爣涔︽鏌モ�濄�佲�滄爣涔︽寚瀵尖�濓紝閫�浼戣祫娣辫瘎瀹′笓瀹跺湪寮�鏍囧墠鎸夌収璇勬爣娴佺▼涓烘偍浜ゅ弶妫�鏌ャ�佹寚瀵兼爣涔︼紝璁╂偍寰楅綈鍏ㄩ儴瀹㈣鍒嗗拰涓昏鍒嗭紝浠庢涓嶅啀涓烘爣涔﹀埗浣滄搷蹇冦�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"}," + // + "\"force_notification\": true" + // + "}"; + + // string result2 = SMSHelper.PushApp(conment); + // _logger.LogInformation("result2:" + result2); + // JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); + + // if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + // { + // var isOK = jobjectresult["isOK"].ToString(); + + // foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) + // { + // if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) + // { + // var projectfasongxiaoxi = new Projectfasongxiaoxi(); + // projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + // projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; + // projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; + // projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; + // projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; + // projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; + // projectfasongxiaoxi.RecStatus = "A"; + // projectfasongxiaoxi.Createtime = DateTime.Now; + // _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); + // } + // } + // _context.SaveChanges(); + // } + + + + // _logger.LogInformation("鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴�" + customename); + //} } @@ -3269,10 +3578,10 @@ projectfasongxiaoxiDTO1.Ywjl = cooperatecustomCustomer.Ywjl; projectfasongxiaoxiDTO1.KhId = cooperatecustomCustomer.Id; projectfasongxiaoxiDTO1.HuiyuanId = cooperatecustomCustomer.HuiyuanId; - projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); + //projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); //鏌ヨ璇ヤ紒涓氫笅鐨勫叾浠栦汉鍛� - var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == cooperatecustomCustomer.Id && x.Huiyuanid != cooperatecustomCustomer.HuiyuanId).ToList(); + var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == cooperatecustomCustomer.Id).ToList(); if (customerGuanlianhuiyuansqita != null && customerGuanlianhuiyuansqita.Count > 0) { var huiyuanids = new List<Guid>(); @@ -3318,10 +3627,10 @@ projectfasongxiaoxiDTO1.Ywjl = intentionCustomer.Ywjl; projectfasongxiaoxiDTO1.KhId = intentionCustomer.Id; projectfasongxiaoxiDTO1.HuiyuanId = intentionCustomer.HuiyuanId; - projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); + //projectfasongxiaoxiDTOsappzuizhong.Add(projectfasongxiaoxiDTO1); //鏌ヨ璇ヤ紒涓氫笅鐨勫叾浠栦汉鍛� - var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == intentionCustomer.Id && x.Huiyuanid != intentionCustomer.HuiyuanId).ToList(); + var customerGuanlianhuiyuansqita = customerGuanlianhuiyuans.Where(x => x.Customerid == intentionCustomer.Id).ToList(); if (customerGuanlianhuiyuansqita != null && customerGuanlianhuiyuansqita.Count > 0) { var huiyuanids = new List<Guid>(); @@ -3489,81 +3798,119 @@ //鎺ㄩ�丄pp foreach (var ywjl in Ywjl) { - - var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id && x.Tel != null && x.Tel.StartsWith("1")).ToList(); - int j = 0; - while (j * 1000 <= projectfasongxiaoxisywjl.Count) + var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id).ToList(); + for (int i = 0; i < projectfasongxiaoxisywjl.Count; i++) { - j = j + 1; - string numberstring = ""; - string customename = ""; - if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) - { - int countt = (j * 1000); - if (countt > projectfasongxiaoxisywjl.Count) - { - countt = projectfasongxiaoxisywjl.Count; - } - - for (int i = 0; i < countt; i++) - { - if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) - { - continue; - } - numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; - customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; - - } - } - - if (numberstring.EndsWith(",")) - { - numberstring = numberstring.Substring(0, numberstring.Length - 1); - } - if (string.IsNullOrEmpty(numberstring)) - { - continue; - } string conment = "{" - + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功\"," - + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功锛岃祫娣辨斂搴滈噰璐硶寰嬩笓瀹躲��3000澶氫欢璐ㄧ枒鎶曡瘔鎴愬姛妗堜緥锛屾壘鏀块噰鍜ㄨ锛岃姳閽辨洿灏戙�佽儨绠楁洿楂橈紝鎺ュ彈鎺ㄩ闄╀唬鐞嗭紝璐ㄧ枒鎶曡瘔鎴愬姛鍐嶆敹璐广�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," - + "\"getui_alias\": [" + numberstring + "]," - + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功锛岃祫娣辨斂搴滈噰璐硶寰嬩笓瀹躲��3000澶氫欢璐ㄧ枒鎶曡瘔鎴愬姛妗堜緥锛屾壘鏀块噰鍜ㄨ锛岃姳閽辨洿灏戙�佽儨绠楁洿楂橈紝鎺ュ彈鎺ㄩ闄╀唬鐞嗭紝璐ㄧ枒鎶曡瘔鎴愬姛鍐嶆敹璐广�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"}," - + "\"force_notification\": true" - + "}"; + + "\"appkey\": \"" + appkey + "\"," + + "\"senderId\": \"" + ywjl.UserSn + "\"," + + "\"senderData\": { \"avatar\": \"\",\"name\": \"" + ywjl.UserName + "\"}," + + "\"to\": { \"type\": \"private\",\"id\": \"" + projectfasongxiaoxisywjl[i].HuiyuanId + "\",\"data\": { \"avatar\": \"\",\"name\": \"\"}}," + + "\"type\": \"text\"," + + "\"payload\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功锛岃祫娣辨斂搴滈噰璐硶寰嬩笓瀹躲��3000澶氫欢璐ㄧ枒鎶曡瘔鎴愬姛妗堜緥锛屾壘鏀块噰鍜ㄨ锛岃姳閽辨洿灏戙�佽儨绠楁洿楂橈紝鎺ュ彈鎺ㄩ闄╀唬鐞嗭紝璐ㄧ枒鎶曡瘔鎴愬姛鍐嶆敹璐广�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," + + "\"notification\": { \"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功 \",\"body\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功 \"," + + "\"vendorOptions\": {\"huawei\": {\"category\": \"" + huawei + "\"},\"oppo\": {\"channel_id\": \"" + oppo + "\"},\"xiaomi\": {\"channel_id\": \"" + xiaomi + "\"},\"vivo\": {\"classification\":" + vivo + "}}" + + "}" + + "}"; - string result2 = SMSHelper.PushApp(conment); + string result2 = SMSHelper.PushAppduandu(conment); _logger.LogInformation("result2:" + result2); JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); - if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "200") { - var isOK = jobjectresult["isOK"].ToString(); + var projectfasongxiaoxi = new Projectfasongxiaoxi(); + projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + projectfasongxiaoxi.ProjectId = projectfasongxiaoxisywjl[i].ProjectId; + projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; + projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; + projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; + projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; + projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; + projectfasongxiaoxi.RecStatus = "A"; + projectfasongxiaoxi.Createtime = DateTime.Now; + _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) - { - if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) - { - var projectfasongxiaoxi = new Projectfasongxiaoxi(); - projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); - projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; - projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; - projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; - projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; - projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; - projectfasongxiaoxi.RecStatus = "A"; - projectfasongxiaoxi.Createtime = DateTime.Now; - _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - } - } - _context.SaveChanges(); } + _context.SaveChanges(); + _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + projectfasongxiaoxisywjl[i].Khname); - - - _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + customename); } + + //var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == ywjl.Id && x.Tel != null && x.Tel.StartsWith("1")).ToList(); + //int j = 0; + //while (j * 1000 <= projectfasongxiaoxisywjl.Count) + //{ + // j = j + 1; + // string numberstring = ""; + // string customename = ""; + // if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) + // { + // int countt = (j * 1000); + // if (countt > projectfasongxiaoxisywjl.Count) + // { + // countt = projectfasongxiaoxisywjl.Count; + // } + + // for (int i = 0; i < countt; i++) + // { + // if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) + // { + // continue; + // } + // numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; + // customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; + + // } + // } + + // if (numberstring.EndsWith(",")) + // { + // numberstring = numberstring.Substring(0, numberstring.Length - 1); + // } + // if (string.IsNullOrEmpty(numberstring)) + // { + // continue; + // } + // string conment = "{" + // + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功\"," + // + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功锛岃祫娣辨斂搴滈噰璐硶寰嬩笓瀹躲��3000澶氫欢璐ㄧ枒鎶曡瘔鎴愬姛妗堜緥锛屾壘鏀块噰鍜ㄨ锛岃姳閽辨洿灏戙�佽儨绠楁洿楂橈紝鎺ュ彈鎺ㄩ闄╀唬鐞嗭紝璐ㄧ枒鎶曡瘔鎴愬姛鍐嶆敹璐广�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"," + // + "\"getui_alias\": [" + numberstring + "]," + // + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功锛岃祫娣辨斂搴滈噰璐硶寰嬩笓瀹躲��3000澶氫欢璐ㄧ枒鎶曡瘔鎴愬姛妗堜緥锛屾壘鏀块噰鍜ㄨ锛岃姳閽辨洿灏戙�佽儨绠楁洿楂橈紝鎺ュ彈鎺ㄩ闄╀唬鐞嗭紝璐ㄧ枒鎶曡瘔鎴愬姛鍐嶆敹璐广�備簡瑙h鎯呰鍜ㄨ锛�" + ywjl.Phone + " \"}," + // + "\"force_notification\": true" + // + "}"; + + // string result2 = SMSHelper.PushApp(conment); + // _logger.LogInformation("result2:" + result2); + // JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); + + // if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + // { + // var isOK = jobjectresult["isOK"].ToString(); + + // foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) + // { + // if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) + // { + // var projectfasongxiaoxi = new Projectfasongxiaoxi(); + // projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + // projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; + // projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; + // projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; + // projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; + // projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; + // projectfasongxiaoxi.RecStatus = "A"; + // projectfasongxiaoxi.Createtime = DateTime.Now; + // _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); + // } + // } + // _context.SaveChanges(); + // } + + + + // _logger.LogInformation(ywjl.UserName + "鎺ㄩ�乤pp缁欏鎴�" + customename); + //} @@ -3572,80 +3919,119 @@ //涓氬姟缁忕悊涓虹┖ if (true) { - var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null && x.Tel != null && x.Tel.StartsWith("1")).ToList(); - int j = 0; - while (j * 1000 <= projectfasongxiaoxisywjl.Count) + var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null).ToList(); + for (int i = 0; i < projectfasongxiaoxisywjl.Count; i++) { - j = j + 1; - string numberstring = ""; - string customename = ""; - if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) - { - int countt = (j * 1000); - if (countt > projectfasongxiaoxisywjl.Count) - { - countt = projectfasongxiaoxisywjl.Count; - } - for (int i = 0; i < countt; i++) - { - if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) - { - continue; - } - numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; - customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; - - } - } - - if (numberstring.EndsWith(",")) - { - numberstring = numberstring.Substring(0, numberstring.Length - 1); - } - if (string.IsNullOrEmpty(numberstring)) - { - continue; - } string conment = "{" - + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功\"," - + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功锛岃祫娣辨斂搴滈噰璐硶寰嬩笓瀹躲��3000澶氫欢璐ㄧ枒鎶曡瘔鎴愬姛妗堜緥锛屾壘鏀块噰鍜ㄨ锛岃姳閽辨洿灏戙�佽儨绠楁洿楂橈紝鎺ュ彈鎺ㄩ闄╀唬鐞嗭紝璐ㄧ枒鎶曡瘔鎴愬姛鍐嶆敹璐广�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"," - + "\"getui_alias\": [" + numberstring + "]," - + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功锛岃祫娣辨斂搴滈噰璐硶寰嬩笓瀹躲��3000澶氫欢璐ㄧ枒鎶曡瘔鎴愬姛妗堜緥锛屾壘鏀块噰鍜ㄨ锛岃姳閽辨洿灏戙�佽儨绠楁洿楂橈紝鎺ュ彈鎺ㄩ闄╀唬鐞嗭紝璐ㄧ枒鎶曡瘔鎴愬姛鍐嶆敹璐广�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"}," - + "\"force_notification\": true" - + "}"; + + "\"appkey\": \"" + appkey + "\"," + + "\"senderId\": \"kehujingli\"," + + "\"senderData\": { \"avatar\": \"\",\"name\": \"瀹㈡埛缁忕悊\"}," + + "\"to\": { \"type\": \"private\",\"id\": \"" + projectfasongxiaoxisywjl[i].HuiyuanId + "\",\"data\": { \"avatar\": \"\",\"name\": \"\"}}," + + "\"type\": \"text\"," + + "\"payload\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功锛岃祫娣辨斂搴滈噰璐硶寰嬩笓瀹躲��3000澶氫欢璐ㄧ枒鎶曡瘔鎴愬姛妗堜緥锛屾壘鏀块噰鍜ㄨ锛岃姳閽辨洿灏戙�佽儨绠楁洿楂橈紝鎺ュ彈鎺ㄩ闄╀唬鐞嗭紝璐ㄧ枒鎶曡瘔鎴愬姛鍐嶆敹璐广�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"," + + "\"notification\": { \"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功 \",\"body\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功 \"," + + "\"vendorOptions\": {\"huawei\": {\"category\": \"" + huawei + "\"},\"oppo\": {\"channel_id\": \"" + oppo + "\"},\"xiaomi\": {\"channel_id\": \"" + xiaomi + "\"},\"vivo\": {\"classification\":" + vivo + "}}" + + "}" + + "}"; - string result2 = SMSHelper.PushApp(conment); + string result2 = SMSHelper.PushAppduandu(conment); _logger.LogInformation("result2:" + result2); JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); - if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "200") { - var isOK = jobjectresult["isOK"].ToString(); + var projectfasongxiaoxi = new Projectfasongxiaoxi(); + projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + projectfasongxiaoxi.ProjectId = projectfasongxiaoxisywjl[i].ProjectId; + projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoxisywjl[i].ProjectmingxiId; + projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoxisywjl[i].Xiaoxileixing; + projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoxisywjl[i].Xiaoxizhonglei; + projectfasongxiaoxi.Gyszl = projectfasongxiaoxisywjl[i].Gyszl; + projectfasongxiaoxi.Khname = projectfasongxiaoxisywjl[i].Khname; + projectfasongxiaoxi.RecStatus = "A"; + projectfasongxiaoxi.Createtime = DateTime.Now; + _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) - { - if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) - { - var projectfasongxiaoxi = new Projectfasongxiaoxi(); - projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); - projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; - projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; - projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; - projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; - projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; - projectfasongxiaoxi.RecStatus = "A"; - projectfasongxiaoxi.Createtime = DateTime.Now; - _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); - } - } - _context.SaveChanges(); } + _context.SaveChanges(); + _logger.LogInformation("鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴锋帹閫乤pp缁欏鎴�" + projectfasongxiaoxisywjl[i].Khname); - - - _logger.LogInformation("鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴�" + customename); } + //var projectfasongxiaoxisywjl = projectfasongxiaoxiDTOsappzuizhong.Where(x => x.Ywjl == null && x.Tel != null && x.Tel.StartsWith("1")).ToList(); + //int j = 0; + //while (j * 1000 <= projectfasongxiaoxisywjl.Count) + //{ + // j = j + 1; + // string numberstring = ""; + // string customename = ""; + // if (projectfasongxiaoxisywjl != null && projectfasongxiaoxisywjl.Count > 0) + // { + // int countt = (j * 1000); + // if (countt > projectfasongxiaoxisywjl.Count) + // { + // countt = projectfasongxiaoxisywjl.Count; + // } + // for (int i = 0; i < countt; i++) + // { + // if (numberstring.IndexOf(projectfasongxiaoxisywjl[i + j - 1].Tel) >= 0) + // { + // continue; + // } + // numberstring += "\"" + projectfasongxiaoxisywjl[i + j - 1].Tel + "\","; + // customename += projectfasongxiaoxisywjl[i + j - 1].Khname + ","; + + // } + // } + + // if (numberstring.EndsWith(",")) + // { + // numberstring = numberstring.Substring(0, numberstring.Length - 1); + // } + // if (string.IsNullOrEmpty(numberstring)) + // { + // continue; + // } + // string conment = "{" + // + "\"title\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功\"," + // + "\"content\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功锛岃祫娣辨斂搴滈噰璐硶寰嬩笓瀹躲��3000澶氫欢璐ㄧ枒鎶曡瘔鎴愬姛妗堜緥锛屾壘鏀块噰鍜ㄨ锛岃姳閽辨洿灏戙�佽儨绠楁洿楂橈紝鎺ュ彈鎺ㄩ闄╀唬鐞嗭紝璐ㄧ枒鎶曡瘔鎴愬姛鍐嶆敹璐广�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"," + // + "\"getui_alias\": [" + numberstring + "]," + // + "\"payload\": {\"text\": \"鏀块噰鍜ㄨ鍏徃涓撲笟涓轰緵搴斿晢浠f嫙璐ㄧ枒鍑姐�佹姇璇変功锛岃祫娣辨斂搴滈噰璐硶寰嬩笓瀹躲��3000澶氫欢璐ㄧ枒鎶曡瘔鎴愬姛妗堜緥锛屾壘鏀块噰鍜ㄨ锛岃姳閽辨洿灏戙�佽儨绠楁洿楂橈紝鎺ュ彈鎺ㄩ闄╀唬鐞嗭紝璐ㄧ枒鎶曡瘔鎴愬姛鍐嶆敹璐广�備簡瑙h鎯呰鍜ㄨ锛�400-028-8080 \"}," + // + "\"force_notification\": true" + // + "}"; + + // string result2 = SMSHelper.PushApp(conment); + // _logger.LogInformation("result2:" + result2); + // JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2); + + // if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1") + // { + // var isOK = jobjectresult["isOK"].ToString(); + + // foreach (var projectfasongxiaoDTO in projectfasongxiaoxisywjl) + // { + // if (isOK.IndexOf(projectfasongxiaoDTO.Tel) >= 0) + // { + // var projectfasongxiaoxi = new Projectfasongxiaoxi(); + // projectfasongxiaoxi.Id = Guid.NewGuid().ToString(); + // projectfasongxiaoxi.ProjectmingxiId = projectfasongxiaoDTO.ProjectmingxiId; + // projectfasongxiaoxi.Xiaoxileixing = projectfasongxiaoDTO.Xiaoxileixing; + // projectfasongxiaoxi.Xiaoxizhonglei = projectfasongxiaoDTO.Xiaoxizhonglei; + // projectfasongxiaoxi.Gyszl = projectfasongxiaoDTO.Gyszl; + // projectfasongxiaoxi.Khname = projectfasongxiaoDTO.Khname; + // projectfasongxiaoxi.RecStatus = "A"; + // projectfasongxiaoxi.Createtime = DateTime.Now; + // _context.Projectfasongxiaoxis.Add(projectfasongxiaoxi); + // } + // } + // _context.SaveChanges(); + // } + + + + // _logger.LogInformation("鏃犱笟鍔$粡鐞嗘帹閫乤pp缁欏鎴�" + customename); + //} + } diff --git a/zhengcaioa/zhengcaioa/Views/CooperatecustomCustomer/Edit.cshtml b/zhengcaioa/zhengcaioa/Views/CooperatecustomCustomer/Edit.cshtml index 69b2c08..d66ec5a 100644 --- a/zhengcaioa/zhengcaioa/Views/CooperatecustomCustomer/Edit.cshtml +++ b/zhengcaioa/zhengcaioa/Views/CooperatecustomCustomer/Edit.cshtml @@ -1084,6 +1084,34 @@ } }); + + $("#Name").change(function () { + + var Name = $("#Name").val(); + $.ajax({ + type: "GET", + url: "/IntentionCustomer/getTitle?Name=" + Name + "&Id=" + $("#Id").val(), + dataType: "json", + global: false, + data: "", + success: function (data) { + + if (!data.Result) { + toastr.warning(data.Message); + } + + + + + + }, + error: function () { + + + parent.layer.msg('澶辫触', { icon: 5 }); + } + }); + }); </script> </body> </html> \ No newline at end of file diff --git a/zhengcaioa/zhengcaioa/Views/IntentionCustomer/Edit.cshtml b/zhengcaioa/zhengcaioa/Views/IntentionCustomer/Edit.cshtml index 28eb990..ea6cd37 100644 --- a/zhengcaioa/zhengcaioa/Views/IntentionCustomer/Edit.cshtml +++ b/zhengcaioa/zhengcaioa/Views/IntentionCustomer/Edit.cshtml @@ -815,6 +815,35 @@ } }); + + + $("#Name").change(function () { + + var Name = $("#Name").val(); + $.ajax({ + type: "GET", + url: "/IntentionCustomer/getTitle?Name=" + Name + "&Id=" + $("#Id").val(), + dataType: "json", + global: false, + data: "", + success: function (data) { + + if (!data.Result) { + toastr.warning(data.Message); + } + + + + + + }, + error: function () { + + + parent.layer.msg('澶辫触', { icon: 5 }); + } + }); + }); </script> </body> </html> \ No newline at end of file -- Gitblit v1.9.1