| | |
| | | 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); |
| | | } |
| | | 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 == "代拟投诉书" || data.OrderType1 == "代拟质疑函"))) |
| | | { |
| | | 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 == "代拟投诉书" || data.OrderType1 == "代拟质疑函"))) |
| | | { |
| | | |
| | | 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 |
| | | } |
| | | )) |
| | | { |
| | | |
| | | 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; |
| | | data.Modifytime = DateTime.Now; |