|
|
@@ -21,6 +21,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import io.swagger.annotations.*;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
@@ -644,25 +645,17 @@ public class TextdictInfoController extends BladeController {
|
|
|
}
|
|
|
|
|
|
// 查询历史数据
|
|
|
- String querySql = String.format("select * from m_textdict_info where project_id = %d and tab_id = %d and type in (2,6) and is_deleted = 0"
|
|
|
- , Long.parseLong(wbsTreePrivate.getProjectId()), wbsTreePrivate.getPKeyId());
|
|
|
- List<TextdictInfo> oldTextDictInfos = jdbcTemplate.query(querySql, new BeanPropertyRowMapper<>(TextdictInfo.class));
|
|
|
- Map<String, TextdictInfo> oldTextDictInfoMap;
|
|
|
- if (!oldTextDictInfos.isEmpty()) {
|
|
|
- oldTextDictInfoMap = oldTextDictInfos.stream().collect(Collectors.toMap(item -> item.getProjectId() + item.getExcelId()
|
|
|
- + (item.getColKey() != null && item.getColKey().contains("__") ? item.getColKey().split("__")[0] : item.getColKey())
|
|
|
- + item.getSigRoleId(), textdictInfo -> textdictInfo));
|
|
|
- } else {
|
|
|
- querySql = String.format("SELECT * from m_textdict_info WHERE project_id = %d and excel_id = %d and type in (2, 6) and exists (SELECT 1 from m_wbs_tree_private WHERE p_key_id = tab_id and html_url = '%s' )"
|
|
|
- , Long.parseLong(wbsTreePrivate.getProjectId()), wbsTreePrivate.getExcelId(), wbsTreePrivate.getHtmlUrl());
|
|
|
- oldTextDictInfos = jdbcTemplate.query(querySql, new BeanPropertyRowMapper<>(TextdictInfo.class));
|
|
|
- if (!oldTextDictInfos.isEmpty()) {
|
|
|
- oldTextDictInfoMap = oldTextDictInfos.stream().collect(Collectors.toMap(item -> item.getProjectId() + item.getExcelId()
|
|
|
- + (item.getColKey() != null && item.getColKey().contains("__") ? item.getColKey().split("__")[0] : item.getColKey())
|
|
|
- + item.getSigRoleId(), textdictInfo -> textdictInfo));
|
|
|
- } else {
|
|
|
- oldTextDictInfoMap = new HashMap<>();
|
|
|
- }
|
|
|
+ Map<String, TextdictInfo> oldTextDictInfoMap = new HashMap<>();
|
|
|
+ List<TextdictInfoVO> oldTextDictInfos = new ArrayList<>();
|
|
|
+ TextdictInfoVO param = new TextdictInfoVO();
|
|
|
+ param.setProjectId(wbsTreePrivate.getProjectId());
|
|
|
+ param.setTabId(wbsTreePrivate.getPKeyId() + "");
|
|
|
+ param.setShowType(1);
|
|
|
+ param.setType(2);
|
|
|
+ IPage<TextdictInfoVO> signConfigs = textdictInfoService.selectTextdictInfoPage(new Page<>(1, 1000), param);
|
|
|
+ if (signConfigs != null && signConfigs.getRecords() != null && !signConfigs.getRecords().isEmpty()) {
|
|
|
+ oldTextDictInfos = signConfigs.getRecords();
|
|
|
+ oldTextDictInfoMap = oldTextDictInfos.stream().collect(Collectors.toMap(item -> item.getProjectId() + item.getId(), textdictInfo -> textdictInfo));
|
|
|
}
|
|
|
// 由于要实现电签 一对多(1个key 对应多个电签Id)
|
|
|
Map<String,String> keyMap = new HashMap<>();
|
|
|
@@ -719,12 +712,10 @@ public class TextdictInfoController extends BladeController {
|
|
|
}
|
|
|
textdictInfo.setColKey(colKey);
|
|
|
|
|
|
- TextdictInfo info = oldTextDictInfoMap.get(wbsTreePrivate.getProjectId() + wbsTreePrivate.getExcelId() + (colKey != null && colKey.contains("__") ? colKey.split("__")[0] : colKey) + sigRoleId);
|
|
|
+ TextdictInfo info = oldTextDictInfoMap.get(wbsTreePrivate.getProjectId() + id);
|
|
|
if (info != null) {
|
|
|
- textdictInfo.setId(info.getId());
|
|
|
updateList.add(textdictInfo);
|
|
|
} else {
|
|
|
- textdictInfo.setId(SnowFlakeUtil.getId());
|
|
|
addList.add(textdictInfo);
|
|
|
}
|
|
|
newTextDictInfos.add(textdictInfo);
|
|
|
@@ -751,7 +742,7 @@ public class TextdictInfoController extends BladeController {
|
|
|
String str1 = wbsTreePrivate.getHtmlUrl().replace("Desktop//privateUrl", "Desktop/privateUrl");
|
|
|
String replace = str1.replace("\\", "\\\\");
|
|
|
if (!oldTextDictInfos.isEmpty()) {
|
|
|
- Set<Long> set = oldTextDictInfos.stream().map(TextdictInfo::getId).collect(Collectors.toSet());
|
|
|
+ Set<Long> set = oldTextDictInfos.stream().map(TextdictInfoVO::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));
|