From e649be7905be7e74f6e09d8d74a7bd7bcd3923b7 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期二, 27 七月 2021 16:17:35 +0800 Subject: [PATCH] 修改 --- zhengcaioa/zhengcaioa/Controllers/HR/SalaryCheckController.cs | 104 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 92 insertions(+), 12 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Controllers/HR/SalaryCheckController.cs b/zhengcaioa/zhengcaioa/Controllers/HR/SalaryCheckController.cs index 14d8836..cdbb115 100644 --- a/zhengcaioa/zhengcaioa/Controllers/HR/SalaryCheckController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/HR/SalaryCheckController.cs @@ -18,12 +18,19 @@ private readonly IHrDeptService _hrDeptService; private readonly ILogger<SalaryCheckController> _logger; private readonly IHrSalaryService _hrSalaryService; + private readonly IWfRunProcessService _wfRunProcessService; + private readonly IWfHistoryService _wfHistoryService; + private readonly IWfNeeddeelService _wfNeeddeelService; - public SalaryCheckController(ILogger<SalaryCheckController> logger, IHrSalaryService hrSalaryService, IHrDeptService hrDeptService) + public SalaryCheckController(ILogger<SalaryCheckController> logger, IHrSalaryService hrSalaryService, IHrDeptService hrDeptService, IWfRunProcessService wfRunProcessService + , IWfHistoryService wfHistoryService, IWfNeeddeelService wfNeeddeelService) { _logger = logger; _hrDeptService = hrDeptService; _hrSalaryService = hrSalaryService; + _wfRunProcessService = wfRunProcessService; + _wfHistoryService = wfHistoryService; + _wfNeeddeelService = wfNeeddeelService; } public IActionResult Index() @@ -62,6 +69,8 @@ /// <returns></returns> public IActionResult GetList(HrSalaryDTOSearch search) { + _hrSalaryService.AutoCheck(); + return new JsonResult(_hrSalaryService.SearchSalaryByPaging(search)); } @@ -87,7 +96,7 @@ /// <param name="data"></param> /// <returns></returns> [HttpPost] - public IActionResult SaveCheck(HrSalaryDTO data) + public IActionResult SaveCheck(HrSalaryUpDTO data) { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); ResultEntity resultEntity = new ResultEntity(); @@ -146,19 +155,69 @@ } - public IActionResult Appeal(string id) + public IActionResult Appeal(string id="",string salaryId = "") { HrSalaryAppeal dto = new HrSalaryAppeal(); var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); - if (!string.IsNullOrEmpty(id)) - { - dto = _hrSalaryService.GetAppeal(id, curentuser.Id); - if(dto==null) + dto = _hrSalaryService.GetAppeal(id, curentuser.Id, salaryId); + + //娴佺▼鐩稿叧 + string shifoubiaoji = "A"; + string sifoudangqian = "A"; + string dangqianbuzhou = "鎻愪氦"; + var lishiyijian = new List<WfHistoryDTO>(); + + if (dto==null) { + var salaryDTO = _hrSalaryService.Get(salaryId); dto = new HrSalaryAppeal(); - dto.salary_id = id; - } + dto.salary_id = salaryId; + dto.Year = salaryDTO.Year; + dto.Month = salaryDTO.Month; + dto.createrName = curentuser.UserName; + dto.tittle = "宸ヨ祫鐢宠瘔锛�" + curentuser.UserName + "锛�"; } + else if (dto != null) + { + var wfRunProcessDTO = _wfRunProcessService.GetList(dto.id, "03").FirstOrDefault(); + if (wfRunProcessDTO == null) + { + shifoubiaoji = "D"; + sifoudangqian = "D"; + } + else + { + dangqianbuzhou = wfRunProcessDTO.Step; + //鏌ヨ鍘嗗彶鎰忚 + lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id); + if (wfRunProcessDTO.Step != "鎻愪氦") + { + shifoubiaoji = "D"; + } + + //鏌ヨ寰呭姙 + var chaxundaiban = _wfNeeddeelService.GetListTracking(wfRunProcessDTO.Id, wfRunProcessDTO.Step).Where(x => x.DeelUserId == curentuser.Id).ToList(); + if (chaxundaiban != null && chaxundaiban.Count > 0) + { + sifoudangqian = "A"; + } + else + { + sifoudangqian = "D"; + } + + } + + + + + } + + ViewBag.shifoubiaoji = shifoubiaoji; + ViewBag.sifoudangqian = sifoudangqian; + ViewBag.lishiyijian = lishiyijian; + ViewBag.dangqianbuzhou = dangqianbuzhou; + ViewData.Model = dto; return View(); } @@ -169,14 +228,32 @@ /// <param name="data"></param> /// <returns></returns> [HttpPost] - public IActionResult SaveAppeal(HrSalaryAppeal data) + public IActionResult SaveAppeal(HrSalaryAppealDTO data) { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); ResultEntity resultEntity = new ResultEntity(); using (TransactionScope scope = new TransactionScope()) { - data.sub_user = curentuser.Id; - resultEntity = _hrSalaryService.CheckAppea(data); + if (data.Step == "鎻愪氦") + { + data.sub_user = curentuser.Id; + data.shenpi_status = "D"; + data.status = "A"; + resultEntity = _hrSalaryService.CheckAppea(data); + if (!resultEntity.Result) + { + return new JsonResult(resultEntity); + } + } + + + //鍙戣捣娴佺▼鐩稿叧 + + resultEntity = _wfRunProcessService.WfSalaryAppeal(data.id, data.Step, data.Tongguojujue, curentuser.Id, data.Content, data.tittle, "v1"); + if (!resultEntity.Result) + { + return new JsonResult(resultEntity); + } scope.Complete(); } return new JsonResult(resultEntity); @@ -212,6 +289,9 @@ /// <returns></returns> public IActionResult GetSearchList(HrSalaryDTOSearch search) { + //鑷姩纭 + _hrSalaryService.AutoCheck(); + return new JsonResult(_hrSalaryService.SearchByPagingFinish(search)); } -- Gitblit v1.9.1