From 6b14f6fdebc6bb3cb99aea0c0848ddfad0e30633 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期三, 22 十二月 2021 14:02:46 +0800 Subject: [PATCH] 会员的免费质疑书,投诉书次数 --- zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs | 564 +++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 437 insertions(+), 127 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs b/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs index 5ec446f..8051741 100644 --- a/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs @@ -44,6 +44,9 @@ 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 @@ -54,6 +57,9 @@ , IAskService askService , IAdmGoodsRecordService admGoodsRecordService , IAdmGoodsManageService admGoodsManageService + , IFiOrderrecievemoneyService fiOrderrecievemoneyService + , IFiAccountService fiAccountService + , IFiAccountRecordService iFiAccountRecordService ) { _logger = logger; @@ -71,6 +77,9 @@ _askService = askService; _admGoodsRecordService = admGoodsRecordService; _admGoodsManageService = admGoodsManageService; + _fiOrderrecievemoneyService = fiOrderrecievemoneyService; + _fiAccountService = fiAccountService; + _iFiAccountRecordService = iFiAccountRecordService; } [CheckLogin] @@ -573,119 +582,160 @@ 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 == "浠f嫙鎶曡瘔涔�" || data.OrderType1 == "浠f嫙璐ㄧ枒鍑�"))) - { - 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 == "浠f嫙鎶曡瘔涔�" || data.OrderType1 == "浠f嫙璐ㄧ枒鍑�")) - { - questions2.Add("CaseType", 2); - } + bool youhui = true; - 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 - } - )) + if (String.IsNullOrEmpty(data.Id)) { - - var youHuiDTOs = _askService.GetAskYouHuiList(data.Khdw, data.OrderType).FirstOrDefault(); - if (youHuiDTOs != null) + var cooperatecustomCustomerDTO = _cooperatecustomCustomerService.Get(data.Khdw); + if (cooperatecustomCustomerDTO != null && !string.IsNullOrEmpty(cooperatecustomCustomerDTO.HuiyuanId)) { - data.Youhuier = youHuiDTOs.Id; - if (youHuiDTOs.Youhuistandard == "01") + var cooperOrderDTOs = _cooperOrderService.GetListComplaintsDisputeCount(cooperatecustomCustomerDTO.HuiyuanId).FirstOrDefault(); + if(cooperOrderDTOs != null) { - 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) + if ((cooperOrderDTOs.ComplaintsDisputeCount - cooperOrderDTOs.ComplaintsDisputeCountused > 0) && (data.OrderType == "02" && (data.OrderType1 == "浠f嫙鎶曡瘔涔�" || data.OrderType1 == "浠f嫙璐ㄧ枒鍑�"))) { data.Youhui = data.Money.Value; data.Money = 0; + youhui = false; } - else + else if ((cooperOrderDTOs.BiddingDocumentsCount - cooperOrderDTOs.BiddingDocumentsCountused > 0) && data.OrderType == "03") { - data.Youhui = Math.Round(data.Money.Value * youHuiDTOs.YouHui.Value * new decimal(0.01), 2); - data.Money = data.Money.Value - data.Youhui.Value; + data.Youhui = data.Money.Value; + data.Money = 0; + youhui = false; } + else if ((cooperOrderDTOs.PerformanceDisputeCount - cooperOrderDTOs.PerformanceDisputeCountused > 0) && data.OrderType == "07") + { + data.Youhui = data.Money.Value; + data.Money = 0; + youhui = false; + } + } + } + + + data.Creater = curentuser.Id; + data.Createtime = DateTime.Now; + data.XdTime = data.Createtime; + if (data.OrderType == "03" || data.OrderType == "07" || (data.OrderType == "02" && (data.OrderType1 == "浠f嫙鎶曡瘔涔�" || data.OrderType1 == "浠f嫙璐ㄧ枒鍑�"))) + { + + 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 == "浠f嫙鎶曡瘔涔�" || data.OrderType1 == "浠f嫙璐ㄧ枒鍑�")) + { + 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 + } + )) + { + + if (youhui) + { + 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; @@ -1045,7 +1095,7 @@ return View(); } [CheckLogin] - public IActionResult chedantuihuan(decimal Price, string Chedanid) + public IActionResult chedantuihuan(string Chedanid, decimal Price=0) { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; @@ -1113,6 +1163,45 @@ 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); @@ -1491,6 +1580,13 @@ 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); ViewData["ActionInfo"] = actionlist; ViewBag.status = _liaotianService.GetSYScode("t_challengeletter", "status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); @@ -1545,6 +1641,14 @@ { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; + 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.CodeSn = sysCodeDtl1.Comments; + } //璐ㄧ枒鍑� List<TChallengeletterDTO> challengeletterDTOs = _cooperOrderService.GetListChallengeletter(id); @@ -1558,9 +1662,20 @@ } List<TChallengeItemDTO> challengeItemDTOs = _cooperOrderService.GetListChallengeItem(challengeletterDTO.Id); if (challengeItemDTOs.Count > 0) + { challengeletterDTO.challengeItemDTOs = challengeItemDTOs; + foreach (var challengeItemDTO in challengeletterDTO.challengeItemDTOs) + { + var sysCodeDtls2 = sysCodeDtls1.Where(x => x.Classify1 == challengeItemDTO.Question).ToList(); + challengeItemDTO.sysCodeDtls = sysCodeDtls2; + } + } else + { challengeletterDTO.challengeItemDTOs = new List<TChallengeItemDTO>() { new TChallengeItemDTO() }; + challengeletterDTO.challengeItemDTOs[0].sysCodeDtls = new List<SysCodeDtl>() { new SysCodeDtl() }; + } + List<TComplaintShouquandaibiaoDTO> complaintShouquandaibiaoDTOs = _cooperOrderService.GetListComplaintShouquandaibiao(challengeletterDTO.Id); if (complaintShouquandaibiaoDTOs.Count > 0) @@ -1571,6 +1686,7 @@ else { challengeletterDTO.challengeItemDTOs = new List<TChallengeItemDTO>() { new TChallengeItemDTO() }; + challengeletterDTO.challengeItemDTOs[0].sysCodeDtls = new List<SysCodeDtl>() { new SysCodeDtl() }; challengeletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() }; } //ViewBag.challengeletterDTO = challengeletterDTO; @@ -1580,15 +1696,7 @@ 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;//娉曞緥渚濇嵁 @@ -1632,7 +1740,7 @@ { var sysCodeDtl1 = sysCodeDtls1.Where(x => x.CodeSn == sysCodeDtl.Comments).FirstOrDefault(); if (sysCodeDtl1 != null) - sysCodeDtl.Comments = sysCodeDtl1.Comments; + sysCodeDtl.CodeSn = sysCodeDtl1.Comments; } //if (sysCodeDtl != null) @@ -1643,6 +1751,118 @@ resultEntity.DataList = sysCodeDtls; return new JsonResult(resultEntity); + } + + + public IActionResult getZhiyihan(string id = null) + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ViewData["curentuser"] = curentuser; + 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.CodeSn = sysCodeDtl1.Comments; + } + + //璐ㄧ枒鍑� + 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; + foreach (var challengeItemDTO in challengeletterDTO.challengeItemDTOs) + { + var sysCodeDtls2 = sysCodeDtls1.Where(x => x.Classify1 == challengeItemDTO.Question).ToList(); + challengeItemDTO.sysCodeDtls = sysCodeDtls2; + } + } + else + { + challengeletterDTO.challengeItemDTOs = new List<TChallengeItemDTO>() { new TChallengeItemDTO() }; + challengeletterDTO.challengeItemDTOs[0].sysCodeDtls = new List<SysCodeDtl>() { new SysCodeDtl() }; + } + + 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.challengeItemDTOs[0].sysCodeDtls = new List<SysCodeDtl>() { new SysCodeDtl() }; + challengeletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() }; + } + var question = _liaotianService.GetSYScode("t_challenge_items", "question").OrderBy(x => x.CodeSn).ToList(); // 璐ㄧ枒浜嬮」 + StringBuilder data = new StringBuilder(); + + for (int i = 0; i < challengeletterDTO.challengeItemDTOs.Count; i++) + { + data.Append("<div class=\"clearfix layer-area\" style=\"padding-bottom:15px; \">"); + data.Append("<label grouptype=\"Vdata\" class=\"text-right col-sm-1 col-md-1 control-label\">鎶曡瘔浜嬮」"+(i != 0 ? (i + "") : "") + "</label>"); + data.Append("<div class=\"col-sm-4 col-md-4\" grouptype =\"Vdata\" > "); + data.Append(" <select class=\"form - control\" name=\"Question\" data-placeholder=\"閫夋嫨 搴忓垪...\" onchange=\"Questionchangge("+ i + "); \">"); + data.Append("<option value=\"\" hassubinfo=\"true\">璇烽�夋嫨</option>"); + foreach (var item in question) + { + if (!item.CodeSn.Equals(challengeletterDTO.challengeItemDTOs[i].Question)) + { + data.Append("<option value=\""+ item.CodeSn + "\" hassubinfo=\"true\">"+ item.Comments + "</option>"); + } + else + { + data.Append("<option value=\"" + item.CodeSn + "\" hassubinfo=\"true\" selected=\"selected\" >" + item.Comments + "</option>"); + } + } + data.Append("</select>"); + data.Append(" </div>"); + if (i == 0) + { + data.Append("<div class=\"col-sm-2 col-md-2\" grouptype=\"Vdata\"> <button type=\"button\" class=\"addBtn\" onclick =\"addzhiyishixiang(this)\" data-type=\"1\" > 鎶曡瘔浜嬮」</button> </div>"); + } + data.Append(" </div>"); + data.Append("<div class=\"clearfix layer-area\" style =\"padding-bottom:15px; \" > "); + data.Append("<label grouptype=\"Vdata\" class=\"text-right col-sm-1 col-md-1 control-label\" > 浜嬪疄渚濇嵁" + (i != 0 ? (i + "") : "") + "</label>"); + data.Append(" <div class=\"col-sm-8 col-md-8\" > "); + data.Append("<textarea class=\"form-control bt\" name =\"Evidential\" title =\"浜嬪疄渚濇嵁\" isempty =\"\" maxlength =\"300\" length =\"long\" > "+ challengeletterDTO.challengeItemDTOs[i].Evidential + "</textarea>"); + data.Append("</div>"); + data.Append("</div>"); + data.Append(" <div id=\"falvyiju" + i + "\">"); + for (int j = 0; j < challengeletterDTO.challengeItemDTOs[i].sysCodeDtls.Count; j++) + { + data.Append("<div class=\"clearfix layer-area\" style=\"padding-bottom:15px; \">"); + data.Append("<label grouptype=\"Vdata\" class=\"text-right col-sm-1 col-md-1 control-label\" > 娉曞緥渚濇嵁" + (i != 0 ? (i + "") : "") + "</label>"); + data.Append("<div class=\"col-sm-8 col-md-8\" > " + challengeletterDTO.challengeItemDTOs[i].sysCodeDtls[j].CodeSn + "</div>"); + data.Append("</div>"); + + data.Append("<div class=\"clearfix layer-area\" style=\"padding-bottom:15px; \">"); + data.Append("<label grouptype=\"Vdata\" class=\"text-right col-sm-1 col-md-1 control-label\" > 鍐呭" + (i != 0 ? (i + "") : "") + "</label>"); + data.Append("<div class=\"col-sm-8 col-md-8\" > " + challengeletterDTO.challengeItemDTOs[i].sysCodeDtls[j].Contents + "</div>"); + data.Append("</div>"); + } + + + data.Append("</div>"); + } + + challengeletterDTO.GysId = data.ToString(); + + return new JsonResult(challengeletterDTO); + + } /// <summary> @@ -1758,8 +1978,8 @@ 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.Law = data.Law[i]; + //challengeItemDTO.Lawcoment = data.Lawcoment[i]; challengeItemDTO.Sort = i; resultEntity = _cooperOrderService.saveChallengeItem(challengeItemDTO); } @@ -1778,7 +1998,14 @@ { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; - + 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.CodeSn = sysCodeDtl1.Comments; + } //璐ㄧ枒鍑� List<TChallengeletterDTO> challengeletterDTOs = _cooperOrderService.GetListChallengeletter(id); TChallengeletterDTO challengeletterDTO = new TChallengeletterDTO(); @@ -1791,9 +2018,21 @@ } List<TChallengeItemDTO> challengeItemDTOs = _cooperOrderService.GetListChallengeItem(challengeletterDTO.Id); if (challengeItemDTOs.Count > 0) + { challengeletterDTO.challengeItemDTOs = challengeItemDTOs; + foreach (var challengeItemDTO in challengeletterDTO.challengeItemDTOs) + { + var sysCodeDtls2 = sysCodeDtls1.Where(x => x.Classify1 == challengeItemDTO.Question).ToList(); + challengeItemDTO.sysCodeDtls = sysCodeDtls2; + } + } + else + { challengeletterDTO.challengeItemDTOs = new List<TChallengeItemDTO>() { new TChallengeItemDTO() }; + challengeletterDTO.challengeItemDTOs[0].sysCodeDtls = new List<SysCodeDtl>() { new SysCodeDtl() }; + } + List<TComplaintShouquandaibiaoDTO> complaintShouquandaibiaoDTOs = _cooperOrderService.GetListComplaintShouquandaibiao(challengeletterDTO.Id); if (complaintShouquandaibiaoDTOs.Count > 0) @@ -1804,6 +2043,7 @@ else { challengeletterDTO.challengeItemDTOs = new List<TChallengeItemDTO>() { new TChallengeItemDTO() }; + challengeletterDTO.challengeItemDTOs[0].sysCodeDtls = new List<SysCodeDtl>() { new SysCodeDtl() }; challengeletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() }; } //ViewBag.challengeletterDTO = challengeletterDTO; @@ -1837,7 +2077,15 @@ { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; + 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.CodeSn = sysCodeDtl1.Comments; + } //鎶曡瘔涔� List<TComplaintletterDTO> complaintletterDTOs = _cooperOrderService.GetListComplaintletter(id); TComplaintletterDTO complaintletterDTO = new TComplaintletterDTO(); @@ -1867,9 +2115,20 @@ List<TComplaintItemDTO> complaintItemDTOs = _cooperOrderService.GetListComplaintItem(complaintletterDTO.Id); if (complaintItemDTOs.Count > 0) + { complaintletterDTO.complaintItemDTOs = complaintItemDTOs; + foreach (var complaintItemDTO in complaintletterDTO.complaintItemDTOs) + { + var sysCodeDtls2 = sysCodeDtls1.Where(x => x.Classify1 == complaintItemDTO.Question).ToList(); + complaintItemDTO.sysCodeDtls = sysCodeDtls2; + } + } else + { complaintletterDTO.complaintItemDTOs = new List<TComplaintItemDTO>() { new TComplaintItemDTO() }; + complaintletterDTO.complaintItemDTOs[0].sysCodeDtls = new List<SysCodeDtl>() { new SysCodeDtl() }; + } + List<TComplaintRespondentDTO> complaintRespondentDTOs = _cooperOrderService.GetListComplaintRespondent(complaintletterDTO.Id); if (complaintRespondentDTOs.Count > 0) @@ -1893,6 +2152,7 @@ else { complaintletterDTO.complaintItemDTOs = new List<TComplaintItemDTO>() { new TComplaintItemDTO() }; + complaintletterDTO.complaintItemDTOs[0].sysCodeDtls = new List<SysCodeDtl>() { new SysCodeDtl() }; complaintletterDTO.complaintRespondentDTOs = new List<TComplaintRespondentDTO>() { new TComplaintRespondentDTO() }; complaintletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() }; complaintletterDTO.complaintGongyingshangDTOs = new List<TComplaintGongyingshangDTO>() { new TComplaintGongyingshangDTO() }; @@ -1904,21 +2164,13 @@ 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"); - + ViewBag.ChallengeletterChosen = _cooperOrderService.GetListChallengeletterChosen(); ViewData.Model = complaintletterDTO; return View(); @@ -1988,6 +2240,7 @@ complaintletterDTO.Status = 2; complaintletterDTO.RequestInfo = data.RequestInfo; complaintletterDTO.PrintNum = data.PrintNum; + complaintletterDTO.TsrId = data.TsrId; resultEntity = _cooperOrderService.saveComplaintletter(complaintletterDTO); } else @@ -2026,6 +2279,7 @@ complaintletterDTO.Status = 2; complaintletterDTO.RequestInfo = data.RequestInfo; complaintletterDTO.PrintNum = data.PrintNum; + complaintletterDTO.TsrId = data.TsrId; resultEntity = _cooperOrderService.saveComplaintletter(complaintletterDTO); } @@ -2121,8 +2375,8 @@ 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.Law = data.Law[i]; + //complaintItemDTO.Lawcoment = data.Lawcoment[i]; complaintItemDTO.Sort = i; resultEntity = _cooperOrderService.saveComplaintItem(complaintItemDTO); } @@ -2142,7 +2396,14 @@ { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; - + 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.CodeSn = sysCodeDtl1.Comments; + } //鎶曡瘔涔� List<TComplaintletterDTO> complaintletterDTOs = _cooperOrderService.GetListComplaintletter(id); TComplaintletterDTO complaintletterDTO = new TComplaintletterDTO(); @@ -2162,19 +2423,31 @@ if (complaintletterDTO.ChallengeDate.HasValue) { - complaintletterDTO.ChallengeDateName = complaintletterDTO.ChallengeDate.Value.ToString("yyyy-MM-dd"); + complaintletterDTO.ChallengeDateName = complaintletterDTO.ChallengeDate.Value.ToString("yyyy骞碝M鏈坉d鏃�"); } if (complaintletterDTO.RespondDate.HasValue) { - complaintletterDTO.RespondDateName = complaintletterDTO.RespondDate.Value.ToString("yyyy-MM-dd"); + complaintletterDTO.RespondDateName = complaintletterDTO.RespondDate.Value.ToString("yyyy骞碝M鏈坉d鏃�"); } List<TComplaintItemDTO> complaintItemDTOs = _cooperOrderService.GetListComplaintItem(complaintletterDTO.Id); if (complaintItemDTOs.Count > 0) + { complaintletterDTO.complaintItemDTOs = complaintItemDTOs; + foreach (var complaintItemDTO in complaintletterDTO.complaintItemDTOs) + { + var sysCodeDtls2 = sysCodeDtls1.Where(x => x.Classify1 == complaintItemDTO.Question).ToList(); + complaintItemDTO.sysCodeDtls = sysCodeDtls2; + } + } + else + { complaintletterDTO.complaintItemDTOs = new List<TComplaintItemDTO>() { new TComplaintItemDTO() }; + complaintletterDTO.complaintItemDTOs[0].sysCodeDtls = new List<SysCodeDtl>() { new SysCodeDtl() }; + } + List<TComplaintRespondentDTO> complaintRespondentDTOs = _cooperOrderService.GetListComplaintRespondent(complaintletterDTO.Id); if (complaintRespondentDTOs.Count > 0) @@ -2198,6 +2471,7 @@ else { complaintletterDTO.complaintItemDTOs = new List<TComplaintItemDTO>() { new TComplaintItemDTO() }; + complaintletterDTO.complaintItemDTOs[0].sysCodeDtls = new List<SysCodeDtl>() { new SysCodeDtl() }; complaintletterDTO.complaintRespondentDTOs = new List<TComplaintRespondentDTO>() { new TComplaintRespondentDTO() }; complaintletterDTO.complaintShouquandaibiaoDTOs = new List<TComplaintShouquandaibiaoDTO>() { new TComplaintShouquandaibiaoDTO() }; complaintletterDTO.complaintGongyingshangDTOs = new List<TComplaintGongyingshangDTO>() { new TComplaintGongyingshangDTO() }; @@ -2205,10 +2479,46 @@ } + if (string.IsNullOrEmpty(complaintletterDTO.ChallengeDateName)) + { + complaintletterDTO.ChallengeDateName = "銆�銆�骞淬��鏈堛��鏃�"; + } + if (string.IsNullOrEmpty(complaintletterDTO.Questioned)) + { + complaintletterDTO.Questioned = "銆�銆�銆�銆�銆�銆�"; + } + if (string.IsNullOrEmpty(complaintletterDTO.Respondent)) + { + complaintletterDTO.Respondent = "銆�銆�銆�銆�銆�銆�"; + } + if (string.IsNullOrEmpty(complaintletterDTO.RespondDateName)) + { + complaintletterDTO.RespondDateName = "銆�銆�骞淬��鏈堛��鏃�"; + } + //璐ㄧ枒鍑� + List<TChallengeletterDTO> challengeletterDTOs = _cooperOrderService.GetListChallengeletter(complaintletterDTO.TsrId); + TChallengeletterDTO challengeletterDTO = new TChallengeletterDTO(); + if (challengeletterDTOs != null && challengeletterDTOs.Count > 0) + { + challengeletterDTO = challengeletterDTOs[0]; + List<TChallengeItemDTO> challengeItemDTOs = _cooperOrderService.GetListChallengeItem(challengeletterDTO.Id); + complaintletterDTO.SqdbId = ""; + if (challengeItemDTOs.Count > 0) + { + + foreach (var challengeItemDTO in challengeItemDTOs) + { + + complaintletterDTO.SqdbId += challengeItemDTO.QuestionName+";"; + } + } + - + + } + -- Gitblit v1.9.1