|
|
@@ -2700,6 +2700,137 @@ handlingProportion,
|
|
|
return resultMap;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public HashMap<String, Object> ptImportOther(MultipartFile multipartFile) {
|
|
|
+ HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
+ List<HashMap<String, Object>> resultList = new ArrayList<>();
|
|
|
+ HashMap<String, Object> params = new HashMap<>();
|
|
|
+ BigDecimal allAmount = BigDecimal.ZERO;
|
|
|
+ try {
|
|
|
+ List<InsPtHandExcelDto> dtoList = ExcelEasypoiUtils.importExcel(multipartFile, InsPtHandExcelDto.class, 0, 1, 1);
|
|
|
+ for (InsPtHandExcelDto item : dtoList) {
|
|
|
+ if (StringUtils.isNotEmpty(item.getLicenseno())) {
|
|
|
+ params.put("licenseno", item.getLicenseno());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(item.getPolicyno())) {
|
|
|
+ params.put("policyno", item.getPolicyno());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(item.getSyPolicyno())) {
|
|
|
+ params.put("syPolicyno", item.getSyPolicyno());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(item.getNoPolicyno())) {
|
|
|
+ params.put("noPolicyno", item.getNoPolicyno());
|
|
|
+ }
|
|
|
+ params.put("handlingFeesStatus", "0");
|
|
|
+// isOther
|
|
|
+ params.put("isOther", "0");
|
|
|
+ params.put("isNotCar", "0");
|
|
|
+ InsPlyIncome byBxLicenseno = baseMapper.findByBxLicenseno(params);
|
|
|
+ if (item.getNoOtherCostsProportion() == null) {
|
|
|
+ item.setNoOtherCostsProportion(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ if (item.getJqOtherCostsProportion() == null) {
|
|
|
+ item.setJqOtherCostsProportion(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ if (item.getSyOtherCostsProportion() == null) {
|
|
|
+ item.setSyOtherCostsProportion(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ if (item.getJqSuperviseCostsProportion() == null) {
|
|
|
+ item.setJqSuperviseCostsProportion(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ if (item.getSySuperviseCostsProportion() == null) {
|
|
|
+ item.setSySuperviseCostsProportion(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ if (item.getNoSuperviseCostsProportion() == null) {
|
|
|
+ item.setNoSuperviseCostsProportion(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ObjectUtils.isNotEmpty(byBxLicenseno) && (byBxLicenseno.getJqOtherCostsProportion().compareTo(item.getJqOtherCostsProportion()) != 0 || byBxLicenseno.getSyOtherCostsProportion().compareTo(item.getSyOtherCostsProportion()) != 0)) {
|
|
|
+ InsPlyIncomeLog insPlyIncomeLog = new InsPlyIncomeLog();
|
|
|
+ BeanUtils.copyProperties(byBxLicenseno,insPlyIncomeLog);
|
|
|
+ insPlyIncomeLog.setOperationStatus("2");
|
|
|
+ insPlyIncomeLog.setId(null);
|
|
|
+ insPlyIncomeLog.setIncomeId(byBxLicenseno.getId());
|
|
|
+ insPlyIncomeLogService.saveLog(insPlyIncomeLog); //添加日志
|
|
|
+ // 如果比例不相等
|
|
|
+ BigDecimal jqOtherCostsProportion = item.getJqOtherCostsProportion();
|
|
|
+ BigDecimal syOtherCostsProportion = item.getSyOtherCostsProportion();
|
|
|
+ BigDecimal noOtherCostsProportion = item.getNoOtherCostsProportion();
|
|
|
+
|
|
|
+ BigDecimal jqSuperviseCostsProportion = item.getJqSuperviseCostsProportion();
|
|
|
+ BigDecimal sySuperviseCostsProportion = item.getSySuperviseCostsProportion();
|
|
|
+ BigDecimal noSuperviseCostsProportion = item.getNoSuperviseCostsProportion();
|
|
|
+
|
|
|
+ BigDecimal jqOtherAmount = algorithmAmount( byBxLicenseno.getJqPremium(),jqOtherCostsProportion);
|
|
|
+ BigDecimal syOtherAmount = algorithmAmount( byBxLicenseno.getSyPremium(),syOtherCostsProportion);
|
|
|
+ BigDecimal noOtherAmount = algorithmAmount( byBxLicenseno.getNoPremium(),noOtherCostsProportion);
|
|
|
+
|
|
|
+ BigDecimal jqSuperviseCostsAmount = algorithmAmount( byBxLicenseno.getJqPremium(),jqSuperviseCostsProportion);
|
|
|
+ BigDecimal sySuperviseCostsAmount = algorithmAmount( byBxLicenseno.getSyPremium(),sySuperviseCostsProportion);
|
|
|
+ BigDecimal noSuperviseCostsAmount = algorithmAmount( byBxLicenseno.getNoPremium(),noSuperviseCostsProportion);
|
|
|
+
|
|
|
+ byBxLicenseno.setJqOtherCostsPremium(jqOtherAmount);
|
|
|
+ byBxLicenseno.setSyOtherCostsPremium(syOtherAmount);
|
|
|
+ byBxLicenseno.setNoOtherCostsPremium(noOtherAmount);
|
|
|
+
|
|
|
+ byBxLicenseno.setJqSuperviseCostsPremiums(jqSuperviseCostsAmount);
|
|
|
+ byBxLicenseno.setSySuperviseCostsPremiums(sySuperviseCostsAmount);
|
|
|
+ byBxLicenseno.setNoSuperviseCostsPremiums(noSuperviseCostsAmount);
|
|
|
+
|
|
|
+ byBxLicenseno.setJqOtherCostsProportion(jqOtherCostsProportion);
|
|
|
+ byBxLicenseno.setSyOtherCostsProportion(syOtherCostsProportion);
|
|
|
+ byBxLicenseno.setNoOtherCostsProportion(noOtherCostsProportion);
|
|
|
+
|
|
|
+ byBxLicenseno.setJqSuperviseCostsProportion(jqSuperviseCostsProportion);
|
|
|
+ byBxLicenseno.setSySuperviseCostsProportion(sySuperviseCostsProportion);
|
|
|
+ byBxLicenseno.setNoSuperviseCostsProportion(noSuperviseCostsProportion);
|
|
|
+
|
|
|
+ byBxLicenseno.setOtherFeevalue(this.calculateTotal(jqOtherAmount, syOtherAmount, noOtherAmount));
|
|
|
+ byBxLicenseno.setOtherFeerate(this.calculateTotal(jqOtherCostsProportion, syOtherCostsProportion, noOtherCostsProportion));
|
|
|
+
|
|
|
+ byBxLicenseno.setCommissionFeevalue(this.calculateTotal(jqSuperviseCostsAmount, sySuperviseCostsAmount, noSuperviseCostsAmount));
|
|
|
+ byBxLicenseno.setCommissionFeerate(this.calculateTotal(jqSuperviseCostsProportion,sySuperviseCostsProportion,noSuperviseCostsProportion));
|
|
|
+
|
|
|
+ byBxLicenseno.setAllFeeValue(this.calculateTotal(byBxLicenseno.getOtherFeevalue(),byBxLicenseno.getCommissionFeevalue(),null));
|
|
|
+
|
|
|
+ byBxLicenseno.setJqReceivableProportion(this.calculateTotal(jqSuperviseCostsProportion,jqOtherCostsProportion,null));
|
|
|
+ byBxLicenseno.setSyReceivableProportion(this.calculateTotal(sySuperviseCostsProportion,syOtherCostsProportion,null));
|
|
|
+ byBxLicenseno.setNoReceivableProportion(this.calculateTotal(noSuperviseCostsProportion,noOtherCostsProportion,null));
|
|
|
+ byBxLicenseno.setUpdateUserId(BaseController.getUser().getId());
|
|
|
+ byBxLicenseno.setUpdateUserName(BaseController.getUser().getName());
|
|
|
+ baseMapper.updateById(byBxLicenseno);
|
|
|
+ HashMap<String, Object> map = new HashMap<>();
|
|
|
+ map.put("licenseno", item.getLicenseno());
|
|
|
+ map.put("policyno", item.getPolicyno());
|
|
|
+ map.put("syPolicyno", item.getSyPolicyno());
|
|
|
+ map.put("noPolicyno", item.getNoPolicyno());
|
|
|
+ map.put("jqOtherCostsPremium", jqOtherAmount);
|
|
|
+ map.put("syOtherCostsPremium", syOtherAmount);
|
|
|
+ map.put("noOtherCostsPremium", noOtherAmount);
|
|
|
+ map.put("jqSuperviseCostsPremiums", jqSuperviseCostsAmount);
|
|
|
+ map.put("sySuperviseCostsPremiums", sySuperviseCostsAmount);
|
|
|
+ map.put("noSuperviseCostsPremiums", noSuperviseCostsAmount);
|
|
|
+ map.put("jqOtherCostsProportion", jqOtherCostsProportion);
|
|
|
+ map.put("syOtherCostsProportion", syOtherCostsProportion);
|
|
|
+ map.put("noOtherCostsProportion", noOtherCostsProportion);
|
|
|
+ map.put("jqSuperviseCostsProportion", jqSuperviseCostsProportion);
|
|
|
+ map.put("sySuperviseCostsProportion", sySuperviseCostsProportion);
|
|
|
+ map.put("noSuperviseCostsProportion", noSuperviseCostsProportion);
|
|
|
+ map.put("otherFeevalue", byBxLicenseno.getOtherFeevalue());
|
|
|
+ map.put("otherFeerate", byBxLicenseno.getOtherFeerate());
|
|
|
+ resultList.add(map);
|
|
|
+ allAmount = allAmount.add(jqOtherAmount).add(syOtherAmount).add(noOtherAmount);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resultMap.put("allAmount", allAmount);
|
|
|
+ resultMap.put("resultList", resultList);
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public HashMap<String, Object> noBxImportOther(MultipartFile multipartFile, String isNotCar) {
|
|
|
@@ -2921,7 +3052,7 @@ handlingProportion,
|
|
|
* @return 返回私有 平台 应收 已收 未收
|
|
|
*/
|
|
|
@Override
|
|
|
- public HttpResult<HashMap<String, Object>> totalReceivables(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
+ public HttpResult<ArrayList<Map<String,Object>>> totalReceivables(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
ArrayList<Map<String,Object>> resultList = new ArrayList<>();
|
|
|
BigDecimal bxhandAmount = BigDecimal.ZERO; //保险手续费应收
|
|
|
BigDecimal receivedAmount = BigDecimal.ZERO; //保险手续费应收
|
|
|
@@ -2947,13 +3078,16 @@ handlingProportion,
|
|
|
for (SettlementDocumentaryFeesEntity invoicInsPlyIncome : invoicInsPlyIncomes) {
|
|
|
receivedAmount =receivedAmount.add(invoicInsPlyIncome.getSettlementAmount());
|
|
|
}
|
|
|
+ if(receivedAmount.compareTo(BigDecimal.ZERO)== 0){
|
|
|
+ receivedAmount=bxhandAmount;
|
|
|
+ }
|
|
|
BigDecimal subtract = bxhandAmount.subtract(receivedAmount);
|
|
|
privateParams.clear();
|
|
|
privateParams.put("commissionFeevalue",bxhandAmount);
|
|
|
privateParams.put("noInvoicCommissionFeevalue",receivedAmount);
|
|
|
privateParams.put("readyCommissionFeevalue",subtract);
|
|
|
resultList.add(privateParams);
|
|
|
- return HttpResult.ok();
|
|
|
+ return HttpResult.ok(resultList);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -2986,11 +3120,15 @@ handlingProportion,
|
|
|
ptMap.put(month, commissionFeevalue);
|
|
|
}
|
|
|
for (HashMap<String, Object> ptResultListItem : ptResultList) {
|
|
|
- BigDecimal bigDecimal1 = ptMap.get(ptResultListItem.get("year"));
|
|
|
+ BigDecimal bigDecimal1 = ptMap.get(ptResultListItem.get("month"));
|
|
|
ptResultListItem.put("readyCommissionFeevalue", bigDecimal1);
|
|
|
- BigDecimal commissionFeevalue = BigDecimal.valueOf(Long.valueOf(ptResultListItem.get("commissionFeevalue").toString()));
|
|
|
- BigDecimal subtract = commissionFeevalue.subtract(bigDecimal1);
|
|
|
- ptResultListItem.put("noInvoicCommissionFeevalue", subtract);
|
|
|
+ BigDecimal commissionFeevalue = new BigDecimal(ptResultListItem.get("commissionFeevalue").toString());
|
|
|
+ if (bigDecimal1 !=null && bigDecimal1.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ BigDecimal subtract = commissionFeevalue.subtract(bigDecimal1);
|
|
|
+ ptResultListItem.put("noInvoicCommissionFeevalue", subtract);
|
|
|
+ } else {
|
|
|
+ ptResultListItem.put("noInvoicCommissionFeevalue", ptResultListItem.get("commissionFeevalue"));
|
|
|
+ }
|
|
|
}
|
|
|
return HttpResult.ok(ptResultList);
|
|
|
} else if ("2".equals(insPlyIncomeVo.getAgreementType())) {
|
|
|
@@ -3014,14 +3152,20 @@ handlingProportion,
|
|
|
bxMap.put(month, commissionFeevalue);
|
|
|
}
|
|
|
for (HashMap<String, Object> bxResultListItem : bxResultList) {
|
|
|
- BigDecimal bigDecimal1 = bxMap.get(bxResultListItem.get("year"));
|
|
|
+ BigDecimal bigDecimal1 = bxMap.get(bxResultListItem.get("month"));
|
|
|
bxResultListItem.put("readyCommissionFeevalue", bigDecimal1);
|
|
|
- BigDecimal commissionFeevalue = BigDecimal.valueOf(Long.valueOf(bxResultListItem.get("commissionFeevalue").toString()));
|
|
|
- BigDecimal subtract = commissionFeevalue.subtract(bigDecimal1);
|
|
|
- bxResultListItem.put("noInvoicCommissionFeevalue", subtract);
|
|
|
+ BigDecimal commissionFeevalue = new BigDecimal(bxResultListItem.get("commissionFeevalue").toString());
|
|
|
+ if (bigDecimal1 !=null && bigDecimal1.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ BigDecimal subtract = commissionFeevalue.subtract(bigDecimal1);
|
|
|
+ bxResultListItem.put("noInvoicCommissionFeevalue", subtract);
|
|
|
+ } else {
|
|
|
+ bxResultListItem.put("noInvoicCommissionFeevalue", bxResultListItem.get("commissionFeevalue"));
|
|
|
+ }
|
|
|
}
|
|
|
- return HttpResult.ok(bxReadyCommissionFeevalue);
|
|
|
+ return HttpResult.ok(bxResultList);
|
|
|
}
|
|
|
return HttpResult.ok();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|