Procházet zdrojové kódy

1.結算调整优化 对账 税收 优化

wuhp před 2 roky
rodič
revize
c228d76467

+ 5 - 0
src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java

@@ -169,6 +169,11 @@ public class InsPlyIncomeController extends BaseController {
         return insPlyIncomeService.batchPinBalance(insPlyIncomeVo);
     }
 
+    @PutMapping("/reconciliation")
+    @ApiModelProperty(value = "对账")
+    public HttpResult<Object> reconciliation(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
+        return insPlyIncomeService.reconciliation(insPlyIncomeVo);
+    }
     @PostMapping("/NonSettlementQuery")
     @ApiOperation(value = "非跟单查询")
     public HttpResult<BasePageResult<InsPlyIncome>> NonSettlementQuery(@Valid @RequestBody InsPlyIncomeVo insPlyIncomeVo) {

+ 2 - 0
src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java

@@ -136,4 +136,6 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     HashMap<String, Object> noBxImportOther(MultipartFile multipartFile, String isNotCar);
 
     void batchUpdateVoucher(InsPlyIncomeVo insPlyIncomeVo);
+
+    HttpResult<Object> reconciliation(InsPlyIncomeVo insPlyIncomeVo);
 }

+ 121 - 135
src/main/java/com/ydtech/modules/fnc/service/impl/ImportAsyncServiceImpl.java

@@ -76,78 +76,26 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
 
         if (!CollectionUtils.isEmpty(dtoList)) {
             for (InsBxPlyIncomeExcelDto excelItem : dtoList) {
+                InsImportResult insImportResult = new InsImportResult();
+
                 String reason = "";
                 i = i + 1;
                 params.clear();
                 if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
                     String licenseno = excelItem.getLicenseno();//车牌号
                     params.put("licenseno", licenseno);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据车牌号有问题";
-                    }
                 }
                 if (StringUtils.isNotEmpty(excelItem.getPolicyno())) {
                     String policyno = excelItem.getPolicyno(); //交强保单号
                     params.put("policyno", policyno);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据交强保单号有问题";
-                    }
                 }
 
                 if (StringUtils.isNotEmpty(excelItem.getSyPolicyno())) {
                     String syPolicyno = excelItem.getSyPolicyno(); //商业保单号
                     params.put("syPolicyno", syPolicyno);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据商业保单号有问题";
-                    }
                 }
 
-                if (excelItem.getJqSuperviseCostsPremiums() != null && excelItem.getJqSuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0) {
-                    params.put("jqSuperviseCostsPremiums", excelItem.getJqSuperviseCostsPremiums());
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据交强手续费金额有问题";
-                    }
-                }
-                if (excelItem.getJqSuperviseCostsProportion() != null && excelItem.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
-                    params.put("jqSuperviseCostsProportion", excelItem.getJqSuperviseCostsProportion());
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据交强手续费比例有问题";
-                    }
-                }
-                if (excelItem.getSySuperviseCostsProportion() != null && excelItem.getSySuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
-                    params.put("sySuperviseCostsProportion", excelItem.getSySuperviseCostsProportion());
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据商业手续费比例有问题";
-                    }
-                }
 
-                if (excelItem.getSySuperviseCostsPremiums() != null && excelItem.getSySuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0) {
-                    params.put("sySuperviseCostsPremiums", excelItem.getSySuperviseCostsPremiums());
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据商业手续费金额有问题";
-                    }
-                }
-                if (excelItem.getJqPremium() != null && excelItem.getJqPremium().compareTo(BigDecimal.ZERO) != 0) {
-                    params.put("jqPremium", excelItem.getJqPremium());
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据交强保费有问题";
-                    }
-                }
-                if (excelItem.getSyPremium() != null && excelItem.getSyPremium().compareTo(BigDecimal.ZERO) != 0) {
-                    params.put("syPremium", excelItem.getSyPremium());
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据商业保费有问题";
-                    }
-                }
 //                  只查手续费
                 params.put("isOther", "0");
                 params.put("isNotCar", isNotCar);
@@ -163,8 +111,51 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
                         totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
                     }
