fix: 制修订流程最后一个节点判断标准编号是否重复
This commit is contained in:
+12
-3
@@ -88,6 +88,9 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
|
|||||||
@Resource
|
@Resource
|
||||||
private ILawsEnterpriseStandardService esService;
|
private ILawsEnterpriseStandardService esService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private EnterpriseStandardPlanService planService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startProcess(ProcessInfoVO<ProcessRevisionVO> processInfoVO) {
|
public void startProcess(ProcessInfoVO<ProcessRevisionVO> processInfoVO) {
|
||||||
// 流程Key
|
// 流程Key
|
||||||
@@ -264,9 +267,15 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
|
|||||||
Map<String, Object> variables = JSON.parseObject(data.getBusinessJson(), Map.class);
|
Map<String, Object> variables = JSON.parseObject(data.getBusinessJson(), Map.class);
|
||||||
String standardNumber = (String) variables.get(FieldCommon.STANDARD_NUMBER);
|
String standardNumber = (String) variables.get(FieldCommon.STANDARD_NUMBER);
|
||||||
LambdaQueryWrapper<LawsEnterpriseStandard> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<LawsEnterpriseStandard> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(LawsEnterpriseStandard::getStandardNumber, variables.get(FieldCommon.STANDARD_NUMBER));
|
queryWrapper.eq(LawsEnterpriseStandard::getStandardNumber, standardNumber);
|
||||||
LawsEnterpriseStandard one = esService.getOne(queryWrapper);
|
LawsEnterpriseStandard es = esService.getOne(queryWrapper);
|
||||||
if (Objects.nonNull(one)) {
|
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);
|
throw new JeroBootException(ResultCommon.STANDARD_NUMBER_ALREADY_EXISTS);
|
||||||
}
|
}
|
||||||
// 保存数据
|
// 保存数据
|
||||||
|
|||||||
Reference in New Issue
Block a user