Parcourir la source

农事作物新增预产量字段,
修复首页地图地块列表接口bug

liuyaowen il y a 10 mois
Parent
commit
ceaeb8440a

+ 9 - 13
src/main/java/com/yunfeiyun/agmp/fms/controller/FmsBlockController.java

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

+ 4 - 31
src/main/java/com/yunfeiyun/agmp/fms/domain/resvo/FmsCropResVo.java

@@ -1,9 +1,9 @@
 package com.yunfeiyun.agmp.fms.domain.resvo;
 package com.yunfeiyun.agmp.fms.domain.resvo;
 
 
 import com.yunfeiyun.agmp.common.annotation.Excel;
 import com.yunfeiyun.agmp.common.annotation.Excel;
-import com.yunfeiyun.agmp.common.core.domain.BaseEntity;
 import com.yunfeiyun.agmp.common.utils.DictUtils;
 import com.yunfeiyun.agmp.common.utils.DictUtils;
 import com.yunfeiyun.agmp.common.utils.StringUtils;
 import com.yunfeiyun.agmp.common.utils.StringUtils;
+import com.yunfeiyun.agmp.fms.domain.FmsCrop;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
@@ -15,37 +15,10 @@ import java.math.BigDecimal;
  * @date 2023-05-16
  * @date 2023-05-16
  */
  */
 @Data
 @Data
-public class FmsCropResVo extends BaseEntity
+public class FmsCropResVo extends FmsCrop
 {
 {
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
-    /** 作物标识 */
-    private String cropId;
-
-    /** 作物名称 */
-    @Excel(name = "作物名称")
-    private String cropName;
-
-    /** 作物种类 */
-    @Excel(name = "作物种类")
-    private String cropType;
-
-    /** 作物主要类型 */
-    @Excel(name = "作物主要类型")
-    private String cropMaintype;
-
-    /** 作物推荐状态 */
-    @Excel(name = "作物推荐状态")
-    private String cropRcmdstatus;
-
-    /** 作物预览图 */
-    @Excel(name = "作物预览图")
-    private String cropPreview;
-
-    /** 作物备注 */
-    @Excel(name = "作物备注")
-    private String cropRemark;
-
     @Excel(name = "生长周期条数")
     @Excel(name = "生长周期条数")
     private String count;
     private String count;
 
 
@@ -77,8 +50,8 @@ public class FmsCropResVo extends BaseEntity
     private String landName;
     private String landName;
 
 
     public String getCropMaintypeContent() {
     public String getCropMaintypeContent() {
-        if (!StringUtils.isEmpty(this.cropMaintype)) {
-            return DictUtils.getDictLabel("fms_crop_type", this.cropMaintype);
+        if (!StringUtils.isEmpty(super.getCropMaintype())) {
+            return DictUtils.getDictLabel("fms_crop_type", super.getCropMaintype());
         } else {
         } else {
             return "";
             return "";
         }
         }