|
@@ -611,14 +611,16 @@ public class InformationWriteQueryController extends BladeController {
|
|
// @PushMessage(clientId = ClientIdConstant.BUSINESS_CLIENT_ID)
|
|
// @PushMessage(clientId = ClientIdConstant.BUSINESS_CLIENT_ID)
|
|
public R<Object> abolishOne(@RequestParam String primaryKeyId, @RequestParam String classify, @RequestParam String projectId, @RequestParam String contractId) {
|
|
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::getClassify, classify).eq(InformationQuery::getType, 1));
|
|
|
|
|
|
+ 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 + "*";
|
|
primaryKeyId = primaryKeyId + "*";
|
|
if (businessData != null) {
|
|
if (businessData != null) {
|
|
//使用批量废除接口
|
|
//使用批量废除接口
|
|
return this.batchAbolish(businessData.getId().toString(), primaryKeyId, projectId, contractId, "撤回成功");
|
|
return this.batchAbolish(businessData.getId().toString(), primaryKeyId, projectId, contractId, "撤回成功");
|
|
} else {
|
|
} else {
|
|
//试验
|
|
//试验
|
|
- InformationQuery businessDataTrial = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2));
|
|
|
|
|
|
+ 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) {
|
|
if (businessDataTrial != null) {
|
|
//使用批量废除接口
|
|
//使用批量废除接口
|
|
return this.batchAbolish(businessDataTrial.getId().toString(), primaryKeyId, projectId, contractId, "撤回成功");
|
|
return this.batchAbolish(businessDataTrial.getId().toString(), primaryKeyId, projectId, contractId, "撤回成功");
|
|
@@ -655,7 +657,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
//记录状态
|
|
//记录状态
|
|
String status = "1";
|
|
String status = "1";
|
|
//查询填报状态,type=1资料填报
|
|
//查询填报状态,type=1资料填报
|
|
- InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 1).last("limit 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"));
|
|
if (businessData != null) {
|
|
if (businessData != null) {
|
|
switch (businessData.getStatus()) {
|
|
switch (businessData.getStatus()) {
|
|
case 0:
|
|
case 0:
|
|
@@ -717,7 +719,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
//记录状态
|
|
//记录状态
|
|
String status = "1";
|
|
String status = "1";
|
|
//查询填报状态,type=1资料填报
|
|
//查询填报状态,type=1资料填报
|
|
- InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 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"));
|
|
if (businessData != null) {
|
|
if (businessData != null) {
|
|
switch (businessData.getStatus()) {
|
|
switch (businessData.getStatus()) {
|
|
case 0:
|
|
case 0:
|
|
@@ -782,7 +784,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
//查询填报状态,type=3首件
|
|
//查询填报状态,type=3首件
|
|
InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery()
|
|
InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery()
|
|
.eq(InformationQuery::getId, id)
|
|
.eq(InformationQuery::getId, id)
|
|
- .eq(InformationQuery::getType, 3)
|
|
|
|
|
|
+ .eq(InformationQuery::getType, 3).last("order by id desc limit 1")
|
|
);
|
|
);
|
|
if (businessData != null) {
|
|
if (businessData != null) {
|
|
switch (businessData.getStatus()) {
|
|
switch (businessData.getStatus()) {
|
|
@@ -908,7 +910,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
//此时的ids是当前节点的primaryKeyId但并不是业务数据ID,需要根据ids和classify去查询具体的业务ID
|
|
//此时的ids是当前节点的primaryKeyId但并不是业务数据ID,需要根据ids和classify去查询具体的业务ID
|
|
if (ObjectUtil.isNotEmpty(startTaskVO.getTrialSelfInspectionRecordId())) {
|
|
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).eq(InformationQuery::getContractId,startTaskVO.getContractId()));
|
|
|
|
|
|
+ businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()).eq(InformationQuery::getType, 2).eq(InformationQuery::getContractId,startTaskVO.getContractId()).last("order by id desc limit 1"));
|
|
if (businessData != null) {
|
|
if (businessData != null) {
|
|
//设置业务数据ID
|
|
//设置业务数据ID
|
|
startTaskVO.setIds(businessData.getWbsId().toString());
|
|
startTaskVO.setIds(businessData.getWbsId().toString());
|
|
@@ -918,7 +920,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
return R.data(300, false, "未查询到填报信息,上报失败");
|
|
return R.data(300, false, "未查询到填报信息,上报失败");
|
|
}
|
|
}
|
|
} else { //质检
|
|
} else { //质检
|
|
- businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()).eq(InformationQuery::getType, 1));
|
|
|
|
|
|
+ businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()).eq(InformationQuery::getType, 1).last("order by id desc limit 1"));
|
|
if (businessData != null) {
|
|
if (businessData != null) {
|
|
//设置业务数据ID
|
|
//设置业务数据ID
|
|
startTaskVO.setIds(businessData.getId().toString());
|
|
startTaskVO.setIds(businessData.getId().toString());
|
|
@@ -1172,7 +1174,7 @@ public R<String> batchDownloadFileToZip(String ids, HttpServletResponse response
|
|
//已审批、已撤销的任务,修改业务数据的审批状态为未上报并撤签即可
|
|
//已审批、已撤销的任务,修改业务数据的审批状态为未上报并撤签即可
|
|
LambdaUpdateWrapper<InformationQuery> wrapper = Wrappers.lambdaUpdate();
|
|
LambdaUpdateWrapper<InformationQuery> wrapper = Wrappers.lambdaUpdate();
|
|
//更改状态为未上报
|
|
//更改状态为未上报
|
|
- wrapper.set(InformationQuery::getStatus, 0);
|
|
|
|
|
|
+ wrapper.set(InformationQuery::getStatus, 3);
|
|
//将电签的pdf路径置空
|
|
//将电签的pdf路径置空
|
|
wrapper.set(InformationQuery::getEVisaPdfUrl, null);
|
|
wrapper.set(InformationQuery::getEVisaPdfUrl, null);
|
|
//将上报批次置空
|
|
//将上报批次置空
|
|
@@ -1210,6 +1212,9 @@ public R<String> batchDownloadFileToZip(String ids, HttpServletResponse response
|
|
}
|
|
}
|
|
|
|
|
|
for (InformationQuery query : queries) {
|
|
for (InformationQuery query : queries) {
|
|
|
|
+ if (query.getStatus() != null && query.getStatus() != 3) {
|
|
|
|
+ this.informationQueryService.update(Wrappers.<InformationQuery>lambdaUpdate().eq(InformationQuery::getId, query.getId()).set(InformationQuery::getStatus, 3));
|
|
|
|
+ }
|
|
if (StringUtils.isNotEmpty(query.getFileUserIdAndName())) {
|
|
if (StringUtils.isNotEmpty(query.getFileUserIdAndName())) {
|
|
String[] userArray = query.getFileUserIdAndName().split(",");
|
|
String[] userArray = query.getFileUserIdAndName().split(",");
|
|
for (String str : userArray) {
|
|
for (String str : userArray) {
|
|
@@ -1355,7 +1360,7 @@ public R<String> batchDownloadFileToZip(String ids, HttpServletResponse response
|
|
@ApiOperation(value = "批量上报")
|
|
@ApiOperation(value = "批量上报")
|
|
// @PushMessage(clientId = ClientIdConstant.BUSINESS_CLIENT_ID)
|
|
// @PushMessage(clientId = ClientIdConstant.BUSINESS_CLIENT_ID)
|
|
public R<Object> batchTask(@RequestBody StartTaskVO startTaskVO) {
|
|
public R<Object> batchTask(@RequestBody StartTaskVO startTaskVO) {
|
|
- // 1= 代表 试验 流程上报 2=试验 - 委托单上报 其他=质检或别的项目上报
|
|
|
|
|
|
+ // 1= 代表 试验 流程上报 2=试验 - 委托单上报 3=首件上报 其他=质检或别的项目上报
|
|
Long appType = startTaskVO.getTrialSelfInspectionRecordId();
|
|
Long appType = startTaskVO.getTrialSelfInspectionRecordId();
|
|
if (ObjectUtil.isEmpty(SecureUtil.getUserId()) || SecureUtil.getUserId() == -1L) {
|
|
if (ObjectUtil.isEmpty(SecureUtil.getUserId()) || SecureUtil.getUserId() == -1L) {
|
|
throw new ServiceException("未获取到当前用户信息");
|
|
throw new ServiceException("未获取到当前用户信息");
|
|
@@ -1379,11 +1384,40 @@ public R<Object> batchTask(@RequestBody StartTaskVO startTaskVO) {
|
|
trialIds = startTaskVO.getIds();
|
|
trialIds = startTaskVO.getIds();
|
|
}
|
|
}
|
|
//试验记录 和 委托单 ids重新赋值映射为数据源ids
|
|
//试验记录 和 委托单 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<>();
|
|
Map<String, InformationQuery> queryMap = new HashMap<>();
|
|
- queryList.forEach(query -> queryMap.put(query.getId().toString(), query));
|
|
|
|
|
|
+ List<InformationQuery> saveQueryList = new ArrayList<>();
|
|
|
|
+ List<InformationQuery> queryTempList = new ArrayList<>();
|
|
|
|
+ Map<String, InformationQuery> queryTempMap = new HashMap<>();
|
|
|
|
+ queryList.forEach(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);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ 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);
|
|
boolean var = false;
|
|
boolean var = false;
|
|
|
|
|
|
try {
|
|
try {
|
|
@@ -1407,7 +1441,7 @@ public R<Object> batchTask(@RequestBody StartTaskVO startTaskVO) {
|
|
taskVO.setFixedFlowId(startTaskVO.getFixedFlowId());
|
|
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());
|
|
taskVO.setTaskName(queryMap.get(id).getName());
|
|
}
|
|
}
|
|
//设置数据源指向
|
|
//设置数据源指向
|
|
@@ -1415,6 +1449,10 @@ public R<Object> batchTask(@RequestBody StartTaskVO startTaskVO) {
|
|
//设置上报类型
|
|
//设置上报类型
|
|
if (appType != null && appType == 2L) {
|
|
if (appType != null && appType == 2L) {
|
|
taskVO.setApprovalType(8);
|
|
taskVO.setApprovalType(8);
|
|
|
|
+ } else if (appType != null && appType == 1L) {
|
|
|
|
+ taskVO.setApprovalType(9);
|
|
|
|
+ } else if (appType != null && appType == 3L) {
|
|
|
|
+ taskVO.setApprovalType(10);
|
|
} else {
|
|
} else {
|
|
taskVO.setApprovalType(1);
|
|
taskVO.setApprovalType(1);
|
|
}
|
|
}
|
|
@@ -1456,7 +1494,7 @@ public R<Object> batchTask(@RequestBody StartTaskVO startTaskVO) {
|
|
jdbcTemplate.execute(sql);
|
|
jdbcTemplate.execute(sql);
|
|
}
|
|
}
|
|
var = true;
|
|
var = true;
|
|
-// getPdfs(queryMap.get(id));
|
|
|
|
|
|
+ getPdfs(queryMap.get(id));
|
|
} else {
|
|
} else {
|
|
return R.fail("创建主流程失败");
|
|
return R.fail("创建主流程失败");
|
|
}
|
|
}
|
|
@@ -4605,6 +4643,9 @@ public R<Object> customAddContractNode(@RequestBody CustomAddContractNodeDTO dto
|
|
|
|
|
|
@Async
|
|
@Async
|
|
public R getPdfs(InformationQuery query){
|
|
public R getPdfs(InformationQuery query){
|
|
|
|
+ if (query == null) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
try {
|
|
try {
|
|
return excelTabClient.getPdfS(query.getWbsId() + "", query.getClassify() + "", query.getContractId() + "");
|
|
return excelTabClient.getPdfS(query.getWbsId() + "", query.getClassify() + "", query.getContractId() + "");
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|