提交修改
This commit is contained in:
commit
41e6a8a7c7
@ -488,6 +488,7 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
|
|||||||
}else{
|
}else{
|
||||||
log.info("没有找到父级部门,部门id{}", depId);
|
log.info("没有找到父级部门,部门id{}", depId);
|
||||||
departManagers.setManagers(new ArrayList<>());
|
departManagers.setManagers(new ArrayList<>());
|
||||||
|
return departManagers;
|
||||||
}
|
}
|
||||||
type--;
|
type--;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,4 +36,8 @@ public interface FlowStartMapper extends BaseMapper<FlowStart> {
|
|||||||
List<FlowStart> selectListByTime(@Param("page") IPage page, @Param("cycleType")Integer cycleType,@Param("name")String name);
|
List<FlowStart> selectListByTime(@Param("page") IPage page, @Param("cycleType")Integer cycleType,@Param("name")String name);
|
||||||
|
|
||||||
FlowStart selectFlowStartByName(@Param("name") String name);
|
FlowStart selectFlowStartByName(@Param("name") String name);
|
||||||
|
|
||||||
|
List<FlowStart> selectListByPage(@Param("page")IPage page,@Param("cycleType") Integer cycleType);
|
||||||
|
|
||||||
|
FlowStart selectRecentlyLimt();
|
||||||
}
|
}
|
||||||
@ -36,4 +36,6 @@ public interface FlowStartService extends IService<FlowStart> {
|
|||||||
FlowStart selectFlowStartByName(String name);
|
FlowStart selectFlowStartByName(String name);
|
||||||
|
|
||||||
R saveStart(FlowStart flowStart);
|
R saveStart(FlowStart flowStart);
|
||||||
|
|
||||||
|
R getModelById(Long id, int type);
|
||||||
}
|
}
|
||||||
@ -104,6 +104,9 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
|||||||
@Override
|
@Override
|
||||||
public List<String> selectAllStaffIdsByGroupId(Long id) {
|
public List<String> selectAllStaffIdsByGroupId(Long id) {
|
||||||
EvaluationGroup evaluationGroup = this.selectEvaluationGroupById(id);
|
EvaluationGroup evaluationGroup = this.selectEvaluationGroupById(id);
|
||||||
|
if(evaluationGroup ==null ){
|
||||||
|
return Collections.EMPTY_LIST;
|
||||||
|
}
|
||||||
String depIds = evaluationGroup.getDepIds();
|
String depIds = evaluationGroup.getDepIds();
|
||||||
Set<String> allDeparmentIds = new HashSet<>();
|
Set<String> allDeparmentIds = new HashSet<>();
|
||||||
if(StringUtils.isNotBlank(depIds)){
|
if(StringUtils.isNotBlank(depIds)){
|
||||||
|
|||||||
@ -490,5 +490,14 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
return R.ok("发起成功");
|
return R.ok("发起成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R getModelById(Long id, int type){
|
||||||
|
/*EvaluationGroup evaluationGroup = evaluationGroupService.selectEvaluationGroupById(id);
|
||||||
|
List<StaffSimpleInfo> staffIds = evaluationGroupService.selectAllStaffSimpleInfoByGroupId(evaluationGroup);*/
|
||||||
|
//flowStart = flowStartService.selectFlowStartById(flowStart.getId());
|
||||||
|
DepartManagers staffEntity = staffService.findLeader(id, type);
|
||||||
|
return R.ok().put("data",staffEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,8 +71,7 @@ public class AssessManagerController {
|
|||||||
if(flowStart == null){
|
if(flowStart == null){
|
||||||
return R.error("没有此条记录");
|
return R.error("没有此条记录");
|
||||||
}
|
}
|
||||||
resultRecordMapper.batchDeleteByStartId(flowStart.getId());
|
assessManagerService.accessDelete(flowStart);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,12 +2,19 @@ package com.lz.modules.performance.controller;
|
|||||||
|
|
||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
|
import com.lz.common.utils.StringUtil;
|
||||||
import com.lz.modules.equipment.entity.model.BasePage;
|
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.ChartStartsReq;
|
||||||
|
import com.lz.modules.performance.res.ChartStartsRes;
|
||||||
import com.lz.modules.performance.res.ChartStatisticalRes;
|
import com.lz.modules.performance.res.ChartStatisticalRes;
|
||||||
import com.lz.modules.performance.res.ResultRankListRes;
|
import com.lz.modules.performance.res.ResultRankListRes;
|
||||||
import com.lz.modules.performance.service.ChartResultService;
|
import com.lz.modules.performance.service.ChartResultService;
|
||||||
import com.lz.modules.sys.controller.AbstractController;
|
import com.lz.modules.sys.controller.AbstractController;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -24,23 +31,35 @@ import java.util.*;
|
|||||||
public class ChartController extends AbstractController{
|
public class ChartController extends AbstractController{
|
||||||
@Autowired
|
@Autowired
|
||||||
private ChartResultService chartResultService;
|
private ChartResultService chartResultService;
|
||||||
|
@Autowired
|
||||||
|
private FlowStartMapper flowStartMapper;
|
||||||
|
|
||||||
@PostMapping("chart/result")
|
@GetMapping("chart/result")
|
||||||
@ApiOperation("获取绩效报表统计")
|
@ApiOperation("获取绩效报表统计")
|
||||||
@ApiImplicitParam(name = "startId",value = "考核周期标识id", required = true, dataType = "Long",paramType = "query")
|
|
||||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStatisticalRes.class)})
|
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStatisticalRes.class)})
|
||||||
public R chartResult(@RequestParam Long startId){
|
public R chartResult(@RequestParam(required = false) @ApiParam(name = "startId",value = "考核周期标识id") Long startId){
|
||||||
List<ChartStatisticalRes> chartStatisticalRes = chartResultService.chartReport(startId);
|
String defaultTime = StringUtils.EMPTY;
|
||||||
|
if(startId==null){
|
||||||
|
//取最近一条记录
|
||||||
|
FlowStart flowStart = flowStartMapper.selectRecentlyLimt();
|
||||||
|
if(flowStart!=null){
|
||||||
|
startId = flowStart.getId();
|
||||||
|
defaultTime = flowStart.getName();
|
||||||
|
}else {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<ChartStatisticalRes> chartStatisticalRes = chartResultService.chartReport(startId,defaultTime);
|
||||||
return R.ok().put("data",chartStatisticalRes);
|
return R.ok().put("data",chartStatisticalRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("chart/starts")
|
@PostMapping("chart/starts")
|
||||||
@ApiOperation("获取考核类型列表")
|
@ApiOperation("获取考核类型列表")
|
||||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStatisticalRes.class)})
|
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStartsRes.class)})
|
||||||
public R chartStarts(@RequestBody BasePage req){
|
public R chartStarts(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true)ChartStartsReq req){
|
||||||
|
PageUtils pageUtils = chartResultService.chartStarts(req);
|
||||||
return R.ok().put("data","");
|
return R.ok().put("data",pageUtils);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -46,8 +46,6 @@ public class FlowStartController {
|
|||||||
private FlowStartService flowStartService;
|
private FlowStartService flowStartService;
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private EvaluationGroupService evaluationGroupService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -58,11 +56,7 @@ public class FlowStartController {
|
|||||||
|
|
||||||
@GetMapping("/getById")
|
@GetMapping("/getById")
|
||||||
public R getById(@RequestParam Long id, @RequestParam int type) {
|
public R getById(@RequestParam Long id, @RequestParam int type) {
|
||||||
EvaluationGroup evaluationGroup = evaluationGroupService.selectEvaluationGroupById(id);
|
return flowStartService.getModelById(id, type);
|
||||||
List<StaffSimpleInfo> staffIds = evaluationGroupService.selectAllStaffSimpleInfoByGroupId(evaluationGroup);
|
|
||||||
//flowStart = flowStartService.selectFlowStartById(flowStart.getId());
|
|
||||||
//List<StaffEntity> staffEntity = staffService.findLeader(id, type);
|
|
||||||
return R.ok().put("data",staffIds);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@ public enum ResultFlowProcessEnum {
|
|||||||
TARGET(0,"制定目标"),
|
TARGET(0,"制定目标"),
|
||||||
CONFIRM(1,"目标确认"),
|
CONFIRM(1,"目标确认"),
|
||||||
DO(2,"执行中"),
|
DO(2,"执行中"),
|
||||||
|
WRITE(3,"结果值录入"),
|
||||||
SCORE(4,"评分"),
|
SCORE(4,"评分"),
|
||||||
FINISH(5,"考核结束"),
|
FINISH(5,"考核结束"),
|
||||||
;
|
;
|
||||||
@ -17,6 +18,15 @@ public enum ResultFlowProcessEnum {
|
|||||||
private String desc;
|
private String desc;
|
||||||
|
|
||||||
|
|
||||||
|
public static String getDesc(int status){
|
||||||
|
for(ResultFlowProcessEnum flowProcessEnum:ResultFlowProcessEnum.values()){
|
||||||
|
if(flowProcessEnum.getStatus() == status){
|
||||||
|
return flowProcessEnum.getDesc();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
ResultFlowProcessEnum(int status, String desc) {
|
ResultFlowProcessEnum(int status, String desc) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
|
|||||||
@ -0,0 +1,21 @@
|
|||||||
|
package com.lz.modules.performance.req;
|
||||||
|
|
||||||
|
import com.lz.modules.equipment.entity.model.BasePage;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: djc
|
||||||
|
* @Desc:
|
||||||
|
* @Date: 2020/10/26 15:08
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("获取考核类型列表")
|
||||||
|
public class ChartStartsReq extends BasePage{
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "(必传)类型,0 月度 1:自定义",name = "cycleType",required = true)
|
||||||
|
private Integer cycleType;
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,12 +0,0 @@
|
|||||||
package com.lz.modules.performance.res;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class ChartStart{
|
|
||||||
|
|
||||||
private String time;
|
|
||||||
|
|
||||||
private Long startId;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,5 +1,7 @@
|
|||||||
package com.lz.modules.performance.res;
|
package com.lz.modules.performance.res;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -10,10 +12,13 @@ import java.util.List;
|
|||||||
* @Date: 2020/10/26 14:21
|
* @Date: 2020/10/26 14:21
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@ApiModel("全部考核列表实体")
|
||||||
public class ChartStartsRes {
|
public class ChartStartsRes {
|
||||||
private int type;
|
@ApiModelProperty(value = "时间" , name = "time",example = "2020年08月绩效考核")
|
||||||
|
private String time;
|
||||||
|
|
||||||
private List<ChartStart> list;
|
@ApiModelProperty(value = "考核id" , name = "startId")
|
||||||
|
private Long startId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ApiModel(value = "报表统计实体")
|
@ApiModel(value = "报表统计实体")
|
||||||
@ -13,4 +14,7 @@ public class ChartStatistical {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "人数",name = "num")
|
@ApiModelProperty(value = "人数",name = "num")
|
||||||
private int num = 0;
|
private int num = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否被选中",name = "check")
|
||||||
|
private int check;
|
||||||
}
|
}
|
||||||
@ -17,6 +17,9 @@ public class ChartStatisticalRes {
|
|||||||
@ApiModelProperty(value = "类型 0:节点统计 1:等级统计 2:人数统计 ",name = "type")
|
@ApiModelProperty(value = "类型 0:节点统计 1:等级统计 2:人数统计 ",name = "type")
|
||||||
private int type;
|
private int type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "默认时间 ",name = "defaultTime")
|
||||||
|
private String defaultTime;
|
||||||
|
|
||||||
private List<ChartStatistical> statisticals;
|
private List<ChartStatistical> statisticals;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,4 +16,6 @@ public interface AssessManagerService {
|
|||||||
|
|
||||||
|
|
||||||
PageUtils assessDetail(AssessDetailReq req);
|
PageUtils assessDetail(AssessDetailReq req);
|
||||||
|
|
||||||
|
void accessDelete(FlowStart flowStart);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
package com.lz.modules.performance.service;
|
package com.lz.modules.performance.service;
|
||||||
|
|
||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
|
import com.lz.modules.equipment.entity.model.BasePage;
|
||||||
|
import com.lz.modules.performance.req.ChartStartsReq;
|
||||||
|
import com.lz.modules.performance.res.ChartStartsRes;
|
||||||
import com.lz.modules.performance.res.ChartStatistical;
|
import com.lz.modules.performance.res.ChartStatistical;
|
||||||
import com.lz.modules.performance.res.ChartStatisticalRes;
|
import com.lz.modules.performance.res.ChartStatisticalRes;
|
||||||
|
|
||||||
@ -13,12 +16,12 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface ChartResultService {
|
public interface ChartResultService {
|
||||||
|
|
||||||
List<ChartStatisticalRes> chartReport(Long startId);
|
List<ChartStatisticalRes> chartReport(Long startId,String defaultTime);
|
||||||
|
|
||||||
List<ChartStatistical> countDepartmentAndStaffNum(List<String>staffIds);
|
List<ChartStatistical> countDepartmentAndStaffNum(List<String>staffIds);
|
||||||
|
|
||||||
//PageUtils resultRankList(ChartResultReq req);
|
//PageUtils resultRankList(ChartResultReq req);
|
||||||
|
|
||||||
void chartStarts();
|
PageUtils chartStarts(ChartStartsReq req);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,4 +78,12 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
|||||||
);
|
);
|
||||||
return pageUtils;
|
return pageUtils;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void accessDelete(FlowStart flowStart) {
|
||||||
|
flowStart.setIsDelete(1);
|
||||||
|
flowStartMapper.updateFlowStartById(flowStart);
|
||||||
|
resultRecordMapper.batchDeleteByStartId(flowStart.getId());
|
||||||
|
return ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,22 +6,24 @@ import com.lz.common.utils.PageUtils;
|
|||||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
|
import com.lz.modules.flow.dao.FlowStartMapper;
|
||||||
import com.lz.modules.flow.entity.FlowStart;
|
import com.lz.modules.flow.entity.FlowStart;
|
||||||
import com.lz.modules.flow.service.EvaluationGroupService;
|
import com.lz.modules.flow.service.EvaluationGroupService;
|
||||||
import com.lz.modules.flow.service.FlowStartService;
|
import com.lz.modules.flow.service.FlowStartService;
|
||||||
import com.lz.modules.performance.res.ChartStart;
|
import com.lz.modules.performance.enums.ResultFlowProcessEnum;
|
||||||
|
import com.lz.modules.performance.req.ChartStartsReq;
|
||||||
import com.lz.modules.performance.res.ChartStartsRes;
|
import com.lz.modules.performance.res.ChartStartsRes;
|
||||||
import com.lz.modules.performance.res.ChartStatistical;
|
import com.lz.modules.performance.res.ChartStatistical;
|
||||||
import com.lz.modules.performance.res.ChartStatisticalRes;
|
import com.lz.modules.performance.res.ChartStatisticalRes;
|
||||||
import com.lz.modules.performance.service.ChartResultService;
|
import com.lz.modules.performance.service.ChartResultService;
|
||||||
import com.lz.modules.sys.dao.app.ResultRecordMapper;
|
import com.lz.modules.sys.dao.app.ResultRecordMapper;
|
||||||
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: djc
|
* @Author: djc
|
||||||
@ -43,22 +45,28 @@ public class ChartResultServiceImpl implements ChartResultService {
|
|||||||
private StaffService staffService;
|
private StaffService staffService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private FlowStartService flowStartService;
|
private FlowStartService flowStartService;
|
||||||
|
@Autowired
|
||||||
|
private FlowStartMapper flowStartMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ChartStatisticalRes> chartReport(Long startId) {
|
public List<ChartStatisticalRes> chartReport(Long startId,String defaultTime) {
|
||||||
List<ChartStatisticalRes> data = new ArrayList<>();
|
List<ChartStatisticalRes> data = new ArrayList<>();
|
||||||
ChartStatisticalRes res;
|
ChartStatisticalRes res;
|
||||||
|
|
||||||
List<ChartStatistical> process = resultRecordService.countNumByFlowProcess(startId);
|
List<ChartStatistical> process = resultRecordService.countNumByFlowProcess(startId);
|
||||||
|
|
||||||
res = new ChartStatisticalRes();
|
res = new ChartStatisticalRes();
|
||||||
res.setType(0);
|
res.setType(0);
|
||||||
res.setStatisticals(process);
|
res.setStatisticals(buildProcess(process,startId));
|
||||||
|
res.setDefaultTime(defaultTime);
|
||||||
data.add(res);
|
data.add(res);
|
||||||
|
|
||||||
List<ChartStatistical> scoreLevel = resultRecordService.countNumByScoreLevel(startId);
|
List<ChartStatistical> scoreLevel = resultRecordService.countNumByScoreLevel(startId);
|
||||||
res = new ChartStatisticalRes();
|
res = new ChartStatisticalRes();
|
||||||
res.setType(1);
|
res.setType(1);
|
||||||
res.setStatisticals(scoreLevel);
|
res.setStatisticals(scoreLevel);
|
||||||
|
res.setDefaultTime(defaultTime);
|
||||||
data.add(res);
|
data.add(res);
|
||||||
|
|
||||||
List<String> strings = evaluationGroupService.selectAllStaffIdsByGroupId(3L);
|
List<String> strings = evaluationGroupService.selectAllStaffIdsByGroupId(3L);
|
||||||
@ -66,6 +74,7 @@ public class ChartResultServiceImpl implements ChartResultService {
|
|||||||
res = new ChartStatisticalRes();
|
res = new ChartStatisticalRes();
|
||||||
res.setType(2);
|
res.setType(2);
|
||||||
res.setStatisticals(depstaff);
|
res.setStatisticals(depstaff);
|
||||||
|
res.setDefaultTime(defaultTime);
|
||||||
data.add(res);
|
data.add(res);
|
||||||
return data;
|
return data;
|
||||||
|
|
||||||
@ -110,17 +119,58 @@ public class ChartResultServiceImpl implements ChartResultService {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void chartStarts() {
|
public PageUtils chartStarts(ChartStartsReq req) {
|
||||||
List<ChartStartsRes> res = new ArrayList<>();
|
List<ChartStartsRes> data = new ArrayList<>();
|
||||||
List<FlowStart> list = flowStartService.list(new QueryWrapper<FlowStart>().eq("is_delete", 0).orderByAsc("start_time"));
|
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()).doSelect(
|
||||||
list.forEach(new Consumer<FlowStart>() {
|
page -> flowStartMapper.selectListByPage(page,req.getCycleType())
|
||||||
@Override
|
);
|
||||||
public void accept(FlowStart flowStart) {
|
List<FlowStart> starts = pageUtils.getList();
|
||||||
|
starts.forEach(flowStart -> {
|
||||||
if(flowStart.getCycleType()==0){
|
ChartStartsRes start = new ChartStartsRes();
|
||||||
ChartStart chartStart = new ChartStart();
|
start.setStartId(flowStart.getId());
|
||||||
}
|
start.setTime(flowStart.getName());
|
||||||
}
|
data.add(start);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
PageUtils pages = new PageUtils();
|
||||||
|
pages.setTotalPage(pageUtils.getTotalPage());
|
||||||
|
pages.setTotalCount(pageUtils.getTotalCount());
|
||||||
|
pages.setCurrPage(req.getCurrPage());
|
||||||
|
pages.setPageSize(req.getPageSize());
|
||||||
|
pages.setList(data);
|
||||||
|
|
||||||
|
return pages;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//构建流程默认人数
|
||||||
|
private List<ChartStatistical> buildProcess(List<ChartStatistical> process,Long startId){
|
||||||
|
List<ChartStatistical> data = new ArrayList<>();
|
||||||
|
Map map = Maps.newHashMap();
|
||||||
|
int count = resultRecordService.count(new QueryWrapper<ResultRecord>()
|
||||||
|
.eq("is_delete", 0)
|
||||||
|
.eq("start_id", startId));
|
||||||
|
|
||||||
|
ChartStatistical all = new ChartStatistical();
|
||||||
|
all.setDesc("参与人数");
|
||||||
|
all.setNum(count);
|
||||||
|
data.add(all);
|
||||||
|
|
||||||
|
for(ChartStatistical statistical:process){
|
||||||
|
map.put(ResultFlowProcessEnum.getDesc(Integer.valueOf(statistical.getDesc())),statistical.getNum());
|
||||||
|
}
|
||||||
|
for(ResultFlowProcessEnum flowProcessEnum:ResultFlowProcessEnum.values()){
|
||||||
|
ChartStatistical statistical = new ChartStatistical();
|
||||||
|
statistical.setDesc(flowProcessEnum.getDesc());
|
||||||
|
statistical.setNum(0);
|
||||||
|
Object o = map.get(flowProcessEnum.getDesc());
|
||||||
|
if(o!=null){
|
||||||
|
statistical.setNum(Integer.valueOf(o.toString()));
|
||||||
|
}
|
||||||
|
data.add(statistical);
|
||||||
|
}
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -357,7 +357,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="countNumByScoreLevel" resultType="com.lz.modules.performance.res.ChartStatistical">
|
<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 and start_id =#{startId} GROUP BY score_level
|
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>
|
||||||
|
|
||||||
<select id="selectResultRankList" resultType="com.lz.modules.performance.res.ResultRankListRes">
|
<select id="selectResultRankList" resultType="com.lz.modules.performance.res.ResultRankListRes">
|
||||||
|
|||||||
@ -101,5 +101,17 @@
|
|||||||
<select id="selectFlowStartByName" resultType="FlowStart" >
|
<select id="selectFlowStartByName" resultType="FlowStart" >
|
||||||
select * from lz_flow_start where name=#{name} and is_delete = 0 limit 1
|
select * from lz_flow_start where name=#{name} and is_delete = 0 limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectListByPage" resultType="FlowStart">
|
||||||
|
select * from lz_flow_start where is_delete = 0
|
||||||
|
<if test="cycleType !=null">
|
||||||
|
and cycle_type=#{cycleType}
|
||||||
|
</if>
|
||||||
|
order by id desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRecentlyLimt" resultType="FlowStart">
|
||||||
|
select * from lz_flow_start where is_delete = 0 order by id desc limit 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -78,7 +78,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectByStaffId" resultType="com.lz.modules.app.entity.DepartmentsStaffRelateEntity">
|
<select id="selectByStaffId" resultType="com.lz.modules.app.entity.DepartmentsStaffRelateEntity">
|
||||||
select * from lz_departments_staff_relate where is_delete=0 and staff_id = #{staffId}
|
select * from lz_departments_staff_relate where is_delete=0 and staff_id = #{staffId} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user