|
@@ -363,7 +363,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//获取数据源节点
|
|
|
CopyContractTreeNodeVO.CopyBatch copyBatchResource = batchPathList.stream().filter(f -> f.getPrimaryKeyId().equals(wbsTreeContract.getPKeyId().toString())).findAny().orElse(null);
|
|
|
if (copyBatchResource != null) {
|
|
|
- throw new ServiceException("请选择除【" + wbsTreeContract.getNodeName() + "】源节点之外的节点进行复制");
|
|
|
+ return R.fail("请选择除【" + wbsTreeContract.getNodeName() + "】源节点之外的节点进行复制");
|
|
|
}
|
|
|
|
|
|
String tabOwner;
|
|
@@ -388,17 +388,27 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//获取源数据
|
|
|
Map<String, List<List<Map<String, Object>>>> tableBusinessDataMap = new HashMap<>();
|
|
|
for (WbsTreeContract treeContract : tableList) {
|
|
|
- List<Map<String, Object>> tableBusinessData = this.jdbcTemplate.queryForList("select * from " + treeContract.getInitTableName() + " where p_key_id = " + treeContract.getPKeyId());
|
|
|
- if (tableBusinessData.size() > 0) {
|
|
|
- //设置参数
|
|
|
- List<List<Map<String, Object>>> list;
|
|
|
- if (tableBusinessDataMap.containsKey(treeContract.getId().toString())) {
|
|
|
- list = tableBusinessDataMap.get(treeContract.getId().toString());
|
|
|
- } else {
|
|
|
- list = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotEmpty(treeContract.getInitTableName())) {
|
|
|
+ //判断表是否存在
|
|
|
+ String isExitSql = "select * from information_schema.TABLES where TABLE_NAME='" + treeContract.getInitTableName() + "'";
|
|
|
+ List<Map<String, Object>> tabList = this.jdbcTemplate.queryForList(isExitSql);
|
|
|
+ if (tabList.size() == 0) {
|
|
|
+ continue; //未找到实体表跳过
|
|
|
+ }
|
|
|
+
|
|
|
+ String sql = "select * from " + treeContract.getInitTableName() + " where p_key_id = " + treeContract.getPKeyId();
|
|
|
+ List<Map<String, Object>> tableBusinessData = this.jdbcTemplate.queryForList(sql);
|
|
|
+ if (tableBusinessData.size() > 0) {
|
|
|
+ //设置参数
|
|
|
+ List<List<Map<String, Object>>> list;
|
|
|
+ if (tableBusinessDataMap.containsKey(treeContract.getId().toString())) {
|
|
|
+ list = tableBusinessDataMap.get(treeContract.getId().toString());
|
|
|
+ } else {
|
|
|
+ list = new ArrayList<>();
|
|
|
+ }
|
|
|
+ list.add(tableBusinessData);
|
|
|
+ tableBusinessDataMap.put(treeContract.getId().toString(), list);
|
|
|
}
|
|
|
- list.add(tableBusinessData);
|
|
|
- tableBusinessDataMap.put(treeContract.getId().toString(), list);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -495,7 +505,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
str.add("【" + map.getValue() + "-" + map.getKey() + "】");
|
|
|
}
|
|
|
String join = StringUtils.join(str, "、");
|
|
|
- throw new ServiceException(StringUtil.format("节点{}已上报,无法复制数据,请重新选择", join));
|
|
|
+ return R.fail(StringUtil.format("节点{}已上报,无法复制数据,请重新选择", join));
|
|
|
}
|
|
|
|
|
|
//删除原本填写的数据,覆盖
|
|
@@ -532,8 +542,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//新增源数据附件到复制节点下对应表中
|
|
|
tableFileClient.saveBatchFile(query, next.getPKeyId());
|
|
|
|
|
|
- //修改复制节点下对应表的按钮状态
|
|
|
- String updateStatus = "update m_wbs_tree_contract set tab_file_type = " + sourceDataObj.getTabFileType() + " ,is_tab_pdf = " + sourceDataObj.getIsTabPdf() + " ,pdf_url = '" + sourceDataObj.getPdfUrl() + "' ,is_buss_show = " + sourceDataObj.getIsBussShow() + " where p_key_id = " + next.getPKeyId();
|
|
|
+ //修改复制节点下对应表的文件上传的按钮状态
|
|
|
+ String updateStatus = "update m_wbs_tree_contract set tab_file_type = " + sourceDataObj.getTabFileType() + " where p_key_id = " + next.getPKeyId();
|
|
|
jdbcTemplate.execute(updateStatus);
|
|
|
|
|
|
iterator.remove();
|
|
@@ -542,7 +552,6 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
return R.data(true);
|
|
|
}
|
|
|
|