Browse Source

首页大屏后端1.1

main
parent
commit
fbe2f61a10
  1. 6
      src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java
  2. 11
      src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java
  3. 20
      src/main/java/com/biutag/supervision/service/DataGobalService.java

6
src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java

@ -58,13 +58,15 @@ public class DataGobalController {
// 业务类型占比
List<EchartsVo> ywzblist = dataGobalService.getBusinessRate(beginTime, endTime);
// 问题趋势
// 问题类型占比
List<EchartsVo> wtlxlist = dataGobalService.getProblemRate(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("overview", overview)
.fluentPut("fxsjlist", fxsjlist)
.fluentPut("jsdwlist", jsdwlist)
.fluentPut("ywzblist", ywzblist);
.fluentPut("ywzblist", ywzblist)
.fluentPut("wtlxlist", wtlxlist);
return Result.success(data);
}

11
src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java

@ -2,7 +2,18 @@ package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.NegativeProblemRelation;
import com.biutag.supervision.pojo.vo.EchartsVo;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List;
public interface NegativeProblemRelationMapper extends BaseMapper<NegativeProblemRelation> {
@Select("SELECT npr.oneLevelContent as name, count(*) value " +
"FROM negative_problem_relation npr " +
"WHERE npr.oneLevelContent is not NULL " +
"GROUP BY `name` ")
List<EchartsVo> selectProblemRate(Date beginTime, Date endTime);
}

20
src/main/java/com/biutag/supervision/service/DataGobalService.java

@ -6,6 +6,7 @@ import com.biutag.supervision.constants.enums.InspectCaseEnum;
import com.biutag.supervision.mapper.DataCaseVerifMapper;
import com.biutag.supervision.mapper.DataSupervisionNotifyMapper;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.mapper.NegativeProblemRelationMapper;
import com.biutag.supervision.pojo.dto.CaseVerifDepart;
import com.biutag.supervision.pojo.entity.DataCaseVerif;
import com.biutag.supervision.pojo.entity.DataSupervisionNotify;
@ -31,6 +32,7 @@ public class DataGobalService {
private final NegativeMapper negativeMapper;
private final NegativeProblemRelationMapper negativeProblemRelationMapper;
/**
* 获取所有大屏统计数据
@ -114,4 +116,22 @@ public class DataGobalService {
List<RecentTrendByMonthVo> trendByMonthVoList = negativeMapper.selectRecentTrendByMonth(year);
return trendByMonthVoList;
}
/**
* 获取问题类型占比
* @param beginTime
* @param endTime
* @return
*/
public List<EchartsVo> getProblemRate(Date beginTime, Date endTime) {
/**
* SELECT npr.oneLevelContent as name, count(*) value
* FROM negative_problem_relation npr
* WHERE npr.oneLevelContent is not NULL
* GROUP BY `name`
*/
List<EchartsVo> wtlxList = negativeProblemRelationMapper.selectProblemRate(beginTime, endTime);
return wtlxList;
}
}

Loading…
Cancel
Save