Ver Fonte

Merge branch 'refs/heads/feature-lihb-20251125-logFormula' into dev

LHB há 2 dias atrás
pai
commit
bf2667617e

+ 24 - 21
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -969,7 +969,7 @@ public class ExcelTabController extends BladeController {
                     .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId())
                     .eq(WbsTreeContract::getWbsId, wbsTreeContract.getWbsId()).last("limit 1"));
             if (process != null) {
-                this.excelTabService.gsColor(pkeyId, process.getPKeyId().toString(), wbsTreeContract.getProjectId(), doc);
+                this.excelTabService.gsColor(pkeyId, process.getPKeyId().toString(), wbsTreeContract.getProjectId(), doc, ExecuteType.INSPECTION);
                 //设置自动获取的单元格添加html标识
                 this.excelTabService.setAutomatic(pkeyId,process.getPKeyId().toString(),doc);
             }
@@ -1132,26 +1132,29 @@ public class ExcelTabController extends BladeController {
         Document doc = Jsoup.parse(htmlString);
         Element table = doc.select("table").first();
 
-
-        //获取公式颜色
-        String tabName = wbsTreePrivate.getInitTableName();
-        //字段查询、获取公式字段
-        String colKeys = "SELECT e_key from m_table_info a ,m_wbs_form_element b WHERE a.tab_en_name = '" + tabName + "' and a.id=b.f_id and b.id  in(SELECT element_id from m_element_formula_mapping c where c.is_deleted=0) ";
-        List<Map<String, Object>> maps = jdbcTemplate.queryForList(colKeys);
-        if (maps.size() > 0) {
-            for (Map<String, Object> keys : maps) {
-                String key = keys.get("e_key") + "__";
-                Elements gsColor = doc.select("el-input[keyname~=^" + key + "]");
-                for (Element element : gsColor) {
-                    element.parent().attr("gscolor", "11");
-                }
-
-                Elements dateColor = doc.select("el-date-picker[keyname~=^" + key + "]");
-                for (Element element : dateColor) {
-                    element.parent().attr("gscolor", "11");
-                }
-            }
-        }
+        WbsTreePrivate process = this.wbsTreePrivateMapper.getByPKeyId(wbsTreePrivate.getPId());
+        if (process != null) {
+            this.excelTabService.gsColor(pkeyId, process.getPKeyId().toString(), wbsTreePrivate.getProjectId(), doc, ExecuteType.LOGINFO);
+        }
+//        //获取公式颜色
+//        String tabName = wbsTreePrivate.getInitTableName();
+//        //字段查询、获取公式字段
+//        String colKeys = "SELECT e_key from m_table_info a ,m_wbs_form_element b WHERE a.tab_en_name = '" + tabName + "' and a.id=b.f_id and b.id  in(SELECT element_id from m_element_formula_mapping c where c.is_deleted=0) ";
+//        List<Map<String, Object>> maps = jdbcTemplate.queryForList(colKeys);
+//        if (maps.size() > 0) {
+//            for (Map<String, Object> keys : maps) {
+//                String key = keys.get("e_key") + "__";
+//                Elements gsColor = doc.select("el-input[keyname~=^" + key + "]");
+//                for (Element element : gsColor) {
+//                    element.parent().attr("gscolor", "11");
+//                }
+//
+//                Elements dateColor = doc.select("el-date-picker[keyname~=^" + key + "]");
+//                for (Element element : dateColor) {
+//                    element.parent().attr("gscolor", "11");
+//                }
+//            }
+//        }
 
 
         doc.select("Col").remove();

+ 1 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java

@@ -429,6 +429,7 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
         vos.setPrimaryKeyId(String.valueOf(node.getPKeyId()));
         vos.setTitle(StringUtils.isNotEmpty(node.getFullName()) ? node.getFullName() : node.getNodeName());
         vos.setExcelId(node.getExcelId());
+        vos.setInitTableName(node.getInitTableName());
         //最终返回集合
         vosResult.add(vos);
     }

+ 13 - 11
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml

@@ -286,17 +286,19 @@
     </select>
 
     <select id="queryCurrentContractLogList" resultMap="ResultMap">
-        select p_key_id,
-               node_name,
-               full_name,
-               node_type,
-               excel_id,
-               is_link_table
-        from m_wbs_tree_private
-        where is_deleted = 0
-          and major_data_type = 5
-          and wbs_type = 4
-          and project_id = #{projectId}
+        select 			 a.p_key_id,
+                           a.node_name,
+                           a.full_name,
+                           a.node_type,
+                           a.excel_id,
+                           a.is_link_table,
+                           b.init_table_name
+        from m_wbs_tree_private a
+        left join m_wbs_tree_private b on a.excel_id = b.p_key_id
+        where a.is_deleted = 0
+          and a.major_data_type = 5
+          and a.wbs_type = 4
+          and a.project_id = #{projectId}
     </select>
 
     <select id="selectListByCondition" resultType="org.springblade.manager.vo.WbsTreeContractVO2">

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java

@@ -181,7 +181,7 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
     /**
      * 已经关联公式元素的单元格灰色背景设置
      */
-    void gsColor(Long pKeyId, String nodeId, String projectId, Document doc);
+    void gsColor(Long pKeyId, String nodeId, String projectId, Document doc, ExecuteType type);
 
     List<WbsFormElement> getUnMatchField(Long pkeyId, Long tabId) throws Exception;
 

+ 5 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -1091,10 +1091,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     }
 
     @Override
-    public void gsColor(Long pKeyId, String nodeId, String projectId, Document doc) {
+    public void gsColor(Long pKeyId, String nodeId, String projectId, Document doc, ExecuteType type) {
         try {
-            List<KeyMapper> keyMappers = this.formulaService.getKeyMapperList(Collections.singletonList(pKeyId), projectId, nodeId, ExecuteType.INSPECTION, "1");
+            List<KeyMapper> keyMappers = this.formulaService.getKeyMapperList(Collections.singletonList(pKeyId), projectId, nodeId, type, "1");
             //扩展----根据父节点查询不允许执行的公式
+            if(type == ExecuteType.LOGINFO){
+                nodeId = pKeyId.toString();
+            }
             WbsTreeContractExtend byId = wbsTreeContractExtendService.getById(nodeId);
             List<String> list;