+                    if (excelItem.getJqSuperviseCostsPremiums() != null && excelItem.getJqSuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0) {
+                        params.put("jqSuperviseCostsPremiums", excelItem.getJqSuperviseCostsPremiums());
+                        InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
+                        if (ObjectUtils.isEmpty(byBxLicenseno)) {
+                            reason = "该数据交强手续费金额有问题";
+                        }
+                    }
+                    if (excelItem.getJqSuperviseCostsProportion() != null && excelItem.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
+                        params.put("jqSuperviseCostsProportion", excelItem.getJqSuperviseCostsProportion());
+                        InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
+                        if (ObjectUtils.isEmpty(byBxLicenseno)) {
+                            reason = "该数据交强手续费比例有问题";
+                        }
+                    }
+                    if (excelItem.getSySuperviseCostsProportion() != null && excelItem.getSySuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
+                        params.put("sySuperviseCostsProportion", excelItem.getSySuperviseCostsProportion());
+                        InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
+                        if (ObjectUtils.isEmpty(byBxLicenseno)) {
+                            reason = "该数据商业手续费比例有问题";
+                        }
+                    }
+
+                    if (excelItem.getSySuperviseCostsPremiums() != null && excelItem.getSySuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0) {
+                        params.put("sySuperviseCostsPremiums", excelItem.getSySuperviseCostsPremiums());
+                        InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
+                        if (ObjectUtils.isEmpty(byBxLicenseno)) {
+                            reason = "该数据商业手续费金额有问题";
+                        }
+                    }
+                    if (excelItem.getJqPremium() != null && excelItem.getJqPremium().compareTo(BigDecimal.ZERO) != 0) {
+                        params.put("jqPremium", excelItem.getJqPremium());
+                        InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
+                        if (ObjectUtils.isEmpty(byBxLicenseno)) {
+                            reason = "该数据交强保费有问题";
+                        }
+                    }
+                    if (excelItem.getSyPremium() != null && excelItem.getSyPremium().compareTo(BigDecimal.ZERO) != 0) {
+                        params.put("syPremium", excelItem.getSyPremium());
+                        InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
+                        if (ObjectUtils.isEmpty(byBxLicenseno)) {
+                            reason = "该数据商业保费有问题";
+                        }
+                    }
                 } else {
-                    InsImportResult insImportResult = new InsImportResult();
+                    reason = "查询不到该车辆";
                     if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
                         insImportResult.setLicenseno(excelItem.getLicenseno());
                     }
@@ -174,9 +165,12 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     if (StringUtils.isNotEmpty(excelItem.getSyPolicyno())) {
                         insImportResult.setSyPolicyno(excelItem.getSyPolicyno());
                     }
-                    if(StringUtils.isNotEmpty(reason)){
-                        insImportResult.setReason(reason);
-                    }
+
+                }
+                if(StringUtils.isNotEmpty(reason)){
+                    insImportResult.setReason(reason);
+                }
+                if(StringUtils.isNotEmpty(insImportResult.getLicenseno())){
                     insImportResultsExcel.add(insImportResult);
                 }
             }
@@ -258,51 +252,25 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
 
         if (!CollectionUtils.isEmpty(dtoList)) {
             for (InsBxOtherExcelDto excelItem : dtoList) {
+                InsImportResult insImportResult = new InsImportResult();
                 String reason = "";
                 i = i + 1;
                 params.clear();
                 if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
                     String licenseno = excelItem.getLicenseno();//车牌号
                     params.put("licenseno", licenseno);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据车牌号有问题";
-                    }
                 }
                 if (StringUtils.isNotEmpty(excelItem.getPolicyno())) {
                     String policyno = excelItem.getPolicyno(); //交强保单号
                     params.put("policyno", policyno);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据交强保单号有问题";
-                    }
                 }
 
                 if (StringUtils.isNotEmpty(excelItem.getSyPolicyno())) {
                     String syPolicyno = excelItem.getSyPolicyno(); //商业保单号
                     params.put("syPolicyno", syPolicyno);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据商业保单号有问题";
-                    }
                 }
 
-                if (excelItem.getJqOtherCostsProportion()!=null  &&  excelItem.getJqOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
-                    BigDecimal jqOtherCostsProportion = excelItem.getJqOtherCostsProportion();//商业保单号
-                    params.put("jqOtherCostsProportion", jqOtherCostsProportion);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据交强跟单比例有问题";
-                    }
-                }
-                if (excelItem.getSyOtherCostsProportion()!=null  &&  excelItem.getSyOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
-                    BigDecimal syOtherCostsProportion = excelItem.getSyOtherCostsProportion();//商业保单号
-                    params.put("syOtherCostsProportion", syOtherCostsProportion);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据商业跟单比例有问题";
-                    }
-                }
+
 //                  只查手续费
                 params.put("isOther", "1");
                 params.put("isNotCar", isNotCar);
