|
@@ -4,14 +4,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ydtech.modules.protocol.dao.PtlAgreementUndwrtRulesMapper;
|
|
import com.ydtech.modules.protocol.dao.PtlAgreementUndwrtRulesMapper;
|
|
|
import com.ydtech.modules.protocol.entity.dto.PtlAgreementUndwrtRulesSaveDto;
|
|
import com.ydtech.modules.protocol.entity.dto.PtlAgreementUndwrtRulesSaveDto;
|
|
|
|
|
+import com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementUndwrtRules;
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementUndwrtRules;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
|
|
|
+import com.ydtech.modules.protocol.service.PtlAgreementProductCostsService;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementUndwrtRulesService;
|
|
import com.ydtech.modules.protocol.service.PtlAgreementUndwrtRulesService;
|
|
|
import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author CXP
|
|
* @author CXP
|
|
@@ -23,9 +26,11 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
|
|
|
implements PtlAgreementUndwrtRulesService {
|
|
implements PtlAgreementUndwrtRulesService {
|
|
|
|
|
|
|
|
private final PtlAgreementAttributionService ptlAgreementAttributionService;
|
|
private final PtlAgreementAttributionService ptlAgreementAttributionService;
|
|
|
|
|
+ private final PtlAgreementProductCostsService ptlAgreementProductCostsService;
|
|
|
|
|
|
|
|
- public PtlAgreementUndwrtRulesServiceImpl(PtlAgreementAttributionService ptlAgreementAttributionService) {
|
|
|
|
|
|
|
+ public PtlAgreementUndwrtRulesServiceImpl(PtlAgreementAttributionService ptlAgreementAttributionService,PtlAgreementProductCostsService ptlAgreementProductCostsService) {
|
|
|
this.ptlAgreementAttributionService = ptlAgreementAttributionService;
|
|
this.ptlAgreementAttributionService = ptlAgreementAttributionService;
|
|
|
|
|
+ this.ptlAgreementProductCostsService = ptlAgreementProductCostsService;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -40,7 +45,28 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
|
|
|
List<PtlAgreementUndwrtRulesSaveDto> undwrtRulesSaveDtoList = PtlAgreementUndwrtRulesSaveDto.toPltAgreementRuleSaveDto(ptlAgreementUndwrtRulesList);
|
|
List<PtlAgreementUndwrtRulesSaveDto> undwrtRulesSaveDtoList = PtlAgreementUndwrtRulesSaveDto.toPltAgreementRuleSaveDto(ptlAgreementUndwrtRulesList);
|
|
|
return undwrtRulesSaveDtoList;
|
|
return undwrtRulesSaveDtoList;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Map<String, List<String>> getByLicenseNo(List<String> agreementIdList) {
|
|
|
|
|
+ Map<String, List<String>> map = new HashMap<>();
|
|
|
|
|
+ if (!agreementIdList.isEmpty()) {
|
|
|
|
|
+ agreementIdList.forEach(x -> {
|
|
|
|
|
+ List<PtlAgreementProductCosts> ptlAgreementProductCosts =ptlAgreementProductCostsService.selectVliadFeeFactor(x);
|
|
|
|
|
+ List<String> licenseNoList = ptlAgreementProductCosts.stream()
|
|
|
|
|
+ .map(PtlAgreementProductCosts::getLicenseNumber).distinct().collect(Collectors.toList());
|
|
|
|
|
+ if(licenseNoList!=null && licenseNoList.size()>0){
|
|
|
|
|
+ //将List合并成String串
|
|
|
|
|
+ String licenseNoStr = licenseNoList.stream().filter(tt->!tt.isEmpty()).map(String::valueOf).collect(Collectors.joining(","));
|
|
|
|
|
+ //转换为List
|
|
|
|
|
+ List<String> licenseNo = Arrays.asList(licenseNoStr.split(","));
|
|
|
|
|
+ //去重
|
|
|
|
|
+ HashSet<String> distinctLicenseSet = new HashSet<>(licenseNo);
|
|
|
|
|
+ List<String> distinctLicenseList = new ArrayList<>(distinctLicenseSet);
|
|
|
|
|
+ map.put(x, distinctLicenseList);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ return map;
|
|
|
|
|
+ }
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public void saveBatchProductCosts(String agreementId, List<PtlAgreementUndwrtRulesSaveDto> undwrtRulesSaveDtoList) {
|
|
public void saveBatchProductCosts(String agreementId, List<PtlAgreementUndwrtRulesSaveDto> undwrtRulesSaveDtoList) {
|