|
@@ -611,16 +611,18 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
// @PushMessage(clientId = ClientIdConstant.BUSINESS_CLIENT_ID)
|
|
|
public R<Object> abolishOne(@RequestParam String primaryKeyId, @RequestParam String classify, @RequestParam String projectId, @RequestParam String contractId) {
|
|
|
//查询填报状态
|
|
|
- InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getContractId, contractId)
|
|
|
- .eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 1).ne(InformationQuery::getStatus, 3));
|
|
|
+ InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId)
|
|
|
+// .eq(InformationQuery::getContractId, contractId)
|
|
|
+ .eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 1).in(InformationQuery::getStatus, 1,2));
|
|
|
primaryKeyId = primaryKeyId + "*";
|
|
|
if (businessData != null) {
|
|
|
//使用批量废除接口
|
|
|
return this.batchAbolish(businessData.getId().toString(), primaryKeyId, projectId, contractId, "撤回成功");
|
|
|
} else {
|
|
|
//试验
|
|
|
- InformationQuery businessDataTrial = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, contractId)
|
|
|
- .eq(InformationQuery::getType, 2).ne(InformationQuery::getStatus, 3));
|
|
|
+ InformationQuery businessDataTrial = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify)
|
|
|
+// .eq(InformationQuery::getContractId, contractId)
|
|
|
+ .eq(InformationQuery::getType, 2).in(InformationQuery::getStatus, 1,2));
|
|
|
if (businessDataTrial != null) {
|
|
|
//使用批量废除接口
|
|
|
return this.batchAbolish(businessDataTrial.getId().toString(), primaryKeyId, projectId, contractId, "撤回成功");
|
|
@@ -719,7 +721,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//记录状态
|
|
|
String status = "1";
|
|
|
//查询填报状态,type=1资料填报
|
|
|
- InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 1).last("order by id desc limit 1"));
|
|
|
+ WbsTreeContract obj = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
|
|
|
+ InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, obj.getContractId()).eq(InformationQuery::getType, 1).last("order by id desc limit 1"));
|
|
|
if (businessData != null) {
|
|
|
switch (businessData.getStatus()) {
|
|
|
case 0:
|
|
@@ -736,7 +739,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//如果不匹配,默认为未填报
|
|
|
status = "1";
|
|
|
//查询表格
|
|
|
- WbsTreeContract obj = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
|
|
|
+// 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) {
|
|
@@ -753,7 +756,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
} else {
|
|
|
//查询表格
|
|
|
- WbsTreeContract obj = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
|
|
|
+// 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) {
|
|
@@ -1384,23 +1387,40 @@ public R<Object> batchTask(@RequestBody StartTaskVO startTaskVO) {
|
|
|
trialIds = startTaskVO.getIds();
|
|
|
}
|
|
|
//试验记录 和 委托单 ids重新赋值映射为数据源ids
|
|
|
- ids = queryList.stream().map(InformationQuery::getId).map(String::valueOf).toArray(String[]::new);
|
|
|
+// ids = queryList.stream().map(InformationQuery::getId).map(String::valueOf).toArray(String[]::new);
|
|
|
}
|
|
|
|
|
|
Map<String, InformationQuery> queryMap = new HashMap<>();
|
|
|
List<InformationQuery> saveQueryList = new ArrayList<>();
|
|
|
+ List<InformationQuery> queryTempList = new ArrayList<>();
|
|
|
+ Map<String, InformationQuery> queryTempMap = new HashMap<>();
|
|
|
queryList.forEach(query -> {
|
|
|
- if (query.getStatus() != null && query.getStatus() == 3) {
|
|
|
- query.setId(SnowFlakeUtil.getId());
|
|
|
- query.setStatus(0);
|
|
|
- saveQueryList.add(query);
|
|
|
+ InformationQuery temp = queryTempMap.get(query.getWbsId() + "," + query.getContractId() + "," + query.getClassify());
|
|
|
+ if (temp != null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ queryTempMap.put(query.getWbsId() + "," + query.getContractId() + "," + query.getClassify(), query);
|
|
|
+ // todo 待优化
|
|
|
+ long count = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, query.getWbsId()).eq(InformationQuery::getClassify, query.getClassify())
|
|
|
+ .eq(InformationQuery::getContractId, query.getContractId()).in(InformationQuery::getStatus, 1, 2));
|
|
|
+ if (count == 0) {
|
|
|
+ queryTempList.add(query);
|
|
|
+ if (query.getStatus() != null && query.getStatus() == 3) {
|
|
|
+ query.setId(SnowFlakeUtil.getId());
|
|
|
+ query.setStatus(0);
|
|
|
+ saveQueryList.add(query);
|
|
|
+ }
|
|
|
+ queryMap.put(query.getId().toString(), query);
|
|
|
}
|
|
|
- queryMap.put(query.getId().toString(), query);
|
|
|
});
|
|
|
+ queryList = queryTempList;
|
|
|
+ if (queryList.isEmpty()) {
|
|
|
+ return R.fail( "已上报,无需重复上报");
|
|
|
+ }
|
|
|
if (!saveQueryList.isEmpty()) {
|
|
|
this.informationQueryService.saveBatch(saveQueryList);
|
|
|
- ids = queryList.stream().map(InformationQuery::getId).map(String::valueOf).toArray(String[]::new);
|
|
|
}
|
|
|
+ ids = queryList.stream().map(InformationQuery::getId).map(String::valueOf).toArray(String[]::new);
|
|
|
boolean var = false;
|
|
|
|
|
|
try {
|
|
@@ -1424,7 +1444,7 @@ public R<Object> batchTask(@RequestBody StartTaskVO startTaskVO) {
|
|
|
taskVO.setFixedFlowId(startTaskVO.getFixedFlowId());
|
|
|
}
|
|
|
//设置任务名称
|
|
|
- if (StringUtils.isNotEmpty(queryMap.get(id).toString())) {
|
|
|
+ if (queryMap.get(id) != null && StringUtils.isNotEmpty(queryMap.get(id).getName())) {
|
|
|
taskVO.setTaskName(queryMap.get(id).getName());
|
|
|
}
|
|
|
//设置数据源指向
|
|
@@ -1477,7 +1497,7 @@ public R<Object> batchTask(@RequestBody StartTaskVO startTaskVO) {
|
|
|
jdbcTemplate.execute(sql);
|
|
|
}
|
|
|
var = true;
|
|
|
-// getPdfs(queryMap.get(id));
|
|
|
+ getPdfs(queryMap.get(id));
|
|
|
} else {
|
|
|
return R.fail("创建主流程失败");
|
|
|
}
|
|
@@ -4626,6 +4646,9 @@ public R<Object> customAddContractNode(@RequestBody CustomAddContractNodeDTO dto
|
|
|
|
|
|
@Async
|
|
|
public R getPdfs(InformationQuery query){
|
|
|
+ if (query == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
try {
|
|
|
return excelTabClient.getPdfS(query.getWbsId() + "", query.getClassify() + "", query.getContractId() + "");
|
|
|
} catch (IOException e) {
|