Browse Source

fix:1、大屏优化工作

master
pengwei 6 months ago
parent
commit
9696a663c6
  1. 51
      src/main/java/com/biutag/supervision/controller/datav/DataVJwpyController.java
  2. 10
      src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java
  3. 15
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  4. 19
      src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java
  5. 18
      src/main/java/com/biutag/supervision/pojo/vo/DistributionVo.java
  6. 18
      src/main/java/com/biutag/supervision/service/DataVJwpyService.java

51
src/main/java/com/biutag/supervision/controller/datav/DataVJwpyController.java

@ -0,0 +1,51 @@
package com.biutag.supervision.controller.datav;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.SupDictData;
import com.biutag.supervision.pojo.vo.DistributionVo;
import com.biutag.supervision.service.DataVJwpyService;
import com.biutag.supervision.service.SupDictDataService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.List;
import java.util.Optional;
@RestController
@RequiredArgsConstructor
@RequestMapping("datav/Jwpy")
public class DataVJwpyController {
private final NegativeMapper negativeMapper;
private final SupDictDataService supDictDataService;
@GetMapping
public Result<JSONObject> selectDistribution(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){
List<DistributionVo> list = negativeMapper.getDistributionByTime(beginTime,endTime);
List<SupDictData> supDictDataList = supDictDataService.list( new LambdaQueryWrapper<SupDictData>().eq(SupDictData::getDictType,"businessType"));
list.forEach(s->{
Optional<SupDictData> supDictData = supDictDataList.stream().filter(v->v.getDictValue().equals(s.getName())).findFirst();
supDictData.ifPresent(dictData -> s.setName(dictData.getDictLabel()));
});
JSONObject jsonObject =new JSONObject()
.fluentPut("name",list.stream().map(DistributionVo::getName).toList())
.fluentPut("checkStatus",list.stream().map(DistributionVo::getCheckStatusNum).toList())
.fluentPut("total",list.stream().map(DistributionVo::getTotalNum).toList())
.fluentPut("processing",list.stream().map(DistributionVo::getProcessingNum).toList());
return Result.success(jsonObject);
}
}

10
src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java

@ -239,13 +239,19 @@ public class DataVRightsComfortController {
// 发案环节
List<EchartsVo> incidentLinkList =rpcApplyMapper.getIncidentLink(beginTime, endTime);
// 发案警种
List<EchartsVo> incidentPoliceTypeList = new ArrayList<>();
List<EchartsVo> incidentPoliceList = rpcApplyMapper.getIncidentPolice(beginTime, endTime);
List<SupDictData> supDictDataList = supDictDataService.list( new LambdaQueryWrapper<SupDictData>().eq(SupDictData::getDictType,"personType"));
incidentPoliceList.forEach(s->{
Optional<SupDictData> supDictData = supDictDataList.stream().filter(v->v.getDictValue().equals(s.getName())).findFirst();
supDictData.ifPresent(dictData -> s.setName(dictData.getDictLabel()));
});
// 发案单位
List<EchartsVo> incidentOrgList = rpcApplyMapper.getIncidentOrg(beginTime, endTime);
JSONObject data = new JSONObject()
.fluentPut("incidentLinkList", incidentLinkList)
.fluentPut("incidentPoliceTypeList", incidentPoliceTypeList)
.fluentPut("incidentPoliceTypeList", incidentPoliceList)
.fluentPut("incidentOrgList", incidentOrgList);
return Result.success(data);
}

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

@ -83,6 +83,21 @@ public interface NegativeMapper extends BaseMapper<Negative> {
List<EchartsVo> getGlobalRecentlyTrendByMonth(String year);
@Select(" SELECT " +
" businessTypeCode as name, " +
" SUM(CASE WHEN checkStatus IN (1, 2) THEN 1 ELSE 0 END) AS checkStatusNum, " +
" SUM(CASE WHEN processing_status = 'completed' THEN 1 ELSE 0 END) AS processingNum, " +
" COUNT(*) AS totalNum " +
" FROM " +
" negative " +
" WHERE " +
" problemSourcesCode = 2 " +
" and crtTime BETWEEN #{beginTime} and #{endTime}" +
" GROUP BY " +
" businessTypeCode ")
List<DistributionVo> getDistributionByTime(Date beginTime, Date endTime);
/**
* 首页大屏突出问题排名
*

19
src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java

@ -70,6 +70,14 @@ public interface RpcApplyMapper extends BaseMapper<RpcApply> {
"GROUP BY Incident_link_name ")
List<EchartsVo> getIncidentLink(Date beginTime, Date endTime);
@Select("SELECT person_type as name,COUNT(*) from rpc_apply a " +
"LEFT JOIN (SELECT emp_no,person_type from sup_police WHERE del = 0) as b " +
"ON a.input_emp_no = b.emp_no " +
"WHERE a.crt_time BETWEEN #{beginTime} and #{endTime}" +
" GROUP BY person_type HAVING name is NOT NULL")
List<EchartsVo> getIncidentPolice(Date beginTime, Date endTime);
@Select("SELECT " +
"sd1.short_name AS `name`, " +
"count(*) AS `value` " +
@ -185,12 +193,13 @@ public interface RpcApplyMapper extends BaseMapper<RpcApply> {
* 按事发时间进行筛选
* 维权案件情况
* */
@Select(" SELECT ra.handle_depart_name label ,COUNT(*) value from rpc_apply as ra LEFT JOIN sup_depart sdp " +
" on ra.handle_depart_id = sdp.id where sdp.statistics_group_id=#{departGroupId} " +
" and ra.crt_time between #{beginTime} and #{endTime} "+
" and ra.type = 1 " +
" GROUP BY ra.handle_depart_name order by value desc")
@Select(" select sdp.short_name,COUNT(*) from rpc_apply ra " +
" LEFT JOIN sup_depart sdp on ra.second_depart_id = sdp.id " +
" WHERE sdp.statistics_group_id = #{departGroupId} and ra.type =1 " +
" and ra.crt_time BETWEEN #{beginTime} and #{endTime} " +
" GROUP BY sdp.short_name order by value desc ")
List<BarItem> selectProtectRightsBarList(Date beginTime, Date endTime, Integer departGroupId);
//民辅警受伤表
@Select(
"SELECT person_type as name, COUNT(*) as val FROM rpc_apply_person as a " +
" LEFT JOIN (SELECT emp_no,person_type from sup_police WHERE del = 0) as b " +

18
src/main/java/com/biutag/supervision/pojo/vo/DistributionVo.java

@ -0,0 +1,18 @@
package com.biutag.supervision.pojo.vo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class DistributionVo {
//项目类型名
private String name;
//查实数
private String checkStatusNum;
//办结数
private String processingNum;
//总数
private String totalNum;
}

18
src/main/java/com/biutag/supervision/service/DataVJwpyService.java

@ -0,0 +1,18 @@
package com.biutag.supervision.service;
import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.vo.DistributionVo;
import com.biutag.supervision.util.JSON;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class DataVJwpyService {
}
Loading…
Cancel
Save