From 0c7e6deb5e426a53ce095ddff808168c26215d83 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 20 六月 2025 12:55:40 +0800
Subject: [PATCH] 提交
---
zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs | 1989 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 1,984 insertions(+), 5 deletions(-)
diff --git a/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs b/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs
index 347ea6c..66e6368 100644
--- a/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs
@@ -2,13 +2,18 @@
using IServices;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Net.Http;
+using System.Net.Http.Headers;
using System.Threading.Tasks;
using System.Transactions;
+using zhengcaioa.IService;
using zhengcaioa.Models;
namespace zhengcaioa.Controllers.admin
@@ -23,10 +28,34 @@
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;
+ private readonly IFiSubjectService _ifiSubjectService;
+ private readonly IFiAccountService _fiAccountService;
+
+ private readonly IFiAccountRecordService _iFiAccountRecordService;
+ private readonly IConfiguration _configuration;
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
+ , IFiSubjectService ifiSubjectService
+ , IFiAccountService fiAccountService
+ , IFiAccountRecordService iFiAccountRecordService
+ , IConfiguration configuration
+ )
{
_logger = logger;
_hrDeptService = hrDeptService;
@@ -35,6 +64,17 @@
_wfHistoryService = wfHistoryService;
_wfNeeddeelService = wfNeeddeelService;
_admGoodsManageService = admGoodsManageService;
+ _liaotianService = liaotianService;
+ _userService = userService;
+ _aAdmBreakPrecedentService = aAdmBreakPrecedentService;
+ _cooperatecustomCustomerService = cooperatecustomCustomerService;
+ _intentionCustomerService = intentionCustomerService;
+ _hrPositionService = hrPositionService;
+ _admGoodsRecordService = admGoodsRecordService;
+ _ifiSubjectService = ifiSubjectService;
+ _fiAccountService = fiAccountService;
+ _iFiAccountRecordService = iFiAccountRecordService;
+ _configuration = configuration;
}
public IActionResult Askcost(string id = "")
@@ -68,7 +108,7 @@
else
{
dangqianbuzhou = wfRunProcessDTO.Step;
- //鏌ヨ鍘嗗彶鎰忚
+ //鏌ヨ瀹℃壒杩涘害
lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id);
if (wfRunProcessDTO.Step != "鎻愪氦")
{
@@ -104,7 +144,7 @@
/// <summary>
- /// 淇濆瓨鐢宠瘔
+ /// 淇濆瓨璐圭敤鐢宠
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
@@ -177,7 +217,7 @@
else
{
dangqianbuzhou = wfRunProcessDTO.Step;
- //鏌ヨ鍘嗗彶鎰忚
+ //鏌ヨ瀹℃壒杩涘害
lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id);
if (wfRunProcessDTO.Step != "鎻愪氦")
{
@@ -215,7 +255,7 @@
/// <summary>
- /// 淇濆瓨鐢宠瘔
+ /// 淇濆瓨鐗╁搧鐢抽
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
@@ -258,6 +298,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);
}
@@ -272,5 +325,1931 @@
}
return new JsonResult(resultEntity);
}
+
+
+
+ public IActionResult Askovertime(string id = "")
+ {
+ AdmAskovertimeDTO dto = new AdmAskovertimeDTO();
+ 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.GetAskovertime(id);
+ dto.OvertimeName = dto.Overtime.Value.ToString("0.##");
+ dto.JiabantimeName = dto.Jiabantime.Value.ToString("yyyy-MM-dd");
+
+ var wfRunProcessDTO = _wfRunProcessService.GetList(dto.Id, "10").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 Askovertime(AdmAskovertimeDTO 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.SaveAskovertime(data);
+ if (!resultEntity.Result)
+ {
+ return new JsonResult(resultEntity);
+ }
+ }
+
+
+ //鍙戣捣娴佺▼鐩稿叧
+
+ resultEntity = _wfRunProcessService.WfAskovertime(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 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 =
+
+ if (dangqianbuzhou == "璐㈠姟瀹℃壒")
+ {
+ ViewBag.accounttype = _liaotianService.GetSYScode("fi_account", "accounttype");
+ ViewBag.FiSubject = _ifiSubjectService.GetList().Where(x => x.Subjecttype == "02").ToList();
+ }
+
+ 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);
+ }
+ }
+
+ if(data.Step == "璐㈠姟瀹℃壒" && data.Tongguojujue == "A")
+ {
+ WfRunProcessDTO wfRunProcessDTO = _wfRunProcessService.GetList(data.Id, "20").FirstOrDefault();
+
+ FiAccountRecordDTO datafi = new FiAccountRecordDTO();
+ datafi.Creater = curentuser.Id;
+ datafi.Createtime = DateTime.Now;
+ datafi.Modifier = curentuser.Id;
+ datafi.Modifytime = DateTime.Now;
+ datafi.AccountId = data.AccountId;
+ datafi.Accounttype = data.Accounttype;
+ datafi.SubjectId = data.SubjectId;
+ datafi.Money = data.Jine;
+ if(wfRunProcessDTO!=null)
+ datafi.OperationalMatters = data.Tittle + wfRunProcessDTO.Applyno;
+ datafi.PaymentUnit = data.Username;
+ FiAccountDTO firmAccount = _fiAccountService.Get(data.AccountId);
+
+
+ datafi.RecordTypeId = "2";//鏀嚭
+ //data.Department = "";
+
+ //resultEntity = _iFiAccountRecordService.save(data);
+
+ firmAccount.AllExpenses = (firmAccount.AllExpenses ?? 0) + datafi.Money;
+ firmAccount.Balance = (firmAccount.Balance ?? 0) - datafi.Money;
+
+ datafi.AccountMoney = firmAccount.Balance;
+
+ resultEntity = _iFiAccountRecordService.save(datafi);
+
+ resultEntity = _fiAccountService.save(firmAccount);
+ }
+
+
+ //鍙戣捣娴佺▼鐩稿叧
+
+ 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 CustomerRefund(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, "23").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 SaveCustomerRefund(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.WfCustomerRefund(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);
+ }
+
+
+
+
+
+ //鑾峰彇鎷涙爣淇℃伅缃戣瘯鐢ㄥ鎵�
+
+ public IActionResult AskZBXXW(string id = "")
+ {
+ AdmAskzczbwsyDTO dto = new AdmAskzczbwsyDTO();
+ 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.GetAskZBXXW(id);
+
+ var wfRunProcessDTO = _wfRunProcessService.GetList(dto.Id, "24").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.shiyongstandard = _liaotianService.GetSYScode("ADM_Askzczbwsy", "shiyongstandard");
+
+
+ //ViewBag.CooperatecustomCustomerDTOs = _cooperatecustomCustomerService.GetList();
+
+ ViewData.Model = dto;
+ return View();
+ }
+
+
+ /// <summary>
+ /// 淇濆瓨閿�鍞垂鐢ㄧ敵璇�
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult SaveZBXXW(AdmAskzczbwsyDTO 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.SaveAskZBXXW(data);
+ if (!resultEntity.Result)
+ {
+ return new JsonResult(resultEntity);
+ }
+ }
+ if (data.Step == "鎷涙爣淇℃伅缃戣瘯鐢ㄥ鎵�" && data.Tongguojujue == "A")
+ {
+ //璋冪敤鎺ュ彛寮�鍚敤鎴疯瘯鐢ㄦ潈闄�
+
+ var admAskzczbwsyDTO = _askService.GetAskZBXXW(data.Id);
+ var userDTO = _userService.GetPltUserEntity(admAskzczbwsyDTO.Creater);
+
+ string huiyuanurl = _configuration.GetSection("huiyuanurl").Value;
+ string SetCaseOrder = _configuration.GetSection("OASetOtherBusiness").Value;
+
+ Uri postUrl2 = new Uri(huiyuanurl + SetCaseOrder);
+ if (data.CustomerId != null && data.CustomerId.Length > 0)
+ {
+ for(int i=0;i< data.CustomerId.Length; i++)
+ {
+ if (data.Customertype[i] == "鍚堜綔瀹㈡埛")
+ {
+ var cooperatecustomCustomerDTO = _cooperatecustomCustomerService.Get(data.CustomerId[i]);
+ JObject questions2 = new JObject();
+ questions2.Add("UserID", cooperatecustomCustomerDTO.HuiyuanId);
+ questions2.Add("UserName", cooperatecustomCustomerDTO.Name);
+ questions2.Add("PhoneNumber", cooperatecustomCustomerDTO.Tel);
+ questions2.Add("BusinessKey", "CGGG");
+ if (admAskzczbwsyDTO.Shiyongstandard == "01")
+ {
+ questions2.Add("EndTime", DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd HH:mm:ss"));
+ }
+ else if (admAskzczbwsyDTO.Shiyongstandard == "02")
+ {
+ questions2.Add("EndTime", DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd HH:mm:ss"));
+ }
+ else if(admAskzczbwsyDTO.Shiyongstandard == "03")
+ {
+ questions2.Add("EndTime", DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd HH:mm:ss"));
+ }
+
+
+
+
+ questions2.Add("FromName", userDTO.UserName +" " +userDTO.Phone);
+ questions2.Add("Describe", "OA");
+
+
+ string requestJson2 = questions2.ToString();
+ string result2 = string.Empty;
+
+ using (HttpContent httpContent = new StringContent(requestJson2))
+ {
+ httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
+
+
+ using (HttpClient httpClient = new HttpClient())
+ {
+ httpClient.Timeout = new TimeSpan(0, 0, 10);
+ HttpResponseMessage responseMessage = httpClient.PostAsync(postUrl2, httpContent).Result;
+ result2 = responseMessage.Content.ReadAsStringAsync().Result;
+ }
+ }
+
+ _logger.LogInformation("result2:" + result2);
+ JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2);
+
+ if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1")
+ {
+ cooperatecustomCustomerDTO.HuiyuanId = jobjectresult["UserID"].ToString();
+ _cooperatecustomCustomerService.save(cooperatecustomCustomerDTO);
+ resultEntity.Result = true;
+ }
+ else
+ {
+ resultEntity.Result = false;
+ resultEntity.Message = "寮�閫氭嫑鏍囦俊鎭綉璇曠敤鏉冮檺澶辫触";
+ return new JsonResult(resultEntity);
+ }
+ }
+ else
+ {
+ var cooperatecustomCustomerDTO = _intentionCustomerService.Get(data.CustomerId[i]);
+ JObject questions2 = new JObject();
+ questions2.Add("UserID", cooperatecustomCustomerDTO.HuiyuanId);
+ questions2.Add("UserName", cooperatecustomCustomerDTO.Name);
+ questions2.Add("PhoneNumber", cooperatecustomCustomerDTO.Tel);
+ questions2.Add("BusinessKey", "CGGG");
+ if (admAskzczbwsyDTO.Shiyongstandard == "01")
+ {
+ questions2.Add("EndTime", DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd HH:mm:ss"));
+ }
+ else if (admAskzczbwsyDTO.Shiyongstandard == "02")
+ {
+ questions2.Add("EndTime", DateTime.Now.AddMonths(2).ToString("yyyy-MM-dd HH:mm:ss"));
+ }
+ else if (admAskzczbwsyDTO.Shiyongstandard == "03")
+ {
+ questions2.Add("EndTime", DateTime.Now.AddMonths(3).ToString("yyyy-MM-dd HH:mm:ss"));
+ }
+
+
+
+
+ questions2.Add("FromName", userDTO.UserName + " " + userDTO.Phone);
+ questions2.Add("Describe", "OA");
+
+
+
+ string requestJson2 = questions2.ToString();
+ string result2 = string.Empty;
+
+ using (HttpContent httpContent = new StringContent(requestJson2))
+ {
+ httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
+
+
+ using (HttpClient httpClient = new HttpClient())
+ {
+ httpClient.Timeout = new TimeSpan(0, 0, 10);
+ HttpResponseMessage responseMessage = httpClient.PostAsync(postUrl2, httpContent).Result;
+ result2 = responseMessage.Content.ReadAsStringAsync().Result;
+ }
+ }
+
+ _logger.LogInformation("result2:" + result2);
+ JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2);
+
+ if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1")
+ {
+ cooperatecustomCustomerDTO.HuiyuanId = jobjectresult["UserID"].ToString();
+ _intentionCustomerService.save(cooperatecustomCustomerDTO);
+ resultEntity.Result = true;
+ }
+ else
+ {
+ resultEntity.Result = false;
+ resultEntity.Message = "寮�閫氭嫑鏍囦俊鎭綉璇曠敤鏉冮檺澶辫触";
+ return new JsonResult(resultEntity);
+ }
+ }
+
+
+
+ }
+ }
+
+
+
+
+
+
+ }
+
+
+ //鍙戣捣娴佺▼鐩稿叧
+
+ resultEntity = _wfRunProcessService.WfAskZBXXW(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