Commit e5fabbee authored by hezhuozhi's avatar hezhuozhi

提交长输管道、公用管道的打印汇总表

parent 49aaef53
...@@ -13,7 +13,9 @@ public enum PipelineEnum { ...@@ -13,7 +13,9 @@ public enum PipelineEnum {
PRESSURE_PIPELINE("压力管道", "8000"), PRESSURE_PIPELINE("压力管道", "8000"),
INDUSTRIAL_PIPELINE("工业管道", "8300"); INDUSTRIAL_PIPELINE("工业管道", "8300"),
LONG_DISTANCE_PIPELINE("长输管道", "8100"),
COMMON_PIPELINE("公用管道", "8200");
private final String name; private final String name;
......
...@@ -6,9 +6,11 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -6,9 +6,11 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.IdxBizJgProjectContraptionServiceImpl; import com.yeejoin.amos.boot.module.jg.biz.service.impl.IdxBizJgProjectContraptionServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto; import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -16,6 +18,9 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -16,6 +18,9 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -97,6 +102,7 @@ public class IdxBizJgProjectContraptionController extends BaseController { ...@@ -97,6 +102,7 @@ public class IdxBizJgProjectContraptionController extends BaseController {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.proConPageByParams(params, page, reginParams)); return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.proConPageByParams(params, page, reginParams));
} }
/** /**
* 根据入参 列表查询(当前)单位下的工程管道 * 根据入参 列表查询(当前)单位下的工程管道
* *
...@@ -127,6 +133,70 @@ public class IdxBizJgProjectContraptionController extends BaseController { ...@@ -127,6 +133,70 @@ public class IdxBizJgProjectContraptionController extends BaseController {
} }
/** /**
* 根据sequenceNbr分页查询管道信息
*
* @param sequenceNbr
* @param current 当前页
* @param size 大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/techParamsPipelinePage")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询管道信息", notes = "管道工程装置表分页查询")
public ResponseModel <Page<Map<String, Object>>> techParamsPipelinePage(@RequestParam("sequenceNbr") String sequenceNbr,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.techParamsPipelinePage(sequenceNbr,current,size));
}
/**
* 新增或者更新检验信息
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveOrUpdateDetectionInfo")
@ApiOperation(httpMethod = "POST", value = "新增或者更新检验信息", notes = "新增或者更新检验信息")
public ResponseModel<?> saveOrUpdateDetectionInfo(@RequestBody IdxBizJgInspectionDetectionInfo detectionInfo) {
idxBizJgProjectContraptionServiceImpl.saveOrUpdateDetectionInfo(detectionInfo);
return ResponseHelper.buildResponse("更新成功");
}
/**
* 新增或者更新检验信息批量
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveOrUpdateDetectionInfoBatch")
@ApiOperation(httpMethod = "POST", value = "新增或者更新检验信息", notes = "新增或者更新检验信息")
public ResponseModel<?> saveOrUpdateDetectionInfoBatch(@RequestBody List<IdxBizJgInspectionDetectionInfo> detectionInfos) {
idxBizJgProjectContraptionServiceImpl.saveOrUpdateDetectionInfoBatch(detectionInfos);
return ResponseHelper.buildResponse("更新成功");
}
/**
* 获取检验信息详情
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getDetectionInfoDetail")
@ApiOperation(httpMethod = "GET", value = "获取检验信息详情", notes = "获取检验信息详情")
public ResponseModel<IdxBizJgInspectionDetectionInfo> getDetectionInfoDetail(@RequestParam("sequenceNbr") String sequenceNbr) {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.getDetectionInfoDetail(sequenceNbr));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/summaryBasicInfo/export")
@ApiOperation(httpMethod = "GET", value = "导出基本信息汇总表(长输/公用管道)", notes = "导出基本信息汇总表(长输/公用管道)")
public void exportSummaryBasicInfo(HttpServletResponse response,
@RequestParam("sequenceNbr") String sequenceNbr,
@RequestParam("category") String category) {
idxBizJgProjectContraptionServiceImpl.exportSummaryBasicInfo(sequenceNbr, response, category);
}
/**
* 列表分页查询 * 列表分页查询
* *
* @param current 当前页 * @param current 当前页
...@@ -144,6 +214,7 @@ public class IdxBizJgProjectContraptionController extends BaseController { ...@@ -144,6 +214,7 @@ public class IdxBizJgProjectContraptionController extends BaseController {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.queryForIdxBizJgProjectContraptionPage(page)); return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.queryForIdxBizJgProjectContraptionPage(page));
} }
/** /**
* 列表全部数据查询 * 列表全部数据查询
* *
...@@ -155,4 +226,5 @@ public class IdxBizJgProjectContraptionController extends BaseController { ...@@ -155,4 +226,5 @@ public class IdxBizJgProjectContraptionController extends BaseController {
public ResponseModel<List<IdxBizJgProjectContraptionDto>> selectForList() { public ResponseModel<List<IdxBizJgProjectContraptionDto>> selectForList() {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.queryForIdxBizJgProjectContraptionList()); return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.queryForIdxBizJgProjectContraptionList());
} }
} }
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.CompletableFuture;
import java.util.stream.IntStream;
import java.util.stream.Stream; import java.util.stream.Stream;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum; import com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgProjectContraptionService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgProjectContraptionService;
import com.yeejoin.amos.boot.module.ymt.api.dto.ElevatorWlInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto; import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import lombok.extern.slf4j.Slf4j;
import lombok.var; import lombok.var;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.*; import java.util.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/** /**
* 管道工程装置表服务实现类 * 管道工程装置表服务实现类
...@@ -32,6 +61,7 @@ import java.util.*; ...@@ -32,6 +61,7 @@ import java.util.*;
* @author system_generator * @author system_generator
* @date 2024-12-11 * @date 2024-12-11
*/ */
@Slf4j
@Service @Service
public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgProjectContraptionDto, IdxBizJgProjectContraption, IdxBizJgProjectContraptionMapper> implements IIdxBizJgProjectContraptionService { public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgProjectContraptionDto, IdxBizJgProjectContraption, IdxBizJgProjectContraptionMapper> implements IIdxBizJgProjectContraptionService {
...@@ -52,6 +82,12 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -52,6 +82,12 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
private IdxBizJgRegisterInfoServiceImpl registerInfoService; private IdxBizJgRegisterInfoServiceImpl registerInfoService;
@Autowired @Autowired
private CommonServiceImpl commonServiceImpl; private CommonServiceImpl commonServiceImpl;
@Autowired
private IdxBizJgInspectionDetectionInfoServiceImpl detectionInfoService;
@Autowired
private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
@Autowired
private CommonServiceImpl commonService;
@Override @Override
public boolean saveOrUpdateData(IdxBizJgProjectContraption projectContraption) { public boolean saveOrUpdateData(IdxBizJgProjectContraption projectContraption) {
...@@ -211,4 +247,187 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -211,4 +247,187 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
resultMap.put(EQUIP_INFO_FORM_ID, projectContraptionMap); resultMap.put(EQUIP_INFO_FORM_ID, projectContraptionMap);
return resultMap; return resultMap;
} }
public Page<Map<String, Object>> techParamsPipelinePage(String sequenceNbr,int current, int size) {
Page<Map<String, Object>> page=new Page<>();
page.setCurrent(current);
page.setSize(size);
page.setRecords(baseMapper.selectEquipListPage(sequenceNbr,(current-1)*size,size));
page.setTotal(baseMapper.selectEquipCount(sequenceNbr));
return page;
}
public void saveOrUpdateDetectionInfo(IdxBizJgInspectionDetectionInfo detectionInfo) {
detectionInfo.setRecDate(new Date());
detectionInfoService.saveOrUpdateData(detectionInfo);
}
public void saveOrUpdateDetectionInfoBatch(List<IdxBizJgInspectionDetectionInfo> detectionInfos) {
if(CollectionUtil.isNotEmpty(detectionInfos)){
for (IdxBizJgInspectionDetectionInfo detectionInfo : detectionInfos) {
detectionInfo.setRecDate(new Date());
}
detectionInfoService.saveOrUpdateBatch(detectionInfos);
}
}
public IdxBizJgInspectionDetectionInfo getDetectionInfoDetail(String sequenceNbr) {
return detectionInfoService.getById(sequenceNbr);
}
public void exportSummaryBasicInfo(String sequenceNbr, HttpServletResponse response, String category) {
//长输/公共管道汇总
if ("8200".equals(category) || "8100".equals(category)) {
// 总数
double total;
// 每页显示条数,默认 10
int size = 10;
IdxBizJgProjectContraption idxBizJgProjectContraption = baseMapper.selectById(sequenceNbr);
if (ValidationUtil.isEmpty(idxBizJgProjectContraption)) {
throw new BadRequest("没有查询到汇总信息!");
}
List<Map<String, Object>> allEquipment = baseMapper.selectEquipList(sequenceNbr);
total = allEquipment.size();
AgencyUserModel result = new AgencyUserModel();
if (!ValidationUtil.isEmpty(idxBizJgProjectContraption.getRecUserId())) {
result = Privilege.agencyUserClient.queryByUserId(idxBizJgProjectContraption.getRecUserId()).getResult();
}
// 模板
String wordPath = "PressurePipeBasicInformationSummary.ftl";
// 文件名前缀
String filePrefix = "压力管道基本信息汇总表_";
// 压力包名称
String customFileName = filePrefix + idxBizJgProjectContraption.getProjectContraptionNo() + ".zip";
// 总页数
int page = (int) Math.ceil(total / size);
// 异步获取数据
List<CompletableFuture<byte[]>> futures = pressurePipeDataPreparation(page, idxBizJgProjectContraption, size, total, allEquipment, wordPath, filePrefix, result,category);
// byte[]压缩zip
toZipFile(response, futures, filePrefix, customFileName);
}
}
/**
* 压力管道数据
*
* @return
*/
private List<CompletableFuture<byte[]>> pressurePipeDataPreparation(int page, IdxBizJgProjectContraption idxBizJgProjectContraption, int size, double total, List<Map<String, Object>> equipmentLists, String wordPath, String filePrefix, AgencyUserModel result,String category) {
Map<String, Object> exportParamsMap = new HashMap<>();
exportParamsMap.put("page", page);
LocalDate currentDate = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDate = currentDate.format(formatter);
exportParamsMap.put("printDate", formattedDate);
//获取分类名称
exportParamsMap.put("categoryName", PipelineEnum.getMessage(category));
// 使用单位
exportParamsMap.put("useUnitName", idxBizJgProjectContraption.getUseUnitName());
// 使用单位地址
String useUnitCreditCode = String.valueOf(idxBizJgProjectContraption.getUseUnitCreditCode());
TzBaseEnterpriseInfo enterpriseInfo = tzBaseEnterpriseInfoMapper.selectOne(new LambdaQueryWrapper<TzBaseEnterpriseInfo>().eq(TzBaseEnterpriseInfo::getUseCode, useUnitCreditCode));
exportParamsMap.put("fullAddress", enterpriseInfo.getAddress());
exportParamsMap.put("nameOfProjectDevice", idxBizJgProjectContraption.getProjectContraption());
// 安全管理部门
exportParamsMap.put("orgBranchName", "");
// 安全管理员
exportParamsMap.put("safetyManager", "");
// 联系电话
exportParamsMap.put("phone", ValidationUtil.isEmpty(result.getMobile()) ? "" : result.getMobile());
// 经办人
exportParamsMap.put("agent", ValidationUtil.isEmpty(result.getRealName()) ? "" : result.getRealName());
// 电子邮箱
exportParamsMap.put("email", ValidationUtil.isEmpty(result.getEmail()) ? "" : result.getEmail());
List<CompletableFuture<byte[]>> futures = IntStream.rangeClosed(1, page)
.mapToObj(current -> CompletableFuture.supplyAsync(() -> {
// 创建独立的参数副本
Map<String, Object> currentExportParamsMap = new HashMap<>(exportParamsMap);
currentExportParamsMap.put("current", current);
// 数据分页
int start = (current - 1) * size;
int end = ((current - 1) * size + size) < total ? (current - 1) * size + size : (int) total;
// 数据截取
List<Map<String, Object>> equData = equipmentLists.subList(start, end);
// 设备数据填充
this.pressurePipeEquData(currentExportParamsMap, equData, current, size);
return commonService.generateSummaryOfCylinderInfo(currentExportParamsMap, wordPath, filePrefix);
})).collect(Collectors.toList());
CompletableFuture.allOf(futures.toArray(new CompletableFuture[page])).join();
return futures;
}
/**
* 压力管道设备数据填充
*/
public void pressurePipeEquData(Map<String, Object> exportParamsMap, List<Map<String, Object>> equData, int current, int size) {
String[] fieldNames = {"pipeName", "pipelineNumber", "deviceLevel", "designUnitName", "uscUnitName",
"uscDate", "useDate", "nominalDiameter", "wallThickness", "pipeLength", "pressure", "temperature",
"medium", "inspectConclusion", "inspectOrgName", "nextInspectDate", "remarks"};
// 填充有效数据
for (int curr = 0; curr < equData.size(); curr++) {
Map<String, Object> map = equData.get(curr);
int serialNum = curr + 1;
for (String fieldName : fieldNames) {
exportParamsMap.put("num" + serialNum, (current - 1) * size + (curr + 1));
exportParamsMap.put(fieldName + serialNum, setSpecialParamFields(fieldName, map));
}
}
// 填充剩余空白项至指定总页数
for (int curr = equData.size(); curr < size; curr++) {
int serialNum = curr + 1;
for (String fieldName : fieldNames) {
exportParamsMap.put("num" + serialNum, "");
exportParamsMap.put(fieldName + serialNum, ""); // 使用空字符串填充空白项
}
}
}
private Object trimIfEmpty(Object obj) {
return ValidationUtil.isEmpty(obj) ? "" : obj;
}
private Object setSpecialParamFields(String fieldName, Map<String, Object> equip){
switch (fieldName) {
case "pressure":
return trimIfEmpty(equip.get(fieldName)) + "/" + trimIfEmpty(equip.get("workPressure"));
case "temperature":
return trimIfEmpty(equip.get(fieldName)) + "/" + trimIfEmpty(equip.get("workTemperature"));
case "medium":
return trimIfEmpty(equip.get(fieldName)) + "/" + trimIfEmpty(equip.get("workMedium"));
default:
return ValidationUtil.isEmpty(equip.get(fieldName)) ? "" : equip.get(fieldName);
}
}
private static void toZipFile(HttpServletResponse response, List<CompletableFuture<byte[]>> futures, String filePrefix, String customFileName) {
// 打包zip
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ZipOutputStream zip = new ZipOutputStream(outputStream)) {
for (int i = 0; i < futures.size(); i++) {
try {
zip.putNextEntry(new ZipEntry(filePrefix + "第" + (i + 1) + "页" + ".pdf"));
IOUtils.write(futures.get(i).join(), zip);
zip.closeEntry(); // 每个条目结束后关闭
} catch (IOException e) {
log.error("打包zip失败:" + e.getMessage());
throw new BadRequest("打包zip失败");
}
}
// 所有条目写入完成后关闭 ZipOutputStream
zip.finish();
// 设置响应头并将压缩文件写入 HttpServletResponse
response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "application/zip");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(customFileName, "UTF-8"));
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
IOUtils.write(outputStream.toByteArray(), response.getOutputStream());
} catch (IOException e) {
throw new RuntimeException("导出异常:", e);
}
}
} }
\ No newline at end of file
...@@ -2434,6 +2434,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2434,6 +2434,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDate = currentDate.format(formatter); String formattedDate = currentDate.format(formatter);
exportParamsMap.put("printDate", formattedDate); exportParamsMap.put("printDate", formattedDate);
//获取分类名称
exportParamsMap.put("categoryName", "工业管道");
// 使用单位 // 使用单位
exportParamsMap.put("useUnitName", jsonObject.get("useUnitName")); exportParamsMap.put("useUnitName", jsonObject.get("useUnitName"));
// 使用单位地址 // 使用单位地址
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<w:sz w:val="36"/> <w:sz w:val="36"/>
<w:szCs w:val="36"/> <w:szCs w:val="36"/>
</w:rPr> </w:rPr>
<w:t>工业管道</w:t> <w:t>${categoryName}</w:t>
</w:r> </w:r>
</w:p> </w:p>
<w:p w14:paraId="7AEDB7EF" w14:textId="156F0207" w:rsidR="00EA7A71" w:rsidRDefault="00DB6291"> <w:p w14:paraId="7AEDB7EF" w14:textId="156F0207" w:rsidR="00EA7A71" w:rsidRDefault="00DB6291">
......
...@@ -36,4 +36,20 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro ...@@ -36,4 +36,20 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro
Integer countContraptionInUseTimesForDelete(@Param("projectContraptionId") Long projectContraptionId); Integer countContraptionInUseTimesForDelete(@Param("projectContraptionId") Long projectContraptionId);
List<IdxBizJgProjectContraption> selectErrorManagementProject(); List<IdxBizJgProjectContraption> selectErrorManagementProject();
/**
* 获取管道信息分页
* @param sequenceNbr
* @param current
* @param size
* @return
*/
List<Map<String, Object>> selectEquipListPage(@Param("sequenceNbr") String sequenceNbr, @Param("current") int current, @Param("size") int size);
/**
* 获取管道信息总数
* @param sequenceNbr
* @return
*/
long selectEquipCount(@Param("sequenceNbr") String sequenceNbr);
} }
...@@ -141,4 +141,45 @@ ...@@ -141,4 +141,45 @@
and p.is_into_management = false and p.is_into_management = false
and n.is_delete = false and n.is_delete = false
</select> </select>
<select id="selectEquipListPage" resultType="java.util.Map">
SELECT ibjtpp."SEQUENCE_NBR" AS sequenceNbr,
ibjtpp."PIPE_NAME" AS pipeName,
ibjtpp."PIPELINE_NUMBER" AS pipelineNumber,
ibjtpp."DEVICE_LEVEL" AS deviceLevel,
ibjtpp."NOMINAL_DIAMETER" AS nominalDiameter,
ibjtpp."WALL_THICKNESS" AS wallThickness,
ibjtpp."PIPE_LENGTH" AS pipeLength,
ibjtpp."PRESSURE" AS pressure,
ibjtpp."TEMPERATURE" AS temperature,
ibjtpp."MEDIUM" AS medium,
ibjtpp."WORK_PRESSURE" AS workPressure,
ibjtpp."WORK_TEMPERATURE" AS workTemperature,
ibjtpp."WORK_MEDIUM" AS workMedium,
ibjtpp."REMARKS" AS remarks,
(select SEQUENCE_NBR from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) detectionInfoSequenceNbr,
(select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectOrgName,
(select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectConclusion,
(select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) nextInspectDate,
(select USC_UNIT_NAME from idx_biz_jg_construction_info jci where ibjui.RECORD = jci.RECORD ORDER BY jci."USC_DATE" DESC limit 1) as uscUnitName,
(select USC_DATE from idx_biz_jg_construction_info jci where ibjui.RECORD = jci.RECORD ORDER BY jci."USC_DATE" DESC limit 1) as uscDate,
ibjdi."DESIGN_UNIT_NAME" AS designUnitName,
ibjui."USE_DATE" AS useDate,
ibjui."RECORD" AS record
FROM idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_tech_params_pipeline ibjtpp ON ibjui.RECORD = ibjtpp.RECORD
LEFT JOIN idx_biz_jg_design_info ibjdi ON ibjui.RECORD = ibjdi.RECORD
WHERE ibjui.project_contraption_id = #{sequenceNbr}
ORDER BY ibjtpp.REC_DATE ASC
limit #{current},#{size}
</select>
<select id="selectEquipCount" resultType="long">
SELECT count(1)
FROM idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_tech_params_pipeline ibjtpp ON ibjui.RECORD = ibjtpp.RECORD
LEFT JOIN idx_biz_jg_design_info ibjdi ON ibjui.RECORD = ibjdi.RECORD
WHERE ibjui.project_contraption_id = #{sequenceNbr}
ORDER BY ibjtpp.REC_DATE ASC
</select>
</mapper> </mapper>
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