智慧农业后台管理
guoshilong
2022-10-15 97da879dc16dffb2fbcc7447dee7db819049fa02
src/main/java/org/springblade/modules/farm/controller/FarmController.java
@@ -24,11 +24,13 @@
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.farm.entity.Farm;
import org.springblade.modules.farm.service.FarmService;
import org.springblade.modules.farm.vo.FarmVO;
import org.springblade.modules.system.vo.RoleVO;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@@ -132,13 +134,13 @@
   public R update(@Valid @RequestBody Farm farm) {
      farm.setUpdateTime(new Date());
      //坐标转换
      if (null != farm.getPosition() && !farm.getPosition().equals("")) {
         //替换逗号为空格
         String sNull = farm.getPosition().replaceAll(",", " ");
         //替换分号为逗号
         String replaceAll = sNull.replaceAll(";", ",");
         farm.setPosition("'POLYGON((" + replaceAll + "))'");
      }
//      if (null != farm.getPosition() && !farm.getPosition().equals("")) {
//         //替换逗号为空格
//         String sNull = farm.getPosition().replaceAll(",", " ");
//         //替换分号为逗号
//         String replaceAll = sNull.replaceAll(";", ",");
//         farm.setPosition("'POLYGON((" + replaceAll + "))'");
//      }
      //更新并返回
      return R.status(farmService.updateFarmById(farm));
   }
@@ -165,7 +167,7 @@
   }
   /**
    * 删除
    * 大屏农场数量与人员数量
    */
   @GetMapping("/SelectCount")
   public R SelectCount() {
@@ -178,5 +180,4 @@
      map.put("rynum", integer1);
      return R.data(map);
   }
}