Browse Source

按钮状态bug

liuyc 2 năm trước cách đây
mục cha
commit
29acc8010a

+ 64 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -540,7 +540,7 @@ public class InformationWriteQueryController extends BladeController {
      */
     @PostMapping("/queryNodeStatus")
     @ApiOperationSupport(order = 23)
-    @ApiOperation(value = "/查询节点状态")
+    @ApiOperation(value = "/查询节点状态-施工")
     public R<String> queryNodeStatus(@RequestParam String primaryKeyId, @RequestParam String classify) {
         //记录状态
         String status = "1";
@@ -598,7 +598,69 @@ public class InformationWriteQueryController extends BladeController {
     }
 
     /**
-     * 查询节点状态
+     * 查询节点状态-监理
+     */
+    @PostMapping("/queryNodeStatus-jl")
+    @ApiOperationSupport(order = 23)
+    @ApiOperation(value = "/查询节点状态-监理")
+    public R<String> queryNodeStatusJl(@RequestParam String primaryKeyId, @RequestParam String classify) {
+        //记录状态
+        String status = "1";
+        //查询填报状态,type=1资料填报
+        InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 1));
+        if (businessData != null) {
+            switch (businessData.getStatus()) {
+                case 0:
+                case 3:
+                    //0属于未上报,3属于已废除,统一为待上报
+                    status = "2";
+                    break;
+                case 1:
+                case 2:
+                    //1属于待审批,2属于已审批,统一为已上报
+                    status = "3";
+                    break;
+                default:
+                    //如果不匹配,默认为未填报
+                    status = "1";
+                    //查询表格
+                    WbsTreeContract obj = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
+                    if (ObjectUtils.isNotEmpty(obj)) {
+                        List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(obj, "queryTable", classify);
+                        if (tableList != null && tableList.size() > 0) {
+                            for (WbsTreeContract table : tableList) {
+                                if (new Integer("2").equals(table.getIsTabPdf())) {
+                                    //这些表格中,但凡有一个能够预览,就开放预览
+                                    status = "2";
+                                    break;
+                                }
+                            }
+                        }
+                        break;
+                    }
+            }
+        } else {
+            //查询表格
+            WbsTreeContract obj = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
+            if (ObjectUtils.isNotEmpty(obj)) {
+                List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(obj, "queryTable", classify);
+                if (tableList != null && tableList.size() > 0) {
+                    for (WbsTreeContract table : tableList) {
+                        if (new Integer("2").equals(table.getIsTabPdf())) {
+                            //这些表格中,但凡有一个能够预览,就开放预览
+                            status = "2";
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+
+        return R.data(status);
+    }
+
+    /**
+     * 查询节点状态-首件
      */
     @PostMapping("/queryNodeStatus-sj")
     @ApiOperationSupport(order = 23)