diff --git a/src/main/java/com/lz/modules/performance/controller/ChartController.java b/src/main/java/com/lz/modules/performance/controller/ChartController.java index 339aef54..6d84c551 100644 --- a/src/main/java/com/lz/modules/performance/controller/ChartController.java +++ b/src/main/java/com/lz/modules/performance/controller/ChartController.java @@ -7,6 +7,7 @@ import com.lz.modules.equipment.entity.model.BasePage; import com.lz.modules.flow.dao.FlowStartMapper; import com.lz.modules.flow.entity.FlowStart; import com.lz.modules.flow.service.FlowStartService; +import com.lz.modules.performance.req.ChartResultReq; import com.lz.modules.performance.req.ChartStartsReq; import com.lz.modules.performance.res.ChartStartsRes; import com.lz.modules.performance.res.ChartStatisticalRes; @@ -62,13 +63,13 @@ public class ChartController extends AbstractController{ } - /*@PostMapping("chart/rank") - @ApiOperation("获取绩排名列表") + @PostMapping("chart/detail") + @ApiOperation("获取报表等级详情") @ApiResponses({@ApiResponse(code = 200,message = "成功",response = ResultRankListRes.class)}) - public R rankList(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) ChartResultReq req){ - PageUtils pageUtils = chartResultService.resultRankList(req); + public R chartDetailList(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) ChartResultReq req){ + PageUtils pageUtils = chartResultService.selectChartDetailList(req); return R.ok().put("data",pageUtils); - }*/ + } diff --git a/src/main/java/com/lz/modules/performance/req/ChartResultReq.java b/src/main/java/com/lz/modules/performance/req/ChartResultReq.java new file mode 100644 index 00000000..5d49ac0c --- /dev/null +++ b/src/main/java/com/lz/modules/performance/req/ChartResultReq.java @@ -0,0 +1,25 @@ +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 lombok.Data; + +/** + * @Author: djc + * @Desc: + * @Date: 2020/10/27 16:05 + */ +@Data +@ApiModel("获取报表等级详情实体") +public class ChartResultReq extends BasePage{ + + @ApiModelProperty(value = "部门id",name = "departmentId") + private String departmentId; + + @ApiModelProperty(value = "考核id",name = "startId") + private Long startId; + + @ApiModelProperty(value = "状态",name = "flowProcess") + private Long flowProcess; +} diff --git a/src/main/java/com/lz/modules/performance/res/ChartStatistical.java b/src/main/java/com/lz/modules/performance/res/ChartStatistical.java index 6a6e8211..a894bc68 100644 --- a/src/main/java/com/lz/modules/performance/res/ChartStatistical.java +++ b/src/main/java/com/lz/modules/performance/res/ChartStatistical.java @@ -14,4 +14,7 @@ public class ChartStatistical { @ApiModelProperty(value = "人数",name = "num") private int num = 0; + + @ApiModelProperty(value = "状态",name = "flowProcess") + private Long flowProcess; } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/performance/res/ResultRankListRes.java b/src/main/java/com/lz/modules/performance/res/ResultRankListRes.java index 610c3004..2a1e8a5a 100644 --- a/src/main/java/com/lz/modules/performance/res/ResultRankListRes.java +++ b/src/main/java/com/lz/modules/performance/res/ResultRankListRes.java @@ -26,10 +26,7 @@ public class ResultRankListRes { private String scoreLevel; //绩效结果 @ApiModelProperty(value = "绩效结果",name = "result") - private String result; - //绩效排名 - @ApiModelProperty(value = "绩效排名",name = "rank") - private String rank; + private String allScore; @ApiModelProperty(value = "id",name = "recordId") private Long recordId; } diff --git a/src/main/java/com/lz/modules/performance/service/ChartResultService.java b/src/main/java/com/lz/modules/performance/service/ChartResultService.java index 99632b61..0e309d81 100644 --- a/src/main/java/com/lz/modules/performance/service/ChartResultService.java +++ b/src/main/java/com/lz/modules/performance/service/ChartResultService.java @@ -3,6 +3,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.ChartResultReq; import com.lz.modules.performance.req.ChartStartsReq; import com.lz.modules.performance.res.ChartStartsRes; import com.lz.modules.performance.res.ChartStatistical; @@ -21,7 +22,7 @@ public interface ChartResultService { List countDepartmentAndStaffNum(ListstaffIds); - //PageUtils resultRankList(ChartResultReq req); + PageUtils selectChartDetailList(ChartResultReq req); PageUtils chartStarts(ChartStartsReq req); diff --git a/src/main/java/com/lz/modules/performance/service/impl/ChartResultServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/ChartResultServiceImpl.java index 4c7dd0f9..9a2a18f2 100644 --- a/src/main/java/com/lz/modules/performance/service/impl/ChartResultServiceImpl.java +++ b/src/main/java/com/lz/modules/performance/service/impl/ChartResultServiceImpl.java @@ -15,6 +15,7 @@ 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.ChartResultReq; import com.lz.modules.performance.req.ChartStartsReq; import com.lz.modules.performance.res.ChartStartsRes; import com.lz.modules.performance.res.ChartStatistical; @@ -28,7 +29,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.*; -import java.util.function.Consumer; /** * @Author: djc @@ -133,13 +133,15 @@ public class ChartResultServiceImpl implements ChartResultService { return data; } - /* @Override - public PageUtils resultRankList(ChartResultReq req) { + @Override + public PageUtils selectChartDetailList(ChartResultReq req) { + List allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(req.getDepartmentId()); + List ids = staffService.staffsByAllDeparmentIds(allDeparmentIds); PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()).doSelect( - page -> resultRecordMapper.selectResultRankList(page,req) + page -> resultRecordMapper.selectChartDetailList(page,ids,req.getStartId(),req.getFlowProcess()) ); return pageUtils; - }*/ + } @Override public PageUtils chartStarts(ChartStartsReq req) { @@ -194,6 +196,7 @@ public class ChartResultServiceImpl implements ChartResultService { ChartStatistical statistical = new ChartStatistical(); statistical.setDesc(flowProcessEnum.getDesc()); statistical.setNum(0); + statistical.setFlowProcess(Long.valueOf(flowProcessEnum.getStatus())); Object o = map.get(flowProcessEnum.getDesc()); if(o!=null){ statistical.setNum(Integer.valueOf(o.toString())); @@ -203,6 +206,9 @@ public class ChartResultServiceImpl implements ChartResultService { return data; } + + + private List buildDepStaffs(List depStaffs){ depStaffs.stream().forEach(chartStatistical -> { String desc = chartStatistical.getDesc(); diff --git a/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java b/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java index 7e788d16..8cb6a4de 100644 --- a/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java +++ b/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java @@ -77,7 +77,7 @@ public interface ResultRecordMapper extends BaseMapper { List countNumByScoreLevel(@Param("startId") Long startId); - //List selectResultRankList(@Param("page") IPage page, @Param("req") ChartResultReq req); + List selectChartDetailList(@Param("page") IPage page, @Param("staffIds") List staffIds, @Param("startId")Long startId,@Param("flowProcess")Long flowProcess); void batchDeleteByStartId(@Param("startId")Long startId); diff --git a/src/main/resources/mapper/app/ResultRecordMapper.xml b/src/main/resources/mapper/app/ResultRecordMapper.xml index a7388485..0875ce92 100644 --- a/src/main/resources/mapper/app/ResultRecordMapper.xml +++ b/src/main/resources/mapper/app/ResultRecordMapper.xml @@ -360,11 +360,23 @@ SELECT count(score_level) num,case score_level WHEN 0 THEN '无等级' ELSE score_level END as 'desc' from lz_result_record where is_delete=0 and start_id =#{startId} GROUP BY score_level - + SELECT r.id recordId,all_score,department_name,staff_name,score_level,job_number staffNo from lz_result_record r LEFT JOIN lz_staff s on r.staff_id = s.id - where r.is_delete =0 and s.is_delete=0 ORDER BY all_score desc + where r.is_delete =0 and s.is_delete=0 + and r.start_id = #{startId} + + and r.staff_id in ( + + #{staff_id} + + ) + + + and r.flow_process = #{flowProcess} + + ORDER BY all_score desc @@ -388,7 +400,7 @@ 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 = #{req.startId} - + and r.evaluation_id in( #{evaluation_id} @@ -401,7 +413,7 @@ and r.staff_name LIKE CONCAT('%',#{req.staffName},'%') - + and r.staff_id in( #{staff_id} @@ -414,21 +426,21 @@ SELECT count(flow_process) num,flow_process as 'desc' from lz_result_record where is_delete=0 and start_id =#{req.startId} - - and r.evaluation_id in( + + and evaluation_id in( #{evaluation_id} ) - and r.flow_process = #{req.flowProcess} + and flow_process = #{req.flowProcess} - and r.staff_name LIKE CONCAT('%',#{req.staffName},'%') + and staff_name LIKE CONCAT('%',#{req.staffName},'%') - - and r.staff_id in( + + and staff_id in( #{staff_id}