Commit 0327b460 authored by suhuiguang's avatar suhuiguang

1.大屏-区域安全指数接口优重写初稿

parent 197716b4
package com.yeejoin.amos.boot.module.statistics.api.dto;
import lombok.Data;
/**
* @author Administrator
*/
@Data
public class SecurityIndexCountItemDto {
private String regionCode;
private String regionName;
/**
* 充装检查率
*/
private String czjc;
/**
* 许可有效率
*/
String xuke;
/**
* 使用登记办理率
*/
String shiyongdengji;
/**
* 检验超期率
*/
String jianyanchaoqi;
/**
* 检验合格率
*/
String jianyanhege;
/**
* 充装检查率
*/
String czjchege;
}
...@@ -46,10 +46,10 @@ public interface AQZSDPStatisticsMapper { ...@@ -46,10 +46,10 @@ public interface AQZSDPStatisticsMapper {
/** /**
* 单位按照资质状态分组下的统计数量 * 单位按照资质状态分组下的统计数量
* *
* @param regionCode 区域 * @param orgCode 区域
* @return List<KeyValueDto> * @return List<KeyValueDto>
*/ */
List<KeyValueDto> queryLicenseEfficiencyOfRegion(@Param(value = "regionCode") String regionCode); List<KeyValueDto> queryLicenseEfficiencyOfRegion(@Param(value = "orgCode") String orgCode);
/** /**
* 查询单个单位的有效期信息 * 查询单个单位的有效期信息
* *
...@@ -58,8 +58,8 @@ public interface AQZSDPStatisticsMapper { ...@@ -58,8 +58,8 @@ public interface AQZSDPStatisticsMapper {
*/ */
KeyValueDto queryLicenseEfficiencyOneCompany(@Param(value = "appId") String appId); KeyValueDto queryLicenseEfficiencyOneCompany(@Param(value = "appId") String appId);
Map<String, Object> getInspectionExpiredRate(@Param(value = "regionCode") String regionCode, @Param(value = "appId") String appId); Map<String, Object> getInspectionExpiredRate(@Param(value = "orgCode") String orgCode, @Param(value = "appId") String appId);
Map<String, Object> getInspectionResultRate(@Param(value = "regionCode") String regionCode, @Param(value = "appId") String appId); Map<String, Object> getInspectionResultRate(@Param(value = "orgCode") String orgCode, @Param(value = "appId") String appId);
} }
...@@ -246,8 +246,8 @@ ...@@ -246,8 +246,8 @@
<where> <where>
cu.data_sources = '陕西省内企业' cu.data_sources = '陕西省内企业'
AND cu.unit_type LIKE '%充装单位%' AND cu.unit_type LIKE '%充装单位%'
<if test="regionCode != null and regionCode != ''"> <if test="orgCode != null and orgCode != ''">
and cu.org_code like concat(#{regionCode}, '%') and cu.supervise_org_code like concat(#{orgCode}, '%')
</if> </if>
<if test="appId != null and appId != ''"> <if test="appId != null and appId != ''">
and cu.app_id = #{appId} and cu.app_id = #{appId}
...@@ -264,8 +264,8 @@ ...@@ -264,8 +264,8 @@
<where> <where>
cu.data_sources = '陕西省内企业' cu.data_sources = '陕西省内企业'
AND cu.unit_type LIKE '%充装单位%' AND cu.unit_type LIKE '%充装单位%'
<if test="regionCode != null and regionCode != ''"> <if test="orgCode != null and orgCode != ''">
and cu.org_code like concat( #{regionCode}, '%') and cu.supervise_org_code like concat( #{orgCode}, '%')
</if> </if>
<if test="appId != null and appId != ''"> <if test="appId != null and appId != ''">
and cu.app_id = #{appId} and cu.app_id = #{appId}
...@@ -303,7 +303,7 @@ ...@@ -303,7 +303,7 @@
where where
cu.data_sources = '陕西省内企业' cu.data_sources = '陕西省内企业'
AND cu.unit_type LIKE '%充装单位%' AND cu.unit_type LIKE '%充装单位%'
and cu.org_code like concat('%', #{regionCode}, '%') and cu.supervise_org_code like concat(#{orgCode}, '%')
GROUP BY strKey GROUP BY strKey
</select> </select>
</mapper> </mapper>
......
...@@ -20,7 +20,7 @@ import java.util.List; ...@@ -20,7 +20,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
@RestController @RestController
@Api(tags = "大屏-安全追溯统计Api") @Api(tags = "大屏-安全追溯及气瓶统计Api")
@RequestMapping(value = "/dp/aqzs") @RequestMapping(value = "/dp/aqzs")
public class AQZSDPStatisticsController { public class AQZSDPStatisticsController {
...@@ -33,20 +33,19 @@ public class AQZSDPStatisticsController { ...@@ -33,20 +33,19 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-气瓶-区域安全指数") @ApiOperation(value = "大屏-气瓶-区域安全指数")
@PostMapping(value = "/security-index") @PostMapping(value = "/security-index")
public ResponseModel<Map<String, Object>> getSecurityIndex(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<Map<String, Object>> getSecurityIndex(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult bindingResult) throws Exception {
Object regionCode = map.get("cityCode"); List<FieldError> fieldErrors = bindingResult.getFieldErrors();
if (ObjectUtils.isEmpty(regionCode)) { if (!fieldErrors.isEmpty()) {
regionCode = "610000"; throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
} }
Map<String, Object> result = statisticsService.getSecurityIndex(dpFilterParamDto);
Map<String, Object> result = statisticsService.getSecurityIndex(regionCode.toString());
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/earlyWarning/child", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "大屏-气瓶-区域安全指数统计") @ApiOperation(httpMethod = "POST", value = "大屏-气瓶-区域安全指数统计")
@RequestMapping(value = "/earlyWarning/child", method = RequestMethod.POST)
public ResponseModel<Map<String, Object>> getChildEarlyWarning(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<Map<String, Object>> getChildEarlyWarning(@RequestBody Map<String, Object> map) throws Exception {
Object regionCode = map.get("cityCode"); Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) { if (ObjectUtils.isEmpty(regionCode)) {
......
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