|
|
@@ -3717,6 +3717,177 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ /** 批量修改 手续费金额
|
|
|
+ *
|
|
|
+ * @param multipartFile
|
|
|
+ * @param isNotCar 是否是非车
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public HashMap<String, Object> insuranceHandlingFeeBathUpdate(MultipartFile multipartFile, String isNotCar) {
|
|
|
+ HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
+ List<HashMap<String, Object>> resultList = new ArrayList<>();
|
|
|
+ HashMap<String, Object> params = new HashMap<>();
|
|
|
+ BigDecimal allAmount = BigDecimal.ZERO;
|
|
|
+ params.put("isNotCar", isNotCar);
|
|
|
+ try {
|
|
|
+ List<InsBxPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(multipartFile, InsBxPlyIncomeExcelDto.class, 0, 1, 1);
|
|
|
+ for (InsBxPlyIncomeExcelDto 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());
|
|
|
+ }
|
|
|
+ params.put("handlingFeesStatus", "0");
|
|
|
+ params.put("isOther", "0");
|
|
|
+ params.put("isNotCar", "0");
|
|
|
+ InsPlyIncome byBxLicenseno = baseMapper.findByBxLicenseno(params);
|
|
|
+ if (item.getJqSuperviseCostsProportion() == null) {
|
|
|
+ item.setJqSuperviseCostsProportion(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ if (item.getSySuperviseCostsProportion() == null) {
|
|
|
+ item.setSySuperviseCostsProportion(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotEmpty(byBxLicenseno) && (byBxLicenseno.getJqOtherCostsProportion().compareTo(item.getJqSuperviseCostsProportion()) != 0 || byBxLicenseno.getSySuperviseCostsProportion().compareTo(item.getSySuperviseCostsProportion()) != 0)) {
|
|
|
+ // 如果比例不相等
|
|
|
+ BigDecimal jqSuperviseCostsProportion = item.getJqSuperviseCostsProportion();
|
|
|
+ BigDecimal sySuperviseCostsProportion = item.getSySuperviseCostsProportion();
|
|
|
+ BigDecimal jqSupervisePremium = getBigDecimal( byBxLicenseno.getJqPremium(),jqSuperviseCostsProportion);
|
|
|
+ BigDecimal sySupervisePremium = getBigDecimal( byBxLicenseno.getSyPremium(),sySuperviseCostsProportion);
|
|
|
+ HashMap<String, Object> map = new HashMap<>();
|
|
|
+ map.put("licenseno", item.getLicenseno());
|
|
|
+ map.put("policyno", item.getPolicyno());
|
|
|
+ map.put("syPolicyno", item.getSyPolicyno());
|
|
|
+ map.put("jqSuperviseCostsPremiums", jqSupervisePremium);
|
|
|
+ map.put("sySuperviseCostsPremiums", sySupervisePremium);
|
|
|
+ map.put("jqSuperviseCostsProportion", jqSuperviseCostsProportion);
|
|
|
+ map.put("sySuperviseCostsProportion", sySuperviseCostsProportion);
|
|
|
+ map.put("id", byBxLicenseno.getId());
|
|
|
+ resultList.add(map);
|
|
|
+ allAmount = allAmount.add(jqSupervisePremium).add(sySupervisePremium);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ resultMap.put("allAmount", allAmount);
|
|
|
+ resultMap.put("resultList", resultList);
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保险手续费批量修改
|
|
|
+ * @param insPlyIncomeVo
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public void insuranceHandlingFeeBathConfirm(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
+ if (ObjectUtils.isEmpty(insPlyIncomeVo)) {
|
|
|
+ throw new SystemException("请导入文件");
|
|
|
+ }
|
|
|
+ if(CollectionUtils.isEmpty(insPlyIncomeVo.getResultList())){
|
|
|
+ throw new SystemException("请导入文件");
|
|
|
+ }
|
|
|
+ ArrayList<InsPlyIncome> batchUpdateItem = new ArrayList<>();
|
|
|
+ for (InsPlyIncome item : insPlyIncomeVo.getResultList()) {
|
|
|
+ InsPlyIncomeLog insPlyIncomeLog = new InsPlyIncomeLog();
|
|
|
+ insPlyIncomeLog.setIncomeId(item.getId());
|
|
|
+ BeanUtils.copyProperties(item, insPlyIncomeLog);
|
|
|
+ insPlyIncomeLog.setOperationStatus("2");
|
|
|
+ insPlyIncomeLog.setId(null);
|
|
|
+ insPlyIncomeLogService.saveLog(insPlyIncomeLog); //添加日志
|
|
|
+ item.setAllFeeValue(this.calculateTotal(item.getJqSuperviseCostsPremiums(), item.getSySuperviseCostsPremiums(), null));
|
|
|
+ item.setCommissionFeevalue(this.calculateTotal(item.getJqSuperviseCostsPremiums(), item.getSySuperviseCostsPremiums(), null));
|
|
|
+ item.setCommissionFeerate(this.calculateTotal(item.getJqSuperviseCostsProportion(), item.getSySuperviseCostsProportion(), null));
|
|
|
+ batchUpdateItem.add(item);
|
|
|
+ // baseMapper.updateById(item);
|
|
|
+ }
|
|
|
+ this.saveOrUpdateBatch(batchUpdateItem);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HashMap<String, Object> insuranceHandlingFeeBathNotCarImport(MultipartFile multipartFile, String isNotCar) {
|
|
|
+ HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
+ List<HashMap<String, Object>> resultList = new ArrayList<>();
|
|
|
+ HashMap<String, Object> params = new HashMap<>();
|
|
|
+ BigDecimal allAmount = BigDecimal.ZERO;
|
|
|
+ params.put("isNotCar", isNotCar);
|
|
|
+ try {
|
|
|
+ List<InsBxNoPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(multipartFile, InsBxNoPlyIncomeExcelDto.class, 0, 1, 1);
|
|
|
+ for (InsBxNoPlyIncomeExcelDto item : dtoList) {
|
|
|
+ if (StringUtils.isNotEmpty(item.getLicenseno())) {
|
|
|
+ params.put("licenseno", item.getLicenseno());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(item.getNoPolicyno())) {
|
|
|
+ params.put("noPolicyno", item.getNoPolicyno());
|
|
|
+ }
|
|
|
+ params.put("handlingFeesStatus", "0");
|
|
|
+ params.put("isOther", "0");
|
|
|
+ params.put("isNotCar", "1");
|
|
|
+ InsPlyIncome byBxLicenseno = baseMapper.findByBxLicenseno(params);
|
|
|
+ if (item.getNoSuperviseCostsProportion() == null) {
|
|
|
+ item.setNoSuperviseCostsProportion(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotEmpty(byBxLicenseno) && (byBxLicenseno.getNoSuperviseCostsProportion().compareTo(item.getNoSuperviseCostsProportion()) != 0 )) {
|
|
|
+ // 如果比例不相等
|
|
|
+ BigDecimal noSuperviseCostsProportion = item.getNoSuperviseCostsProportion();
|
|
|
+ BigDecimal noSuperviseCostsPremiums = getBigDecimal(byBxLicenseno.getNoPremium(),noSuperviseCostsProportion);
|
|
|
+ HashMap<String, Object> map = new HashMap<>();
|
|
|
+ map.put("licenseno", item.getLicenseno());
|
|
|
+ map.put("noPolicyno", item.getNoPolicyno());
|
|
|
+ map.put("noSuperviseCostsPremiums", noSuperviseCostsPremiums);
|
|
|
+ map.put("noSuperviseCostsProportion", noSuperviseCostsProportion);
|
|
|
+ map.put("id", byBxLicenseno.getId());
|
|
|
+ resultList.add(map);
|
|
|
+ allAmount = allAmount.add(noSuperviseCostsPremiums);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resultMap.put("allAmount", allAmount);
|
|
|
+ resultMap.put("resultList", resultList);
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保险手续费批量修改
|
|
|
+ * @param insPlyIncomeVo
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public void insuranceHandlingNotCarFeeBathConfirm(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
+ if (ObjectUtils.isEmpty(insPlyIncomeVo)) {
|
|
|
+ throw new SystemException("请导入文件");
|
|
|
+ }
|
|
|
+ if(CollectionUtils.isEmpty(insPlyIncomeVo.getResultList())){
|
|
|
+ throw new SystemException("请导入文件");
|
|
|
+ }
|
|
|
+ ArrayList<InsPlyIncome> batchUpdateItem = new ArrayList<>();
|
|
|
+ for (InsPlyIncome item : insPlyIncomeVo.getResultList()) {
|
|
|
+ InsPlyIncomeLog insPlyIncomeLog = new InsPlyIncomeLog();
|
|
|
+ insPlyIncomeLog.setIncomeId(item.getId());
|
|
|
+ BeanUtils.copyProperties(item, insPlyIncomeLog);
|
|
|
+ insPlyIncomeLog.setOperationStatus("2");
|
|
|
+ insPlyIncomeLog.setId(null);
|
|
|
+ insPlyIncomeLogService.saveLog(insPlyIncomeLog); //添加日志
|
|
|
+ item.setAllFeeValue(this.calculateTotal(item.getNoSuperviseCostsPremiums(), null, null));
|
|
|
+ item.setCommissionFeevalue(this.calculateTotal(item.getNoSuperviseCostsPremiums(), null, null));
|
|
|
+ item.setCommissionFeerate(this.calculateTotal(item.getNoSuperviseCostsProportion(), null, null));
|
|
|
+ batchUpdateItem.add(item);
|
|
|
+ // baseMapper.updateById(item);
|
|
|
+ }
|
|
|
+ this.saveOrUpdateBatch(batchUpdateItem);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public List<InsPlyIncome> checkData(String type,List<AddTypeCXSXFExcel> cxsxfList,List<AddTypeCXGDExcel> cxgdList, List<AddTypeFCSXFExcel> fcsxfList, List<AddTypeFCGDExcel> fcgdList,List<AddTypePTJSExcel> ptjsList) throws SystemException{
|
|
|
List<InsPlyIncome> list =new ArrayList<InsPlyIncome>();
|