|
@@ -9,10 +9,7 @@ import org.springblade.core.redis.cache.BladeRedis;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.tool.constant.BladeConstant;
|
|
import org.springblade.core.tool.constant.BladeConstant;
|
|
import org.springblade.core.tool.node.ForestNodeMerger;
|
|
import org.springblade.core.tool.node.ForestNodeMerger;
|
|
-import org.springblade.core.tool.utils.DateUtil;
|
|
|
|
-import org.springblade.core.tool.utils.Func;
|
|
|
|
-import org.springblade.core.tool.utils.StringPool;
|
|
|
|
-import org.springblade.core.tool.utils.StringUtil;
|
|
|
|
|
|
+import org.springblade.core.tool.utils.*;
|
|
import org.springblade.manager.aop.AvoidRepeatableCommit;
|
|
import org.springblade.manager.aop.AvoidRepeatableCommit;
|
|
import org.springblade.manager.dto.FormElementDTO;
|
|
import org.springblade.manager.dto.FormElementDTO;
|
|
import org.springblade.manager.dto.WbsTreeBatchImportDTO;
|
|
import org.springblade.manager.dto.WbsTreeBatchImportDTO;
|
|
@@ -26,23 +23,17 @@ import org.springblade.manager.service.IWbsFormElementService;
|
|
import org.springblade.manager.service.IWbsTreeService;
|
|
import org.springblade.manager.service.IWbsTreeService;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.manager.unit.DiffListUtil;
|
|
import org.springblade.manager.unit.DiffListUtil;
|
|
-import org.springblade.manager.unit.RedisUtil;
|
|
|
|
import org.springblade.manager.unit.WbsElementUtil;
|
|
import org.springblade.manager.unit.WbsElementUtil;
|
|
import org.springblade.manager.vo.*;
|
|
import org.springblade.manager.vo.*;
|
|
-import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
|
-import org.springframework.jdbc.support.JdbcUtils;
|
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
-import javax.sql.DataSource;
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
-import java.sql.*;
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
-import java.util.concurrent.Executor;
|
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -57,9 +48,11 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
private final ProjectInfoMapper projectInfoMapper;
|
|
private final ProjectInfoMapper projectInfoMapper;
|
|
private final WbsTreeContractMapper wbsTreeContractMapper;
|
|
private final WbsTreeContractMapper wbsTreeContractMapper;
|
|
private final ContractInfoMapper contractInfoMapper;
|
|
private final ContractInfoMapper contractInfoMapper;
|
|
|
|
+ private final TextdictInfoServiceImpl textDictInfoService;
|
|
private final FormulaMapper formulaMapper;
|
|
private final FormulaMapper formulaMapper;
|
|
private final BladeRedis bladeRedis;
|
|
private final BladeRedis bladeRedis;
|
|
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public IPage<WbsTreeVO> selectWbsTreePage(IPage<WbsTreeVO> page, WbsTreeVO wbsTree) {
|
|
public IPage<WbsTreeVO> selectWbsTreePage(IPage<WbsTreeVO> page, WbsTreeVO wbsTree) {
|
|
return page.setRecords(baseMapper.selectWbsTreePage(page, wbsTree));
|
|
return page.setRecords(baseMapper.selectWbsTreePage(page, wbsTree));
|
|
@@ -929,10 +922,12 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //数据初始化节点-引用公有
|
|
|
|
- List<WbsTreePrivate> insertData = new ArrayList<>();
|
|
|
|
- //数据初始化节点-引用私有
|
|
|
|
|
|
+ //公有-数据初始化节点
|
|
|
|
+ List<WbsTreePrivate> insertData1 = new ArrayList<>();
|
|
|
|
+ //私有-数据初始化节点
|
|
List<WbsTreePrivate> insertData2 = new ArrayList<>();
|
|
List<WbsTreePrivate> insertData2 = new ArrayList<>();
|
|
|
|
+ //私有-电签匹配数据、默认信息数据
|
|
|
|
+ List<TextdictInfo> insertData3 = new ArrayList<>();
|
|
|
|
|
|
if (pawDTO.getReferenceType().equals("public")) {
|
|
if (pawDTO.getReferenceType().equals("public")) {
|
|
//引用公有
|
|
//引用公有
|
|
@@ -956,7 +951,7 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
|
|
|
addListData.forEach(tree -> {
|
|
addListData.forEach(tree -> {
|
|
WbsTreePrivate wbsTreePrivate2 = getWbsTreePrivate1(tree, pawDTO);
|
|
WbsTreePrivate wbsTreePrivate2 = getWbsTreePrivate1(tree, pawDTO);
|
|
- insertData.add(wbsTreePrivate2);
|
|
|
|
|
|
+ insertData1.add(wbsTreePrivate2);
|
|
});
|
|
});
|
|
|
|
|
|
} else if (pawDTO.getReferenceType().equals("private")) {
|
|
} else if (pawDTO.getReferenceType().equals("private")) {
|
|
@@ -964,6 +959,9 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
//查询所有私有节点、表 saveIds=新增的节点id
|
|
//查询所有私有节点、表 saveIds=新增的节点id
|
|
List<WbsTreePrivate> addListData = new ArrayList<>();
|
|
List<WbsTreePrivate> addListData = new ArrayList<>();
|
|
|
|
|
|
|
|
+ //私有引用-电签匹配数据、默认信息数据
|
|
|
|
+ Map<Long, List<TextdictInfo>> textDictInfoData = new HashMap<>();
|
|
|
|
+
|
|
//查询出当前wbs树下所有节点、表信息
|
|
//查询出当前wbs树下所有节点、表信息
|
|
List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateMapper.selectNodeAndTable(null, pawDTO.getWbsId(), pawDTO.getReferencePrivateWbsProjectId());
|
|
List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateMapper.selectNodeAndTable(null, pawDTO.getWbsId(), pawDTO.getReferencePrivateWbsProjectId());
|
|
|
|
|
|
@@ -975,27 +973,50 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
} else if (Long.parseLong(id) == (wbsTreePrivate.getParentId()) && wbsTreePrivate.getType() == 2) {
|
|
} else if (Long.parseLong(id) == (wbsTreePrivate.getParentId()) && wbsTreePrivate.getType() == 2) {
|
|
//表
|
|
//表
|
|
addListData.add(wbsTreePrivate);
|
|
addListData.add(wbsTreePrivate);
|
|
|
|
+
|
|
|
|
+ //根据元素表pKeyId,获取电签位置匹配信息、编辑默认信息
|
|
|
|
+ List<TextdictInfo> textDictInfos = baseMapper.selectTextDictInfoByTabId(wbsTreePrivate.getPKeyId());
|
|
|
|
+ if (textDictInfos.size() > 0) {
|
|
|
|
+ textDictInfoData.put(wbsTreePrivate.getPKeyId(), textDictInfos);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
addListData.forEach(tree -> {
|
|
addListData.forEach(tree -> {
|
|
|
|
+ //构造参数
|
|
WbsTreePrivate wbsTreePrivate2 = getWbsTreePrivate2(tree, pawDTO);
|
|
WbsTreePrivate wbsTreePrivate2 = getWbsTreePrivate2(tree, pawDTO);
|
|
insertData2.add(wbsTreePrivate2);
|
|
insertData2.add(wbsTreePrivate2);
|
|
|
|
+
|
|
|
|
+ //构造电签位置配置信息、编辑默认信息数据
|
|
|
|
+ if (wbsTreePrivate2.getType() == 2) {
|
|
|
|
+ if (textDictInfoData.size() > 0) {
|
|
|
|
+ textDictInfoData.forEach((k, v) -> {
|
|
|
|
+ if (tree.getPKeyId().equals(k)) {
|
|
|
|
+ for (TextdictInfo textdictInfo : v) {
|
|
|
|
+ textdictInfo.setTabId(String.valueOf(wbsTreePrivate2.getPKeyId()));
|
|
|
|
+ textdictInfo.setId(SnowFlakeUtil.getId());
|
|
|
|
+ }
|
|
|
|
+ insertData3.addAll(v);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
//新增
|
|
//新增
|
|
if (pawDTO.getReferenceType().equals("public")) {
|
|
if (pawDTO.getReferenceType().equals("public")) {
|
|
- //wbsTreePrivateMapper.insertBatchSomeColumn(insertData);
|
|
|
|
- insertBatch(insertData, 100);
|
|
|
|
|
|
+ insertBatch(insertData1, 100);
|
|
|
|
|
|
projectInfoMapper.updateTemplateIdById(pawDTO.getProjectId(), pawDTO.getWbsId(), "public");
|
|
projectInfoMapper.updateTemplateIdById(pawDTO.getProjectId(), pawDTO.getWbsId(), "public");
|
|
|
|
|
|
} else if (pawDTO.getReferenceType().equals("private")) {
|
|
} else if (pawDTO.getReferenceType().equals("private")) {
|
|
- //wbsTreePrivateMapper.insertBatchSomeColumn(insertData2);
|
|
|
|
insertBatch(insertData2, 100);
|
|
insertBatch(insertData2, 100);
|
|
|
|
|
|
|
|
+ //同步电签位置配置信息、编辑默认信息数据
|
|
|
|
+ textDictInfoService.saveBatch(insertData3, 100);
|
|
|
|
+
|
|
projectInfoMapper.updateTemplateIdById(pawDTO.getProjectId(), pawDTO.getPrimaryKeyId(), "private");
|
|
projectInfoMapper.updateTemplateIdById(pawDTO.getProjectId(), pawDTO.getPrimaryKeyId(), "private");
|
|
}
|
|
}
|
|
|
|
|