fix: 优化过鱼设施倒数统计优化

This commit is contained in:
tangwei 2026-08-17 09:43:22 +08:00
parent 23e1e80cb4
commit ab4f40ed56
5 changed files with 13 additions and 7 deletions

View File

@ -112,8 +112,9 @@ public class FishDraftDataController {
@PostMapping("/statistics")
@Operation(summary = "过鱼到数统计(按用户月度汇总,支持流域/电站多选过滤)")
public ResponseResult statistics(@RequestBody DataSourceRequest dataSourceRequest) {
Page<FishStatisticsVO> result = fishStatisticsService.queryPage(dataSourceRequest);
public ResponseResult statistics(@RequestBody DataSourceRequest dataSourceRequest,
@RequestHeader(value = "Tenant_id", required = false) String tenantId) {
Page<FishStatisticsVO> result = fishStatisticsService.queryPage(dataSourceRequest, tenantId);
return ResponseResult.successData(result);
}

View File

@ -10,10 +10,12 @@ public interface FishStatisticsMapper {
List<FishStatisticsVO> queryStatistics(@Param("basinCode") String basinCode,
@Param("stationCode") String stationCode,
@Param("reportMonth") String reportMonth,
@Param("tenantId") String tenantId,
@Param("startRow") int startRow,
@Param("endRow") int endRow);
int countStatistics(@Param("basinCode") String basinCode,
@Param("stationCode") String stationCode,
@Param("reportMonth") String reportMonth);
@Param("reportMonth") String reportMonth,
@Param("tenantId") String tenantId);
}

View File

@ -6,5 +6,5 @@ import com.yfd.platform.qgc_data.domain.vo.FishStatisticsVO;
public interface IFishStatisticsService {
Page<FishStatisticsVO> queryPage(DataSourceRequest dataSourceRequest);
Page<FishStatisticsVO> queryPage(DataSourceRequest dataSourceRequest, String tenantId);
}

View File

@ -26,7 +26,7 @@ public class FishStatisticsServiceImpl implements IFishStatisticsService {
private FishStatisticsMapper fishStatisticsMapper;
@Override
public Page<FishStatisticsVO> queryPage(DataSourceRequest dataSourceRequest) {
public Page<FishStatisticsVO> queryPage(DataSourceRequest dataSourceRequest, String tenantId) {
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
String basinNamesStr = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "basinCode");
@ -53,9 +53,9 @@ public class FishStatisticsServiceImpl implements IFishStatisticsService {
int endRow = startRow + pageSize;
List<FishStatisticsVO> records = fishStatisticsMapper.queryStatistics(
basinNamesStr, stationNamesStr, reportMonth, startRow, endRow);
basinNamesStr, stationNamesStr, reportMonth, tenantId, startRow, endRow);
int total = fishStatisticsMapper.countStatistics(basinNamesStr, stationNamesStr, reportMonth);
int total = fishStatisticsMapper.countStatistics(basinNamesStr, stationNamesStr, reportMonth, tenantId);
Page<FishStatisticsVO> page = new Page<>();
page.setRecords(records);

View File

@ -115,6 +115,9 @@
<if test="stationCode != null and stationCode != ''">
AND STATION_CODE = #{stationCode}
</if>
<if test="tenantId != null and tenantId != ''">
AND USER_ID IN (SELECT USER_ID FROM SYS_USER_TENANT WHERE TENANT_ID = #{tenantId})
</if>
</where>
),