| | |
| | | private readonly IAdmGoodsManageService _admGoodsManageService; |
| | | private readonly ILiaotianService _liaotianService; |
| | | private readonly IUserService _userService; |
| | | private readonly IAdmBreakPrecedentService _aAdmBreakPrecedentService; |
| | | |
| | | public AdmAskController(ILogger<AdmAskController> logger, IAskService askService, IHrDeptService hrDeptService, IWfRunProcessService wfRunProcessService |
| | | , IWfHistoryService wfHistoryService, IWfNeeddeelService wfNeeddeelService |
| | | , IAdmGoodsManageService admGoodsManageService |
| | | , ILiaotianService liaotianService |
| | | , IUserService userService) |
| | | , IUserService userService |
| | | , IAdmBreakPrecedentService aAdmBreakPrecedentService) |
| | | { |
| | | _logger = logger; |
| | | _hrDeptService = hrDeptService; |
| | |
| | | _admGoodsManageService = admGoodsManageService; |
| | | _liaotianService = liaotianService; |
| | | _userService = userService; |
| | | _aAdmBreakPrecedentService = aAdmBreakPrecedentService; |
| | | } |
| | | |
| | | public IActionResult Askcost(string id = "") |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 保存用车申请 |
| | | /// 保存工作建议 |
| | | /// </summary> |
| | | /// <param name="data"></param> |
| | | /// <returns></returns> |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 保存销售费用申请 |
| | | /// 保存其他请示 |
| | | /// </summary> |
| | | /// <param name="data"></param> |
| | | /// <returns></returns> |
| | |
| | | } |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | |
| | | public IActionResult AskPunishAppeal(string id = "") |
| | | { |
| | | AdmAskMarketingCostDTO dto = new AdmAskMarketingCostDTO(); |
| | | 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 + ")"; |
| | | } |
| | | else if (dto != null) |
| | | { |
| | | dto = _askService.GetAskMarketingCost(id); |
| | | //dto.FeiyongName = dto.Feiyong.Value.ToString("F2"); |
| | | |
| | | var wfRunProcessDTO = _wfRunProcessService.GetList(dto.Id, "09").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; |
| | | if (string.IsNullOrEmpty(id)) |
| | | { |
| | | ViewBag.AdmBreakPrecedentDTOs = _aAdmBreakPrecedentService.GetList(curentuser.Id, DateTime.Now.Date.AddYears(-20), DateTime.Now.Date.AddDays(1)).ToList(); |
| | | } |
| | | else |
| | | { |
| | | ViewBag.AdmBreakPrecedentDTOs = _aAdmBreakPrecedentService.GetList(dto.Creater, DateTime.Now.Date.AddYears(-20), DateTime.Now.Date.AddDays(1)).ToList(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | ViewData.Model = dto; |
| | | return View(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 保存处罚申诉 |
| | | /// </summary> |
| | | /// <param name="data"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult SaveAskPunishAppeal(AdmAskMarketingCostDTO 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.SaveAskMarketingCost(data); |
| | | if (!resultEntity.Result) |
| | | { |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //发起流程相关 |
| | | |
| | | resultEntity = _wfRunProcessService.WfAskPunishAppeal(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); |
| | | } |
| | | } |
| | | } |