@@ -314,12 +282,30 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     agreementId = insPlyIncome.getAgreementId();  //协议id
                 }
                 if (ObjectUtils.isNotEmpty(insPlyIncome)) {  // 比配上汇总金额 未匹配则返回到数据当中
+                    if (excelItem.getJqOtherCostsProportion()!=null  &&  excelItem.getJqOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
+                        BigDecimal jqOtherCostsProportion = excelItem.getJqOtherCostsProportion();//商业保单号
+                        params.put("jqOtherCostsProportion", jqOtherCostsProportion);
+                        InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
+                        if (ObjectUtils.isEmpty(byBxLicenseno)) {
+                            reason = "该数据交强跟单比例有问题";
+                        }
+                    }
+                    if (excelItem.getSyOtherCostsProportion()!=null  &&  excelItem.getSyOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
+                        BigDecimal syOtherCostsProportion = excelItem.getSyOtherCostsProportion();//商业保单号
+                        params.put("syOtherCostsProportion", syOtherCostsProportion);
+                        InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
+                        if (ObjectUtils.isEmpty(byBxLicenseno)) {
+                            reason = "该数据商业跟单比例有问题";
+                        }
+                    }
+
                     idList.add(insPlyIncome.getId());
-                    if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
-                        totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
+                    if (insPlyIncome.getOtherFeevalue() != null && insPlyIncome.getOtherFeevalue().compareTo(BigDecimal.ZERO) != 0) {
+                        totalAmount = totalAmount.add(insPlyIncome.getOtherFeevalue());  //添加总跟单
                     }
                 } else {
-                    InsImportResult insImportResult = new InsImportResult();
+
+                    reason = "查询不到该车辆";
                     if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
                         insImportResult.setLicenseno(excelItem.getLicenseno());
                     }
@@ -329,9 +315,12 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     if (StringUtils.isNotEmpty(excelItem.getSyPolicyno())) {
                         insImportResult.setSyPolicyno(excelItem.getSyPolicyno());
                     }
-                    if(StringUtils.isNotEmpty(reason)){
-                        insImportResult.setReason(reason);
-                    }
+
+                }
+                if(StringUtils.isNotEmpty(reason)){
+                    insImportResult.setReason(reason);
+                }
+                if(StringUtils.isNotEmpty(insImportResult.getLicenseno()) ){
                     insImportResultsExcel.add(insImportResult);
                 }
             }
@@ -388,33 +377,19 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
 
         if (!CollectionUtils.isEmpty(dtoList)) {
             for (InsNoBxOtherExcelDto excelItem : dtoList) {
+                InsImportResult insImportResult = new InsImportResult();
                 String reason = "";
                 i = i + 1;
                 params.clear();
                 if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
                     String licenseno = excelItem.getLicenseno();//车牌号
                     params.put("licenseno", licenseno);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据车牌号有问题";
-                    }
                 }
                 if (StringUtils.isNotEmpty(excelItem.getNoPolicyno())) {
-                    String noPolicyno = excelItem.getNoPolicyno(); //交强保单号
+                    String noPolicyno = excelItem.getNoPolicyno(); //非车保单号
                     params.put("noPolicyno", noPolicyno);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据非车保单号有问题";
-                    }
-                }
-                if (excelItem.getNoOtherCostsProportion()!=null  &&  excelItem.getNoOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
-                    BigDecimal noOtherCostsProportion = excelItem.getNoOtherCostsProportion();//商业保单号
-                    params.put("noOtherCostsProportion", noOtherCostsProportion);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据非车跟单比例有问题";
-                    }
                 }
+
 //                  只查手续费
                 params.put("isOther", "1");
                 params.put("isNotCar", isNotCar);
