提交修改

This commit is contained in:
quyixiao 2020-10-27 11:49:08 +08:00
commit 1880e48eab
11 changed files with 99 additions and 21 deletions

View File

@ -11,11 +11,15 @@ import com.lz.modules.performance.res.AssessManagerListRes;
import com.lz.modules.performance.res.ChartStatistical;
import com.lz.modules.performance.res.ChartStatisticalRes;
import com.lz.modules.performance.service.AssessManagerService;
import com.lz.modules.performance.service.ChartResultService;
import com.lz.modules.sys.dao.app.ResultRecordMapper;
import com.lz.modules.sys.service.app.ResultRecordService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Author: djc
* @Desc:
@ -32,6 +36,8 @@ public class AssessManagerController {
private AssessManagerService assessManagerService;
@Autowired
private ResultRecordMapper resultRecordMapper;
@Autowired
private ChartResultService chartResultService;
@PostMapping("assess/manager/list")
@ -46,6 +52,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);
@ -54,9 +63,14 @@ public class AssessManagerController {
@PostMapping("assess/manager/chart")
@ApiOperation("获取考核详情列表人数统计")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStatistical.class)})
public R assessChart(@RequestBody AssessDetailReq req){
return R.ok();
if(req.getStartId()==null){
return R.error("考核id不能为空");
}
List<ChartStatistical> process = chartResultService.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

@ -1,6 +1,8 @@
package com.lz.modules.performance.req;
import com.lz.modules.equipment.entity.model.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
@ -12,17 +14,21 @@ import java.util.List;
* @Date: 2020/10/13 18:00
*/
@Data
@ApiModel("获取考核详情实体")
public class AssessDetailReq extends BasePage{
//考勤组id
private Long evaluationId;
@ApiModelProperty(value = "考勤组ids",name = "evaluationIds")
private List<Long> evaluationIds;
//发起考核的id
private int startId;
@ApiModelProperty(value = "发起考核的id",name = "startId")
private Long startId;
//员工名称
@ApiModelProperty(value = "员工名称",name = "staffName")
private String staffName;
//部门ids数组
private List<Long> departments;
//人员id数组
@ApiModelProperty(value = "人员id数组",name = "staffIds")
private List<Long> staffIds;
//状态 确认 执行 结果录入
@ApiModelProperty(value = "状态 确认 执行 结果录入。。。",name = "flowProcess")
private Integer flowProcess;
}

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

@ -74,7 +74,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
@Override
public PageUtils assessDetail(AssessDetailReq req) {
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(),req.getPageSize()).doSelect(
page -> resultRecordMapper.selectAssessListByStartId(page,null)
page -> resultRecordMapper.selectAssessListByStartId(page,req)
);
return pageUtils;
}

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) {
List<ChartStatistical> process = resultRecordMapper.countAssessNumByFlowProcess(req);
List<ChartStatistical> data = buildProcess(process, req.getStartId());
return data;
}
//构建流程默认人数
private List<ChartStatistical> buildProcess(List<ChartStatistical> process,Long startId){

View File

@ -16,6 +16,7 @@ import com.lz.modules.app.req.ReportListReq;
import com.lz.modules.app.req.ResultRecordReq;
import com.lz.modules.app.resp.OwnResultResp;
import com.lz.modules.flow.model.ResultRecordDto;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.res.AssessManagerDetailRes;
import com.lz.modules.performance.res.ChartStatistical;
import com.lz.modules.sys.entity.app.ResultRecord;
@ -84,5 +85,7 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
ResultRecord selectOneByStartId(@Param("startId")Long startId);
List<AssessManagerDetailRes> selectAssessListByStartId(@Param("page") IPage page, @Param("startId")Long startId);
List<AssessManagerDetailRes> selectAssessListByStartId(@Param("page") IPage page, @Param("req")AssessDetailReq req);
List<ChartStatistical> countAssessNumByFlowProcess(@Param("req")AssessDetailReq req);
}

View File

@ -1028,4 +1028,5 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
return new Flow();
}
}

View File

@ -387,21 +387,55 @@
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}
<if test="evaluationId !=null">
and r.evaluation_id = #{evaluationId}
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=",">
#{evaluation_id}
</foreach>
)
</if>
<if test="flowProcess !=null">
and r.flow_process = #{flowProcess}
<if test="req.flowProcess !=null">
and r.flow_process = #{req.flowProcess}
</if>
<if test="staffIds !=null and staffIds.size() !=0">
and staff_id in(
<foreach collection="staffIds" item="staff_id" separator=",">
<if test="req.staffName !=null and req.staffName!=''">
and r.staff_name = #{req.staffName}
</if>
<if test="req.staffIds !=null and req.staffIds.size() !=0">
and r.staff_id in(
<foreach collection="req.staffIds" item="staff_id" separator=",">
#{staff_id}
</foreach>
)
</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>