Sfoglia il codice sorgente

app,增加reporttemplaate接口;设备列表增加安全管理员、安全管理员电话字段;

yangguanjin 3 giorni fa
parent
commit
9ea8ae8d54

+ 6 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/controller/admin/boilertaskorder/vo/BoilerOrderItemPageRespVO.java

@@ -31,6 +31,12 @@ public class BoilerOrderItemPageRespVO {
     @Schema(description = "单位地址")
     private String unitAddress;
 
+    @Schema(description = "安全管理人员")
+    private String safery;
+
+    @Schema(description = "安全管理人员电话")
+    private String saferydh;
+
     @Schema(description = "检验性质", example = "2")
     private Integer checkType;
 

+ 4 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/controller/admin/pipetaskorder/vo/PipeOrderItemPageRespVO.java

@@ -413,4 +413,8 @@ public class PipeOrderItemPageRespVO {
     private String approvalId;
 
     private String ratifyId;
+
+    private String securityMan;
+
+    private String securityManPhone;
 }

+ 223 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/controller/appapi/reporttemplate/AppapiReportTemplateController.java

@@ -0,0 +1,223 @@
+package cn.start.tz.module.pressure2.controller.appapi.reporttemplate;
+
+import cn.start.tz.framework.common.pojo.CommonResult;
+import cn.start.tz.framework.common.pojo.PageResult;
+import cn.start.tz.module.pressure2.controller.admin.reporttemplate.vo.*;
+import cn.start.tz.module.pressure2.dal.dataobject.dynamictb.DynamicTbDO;
+import cn.start.tz.module.pressure2.service.reporttemplate.ReportTemplateService;
+import cn.start.tz.module.system.api.template.TemplateInitDataApi;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.Valid;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+import static cn.start.tz.framework.common.pojo.CommonResult.success;
+
+@Slf4j
+@Tag(name = "管理后台 - 承压报告模版")
+@RestController
+@RequestMapping("/pressure2/report-template")
+@Validated
+public class AppapiReportTemplateController {
+
+    @Resource
+    private ReportTemplateService reportTemplateService;
+
+    @Resource
+    private TemplateInitDataApi templateInitDataApi;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建承压报告模版")
+    //@PreAuthorize("@ss.hasPermission('pressure:report-template:create')")
+    public CommonResult<String> createReportTemplate(@Valid @RequestBody ReportTemplateSaveReqVO createReqVO) {
+        return success(reportTemplateService.createReportTemplate(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新承压报告模版")
+    //@PreAuthorize("@ss.hasPermission('pressure:report-template:update')")
+    public CommonResult<Boolean> updateReportTemplate(@Valid @RequestBody ReportTemplateSaveReqVO updateReqVO) {
+        reportTemplateService.updateReportTemplate(updateReqVO);
+        return success(true);
+    }
+
+    @PutMapping("/update-status")
+    @Operation(summary = "更新承压报告模版状态")
+    //@PreAuthorize("@ss.hasPermission('pressure:report-template:update')")
+    public CommonResult<Boolean> updateReportTemplateStatus(@Valid @RequestBody ReportTemplateUpdateReqVO updateReqVO) {
+        reportTemplateService.updateReportTemplateStatus(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除承压报告模版")
+    @Parameter(name = "id", description = "编号", required = true)
+    //@PreAuthorize("@ss.hasPermission('pressure:report-template:delete')")
+    public CommonResult<Boolean> deleteReportTemplate(@RequestParam("id") String id) {
+        reportTemplateService.deleteReportTemplate(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得承压报告模版")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    //@PreAuthorize("@ss.hasPermission('pressure:report-template:query')")
+    public CommonResult<ReportTemplateDetailRespVO> getReportTemplate(@RequestParam("id") String id) {
+        ReportTemplateDetailRespVO detailRespVO = reportTemplateService.getReportTemplateDetail(id);
+        return success(detailRespVO);
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得承压报告模版分页")
+    //@PreAuthorize("@ss.hasPermission('pressure:report-template:query')")
+    public CommonResult<PageResult<ReportTemplateRespVO>> getReportTemplatePage(@Valid ReportTemplatePageReqVO pageReqVO) {
+        PageResult<ReportTemplateRespVO> pageResult = reportTemplateService.getPage(pageReqVO);
+        return success(pageResult);
+    }
+
+    @GetMapping("/audit/page")
+    @Operation(summary = "获得承压报告模版审核列表分页")
+    //@PreAuthorize("@ss.hasPermission('pressure:report-template:query')")
+    public CommonResult<PageResult<ReportTemplateRespVO>> getReportTemplateAuditPage(@Valid ReportTemplatePageReqVO pageReqVO) {
+        PageResult<ReportTemplateRespVO> pageResult = reportTemplateService.getAuditPage(pageReqVO);
+        return success(pageResult);
+    }
+
+    @GetMapping("/notVerifyPage")
+    @Operation(summary = "获得承压报告模版分页(不校验菜单权限)")
+    public CommonResult<List<DynamicTbDO>> notReportTemplateVerifyPage(@Valid ReportTemplatePageReqVO pageReqVO) {
+        List<DynamicTbDO> list = reportTemplateService.getReportTemplatePage(pageReqVO);
+        return success(list);
+    }
+
+//    @GetMapping("/export-excel")
+//    @Operation(summary = "导出承压报告模版 Excel")
+//    //@PreAuthorize("@ss.hasPermission('pressure:report-template:export')")
+//    @ApiAccessLog(operateType = EXPORT)
+//    public void exportReportTemplateExcel(@Valid ReportTemplatePageReqVO pageReqVO,
+//                                          HttpServletResponse response) throws IOException {
+//        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+//        List<ReportTemplateRespVO> list = reportTemplateService.getReportTemplatePage(pageReqVO).getList();
+//        // 导出 Excel
+//        ExcelUtils.write(response, "承压报告模版.xls", "数据", ReportTemplateRespVO.class,
+//                BeanUtils.toBean(list, ReportTemplateRespVO.class));
+//    }
+
+//    @GetMapping("/reportPreview")
+//    @Operation(summary = "承压报告xlsx预览测试接口 type 默认100 100报告记录 200报告结论 300 报告模板 400 金额计算&关联关系, fileType 默认100 xlsx ,200 pdf")
+//    public void reportPreview(HttpServletResponse response, @RequestParam(name = "templateId") String templateId,
+//                              @RequestParam(name = "equipCode") String equipCode,
+//                              @RequestParam(name = "type", defaultValue = "100") Integer type,
+//                              @RequestParam(name = "fileType", defaultValue = "100") Integer fileType,
+//                              @RequestParam(name = "reportId", required = false) String reportId
+//
+//    ) throws Exception {
+//        try (ByteArrayOutputStream outputStream = reportTemplateService.getRecordOutputStream(templateId, equipCode, type, fileType, reportId)) {
+//            ServletOutputStream responseOutputStream = response.getOutputStream();
+//            outputStream.writeTo(responseOutputStream);
+//        } catch (Exception e) {
+//            // 5. 错误处理
+//            response.reset();
+//            response.setContentType("application/json");
+//            response.setCharacterEncoding("UTF-8");
+//            response.getWriter().write("{\"error\":\"文件生成失败: " + e.getMessage() + "\"}");
+//        }
+//    }
+//
+//
+//    @PostMapping("/reportPreview")
+//    @Operation(summary = "承压报告xlsx预览测试接口 type 默认100 100报告记录 200报告结论 300 报告模板 400 金额计算&关联关系, fileType 默认100 xlsx ,200 pdf")
+//    public void reportPreviewPost(HttpServletResponse response, @RequestBody ReportPreviewVO reportPreviewVO) throws Exception {
+//        try (ByteArrayOutputStream outputStream = reportTemplateService.getRecordOutputStreamMerge(reportPreviewVO)) {
+//            ServletOutputStream responseOutputStream = response.getOutputStream();
+//            outputStream.writeTo(responseOutputStream);
+//        } catch (Exception e) {
+//            log.error("reportPreview error",e);
+//            // 5. 错误处理
+//            response.reset();
+//            response.setContentType("application/json");
+//            response.setCharacterEncoding("UTF-8");
+//            response.getWriter().write("{\"error\":\"文件生成失败: " + e.getMessage() + "\"}");
+//        }
+//    }
+
+//    @PutMapping("/updateBindingPathNameJson")
+//    @Operation(summary = "更新绑定数据json字符串带注释")
+//    //@PreAuthorize("@ss.hasPermission('pressure:report-template:update')")
+//    public CommonResult<Boolean> updateBindingPathNameJson(@Valid @RequestBody ReportTemplateSaveReqVO updateReqVO) {
+//        reportTemplateService.updateBindingPathNameJson(updateReqVO);
+//        return success(true);
+//    }
+
+
+    @GetMapping("/report/json")
+    @Operation(summary = "获得承压报告json")
+    public CommonResult<String> getReportJson(@RequestParam(name = "type", defaultValue = "100") Integer type,
+                                              @RequestParam(name = "fileType", defaultValue = "100") Integer fileType,
+                                              @RequestParam(name = "reportId", required = true) String reportId) throws Exception {
+        return CommonResult.success(reportTemplateService.getReportJson(reportId, type, fileType));
+    }
+
+
+//    @PutMapping("/initiateApproval")
+//    @Operation(summary = "发起审批")
+//    public CommonResult<Boolean> reportTemplateInitiateApproval(@RequestBody ReportTemplateSubmitVO reportTemplateSubmitVO) {
+//        Boolean result = reportTemplateService.initiateApproval(reportTemplateSubmitVO);
+//        return success(result);
+//    }
+
+//    @PostMapping("/approve")
+//    @Operation(summary = "审批通过")
+//    public CommonResult<Boolean> reportTemplateApprove(@RequestBody ReportTemplateAuditVO reportTemplateAuditVO) {
+//        reportTemplateService.approve(reportTemplateAuditVO);
+//        return success(true);
+//    }
+
+//    @PostMapping("/reject")
+//    @Operation(summary = "审批拒绝")
+//    public CommonResult<Boolean> reportTemplateReject(@RequestBody ReportTemplateAuditVO reportTemplateAuditVO) {
+//        reportTemplateService.reject(reportTemplateAuditVO);
+//        return success(true);
+//    }
+
+
+//    @GetMapping("/circulationRecord")
+//    @Operation(summary = "流转列表")
+//    public CommonResult<List<BpmTaskRespVO>> reportTemplateCirculationRecord(
+//            @RequestParam(name = "id") String id) {
+//        List<BpmTaskRespVO> pageResult = reportTemplateService.circulationRecord(id);
+//        return success(pageResult);
+//    }
+
+//    @PostMapping("/mock/preview")
+//    @Operation(summary = "预览")
+//    public void reportTemplateMockPreview(HttpServletResponse response, @RequestBody ReportMockPreviewVO reportPreviewVO) throws IOException {
+//        try (ByteArrayOutputStream outputStream = reportTemplateService.reportTemplateMockPreview(reportPreviewVO)) {
+//            ServletOutputStream responseOutputStream = response.getOutputStream();
+//            outputStream.writeTo(responseOutputStream);
+//        } catch (Exception e) {
+//            // 5. 错误处理
+//            response.reset();
+//            response.setContentType("application/json");
+//            response.setCharacterEncoding("UTF-8");
+//            response.getWriter().write("\"error\":\"文件生成失败: " + e.getMessage() + "\"");
+//        }
+//    }
+
+    // json
+    @PostMapping("/mock/json")
+    @Operation(summary = "预览")
+    public CommonResult<String> reportTemplateMockJson(HttpServletResponse response,
+                                                       @RequestBody ReportMockPreviewVO reportPreviewVO) {
+        String json = reportTemplateService.reportTemplateMockJson(reportPreviewVO);
+        return success(json);
+    }
+
+}

+ 2 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/resources/mapper/boilertaskorder/BoilerTaskOrderMapper.xml

@@ -216,6 +216,8 @@
         ,eb.EQUIP_NAME
         ,eb.BOILER_MODEL
         ,eb.UNIT_NAME
+        ,eb.SAFERY
+        ,eb.SAFERYDH
         ,bto.CHECK_TYPE
         ,bto.DEPT_ID
         ,btoir.TASK_STATUS

+ 2 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/resources/mapper/pipetaskorder/PipeTaskOrderMapper.xml

@@ -169,6 +169,8 @@
             ,tt.END_CHECK_DATE
             ,bto.CREATE_TIME
             ,epp.ID AS EQUIP_ID
+            ,epp.USE_UNIT_SECURITY_MAN as SECURITY_MAN
+            ,epp.USE_UNIT_SECURITY_MAN_PHONE AS SECURITY_MAN_PHONE
             -- 去重后聚合
             ,WM_CONCAT(epp.PROJECT_NO) as PROJECT_NO
             -- 设备任务