Quellcode durchsuchen

Merge remote-tracking branch 'origin/test-merge' into test-merge

LHB vor 1 Monat
Ursprung
Commit
d35f12920c

+ 3 - 3
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/WbsTreeContractStatisticsClientImpl.java

@@ -45,19 +45,19 @@ public class WbsTreeContractStatisticsClientImpl implements WbsTreeContractStati
             if (!queryList.isEmpty()) {
                 for (InformationQuery query : queryList) {
                     if (map.containsKey(query.getWbsId() + "," + query.getContractId() + "," + query.getClassify())) {
+                        redisTemplate.opsForList().remove("blade:statistics:information_query_statistics_key", 1, query.getId() + "");
                         continue;
                     }
                     try {
                         wbsTreeContractStatisticsService.updateInformationNumber(query.getWbsId(), query.getClassify(), query.getContractId());
                         map.put(query.getWbsId() + "," + query.getContractId() + "," + query.getClassify(), "");
+                        redisTemplate.opsForList().remove("blade:statistics:information_query_statistics_key", 1, query.getId() + "");
                     } catch (Exception e) {
+                        redisTemplate.opsForList().remove("blade:statistics:information_query_statistics_key", 1, query.getId() + "");
                         redisTemplate.opsForList().rightPush("blade:statistics:information_query_statistics_key", query.getId() + "");
                         log.error("updateInformationQueryStatus wbsId = {}, contractId = {}, classify = {}", query.getWbsId(), query.getContractId(), query.getClassify() , e);
                     }
                 }
-                for (String queryId : queryIds) {
-                    redisTemplate.opsForList().remove("blade:statistics:information_query_statistics_key", 1, queryId);
-                }
             }
         }
     }

+ 6 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java

@@ -715,10 +715,12 @@ public class TextdictInfoController extends BladeController {
         FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
         String str1 = wbsTreePrivate.getHtmlUrl().replace("Desktop//privateUrl", "Desktop/privateUrl");
         String replace = str1.replace("\\", "\\\\");
-        Set<Long> set = oldTextDictInfos.stream().map(TextdictInfo::getId).collect(Collectors.toSet());
-        // 先逻辑删除然后修改
-        this.textdictInfoService.update(Wrappers.<TextdictInfo>lambdaUpdate().eq(TextdictInfo::getProjectId, wbsTreePrivate.getProjectId())
-                .eq(TextdictInfo::getExcelId, wbsTreePrivate.getExcelId()).in(TextdictInfo::getType, 2, 6).in(TextdictInfo::getId, set).set(TextdictInfo::getIsDeleted, 1));
+        if (!oldTextDictInfos.isEmpty()) {
+            Set<Long> set = oldTextDictInfos.stream().map(TextdictInfo::getId).collect(Collectors.toSet());
+            // 先逻辑删除然后修改
+            this.textdictInfoService.update(Wrappers.<TextdictInfo>lambdaUpdate().eq(TextdictInfo::getProjectId, wbsTreePrivate.getProjectId())
+                    .eq(TextdictInfo::getExcelId, wbsTreePrivate.getExcelId()).in(TextdictInfo::getType, 2, 6).in(TextdictInfo::getId, set).set(TextdictInfo::getIsDeleted, 1));
+        }
         if (!updateList.isEmpty()) {
             for (TextdictInfo info : updateList) {
                 this.textdictInfoService.update(Wrappers.<TextdictInfo>lambdaUpdate().eq(TextdictInfo::getId, info.getId()).eq(TextdictInfo::getProjectId, info.getProjectId())

+ 12 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsParamController.java

@@ -621,6 +621,17 @@ public class WbsParamController {
                         .apply(" node_id = (SELECT is_type_private_pid from m_wbs_tree_contract WHERE p_key_id = (select p_id from m_wbs_tree_contract where p_key_id =  "+ pKeyId +" ))"));
             }
         }
+        if (wps != null && !wps.isEmpty()) {
+            Map<Integer, List<WbsParam>> map = wps.stream().collect(Collectors.groupingBy(WbsParam::getType));
+            List<Integer> keys = new ArrayList<>(map.keySet());
+            keys.sort(Integer::compareTo);
+            for (int i = keys.size() - 1; i >= 0; i--) {
+                wps = map.get(keys.get(i));
+                if (wps !=  null && !wps.isEmpty()) {
+                    break;
+                }
+            }
+        }
         return R.data(wps);
     }
     /**
@@ -637,7 +648,7 @@ public class WbsParamController {
         String g10 = checkDeviationRange(obj.getString("g10pcfw"));
         String g8 = checkDeviationRange(obj.getString(G8PCFW));
         if (StringUtil.isBlank(g10) && StringUtil.isBlank(g8)) {
-            return R.fail("请输入偏差范围");
+            return R.fail("请输入符合格式要求的偏差范围");
         }
         try {
             saveOrUpdateDeviationRange(nodeId, G10PCFW, g10, "G10偏差范围");

+ 13 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -931,14 +931,27 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
     public Map<String, Object> getWpMap(Long wbsNodeId, Long wtpPkeyId, TableElementConverter tec) {
         Map<String, Object> result = new HashMap<>(100);
         List<WbsParam> total = this.getNodeWps(wbsNodeId, wtpPkeyId);
+        Set<Long> tablePkeyIds = tec.getTableAll().stream().map(NodeTable::getPKeyId).collect(Collectors.toSet());
+        // 目前表单 参数只有偏差范围 2025-08-15
+        List<WbsParam> tabWps = this.wpService.list(Wrappers.<WbsParam>lambdaQuery().in(WbsParam::getNodeId, tablePkeyIds).in(WbsParam::getK, "G10pcfw", "g8pcfw").eq(WbsParam::getType, 220));
         Map<String, String> logMap = new HashMap<>();
+        Map<String, WbsParam> tatalMap = new HashMap<>();
         if (CollectionUtil.isNotEmpty(total)) {
             /*同名参数私有覆盖公用*/
             for (WbsParam p : total) {
                 result.put(p.getK(), p.getV());
                 logMap.put(p.getK(), p.getName());
+                tatalMap.put(p.getK(), p);
             }
         }
+        if (CollectionUtil.isNotEmpty(tabWps)) {
+            for (WbsParam p : tabWps) {
+                result.put(p.getK(), p.getV());
+                logMap.put(p.getK(), p.getName());
+                tatalMap.put(p.getK(), p);
+            }
+            total = new ArrayList<>(tatalMap.values());
+        }
         //tec.getLog().put(FormulaLog.PARAM,result.entrySet().stream().map(p->logMap.get(p.getKey())+":"+p.getValue()).collect(Collectors.joining(";")));
         /*绑定节点参数公式*/
         this.bindParamFormula(total, tec);