Commit 6a13d3df authored by suhuiguang's avatar suhuiguang

1.大屏地图图列统计接口开发空指针处理

parent ee6cead1
......@@ -51,7 +51,7 @@ public class DPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏总览中间-地图左右两侧8大类、单位、人员数量全局统计", notes = "大屏总览中间-地图左右两侧8大类、单位、人员数量全局统计")
@PostMapping(value = "/zl/center-map/global/count")
@PostMapping(value = "/zl/center-map/legend")
public ResponseModel<Map<String, Object>> centerMapCountForGlobal(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
......@@ -61,6 +61,17 @@ public class DPStatisticsController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏总览中间-地图地市统计", notes = "大屏总览中间-地图地市统计")
@PostMapping(value = "/zl/center-map/overview")
public ResponseModel<List<Map<String, Object>>> centerMapCountForOverview(@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.getCenterMapCountDataForOverview(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏八大类左侧-使用登记统计", notes = "大屏八大类左侧-使用登记统计")
@PostMapping(value = "/useRegisterCount")
public ResponseModel<Map<String, Object>> useRegisterCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
......
......@@ -5,9 +5,11 @@ import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.service.IEquipUsedCheck;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.component.robot.AmosRequestContext;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.List;
......@@ -48,6 +50,10 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
private List<IEquipUsedCheck> equipUsedCheckList;
private DPStatisticsServiceImpl statisticsService;
private AmosRequestContext amosRequestContext;
public ApplicationRunnerImpl(JgUseRegistrationServiceImpl useRegistrationService,
CommonServiceImpl commonService,
JgInstallationNoticeServiceImpl installationNoticeService,
......@@ -63,7 +69,7 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
JgScrapCancelServiceImpl scrapCancelService,
JgChangeRegistrationNameServiceImpl changeRegistrationNameService,
ReportAnalysisServiceImpl reportAnalysisService,
List<IEquipUsedCheck> equipUsedCheckList) {
List<IEquipUsedCheck> equipUsedCheckList, DPStatisticsServiceImpl statisticsService, AmosRequestContext amosRequestContext) {
this.commonService = commonService;
this.useRegistrationService = useRegistrationService;
......@@ -95,6 +101,8 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
this.reportAnalysisService = reportAnalysisService;
this.equipUsedCheckList = equipUsedCheckList;
this.statisticsService = statisticsService;
this.amosRequestContext = amosRequestContext;
}
......@@ -184,5 +192,11 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
// 流程中的设备统计数据预热
equipUsedCheckList.forEach(IEquipUsedCheck::init);
// 初始化数据到内存
RequestContext.setAppKey(amosRequestContext.getAppKey());
RequestContext.setProduct(amosRequestContext.getProduct());
RequestContext.setToken(amosRequestContext.getToken());
statisticsService.init();
}
}
......@@ -12,5 +12,5 @@ import java.util.Set;
public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
Page<TzsUserInfoDto> selectPageMessage(@Param("page") Page<TzsUserInfoDto> page, @Param("dto") TzsUserInfoDto dto);
Long countUserByPostAndAreaCode(@Param("areaCode") String areaCode, @Param("post") String post);
Long countUserByPostAndAreaCode(@Param("orgCode") String orgCode, @Param("post") String post);
}
......@@ -27,7 +27,7 @@
</select>
<select id="sumPipeLengthByArea" resultType="java.lang.String">
select
round(sum(p."PIPE_LENGTH"), 2) as PIPE_LENGTH
COALESCE(round(sum(p."PIPE_LENGTH"), 2),0) as PIPE_LENGTH
from
idx_biz_jg_tech_params_pipeline p,
(
......@@ -45,6 +45,6 @@
and ui.IS_INTO_MANAGEMENT =true
) a
where
p."RECORD" = a."RECORD" and c.areaCode like concat('%',#{cityCode}, '%')
p."RECORD" = a."RECORD" and a.areaCode like concat('%',#{cityCode}, '%')
</select>
</mapper>
......@@ -57,7 +57,7 @@
WHERE
tui.unit_code = bi.use_code
and tui.post LIKE concat ( '%', #{post}, '%' )
and bi.supervise_org_code LIKE CONCAT ( #{areaCode}}, '%' )
and bi.supervise_org_code LIKE CONCAT ( #{orgCode}, '%' )
and tui.is_delete=false
</select>
</mapper>
\ No newline at end of file
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