Commit 257813b0 authored by tianyiming's avatar tianyiming

安装告知作废后将设备改为未纳管状态

parent 7fd2fa47
......@@ -115,6 +115,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Autowired
JgUseRegistrationMapper jgUseRegistrationMapper;
@Autowired
IdxBizJgUseInfoServiceImpl idxBizJgUseInfoService;
@Autowired
IdxBizJgRegisterInfoServiceImpl idxBizJgRegisterInfoService;
@Autowired
IdxBizJgRegisterInfoMapper tzsJgRegistrationInfoMapper;
......@@ -1394,6 +1396,28 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
this.updateById(installationNotice);
// 2.更新关联的业务
this.processElseDataByStatus(Objects.requireNonNull(FlowStatusEnum.getEumByCode(Integer.parseInt(oldNoticeStatus))), installationNotice);
// 3.更新ES、IdxBizJgUseInfo中关联设备为未纳管
Map<String, Map<String, Object>> objMap = new HashMap<>();
LambdaQueryWrapper<JgInstallationNoticeEq> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.eq(JgInstallationNoticeEq::getEquipTransferId, installationNotice.getSequenceNbr());
List<JgInstallationNoticeEq> jgInstallationNoticeEqs = jgInstallationNoticeEqMapper.selectList(lambdaQueryWrapper);
if (!ObjectUtils.isEmpty(jgInstallationNoticeEqs) && jgInstallationNoticeEqs.size() > 0) {
for (JgInstallationNoticeEq jgInstallationNoticeEq : jgInstallationNoticeEqs) {
// 组装修改es条件及数据
Map<String, Object> map = new HashMap<>();
map.put("IS_INTO_MANAGEMENT", Boolean.FALSE);
objMap.put(jgInstallationNoticeEq.getEquId(), map);
}
}
// 组装更新IdxBizJgUseInfo条件
LambdaQueryWrapper<IdxBizJgUseInfo> jgUseInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
jgUseInfoLambdaQueryWrapper.in(IdxBizJgUseInfo::getRecord, jgInstallationNoticeEqs.stream().map(JgInstallationNoticeEq::getEquId).collect(Collectors.toList()));
List<IdxBizJgUseInfo> list = idxBizJgUseInfoMapper.selectList(jgUseInfoLambdaQueryWrapper);
for (IdxBizJgUseInfo useInfo : list) {
useInfo.setIsIntoManagement(Boolean.FALSE);
}
idxBizJgUseInfoService.saveOrUpdateBatch(list);
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
return installationNotice;
}
......
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