|
|
@@ -214,10 +214,14 @@ public class FmsBlockController extends BaseController
|
|
|
blockQuery.setBlockId(blockId);
|
|
|
blockQuery.setLandId(landId);
|
|
|
List<FmsBlock> fmsBlocks = fmsBlockService.selectFmsBlockList(blockQuery);
|
|
|
- Map<String,FmsBlock> blockMap = new HashMap<>();
|
|
|
+
|
|
|
+ Map<String, FmsBlockPlanResVo> fmsBlockPlanResVoMap = new HashMap<>();
|
|
|
blockIds = new ArrayList<>();
|
|
|
for(FmsBlock fmsBlock : fmsBlocks){
|
|
|
- blockMap.put(fmsBlock.getBlockId(),fmsBlock);
|
|
|
+ FmsBlockPlanResVo fmsBlockPlanResVo = new FmsBlockPlanResVo();
|
|
|
+ fmsBlockPlanResVo.setFmsPlanCropResVoList(new ArrayList<>());
|
|
|
+ BeanUtils.copyProperties(fmsBlock,fmsBlockPlanResVo);
|
|
|
+ fmsBlockPlanResVoMap.put(fmsBlockPlanResVo.getBlockId(),fmsBlockPlanResVo);
|
|
|
blockIds.add(fmsBlock.getBlockId());
|
|
|
}
|
|
|
FmsPlanReqVo fmsPlanQuery = new FmsPlanReqVo();
|
|
|
@@ -225,20 +229,12 @@ public class FmsBlockController extends BaseController
|
|
|
fmsPlanQuery.setTid(SecurityUtils.getTid());
|
|
|
fmsPlanQuery.setPlanStatusArray(Arrays.asList(CommonEnums.PLAN_STATUS_START.getCode(), CommonEnums.PLAN_STATUS_NOT_START.getCode()));
|
|
|
List<FmsPlanCropResVo> fmsPlanCropResVoList = fmsPlanService.selectFmsCropPlanResVoList(fmsPlanQuery);
|
|
|
- Map<String, FmsBlockPlanResVo> fmsBlockPlanResVoMap = new HashMap<>();
|
|
|
+
|
|
|
for(FmsPlanCropResVo fmsPlanCropResVo : fmsPlanCropResVoList){
|
|
|
FmsBlockPlanResVo fmsBlockPlanResVo = fmsBlockPlanResVoMap.get(fmsPlanCropResVo.getBlockId());
|
|
|
- if(null == fmsBlockPlanResVo){
|
|
|
- FmsBlock fmsBlock = blockMap.get(fmsPlanCropResVo.getBlockId());
|
|
|
- if(null == fmsBlock){
|
|
|
- continue;
|
|
|
- }
|
|
|
- fmsBlockPlanResVo = new FmsBlockPlanResVo();
|
|
|
- BeanUtils.copyProperties(fmsBlock,fmsBlockPlanResVo);
|
|
|
- fmsBlockPlanResVo.setFmsPlanCropResVoList(new ArrayList<>());
|
|
|
- fmsBlockPlanResVoMap.put(fmsBlockPlanResVo.getBlockId(),fmsBlockPlanResVo);
|
|
|
+ if(null != fmsBlockPlanResVo){
|
|
|
+ fmsBlockPlanResVo.getFmsPlanCropResVoList().add(fmsPlanCropResVo);
|
|
|
}
|
|
|
- fmsBlockPlanResVo.getFmsPlanCropResVoList().add(fmsPlanCropResVo);
|
|
|
}
|
|
|
|
|
|
return AjaxResult.success(fmsBlockPlanResVoMap.values());
|