Browse Source

新增 获取高空测报灯,水稻测报灯设备列表接口

zhaiyifei 1 year atrás
parent
commit
ca9fa98417

+ 54 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/pest/controller/IotDeviceCbdController.java

@@ -37,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
@@ -71,6 +72,35 @@ public class IotDeviceCbdController extends BaseController {
     private IotDeviceRefreshService iotDeviceRefreshService;
 
     /**
+     * 获取测报灯列表数据
+     * 普通测报灯  pt
+     * 水稻测报灯  sc
+     * 高空测报灯  gk
+     * @param reqVo
+     * @return
+     */
+    @GetMapping({"/gk/list", "/sd/list", "/pt/list"})
+    public TableDataInfo list(HttpServletRequest request, IotDeviceListReqVo reqVo) {
+        startPage();
+        String reqUri = request.getRequestURI();
+        String[] devTypeList = null;
+        if(reqUri.endsWith("/gk/list")){
+            devTypeList = new String[]{IotDeviceDictConst.TYPE_YF_GKCBD};
+        }else if(reqUri.endsWith("/sd/list")){
+            devTypeList = new String[]{IotDeviceDictConst.TYPE_YF_SDCBD};
+        }else if(reqUri.endsWith("/pt/list")){
+            devTypeList = new String[]{IotDeviceDictConst.TYPE_YF_CBD};
+        }
+        List<IotDeviceListResVo> list = new ArrayList<>();
+        if(devTypeList != null){
+            reqVo.setDevtypeBidList(Arrays.asList(devTypeList));
+            list = iIotDeviceService.selectIotDeviceListByType(reqVo);
+        }
+        return getDataTable(list);
+    }
+
+
+    /**
      * 下发测报灯配置指令
      *
      * @return
@@ -204,4 +234,28 @@ public class IotDeviceCbdController extends BaseController {
         }
         return getDataTable(list);
     }
+
+//
+//    /**
+//     * 水稻测报灯列表
+//     * @param reqVo
+//     * @return
+//     */
+//    @GetMapping("/sd/list")
+//    public TableDataInfo sdList(IotDeviceListReqVo reqVo) {
+//        startPage();
+//        TosDevicetype tosDevicetype= typeCacheService.getCacheObjectByDevTypeCode(IotDeviceDictConst.TYPE_YF_CBD);
+//        reqVo.setDevtypeBid(tosDevicetype.getDevtypeBid());
+//        List<IotDeviceListResVo> list = iIotDeviceService.selectIotDeviceListByType(reqVo);
+//        for (IotDeviceListResVo resVo : list) {
+//            //查询图片数量
+//            Map<String, Object> map = new HashMap<>();
+//            map.put("devBid", resVo.getDevBid());
+//            map.put("cbdimgDelstatus", "0");
+//            long count = mongoService.count(IotCbdimg.class, map);
+//            resVo.setImgCount(count);
+//
+//        }
+//        return getDataTable(list);
+//    }
 }

+ 1 - 1
src/main/java/com/yunfeiyun/agmp/iotm/device/pest/service/impl/IotPestrecogServiceImpl.java

@@ -565,7 +565,7 @@ public class IotPestrecogServiceImpl implements IIotPestrecogService {
                 IotCbdimg.class, aggregation, IotPestRecogPeriodInfoResVo.class
         );
         IotPestRecogPeriodInfoResVo result = new IotPestRecogPeriodInfoResVo();
-        if(infoResVoList != null && infoResVoList.size() > 0){
+        if(infoResVoList != null && !infoResVoList.isEmpty()){
             result = infoResVoList.get(0);
             IoPestResVo ioPestResVo = null;
             if(Objects.equals(cbdrecogMarktype, EnumCbdMarkType.AUTO.getCode())){

+ 0 - 4
src/main/java/com/yunfeiyun/agmp/iotm/device/qxsqz/controller/IotDeviceQxzController.java

@@ -60,10 +60,6 @@ public class IotDeviceQxzController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo list(HttpServletRequest request, IotDeviceListReqVo reqVo) {
         startPage();
-        log.info(request.getPathInfo());
-        log.info(request.getRequestURI());
-        log.info(request.getContextPath());
-        log.info(String.valueOf(request.getRequestURL()));
         String reqUri = request.getRequestURI();
         String[] devTypeList = null;
         if(reqUri.endsWith("/qxz/list")){