|
@@ -139,7 +139,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 29)
|
|
|
@ApiOperation(value = "获取文件题名")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "queryId", value = "列表ID", required = true)
|
|
|
+ @ApiImplicitParam(name = "queryId", value = "列表ID", required = true)
|
|
|
})
|
|
|
public R<String> queryFirstDocumentTitle(@RequestParam String queryId) {
|
|
|
InformationQuery query = this.informationQueryService.getById(queryId);
|
|
@@ -156,8 +156,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 28)
|
|
|
@ApiOperation(value = "获取文件题名")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "primaryKeyId", value = "节点的primaryKeyId", required = true),
|
|
|
- @ApiImplicitParam(name = "classify", value = "当前所选的类型", required = true)
|
|
|
+ @ApiImplicitParam(name = "primaryKeyId", value = "节点的primaryKeyId", required = true),
|
|
|
+ @ApiImplicitParam(name = "classify", value = "当前所选的类型", required = true)
|
|
|
})
|
|
|
public R<String> queryDocumentTitle(@RequestParam String primaryKeyId, @RequestParam Integer classify) {
|
|
|
List<InformationQuery> result = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getClassify, classify).eq(InformationQuery::getWbsId, primaryKeyId));
|
|
@@ -227,9 +227,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
//根据id、nodeName去重
|
|
|
List<WbsTreeContract> resultNodeData = queryValueList.stream().collect(
|
|
|
- Collectors.collectingAndThen(
|
|
|
- Collectors.toCollection(() -> new TreeSet<>(
|
|
|
- Comparator.comparing(o -> o.getId() + ";" + o.getNodeName()))), ArrayList::new));
|
|
|
+ Collectors.collectingAndThen(
|
|
|
+ Collectors.toCollection(() -> new TreeSet<>(
|
|
|
+ Comparator.comparing(o -> o.getId() + ";" + o.getNodeName()))), ArrayList::new));
|
|
|
|
|
|
//处理参数
|
|
|
this.queryContractTree(associatedVONodeList, resultNodeData, 2);
|
|
@@ -302,9 +302,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
//根据id、nodeName去重
|
|
|
List<WbsTreeContract> resultNodeData = queryValueList.stream().collect(
|
|
|
- Collectors.collectingAndThen(
|
|
|
- Collectors.toCollection(() -> new TreeSet<>(
|
|
|
- Comparator.comparing(o -> o.getId() + ";" + o.getNodeName()))), ArrayList::new));
|
|
|
+ Collectors.collectingAndThen(
|
|
|
+ Collectors.toCollection(() -> new TreeSet<>(
|
|
|
+ Comparator.comparing(o -> o.getId() + ";" + o.getNodeName()))), ArrayList::new));
|
|
|
|
|
|
this.queryContractTree(associatedVONodeList, resultNodeData, 1);
|
|
|
|
|
@@ -615,7 +615,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
public R<Object> abolishOneSJ(@RequestParam String primaryKeyId, @RequestParam String id, @RequestParam String projectId, @RequestParam String contractId) {
|
|
|
//查询填报状态
|
|
|
InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery()
|
|
|
- .eq(InformationQuery::getId, id));
|
|
|
+ .eq(InformationQuery::getId, id));
|
|
|
if (businessData != null) {
|
|
|
//使用批量废除接口
|
|
|
return this.batchAbolish(businessData.getId().toString(), primaryKeyId, projectId, contractId);
|
|
@@ -759,8 +759,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
String status = "1";
|
|
|
//查询填报状态,type=3首件
|
|
|
InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery()
|
|
|
- .eq(InformationQuery::getId, id)
|
|
|
- .eq(InformationQuery::getType, 3)
|
|
|
+ .eq(InformationQuery::getId, id)
|
|
|
+ .eq(InformationQuery::getType, 3)
|
|
|
);
|
|
|
if (businessData != null) {
|
|
|
switch (businessData.getStatus()) {
|
|
@@ -825,7 +825,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
String status = "1";
|
|
|
//查询填报状态,type=2试验
|
|
|
InformationQuery businessData = this.informationQueryService.getBaseMapper().selectList(Wrappers.<InformationQuery>lambdaQuery()
|
|
|
- .eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2)).stream().findAny().orElse(null);
|
|
|
+ .eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2)).stream().findAny().orElse(null);
|
|
|
if (businessData != null) {
|
|
|
switch (businessData.getStatus()) {
|
|
|
case 0:
|
|
@@ -887,17 +887,25 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if (ObjectUtil.isNotEmpty(startTaskVO.getTrialSelfInspectionRecordId())) {
|
|
|
//试验
|
|
|
businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()).eq(InformationQuery::getType, 2));
|
|
|
+ if (businessData != null) {
|
|
|
+ //设置业务数据ID
|
|
|
+ startTaskVO.setIds(businessData.getWbsId().toString());
|
|
|
+ startTaskVO.setTrialSelfInspectionRecordId(1L);
|
|
|
+ return this.batchTask(startTaskVO);
|
|
|
+ } else {
|
|
|
+ return R.data(300, false, "未查询到填报信息,上报失败");
|
|
|
+ }
|
|
|
} else { //质检
|
|
|
businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()).eq(InformationQuery::getType, 1));
|
|
|
+ if (businessData != null) {
|
|
|
+ //设置业务数据ID
|
|
|
+ startTaskVO.setIds(businessData.getId().toString());
|
|
|
+ return this.batchTask(startTaskVO);
|
|
|
+ } else {
|
|
|
+ return R.data(300, false, "未查询到填报信息,上报失败");
|
|
|
+ }
|
|
|
}
|
|
|
- //处理上报信息
|
|
|
- if (businessData != null) {
|
|
|
- //设置业务数据ID
|
|
|
- startTaskVO.setIds(businessData.getId().toString());
|
|
|
- return this.batchTask(startTaskVO);
|
|
|
- } else {
|
|
|
- return R.data(300, false, "未查询到填报信息,上报失败");
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1009,47 +1017,45 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
List<InformationQuery> result = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getId, Arrays.asList(ids.split(","))));
|
|
|
|
|
|
|
|
|
-
|
|
|
if (result != null && result.size() > 0) {
|
|
|
//删除掉pdfUrl和eVisaPdfUrl都为空的数据
|
|
|
/** 任务审批查看时,把节点附件列表跟在上报文件后面*/
|
|
|
|
|
|
|
|
|
-
|
|
|
result.removeIf(query -> StringUtils.isEmpty(query.getPdfUrl()) && StringUtils.isEmpty(query.getPdfUrl()));
|
|
|
if (result.size() > 0) {
|
|
|
List<String> urls = new ArrayList<>();
|
|
|
/* result.forEach(query -> urls.add(
|
|
|
StringUtils.isNotEmpty(query.getNodePdfUrl()) ? query.getNodePdfUrl() + "@@@" + query.getName() + "-" + query.getId() : query.getPdfUrl() + "@@@" + query.getName() + "-" + query.getId()));
|
|
|
*/
|
|
|
- for(InformationQuery query:result){
|
|
|
+ for (InformationQuery query : result) {
|
|
|
String url_link = "";
|
|
|
- List<TaskApprovalVO.ApprovalFile> files = jdbcTemplate.query("select name as fileName,domain_url as fileUrl from m_table_file where is_deleted = 0 and type in(10,11,12)and tab_id = ?",new BeanPropertyRowMapper<>(TaskApprovalVO.ApprovalFile.class),query.getWbsId());
|
|
|
+ List<TaskApprovalVO.ApprovalFile> files = jdbcTemplate.query("select name as fileName,domain_url as fileUrl from m_table_file where is_deleted = 0 and type in(10,11,12)and tab_id = ?", new BeanPropertyRowMapper<>(TaskApprovalVO.ApprovalFile.class), query.getWbsId());
|
|
|
List<String> url = new ArrayList();
|
|
|
- if (ObjectUtil.isNotEmpty(files)){
|
|
|
- for (TaskApprovalVO.ApprovalFile da:files){
|
|
|
+ if (ObjectUtil.isNotEmpty(files)) {
|
|
|
+ for (TaskApprovalVO.ApprovalFile da : files) {
|
|
|
url.add(da.getFileUrl());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(query!=null && Func.isNull(query.getEVisaPdfUrl())){
|
|
|
+ if (query != null && Func.isNull(query.getEVisaPdfUrl())) {
|
|
|
url.add(query.getEVisaPdfUrl());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
url.add(query.getPdfUrl());
|
|
|
}
|
|
|
|
|
|
- if(urls!=null && urls.size()>1){
|
|
|
- String localUrl = FileUtils.getSysLocalFileUrl()+"\\" + query.getId()+".pdf";
|
|
|
- FileUtils.mergePdfPublicMethods(url,localUrl);
|
|
|
- BladeFile bladeFile = newIOSSClient.uploadFile(query.getId()+".pdf",localUrl);
|
|
|
+ if (urls != null && urls.size() > 1) {
|
|
|
+ String localUrl = FileUtils.getSysLocalFileUrl() + "\\" + query.getId() + ".pdf";
|
|
|
+ FileUtils.mergePdfPublicMethods(url, localUrl);
|
|
|
+ BladeFile bladeFile = newIOSSClient.uploadFile(query.getId() + ".pdf", localUrl);
|
|
|
if (bladeFile != null && ObjectUtils.isNotEmpty(bladeFile.getLink())) {
|
|
|
- url.add( bladeFile.getLink());
|
|
|
+ url.add(bladeFile.getLink());
|
|
|
}
|
|
|
|
|
|
- }else if(urls!=null && urls.size()==1){
|
|
|
+ } else if (urls != null && urls.size() == 1) {
|
|
|
url_link = url.get(0);
|
|
|
}
|
|
|
- url.add(url_link+ "@@@" + query.getName() + "-" + query.getId());
|
|
|
+ url.add(url_link + "@@@" + query.getName() + "-" + query.getId());
|
|
|
}
|
|
|
|
|
|
//删除空数据
|
|
@@ -1081,9 +1087,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if (taskList.size() == 0) {
|
|
|
//试验
|
|
|
List<InformationQuery> dataList = this.informationQueryService.getBaseMapper().selectList(Wrappers.<InformationQuery>lambdaQuery()
|
|
|
- .select(InformationQuery::getId)
|
|
|
- .eq(InformationQuery::getType, 2)
|
|
|
- .in(InformationQuery::getWbsId, Func.toStrList(ids)));
|
|
|
+ .select(InformationQuery::getId)
|
|
|
+ .eq(InformationQuery::getType, 2)
|
|
|
+ .in(InformationQuery::getWbsId, Func.toStrList(ids)));
|
|
|
if (dataList.size() > 0) {
|
|
|
List<Long> dataIds = dataList.stream().map(InformationQuery::getId).collect(Collectors.toList());
|
|
|
taskList = this.taskClient.queryTaskListByFormDataId(StringUtils.join(dataIds, ","));
|
|
@@ -1155,18 +1161,18 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
//保存通知记录
|
|
|
this.messageWarningClient.savePushUserMessageWarning(
|
|
|
- new MessageWarningVO(
|
|
|
- query.getProjectId(),
|
|
|
- query.getContractId(),
|
|
|
- //废除通知
|
|
|
- 3,
|
|
|
- //内容
|
|
|
- projectName + contractName + "的用户【" + AuthUtil.getNickName() + "】废除了【" + query.getName() + "】",
|
|
|
- //推送的目标人
|
|
|
- Long.parseLong(strs[0]),
|
|
|
- //默认未读
|
|
|
- 0
|
|
|
- ));
|
|
|
+ new MessageWarningVO(
|
|
|
+ query.getProjectId(),
|
|
|
+ query.getContractId(),
|
|
|
+ //废除通知
|
|
|
+ 3,
|
|
|
+ //内容
|
|
|
+ projectName + contractName + "的用户【" + AuthUtil.getNickName() + "】废除了【" + query.getName() + "】",
|
|
|
+ //推送的目标人
|
|
|
+ Long.parseLong(strs[0]),
|
|
|
+ //默认未读
|
|
|
+ 0
|
|
|
+ ));
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(query.getProjectId()) && ObjectUtil.isNotEmpty(query.getContractId()) && ObjectUtil.isNotEmpty(strs[0])) {
|
|
|
String param = strs[0] + "," + query.getProjectId() + "," + query.getContractId();
|
|
@@ -1186,16 +1192,16 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
List<MessageWarningVO> messageList = new ArrayList<>();
|
|
|
for (TaskParallel taskParallel : linkList) {
|
|
|
messageList.add(new MessageWarningVO(
|
|
|
- Long.parseLong(task.getProjectId()),
|
|
|
- Long.parseLong(task.getContractId()),
|
|
|
- //废除通知
|
|
|
- 3,
|
|
|
- //内容
|
|
|
- (StringUtils.isNotEmpty(projectInfo.getProjectAlias()) ? projectInfo.getProjectAlias() : projectInfo.getProjectName()) + contractInfo.getContractName() + "的用户" + AuthUtil.getNickName() + "废除了【" + query.getName() + "】流程,请及时查看",
|
|
|
- //推送的目标人
|
|
|
- Long.parseLong(taskParallel.getTaskUser()),
|
|
|
- //默认未读
|
|
|
- 0
|
|
|
+ Long.parseLong(task.getProjectId()),
|
|
|
+ Long.parseLong(task.getContractId()),
|
|
|
+ //废除通知
|
|
|
+ 3,
|
|
|
+ //内容
|
|
|
+ (StringUtils.isNotEmpty(projectInfo.getProjectAlias()) ? projectInfo.getProjectAlias() : projectInfo.getProjectName()) + contractInfo.getContractName() + "的用户" + AuthUtil.getNickName() + "废除了【" + query.getName() + "】流程,请及时查看",
|
|
|
+ //推送的目标人
|
|
|
+ Long.parseLong(taskParallel.getTaskUser()),
|
|
|
+ //默认未读
|
|
|
+ 0
|
|
|
));
|
|
|
}
|
|
|
if (messageList.size() > 0) {
|
|
@@ -1281,11 +1287,11 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//试验批量上报
|
|
|
String trialIds = "";
|
|
|
Map<Long, Long> mapKey = new HashMap<>();
|
|
|
- if (queryList.size() == 0 ) {
|
|
|
+ if (queryList.size() == 0) {
|
|
|
//试验填报数据
|
|
|
queryList = new ArrayList<>(this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, Arrays.asList(ids))));
|
|
|
//重新绑定trialSelfInspectionRecordId使用map
|
|
|
- if(appType == 1L){ // 试验上报
|
|
|
+ if (appType == 1L) { // 试验上报
|
|
|
for (InformationQuery informationQuery : queryList) {
|
|
|
mapKey.put(informationQuery.getId(), informationQuery.getWbsId());
|
|
|
}
|
|
@@ -1327,9 +1333,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//设置数据源指向
|
|
|
taskVO.setFormDataId(id);
|
|
|
//设置上报类型
|
|
|
- if(appType!=null && appType==2L){
|
|
|
+ if (appType != null && appType == 2L) {
|
|
|
taskVO.setApprovalType(8);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
taskVO.setApprovalType(1);
|
|
|
}
|
|
|
|
|
@@ -1361,21 +1367,21 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
|
|
|
// 为多单上报 状态修改
|
|
|
- if(appType!=null && appType == 2L){
|
|
|
+ if (appType != null && appType == 2L) {
|
|
|
//获取当前时间
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
//格式化时间
|
|
|
String nowFormat = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
- String sql = "update u_entrust_info set status = 2 , entrust_time = '"+ nowFormat + "' ,sample_status=1 where id = " + startTaskVO.getIds();
|
|
|
+ String sql = "update u_entrust_info set status = 2 , entrust_time = '" + nowFormat + "' ,sample_status=1 where id = " + startTaskVO.getIds();
|
|
|
jdbcTemplate.execute(sql);
|
|
|
}
|
|
|
var = true;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return R.fail("创建主流程失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(trialIds) && var && appType==1L) {
|
|
|
+ if (StringUtils.isNotEmpty(trialIds) && var && appType == 1L) {
|
|
|
//修改试验记录上报任务状态(批量上报)
|
|
|
String sql = "update u_trial_self_inspection_record set task_status = '待审批' where id in(" + trialIds + ")";
|
|
|
jdbcTemplate.execute(sql);
|
|
@@ -1510,20 +1516,20 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
Map<Long, Map<String, Object>> colMaps = new HashMap<>();
|
|
|
if (vo.getIsCopyData() == 1) {
|
|
|
List<String> tabNames = nodeChildAll.stream()
|
|
|
- .map(WbsTreeContract::getInitTableName)
|
|
|
- .filter(ObjectUtil::isNotEmpty)
|
|
|
- .distinct()
|
|
|
- .collect(Collectors.toList());
|
|
|
+ .map(WbsTreeContract::getInitTableName)
|
|
|
+ .filter(ObjectUtil::isNotEmpty)
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
String inClausePlaceholders = String.join(",", Collections.nCopies(tabNames.size(), "?"));
|
|
|
String sql = "SELECT table_name AS queryType, GROUP_CONCAT(COLUMN_name) AS ancestors " +
|
|
|
- "FROM information_schema.COLUMNS WHERE table_name IN (" + inClausePlaceholders + ") " +
|
|
|
- "GROUP BY table_name";
|
|
|
+ "FROM information_schema.COLUMNS WHERE table_name IN (" + inClausePlaceholders + ") " +
|
|
|
+ "GROUP BY table_name";
|
|
|
Object[] params = tabNames.toArray();
|
|
|
List<Map<String, Object>> results = jdbcTemplate.queryForList(sql, params);
|
|
|
|
|
|
Map<String, List<WbsTreeContract>> tabsGroup = nodeChildAll.stream()
|
|
|
- .filter(f -> f.getType() == 2 && ObjectUtil.isNotEmpty(f.getInitTableName()))
|
|
|
- .collect(Collectors.groupingBy(WbsTreeContract::getInitTableName));
|
|
|
+ .filter(f -> f.getType() == 2 && ObjectUtil.isNotEmpty(f.getInitTableName()))
|
|
|
+ .collect(Collectors.groupingBy(WbsTreeContract::getInitTableName));
|
|
|
|
|
|
Set<Long> continuePkeyIds = new HashSet<>();
|
|
|
for (Map<String, Object> result : results) {
|
|
@@ -1534,8 +1540,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
|
|
|
List<String> filteredList = Arrays.stream(col.split(","))
|
|
|
- .filter(value -> !value.equals("id") && !value.equals("p_key_id") && !value.equals("group_id"))
|
|
|
- .collect(Collectors.toList());
|
|
|
+ .filter(value -> !value.equals("id") && !value.equals("p_key_id") && !value.equals("group_id"))
|
|
|
+ .collect(Collectors.toList());
|
|
|
String keys = StringUtils.join(filteredList, ",");
|
|
|
List<WbsTreeContract> tabs = tabsGroup.get(tabName);
|
|
|
for (WbsTreeContract tab : tabs) {
|
|
@@ -1597,8 +1603,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
/*处理复制表数据*/
|
|
|
if (nodeOld.getType() == 2 && vo.getIsCopyData() == 1
|
|
|
- && StringUtils.isNotEmpty(newData.getInitTableName())
|
|
|
- && tabOwner.contains(nodeOld.getTableOwner())) {
|
|
|
+ && StringUtils.isNotEmpty(newData.getInitTableName())
|
|
|
+ && tabOwner.contains(nodeOld.getTableOwner())) {
|
|
|
|
|
|
/*获取表对应的实体数据*/
|
|
|
Map<String, Object> resultMap = colMaps.getOrDefault(nodeOld.getPKeyId(), null);
|
|
@@ -1636,15 +1642,15 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
String delSql = "DELETE FROM " + newData.getInitTableName() + " WHERE p_key_id = " + newData.getPKeyId() + " ; ";
|
|
|
//insert SQL
|
|
|
copySql.append(delSql)
|
|
|
- .append("INSERT INTO ")
|
|
|
- .append(newData.getInitTableName())
|
|
|
- .append(" (id,p_key_id,group_id")
|
|
|
- .append(keysHaveValue)
|
|
|
- .append(") VALUES (")
|
|
|
- .append(SnowFlakeUtil.getId()).append(",")
|
|
|
- .append(newData.getPKeyId()).append(",null")
|
|
|
- .append(newString)
|
|
|
- .append(");");
|
|
|
+ .append("INSERT INTO ")
|
|
|
+ .append(newData.getInitTableName())
|
|
|
+ .append(" (id,p_key_id,group_id")
|
|
|
+ .append(keysHaveValue)
|
|
|
+ .append(") VALUES (")
|
|
|
+ .append(SnowFlakeUtil.getId()).append(",")
|
|
|
+ .append(newData.getPKeyId()).append(",null")
|
|
|
+ .append(newString)
|
|
|
+ .append(");");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2033,11 +2039,11 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
for (String k : colsList) {
|
|
|
if (p2.containsKey(k)) {
|
|
|
Object value = reviseValue(p2, k, origin.get(k));
|
|
|
- if (value != null ) {
|
|
|
- if( value.toString().contains("_^_")) {
|
|
|
+ if (value != null) {
|
|
|
+ if (value.toString().contains("_^_")) {
|
|
|
value = "'" + value + "'";
|
|
|
target.set(target.indexOf(k), value.toString());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
target.set(target.indexOf(k), StringPool.NULL);
|
|
|
}
|
|
|
}
|
|
@@ -2147,11 +2153,11 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
List<WbsTreeContract> needCopyNodeTabs = this.getChildNodesTables(wbsTreeContractsNeed, needCopyNode.getContractId());
|
|
|
List<WbsTreeContract> toCopyNodeTabs = this.getChildNodesTables(wbsTreeContractsTo, needCopyNode.getContractId());
|
|
|
Map<String, WbsTreeContract> toCopyNodeTabsMaps = toCopyNodeTabs.stream()
|
|
|
- .collect(Collectors.toMap(
|
|
|
- obj -> obj.getNodeName() + "-" + obj.getHtmlUrl(),
|
|
|
- Function.identity(),
|
|
|
- (existing, replacement) -> existing
|
|
|
- ));
|
|
|
+ .collect(Collectors.toMap(
|
|
|
+ obj -> obj.getNodeName() + "-" + obj.getHtmlUrl(),
|
|
|
+ Function.identity(),
|
|
|
+ (existing, replacement) -> existing
|
|
|
+ ));
|
|
|
if (needCopyNodeTabs.size() > 0) {
|
|
|
for (WbsTreeContract needTab : needCopyNodeTabs) {
|
|
|
if (ObjectUtil.isNotEmpty(needTab.getHtmlUrl())) {
|
|
@@ -2493,7 +2499,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
* 递归获取所有子级节点
|
|
|
*/
|
|
|
private void recursionGetChildNodes(List<WbsTreeContract> list, List<WbsTreeContract> result, String
|
|
|
- contractId) {
|
|
|
+ contractId) {
|
|
|
List<Long> ids = list.stream().map(WbsTreeContract::getId).collect(Collectors.toList());
|
|
|
if (ids.size() > 0) {
|
|
|
List<WbsTreeContract> query = jdbcTemplate.query("select * from m_wbs_tree_contract where type = 1 and parent_id in(" + StringUtils.join(ids, ",") + ") and status = 1 and is_deleted = 0 and contract_id = " + contractId, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
@@ -2604,9 +2610,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 14)
|
|
|
@ApiOperation(value = "导图结构树节点查询")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "parentId", value = "父节点,首次进入传0、null、''", required = true),
|
|
|
- @ApiImplicitParam(name = "wbsType", value = "模板类型, 1质检,2试验", required = true),
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
+ @ApiImplicitParam(name = "parentId", value = "父节点,首次进入传0、null、''", required = true),
|
|
|
+ @ApiImplicitParam(name = "wbsType", value = "模板类型, 1质检,2试验", required = true),
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
})
|
|
|
public R<List<WbsTreeContractTreeVOS>> queryMappingStructureTree(@RequestParam String parentId,
|
|
|
@RequestParam String contractId,
|
|
@@ -2658,12 +2664,14 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 13)
|
|
|
@ApiOperation(value = "修改节点信息")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "pKeyId", value = "节点的primaryKeyId", required = true),
|
|
|
- @ApiImplicitParam(name = "nodeName", value = "节点的title", required = true),
|
|
|
- @ApiImplicitParam(name = "partitionCode", value = "划分编号")
|
|
|
+ @ApiImplicitParam(name = "pKeyId", value = "节点的primaryKeyId", required = true),
|
|
|
+ @ApiImplicitParam(name = "nodeName", value = "节点的title", required = true),
|
|
|
+ @ApiImplicitParam(name = "partitionCode", value = "划分编号")
|
|
|
})
|
|
|
public R<Boolean> updateContractNodeParameter(@RequestParam Long pKeyId, @RequestParam String
|
|
|
- nodeName, @RequestParam String partitionCode) {
|
|
|
+ nodeName, @RequestParam String partitionCode, @RequestParam(required = false) Integer className,
|
|
|
+ @RequestParam(required = false) Integer unitName, @RequestParam(required = false) Integer excellentNum,
|
|
|
+ @RequestParam(required = false) Integer unitNum,@RequestParam(required = false)String digitizeTime) {
|
|
|
WbsTreeContract node = new WbsTreeContract();
|
|
|
node.setPKeyId(pKeyId);
|
|
|
node.setNodeName(nodeName);
|
|
@@ -2675,7 +2683,40 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
|
|
|
WbsTreeContract queries = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(pKeyId);
|
|
|
+ if (ObjectUtil.isNotEmpty(className) || ObjectUtil.isNotEmpty(unitName)) {
|
|
|
+ //查询当前节点的是否是子节点,以及当前节点父节点是否包含单元评定
|
|
|
+ String child = "SELECT * FROM m_wbs_tree_contract WHERE parent_id=" + queries.getId() + " AND is_deleted=0";
|
|
|
+ List<WbsTreeContract> childList = jdbcTemplate.query(child, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
+ if (childList.size() > 0) {
|
|
|
+ for (WbsTreeContract wbsTreeContract : childList) {
|
|
|
+ if (ObjectUtil.isEmpty(wbsTreeContract.getInitTableName())) {
|
|
|
+ return R.fail("当前节点存在子节点,不能设置标准分类和单元名称");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ String father = "SELECT * FROM m_wbs_tree_contract WHERE id=" + queries.getParentId()+" AND is_deleted=0";
|
|
|
+ List<WbsTreeContract> fatherNode = jdbcTemplate.query(father, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
+ if (ObjectUtil.isNotEmpty(fatherNode)&&fatherNode.size()>0) {
|
|
|
+ for (WbsTreeContract wbsTreeContract : fatherNode) {
|
|
|
+ if (wbsTreeContract.getIsClassifition() == Integer.valueOf(1)) {
|
|
|
+ return R.fail("当前节点的父节点包含单元评定");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(ObjectUtil.isNotEmpty(digitizeTime)){
|
|
|
+ node.setDigitizeTime(digitizeTime);
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(unitName) && ObjectUtil.isNotEmpty(className)) {
|
|
|
+ node.setIsClassifition(1);
|
|
|
+ node.setClassName(className);
|
|
|
+ node.setUnitName(unitName);
|
|
|
+ if (queries.getNodeClass() == Integer.valueOf(2)) {
|
|
|
+ node.setExcellentNum(excellentNum);
|
|
|
+ node.setUnitNum(unitNum);
|
|
|
+ }
|
|
|
+ }
|
|
|
//保存操作记录
|
|
|
try {
|
|
|
JSONObject json = new JSONObject();
|
|
@@ -2742,6 +2783,33 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询当前节点下的数据 是否包含监理填报数据
|
|
|
+ */
|
|
|
+ @PostMapping("/removeContractTreeNodeJudge")
|
|
|
+ @ApiOperationSupport(order = 11)
|
|
|
+ @ApiOperation(value = "删除节点前的校验判断")
|
|
|
+ @ApiImplicitParam(name = "ids", value = "节点的primaryKeyId")
|
|
|
+ public R removeContractTreeNodeJudge(@RequestParam String ids) {
|
|
|
+ //删除的节点
|
|
|
+ WbsTreeContract removeNode = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.parseLong(ids));
|
|
|
+
|
|
|
+ List<WbsTreeContract> removeNodeList = new ArrayList<>();
|
|
|
+ this.currentNodeAllChild(removeNodeList, Collections.singletonList(removeNode), removeNode.getContractId());
|
|
|
+
|
|
|
+ //获取pKeyId
|
|
|
+ List<Long> removeList = removeNodeList.stream().map(WbsTreeContract::getPKeyId).distinct().collect(Collectors.toList());
|
|
|
+ removeList.add(Long.parseLong(ids));
|
|
|
+ if (removeList.size() > 0) {
|
|
|
+ /** 判断是否子节点有上存在监理填报内容的资料,提示用户谨慎操作*/
|
|
|
+ List<WbsTreeContractTreeVOS> list = this.wbsTreeContractClient.selectContractJLForm(removeList);
|
|
|
+ if (list != null && list.size() >= 1) {
|
|
|
+ return R.data(300, false, "当前节点已存在监理资料,删除节点会把监理数据一并删除(永久删除),建议与监理方确认是否能删除该数据,请慎重删除!删除后果请自行负责。");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return R.data(true);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 删除节点
|
|
|
*
|
|
@@ -2881,6 +2949,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if (allSelectedNodeList.size() > 0) {
|
|
|
//查询数据
|
|
|
selectedNodeList = this.unifiedCode(allSelectedNodeList, treeContract, "1", query);
|
|
|
+
|
|
|
if (ObjectUtil.isEmpty(selectedNodeList)) {
|
|
|
return R.data(null);
|
|
|
}
|
|
@@ -2896,8 +2965,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
//处理重复的数据
|
|
|
selectedNodeList = selectedNodeList.stream().collect(Collectors.collectingAndThen(
|
|
|
- Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreePrivate::getId))),
|
|
|
- ArrayList::new
|
|
|
+ Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreePrivate::getId))),
|
|
|
+ ArrayList::new
|
|
|
));
|
|
|
}
|
|
|
//处理半选
|
|
@@ -2926,8 +2995,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
//处理重复的数据
|
|
|
selectedNodeList = selectedNodeList.stream().collect(Collectors.collectingAndThen(
|
|
|
- Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreePrivate::getId))),
|
|
|
- ArrayList::new
|
|
|
+ Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreePrivate::getId))),
|
|
|
+ ArrayList::new
|
|
|
));
|
|
|
}
|
|
|
}
|
|
@@ -2938,17 +3007,19 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
//封裝节点名称nodeName与id的Map
|
|
|
Map<Long, String> idAndNodeNameMaps = query.stream()
|
|
|
- .filter(wbsTreePrivate -> pKeyIds.contains(wbsTreePrivate.getPKeyId().toString()))
|
|
|
- .collect(Collectors.toMap(WbsTreePrivate::getId,
|
|
|
- wbsTreePrivate -> selectList.stream()
|
|
|
- .filter(node -> node.getPrimaryKeyId().equals(wbsTreePrivate.getPKeyId().toString()))
|
|
|
- .findFirst()
|
|
|
- .map(AddContractTreeNodeVO.Node::getNodeName)
|
|
|
- .orElse("")));
|
|
|
+ .filter(wbsTreePrivate -> pKeyIds.contains(wbsTreePrivate.getPKeyId().toString()))
|
|
|
+ .collect(Collectors.toMap(WbsTreePrivate::getId,
|
|
|
+ wbsTreePrivate -> selectList.stream()
|
|
|
+ .filter(node -> node.getPrimaryKeyId().equals(wbsTreePrivate.getPKeyId().toString()))
|
|
|
+ .findFirst()
|
|
|
+ .map(AddContractTreeNodeVO.Node::getNodeName)
|
|
|
+ .orElse("")));
|
|
|
+
|
|
|
|
|
|
//原始表ids,电签位置信息使用
|
|
|
List<Long> oldTabIds = selectedNodeList.stream().filter(f -> new Integer(2).equals(f.getType())).map(WbsTreePrivate::getId).collect(Collectors.toList());
|
|
|
|
|
|
+
|
|
|
//构造参数
|
|
|
if (selectedNodeList.size() > 0) {
|
|
|
//重塑关键信息
|
|
@@ -2997,19 +3068,19 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//自定义节点(非根节点才处理)
|
|
|
if (!newData.getParentId().equals(0L)) {
|
|
|
newData.setParentId(OldIdToNewIdMap.containsKey(half.getParentId())
|
|
|
- ? OldIdToNewIdMap.get(half.getParentId()) : treeContract.getId().equals(half.getParentId())
|
|
|
- ||
|
|
|
- treeContract.getOldId().equals(half.getParentId().toString())
|
|
|
- ? treeContract.getId() : SnowFlakeUtil.getId());
|
|
|
+ ? OldIdToNewIdMap.get(half.getParentId()) : treeContract.getId().equals(half.getParentId())
|
|
|
+ ||
|
|
|
+ treeContract.getOldId().equals(half.getParentId().toString())
|
|
|
+ ? treeContract.getId() : SnowFlakeUtil.getId());
|
|
|
}
|
|
|
} else {
|
|
|
//非自定义节点
|
|
|
//同节点
|
|
|
newData.setParentId(OldIdToNewIdMap.containsKey(half.getParentId())
|
|
|
- ? OldIdToNewIdMap.get(half.getParentId()) : treeContract.getId().equals(half.getParentId())
|
|
|
- ||
|
|
|
- treeContract.getOldId().equals(half.getParentId().toString())
|
|
|
- ? treeContract.getId() : SnowFlakeUtil.getId());
|
|
|
+ ? OldIdToNewIdMap.get(half.getParentId()) : treeContract.getId().equals(half.getParentId())
|
|
|
+ ||
|
|
|
+ treeContract.getOldId().equals(half.getParentId().toString())
|
|
|
+ ? treeContract.getId() : SnowFlakeUtil.getId());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -3124,7 +3195,15 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
saveList.clear();
|
|
|
saveList.addAll(customResult);
|
|
|
}
|
|
|
-
|
|
|
+ //找到最顶级节点设置parentId
|
|
|
+ WbsTreeContract topLevelNode = findTopLevelNode(saveList);
|
|
|
+ if (ObjectUtils.isNotEmpty(topLevelNode)) {
|
|
|
+ for (WbsTreeContract wbsTreeContract : saveList) {
|
|
|
+ if (topLevelNode.getPKeyId().equals(wbsTreeContract.getPKeyId())) {
|
|
|
+ wbsTreeContract.setParentId(treeContract.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
R<Boolean> booleanR = this.saveOrCopyNodeTree(saveList, saveLedger, 2, treeContract);
|
|
|
|
|
|
List<WbsTreeContract> nowTabs = saveList.stream().filter(f -> new Integer(2).equals(f.getType())).collect(Collectors.toList());
|
|
@@ -3135,6 +3214,19 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
return booleanR;
|
|
|
}
|
|
|
|
|
|
+ public static WbsTreeContract findTopLevelNode(List<WbsTreeContract> saveList) {
|
|
|
+ Set<Long> nodeIds = new HashSet<>();
|
|
|
+ for (WbsTreeContract node : saveList) {
|
|
|
+ nodeIds.add(node.getId());
|
|
|
+ }
|
|
|
+ for (WbsTreeContract node : saveList) {
|
|
|
+ if (!nodeIds.contains(node.getParentId())) {
|
|
|
+ return node;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
private void child(List<WbsTreeContract> resultChild, List<WbsTreeContract> nodeAll, WbsTreeContract root) {
|
|
|
for (WbsTreeContract node : nodeAll) {
|
|
|
if (Objects.equals(node.getParentId(), root.getId())) {
|
|
@@ -3201,18 +3293,18 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
|
|
|
private List<WbsTreePrivateAddVO> unifiedCode
|
|
|
- (List<AddContractTreeNodeVO.Node> allSelectedNodeList, WbsTreeContract treeContract, String
|
|
|
- saveType, List<WbsTreePrivate> queryResultP) {
|
|
|
+ (List<AddContractTreeNodeVO.Node> allSelectedNodeList, WbsTreeContract treeContract, String
|
|
|
+ saveType, List<WbsTreePrivate> queryResultP) {
|
|
|
//获取项目节点树的主键
|
|
|
List<Long> halfSelectedList = allSelectedNodeList.stream().map(AddContractTreeNodeVO.Node::getPrimaryKeyId).map(Long::parseLong).distinct().collect(Collectors.toList());
|
|
|
|
|
|
//获取项目对应的合同段的树原始节点的信息
|
|
|
List<WbsTreePrivateAddVO> query = jdbcTemplate.query("select *," +
|
|
|
- "(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id" +
|
|
|
- " AND b.type = 1 and b.status = 1 AND b.is_deleted = 0 AND b.project_id = " + treeContract.getProjectId() +
|
|
|
- " AND b.wbs_id = " + treeContract.getWbsId() + " AND b.wbs_type = " + treeContract.getWbsType() + ") AS low " +
|
|
|
- " FROM m_wbs_tree_private a WHERE p_key_id IN (" + StringUtils.join(halfSelectedList, ",") + ")",
|
|
|
- new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
|
|
|
+ "(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id" +
|
|
|
+ " AND b.type = 1 and b.status = 1 AND b.is_deleted = 0 AND b.project_id = " + treeContract.getProjectId() +
|
|
|
+ " AND b.wbs_id = " + treeContract.getWbsId() + " AND b.wbs_type = " + treeContract.getWbsType() + ") AS low " +
|
|
|
+ " FROM m_wbs_tree_private a WHERE p_key_id IN (" + StringUtils.join(halfSelectedList, ",") + ")",
|
|
|
+ new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
|
|
|
|
|
|
if (query.size() > 0) {
|
|
|
//返回结果集,匹配节点名称使用
|
|
@@ -3221,8 +3313,10 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//剔除与当前操作节点相同的ID,(如果saveType=1,表示当前及子级节点,那么就要剔除自己本身,否则视为仅当前节点操作,会存在自己本身)
|
|
|
if ("1".equals(saveType)) {
|
|
|
query.removeIf(wbsTreePrivate -> {
|
|
|
- Long id = wbsTreePrivate.getId();
|
|
|
- return treeContract.getId() != null && treeContract.getId().equals(id);
|
|
|
+ /*Long id = wbsTreePrivate.getId();
|
|
|
+ return treeContract.getId() != null && treeContract.getId().equals(id);*/
|
|
|
+ Long pKeyId = wbsTreePrivate.getPKeyId();
|
|
|
+ return treeContract.getIsTypePrivatePid() != null && treeContract.getIsTypePrivatePid().equals(pKeyId);
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -3233,18 +3327,18 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
|
|
|
private List<WbsTreePrivateAddVO> unifiedCode2
|
|
|
- (List<AddContractTreeNodeVO.Node> allSelectedNodeList, WbsTreeContract treeContract, String
|
|
|
- saveType, List<WbsTreePrivate> queryResultP) {
|
|
|
+ (List<AddContractTreeNodeVO.Node> allSelectedNodeList, WbsTreeContract treeContract, String
|
|
|
+ saveType, List<WbsTreePrivate> queryResultP) {
|
|
|
//获取项目节点树的主键
|
|
|
List<Long> halfSelectedList = allSelectedNodeList.stream().map(AddContractTreeNodeVO.Node::getPrimaryKeyId).map(Long::parseLong).distinct().collect(Collectors.toList());
|
|
|
|
|
|
//获取项目对应的合同段的树原始节点的信息
|
|
|
List<WbsTreePrivateAddVO> query = jdbcTemplate.query("select *," +
|
|
|
- "(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_private b WHERE b.parent_id = a.id" +
|
|
|
- " AND b.type = 2 and b.status = 1 AND b.is_deleted = 0 AND b.project_id = " + treeContract.getProjectId() +
|
|
|
- ") AS low " +
|
|
|
- " FROM m_wbs_tree_private a WHERE p_key_id IN (" + StringUtils.join(halfSelectedList, ",") + ")",
|
|
|
- new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
|
|
|
+ "(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_private b WHERE b.parent_id = a.id" +
|
|
|
+ " AND b.type = 2 and b.status = 1 AND b.is_deleted = 0 AND b.project_id = " + treeContract.getProjectId() +
|
|
|
+ ") AS low " +
|
|
|
+ " FROM m_wbs_tree_private a WHERE p_key_id IN (" + StringUtils.join(halfSelectedList, ",") + ")",
|
|
|
+ new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
|
|
|
|
|
|
if (query.size() > 0) {
|
|
|
//返回结果集,匹配节点名称使用
|
|
@@ -3253,8 +3347,10 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//剔除与当前操作节点相同的ID,(如果saveType=1,表示当前及子级节点,那么就要剔除自己本身,否则视为仅当前节点操作,会存在自己本身)
|
|
|
if ("1".equals(saveType)) {
|
|
|
query.removeIf(wbsTreePrivate -> {
|
|
|
- Long id = wbsTreePrivate.getId();
|
|
|
- return treeContract.getId() != null && treeContract.getId().equals(id);
|
|
|
+ /*Long id = wbsTreePrivate.getId();
|
|
|
+ return treeContract.getId() != null && treeContract.getId().equals(id);*/
|
|
|
+ Long pKeyId = wbsTreePrivate.getPKeyId();
|
|
|
+ return treeContract.getIsTypePrivatePid() != null && treeContract.getIsTypePrivatePid().equals(pKeyId);
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -3266,8 +3362,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
@NotNull
|
|
|
public R<Boolean> saveOrCopyNodeTree
|
|
|
- (List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger, Integer
|
|
|
- operationType, WbsTreeContract currentNode) {
|
|
|
+ (List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger, Integer
|
|
|
+ operationType, WbsTreeContract currentNode) {
|
|
|
if (saveList.size() > 0) {
|
|
|
//StringBuilder str = new StringBuilder();
|
|
|
//str.append("-" + saveList.get(0).getFullName());
|
|
@@ -3314,8 +3410,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
@NotNull
|
|
|
private R<Boolean> saveOrCopyNodeTree2
|
|
|
- (List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger, Integer
|
|
|
- operationType, WbsTreeContract currentNode) {
|
|
|
+ (List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger, Integer
|
|
|
+ operationType, WbsTreeContract currentNode) {
|
|
|
if (saveList.size() > 0) {
|
|
|
//StringBuilder str = new StringBuilder();
|
|
|
//str.append("-" + saveList.get(0).getFullName());
|
|
@@ -3379,15 +3475,17 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
//获取项目对应的合同段的树原始节点的信息
|
|
|
List<WbsTreePrivateAddVO> query = jdbcTemplate.query("select * from m_wbs_tree_private where p_key_id in(" + StringUtils.join(allSelectedList, ",") + ")",
|
|
|
- new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
|
|
|
+ new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
|
|
|
if (query.size() > 0) {
|
|
|
//返回结果集,匹配节点名称使用
|
|
|
queryResultP.addAll(query);
|
|
|
|
|
|
//剔除与当前操作节点相同的ID
|
|
|
query.removeIf(wbsTreePrivate -> {
|
|
|
- Long id = wbsTreePrivate.getId();
|
|
|
- return treeContract.getId() != null && treeContract.getId().equals(id);
|
|
|
+ /*Long id = wbsTreePrivate.getId();
|
|
|
+ return treeContract.getId() != null && treeContract.getId().equals(id);*/
|
|
|
+ Long pKeyId = wbsTreePrivate.getPKeyId();
|
|
|
+ return treeContract.getIsTypePrivatePid() != null && treeContract.getIsTypePrivatePid().equals(pKeyId);
|
|
|
});
|
|
|
|
|
|
//设置到集合中
|
|
@@ -3405,11 +3503,11 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
*/
|
|
|
private void foreachQueryChild(List<Long> parentIdsList, List<WbsTreePrivateAddVO> childList, WbsTreeContract wbsTreeContract) {
|
|
|
List<WbsTreePrivateAddVO> childS = jdbcTemplate.query("select * from m_wbs_tree_private" +
|
|
|
- " where parent_id in(" + StringUtils.join(parentIdsList, ",") + ")" +
|
|
|
- " and project_id = " + wbsTreeContract.getProjectId() +
|
|
|
- " and wbs_id = " + wbsTreeContract.getWbsId() +
|
|
|
- " and wbs_type = " + wbsTreeContract.getWbsType() +
|
|
|
- " and is_deleted = 0 and status = 1", new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
|
|
|
+ " where parent_id in(" + StringUtils.join(parentIdsList, ",") + ")" +
|
|
|
+ " and project_id = " + wbsTreeContract.getProjectId() +
|
|
|
+ " and wbs_id = " + wbsTreeContract.getWbsId() +
|
|
|
+ " and wbs_type = " + wbsTreeContract.getWbsType() +
|
|
|
+ " and is_deleted = 0 and status = 1", new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
|
|
|
if (childS.size() > 0) {
|
|
|
childList.addAll(childS);
|
|
|
}
|
|
@@ -3426,11 +3524,11 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 9)
|
|
|
@ApiOperation(value = "懒加载项目级工程划分树")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "projectId", value = "项目ID"),
|
|
|
- @ApiImplicitParam(name = "id", value = "点击节点ID")
|
|
|
+ @ApiImplicitParam(name = "projectId", value = "项目ID"),
|
|
|
+ @ApiImplicitParam(name = "id", value = "点击节点ID")
|
|
|
})
|
|
|
public R<List<WbsTreeContractTreeVOS>> queryWbsTreePrivateByProjectIdAndId(@RequestParam String
|
|
|
- projectId, @RequestParam String id) {
|
|
|
+ projectId, @RequestParam String id) {
|
|
|
List<WbsTreeContractTreeVOS> result = new ArrayList<>();
|
|
|
|
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
@@ -3464,11 +3562,11 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 9)
|
|
|
@ApiOperation(value = "懒加载合同段工程划分树")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同段ID"),
|
|
|
- @ApiImplicitParam(name = "id", value = "点击节点ID")
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段ID"),
|
|
|
+ @ApiImplicitParam(name = "id", value = "点击节点ID")
|
|
|
})
|
|
|
public R<List<WbsTreeContractTreeVOS>> queryWbsTreeContractByContractIdAndId(@RequestParam String
|
|
|
- contractId, @RequestParam String id) {
|
|
|
+ contractId, @RequestParam String id) {
|
|
|
List<WbsTreeContractTreeVOS> result = new ArrayList<>();
|
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
|
WbsTreeContractTreeVOS vos = new WbsTreeContractTreeVOS();
|
|
@@ -3569,10 +3667,10 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 4)
|
|
|
@ApiOperation(value = "分页")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "size", value = "当前页条数", required = true),
|
|
|
- @ApiImplicitParam(name = "current", value = "当前页", required = true),
|
|
|
- @ApiImplicitParam(name = "wbsId", value = "节点ID", required = true),
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
+ @ApiImplicitParam(name = "size", value = "当前页条数", required = true),
|
|
|
+ @ApiImplicitParam(name = "current", value = "当前页", required = true),
|
|
|
+ @ApiImplicitParam(name = "wbsId", value = "节点ID", required = true),
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
})
|
|
|
public R<IPage<InformationQueryVO>> page(@RequestBody InformationQueryVO vo) {
|
|
|
if (ObjectUtil.isEmpty(vo.getContractId())) {
|
|
@@ -3713,12 +3811,12 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 29)
|
|
|
@ApiOperation(value = "获取当前合同段的划分树")
|
|
|
@ApiImplicitParams(value = {
|
|
|
- @ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
+ @ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
})
|
|
|
public R<List<WbsTreeContractTreeVOS>> queryStandingBookContractWbsTree(@RequestParam String
|
|
|
- primaryKeyId, @RequestParam String parentId, @RequestParam String contractId, @RequestParam String
|
|
|
- contractIdRelation) {
|
|
|
+ primaryKeyId, @RequestParam String parentId, @RequestParam String contractId, @RequestParam String
|
|
|
+ contractIdRelation) {
|
|
|
if (StringUtils.isNotEmpty(primaryKeyId)) {
|
|
|
parentId = primaryKeyId;
|
|
|
}
|
|
@@ -3737,12 +3835,12 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 3)
|
|
|
@ApiOperation(value = "获取当前合同段的划分树")
|
|
|
@ApiImplicitParams(value = {
|
|
|
- @ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
|
|
|
- @ApiImplicitParam(name = "classifyType", value = "所属方,监理、总监办的资料查询使用,=1施工数据(默认),=2监理数据")
|
|
|
+ @ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
|
|
|
+ @ApiImplicitParam(name = "classifyType", value = "所属方,监理、总监办的资料查询使用,=1施工数据(默认),=2监理数据")
|
|
|
})
|
|
|
public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByContractIdAndType(@RequestParam String
|
|
|
- primaryKeyId,
|
|
|
+ primaryKeyId,
|
|
|
@RequestParam String parentId,
|
|
|
@RequestParam String contractId,
|
|
|
@RequestParam String contractIdRelation,
|
|
@@ -3773,8 +3871,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiOperation(value = "修改(只能修改编号和文件名)")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "name", value = "文件名称, 必须有值", required = true),
|
|
|
- @ApiImplicitParam(name = "number", value = "文件编号,可以为空")
|
|
|
+ @ApiImplicitParam(name = "name", value = "文件名称, 必须有值", required = true),
|
|
|
+ @ApiImplicitParam(name = "number", value = "文件编号,可以为空")
|
|
|
})
|
|
|
public R<Boolean> update(@Valid @RequestBody InformationQuery informationQuery) {
|
|
|
if ("null".equals(String.valueOf(informationQuery.getId())) || StringUtils.isEmpty(String.valueOf(informationQuery.getId()))) {
|
|
@@ -3804,11 +3902,11 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 28)
|
|
|
@ApiOperation(value = "首件wbs树")
|
|
|
@ApiImplicitParams(value = {
|
|
|
- @ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
+ @ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
})
|
|
|
public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByFirstInfo(@RequestParam String
|
|
|
- parentId, @RequestParam String contractId, @RequestParam String contractIdRelation) {
|
|
|
+ parentId, @RequestParam String contractId, @RequestParam String contractIdRelation) {
|
|
|
List<WbsTreeContractTreeVOS> rootTreeNode = informationQueryService.queryContractTree(parentId, contractId, contractIdRelation, null);
|
|
|
//查询被标记为首件的数据
|
|
|
rootTreeNode = rootTreeNode.stream().filter(WbsTreeContractTreeVOS::getIsFirst).collect(Collectors.toList());
|
|
@@ -3823,7 +3921,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 29)
|
|
|
@ApiOperation(value = "分页")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "ids", value = "ids", required = true)
|
|
|
+ @ApiImplicitParam(name = "ids", value = "ids", required = true)
|
|
|
})
|
|
|
public R<String> getQueryInfoIds(String ids) {
|
|
|
List<String> strList = Func.toStrList(ids);
|
|
@@ -3891,10 +3989,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if (parentNode.getParentId().equals(0L)) {
|
|
|
obj.setNodeType(1);
|
|
|
} else {
|
|
|
- obj.setNodeType(parentNode.getNodeType().equals(6) ? 6 : parentNode.getNodeType() + 1);
|
|
|
+ obj.setNodeType(parentNode.getNodeType().equals(6) ? 6 : dto.getNodeType());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
obj.setPartitionCode(dto.getPartitionCode());
|
|
|
obj.setParentId(parentNode.getId());
|
|
|
obj.setAncestors(parentNode.getAncestors() + "," + parentNode.getId());
|
|
@@ -3917,12 +4014,41 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
obj.setTenantId(SecureUtil.getTenantId());
|
|
|
}
|
|
|
|
|
|
- if (wbsTreeContractClient.saveBatch(Collections.singletonList(obj))) {
|
|
|
- informationQueryService.delAsyncWbsTree(parentNode.getContractId());
|
|
|
- return R.success("操作成功");
|
|
|
+ if (dto.getNodeClass() == Integer.valueOf(2)) {
|
|
|
+ if (dto.getIsClassifition() == 1) {
|
|
|
+ if (parentNode.getNodeClass() == Integer.valueOf(2)) {
|
|
|
+ throw new ServiceException("当前节点的父节点已经是数字化上传节点");
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isEmpty(dto.getClassName())) {
|
|
|
+ throw new ServiceException("请选择标准分类");
|
|
|
+ } else {
|
|
|
+ if (ObjectUtil.isEmpty(dto.getUnitName())) {
|
|
|
+ throw new ServiceException("请选择单元名称");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getClassName()) && ObjectUtil.isNotEmpty(dto.getUnitName())) {
|
|
|
+ obj.setClassName(dto.getClassName());
|
|
|
+ obj.setUnitName(dto.getUnitName());
|
|
|
+ obj.setIsClassifition(dto.getIsClassifition());
|
|
|
+ obj.setExcellentNum(dto.getExcellentNum());
|
|
|
+ obj.setUnitNum(dto.getUnitNum());
|
|
|
+
|
|
|
+ } else {
|
|
|
+ throw new ServiceException("标准分类或单元名称选择有误");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ obj.setNodeClass(dto.getNodeClass());
|
|
|
+ if (ObjectUtil.isEmpty(dto.getDigitizeTime())) {
|
|
|
+ throw new ServiceException("请选择节点时间");
|
|
|
+ }
|
|
|
+ obj.setDigitizeTime(dto.getDigitizeTime());
|
|
|
}
|
|
|
+ if (wbsTreeContractClient.saveBatch(Collections.singletonList(obj))) {
|
|
|
+ informationQueryService.delAsyncWbsTree(parentNode.getContractId());
|
|
|
+ return R.success("操作成功");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
return R.fail("未获取到当前选择节点信息");
|
|
|
}
|
|
|
-
|
|
|
}
|