|
@@ -361,21 +361,21 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
|
|
Integer classify, Integer sourceType,
|
|
Integer classify, Integer sourceType,
|
|
String isFirst, String sourceUrl,
|
|
String isFirst, String sourceUrl,
|
|
String pdfUrl, String firstFileName, List<JSONObject> linkDataList) {
|
|
String pdfUrl, String firstFileName, List<JSONObject> linkDataList) {
|
|
- Long userId = 0L ;
|
|
|
|
- String userNmae ="";
|
|
|
|
|
|
+ Long userId = 0L;
|
|
|
|
+ String userNmae = "";
|
|
|
|
|
|
- if(primaryKeyId.indexOf(":")>=0){
|
|
|
|
- String prdata[] = primaryKeyId.split(":");
|
|
|
|
|
|
+ if (primaryKeyId.indexOf(":") >= 0) {
|
|
|
|
+ String prdata[] = primaryKeyId.split(":");
|
|
primaryKeyId = prdata[0];
|
|
primaryKeyId = prdata[0];
|
|
userId = Long.parseLong(prdata[1]);
|
|
userId = Long.parseLong(prdata[1]);
|
|
R<User> userR = userClient.userInfoById(userId);
|
|
R<User> userR = userClient.userInfoById(userId);
|
|
userNmae = userR.getData().getName();
|
|
userNmae = userR.getData().getName();
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
BladeUser user = AuthUtil.getUser();
|
|
BladeUser user = AuthUtil.getUser();
|
|
- if(user!=null) {
|
|
|
|
|
|
+ if (user != null) {
|
|
userId = user.getUserId();
|
|
userId = user.getUserId();
|
|
userNmae = user.getNickName();
|
|
userNmae = user.getNickName();
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
/*非客户端调用,request里不一定有用户信息,暂停后续操作*/
|
|
/*非客户端调用,request里不一定有用户信息,暂停后续操作*/
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -534,16 +534,14 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
|
|
//转换VO
|
|
//转换VO
|
|
if (result != null && result.size() != 0) {
|
|
if (result != null && result.size() != 0) {
|
|
|
|
|
|
- //属于待审批和已审批状态,查询待办信息
|
|
|
|
|
|
+ //属于待审批、已审批状态任务Task信息,以及当前任务对应的副任务TaskParallel信息
|
|
Map<String, List<Task>> taskMaps = new HashMap<>();
|
|
Map<String, List<Task>> taskMaps = new HashMap<>();
|
|
Map<String, List<TaskParallel>> taskParallelMaps = new HashMap<>();
|
|
Map<String, List<TaskParallel>> taskParallelMaps = new HashMap<>();
|
|
List<Long> informationIds = result.stream().filter(f -> f.getStatus().equals(1) || f.getStatus().equals(2)).map(InformationQuery::getId).collect(Collectors.toList());
|
|
List<Long> informationIds = result.stream().filter(f -> f.getStatus().equals(1) || f.getStatus().equals(2)).map(InformationQuery::getId).collect(Collectors.toList());
|
|
String informationIdsStr = informationIds.stream().map(String::valueOf).collect(Collectors.joining(","));
|
|
String informationIdsStr = informationIds.stream().map(String::valueOf).collect(Collectors.joining(","));
|
|
if (StringUtils.isNotEmpty(informationIdsStr)) {
|
|
if (StringUtils.isNotEmpty(informationIdsStr)) {
|
|
- List<Task> query = jdbcTemplate.query("SELECT id,form_data_id,process_instance_id,approval_type,status,batch,project_id,contract_id FROM u_task WHERE form_data_id IN(" + informationIdsStr + ") AND status IN (1, 2) AND is_deleted = 0", new BeanPropertyRowMapper<>(Task.class));
|
|
|
|
-
|
|
|
|
|
|
+ List<Task> query = jdbcTemplate.query("SELECT id,form_data_id,process_instance_id,approval_type,status,batch,project_id,contract_id,create_time FROM u_task WHERE form_data_id IN(" + informationIdsStr + ") AND status IN (1, 2) AND is_deleted = 0", new BeanPropertyRowMapper<>(Task.class));
|
|
taskMaps = query.stream().collect(Collectors.groupingBy(Task::getFormDataId));
|
|
taskMaps = query.stream().collect(Collectors.groupingBy(Task::getFormDataId));
|
|
-
|
|
|
|
Set<String> processInstanceIds = query.stream().map(Task::getProcessInstanceId).map(id -> "'" + id + "'").collect(Collectors.toSet());
|
|
Set<String> processInstanceIds = query.stream().map(Task::getProcessInstanceId).map(id -> "'" + id + "'").collect(Collectors.toSet());
|
|
if (processInstanceIds.size() > 0) {
|
|
if (processInstanceIds.size() > 0) {
|
|
List<TaskParallel> taskParallels = jdbcTemplate.query("select task_user, task_user_name, e_visa_status, status, process_instance_id, initiative,e_visa_content from u_task_parallel where is_deleted = 0 and process_instance_id in(" + StringUtils.join(processInstanceIds, ",") + ")", new BeanPropertyRowMapper<>(TaskParallel.class));
|
|
List<TaskParallel> taskParallels = jdbcTemplate.query("select task_user, task_user_name, e_visa_status, status, process_instance_id, initiative,e_visa_content from u_task_parallel where is_deleted = 0 and process_instance_id in(" + StringUtils.join(processInstanceIds, ",") + ")", new BeanPropertyRowMapper<>(TaskParallel.class));
|
|
@@ -594,9 +592,12 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
|
|
if (Arrays.asList("1,2".split(",")).contains(vor.getStatus().toString())) {
|
|
if (Arrays.asList("1,2".split(",")).contains(vor.getStatus().toString())) {
|
|
//说明属于待审批和已审批状态,查询待办信息
|
|
//说明属于待审批和已审批状态,查询待办信息
|
|
List<Task> tasks = finalTaskMaps.getOrDefault(vor.getId().toString(), null);
|
|
List<Task> tasks = finalTaskMaps.getOrDefault(vor.getId().toString(), null);
|
|
- if (tasks != null && tasks.size() > 0) {
|
|
|
|
|
|
+ //获取创建时间最新的那条任务数据(存在多条任务指向同一个form_data_id,即一条资料多次上报,这里要获取最新的)
|
|
|
|
+ Optional<Task> maxTask = tasks.stream().max(Comparator.comparing(Task::getCreateTime));
|
|
|
|
+ if (maxTask.isPresent()) {
|
|
|
|
+ Task maxTaskObject = maxTask.get();
|
|
//查询当前任务的所有待办人
|
|
//查询当前任务的所有待办人
|
|
- List<TaskParallel> linkTasks = finalTaskParallelMaps.getOrDefault(tasks.get(0).getProcessInstanceId(), null);
|
|
|
|
|
|
+ List<TaskParallel> linkTasks = finalTaskParallelMaps.getOrDefault(maxTaskObject.getProcessInstanceId(), null);
|
|
if (linkTasks != null && linkTasks.size() > 0) {
|
|
if (linkTasks != null && linkTasks.size() > 0) {
|
|
//处理审批状态
|
|
//处理审批状态
|
|
this.integrationMethod(vor, linkTasks);
|
|
this.integrationMethod(vor, linkTasks);
|
|
@@ -818,8 +819,7 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
|
|
* 统合方法
|
|
* 统合方法
|
|
*/
|
|
*/
|
|
private void integrationMethod(InformationQueryVO vo, List<TaskParallel> linkList) {
|
|
private void integrationMethod(InformationQueryVO vo, List<TaskParallel> linkList) {
|
|
-
|
|
|
|
- for (TaskParallel link : linkList) {
|
|
|
|
|
|
+ /*for (TaskParallel link : linkList) {
|
|
vo.setWaitingUserList
|
|
vo.setWaitingUserList
|
|
(link.getTaskUserName(),
|
|
(link.getTaskUserName(),
|
|
new Integer(999).equals(link.getEVisaStatus()) ? 999 :
|
|
new Integer(999).equals(link.getEVisaStatus()) ? 999 :
|
|
@@ -837,6 +837,31 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
|
|
}
|
|
}
|
|
}
|
|
}
|
|
vo.setEVisaFailedInfo(eVisaFailedInfo);
|
|
vo.setEVisaFailedInfo(eVisaFailedInfo);
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ for (TaskParallel taskPa : linkList) {
|
|
|
|
+ if (taskPa.getStatus() == 2 && ObjectUtil.isNotEmpty(taskPa.getEVisaStatus()) && taskPa.getEVisaStatus() == 1) {
|
|
|
|
+ taskPa.setEVisaStatus(2);
|
|
|
|
+ } else if (taskPa.getStatus() == 3 && taskPa.getTaskUser().equals(SecureUtil.getUserId().toString())) {
|
|
|
|
+ taskPa.setEVisaStatus(3);
|
|
|
|
+ } else if (ObjectUtil.isNotEmpty(taskPa.getEVisaStatus()) && taskPa.getEVisaStatus() == 99) {
|
|
|
|
+ taskPa.setEVisaStatus(999);
|
|
|
|
+ } else {
|
|
|
|
+ taskPa.setEVisaStatus(1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String eVisaFailedInfo = "";
|
|
|
|
+ if (taskPa.getStatus() == 2 && ObjectUtil.isNotEmpty(taskPa.getEVisaStatus()) && taskPa.getEVisaStatus() == 2) {
|
|
|
|
+ if (taskPa.getEVisaContent().contains("请等待") && ObjectUtil.isEmpty(eVisaFailedInfo)) {
|
|
|
|
+ eVisaFailedInfo = taskPa.getEVisaContent();
|
|
|
|
+ }
|
|
|
|
+ } else if (ObjectUtil.isNotEmpty(taskPa.getEVisaStatus()) && taskPa.getEVisaStatus() == 999) {
|
|
|
|
+ if (ObjectUtil.isEmpty(eVisaFailedInfo)) {
|
|
|
|
+ eVisaFailedInfo = taskPa.getEVisaContent();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ vo.setWaitingUserList(taskPa.getTaskUserName(), taskPa.getEVisaStatus());
|
|
|
|
+ vo.setEVisaFailedInfo(eVisaFailedInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|