| | |
| | | private readonly IAdmBreakPrecedentService _aAdmBreakPrecedentService; |
| | | private readonly ICooperatecustomCustomerService _cooperatecustomCustomerService; |
| | | private readonly IIntentionCustomerService _intentionCustomerService; |
| | | private readonly IHrPositionService _hrPositionService; |
| | | |
| | | public AdmAskController(ILogger<AdmAskController> logger, IAskService askService, IHrDeptService hrDeptService, IWfRunProcessService wfRunProcessService |
| | | , IWfHistoryService wfHistoryService, IWfNeeddeelService wfNeeddeelService |
| | |
| | | , IUserService userService |
| | | , IAdmBreakPrecedentService aAdmBreakPrecedentService |
| | | , ICooperatecustomCustomerService cooperatecustomCustomerService |
| | | , IIntentionCustomerService intentionCustomerService) |
| | | , IIntentionCustomerService intentionCustomerService |
| | | , IHrPositionService hrPositionService) |
| | | { |
| | | _logger = logger; |
| | | _hrDeptService = hrDeptService; |
| | |
| | | _aAdmBreakPrecedentService = aAdmBreakPrecedentService; |
| | | _cooperatecustomCustomerService = cooperatecustomCustomerService; |
| | | _intentionCustomerService = intentionCustomerService; |
| | | _hrPositionService = hrPositionService; |
| | | } |
| | | |
| | | public IActionResult Askcost(string id = "") |
| | |
| | | } |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | public IActionResult AskCiZhi(string id = "") |
| | | { |
| | | AdmAskCiZhiDTO dto = new AdmAskCiZhiDTO(); |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | |
| | | |
| | | //流程相关 |
| | | string shifoubiaoji = "A"; |
| | | string sifoudangqian = "A"; |
| | | string dangqianbuzhou = "提交"; |
| | | var lishiyijian = new List<WfHistoryDTO>(); |
| | | |
| | | if (string.IsNullOrEmpty(id)) |
| | | { |
| | | dto.CreaterName = curentuser.UserName; |
| | | dto.Tittle = "辞职申请(" + curentuser.UserName + ")"; |
| | | dto.RuzhitimeName = curentuser.Indate.HasValue? curentuser.Indate.Value.ToString("yyyy-MM-dd"):""; |
| | | dto.CreatetimeName = DateTime.Now.ToString("yyyy-MM-dd"); |
| | | var deptDTO = _hrDeptService.Get(curentuser.DeptId); |
| | | if (deptDTO != null) |
| | | { |
| | | dto.DeptName = deptDTO.DeptName; |
| | | } |
| | | var positionDTO = _hrPositionService.Get(curentuser.HrPosition); |
| | | |
| | | if (positionDTO != null) |
| | | { |
| | | dto.PostName = positionDTO.PostName; |
| | | } |
| | | } |
| | | else if (dto != null) |
| | | { |
| | | dto = _askService.GetAskCiZhi(id); |
| | | dto.OuttimeName = dto.Outtime.HasValue ? dto.Outtime.Value.ToString("yyyy-MM-dd"):""; |
| | | //dto.JineName = dto.Jine.Value.ToString("F2"); |
| | | |
| | | var wfRunProcessDTO = _wfRunProcessService.GetList(dto.Id, "21").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; |
| | | |
| | | var userDTOs = _userService.GetList(); |
| | | ViewData["UserIds"] = userDTOs; |
| | | |
| | | string[] Userids = null; |
| | | if (!string.IsNullOrEmpty(dto.JiaojieUser) ) |
| | | { |
| | | Userids = dto.JiaojieUser.Split(','); ; |
| | | |
| | | } |
| | | else |
| | | { |
| | | Userids = new string[0]; |
| | | } |
| | | |
| | | ViewBag.Userid = Userids; |
| | | |
| | | var userDTOsList = userDTOs.Where(x => Userids.Contains(x.Id)).ToList(); |
| | | if(userDTOsList!=null && userDTOsList.Count > 0) |
| | | { |
| | | dto.JiaojieUserName = ""; |
| | | foreach (var userDTO in userDTOsList) |
| | | { |
| | | dto.JiaojieUserName += userDTO.UserName + ","; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //ViewBag.jtype = _liaotianService.GetSYScode("CooperVisit", "jtype"); |
| | | //ViewBag.visType = _liaotianService.GetSYScode("CooperVisit", "visType"); |
| | | //var cooperatecustomCustomerDTOs = _cooperatecustomCustomerService.GetList(); |
| | | //var intentionCustomerDTOs = _intentionCustomerService.GetList(); |
| | | |
| | | //ViewBag.CooperatecustomCustomerDTOs = |
| | | |
| | | ViewData.Model = dto; |
| | | return View(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 辞职申请 |
| | | /// </summary> |
| | | /// <param name="data"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult SaveAskCiZhi(AdmAskCiZhiDTO data) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | using (TransactionScope scope = new TransactionScope()) |
| | | { |
| | | if (data.Step == "提交") |
| | | { |
| | | |
| | | data.ShenpiStatus = "D"; |
| | | data.RecStatus = "A"; |
| | | data.Creater = curentuser.Id; |
| | | data.Createtime = DateTime.Now; |
| | | data.Modifier = data.Creater; |
| | | data.Modifytime = data.Createtime; |
| | | |
| | | resultEntity = _askService.SaveAskCiZhi(data); |
| | | if (!resultEntity.Result) |
| | | { |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | | var askCiZhiDTO = _askService.GetAskCiZhi(data.Id); |
| | | askCiZhiDTO.Outtime = data.Outtime; |
| | | askCiZhiDTO.JiaojieUser = data.JiaojieUser; |
| | | askCiZhiDTO.Modifier = curentuser.Id; |
| | | askCiZhiDTO.Modifytime = DateTime.Now; |
| | | |
| | | resultEntity = _askService.SaveAskCiZhi(askCiZhiDTO); |
| | | if (!resultEntity.Result) |
| | | { |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | } |
| | | |
| | | if (data.Step == "总经理审批") |
| | | { |
| | | //总经理审批同意之后,插入工作交接 |
| | | } |
| | | |
| | | |
| | | |
| | | //发起流程相关 |
| | | |
| | | resultEntity = _wfRunProcessService.WfAskCiZhi(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); |
| | | } |
| | | } |
| | | } |