@@ -426,21 +401,33 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     agreementId = insPlyIncome.getAgreementId();  //协议id
                 }
                 if (ObjectUtils.isNotEmpty(insPlyIncome)) {  // 比配上汇总金额 未匹配则返回到数据当中
-                    if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
-                        totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
+                    if (excelItem.getNoOtherCostsProportion()!=null  &&  excelItem.getNoOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
+                        BigDecimal noOtherCostsProportion = excelItem.getNoOtherCostsProportion();//商业保单号
+                        params.put("noOtherCostsProportion", noOtherCostsProportion);
+                        InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
+                        if (ObjectUtils.isEmpty(byBxLicenseno)) {
+                            reason = "该数据非车跟单比例有问题";
+                        }
+                    }
+                    if (insPlyIncome.getOtherFeevalue() != null && insPlyIncome.getOtherFeevalue().compareTo(BigDecimal.ZERO) != 0) {
+                        totalAmount = totalAmount.add(insPlyIncome.getOtherFeevalue());  //添加总手续费
                     }
                     
                 } else {
-                    InsImportResult insImportResult = new InsImportResult();
+                    reason = "查询不到该车辆";
+
                     if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
                         insImportResult.setLicenseno(excelItem.getLicenseno());
                     }
                     if (StringUtils.isNotEmpty(excelItem.getNoPolicyno())) {
                         insImportResult.setPolicyno(excelItem.getNoPolicyno());
                     }
-                    if(StringUtils.isNotEmpty(reason)){
-                        insImportResult.setReason(reason);
-                    }
+
+                }
+                if(StringUtils.isNotEmpty(reason)){
+                    insImportResult.setReason(reason);
+                }
+                if(StringUtils.isNotEmpty(insImportResult.getLicenseno())){
                     insImportResultsExcel.add(insImportResult);
                 }
             }
@@ -496,33 +483,19 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
 
         if (!CollectionUtils.isEmpty(dtoList)) {
             for (InsBxNoPlyIncomeExcelDto excelItem : dtoList) {
+                InsImportResult insImportResult = new InsImportResult();
                 String reason = "";
                 i = i + 1;
                 params.clear();
                 if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
                     String licenseno = excelItem.getLicenseno();//车牌号
                     params.put("licenseno", licenseno);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据车牌号有问题";
-                    }
                 }
                 if (StringUtils.isNotEmpty(excelItem.getNoPolicyno())) {
                     String noPolicyno = excelItem.getNoPolicyno(); //交强保单号
                     params.put("noPolicyno", noPolicyno);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据非车保单号有问题";
-                    }
-                }
-                if (excelItem.getNoSuperviseCostsProportion()!=null  &&  excelItem.getNoSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
-                    BigDecimal noSuperviseCostsProportion = excelItem.getNoSuperviseCostsProportion();//商业保单号
-                    params.put("noSuperviseCostsProportion", noSuperviseCostsProportion);
-                    InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                    if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                        reason = "该数据非车手续费比例有问题";
-                    }
                 }
+
 //                  只查手续费
                 params.put("isOther", "1");
                 params.put("isNotCar", "1");
@@ -538,18 +511,31 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
                         totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
                     }
+                    if (excelItem.getNoSuperviseCostsProportion()!=null  &&  excelItem.getNoSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
+                        BigDecimal noSuperviseCostsProportion = excelItem.getNoSuperviseCostsProportion();//商业保单号
+                        params.put("noSuperviseCostsProportion", noSuperviseCostsProportion);
+                        InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
+                        if (ObjectUtils.isEmpty(byBxLicenseno)) {
+                            reason = "该数据非车手续费比例有问题";
+                        }
+                    }
                     
                 } else {
-                    InsImportResult insImportResult = new InsImportResult();
+
+                    reason = "查询不到该车辆";
+
                     if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
                         insImportResult.setLicenseno(excelItem.getLicenseno());
                     }
                     if (StringUtils.isNotEmpty(excelItem.getNoPolicyno())) {
                         insImportResult.setPolicyno(excelItem.getNoPolicyno());
                     }
-                    if(StringUtils.isNotEmpty(reason)){
-                        insImportResult.setReason(reason);
-                    }
+
+                }
+                if(StringUtils.isNotEmpty(reason)){
+                    insImportResult.setReason(reason);
+                }
+                if(StringUtils.isNotEmpty(insImportResult.getLicenseno())){
                     insImportResultsExcel.add(insImportResult);
                 }
             }

+ 29 - 3
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -62,6 +62,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.awt.image.BandedSampleModel;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -1921,6 +1922,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                     params.put("syPolicyno",item.getSyPolicyno());
                 }
                 params.put("handlingFeesStatus","0");
