|
@@ -23,6 +23,7 @@ import com.jzg.commons.entity.po.EsmInsCompany;
|
|
|
import com.jzg.commons.entity.po.InsFeeOrders;
|
|
import com.jzg.commons.entity.po.InsFeeOrders;
|
|
|
import com.jzg.commons.entity.po.PtlAgreement;
|
|
import com.jzg.commons.entity.po.PtlAgreement;
|
|
|
import com.jzg.commons.entity.po.SysUploadFiles;
|
|
import com.jzg.commons.entity.po.SysUploadFiles;
|
|
|
|
|
+import com.jzg.commons.exception.ServiceException;
|
|
|
import com.jzg.commons.exception.SystemException;
|
|
import com.jzg.commons.exception.SystemException;
|
|
|
import com.jzg.commons.util.AssertionUtils;
|
|
import com.jzg.commons.util.AssertionUtils;
|
|
|
import com.jzg.commons.util.EasyExcelUtils;
|
|
import com.jzg.commons.util.EasyExcelUtils;
|
|
@@ -1397,68 +1398,89 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
return importExcelResultVo;
|
|
return importExcelResultVo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 私有协议批量修改
|
|
|
|
|
+ * 修改手续费比例(商业险手续费比例, 交强险手续费比例)
|
|
|
|
|
+ * 签单时间
|
|
|
|
|
+ * 对接人(对接人姓名,手机号)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @author lipf
|
|
|
|
|
+ * @date 2026/5/27 20:25
|
|
|
|
|
+ */
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public boolean batchModify(BatchModifyVo batchModifyVo) {
|
|
public boolean batchModify(BatchModifyVo batchModifyVo) {
|
|
|
- List<InsPlyIncome> updateInsPlyIncome = new ArrayList<>();
|
|
|
|
|
|
|
+ log.info("批量修改应收订单: batchModifyVo=[{}]", JSONUtil.toJsonStr(batchModifyVo));
|
|
|
|
|
|
|
|
|
|
+ List<String> incomeIds = batchModifyVo.getIncomeIds();
|
|
|
|
|
+ if(CollUtil.isEmpty(incomeIds)) {
|
|
|
|
|
+ throw new ServiceException("请勾选要批量修改的应收订单");
|
|
|
|
|
+ }
|
|
|
|
|
+ List<InsPlyIncome> updateInsPlyIncome = new ArrayList<>();
|
|
|
for (String incomeId : batchModifyVo.getIncomeIds()) {
|
|
for (String incomeId : batchModifyVo.getIncomeIds()) {
|
|
|
- InsPlyIncome insPlyIncome = baseMapper.selectById(incomeId);
|
|
|
|
|
- if (Objects.nonNull(insPlyIncome)) {
|
|
|
|
|
- if (Objects.nonNull(batchModifyVo.getJqSuperviseCostsProportion()) && batchModifyVo.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
- BigDecimal superviseReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJqPremium()), batchModifyVo.getJqSuperviseCostsProportion());
|
|
|
|
|
- insPlyIncome.setJqSuperviseCostsPremiums(superviseReceivablePremium.toString());
|
|
|
|
|
- }
|
|
|
|
|
- if (Objects.nonNull(batchModifyVo.getSySuperviseCostsProportion()) && batchModifyVo.getSySuperviseCostsProportion().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
|
- BigDecimal otherReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getSyPremium()), batchModifyVo.getSySuperviseCostsProportion());
|
|
|
|
|
- insPlyIncome.setSySuperviseCostsPremiums(otherReceivablePremium.toString());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (Objects.nonNull(batchModifyVo.getJqOtherCostsProportion()) && batchModifyVo.getJqOtherCostsProportion().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
- BigDecimal otherReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJqPremium()), batchModifyVo.getJqOtherCostsProportion());
|
|
|
|
|
- insPlyIncome.setJqOtherCostsPremiums(otherReceivablePremium.toString());
|
|
|
|
|
- }
|
|
|
|
|
- if (Objects.nonNull(batchModifyVo.getSyOtherCostsProportion()) && batchModifyVo.getSyOtherCostsProportion().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
|
- BigDecimal otherReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getSyPremium()), batchModifyVo.getSyOtherCostsProportion());
|
|
|
|
|
- insPlyIncome.setSySuperviseCostsPremiums(otherReceivablePremium.toString());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (Objects.nonNull(batchModifyVo.getJySuperviseCostsProportion()) && batchModifyVo.getJySuperviseCostsProportion().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
- BigDecimal jySuperviseReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJyPremium()), batchModifyVo.getJySuperviseCostsProportion());
|
|
|
|
|
- insPlyIncome.setJySuperviseCostsPremiums(jySuperviseReceivablePremium.toString());
|
|
|
|
|
- }
|
|
|
|
|
- if (Objects.nonNull(batchModifyVo.getJySuperviseCostsProportion()) && batchModifyVo.getJySuperviseCostsProportion().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
|
- BigDecimal jyOtherReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJyPremium()), batchModifyVo.getJySuperviseCostsProportion());
|
|
|
|
|
- insPlyIncome.setJyOtherCostsPremiums(jyOtherReceivablePremium.toString());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ InsPlyIncome insPlyIncomeSource = baseMapper.selectById(incomeId);
|
|
|
|
|
+ if(insPlyIncomeSource == null) {
|
|
|
|
|
+ log.info("批量修改应收订单。序号为[{}]的应收订单不存在", incomeId);
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ InsPlyIncome insPlyIncome = new InsPlyIncome();
|
|
|
|
|
+ insPlyIncome.setId(insPlyIncomeSource.getId());
|
|
|
|
|
+ if (Objects.nonNull(batchModifyVo.getJqSuperviseCostsProportion()) && batchModifyVo.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
+ BigDecimal superviseReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJqPremium()), batchModifyVo.getJqSuperviseCostsProportion());
|
|
|
|
|
+ insPlyIncome.setJqSuperviseCostsProportion(Objects.toString(batchModifyVo.getJqSuperviseCostsProportion()));
|
|
|
|
|
+ insPlyIncome.setJqSuperviseCostsPremiums(superviseReceivablePremium.toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Objects.nonNull(batchModifyVo.getSySuperviseCostsProportion()) && batchModifyVo.getSySuperviseCostsProportion().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
+ BigDecimal otherReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getSyPremium()), batchModifyVo.getSySuperviseCostsProportion());
|
|
|
|
|
+ insPlyIncome.setSySuperviseCostsProportion(Objects.toString(batchModifyVo.getSySuperviseCostsProportion()));
|
|
|
|
|
+ insPlyIncome.setSySuperviseCostsPremiums(otherReceivablePremium.toString());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-// if (batchModifyVo.getSigningTime() != null){
|
|
|
|
|
-// insPlyIncome.setSigningTime(batchModifyVo.getSigningTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
|
|
|
|
+// if (Objects.nonNull(batchModifyVo.getJqOtherCostsProportion()) && batchModifyVo.getJqOtherCostsProportion().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
+// BigDecimal otherReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJqPremium()), batchModifyVo.getJqOtherCostsProportion());
|
|
|
|
|
+// insPlyIncome.setJqOtherCostsPremiums(otherReceivablePremium.toString());
|
|
|
|
|
+// }
|
|
|
|
|
+// if (Objects.nonNull(batchModifyVo.getSyOtherCostsProportion()) && batchModifyVo.getSyOtherCostsProportion().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
|
+// BigDecimal otherReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getSyPremium()), batchModifyVo.getSyOtherCostsProportion());
|
|
|
|
|
+// insPlyIncome.setSySuperviseCostsPremiums(otherReceivablePremium.toString());
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// if (Objects.nonNull(batchModifyVo.getJySuperviseCostsProportion()) && batchModifyVo.getJySuperviseCostsProportion().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
+// BigDecimal jySuperviseReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJyPremium()), batchModifyVo.getJySuperviseCostsProportion());
|
|
|
|
|
+// insPlyIncome.setJySuperviseCostsPremiums(jySuperviseReceivablePremium.toString());
|
|
|
|
|
+// }
|
|
|
|
|
+// if (Objects.nonNull(batchModifyVo.getJySuperviseCostsProportion()) && batchModifyVo.getJySuperviseCostsProportion().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
|
+// BigDecimal jyOtherReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJyPremium()), batchModifyVo.getJySuperviseCostsProportion());
|
|
|
|
|
+// insPlyIncome.setJyOtherCostsPremiums(jyOtherReceivablePremium.toString());
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- updateInsPlyIncome.add(insPlyIncome);
|
|
|
|
|
|
|
+ if (batchModifyVo.getSigningTime() != null){
|
|
|
|
|
+ insPlyIncome.setSigningTime(batchModifyVo.getSigningTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
}
|
|
}
|
|
|
- baseMapper.updateById(updateInsPlyIncome);
|
|
|
|
|
- return true;
|
|
|
|
|
|
|
+ updateInsPlyIncome.add(insPlyIncome);
|
|
|
}
|
|
}
|
|
|
|
|
+ baseMapper.updateById(updateInsPlyIncome);
|
|
|
|
|
+ return true;
|
|
|
|
|
|
|
|
// 批量修改
|
|
// 批量修改
|
|
|
- baseMapper.update(new InsPlyIncome(), new LambdaUpdateWrapper<InsPlyIncome>()
|
|
|
|
|
- .set(InsPlyIncome::getJqSuperviseCostsProportion, batchModifyVo.getJqSuperviseCostsProportion())
|
|
|
|
|
- .set(InsPlyIncome::getSySuperviseCostsProportion, batchModifyVo.getSySuperviseCostsProportion())
|
|
|
|
|
- .set(InsPlyIncome::getJySuperviseCostsProportion, batchModifyVo.getJySuperviseCostsProportion())
|
|
|
|
|
- .set(InsPlyIncome::getJqOtherCostsProportion, batchModifyVo.getJqOtherCostsProportion())
|
|
|
|
|
- .set(InsPlyIncome::getSyOtherCostsProportion, batchModifyVo.getSyOtherCostsProportion())
|
|
|
|
|
- .set(InsPlyIncome::getJyOtherCostsProportion, batchModifyVo.getJyOtherCostsProportion())
|
|
|
|
|
-// .set(InsPlyIncome::getSigningTime, batchModifyVo.getSigningTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))
|
|
|
|
|
- .in(InsPlyIncome::getId, batchModifyVo.getIncomeIds()));
|
|
|
|
|
|
|
+// baseMapper.update(new InsPlyIncome(), new LambdaUpdateWrapper<InsPlyIncome>()
|
|
|
|
|
+// .set(InsPlyIncome::getJqSuperviseCostsProportion, batchModifyVo.getJqSuperviseCostsProportion())
|
|
|
|
|
+// .set(InsPlyIncome::getSySuperviseCostsProportion, batchModifyVo.getSySuperviseCostsProportion())
|
|
|
|
|
+// .set(InsPlyIncome::getJySuperviseCostsProportion, batchModifyVo.getJySuperviseCostsProportion())
|
|
|
|
|
+// .set(InsPlyIncome::getJqOtherCostsProportion, batchModifyVo.getJqOtherCostsProportion())
|
|
|
|
|
+// .set(InsPlyIncome::getSyOtherCostsProportion, batchModifyVo.getSyOtherCostsProportion())
|
|
|
|
|
+// .set(InsPlyIncome::getJyOtherCostsProportion, batchModifyVo.getJyOtherCostsProportion())
|
|
|
|
|
+//// .set(InsPlyIncome::getSigningTime, batchModifyVo.getSigningTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))
|
|
|
|
|
+// .in(InsPlyIncome::getId, batchModifyVo.getIncomeIds()));
|
|
|
|
|
|
|
|
- return false;
|
|
|
|
|
|
|
+// return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public BigDecimal calcReceivableAmount(BigDecimal premium, BigDecimal ratio) {
|
|
public BigDecimal calcReceivableAmount(BigDecimal premium, BigDecimal ratio) {
|
|
|
|
|
+ if(premium==null||ratio==null) {
|
|
|
|
|
+ return BigDecimal.ZERO;
|
|
|
|
|
+ }
|
|
|
return premium.multiply(ratio);
|
|
return premium.multiply(ratio);
|
|
|
}
|
|
}
|
|
|
|
|
|