Commit 4be7b182 authored by suhuiguang's avatar suhuiguang

1.安装告知、使用登记增,压力管道详情页面增加设备种类、设备类别、设备品种后端修改

parent 34c48c6f
...@@ -306,12 +306,14 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -306,12 +306,14 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 兼容老数据 // 兼容老数据
if (hisData == null) { if (hisData == null) {
Map<String, Object> detail = setNewEquipData(companyLevel, installationInfo); Map<String, Object> detail = setNewEquipData(companyLevel, installationInfo);
this.fillingEquCategoryNameForHisData(detail, notice);
return new HashMap<String, Map<String, Object>>() {{ return new HashMap<String, Map<String, Object>>() {{
this.put("installationInfo", detail); this.put("installationInfo", detail);
}}; }};
} else { } else {
hisData.putAll(installationInfo); hisData.putAll(installationInfo);
CommonServiceImpl.formatTime2StrDateForEquip(hisData); CommonServiceImpl.formatTime2StrDateForEquip(hisData);
this.fillingEquCategoryNameForHisData(hisData, notice);
return new HashMap<String, Map<String, Object>>() {{ return new HashMap<String, Map<String, Object>>() {{
this.put("installationInfo", hisData); this.put("installationInfo", hisData);
}}; }};
...@@ -327,6 +329,25 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -327,6 +329,25 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
} }
} }
/**
* 历史数据填充设备种类、设备类别、设备品种
* @param detail 返回json
* @param notice 当前单据
*/
private void fillingEquCategoryNameForHisData(Map<String, Object> detail, JgInstallationNotice notice) {
if(!StringUtils.isEmpty(notice.getProjectContraptionId())){
LambdaQueryWrapper<IdxBizJgProjectContraption> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BaseEntity::getSequenceNbr, notice.getProjectContraptionId());
queryWrapper.select(IdxBizJgProjectContraption::getEquListName,IdxBizJgProjectContraption::getEquCategoryName,IdxBizJgProjectContraption::getEquDefineName,BaseEntity::getSequenceNbr);
IdxBizJgProjectContraption projectContraption = projectContraptionService.getBaseMapper().selectOne(queryWrapper);
if(projectContraption != null){
detail.put("equListName", projectContraption.getEquListName());
detail.put("equCategoryName", projectContraption.getEquCategoryName());
detail.put("equDefineName", projectContraption.getEquDefineName());
}
}
}
private List<Map<String, Object>> getEquipListMaps(Iterable<ESEquipmentCategoryDto> equips) { private List<Map<String, Object>> getEquipListMaps(Iterable<ESEquipmentCategoryDto> equips) {
List<Map<String, Object>> arrayList = new ArrayList<>(); List<Map<String, Object>> arrayList = new ArrayList<>();
equips.forEach(equip -> { equips.forEach(equip -> {
...@@ -362,6 +383,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -362,6 +383,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
installationInfo.put("pipelineLength", projectContraption.getPipelineLength()); installationInfo.put("pipelineLength", projectContraption.getPipelineLength());
installationInfo.put("projectContraptionNo", projectContraption.getProjectContraptionNo()); installationInfo.put("projectContraptionNo", projectContraption.getProjectContraptionNo());
installationInfo.put("projectContraption", projectContraption.getProjectContraption()); installationInfo.put("projectContraption", projectContraption.getProjectContraption());
installationInfo.put("equListName", projectContraption.getEquListName());
installationInfo.put("equCategoryName", projectContraption.getEquCategoryName());
installationInfo.put("equDefineName", projectContraption.getEquDefineName());
equipListMaps = projectContraptionService.getBaseMapper().selectEquipList(projectContraptionId); equipListMaps = projectContraptionService.getBaseMapper().selectEquipList(projectContraptionId);
equipListMaps.forEach(item -> equipListMaps.forEach(item ->
item.put("deviceLevel", Optional.ofNullable(dataDictionaryMapper.selectById(String.valueOf(item.get("deviceLevel")))) item.put("deviceLevel", Optional.ofNullable(dataDictionaryMapper.selectById(String.valueOf(item.get("deviceLevel"))))
...@@ -1941,6 +1965,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1941,6 +1965,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
if (!ValidationUtil.isEmpty(projectContraption.getAddress())) { if (!ValidationUtil.isEmpty(projectContraption.getAddress())) {
result.fluentPut("address", projectContraption.getAddress()); result.fluentPut("address", projectContraption.getAddress());
} }
result.put("equListName", projectContraption.getEquListName());
result.put("equCategoryName", projectContraption.getEquCategoryName());
result.put("equDefineName", projectContraption.getEquDefineName());
return result; return result;
} }
......
...@@ -2108,6 +2108,25 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2108,6 +2108,25 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}); });
} }
/**
* 历史数据填充 设备种类、设备类别、设备品种名称
* @param detail 返回数据
* @param jgUseRegistration 当前单据
*/
private void fillingEquCategoryNameForHisData(Map<String, Object> detail, JgUseRegistration jgUseRegistration) {
if(!StringUtils.isEmpty(jgUseRegistration.getProjectContraptionId())){
LambdaQueryWrapper<IdxBizJgProjectContraption> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BaseEntity::getSequenceNbr, jgUseRegistration.getProjectContraptionId());
queryWrapper.select(IdxBizJgProjectContraption::getEquListName,IdxBizJgProjectContraption::getEquCategoryName,IdxBizJgProjectContraption::getEquDefineName,BaseEntity::getSequenceNbr);
IdxBizJgProjectContraption projectContraption = jgProjectContraptionService.getBaseMapper().selectOne(queryWrapper);
if(projectContraption != null){
detail.put("equListName", projectContraption.getEquListName());
detail.put("equCategoryName", projectContraption.getEquCategoryName());
detail.put("equDefineName", projectContraption.getEquDefineName());
}
}
}
public Map<String, Object> getDetail(String record, Long sequenceNbr) { public Map<String, Object> getDetail(String record, Long sequenceNbr) {
if (!ObjectUtils.isEmpty(sequenceNbr)) { if (!ObjectUtils.isEmpty(sequenceNbr)) {
JgUseRegistration jgUseRegistration = this.getBaseMapper().selectById(sequenceNbr); JgUseRegistration jgUseRegistration = this.getBaseMapper().selectById(sequenceNbr);
...@@ -2172,6 +2191,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2172,6 +2191,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jsonObject.put("useRegistrationCode", jgUseRegistration.getUseRegistrationCode()); jsonObject.put("useRegistrationCode", jgUseRegistration.getUseRegistrationCode());
jsonObject.put("useRegistrationFormUrl", jgUseRegistration.getUseRegistrationFormUrl()); jsonObject.put("useRegistrationFormUrl", jgUseRegistration.getUseRegistrationFormUrl());
jsonObject.put("useRegistrationFormFile", JSONArray.parseArray(jgUseRegistration.getUseRegistrationFormFile())); jsonObject.put("useRegistrationFormFile", JSONArray.parseArray(jgUseRegistration.getUseRegistrationFormFile()));
this.fillingEquCategoryNameForHisData(jsonObject, jgUseRegistration);
// 转化 附件 字段 // 转化 附件 字段
commonServiceImpl.convertStringToJsonobject(jsonObject, jsonFields); commonServiceImpl.convertStringToJsonobject(jsonObject, jsonFields);
// 结果增强,填充单据是否可变更设备状态,用来控制前端按钮的显示隐藏。 // 结果增强,填充单据是否可变更设备状态,用来控制前端按钮的显示隐藏。
...@@ -4296,7 +4316,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -4296,7 +4316,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.put("projectContraptionId", projectContraptionSeq) .put("projectContraptionId", projectContraptionSeq)
.put("projectContraptionNo", projectContraption.getProjectContraptionNo()) .put("projectContraptionNo", projectContraption.getProjectContraptionNo())
.put("isFirstMerge", projectContraption.getIsFirstMerge()) .put("isFirstMerge", projectContraption.getIsFirstMerge())
.put("pipelineLength", totalPipelineLength); .put("pipelineLength", totalPipelineLength)
.put("equListName", projectContraption.getEquListName())
.put("equCategoryName", projectContraption.getEquCategoryName())
.put("equDefineName", projectContraption.getEquDefineName());
setProjectContraptionInfo(projectContraption, resultBuilder); setProjectContraptionInfo(projectContraption, resultBuilder);
return resultBuilder.build(); return resultBuilder.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