Commit da26be78 authored by suhuiguang's avatar suhuiguang

fix(大编辑):自测bug修复

1.装置列表管道长度不应该显示为科学计数法
parent 36062b76
...@@ -24,10 +24,10 @@ public class ProjectContraptionChangeDataDto extends BaseChangeDataDto { ...@@ -24,10 +24,10 @@ public class ProjectContraptionChangeDataDto extends BaseChangeDataDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@FieldDisplayDefine(value = "工程装置名称") @FieldDisplayDefine(value = "工程(装置)名称/项目名称")
private String projectContraption; private String projectContraption;
@FieldDisplayDefine(value = "工程装置编号") @FieldDisplayDefine(value = "工程(装置)编号/项目编号")
private String projectContraptionNo; private String projectContraptionNo;
@FieldDisplayDefine(value = "设备品种代码") @FieldDisplayDefine(value = "设备品种代码")
......
...@@ -848,9 +848,10 @@ public class CommonEquipDataProcessService { ...@@ -848,9 +848,10 @@ public class CommonEquipDataProcessService {
IdxBizJgProjectContraption projectContraption = idxBizJgProjectContraptionServiceImpl.getById(projectContraptionId); IdxBizJgProjectContraption projectContraption = idxBizJgProjectContraptionServiceImpl.getById(projectContraptionId);
Map<String, Object> re = BeanUtil.beanToMap(projectContraption); Map<String, Object> re = BeanUtil.beanToMap(projectContraption);
this.convertStringToJsonObject(re, IdxBizJgProjectContraptionServiceImpl.getJsonFieldsCamel()); this.convertStringToJsonObject(re, IdxBizJgProjectContraptionServiceImpl.getJsonFieldsCamel());
List<Map<String, Object>> equList = jgUseRegistrationService.getBaseMapper().queryForUnitPipelineEquipment(new ArrayList<>(records)); List<Map<String, Object>> equList = jgUseRegistrationService.getBaseMapper().queryForUnitPipelineEquipmentForEdit(new ArrayList<>(records));
// 检验报告数据格式化 转json // 检验报告数据格式化 转json
equList.stream().filter(e -> e.get("inspectReport") != null).forEach(item -> item.put("inspectReport", JSON.parse(item.get("inspectReport").toString()))); equList.stream().filter(e -> e.get("inspectReport") != null).forEach(item -> item.put("inspectReport", JSON.parse(item.get("inspectReport").toString())));
re.put("projectContraptionId", projectContraption.getSequenceNbr());
re.put("tableData", equList); re.put("tableData", equList);
return re; return re;
} }
...@@ -891,21 +892,27 @@ public class CommonEquipDataProcessService { ...@@ -891,21 +892,27 @@ public class CommonEquipDataProcessService {
.in(BaseEntity::getSequenceNbr, projectContraptionIds) .in(BaseEntity::getSequenceNbr, projectContraptionIds)
.orderByDesc(IdxBizJgProjectContraption::getRecDate) .orderByDesc(IdxBizJgProjectContraption::getRecDate)
.page(page); .page(page);
List<Map<String, Object>> records = new ArrayList<>();
if (!ValidationUtil.isEmpty(pageList.getRecords())) { if (!ValidationUtil.isEmpty(pageList.getRecords())) {
pageList.getRecords().forEach(record -> { pageList.getRecords().forEach(record -> {
BigDecimal pipelineLength = BigDecimal.valueOf(record.getPipelineLength()); Map<String, Object> item = new HashMap<>();
BigDecimal roundedValue = pipelineLength.setScale(3, RoundingMode.HALF_UP);
BigDecimal strippedValue = roundedValue.stripTrailingZeros();
record.setPipelineLength(Double.valueOf(strippedValue.toPlainString()));
record.setDataSourceName(EquipSourceEnum.getDataSourceName(record.getDataSource())); record.setDataSourceName(EquipSourceEnum.getDataSourceName(record.getDataSource()));
record.setFullAddress( record.setFullAddress(
Stream.of(record.getProvinceName(), record.getCityName(), record.getCountyName(), record.getStreetName(), record.getAddress()) Stream.of(record.getProvinceName(), record.getCityName(), record.getCountyName(), record.getStreetName(), record.getAddress())
.map(value -> value == null ? "" : value) .map(value -> value == null ? "" : value)
.collect(Collectors.joining()) .collect(Collectors.joining())
); );
BeanUtil.copyProperties(record, item);
BigDecimal pipelineLength = BigDecimal.valueOf(record.getPipelineLength());
BigDecimal roundedValue = pipelineLength.setScale(2, RoundingMode.HALF_UP);
item.put("pipelineLength", roundedValue.toPlainString());
records.add(item);
}); });
} }
return pageList; Page<Map<String, Object>> page1 = new Page<>();
BeanUtil.copyProperties(pageList, page1);
page1.setRecords(records);
return page1;
} }
public void updateEsDataOfEquip(String record, IBaseChangeData changeDataDto) { public void updateEsDataOfEquip(String record, IBaseChangeData changeDataDto) {
......
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