|
|
@@ -28,6 +28,7 @@ import com.ydtech.modules.protocols.entity.vo.*;
|
|
|
import com.ydtech.modules.protocols.service.*;
|
|
|
import com.ydtech.utils.idgen.IdGenerate;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import org.apache.commons.collections4.trie.analyzer.StringKeyAnalyzer;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -73,6 +74,9 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
@Autowired
|
|
|
InsFeeOrderNewService insFeeOrderNewService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ PtlAgreementProductCostsTrajectoryService ptlAgreementProductCostsTrajectoryService;
|
|
|
+
|
|
|
@Override
|
|
|
public Page<PtlAgreementProductCostsNew> getByAgreementId(Page page, AgreementProductQueryVo agreementProductQueryVo) {
|
|
|
LambdaQueryWrapper<PtlAgreementProductCostsNew> ptlAgreementProductCostsNewLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
@@ -94,6 +98,22 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
.or().lt(PtlAgreementProductCostsNew::getCostsEndDate, agreementProductQueryVo.getCostsEndDate());
|
|
|
}
|
|
|
|
|
|
+ //是否有效 1失效 2 有效
|
|
|
+ if(agreementProductQueryVo.getIsEffective() != null){
|
|
|
+ if(agreementProductQueryVo.getIsEffective().equals("1")) {
|
|
|
+ ptlAgreementProductCostsNewLambdaQueryWrapper.gt(PtlAgreementProductCostsNew::getCostsStartDate, LocalDateTime.now())
|
|
|
+ .lt(PtlAgreementProductCostsNew::getCostsEndDate, LocalDateTime.now());
|
|
|
+ }else if(agreementProductQueryVo.getIsEffective().equals("2")){
|
|
|
+ ptlAgreementProductCostsNewLambdaQueryWrapper.lt(PtlAgreementProductCostsNew::getCostsStartDate, LocalDateTime.now())
|
|
|
+ .gt(PtlAgreementProductCostsNew::getCostsEndDate, LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //统配描述
|
|
|
+ if(agreementProductQueryVo.getDesc() != null){
|
|
|
+ ptlAgreementProductCostsNewLambdaQueryWrapper.like(PtlAgreementProductCostsNew::getDesc, agreementProductQueryVo.getDesc());
|
|
|
+ }
|
|
|
+
|
|
|
Page<PtlAgreementProductCostsNew> pages = baseMapper.selectPage(page, ptlAgreementProductCostsNewLambdaQueryWrapper);
|
|
|
|
|
|
// .lt(PtlAgreementProductCostsNew::getCostsStartDate, formattedDateTime)
|
|
|
@@ -130,13 +150,13 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
records.get(i).setJqExportRadioLevel3(ptlAgreementProductCostsExport.getJqExportRadioLevel3().toString());
|
|
|
records.get(i).setJqExportRadioLevel4(ptlAgreementProductCostsExport.getJqExportRadioLevel4().toString());
|
|
|
records.get(i).setJqExportRadioLevel5(ptlAgreementProductCostsExport.getJqExportRadioLevel5().toString());
|
|
|
- records.get(i).setJqExportInvestmentRadio(ptlAgreementProductCostsExport.getJqExportInvestmentRadio().toString());
|
|
|
+// records.get(i).setJqExportInvestmentRadio(ptlAgreementProductCostsExport.getJqExportInvestmentRadio().toString());
|
|
|
records.get(i).setSyExportRadioLevel1(ptlAgreementProductCostsExport.getSyExportRadioLevel1().toString());
|
|
|
records.get(i).setSyExportRadioLevel2(ptlAgreementProductCostsExport.getSyExportRadioLevel2().toString());
|
|
|
records.get(i).setSyExportRadioLevel3(ptlAgreementProductCostsExport.getSyExportRadioLevel3().toString());
|
|
|
records.get(i).setSyExportRadioLevel4(ptlAgreementProductCostsExport.getSyExportRadioLevel4().toString());
|
|
|
records.get(i).setSyExportRadioLevel5(ptlAgreementProductCostsExport.getSyExportRadioLevel5().toString());
|
|
|
- records.get(i).setSyExportInvestmentRadio(ptlAgreementProductCostsExport.getSyExportInvestmentRadio().toString());
|
|
|
+// records.get(i).setSyExportInvestmentRadio(ptlAgreementProductCostsExport.getSyExportInvestmentRadio().toString());
|
|
|
records.get(i).setNoCarExportRadioLevel1(ptlAgreementProductCostsExport.getNoCarExportRadioLevel1().toString());
|
|
|
records.get(i).setNoCarExportRadioLevel2(ptlAgreementProductCostsExport.getNoCarExportRadioLevel2().toString());
|
|
|
records.get(i).setNoCarExportRadioLevel3(ptlAgreementProductCostsExport.getNoCarExportRadioLevel3().toString());
|
|
|
@@ -207,13 +227,13 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
records.get(i).setJqExportRadioLevel3(ptlAgreementProductCostsExport.getJqExportRadioLevel3().toString());
|
|
|
records.get(i).setJqExportRadioLevel4(ptlAgreementProductCostsExport.getJqExportRadioLevel4().toString());
|
|
|
records.get(i).setJqExportRadioLevel5(ptlAgreementProductCostsExport.getJqExportRadioLevel5().toString());
|
|
|
- records.get(i).setJqExportInvestmentRadio(ptlAgreementProductCostsExport.getJqExportInvestmentRadio().toString());
|
|
|
+// records.get(i).setJqExportInvestmentRadio(ptlAgreementProductCostsExport.getJqExportInvestmentRadio().toString());
|
|
|
records.get(i).setSyExportRadioLevel1(ptlAgreementProductCostsExport.getSyExportRadioLevel1().toString());
|
|
|
records.get(i).setSyExportRadioLevel2(ptlAgreementProductCostsExport.getSyExportRadioLevel2().toString());
|
|
|
records.get(i).setSyExportRadioLevel3(ptlAgreementProductCostsExport.getSyExportRadioLevel3().toString());
|
|
|
records.get(i).setSyExportRadioLevel4(ptlAgreementProductCostsExport.getSyExportRadioLevel4().toString());
|
|
|
records.get(i).setSyExportRadioLevel5(ptlAgreementProductCostsExport.getSyExportRadioLevel5().toString());
|
|
|
- records.get(i).setSyExportInvestmentRadio(ptlAgreementProductCostsExport.getSyExportInvestmentRadio().toString());
|
|
|
+// records.get(i).setSyExportInvestmentRadio(ptlAgreementProductCostsExport.getSyExportInvestmentRadio().toString());
|
|
|
records.get(i).setNoCarExportRadioLevel1(ptlAgreementProductCostsExport.getNoCarExportRadioLevel1().toString());
|
|
|
records.get(i).setNoCarExportRadioLevel2(ptlAgreementProductCostsExport.getNoCarExportRadioLevel2().toString());
|
|
|
records.get(i).setNoCarExportRadioLevel3(ptlAgreementProductCostsExport.getNoCarExportRadioLevel3().toString());
|
|
|
@@ -417,16 +437,17 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public boolean costsAdd(AgreementProductCosts agreementProductCosts) {
|
|
|
+//2024-04-26 删除检测非车信息 强制填写费用
|
|
|
//校验非车信息是否存在
|
|
|
- List<PtlAgreementProductCostsAttrLink> nonMotorInsurance = agreementProductCosts.getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("NonMotorInsurance")).collect(Collectors.toList());
|
|
|
- if (nonMotorInsurance.size() > 0) {
|
|
|
- if((nonMotorInsurance.get(0).getMin() != null && !nonMotorInsurance.get(0).getMin().equals("0")) || nonMotorInsurance.get(0).getMax() != null && !nonMotorInsurance.get(0).getMax().equals("0"))
|
|
|
- {
|
|
|
- if((agreementProductCosts.getNoCostsProportion() == null || agreementProductCosts.getNoCostsProportion().equals("0"))){
|
|
|
- throw new SystemException("检测到存在非车费用因子,请填写非车费用!");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// List<PtlAgreementProductCostsAttrLink> nonMotorInsurance = agreementProductCosts.getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("NonMotorInsurance")).collect(Collectors.toList());
|
|
|
+// if (nonMotorInsurance.size() > 0) {
|
|
|
+// if((nonMotorInsurance.get(0).getMin() != null && !nonMotorInsurance.get(0).getMin().equals("0")) || nonMotorInsurance.get(0).getMax() != null && !nonMotorInsurance.get(0).getMax().equals("0"))
|
|
|
+// {
|
|
|
+// if((agreementProductCosts.getNoCostsProportion() == null || agreementProductCosts.getNoCostsProportion().equals("0"))){
|
|
|
+// throw new SystemException("检测到存在非车费用因子,请填写非车费用!");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
//添加费用主表信息
|
|
|
PtlAgreementProductCostsNew ptlAgreementProductCostsNew = new PtlAgreementProductCostsNew();
|
|
|
@@ -494,25 +515,28 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
costsAttrLinkHistories.add(costsAttrLinkHistory);
|
|
|
} else {
|
|
|
if (ptlAgreementUndwrtRulesAttr.getAttrType().equals("radio") || (!"0".equals(x.getMin()) && null != x.getMin()) || (!"0".equals(x.getMax()) && null != x.getMax())) {
|
|
|
+ if(x.getMin() != null || x.getMax() != null) {
|
|
|
+ x.setCostsId(ptlAgreementProductCostsNew.getId());
|
|
|
+ x.setId(0);
|
|
|
+ costsAttrLink.add(x);
|
|
|
+ BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
|
+ //设置产品费用因子历史记录
|
|
|
+ costsAttrLinkHistory.setId(null);
|
|
|
+ costsAttrLinkHistory.setBatch(uuid);
|
|
|
|
|
|
- x.setCostsId(ptlAgreementProductCostsNew.getId());
|
|
|
- x.setId(0);
|
|
|
- costsAttrLink.add(x);
|
|
|
- BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
|
- //设置产品费用因子历史记录
|
|
|
- costsAttrLinkHistory.setId(null);
|
|
|
- costsAttrLinkHistory.setBatch(uuid);
|
|
|
-
|
|
|
- costsAttrLinkHistory.setOperatorType("add");
|
|
|
- costsAttrLinkHistory.setModifier(BaseController.getUser().getId());
|
|
|
- costsAttrLinkHistory.setOperatorTime(LocalDateTime.now());
|
|
|
- costsAttrLinkHistories.add(costsAttrLinkHistory);
|
|
|
+ costsAttrLinkHistory.setOperatorType("add");
|
|
|
+ costsAttrLinkHistory.setModifier(BaseController.getUser().getId());
|
|
|
+ costsAttrLinkHistory.setOperatorTime(LocalDateTime.now());
|
|
|
+ costsAttrLinkHistories.add(costsAttrLinkHistory);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
//保存产品费用因子历史记录
|
|
|
ptlAgreementProductCostsAttrLinkHistoryService.saveBatch(costsAttrLinkHistories);
|
|
|
ptlAgreementProductCostsAttrLinkService.saveBatch(costsAttrLink);
|
|
|
+ //添加费用因子轨迹
|
|
|
+ ptlAgreementProductCostsTrajectoryService.addCostsTrajectory(ptlAgreementProductCostsNew.getId(),"新增费用因子",BaseController.getUser().getId());
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
@@ -520,16 +544,17 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public boolean costsUpdate(AgreementProductCosts agreementProductCosts) {
|
|
|
+//2024-04-26 删除检测非车信息 强制填写费用
|
|
|
//校验非车信息是否存在
|
|
|
- List<PtlAgreementProductCostsAttrLink> nonMotorInsurance = agreementProductCosts.getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("NonMotorInsurance")).collect(Collectors.toList());
|
|
|
- if (nonMotorInsurance.size() > 0) {
|
|
|
- if((nonMotorInsurance.get(0).getMin() != null && !nonMotorInsurance.get(0).getMin().equals("0")) || nonMotorInsurance.get(0).getMax() != null && !nonMotorInsurance.get(0).getMax().equals("0"))
|
|
|
- {
|
|
|
- if((agreementProductCosts.getNoCostsProportion() == null || agreementProductCosts.getNoCostsProportion().equals("0"))){
|
|
|
- throw new SystemException("检测到存在非车费用因子,请填写非车费用!");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// List<PtlAgreementProductCostsAttrLink> nonMotorInsurance = agreementProductCosts.getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("NonMotorInsurance")).collect(Collectors.toList());
|
|
|
+// if (nonMotorInsurance.size() > 0) {
|
|
|
+// if((nonMotorInsurance.get(0).getMin() != null && !nonMotorInsurance.get(0).getMin().equals("0")) || nonMotorInsurance.get(0).getMax() != null && !nonMotorInsurance.get(0).getMax().equals("0"))
|
|
|
+// {
|
|
|
+// if((agreementProductCosts.getNoCostsProportion() == null || agreementProductCosts.getNoCostsProportion().equals("0"))){
|
|
|
+// throw new SystemException("检测到存在非车费用因子,请填写非车费用!");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
//更新费用主表信息
|
|
|
PtlAgreementProductCostsNew ptlAgreementProductCostsNew = new PtlAgreementProductCostsNew();
|
|
|
@@ -653,6 +678,8 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
//保存产品费用因子历史记录
|
|
|
ptlAgreementProductCostsAttrLinkHistoryService.saveBatch(costsAttrLinkHistories);
|
|
|
ptlAgreementProductCostsAttrLinkService.saveBatch(costsAttrLink);
|
|
|
+ //添加费用因子轨迹
|
|
|
+ ptlAgreementProductCostsTrajectoryService.addCostsTrajectory(ptlAgreementProductCostsNew.getId(),"修改费用因子",BaseController.getUser().getId());
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -706,7 +733,8 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
//删除产品费用及费用因子
|
|
|
baseMapper.deleteById(costsId);
|
|
|
ptlAgreementProductCostsAttrLinkService.remove(new LambdaQueryWrapper<PtlAgreementProductCostsAttrLink>().eq(PtlAgreementProductCostsAttrLink::getCostsId, costsId));
|
|
|
-
|
|
|
+ //添加费用因子轨迹
|
|
|
+ ptlAgreementProductCostsTrajectoryService.addCostsTrajectory(ptlAgreementProductCostsNew.getId(),"删除费用因子",BaseController.getUser().getId());
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -787,9 +815,41 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
ptlAgreementProductCostsNew.setIsAudit(costsAuditVo.getIsAudit());
|
|
|
ptlAgreementProductCostsNew.setAuditPerson(BaseController.getUser().getId());
|
|
|
ptlAgreementProductCostsNew.setAuditTime(LocalDateTime.now());
|
|
|
+ String desc = "";
|
|
|
+ if(costsAuditVo.getIsAudit() == 1) {
|
|
|
+ desc = "审核通过";
|
|
|
+ }else if(costsAuditVo.getIsAudit() == 2){
|
|
|
+ desc = "审核驳回";
|
|
|
+ }
|
|
|
+ //添加费用因子轨迹
|
|
|
+ ptlAgreementProductCostsTrajectoryService.addCostsTrajectory(ptlAgreementProductCostsNew.getId(),desc,BaseController.getUser().getId());
|
|
|
return baseMapper.updateById(ptlAgreementProductCostsNew) > 0 ? true : false;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public boolean costsAuditBatch(CostsAuditVo costsAuditVo){
|
|
|
+ for (String costsId : costsAuditVo.getCostsIds()){
|
|
|
+ PtlAgreementProductCostsNew ptlAgreementProductCostsNew = this.getById(costsId);
|
|
|
+ if(ptlAgreementProductCostsNew == null){
|
|
|
+ throw new SystemException("费用不存在");
|
|
|
+ }
|
|
|
+ ptlAgreementProductCostsNew.setIsAudit(costsAuditVo.getIsAudit());
|
|
|
+ ptlAgreementProductCostsNew.setAuditPerson(BaseController.getUser().getId());
|
|
|
+ ptlAgreementProductCostsNew.setAuditTime(LocalDateTime.now());
|
|
|
+ String desc = "";
|
|
|
+ if(costsAuditVo.getIsAudit() == 1) {
|
|
|
+ desc = "审核通过";
|
|
|
+ }else if(costsAuditVo.getIsAudit() == 2){
|
|
|
+ desc = "审核驳回";
|
|
|
+ }
|
|
|
+ //添加费用因子轨迹
|
|
|
+ ptlAgreementProductCostsTrajectoryService.addCostsTrajectory(ptlAgreementProductCostsNew.getId(),desc,BaseController.getUser().getId());
|
|
|
+ baseMapper.updateById(ptlAgreementProductCostsNew);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
@Autowired
|
|
|
PtlAgreementService ptlAgreementService;
|
|
|
|
|
|
@@ -1165,13 +1225,13 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
records.get(i).setJqExportRadioLevel3(ptlAgreementProductCostsExport.getJqExportRadioLevel3().toString());
|
|
|
records.get(i).setJqExportRadioLevel4(ptlAgreementProductCostsExport.getJqExportRadioLevel4().toString());
|
|
|
records.get(i).setJqExportRadioLevel5(ptlAgreementProductCostsExport.getJqExportRadioLevel5().toString());
|
|
|
- records.get(i).setJqExportInvestmentRadio(ptlAgreementProductCostsExport.getJqExportInvestmentRadio().toString());
|
|
|
+// records.get(i).setJqExportInvestmentRadio(ptlAgreementProductCostsExport.getJqExportInvestmentRadio().toString());
|
|
|
records.get(i).setSyExportRadioLevel1(ptlAgreementProductCostsExport.getSyExportRadioLevel1().toString());
|
|
|
records.get(i).setSyExportRadioLevel2(ptlAgreementProductCostsExport.getSyExportRadioLevel2().toString());
|
|
|
records.get(i).setSyExportRadioLevel3(ptlAgreementProductCostsExport.getSyExportRadioLevel3().toString());
|
|
|
records.get(i).setSyExportRadioLevel4(ptlAgreementProductCostsExport.getSyExportRadioLevel4().toString());
|
|
|
records.get(i).setSyExportRadioLevel5(ptlAgreementProductCostsExport.getSyExportRadioLevel5().toString());
|
|
|
- records.get(i).setSyExportInvestmentRadio(ptlAgreementProductCostsExport.getSyExportInvestmentRadio().toString());
|
|
|
+// records.get(i).setSyExportInvestmentRadio(ptlAgreementProductCostsExport.getSyExportInvestmentRadio().toString());
|
|
|
records.get(i).setNoCarExportRadioLevel1(ptlAgreementProductCostsExport.getNoCarExportRadioLevel1().toString());
|
|
|
records.get(i).setNoCarExportRadioLevel2(ptlAgreementProductCostsExport.getNoCarExportRadioLevel2().toString());
|
|
|
records.get(i).setNoCarExportRadioLevel3(ptlAgreementProductCostsExport.getNoCarExportRadioLevel3().toString());
|