Commit 03708105 authored by suhuiguang's avatar suhuiguang

1.大屏概览接口mockdata

parent ca4cd513
package com.yeejoin.amos.boot.module.jg.api.dto;
import lombok.Data;
import java.util.List;
/**
* 四色数字统计
* @author Administrator
*/
@Data
public class FourColorCountDataDto {
private String label;
private String img;
private String key;
private List<FourColorCountDataDto> children;
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.jg.api.dto.FourColorCountDataDto;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.DPStatisticsServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -81,4 +82,37 @@ public class DPStatisticsController {
}
return ResponseHelper.buildResponse(statisticsService.useRegisterCount(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏总览-左侧-安全指数", notes = "大屏总览-一码知风险-安全指数")
@PostMapping(value = "/zl/left/safetyIndex")
public ResponseModel<Map<String, Object>> querySafetyIndex(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.querySafetyIndex(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏总览-左侧-四色管安全", notes = "大屏总览-左侧-四色管安全")
@PostMapping(value = "/zl/left/fourColorManager")
public ResponseModel<List<FourColorCountDataDto>> fourColorManagerSafety(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.queryFourColorManagerSafetyData(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏总览-右侧-业务全过程", notes = "大屏总览-右侧-业务全过程")
@PostMapping(value = "/zl/right/bizCycle")
public ResponseModel<Map<String, Object>> queryBizCycleData(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.queryBizCycleData(dpFilterParamDto));
}
}
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.dto.LegendDataDto;
import com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto;
import com.yeejoin.amos.boot.module.jg.api.dto.FourColorCountDataDto;
import com.yeejoin.amos.boot.module.jg.api.enums.DPMapStatisticsItemEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableMapper;
......@@ -439,4 +441,94 @@ public class DPStatisticsServiceImpl {
});
}
}
public Map<String, Object> querySafetyIndex(DPFilterParamDto dpFilterParamDto) {
Map<String, Object> result = new HashMap<>();
result.put("riskScore", 89.2);
return result;
}
public List<FourColorCountDataDto> queryFourColorManagerSafetyData(DPFilterParamDto dpFilterParamDto) {
String mockData = "[{\n" +
"\t\t\"label\": \"设备\",\n" +
"\t\t\"img\": \"/upload/tzs/dqscreen/images/设备.png\",\n" +
"\t\t\"children\": [{\n" +
"\t\t\t\t\"label\": \"正常在用\",\n" +
"\t\t\t\t\"value\": 112372,\n" +
"\t\t\t\t\"img\": \"/upload/tzs/dqscreen/images/qrcodeFour.png\"\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"label\": \"超期末检\",\n" +
"\t\t\t\t\"value\": 72,\n" +
"\t\t\t\t\"img\": \"/upload/tzs/dqscreen/images/qrcodeThree.png\"\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"label\": \"临期告警\",\n" +
"\t\t\t\t\"value\": 72,\n" +
"\t\t\t\t\"img\": \"/upload/tzs/dqscreen/images/qrcodeTwo.png\"\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"label\": \"未注册、停用或注销\",\n" +
"\t\t\t\t\"value\": 72,\n" +
"\t\t\t\t\"img\": \"/upload/tzs/dqscreen/images/qrcodeOne.png\"\n" +
"\t\t\t}\n" +
"\t\t]\n" +
"\t},\n" +
"\t{\n" +
"\t\t\"label\": \"企业\",\n" +
"\t\t\"img\": \"/upload/tzs/dqscreen/images/企业.png\",\n" +
"\t\t\"children\": [{\n" +
"\t\t\t\t\"label\": \"正常在业\",\n" +
"\t\t\t\t\"value\": 72,\n" +
"\t\t\t\t\"img\": \"/upload/tzs/dqscreen/images/qrcodeFour.png\"\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"label\": \"超期未检\",\n" +
"\t\t\t\t\"value\": 72,\n" +
"\t\t\t\t\"img\": \"/upload/tzs/dqscreen/images/qrcodeThree.png\"\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"label\": \"临期告警\",\n" +
"\t\t\t\t\"value\": 72,\n" +
"\t\t\t\t\"img\": \"/upload/tzs/dqscreen/images/qrcodeTwo.png\"\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"label\": \"停业\",\n" +
"\t\t\t\t\"value\": 72,\n" +
"\t\t\t\t\"img\": \"/upload/tzs/dqscreen/images/qrcodeOne.png\"\n" +
"\t\t\t}\n" +
"\t\t]\n" +
"\t},\n" +
"\t{\n" +
"\t\t\"label\": \"人员\",\n" +
"\t\t\"img\": \"/upload/tzs/dqscreen/images/人员.png\",\n" +
"\t\t\"children\": [{\n" +
"\t\t\t\t\"label\": \"许可正常\",\n" +
"\t\t\t\t\"value\": 72,\n" +
"\t\t\t\t\"img\": \"/upload/tzs/dqscreen/images/qrcodeFour.png\"\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"label\": \"许可超期\",\n" +
"\t\t\t\t\"value\": 72,\n" +
"\t\t\t\t\"img\": \"/upload/tzs/dqscreen/images/qrcodeThree.png\"\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"label\": \"许可临期\",\n" +
"\t\t\t\t\"value\": 72,\n" +
"\t\t\t\t\"img\": \"/upload/tzs/dqscreen/images/qrcodeTwo.png\"\n" +
"\t\t\t}\n" +
"\t\t]\n" +
"\t}\n" +
"]";
return JSONArray.parseArray(mockData, FourColorCountDataDto.class);
}
public Map<String, Object> queryBizCycleData(DPFilterParamDto dpFilterParamDto) {
Map<String, Object> result = new HashMap<>();
result.put("xdata", Arrays.asList("安装告知", "监督检验", "使用登记", "定期检验", "变更登录", "注销报废"));
result.put("ydata", Arrays.asList(35, 13, 19, 18, 87, 71));
result.put("allCount", 1021);
result.put("completionRate", 90.2);
return result;
}
}
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