智慧农业后台管理
src/main/java/org/springblade/modules/lang/controller/LandController.java
@@ -30,6 +30,7 @@
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.modules.farm.entity.Farm;
import org.springblade.modules.farm.vo.FarmVO;
import org.springblade.modules.resource.endpoint.OssEndpoint;
@@ -112,7 +113,7 @@
    */
   @GetMapping("/selcetByStrainId")
   public R selcetByStrainId(String strainId,String farmId) {
      List<Land> list = landService.selectByStrainId(strainId,farmId);
      List<LandVO> list = landService.selectByStrainId(strainId,farmId);
      return R.data(list);
   }
@@ -314,7 +315,13 @@
   @ApiOperationSupport(order = 7)
   @ApiOperation(value = "逻辑删除", notes = "传入ids")
   public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
      return R.status(landService.deleteLogic(Func.toLongList(ids)));
      //先要判断该地块是否还有正在种植的作物,先结束才能删除地块
      List<LandVO> land= landService.findPlantInLand(ids);
      if (land.size()<=0) {
         return R.status(landService.deleteLogic(Func.toLongList(ids)));
      }else {
         throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("请先结束该地块正在种养品种"));
      }
   }
   /**
@@ -358,7 +365,7 @@
         if (unit.equals("0")) {
            num += area1;
         }
         if (unit.equals("1")) {
         else if (unit.equals("1")) {
            double v = area1 * 0.1;
            num += v;
         } else {
@@ -378,10 +385,10 @@
         if (unit.equals("0")) {
            snum += area1;
         }
         if (unit.equals("1")) {
         else if (unit.equals("1")) {
            double v = area1 * 0.1;
            snum += v;
         } else {
         } else{
            double v = area1 * 0.0015;
            snum += v;
         }