This commit is contained in:
杜建超 2020-10-26 14:28:40 +08:00
parent 2a18e0b3a8
commit 82cade6318
12 changed files with 90 additions and 81 deletions

View File

@ -2,25 +2,16 @@ package com.lz.modules.performance.controller;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.modules.flow.entity.EvaluationGroup;
import com.lz.modules.flow.service.EvaluationGroupService;
import com.lz.modules.performance.req.ChartResultReq;
import com.lz.modules.equipment.entity.model.BasePage;
import com.lz.modules.performance.res.ChartStatisticalRes;
import com.lz.modules.performance.res.ResultRankListRes;
import com.lz.modules.performance.res.TaskListRes;
import com.lz.modules.performance.service.ChartResultService;
import com.lz.modules.sys.controller.AbstractController;
import io.swagger.annotations.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.function.ToLongFunction;
/**
* @Author: djc
@ -36,19 +27,30 @@ public class ChartController extends AbstractController{
@PostMapping("chart/result")
@ApiOperation("获取绩效报表统计")
@ApiImplicitParam(name = "startId",value = "考核周期标识id", required = true, dataType = "Long",paramType = "query")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStatisticalRes.class)})
public R chartResult(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) ChartResultReq req){
List<ChartStatisticalRes> chartStatisticalRes = chartResultService.chartReport(req);
public R chartResult(@RequestParam Long startId){
List<ChartStatisticalRes> chartStatisticalRes = chartResultService.chartReport(startId);
return R.ok().put("data",chartStatisticalRes);
}
@PostMapping("chart/rank")
@PostMapping("chart/starts")
@ApiOperation("获取考核类型列表")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStatisticalRes.class)})
public R chartStarts(@RequestBody BasePage req){
return R.ok().put("data","");
}
/*@PostMapping("chart/rank")
@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);
return R.ok().put("data",pageUtils);
}
}*/

View File

@ -1,31 +0,0 @@
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;
import java.time.YearMonth;
/**
* @Author: djc
* @Desc:
* @Date: 2020/10/14 16:50
*/
@Data
@ApiModel(value = "绩效报表请求实体")
public class ChartResultReq extends BasePage{
//考核类型 月度 季度
@ApiModelProperty(value = "考核类型 月度,自定义",name = "type")
private int type = 0;
@ApiModelProperty(value = "如果为月度 默认当前月",name = "month")
private String month = YearMonth.now().toString();
@ApiModelProperty(value = "自定义起始时间",name = "startTime")
private String startTime;
@ApiModelProperty(value = "自定义结束时间",name = "endTime")
private String endTime;
}

View File

@ -0,0 +1,12 @@
package com.lz.modules.performance.res;
import lombok.Data;
@Data
public class ChartStart{
private String time;
private Long startId;
}

View File

@ -0,0 +1,19 @@
package com.lz.modules.performance.res;
import lombok.Data;
import java.util.List;
/**
* @Author: djc
* @Desc:
* @Date: 2020/10/26 14:21
*/
@Data
public class ChartStartsRes {
private int type;
private List<ChartStart> list;
}

View File

@ -2,7 +2,6 @@ package com.lz.modules.performance.service;
import com.lz.common.utils.PageUtils;
import com.lz.modules.performance.req.AssessTaskReq;
import com.lz.modules.performance.req.ChartResultReq;
import com.lz.modules.performance.res.ChartStatisticalRes;
import java.util.List;
@ -15,5 +14,5 @@ import java.util.List;
public interface AssessService {
PageUtils userTaskList(AssessTaskReq req,Long userId);
List<ChartStatisticalRes> chartResult(ChartResultReq req);
//List<ChartStatisticalRes> chartResult(ChartResultReq req);
}

View File

@ -1,12 +1,9 @@
package com.lz.modules.performance.service;
import com.lz.common.utils.PageUtils;
import com.lz.modules.performance.req.ChartResultReq;
import com.lz.modules.performance.res.ChartStatistical;
import com.lz.modules.performance.res.ChartStatisticalRes;
import com.lz.modules.performance.res.ResultRankListRes;
import java.math.BigDecimal;
import java.util.List;
/**
@ -16,10 +13,12 @@ import java.util.List;
*/
public interface ChartResultService {
List<ChartStatisticalRes> chartReport(ChartResultReq req);
List<ChartStatisticalRes> chartReport(Long startId);
List<ChartStatistical> countDepartmentAndStaffNum(List<String>staffIds);
PageUtils resultRankList(ChartResultReq req);
//PageUtils resultRankList(ChartResultReq req);
void chartStarts();
}

View File

@ -9,7 +9,6 @@ import com.lz.modules.flow.service.FlowChangeService;
import com.lz.modules.flow.service.FlowRecordService;
import com.lz.modules.performance.dto.TaskListDto;
import com.lz.modules.performance.req.AssessTaskReq;
import com.lz.modules.performance.req.ChartResultReq;
import com.lz.modules.performance.res.ChartStatisticalRes;
import com.lz.modules.performance.res.TaskListRes;
import com.lz.modules.performance.service.AssessService;
@ -67,9 +66,4 @@ public class AssessServiceImpl implements AssessService {
return data;
}
@Override
public List<ChartStatisticalRes> chartResult(ChartResultReq req) {
return null;
}
}

View File

