Commit 3982ed9b authored by suhuiguang's avatar suhuiguang

1.需求3005开发,下载汇总表时直接信息管理情况

parent 94a1b9bc
......@@ -40,10 +40,7 @@ import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionI
import com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil;
import com.yeejoin.amos.boot.module.ymt.api.common.StringUtil;
import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquCodeTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.*;
import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -2079,14 +2076,29 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
int end = ((current - 1) * size + size) < total ? (current - 1) * size + size : (int) total;
// 数据截取
List<Object> equData = equipmentLists.subList(start, end);
Map<String, String> recordInformationMap = this.getInformationManageInfo(equData);
// 设备数据填充
this.fillInCylinderEquData(exportParamsMap, equData, size);
this.fillInCylinderEquData(exportParamsMap, equData, size, recordInformationMap);
return commonService.generateSummaryOfCylinderInfo(exportParamsMap, wordPath, filePrefix);
})).collect(Collectors.toList());
CompletableFuture.allOf(futures.toArray(new CompletableFuture[page])).join();
return futures;
}
private Map<String, String> getInformationManageInfo(List<Object> equData) {
List<String> records = new ArrayList<>();
equData.forEach(e->{
JSONObject jsonObject = (JSONObject)e;
String record = jsonObject.getString("record");
records.add(record);
});
LambdaQueryWrapper<IdxBizJgOtherInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.select(IdxBizJgOtherInfo::getRecord,IdxBizJgOtherInfo::getInformationSituation);
wrapper.in(IdxBizJgOtherInfo::getRecord, records);
List<IdxBizJgOtherInfo> jgOtherInfos = otherInfoMapper.selectList(wrapper);
return jgOtherInfos.stream().collect(Collectors.toMap(IdxBizJgOtherInfo::getRecord, d-> InformationManageTypeEnum.getName(d.getInformationSituation()),(k1, k2) ->k2));
}
/**
* 压力管道数据
*
......@@ -2140,14 +2152,16 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
/**
* 气瓶设备数据填充
*/
public void fillInCylinderEquData(Map<String, Object> exportParamsMap, List<Object> equData, int size) {
private void fillInCylinderEquData(Map<String, Object> exportParamsMap, List<Object> equData, int size, Map<String, String> recordInformationMap) {
String[] fieldNames = {"equDefineName", "factoryNum", "chargingMedium",
"produceUnitName", "produceDate", "nominalWorkingPressure",
"singleBottleVolume", "inspectDate", "nextInspectDate", "useInnerCode"};
"singleBottleVolume", "inspectDate", "nextInspectDate", "useInnerCode","informationSituation"};
// 填充有效数据
for (int curr = 0; curr < equData.size(); curr++) {
JSONObject obj = (JSONObject) equData.get(curr);
// 新增字段信息化管理情况
obj.put("informationSituation", recordInformationMap.get(obj.getString("record")));
int serialNum = curr + 1;
for (String fieldName : fieldNames) {
exportParamsMap.put(fieldName + serialNum, ValidationUtil.isEmpty(obj.get(fieldName)) ? "" : obj.get(fieldName));
......
package com.yeejoin.amos.boot.module.ymt.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.Optional;
@AllArgsConstructor
@Getter
public enum InformationManageTypeEnum {
/**
* 信息化管理情况枚举
*/
TYPE_QR_CODE("1", "二维码"),
TYPE_STAMP("2", "二维码"),
TYPE_NO("99", "无");
private String code;
private String name;
public static String getName(String code) {
Optional<String> op = Arrays.stream(InformationManageTypeEnum.values()).filter(e -> e.getCode().equals(code)).map(InformationManageTypeEnum::getName).findFirst();
return op.orElse("");
}
}
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