feat (farm): API接口
- 数字驾驶舱-灾害统计-灾害分析 - 数字驾驶舱-灾害统计-农事分布
This commit is contained in:
@@ -69,6 +69,8 @@ public class ApiController {
|
|||||||
return baseInfoService.getBaseOverview(req);
|
return baseInfoService.getBaseOverview(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: 2025/9/4 地图展示信息 - 设备坐标
|
||||||
|
|
||||||
@GetMapping("/digital-cockpit/list")
|
@GetMapping("/digital-cockpit/list")
|
||||||
@Operation(summary = "数字驾驶舱-基地信息列表")
|
@Operation(summary = "数字驾驶舱-基地信息列表")
|
||||||
public CommonResult<List<FarmBaseInfoRespVO>> getBaseInfoList(@Valid @RequestBody FarmBaseInfoReqVO req) {
|
public CommonResult<List<FarmBaseInfoRespVO>> getBaseInfoList(@Valid @RequestBody FarmBaseInfoReqVO req) {
|
||||||
@@ -87,4 +89,22 @@ public class ApiController {
|
|||||||
return productionPlanService.getPlantingPlanCompletionChart(req);
|
return productionPlanService.getPlantingPlanCompletionChart(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/digital-cockpit/chart/disaster-statistics")
|
||||||
|
@Operation(summary = "数字驾驶舱-灾害统计-灾害分析")
|
||||||
|
public CommonResult<List<DisasterAnalysisRespVO>> getDisasterStatisticsChart(@Valid @RequestBody DisasterAnalysisReqVO req) {
|
||||||
|
return productionPlanService.getDisasterStatisticsChart(req); // TODO: 2025/9/4 未实现
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/digital-cockpit/chart/farming-distribution")
|
||||||
|
@Operation(summary = "数字驾驶舱-灾害统计-农事分布")
|
||||||
|
public CommonResult<List<FarmingDistributionRespVO>> getFarmingDistributionChart(@Valid @RequestBody FarmingDistributionReqVO req) {
|
||||||
|
return productionPlanService.getFarmingDistributionChart(req); // TODO: 2025/9/4 未实现
|
||||||
|
}
|
||||||
|
|
||||||
|
// todo 设备监控
|
||||||
|
|
||||||
|
// todo 物候信息
|
||||||
|
|
||||||
|
// todo 设备总览
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.api.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 数字驾驶舱-统计图-灾害分析 请求实体
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/9/4 22:22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class DisasterAnalysisReqVO {
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.api.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 数字驾驶舱-统计图-灾害分析 响应实体
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/9/4 22:23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class DisasterAnalysisRespVO {
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -28,6 +28,8 @@ public class FarmBaseOverviewRespVO {
|
|||||||
private Double baseTotalArea;
|
private Double baseTotalArea;
|
||||||
@Schema(description = "基地总数量")
|
@Schema(description = "基地总数量")
|
||||||
private Integer baseTotalCount;
|
private Integer baseTotalCount;
|
||||||
|
@Schema(description = "地块总数量")
|
||||||
|
private Integer plotTotalCount;
|
||||||
@Schema(description = "品种总数量")
|
@Schema(description = "品种总数量")
|
||||||
private Integer cropTotalCount;
|
private Integer cropTotalCount;
|
||||||
@Schema(description = "物联网设备总数")
|
@Schema(description = "物联网设备总数")
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ public class FarmProductionPlanDetailRespVO {
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Schema(description = "种植结束日期")
|
@Schema(description = "种植结束日期")
|
||||||
private LocalDate productionEndDate;
|
private LocalDate productionEndDate;
|
||||||
|
@Schema(description = "基地ID")
|
||||||
|
private String baseId;
|
||||||
|
@Schema(description = "基地名称")
|
||||||
|
private String baseName;
|
||||||
@Schema(description = "基地中心点坐标")
|
@Schema(description = "基地中心点坐标")
|
||||||
private String centrePoint;
|
private String centrePoint;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.api.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 数字驾驶舱-统计图-农事分布 请求实体
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/9/4 22:28
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class FarmingDistributionReqVO {
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.api.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 数字驾驶舱-统计图-农事分布 响应实体
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/9/4 22:30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class FarmingDistributionRespVO {
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
@@ -281,6 +281,7 @@ public class BaseInfoServiceImpl implements BaseInfoService {
|
|||||||
tenantInfo.setTenantId(bDO.getTenantId());
|
tenantInfo.setTenantId(bDO.getTenantId());
|
||||||
tenantInfo.setBaseTotalArea(this.getBaseTotalArea(tenantId));
|
tenantInfo.setBaseTotalArea(this.getBaseTotalArea(tenantId));
|
||||||
tenantInfo.setBaseTotalCount(this.getBaseTotalCount(tenantId));
|
tenantInfo.setBaseTotalCount(this.getBaseTotalCount(tenantId));
|
||||||
|
tenantInfo.setPlotTotalCount(plotInfoService.getPlotTotalCount(tenantId));
|
||||||
tenantInfo.setCropTotalCount(speciesLibraryService.getCropTotalCount(tenantId));
|
tenantInfo.setCropTotalCount(speciesLibraryService.getCropTotalCount(tenantId));
|
||||||
tenantInfo.setIotDeviceTotalCount(0); // TODO: 2025/9/4
|
tenantInfo.setIotDeviceTotalCount(0); // TODO: 2025/9/4
|
||||||
|
|
||||||
|
|||||||
@@ -69,4 +69,11 @@ public interface PlotInfoService {
|
|||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
void deleteByBaseId(String baseId);
|
void deleteByBaseId(String baseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户-地块总数
|
||||||
|
* @param tenantId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer getPlotTotalCount(String tenantId);
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.farm.service.plotinfo;
|
|||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.plotinfo.vo.PlotInfoPageReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.plotinfo.vo.PlotInfoPageReqVO;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.plotinfo.vo.PlotInfoSaveReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.plotinfo.vo.PlotInfoSaveReqVO;
|
||||||
@@ -10,6 +11,7 @@ import cn.iocoder.yudao.module.farm.dal.dataobject.baseinfo.BaseInfoDO;
|
|||||||
import cn.iocoder.yudao.module.farm.dal.dataobject.plotinfo.PlotInfoDO;
|
import cn.iocoder.yudao.module.farm.dal.dataobject.plotinfo.PlotInfoDO;
|
||||||
import cn.iocoder.yudao.module.farm.dal.mysql.baseinfo.BaseInfoMapper;
|
import cn.iocoder.yudao.module.farm.dal.mysql.baseinfo.BaseInfoMapper;
|
||||||
import cn.iocoder.yudao.module.farm.dal.mysql.plotinfo.PlotInfoMapper;
|
import cn.iocoder.yudao.module.farm.dal.mysql.plotinfo.PlotInfoMapper;
|
||||||
|
import cn.iocoder.yudao.module.farm.enums.CommonConstants;
|
||||||
import cn.iocoder.yudao.module.farm.service.productionplan.ProductionPlanService;
|
import cn.iocoder.yudao.module.farm.service.productionplan.ProductionPlanService;
|
||||||
import cn.iocoder.yudao.module.farm.utils.StrHelperUtil;
|
import cn.iocoder.yudao.module.farm.utils.StrHelperUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@@ -139,6 +141,15 @@ public class PlotInfoServiceImpl implements PlotInfoService {
|
|||||||
plotInfoMapper.delete("base_id", baseId);
|
plotInfoMapper.delete("base_id", baseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getPlotTotalCount(String tenantId) {
|
||||||
|
LambdaQueryWrapperX<PlotInfoDO> wrapperX = new LambdaQueryWrapperX<>();
|
||||||
|
wrapperX.eq(PlotInfoDO::getTenantId, tenantId);
|
||||||
|
wrapperX.eq(PlotInfoDO::getDeleted, CommonConstants.NO_CODE);
|
||||||
|
Long count = plotInfoMapper.selectCount(wrapperX);
|
||||||
|
return count.intValue();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证: 地块总面积不得大于基地面积
|
* 验证: 地块总面积不得大于基地面积
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -188,4 +188,20 @@ public interface ProductionPlanService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
CommonResult<List<PlantingPlanCompletionRespVO>> getPlantingPlanCompletionChart(PlantingPlanCompletionReqVO req);
|
CommonResult<List<PlantingPlanCompletionRespVO>> getPlantingPlanCompletionChart(PlantingPlanCompletionReqVO req);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* api 接口
|
||||||
|
* 灾害统计-灾害分析
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CommonResult<List<DisasterAnalysisRespVO>> getDisasterStatisticsChart(DisasterAnalysisReqVO req);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* api 接口
|
||||||
|
* 灾害统计-农事分布
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CommonResult<List<FarmingDistributionRespVO>> getFarmingDistributionChart(FarmingDistributionReqVO req);
|
||||||
}
|
}
|
||||||
@@ -369,6 +369,8 @@ public class ProductionPlanServiceImpl implements ProductionPlanService {
|
|||||||
res.setProductionPlanName(planDO.getPlanNumber());
|
res.setProductionPlanName(planDO.getPlanNumber());
|
||||||
res.setProductionStartDate(planDO.getProductionStartDate());
|
res.setProductionStartDate(planDO.getProductionStartDate());
|
||||||
res.setProductionEndDate(planDO.getProductionEndDate());
|
res.setProductionEndDate(planDO.getProductionEndDate());
|
||||||
|
res.setBaseId(baseDO.getId());
|
||||||
|
res.setBaseName(baseDO.getName());
|
||||||
res.setCentrePoint(baseDO.getCentrePoint());
|
res.setCentrePoint(baseDO.getCentrePoint());
|
||||||
|
|
||||||
return CommonResult.success(res);
|
return CommonResult.success(res);
|
||||||
@@ -386,4 +388,13 @@ public class ProductionPlanServiceImpl implements ProductionPlanService {
|
|||||||
return CommonResult.success(res);
|
return CommonResult.success(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<List<DisasterAnalysisRespVO>> getDisasterStatisticsChart(DisasterAnalysisReqVO req) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<List<FarmingDistributionRespVO>> getFarmingDistributionChart(FarmingDistributionReqVO req) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user