Kaynağa Gözat

独立库电签默认信息同步bug

liuyc 2 yıl önce
ebeveyn
işleme
6528865c66

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

@@ -445,7 +445,7 @@
     </select>
 
     <select id="getContractWbsTreeAll" resultType="org.springblade.manager.entity.WbsTreeContract">
-        select p_key_id,node_name,node_type,parent_id,sort from m_wbs_tree_contract where project_id = #{obj.projectId} and contract_id = #{obj.contractId} and `type` = 1 and status = 1 order by sort
+        select p_key_id,id,node_name,node_type,parent_id,sort from m_wbs_tree_contract where project_id = #{obj.projectId} and contract_id = #{obj.contractId} and `type` = 1 and status = 1 and node_type in (1,2,3,4,5,6) order by sort
     </select>
 
 </mapper>

+ 5 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/ManagerApplication.java

@@ -3,15 +3,17 @@ package org.springblade.manager;
 import org.springblade.common.constant.LauncherConstant;
 import org.springblade.core.cloud.feign.EnableBladeFeign;
 import org.springblade.core.launch.BladeApplication;
+import org.springframework.cache.annotation.EnableCaching;
 import org.springframework.cloud.client.SpringCloudApplication;
 import org.springframework.scheduling.annotation.EnableAsync;
 
 @EnableBladeFeign
 @SpringCloudApplication
 @EnableAsync
+@EnableCaching //缓存
 public class ManagerApplication {
 
-	public static void main(String[] args) {
-		BladeApplication.run(LauncherConstant.APPLICATION_MANAGER_NAME, ManagerApplication.class, args);
-	}
+    public static void main(String[] args) {
+        BladeApplication.run(LauncherConstant.APPLICATION_MANAGER_NAME, ManagerApplication.class, args);
+    }
 }

+ 2 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.java

@@ -17,6 +17,7 @@
 package org.springblade.manager.mapper;
 
 import org.springblade.manager.entity.TextdictInfo;
+import org.springblade.manager.injector.EasyBaseMapper;
 import org.springblade.manager.vo.TextdictInfoVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -28,7 +29,7 @@ import java.util.List;
  * @author BladeX
  * @since 2022-06-17
  */
