farm模块-模型调用
This commit is contained in:
@@ -91,7 +91,7 @@ public class CropFarmingCenterServiceImpl implements CropFarmingCenterService {
|
|||||||
for (ProductionPlanSaveReqVO.CultivationArea e : cultivationAreaList) {
|
for (ProductionPlanSaveReqVO.CultivationArea e : cultivationAreaList) {
|
||||||
ProductionPlanDO obj = new ProductionPlanDO();
|
ProductionPlanDO obj = new ProductionPlanDO();
|
||||||
obj.setPlantSpeciesCode(reqVO.getPlantSpeciesCode());
|
obj.setPlantSpeciesCode(reqVO.getPlantSpeciesCode());
|
||||||
obj.setSpeciesModelId(speciesModelId);
|
|
||||||
obj.setProductionStartDate(reqVO.getProductionStartDate());
|
obj.setProductionStartDate(reqVO.getProductionStartDate());
|
||||||
obj.setProductionEndDate(reqVO.getProductionEndDate());
|
obj.setProductionEndDate(reqVO.getProductionEndDate());
|
||||||
obj.setHarvestStartDate(reqVO.getHarvestStartDate());
|
obj.setHarvestStartDate(reqVO.getHarvestStartDate());
|
||||||
@@ -122,7 +122,7 @@ public class CropFarmingCenterServiceImpl implements CropFarmingCenterService {
|
|||||||
if (speciesModelId.equals("")) {
|
if (speciesModelId.equals("")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
obj.setSpeciesModelId(speciesModelId);
|
||||||
list.add(obj);
|
list.add(obj);
|
||||||
}
|
}
|
||||||
productionPlanMapper.insertBatch(list);
|
productionPlanMapper.insertBatch(list);
|
||||||
@@ -217,7 +217,7 @@ public class CropFarmingCenterServiceImpl implements CropFarmingCenterService {
|
|||||||
throw exception(PRODUCTION_PLAN_NOT_EXISTS);
|
throw exception(PRODUCTION_PLAN_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelManagementRespVO modelManagementRespVO = modelManagementService.getModelManagement(productionPlanDO.getSpeciesModelId());
|
ModelManagementRespVO modelManagementRespVO = modelManagementService.getModelManagement(productionPlanDO.getId());
|
||||||
|
|
||||||
ProductionPlanRespVO productionPlanRespVO = BeanUtils.toBean(productionPlanDO, ProductionPlanRespVO.class);
|
ProductionPlanRespVO productionPlanRespVO = BeanUtils.toBean(productionPlanDO, ProductionPlanRespVO.class);
|
||||||
productionPlanRespVO.setModelManagementRespVO(modelManagementRespVO);
|
productionPlanRespVO.setModelManagementRespVO(modelManagementRespVO);
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ 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.security.core.LoginUser;
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.DisasterDataReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.DisasterDataReqVO;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys.SysDictThreeLvRespVO;
|
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.modelcycle.vo.ModelCycleRespVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.modelcycle.vo.ModelCycleRespVO;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.modelfarmingoperation.vo.ModelFarmingOperationRespVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.modelfarmingoperation.vo.ModelFarmingOperationRespVO;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.modelmanagement.vo.ModelManagementPageReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.modelmanagement.vo.ModelManagementPageReqVO;
|
||||||
@@ -233,8 +232,8 @@ public class ModelManagementServiceImpl implements ModelManagementService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModelManagementDO getModelManagement(String field,String id) {
|
public ModelManagementDO getModelManagement(String field, String id) {
|
||||||
return modelManagementMapper.selectOne(field,id);
|
return modelManagementMapper.selectOne(field, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -279,9 +278,9 @@ public class ModelManagementServiceImpl implements ModelManagementService {
|
|||||||
Map<String, String> unit2Map = unit2List.stream().collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1));
|
Map<String, String> unit2Map = unit2List.stream().collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1));
|
||||||
|
|
||||||
|
|
||||||
ModelManagementDO modelManagementDO = modelManagementMapper.selectOne(ModelManagementDO::getTaskId,id);
|
ModelManagementDO modelManagementDO = modelManagementMapper.selectById(id);
|
||||||
if (modelManagementDO == null) {
|
if (modelManagementDO == null) {
|
||||||
return null;
|
modelManagementDO = modelManagementMapper.selectOne(ModelManagementDO::getTaskId, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 使用统一的转换方法
|
// 使用统一的转换方法
|
||||||
|
|||||||
@@ -256,17 +256,6 @@ public class SpeciesLibraryServiceImpl implements SpeciesLibraryService {
|
|||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
Map<String, List<SpeciesLibraryDO>> categoryToSpeciesMap;
|
|
||||||
if (level2Ids.isEmpty()) {
|
|
||||||
categoryToSpeciesMap = java.util.Collections.emptyMap();
|
|
||||||
} else {
|
|
||||||
level2Ids.forEach(level2Id -> {
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
List<SpeciesThreeLevelTreeRespVO> result = new ArrayList<>();
|
List<SpeciesThreeLevelTreeRespVO> result = new ArrayList<>();
|
||||||
for (TwoDictTreeRespVO lvl1 : level1Nodes) {
|
for (TwoDictTreeRespVO lvl1 : level1Nodes) {
|
||||||
SpeciesThreeLevelTreeRespVO lvl1Vo = new SpeciesThreeLevelTreeRespVO();
|
SpeciesThreeLevelTreeRespVO lvl1Vo = new SpeciesThreeLevelTreeRespVO();
|
||||||
|
|||||||
Reference in New Issue
Block a user