|
|
@@ -26,10 +26,7 @@ import com.jzg.commons.util.idgen.IdGenerate;
|
|
|
import com.jzg.organization.mapper.PtlAgreementCostMapper;
|
|
|
import com.jzg.organization.mapper.PtlAgreementCostRuleMapper;
|
|
|
import com.jzg.organization.mapper.PtlAgreementCostTypeMapper;
|
|
|
-import com.jzg.organization.service.PtlAgreementCostRuleService;
|
|
|
-import com.jzg.organization.service.PtlAgreementCostService;
|
|
|
-import com.jzg.organization.service.PtlAgreementCostTypeService;
|
|
|
-import com.jzg.organization.service.PtlAgreementUndwrtRulesAttrService;
|
|
|
+import com.jzg.organization.service.*;
|
|
|
import com.jzg.organization.state.CostState;
|
|
|
import com.jzg.organization.state.listener.CostStateListener;
|
|
|
import io.seata.spring.annotation.GlobalTransactional;
|
|
|
@@ -89,6 +86,9 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
@Autowired
|
|
|
private PtlAgreementCostRuleMapper ptlAgreementCostRuleMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PtlAgreementService ptlAgreementService;
|
|
|
+
|
|
|
/**
|
|
|
* 报价配置/费用管理/新增费用
|
|
|
*
|
|
|
@@ -117,6 +117,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
log.info("新增费用的时候,需要指定关联的协议信息。ptlAgreemenCostAdd=[{}]", JSONUtil.toJsonStr(ptlAgreemenCostAdd));
|
|
|
return HttpResult.error("新增费用的时候,需要指定关联的协议信息");
|
|
|
}
|
|
|
+ PtlAgreement agreement = ptlAgreementService.getById(costAdd.getPtlAgreementId());
|
|
|
ptlAgreementCostAdd.setPtlAgreementId(costAdd.getPtlAgreementId());
|
|
|
ptlAgreementCostAdd.setProductId(costAdd.getProductId());
|
|
|
ptlAgreementCostAdd.setProductName(costAdd.getProductName());
|
|
|
@@ -127,7 +128,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
// throw new SystemException("已存在相同且有效的费用规则,请检查");
|
|
|
// }
|
|
|
PtlAgreementCost ptlAgreementCost = BeanUtil.copyProperties(ptlAgreementCostAdd, PtlAgreementCost.class);
|
|
|
- ptlAgreementCost.setCostRules(buildDescString(ptlAgreementCostAdd.getRuleConditions()));
|
|
|
+ ptlAgreementCost.setCostRules(buildDescString(agreement.getCompanyId(), ptlAgreementCostAdd.getRuleConditions()));
|
|
|
if (baseMapper.insert(ptlAgreementCost) <= 0) {
|
|
|
log.error("插入操作失败");
|
|
|
throw new RuntimeException(ReturnInformation.FAILURE_MESSAGE);
|
|
|
@@ -167,10 +168,11 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ PtlAgreement agreement = ptlAgreementService.getById(ptlAgreementCostEnd.getPtlAgreementId());
|
|
|
PtlAgreementCost ptlAgreementCost = BeanUtil.copyProperties(ptlAgreementCostEnd, PtlAgreementCost.class);
|
|
|
// modify by lipf, 2026年5月22日11:28:34 设置为待审核状态
|
|
|
ptlAgreementCost.setApproved(0);
|
|
|
- ptlAgreementCost.setCostRules(buildDescString(ptlAgreementCostEnd.getRuleConditions()));
|
|
|
+ ptlAgreementCost.setCostRules(buildDescString(agreement.getCompanyId(), ptlAgreementCostEnd.getRuleConditions()));
|
|
|
if (baseMapper.updateById(ptlAgreementCost) <= 0) {
|
|
|
throw new RuntimeException(ReturnInformation.UPDATE_FAILED);
|
|
|
}
|
|
|
@@ -196,11 +198,11 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
}
|
|
|
|
|
|
|
|
|
- public String buildDescString(List<?> list){
|
|
|
+ public String buildDescString(String companyId, List<?> list){
|
|
|
if (CollectionUtils.isEmpty(list)){
|
|
|
return null;
|
|
|
}
|
|
|
- return BuildDescUtils.buildDesc(BeanUtil.copyToList(list, PtlAgreementUndwrtRulesAttr.class), agreementUndwrtRulesAttrService.getUndwrtRulesAttrList());
|
|
|
+ return BuildDescUtils.buildDesc(companyId, BeanUtil.copyToList(list, PtlAgreementUndwrtRulesAttr.class), agreementUndwrtRulesAttrService.getUndwrtRulesAttrList());
|
|
|
}
|
|
|
|
|
|
public boolean verify(PtlAgreementCostAdd ptlAgreementCostAdd){
|