From f83fb19d3f31c2c48390da94740c68ffd07a6f12 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期五, 07 一月 2022 10:09:14 +0800 Subject: [PATCH] 订单收款改造 --- zhengcaioa/zhengcaioa/Controllers/ProjectController.cs | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 110 insertions(+), 3 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs b/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs index 02a69c9..800b4cb 100644 --- a/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs @@ -25,9 +25,11 @@ private readonly IIntentionCustomerService _intentionCustomerService; private readonly IUserService _userService; private readonly ICooperatecustomCustomerService _cooperatecustomCustomerService; + private readonly ISysBaimingdanService _sysBaimingdanService; public ProjectController(ILogger<ProjectController> logger, IProjectService projectService, ILiaotianService liaotianService,IIntentionCustomerService intentionCustomerService, IUserService userService - , ICooperatecustomCustomerService cooperatecustomCustomerService) + , ICooperatecustomCustomerService cooperatecustomCustomerService + , ISysBaimingdanService sysBaimingdanService) { _logger = logger; _projectService = projectService; @@ -35,6 +37,7 @@ _intentionCustomerService = intentionCustomerService; _userService = userService; _cooperatecustomCustomerService = cooperatecustomCustomerService; + _sysBaimingdanService = sysBaimingdanService; } [CheckLogin] public IActionResult Index() @@ -205,7 +208,21 @@ } var zhuanjia = _projectService.Getzhuanjie(); var cgfs = _projectService.GetCgfs(); - var sheng = _projectService.Getsheng(); + var areaDTOs = _projectService.Getsheng().ToList(); + foreach (var areaDTO in areaDTOs) + { + if (areaDTO.CodeId == "510000") + { + areaDTOs.Remove(areaDTO); + break; + } + } + var areaDTOsic = new Area(); + areaDTOsic.CodeId = "510000"; + areaDTOsic.Name = "鍥涘窛鐪�"; + areaDTOsic.ParentId = "0 "; + areaDTOs.Insert(1, areaDTOsic); + var sheng = areaDTOs; var shi = _projectService.Getshi(projectDTO.Sheng); var quxian = _projectService.Getquxian(projectDTO.City); @@ -297,7 +314,21 @@ ViewData["ActionInfo"] = actionlist; ViewBag.ProjectDropDown = _projectService.AllcgfsDropDown().Select(x => new { code = x.Value, label = x.Text }).ToList(); //ViewBag.flbx = _liaotianService.GetSYScode("Project", "flbx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); - ViewBag.ShengDropDown = _projectService.Getsheng().Select(x => new { code = x.CodeId, label = x.Name }).ToList(); + var areaDTOs = _projectService.Getsheng().ToList(); + foreach (var areaDTO in areaDTOs) + { + if (areaDTO.CodeId == "510000") + { + areaDTOs.Remove(areaDTO); + break; + } + } + var areaDTOsic = new Area(); + areaDTOsic.CodeId = "510000"; + areaDTOsic.Name = "鍥涘窛鐪�"; + areaDTOsic.ParentId = "0 "; + areaDTOs.Insert(1, areaDTOsic); + ViewBag.ShengDropDown = areaDTOs.Select(x => new { code = x.CodeId, label = x.Name }).ToList(); ViewBag.Creater = _userService.GetList().Select(x => new { code = x.Id, label = x.UserName }).ToList(); ViewBag.flbx = _liaotianService.GetSYScode("system", "shifou").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); @@ -636,5 +667,81 @@ } } + + + //鑾峰彇瀵规墜鍒嗘瀽 + public IActionResult GetProjectFenxi([FromBody] ProjectDTOSearch search) + { + ReturnMsg<List<ProjectDTO>> returnMsg = new ReturnMsg<List<ProjectDTO>>(); + returnMsg.code = 2; + + var sysBaimingdanDTOs = _sysBaimingdanService.GetList(); + if (!string.IsNullOrEmpty(search.Zhuanjia)) + { + var sss = sysBaimingdanDTOs.Where(x => x.PostType == "01" && search.Zhuanjia.Contains(x.BaimingdanName)).Count(); + if (sss > 0) + { + returnMsg.code = 2; + returnMsg.error = "璇ヤ笓瀹惰鐩存帴鑱旂郴鏀块噰鍜ㄨ"; + returnMsg.count = 0; + return new JsonResult(returnMsg); + } + } + if (!string.IsNullOrEmpty(search.Names)) + { + var sss = sysBaimingdanDTOs.Where(x => x.PostType == "02" && search.Names.Contains(x.BaimingdanName)).Count(); + if (sss > 0) + { + returnMsg.code = 11; + returnMsg.error = "璇ヤ緵搴斿晢璇风洿鎺ヨ仈绯绘斂閲囧挩璇�"; + returnMsg.count = 0; + return new JsonResult(returnMsg); + } + } + if (!string.IsNullOrEmpty(search.NamesToubiao)) + { + var sss = sysBaimingdanDTOs.Where(x => x.PostType == "02" && search.NamesToubiao.Contains(x.BaimingdanName)).Count(); + if (sss > 0) + { + returnMsg.code = 11; + returnMsg.error = "璇ヤ緵搴斿晢璇风洿鎺ヨ仈绯绘斂閲囧挩璇�"; + returnMsg.count = 0; + return new JsonResult(returnMsg); + } + } + if (!string.IsNullOrEmpty(search.Reasonname)) + { + var sss = sysBaimingdanDTOs.Where(x => x.PostType == "02" && search.Reasonname.Contains(x.BaimingdanName)).Count(); + if (sss > 0) + { + returnMsg.code = 11; + returnMsg.error = "璇ヤ緵搴斿晢璇风洿鎺ヨ仈绯绘斂閲囧挩璇�"; + returnMsg.count = 0; + return new JsonResult(returnMsg); + } + } + + + try + { + + //search.page = 1; + //search.rows = 1; + ResultDataEntity<ProjectDTO> resultDataEntity = _projectService.SearchByPaging(search); + + returnMsg.code = 1; + returnMsg.count = search.totalrows; + returnMsg.returnObj = resultDataEntity.DataList; + + } + catch (Exception ex) + { + returnMsg.code = 2; + returnMsg.error = "娌℃湁鑾峰彇鍒皌oken"; + returnMsg.count = 0; + + } + return new JsonResult(returnMsg); + } } } -- Gitblit v1.9.1