using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using AutoMapper;
|
using AngleSharp.Html.Parser;
|
using DTO;
|
using IServices;
|
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.Bot.Builder.Integration.AspNet.Core;
|
using Microsoft.Extensions.Logging;
|
using Newtonsoft.Json;
|
using System.Net.Http;
|
using System.Threading.Tasks;
|
using zhengcaioa.Models;
|
using zhengcaioa.IService;
|
using CommonToolsCore;
|
using Services;
|
using System.Transactions;
|
using System.IdentityModel.Tokens.Jwt;
|
using Microsoft.Extensions.Configuration;
|
using Newtonsoft.Json.Linq;
|
using System.Net.Http.Headers;
|
|
namespace zhengcaioa.Controllers.BusinessOrder
|
{
|
|
public class CooperOrderController : Controller
|
{
|
private readonly ILogger<CooperOrderController> _logger;
|
private readonly ILiaotianService _liaotianService;
|
private readonly IUserService _userService;
|
private readonly ICooperOrderService _cooperOrderService;
|
private readonly ICooperatecustomCustomerService _cooperatecustomCustomerService;
|
private readonly IProjectService _projectService;
|
private readonly IPltPageService _pltPageService;
|
private readonly IFiBookService _fiBookService;
|
private readonly IFiServiceService _fiServiceService;
|
private readonly IFiMemberService _fiMemberService;
|
private readonly IConfiguration _configuration;
|
private readonly IHttpClientFactory _clientFactory;
|
private readonly IAskService _askService;
|
private readonly IAdmGoodsRecordService _admGoodsRecordService;
|
|
private readonly IAdmGoodsManageService _admGoodsManageService;
|
private readonly IFiOrderrecievemoneyService _fiOrderrecievemoneyService;
|
private readonly IFiAccountService _fiAccountService;
|
private readonly IFiAccountRecordService _iFiAccountRecordService;
|
|
|
public CooperOrderController(ILogger<CooperOrderController> logger, ILiaotianService liaotianService, IUserService userService, ICooperOrderService cooperOrderService
|
, ICooperatecustomCustomerService cooperatecustomCustomerService, IProjectService projectService, IPltPageService pltPageService, IFiBookService fiBookService
|
, IFiServiceService fiServiceService, IFiMemberService fiMemberService
|
, IConfiguration configuration
|
, IHttpClientFactory clientFactory
|
, IAskService askService
|
, IAdmGoodsRecordService admGoodsRecordService
|
, IAdmGoodsManageService admGoodsManageService
|
, IFiOrderrecievemoneyService fiOrderrecievemoneyService
|
, IFiAccountService fiAccountService
|
, IFiAccountRecordService iFiAccountRecordService
|
)
|
{
|
_logger = logger;
|
_liaotianService = liaotianService;
|
_userService = userService;
|
_cooperOrderService = cooperOrderService;
|
_cooperatecustomCustomerService = cooperatecustomCustomerService;
|
_projectService = projectService;
|
_pltPageService = pltPageService;
|
_fiBookService = fiBookService;
|
_fiServiceService = fiServiceService;
|
_fiMemberService = fiMemberService;
|
_configuration = configuration;
|
_clientFactory = clientFactory;
|
_askService = askService;
|
_admGoodsRecordService = admGoodsRecordService;
|
_admGoodsManageService = admGoodsManageService;
|
_fiOrderrecievemoneyService = fiOrderrecievemoneyService;
|
_fiAccountService = fiAccountService;
|
_iFiAccountRecordService = iFiAccountRecordService;
|
}
|
|
[CheckLogin]
|
public IActionResult Index()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
ActionEntity actionEntity1 = new ActionEntity();
|
actionEntity1.OpenType = 0;
|
actionEntity1.ActionUrl = "";
|
actionEntity1.ActionFun = "Add";
|
actionEntity1.PageIco = "fa fa-plus";
|
actionEntity1.ActionName = "新增";
|
actionlist.Add(actionEntity1);
|
|
ActionEntity actionEntity3 = new ActionEntity();
|
actionEntity3.OpenType = 0;
|
actionEntity3.ActionUrl = "";
|
actionEntity3.ActionFun = "Print";
|
actionEntity3.PageIco = "fa fa-print";
|
actionEntity3.ActionName = "打印";
|
actionlist.Add(actionEntity3);
|
|
ViewData["ActionInfo"] = actionlist;
|
|
List<PageEntity> pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/CooperOrder/Index/");
|
|
ViewBag.pageEntities = pageEntities;
|
|
ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList();
|
|
ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.ShouliStatus = _liaotianService.GetSYScode("CooperOrder", "shouli_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
return View();
|
|
}
|
|
|
|
[CheckLogin]
|
public IActionResult GetList(CooperOrderDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
//search.Creater = curentuser.Id;
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_cooperOrderService.SearchByPaging(search));
|
}
|
|
[CheckLogin]
|
public IActionResult ShouliList()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
|
ViewData["ActionInfo"] = actionlist;
|
|
ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList();
|
|
ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
return View();
|
|
}
|
[CheckLogin]
|
public IActionResult GetListshouli(CooperOrderDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
//search.ShouliStatus = "A";
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_cooperOrderService.SearchByPaging(search));
|
}
|
|
|
[CheckLogin]
|
public IActionResult ChedanList()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
|
ViewData["ActionInfo"] = actionlist;
|
|
ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList();
|
|
ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
return View();
|
|
}
|
[CheckLogin]
|
public IActionResult GetListchedan(CooperOrderDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
//search.ShouliStatus = "A";
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_cooperOrderService.SearchByPaging(search));
|
}
|
|
[CheckLogin]
|
public IActionResult WangongList()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
|
ViewData["ActionInfo"] = actionlist;
|
|
ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList();
|
|
ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
return View();
|
|
}
|
[CheckLogin]
|
public IActionResult GetListwangong(CooperOrderDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
search.ShouliStatus = "A";
|
search.ChedanStatus = "D";
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_cooperOrderService.SearchByPaging(search));
|
}
|
[CheckLogin]
|
public IActionResult SonghuoList()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
|
|
|
ViewData["ActionInfo"] = actionlist;
|
|
ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList();
|
|
ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
return View();
|
|
}
|
[CheckLogin]
|
public IActionResult GetListsonghuo(CooperOrderDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
search.WangongStatus = "A";
|
search.ChedanStatus = "D";
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_cooperOrderService.SearchByPaging(search));
|
}
|
[CheckLogin]
|
public IActionResult HuifangList()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
|
ViewData["ActionInfo"] = actionlist;
|
|
ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList();
|
|
ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
return View();
|
|
}
|
[CheckLogin]
|
public IActionResult GetListHuifang(CooperOrderDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
search.SonghuoStatus = "A";
|
search.ChedanStatus = "D";
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_cooperOrderService.SearchByPaging(search));
|
}
|
[CheckLogin]
|
public IActionResult PingjiaList()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
|
ViewData["ActionInfo"] = actionlist;
|
|
ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList();
|
|
ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
return View();
|
|
}
|
[CheckLogin]
|
public IActionResult GetListPingjia(CooperOrderDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
search.HuifangStatussss = "A";
|
search.ChedanStatus = "D";
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_cooperOrderService.SearchByPaging(search));
|
}
|
|
public IActionResult YouhuiList()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
|
|
|
ViewData["ActionInfo"] = actionlist;
|
|
ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList();
|
|
ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
return View();
|
|
}
|
[CheckLogin]
|
public IActionResult GetListYouhui(CooperOrderDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
search.ShouliStatus = "A";
|
search.ChedanStatus = "D";
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_cooperOrderService.SearchByPaging(search));
|
}
|
[CheckLogin]
|
public IActionResult Edit(string id = null, string ShouliStatus = "1")
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
CooperOrderDTO dto = new CooperOrderDTO();
|
if (!String.IsNullOrEmpty(id))
|
{
|
dto = _cooperOrderService.Get(id);
|
ViewBag.ShouliStatus = ShouliStatus;
|
//ViewBag.YouHuiList = _askService.GetAskYouHuiList(dto.Khdw, dto.OrderType);
|
//质疑函
|
List<TChallengeletterDTO> challengeletterDTOs = _cooperOrderService.GetListChallengeletter(id);
|
TChallengeletterDTO challengeletterDTO = new TChallengeletterDTO();
|
if (challengeletterDTOs!=null&& challengeletterDTOs.Count > 0)
|
{
|
challengeletterDTO = challengeletterDTOs[0];
|
if (challengeletterDTO.DocumentsDate.HasValue)
|
{
|
challengeletterDTO.DocumentsDateName = challengeletterDTO.DocumentsDate.Value.ToString("yyyy-MM-dd");
|
}
|
List<TChallengeItemDTO> challengeItemDTOs = _cooperOrderService.GetListChallengeItem(challengeletterDTO.Id);
|
if(challengeItemDTOs.Count>0)
|
challengeletterDTO.challengeItemDTOs = challengeItemDTOs;
|
else
|
challengeletterDTO.challengeItemDTOs = new List<TChallengeItemDTO>() { new TChallengeItemDTO() };
|
List<TComplaintShouquandaibiaoDTO> complaintShouquandaibiaoDTOs = _cooperOrderService.GetListComplaintShouquandaibiao(challengeletterDTO.Id);
|
if (complaintShouquandaibiaoDTOs.Count > 0)
|
challengeletterDTO.complaintShouquandaibiaoDTOs = complaintShouquandaibiaoDTOs;
|
else
|
challengeletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
|
}
|
else
|
{
|
challengeletterDTO.challengeItemDTOs = new List<TChallengeItemDTO>() { new TChallengeItemDTO() };
|
challengeletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
}
|
ViewBag.challengeletterDTO = challengeletterDTO;
|
//投诉书
|
List<TComplaintletterDTO> complaintletterDTOs = _cooperOrderService.GetListComplaintletter(id);
|
TComplaintletterDTO complaintletterDTO = new TComplaintletterDTO();
|
if (complaintletterDTOs != null && complaintletterDTOs.Count > 0)
|
{
|
complaintletterDTO = complaintletterDTOs[0];
|
|
if (complaintletterDTO.NoticeDate.HasValue)
|
{
|
complaintletterDTO.NoticeDateName = complaintletterDTO.NoticeDate.Value.ToString("yyyy-MM-dd");
|
}
|
|
if (complaintletterDTO.ResultnoticeDate.HasValue)
|
{
|
complaintletterDTO.ResultnoticeDateName = complaintletterDTO.ResultnoticeDate.Value.ToString("yyyy-MM-dd");
|
}
|
|
List<TComplaintItemDTO> complaintItemDTOs = _cooperOrderService.GetListComplaintItem(complaintletterDTO.Id);
|
if (complaintItemDTOs.Count > 0)
|
complaintletterDTO.complaintItemDTOs = complaintItemDTOs;
|
else
|
complaintletterDTO.complaintItemDTOs = new List<TComplaintItemDTO>() { new TComplaintItemDTO() };
|
|
List<TComplaintRespondentDTO> complaintRespondentDTOs = _cooperOrderService.GetListComplaintRespondent(complaintletterDTO.Id);
|
if (complaintRespondentDTOs.Count > 0)
|
complaintletterDTO.complaintRespondentDTOs = complaintRespondentDTOs;
|
else
|
complaintletterDTO.complaintRespondentDTOs = new List<TComplaintRespondentDTO>() { new TComplaintRespondentDTO() };
|
|
List<TComplaintShouquandaibiaoDTO> complaintShouquandaibiaoDTOs = _cooperOrderService.GetListComplaintShouquandaibiao(complaintletterDTO.Id);
|
if (complaintShouquandaibiaoDTOs.Count > 0)
|
complaintletterDTO.complaintShouquandaibiaoDTOs = complaintShouquandaibiaoDTOs;
|
else
|
complaintletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
|
List<TComplaintGongyingshangDTO> complaintGongyingshangDTOs = _cooperOrderService.GetListComplaintGongyingshang(complaintletterDTO.Id);
|
if (complaintGongyingshangDTOs.Count > 0)
|
complaintletterDTO.complaintGongyingshangDTOs = complaintGongyingshangDTOs;
|
else
|
complaintletterDTO.complaintGongyingshangDTOs = new List<TComplaintGongyingshangDTO>() { new TComplaintGongyingshangDTO() };
|
|
}
|
else
|
{
|
complaintletterDTO.complaintItemDTOs = new List<TComplaintItemDTO>() { new TComplaintItemDTO() };
|
complaintletterDTO.complaintRespondentDTOs = new List<TComplaintRespondentDTO>() { new TComplaintRespondentDTO() };
|
complaintletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
complaintletterDTO.complaintGongyingshangDTOs = new List<TComplaintGongyingshangDTO>() { new TComplaintGongyingshangDTO() };
|
|
}
|
ViewBag.complaintletterDTO = complaintletterDTO;
|
}
|
else
|
{
|
dto.XdTime = DateTime.Now;
|
dto.OrderNum = 1;
|
ViewBag.ShouliStatus = "1";
|
dto.OrderNo = _cooperOrderService.GetOrderNo();
|
//ViewBag.YouHuiList = new List<AdmAskYouHuiDTO>();
|
//质疑函
|
TChallengeletterDTO challengeletterDTO = new TChallengeletterDTO();
|
challengeletterDTO.challengeItemDTOs = new List<TChallengeItemDTO>() { new TChallengeItemDTO() };
|
challengeletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
ViewBag.challengeletterDTO = challengeletterDTO;
|
//投诉书
|
TComplaintletterDTO complaintletterDTO = new TComplaintletterDTO();
|
complaintletterDTO.complaintItemDTOs = new List<TComplaintItemDTO>() { new TComplaintItemDTO() };
|
complaintletterDTO.complaintRespondentDTOs = new List<TComplaintRespondentDTO>() { new TComplaintRespondentDTO()};
|
complaintletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
complaintletterDTO.complaintGongyingshangDTOs = new List<TComplaintGongyingshangDTO>() { new TComplaintGongyingshangDTO() };
|
ViewBag.complaintletterDTO = complaintletterDTO;
|
|
}
|
ViewBag.request_info = _liaotianService.GetSYScode("t_challengeletter", "request_info");//质疑请求
|
ViewBag.question = _liaotianService.GetSYScode("t_challenge_items", "question"); // 质疑事项
|
ViewBag.law = _liaotianService.GetSYScode("t_complaint_items", "law");//法律依据
|
|
|
|
|
ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype");
|
|
ViewBag.shifou = _liaotianService.GetSYScode("system", "shifou");
|
|
ViewBag.customer = _cooperatecustomCustomerService.GetList();
|
|
//ViewBag.project = _projectService.GetList();
|
|
|
|
|
ViewData.Model = dto;
|
return View();
|
}
|
|
|
/// <summary>
|
/// 获取市
|
/// </summary>
|
/// <param name="shengid">省id</param>
|
/// <returns></returns>
|
///
|
[CheckLogin]
|
public string getProject()
|
{
|
var shi = _projectService.GetList().Select(x => new { Id = x.Id, Name = x.Name }).ToList(); ;
|
|
return JsonConvert.SerializeObject(shi);
|
|
}
|
|
|
|
/// <summary>
|
/// 保存
|
/// </summary>
|
/// <param name="data">岗位实体类对象</param>
|
/// <returns></returns>
|
///
|
[CheckLogin]
|
[HttpPost]
|
public async Task<IActionResult> SaveAsync(CooperOrderDTO data)
|
{
|
ResultEntity resultEntity = new ResultEntity();
|
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
data.RecStatus = "A";
|
if (String.IsNullOrEmpty(data.Id))
|
{
|
data.Creater = curentuser.Id;
|
data.Createtime = DateTime.Now;
|
data.XdTime = data.Createtime;
|
if (data.OrderType == "03" || data.OrderType == "07" || (data.OrderType == "02" && (data.OrderType1 == "代拟投诉书" || data.OrderType1 == "代拟质疑函")))
|
{
|
var cooperatecustomCustomerDTO = _cooperatecustomCustomerService.Get(data.Khdw);
|
if (cooperatecustomCustomerDTO != null && !string.IsNullOrEmpty(cooperatecustomCustomerDTO.HuiyuanId))
|
{
|
string huiyuanurl = _configuration.GetSection("huiyuanurl").Value;
|
string SetCaseOrder = _configuration.GetSection("SetCaseOrder").Value;
|
|
Uri postUrl2 = new Uri(huiyuanurl + SetCaseOrder);
|
|
JObject questions2 = new JObject();
|
questions2.Add("UserID", cooperatecustomCustomerDTO.HuiyuanId);
|
if (data.OrderType == "03")
|
{
|
questions2.Add("CaseType", 0);
|
}
|
else if (data.OrderType == "07")
|
{
|
questions2.Add("CaseType", 1);
|
}
|
else if (data.OrderType == "07")
|
{
|
questions2.Add("CaseType", 1);
|
}
|
else if (data.OrderType == "02" && (data.OrderType1 == "代拟投诉书" || data.OrderType1 == "代拟质疑函"))
|
{
|
questions2.Add("CaseType", 2);
|
}
|
|
questions2.Add("count", Decimal.ToInt32(data.OrderNum.Value) );
|
|
string requestJson2 = questions2.ToString();
|
string result2 = string.Empty;
|
|
using (HttpContent httpContent = new StringContent(requestJson2))
|
{
|
httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
|
var httpClient2 = _clientFactory.CreateClient();
|
httpClient2.Timeout = new TimeSpan(0, 0, 10);
|
var Result2 = await httpClient2.PostAsync(postUrl2, httpContent);
|
result2 = Result2.Content.ReadAsStringAsync().Result;
|
}
|
|
_logger.LogInformation("result2:" + result2);
|
JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2);
|
|
if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1")
|
{
|
resultEntity.Result = true;
|
}
|
else
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "写入会员订单失败";
|
return new JsonResult(resultEntity);
|
}
|
}
|
}
|
|
|
|
|
|
}
|
|
using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
|
new TransactionOptions
|
{
|
IsolationLevel = IsolationLevel.ReadCommitted,
|
Timeout = TransactionManager.MaximumTimeout
|
}
|
))
|
{
|
|
var youHuiDTOs = _askService.GetAskYouHuiList(data.Khdw, data.OrderType).FirstOrDefault();
|
if (youHuiDTOs != null)
|
{
|
data.Youhuier = youHuiDTOs.Id;
|
if (youHuiDTOs.Youhuistandard == "01")
|
{
|
data.Youhui = youHuiDTOs.YouHui.Value;
|
if (data.Money.Value < data.Youhui.Value)
|
{
|
data.Money = 0;
|
}
|
else
|
{
|
data.Money = data.Money.Value - data.Youhui.Value;
|
}
|
|
}
|
else if (youHuiDTOs.Youhuistandard == "02")
|
{
|
if (youHuiDTOs.YouHui.Value >= 100)
|
{
|
data.Youhui = data.Money.Value;
|
data.Money = 0;
|
}
|
else
|
{
|
data.Youhui = Math.Round(data.Money.Value * youHuiDTOs.YouHui.Value * new decimal(0.01), 2);
|
data.Money = data.Money.Value - data.Youhui.Value;
|
}
|
}
|
|
|
}
|
|
data.ShouliStatus = "1";
|
data.Modifier = curentuser.Id;
|
data.Modifytime = DateTime.Now;
|
|
resultEntity = _cooperOrderService.save(data);
|
|
if (data.OrderType1 == "代拟投诉书")
|
{
|
//查询主表
|
var complaintletterDTO = _cooperOrderService.GetListComplaintletter(data.Id).FirstOrDefault();
|
if (complaintletterDTO != null)
|
{
|
complaintletterDTO.TsrName = data.TsrName;
|
complaintletterDTO.TsrAddress = data.TsrAddress;
|
complaintletterDTO.TsrPostcode = data.TsrPostcode;
|
complaintletterDTO.TsrCorporation = data.TsrCorporation;
|
complaintletterDTO.TsrPhone = data.TsrPhone;
|
|
complaintletterDTO.XmName = data.tousuXmName;
|
complaintletterDTO.XmCode = data.tousuXmCode;
|
complaintletterDTO.XmPackage = data.tousuXmPackage;
|
complaintletterDTO.PurchaserName = data.tousuPurchaserName;
|
|
complaintletterDTO.Agency = data.tousuAgency;
|
complaintletterDTO.IsNotice = data.tousuIsNotice;
|
complaintletterDTO.NoticeDate = data.tousuNoticeDate;
|
complaintletterDTO.IsResultnotice = data.tousuIsResultnotice;
|
complaintletterDTO.ResultnoticeDate = data.tousuResultnoticeDate;
|
complaintletterDTO.Modifier = curentuser.Id;
|
complaintletterDTO.Modifytime = DateTime.Now;
|
complaintletterDTO.Status = 1;
|
resultEntity = _cooperOrderService.saveComplaintletter(complaintletterDTO);
|
}
|
else
|
{
|
complaintletterDTO = new TComplaintletterDTO();
|
complaintletterDTO.OrderId = data.Id;
|
complaintletterDTO.TsrName = data.TsrName;
|
complaintletterDTO.TsrAddress = data.TsrAddress;
|
complaintletterDTO.TsrPostcode = data.TsrPostcode;
|
complaintletterDTO.TsrCorporation = data.TsrCorporation;
|
complaintletterDTO.TsrPhone = data.TsrPhone;
|
|
complaintletterDTO.XmName = data.tousuXmName;
|
complaintletterDTO.XmCode = data.tousuXmCode;
|
complaintletterDTO.XmPackage = data.tousuXmPackage;
|
complaintletterDTO.PurchaserName = data.tousuPurchaserName;
|
|
complaintletterDTO.Agency = data.tousuAgency;
|
complaintletterDTO.IsNotice = data.tousuIsNotice;
|
complaintletterDTO.NoticeDate = data.tousuNoticeDate;
|
complaintletterDTO.IsResultnotice = data.tousuIsResultnotice;
|
complaintletterDTO.ResultnoticeDate = data.tousuResultnoticeDate;
|
complaintletterDTO.Modifier = curentuser.Id;
|
complaintletterDTO.Modifytime = DateTime.Now;
|
complaintletterDTO.Creater = curentuser.Id;
|
complaintletterDTO.Createtime = complaintletterDTO.Modifytime;
|
complaintletterDTO.Status = 1;
|
resultEntity = _cooperOrderService.saveComplaintletter(complaintletterDTO);
|
}
|
resultEntity = _cooperOrderService.deleteComplaintShouquandaibiao(complaintletterDTO.Id);
|
if (data.tousuShouquandaibiao != null && data.tousuShouquandaibiao.Length > 0)
|
{
|
for (int i = 0; i < data.tousuShouquandaibiao.Length; i++)
|
{
|
if (!(string.IsNullOrEmpty(data.tousuShouquandaibiao[i])
|
&& string.IsNullOrEmpty(data.tousuLianxidianhua[i])
|
&& string.IsNullOrEmpty(data.tousuDizhi[i])
|
&& string.IsNullOrEmpty(data.tousuYoubian[i])))
|
{
|
var complaintShouquandaibiaoDTO = new TComplaintShouquandaibiaoDTO();
|
complaintShouquandaibiaoDTO.ComplaintId = complaintletterDTO.Id;
|
complaintShouquandaibiaoDTO.Shouquandaibiao = data.tousuShouquandaibiao[i];
|
complaintShouquandaibiaoDTO.Lianxidianhua = data.tousuLianxidianhua[i];
|
complaintShouquandaibiaoDTO.Dizhi = data.tousuDizhi[i];
|
complaintShouquandaibiaoDTO.Youbian = data.tousuYoubian[i];
|
complaintShouquandaibiaoDTO.Sort = i;
|
resultEntity = _cooperOrderService.saveComplaintShouquandaibiao(complaintShouquandaibiaoDTO);
|
}
|
|
}
|
}
|
|
|
resultEntity = _cooperOrderService.deleteComplaintRespondent(complaintletterDTO.Id);
|
if (data.tousuRespondent != null && data.tousuRespondent.Length > 0)
|
{
|
for (int i = 0; i < data.tousuRespondent.Length; i++)
|
{
|
if (!(string.IsNullOrEmpty(data.tousuRespondent[i])
|
&& string.IsNullOrEmpty(data.tousuAddress[i])
|
&& string.IsNullOrEmpty(data.tousuPostcode[i])
|
&& string.IsNullOrEmpty(data.tousuContacts[i])
|
&& string.IsNullOrEmpty(data.tousuPhone[i])))
|
{
|
var complaintRespondentDTO = new TComplaintRespondentDTO();
|
complaintRespondentDTO.ComplaintId = complaintletterDTO.Id;
|
complaintRespondentDTO.Respondent = data.tousuRespondent[i];
|
complaintRespondentDTO.Address = data.tousuAddress[i];
|
complaintRespondentDTO.Postcode = data.tousuPostcode[i];
|
complaintRespondentDTO.Contacts = data.tousuContacts[i];
|
complaintRespondentDTO.Phone = data.tousuPhone[i];
|
complaintRespondentDTO.Sort = i;
|
resultEntity = _cooperOrderService.saveComplaintRespondent(complaintRespondentDTO);
|
}
|
|
}
|
}
|
|
resultEntity = _cooperOrderService.deleteComplaintGongyingshang(complaintletterDTO.Id);
|
if (data.Gongytingshang != null && data.Gongytingshang.Length > 0)
|
{
|
for (int i = 0; i < data.Gongytingshang.Length; i++)
|
{
|
if (!(string.IsNullOrEmpty(data.Gongytingshang[i])
|
&& string.IsNullOrEmpty(data.gongyingshangYoubian[i])
|
&& string.IsNullOrEmpty(data.gongyingshangLianxiren[i])
|
&& string.IsNullOrEmpty(data.gongyingshangLianxidianhua[i])
|
&& string.IsNullOrEmpty(data.gongyingshangDizhi[i])))
|
{
|
var complaintGongyingshangDTO = new TComplaintGongyingshangDTO();
|
complaintGongyingshangDTO.ComplaintId = complaintletterDTO.Id;
|
complaintGongyingshangDTO.Gongytingshang = data.Gongytingshang[i];
|
complaintGongyingshangDTO.Youbian = data.gongyingshangYoubian[i];
|
complaintGongyingshangDTO.Lianxiren = data.gongyingshangLianxiren[i];
|
complaintGongyingshangDTO.Lianxidianhua = data.gongyingshangLianxidianhua[i];
|
complaintGongyingshangDTO.Dizhi = data.gongyingshangDizhi[i];
|
complaintGongyingshangDTO.Sort = i;
|
resultEntity = _cooperOrderService.saveComplaintGongyingshang(complaintGongyingshangDTO);
|
}
|
|
}
|
}
|
|
}
|
else if (data.OrderType1 == "代拟质疑函")
|
{
|
//查询主表
|
var challengeletterDTO = _cooperOrderService.GetListChallengeletter(data.Id).FirstOrDefault();
|
if (challengeletterDTO != null)
|
{
|
challengeletterDTO.GysName = data.GysName;
|
challengeletterDTO.GysAddress = data.GysAddress;
|
challengeletterDTO.GysPostcode = data.GysPostcode;
|
challengeletterDTO.GysContacts = data.GysContacts;
|
challengeletterDTO.GysPhone = data.GysPhone;
|
|
challengeletterDTO.XmName = data.zhiyiXmName;
|
challengeletterDTO.XmCode = data.zhiyiXmCode;
|
challengeletterDTO.XmPackage = data.zhiyiXmPackage;
|
challengeletterDTO.PurchaserName = data.zhiyiPurchaserName;
|
challengeletterDTO.DocumentsDate = data.zhiyiDocumentsDate;
|
challengeletterDTO.Modifier = curentuser.Id;
|
challengeletterDTO.Modifytime = DateTime.Now;
|
challengeletterDTO.Status = 1;
|
resultEntity = _cooperOrderService.saveChallengeletter(challengeletterDTO);
|
}
|
else
|
{
|
challengeletterDTO = new TChallengeletterDTO();
|
challengeletterDTO.OrderId = data.Id;
|
challengeletterDTO.GysName = data.GysName;
|
challengeletterDTO.GysAddress = data.GysAddress;
|
challengeletterDTO.GysPostcode = data.GysPostcode;
|
challengeletterDTO.GysContacts = data.GysContacts;
|
challengeletterDTO.GysPhone = data.GysPhone;
|
|
challengeletterDTO.XmName = data.zhiyiXmName;
|
challengeletterDTO.XmCode = data.zhiyiXmCode;
|
challengeletterDTO.XmPackage = data.zhiyiXmPackage;
|
challengeletterDTO.PurchaserName = data.zhiyiPurchaserName;
|
challengeletterDTO.DocumentsDate = data.zhiyiDocumentsDate;
|
challengeletterDTO.Modifier = curentuser.Id;
|
challengeletterDTO.Modifytime = DateTime.Now;
|
challengeletterDTO.Creater = curentuser.Id;
|
challengeletterDTO.Createtime = challengeletterDTO.Modifytime;
|
challengeletterDTO.Status = 1;
|
resultEntity = _cooperOrderService.saveChallengeletter(challengeletterDTO);
|
}
|
|
resultEntity = _cooperOrderService.deleteComplaintShouquandaibiao(challengeletterDTO.Id);
|
if (data.zhiyiShouquandaibiao != null && data.zhiyiShouquandaibiao.Length > 0)
|
{
|
for (int i = 0; i < data.zhiyiShouquandaibiao.Length; i++)
|
{
|
if (!(string.IsNullOrEmpty(data.zhiyiShouquandaibiao[i])
|
&& string.IsNullOrEmpty(data.zhiyiLianxidianhua[i])
|
&& string.IsNullOrEmpty(data.zhiyiDizhi[i])
|
&& string.IsNullOrEmpty(data.zhiyiYoubian[i])))
|
{
|
var complaintShouquandaibiaoDTO = new TComplaintShouquandaibiaoDTO();
|
complaintShouquandaibiaoDTO.ComplaintId = challengeletterDTO.Id;
|
complaintShouquandaibiaoDTO.Shouquandaibiao = data.zhiyiShouquandaibiao[i];
|
complaintShouquandaibiaoDTO.Lianxidianhua = data.zhiyiLianxidianhua[i];
|
complaintShouquandaibiaoDTO.Dizhi = data.zhiyiDizhi[i];
|
complaintShouquandaibiaoDTO.Youbian = data.zhiyiYoubian[i];
|
complaintShouquandaibiaoDTO.Sort = i;
|
resultEntity = _cooperOrderService.saveComplaintShouquandaibiao(complaintShouquandaibiaoDTO);
|
}
|
|
}
|
}
|
|
|
}
|
scope.Complete();
|
}
|
|
|
return new JsonResult(resultEntity);
|
}
|
|
|
/// <summary>
|
/// 删除主信息
|
/// </summary>
|
/// <param name="info">实体</param>
|
/// <returns></returns>
|
///
|
[CheckLogin]
|
public IActionResult Nullify(string Id = "")
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
return new JsonResult(_cooperOrderService.ModifyStatus(Id, curentuser.Id));
|
}
|
|
|
/// <summary>
|
/// 受理
|
/// </summary>
|
/// <param name="data">岗位实体类对象</param>
|
/// <returns></returns>
|
///
|
[CheckLogin]
|
public IActionResult Shouli(string id)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = false;
|
|
using (TransactionScope scope = new TransactionScope())
|
{
|
|
CooperOrderDTO dto = _cooperOrderService.Get(id);
|
if (dto.ShouliStatus != "1")
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "只有已下单状态的订单才能受理";
|
return new JsonResult(resultEntity);
|
}
|
|
|
if (dto.OrderType == "01")
|
{
|
var shi = _fiBookService.Get(dto.OrderType1);
|
if (string.IsNullOrEmpty(shi.Id))
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "未找到该商品";
|
return new JsonResult(resultEntity);
|
}
|
var admGoodsManageDTOs = _admGoodsManageService.GetList().Where(x => x.ISBN == shi.BookNo).FirstOrDefault();
|
|
if (admGoodsManageDTOs == null)
|
{
|
|
|
resultEntity.Result = false;
|
resultEntity.Message = "没有找到该商品";
|
return new JsonResult(resultEntity);
|
|
}
|
else if (!admGoodsManageDTOs.GoodsLeft.HasValue)
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "该商品没有库存";
|
return new JsonResult(resultEntity);
|
|
}
|
else if (admGoodsManageDTOs.GoodsLeft.Value < dto.OrderNum)
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "该商品库存不足";
|
return new JsonResult(resultEntity);
|
|
}
|
var left = admGoodsManageDTOs.GoodsLeft - dto.OrderNum;
|
admGoodsManageDTOs.GoodsLeft = left;
|
|
resultEntity = _admGoodsManageService.save(admGoodsManageDTOs);
|
|
AdmGoodsRecordDTO dto1 = new AdmGoodsRecordDTO();
|
dto1.GoodsId = admGoodsManageDTOs.Id;
|
dto1.GoodsNum = dto.OrderNum;
|
dto1.GoodsLeft = admGoodsManageDTOs.GoodsLeft;
|
dto1.RecordTypeId = "02";
|
dto1.RecStatus = "A";
|
dto1.Creater = curentuser.Id;
|
dto1.Createtime = DateTime.Now;
|
dto1.Modifier = curentuser.Id;
|
dto1.Modifytime = DateTime.Now;
|
dto1.OperationalMatters = "订单:" + dto.OrderNo + " 购买书籍";
|
resultEntity = _admGoodsRecordService.save(dto1);
|
|
}
|
|
|
|
dto.Shoulier = curentuser.Id;
|
dto.Shoulitime = DateTime.Now;
|
dto.ShouliStatus = "2";
|
|
resultEntity = _cooperOrderService.shouli(dto);
|
|
scope.Complete();
|
}
|
|
return new JsonResult(resultEntity);
|
}
|
|
|
/// <summary>
|
/// 完工
|
/// </summary>
|
/// <param name="data">岗位实体类对象</param>
|
/// <returns></returns>
|
///
|
[CheckLogin]
|
public IActionResult Wangong(string id)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
CooperOrderDTO dto = _cooperOrderService.Get(id);
|
//dto.Id = id;
|
dto.Wangonger = curentuser.Id;
|
dto.Wangongtime = DateTime.Now;
|
dto.ShouliStatus = "4";
|
|
ResultEntity resultEntity = _cooperOrderService.save(dto);
|
|
return new JsonResult(resultEntity);
|
}
|
|
|
[CheckLogin]
|
public IActionResult Chedan(string id = null)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
ViewData["Chedanid"] = id;
|
|
|
|
return View();
|
}
|
[CheckLogin]
|
public IActionResult chedantuihuan(decimal Price, string Chedanid)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = false;
|
using (TransactionScope scope = new TransactionScope())
|
{
|
|
CooperOrderDTO dto = _cooperOrderService.Get(Chedanid);
|
if (dto.ShouliStatus != "2")
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "只有受理状态的订单才能撤单";
|
return new JsonResult(resultEntity);
|
}
|
|
|
if (dto.OrderType == "01")
|
{
|
var shi = _fiBookService.Get(dto.OrderType1);
|
if (string.IsNullOrEmpty(shi.Id))
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "未找到该商品";
|
return new JsonResult(resultEntity);
|
}
|
var admGoodsManageDTOs = _admGoodsManageService.GetList().Where(x => x.ISBN == shi.BookNo).FirstOrDefault();
|
|
if (admGoodsManageDTOs == null)
|
{
|
|
|
resultEntity.Result = false;
|
resultEntity.Message = "没有找到该商品";
|
return new JsonResult(resultEntity);
|
|
}
|
|
var left = admGoodsManageDTOs.GoodsLeft + dto.OrderNum;
|
admGoodsManageDTOs.GoodsLeft = left;
|
|
resultEntity = _admGoodsManageService.save(admGoodsManageDTOs);
|
|
AdmGoodsRecordDTO dto1 = new AdmGoodsRecordDTO();
|
dto1.GoodsId = admGoodsManageDTOs.Id;
|
dto1.GoodsNum = dto.OrderNum;
|
dto1.GoodsLeft = admGoodsManageDTOs.GoodsLeft;
|
dto1.RecordTypeId = "01";
|
dto1.RecStatus = "A";
|
dto1.Creater = curentuser.Id;
|
dto1.Createtime = DateTime.Now;
|
dto1.Modifier = curentuser.Id;
|
dto1.Modifytime = DateTime.Now;
|
dto1.OperationalMatters = "订单:" + dto.OrderNo + " 撤单";
|
resultEntity = _admGoodsRecordService.save(dto1);
|
|
}
|
|
|
dto.Chedaner = curentuser.Id;
|
dto.Chedantime = DateTime.Now;
|
dto.ChedanStatus = "A";
|
dto.Chedan = Price;
|
dto.ShouliStatus = "0";
|
|
resultEntity = _cooperOrderService.chedan(dto);
|
|
|
var fiAccountRecordDTOs = _iFiAccountRecordService.GetList("订单收款"+dto.OrderNo);
|
if (fiAccountRecordDTOs!= null && fiAccountRecordDTOs.Count > 0)
|
{
|
foreach (var fiAccountRecordDTO in fiAccountRecordDTOs)
|
{
|
CooperatecustomCustomerDTO cooperatecustomCustomerDTO = _cooperatecustomCustomerService.Get(dto.Khdw);
|
FiAccountRecordDTO data1 = new FiAccountRecordDTO();
|
data1.RecStatus = "A";
|
data1.Creater = curentuser.Id;
|
data1.Createtime = DateTime.Now;
|
data1.Modifier = curentuser.Id;
|
data1.Modifytime = DateTime.Now;
|
data1.SubjectId = fiAccountRecordDTO.SubjectId;
|
|
data1.AccountId = fiAccountRecordDTO.AccountId;
|
data1.Money = fiAccountRecordDTO.Money;
|
data1.PaymentUnit = cooperatecustomCustomerDTO.Name;
|
data1.OperationalMatters = "订单撤单" + dto.OrderNo;
|
|
|
|
FiAccountDTO firmAccount = _fiAccountService.Get(data1.AccountId);
|
|
|
data1.RecordTypeId = "2";//退款
|
data1.Department = "";
|
|
|
|
firmAccount.AllExpenses = (firmAccount.AllExpenses ?? 0) + fiAccountRecordDTO.Money;
|
firmAccount.Balance = (firmAccount.Balance ?? 0) - fiAccountRecordDTO.Money;
|
|
data1.AccountMoney = firmAccount.Balance;
|
resultEntity = _iFiAccountRecordService.save(data1);
|
resultEntity = _fiAccountService.save(firmAccount);
|
}
|
}
|
scope.Complete();
|
}
|
return new JsonResult(resultEntity);
|
}
|
[CheckLogin]
|
public IActionResult Huifang(string id = null)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
ViewData["Huifangid"] = id;
|
|
ViewData["PingjiaStatus"] = _liaotianService.GetSYScode("CooperOrder", "pingjia_status");
|
ViewData.Model = _cooperOrderService.Get(id);
|
|
return View();
|
}
|
[CheckLogin]
|
public IActionResult Huifangtuihuan(CooperOrderDTO dto)
|
{
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = true;
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
|
|
dto.Huifanger = curentuser.Id;
|
dto.Huifangtime = DateTime.Now;
|
dto.HuifangStatus = "A";
|
|
|
resultEntity = _cooperOrderService.huifang(dto);
|
|
return new JsonResult(resultEntity);
|
}
|
|
|
/// <summary>
|
/// 送货
|
/// </summary>
|
/// <param name="data">岗位实体类对象</param>
|
/// <returns></returns>
|
///
|
[CheckLogin]
|
public IActionResult Songhuo(string id)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
ViewData["Huifangid"] = id;
|
|
var cooperOrderDTO = _cooperOrderService.Get(id);
|
if (!cooperOrderDTO.SonghuoTime1.HasValue)
|
{
|
cooperOrderDTO.SonghuoTime1 = DateTime.Now;
|
}
|
|
ViewData.Model = cooperOrderDTO;
|
|
return View();
|
|
|
}
|
|
[CheckLogin]
|
public IActionResult Songhuotuihuan(CooperOrderDTO dto)
|
{
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = true;
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
var cooperOrderDTO = _cooperOrderService.Get(dto.Id);
|
if (cooperOrderDTO.ShouliStatus != "2")
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "只有受理状态的订单才能送货";
|
return new JsonResult(resultEntity);
|
}
|
|
dto.Songhuoer = curentuser.Id;
|
dto.Songhuotime = DateTime.Now;
|
dto.ShouliStatus = "5";
|
|
resultEntity = _cooperOrderService.Songhuo(dto);
|
|
return new JsonResult(resultEntity);
|
}
|
|
[CheckLogin]
|
public IActionResult Pingjia(string id = null)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
ViewData["Pingjiaid"] = id;
|
ViewData["PingjiaStatus"] = _liaotianService.GetSYScode("CooperOrder", "pingjia_status");
|
|
|
return View();
|
}
|
[CheckLogin]
|
public IActionResult Pingjiatuihuan(string PingjiaStatus, string Pingjiaid)
|
{
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = true;
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
CooperOrderDTO dto = new CooperOrderDTO();
|
dto.Id = Pingjiaid;
|
dto.Pingjiaer = curentuser.Id;
|
dto.Pingjiatime = DateTime.Now;
|
dto.PingjiaStatus = PingjiaStatus;
|
|
|
resultEntity = _cooperOrderService.pingjia(dto);
|
|
return new JsonResult(resultEntity);
|
}
|
|
|
[CheckLogin]
|
public IActionResult Print(string id = null)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
CooperOrderDTO dto = new CooperOrderDTO();
|
if (!String.IsNullOrEmpty(id))
|
{
|
dto = _cooperOrderService.Getprint(id);
|
if (dto.OrderType == "01")
|
{
|
dto.OrderType1 = _fiBookService.Get(dto.OrderType1).BookName;
|
}
|
if (dto.OrderType == "05")
|
{
|
dto.OrderType1 = _fiMemberService.Get(dto.OrderType1).MemberType;
|
}
|
}
|
else
|
{
|
dto.XdTime = DateTime.Now;
|
|
}
|
|
ViewData.Model = dto;
|
return View();
|
}
|
|
[CheckLogin]
|
public IActionResult printList(CooperOrderDTOSearch search)
|
{
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
search.rows = 1000;
|
search.page = 1;
|
ViewBag.ListCooperOrderDTO = _cooperOrderService.SearchByPaging(search).DataList as List<CooperOrderDTO>;
|
|
|
|
return View();
|
}
|
|
|
|
|
/// <summary>
|
/// 获取物品
|
/// </summary>
|
/// <param name="shengid">省id</param>
|
/// <returns></returns>
|
///
|
[CheckLogin]
|
public string getOrderType(string OrderType)
|
{
|
string result = "";
|
if(OrderType == "01")
|
{
|
var shi = _fiBookService.GetList().Select(x => new { code = x.Id, label = x.BookName }).ToList();
|
result = JsonConvert.SerializeObject(shi);
|
}
|
if (OrderType == "02" || OrderType == "04" || OrderType == "06" || OrderType == "09")
|
{
|
var shi = _fiServiceService.GetList().Where(x=>x.ServiceTypeTop == OrderType).Select(x => new { code = x.ServiceType, label = x.ServiceType }).Distinct().ToList();
|
result = JsonConvert.SerializeObject(shi);
|
}
|
if ( OrderType == "03" || OrderType == "07" )
|
{
|
var shi = _fiServiceService.GetList().Where(x => x.ServiceTypeTop == OrderType).Select(x => new { code = x.ServiceTypeTwo, label = x.ServiceTypeTwo }).ToList();
|
result = JsonConvert.SerializeObject(shi);
|
}
|
if (OrderType == "05" )
|
{
|
var shi = _fiMemberService.GetList().Select(x => new { code = x.Id, label = x.MemberType }).ToList();
|
result = JsonConvert.SerializeObject(shi);
|
}
|
|
if (OrderType == "08" || OrderType == "10" || OrderType == "11")
|
{
|
|
result = "[]";
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
/// 获取物品
|
/// </summary>
|
/// <param name="shengid">省id</param>
|
/// <returns></returns>
|
///
|
[CheckLogin]
|
public string getOrderType1(string OrderType,string OrderType1)
|
{
|
string result = "";
|
if (OrderType == "01")
|
{
|
var shi = _fiBookService.Get(OrderType1);
|
result = JsonConvert.SerializeObject(shi);
|
}
|
if (OrderType == "03" || OrderType == "07")
|
{
|
var shi = _fiServiceService.GetList().Where(x => x.ServiceTypeTop == OrderType && x.ServiceTypeTwo == OrderType1).FirstOrDefault();
|
result = JsonConvert.SerializeObject(shi);
|
}
|
if (OrderType == "05")
|
{
|
var shi = _fiMemberService.Get(OrderType1);
|
result = JsonConvert.SerializeObject(shi);
|
}
|
if ( OrderType == "04" || OrderType == "06" || OrderType == "09")
|
{
|
var shi = _fiServiceService.GetList().Where(x => x.ServiceTypeTop == OrderType && x.ServiceType == OrderType1).FirstOrDefault();
|
result = JsonConvert.SerializeObject(shi);
|
}
|
|
|
if (OrderType == "02" )
|
{
|
if(OrderType1== "电话咨询" || OrderType1 == "当面咨询" || OrderType1 == "代拟质疑答复" || OrderType1 == "代拟投诉处理决定" || OrderType1 == "竞争对手和评审专家参加政府采购数据信息查询" || OrderType1 == "政采贷")
|
{
|
var shi = _fiServiceService.GetList().Where(x => x.ServiceTypeTop == OrderType && x.ServiceType == OrderType1).FirstOrDefault();
|
result = JsonConvert.SerializeObject(shi);
|
}
|
else
|
{
|
var shi = _fiServiceService.GetList().Where(x => x.ServiceTypeTop == OrderType && x.ServiceType == OrderType1).Select(x => new { code = x.ServiceTypeTwo, label = x.ServiceTypeTwo }).Distinct().ToList();
|
result = JsonConvert.SerializeObject(shi);
|
}
|
|
|
}
|
if (result == "")
|
{
|
result = "[]";
|
}
|
return result;
|
|
}
|
|
/// <summary>
|
/// 获取物品
|
/// </summary>
|
/// <param name="shengid">省id</param>
|
/// <returns></returns>
|
///
|
[CheckLogin]
|
public string getOrderType2(string OrderType, string OrderType1, string OrderType2)
|
{
|
string result = "";
|
|
|
var shi = _fiServiceService.GetList().Where(x => x.ServiceTypeTop == OrderType && x.ServiceType == OrderType1 && x.ServiceTypeTwo == OrderType2).FirstOrDefault();
|
result = JsonConvert.SerializeObject(shi);
|
|
|
return result;
|
|
}
|
|
|
|
//提问
|
public IActionResult GetHuiYuanOrder([FromBody]CooperOrderDTOSearch search)
|
{
|
ReturnMsg<List<UserOrders>> returnMsg = new ReturnMsg<List<UserOrders>>();
|
returnMsg.code = 2;
|
try
|
{
|
string userid = "";
|
var headers = Request.Headers;
|
if (headers != null)
|
{
|
//string SecurityKey = _configuration.GetSection("SecurityKey").Value;
|
var keyId = headers["Authorization"].FirstOrDefault();
|
if (string.IsNullOrEmpty("keyId"))
|
{
|
returnMsg.code = 2;
|
returnMsg.error = "没有获取到token";
|
returnMsg.count = 0;
|
|
return new JsonResult(returnMsg);
|
}
|
|
|
JwtSecurityToken jwt = null;
|
var handler = new JwtSecurityTokenHandler();
|
var key1 = keyId.Replace("Bearer", "").Trim();
|
jwt = handler.ReadJwtToken(key1);
|
System.Security.Claims.Claim sss = jwt.Claims.Where(x => x.Type == "id").FirstOrDefault();
|
userid = sss.Value;
|
|
}
|
//LZhuanjiahuidumDTOSearch searchEntity = new LZhuanjiahuidumDTOSearch();
|
//searchEntity.Userid = userid;
|
////searchEntity.HuidaStatus = "A";
|
//searchEntity.page = 1;
|
//searchEntity.rows = 1000;
|
search.HuiyuanId = userid;
|
ResultDataEntity<CooperOrderDTO> resultDataEntity = _cooperOrderService.SearchByPaging(search);
|
List<CooperOrderDTO> cooperOrderDTOs = resultDataEntity.DataList;
|
List<UserOrders> userOrders = new List<UserOrders>();
|
//封装订单
|
foreach (var cooperOrderDTO in cooperOrderDTOs)
|
{
|
UserOrders userOrder = new UserOrders();
|
userOrder.order_goods = new List<usercart_items>();
|
usercart_items usercart_Item = new usercart_items();
|
|
userOrder.order_type = "offline";
|
userOrder.order_no = cooperOrderDTO.OrderNo;
|
userOrder.accept_name = cooperOrderDTO.Shr;
|
userOrder.mobile = cooperOrderDTO.ShrTel;
|
userOrder.address = cooperOrderDTO.ShrAddress;
|
userOrder.order_amount = cooperOrderDTO.Money.HasValue ? cooperOrderDTO.Money.Value: 0;
|
userOrder.statusChs = cooperOrderDTO.ShouliStatusName;
|
userOrder.add_time = cooperOrderDTO.Createtime;
|
|
usercart_Item.sell_price = cooperOrderDTO.Price.HasValue ? cooperOrderDTO.Price.Value : 0;
|
usercart_Item.quantity = cooperOrderDTO.OrderNum.HasValue ? decimal.ToInt32(cooperOrderDTO.OrderNum.Value) : 0;
|
usercart_Item.name = cooperOrderDTO.OrderTypeName + "-" + cooperOrderDTO.OrderType1Name + (string.IsNullOrEmpty(cooperOrderDTO.OrderType2)?"": "-"+cooperOrderDTO.OrderType2);
|
|
|
|
userOrder.order_goods.Add(usercart_Item);
|
userOrders.Add(userOrder);
|
}
|
returnMsg.code = 1;
|
returnMsg.returnObj = userOrders;
|
returnMsg.count = resultDataEntity.DataList.Count;
|
}
|
catch (Exception ex)
|
{
|
returnMsg.code = 2;
|
returnMsg.error = "没有获取到token";
|
returnMsg.count = 0;
|
|
}
|
return new JsonResult(returnMsg);
|
}
|
|
|
|
[CheckLogin]
|
public IActionResult IndexWenshu()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
|
ViewData["ActionInfo"] = actionlist;
|
ViewBag.status = _liaotianService.GetSYScode("t_challengeletter", "status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
|
|
return View();
|
|
}
|
|
|
|
[CheckLogin]
|
public IActionResult GetListWenshu(CooperOrderDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
//search.Status = 1;
|
//search.Creater = curentuser.Id;
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_cooperOrderService.SearchByPagingWenshu(search));
|
}
|
|
|
[CheckLogin]
|
public IActionResult selectWenshu()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
|
ViewData["ActionInfo"] = actionlist;
|
|
|
ViewBag.Wenshuleixing = _liaotianService.GetSYScode("t_challengeletter", "Wenshuleixing").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
ViewBag.status = _liaotianService.GetSYScode("t_challengeletter", "status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
return View();
|
|
}
|
|
|
|
public IActionResult EditZhiyihan(string id = null)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
//质疑函
|
List<TChallengeletterDTO> challengeletterDTOs = _cooperOrderService.GetListChallengeletter(id);
|
TChallengeletterDTO challengeletterDTO = new TChallengeletterDTO();
|
if (challengeletterDTOs != null && challengeletterDTOs.Count > 0)
|
{
|
challengeletterDTO = challengeletterDTOs[0];
|
if (challengeletterDTO.DocumentsDate.HasValue)
|
{
|
challengeletterDTO.DocumentsDateName = challengeletterDTO.DocumentsDate.Value.ToString("yyyy-MM-dd");
|
}
|
List<TChallengeItemDTO> challengeItemDTOs = _cooperOrderService.GetListChallengeItem(challengeletterDTO.Id);
|
if (challengeItemDTOs.Count > 0)
|
challengeletterDTO.challengeItemDTOs = challengeItemDTOs;
|
else
|
challengeletterDTO.challengeItemDTOs = new List<TChallengeItemDTO>() { new TChallengeItemDTO() };
|
List<TComplaintShouquandaibiaoDTO> complaintShouquandaibiaoDTOs = _cooperOrderService.GetListComplaintShouquandaibiao(challengeletterDTO.Id);
|
|
if (complaintShouquandaibiaoDTOs.Count > 0)
|
challengeletterDTO.complaintShouquandaibiaoDTOs = complaintShouquandaibiaoDTOs;
|
else
|
challengeletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
}
|
else
|
{
|
challengeletterDTO.challengeItemDTOs = new List<TChallengeItemDTO>() { new TChallengeItemDTO() };
|
challengeletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
}
|
//ViewBag.challengeletterDTO = challengeletterDTO;
|
|
|
|
|
ViewBag.request_info = _liaotianService.GetSYScode("t_challengeletter", "request_info").OrderBy(x=>x.CodeSn).ToList();//质疑请求
|
ViewBag.question = _liaotianService.GetSYScode("t_challenge_items", "question").OrderBy(x => x.CodeSn).ToList(); // 质疑事项
|
var sysCodeDtls = _liaotianService.GetSYScode("expert_test_topicjiexi", "falv").OrderBy(x => x.CodeSn).ToList();//法律
|
var sysCodeDtls1 = _liaotianService.GetSYScode("t_complaint_items", "law").OrderBy(x => x.CodeSn).ToList();//法律依据
|
foreach ( var sysCodeDtl in sysCodeDtls1)
|
{
|
var sysCodeDtl1 = sysCodeDtls.Where(x => x.CodeSn == sysCodeDtl.Comments).FirstOrDefault();
|
if (sysCodeDtl1 != null)
|
sysCodeDtl.Comments = sysCodeDtl1.Comments;
|
}
|
|
ViewBag.law = sysCodeDtls1;//法律依据
|
|
|
|
|
|
ViewData.Model = challengeletterDTO;
|
return View();
|
}
|
|
|
public IActionResult getLaw(string id)
|
{
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = true;
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
var sysCodeDtl = _liaotianService.GetSYScode("t_complaint_items", "law").Where(x=>x.CodeSn== id).FirstOrDefault();//法律依据
|
|
|
if (sysCodeDtl != null )
|
{
|
resultEntity.Message = sysCodeDtl.Contents;
|
}
|
|
|
return new JsonResult(resultEntity);
|
}
|
|
public IActionResult getQuestionLaw(string id, string no)
|
{
|
ResultEntity<SysCodeDtl> resultEntity = new ResultEntity<SysCodeDtl>();
|
resultEntity.Result = true;
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
var sysCodeDtls = _liaotianService.GetSYScode("t_complaint_items", "law").Where(x => x.Classify1 == id).OrderBy(x => x.CodeSn).ToList().ToList();//法律依据
|
var sysCodeDtls1 = _liaotianService.GetSYScode("expert_test_topicjiexi", "falv");//法律
|
foreach (var sysCodeDtl in sysCodeDtls)
|
{
|
var sysCodeDtl1 = sysCodeDtls1.Where(x => x.CodeSn == sysCodeDtl.Comments).FirstOrDefault();
|
if (sysCodeDtl1 != null)
|
sysCodeDtl.Comments = sysCodeDtl1.Comments;
|
}
|
|
//if (sysCodeDtl != null)
|
//{
|
// resultEntity.Message = sysCodeDtl.Contents;
|
//}
|
resultEntity.Message = no;
|
resultEntity.DataList = sysCodeDtls;
|
|
return new JsonResult(resultEntity);
|
}
|
|
/// <summary>
|
/// 保存
|
/// </summary>
|
/// <param name="data">岗位实体类对象</param>
|
/// <returns></returns>
|
///
|
[CheckLogin]
|
[HttpPost]
|
public IActionResult SaveChallengeletter(CooperOrderDTO data)
|
{
|
ResultEntity resultEntity = new ResultEntity();
|
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
|
using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
|
new TransactionOptions
|
{
|
IsolationLevel = IsolationLevel.ReadCommitted,
|
Timeout = TransactionManager.MaximumTimeout
|
}
|
))
|
{
|
|
|
|
|
//查询主表
|
var challengeletterDTO = _cooperOrderService.GetListChallengeletter(data.OrderId).FirstOrDefault();
|
if (challengeletterDTO != null)
|
{
|
challengeletterDTO.GysName = data.GysName;
|
challengeletterDTO.GysAddress = data.GysAddress;
|
challengeletterDTO.GysPostcode = data.GysPostcode;
|
challengeletterDTO.GysContacts = data.GysContacts;
|
challengeletterDTO.GysPhone = data.GysPhone;
|
|
challengeletterDTO.XmName = data.zhiyiXmName;
|
challengeletterDTO.XmCode = data.zhiyiXmCode;
|
challengeletterDTO.XmPackage = data.zhiyiXmPackage;
|
challengeletterDTO.PurchaserName = data.zhiyiPurchaserName;
|
challengeletterDTO.DocumentsDate = data.zhiyiDocumentsDate;
|
challengeletterDTO.Modifier = curentuser.Id;
|
challengeletterDTO.Modifytime = DateTime.Now;
|
challengeletterDTO.Status = 2;
|
challengeletterDTO.RequestInfo = data.RequestInfo;
|
challengeletterDTO.PrintNum = data.PrintNum;
|
resultEntity = _cooperOrderService.saveChallengeletter(challengeletterDTO);
|
}
|
else
|
{
|
challengeletterDTO = new TChallengeletterDTO();
|
challengeletterDTO.OrderId = data.Id;
|
challengeletterDTO.GysName = data.GysName;
|
challengeletterDTO.GysAddress = data.GysAddress;
|
challengeletterDTO.GysPostcode = data.GysPostcode;
|
challengeletterDTO.GysContacts = data.GysContacts;
|
challengeletterDTO.GysPhone = data.GysPhone;
|
|
challengeletterDTO.XmName = data.zhiyiXmName;
|
challengeletterDTO.XmCode = data.zhiyiXmCode;
|
challengeletterDTO.XmPackage = data.zhiyiXmPackage;
|
challengeletterDTO.PurchaserName = data.zhiyiPurchaserName;
|
challengeletterDTO.DocumentsDate = data.zhiyiDocumentsDate;
|
challengeletterDTO.Modifier = curentuser.Id;
|
challengeletterDTO.Modifytime = DateTime.Now;
|
challengeletterDTO.Creater = curentuser.Id;
|
challengeletterDTO.Createtime = challengeletterDTO.Modifytime;
|
challengeletterDTO.Status = 2;
|
challengeletterDTO.RequestInfo = data.RequestInfo;
|
challengeletterDTO.PrintNum = data.PrintNum;
|
resultEntity = _cooperOrderService.saveChallengeletter(challengeletterDTO);
|
}
|
|
resultEntity = _cooperOrderService.deleteComplaintShouquandaibiao(challengeletterDTO.Id);
|
if (data.zhiyiShouquandaibiao != null && data.zhiyiShouquandaibiao.Length > 0)
|
{
|
for (int i = 0; i < data.zhiyiShouquandaibiao.Length; i++)
|
{
|
if (!(string.IsNullOrEmpty(data.zhiyiShouquandaibiao[i])
|
&& string.IsNullOrEmpty(data.zhiyiLianxidianhua[i])
|
&& string.IsNullOrEmpty(data.zhiyiDizhi[i])
|
&& string.IsNullOrEmpty(data.zhiyiYoubian[i])))
|
{
|
var complaintShouquandaibiaoDTO = new TComplaintShouquandaibiaoDTO();
|
complaintShouquandaibiaoDTO.ComplaintId = challengeletterDTO.Id;
|
complaintShouquandaibiaoDTO.Shouquandaibiao = data.zhiyiShouquandaibiao[i];
|
complaintShouquandaibiaoDTO.Lianxidianhua = data.zhiyiLianxidianhua[i];
|
complaintShouquandaibiaoDTO.Dizhi = data.zhiyiDizhi[i];
|
complaintShouquandaibiaoDTO.Youbian = data.zhiyiYoubian[i];
|
complaintShouquandaibiaoDTO.Sort = i;
|
resultEntity = _cooperOrderService.saveComplaintShouquandaibiao(complaintShouquandaibiaoDTO);
|
}
|
|
}
|
}
|
|
|
resultEntity = _cooperOrderService.deleteChallengeItem(challengeletterDTO.Id);
|
if (data.Question != null && data.Question.Length > 0)
|
{
|
for (int i = 0; i < data.Question.Length; i++)
|
{
|
if (!(string.IsNullOrEmpty(data.Question[i])
|
&& string.IsNullOrEmpty(data.Evidential[i])
|
&& string.IsNullOrEmpty(data.Law[i])
|
&& string.IsNullOrEmpty(data.Lawcoment[i])))
|
{
|
var challengeItemDTO = new TChallengeItemDTO();
|
challengeItemDTO.ChallengeId = challengeletterDTO.Id;
|
challengeItemDTO.Question = data.Question[i];
|
challengeItemDTO.Evidential = data.Evidential[i];
|
challengeItemDTO.Law = data.Law[i];
|
challengeItemDTO.Lawcoment = data.Lawcoment[i];
|
challengeItemDTO.Sort = i;
|
resultEntity = _cooperOrderService.saveChallengeItem(challengeItemDTO);
|
}
|
|
}
|
}
|
scope.Complete();
|
}
|
|
|
return new JsonResult(resultEntity);
|
}
|
|
|
public IActionResult PrintZhiyihan(string id = null)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
//质疑函
|
List<TChallengeletterDTO> challengeletterDTOs = _cooperOrderService.GetListChallengeletter(id);
|
TChallengeletterDTO challengeletterDTO = new TChallengeletterDTO();
|
if (challengeletterDTOs != null && challengeletterDTOs.Count > 0)
|
{
|
challengeletterDTO = challengeletterDTOs[0];
|
if (challengeletterDTO.DocumentsDate.HasValue)
|
{
|
challengeletterDTO.DocumentsDateName = challengeletterDTO.DocumentsDate.Value.ToString("yyyy-MM-dd");
|
}
|
List<TChallengeItemDTO> challengeItemDTOs = _cooperOrderService.GetListChallengeItem(challengeletterDTO.Id);
|
if (challengeItemDTOs.Count > 0)
|
challengeletterDTO.challengeItemDTOs = challengeItemDTOs;
|
else
|
challengeletterDTO.challengeItemDTOs = new List<TChallengeItemDTO>() { new TChallengeItemDTO() };
|
List<TComplaintShouquandaibiaoDTO> complaintShouquandaibiaoDTOs = _cooperOrderService.GetListComplaintShouquandaibiao(challengeletterDTO.Id);
|
|
if (complaintShouquandaibiaoDTOs.Count > 0)
|
challengeletterDTO.complaintShouquandaibiaoDTOs = complaintShouquandaibiaoDTOs;
|
else
|
challengeletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
}
|
else
|
{
|
challengeletterDTO.challengeItemDTOs = new List<TChallengeItemDTO>() { new TChallengeItemDTO() };
|
challengeletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
}
|
//ViewBag.challengeletterDTO = challengeletterDTO;
|
|
|
|
|
//ViewBag.request_info = _liaotianService.GetSYScode("t_challengeletter", "request_info");//质疑请求
|
//ViewBag.question = _liaotianService.GetSYScode("t_challenge_items", "question"); // 质疑事项
|
//var sysCodeDtls = _liaotianService.GetSYScode("expert_test_topicjiexi", "falv");//法律
|
//var sysCodeDtls1 = _liaotianService.GetSYScode("t_complaint_items", "law");//法律依据
|
//foreach (var sysCodeDtl in sysCodeDtls1)
|
//{
|
// var sysCodeDtl1 = sysCodeDtls.Where(x => x.CodeSn == sysCodeDtl.Comments).FirstOrDefault();
|
// if (sysCodeDtl1 != null)
|
// sysCodeDtl.Comments = sysCodeDtl1.Comments;
|
//}
|
|
//ViewBag.law = sysCodeDtls1;//法律依据
|
|
|
|
|
|
ViewData.Model = challengeletterDTO;
|
return View();
|
}
|
|
|
public IActionResult EditTousushu(string id = null)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
//投诉书
|
List<TComplaintletterDTO> complaintletterDTOs = _cooperOrderService.GetListComplaintletter(id);
|
TComplaintletterDTO complaintletterDTO = new TComplaintletterDTO();
|
if (complaintletterDTOs != null && complaintletterDTOs.Count > 0)
|
{
|
complaintletterDTO = complaintletterDTOs[0];
|
|
if (complaintletterDTO.NoticeDate.HasValue)
|
{
|
complaintletterDTO.NoticeDateName = complaintletterDTO.NoticeDate.Value.ToString("yyyy-MM-dd");
|
}
|
|
if (complaintletterDTO.ResultnoticeDate.HasValue)
|
{
|
complaintletterDTO.ResultnoticeDateName = complaintletterDTO.ResultnoticeDate.Value.ToString("yyyy-MM-dd");
|
}
|
|
if (complaintletterDTO.ChallengeDate.HasValue)
|
{
|
complaintletterDTO.ChallengeDateName = complaintletterDTO.ChallengeDate.Value.ToString("yyyy-MM-dd");
|
}
|
if (complaintletterDTO.RespondDate.HasValue)
|
{
|
complaintletterDTO.RespondDateName = complaintletterDTO.RespondDate.Value.ToString("yyyy-MM-dd");
|
}
|
|
|
List<TComplaintItemDTO> complaintItemDTOs = _cooperOrderService.GetListComplaintItem(complaintletterDTO.Id);
|
if (complaintItemDTOs.Count > 0)
|
complaintletterDTO.complaintItemDTOs = complaintItemDTOs;
|
else
|
complaintletterDTO.complaintItemDTOs = new List<TComplaintItemDTO>() { new TComplaintItemDTO() };
|
|
List<TComplaintRespondentDTO> complaintRespondentDTOs = _cooperOrderService.GetListComplaintRespondent(complaintletterDTO.Id);
|
if (complaintRespondentDTOs.Count > 0)
|
complaintletterDTO.complaintRespondentDTOs = complaintRespondentDTOs;
|
else
|
complaintletterDTO.complaintRespondentDTOs = new List<TComplaintRespondentDTO>() { new TComplaintRespondentDTO() };
|
|
List<TComplaintShouquandaibiaoDTO> complaintShouquandaibiaoDTOs = _cooperOrderService.GetListComplaintShouquandaibiao(complaintletterDTO.Id);
|
if (complaintShouquandaibiaoDTOs.Count > 0)
|
complaintletterDTO.complaintShouquandaibiaoDTOs = complaintShouquandaibiaoDTOs;
|
else
|
complaintletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
|
List<TComplaintGongyingshangDTO> complaintGongyingshangDTOs = _cooperOrderService.GetListComplaintGongyingshang(complaintletterDTO.Id);
|
if (complaintGongyingshangDTOs.Count > 0)
|
complaintletterDTO.complaintGongyingshangDTOs = complaintGongyingshangDTOs;
|
else
|
complaintletterDTO.complaintGongyingshangDTOs = new List<TComplaintGongyingshangDTO>() { new TComplaintGongyingshangDTO() };
|
|
}
|
else
|
{
|
complaintletterDTO.complaintItemDTOs = new List<TComplaintItemDTO>() { new TComplaintItemDTO() };
|
complaintletterDTO.complaintRespondentDTOs = new List<TComplaintRespondentDTO>() { new TComplaintRespondentDTO() };
|
complaintletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
complaintletterDTO.complaintGongyingshangDTOs = new List<TComplaintGongyingshangDTO>() { new TComplaintGongyingshangDTO() };
|
|
}
|
|
|
|
|
ViewBag.request_info = _liaotianService.GetSYScode("t_challengeletter", "request_info").OrderBy(x => x.CodeSn).ToList();//质疑请求
|
ViewBag.question = _liaotianService.GetSYScode("t_challenge_items", "question").OrderBy(x => x.CodeSn).ToList(); // 质疑事项
|
var sysCodeDtls = _liaotianService.GetSYScode("expert_test_topicjiexi", "falv").OrderBy(x => x.CodeSn).ToList();//法律
|
var sysCodeDtls1 = _liaotianService.GetSYScode("t_complaint_items", "law").OrderBy(x => x.CodeSn).ToList();//法律依据
|
|
foreach (var sysCodeDtl in sysCodeDtls1)
|
{
|
var sysCodeDtl1 = sysCodeDtls.Where(x => x.CodeSn == sysCodeDtl.Comments).FirstOrDefault();
|
if (sysCodeDtl1 != null)
|
sysCodeDtl.Comments = sysCodeDtl1.Comments;
|
}
|
|
ViewBag.law = sysCodeDtls1;//法律依据
|
|
ViewBag.shifou = _liaotianService.GetSYScode("system", "shifou");
|
|
|
|
ViewData.Model = complaintletterDTO;
|
return View();
|
}
|
|
|
|
|
/// <summary>
|
/// 保存
|
/// </summary>
|
/// <param name="data">岗位实体类对象</param>
|
/// <returns></returns>
|
///
|
[CheckLogin]
|
[HttpPost]
|
public IActionResult SaveComplaintletter(CooperOrderDTO data)
|
{
|
ResultEntity resultEntity = new ResultEntity();
|
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
|
using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
|
new TransactionOptions
|
{
|
IsolationLevel = IsolationLevel.ReadCommitted,
|
Timeout = TransactionManager.MaximumTimeout
|
}
|
))
|
{
|
|
|
|
|
//查询主表
|
var complaintletterDTO = _cooperOrderService.GetListComplaintletter(data.OrderId).FirstOrDefault();
|
if (complaintletterDTO != null)
|
{
|
complaintletterDTO.TsrName = data.TsrName;
|
complaintletterDTO.TsrAddress = data.TsrAddress;
|
complaintletterDTO.TsrPostcode = data.TsrPostcode;
|
complaintletterDTO.TsrCorporation = data.TsrCorporation;
|
complaintletterDTO.TsrPhone = data.TsrPhone;
|
|
|
|
complaintletterDTO.XmName = data.tousuXmName;
|
complaintletterDTO.XmCode = data.tousuXmCode;
|
complaintletterDTO.XmPackage = data.tousuXmPackage;
|
complaintletterDTO.PurchaserName = data.tousuPurchaserName;
|
complaintletterDTO.Agency = data.tousuAgency;
|
|
complaintletterDTO.IsNotice = data.tousuIsNotice;
|
complaintletterDTO.NoticeDate = data.tousuNoticeDate;
|
complaintletterDTO.IsResultnotice = data.tousuIsResultnotice;
|
complaintletterDTO.ResultnoticeDate = data.tousuResultnoticeDate;
|
complaintletterDTO.ChallengeDate = data.tousuChallengeDate;
|
complaintletterDTO.Questioned = data.tousuQuestioned;
|
complaintletterDTO.Respondent = data.Respondent;
|
complaintletterDTO.RespondDate = data.tousuRespondDate;
|
|
|
complaintletterDTO.Modifier = curentuser.Id;
|
complaintletterDTO.Modifytime = DateTime.Now;
|
complaintletterDTO.Status = 2;
|
complaintletterDTO.RequestInfo = data.RequestInfo;
|
complaintletterDTO.PrintNum = data.PrintNum;
|
resultEntity = _cooperOrderService.saveComplaintletter(complaintletterDTO);
|
}
|
else
|
{
|
complaintletterDTO = new TComplaintletterDTO();
|
complaintletterDTO.OrderId = data.Id;
|
|
complaintletterDTO.TsrName = data.TsrName;
|
complaintletterDTO.TsrAddress = data.TsrAddress;
|
complaintletterDTO.TsrPostcode = data.TsrPostcode;
|
complaintletterDTO.TsrCorporation = data.TsrCorporation;
|
complaintletterDTO.TsrPhone = data.TsrPhone;
|
|
|
|
complaintletterDTO.XmName = data.tousuXmName;
|
complaintletterDTO.XmCode = data.tousuXmCode;
|
complaintletterDTO.XmPackage = data.tousuXmPackage;
|
complaintletterDTO.PurchaserName = data.tousuPurchaserName;
|
complaintletterDTO.Agency = data.tousuAgency;
|
|
complaintletterDTO.IsNotice = data.tousuIsNotice;
|
complaintletterDTO.NoticeDate = data.tousuNoticeDate;
|
complaintletterDTO.IsResultnotice = data.tousuIsResultnotice;
|
complaintletterDTO.ResultnoticeDate = data.tousuResultnoticeDate;
|
complaintletterDTO.ChallengeDate = data.tousuChallengeDate;
|
complaintletterDTO.Questioned = data.tousuQuestioned;
|
complaintletterDTO.Respondent = data.Respondent;
|
complaintletterDTO.RespondDate = data.tousuRespondDate;
|
|
|
complaintletterDTO.Modifier = curentuser.Id;
|
complaintletterDTO.Modifytime = DateTime.Now;
|
complaintletterDTO.Creater = curentuser.Id;
|
complaintletterDTO.Createtime = complaintletterDTO.Modifytime;
|
complaintletterDTO.Status = 2;
|
complaintletterDTO.RequestInfo = data.RequestInfo;
|
complaintletterDTO.PrintNum = data.PrintNum;
|
resultEntity = _cooperOrderService.saveComplaintletter(complaintletterDTO);
|
}
|
|
|
|
resultEntity = _cooperOrderService.deleteComplaintShouquandaibiao(complaintletterDTO.Id);
|
if (data.tousuShouquandaibiao != null && data.tousuShouquandaibiao.Length > 0)
|
{
|
for (int i = 0; i < data.tousuShouquandaibiao.Length; i++)
|
{
|
if (!(string.IsNullOrEmpty(data.tousuShouquandaibiao[i])
|
&& string.IsNullOrEmpty(data.tousuLianxidianhua[i])
|
&& string.IsNullOrEmpty(data.tousuDizhi[i])
|
&& string.IsNullOrEmpty(data.tousuYoubian[i])))
|
{
|
var complaintShouquandaibiaoDTO = new TComplaintShouquandaibiaoDTO();
|
complaintShouquandaibiaoDTO.ComplaintId = complaintletterDTO.Id;
|
complaintShouquandaibiaoDTO.Shouquandaibiao = data.tousuShouquandaibiao[i];
|
complaintShouquandaibiaoDTO.Lianxidianhua = data.tousuLianxidianhua[i];
|
complaintShouquandaibiaoDTO.Dizhi = data.tousuDizhi[i];
|
complaintShouquandaibiaoDTO.Youbian = data.tousuYoubian[i];
|
complaintShouquandaibiaoDTO.Sort = i;
|
resultEntity = _cooperOrderService.saveComplaintShouquandaibiao(complaintShouquandaibiaoDTO);
|
}
|
|
}
|
}
|
|
|
resultEntity = _cooperOrderService.deleteComplaintRespondent(complaintletterDTO.Id);
|
if (data.tousuRespondent != null && data.tousuRespondent.Length > 0)
|
{
|
for (int i = 0; i < data.tousuRespondent.Length; i++)
|
{
|
if (!(string.IsNullOrEmpty(data.tousuRespondent[i])
|
&& string.IsNullOrEmpty(data.tousuAddress[i])
|
&& string.IsNullOrEmpty(data.tousuPostcode[i])
|
&& string.IsNullOrEmpty(data.tousuContacts[i])
|
&& string.IsNullOrEmpty(data.tousuPhone[i])))
|
{
|
var complaintRespondentDTO = new TComplaintRespondentDTO();
|
complaintRespondentDTO.ComplaintId = complaintletterDTO.Id;
|
complaintRespondentDTO.Respondent = data.tousuRespondent[i];
|
complaintRespondentDTO.Address = data.tousuAddress[i];
|
complaintRespondentDTO.Postcode = data.tousuPostcode[i];
|
complaintRespondentDTO.Contacts = data.tousuContacts[i];
|
complaintRespondentDTO.Phone = data.tousuPhone[i];
|
complaintRespondentDTO.Sort = i;
|
resultEntity = _cooperOrderService.saveComplaintRespondent(complaintRespondentDTO);
|
}
|
|
}
|
}
|
|
resultEntity = _cooperOrderService.deleteComplaintGongyingshang(complaintletterDTO.Id);
|
if (data.Gongytingshang != null && data.Gongytingshang.Length > 0)
|
{
|
for (int i = 0; i < data.Gongytingshang.Length; i++)
|
{
|
if (!(string.IsNullOrEmpty(data.Gongytingshang[i])
|
&& string.IsNullOrEmpty(data.gongyingshangYoubian[i])
|
&& string.IsNullOrEmpty(data.gongyingshangLianxiren[i])
|
&& string.IsNullOrEmpty(data.gongyingshangLianxidianhua[i])
|
&& string.IsNullOrEmpty(data.gongyingshangDizhi[i])))
|
{
|
var complaintGongyingshangDTO = new TComplaintGongyingshangDTO();
|
complaintGongyingshangDTO.ComplaintId = complaintletterDTO.Id;
|
complaintGongyingshangDTO.Gongytingshang = data.Gongytingshang[i];
|
complaintGongyingshangDTO.Youbian = data.gongyingshangYoubian[i];
|
complaintGongyingshangDTO.Lianxiren = data.gongyingshangLianxiren[i];
|
complaintGongyingshangDTO.Lianxidianhua = data.gongyingshangLianxidianhua[i];
|
complaintGongyingshangDTO.Dizhi = data.gongyingshangDizhi[i];
|
complaintGongyingshangDTO.Sort = i;
|
resultEntity = _cooperOrderService.saveComplaintGongyingshang(complaintGongyingshangDTO);
|
}
|
|
}
|
}
|
|
|
|
resultEntity = _cooperOrderService.deleteComplaintItem(complaintletterDTO.Id);
|
if (data.Question != null && data.Question.Length > 0)
|
{
|
for (int i = 0; i < data.Question.Length; i++)
|
{
|
if (!(string.IsNullOrEmpty(data.Question[i])
|
&& string.IsNullOrEmpty(data.Evidential[i])
|
&& string.IsNullOrEmpty(data.Law[i])
|
&& string.IsNullOrEmpty(data.Lawcoment[i])))
|
{
|
var complaintItemDTO = new TComplaintItemDTO();
|
complaintItemDTO.ComplaintId = complaintletterDTO.Id;
|
complaintItemDTO.Question = data.Question[i];
|
complaintItemDTO.Evidential = data.Evidential[i];
|
complaintItemDTO.Law = data.Law[i];
|
complaintItemDTO.Lawcoment = data.Lawcoment[i];
|
complaintItemDTO.Sort = i;
|
resultEntity = _cooperOrderService.saveComplaintItem(complaintItemDTO);
|
}
|
|
}
|
}
|
scope.Complete();
|
}
|
|
|
return new JsonResult(resultEntity);
|
}
|
|
|
|
public IActionResult Printtousushu(string id = null)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
//投诉书
|
List<TComplaintletterDTO> complaintletterDTOs = _cooperOrderService.GetListComplaintletter(id);
|
TComplaintletterDTO complaintletterDTO = new TComplaintletterDTO();
|
if (complaintletterDTOs != null && complaintletterDTOs.Count > 0)
|
{
|
complaintletterDTO = complaintletterDTOs[0];
|
|
if (complaintletterDTO.NoticeDate.HasValue)
|
{
|
complaintletterDTO.NoticeDateName = complaintletterDTO.NoticeDate.Value.ToString("yyyy-MM-dd");
|
}
|
|
if (complaintletterDTO.ResultnoticeDate.HasValue)
|
{
|
complaintletterDTO.ResultnoticeDateName = complaintletterDTO.ResultnoticeDate.Value.ToString("yyyy-MM-dd");
|
}
|
|
if (complaintletterDTO.ChallengeDate.HasValue)
|
{
|
complaintletterDTO.ChallengeDateName = complaintletterDTO.ChallengeDate.Value.ToString("yyyy-MM-dd");
|
}
|
if (complaintletterDTO.RespondDate.HasValue)
|
{
|
complaintletterDTO.RespondDateName = complaintletterDTO.RespondDate.Value.ToString("yyyy-MM-dd");
|
}
|
|
|
List<TComplaintItemDTO> complaintItemDTOs = _cooperOrderService.GetListComplaintItem(complaintletterDTO.Id);
|
if (complaintItemDTOs.Count > 0)
|
complaintletterDTO.complaintItemDTOs = complaintItemDTOs;
|
else
|
complaintletterDTO.complaintItemDTOs = new List<TComplaintItemDTO>() { new TComplaintItemDTO() };
|
|
List<TComplaintRespondentDTO> complaintRespondentDTOs = _cooperOrderService.GetListComplaintRespondent(complaintletterDTO.Id);
|
if (complaintRespondentDTOs.Count > 0)
|
complaintletterDTO.complaintRespondentDTOs = complaintRespondentDTOs;
|
else
|
complaintletterDTO.complaintRespondentDTOs = new List<TComplaintRespondentDTO>() { new TComplaintRespondentDTO() };
|
|
List<TComplaintShouquandaibiaoDTO> complaintShouquandaibiaoDTOs = _cooperOrderService.GetListComplaintShouquandaibiao(complaintletterDTO.Id);
|
if (complaintShouquandaibiaoDTOs.Count > 0)
|
complaintletterDTO.complaintShouquandaibiaoDTOs = complaintShouquandaibiaoDTOs;
|
else
|
complaintletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
|
List<TComplaintGongyingshangDTO> complaintGongyingshangDTOs = _cooperOrderService.GetListComplaintGongyingshang(complaintletterDTO.Id);
|
if (complaintGongyingshangDTOs.Count > 0)
|
complaintletterDTO.complaintGongyingshangDTOs = complaintGongyingshangDTOs;
|
else
|
complaintletterDTO.complaintGongyingshangDTOs = new List<TComplaintGongyingshangDTO>() { new TComplaintGongyingshangDTO() };
|
|
}
|
else
|
{
|
complaintletterDTO.complaintItemDTOs = new List<TComplaintItemDTO>() { new TComplaintItemDTO() };
|
complaintletterDTO.complaintRespondentDTOs = new List<TComplaintRespondentDTO>() { new TComplaintRespondentDTO() };
|
complaintletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() };
|
complaintletterDTO.complaintGongyingshangDTOs = new List<TComplaintGongyingshangDTO>() { new TComplaintGongyingshangDTO() };
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ViewData.Model = complaintletterDTO;
|
return View();
|
}
|
}
|
}
|