|
|
@@ -79,10 +79,10 @@ public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSource
|
|
|
@Transactional
|
|
|
public boolean saveTaxSource(TaxSourceVo taxSourceVo) {
|
|
|
//删除排除的信息
|
|
|
- taxSourceExcludeService.remove(new LambdaQueryWrapper<TaxSourceExcludeDto>().eq(TaxSourceExcludeDto::getInsCompanyId,
|
|
|
- taxSourceVo.getInsCompanyId()));
|
|
|
+ taxSourceExcludeService.remove(new LambdaQueryWrapper<TaxSourceExcludeDto>().eq(TaxSourceExcludeDto::getInsCompanyId, taxSourceVo.getInsCompanyId()));
|
|
|
//删除税源配置信息
|
|
|
- baseMapper.delete(new LambdaQueryWrapper<TaxSourceDto>().eq(TaxSourceDto::getInsCompanyId, taxSourceVo.getInsCompanyId()));
|
|
|
+ baseMapper.delete(new LambdaQueryWrapper<TaxSourceDto>().eq(TaxSourceDto::getInsCompanyId,
|
|
|
+ taxSourceVo.getInsCompanyId()));
|
|
|
//组装税源数据
|
|
|
List<TaxSourceDto> dtos = new ArrayList<>();
|
|
|
List<TaxSourceExcludeDto> excludeDtos = new ArrayList<>();
|
|
|
@@ -140,16 +140,15 @@ public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSource
|
|
|
public TaxSourceVo getTaxSource(String companyId) {
|
|
|
TaxSourceVo taxSourceVo = new TaxSourceVo();
|
|
|
//税源信息
|
|
|
- List<TaxSourceDto> taxSourceDto = baseMapper.selectList(new LambdaQueryWrapper<TaxSourceDto>().eq(TaxSourceDto::getInsCompanyId,
|
|
|
- companyId));
|
|
|
+ List<TaxSourceDto> taxSourceDto =
|
|
|
+ baseMapper.selectList(new LambdaQueryWrapper<TaxSourceDto>().eq(TaxSourceDto::getInsCompanyId,
|
|
|
+ companyId));
|
|
|
//排除的部门信息
|
|
|
- List<TaxSourceExcludeDto> taxSourceExcludeDepts = taxSourceExcludeService.list(new LambdaQueryWrapper<TaxSourceExcludeDto>()
|
|
|
- .eq(TaxSourceExcludeDto::getInsCompanyId, companyId)
|
|
|
- .eq(TaxSourceExcludeDto::getType, TaxSourceStatusConstants.EXCLUDE_TYPE_DEPT));
|
|
|
+ List<TaxSourceExcludeDto> taxSourceExcludeDepts =
|
|
|
+ taxSourceExcludeService.list(new LambdaQueryWrapper<TaxSourceExcludeDto>().eq(TaxSourceExcludeDto::getInsCompanyId, companyId).eq(TaxSourceExcludeDto::getType, TaxSourceStatusConstants.EXCLUDE_TYPE_DEPT));
|
|
|
//排除的车牌号信息
|
|
|
- List<TaxSourceExcludeDto> taxSourceExcludeLicense = taxSourceExcludeService.list(new LambdaQueryWrapper<TaxSourceExcludeDto>()
|
|
|
- .eq(TaxSourceExcludeDto::getInsCompanyId, companyId)
|
|
|
- .eq(TaxSourceExcludeDto::getType, TaxSourceStatusConstants.EXCLUDE_TYPE_LICENSE));
|
|
|
+ List<TaxSourceExcludeDto> taxSourceExcludeLicense =
|
|
|
+ taxSourceExcludeService.list(new LambdaQueryWrapper<TaxSourceExcludeDto>().eq(TaxSourceExcludeDto::getInsCompanyId, companyId).eq(TaxSourceExcludeDto::getType, TaxSourceStatusConstants.EXCLUDE_TYPE_LICENSE));
|
|
|
|
|
|
taxSourceVo.setInsCompanyId(companyId);
|
|
|
|
|
|
@@ -207,24 +206,28 @@ public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSource
|
|
|
}
|
|
|
|
|
|
// @Override
|
|
|
-// public List<PtlAgreementInsCompanyDto> getAgreementInsCompany(String deptId, String userId, String license,String volume) {
|
|
|
+// public List<PtlAgreementInsCompanyDto> getAgreementInsCompany(String deptId, String userId, String license,
|
|
|
+// String volume) {
|
|
|
// //查出所有协议
|
|
|
// List<PtlAgreementInsCompanyDto> agreementInsCompany = this.getAgreementInsCompany(deptId, userId);
|
|
|
// if(license != null && volume != null) {
|
|
|
// //排除的部门信息
|
|
|
-// List<TaxSourceExcludeDto> excludeDepts = taxSourceExcludeService.list(new LambdaQueryWrapper<TaxSourceExcludeDto>().eq
|
|
|
+// List<TaxSourceExcludeDto> excludeDepts = taxSourceExcludeService.list(new
|
|
|
+// LambdaQueryWrapper<TaxSourceExcludeDto>().eq
|
|
|
// (TaxSourceExcludeDto::getExcludeInfo, deptId)
|
|
|
// .eq(TaxSourceExcludeDto::getType, TaxSourceStatusConstants.EXCLUDE_TYPE_DEPT));
|
|
|
//
|
|
|
// agreementInsCompany.forEach(item ->
|
|
|
// excludeDepts.stream()
|
|
|
-// .filter(taxSourceDto -> item.getId().equals(taxSourceDto.getInsCompanyId()) && taxSourceDto.getExcludeInfo
|
|
|
+// .filter(taxSourceDto -> item.getId().equals(taxSourceDto.getInsCompanyId()) &&
|
|
|
+// taxSourceDto.getExcludeInfo
|
|
|
// ().equals(deptId))
|
|
|
// .findFirst()
|
|
|
// .ifPresent(taxSourceDto -> item.setIsExclude(TaxSourceStatusConstants.TAX_SOURCE_START))
|
|
|
// );
|
|
|
// //查找排除的车牌号
|
|
|
-// List<TaxSourceExcludeDto> licenseExclude = taxSourceExcludeService.list(new LambdaQueryWrapper<TaxSourceExcludeDto>().eq
|
|
|
+// List<TaxSourceExcludeDto> licenseExclude = taxSourceExcludeService.list(new
|
|
|
+// LambdaQueryWrapper<TaxSourceExcludeDto>().eq
|
|
|
// (TaxSourceExcludeDto::getExcludeInfo, license)
|
|
|
// .eq(TaxSourceExcludeDto::getType, TaxSourceStatusConstants.EXCLUDE_TYPE_LICENSE));
|
|
|
// agreementInsCompany.forEach(item -> {
|
|
|
@@ -292,8 +295,8 @@ public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSource
|
|
|
List<PtlAgreementInsCompanyDto> agreementInsCompany = this.getAgreementInsCompany(deptId, userId);
|
|
|
|
|
|
//查找是否配置税源
|
|
|
- List<TaxSourceDto> taxSourceDtos = baseMapper.selectList(new LambdaQueryWrapper<TaxSourceDto>().eq(TaxSourceDto::getIsTaxSource,
|
|
|
- "1"));
|
|
|
+ List<TaxSourceDto> taxSourceDtos =
|
|
|
+ baseMapper.selectList(new LambdaQueryWrapper<TaxSourceDto>().eq(TaxSourceDto::getIsTaxSource, "1"));
|
|
|
//设置税源参数
|
|
|
agreementInsCompany.forEach(item -> {
|
|
|
if (!TaxSourceStatusConstants.TAX_SOURCE_START.equals(item.getIsExclude())) {
|
|
|
@@ -324,14 +327,16 @@ public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSource
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public String getAgreementId(String deptId, String userId, String companyId, String license, String volume, String productid) {
|
|
|
+ public String getAgreementId(String deptId, String userId, String companyId, String license, String volume,
|
|
|
+ String productid) {
|
|
|
// 车牌前两位
|
|
|
String firstTwoPlates = license.substring(0, 2);
|
|
|
String resultId = "";
|
|
|
|
|
|
//查找配置的默认项
|
|
|
- List<TaxSourceDto> taxSourceDtoList = baseMapper.selectList(new LambdaQueryWrapper<TaxSourceDto>()
|
|
|
- .eq(TaxSourceDto::getInsCompanyId, companyId));
|
|
|
+ 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());
|
|
|
@@ -341,10 +346,8 @@ public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSource
|
|
|
|
|
|
boolean isExclude = false;
|
|
|
//排除的部门信息
|
|
|
- List<TaxSourceExcludeDto> excludeDepts = taxSourceExcludeService.list(new LambdaQueryWrapper<TaxSourceExcludeDto>()
|
|
|
- .eq(TaxSourceExcludeDto::getExcludeInfo, deptId)
|
|
|
- .eq(TaxSourceExcludeDto::getInsCompanyId, companyId)
|
|
|
- .eq(TaxSourceExcludeDto::getType, TaxSourceStatusConstants.EXCLUDE_TYPE_DEPT));
|
|
|
+ List<TaxSourceExcludeDto> excludeDepts =
|
|
|
+ taxSourceExcludeService.list(new LambdaQueryWrapper<TaxSourceExcludeDto>().eq(TaxSourceExcludeDto::getExcludeInfo, deptId).eq(TaxSourceExcludeDto::getInsCompanyId, companyId).eq(TaxSourceExcludeDto::getType, TaxSourceStatusConstants.EXCLUDE_TYPE_DEPT));
|
|
|
|
|
|
//部门排除
|
|
|
if (excludeDepts.stream().anyMatch(taxSourceDto -> taxSourceDto.getExcludeInfo().equals(deptId))) {
|
|
|
@@ -353,9 +356,7 @@ public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSource
|
|
|
|
|
|
//查找排除的车牌号
|
|
|
List<TaxSourceExcludeDto> licenseExclude =
|
|
|
- taxSourceExcludeService.list(new LambdaQueryWrapper<TaxSourceExcludeDto>().eq(TaxSourceExcludeDto::getExcludeInfo,
|
|
|
- firstTwoPlates)
|
|
|
- .eq(TaxSourceExcludeDto::getType, TaxSourceStatusConstants.EXCLUDE_TYPE_LICENSE));
|
|
|
+ taxSourceExcludeService.list(new LambdaQueryWrapper<TaxSourceExcludeDto>().eq(TaxSourceExcludeDto::getExcludeInfo, firstTwoPlates).eq(TaxSourceExcludeDto::getType, TaxSourceStatusConstants.EXCLUDE_TYPE_LICENSE));
|
|
|
|
|
|
//车牌排除
|
|
|
if (licenseExclude.stream().anyMatch(taxSourceDto -> taxSourceDto.getExcludeInfo().equals(firstTwoPlates))) {
|
|
|
@@ -370,7 +371,7 @@ public class TaxSourceServiceImpl extends ServiceImpl<TaxSourceMapper, TaxSource
|
|
|
}
|
|
|
|
|
|
// 不包含险种 随机其他保险公司
|
|
|
- if (taxSourceDtos != null && taxSourceDtos.getInsuranceRepertoire().contains(productid) && Objects.equals(resultId, taxSourceDtos.getAgreementId())) {
|
|
|
+ if (taxSourceDtos != null && Objects.equals(resultId, taxSourceDtos.getAgreementId()) && taxSourceDtos.getInsuranceRepertoire().contains(productid)) {
|
|
|
resultId = taxSourceDtos.getBanishAgreementId();
|
|
|
}
|
|
|
|