|
@@ -1527,48 +1527,51 @@ public class TaskController extends BladeController {
|
|
|
Task::getId,
|
|
|
task -> task));
|
|
|
}
|
|
|
- //所有满足条件的日志 转map
|
|
|
- String logQuery = "select business_id,create_user_name ,create_time, operation_type, save_data from u_operation_log where operation_type in (6,9,12,15,18,21,24,26,61,62)";
|
|
|
- List<OperationLog> operationLogs = jdbcTemplate.query(logQuery, new BeanPropertyRowMapper<>(OperationLog.class));
|
|
|
- if(ObjectUtil.isNotEmpty(operationLogs)){
|
|
|
- operationLogMap = operationLogs.stream().collect(Collectors.groupingBy(OperationLog::getBusinessId));
|
|
|
- }
|
|
|
- for (BusinessTaskPageVO businessTaskPageVO : pageList) {
|
|
|
- if("已废除".equals(businessTaskPageVO.getTaskStatusName())){
|
|
|
- Long taskId = businessTaskPageVO.getTaskId();
|
|
|
- Task task = taskMap.get(taskId);
|
|
|
- if (ObjectUtil.isEmpty(task)){
|
|
|
- continue;
|
|
|
- }
|
|
|
- //任务创建时间
|
|
|
- Date createTime = task.getCreateTime();
|
|
|
- //废除时间肯定在任务创建时间之后 选择距离当前任务创建时间最近的一条数据
|
|
|
- List<OperationLog> operationLogsF = operationLogMap.get(task.getFormDataId());
|
|
|
-
|
|
|
- if(ObjectUtil.isNotEmpty(operationLogsF)){
|
|
|
- Optional<OperationLog> min = operationLogsF.stream().filter(o -> o.getCreateTime().compareTo(createTime) >= 0)
|
|
|
- .min(Comparator.comparing(t -> t.getCreateTime().getTime() - createTime.getTime()));
|
|
|
- if (min.isPresent()){
|
|
|
- OperationLog operationLog = min.get();
|
|
|
- String createUserName = operationLog.getCreateUserName();
|
|
|
- String date = DateUtil.formatDateTime(operationLog.getCreateTime());
|
|
|
- if (operationLog.getOperationType() != null && operationLog.getOperationType() == 61) {
|
|
|
- businessTaskPageVO.setEVisaStatus("驳回成功:"+ createUserName +"-"+ date);
|
|
|
- String saveData = operationLog.getSaveData();
|
|
|
- if (saveData != null && !saveData.isEmpty()) {
|
|
|
- try {
|
|
|
- JSONObject data = JSONObject.parseObject(saveData);
|
|
|
- if (data != null && data.containsKey("comment")) {
|
|
|
- businessTaskPageVO.setEVisaStatus("驳回成功:"+ createUserName +"-"+ date + ";驳回原因:"+data.getString("comment"));
|
|
|
+ if(CollectionUtil.isNotEmpty(pageList)){
|
|
|
+ //所有满足条件的日志 转map
|
|
|
+ Set<String> collect = pageList.stream().map(BusinessTaskPageVO::getFormDataId).collect(Collectors.toSet());
|
|
|
+ String logQuery = "select business_id,create_user_name ,create_time, operation_type, save_data from u_operation_log where business_id in (" + StringUtil.join(collect) + ") and operation_type in (6,9,12,15,18,21,24,26,61,62)";
|
|
|
+ List<OperationLog> operationLogs = jdbcTemplate.query(logQuery, new BeanPropertyRowMapper<>(OperationLog.class));
|
|
|
+ if(ObjectUtil.isNotEmpty(operationLogs)){
|
|
|
+ operationLogMap = operationLogs.stream().collect(Collectors.groupingBy(OperationLog::getBusinessId));
|
|
|
+ }
|
|
|
+ for (BusinessTaskPageVO businessTaskPageVO : pageList) {
|
|
|
+ if("已废除".equals(businessTaskPageVO.getTaskStatusName())){
|
|
|
+ Long taskId = businessTaskPageVO.getTaskId();
|
|
|
+ Task task = taskMap.get(taskId);
|
|
|
+ if (ObjectUtil.isEmpty(task)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //任务创建时间
|
|
|
+ Date createTime = task.getCreateTime();
|
|
|
+ //废除时间肯定在任务创建时间之后 选择距离当前任务创建时间最近的一条数据
|
|
|
+ List<OperationLog> operationLogsF = operationLogMap.get(task.getFormDataId());
|
|
|
+
|
|
|
+ if(ObjectUtil.isNotEmpty(operationLogsF)){
|
|
|
+ Optional<OperationLog> min = operationLogsF.stream().filter(o -> o.getCreateTime().compareTo(createTime) >= 0)
|
|
|
+ .min(Comparator.comparing(t -> t.getCreateTime().getTime() - createTime.getTime()));
|
|
|
+ if (min.isPresent()){
|
|
|
+ OperationLog operationLog = min.get();
|
|
|
+ String createUserName = operationLog.getCreateUserName();
|
|
|
+ String date = DateUtil.formatDateTime(operationLog.getCreateTime());
|
|
|
+ if (operationLog.getOperationType() != null && operationLog.getOperationType() == 61) {
|
|
|
+ businessTaskPageVO.setEVisaStatus("驳回成功:"+ createUserName +"-"+ date);
|
|
|
+ String saveData = operationLog.getSaveData();
|
|
|
+ if (saveData != null && !saveData.isEmpty()) {
|
|
|
+ try {
|
|
|
+ JSONObject data = JSONObject.parseObject(saveData);
|
|
|
+ if (data != null && data.containsKey("comment")) {
|
|
|
+ businessTaskPageVO.setEVisaStatus("驳回成功:"+ createUserName +"-"+ date + ";驳回原因:"+data.getString("comment"));
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
}
|
|
|
+ } else if (operationLog.getOperationType() != null && operationLog.getOperationType() == 62) {
|
|
|
+ businessTaskPageVO.setEVisaStatus("撤回成功:"+ createUserName +"-"+ date);
|
|
|
+ } else {
|
|
|
+ businessTaskPageVO.setEVisaStatus(businessTaskPageVO.getEVisaStatus()+":"+ createUserName +"-"+ date);
|
|
|
}
|
|
|
- } else if (operationLog.getOperationType() != null && operationLog.getOperationType() == 62) {
|
|
|
- businessTaskPageVO.setEVisaStatus("撤回成功:"+ createUserName +"-"+ date);
|
|
|
- } else {
|
|
|
- businessTaskPageVO.setEVisaStatus(businessTaskPageVO.getEVisaStatus()+":"+ createUserName +"-"+ date);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2138,7 +2141,7 @@ public class TaskController extends BladeController {
|
|
|
/**
|
|
|
* 任务超时提示信息
|
|
|
*/
|
|
|
- @Scheduled(cron = "0 0 3 * * ?")
|
|
|
+// @Scheduled(cron = "0 0 3 * * ?")
|
|
|
public void TaskTimeoutTips() {
|
|
|
String key = "task.time.out";
|
|
|
String value = ParamCache.getValue(key);
|