+//                isOther
+                params.put("isOther","1");
+                params.put("isNotCar","0");
                 InsPlyIncome byBxLicenseno = baseMapper.findByBxLicenseno(params);
 
                 if (item.getJqOtherCostsProportion() ==null){
@@ -1934,9 +1938,10 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                 // 如果比例不相等
                     BigDecimal jqOtherCostsProportion = item.getJqOtherCostsProportion();
                     BigDecimal syOtherCostsProportion = item.getSyOtherCostsProportion();
+                    BigDecimal divisor = new BigDecimal("1.06"); // 最好是使用字符串来避免精度损失
 
-                    BigDecimal jqNoTaxPremium = byBxLicenseno.getJqPremium();//交强含税
-                    BigDecimal syNoTaxPremium = byBxLicenseno.getSyPremium();// 商业不含税
+                    BigDecimal jqNoTaxPremium = byBxLicenseno.getJqPremium().divide(divisor, 5, RoundingMode.HALF_UP);//交强保费 / 1.06
+                    BigDecimal syNoTaxPremium = byBxLicenseno.getSyPremium().divide(divisor, 5, RoundingMode.HALF_UP);// 商业 保费  /1.06
                     BigDecimal jqOtherAmount = jqNoTaxPremium.multiply(item.getJqOtherCostsProportion().divide(new BigDecimal(100)));  //交强跟单费用
                     BigDecimal syOtherAmount = syNoTaxPremium.multiply(item.getSyOtherCostsProportion().divide(new BigDecimal(100)));
 
@@ -1946,6 +1951,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                     byBxLicenseno.setSyOtherCostsProportion(syOtherCostsProportion);
                     byBxLicenseno.setOtherFeevalue(this.calculateTotal(jqOtherAmount,syOtherAmount,null));
                     byBxLicenseno.setOtherFeerate(this.calculateTotal(jqOtherCostsProportion,syOtherCostsProportion ,null));
+                    byBxLicenseno.setAllFeeValue(this.calculateTotal(jqOtherAmount,syOtherAmount,null));
                     baseMapper.updateById(byBxLicenseno);
 
 
@@ -1954,7 +1960,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                     map.put("policyno",item.getPolicyno());
                     map.put("syPolicyno",item.getSyPolicyno());
                     map.put("jqOtherCostsPremium",jqOtherAmount);
-                    map.put("syOtherCostsProportion",syOtherAmount);
+                    map.put("syOtherCostsPremium",syOtherAmount);
 
                     map.put("otherFeevalue",byBxLicenseno.getOtherFeevalue());
                     map.put("otherFeerate",byBxLicenseno.getOtherFeerate());
@@ -1990,6 +1996,8 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                 }
 
                 params.put("handlingFeesStatus","0");
+                params.put("isNotCar","1");
+                params.put("isOther","1");
                 InsPlyIncome byBxLicenseno = baseMapper.findByBxLicenseno(params);
                 if(byBxLicenseno.getNoOtherCostsProportion().compareTo(item.getNoOtherCostsProportion()) !=0 ){
                     // 如果比例不相等
@@ -2035,4 +2043,22 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         }
     }
 
+    /**
+     *   通过任务id  去查询关联表
+     * @param insPlyIncomeVo
+     * @return
+     */
+    @Override
+    public HttpResult<Object> reconciliation(InsPlyIncomeVo insPlyIncomeVo) {
+        String taskId = insPlyIncomeVo.getTaskId();
+        List<String> incomeIdList = incomeTaskRelationshipService.getByTaskId(taskId);
+        for (String  incomeId :incomeIdList){
+            InsPlyIncome insPlyIncome = baseMapper.getById(incomeId);
+            insPlyIncome.setSettleOtherStatus("1");
+            insPlyIncome.setSettlementImageId(insPlyIncomeVo.getSettlementImageId());
+            baseMapper.updateById(insPlyIncome);
+        }
+        return HttpResult.ok();
+    }
+
 }

+ 2 - 2
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -1162,8 +1162,8 @@
         ) d ON d.partnerCompaniesId = a.partner_companies_id
         LEFT JOIN ( SELECT a.partner_companies_id AS "partnerCompaniesId",sum(
         settlement_amount ) AS "settleMentAmount",
-        SUM(a.expend_amount) as  "expendAmount",
-        IFNULL(sum(settlement_amount ) ,0) -IFNULL(SUM(a.expend_amount),0) as  "taxesFees",
+        sum(a.settlement_amount * (1 -a.tax_points/100) ) as 'expendAmount',
+        sum(a.settlement_amount * (a.tax_points/100) ) as 'taxesFees',
         SUM(a.tax_points) as  "taxPoints"
         FROM settlement_documentary_fees a
         WHERE a.settlement_status = '2'