|
@@ -1,19 +1,25 @@
|
|
|
package com.zfjg.manage.controller.statistics;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.zfjg.common.core.domain.R;
|
|
|
import com.zfjg.manage.api.dto.statistics.CommonQueryDto;
|
|
|
+import com.zfjg.manage.api.dto.statistics.EnforceAverageTimeDto;
|
|
|
+import com.zfjg.manage.api.dto.statistics.EnforceTimeoutDto;
|
|
|
+import com.zfjg.manage.api.dto.statistics.EnforcementProcess;
|
|
|
+import com.zfjg.manage.api.dto.statistics.vo.EnforceTimeoutVo;
|
|
|
import com.zfjg.manage.api.vo.DeptVo;
|
|
|
+import com.zfjg.manage.mapper.StatisticsMapper;
|
|
|
import com.zfjg.manage.service.statistics.StatisticsService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import java.util.List;
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.sql.Array;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Author: Mr.Yang
|
|
@@ -26,6 +32,8 @@ import java.util.List;
|
|
|
@Slf4j
|
|
|
public class StatisticsController {
|
|
|
|
|
|
+ @Resource
|
|
|
+ private StatisticsMapper statisticsMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private StatisticsService statisticsServiceImpl;
|
|
@@ -46,6 +54,7 @@ public class StatisticsController {
|
|
|
|
|
|
/**
|
|
|
* 监督抽查(专项、日常)
|
|
|
+ *
|
|
|
* @param commonQueryDto
|
|
|
* @return
|
|
|
*/
|
|
@@ -57,10 +66,9 @@ public class StatisticsController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 限改通知(份)
|
|
|
+ *
|
|
|
* @param commonQueryDto
|
|
|
* @return
|
|
|
*/
|
|
@@ -73,6 +81,7 @@ public class StatisticsController {
|
|
|
|
|
|
/**
|
|
|
* 执法人员
|
|
|
+ *
|
|
|
* @param commonQueryDto
|
|
|
* @return
|
|
|
*/
|
|
@@ -82,4 +91,68 @@ public class StatisticsController {
|
|
|
int count = statisticsServiceImpl.zfry(commonQueryDto);
|
|
|
return R.ok(count);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取执法记录全过程")
|
|
|
+ @GetMapping("/enforcement/process")
|
|
|
+ public R<List<EnforcementProcess>> selectEnforcementProcess() {
|
|
|
+ List<EnforcementProcess> enforcementProcess = statisticsMapper.selectEnforcementProcess();
|
|
|
+ return R.ok(enforcementProcess);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "检查超期")
|
|
|
+ @GetMapping("/enforcement/timeout")
|
|
|
+ public R<EnforceTimeoutVo> selectEnforceTimeout() {
|
|
|
+// //todo: enforceTimeouts本地没有数据,所以注释它,增加演示数据给前端测试
|
|
|
+// List<EnforceTimeoutDto> enforceTimeouts = statisticsMapper.selectEnforceTimeout();
|
|
|
+
|
|
|
+ List<EnforceTimeoutDto> enforceTimeouts = new ArrayList<>();
|
|
|
+ EnforceTimeoutDto dto1 = new EnforceTimeoutDto();
|
|
|
+ dto1.setOrgName("重庆市荣昌区消防救援支队");
|
|
|
+ dto1.setTaskCategory("举报");
|
|
|
+ dto1.setTaskCount(2);
|
|
|
+
|
|
|
+ EnforceTimeoutDto dto2 = new EnforceTimeoutDto();
|
|
|
+ dto2.setOrgName("重庆市长寿区消防救援支队");
|
|
|
+ dto2.setTaskCategory("复查");
|
|
|
+ dto2.setTaskCount(3);
|
|
|
+
|
|
|
+ enforceTimeouts.add(dto1);
|
|
|
+ enforceTimeouts.add(dto2);
|
|
|
+
|
|
|
+
|
|
|
+ EnforceTimeoutVo enforceTimeoutVo = new EnforceTimeoutVo();
|
|
|
+ Set<HashMap<String, String>> collected = enforceTimeouts.stream().map(it -> {
|
|
|
+ HashMap<String, String> hashMap = new HashMap<>();
|
|
|
+ hashMap.put("filed", it.getTaskCategory());
|
|
|
+ hashMap.put("name", it.getTaskCategory());
|
|
|
+ return hashMap;
|
|
|
+ }).collect(Collectors.toSet());
|
|
|
+ ArrayList<HashMap<String, String>> arrayList = new ArrayList<>(collected);
|
|
|
+
|
|
|
+ HashMap<String, String> hashMap = new HashMap<>();
|
|
|
+ hashMap.put("filed", "orgName");
|
|
|
+ hashMap.put("name", "支大队");
|
|
|
+ arrayList.add(0, hashMap);
|
|
|
+
|
|
|
+ enforceTimeoutVo.setTableHead(arrayList);
|
|
|
+ enforceTimeoutVo.setTableData((ets) -> {
|
|
|
+ List<HashMap<String, String>> result = new ArrayList<>();
|
|
|
+ for (EnforceTimeoutDto et : ets) {
|
|
|
+ HashMap<String, String> etMap = new HashMap<>();
|
|
|
+ etMap.put("orgName", et.getOrgName());
|
|
|
+ etMap.put(et.getTaskCategory(), et.getTaskCount().toString());
|
|
|
+ result.add(etMap);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }, enforceTimeouts);
|
|
|
+
|
|
|
+ return R.ok(enforceTimeoutVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "检查时长")
|
|
|
+ @GetMapping("/enforcement/average-time")
|
|
|
+ public R<List<EnforceAverageTimeDto>> selectEnforceAverageTime() {
|
|
|
+ List<EnforceAverageTimeDto> enforceAverageTimes = statisticsMapper.selectEnforceAverageTime();
|
|
|
+ return R.ok(enforceAverageTimes);
|
|
|
+ }
|
|
|
}
|