Commit 61d7824e authored by 麻笑宇's avatar 麻笑宇

监督管理 / 施工单位施工总量排名

下钻代码提交
parent 4f71da2c
......@@ -91,4 +91,8 @@ public interface JGStatisticsMapper {
Page<Map<String, Object>> countBizFinishedNumForDPListZXBF(@Param("page") Page<Map<String, Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto filterParamDto, @Param("treeValue") String treeValue);
Page<Map<String, Object>> countBizFinishedNumForDPListAll(@Param("page") Page<Map<String, Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto filterParamDto, @Param("treeValue") String treeValue);
Long getNoticeCountTopChart(@Param("dpFilterParamForDetailDto") DPFilterParamForDetailDto dpFilterParamForDetailDto);
Page<Map<String, Object>> noticeCountTopPage(@Param("page") Page<Map<String, Object>> page, @Param("dpFilterParamForDetailDto") DPFilterParamForDetailDto dpFilterParamForDetailDto);
}
......@@ -2244,4 +2244,150 @@
GROUP BY tjsc.sequence_nbr
</if>
</select>
<select id="getNoticeCountTopChart" resultType="java.lang.Long">
SELECT SUM
( T.num ) AS COUNT
FROM
(
SELECT COUNT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_installation_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code UNION ALL
SELECT COUNT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_maintain_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code UNION ALL
SELECT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_reform_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code UNION ALL
SELECT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_transfer_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code
) T
</select>
<select id="noticeCountTopPage" resultType="java.util.Map">
SELECT
tbei.use_unit_code AS useUnitCode,
tbei.unit_type AS unitType,
tbei.use_unit AS useUnit,
concat ( tbei.province, tbei.city, tbei.district ) AS region,
tbei.address AS address,
tbei.legal_person AS legalPerson,
tbei.use_unit_certificate AS useUnitCertificate,
tbei.supervise_org_name AS superviseOrgName,
l.expiry_date AS expiryDate,
IFNULL ( u."userCount", '0' ) AS userCount,
IFNULL ( e."equipCount", '0' ) AS equipCount,
IFNULL ( T.num, '0' ) AS installCount
FROM
tz_base_enterprise_info tbei
LEFT JOIN ( SELECT * FROM tz_base_unit_licence GROUP BY unit_code ORDER BY expiry_date DESC ) AS l ON l.unit_code = tbei.use_unit_code
LEFT JOIN (
SELECT
tbei.use_unit_code AS useNnitCode,
COUNT ( 1 ) AS userCount
FROM
tz_base_enterprise_info tbei
INNER JOIN tzs_user_info ui ON tbei.use_unit_code = ui.unit_code
WHERE
tbei.unit_type LIKE'%安装改造维修单位%'
GROUP BY
tbei.use_unit_code
) u ON u."useNnitCode" = tbei.use_unit_code
LEFT JOIN (
SELECT
tbei.use_unit_code AS useNnitCode,
COUNT ( 1 ) AS equipCount
FROM
tz_base_enterprise_info tbei
INNER JOIN idx_biz_jg_use_info jui ON tbei.use_unit_code = jui.USE_UNIT_CREDIT_CODE
LEFT JOIN idx_biz_jg_other_info joi ON joi.RECORD = jui.RECORD
AND joi.SUPERVISORY_CODE IS NOT NULL
AND joi.SUPERVISORY_CODE != ''
AND joi.SUPERVISORY_CODE != 'null'
WHERE
tbei.unit_type LIKE'%安装改造维修单位%'
GROUP BY
tbei.use_unit_code
) e ON e."useNnitCode" = tbei.use_unit_code
LEFT JOIN (
SELECT T
.num AS num,
T.install_unit_credit_code
FROM
(
SELECT COUNT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_installation_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code UNION ALL
SELECT COUNT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_maintain_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code UNION ALL
SELECT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_reform_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code UNION ALL
SELECT
( 1 ) AS num,
T.install_unit_name AS company,
T.install_unit_credit_code
FROM
tzs_jg_transfer_notice T
WHERE
T.receive_company_org_code LIKE CONCAT ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
T.install_unit_credit_code
) T
) T ON T.install_unit_credit_code = tbei.use_unit_code
where tbei.unit_type LIKE'%安装改造维修单位%' and tbei.org_code LIKE CONCAT (#{dpFilterParamForDetailDto.orgCode},'%')
<if test="dpFilterParamForDetailDto.companyName != null and dpFilterParamForDetailDto.companyName != ''">
and tbei.use_unit like concat('%',#{dpFilterParamForDetailDto.companyName},'%')
</if>
</select>
</mapper>
......@@ -343,6 +343,42 @@ public class JGDPStatisticsController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-右屏-施工单位施工总量排名TOP10图表", notes = "监管大屏-右屏-施工单位施工总量排名TOP10图表")
@PostMapping(value = "/noticeCountTopChart")
public ResponseModel<Map<String, Object>> noticeCountTopChart(@Validated @RequestBody DPFilterParamForDetailDto dpFilterParamForDetailDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.noticeCountTopChart(dpFilterParamForDetailDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-右屏-施工单位施工总量排名TOP10类型", notes = "监管大屏-右屏-施工单位施工总量排名TOP10类型")
@PostMapping(value = "/noticeCountTopType")
public ResponseModel<List<Map<String, Object>>> noticeCountTopType(@Validated @RequestBody DPFilterParamForDetailDto dpFilterParamForDetailDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.noticeCountTopType(dpFilterParamForDetailDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-右屏-施工单位施工总量排名TOP10下钻列表", notes = "监管大屏-右屏-施工单位施工总量排名TOP10下钻列表")
@PostMapping(value = "/noticeCountTopPage")
public ResponseModel<Page<Map<String, Object>>> noticeCountTopPage(@Validated @RequestBody DPFilterParamForDetailDto dpFilterParamDto, BindingResult result,
@RequestParam(value = "current", defaultValue = "1") Integer current,
@RequestParam(value = "size", defaultValue = "20") Integer size) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
Page<Map<String, Object>> page = new Page<>(current, size);
return ResponseHelper.buildResponse(statisticsService.noticeCountTopPage(page,dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-右屏-近30天办结率下钻类型", notes = "监管大屏-右屏-近30天办结率下钻类型")
@PostMapping(value = "/getBusinessType")
public ResponseModel<List<Map<String, Object>>> getBusinessType(@Validated @RequestBody DPFilterParamForDetailDto dpFilterParamForDetailDto, BindingResult result) {
......
......@@ -1697,6 +1697,68 @@ public class JGDPStatisticsServiceImpl {
return jgStatisticsMapper.selectNoticeCountTopTen(orgCode, time);
}
public Map<String, Object> noticeCountTopChart(DPFilterParamForDetailDto dpFilterParamForDetailDto) {
List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(dpFilterParamForDetailDto.getCityCode());
List<Map<String,Object>> result = regionModels.parallelStream().map(r -> {
String orgCode = stCommonService.getAndSetOrgCode(r.getRegionCode()+"");
DPFilterParamForDetailDto dpFilterParamForDetailDtoForSearch = new DPFilterParamForDetailDto();
dpFilterParamForDetailDtoForSearch.setOrgCode(orgCode);
dpFilterParamForDetailDtoForSearch.setCityCode(r.getRegionCode()+"");
Map<String, Object> itemResult = new HashMap<>();
itemResult.put("xdata",r.getRegionName());
getNoticeCountTopChart(itemResult,dpFilterParamForDetailDtoForSearch);
return itemResult;
}).collect(Collectors.toList());
Map<String,Object> returnMap = new HashMap<>();
List<Map<String,Object>> legendData = new ArrayList<>();
Map<String,Object> map = new HashMap<>();
map.put("dataKey","count");
map.put("value","施工数量");
map.put("chartType","bar");
legendData.add(map);
returnMap.put("legendData",legendData);
List xdata = new ArrayList();
List count = new ArrayList();
for(int i = 0;i<result.size();i++){
xdata.add(result.get(i).get("xdata"));
count.add(result.get(i).get("count") == null ? "0" : result.get(i).get("count"));
}
returnMap.put("xdata",xdata);
returnMap.put("count",count);
return returnMap;
}
public Page<Map<String, Object>> noticeCountTopPage(Page<Map<String, Object>> page, DPFilterParamForDetailDto dpFilterParamForDetailDto) {
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamForDetailDto.getCityCode());
dpFilterParamForDetailDto.setOrgCode(orgCode);
return jgStatisticsMapper.noticeCountTopPage(page,dpFilterParamForDetailDto);
}
public List<Map<String, Object>> noticeCountTopType(DPFilterParamForDetailDto dpFilterParamForDetailDto) {
List<Map<String, Object>> enumList = new ArrayList<>();
Map<String,Object> enumMap = new HashMap<>();
enumMap.put("title","安装改造维修单位");
enumMap.put("value","安装改造维修单位");
enumList.add(enumMap);
List<Map<String,Object>> result = new ArrayList<>();
Map<String,Object> map = new HashMap<>();
map.put("title","业务类型");
map.put("value","0");
map.put("children",enumList);
result.add(map);
return result;
}
private void getNoticeCountTopChart(Map<String, Object> itemResult, DPFilterParamForDetailDto dpFilterParamForDetailDto) {
Long count = jgStatisticsMapper.getNoticeCountTopChart(dpFilterParamForDetailDto);
itemResult.put("count",count);
}
private List<Long> countBizFinishedNumForDetail(DPFilterParamDto dpFilterParamDto,String businessType) {
// 1.统计各业务办理量注意要和x轴顺序一致
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
......
......@@ -402,8 +402,8 @@ public class JYJCDPStatisticsServiceImpl {
for(int i = 0;i<result.size();i++){
xdata.add(result.get(i).get("xdata"));
inspectionCount.add(result.get(i).get("inspectionCount") == null ? 0 : result.get(i).get("inspectionCount"));
inspectionFinishCount.add(result.get(i).get("inspectionFinishCount") == null ? 0 : result.get(i).get("inspectionFinishCount"));
inspectionCount.add(result.get(i).get("inspectionCount") == null ? "0" : result.get(i).get("inspectionCount"));
inspectionFinishCount.add(result.get(i).get("inspectionFinishCount") == null ? "0" : result.get(i).get("inspectionFinishCount"));
}
returnMap.put("xdata",xdata);
......
......@@ -353,8 +353,8 @@ public class YJDPStatisticsServiceImpl {
for(int i = 0;i<result.size();i++){
xdata.add(result.get(i).get("xdata"));
count.add(result.get(i).get("count") == null ? 0 : result.get(i).get("count"));
avgTime.add(result.get(i).get("avgTime") == null ? 0 : result.get(i).get("avgTime"));
count.add(result.get(i).get("count") == null ? "0" : result.get(i).get("count"));
avgTime.add(result.get(i).get("avgTime") == null ? "0" : result.get(i).get("avgTime"));
}
returnMap.put("xdata",xdata);
......
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