From e5d50b0415bef5e93c10b2bfbca98d377d3cad04 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期二, 07 十二月 2021 16:01:56 +0800
Subject: [PATCH] 提交
---
zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs | 1438 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 1,434 insertions(+), 4 deletions(-)
diff --git a/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs b/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs
index e668754..91cc7d4 100644
--- a/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs
@@ -9,6 +9,7 @@
using System.Linq;
using System.Threading.Tasks;
using System.Transactions;
+using zhengcaioa.IService;
using zhengcaioa.Models;
namespace zhengcaioa.Controllers.admin
@@ -23,10 +24,24 @@
private readonly IWfHistoryService _wfHistoryService;
private readonly IWfNeeddeelService _wfNeeddeelService;
private readonly IAdmGoodsManageService _admGoodsManageService;
+ private readonly ILiaotianService _liaotianService;
+ private readonly IUserService _userService;
+ private readonly IAdmBreakPrecedentService _aAdmBreakPrecedentService;
+ private readonly ICooperatecustomCustomerService _cooperatecustomCustomerService;
+ private readonly IIntentionCustomerService _intentionCustomerService;
+ private readonly IHrPositionService _hrPositionService;
+ private readonly IAdmGoodsRecordService _admGoodsRecordService;
public AdmAskController(ILogger<AdmAskController> logger, IAskService askService, IHrDeptService hrDeptService, IWfRunProcessService wfRunProcessService
, IWfHistoryService wfHistoryService, IWfNeeddeelService wfNeeddeelService
- , IAdmGoodsManageService admGoodsManageService)
+ , IAdmGoodsManageService admGoodsManageService
+ , ILiaotianService liaotianService
+ , IUserService userService
+ , IAdmBreakPrecedentService aAdmBreakPrecedentService
+ , ICooperatecustomCustomerService cooperatecustomCustomerService
+ , IIntentionCustomerService intentionCustomerService
+ , IHrPositionService hrPositionService
+ , IAdmGoodsRecordService admGoodsRecordService)
{
_logger = logger;
_hrDeptService = hrDeptService;
@@ -35,6 +50,13 @@
_wfHistoryService = wfHistoryService;
_wfNeeddeelService = wfNeeddeelService;
_admGoodsManageService = admGoodsManageService;
+ _liaotianService = liaotianService;
+ _userService = userService;
+ _aAdmBreakPrecedentService = aAdmBreakPrecedentService;
+ _cooperatecustomCustomerService = cooperatecustomCustomerService;
+ _intentionCustomerService = intentionCustomerService;
+ _hrPositionService = hrPositionService;
+ _admGoodsRecordService = admGoodsRecordService;
}
public IActionResult Askcost(string id = "")
@@ -68,7 +90,7 @@
else
{
dangqianbuzhou = wfRunProcessDTO.Step;
- //鏌ヨ鍘嗗彶鎰忚
+ //鏌ヨ瀹℃壒杩涘害
lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id);
if (wfRunProcessDTO.Step != "鎻愪氦")
{
@@ -177,7 +199,7 @@
else
{
dangqianbuzhou = wfRunProcessDTO.Step;
- //鏌ヨ鍘嗗彶鎰忚
+ //鏌ヨ瀹℃壒杩涘害
lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id);
if (wfRunProcessDTO.Step != "鎻愪氦")
{
@@ -258,6 +280,19 @@
resultEntity.Message = "鐗╁搧鍓╀綑鏁伴噺涓嶈冻";
return new JsonResult(resultEntity);
}
+
+ AdmGoodsRecordDTO dto = new AdmGoodsRecordDTO();
+ dto.GoodsId = admGoodsManageDTO.Id;
+ dto.GoodsNum = admAskGoodDTO.Shuliang.Value;
+ dto.GoodsLeft = admGoodsManageDTO.GoodsLeft;
+ dto.RecordTypeId = "02";
+ dto.RecStatus = "A";
+ dto.Creater = curentuser.Id;
+ dto.Createtime = DateTime.Now;
+ dto.Modifier = curentuser.Id;
+ dto.Modifytime = DateTime.Now;
+ dto.OperationalMatters = admAskGoodDTO.Tittle;
+ resultEntity = _admGoodsRecordService.save(dto);
}
@@ -307,7 +342,7 @@
else
{
dangqianbuzhou = wfRunProcessDTO.Step;
- //鏌ヨ鍘嗗彶鎰忚
+ //鏌ヨ瀹℃壒杩涘害
lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id);
if (wfRunProcessDTO.Step != "鎻愪氦")
{
@@ -383,5 +418,1400 @@
}
return new JsonResult(resultEntity);
}
+
+ public IActionResult AskCar(string id = "")
+ {
+ AdmAskCarDTO dto = new AdmAskCarDTO();
+ 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.GetAskCar(id);
+ dto.FeiyongName = dto.Feiyong.Value.ToString("F2");
+
+ var wfRunProcessDTO = _wfRunProcessService.GetList(dto.Id, "06").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;
+
+ ViewBag.CarLaiyuan = _liaotianService.GetSYScode("ADM_AskCar", "CarLaiyuan"); ;
+
+ ViewData.Model = dto;
+ return View();
+ }
+
+
+ /// <summary>
+ /// 淇濆瓨鐢ㄨ溅鐢宠
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult SaveAskCar(AdmAskCarDTO 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.SaveAskCar(data);
+ if (!resultEntity.Result)
+ {
+ return new JsonResult(resultEntity);
+ }
+ }
+
+
+
+ //鍙戣捣娴佺▼鐩稿叧
+
+ resultEntity = _wfRunProcessService.WfAskCar(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);
+ }
+
+ public IActionResult AskMarketingCost(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, "07").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();
+ }
+
+
+ /// <summary>
+ /// 淇濆瓨閿�鍞垂鐢ㄧ敵璇�
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult SaveAskMarketingCost(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.WfAskMarketingCost(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);
+ }
+
+ public IActionResult AskSuggestion(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, "08").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.Users = _userService.GetList().Where(x => x.Id != curentuser.Id).ToList();
+ }
+ else
+ {
+ ViewBag.Users = _userService.GetList();
+ }
+
+
+ ViewData.Model = dto;
+ return View();
+ }
+
+
+ /// <summary>
+ /// 淇濆瓨宸ヤ綔寤鸿
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult SaveAskSuggestion(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.WfAskSuggestion(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);
+ }
+
+
+ public IActionResult AskOther(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, "11").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();
+ }
+
+
+ /// <summary>
+ /// 淇濆瓨鍏朵粬璇风ず
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult SaveOther(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.WfAskMarketingCost(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);
+ }
+
+
+ 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.AddMonths(-2), DateTime.Now.Date.AddDays(1)).ToList();
+ }
+ else
+ {
+ ViewBag.AdmBreakPrecedentDTOs = _aAdmBreakPrecedentService.GetList(dto.Creater, DateTime.Now.Date.AddMonths(-2), 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);
+ }
+
+
+ public IActionResult AskYouHui(string id = "")
+ {
+ AdmAskYouHuiDTO dto = new AdmAskYouHuiDTO();
+ 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.GetAskYouHui(id);
+ dto.YouHuiName = dto.YouHui.Value.ToString("F2");
+
+ var wfRunProcessDTO = _wfRunProcessService.GetList(dto.Id, "12").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;
+
+ ViewBag.jtype = _liaotianService.GetSYScode("CooperVisit", "jtype");
+ ViewBag.standard = _liaotianService.GetSYScode("fi_piecerate", "standard");
+
+ ViewBag.CooperatecustomCustomerDTOs = _cooperatecustomCustomerService.GetList();
+
+ ViewData.Model = dto;
+ return View();
+ }
+
+
+ /// <summary>
+ /// 淇濆瓨閿�鍞垂鐢ㄧ敵璇�
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult SaveYouHui(AdmAskYouHuiDTO 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.SaveAskYouHui(data);
+ if (!resultEntity.Result)
+ {
+ return new JsonResult(resultEntity);
+ }
+ }
+
+
+
+ //鍙戣捣娴佺▼鐩稿叧
+
+ resultEntity = _wfRunProcessService.WfAskYouHui(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);
+ }
+
+ public IActionResult AskBaiFang(string id = "")
+ {
+ AdmAskBaiFangDTO dto = new AdmAskBaiFangDTO();
+ 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.GetAskBaiFang(id);
+ dto.BaiFangtimeName = dto.BaiFangtime.Value.ToString("yyyy-MM-dd");
+
+ var wfRunProcessDTO = _wfRunProcessService.GetList(dto.Id, "13").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;
+
+ 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 SaveBaiFang(AdmAskBaiFangDTO 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.SaveAskBaiFang(data);
+ if (!resultEntity.Result)
+ {
+ return new JsonResult(resultEntity);
+ }
+ }
+
+
+
+ //鍙戣捣娴佺▼鐩稿叧
+
+ resultEntity = _wfRunProcessService.WfAskBaiFang(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);
+ }
+
+
+ public IActionResult CustomerWithdrawal(string id = "")
+ {
+ AdmCustomerWithdrawalDTO dto = new AdmCustomerWithdrawalDTO();
+ 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.GetCustomerWithdrawal(id);
+ dto.ShenqingtimeName = dto.Shenqingtime.ToString("yyyy-MM-dd");
+ dto.JineName = dto.Jine.Value.ToString("F2");
+
+ var wfRunProcessDTO = _wfRunProcessService.GetList(dto.Id, "20").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;
+
+ //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 SaveCustomerWithdrawal(AdmCustomerWithdrawalDTO 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.SaveCustomerWithdrawal(data);
+ if (!resultEntity.Result)
+ {
+ return new JsonResult(resultEntity);
+ }
+ }
+
+
+
+ //鍙戣捣娴佺▼鐩稿叧
+
+ resultEntity = _wfRunProcessService.WfCustomerWithdrawal(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);
+ }
+
+ 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 == "鎬荤粡鐞嗗鎵�")
+ {
+ //鎬荤粡鐞嗗鎵瑰悓鎰忎箣鍚庯紝鎻掑叆宸ヤ綔浜ゆ帴
+ var askCiZhiDTO = _askService.GetAskCiZhi(resultEntity.ReturnID);
+ var pltUserDTO = _userService.GetPltUserEntity(askCiZhiDTO.Creater);
+ AdmAskJiaojieDTO admAskJiaojieDTO = new AdmAskJiaojieDTO();
+ admAskJiaojieDTO.CiZhiId = resultEntity.ReturnID;
+ admAskJiaojieDTO.Remark = "";
+ admAskJiaojieDTO.ShenpiStatus = "D";
+ admAskJiaojieDTO.RecStatus = "A";
+ admAskJiaojieDTO.Creater = askCiZhiDTO.Creater;
+ admAskJiaojieDTO.Createtime = DateTime.Now;
+ admAskJiaojieDTO.Modifier = askCiZhiDTO.Creater;
+ admAskJiaojieDTO.Modifytime = admAskJiaojieDTO.Createtime;
+ admAskJiaojieDTO.CreaterName = pltUserDTO.UserName;
+ admAskJiaojieDTO.Tittle = "宸ヤ綔浜ゆ帴(" + pltUserDTO.UserName + ")";
+
+ resultEntity = _askService.SaveAskJiaojie(admAskJiaojieDTO);
+ if (!resultEntity.Result)
+ {
+ return new JsonResult(resultEntity);
+ }
+ //鏌ヨ鍚堜綔瀹㈡埛
+ CooperatecustomCustomerDTOSearch searchEntity = new CooperatecustomCustomerDTOSearch();
+ searchEntity.page = 1;
+ searchEntity.rows = 10000;
+ searchEntity.Ywjl = admAskJiaojieDTO.Creater;
+ var resultDataEntity = _cooperatecustomCustomerService.SearchByPaging(searchEntity);
+ var cooperatecustomCustomerDTOs = resultDataEntity.DataList;
+ foreach (var cooperatecustomCustomerDTO in cooperatecustomCustomerDTOs)
+ {
+ AdmAskJiaojieDtlDTO admAskJiaojieDtl = new AdmAskJiaojieDtlDTO();
+ admAskJiaojieDtl.JiaojieId = admAskJiaojieDTO.Id;
+ admAskJiaojieDtl.Jiaojietime = DateTime.Now;
+ admAskJiaojieDtl.JiaojieType = "01";
+ admAskJiaojieDtl.Kehudanwei = cooperatecustomCustomerDTO.Name;
+ admAskJiaojieDtl.JiaojieStatus = "D";
+ admAskJiaojieDtl.RecStatus = "A";
+ admAskJiaojieDtl.Creater = admAskJiaojieDTO.Creater;
+ admAskJiaojieDtl.Createtime = admAskJiaojieDTO.Createtime;
+ admAskJiaojieDtl.Modifier = admAskJiaojieDTO.Creater;
+ admAskJiaojieDtl.Modifytime = admAskJiaojieDTO.Createtime;
+ resultEntity = _askService.SaveAskJiaojieDtl(admAskJiaojieDtl);
+ if (!resultEntity.Result)
+ {
+ return new JsonResult(resultEntity);
+ }
+ }
+
+ //鏌ヨ鎰忓悜瀹㈡埛
+ IntentionCustomerDTOSearch searchEntityin = new IntentionCustomerDTOSearch();
+ searchEntityin.page = 1;
+ searchEntityin.rows = 10000;
+ searchEntityin.YwjlYx = admAskJiaojieDTO.Creater;
+ searchEntityin.Ywjl = admAskJiaojieDTO.Creater;
+ searchEntityin.Yixiang = "05";
+ var resultDataEntity1 = _intentionCustomerService.SearchByPaging(searchEntityin);
+ var intentionCustomerDTOs = resultDataEntity1.DataList;
+ foreach (var intentionCustomerDTO in intentionCustomerDTOs)
+ {
+ AdmAskJiaojieDtlDTO admAskJiaojieDtl = new AdmAskJiaojieDtlDTO();
+ admAskJiaojieDtl.JiaojieId = admAskJiaojieDTO.Id;
+ admAskJiaojieDtl.Jiaojietime = DateTime.Now;
+ admAskJiaojieDtl.JiaojieType = "02";
+ admAskJiaojieDtl.Kehudanwei = intentionCustomerDTO.Name;
+ admAskJiaojieDtl.JiaojieStatus = "D";
+ admAskJiaojieDtl.RecStatus = "A";
+ admAskJiaojieDtl.Creater = admAskJiaojieDTO.Creater;
+ admAskJiaojieDtl.Createtime = admAskJiaojieDTO.Createtime;
+ admAskJiaojieDtl.Modifier = admAskJiaojieDTO.Creater;
+ admAskJiaojieDtl.Modifytime = admAskJiaojieDTO.Createtime;
+ resultEntity = _askService.SaveAskJiaojieDtl(admAskJiaojieDtl);
+ if (!resultEntity.Result)
+ {
+ return new JsonResult(resultEntity);
+ }
+ }
+ //鎻掑叆浜ゆ帴鏄庣粏
+
+
+
+ resultEntity = _wfRunProcessService.WfAskJiaojie(admAskJiaojieDTO.Id, "淇濆瓨", "A", admAskJiaojieDTO.Creater, "", admAskJiaojieDTO.Tittle, "v1");
+ if (!resultEntity.Result)
+ {
+ return new JsonResult(resultEntity);
+ }
+ }
+
+
+
+ //鍙戣捣娴佺▼鐩稿叧
+
+ 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);
+ }
+
+
+ public IActionResult AskJiaojie(AdmAskJiaojieDTO data)
+ {
+ AdmAskJiaojieDTO dto = new AdmAskJiaojieDTO();
+ 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(data.id))
+ {
+ dto.CreaterName = curentuser.UserName;
+ dto.Tittle = "宸ヤ綔浜ゆ帴锛�" + curentuser.UserName + "锛�";
+ dto.admAskJiaojieDtlDTOs = new List<AdmAskJiaojieDtlDTO>();
+ }
+ else if (dto != null)
+ {
+ dto = _askService.GetAskJiaojie(data.id);
+ dto.JiaojietimeStart = data.JiaojietimeStart;
+ dto.JiaojietimeEnd = data.JiaojietimeEnd;
+ dto.JiaojieStatus = data.JiaojieStatus;
+
+ dto.JiaojietimeStartName = dto.JiaojietimeStart.HasValue? dto.JiaojietimeStart.Value.ToString("yyyy-MM-dd"):"";
+ dto.JiaojietimeEndName = dto.JiaojietimeEnd.HasValue ? dto.JiaojietimeEnd.Value.ToString("yyyy-MM-dd") : "";
+ //dto.JineName = dto.Jine.Value.ToString("F2");
+ var admAskJiaojieDtlDTOs = _askService.GetAskJiaojieDtls(data.id);
+ if (!string.IsNullOrEmpty(data.JiaojieStatus))
+ {
+ admAskJiaojieDtlDTOs = admAskJiaojieDtlDTOs.Where(x => x.JiaojieStatus == data.JiaojieStatus).ToList();
+ }
+ if (data.JiaojietimeStart.HasValue)
+ {
+ admAskJiaojieDtlDTOs = admAskJiaojieDtlDTOs.Where(x => x.Jiaojietime >= data.JiaojietimeStart).ToList();
+ }
+ if (data.JiaojietimeEnd.HasValue)
+ {
+ admAskJiaojieDtlDTOs = admAskJiaojieDtlDTOs.Where(x => x.Jiaojietime <= data.JiaojietimeEnd.Value.AddDays(1)).ToList();
+ }
+
+ dto.admAskJiaojieDtlDTOs = admAskJiaojieDtlDTOs;
+ var wfRunProcessDTO = _wfRunProcessService.GetList(dto.Id, "22").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;
+
+ ViewBag.shifou = _liaotianService.GetSYScode("system", "shifou");
+ //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 SaveAskJiaojie(AdmAskJiaojieDTO 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.SaveAskJiaojie(data);
+ if (!resultEntity.Result)
+ {
+ return new JsonResult(resultEntity);
+ }
+ //鍙戣捣娴佺▼鐩稿叧
+
+ resultEntity = _wfRunProcessService.WfAskJiaojie(data.Id, data.Step, data.Tongguojujue, curentuser.Id, data.Content, data.Tittle, "v1");
+ if (!resultEntity.Result)
+ {
+ return new JsonResult(resultEntity);
+ }
+ }
+ else if (data.Step == "宸ヤ綔浜ゆ帴")
+ {
+ var ids = data.JiaojieDtlId.Split(',');
+ foreach(var id in ids)
+ {
+ if (string.IsNullOrEmpty(id))
+ {
+ continue;
+ }
+ var admAskJiaojieDtl = _askService.GetAskJiaojieDtl(id);
+ if (admAskJiaojieDtl.JiaojieStatus == "A")
+ {
+ continue;
+ }
+ else
+ {
+ admAskJiaojieDtl.JiaojieStatus = "A";
+ admAskJiaojieDtl.JiaojieUserId = curentuser.Id;
+ admAskJiaojieDtl.Jiaojietime = DateTime.Now;
+ admAskJiaojieDtl.JieShoutime = admAskJiaojieDtl.Jiaojietime;
+ admAskJiaojieDtl.Modifier = curentuser.Id; ;
+ admAskJiaojieDtl.Modifytime = admAskJiaojieDtl.Jiaojietime.Value;
+ resultEntity = _askService.SaveAskJiaojieDtl(admAskJiaojieDtl);
+ if (!resultEntity.Result)
+ {
+ return new JsonResult(resultEntity);
+ }
+ }
+ }
+ var admAskJiaojieDtls = _askService.GetAskJiaojieDtls(data.Id).Where(x => x.JiaojieStatus == "D").ToList();
+ if(admAskJiaojieDtls ==null || admAskJiaojieDtls.Count == 0)
+ {
+ //鍙戣捣娴佺▼鐩稿叧
+
+ resultEntity = _wfRunProcessService.WfAskJiaojie(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);
+ }
+
+ public IActionResult EditAskJiaojie(string id)
+ {
+ ViewBag.id = id;
+ ViewBag.JiaojieType = _liaotianService.GetSYScode("ADM_AskJiaojieDtl", "JiaojieType");
+ ViewData.Model = new AdmAskJiaojieDtlDTO();
+ return View();
+ }
+
+
+ /// <summary>
+ /// 淇濆瓨
+ /// </summary>
+ /// <param name="data">宀椾綅瀹炰綋绫诲璞�</param>
+ /// <returns></returns>
+ [HttpPost]
+
+ public string SaveAskJiaojieDtl(AdmAskJiaojieDtlDTO data)
+ {
+ var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+ ViewData["curentuser"] = curentuser;
+ data.RecStatus = "A";
+ data.JiaojieStatus = "D";
+ if (String.IsNullOrEmpty(data.Id))
+ {
+ data.Creater = curentuser.Id;
+ data.Createtime = DateTime.Now;
+ }
+ data.Modifier = curentuser.Id;
+ data.Modifytime = DateTime.Now;
+
+ ResultEntity resultEntity = _askService.SaveAskJiaojieDtl(data);
+
+ return JsonConvert.SerializeObject(resultEntity);
+ }
+
}
}
--
Gitblit v1.9.1