username@email.com
2021-07-30 f0226fac55f50b362d145ce969e66d41606a8b06
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 = "[]";