username@email.com
2022-07-15 283f3e33e15409f657c152881620103c95811768
zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs
@@ -47,6 +47,7 @@
        private readonly IFiOrderrecievemoneyService _fiOrderrecievemoneyService;
        private readonly IFiAccountService _fiAccountService;
        private readonly IFiAccountRecordService _iFiAccountRecordService;
        private readonly ISysAttachmentService _sysAttachmentService;
        public CooperOrderController(ILogger<CooperOrderController> logger, ILiaotianService liaotianService, IUserService userService, ICooperOrderService cooperOrderService
@@ -60,6 +61,7 @@
            , IFiOrderrecievemoneyService fiOrderrecievemoneyService
            , IFiAccountService fiAccountService
            , IFiAccountRecordService iFiAccountRecordService
             , ISysAttachmentService sysAttachmentService
            )
        {
            _logger = logger;
@@ -80,6 +82,7 @@
            _fiOrderrecievemoneyService = fiOrderrecievemoneyService;
            _fiAccountService = fiAccountService;
            _iFiAccountRecordService = iFiAccountRecordService;
            _sysAttachmentService = sysAttachmentService;
        }
        [CheckLogin]
@@ -1017,7 +1020,13 @@
            ResultEntity resultEntity = new ResultEntity();
            resultEntity.Result = false;
            using (TransactionScope scope = new TransactionScope())
            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
          new TransactionOptions
          {
              IsolationLevel = IsolationLevel.ReadCommitted,
              Timeout = TransactionManager.MaximumTimeout
          }
          ))
            {
                CooperOrderDTO dto = _cooperOrderService.Get(id);
@@ -1084,6 +1093,59 @@
                }
                if(dto.Money<=0 && dto.OrderType == "05")
                {
                var cooperatecustomCustomerDTO = _cooperatecustomCustomerService.Get(dto.Khdw);
                var fiMemberDTO = _fiMemberService.Get(dto.OrderType1);
                //开通会员
                string huiyuanurl = _configuration.GetSection("huiyuanurl").Value;
                string OAWriteChangeAsync = _configuration.GetSection("OAWriteChangeAsync").Value;
                Uri postUrl2 = new Uri(huiyuanurl + OAWriteChangeAsync);
                JObject questions2 = new JObject();
                questions2.Add("UserID", cooperatecustomCustomerDTO.HuiyuanId);
                questions2.Add("PhoneNumber", cooperatecustomCustomerDTO.Tel);
                questions2.Add("VIPName", fiMemberDTO.MemberType);
                questions2.Add("FromName", "OA");
                questions2.Add("UserName", cooperatecustomCustomerDTO.Name);
                string requestJson2 = questions2.ToString();
                    string result2 = string.Empty;
                    using (HttpContent httpContent = new StringContent(requestJson2))
                    {
                        httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                        using (HttpClient httpClient = new HttpClient())
                        {
                            httpClient.Timeout = new TimeSpan(0, 0, 10);
                            HttpResponseMessage responseMessage = httpClient.PostAsync(postUrl2, httpContent).Result;
                            result2 = responseMessage.Content.ReadAsStringAsync().Result;
                        }
                    }
                    _logger.LogInformation("result2:" + result2);
                    JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2);
                    if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1")
                    {
                        cooperatecustomCustomerDTO.HuiyuanId = jobjectresult["UserID"].ToString();
                        _cooperatecustomCustomerService.save(cooperatecustomCustomerDTO);
                        resultEntity.Result = true;
                    }
                    else
                    {
                        resultEntity.Result = false;
                        resultEntity.Message = "写入会员权限失败";
                        return new JsonResult(resultEntity);
                    }
                }
                dto.Shoulier = curentuser.Id;
                dto.Shoulitime = DateTime.Now;