-public interface TextdictInfoMapper extends BaseMapper<TextdictInfo> {
+public interface TextdictInfoMapper extends EasyBaseMapper<TextdictInfo> {
 
 	/**
 	 * 自定义分页

+ 33 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java

@@ -19,6 +19,7 @@ package org.springblade.manager.service.impl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springblade.core.tool.api.R;
 import org.springblade.manager.entity.TextdictInfo;
+import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.vo.TextdictDataInfoVO;
 import org.springblade.manager.vo.TextdictInfoVO;
 import org.springblade.manager.mapper.TextdictInfoMapper;
@@ -26,6 +27,12 @@ import org.springblade.manager.service.ITextdictInfoService;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  * 参数信息表 服务实现类
@@ -46,4 +53,30 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
 		baseMapper.deleteById(id);
 	}
 
+
+	@Transactional(rollbackFor = Exception.class)
+	public boolean insertBatch(Collection<TextdictInfo> entityList, int batchSize) {
+		try {
+			int size = entityList.size();
+			int idxLimit = Math.min(batchSize, size);
+			int i = 1;
+			//保存单批提交的数据集合
+			List<TextdictInfo> oneBatchList = new ArrayList<>();
+			for (Iterator<TextdictInfo> var1 = entityList.iterator(); var1.hasNext(); ++i) {
+				TextdictInfo element = var1.next();
+				oneBatchList.add(element);
+				if (i == idxLimit) {
+					baseMapper.insertBatchSomeColumn(oneBatchList);
+					//每次提交后清空集合数据
+					oneBatchList.clear();
+					idxLimit = Math.min(idxLimit + batchSize, size);
+				}
+			}
+		} catch (Exception e) {
+			log.error("保存失败", e);
+			return false;
+		}
+		return true;
+	}
+
 }

+ 9 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java

@@ -681,6 +681,7 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
                             dataPrivate.setWbsType(wbsTreePrivate.getWbsType());
                             dataPrivate.setProjectId(wbsTreePrivate.getProjectId());
                             dataPrivate.setFullName(dataPrivate.getNodeName());
+                            dataPrivate.setInitTableId(tree.getInitTableId().toString());
                             //新增
                             insertDataPrivateList.add(dataPrivate);
 
@@ -824,6 +825,7 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
                             dataPrivate.setWbsId(wbsTreePrivate.getWbsId());
                             dataPrivate.setWbsType(tree.getWbsType());
                             dataPrivate.setProjectId(wbsTreePrivate.getProjectId());
+                            dataPrivate.setInitTableId(tree.getInitTableId());
                             insertDataPrivateList.add(dataPrivate);
 
                             //同步到该项目下的所有合同段
@@ -966,6 +968,7 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
                             dataPrivate.setWbsType(wbsTreePrivate.getWbsType());
                             dataPrivate.setProjectId(wbsTreePrivate.getProjectId());
                             dataPrivate.setFullName(dataPrivate.getNodeName());
+                            dataPrivate.setInitTableId(tree.getInitTableId().toString());
                             //新增
                             insertDataPrivateList.add(dataPrivate);
 
@@ -1109,6 +1112,8 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
                             dataPrivate.setWbsId(wbsTreePrivate.getWbsId());
                             dataPrivate.setWbsType(tree.getWbsType());
                             dataPrivate.setProjectId(wbsTreePrivate.getProjectId());
+                            dataPrivate.setInitTableId(tree.getInitTableId());
+
                             insertDataPrivateList.add(dataPrivate);
 
                             //同步到该项目下的所有合同段
@@ -1300,7 +1305,7 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
     }
 
     @Override
-    public R saveLinkeTableInfo(String tabId, String linkids, String type,String wbsId) {
+    public R saveLinkeTableInfo(String tabId, String linkids, String type, String wbsId) {
         //1 元素表关联  2表示新增 3 表示项目节点关联
         if (com.alibaba.cloud.commons.lang.StringUtils.isEmpty(tabId)) {
             return R.fail("tabId不能为空");
@@ -1329,7 +1334,9 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
                 WbsTree tree = new WbsTree();
                 tree.setParentId(pid);
                 tree.setTableOwner(tableInfo.getTableOwner());
+
                 tree.setInitTableId(tableInfo.getId());
+
                 tree.setTableType(tableInfo.getTabType());
                 tree.setInitTableName(tableInfo.getTabEnName());
                 tree.setNodeName(tableInfo.getTabChName());
@@ -1339,6 +1346,7 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
                 tree.setWbsId(wbsId);
 
                 this.submit2(tree);
+
             }
         } else if (type.equals("3")) {
             WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(Long.parseLong(tabId));

+ 75 - 59
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeServiceImpl.java

@@ -37,6 +37,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.xml.soap.Text;
 import java.io.File;
 import java.io.IOException;
 import java.util.*;
@@ -501,7 +502,7 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
 
                 if (pawDTO.getReferenceType().equals("private")) {
 
-                    //同步独立表单库数据
+                    //新增独立表单库数据
                     this.insertDLTabAsync(pawDTO);
 
                     //获取私有引用项目的wbs树的所有节点、元素表、独立表(type=10)
@@ -604,8 +605,6 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                     List<WbsTreePrivate> insertData2 = new ArrayList<>();
                     //私有-电签匹配数据、默认信息数据
                     List<TextdictInfo> insertData3 = new ArrayList<>();
-                    //电签缓存数据
-                    List<TextdictInfo> textDictInfosAll = null;
 
                     if (pawDTO.getReferenceType().equals("public")) {
                         List<WbsTree> addListData = new ArrayList<>();
@@ -651,20 +650,11 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                                 .eq(WbsTreePrivate::getStatus, 1)
                         );
 
-                        //查询所有电签位置配置信息
-                        //List<TextdictInfo> textDictInfosAll = textdictInfoMapper.selectList(Wrappers.<TextdictInfo>query().lambda());
-                        textDictInfosAll = bladeRedis.get("textDictInfos:");
-                        if (ObjectUtils.isEmpty(textDictInfosAll)) {
-                            //获取所有电签配置信息
-                            textDictInfosAll = textdictInfoMapper.selectList(Wrappers.<TextdictInfo>query().lambda());
-
-                            if (textDictInfosAll.size() > 0) {
-                                //存入Redis
-                                bladeRedis.set("textDictInfos:", textDictInfosAll);
-                                //过期时间
-                                bladeRedis.expire("textDictInfos:", 3600);
-                            }
-                        }
+                        //查询对应电签位置配置信息的pKeyIds
+                        List<Long> pIdsDL = wbsTreePrivates.stream().filter(f -> f.getType().equals(10) || f.getType().equals(2)).collect(Collectors.toList()).stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
+                        String pKeyIds = StringUtils.join(pIdsDL, ",");
+                        String sql = "select `id`,`name`,`type`,tab_id,col_key,sig_role_id,is_deleted,sig_role_name,col_name,pyzbx,pyzby from m_textdict_info where tab_id in (" + pKeyIds + ") and is_deleted = 0";
+                        List<TextdictInfo> textDictInfosAll = jdbcTemplate.query(sql, new BeanPropertyRowMapper<TextdictInfo>(TextdictInfo.class));
 
                         for (WbsTreePrivate wbsTreePrivate : wbsTreePrivates) {
                             if (wbsTreePrivate.getType() == 1 || wbsTreePrivate.getType() == 2) {
@@ -701,7 +691,10 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                             }
                         }
 
-                        addListData.forEach(tree -> {
+                        //只同步独立库中有关联过清表的元素表type=10,以及原始方式的元素表type=2,节点信息type=1
+                        List<WbsTreePrivate> collect = addListData.stream().filter(f -> f.getType().equals(1) || f.getType().equals(2) || (f.getHtmlUrl() != null && f.getType().equals(10))).collect(Collectors.toList());
+
+                        collect.forEach(tree -> {
                             WbsTreePrivate wbsTreePrivate = BeanUtil.copyProperties(tree, WbsTreePrivate.class);
                             if (wbsTreePrivate != null) {
                                 wbsTreePrivate.setPKeyId(SnowFlakeUtil.getId());
@@ -709,10 +702,12 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                                 wbsTreePrivate.setFullName(wbsTreePrivate.getNodeName());
                                 wbsTreePrivate.setInitTableId(ObjectUtil.isNotEmpty(tree.getInitTableId()) ? String.valueOf(tree.getInitTableId()) : null);
 
+                                wbsTreePrivate.setHtmlUrl(ObjectUtil.isNotEmpty(tree.getHtmlUrl()) ? tree.getHtmlUrl() : null);
+
                                 if (tree.getType() == 10) {  //独立表单数据
                                     wbsTreePrivate.setWbsId(null);
                                     wbsTreePrivate.setWbsType(null);
-                                } else {
+                                } else { //非独立库形式
                                     wbsTreePrivate.setWbsId(pawDTO.getPrimaryKeyId());
                                     wbsTreePrivate.setWbsType(String.valueOf(pawDTO.getWbsType()));
                                 }
@@ -724,10 +719,12 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                                         textDictInfoData.forEach((k, v) -> {
                                             if (tree.getPKeyId().equals(k)) {
                                                 for (TextdictInfo textdictInfo : v) {
-                                                    textdictInfo.setTabId(String.valueOf(wbsTreePrivate.getPKeyId()));
-                                                    textdictInfo.setId(SnowFlakeUtil.getId());
+                                                    TextdictInfo obj = BeanUtil.copyProperties(textdictInfo, TextdictInfo.class);
+                                                    assert obj != null;
+                                                    obj.setTabId(String.valueOf(wbsTreePrivate.getPKeyId()));
+                                                    obj.setId(SnowFlakeUtil.getId());
+                                                    insertData3.add(obj);
                                                 }
-                                                insertData3.addAll(v);
                                             }
                                         });
                                     }
@@ -754,13 +751,7 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                         this.insertBatch(insertData2, 1000);
 
                         //电签
-                        textDictInfoService.saveBatch(insertData3, 1000);
-                        assert textDictInfosAll != null;
-                        textDictInfosAll.addAll(insertData3);
-                        //更新Redis
-                        bladeRedis.set("textDictInfos:", textDictInfosAll);
-                        //更新过期时间
-                        bladeRedis.expire("textDictInfos:", 3600);
+                        textDictInfoService.insertBatch(insertData3, 1000);
 
                         //修改质检关联信息
                         if (pawDTO.getWbsType() == 1) {
@@ -820,12 +811,13 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
         return wbsTreePrivateService.updateBatchByIds2(wbsTreePrivates, wbsTreePrivatesAllNow, projectId, primaryKeyId);
     }
 
-    //同步独立表单库数据
+    //新增独立表单库数据
     private void insertDLTabAsync(WbsTreeContractDTO pawDTO) {
         //获取当前引用项目的独立表
         List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateService.getBaseMapper().selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
                 .eq(WbsTreePrivate::getProjectId, pawDTO.getReferencePrivateWbsProjectId())
                 .eq(WbsTreePrivate::getType, 10)
+                .isNotNull(WbsTreePrivate::getHtmlUrl)
         );
 
         //获取当前项目独立表
@@ -834,13 +826,22 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                 .eq(WbsTreePrivate::getType, 10)
         );
 
+        //同步htmlURL丢失问题
+        this.syncDLHtmlUrlLost(wbsTreePrivates, wbsTreePrivatesNew);
+
+        //去重
         Iterator<WbsTreePrivate> iterator = wbsTreePrivates.iterator();
         while (iterator.hasNext()) {
             WbsTreePrivate next = iterator.next();
             for (WbsTreePrivate wbsTreePrivate : wbsTreePrivatesNew) {
                 if (next.getNodeName().equals(wbsTreePrivate.getNodeName()) && next.getTableType().equals(wbsTreePrivate.getTableType())) {
-                    //去重,获取新增的独立表
-                    iterator.remove();
+                    //如果当前独立库的元素表的htmlUrl==null,那么需要重新赋值,解决无法找到清表问题
+                    if (ObjectUtil.isEmpty(wbsTreePrivate.getHtmlUrl())) {
+                        wbsTreePrivate.setHtmlUrl(next.getHtmlUrl());
+                    } else {
+                        //去重,获取新增的独立表
+                        iterator.remove();
+                    }
                     break;
                 }
             }
@@ -854,41 +855,55 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                 Long id = SnowFlakeUtil.getId();
                 wbsTreePrivateNew.setPKeyId(id);
                 wbsTreePrivateNew.setProjectId(pawDTO.getProjectId());
+                wbsTreePrivateNew.setHtmlUrl(wbsTreePrivate.getHtmlUrl());
+                wbsTreePrivateNew.setExcelId(wbsTreePrivate.getExcelId());
+                wbsTreePrivateNew.setIsLinkTable(wbsTreePrivate.getIsLinkTable());
                 wbsTreePrivatesNewAdd.add(wbsTreePrivateNew);
             }
         }
 
         if (wbsTreePrivatesNewAdd.size() > 0) {
             //新增独立表
-            wbsTreePrivateService.saveBatch(wbsTreePrivatesNewAdd, 1000);
+            wbsTreePrivateService.insertBatch(wbsTreePrivatesNewAdd, 1000);
         }
 
     }
 
     @Async
-    public boolean insertTextDictInfoAsync(List<WbsTreePrivate> wbsTreePrivateOldTables, List<WbsTreePrivate> wbsTreePrivateNewTables) {
-        List<TextdictInfo> redisValue = bladeRedis.get("textDictInfos:");
-        if (ObjectUtils.isEmpty(redisValue)) {
-            //获取所有电签配置信息
-            redisValue = textdictInfoMapper.selectList(Wrappers.<TextdictInfo>query().lambda());
-
-            if (redisValue.size() > 0) {
-                //存入Redis
-                bladeRedis.set("textDictInfos:", redisValue);
-                //过期时间
-                bladeRedis.expire("textDictInfos:", 3600);
+    public void syncDLHtmlUrlLost(List<WbsTreePrivate> wbsTreePrivates, List<WbsTreePrivate> wbsTreePrivatesNew) {
+        //获取当前项目的所有htmlUrl为null的独立表信息
+        List<WbsTreePrivate> collect = wbsTreePrivatesNew.stream().filter(f -> f.getHtmlUrl() == null).collect(Collectors.toList());
+        if (collect.size() > 0) {
+            for (WbsTreePrivate wbsTreePrivateOld : wbsTreePrivates) {
+                for (WbsTreePrivate treePrivateNew : collect) {
+                    if (wbsTreePrivateOld.getId().equals(treePrivateNew.getId())
+                            && ObjectUtil.isNotEmpty(wbsTreePrivateOld.getHtmlUrl())
+                            && ObjectUtil.isEmpty(treePrivateNew.getHtmlUrl())) {
+                        //更新HTMLUrl
+                        wbsTreePrivateService.update(Wrappers.<WbsTreePrivate>lambdaUpdate()
+                                .set(WbsTreePrivate::getHtmlUrl, wbsTreePrivateOld.getHtmlUrl())
+                                .eq(WbsTreePrivate::getPKeyId, treePrivateNew.getPKeyId())
+                        );
+                    }
+                }
             }
         }
+    }
 
+    @Async
+    public boolean insertTextDictInfoAsync(List<WbsTreePrivate> wbsTreePrivateOldTables, List<WbsTreePrivate> wbsTreePrivateNewTables) {
         //wbsTreePrivateOldTables=原始引用的元素表+独立表 wbsTreePrivateNewTables=现在项目树的元素表+独立表
         Map<Long, List<TextdictInfo>> textDictInfoData = new HashMap<>();
         if (wbsTreePrivateOldTables.size() > 0) {
+            //只同步了独立库的元素表电签信息,type=2以前的节点下同步形式,现在type=10为独立库
+            List<Long> pIdsDL = wbsTreePrivateOldTables.stream().filter(f -> f.getType().equals(10) || f.getType().equals(2)).collect(Collectors.toList()).stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
+            String ids = StringUtils.join(pIdsDL, ",");
+            String sql = "select `id`,`name`,`type`,tab_id,col_key,sig_role_id,is_deleted,sig_role_name,col_name,pyzbx,pyzby from m_textdict_info where tab_id in (" + ids + ") and is_deleted = 0";
+            List<TextdictInfo> textDictInfos = jdbcTemplate.query(sql, new BeanPropertyRowMapper<TextdictInfo>(TextdictInfo.class));
+
             for (WbsTreePrivate wbsTreePrivate : wbsTreePrivateOldTables) {
                 //私有引用-电签匹配数据、默认信息数据,根据元素表pKeyId,获取电签位置匹配信息、编辑默认信息
-                //List<TextdictInfo> collect = redisValue.stream().filter(f -> f.getTabId().equals(String.valueOf(wbsTreePrivate.getPKeyId()))).collect(Collectors.toList());
-                //不清楚为什么上面走内存,无法判断,所以直接查询
-                List<TextdictInfo> collect = textdictInfoMapper.selectList(Wrappers.<TextdictInfo>lambdaQuery().eq(TextdictInfo::getTabId, String.valueOf(wbsTreePrivate.getPKeyId())));
-
+                List<TextdictInfo> collect = textDictInfos.stream().filter(f -> f.getTabId().equals(String.valueOf(wbsTreePrivate.getPKeyId()))).collect(Collectors.toList());
                 if (collect.size() > 0) {
                     textDictInfoData.put(wbsTreePrivate.getId(), collect);
                 }
@@ -902,19 +917,26 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                 textDictInfoData.forEach((k, v) -> {
                     if (wbsTreePrivateNewTable.getId().equals(k)) {
                         for (TextdictInfo textdictInfo : v) {
-                            textdictInfo.setTabId(String.valueOf(wbsTreePrivateNewTable.getPKeyId()));
-                            textdictInfo.setId(SnowFlakeUtil.getId());
-                            insertData.add(textdictInfo);
+                            TextdictInfo obj = BeanUtil.copyProperties(textdictInfo, TextdictInfo.class);
+                            assert obj != null;
+                            obj.setTabId(String.valueOf(wbsTreePrivateNewTable.getPKeyId()));
+                            obj.setId(SnowFlakeUtil.getId());
+                            insertData.add(obj);
                         }
                     }
                 });
             }
 
             //判断是否存在
+            List<Long> pIdsDLNew = wbsTreePrivateNewTables.stream().filter(f -> f.getType().equals(10) || f.getType().equals(2)).collect(Collectors.toList()).stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
+            String ids = StringUtils.join(pIdsDLNew, ",");
+            String sql = "select `id`,`name`,`type`,tab_id,col_key,sig_role_id,is_deleted,sig_role_name,col_name,pyzbx,pyzby from m_textdict_info where tab_id in (" + ids + ") and is_deleted = 0";
+            List<TextdictInfo> textDictInfosNew = jdbcTemplate.query(sql, new BeanPropertyRowMapper<TextdictInfo>(TextdictInfo.class));
+
             Iterator<TextdictInfo> iterator = insertData.iterator();
             while (iterator.hasNext()) {
                 TextdictInfo textDictInfo = iterator.next();
-                redisValue.stream().filter(f ->
+                textDictInfosNew.stream().filter(f ->
                         //判断每张表TabId的每个位置ColKey、类型Type唯一
                         f.getColKey().equals(textDictInfo.getColKey())
                                 && f.getType().equals(textDictInfo.getType())
@@ -923,13 +945,7 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
             }
 
             if (insertData.size() > 0) {
-                textDictInfoService.saveBatch(insertData, 1000);
-
-                //更新Redis
-                redisValue.addAll(insertData);
-                bladeRedis.set("textDictInfos:", redisValue);
-                //更新过期时间
-                bladeRedis.expire("textDictInfos:", 3600);
+                textDictInfoService.insertBatch(insertData, 1000);
             }
 
             return true;