Browse Source

fiex:大屏

master
pengwei 1 month ago
parent
commit
9629ae4601
  1. 21
      src/main/java/com/biutag/supervision/controller/datav/DataVAuditController.java
  2. 11
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneCaseVerifController.java
  3. 25
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  4. 20
      src/main/java/com/biutag/supervision/pojo/vo/AuditNegativeVo.java

21
src/main/java/com/biutag/supervision/controller/datav/DataVAuditController.java

@ -1,14 +1,18 @@
package com.biutag.supervision.controller.datav;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.biutag.supervision.constants.enums.ProblemSourcesEnum;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.common.PieItem;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeBlame;
import com.biutag.supervision.pojo.entity.News;
import com.biutag.supervision.pojo.vo.AuditNegativeVo;
import com.biutag.supervision.pojo.vo.AuditOverview;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.service.NegativeBlameService;
import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.NewsService;
@ -44,6 +48,8 @@ public class DataVAuditController {
private final NegativeService negativeService;
private final NegativeMapper negativeMapper;
private final NegativeBlameService negativeBlameService;
@GetMapping("/overview")
@ -59,6 +65,21 @@ public class DataVAuditController {
return Result.success(overview);
}
@GetMapping("/getAuditNegativeVo")
public Result<JSONObject> getAuditNegativeVo(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){
List<AuditNegativeVo> fxData = negativeMapper.getAuditNegativeVo(beginTime,endTime,"3");
List<AuditNegativeVo> jsData = negativeMapper.getAuditNegativeVo(beginTime,endTime,"4");
List<EchartsVo> barData = negativeMapper.getBarEchartsVoData(beginTime,endTime);
JSONObject object=new JSONObject();
object.fluentPut("fxData",fxData);
object.fluentPut("jsData",jsData);
object.fluentPut("barData",barData);
return Result.success(object);
}
@GetMapping("/getWorkDynamics")
public Result<List<News>> getWorkDynamics(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {

11
src/main/java/com/biutag/supervision/controller/subdatav/SubOneCaseVerifController.java

@ -8,6 +8,7 @@ import com.biutag.supervision.mapper.DataCaseVerifMapper;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.DataCaseVerif;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.vo.CaseVerificationCountVo;
import com.biutag.supervision.pojo.vo.CaseVerificationMapVo;
import com.biutag.supervision.pojo.vo.EchartsVo;
@ -22,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@ -110,7 +112,14 @@ public class SubOneCaseVerifController {
.eq(DataCaseVerif::getSecondDepartId,departId)
);
overview.setTotal((int) total);
int confirmed = overview.getConfirmed() != null?overview.getConfirmed():0;
List<String> list = Arrays.asList( A12389.getValue(),SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue());
long confirmed = negativeMapper.selectCount(new LambdaQueryWrapper<Negative>()
.eq(Negative::getSecondInvolveDepartId,departId)
.in(Negative::getProblemSourcesCode,list).between(Negative::getCrtTime,beginTime,endTime));
if(total != 0 && confirmed != 0) {
overview.setRate(NumberUtil.div((Number) (confirmed * 100),total ).doubleValue());
}else{

25
src/main/java/com/biutag/supervision/mapper/NegativeMapper.java

@ -67,11 +67,15 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"COALESCE(SUM(IF(problemSourcesCode IN (27,28,29,30), 1, 0)), 0) AS auditPro, " +
"COALESCE(SUM(IF(problemSourcesCode IN (2), 1, 0)), 0) AS talkPro " +
"FROM negative ng " +
"WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime}; ")
"WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} ")
GlobalOverViewVo getAllGlobalCount(Date beginTime, Date endTime);
@Select("SELECT problemSources as name ,COUNT(DISTINCT id) as value " +
"from negative WHERE problemSourcesCode IN (27,28,29,30) " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY problemSources " +
"ORDER BY value desc ")
List<EchartsVo> getBarEchartsVoData(Date beginTime, Date endTime);
// 地图卡片
@ -198,6 +202,21 @@ public interface NegativeMapper extends BaseMapper<Negative> {
SupervisionNotifyOverView getAllSupervisionNotifyCount(Date beginTime, Date endTime);
@Select("SELECT " +
" sd.short_name as label, " +
"COUNT(DISTINCT ng.id) AS denominator, " +
"COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS processingNumber, " +
"COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS numerator, " +
"IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS value " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " +
"WHERE problemSourcesCode IN (27,28,29,30) " +
"AND sd.statistics_group_id=#{groupId} " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
" GROUP BY sd.short_name " +
" ORDER BY denominator desc ")
List<AuditNegativeVo> getAuditNegativeVo(Date beginTime, Date endTime,String groupId);
@Select("SELECT " +
"sd.short_name AS `name`, " +
"sd.id AS departId, " +

20
src/main/java/com/biutag/supervision/pojo/vo/AuditNegativeVo.java

@ -0,0 +1,20 @@
package com.biutag.supervision.pojo.vo;
import lombok.Data;
@Data
public class AuditNegativeVo {
//部门名称
private String label;
//整改率
private Long value;
//未整改问题数
private Long processingNumber;
//已整改问题数
private Long numerator;
//查处问题数
private Long denominator;
}
Loading…
Cancel
Save