From ef80d35cdbabf2ac5fd83f84714b4254e6444fef Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期二, 28 九月 2021 14:22:27 +0800 Subject: [PATCH] 通讯录,账号密码 --- zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 51 insertions(+), 8 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs b/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs index 8fd61ed..7693c12 100644 --- a/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs @@ -40,13 +40,15 @@ private readonly IFiMemberService _fiMemberService; private readonly IConfiguration _configuration; private readonly IHttpClientFactory _clientFactory; + private readonly IAskService _askService; 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) + , IHttpClientFactory clientFactory + , IAskService askService) { _logger = logger; _liaotianService = liaotianService; @@ -60,6 +62,7 @@ _fiMemberService = fiMemberService; _configuration = configuration; _clientFactory = clientFactory; + _askService = askService; } [CheckLogin] @@ -405,12 +408,14 @@ { dto = _cooperOrderService.Get(id); ViewBag.ShouliStatus = ShouliStatus; + //ViewBag.YouHuiList = _askService.GetAskYouHuiList(dto.Khdw, dto.OrderType); } else { dto.XdTime = DateTime.Now; dto.OrderNum = 1; ViewBag.ShouliStatus = "1"; + //ViewBag.YouHuiList = new List<AdmAskYouHuiDTO>(); } @@ -534,14 +539,49 @@ } - data.ShouliStatus = "1"; - data.Modifier = curentuser.Id; - data.Modifytime = DateTime.Now; - resultEntity = _cooperOrderService.save(data); + 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); // scope.Complete(); //} - + return new JsonResult(resultEntity); } @@ -847,7 +887,7 @@ result = JsonConvert.SerializeObject(shi); } - if (OrderType == "08" || OrderType == "10") + if (OrderType == "08" || OrderType == "10" || OrderType == "11") { result = "[]"; @@ -906,7 +946,10 @@ } - + if (result == "") + { + result = "[]"; + } return result; } -- Gitblit v1.9.1