@@ -1140,9 +1202,10 @@
            ResultEntity resultEntity = new ResultEntity();
            resultEntity.Result = false;
            using (TransactionScope scope = new TransactionScope())
            {
                CooperOrderDTO dto = _cooperOrderService.Get(Chedanid);
                if (dto.ShouliStatus != "2")
                {
@@ -2200,10 +2263,53 @@
            //ViewBag.law = sysCodeDtls1;//法律依据
            var cooperOrderDTO = _cooperOrderService.Get(id);
            var cooperatecustomCustomerDTO = _cooperatecustomCustomerService.Get(cooperOrderDTO.Khdw);
            if (cooperatecustomCustomerDTO.Name.IndexOf("股份有限公司") >= 0)
            {
                cooperatecustomCustomerDTO.Zhiwu = "董事长";
            }
            else if (cooperatecustomCustomerDTO.Name.IndexOf("有限公司") >= 0 || cooperatecustomCustomerDTO.Name.IndexOf("有限责任公司") >= 0)
            {
                cooperatecustomCustomerDTO.Zhiwu = "执行董事";
            }
            else if (cooperatecustomCustomerDTO.Name.IndexOf("协会") >= 0)
            {
                cooperatecustomCustomerDTO.Zhiwu = "会长";
            }
            else
            {
                cooperatecustomCustomerDTO.Zhiwu = "总经理";
            }
            ResultDataEntity<SysAttachmentDTO> resultsyinyezhizhao = new ResultDataEntity<SysAttachmentDTO>();
            SysAttachmentDTOSearch searchEntity = new SysAttachmentDTOSearch();
            searchEntity.page = 1;
            searchEntity.rows = 1000;
            searchEntity.AttObj = "Cooperyinyezhizhao";
            searchEntity.AttObjid = cooperOrderDTO.Khdw;
            resultsyinyezhizhao = _sysAttachmentService.SearchByPaging(searchEntity);
            ViewBag.yinyezhizhao = resultsyinyezhizhao;
            ResultDataEntity<SysAttachmentDTO> resultshenfenzheng = new ResultDataEntity<SysAttachmentDTO>();
            SysAttachmentDTOSearch searchEntity1 = new SysAttachmentDTOSearch();
            searchEntity1.page = 1;
            searchEntity1.rows = 1000;
            searchEntity1.AttObj = "Cooperashenfenzheng";
            searchEntity1.AttObjid = cooperOrderDTO.Khdw;
            resultshenfenzheng = _sysAttachmentService.SearchByPaging(searchEntity1);
            ViewBag.shenfenzheng = resultshenfenzheng;
            ViewBag.cooperatecustomCustomerDTO = cooperatecustomCustomerDTO;
            ViewData.Model = challengeletterDTO;
            return View();
        }
@@ -2731,10 +2837,50 @@
                
            }
            var cooperOrderDTO = _cooperOrderService.Get(id);
            var cooperatecustomCustomerDTO = _cooperatecustomCustomerService.Get(cooperOrderDTO.Khdw);
            if (cooperatecustomCustomerDTO.Name.IndexOf("股份有限公司") >= 0)
            {
                cooperatecustomCustomerDTO.Zhiwu = "董事长";
            }
            else if (cooperatecustomCustomerDTO.Name.IndexOf("有限公司") >= 0 || cooperatecustomCustomerDTO.Name.IndexOf("有限责任公司") >= 0)
            {
                cooperatecustomCustomerDTO.Zhiwu = "执行董事";
            }
            else if (cooperatecustomCustomerDTO.Name.IndexOf("协会") >= 0)
            {
                cooperatecustomCustomerDTO.Zhiwu = "会长";
            }
            else
            {
                cooperatecustomCustomerDTO.Zhiwu = "总经理";
            }
            ResultDataEntity<SysAttachmentDTO> resultsyinyezhizhao = new ResultDataEntity<SysAttachmentDTO>();
            SysAttachmentDTOSearch searchEntity = new SysAttachmentDTOSearch();
            searchEntity.page = 1;
            searchEntity.rows = 1000;
            searchEntity.AttObj = "Cooperyinyezhizhao";
            searchEntity.AttObjid = cooperOrderDTO.Khdw;
            resultsyinyezhizhao = _sysAttachmentService.SearchByPaging(searchEntity);
            ViewBag.yinyezhizhao = resultsyinyezhizhao;
            ResultDataEntity<SysAttachmentDTO> resultshenfenzheng = new ResultDataEntity<SysAttachmentDTO>();
            SysAttachmentDTOSearch searchEntity1 = new SysAttachmentDTOSearch();
            searchEntity1.page = 1;
            searchEntity1.rows = 1000;
            searchEntity1.AttObj = "Cooperashenfenzheng";
            searchEntity1.AttObjid = cooperOrderDTO.Khdw;
            resultshenfenzheng = _sysAttachmentService.SearchByPaging(searchEntity1);
            ViewBag.shenfenzheng = resultshenfenzheng;
            ViewBag.cooperatecustomCustomerDTO = cooperatecustomCustomerDTO;
            ViewData.Model = complaintletterDTO;