|
@@ -482,7 +482,7 @@ public class TaskController extends BladeController {
|
|
|
if (archiveFile != null) {
|
|
|
//修改档案文件收集业务数据状态=已废除
|
|
|
jdbcTemplate.execute("update u_archive_file set status = 3 where id = " + archiveId);
|
|
|
- Task task = jdbcTemplate.queryForObject("select id,status,process_instance_id from u_task where form_data_id = " + archiveId, new BeanPropertyRowMapper<>(Task.class));
|
|
|
+ Task task = jdbcTemplate.query("select id,status,process_instance_id from u_task where form_data_id = " + archiveId, new BeanPropertyRowMapper<>(Task.class)).stream().findAny().orElse(null);
|
|
|
if (task != null && task.getStatus().equals(1)) {
|
|
|
//待审批审批任务=已废除
|
|
|
jdbcTemplate.execute("update u_task set status = 3 where id = " + task.getId());
|
|
@@ -512,7 +512,7 @@ public class TaskController extends BladeController {
|
|
|
} else if (repealDTO.getType().equals(2)) { //任务审批废除
|
|
|
String[] taskIds = repealDTO.getIds().split(",");
|
|
|
for (String taskId : taskIds) {
|
|
|
- Task task = jdbcTemplate.queryForObject("select id,status,process_instance_id,form_data_id from u_task where id = " + taskId, new BeanPropertyRowMapper<>(Task.class));
|
|
|
+ Task task = jdbcTemplate.query("select id,status,process_instance_id,form_data_id from u_task where id = " + taskId, new BeanPropertyRowMapper<>(Task.class)).stream().findAny().orElse(null);
|
|
|
if (task != null && task.getStatus().equals(1)) {
|
|
|
//待审批审批任务=已废除
|
|
|
jdbcTemplate.execute("update u_task set status = 3 where id = " + task.getId());
|
|
@@ -1110,13 +1110,26 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
} else if (contractInfo != null && (contractInfo.getContractType().equals(2) || contractInfo.getContractType().equals(3))) {
|
|
|
- //如果是监理合同段,那么默认查询关联的全部施工合同段+本身任务
|
|
|
- List<ContractRelationJlyz> contractRelationJLYZ = jdbcTemplate.query("select contract_id_sg from m_contract_relation_jlyz where contract_id_jlyz = " + dto.getCurrentContractId(), new BeanPropertyRowMapper<>(ContractRelationJlyz.class));
|
|
|
- Set<Long> ids = contractRelationJLYZ.stream().map(ContractRelationJlyz::getContractIdSg).collect(Collectors.toSet());
|
|
|
- ids.add(dto.getCurrentContractId()); //把监理本身也加入查询
|
|
|
- sqlString.append(" AND contract_id in(").append(StringUtils.join(ids, ",")).append(")");
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getContractIdValue())) {
|
|
|
+ if (dto.getContractIdValue().equals(dto.getCurrentContractId())) {
|
|
|
+ //如果下拉框合同段选择框合同段=当前用户登陆合同段,那么查询全部合同段的数据
|
|
|
+ List<ContractRelationJlyz> contractRelationJLYZ = jdbcTemplate.query("select contract_id_sg from m_contract_relation_jlyz where contract_id_jlyz = " + dto.getCurrentContractId(), new BeanPropertyRowMapper<>(ContractRelationJlyz.class));
|
|
|
+ Set<Long> ids = contractRelationJLYZ.stream().map(ContractRelationJlyz::getContractIdSg).collect(Collectors.toSet());
|
|
|
+ ids.add(dto.getCurrentContractId()); //把监理本身也加入查询
|
|
|
+ sqlString.append(" AND contract_id in(").append(StringUtils.join(ids, ",")).append(")");
|
|
|
+ } else {
|
|
|
+ //如果下拉框合同段选择框合同段!=当前用户登陆合同段,那么查询下拉框合同段数据
|
|
|
+ sqlString.append(" AND contract_id = ?");
|
|
|
+ params.add(dto.getContractIdValue());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //如果下拉框合同段id=null,那么查询当前整个项目的数据
|
|
|
+ sqlString.append(" AND project_id = ?");
|
|
|
+ params.add(dto.getProjectIdValue());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
if (ObjectUtil.isNotEmpty(dto.getBatchValue())) {
|
|
|
sqlString.append(" AND batch = ?");
|
|
|
params.add(dto.getBatchValue());
|
|
@@ -1189,11 +1202,12 @@ public class TaskController extends BladeController {
|
|
|
Set<String> processInstanceIds = resultList.stream().map(Task::getProcessInstanceId).collect(Collectors.toSet());
|
|
|
Map<String, List<TaskParallel>> taskParallelGroupMap = new HashMap<>();
|
|
|
if (processInstanceIds.size() > 0) {
|
|
|
- StringJoiner joiner = new StringJoiner(",", "'", "'");
|
|
|
- processInstanceIds.forEach(joiner::add);
|
|
|
- String joinedIds = joiner.toString();
|
|
|
- taskParallelGroupMap = jdbcTemplate.query("select process_instance_id,task_user_name,e_visa_status,e_visa_content from u_task_parallel where process_instance_id in(" + joinedIds + ") order by id", new BeanPropertyRowMapper<>(TaskParallel.class)).stream().collect(Collectors.groupingBy(TaskParallel::getProcessInstanceId));
|
|
|
+ String resultIds = processInstanceIds.stream()
|
|
|
+ .map(id -> "'" + id + "'")
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+ taskParallelGroupMap = jdbcTemplate.query("select process_instance_id,task_user_name,e_visa_status,e_visa_content from u_task_parallel where process_instance_id in(" + resultIds + ") order by id", new BeanPropertyRowMapper<>(TaskParallel.class)).stream().collect(Collectors.groupingBy(TaskParallel::getProcessInstanceId));
|
|
|
}
|
|
|
+
|
|
|
Map<String, List<TaskParallel>> finalTaskParallelGroupMap = taskParallelGroupMap;
|
|
|
|
|
|
//获取用户信息Map
|
|
@@ -1219,15 +1233,14 @@ public class TaskController extends BladeController {
|
|
|
if (taskParallelList != null && taskParallelList.size() > 0) {
|
|
|
List<String> names = taskParallelList.stream().map(TaskParallel::getTaskUserName).collect(Collectors.toList());
|
|
|
if (names.size() > 0) {
|
|
|
- vo.setTaskApproveUserNames(StringUtils.join(names, ","));
|
|
|
+ vo.setTaskApproveUserNames(StringUtils.join(names, "、"));
|
|
|
}
|
|
|
- Set<Integer> eVisaStatus = taskParallelList.stream().map(TaskParallel::getEVisaStatus).collect(Collectors.toSet());
|
|
|
- if (eVisaStatus.size() > 0) {
|
|
|
- vo.setEVisaStatus(StringUtils.join(eVisaStatus, "、"));
|
|
|
+ List<String> contentsList = new LinkedList<>();
|
|
|
+ for (TaskParallel taskParallel : taskParallelList) {
|
|
|
+ contentsList.add("【" + taskParallel.getTaskUserName() + "】msg:" + (ObjectUtil.isNotEmpty(taskParallel.getEVisaContent()) ? taskParallel.getEVisaContent() : "null") + " code:" + (ObjectUtil.isNotEmpty(taskParallel.getEVisaStatus()) ? taskParallel.getEVisaStatus() : "null "));
|
|
|
}
|
|
|
- Set<String> eVisaContents = taskParallelList.stream().map(TaskParallel::getEVisaContent).collect(Collectors.toSet());
|
|
|
- if (eVisaContents.size() > 0) {
|
|
|
- vo.setEVisaContents(StringUtils.join(eVisaContents, "、"));
|
|
|
+ if (contentsList.size() > 0) {
|
|
|
+ vo.setEVisaStatus(StringUtils.join(contentsList, " 、"));
|
|
|
}
|
|
|
}
|
|
|
return vo;
|
|
@@ -1239,7 +1252,9 @@ public class TaskController extends BladeController {
|
|
|
R<IPage<BusinessTaskPageVO>> iPageR = R.data(page);
|
|
|
|
|
|
//待办推送
|
|
|
- if (dto.getSelectedType().equals(1)) {
|
|
|
+ if (dto.getSelectedType().
|
|
|
+
|
|
|
+ equals(1)) {
|
|
|
if (ObjectUtil.isNotEmpty(iPageR.getData()) && ObjectUtil.isNotEmpty(iPageR.getData().getRecords()) && ObjectUtil.isNotEmpty(dto.getContractIdValue()) && ObjectUtil.isNotEmpty(dto.getProjectIdValue())) {
|
|
|
this.sendsWebSocketCount(iPageR, 1, dto);
|
|
|
} else if (ObjectUtil.isNotEmpty(dto.getContractIdValue()) && ObjectUtil.isNotEmpty(dto.getProjectIdValue())) {
|