|
@@ -1,6 +1,7 @@
|
|
|
package com.ydtech.modules.admin.service.impl;
|
|
package com.ydtech.modules.admin.service.impl;
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
@@ -257,52 +258,68 @@ public class SysChannelCostServiceImpl extends ServiceImpl<SysChannelCostMapper,
|
|
|
heads.forEach(head -> {
|
|
heads.forEach(head -> {
|
|
|
LambdaQueryWrapper<SysChannelCost> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<SysChannelCost> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.eq(SysChannelCost::getStatus,1)
|
|
wrapper.eq(SysChannelCost::getStatus,1)
|
|
|
|
|
+ .eq(SysChannelCost::getSettleStatus,0)
|
|
|
.eq(!StringUtils.isBlank(head.getUserId()),SysChannelCost::getUserId,head.getUserId())
|
|
.eq(!StringUtils.isBlank(head.getUserId()),SysChannelCost::getUserId,head.getUserId())
|
|
|
- .eq(!StringUtils.isBlank(head.getUserName()),SysChannelCost::getUserName,head.getUserName())
|
|
|
|
|
- .eq(!StringUtils.isBlank(head.getLicenseNo()),SysChannelCost::getLicenseNo,head.getLicenseNo());
|
|
|
|
|
|
|
+ .eq(!StringUtils.isBlank(head.getUserName()),SysChannelCost::getUserName,head.getUserName());
|
|
|
List<SysChannelCost> costList = list(wrapper);
|
|
List<SysChannelCost> costList = list(wrapper);
|
|
|
- costList.stream()
|
|
|
|
|
- .filter(cost ->
|
|
|
|
|
- !cost.getJqPolicyNo().equals(head.getJqPolicyNo()))
|
|
|
|
|
- .filter(cost ->
|
|
|
|
|
- !cost.getSyPolicyNo().equals(head.getSyPolicyNo()))
|
|
|
|
|
- .filter(cost ->
|
|
|
|
|
- !cost.getNoPolicyNo().equals(head.getNoPolicyNo()))
|
|
|
|
|
- .filter(cost ->
|
|
|
|
|
- !cost.getJqPremium().equals(head.getJqPremium()))
|
|
|
|
|
- .filter(cost ->
|
|
|
|
|
- !cost.getSyPremium().equals(head.getSyPremium()))
|
|
|
|
|
- .filter(cost ->
|
|
|
|
|
- !cost.getJyPremium().equals(head.getJyPremium()))
|
|
|
|
|
- .filter(cost ->
|
|
|
|
|
- !cost.getTaxAmount().equals(head.getTaxAmount()))
|
|
|
|
|
- .filter(cost ->
|
|
|
|
|
- !cost.getJqCostsProportion().equals(head.getJqCostsProportion()))
|
|
|
|
|
- .filter(cost ->
|
|
|
|
|
- !cost.getSyCostsProportion().equals(head.getSyCostsProportion()))
|
|
|
|
|
- .filter(cost ->
|
|
|
|
|
- !cost.getNoCostsProportion().equals(head.getNoCostsProportion()))
|
|
|
|
|
- .filter(cost ->
|
|
|
|
|
- !cost.getTotalPremium().equals(head.getTotalPremium()))
|
|
|
|
|
- .forEach(cost ->{
|
|
|
|
|
- // 查询子订单
|
|
|
|
|
- List<String> orderNos = costList.stream().map(SysChannelCost::getOrderNo).collect(Collectors.toList());
|
|
|
|
|
- LambdaQueryWrapper<InsAreaCompany> orderWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
- orderWrapper.select(InsAreaCompany::getId,InsAreaCompany::getSigningTime,InsAreaCompany::getPayDate)
|
|
|
|
|
- .eq(InsAreaCompany::getId, cost.getOrderNo());
|
|
|
|
|
- InsAreaCompany insAreaCompany = insAreaCompanyService.getOne(orderWrapper);
|
|
|
|
|
- LambdaUpdateWrapper<SysChannelCost> costWrapper = new LambdaUpdateWrapper<>();
|
|
|
|
|
- costWrapper.eq(SysChannelCost::getId,cost.getId())
|
|
|
|
|
- .set(SysChannelCost::getSettleStatus,1)
|
|
|
|
|
- .set(SysChannelCost::getVoucherNumber,voucherNumber)
|
|
|
|
|
- .set(SysChannelCost::getSigningTime,insAreaCompany.getSigningTime())
|
|
|
|
|
- .set(SysChannelCost::getPayDate,insAreaCompany.getPayDate())
|
|
|
|
|
- .set(SysChannelCost::getUpdateBy,BaseController.getUser().getName())
|
|
|
|
|
- .set(SysChannelCost::getUpdateTime,LocalDateTime.now());
|
|
|
|
|
- this.baseMapper.update(cost, costWrapper);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if (CollUtil.isNotEmpty(costList)) {
|
|
|
|
|
+ for (SysChannelCost sysChannelCost : costList) {
|
|
|
|
|
+ sysChannelCost.setJqPolicyNo(StrUtil.nullToEmpty(sysChannelCost.getJqPolicyNo()));
|
|
|
|
|
+ sysChannelCost.setSyPolicyNo(StrUtil.nullToEmpty(sysChannelCost.getSyPolicyNo()));
|
|
|
|
|
+ sysChannelCost.setNoPolicyNo(StrUtil.nullToEmpty(sysChannelCost.getNoPolicyNo()));
|
|
|
|
|
+ sysChannelCost.setJqPremium(Objects.isNull(sysChannelCost.getJqPremium()) ? new BigDecimal(0) : sysChannelCost.getJqPremium());
|
|
|
|
|
+ sysChannelCost.setSyPremium(Objects.isNull(sysChannelCost.getSyPremium()) ? new BigDecimal(0) : sysChannelCost.getSyPremium());
|
|
|
|
|
+ sysChannelCost.setJyPremium(Objects.isNull(sysChannelCost.getJyPremium()) ? new BigDecimal(0) : sysChannelCost.getJyPremium());
|
|
|
|
|
+ sysChannelCost.setTaxAmount(Objects.isNull(sysChannelCost.getTaxAmount()) ? new BigDecimal(0) : sysChannelCost.getTaxAmount());
|
|
|
|
|
+ sysChannelCost.setJqCostsProportion(StringUtils.isBlank(sysChannelCost.getJqCostsProportion()) ? "0" : sysChannelCost.getJqCostsProportion());
|
|
|
|
|
+ sysChannelCost.setSyCostsProportion(StringUtils.isBlank(sysChannelCost.getSyCostsProportion()) ? "0" : sysChannelCost.getSyCostsProportion());
|
|
|
|
|
+ sysChannelCost.setNoCostsProportion(StringUtils.isBlank(sysChannelCost.getNoCostsProportion()) ? "0" : sysChannelCost.getNoCostsProportion());
|
|
|
|
|
+ sysChannelCost.setTotalPremium(Objects.isNull(sysChannelCost.getTotalPremium()) ? new BigDecimal(0) : sysChannelCost.getTotalPremium());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (!sysChannelCost.getJqPolicyNo().equals(StrUtil.nullToEmpty(head.getJqPolicyNo()))
|
|
|
|
|
+ || !sysChannelCost.getSyPolicyNo().equals(StrUtil.nullToEmpty(head.getSyPolicyNo()))
|
|
|
|
|
+ || !sysChannelCost.getNoPolicyNo().equals(StrUtil.nullToEmpty(head.getNoPolicyNo()))
|
|
|
|
|
+ || sysChannelCost.getJqPremium().compareTo(head.getJqPremium()) != 0
|
|
|
|
|
+ || sysChannelCost.getSyPremium().compareTo(head.getSyPremium()) != 0
|
|
|
|
|
+ || sysChannelCost.getJyPremium().compareTo(head.getJyPremium()) != 0
|
|
|
|
|
+ || sysChannelCost.getTaxAmount().compareTo(head.getTaxAmount()) != 0
|
|
|
|
|
+ || sysChannelCost.getTotalPremium().compareTo(head.getTotalPremium()) != 0
|
|
|
|
|
+ || !sysChannelCost.getJqCostsProportion().equals(head.getJqCostsProportion())
|
|
|
|
|
+ || !sysChannelCost.getSyCostsProportion().equals(head.getSyCostsProportion())
|
|
|
|
|
+ || !sysChannelCost.getNoCostsProportion().equals(head.getNoCostsProportion())
|
|
|
|
|
+ || !sysChannelCost.getLicenseNo().equals(head.getLicenseNo())
|
|
|
|
|
+ ){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 查询子订单
|
|
|
|
|
+ List<String> orderNos = costList.stream().map(SysChannelCost::getOrderNo).collect(Collectors.toList());
|
|
|
|
|
+ LambdaQueryWrapper<InsAreaCompany> orderWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ orderWrapper.select(InsAreaCompany::getId,InsAreaCompany::getSigningTime,InsAreaCompany::getPayDate)
|
|
|
|
|
+ .eq(InsAreaCompany::getId, sysChannelCost.getOrderNo());
|
|
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getOne(orderWrapper);
|
|
|
|
|
+ LambdaUpdateWrapper<SysChannelCost> costWrapper = new LambdaUpdateWrapper<>();
|
|
|
|
|
+ costWrapper.eq(SysChannelCost::getId,sysChannelCost.getId())
|
|
|
|
|
+ .set(SysChannelCost::getSettleStatus,1)
|
|
|
|
|
+ .set(SysChannelCost::getVoucherNumber,voucherNumber)
|
|
|
|
|
+ .set(!Objects.isNull(insAreaCompany.getSigningTime()),SysChannelCost::getSigningTime,insAreaCompany.getSigningTime())
|
|
|
|
|
+ .set(!Objects.isNull(insAreaCompany.getPayDate()),SysChannelCost::getPayDate,insAreaCompany.getPayDate())
|
|
|
|
|
+ .set(SysChannelCost::getUpdateBy,BaseController.getUser().getName())
|
|
|
|
|
+ .set(SysChannelCost::getUpdateTime,LocalDateTime.now());
|
|
|
|
|
+ this.baseMapper.update(sysChannelCost, costWrapper);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
|
+ BigDecimal a = new BigDecimal("10");
|
|
|
|
|
+ BigDecimal b = new BigDecimal("10.00");
|
|
|
|
|
+ if(a.compareTo(b) == -1){
|
|
|
|
|
+ System.out.println(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|