Bladeren bron

质检-资料查询
1、查询质检树时 查询同步信息

lvy 2 maanden geleden
bovenliggende
commit
5803de2114

+ 2 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractLazyVO.java

@@ -139,6 +139,7 @@ public class WbsTreeContractLazyVO implements Serializable {
     @ApiModelProperty(value = "是否完成日期填写1是2否")
     private Integer dateIsComplete;
 
-
+    @ApiModelProperty(value = "是否最近同步节点")
+    private Integer isSync;
 
 }

+ 16 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

@@ -761,6 +761,19 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
         if (cn.hutool.core.util.ObjectUtil.isNotEmpty(contractId)) {
             ContractInfo contractInfo = jdbcTemplate.query("SELECT contract_name,contract_type FROM m_contract_info WHERE id = " + contractId,
                     new BeanPropertyRowMapper<>(ContractInfo.class)).stream().findAny().orElse(null);
+            String contractExtendSql = "select ancestors from m_wbs_tree_contract_extend where type = " + tableOwner + " and is_sync = 1 and is_deleted = 0 and ancestors like concat( " + id + ",'%')";
+            List<String> ids = new ArrayList<>();
+            List<String> strings = null;
+            try {
+                strings = jdbcTemplate.queryForList(contractExtendSql, String.class);
+            } catch (DataAccessException e) {
+                e.printStackTrace();
+                //TODO 暂时忽略错误
+            }
+            if(CollectionUtil.isNotEmpty(strings)){
+                strings.forEach(f -> ids.addAll(Arrays.asList(f.split(","))));
+            }
+
             if (contractInfo != null) {
                 /* =========================== 施工合同段 =========================== */
                 if (new Integer(1).equals(contractInfo.getContractType())) {
@@ -897,6 +910,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
 
 //                            }
                         }
+                        if(CollectionUtil.isNotEmpty(ids)){
+                            lazyNodes.forEach(f -> f.setIsSync(ids.contains(f.getPKeyId()) ? 1 : 0));
+                        }
                         return lazyNodes;
                     }