|
|
@@ -1048,6 +1048,45 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public boolean costsDateBatch(AgreementProductCostsVo agreementProductCostsVo) {
|
|
|
+ // 更新每个费用项目的起止期
|
|
|
+ for (String id : agreementProductCostsVo.getIds()) {
|
|
|
+ PtlAgreementProductCostsNew ptlAgreementProductCostsNew = this.getById(id);
|
|
|
+ if (ptlAgreementProductCostsNew == null) {
|
|
|
+ throw new SystemException("费用不存在");
|
|
|
+ }
|
|
|
+ if (agreementProductCostsVo.getCostsEndDate() != null) {
|
|
|
+ ptlAgreementProductCostsNew.setCostsEndDate(agreementProductCostsVo.getCostsEndDate());
|
|
|
+ }
|
|
|
+ if (agreementProductCostsVo.getCostsStartDate() != null) {
|
|
|
+ ptlAgreementProductCostsNew.setCostsStartDate(agreementProductCostsVo.getCostsStartDate());
|
|
|
+ }
|
|
|
+ String desc = "修改费用因子";
|
|
|
+ //添加费用因子轨迹
|
|
|
+ ptlAgreementProductCostsTrajectoryService.addCostsTrajectory(ptlAgreementProductCostsNew.getId(), desc, BaseController.getUser().getId());
|
|
|
+ //保存产品费用历史记录
|
|
|
+ PtlAgreementProductCostsNewHistory ptlAgreementProductCostsNewHistory = new PtlAgreementProductCostsNewHistory();
|
|
|
+ //添加费用ID
|
|
|
+ ptlAgreementProductCostsNewHistory.setId(IdGenerate.nextId());
|
|
|
+ ptlAgreementProductCostsNewHistory.setCostsId(ptlAgreementProductCostsNew.getId());
|
|
|
+ //生成批次ID
|
|
|
+ String uuid = IdGenerate.nextId();
|
|
|
+ ptlAgreementProductCostsNewHistory.setBatch(uuid);
|
|
|
+ ptlAgreementProductCostsNewHistory.setAgreementId(ptlAgreementProductCostsNew.getAgreementId());
|
|
|
+ ptlAgreementProductCostsNewHistory.setProductId(ptlAgreementProductCostsNew.getProductId());
|
|
|
+ ptlAgreementProductCostsNewHistory.setProductName(ptlAgreementProductCostsNew.getProductName());
|
|
|
+ ptlAgreementProductCostsNewHistory.setOperatorType("update");
|
|
|
+ ptlAgreementProductCostsNewHistory.setModifier(BaseController.getUser().getId());
|
|
|
+ ptlAgreementProductCostsNewHistory.setOperatorTime(LocalDateTime.now());
|
|
|
+ ptlAgreementProductCostsNewHistoryService.save(ptlAgreementProductCostsNewHistory);
|
|
|
+ baseMapper.updateById(ptlAgreementProductCostsNew);
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public boolean costsBatch(AgreementProductCostsVo agreementProductCostsVo) {
|
|
|
@@ -1096,12 +1135,6 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
}
|
|
|
|
|
|
private void updateCostsItem(AgreementProductCostsVo vo, PtlAgreementProductCostsNew item) {
|
|
|
- if (vo.getCostsEndDate() != null) {
|
|
|
- item.setCostsEndDate(vo.getCostsEndDate());
|
|
|
- }
|
|
|
- if (vo.getCostsStartDate() != null) {
|
|
|
- item.setCostsStartDate(vo.getCostsStartDate());
|
|
|
- }
|
|
|
updateProportion(item, vo.getJqCostsProportion(), item::getJqCostsProportion, item::setJqCostsProportion, "交强险总费用");
|
|
|
updateProportion(item, vo.getSyCostsProportion(), item::getSyCostsProportion, item::setSyCostsProportion, "商业险总费用");
|
|
|
updateProportion(item, vo.getNoCostsProportion(), item::getNoCostsProportion, item::setNoCostsProportion, "非车险总费用");
|