Commit 06061da2 authored by suhuiguang's avatar suhuiguang

1.报错代码处理

parent c4000bf9
......@@ -57,7 +57,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-左屏-问题类型主体统计")
@PostMapping(value = "/mainBodyCount")
public ResponseModel<Map<String, Object>> mainBodyCount(@RequestBody Map<String, Object> map) throws Exception {
public ResponseModel<Map<String, Object>> mainBodyCount(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
......@@ -70,7 +70,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-左屏-设备问题近30天统计")
@PostMapping(value = "/equipmentCount")
public ResponseModel<Map<String, Object>> equipmentCount(@RequestBody Map<String, Object> map) throws Exception {
public ResponseModel<Map<String, Object>> equipmentCount(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
......@@ -83,7 +83,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-左屏-企业问题近30天统计")
@PostMapping(value = "/companyCount")
public ResponseModel<List<Map<String, Object>>> companyCount(@RequestBody Map<String, Object> map) throws Exception {
public ResponseModel<List<Map<String, Object>>> companyCount(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
......@@ -96,7 +96,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-左屏-人员问题近30天统计")
@PostMapping(value = "/personCount")
public ResponseModel<Map<String, Object>> personCount(@RequestBody Map<String, Object> map) throws Exception {
public ResponseModel<Map<String, Object>> personCount(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
......@@ -110,7 +110,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-左屏-气瓶问题近30天统计")
@PostMapping(value = "/cylinderCount")
public ResponseModel<Map<String, Object>> cylinderCount(@RequestBody Map<String, Object> map) throws Exception {
public ResponseModel<Map<String, Object>> cylinderCount(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
......@@ -123,7 +123,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-右屏-按月统计近12个月的问题数量趋势")
@PostMapping(value = "/issueCountByMonth")
public ResponseModel<Map<String, Object>> issueCountByMonth(@RequestBody Map<String, Object> map) throws Exception {
public ResponseModel<Map<String, Object>> issueCountByMonth(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
......@@ -136,7 +136,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-右屏-按月统计近30天的问题数量趋势")
@PostMapping(value = "/issueCountByDay")
public ResponseModel<Map<String, Object>> issueCountByDay(@RequestBody Map<String, Object> map) throws Exception {
public ResponseModel<Map<String, Object>> issueCountByDay(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
......@@ -148,7 +148,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-中屏-当前区域数据统计")
@PostMapping(value = "/issueCountByCityCode")
public ResponseModel<Map<String, Object>> issueCountByCityCode(@RequestBody Map<String, Object> map) throws Exception {
public ResponseModel<Map<String, Object>> issueCountByCityCode(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
......@@ -174,7 +174,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-左屏-当月问题列表(主体类型、问题类型、问题时间、操作)")
@PostMapping(value = "/issueMonthList")
public ResponseModel<List<Map<String, Object>>> issueMonthList(@RequestBody Map<String, Object> map) throws Exception {
public ResponseModel<List<Map<String, Object>>> issueMonthList(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
......@@ -186,7 +186,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-右屏-当年问题等级分类统计")
@PostMapping(value = "/issueProblemLevelCount")
public ResponseModel<Map<String, Object>> issueProblemLevelCount(@RequestBody Map<String, Object> map) throws Exception {
public ResponseModel<Map<String, Object>> issueProblemLevelCount(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
......@@ -198,7 +198,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-右屏-按问题类型排名top 10")
@PostMapping(value = "/issueCompanyTop")
public ResponseModel<List<Map<String, Object>>> issueCompanyTop(@RequestBody Map<String, Object> map) throws Exception {
public ResponseModel<List<Map<String, Object>>> issueCompanyTop(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
......@@ -233,7 +233,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-右屏-按问题类型排名top 10")
@PostMapping(value = "/issueCountTopByProblemType")
public ResponseModel<List<Map<String, Object>>> issueCountTopByProblemType(@RequestBody Map<String, Object> map) throws Exception {
public ResponseModel<List<Map<String, Object>>> issueCountTopByProblemType(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
......
......@@ -45,7 +45,6 @@ import java.text.NumberFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
......@@ -99,8 +98,6 @@ public class AQZSDPStatisticsServiceImpl {
private static List<RegionModel> regionModels = new ArrayList<>();
private static Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>();
private RestHighLevelClient restHighLevelClient;
......@@ -1009,11 +1006,10 @@ public class AQZSDPStatisticsServiceImpl {
}
private void setCompanyDataBatch(List<Map<String, Object>> result) {
List<CountDto> countDtos = enterpriseInfoMapper.countByUnitTypeAndOrgCodeNoParam();
result.forEach(m -> {
String cityCode = m.get("regionCode").toString();
String orgCode = regionCodeOrgCodeMap.get(cityCode);
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
if (orgCode != null) {
m.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_USE) && c.getLabel().contains(orgCode)).mapToInt(CountDto::getIntValue).sum());
m.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MAINTENANCE) && c.getLabel().contains(orgCode)).mapToInt(CountDto::getIntValue).sum());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment