fix (farm): 微服务API

- 绕过token配置
This commit is contained in:
达富斌
2025-09-15 11:09:03 +08:00
parent 705a4cc9e9
commit c374b1fc54
7 changed files with 23 additions and 14 deletions

View File

@@ -26,7 +26,6 @@ import java.util.List;
@RestController
@RequestMapping("/farm/remote")
@Validated
@PermitAll
public class ApiController {
private final ProductionPlanService productionPlanService;
@@ -45,6 +44,7 @@ public class ApiController {
* @param req 根据租户id、开始时间、结束时间 ,已完成状态
* @return 种植计划id、种植计划名称
*/
@PermitAll
@PostMapping("/production-plan/page")
@Operation(summary = "生产计划-分页")
public CommonResult<PageResult<FarmProductionPlanRespVO>> getPageForFarmProductionPlan(@Valid @RequestBody FarmProductionPlanReqVO req) {
@@ -59,12 +59,14 @@ public class ApiController {
* @param req 根据租户id、种植计划id
* @return 种植计划id、种植计划名称、种植开始时间、种植结束时间、计划所属的基地图片、基地简介、基地中心坐标点
*/
@PermitAll
@PostMapping("/production-plan/get")
@Operation(summary = "生产计划-详情")
public CommonResult<FarmProductionPlanDetailRespVO> getDetailForFarmProductionPlan(@Valid @RequestBody FarmProductionPlanDetailReqVO req) {
return productionPlanService.getDetailForFarmProductionPlan(req);
}
@PermitAll
@PostMapping("/digital-cockpit/get")
@Operation(summary = "数字驾驶舱-基地概要信息")
public CommonResult<FarmBaseOverviewRespVO> getBaseOverview(@Valid @RequestBody FarmBaseOverviewReqVO req) {
@@ -72,31 +74,35 @@ public class ApiController {
}
// TODO: 2025/9/4 地图展示信息 - 设备坐标
@PermitAll
@PostMapping("/digital-cockpit/list")
@Operation(summary = "数字驾驶舱-基地信息列表")
public CommonResult<List<FarmBaseInfoRespVO>> getBaseInfoList(@Valid @RequestBody FarmBaseInfoReqVO req) {
return baseInfoService.getBaseInfoList(req);
}
@PermitAll
@PostMapping("/digital-cockpit/chart/yield-comparison")
@Operation(summary = "数字驾驶舱-生产数据-产量对比")
public CommonResult<List<YieldComparisonChartRespVO>> getYieldComparisonChart(@Valid @RequestBody YieldComparisonChartReqVO req) {
return productionPlanService.getYieldComparisonChart(req);
}
@PermitAll
@PostMapping("/digital-cockpit/chart/planting-plan-completion")
@Operation(summary = "数字驾驶舱-生产数据-种植计划完成情况")
public CommonResult<List<PlantingPlanCompletionRespVO>> getPlantingPlanCompletionChart(@Valid @RequestBody PlantingPlanCompletionReqVO req) {
public CommonResult<PlantingPlanCompletionRespVO> getPlantingPlanCompletionChart(@Valid @RequestBody PlantingPlanCompletionReqVO req) {
return productionPlanService.getPlantingPlanCompletionChart(req);
}
@PermitAll
@PostMapping("/digital-cockpit/chart/disaster-statistics")
@Operation(summary = "数字驾驶舱-灾害统计-灾害分析")
public CommonResult<List<DisasterAnalysisRespVO>> getDisasterStatisticsChart(@Valid @RequestBody DisasterAnalysisReqVO req) {
return productionPlanService.getDisasterStatisticsChart(req); // TODO: 2025/9/4 未实现
}
@PermitAll
@PostMapping("/digital-cockpit/chart/farming-distribution")
@Operation(summary = "数字驾驶舱-灾害统计-农事分布")
public CommonResult<List<FarmingDistributionRespVO>> getFarmingDistributionChart(@Valid @RequestBody FarmingDistributionReqVO req) {

View File

@@ -82,5 +82,5 @@ public interface ProductionPlanMapper extends BaseMapperX<ProductionPlanDO> {
List<YieldComparisonChartRespVO> getYieldComparisonChart(YieldComparisonChartReqVO req);
List<PlantingPlanCompletionRespVO> getPlantingPlanCompletionChart(PlantingPlanCompletionReqVO req);
PlantingPlanCompletionRespVO getPlantingPlanCompletionChart(PlantingPlanCompletionReqVO req);
}

View File

@@ -171,8 +171,8 @@ public class BaseInfoServiceImpl implements BaseInfoService {
public List<BaseInfoDO> getBaseInfosById(String id) {
LambdaQueryWrapperX<BaseInfoDO> wrapperX = new LambdaQueryWrapperX<>();
String tenantId = String.valueOf(getLoginUser().getTenantId());
wrapperX.eq(BaseInfoDO::getTenantId, tenantId);
wrapperX.eq(BaseInfoDO::getDeleted, CommonConstants.NO_CODE);
wrapperX.eqIfPresent(BaseInfoDO::getTenantId, tenantId);
wrapperX.eqIfPresent(BaseInfoDO::getDeleted, CommonConstants.NO_CODE);
wrapperX.eqIfPresent(BaseInfoDO::getId, id);
return baseInfoMapper.selectList(wrapperX);
}

View File

@@ -193,7 +193,7 @@ public interface ProductionPlanService {
* @param req
* @return
*/
CommonResult<List<PlantingPlanCompletionRespVO>> getPlantingPlanCompletionChart(PlantingPlanCompletionReqVO req);
CommonResult<PlantingPlanCompletionRespVO> getPlantingPlanCompletionChart(PlantingPlanCompletionReqVO req);
/**
* api 接口

View File

@@ -398,8 +398,8 @@ public class ProductionPlanServiceImpl implements ProductionPlanService {
}
@Override
public CommonResult<List<PlantingPlanCompletionRespVO>> getPlantingPlanCompletionChart(PlantingPlanCompletionReqVO req) {
List<PlantingPlanCompletionRespVO> res = productionPlanMapper.getPlantingPlanCompletionChart(req);
public CommonResult<PlantingPlanCompletionRespVO> getPlantingPlanCompletionChart(PlantingPlanCompletionReqVO req) {
PlantingPlanCompletionRespVO res = productionPlanMapper.getPlantingPlanCompletionChart(req);
return CommonResult.success(res);
}

View File

@@ -86,14 +86,16 @@
</if>
</sql>
<select id="selectById"
resultType="cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata.DisasterDataDO">
<select id="selectById" resultType="cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata.DisasterDataDO">
SELECT
<include refid="all_fields"/>
FROM farm_disaster_data
WHERE deleted = 0 AND id = #{id}
<where>
deleted = 0
<if test="id != null and id !=''">
AND id = #{id}
</if>
</where>
</select>
<update id="updateById" parameterType="cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata.DisasterDataDO">

View File

@@ -288,6 +288,7 @@ yudao:
- /admin-api/system/user/profile/**
- /admin-api/system/auth/**
- /admin-api/app/traceability-code/scan
- /admin-api/farm/remote/**
ignore-tables:
- region
- farm_mqtt_connection