|
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.jzg.commons.constants.Constants;
|
|
import com.jzg.commons.constants.Constants;
|
|
|
|
|
+import com.jzg.commons.constants.ProductsType;
|
|
|
import com.jzg.commons.constants.ReturnInformation;
|
|
import com.jzg.commons.constants.ReturnInformation;
|
|
|
import com.jzg.commons.core.base.BaseController;
|
|
import com.jzg.commons.core.base.BaseController;
|
|
|
import com.jzg.commons.core.base.StateResult;
|
|
import com.jzg.commons.core.base.StateResult;
|
|
@@ -408,10 +409,30 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
ptlAgreementCost.setProductId(costCopyParam.getProductId());
|
|
ptlAgreementCost.setProductId(costCopyParam.getProductId());
|
|
|
ptlAgreementCost.setProductName(costCopyParam.getProductName());
|
|
ptlAgreementCost.setProductName(costCopyParam.getProductName());
|
|
|
|
|
|
|
|
- ptlAgreementCostTypes.forEach(item->{
|
|
|
|
|
- item.setId(IdGenerate.nextId());
|
|
|
|
|
- item.setPtlAgreementCostId(costId);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
|
|
+ List<PtlAgreementCostType> newPtlAgreementCostTypes = ptlAgreementCostTypes.stream()
|
|
|
|
|
+ .filter(item -> {
|
|
|
|
|
+ String productId = costCopyParam.getProductId();
|
|
|
|
|
+ // 单交剔除 CostType = 商业险
|
|
|
|
|
+ if ("0330".equals(productId)) {
|
|
|
|
|
+ return !"商业险".equals(item.getCostType());
|
|
|
|
|
+ }
|
|
|
|
|
+ // 单商剔除 CostType = 交强险
|
|
|
|
|
+ if ("034001".equals(productId)) {
|
|
|
|
|
+ return !"交强险".equals(item.getCostType());
|
|
|
|
|
+ }
|
|
|
|
|
+ // 单三剔除 CostType = 交强险
|
|
|
|
|
+ if ("034002".equals(productId)) {
|
|
|
|
|
+ return !"交强险".equals(item.getCostType());
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ })
|
|
|
|
|
+ .peek(item -> {
|
|
|
|
|
+ // 给留存的元素赋值字段
|
|
|
|
|
+ item.setId(IdGenerate.nextId());
|
|
|
|
|
+ item.setPtlAgreementCostId(costId);
|
|
|
|
|
+ })
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
|
|
|
ptlAgreementCostRules.forEach(item->{
|
|
ptlAgreementCostRules.forEach(item->{
|
|
|
item.setId(IdGenerate.nextId());
|
|
item.setId(IdGenerate.nextId());
|
|
@@ -419,7 +440,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
ptlAgreementCostMapper.insert(ptlAgreementCost);
|
|
ptlAgreementCostMapper.insert(ptlAgreementCost);
|
|
|
- ptlAgreementCostTypeMapper.insert(ptlAgreementCostTypes);
|
|
|
|
|
|
|
+ ptlAgreementCostTypeMapper.insert(newPtlAgreementCostTypes);
|
|
|
ptlAgreementCostRuleMapper.insert(ptlAgreementCostRules);
|
|
ptlAgreementCostRuleMapper.insert(ptlAgreementCostRules);
|
|
|
|
|
|
|
|
});
|
|
});
|