feat: 增加过鱼设施建设及接入情况统计
This commit is contained in:
parent
6a56b0ef1d
commit
7999f88e33
@ -2,6 +2,7 @@ package com.yfd.platform.env.fp.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.env.fp.service.FpBuildService;
|
||||
import com.yfd.platform.env.fp.service.FpRunService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -13,17 +14,27 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/fp/run")
|
||||
@RequestMapping("/fp")
|
||||
@Tag(name = "过鱼设施建设及运行情况")
|
||||
@Validated
|
||||
public class FpRunController {
|
||||
public class FishPassageController {
|
||||
|
||||
@Resource
|
||||
private FpRunService fpRunService;
|
||||
|
||||
@PostMapping("/secondPlan/qgc/GetKendoListCust")
|
||||
|
||||
@Resource
|
||||
private FpBuildService fpBuildService;
|
||||
|
||||
@PostMapping("/run/secondPlan/qgc/GetKendoListCust")
|
||||
@Operation(summary = "环保部-建设及运行运行情况(二级级页面 已建设施运行情况-计划接口)")
|
||||
public ResponseResult getQgcSecondPlanKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fpRunService.processQgcSecondPlanKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/build/GetKendoListCust")
|
||||
@Operation(summary = "过鱼设施建设及接入情况统计")
|
||||
public ResponseResult getKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fpBuildService.processKendoList(dataSourceRequest));
|
||||
}
|
||||
}
|
||||
30
backend/src/main/java/com/yfd/platform/env/fp/entity/vo/FpConstructionSituationVo.java
vendored
Normal file
30
backend/src/main/java/com/yfd/platform/env/fp/entity/vo/FpConstructionSituationVo.java
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
package com.yfd.platform.env.fp.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "过鱼设施建设及接入情况")
|
||||
public class FpConstructionSituationVo {
|
||||
|
||||
@Schema(description = "过鱼设施类型")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "已接入")
|
||||
private Integer bonusing;
|
||||
|
||||
@Schema(description = "已建")
|
||||
private Integer built;
|
||||
|
||||
@Schema(description = "已建已接入")
|
||||
private Integer builtConnected;
|
||||
|
||||
@Schema(description = "在建")
|
||||
private Integer building;
|
||||
|
||||
@Schema(description = "在建已接入")
|
||||
private Integer buildingConnected;
|
||||
|
||||
@Schema(description = "规划")
|
||||
private Integer noBuilt;
|
||||
}
|
||||
10
backend/src/main/java/com/yfd/platform/env/fp/service/FpBuildService.java
vendored
Normal file
10
backend/src/main/java/com/yfd/platform/env/fp/service/FpBuildService.java
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
package com.yfd.platform.env.fp.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.env.fp.entity.vo.FpConstructionSituationVo;
|
||||
|
||||
public interface FpBuildService {
|
||||
|
||||
DataSourceResult<FpConstructionSituationVo> processKendoList(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
54
backend/src/main/java/com/yfd/platform/env/fp/service/impl/FpBuildServiceImpl.java
vendored
Normal file
54
backend/src/main/java/com/yfd/platform/env/fp/service/impl/FpBuildServiceImpl.java
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
package com.yfd.platform.env.fp.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||
import com.yfd.platform.common.PageInfo;
|
||||
import com.yfd.platform.env.fp.entity.vo.FpConstructionSituationVo;
|
||||
import com.yfd.platform.env.fp.service.FpBuildService;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class FpBuildServiceImpl implements FpBuildService {
|
||||
|
||||
@Resource
|
||||
private MicroservicDynamicSQLMapper microservicDynamicSQLMapper;
|
||||
|
||||
@Override
|
||||
public DataSourceResult<FpConstructionSituationVo> processKendoList(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
PageInfo pageInfo = QgcQueryWrapperUtil.getPageInfo(loadOptions);
|
||||
Page<?> page = pageInfo.getHasPageInfo() ? pageInfo.getPage() : null;
|
||||
|
||||
String sql = "SELECT t.STTP AS sttpCode, " +
|
||||
" SUM(CASE WHEN t.DTIN = 1 THEN 1 ELSE 0 END) AS bonusing, " +
|
||||
" SUM(CASE WHEN t.DTIN = 1 AND t.BLDSTT_CODE = 2 THEN 1 ELSE 0 END) AS builtConnected, " +
|
||||
" SUM(CASE WHEN t.BLDSTT_CODE = 2 THEN 1 ELSE 0 END) AS built, " +
|
||||
" SUM(CASE WHEN t.DTIN = 1 AND t.BLDSTT_CODE = 1 THEN 1 ELSE 0 END) AS buildingConnected, " +
|
||||
" SUM(CASE WHEN t.BLDSTT_CODE = 1 THEN 1 ELSE 0 END) AS building, " +
|
||||
" SUM(CASE WHEN NVL(t.BLDSTT_CODE, 0) = 0 THEN 1 ELSE 0 END) AS noBuilt " +
|
||||
"FROM SD_FPSS_B_H t " +
|
||||
"GROUP BY t.STTP " +
|
||||
"ORDER BY t.STTP";
|
||||
|
||||
List<FpConstructionSituationVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(
|
||||
page,
|
||||
sql,
|
||||
new HashMap<>(),
|
||||
FpConstructionSituationVo.class
|
||||
);
|
||||
|
||||
DataSourceResult<FpConstructionSituationVo> result = new DataSourceResult<>();
|
||||
result.setData(list);
|
||||
result.setTotal(page != null ? page.getTotal() : list.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user