Commit cbb7dac2 authored by 刘林's avatar 刘林

fix(jg):证打印标记功能开发

parent e086c80b
package com.yeejoin.amos.boot.module.jg.api.dto; package com.yeejoin.amos.boot.module.jg.api.dto;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -147,4 +148,7 @@ public class JgUseRegistrationManageDto extends BaseDto { ...@@ -147,4 +148,7 @@ public class JgUseRegistrationManageDto extends BaseDto {
@ApiModelProperty("使用单位seq") @ApiModelProperty("使用单位seq")
private String useUnitSeq; private String useUnitSeq;
@ApiModelProperty("证书是否打印标记")
private JSONObject certificatePrintTag;
} }
package com.yeejoin.amos.boot.module.jg.api.entity; package com.yeejoin.amos.boot.module.jg.api.entity;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
...@@ -240,4 +241,10 @@ public class JgUseRegistrationManage extends BaseEntity { ...@@ -240,4 +241,10 @@ public class JgUseRegistrationManage extends BaseEntity {
*/ */
@TableField("is_do_business") @TableField("is_do_business")
private String isDoBusiness; private String isDoBusiness;
/**
* 证书是否打印标记
*/
@TableField("certificate_print_tag")
private JSONObject certificatePrintTag;
} }
...@@ -226,7 +226,7 @@ public class JgUseRegistrationController extends BaseController { ...@@ -226,7 +226,7 @@ public class JgUseRegistrationController extends BaseController {
public void exportSummaryBasicInfo(HttpServletResponse response, public void exportSummaryBasicInfo(HttpServletResponse response,
@RequestParam("sequenceNbr") String sequenceNbr, @RequestParam("sequenceNbr") String sequenceNbr,
@RequestParam("category") String category) { @RequestParam("category") String category) {
jgUseRegistrationServiceImpl.exportSummaryBasicInfo(Collections.singletonList(Long.valueOf(sequenceNbr)), response, category); jgUseRegistrationServiceImpl.exportSummaryBasicInfo(Collections.singletonList(Long.valueOf(sequenceNbr)), response, category, null);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -710,7 +710,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -710,7 +710,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
//获取告知单信息 //获取告知单信息
byte[] templateToPdfData = WordTemplateUtils.getTemplateToPdfData(tempFileName, "installation-notification-report.ftl", map); byte[] templateToPdfData = WordTemplateUtils.getTemplateToPdfData(tempFileName, "installation-notification-report.ftl", map);
//获取管道和气瓶的基本信息汇总表 //获取管道和气瓶的基本信息汇总表
List<CompletableFuture<byte[]>> exportSummaryBasicInfoData = jgUseRegistrationService.getExportSummaryBasicInfoData(Collections.singletonList(Long.valueOf(sequenceNbr)), jgInstallationNotice.getEquCategoryCode(), "安装告知", Boolean.TRUE); List<CompletableFuture<byte[]>> exportSummaryBasicInfoData = jgUseRegistrationService.getExportSummaryBasicInfoData(Collections.singletonList(Long.valueOf(sequenceNbr)), jgInstallationNotice.getEquCategoryCode(), "安装告知", Boolean.TRUE, null);
toZipFileByData(response, exportSummaryBasicInfoData, templateToPdfData, jgInstallationNotice.getApplyNo()); toZipFileByData(response, exportSummaryBasicInfoData, templateToPdfData, jgInstallationNotice.getApplyNo());
}else { }else {
WordTemplateUtils.templateToPdfDownload(tempFileName, "installation-notification-report.ftl", map, response); WordTemplateUtils.templateToPdfDownload(tempFileName, "installation-notification-report.ftl", map, response);
......
...@@ -88,7 +88,11 @@ import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistration ...@@ -88,7 +88,11 @@ import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistration
*/ */
@Service @Service
public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistrationManageDto, JgUseRegistrationManage, JgUseRegistrationManageMapper> implements IJgUseRegistrationManageService { public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistrationManageDto, JgUseRegistrationManage, JgUseRegistrationManageMapper> implements IJgUseRegistrationManageService {
public static final String CERTIFICATE_NORMAL = "certificateNormalPrint";
public static final String CERTIFICATE_NESTED = "certificateNestedPrint";
public static final String USE_FLAG_NORMAL = "useFlagNormalPrint";
public static final String USE_FLAG_NESTED = "useFlagNestedPrint";
public static final String EXPORT_SUMMARY_TABLE = "exportSummaryTable";
@Autowired @Autowired
RestHighLevelClient restHighLevelClient; RestHighLevelClient restHighLevelClient;
...@@ -582,132 +586,124 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr ...@@ -582,132 +586,124 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
* @param certificateSeq 使用登记证的seq * @param certificateSeq 使用登记证的seq
*/ */
public void printCertificate(HttpServletResponse response, String printType, String certificateSeq) { public void printCertificate(HttpServletResponse response, String printType, String certificateSeq) {
if (StringUtils.isEmpty(printType) || StringUtils.isEmpty(certificateSeq)) { if (StringUtils.isEmpty(printType) || StringUtils.isEmpty(certificateSeq)) {
throw new BadRequest("打印失败,请联系管理员!"); throw new BadRequest("打印失败,请联系管理员!");
} }
JgUseRegistrationManage manage = this.baseMapper.selectById(certificateSeq); JgUseRegistrationManage manage = this.baseMapper.selectById(certificateSeq);
String useRegistrationCode = manage.getUseRegistrationCode(); if (manage == null) {
String equCategoryCode = manage.getEquCategoryCode(); throw new BadRequest("未找到对应的使用登记信息!");
switch (printType) {
case "certificateNormalPrint":// 使用登记证 普打
case "certificateNestedPrint":// 使用登记证 套打
case "useFlagNormalPrint":// 使用标志 普打
case "useFlagNestedPrint":// 使用标志 套打
this.exportUseRegistrationCertificate(manage, response, getPrintTypeCode(printType));
break;
case "exportSummaryTable":// 工业管道和气瓶 汇总表下载
List<JgUseRegistration> jgUseRegistrations = jgUseRegistrationService.getBaseMapper().selectList(new LambdaQueryWrapper<JgUseRegistration>()
.eq(JgUseRegistration::getUseRegistrationCode, useRegistrationCode)
.eq(JgUseRegistration::getStatus, "已完成"));
List<Long> useRegistrationSeqs = jgUseRegistrations.stream().map(JgUseRegistration::getSequenceNbr).collect(Collectors.toList());
jgUseRegistrationService.exportSummaryBasicInfo(useRegistrationSeqs, response, equCategoryCode);
break;
default:
break;
} }
if (EXPORT_SUMMARY_TABLE.equals(printType)) {
//打印汇总表
handleExportSummaryTable(response, manage);
} else {
exportUseRegistrationCertificate(manage, response, printType);
}
this.updateById(manage);
} }
private String getPrintTypeCode(String printType) { private void handleExportSummaryTable(HttpServletResponse response, JgUseRegistrationManage manage) {
switch (printType) { JSONObject tagJson = Optional.ofNullable(manage.getCertificatePrintTag()).orElse(new JSONObject());
case "certificateNormalPrint": tagJson.put(EXPORT_SUMMARY_TABLE, 2);
return "0"; manage.setCertificatePrintTag(tagJson);
case "certificateNestedPrint": List<JgUseRegistration> registrations = jgUseRegistrationService.getBaseMapper().selectList(
return "1"; new LambdaQueryWrapper<JgUseRegistration>()
case "useFlagNormalPrint": .eq(JgUseRegistration::getUseRegistrationCode, manage.getUseRegistrationCode())
return "2"; .eq(JgUseRegistration::getStatus, "已完成")
case "useFlagNestedPrint": );
return "3"; List<Long> seqs = registrations.stream().map(JgUseRegistration::getSequenceNbr).collect(Collectors.toList());
default: Set<String> projectIds = registrations.stream().map(JgUseRegistration::getProjectContraptionId).collect(Collectors.toSet());
return ""; jgUseRegistrationService.exportSummaryBasicInfo(seqs, response, manage.getEquCategoryCode(), projectIds);
}
} }
public void exportUseRegistrationCertificate(JgUseRegistrationManage manage, HttpServletResponse response, String printType) { public void exportUseRegistrationCertificate(JgUseRegistrationManage manage, HttpServletResponse response, String printType) {
Map<String, Object> exportParamsMap = new HashMap<>(); if (ValidationUtil.isEmpty(manage)) {
// 查询使用登记详情 throw new BadRequest("使用登记信息为空,导出失败!");
List<JSONObject> deviceList = this.queryEquByCertificate(manage);
if (ValidationUtil.isEmpty(manage) || ValidationUtil.isEmpty(deviceList)) {
throw new BadRequest("使用登记证导出失败,请稍后重试!");
}
// 登记机关
if (ValidationUtil.isEmpty(manage.getReceiveOrgName())) {
throw new BadRequest("使用登记证导出失败,登记机关为空!");
} }
exportParamsMap.put("receiveOrgName", manage.getReceiveOrgName()); List<JSONObject> deviceList = this.queryEquByCertificate(manage);
// 使用登记证编号 if (ValidationUtil.isEmpty(deviceList)) {
if (ValidationUtil.isEmpty(manage.getUseRegistrationCode())) { throw new BadRequest("设备信息为空,导出失败!");
throw new BadRequest("使用登记证导出失败,使用登记证编号为空!");
} }
exportParamsMap.put("useRegistrationCode", manage.getUseRegistrationCode()); Map<String, Object> params = buildExportParams(manage, deviceList);
// 使用单位名称 JSONObject tagJson = new JSONObject(manage.getCertificatePrintTag());
if (ValidationUtil.isEmpty(manage.getUseUnitName())) { switch (printType) {
throw new BadRequest("使用登记证导出失败,使用单位名称为空!"); case CERTIFICATE_NORMAL://证 普打
commonService.generateCertificateReport(params, response);
tagJson.put(CERTIFICATE_NORMAL, 2);
break;
case CERTIFICATE_NESTED://证 套打
commonService.generateCertificateReportDoc(params, response);
tagJson.put(CERTIFICATE_NESTED, 2);
break;
case USE_FLAG_NORMAL://标志 普打
commonService.useFlagGenerate(this.buildUseFlagParamDto(deviceList, manage, params), response);
tagJson.put(USE_FLAG_NORMAL, 2);
break;
case USE_FLAG_NESTED://标志 套打
commonService.fightUseFlagGenerate(this.buildUseFlagParamDto(deviceList, manage, params), response);
tagJson.put(USE_FLAG_NESTED, 2);
break;
default:
throw new BadRequest("无效的打印类型!");
} }
exportParamsMap.put("useUnitName", manage.getUseUnitName()); manage.setCertificatePrintTag(tagJson);
}
// 监管码 private Map<String, Object> buildExportParams(JgUseRegistrationManage manage, List<JSONObject> deviceList) {
if (ValidationUtil.isEmpty(deviceList.get(0))) { Map<String, Object> map = new HashMap<>();
throw new BadRequest("使用登记证导出失败,监管码为空!"); if (ValidationUtil.isEmpty(manage.getReceiveOrgName()) ||
ValidationUtil.isEmpty(manage.getUseRegistrationCode()) ||
ValidationUtil.isEmpty(manage.getUseUnitName())) {
throw new BadRequest("导出失败,登记机关、编号或单位名称为空!");
} }
map.put("receiveOrgName", manage.getReceiveOrgName());
map.put("useRegistrationCode", manage.getUseRegistrationCode());
map.put("useUnitName", manage.getUseUnitName());
map.put("supervisoryCode", deviceList.get(0).get("SUPERVISORY_CODE"));
if ("1".equals(manage.getIsOverDesign())) { if ("1".equals(manage.getIsOverDesign())) {
exportParamsMap.put("overDesign", "超设计使用年限"); map.put("overDesign", "超设计使用年限");
} }
exportParamsMap.put("supervisoryCode", deviceList.get(0).get("SUPERVISORY_CODE")); getAuditPassedDate(manage.getAuditPassDate(), map);
getAuditPassedDate(manage.getAuditPassDate(), exportParamsMap); getReissueDate(manage.getReissueDate(), map);
getReissueDate(manage.getReissueDate(), exportParamsMap); map.put("equList", manage.getEquList());
exportParamsMap.put("equList", manage.getEquList()); map.put("equCategory", manage.getEquCategory());
exportParamsMap.put("equCategory", manage.getEquCategory()); map.put("equDefine", manage.getEquDefine());
exportParamsMap.put("equDefine", manage.getEquDefine()); map.put("manageType", manage.getManageType());
exportParamsMap.put("manageType", manage.getManageType()); if (BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.getName().equals(manage.getRegType())) {
if (BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.getName().equals(manage.getRegType())){ map.put("fullAddress", manage.getUseUnitAddress());
exportParamsMap.put("fullAddress", manage.getUseUnitAddress()); map.put("manageType", "");
exportParamsMap.put("manageType", ""); map.put("equDefineCode", "23T0");
exportParamsMap.put("equDefineCode", "23T0"); map.put("equCode", joinDeviceField(deviceList, "EQU_CODE"));
exportParamsMap.put("equCode", deviceList.stream() map.put("factoryNum", joinDeviceField(deviceList, "FACTORY_NUM"));
.map(equ -> String.valueOf(equ.get("EQU_CODE"))) map.put("useInnerCode", joinDeviceFieldDistinct(deviceList, "USE_INNER_CODE"));
.filter(Objects::nonNull) } else {
.collect(Collectors.joining(", "))); map.put("fullAddress", "unit".equals(manage.getManageType()) ? manage.getUseUnitAddress() : manage.getEquUseAddress());
exportParamsMap.put("factoryNum", deviceList.stream() map.put("equCode", deviceList.get(0).get("EQU_CODE"));
.map(equ -> String.valueOf(equ.get("FACTORY_NUM"))) map.put("factoryNum", deviceList.get(0).get("FACTORY_NUM"));
.filter(Objects::nonNull) map.put("useInnerCode", deviceList.get(0).get("USE_INNER_CODE"));
.collect(Collectors.joining(", ")));
exportParamsMap.put("useInnerCode", deviceList.stream()
.map(equ -> String.valueOf(equ.get("USE_INNER_CODE")))
.filter(Objects::nonNull)
.distinct()
.collect(Collectors.joining(", ")));
}else{
exportParamsMap.put("fullAddress", manage.getEquUseAddress());
exportParamsMap.put("equCode", deviceList.get(0).get("EQU_CODE"));
exportParamsMap.put("factoryNum", deviceList.get(0).get("FACTORY_NUM"));
exportParamsMap.put("useInnerCode", deviceList.get(0).get("USE_INNER_CODE"));
if ("unit".equals(manage.getManageType())) {
exportParamsMap.put("fullAddress", manage.getUseUnitAddress());
}
}
// 调整为证编号 全库唯一
exportParamsMap.put("certificateNo", manage.getCertificateNo());
// 与certificateNo一样,冗余字段防止漏调整
exportParamsMap.put("applyNo", manage.getCertificateNo());
exportParamsMap.put("version", manage.getVersion() + "");
exportParamsMap.put("carNumber", manage.getCarNumber());
exportParamsMap.put("equListCode", manage.getEquListCode());
if ("0".equals(printType)) {
// 调用生成使用登记证
commonService.generateCertificateReport(exportParamsMap, response);
} else if ("1".equals(printType)) {
// 套打
commonService.generateCertificateReportDoc(exportParamsMap, response);
} else if ("2".equals(printType)) {
// 使用标志普通打印
commonService.useFlagGenerate(this.buildUseFlagParamDto(deviceList, manage, exportParamsMap), response);
} else if ("3".equals(printType)) {
// 使用标志套打
commonService.fightUseFlagGenerate(this.buildUseFlagParamDto(deviceList, manage, exportParamsMap), response);
} }
map.put("certificateNo", manage.getCertificateNo());
map.put("applyNo", manage.getCertificateNo());
map.put("version", String.valueOf(manage.getVersion()));
map.put("carNumber", manage.getCarNumber());
map.put("equListCode", manage.getEquListCode());
return map;
}
private String joinDeviceField(List<JSONObject> devices, String field) {
return devices.stream()
.map(obj -> String.valueOf(obj.get(field)))
.filter(Objects::nonNull)
.collect(Collectors.joining(", "));
}
private String joinDeviceFieldDistinct(List<JSONObject> devices, String field) {
return devices.stream()
.map(obj -> String.valueOf(obj.get(field)))
.filter(Objects::nonNull)
.distinct()
.collect(Collectors.joining(", "));
} }
/** /**
......
...@@ -1167,7 +1167,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1167,7 +1167,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
boolean isFirstMerge = jgProjectContraption.getIsFirstMerge(); boolean isFirstMerge = jgProjectContraption.getIsFirstMerge();
mapData.put("isFirstMerge", isFirstMerge); mapData.put("isFirstMerge", isFirstMerge);
// 装置表写入使用登记证编号、将装置名称写入到使用登记表 // 装置表写入使用登记证编号、将装置名称写入到使用登记表
updateRegAndProjectContraption(jgUseRegistration, mapData, jgProjectContraption); this.updateRegAndProjectContraption(jgUseRegistration, mapData, jgProjectContraption);
// 首次合并 + 特殊登记,给工程装置生成设备代码和监管码 // 首次合并 + 特殊登记,给工程装置生成设备代码和监管码
if (isFirstMerge || "2".equals(jgUseRegistration.getRegType())) { if (isFirstMerge || "2".equals(jgUseRegistration.getRegType())) {
Map<String, Object> createCodeMap = new HashMap<>(); Map<String, Object> createCodeMap = new HashMap<>();
...@@ -2556,13 +2556,52 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2556,13 +2556,52 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
} }
/** /**
* 获取装置下的管道信息(根据整个记录去重)
*
* @param projectContraptionList 装置 ID 列表
* @return 去重后的管道信息 JSON 数组
*/
public List<Map<String, Object>> queryPipelineList(Set<String> projectContraptionList) {
if (CollectionUtils.isEmpty(projectContraptionList)) {
return Collections.emptyList();
}
Set<String> result = new HashSet<>();
return projectContraptionList.stream()
.filter(Objects::nonNull)
.map(jgProjectContraptionService.getBaseMapper()::selectEquipList)
.filter(Objects::nonNull)
.flatMap(List::stream)
.peek(map -> map.put("productName", map.get("pipeName")))
.filter(map -> result.add(JSONObject.toJSONString(map)))
.collect(Collectors.toList());
}
public List<Map<String, Object>> getEquipInfoList(List<Long> useRegistrationSeqs, String category, Set<String> projectContraptionIdList) {
LambdaQueryWrapper<JgUseRegistrationEq> lambda = new QueryWrapper<JgUseRegistrationEq>().lambda();
lambda.in(JgUseRegistrationEq::getEquipTransferId, useRegistrationSeqs);
lambda.select(JgUseRegistrationEq::getEquId);
List<JgUseRegistrationEq> eqs = jgUseRegistrationEqService.getBaseMapper().selectList(lambda);
List<String> records = eqs.stream().map(JgUseRegistrationEq::getEquId).collect(toList());
if (!"2300".equals(category)) {
return this.queryPipelineList(projectContraptionIdList);
} else {
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
List<Map<String, Object>> tableData = jgUseRegistrationMapper.queryForUnitVesselEquipment(records);
tableData.forEach(i -> i.put("chargingMedium", fillingMediumMap.get(i.get("chargingMedium"))));
return tableData;
}
}
/**
* 获取导出基本信息数据 * 获取导出基本信息数据
* @param useRegistrationSeqs * @param useRegistrationSeqs
* @param category * @param category
* @param whetherToFilterStatus 是否过滤设备状态 是:true(过滤设备状态为在用),否:false(所有的) * @param whetherToFilterStatus 是否过滤设备状态 是:true(过滤设备状态为在用),否:false(所有的)
* @return * @return
*/ */
public List<CompletableFuture<byte[]>> getExportSummaryBasicInfoData(List<Long> useRegistrationSeqs, String category, String type, Boolean whetherToFilterStatus) { public List<CompletableFuture<byte[]>> getExportSummaryBasicInfoData(List<Long> useRegistrationSeqs, String category, String type,
Boolean whetherToFilterStatus, Set<String> projectContraptionIdList) {
List<CompletableFuture<byte[]>> futureList = new ArrayList<>(); List<CompletableFuture<byte[]>> futureList = new ArrayList<>();
// 总数 // 总数
double total; double total;
...@@ -2575,26 +2614,38 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2575,26 +2614,38 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
throw new BadRequest("没有查询到汇总信息!"); throw new BadRequest("没有查询到汇总信息!");
} }
JSONArray allEquipment = new JSONArray(); JSONArray allEquipment = new JSONArray();
// 用Set存储已添加的equCode,防止重复添加
Set<String> addedEquCodes = new HashSet<>(); Set<String> addedEquCodes = new HashSet<>();
registrationHistoryList.forEach(historyList -> {
JSONObject jsonObject = JSONObject.parseObject(historyList.getChangeData()); if (!"安装告知".equals(type)) {
JSONArray equipmentLists = "安装告知".equals(type) List<Map<String, Object>> equipmentList = getEquipInfoList(useRegistrationSeqs, category, projectContraptionIdList);
? (JSONArray) jsonObject.get("deviceList") if (CollectionUtils.isNotEmpty(equipmentList)) {
: (JSONArray) jsonObject.get("equipmentLists"); equipmentList.forEach(map -> {
String record = (String) map.get("record");
final String useDateValue = jsonObject.getString("useDate"); if ((whetherToFilterStatus || this.checkEquStatusInUse(record))) {
if (CollectionUtils.isNotEmpty(equipmentLists)) { allEquipment.add(new JSONObject(map));
equipmentLists.stream() }
.map(obj -> (JSONObject) obj) });
.filter(equipmentItem -> whetherToFilterStatus || this.checkEquStatusInUse(equipmentItem.getString("record")))
.forEach(item -> {
item.put("useDate", timeToMonths(useDateValue));
allEquipment.add(item);
addedEquCodes.add(item.getString("equCode"));
});
} }
}); } else {
registrationHistoryList.forEach(history -> {
JSONObject jsonObject = JSONObject.parseObject(history.getChangeData());
String useDate = jsonObject.getString("useDate");
List<Map<String, Object>> deviceList = (List<Map<String, Object>>) jsonObject.get("deviceList");
if (CollectionUtils.isNotEmpty(deviceList)) {
deviceList.forEach(map -> {
JSONObject item = new JSONObject(map);
String equCode = item.getString("equCode");
String record = item.getString("record");
if ((whetherToFilterStatus || this.checkEquStatusInUse(record)) && addedEquCodes.add(equCode)) {
item.put("useDate", timeToMonths(useDate));
allEquipment.add(item);
}
});
}
});
}
total = allEquipment.size(); total = allEquipment.size();
AgencyUserModel result = new AgencyUserModel(); AgencyUserModel result = new AgencyUserModel();
// 暂时拿第一条的 监管部门和安全管理人员 // 暂时拿第一条的 监管部门和安全管理人员
...@@ -2661,10 +2712,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2661,10 +2712,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
* @param useRegistrationSeqs * @param useRegistrationSeqs
* @param response * @param response
*/ */
public void exportSummaryBasicInfo(List<Long> useRegistrationSeqs, HttpServletResponse response, String category) { public void exportSummaryBasicInfo(List<Long> useRegistrationSeqs, HttpServletResponse response, String category, Set<String> projectContraptionIdList) {
JgUseRegistration jgUseRegistration = jgUseRegistrationMapper.selectOne(new QueryWrapper<JgUseRegistration>().lambda() JgUseRegistration jgUseRegistration = jgUseRegistrationMapper.selectOne(new QueryWrapper<JgUseRegistration>().lambda()
.eq(JgUseRegistration::getSequenceNbr, useRegistrationSeqs.get(0)).eq(JgUseRegistration::getIsDelete, false)); .eq(JgUseRegistration::getSequenceNbr, useRegistrationSeqs.get(0)).eq(JgUseRegistration::getIsDelete, false));
List<CompletableFuture<byte[]>> futures = getExportSummaryBasicInfoData(useRegistrationSeqs, category, "", Boolean.FALSE); List<CompletableFuture<byte[]>> futures = getExportSummaryBasicInfoData(useRegistrationSeqs, category, "", Boolean.FALSE, projectContraptionIdList);
if ("8300".equals(category) || "8200".equals(category) || "8100".equals(category)) { if ("8300".equals(category) || "8200".equals(category) || "8100".equals(category)) {
// 文件名前缀 // 文件名前缀
String filePrefix = "压力管道基本信息汇总表_"; String filePrefix = "压力管道基本信息汇总表_";
...@@ -2680,7 +2731,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2680,7 +2731,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// byte[]压缩zip // byte[]压缩zip
toZipFile(response, futures, filePrefix, customFileName); toZipFile(response, futures, filePrefix, customFileName);
} }
} }
/** /**
......
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