fiz
This commit is contained in:
parent
5a9e697deb
commit
82bfc20cd4
@ -63,11 +63,11 @@ 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);
|
||||
}
|
||||
|
||||
|
||||
@ -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 lombok.Data;
|
||||
|
||||
/**
|
||||
@ -9,7 +11,12 @@ import lombok.Data;
|
||||
* @Date: 2020/10/27 16:05
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("获取报表等级详情实体")
|
||||
public class ChartResultReq extends BasePage{
|
||||
|
||||
private Long departmentId;
|
||||
@ApiModelProperty(value = "部门id",name = "departmentId")
|
||||
private String departmentId;
|
||||
|
||||
@ApiModelProperty(value = "考核id",name = "startId")
|
||||
private Long startId;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ public interface ChartResultService {
|
||||
|
||||
List<ChartStatistical> countDepartmentAndStaffNum(List<String>staffIds);
|
||||
|
||||
PageUtils resultRankList(ChartResultReq req);
|
||||
PageUtils selectChartDetailList(ChartResultReq req);
|
||||
|
||||
PageUtils chartStarts(ChartStartsReq req);
|
||||
|
||||
|
||||
@ -135,10 +135,11 @@ public class ChartResultServiceImpl implements ChartResultService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils resultRankList(ChartResultReq req) {
|
||||
List<String> ids = staffService.staffsByAllDeparmentIds(Arrays.asList(req.getDepartmentId() + StringUtil.EMPTY));
|
||||
public PageUtils selectChartDetailList(ChartResultReq req) {
|
||||
List<String> allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(req.getDepartmentId());
|
||||
List<String> ids = staffService.staffsByAllDeparmentIds(allDeparmentIds);
|
||||
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()).doSelect(
|
||||
page -> resultRecordMapper.selectResultRankList(page,ids)
|
||||
page -> resultRecordMapper.selectChartDetailList(page,ids,req.getStartId())
|
||||
);
|
||||
return pageUtils;
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
|
||||
|
||||
List<ChartStatistical> countNumByScoreLevel(@Param("startId") Long startId);
|
||||
|
||||
List<ResultRecord> selectResultRankList(@Param("page") IPage page, @Param("staffIds") List<String> staffIds);
|
||||
List<ResultRecord> selectChartDetailList(@Param("page") IPage page, @Param("staffIds") List<String> staffIds, @Param("startId")Long startId);
|
||||
|
||||
void batchDeleteByStartId(@Param("startId")Long startId);
|
||||
|
||||
|
||||
@ -360,11 +360,20 @@
|
||||
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>
|
||||
|
||||
<select id="selectResultRankList" resultType="com.lz.modules.performance.res.ResultRankListRes">
|
||||
SELECT r.id,all_score,department_name,staff_name,score_level,job_number from lz_result_record r
|
||||
<select id="selectChartDetailList" resultType="com.lz.modules.performance.res.ResultRankListRes">
|
||||
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}
|
||||
<if test="staffIds!=null and staffIds.size()!=0">
|
||||
and r.staff_id in (
|
||||
<foreach collection="staffIds" item="staff_id" separator=",">
|
||||
#{staff_id}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
ORDER BY all_score desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user