@ -6,20 +6,22 @@ import com.lz.common.utils.PageUtils;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.service.DepartmentsStaffRelateService;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.service.EvaluationGroupService;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.ChartResultReq;
import com.lz.modules.flow.service.FlowStartService;
import com.lz.modules.performance.res.ChartStart;
import com.lz.modules.performance.res.ChartStartsRes;
import com.lz.modules.performance.res.ChartStatistical;
import com.lz.modules.performance.res.ChartStatisticalRes;
import com.lz.modules.performance.service.ChartResultService;
import com.lz.modules.sys.dao.app.ResultRecordMapper;
import com.lz.modules.sys.service.app.ResultRecordService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.function.Consumer;
/**
* @Author: djc
@ -39,21 +41,21 @@ public class ChartResultServiceImpl implements ChartResultService {
private ResultRecordMapper resultRecordMapper;
@Autowired
private StaffService staffService;
@Autowired
private FlowStartService flowStartService;
@Override
public List<ChartStatisticalRes> chartReport(ChartResultReq req) {
public List<ChartStatisticalRes> chartReport(Long startId) {
List<ChartStatisticalRes> data = new ArrayList<>();
AssessDetailReq query = new AssessDetailReq();
ChartStatisticalRes res;
BeanUtils.copyProperties(req,query);
List<ChartStatistical> process = resultRecordService.countNumByFlowProcess(query);
List<ChartStatistical> process = resultRecordService.countNumByFlowProcess(startId);
res = new ChartStatisticalRes();
res.setType(0);
res.setStatisticals(process);
data.add(res);
List<ChartStatistical> scoreLevel = resultRecordService.countNumByScoreLevel(query);
List<ChartStatistical> scoreLevel = resultRecordService.countNumByScoreLevel(startId);
res = new ChartStatisticalRes();
res.setType(1);
res.setStatisticals(scoreLevel);
@ -99,11 +101,26 @@ public class ChartResultServiceImpl implements ChartResultService {
return data;
}
@Override
/* @Override
public PageUtils resultRankList(ChartResultReq req) {
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()).doSelect(
page -> resultRecordMapper.selectResultRankList(page,req)
);
return pageUtils;
}*/
@Override
public void chartStarts() {
List<ChartStartsRes> res = new ArrayList<>();
List<FlowStart> list = flowStartService.list(new QueryWrapper<FlowStart>().eq("is_delete", 0).orderByAsc("start_time"));
list.forEach(new Consumer<FlowStart>() {
@Override
public void accept(FlowStart flowStart) {
if(flowStart.getCycleType()==0){
ChartStart chartStart = new ChartStart();
}
}
});
}
}

View File

@ -16,8 +16,6 @@ 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.req.ChartResultReq;
import com.lz.modules.performance.res.AssessManagerDetailRes;
import com.lz.modules.performance.res.ChartStatistical;
import com.lz.modules.sys.entity.app.ResultRecord;
@ -74,11 +72,11 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
List<ResultRecord> selectResultRecordAllByStaffId(@Param("staffId") Long staffId);
List<ChartStatistical> countNumByFlowProcess(@Param("req") AssessDetailReq req);
List<ChartStatistical> countNumByFlowProcess(@Param("startId") Long startId);
List<ChartStatistical> countNumByScoreLevel(@Param("req") AssessDetailReq req);
List<ChartStatistical> countNumByScoreLevel(@Param("startId") Long startId);
List<ResultRecord> selectResultRankList(@Param("page") IPage page, @Param("req") ChartResultReq req);
//List<ResultRecord> selectResultRankList(@Param("page") IPage page, @Param("req") ChartResultReq req);
void batchDeleteByStartId(@Param("startId")Long startId);

View File

@ -101,9 +101,9 @@ public interface ResultRecordService extends IService<ResultRecord> {
List<ResultRecord> selectResultRecordAllByStaffId(Long staffId);
List<ChartStatistical> countNumByFlowProcess(AssessDetailReq req);
List<ChartStatistical> countNumByFlowProcess(Long startId);
List<ChartStatistical> countNumByScoreLevel(AssessDetailReq req);
List<ChartStatistical> countNumByScoreLevel(Long startId);
void batchDeleteByStaffIds(List<String> staffIds);

View File

@ -733,13 +733,13 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
@Override
public List<ChartStatistical> countNumByFlowProcess(AssessDetailReq req) {
return resultRecordMapper.countNumByFlowProcess(req);
public List<ChartStatistical> countNumByFlowProcess(Long startId) {
return resultRecordMapper.countNumByFlowProcess(startId);
}
@Override
public List<ChartStatistical> countNumByScoreLevel(AssessDetailReq req) {
return resultRecordMapper.countNumByScoreLevel(req);
public List<ChartStatistical> countNumByScoreLevel(Long startId) {
return resultRecordMapper.countNumByScoreLevel(startId);
}
@Override

View File

@ -353,11 +353,11 @@
</select>
<select id="countNumByFlowProcess" resultType="com.lz.modules.performance.res.ChartStatistical">
SELECT count(flow_process) num,flow_process as 'desc' from lz_result_record where is_delete=0 GROUP BY flow_process
SELECT count(flow_process) num,flow_process as 'desc' from lz_result_record where is_delete=0 and start_id =#{startId} GROUP BY flow_process
</select>
<select id="countNumByScoreLevel" resultType="com.lz.modules.performance.res.ChartStatistical">
SELECT count(score_level) num,score_level as 'desc' from lz_result_record where is_delete=0 GROUP BY score_level
SELECT count(score_level) num,score_level 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">