|
|
@@ -277,8 +277,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
};
|
|
|
// 签单时间
|
|
|
Predicate<InsPlyIncome> signDatePredicate = insPlyIncome -> {
|
|
|
- String signingTime = insPlyIncome.getSigningTime();
|
|
|
- if(StrUtil.isEmpty(signingTime)){
|
|
|
+ LocalDateTime signingTime = insPlyIncome.getSigningTime();
|
|
|
+ if(signingTime == null){
|
|
|
// 签单时间如果为空,说明是数据问题 先返回去,让业务去处理
|
|
|
return true;
|
|
|
}
|
|
|
@@ -1427,7 +1427,6 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
@Transactional
|
|
|
public boolean batchModify(BatchModifyVo batchModifyVo) {
|
|
|
log.info("批量修改应收订单: batchModifyVo=[{}]", JSONUtil.toJsonStr(batchModifyVo));
|
|
|
-
|
|
|
List<String> incomeIds = batchModifyVo.getIncomeIds();
|
|
|
if(CollUtil.isEmpty(incomeIds)) {
|
|
|
throw new ServiceException("请勾选要批量修改的应收订单");
|
|
|
@@ -1440,48 +1439,42 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
continue;
|
|
|
}
|
|
|
insOrders.add(insPlyIncomeSource.getOrderNo());
|
|
|
- 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());
|
|
|
+ BigDecimal superviseReceivablePremium = calcReceivableAmount(new BigDecimal(Objects.toString(insPlyIncomeSource.getJqPremium(),"0") ), batchModifyVo.getJqSuperviseCostsProportion());
|
|
|
+ baseMapper.update(null, new LambdaUpdateWrapper<InsPlyIncome>()
|
|
|
+ .set(InsPlyIncome::getJqSuperviseCostsProportion, batchModifyVo.getJqSuperviseCostsProportion())
|
|
|
+ .set(InsPlyIncome::getJqSuperviseCostsPremiums, superviseReceivablePremium)
|
|
|
+ .in(InsPlyIncome::getId, batchModifyVo.getIncomeIds()));
|
|
|
}
|
|
|
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());
|
|
|
+ BigDecimal otherReceivablePremium = calcReceivableAmount(new BigDecimal(Objects.toString(insPlyIncomeSource.getSyPremium(),"0")), batchModifyVo.getSySuperviseCostsProportion());
|
|
|
+ baseMapper.update(null, new LambdaUpdateWrapper<InsPlyIncome>()
|
|
|
+ .set(InsPlyIncome::getSySuperviseCostsProportion, batchModifyVo.getSySuperviseCostsProportion())
|
|
|
+ .set(InsPlyIncome::getSySuperviseCostsPremiums, otherReceivablePremium)
|
|
|
+ .in(InsPlyIncome::getId, batchModifyVo.getIncomeIds()));
|
|
|
}
|
|
|
if (batchModifyVo.getSigningTime() != null){
|
|
|
- insPlyIncome.setSigningTime(batchModifyVo.getSigningTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
+ baseMapper.update(null, new LambdaUpdateWrapper<InsPlyIncome>()
|
|
|
+ .set(InsPlyIncome::getSigningTime, batchModifyVo.getSigningTime())
|
|
|
+ .in(InsPlyIncome::getId, batchModifyVo.getIncomeIds()));
|
|
|
|
|
|
}
|
|
|
-
|
|
|
if(StrUtil.isNotEmpty(batchModifyVo.getContractUserName())){
|
|
|
- insPlyIncome.setContactPerson(batchModifyVo.getContractUserName());
|
|
|
+ baseMapper.update(null, new LambdaUpdateWrapper<InsPlyIncome>()
|
|
|
+ .set(InsPlyIncome::getContactPerson, batchModifyVo.getContractUserName())
|
|
|
+ .in(InsPlyIncome::getId, batchModifyVo.getIncomeIds()));
|
|
|
|
|
|
}
|
|
|
if(StrUtil.isNotEmpty(batchModifyVo.getContractPhone())){
|
|
|
- insPlyIncome.setContactPersonPhone(batchModifyVo.getContractPhone());
|
|
|
-
|
|
|
-
|
|
|
+ baseMapper.update(null, new LambdaUpdateWrapper<InsPlyIncome>()
|
|
|
+ .set(InsPlyIncome::getContactPersonPhone, batchModifyVo.getContractPhone())
|
|
|
+ .in(InsPlyIncome::getId, batchModifyVo.getIncomeIds()));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
batchModifyVo.setOrderNos(insOrders);
|
|
|
HttpResult<String> updateOrdersRes = insFeeOrdersClient.updateOrdersBatch(batchModifyVo);
|
|
|
- if(updateOrdersRes.isSuccess()){
|
|
|
- // 批量修改
|
|
|
- baseMapper.update(new InsPlyIncome(), new LambdaUpdateWrapper<InsPlyIncome>()
|
|
|
- .set(InsPlyIncome::getJqSuperviseCostsProportion, batchModifyVo.getJqSuperviseCostsProportion())
|
|
|
- .set(InsPlyIncome::getSySuperviseCostsProportion, batchModifyVo.getSySuperviseCostsProportion())
|
|
|
- .set(InsPlyIncome::getSigningTime, batchModifyVo.getSigningTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))
|
|
|
- .set(InsPlyIncome::getContactPerson, batchModifyVo.getContractUserName())
|
|
|
- .set(InsPlyIncome::getContactPersonPhone, batchModifyVo.getContractPhone())
|
|
|
- .in(InsPlyIncome::getId, batchModifyVo.getIncomeIds()));
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
+ log.info("更新车险订单的结果:updateOrdersRes=[{}]", JSONUtil.toJsonStr(updateOrdersRes));
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
@Override
|