From 239927b057f65a040594f7a4cb08c8881b303797 Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Fri, 18 Aug 2023 14:52:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/cjl-230812' into cjl-230812
---
screen-api/src/main/java/com/moral/api/controller/UAVController.java | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 102 insertions(+), 8 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 408ba94..2323049 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
@@ -1,18 +1,42 @@
package com.moral.api.controller;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.moral.api.entity.HistorySecondUav;
import com.moral.api.mapper.HistorySecondUavMapper;
+import com.moral.api.pojo.dto.uav.UAVGetBD;
+import com.moral.api.pojo.dto.uav.UAVGteForDTO;
+import com.moral.api.pojo.dto.uav.UAVQueryTimeSlotDTO;
+import com.moral.api.pojo.dto.uav.UAVResultDTO;
+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.api.service.UAVService;
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;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import java.util.List;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Point2D;
+import java.text.DecimalFormat;
+import java.util.*;
+import java.util.stream.Collectors;
/**
* @ClassName UAVController
@@ -29,17 +53,87 @@
public class UAVController {
@Autowired
+ HistorySecondUavService historySecondUavService;
+ @Autowired
HistorySecondUavMapper historySecondUavMapper;
+ @Autowired
+ UAVService uavService;
+
/**
- * @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);
}
+
+ @PostMapping("getUav")
+ public ResultMessage test(@RequestBody Map<String, Object> params){
+ //������������������������
+ if (!params.containsKey("mac") || !params.containsKey("batch") || !params.containsKey("height1")|| !params.containsKey("uvasize")|| !params.containsKey("height2")) {
+ return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
+ }
+ List<UAVResultDTO> uavResultDTOS = uavService.getUav(params);
+ if (ObjectUtils.isEmpty(uavResultDTOS)){
+ return new ResultMessage(ResponseCodeEnum.SENSOR_IS_NOT_EXIST,"null");
+ }
+ return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(),uavResultDTOS);
+ }
+
+
+ /**
+ * @Description: ������������������������������������������������������������
+ * @Param: [organizationId]
+ * @return: com.moral.constant.ResultMessage
+ * @Author: ���������
+ * @Date: 2021/9/8
+ */
+ @RequestMapping("queryDate")
+ public ResultMessage queryDate(Integer organizationId){
+ //������������������
+ List<Date> dates = historySecondUavService.queryDate(organizationId);
+ //������vo���
+ UAVQueryDateVO vo = UAVQueryDateVO.convert(dates);
+ //������������
+ 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);
+ if (ObjectUtils.isEmpty(dtos)){
+ return new ResultMessage(ResponseCodeEnum.TARGET_IS_NULL,null);
+ }
+ //������vo���
+ UAVQueryTimeSlotVOs vo = UAVQueryTimeSlotVOs.convert(dtos);
+
+ //������������
+ return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(),vo);
+ }
+
+
}
--
Gitblit v1.8.0