|
@@ -0,0 +1,105 @@
|
|
|
|
|
+package cn.start.tz.module.pressure2.controller.appapi.orderreport;
|
|
|
|
|
+
|
|
|
|
|
+import cn.start.tz.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
|
|
+import cn.start.tz.framework.common.pojo.CommonResult;
|
|
|
|
|
+import cn.start.tz.framework.common.pojo.PageParam;
|
|
|
|
|
+import cn.start.tz.framework.common.pojo.PageResult;
|
|
|
|
|
+import cn.start.tz.framework.common.util.object.BeanUtils;
|
|
|
|
|
+import cn.start.tz.framework.excel.core.util.ExcelUtils;
|
|
|
|
|
+import cn.start.tz.module.pressure2.controller.admin.orderreport.vo.OrderReportPageReqVO;
|
|
|
|
|
+import cn.start.tz.module.pressure2.controller.admin.orderreport.vo.OrderReportRespVO;
|
|
|
|
|
+import cn.start.tz.module.pressure2.controller.admin.orderreport.vo.OrderReportSaveReqVO;
|
|
|
|
|
+import cn.start.tz.module.pressure2.dal.dataobject.orderreport.OrderReportDO;
|
|
|
|
|
+import cn.start.tz.module.pressure2.service.orderreport.OrderReportService;
|
|
|
|
|
+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 org.springframework.validation.annotation.Validated;
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+
|
|
|
|
|
+import java.io.IOException;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+import static cn.start.tz.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
|
|
|
+import static cn.start.tz.framework.common.pojo.CommonResult.success;
|
|
|
|
|
+
|
|
|
|
|
+@Tag(name = "管理后台 - 受理单任务单关联报告")
|
|
|
|
|
+@RestController
|
|
|
|
|
+@RequestMapping("/pressure2/order-report")
|
|
|
|
|
+@Validated
|
|
|
|
|
+public class AppApiOrderReportController {
|
|
|
|
|
+
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private OrderReportService orderReportService;
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("/create")
|
|
|
|
|
+ @Operation(summary = "创建受理单任务单关联报告")
|
|
|
|
|
+ //@PreAuthorize("@ss.hasPermission('pressure2:order-report:create')")
|
|
|
|
|
+ public CommonResult<String> createOrderReport(@Valid @RequestBody OrderReportSaveReqVO createReqVO) {
|
|
|
|
|
+ return success(orderReportService.createOrderReport(createReqVO));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @PutMapping("/update")
|
|
|
|
|
+ @Operation(summary = "更新受理单任务单关联报告")
|
|
|
|
|
+ //@PreAuthorize("@ss.hasPermission('pressure2:order-report:update')")
|
|
|
|
|
+ public CommonResult<Boolean> updateOrderReport(@Valid @RequestBody OrderReportSaveReqVO updateReqVO) {
|
|
|
|
|
+ orderReportService.updateOrderReport(updateReqVO);
|
|
|
|
|
+ return success(true);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @DeleteMapping("/delete")
|
|
|
|
|
+ @Operation(summary = "删除受理单任务单关联报告")
|
|
|
|
|
+ @Parameter(name = "id", description = "编号", required = true)
|
|
|
|
|
+ //@PreAuthorize("@ss.hasPermission('pressure2:order-report:delete')")
|
|
|
|
|
+ public CommonResult<Boolean> deleteOrderReport(@RequestParam("id") String id) {
|
|
|
|
|
+ orderReportService.deleteOrderReport(id);
|
|
|
|
|
+ return success(true);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/get")
|
|
|
|
|
+ @Operation(summary = "获得受理单任务单关联报告")
|
|
|
|
|
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
|
|
+ //@PreAuthorize("@ss.hasPermission('pressure2:order-report:query')")
|
|
|
|
|
+ public CommonResult<OrderReportRespVO> getOrderReport(@RequestParam("id") String id) {
|
|
|
|
|
+ OrderReportDO orderReport = orderReportService.getOrderReport(id);
|
|
|
|
|
+ return success(BeanUtils.toBean(orderReport, OrderReportRespVO.class));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/page")
|
|
|
|
|
+ @Operation(summary = "获得受理单任务单关联报告分页")
|
|
|
|
|
+ //@PreAuthorize("@ss.hasPermission('pressure2:order-report:query')")
|
|
|
|
|
+ public CommonResult<PageResult<OrderReportRespVO>> getOrderReportPage(@Valid OrderReportPageReqVO pageReqVO) {
|
|
|
|
|
+ PageResult<OrderReportDO> pageResult = orderReportService.getOrderReportPage(pageReqVO);
|
|
|
|
|
+ return success(BeanUtils.toBean(pageResult, OrderReportRespVO.class));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/export-excel")
|
|
|
|
|
+ @Operation(summary = "导出受理单任务单关联报告 Excel")
|
|
|
|
|
+ //@PreAuthorize("@ss.hasPermission('pressure2:order-report:export')")
|
|
|
|
|
+ @ApiAccessLog(operateType = EXPORT)
|
|
|
|
|
+ public void exportOrderReportExcel(@Valid OrderReportPageReqVO pageReqVO,
|
|
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
|
|
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
|
+ List<OrderReportDO> list = orderReportService.getOrderReportPage(pageReqVO).getList();
|
|
|
|
|
+ // 导出 Excel
|
|
|
|
|
+ ExcelUtils.write(response, "受理单任务单关联报告.xls", "数据", OrderReportRespVO.class,
|
|
|
|
|
+ BeanUtils.toBean(list, OrderReportRespVO.class));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/generateBoilerOrderReport/{acceptOrderId}")
|
|
|
|
|
+ @Operation(summary = "生成锅炉报告")
|
|
|
|
|
+ public CommonResult<Boolean> generateBoilerOrderReport(@PathVariable String acceptOrderId) {
|
|
|
|
|
+ orderReportService.generateBoilerOrderReport(acceptOrderId);
|
|
|
|
|
+ return success(true);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/generatePipeOrderReport/{acceptOrderId}")
|
|
|
|
|
+ @Operation(summary = "生成管道报告")
|
|
|
|
|
+ public CommonResult<Boolean> generatePipeOrderReport(@PathVariable String acceptOrderId) {
|
|
|
|
|
+ orderReportService.generatePipeOrderReport(acceptOrderId);
|
|
|
|
|
+ return success(true);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|