Commit 20786824 authored by 韩桐桐's avatar 韩桐桐

fix(jg):改造告知

parent 9adf3fec
......@@ -200,7 +200,9 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
// 字段转换
this.convertField(noticeDto);
JgReformNotice notice = this.getById(noticeDto.getSequenceNbr());
this.checkRepeatUsed(submitType, notice);
List<Map<String, Object>> deviceList = noticeDto.getDeviceList();
List<String> records = deviceList.stream().map(equ -> String.valueOf(equ.get("SEQUENCE_NBR"))).collect(Collectors.toList());
this.checkRepeatUsed(submitType, records, notice);
if (SUBMIT_TYPE_FLOW.equals(submitType)) {
// 发起流程
if (!StringUtils.hasText(noticeDto.getInstanceId())) {
......@@ -274,7 +276,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
BeanUtils.copyProperties(noticeDto, bean);
jgReformNoticeMapper.updateById(bean);
}
List<Map<String, Object>> deviceList = noticeDto.getDeviceList();
jgReformNoticeEqMapper.delete(new QueryWrapper<JgReformNoticeEq>()
.eq("equip_transfer_id", notice.getSequenceNbr()));
// eq关系表
......@@ -512,15 +514,13 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
equipList.forEach(equipMap -> EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY).equipRepeatUsedCheck(String.valueOf(equipMap.get("SEQUENCE_NBR")), companyCode));
}
private void checkRepeatUsed(String submitType, JgReformNotice jgReformNotice) {
private void checkRepeatUsed(String submitType, List<String> records, JgReformNotice jgReformNotice) {
if (SUBMIT_TYPE_FLOW.equals(submitType)) {
// 流程中校验
LambdaQueryWrapper<JgReformNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgReformNoticeEq::getEquipTransferId, jgReformNotice.getSequenceNbr());
List<JgReformNoticeEq> noticeEqs = jgReformNoticeEqMapper.selectList(queryWrapper);
for (JgReformNoticeEq noticeEq : noticeEqs) {
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY).equipRepeatUsedCheck(noticeEq.getEquId(), jgReformNotice.getInstallUnitCreditCode());
}
records.forEach(record -> {
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY)
.equipRepeatUsedCheck(record, jgReformNotice.getInstallUnitCreditCode());
});
}
}
......@@ -612,6 +612,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
.startDate(item.getCreateDate())
.model(taskMessageDto)
.nextExecuteUser(item.getNextExecuteIds())
.startDate(new Date())
.build();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment