|
@@ -1,5 +1,6 @@
|
|
|
package org.springblade.business.controller;
|
|
|
|
|
|
+import cn.hutool.log.StaticLog;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -24,6 +25,7 @@ import org.springblade.business.socket.WebSocket;
|
|
|
import org.springblade.business.utils.FileUtils;
|
|
|
import org.springblade.business.vo.*;
|
|
|
import org.springblade.common.constant.CommonConstant;
|
|
|
+import org.springblade.common.utils.BaseUtils;
|
|
|
import org.springblade.common.utils.CommonUtil;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
@@ -37,6 +39,8 @@ import org.springblade.core.tool.node.ForestNodeMerger;
|
|
|
import org.springblade.core.tool.utils.*;
|
|
|
import org.springblade.evisa.feign.EVisaClient;
|
|
|
import org.springblade.evisa.vo.CertBeanVO;
|
|
|
+import org.springblade.manager.dto.RangeInfo;
|
|
|
+import org.springblade.manager.dto.RangeJson;
|
|
|
import org.springblade.manager.entity.*;
|
|
|
import org.springblade.manager.feign.*;
|
|
|
import org.springblade.manager.vo.WbsTreeContractLazyVO;
|
|
@@ -119,6 +123,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
private final ITreeContractFirstService treeContractFirstService;
|
|
|
|
|
|
+ private final FormulaClient formulaClient;
|
|
|
+
|
|
|
@Autowired
|
|
|
StringRedisTemplate RedisTemplate;
|
|
|
|
|
@@ -1403,6 +1409,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//转化为map
|
|
|
Map<String, String> nodeTabColsMap = nodeTabCols.stream().collect(Collectors.toMap(QueryProcessDataVO::getQueryType, QueryProcessDataVO::getAncestors, (key1, key2) -> key2));
|
|
|
StringBuilder copySql = new StringBuilder();
|
|
|
+ /*重置内容*/
|
|
|
+ Map<String,Map<String,String>> ekvMap = new HashMap<>();
|
|
|
|
|
|
if (StringUtils.isNotEmpty(vo.getNeedCopyPrimaryKeyId())) {
|
|
|
WbsTreeContract parent = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getParentPrimaryKeyId());
|
|
@@ -1474,6 +1482,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
.collect(Collectors.toList());
|
|
|
String keys = StringUtils.join(filteredList, ",");
|
|
|
|
|
|
+ /*重置*/
|
|
|
+ Map<String,String> eMap=reviseValue(nodeOld,parent,ekvMap);
|
|
|
//构造入参
|
|
|
String dataSql = "SELECT " + keys + " FROM " + tableName + " WHERE p_key_id= " + nodeOld.getPKeyId() + " LIMIT 1;";
|
|
|
List<LinkedHashMap<String, Object>> resultList = jdbcTemplate.query(dataSql, new RowMapper<LinkedHashMap<String, Object>>() {
|
|
@@ -1494,7 +1504,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if (!resultList.isEmpty()) {
|
|
|
LinkedHashMap<String, Object> resultMap = resultList.get(0);
|
|
|
for (Map.Entry<String, Object> entry : resultMap.entrySet()) {
|
|
|
- Object value = entry.getValue();
|
|
|
+ Object value =reviseValue(eMap,entry.getKey(),entry.getValue());
|
|
|
if (value != null) {
|
|
|
if (value.toString().contains("\n")) {
|
|
|
//如果值中包含换行符,则将换行符替换
|
|
@@ -1876,6 +1886,11 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
String pKey = needTab.getNodeName() + "-" + needTab.getHtmlUrl();
|
|
|
//获取目标表对象
|
|
|
WbsTreeContract toCopyNodeTab = toCopyNodeTabsMaps.get(pKey);
|
|
|
+
|
|
|
+ /*重置内容step1*/
|
|
|
+ Map<String,Map<String,String>> ekvMap = new HashMap<>();
|
|
|
+ /*重置内容step2*/
|
|
|
+ Map<String,String> eMap=reviseValue(needTab,null,ekvMap);
|
|
|
//如果存在,只复制数据
|
|
|
if (toCopyNodeTab != null) {
|
|
|
Long oldPKeyId = needTab.getPKeyId();
|
|
@@ -1897,6 +1912,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//delete SQL (先删除旧数据,再新增)
|
|
|
String delSql = "delete from " + tableName + " where p_key_id = " + toCopyNodeTab.getPKeyId() + " ; ";
|
|
|
//insert into SQL
|
|
|
+ String testColVal=reviseCols(eMap,colVal,oldPKeyId,tableName);
|
|
|
+ StaticLog.info("KT3356:"+testColVal);
|
|
|
copyDataSql.append(delSql).append("insert into ").append(tableName).append(" (").append(col).append(") select ").append(colVal).append(" from ").append(tableName).append(" where p_key_id='").append(oldPKeyId).append("' LIMIT 1;");
|
|
|
resultTablesData.add(copyDataSql.toString());
|
|
|
}
|
|
@@ -1942,6 +1959,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//delete SQL (先删除旧数据,再新增)
|
|
|
String delSql = "delete from " + tableName + " where p_key_id = " + objTab.getPKeyId() + " ; ";
|
|
|
//insert into SQL
|
|
|
+ String testColVal=reviseCols(eMap,colVal,oldPKeyId,tableName);
|
|
|
+ StaticLog.info("KT3356:"+testColVal);
|
|
|
copyDataSql.append(delSql).append("insert into ").append(tableName).append(" (").append(col).append(") select ").append(colVal).append(" from ").append(tableName).append(" where p_key_id='").append(oldPKeyId).append("' LIMIT 1;");
|
|
|
resultTablesData.add(copyDataSql.toString());
|
|
|
}
|
|
@@ -1968,7 +1987,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
var = 1;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ /*重置内容step1*/
|
|
|
+ Map<String,Map<String,String>> ekvMap = new HashMap<>();
|
|
|
//最下层级节点复制
|
|
|
if (var == 1) {
|
|
|
//构造节点
|
|
@@ -2025,8 +2045,12 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
List<QueryProcessDataVO> nodeTabColOneTab = informationQueryService.getNodeChildTabColsAllByTabName(obj.getInitTableName());
|
|
|
//转化为map
|
|
|
Map<String, String> nodeTabColsMap = nodeTabColOneTab.stream().collect(Collectors.toMap(QueryProcessDataVO::getQueryType, QueryProcessDataVO::getAncestors, (key1, key2) -> key2));
|
|
|
+
|
|
|
//组织复制表的数据的sql
|
|
|
if (nodeTabColsMap.size() > 0) {
|
|
|
+ /*重置内容step2*/
|
|
|
+ Map<String,String> eMap=reviseValue(needTab,null,ekvMap);
|
|
|
+
|
|
|
StringBuilder copyDataSql = new StringBuilder();
|
|
|
String tableName = obj.getInitTableName();
|
|
|
String col = nodeTabColsMap.get(tableName);
|
|
@@ -2035,6 +2059,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//delete SQL (先删除旧数据,再新增)
|
|
|
String delSql = "delete from " + tableName + " where p_key_id = " + obj.getPKeyId() + " ; ";
|
|
|
//insert into SQL
|
|
|
+ String testColVal=reviseCols(eMap,colVal,oldPKeyId,tableName);
|
|
|
+ StaticLog.info("KT3356:"+testColVal);
|
|
|
copyDataSql.append(delSql).append("insert into ").append(tableName).append(" (").append(col).append(") select ").append(colVal).append(" from ").append(tableName).append(" where p_key_id='").append(oldPKeyId).append("' LIMIT 1;");
|
|
|
resultTablesData.add(copyDataSql.toString());
|
|
|
}
|
|
@@ -2125,6 +2151,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
QueryProcessDataVO queryProcessDataVO = tabColsAllByTabNameMaps.get(tableName);
|
|
|
//组织复制表的数据的sql
|
|
|
if (queryProcessDataVO != null) {
|
|
|
+ /*重置内容step2*/
|
|
|
+ Map<String,String> eMap=reviseValue(needTab,null,ekvMap);
|
|
|
+
|
|
|
StringBuilder copyDataSql = new StringBuilder();
|
|
|
String col = queryProcessDataVO.getAncestors();
|
|
|
String colVal = queryProcessDataVO.getAncestors();
|
|
@@ -2132,6 +2161,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//delete SQL (先删除旧数据,再新增)
|
|
|
String delSql = "delete from " + tableName + " where p_key_id = " + needTab.getPKeyId() + " ; ";
|
|
|
//insert into SQL
|
|
|
+ String testColVal=reviseCols(eMap,colVal,oldPKeyId,tableName);
|
|
|
+ StaticLog.info("KT3356:"+testColVal);
|
|
|
copyDataSql.append(delSql).append("insert into ").append(tableName).append(" (").append(col).append(") select ").append(colVal).append(" from ").append(tableName).append(" where p_key_id='").append(oldPKeyId).append("' LIMIT 1;");
|
|
|
resultTablesData.add(copyDataSql.toString());
|
|
|
}
|