This commit is contained in:
杜建超 2020-10-27 11:41:36 +08:00
parent f4a30d65e5
commit 4c0ff8225e
11 changed files with 67 additions and 16 deletions

View File

@ -51,6 +51,9 @@ public class AssessManagerController {
@ApiOperation("获取考核详情列表")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = AssessManagerDetailRes.class)})
public R assessDetail(@RequestBody AssessDetailReq req){
if(req.getStartId()==null){
return R.error("考核id不能为空");
}
PageUtils pageUtils = assessManagerService.assessDetail(req);
return R.ok().put("data",pageUtils);
@ -59,10 +62,14 @@ public class AssessManagerController {
@PostMapping("assess/manager/chart")
@ApiOperation("获取考核详情列表人数统计")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStatistical.class)})
public R assessChart(@RequestBody AssessDetailReq req){
List<ChartStatistical> process = resultRecordService.countNumByFlowProcess(startId);
return R.ok();
if(req.getStartId()==null){
return R.error("考核id不能为空");
}
List<ChartStatistical> process = resultRecordService.countAssessNumByFlowProcess(req);
return R.ok().put("data",process);
}

View File

@ -14,7 +14,6 @@ import com.lz.modules.performance.res.ResultRankListRes;
import com.lz.modules.performance.service.ChartResultService;
import com.lz.modules.sys.controller.AbstractController;
import io.swagger.annotations.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -38,7 +37,7 @@ public class ChartController extends AbstractController{
@ApiOperation("获取绩效报表统计")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStatisticalRes.class)})
public R chartResult(@RequestParam(required = false) @ApiParam(name = "startId",value = "考核周期标识id") Long startId){
String defaultTime = StringUtils.EMPTY;
String defaultTime = StringUtil.EMPTY;
if(startId==null){
//取最近一条记录
FlowStart flowStart = flowStartMapper.selectRecentlyLimt();
@ -46,7 +45,7 @@ public class ChartController extends AbstractController{
startId = flowStart.getId();
defaultTime = flowStart.getName();
}else {
return R.ok();
return R.ok("暂无记录");
}
}
List<ChartStatisticalRes> chartStatisticalRes = chartResultService.chartReport(startId,defaultTime);

View File

@ -21,7 +21,7 @@ public class AssessDetailReq extends BasePage{
private List<Long> evaluationIds;
//发起考核的id
@ApiModelProperty(value = "发起考核的id",name = "startId")
private int startId;
private Long startId;
//员工名称
@ApiModelProperty(value = "员工名称",name = "staffName")
private String staffName;

View File

@ -14,7 +14,4 @@ public class ChartStatistical {
@ApiModelProperty(value = "人数",name = "num")
private int num = 0;
@ApiModelProperty(value = "是否被选中",name = "check")
private int check;
}

View File

@ -20,6 +20,9 @@ public class ChartStatisticalRes {
@ApiModelProperty(value = "默认时间 ",name = "defaultTime")
private String defaultTime;
@ApiModelProperty(value = "默认考核id ",name = "defaultId")
private Long defaultId;
private List<ChartStatistical> statisticals;
}

View File

@ -2,6 +2,7 @@ package com.lz.modules.performance.service;
import com.lz.common.utils.PageUtils;
import com.lz.modules.equipment.entity.model.BasePage;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.ChartStartsReq;
import com.lz.modules.performance.res.ChartStartsRes;
import com.lz.modules.performance.res.ChartStatistical;
@ -24,4 +25,6 @@ public interface ChartResultService {
PageUtils chartStarts(ChartStartsReq req);
List<ChartStatistical> countAssessNumByFlowProcess(AssessDetailReq req);
}

View File

@ -3,6 +3,7 @@ package com.lz.modules.performance.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Maps;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.StringUtil;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.service.DepartmentsStaffRelateService;
import com.lz.modules.app.service.StaffService;
@ -11,6 +12,7 @@ import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.service.EvaluationGroupService;
import com.lz.modules.flow.service.FlowStartService;
import com.lz.modules.performance.enums.ResultFlowProcessEnum;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.ChartStartsReq;
import com.lz.modules.performance.res.ChartStartsRes;
import com.lz.modules.performance.res.ChartStatistical;
@ -24,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.function.Consumer;
/**
* @Author: djc
@ -60,6 +63,9 @@ public class ChartResultServiceImpl implements ChartResultService {
res.setType(0);
res.setStatisticals(buildProcess(process,startId));
res.setDefaultTime(defaultTime);
if(StringUtil.isNotBlank(defaultTime)){
res.setDefaultId(startId);
}
data.add(res);
List<ChartStatistical> scoreLevel = resultRecordService.countNumByScoreLevel(startId);
@ -67,6 +73,9 @@ public class ChartResultServiceImpl implements ChartResultService {
res.setType(1);
res.setStatisticals(scoreLevel);
res.setDefaultTime(defaultTime);
if(StringUtil.isNotBlank(defaultTime)){
res.setDefaultId(startId);
}
data.add(res);
List<String> strings = evaluationGroupService.selectAllStaffIdsByGroupId(3L);
@ -75,6 +84,9 @@ public class ChartResultServiceImpl implements ChartResultService {
res.setType(2);
res.setStatisticals(depstaff);
res.setDefaultTime(defaultTime);
if(StringUtil.isNotBlank(defaultTime)){
res.setDefaultId(startId);
}
data.add(res);
return data;
@ -144,6 +156,12 @@ public class ChartResultServiceImpl implements ChartResultService {
}
@Override
public List<ChartStatistical> countAssessNumByFlowProcess(AssessDetailReq req) {
resultRecordMapper.countAssessNumByFlowProcess(req);
return null;
}
//构建流程默认人数
private List<ChartStatistical> buildProcess(List<ChartStatistical> process,Long startId){

View File

@ -86,4 +86,6 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
ResultRecord selectOneByStartId(@Param("startId")Long startId);
List<AssessManagerDetailRes> selectAssessListByStartId(@Param("page") IPage page, @Param("req")AssessDetailReq req);
List<ChartStatistical> countAssessNumByFlowProcess(@Param("req")AssessDetailReq req);
}

View File

@ -112,5 +112,4 @@ public interface ResultRecordService extends IService<ResultRecord> {
R newApproval(ApprovalDto approvalDto);
List<ChartStatistical> countNumByFlowProcess(AssessDetailReq req);
}

View File

@ -951,8 +951,4 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
return new Flow();
}
@Override
public List<ChartStatistical> countNumByFlowProcess(AssessDetailReq req) {
return null;
}
}

View File

@ -387,7 +387,7 @@
LEFT JOIN lz_evaluation_start_staff s
ON r.start_id = s.start_id and r.staff_id = s.staff_id
where r.is_delete = 0 and s.is_delete = 0
and r.start_id = #{startId}
and r.start_id = #{req.startId}
<if test="req.evaluationIds !=null and req.evaluationIds.size()!=0">
and r.evaluation_id in(
<foreach collection="req.evaluationIds" item="evaluation_id" separator=",">
@ -402,7 +402,7 @@
and r.staff_name = #{req.staffName}
</if>
<if test="req.staffIds !=null and req.staffIds.size() !=0">
and staff_id in(
and r.staff_id in(
<foreach collection="req.staffIds" item="staff_id" separator=",">
#{staff_id}
</foreach>
@ -410,5 +410,32 @@
</if>
</select>
<select id="countAssessNumByFlowProcess" resultType="com.lz.modules.performance.res.ChartStatistical">
SELECT count(flow_process) num,flow_process as 'desc' from lz_result_record
where is_delete=0
and start_id =#{req.startId}
<if test="req.evaluationIds !=null and req.evaluationIds.size()!=0">
and evaluation_id in(
<foreach collection="req.evaluationIds" item="evaluation_id" separator=",">
#{evaluation_id}
</foreach>
)
</if>
<if test="req.flowProcess !=null">
and flow_process = #{req.flowProcess}
</if>
<if test="req.staffName !=null and req.staffName!=''">
and staff_name = #{req.staffName}
</if>
<if test="req.staffIds !=null and req.staffIds.size() !=0">
and staff_id in(
<foreach collection="req.staffIds" item="staff_id" separator=",">
#{staff_id}
</foreach>
)
</if>
GROUP BY flow_process
</select>
</mapper>