Browse Source

1.結算调整优化 跟单作废 金额调整

wuhp 2 years ago
parent
commit
f12d567bdc

+ 6 - 9
src/main/java/com/ydtech/modules/fnc/service/impl/ImportAsyncServiceImpl.java

@@ -163,7 +163,6 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
                         totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
                     }
-                    insPlyIncomeMapper.updateById(insPlyIncome);
                 } else {
                     InsImportResult insImportResult = new InsImportResult();
                     if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
@@ -240,6 +239,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
 
         BigDecimal totalAmount = BigDecimal.ZERO;
         HashMap<String, Object> params = new HashMap<>();
+        List<String> idList= new ArrayList<>();
         List<InsImportResult> insImportResultsExcel = new ArrayList<>();
         String companyId  ="";
         String partnerCompaniesId  ="";
@@ -314,11 +314,10 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     agreementId = insPlyIncome.getAgreementId();  //协议id
                 }
                 if (ObjectUtils.isNotEmpty(insPlyIncome)) {  // 比配上汇总金额 未匹配则返回到数据当中
+                    idList.add(insPlyIncome.getId());
                     if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
                         totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
                     }
-                    
-                    insPlyIncomeMapper.updateById(insPlyIncome);
                 } else {
                     InsImportResult insImportResult = new InsImportResult();
                     if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
@@ -347,7 +346,6 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
             }
         }
         String fileName = EasyExcelUtils.downExcel(uploadPath, "保险对账问题文件", InsImportResult.class, insImportResultsExcel);
-        String  url=uploadUrl + "excel/" + fileName;
 
         ImportResult endTask = new ImportResult();
         endTask.setTotalAmount(totalAmount);
@@ -356,6 +354,9 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
         endTask.setStatus("complete");
         if(!CollectionUtils.isEmpty(insImportResultsExcel)){
             endTask.setUploadUrl("/upload/excel/" + taskId + "/" + fileName);
+        }else {
+            //则生成 结算任务关系表
+            incomeTaskRelationshipService.saveByIncomeIdList(taskId,idList);
         }
         endTask.setCompanyId(companyId);
         endTask.setAgreementId(agreementId);
@@ -429,7 +430,6 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                         totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
                     }
                     
-                    insPlyIncomeMapper.updateById(insPlyIncome);
                 } else {
                     InsImportResult insImportResult = new InsImportResult();
                     if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
@@ -455,7 +455,6 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
             }
         }
         String fileName = EasyExcelUtils.downExcel(uploadPath, "保险对账问题文件", InsImportResult.class, insImportResultsExcel);
-        String  url=uploadUrl + "excel/" + fileName;
 
         ImportResult endTask = new ImportResult();
         endTask.setTotalAmount(totalAmount);
@@ -540,7 +539,6 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                         totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
                     }
                     
-                    insPlyIncomeMapper.updateById(insPlyIncome);
                 } else {
                     InsImportResult insImportResult = new InsImportResult();
                     if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
@@ -566,7 +564,6 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
             }
         }
         String fileName = EasyExcelUtils.downExcel(uploadPath, "保险对账问题文件", InsImportResult.class, insImportResultsExcel);
-        String  url=uploadUrl + "excel/" + fileName;
 
         ImportResult endTask = new ImportResult();
         endTask.setTotalAmount(totalAmount);
@@ -582,7 +579,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
         endTask.setCompanyId(companyId);
         endTask.setAgreementId(agreementId);
         endTask.setPartnerCompaniesId(partnerCompaniesId);
-        endTask.setHandStatus("3");
+        endTask.setHandStatus("1");
         baseMapper.updateById(endTask);
     }
 }

+ 1 - 1
src/main/resources/mapper/modules/fnc/SettlementDocumentaryFeesMapper.xml

@@ -87,7 +87,7 @@
         a.tax_points AS  "taxPoints",
         a.settlement_amount - COALESCE(b.settlementAmount, 0) AS "invoicCommissionFeevalue",
         a.agreement_type as "agreementType",
-        a.agreement_type as "agreementType",
+        a.invoicing_method as "invoicingMethod",
         a.ids  as "ids",
         a.task_id AS  "taskId"
         FROM