This commit is contained in:
杜建超 2020-10-26 17:05:46 +08:00
parent 2f519074d3
commit 353daceb41
3 changed files with 45 additions and 2 deletions

View File

@ -9,6 +9,7 @@ public enum ResultFlowProcessEnum {
TARGET(0,"制定目标"),
CONFIRM(1,"目标确认"),
DO(2,"执行中"),
WRITE(3,"结果值录入"),
SCORE(4,"评分"),
FINISH(5,"考核结束"),
;
@ -17,6 +18,15 @@ public enum ResultFlowProcessEnum {
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) {
this.status = status;

View File

@ -10,12 +10,14 @@ import com.lz.modules.flow.dao.FlowStartMapper;
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.ChartStartsReq;
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.entity.app.ResultRecord;
import com.lz.modules.sys.service.app.ResultRecordService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -53,9 +55,10 @@ public class ChartResultServiceImpl implements ChartResultService {
ChartStatisticalRes res;
List<ChartStatistical> process = resultRecordService.countNumByFlowProcess(startId);
res = new ChartStatisticalRes();
res.setType(0);
res.setStatisticals(process);
res.setStatisticals(buildProcess(process,startId));
res.setDefaultTime(defaultTime);
data.add(res);
@ -140,4 +143,34 @@ public class ChartResultServiceImpl implements ChartResultService {
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;
}
}

View File

@ -357,7 +357,7 @@
</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 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 id="selectResultRankList" resultType="com.lz.modules.performance.res.ResultRankListRes">