|
@@ -38,6 +38,7 @@ import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.node.ForestNodeMerger;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
+import org.springblade.core.tool.utils.StringUtil;
|
|
|
import org.springblade.evisa.feign.EVisaClient;
|
|
|
import org.springblade.evisa.vo.CertBeanVO;
|
|
|
import org.springblade.manager.entity.*;
|
|
@@ -356,6 +357,15 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if (StringUtils.isNotEmpty(copyVO.getNeedCopyPrimaryKeyId()) && copyVO.getCopyBatchToPaths().size() > 0) {
|
|
|
//查询被复制节点
|
|
|
WbsTreeContract wbsTreeContract = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(copyVO.getNeedCopyPrimaryKeyId());
|
|
|
+
|
|
|
+ //获取数据写入的节点信息
|
|
|
+ List<CopyContractTreeNodeVO.CopyBatch> batchPathList = copyVO.getCopyBatchToPaths();
|
|
|
+ //获取数据源节点
|
|
|
+ CopyContractTreeNodeVO.CopyBatch copyBatchResource = batchPathList.stream().filter(f -> f.getPrimaryKeyId().equals(wbsTreeContract.getPKeyId().toString())).findAny().orElse(null);
|
|
|
+ if (copyBatchResource != null) {
|
|
|
+ throw new ServiceException("请选择除【" + wbsTreeContract.getNodeName() + "】源节点之外的节点进行复制");
|
|
|
+ }
|
|
|
+
|
|
|
String tabOwner;
|
|
|
if (("1,2").equals(copyVO.getClassify()) || ("2,1").equals(copyVO.getClassify())) {
|
|
|
tabOwner = "1,2,3,4,5,6";
|
|
@@ -392,17 +402,27 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //获取数据写入的节点信息
|
|
|
- List<CopyContractTreeNodeVO.CopyBatch> batchPathList = copyVO.getCopyBatchToPaths();
|
|
|
//删除数据SQL
|
|
|
List<String> removeSqlList = new ArrayList<>();
|
|
|
//新增数据SQL
|
|
|
List<String> saveSqlList = new ArrayList<>();
|
|
|
+ //已上报状态的节点名称
|
|
|
+ Map<String, String> taskStatusMap = new HashMap<>();
|
|
|
|
|
|
for (CopyContractTreeNodeVO.CopyBatch copyBatch : batchPathList) {
|
|
|
//获取选择的节点信息
|
|
|
WbsTreeContract selectNode = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(copyBatch.getPrimaryKeyId());
|
|
|
|
|
|
+ //判断该节点是否已上报,1=待审批,2=已审批均属于已上报
|
|
|
+ String sqlSb = "select classify from u_information_query where type = 1 and status in (1,2) and wbs_id = " + selectNode.getPKeyId() + " and classify in (" + copyVO.getClassify() + ")";
|
|
|
+ List<InformationQuery> query = jdbcTemplate.query(sqlSb, new BeanPropertyRowMapper<>(InformationQuery.class));
|
|
|
+ if (query.size() > 0) {
|
|
|
+ for (InformationQuery informationQuery : query) {
|
|
|
+ taskStatusMap.put((new Integer(1)).equals(informationQuery.getClassify()) ? "施工" : "监理", selectNode.getNodeName());
|
|
|
+ }
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
//实际获取的数据
|
|
|
Map<String, List<List<Map<String, Object>>>> currentDataMap = new HashMap<>();
|
|
|
|
|
@@ -468,6 +488,16 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (taskStatusMap.size() > 0) {
|
|
|
+ List<String> str = new ArrayList<>();
|
|
|
+ for (Map.Entry<String, String> map : taskStatusMap.entrySet()) {
|
|
|
+ str.add("【" + map.getValue() + "-" + map.getKey() + "】");
|
|
|
+ }
|
|
|
+ String join = StringUtils.join(str, "、");
|
|
|
+ throw new ServiceException(StringUtil.format("节点{}已上报,无法复制数据,请重新选择", join));
|
|
|
+ }
|
|
|
+
|
|
|
//删除原本填写的数据,覆盖
|
|
|
if (removeSqlList.size() > 0) {
|
|
|
for (String sql : removeSqlList) {
|
|
@@ -486,7 +516,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
//复制附件信息
|
|
|
for (WbsTreeContract sourceDataObj : tableList) {
|
|
|
- if (sourceDataObj.getTabFileType() == 2) {
|
|
|
+ if (ObjectUtils.isNotEmpty(sourceDataObj.getTabFileType()) && sourceDataObj.getTabFileType() == 2) {
|
|
|
//获取源表中的附件信息
|
|
|
String sql = "select * from m_table_file where is_deleted = 0 and type = 2 and tab_id =" + sourceDataObj.getPKeyId();
|
|
|
List<TableFile> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TableFile.class));
|
|
@@ -1310,7 +1340,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
String sql = "select sort from m_wbs_tree_contract where contract_id = '" + node.getContractId() + "' and (id = '" + node.getId() + "' or old_id = '" + node.getId() + "')";
|
|
|
List<WbsTreeContract> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
List<Integer> collect = query.stream().filter(f -> ObjectUtils.isNotEmpty(f.getSort())).collect(Collectors.toList()).stream().map(WbsTreeContract::getSort).collect(Collectors.toList());
|
|
|
- Integer max=1;
|
|
|
+ Integer max = 1;
|
|
|
if (collect.size() > 0) {
|
|
|
max = collect.stream().reduce(collect.get(0), Integer::max);
|
|
|
} else {
|
|
@@ -1391,7 +1421,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
String sql = "select sort from m_wbs_tree_contract where contract_id = '" + node.getContractId() + "' and (id = '" + node.getId() + "' or old_id = '" + node.getId() + "')";
|
|
|
List<WbsTreeContract> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
List<Integer> collect = query.stream().filter(f -> ObjectUtils.isNotEmpty(f.getSort())).collect(Collectors.toList()).stream().map(WbsTreeContract::getSort).collect(Collectors.toList());
|
|
|
- Integer max=1;
|
|
|
+ Integer max = 1;
|
|
|
if (collect.size() > 0) {
|
|
|
max = collect.stream().reduce(collect.get(0), Integer::max);
|
|
|
} else {
|
|
@@ -1833,7 +1863,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
String sql = "select sort from m_wbs_tree_contract where contract_id = '" + treeContract.getContractId() + "' and (id = '" + half.getId() + "' or old_id = '" + half.getId() + "')";
|
|
|
List<WbsTreeContract> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
List<Integer> collect = query.stream().filter(f -> ObjectUtils.isNotEmpty(f.getSort())).collect(Collectors.toList()).stream().map(WbsTreeContract::getSort).collect(Collectors.toList());
|
|
|
- Integer max =1 ;
|
|
|
+ Integer max = 1;
|
|
|
if (collect.size() > 0) {
|
|
|
max = collect.stream().reduce(collect.get(0), Integer::max);
|
|
|
} else {
|
|
@@ -1912,7 +1942,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if (saveList.size() > 0) {
|
|
|
//保存施工日志
|
|
|
if (saveLedger.size() > 0) {
|
|
|
- this.constructionLedgerService.saveBatch(saveLedger,1000);
|
|
|
+ this.constructionLedgerService.saveBatch(saveLedger, 1000);
|
|
|
}
|
|
|
|
|
|
try {
|
|
@@ -2287,7 +2317,6 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
contractIds.add(contractIdRelation);
|
|
|
}
|
|
|
if (contractIds.size() > 0) {
|
|
|
- //原始classify=2时查不出数量统计,所以改成传1
|
|
|
if (StringUtils.isNotEmpty(parentId)) {
|
|
|
//子节点
|
|
|
rootTreeNode = this.informationQueryService.queryContractTreeSupervision(contractIds, parentId, Integer.parseInt(classifyType));
|