xy vor 2 Tagen
Ursprung
Commit
247e54b48c

+ 7 - 6
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/controller/admin/notificationformreport/NotificationformReportController.java

@@ -40,14 +40,12 @@ public class NotificationformReportController {
 
     @PostMapping("/create")
     @Operation(summary = "创建检验情况告知")
-    @PreAuthorize("@ss.hasPermission('pressure2:notificationform-report:create')")
     public CommonResult<String> createNotificationformReport(@Valid @RequestBody NotificationformReportSaveReqVO createReqVO) {
         return success(notificationformReportService.createNotificationformReport(createReqVO));
     }
 
     @PutMapping("/update")
     @Operation(summary = "更新检验情况告知")
-    @PreAuthorize("@ss.hasPermission('pressure2:notificationform-report:update')")
     public CommonResult<Boolean> updateNotificationformReport(@Valid @RequestBody NotificationformReportSaveReqVO updateReqVO) {
         notificationformReportService.updateNotificationformReport(updateReqVO);
         return success(true);
@@ -56,7 +54,6 @@ public class NotificationformReportController {
     @DeleteMapping("/delete")
     @Operation(summary = "删除检验情况告知")
     @Parameter(name = "id", description = "编号", required = true)
-    @PreAuthorize("@ss.hasPermission('pressure2:notificationform-report:delete')")
     public CommonResult<Boolean> deleteNotificationformReport(@RequestParam("id") String id) {
         notificationformReportService.deleteNotificationformReport(id);
         return success(true);
@@ -65,7 +62,6 @@ public class NotificationformReportController {
     @GetMapping("/get")
     @Operation(summary = "获得检验情况告知")
     @Parameter(name = "id", description = "编号", required = true, example = "1024")
-    @PreAuthorize("@ss.hasPermission('pressure2:notificationform-report:query')")
     public CommonResult<NotificationformReportRespVO> getNotificationformReport(@RequestParam("id") String id) {
         NotificationformReportDO notificationformReport = notificationformReportService.getNotificationformReport(id);
         return success(BeanUtils.toBean(notificationformReport, NotificationformReportRespVO.class));
@@ -73,7 +69,6 @@ public class NotificationformReportController {
 
     @GetMapping("/page")
     @Operation(summary = "获得检验情况告知分页")
-    @PreAuthorize("@ss.hasPermission('pressure2:notificationform-report:query')")
     public CommonResult<PageResult<NotificationformReportRespVO>> getNotificationformReportPage(@Valid NotificationformReportPageReqVO pageReqVO) {
         PageResult<NotificationformReportDO> pageResult = notificationformReportService.getNotificationformReportPage(pageReqVO);
         return success(BeanUtils.toBean(pageResult, NotificationformReportRespVO.class));
@@ -81,7 +76,6 @@ public class NotificationformReportController {
 
     @GetMapping("/export-excel")
     @Operation(summary = "导出检验情况告知 Excel")
-    @PreAuthorize("@ss.hasPermission('pressure2:notificationform-report:export')")
     @ApiAccessLog(operateType = EXPORT)
     public void exportNotificationformReportExcel(@Valid NotificationformReportPageReqVO pageReqVO,
               HttpServletResponse response) throws IOException {
@@ -92,4 +86,11 @@ public class NotificationformReportController {
                         BeanUtils.toBean(list, NotificationformReportRespVO.class));
     }
 
+    @GetMapping("/updateNotificationReport/{orderId}")
+    @Operation(summary = "更新检验情况报告")
+    public CommonResult<Boolean> updateNotificationReport(@PathVariable String orderId) {
+        notificationformReportService.updateNotificationReport(orderId);
+        return success(true);
+    }
+
 }

+ 4 - 4
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/dynamicOFData/comm/QC01012_202500OFData.java

@@ -201,7 +201,7 @@ public class QC01012_202500OFData implements IDynamicOFData {
 
                             //是否有检验意见通知书
                             List<BoilerTaskOrderItemReportDO> itemReportDOS = boilerTaskOrderItemReportMapper.selectList(new LambdaQueryWrapper<BoilerTaskOrderItemReportDO>()
-                                    .eq(BoilerTaskOrderItemReportDO::getOrderId, itemDO.getId())
+                                    .eq(BoilerTaskOrderItemReportDO::getOrderId, itemDO.getOrderId())
                                     .eq(BoilerTaskOrderItemReportDO::getReportType, TaskOrderItemReportTypeEnum.NOTICE_OF_OPINION.getType())
                             );
                             if (!itemReportDOS.isEmpty()){
@@ -223,7 +223,7 @@ public class QC01012_202500OFData implements IDynamicOFData {
 
                     result.put("table",voList.toJSONString());
 
-                    long equipNum2 = itemDOS.stream().filter(itemDO -> itemDO.getTaskStatus() >= TaskOrderStatusEnum.FINISH_CONFIRM.getStatus()).count();
+                    long equipNum2 = itemDOS.stream().filter(itemDO -> itemDO.getTaskStatus() != null && itemDO.getTaskStatus() >= TaskOrderStatusEnum.FINISH_CONFIRM.getStatus()).count();
                     result.put("equipNum1",itemDOS.size()); //检验设备数量
                     result.put("equipNum2",equipNum2); //已检验设备数量
                     result.put("equipNum3",0); //中止检验设备
@@ -355,7 +355,7 @@ public class QC01012_202500OFData implements IDynamicOFData {
 
                             //是否有检验意见通知书
                             List<PipeTaskOrderItemReportDO> itemReportDOS = pipeTaskOrderItemReportMapper.selectList(new LambdaQueryWrapper<PipeTaskOrderItemReportDO>()
-                                    .eq(PipeTaskOrderItemReportDO::getOrderId, itemDO.getId())
+                                    .eq(PipeTaskOrderItemReportDO::getOrderId, itemDO.getOrderId())
                                     .eq(PipeTaskOrderItemReportDO::getReportType, TaskOrderItemReportTypeEnum.NOTICE_OF_OPINION.getType())
                             );
                             if (!itemReportDOS.isEmpty()){
@@ -377,7 +377,7 @@ public class QC01012_202500OFData implements IDynamicOFData {
 
                     result.put("table",voList.toJSONString());
 
-                    long equipNum2 = itemDOS.stream().filter(itemDO -> itemDO.getTaskStatus() >= TaskOrderStatusEnum.FINISH_CONFIRM.getStatus()).count();
+                    long equipNum2 = itemDOS.stream().filter(itemDO -> itemDO.getTaskStatus() != null && itemDO.getTaskStatus() >= TaskOrderStatusEnum.FINISH_CONFIRM.getStatus()).count();
                     result.put("equipNum1",itemDOS.size()); //检验设备数量
                     result.put("equipNum2",equipNum2); //已检验设备数量
                     result.put("equipNum3",0); //中止检验设备

+ 8 - 12
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/dynamicOFData/pipe/QR0424_202404ReportOFData.java

@@ -117,30 +117,26 @@ public class QR0424_202404ReportOFData implements IDynamicOFData {
 
         result.put("equipNums", String.valueOf(equipPipeDOS.size()));
 
-        JSONArray voList = new JSONArray();
         AtomicInteger number = new AtomicInteger(1);
         equipPipeDOS.forEach(equipPipeDO -> {
 
-            JSONObject vo = new JSONObject();
-            //序号
-            vo.put("value1",String.valueOf(number.getAndIncrement()));
-            vo.put("value2",equipPipeDO.getCertificateNo());
-            vo.put("value3",equipPipeDO.getProjectNo());
-            vo.put("value4",equipPipeDO.getProjectName());
-            vo.put("value5",equipPipeDO.getPipeClass());
+            result.put("value1_" + number.get(), String.valueOf(number.get()));
+            result.put("value2_" + number.get(), equipPipeDO.getCertificateNo());
+            result.put("value3_" + number.get(), equipPipeDO.getProjectNo());
+            result.put("value4_" + number.get(), equipPipeDO.getProjectName());
+            result.put("value5_" + number.get(), equipPipeDO.getPipeClass());
             if (taskOrderDO != null){
                 List<PipeTaskOrderItemReportDO> pipeTaskOrderItemReportDOS = pipeTaskOrderItemReportMapper.selectList(new LambdaQueryWrapperX<PipeTaskOrderItemReportDO>()
                         .eq(PipeTaskOrderItemReportDO::getOrderId, taskOrderDO.getId()));
                 if (!pipeTaskOrderItemReportDOS.isEmpty()){
                     List<String> reportNames = pipeTaskOrderItemReportDOS.stream().map(PipeTaskOrderItemReportDO::getReportName).toList();
-                    vo.put("value6",reportNames);
+                    result.put("value6_" + number.get(), reportNames);
                 }
             }
-            vo.put("value7","-");
-            voList.add(vo);
+            result.put("value7_" + number.get(), "-");
+            number.getAndIncrement();
 
         });
-        result.put("table",voList.toJSONString());
 
         if (taskOrderDO != null){
             String managerId = taskOrderDO.getManagerId();

+ 1 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/notificationformreport/NotificationformReportService.java

@@ -53,4 +53,5 @@ public interface NotificationformReportService extends IService<Notificationform
      */
     PageResult<NotificationformReportDO> getNotificationformReportPage(NotificationformReportPageReqVO pageReqVO);
 
+    void updateNotificationReport(String orderId);
 }

+ 54 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/notificationformreport/NotificationformReportServiceImpl.java

@@ -1,5 +1,12 @@
 package cn.start.tz.module.pressure2.service.notificationformreport;
 
+import cn.start.tz.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.start.tz.module.pressure2.controller.admin.dynamictbins.vo.CreateInstantiateWithRuleVO;
+import cn.start.tz.module.pressure2.dal.dataobject.boilerconnecttbservice.BoilerConnectTbServiceDO;
+import cn.start.tz.module.pressure2.dal.dataobject.boilertaskorder.BoilerTaskOrderDO;
+import cn.start.tz.module.pressure2.dal.mysql.boilerconnecttbservice.BoilerConnectTbServiceMapper;
+import cn.start.tz.module.pressure2.dal.mysql.boilertaskorder.BoilerTaskOrderMapper;
+import cn.start.tz.module.pressure2.service.dynamictbins.DynamicTbInsService;
 import org.springframework.stereotype.Service;
 import jakarta.annotation.Resource;
 import org.springframework.validation.annotation.Validated;
@@ -30,6 +37,15 @@ public class NotificationformReportServiceImpl extends ServiceImpl<Notificationf
     @Resource
     private NotificationformReportMapper notificationformReportMapper;
 
+    @Resource
+    private BoilerTaskOrderMapper taskOrderMapper;
+
+    @Resource
+    private BoilerConnectTbServiceMapper boilerConnectTbServiceMapper;
+
+    @Resource
+    private DynamicTbInsService dynamicTbInsService;
+
     @Override
     public String createNotificationformReport(NotificationformReportSaveReqVO createReqVO) {
         // 插入
@@ -72,4 +88,42 @@ public class NotificationformReportServiceImpl extends ServiceImpl<Notificationf
         return notificationformReportMapper.selectPage(pageReqVO);
     }
 
+    @Override
+    public void updateNotificationReport(String orderId) {
+
+        BoilerTaskOrderDO taskOrderDO = taskOrderMapper.selectById(orderId);
+        List<NotificationformReportDO> reportDOS = notificationformReportMapper.selectList(new LambdaQueryWrapperX<NotificationformReportDO>()
+                .eq(NotificationformReportDO::getTaskOrderId, orderId));
+        if (!reportDOS.isEmpty()){
+
+            NotificationformReportDO reportDO = reportDOS.get(0);
+            if (reportDO != null){
+                CreateInstantiateWithRuleVO ruleVO = new CreateInstantiateWithRuleVO();
+                ruleVO.setTemplateId(reportDO.getTemplateId());
+                ruleVO.setRefId(reportDO.getId());
+                ruleVO.setReportType(1);
+                com.alibaba.fastjson2.JSONObject params = new com.alibaba.fastjson2.JSONObject();
+                if (taskOrderDO != null){
+                    if (taskOrderDO.getEquipMainType() == 200){
+                        params.put("equipMainType","boiler");
+                    }else{
+                        params.put("equipMainType","pipe");
+                    }
+                }
+                ruleVO.setParams(params);
+                //获取tbCode的服务方法名
+                BoilerConnectTbServiceDO tbServiceDO = boilerConnectTbServiceMapper.selectOne(BoilerConnectTbServiceDO::getTbId,reportDO.getTemplateId());
+                if (tbServiceDO != null){
+                    ruleVO.setServiceName(tbServiceDO.getInitServiceName());
+                    dynamicTbInsService.createInstantiateWithRule(ruleVO);
+                }else{
+                    ruleVO.setServiceName("");
+                    dynamicTbInsService.createInstantiateWithRule(ruleVO);
+                }
+            }
+
+        }
+
+    }
+
 }