This commit is contained in:
杜建超 2020-11-17 15:11:01 +08:00
parent 3c85e12cd8
commit 76e70c8b1f
4 changed files with 32 additions and 7 deletions

View File

@ -1,6 +1,7 @@
package com.lz.modules.performance.controller;
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.R;
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.service.ChartResultService;
import com.lz.modules.sys.controller.AbstractController;
import com.lz.modules.sys.entity.app.ResultRecord;
import com.lz.modules.sys.service.app.ResultRecordService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
@ -25,6 +27,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
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
@ -104,5 +111,15 @@ public class ChartController extends AbstractController{
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();
}
}
}

View File

@ -32,11 +32,12 @@ public class UserTaskController extends AbstractController{
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = TaskListRes.class)})
public R list(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) AssessTaskReq req){
PageUtils pageUtils;
Long userId = null;
try {
Long userId = getUserId();
userId = getUserId();
pageUtils = assessService.userTaskList(req, userId);
} catch (Exception e) {
log.error("获取用户事项异常 userId:" ,e);
log.error("获取用户事项异常 userId:" + userId,e);
return R.error(e.getMessage());
}
return R.ok().put("data",pageUtils);

View File

@ -69,11 +69,18 @@ public class AssessServiceImpl implements AssessService {
dtos.stream().forEach(taskListDto -> {
TaskListRes res = new TaskListRes();
StaffEntity staffEntity = staffService.selectStaffById(taskListDto.getRecordStaffId());
res.setAvatar(Optional.ofNullable(staffEntity.getAvatar()).orElse(StringUtil.EMPTY));
String name = staffEntity.getName();
if(taskListDto.getRecordStaffId().equals(taskListDto.getApprovalStaffId())){
name = "";
String name = "";
if(staffEntity!=null){
res.setAvatar(Optional.ofNullable(staffEntity.getAvatar()).orElse(StringUtil.EMPTY));
name = staffEntity.getName();
if(taskListDto.getRecordStaffId().equals(taskListDto.getApprovalStaffId())){
name = "";
}
}else {
name = "未知";
log.info("未找到此人信息 staffId: " + taskListDto.getRecordStaffId());
}
FlowStart start = flowStartService.selectFlowStartById(taskListDto.getStartId());
//根据状态拼接文案
String startName = start == null ? "" : start.getName();

View File

@ -175,7 +175,7 @@
<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
ON f.record_id = r.id
where f.is_delete=0 and r.is_delete=0