Browse Source

bug相关

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

+ 3 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/CopyContractTreeNodeVO.java

@@ -30,6 +30,9 @@ public class CopyContractTreeNodeVO {
     @ApiModelProperty("所属方,1=施工,2=监理,字符串拼接,复制数据")
     private String classify;
 
+    @ApiModelProperty("划分编号,单份复制")
+    private String partitionCode;
+
     public void setCopyBatchToPaths(String primaryKeyId, String nodeName, String partitionCode) {
         this.copyBatchToPaths.add(new CopyBatch(primaryKeyId, nodeName, partitionCode));
     }

+ 28 - 19
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import io.swagger.annotations.*;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@@ -561,27 +562,33 @@ public class InformationWriteQueryController extends BladeController {
                     //如果不匹配,默认为未填报
                     status = "1";
                     //查询表格
-                    List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId), "queryTable", classify);
-                    if (tableList != null && tableList.size() > 0) {
-                        for (WbsTreeContract table : tableList) {
-                            if (new Integer("2").equals(table.getIsTabPdf())) {
-                                //这些表格中,但凡有一个能够预览,就开放预览
-                                status = "2";
-                                break;
+                    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;
                     }
-                    break;
             }
         } else {
             //查询表格
-            List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId), "queryTable", classify);
-            if (tableList != null && tableList.size() > 0) {
-                for (WbsTreeContract table : tableList) {
-                    if (new Integer("2").equals(table.getIsTabPdf())) {
-                        //这些表格中,但凡有一个能够预览,就开放预览
-                        status = "2";
-                        break;
+            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;
+                        }
                     }
                 }
             }
@@ -1127,6 +1134,9 @@ public class InformationWriteQueryController extends BladeController {
                     if (new Integer("1").equals(node.getType())) {
                         //如果是节点类型才重塑ID
                         newData.setId(oldToNewIdMap.containsKey(node.getId()) ? oldToNewIdMap.get(node.getId()) : SnowFlakeUtil.getId());
+
+                        //划分编号
+                        newData.setPartitionCode(StringUtils.isNotEmpty(vo.getPartitionCode()) ? vo.getPartitionCode() : null);
                     }
                     //设置父节点ID
                     if (vo.getNeedCopyPrimaryKeyId().equals(node.getPKeyId().toString())) {
@@ -1149,8 +1159,6 @@ public class InformationWriteQueryController extends BladeController {
                     //初始化PDF路径
                     newData.setPdfUrl(null);
                     newData.setCreateUser(AuthUtil.getUserId());
-                    //划分编号
-                    newData.setPartitionCode(StringUtils.isNotEmpty(node.getPartitionCode()) ? node.getPartitionCode() : null);
 
                     //获取当前所有复制的节点的最大sort
                     String sql = "select sort from m_wbs_tree_contract where contract_id = '" + node.getContractId() + "' and (id = '" + node.getId() + "' or old_id = '" + node.getId() + "')";
@@ -1202,6 +1210,9 @@ public class InformationWriteQueryController extends BladeController {
                         //设置新ID
                         if (new Integer("1").equals(node.getType())) {
                             newData.setId(oldToNewIdMap.containsKey(node.getId()) ? oldToNewIdMap.get(node.getId()) : SnowFlakeUtil.getId());
+
+                            //划分编号
+                            newData.setPartitionCode(StringUtils.isNotEmpty(node.getPartitionCode()) ? node.getPartitionCode() : null);
                         }
                         //设置父节点ID
                         if (vo.getNeedCopyPrimaryKeyId().equals(node.getPKeyId().toString())) {
@@ -1224,8 +1235,6 @@ public class InformationWriteQueryController extends BladeController {
                         newData.setIsTabPdf(1);
                         //初始化PDF路径
                         newData.setPdfUrl(null);
-                        //划分编号
-                        newData.setPartitionCode(StringUtils.isNotEmpty(copyBatch.getPartitionCode()) ? copyBatch.getPartitionCode() : null);
 
                         //获取当前所有复制的节点的最大sort
                         String sql = "select sort from m_wbs_tree_contract where contract_id = '" + node.getContractId() + "' and (id = '" + node.getId() + "' or old_id = '" + node.getId() + "')";

+ 4 - 5
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -253,12 +253,11 @@
                 group by wtc.p_key_id
             ) AS querys
         ) AS querys ON wtc.p_key_id = querys.pKeyId
-        WHERE
-            wtc.contract_id = #{contractId}
-        AND wtc.type = 1
-        AND wtc.parent_id = #{parentId}
+        WHERE wtc.type = 1
+        AND wtc.is_deleted= 0
         AND wtc.node_type != 111
-        AND wtc.is_deleted= '0'
+        AND wtc.parent_id = #{parentId}
+        AND wtc.contract_id = #{contractId}
         ORDER BY wtc.sort,wtc.create_time
     </select>
 

+ 1 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FirstController.java

@@ -442,8 +442,6 @@ public class FirstController extends BladeController {
                 Elements sgTitle1 = doc.select("el-input[placeholder=安装单位]");
                 sgTitle.addAll(sgTitle1);
                 Elements htdTitle = doc.select("el-input[placeholder~=.*合同段:");
-                /*Elements htdTitle1 = doc.select("el-input[placeholder~=合同名称.*]");
-                htdTitle.addAll(htdTitle1);*/
                 Elements jlTitle = doc.select("el-input[placeholder~=监理单位.*]");
                 Elements bhTitle = doc.select("el-input[placeholder~=^编号]");
                 Elements bhTitle1 = doc.select("el-input[placeholder~=合同编号.*]");
@@ -607,9 +605,7 @@ public class FirstController extends BladeController {
                 Elements sgTitle = doc.select("el-input[placeholder~=^施工单位]");
                 Elements sgTitle1 = doc.select("el-input[placeholder=安装单位]");
                 sgTitle.addAll(sgTitle1);
-                Elements htdTitle = doc.select("el-input[placeholder~=.*合同段.*]");
-                Elements htdTitle1 = doc.select("el-input[placeholder~=合同名称.*]");
-                htdTitle.addAll(htdTitle1);
+                Elements htdTitle = doc.select("el-input[placeholder~=.*合同段:]");
                 Elements jlTitle = doc.select("el-input[placeholder~=监理单位.*]");
                 Elements bhTitle = doc.select("el-input[placeholder~=^编号]");
                 Elements bhTitle1 = doc.select("el-input[placeholder~=合同编号.*]");