智慧农业后台管理
guoshilong
2022-09-17 eab652f2f1c596c839013172a472bf88466f0c83
src/main/java/org/springblade/modules/remote/controller/RemoteController.java
@@ -27,6 +27,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.desk.entity.Notice;
import org.springblade.modules.remote.wrapper.RemoteWrapper;
import org.springframework.web.bind.annotation.*;
@@ -38,7 +39,7 @@
import org.springblade.core.boot.ctrl.BladeController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Map;
import java.util.*;
/**
 *  控制器
@@ -88,6 +89,11 @@
      return R.data(pages);
   }
   @GetMapping("/getSensings")
   public R getSensing(String type){
      return R.data(remoteService.getRemoteList(type));
   }
   /**
    * 新增
    */
@@ -115,6 +121,13 @@
   @ApiOperationSupport(order = 6)
   @ApiOperation(value = "新增或修改", notes = "传入remote")
   public R submit(@Valid @RequestBody Remote remote) {
      if (remote.getReType().equals("0")) {//判断是否修改为展示
         //查找当前类型默认展示的数量
         List<Remote> remoteList = remoteService.findByType(remote);
         if (remoteList.size() > 0) {
            throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("该类型已有默认展示,请先取消默认展示"));
         }
      }
      return R.status(remoteService.saveOrUpdate(remote));
   }