| | |
| | | private readonly ICooperatecustomCustomerService _cooperatecustomCustomerService; |
| | | private readonly IMapper _mapper; |
| | | private readonly IHrDeptService _hrDeptService; |
| | | private readonly IPltPageService _pltPageService; |
| | | |
| | | |
| | | public IntentionCustomerController(ILogger<IntentionCustomerController> logger, IProjectService projectService, ILiaotianService liaotianService, IIntentionCustomerService intentionCustomerService, IUserService userService, ICooperatecustomCustomerService cooperatecustomCustomerService, IMapper mapper, IHrDeptService hrDeptService) |
| | | public IntentionCustomerController(ILogger<IntentionCustomerController> logger, IProjectService projectService, ILiaotianService liaotianService, IIntentionCustomerService intentionCustomerService, IUserService userService |
| | | , ICooperatecustomCustomerService cooperatecustomCustomerService, IMapper mapper, IHrDeptService hrDeptService, IPltPageService pltPageService) |
| | | { |
| | | _logger = logger; |
| | | _projectService = projectService; |
| | |
| | | _cooperatecustomCustomerService = cooperatecustomCustomerService; |
| | | _mapper = mapper; |
| | | _hrDeptService = hrDeptService; |
| | | _pltPageService = pltPageService; |
| | | } |
| | | |
| | | public IActionResult Index() |
| | |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | List<ActionEntity> actionlist = new List<ActionEntity>(); |
| | | ActionEntity actionEntity = new ActionEntity(); |
| | | actionEntity.OpenType = 0; |
| | | actionEntity.ActionUrl = ""; |
| | | actionEntity.ActionFun = "Search"; |
| | | actionEntity.PageIco = "fa fa-search"; |
| | | actionEntity.ActionName = "查询"; |
| | | actionlist.Add(actionEntity); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | List<PageEntity> pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/IntentionCustomer/IndexYiXiang/"); |
| | | foreach(var pageEntity in pageEntities) |
| | | { |
| | | ActionEntity actionEntity = new ActionEntity(); |
| | | actionEntity.OpenType = pageEntity.OpenType; |
| | | actionEntity.ActionUrl = ""; |
| | | actionEntity.ActionFun = pageEntity.PageShortcut; |
| | | actionEntity.PageIco = pageEntity.PageIco; |
| | | actionEntity.ActionName = pageEntity.PageName; |
| | | actionlist.Add(actionEntity); |
| | | } |
| | | |
| | | ViewData["ActionInfo"] = actionlist; |
| | | |
| | | |
| | | ViewBag.khly = _liaotianService.GetSYScode("IntentionCustomer", "khly").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | |
| | | ViewBag.ywjl = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList(); |
| | |
| | | //ViewBag.ShengDropDown = _projectService.Getsheng().Select(x => new { code = x.CodeId, label = x.Name }).ToList(); |
| | | return View(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 解绑 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public JsonResult UnBind(string id) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | using (TransactionScope scope = new TransactionScope()) |
| | | { |
| | | string[] ids = id.Split(','); |
| | | foreach (var iddd in ids) |
| | | { |
| | | var intentionCustomerDTO = _intentionCustomerService.Get(iddd); |
| | | intentionCustomerDTO.Yixiang = null; |
| | | intentionCustomerDTO.Yixiangtime = null; |
| | | resultEntity = _intentionCustomerService.save(intentionCustomerDTO); |
| | | if (!resultEntity.Result) |
| | | { |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | scope.Complete(); |
| | | } |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | public IActionResult Edit(string id = null,string namecus = null) |
| | |
| | | for (int i = 0; i < result.Count; i++) |
| | | { |
| | | |
| | | //resultEntity = _intentionCustomerService.ModifyStatus(result[i].Id, curentuser.Id); |
| | | //if (!resultEntity.Result) |
| | | //{ |
| | | // return new JsonResult(resultEntity); |
| | | //} |
| | | resultEntity = _intentionCustomerService.ModifyStatus(result[i].Id, curentuser.Id); |
| | | if (!resultEntity.Result) |
| | | { |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | var dto = _mapper.Map<CooperatecustomCustomerDTO>(result[i]); |
| | | dto.Id = ""; |