|
@@ -28,9 +28,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
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.ArrayList;
|
|
|
|
|
-import java.util.Arrays;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
|
public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSourceDto> implements ITaxSourceService {
|
|
public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSourceDto> implements ITaxSourceService {
|
|
@@ -67,7 +66,7 @@ public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSource
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- QueryWrapper queryWrapper = new QueryWrapper();
|
|
|
|
|
|
|
+ QueryWrapper<PtlAgreement> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.in("id", agreementIds);
|
|
queryWrapper.in("id", agreementIds);
|
|
|
List<PtlAgreement> list = ptlAgreementService.list(queryWrapper);
|
|
List<PtlAgreement> list = ptlAgreementService.list(queryWrapper);
|
|
|
return list;
|
|
return list;
|
|
@@ -92,6 +91,7 @@ public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSource
|
|
|
dto.setAgreementId(agreementTax.getAgreementId());
|
|
dto.setAgreementId(agreementTax.getAgreementId());
|
|
|
dto.setIsTaxSource(agreementTax.getIsTaxSource());
|
|
dto.setIsTaxSource(agreementTax.getIsTaxSource());
|
|
|
dto.setLicense(agreementTax.getLicense());
|
|
dto.setLicense(agreementTax.getLicense());
|
|
|
|
|
+ dto.setInsuranceRepertoire(taxSourceVo.getInsuranceRepertoire());
|
|
|
dtos.add(dto);
|
|
dtos.add(dto);
|
|
|
});
|
|
});
|
|
|
//组装排除的部门信息
|
|
//组装排除的部门信息
|
|
@@ -320,17 +320,18 @@ public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSource
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public String getAgreementId(String deptId, String userId, String companyId, String license, String volume) {
|
|
|
|
|
|
|
+ public String getAgreementId(String deptId, String userId, String companyId, String license, String volume, String productid) {
|
|
|
// 车牌前两位
|
|
// 车牌前两位
|
|
|
String firstTwoPlates = license.substring(0, 2);
|
|
String firstTwoPlates = license.substring(0, 2);
|
|
|
String resultId = "";
|
|
String resultId = "";
|
|
|
|
|
|
|
|
//查找配置的默认项
|
|
//查找配置的默认项
|
|
|
- TaxSourceDto taxSourceDefaultDto = baseMapper.selectOne(new LambdaQueryWrapper<TaxSourceDto>()
|
|
|
|
|
- .eq(TaxSourceDto::getInsCompanyId, companyId)
|
|
|
|
|
- .eq(TaxSourceDto::getLicense, firstTwoPlates));
|
|
|
|
|
- if (taxSourceDefaultDto != null) {
|
|
|
|
|
- resultId = taxSourceDefaultDto.getAgreementId();
|
|
|
|
|
|
|
+ List<TaxSourceDto> taxSourceDtoList = baseMapper.selectList(new LambdaQueryWrapper<TaxSourceDto>()
|
|
|
|
|
+ .eq(TaxSourceDto::getInsCompanyId, companyId));
|
|
|
|
|
+
|
|
|
|
|
+ List<TaxSourceDto> taxSource = taxSourceDtoList.stream().filter(x -> x.getLicense().equals(firstTwoPlates)).collect(Collectors.toList());
|
|
|
|
|
+ if (!taxSource.isEmpty()) {
|
|
|
|
|
+ resultId = taxSourceDtoList.get(0).getAgreementId();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
boolean isExclude = false;
|
|
boolean isExclude = false;
|
|
@@ -363,6 +364,14 @@ public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSource
|
|
|
if (taxSourceDtos != null) {
|
|
if (taxSourceDtos != null) {
|
|
|
resultId = taxSourceDtos.getAgreementId();
|
|
resultId = taxSourceDtos.getAgreementId();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 不包含险种 随机其他保险公司
|
|
|
|
|
+ if(taxSourceDtos != null && !taxSourceDtos.getInsuranceRepertoire().contains(productid)){
|
|
|
|
|
+ List<TaxSourceDto> collect = taxSourceDtoList.stream().filter(x -> !x.getAgreementId().equals(taxSourceDtos.getAgreementId())).collect(Collectors.toList());
|
|
|
|
|
+ Collections.shuffle(collect);
|
|
|
|
|
+ resultId = collect.get(0).getAgreementId();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return resultId;
|
|
return resultId;
|