| | |
| | | { |
| | | dto = _intentionVisitService.Get(id); |
| | | |
| | | //dto.Viscustomer = Viscustomer; |
| | | IntentionVisitDTOSearch searchEntity = new IntentionVisitDTOSearch(); |
| | | searchEntity.page = 1; |
| | | searchEntity.rows = 1000; |
| | | searchEntity.Viscustomer = dto.Viscustomer; |
| | | var resultDataEntity = _intentionVisitService.SearchByPaging(searchEntity); |
| | | ViewData["visitlishi"] = resultDataEntity.DataList; |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | if (!string.IsNullOrWhiteSpace(Viscustomer)) |
| | | { |
| | | dto.Viscustomer = Viscustomer; |
| | | IntentionVisitDTOSearch searchEntity = new IntentionVisitDTOSearch(); |
| | | searchEntity.page = 1; |
| | | searchEntity.rows = 1000; |
| | | searchEntity.Viscustomer = Viscustomer; |
| | | var resultDataEntity = _intentionVisitService.SearchByPaging(searchEntity); |
| | | ViewData["visitlishi"] = resultDataEntity.DataList; |
| | | |
| | | } |
| | | else |
| | | { |
| | | ViewData["visitlishi"] = new List<IntentionVisitDTO>(); |
| | | } |
| | | |
| | | dto.VisType = "01"; |
| | | dto.Jtype = "02"; |
| | | dto.Jdr = "02"; |
| | | //dto.Jdr = "02"; |
| | | dto.Talk = "介绍公司业务内容和产品。"; |
| | | dto.Yx = "03"; |
| | | dto.Jy = "02"; |
| | | |
| | | dto.Zw = "02"; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | ViewData["yx"] = _liaotianService.GetSYScode("CooperVisit", "yx"); |
| | | ViewData["jy"] = _liaotianService.GetSYScode("CooperVisit", "jy"); |
| | | |
| | | ViewData["Duanxin"] = _intentionVisitService.GetListDuanxin(); |
| | | |
| | | ViewBag.IsYwjl = IsYwjl; |
| | | |
| | | ViewData.Model = dto; |
| | | return View(); |
| | | } |
| | | |
| | | |
| | | public IActionResult getDuanxin(string id) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = true; |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | |
| | | var intentionVisitDuanxinDTO = _intentionVisitService.GetDuanxin(id); |
| | | if(intentionVisitDuanxinDTO!=null && !string.IsNullOrEmpty(intentionVisitDuanxinDTO.DuanxinNeirong)) |
| | | { |
| | | resultEntity.Message = string.Format(intentionVisitDuanxinDTO.DuanxinNeirong, curentuser.UserName, curentuser.Phone); |
| | | } |
| | | |
| | | |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | |
| | |
| | | using (TransactionScope scope = new TransactionScope()) |
| | | { |
| | | resultEntity = _intentionVisitService.save(data); |
| | | |
| | | if (!resultEntity.Result) |
| | | { |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | |
| | | if (!string.IsNullOrEmpty(data.IsYwjl)) |
| | |
| | | intentionCustomerDTO.Ywjl = curentuser.Id; |
| | | } |
| | | resultEntity = _intentionCustomerService.save(intentionCustomerDTO); |
| | | if (!resultEntity.Result) |
| | | { |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | } |
| | | else if (data.Jy == "05") |
| | | { |
| | |
| | | intentionCustomerDTO.Yixiangtime = data.Vistime; |
| | | intentionCustomerDTO.Dianxiaozhuanyuan = curentuser.Id; |
| | | resultEntity = _intentionCustomerService.save(intentionCustomerDTO); |
| | | if (!resultEntity.Result) |
| | | { |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | if (!string.IsNullOrEmpty(data.DuanxinNeirong)) |
| | | { |
| | | IntentionCustomerDTO intentionCustomerDTO = _intentionCustomerService.Get(data.Viscustomer); |
| | | if(intentionCustomerDTO!=null && ( !string.IsNullOrEmpty(intentionCustomerDTO.Phone) || !string.IsNullOrEmpty(intentionCustomerDTO.Tel))) |
| | | { |
| | | string sss = SMSHelper.PushWToUserMES(string.IsNullOrEmpty(intentionCustomerDTO.Phone)? intentionCustomerDTO.Tel: intentionCustomerDTO.Phone, "您好,客户. 详情见:"+data.DuanxinNeirong); |
| | | if (int.Parse(sss) <= 0) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "短信发送失败"; |
| | | |
| | | } |
| | | if (!resultEntity.Result) |
| | | { |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "客户无手机号码"; |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | scope.Complete(); |
| | |
| | | { |
| | | for(int i=0;i< result.Count; i++) |
| | | { |
| | | number.Append(result[i].Phone); |
| | | number.Append(string.IsNullOrEmpty(result[i].Phone)? result[i].Tel: result[i].Phone); |
| | | customename += result[i].Name + ","; |
| | | if (i!= result.Count - 1) |
| | | { |
| | |
| | | resultEntity.Message = "无联系人"; |
| | | } |
| | | |
| | | string sss = SMSHelper.PushWToUserMES(number.ToString(), neirong); |
| | | string sss = SMSHelper.PushWToUserMES(number.ToString(), "您好,客户. 详情见:" + neirong ); |
| | | if (int.Parse(sss) <= 0) |
| | | { |
| | | resultEntity.Result = false; |