|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import io.swagger.annotations.*;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
@@ -561,27 +562,33 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//如果不匹配,默认为未填报
|
|
|
status = "1";
|
|
|
//查询表格
|
|
|
- List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId), "queryTable", classify);
|
|
|
- if (tableList != null && tableList.size() > 0) {
|
|
|
- for (WbsTreeContract table : tableList) {
|
|
|
- if (new Integer("2").equals(table.getIsTabPdf())) {
|
|
|
- //这些表格中,但凡有一个能够预览,就开放预览
|
|
|
- status = "2";
|
|
|
- break;
|
|
|
+ WbsTreeContract obj = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
|
|
|
+ if (ObjectUtils.isNotEmpty(obj)) {
|
|
|
+ List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(obj, "queryTable", classify);
|
|
|
+ if (tableList != null && tableList.size() > 0) {
|
|
|
+ for (WbsTreeContract table : tableList) {
|
|
|
+ if (new Integer("2").equals(table.getIsTabPdf())) {
|
|
|
+ //这些表格中,但凡有一个能够预览,就开放预览
|
|
|
+ status = "2";
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ break;
|
|
|
}
|
|
|
- break;
|
|
|
}
|
|
|
} else {
|
|
|
//查询表格
|
|
|
- List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId), "queryTable", classify);
|
|
|
- if (tableList != null && tableList.size() > 0) {
|
|
|
- for (WbsTreeContract table : tableList) {
|
|
|
- if (new Integer("2").equals(table.getIsTabPdf())) {
|
|
|
- //这些表格中,但凡有一个能够预览,就开放预览
|
|
|
- status = "2";
|
|
|
- break;
|
|
|
+ WbsTreeContract obj = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
|
|
|
+ if (ObjectUtils.isNotEmpty(obj)) {
|
|
|
+ List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(obj, "queryTable", classify);
|
|
|
+ if (tableList != null && tableList.size() > 0) {
|
|
|
+ for (WbsTreeContract table : tableList) {
|
|
|
+ if (new Integer("2").equals(table.getIsTabPdf())) {
|
|
|
+ //这些表格中,但凡有一个能够预览,就开放预览
|
|
|
+ status = "2";
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1127,6 +1134,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if (new Integer("1").equals(node.getType())) {
|
|
|
//如果是节点类型才重塑ID
|
|
|
newData.setId(oldToNewIdMap.containsKey(node.getId()) ? oldToNewIdMap.get(node.getId()) : SnowFlakeUtil.getId());
|
|
|
+
|
|
|
+ //划分编号
|
|
|
+ newData.setPartitionCode(StringUtils.isNotEmpty(vo.getPartitionCode()) ? vo.getPartitionCode() : null);
|
|
|
}
|
|
|
//设置父节点ID
|
|
|
if (vo.getNeedCopyPrimaryKeyId().equals(node.getPKeyId().toString())) {
|
|
@@ -1149,8 +1159,6 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//初始化PDF路径
|
|
|
newData.setPdfUrl(null);
|
|
|
newData.setCreateUser(AuthUtil.getUserId());
|
|
|
- //划分编号
|
|
|
- newData.setPartitionCode(StringUtils.isNotEmpty(node.getPartitionCode()) ? node.getPartitionCode() : null);
|
|
|
|
|
|
//获取当前所有复制的节点的最大sort
|
|
|
String sql = "select sort from m_wbs_tree_contract where contract_id = '" + node.getContractId() + "' and (id = '" + node.getId() + "' or old_id = '" + node.getId() + "')";
|
|
@@ -1202,6 +1210,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//设置新ID
|
|
|
if (new Integer("1").equals(node.getType())) {
|
|
|
newData.setId(oldToNewIdMap.containsKey(node.getId()) ? oldToNewIdMap.get(node.getId()) : SnowFlakeUtil.getId());
|
|
|
+
|
|
|
+ //划分编号
|
|
|
+ newData.setPartitionCode(StringUtils.isNotEmpty(node.getPartitionCode()) ? node.getPartitionCode() : null);
|
|
|
}
|
|
|
//设置父节点ID
|
|
|
if (vo.getNeedCopyPrimaryKeyId().equals(node.getPKeyId().toString())) {
|
|
@@ -1224,8 +1235,6 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
newData.setIsTabPdf(1);
|
|
|
//初始化PDF路径
|
|
|
newData.setPdfUrl(null);
|
|
|
- //划分编号
|
|
|
- newData.setPartitionCode(StringUtils.isNotEmpty(copyBatch.getPartitionCode()) ? copyBatch.getPartitionCode() : null);
|
|
|
|
|
|
//获取当前所有复制的节点的最大sort
|
|
|
String sql = "select sort from m_wbs_tree_contract where contract_id = '" + node.getContractId() + "' and (id = '" + node.getId() + "' or old_id = '" + node.getId() + "')";
|