From 760eede869d8bc0b1b5a4ff38b2d3d94f5e2cb86 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期三, 04 八月 2021 14:29:15 +0800
Subject: [PATCH] 今日开发 专家派工-没有审批的专家不能派工 意向客户访问新增,短信发送不要红星 合作客户 在客户资料列表增加快捷访问链接 工作报表 修改排版 问题维护 试用法条 改为1000字, 问题查询打开直接默认未审核,不要停两秒再刷新 项目新增 增加字段:采购预算 万元 工作考评 考聘不称职当天无工资
---
zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs | 946 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 942 insertions(+), 4 deletions(-)
diff --git a/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs b/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs
index e668754..3b23945 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,20 @@
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;
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)
{
_logger = logger;
_hrDeptService = hrDeptService;
@@ -35,6 +46,11 @@
_wfHistoryService = wfHistoryService;
_wfNeeddeelService = wfNeeddeelService;
_admGoodsManageService = admGoodsManageService;
+ _liaotianService = liaotianService;
+ _userService = userService;
+ _aAdmBreakPrecedentService = aAdmBreakPrecedentService;
+ _cooperatecustomCustomerService = cooperatecustomCustomerService;
+ _intentionCustomerService = intentionCustomerService;
}
public IActionResult Askcost(string id = "")
@@ -68,7 +84,7 @@
else
{
dangqianbuzhou = wfRunProcessDTO.Step;
- //鏌ヨ鍘嗗彶鎰忚
+ //鏌ヨ瀹℃壒杩涘害
lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id);
if (wfRunProcessDTO.Step != "鎻愪氦")
{
@@ -177,7 +193,7 @@
else
{
dangqianbuzhou = wfRunProcessDTO.Step;
- //鏌ヨ鍘嗗彶鎰忚
+ //鏌ヨ瀹℃壒杩涘害
lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id);
if (wfRunProcessDTO.Step != "鎻愪氦")
{
@@ -307,7 +323,7 @@
else
{
dangqianbuzhou = wfRunProcessDTO.Step;
- //鏌ヨ鍘嗗彶鎰忚
+ //鏌ヨ瀹℃壒杩涘害
lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id);
if (wfRunProcessDTO.Step != "鎻愪氦")
{
@@ -383,5 +399,927 @@
}
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);
+ }
}
}
--
Gitblit v1.9.1