farm模块-模型生命周期
This commit is contained in:
@@ -24,7 +24,7 @@ public class ModelManagementPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "生命周期")
|
||||
private String cycle;
|
||||
|
||||
private String cycleName;
|
||||
@Schema(description = "产量参考")
|
||||
private String harvest;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ModelManagementSaveReqVO {
|
||||
|
||||
@Schema(description = "生命周期")
|
||||
private String cycle;
|
||||
|
||||
private String cycleName;
|
||||
@Schema(description = "产量参考")
|
||||
private String harvest;
|
||||
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
package cn.iocoder.yudao.module.farm.dal.dataobject.modelmanagement;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import cn.iocoder.yudao.module.farm.framework.util.AreaCodeUtil;
|
||||
import cn.iocoder.yudao.module.farm.framework.util.ImageCollectionUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import cn.iocoder.yudao.module.farm.framework.util.ImageCollectionUtil;
|
||||
import cn.iocoder.yudao.module.farm.framework.util.AreaCodeUtil;
|
||||
|
||||
/**
|
||||
* 模型管理 DO
|
||||
@@ -100,7 +96,7 @@ public class ModelManagementDO extends BaseDO {
|
||||
* 物种图片(数据库存储为逗号分隔的字符串)
|
||||
*/
|
||||
private String speciesImage;
|
||||
|
||||
private String cycleName;
|
||||
/**
|
||||
* 物种图片集合(业务层使用)
|
||||
*/
|
||||
|
||||
@@ -92,10 +92,11 @@ public class ModelManagementServiceImpl implements ModelManagementService {
|
||||
|
||||
SpeciesLibraryDO speciesLibrary = speciesLibraryService.getSpeciesLibrary(createReqVO.getSpeciesId());
|
||||
modelManagement.setSpeciesName(speciesLibrary.getSpeciesName() + "/" + speciesLibrary.getCultivarName());
|
||||
modelManagement.setCycle(speciesLibrary.getLifeCycle().toString());
|
||||
if (speciesLibrary.getLifeCycle() == 1) {
|
||||
modelManagement.setCycle("一年生");
|
||||
modelManagement.setCycleName("一年生");
|
||||
} else if (speciesLibrary.getLifeCycle() == 10) {
|
||||
modelManagement.setCycle("多年生");
|
||||
modelManagement.setCycleName("多年生");
|
||||
}
|
||||
modelManagement.setSpeciesImage(speciesLibrary.getImage());
|
||||
// 处理suitablePlantingAreas字段,优先使用集合
|
||||
@@ -282,7 +283,6 @@ public class ModelManagementServiceImpl implements ModelManagementService {
|
||||
|
||||
// 使用统一的转换方法
|
||||
ModelManagementRespVO bean = ModelManagementConvertUtil.convertToRespVO(modelManagementDO);
|
||||
bean.setCycleName(LIFE_CYCLE_MAP.get(bean.getCycle()));
|
||||
|
||||
// 设置模型周期信息
|
||||
List<ModelCycleRespVO> vos = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user