username@email.com
2022-08-29 c06eb4d284a80dbee4a2d040046c37bf73dcfcd5
zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs
@@ -1324,9 +1324,10 @@
            //dto.Id = id;
            dto.Wangonger = curentuser.Id;
            dto.Wangongtime = DateTime.Now;
            dto.WangongStatus = "A";
            dto.ShouliStatus = "4";
            ResultEntity resultEntity = _cooperOrderService.save(dto);
            ResultEntity resultEntity = _cooperOrderService.Wangong(dto);
            return new JsonResult(resultEntity);
        }
@@ -1415,11 +1416,13 @@
                resultEntity = _cooperOrderService.chedan(dto);
                var fiAccountRecordDTOs = _iFiAccountRecordService.GetList("订单收款"+dto.OrderNo);
                var fiAccountRecordDTOs = _iFiAccountRecordService.GetList("订单收款"+dto.OrderNo, dto.OrderNo);
                if (fiAccountRecordDTOs!= null && fiAccountRecordDTOs.Count > 0)
                {
                    var sysCodeDtls = _liaotianService.GetSYScode("CooperVisit", "jtype");
                    foreach (var fiAccountRecordDTO in fiAccountRecordDTOs)
                    {
                        CooperatecustomCustomerDTO cooperatecustomCustomerDTO = _cooperatecustomCustomerService.Get(dto.Khdw);
                        FiAccountRecordDTO data1 = new FiAccountRecordDTO();
                        data1.RecStatus = "A";
@@ -1430,21 +1433,36 @@
                        data1.SubjectId = fiAccountRecordDTO.SubjectId;
                        data1.AccountId = fiAccountRecordDTO.AccountId;
                        data1.Money = fiAccountRecordDTO.Money;
                        data1.Money = -fiAccountRecordDTO.Money;
                        data1.PaymentUnit = cooperatecustomCustomerDTO.Name;
                        data1.OperationalMatters = "订单撤单" + dto.OrderNo;
                        var ssss = sysCodeDtls.Where(x => x.CodeSn == dto.OrderType).FirstOrDefault();
                        if (ssss!=null)
                        {
                            dto.OrderTypeName = ssss.Comments;
                        }
                        var book = _fiBookService.Get(dto.OrderType1);
                        var member = _fiMemberService.Get(dto.OrderType1);
                        if (book != null)
                        {
                            dto.OrderType1 = book.BookName;
                        }
                        if (member != null)
                        {
                            dto.OrderType1 = member.MemberType;
                        }
                        data1.OperationalMatters = dto.OrderTypeName + dto.OrderType1 + dto.OrderType2 + " 订单撤单退款"  ;
                        data1.Remark =  dto.OrderNo;
                        FiAccountDTO firmAccount = _fiAccountService.Get(data1.AccountId);
                        data1.RecordTypeId = "2";//退款
                        data1.RecordTypeId = "1";//退款
                        data1.Department = "";
                        firmAccount.AllExpenses = (firmAccount.AllExpenses ?? 0) + fiAccountRecordDTO.Money;
                        firmAccount.AllIncome = (firmAccount.AllIncome ?? 0) - fiAccountRecordDTO.Money;
                        firmAccount.Balance = (firmAccount.Balance ?? 0) - fiAccountRecordDTO.Money;
                        data1.AccountMoney = firmAccount.Balance;