fix
This commit is contained in:
parent
3c85e12cd8
commit
76e70c8b1f
@ -1,6 +1,7 @@
|
|||||||
package com.lz.modules.performance.controller;
|
package com.lz.modules.performance.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
import com.lz.common.utils.StringUtil;
|
import com.lz.common.utils.StringUtil;
|
||||||
@ -18,6 +19,7 @@ import com.lz.modules.performance.res.ChartStatisticalRes;
|
|||||||
import com.lz.modules.performance.res.ResultRankListRes;
|
import com.lz.modules.performance.res.ResultRankListRes;
|
||||||
import com.lz.modules.performance.service.ChartResultService;
|
import com.lz.modules.performance.service.ChartResultService;
|
||||||
import com.lz.modules.sys.controller.AbstractController;
|
import com.lz.modules.sys.controller.AbstractController;
|
||||||
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -25,6 +27,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: djc
|
* @Author: djc
|
||||||
@ -104,5 +111,15 @@ public class ChartController extends AbstractController{
|
|||||||
return R.ok().put("data",ownResultResps);
|
return R.ok().put("data",ownResultResps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void main(String[] args) {
|
||||||
|
ExecutorService executor = Executors.newFixedThreadPool(10);
|
||||||
|
List<ResultRecord> resultRecords = Lists.newArrayList();
|
||||||
|
CompletableFuture<List<ResultRecord>> listCompletableFuture = CompletableFuture.supplyAsync(() -> resultRecordService.list(), executor);
|
||||||
|
try {
|
||||||
|
resultRecords = listCompletableFuture.get();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,11 +32,12 @@ public class UserTaskController extends AbstractController{
|
|||||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = TaskListRes.class)})
|
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = TaskListRes.class)})
|
||||||
public R list(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) AssessTaskReq req){
|
public R list(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) AssessTaskReq req){
|
||||||
PageUtils pageUtils;
|
PageUtils pageUtils;
|
||||||
|
Long userId = null;
|
||||||
try {
|
try {
|
||||||
Long userId = getUserId();
|
userId = getUserId();
|
||||||
pageUtils = assessService.userTaskList(req, userId);
|
pageUtils = assessService.userTaskList(req, userId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("获取用户事项异常 userId:" ,e);
|
log.error("获取用户事项异常 userId:" + userId,e);
|
||||||
return R.error(e.getMessage());
|
return R.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return R.ok().put("data",pageUtils);
|
return R.ok().put("data",pageUtils);
|
||||||
|
|||||||
@ -69,11 +69,18 @@ public class AssessServiceImpl implements AssessService {
|
|||||||
dtos.stream().forEach(taskListDto -> {
|
dtos.stream().forEach(taskListDto -> {
|
||||||
TaskListRes res = new TaskListRes();
|
TaskListRes res = new TaskListRes();
|
||||||
StaffEntity staffEntity = staffService.selectStaffById(taskListDto.getRecordStaffId());
|
StaffEntity staffEntity = staffService.selectStaffById(taskListDto.getRecordStaffId());
|
||||||
res.setAvatar(Optional.ofNullable(staffEntity.getAvatar()).orElse(StringUtil.EMPTY));
|
String name = "";
|
||||||
String name = staffEntity.getName();
|
if(staffEntity!=null){
|
||||||
if(taskListDto.getRecordStaffId().equals(taskListDto.getApprovalStaffId())){
|
res.setAvatar(Optional.ofNullable(staffEntity.getAvatar()).orElse(StringUtil.EMPTY));
|
||||||
name = "您";
|
name = staffEntity.getName();
|
||||||
|
if(taskListDto.getRecordStaffId().equals(taskListDto.getApprovalStaffId())){
|
||||||
|
name = "您";
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
name = "未知";
|
||||||
|
log.info("未找到此人信息 staffId: " + taskListDto.getRecordStaffId());
|
||||||
}
|
}
|
||||||
|
|
||||||
FlowStart start = flowStartService.selectFlowStartById(taskListDto.getStartId());
|
FlowStart start = flowStartService.selectFlowStartById(taskListDto.getStartId());
|
||||||
//根据状态拼接文案
|
//根据状态拼接文案
|
||||||
String startName = start == null ? "" : start.getName();
|
String startName = start == null ? "" : start.getName();
|
||||||
|
|||||||
@ -175,7 +175,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectFinishTasksByApprovalStaffId" resultType="com.lz.modules.performance.dto.TaskListDto">
|
<select id="selectFinishTasksByApprovalStaffId" resultType="com.lz.modules.performance.dto.TaskListDto">
|
||||||
SELECT DISTINCT(record_id),f.flow_process,f.flow_name,current_approval_staff_id,staff_id,start_id,r.gmt_modified,f.type from lz_flow_record f
|
SELECT DISTINCT(record_id),f.flow_process,f.flow_name,f.approval_staff_id,f.record_staff_id,start_id,r.gmt_modified,f.type from lz_flow_record f
|
||||||
LEFT JOIN lz_result_record r
|
LEFT JOIN lz_result_record r
|
||||||
ON f.record_id = r.id
|
ON f.record_id = r.id
|
||||||
where f.is_delete=0 and r.is_delete=0
|
where f.is_delete=0 and r.is_delete=0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user