From ee138e53a109cfc28aa8565575a944086711094c Mon Sep 17 00:00:00 2001
From: chen_xi <276999030@qq.com>
Date: Thu, 29 Jun 2023 17:33:55 +0800
Subject: [PATCH] 去除无效内容

---
 screen-api/src/main/java/com/moral/api/controller/UAVController.java |   65 +++++++++++++++++++++++++++-----
 1 files changed, 54 insertions(+), 11 deletions(-)

diff --git a/screen-api/src/main/java/com/moral/api/controller/UAVController.java b/screen-api/src/main/java/com/moral/api/controller/UAVController.java
index 412ef42..29c41ef 100644
--- a/screen-api/src/main/java/com/moral/api/controller/UAVController.java
+++ b/screen-api/src/main/java/com/moral/api/controller/UAVController.java
@@ -3,10 +3,16 @@
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.moral.api.entity.HistorySecondUav;
 import com.moral.api.mapper.HistorySecondUavMapper;
+import com.moral.api.pojo.dto.uav.UAVQueryTimeSlotDTO;
+import com.moral.api.pojo.form.uav.UAVQueryTimeSlotForm;
+import com.moral.api.pojo.vo.uav.HistorySecondUavVOs;
 import com.moral.api.pojo.vo.uav.UAVQueryDateVO;
+import com.moral.api.pojo.vo.uav.UAVQueryTimeSlotVO;
+import com.moral.api.pojo.vo.uav.UAVQueryTimeSlotVOs;
 import com.moral.api.service.HistorySecondUavService;
 import com.moral.constant.ResponseCodeEnum;
 import com.moral.constant.ResultMessage;
+import com.moral.util.DateUtils;
 import io.swagger.annotations.Api;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,8 +20,7 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * @ClassName UAVController
@@ -32,20 +37,36 @@
 public class UAVController {
 
     @Autowired
-    HistorySecondUavMapper historySecondUavMapper;
-    @Autowired
     HistorySecondUavService historySecondUavService;
+    @Autowired
+    HistorySecondUavMapper historySecondUavMapper;
+
     /**
-    * @Description: ������������id���mac���������������������������������
-            * @Param: []
+    * @Description: ������������������������������������������
+            * @Param: [batch]
             * @return: com.moral.constant.ResultMessage
             * @Author: ���������
-            * @Date: 2021/8/31
+            * @Date: 2021/9/13
             */
-    @RequestMapping("query")
-    public ResultMessage query(){
-        List<HistorySecondUav> historySecondUavs = historySecondUavMapper.selectList(new QueryWrapper<>());
-        return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(),historySecondUavs);
+    @RequestMapping("queryDataByBatch")
+    public ResultMessage queryDataByBatch(String batch){
+        List<HistorySecondUav> historySecondUavs = historySecondUavService.queryDataByBatch(batch);
+        if (historySecondUavs==null){
+            return new ResultMessage(ResponseCodeEnum.SENSOR_IS_NOT_EXIST,"null");
+        }
+        
+        //������������������������
+        HistorySecondUavVOs vo = HistorySecondUavVOs.convert(historySecondUavs);
+        return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(),vo);
+    }
+
+    @RequestMapping("test")
+    public ResultMessage test(String batch){
+        QueryWrapper<HistorySecondUav> wrapper = new QueryWrapper();
+        wrapper.select("value");
+        wrapper.eq("batch", "2021-07-08 01:00:00");
+        List<HistorySecondUav> datas = historySecondUavMapper.selectList(wrapper);
+        return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(),datas);
     }
 
 
@@ -66,4 +87,26 @@
         return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(),vo);
     }
 
+
+    /**
+    * @Description: ���������������������������������������������
+            * @Param: [form]
+            * @return: com.moral.constant.ResultMessage
+            * @Author: ���������
+            * @Date: 2021/9/13
+            */
+    @RequestMapping("queryTimeSlot")
+    public ResultMessage queryTimeSlot(UAVQueryTimeSlotForm form){
+        //������������������������
+        if (!form.valid())
+            return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(),
+                    ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
+        //������������������
+        List<UAVQueryTimeSlotDTO> dtos = historySecondUavService.queryTimeSlot(form);
+        //������vo���
+        UAVQueryTimeSlotVOs vo = UAVQueryTimeSlotVOs.convert(dtos);
+        //������������
+        return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(),vo);
+    }
+
 }

--
Gitblit v1.8.0