fix
This commit is contained in:
parent
2f519074d3
commit
353daceb41
@ -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;
|
||||||
|
|||||||
@ -10,12 +10,14 @@ 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.enums.ResultFlowProcessEnum;
|
||||||
import com.lz.modules.performance.req.ChartStartsReq;
|
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;
|
||||||
@ -53,9 +55,10 @@ public class ChartResultServiceImpl implements ChartResultService {
|
|||||||
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);
|
res.setDefaultTime(defaultTime);
|
||||||
data.add(res);
|
data.add(res);
|
||||||
|
|
||||||
@ -140,4 +143,34 @@ public class ChartResultServiceImpl implements ChartResultService {
|
|||||||
return pages;
|
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">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user