fix: 制修订流程最后一个节点判断标准编号是否重复

This commit is contained in:
2024-09-27 11:07:53 +08:00
parent baa03931fb
commit b40eabe610
@@ -88,6 +88,9 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
@Resource
private ILawsEnterpriseStandardService esService;
@Resource
private EnterpriseStandardPlanService planService;
@Override
public void startProcess(ProcessInfoVO<ProcessRevisionVO> processInfoVO) {
// 流程Key
@@ -264,9 +267,15 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
Map<String, Object> variables = JSON.parseObject(data.getBusinessJson(), Map.class);
String standardNumber = (String) variables.get(FieldCommon.STANDARD_NUMBER);
LambdaQueryWrapper<LawsEnterpriseStandard> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(LawsEnterpriseStandard::getStandardNumber, variables.get(FieldCommon.STANDARD_NUMBER));
LawsEnterpriseStandard one = esService.getOne(queryWrapper);
if (Objects.nonNull(one)) {
queryWrapper.eq(LawsEnterpriseStandard::getStandardNumber, standardNumber);
LawsEnterpriseStandard es = esService.getOne(queryWrapper);
if (Objects.nonNull(es)) {
throw new JeroBootException(ResultCommon.STANDARD_NUMBER_ALREADY_EXISTS);
}
LambdaQueryWrapper<EnterpriseStandardPlan> planQueryWrapper = new LambdaQueryWrapper<>();
planQueryWrapper.eq(EnterpriseStandardPlan::getStandardNumber, standardNumber);
EnterpriseStandardPlan plan = planService.getOne(planQueryWrapper);
if (Objects.nonNull(plan)) {
throw new JeroBootException(ResultCommon.STANDARD_NUMBER_ALREADY_EXISTS);
}
// 保存数据