feat: 增殖站地图描点接口(仅查询在建状态的)
This commit is contained in:
parent
53aaf3eb2e
commit
cf6a85d712
@ -152,4 +152,10 @@ public class FbStationController {
|
|||||||
public ResponseResult getFbPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
public ResponseResult getFbPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
return ResponseResult.successData(fbStationService.getFbPointKendoListCust(dataSourceRequest));
|
return ResponseResult.successData(fbStationService.getFbPointKendoListCust(dataSourceRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/point/built/GetKendoListCust")
|
||||||
|
@Operation(summary = "增殖站地图描点接口(仅查询在建状态的)")
|
||||||
|
public ResponseResult getFbBuiltPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(fbStationService.getFbBuiltPointKendoListCust(dataSourceRequest));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,4 +65,6 @@ public interface FbStationService {
|
|||||||
DataSourceResult<TableVo> getFishbreedrFishKendoListCust(DataSourceRequest dataSourceRequest);
|
DataSourceResult<TableVo> getFishbreedrFishKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
DataSourceResult<FbTracingPointVo> getFbPointKendoListCust(DataSourceRequest dataSourceRequest);
|
DataSourceResult<FbTracingPointVo> getFbPointKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult<FbTracingPointVo> getFbBuiltPointKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4577,6 +4577,15 @@ public class FbStationServiceImpl implements FbStationService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataSourceResult<FbTracingPointVo> getFbPointKendoListCust(DataSourceRequest dataSourceRequest) {
|
public DataSourceResult<FbTracingPointVo> getFbPointKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||||
|
return queryFbPointKendoListCust(dataSourceRequest, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSourceResult<FbTracingPointVo> getFbBuiltPointKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||||
|
return queryFbPointKendoListCust(dataSourceRequest, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private DataSourceResult<FbTracingPointVo> queryFbPointKendoListCust(DataSourceRequest dataSourceRequest, boolean builtMode) {
|
||||||
DataSourceResult<FbTracingPointVo> dataSourceResult = new DataSourceResult<>();
|
DataSourceResult<FbTracingPointVo> dataSourceResult = new DataSourceResult<>();
|
||||||
dataSourceResult.setAggregates(new HashMap<>());
|
dataSourceResult.setAggregates(new HashMap<>());
|
||||||
|
|
||||||
@ -4589,6 +4598,9 @@ public class FbStationServiceImpl implements FbStationService {
|
|||||||
DataSourceLoadOptionsBase devRequest = dataSourceRequest.toDevRequest();
|
DataSourceLoadOptionsBase devRequest = dataSourceRequest.toDevRequest();
|
||||||
String rstcd = QgcQueryWrapperUtil.getFilterFieldValue(devRequest, "rstcd");
|
String rstcd = QgcQueryWrapperUtil.getFilterFieldValue(devRequest, "rstcd");
|
||||||
String sttp = QgcQueryWrapperUtil.getFilterFieldValue(devRequest, "sttp");
|
String sttp = QgcQueryWrapperUtil.getFilterFieldValue(devRequest, "sttp");
|
||||||
|
if(StrUtil.isBlank(sttp)){
|
||||||
|
sttp= QgcQueryWrapperUtil.getFilterFieldValue(devRequest, "sttpCode");
|
||||||
|
}
|
||||||
String bldsttCcode = QgcQueryWrapperUtil.getFilterFieldValue(devRequest, "bldsttCcode");
|
String bldsttCcode = QgcQueryWrapperUtil.getFilterFieldValue(devRequest, "bldsttCcode");
|
||||||
|
|
||||||
if (StrUtil.isEmpty(sttp)) {
|
if (StrUtil.isEmpty(sttp)) {
|
||||||
@ -4670,7 +4682,7 @@ public class FbStationServiceImpl implements FbStationService {
|
|||||||
|
|
||||||
|
|
||||||
String filterSql = QgcQueryWrapperUtil.buildFilterCondition(
|
String filterSql = QgcQueryWrapperUtil.buildFilterCondition(
|
||||||
dataSourceRequest == null ? null : dataSourceRequest.getFilter(),
|
dataSourceRequest.getFilter(),
|
||||||
paramMap,
|
paramMap,
|
||||||
new int[]{0},
|
new int[]{0},
|
||||||
this::mapWeFvColumn
|
this::mapWeFvColumn
|
||||||
@ -4683,7 +4695,12 @@ public class FbStationServiceImpl implements FbStationService {
|
|||||||
Page<?> page = devRequest == null ? null : QgcQueryWrapperUtil.buildPage(devRequest, devRequest.getSkip(), devRequest.getTake());
|
Page<?> page = devRequest == null ? null : QgcQueryWrapperUtil.buildPage(devRequest, devRequest.getSkip(), devRequest.getTake());
|
||||||
List<FbTracingPointVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, FbTracingPointVo.class);
|
List<FbTracingPointVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, FbTracingPointVo.class);
|
||||||
|
|
||||||
list = getPointLegend(list);
|
if (builtMode) {
|
||||||
|
enrichFbBuiltPointYearStatistics(list, sttp);
|
||||||
|
list = getBuiltPointLegend(list);
|
||||||
|
} else {
|
||||||
|
list = getPointLegend(list);
|
||||||
|
}
|
||||||
|
|
||||||
SiteAvoidanceUtils.calcSiteMapLev(list,
|
SiteAvoidanceUtils.calcSiteMapLev(list,
|
||||||
FbTracingPointVo::getStcd,
|
FbTracingPointVo::getStcd,
|
||||||
@ -4697,6 +4714,53 @@ public class FbStationServiceImpl implements FbStationService {
|
|||||||
return dataSourceResult;
|
return dataSourceResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void enrichFbBuiltPointYearStatistics(List<FbTracingPointVo> list, String sttp) {
|
||||||
|
if (CollUtil.isEmpty(list) || !"FB".equalsIgnoreCase(sttp)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String currentYear = String.valueOf(Calendar.getInstance().get(Calendar.YEAR));
|
||||||
|
Map<String, Object> planParamMap = new HashMap<>();
|
||||||
|
planParamMap.put("yr", currentYear);
|
||||||
|
String planSql = "SELECT plan.RSTCD AS stcd, SUM(det.FCNT) AS fcnt "
|
||||||
|
+ "FROM SD_ENGFRPLAN_B plan "
|
||||||
|
+ "INNER JOIN SD_ENGFRPLANDET_B det ON plan.ID = det.RPJH_ID "
|
||||||
|
+ "WHERE NVL(plan.IS_DELETED, 0) = 0 "
|
||||||
|
+ "AND NVL(det.IS_DELETED, 0) = 0 "
|
||||||
|
+ "AND TO_CHAR(plan.PLANSD, 'YYYY') = #{map.yr} "
|
||||||
|
+ "GROUP BY plan.RSTCD";
|
||||||
|
List<FbPointCountVo> planList = microservicDynamicSQLMapper.getAllListWithResultType(planSql, planParamMap, FbPointCountVo.class);
|
||||||
|
|
||||||
|
Map<String, Object> actualParamMap = new HashMap<>();
|
||||||
|
actualParamMap.put("yr", currentYear);
|
||||||
|
String actualSql = "SELECT run.RSTCD AS stcd, SUM(det.FCNT) AS fcnt "
|
||||||
|
+ "FROM SD_ENGFR_R run "
|
||||||
|
+ "INNER JOIN SD_RPIMNFISH_R det ON run.ID = det.RPIMN_ID "
|
||||||
|
+ "WHERE NVL(run.IS_DELETED, 0) = 0 "
|
||||||
|
+ "AND NVL(det.IS_DELETED, 0) = 0 "
|
||||||
|
+ "AND TO_CHAR(run.TM, 'YYYY') = #{map.yr} "
|
||||||
|
+ "GROUP BY run.RSTCD";
|
||||||
|
List<FbPointCountVo> actualList = microservicDynamicSQLMapper.getAllListWithResultType(actualSql, actualParamMap, FbPointCountVo.class);
|
||||||
|
|
||||||
|
Map<String, Long> planMap = planList.stream()
|
||||||
|
.filter(item -> StrUtil.isNotBlank(item.getStcd()))
|
||||||
|
.collect(Collectors.toMap(FbPointCountVo::getStcd, FbPointCountVo::getFcnt, (left, right) -> left));
|
||||||
|
Map<String, Long> actualMap = actualList.stream()
|
||||||
|
.filter(item -> StrUtil.isNotBlank(item.getStcd()))
|
||||||
|
.collect(Collectors.toMap(FbPointCountVo::getStcd, FbPointCountVo::getFcnt, (left, right) -> left));
|
||||||
|
|
||||||
|
list.forEach(item -> {
|
||||||
|
Long planCount = planMap.get(item.getStcd());
|
||||||
|
Long actualCount = actualMap.get(item.getStcd());
|
||||||
|
item.setYr(currentYear);
|
||||||
|
item.setJhCnt(planCount);
|
||||||
|
item.setFished(actualCount);
|
||||||
|
if (planCount != null) {
|
||||||
|
item.setUnfished(actualCount == null ? planCount : Math.max(planCount - actualCount, 0L));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private String mapWeFvColumn(String field) {
|
private String mapWeFvColumn(String field) {
|
||||||
if (StrUtil.isBlank(field)) {
|
if (StrUtil.isBlank(field)) {
|
||||||
return null;
|
return null;
|
||||||
@ -4705,6 +4769,7 @@ public class FbStationServiceImpl implements FbStationService {
|
|||||||
case "rstcd" -> "a.RSTCD";
|
case "rstcd" -> "a.RSTCD";
|
||||||
case "stcd" -> "a.STCD";
|
case "stcd" -> "a.STCD";
|
||||||
case "sttp" -> "a.STTP";
|
case "sttp" -> "a.STTP";
|
||||||
|
case "sttpcode" -> "a.STTP";
|
||||||
case "bldsttccode" -> "a.BLDSTT_CODE";
|
case "bldsttccode" -> "a.BLDSTT_CODE";
|
||||||
case "lgtd" -> "a.LGTD";
|
case "lgtd" -> "a.LGTD";
|
||||||
default -> null;
|
default -> null;
|
||||||
@ -4727,4 +4792,41 @@ public class FbStationServiceImpl implements FbStationService {
|
|||||||
}
|
}
|
||||||
return voList;
|
return voList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<FbTracingPointVo> getBuiltPointLegend(List<FbTracingPointVo> voList) {
|
||||||
|
for (FbTracingPointVo pointVo : voList) {
|
||||||
|
Integer bldstt = pointVo.getBldstt();
|
||||||
|
String sttp = pointVo.getSttp();
|
||||||
|
if (bldstt != null && bldstt == 1) {
|
||||||
|
if ("FB".equals(sttp)) {
|
||||||
|
pointVo.setAnchoPointState("fb_built");
|
||||||
|
}
|
||||||
|
if ("SG".equals(sttp)) {
|
||||||
|
pointVo.setAnchoPointState("sg_built");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return voList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class FbPointCountVo {
|
||||||
|
private String stcd;
|
||||||
|
private Long fcnt;
|
||||||
|
|
||||||
|
public String getStcd() {
|
||||||
|
return stcd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStcd(String stcd) {
|
||||||
|
this.stcd = stcd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getFcnt() {
|
||||||
|
return fcnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFcnt(Long fcnt) {
|
||||||
|
this.fcnt = fcnt;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user