From eeb2f0d89dfcbaf29fb54eed2f5046534dd5b5e6 Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Wed, 06 Sep 2023 14:20:52 +0800
Subject: [PATCH] chore:测试提交
---
screen-api/src/main/java/com/moral/api/service/impl/DustldServiceImpl.java | 14 +++++++++-----
screen-manage/src/main/java/com/moral/api/service/ManageCoordinateService.java | 2 +-
screen-api/src/main/java/com/moral/api/controller/CruiserController.java | 4 ++++
screen-manage/src/main/java/com/moral/api/controller/ManageCoordinateController.java | 10 +++-------
screen-manage/src/main/java/com/moral/api/service/impl/ManageCoordinateServiceImpl.java | 22 ++++++++++++++++------
5 files changed, 33 insertions(+), 19 deletions(-)
diff --git a/screen-api/src/main/java/com/moral/api/controller/CruiserController.java b/screen-api/src/main/java/com/moral/api/controller/CruiserController.java
index 6d20e73..40b248a 100644
--- a/screen-api/src/main/java/com/moral/api/controller/CruiserController.java
+++ b/screen-api/src/main/java/com/moral/api/controller/CruiserController.java
@@ -6,6 +6,7 @@
import com.deepoove.poi.data.TextRenderData;
import com.moral.api.pojo.dto.historySecondCruiser.HistorySecondCruiserResultDTO;
+import cn.afterturn.easypoi.exception.word.WordExportException;
import cn.afterturn.easypoi.word.WordExportUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -36,6 +37,7 @@
import java.util.List;
import java.util.Map;
+import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -348,7 +350,9 @@
map.put("table2", new MiniTableRenderData(header2, rsList2));
map.put("data",params.get("data").toString());
map.put("time",params.get("time").toString());
+
compile.render(map);
+// compile.write(new FileOutptStream("���������������������"+paramsu.get("time").toString()+".docx"));
compile.writeToFile("G:\\home\\mon1\\" + "���������������������"+params.get("time").toString()+".docx");
compile.close();
}
diff --git a/screen-api/src/main/java/com/moral/api/service/impl/DustldServiceImpl.java b/screen-api/src/main/java/com/moral/api/service/impl/DustldServiceImpl.java
index 85a16fa..958d520 100644
--- a/screen-api/src/main/java/com/moral/api/service/impl/DustldServiceImpl.java
+++ b/screen-api/src/main/java/com/moral/api/service/impl/DustldServiceImpl.java
@@ -5,6 +5,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.system.ApplicationHome;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
@@ -275,6 +276,7 @@
private MaxRoadMapper maxRoadMapper;
@Override
+ @Transactional
public Map<String, Object> dailyDustlds(List<MultipartFile> file,Map<String, Object> params) {
Map<String, Object> userInfo = (Map<String, Object>) TokenUtils.getUserInfo();
@@ -336,12 +338,14 @@
if (ObjectUtils.isEmpty(doubleArrayList)){
continue;
}
+
Double ListAva = doubleArrayList.stream() .collect(Collectors.averagingDouble(Double::doubleValue));
double rsAvg = new BigDecimal(ListAva/1000).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
dustForm.setRoad(string);
dustForm.setValue(rsAvg);
if (rsAvg>=0.3){
builder.append("("+i+")"+string);
+ i++;
list1.add(dustForm);
//������������������
QueryWrapper<MaxRoad> wrapper = new QueryWrapper<>();
@@ -374,17 +378,17 @@
wrapper.lt("time",DateUtils.getDate(time1,DateUtils.yyyy_MM_dd_EN));
wrapper.orderByDesc("time");
- MaxRoad maxRoad = maxRoadMapper.selectOne(wrapper);
- String dateString3 = DateUtils.dateToDateString(maxRoad.getTime(), DateUtils.yyyy_MM_dd_CN);
+ List<MaxRoad> maxRoads = maxRoadMapper.selectList(wrapper);
+ String dateString3 = DateUtils.dateToDateString(maxRoads.get(0).getTime(), DateUtils.yyyy_MM_dd_CN);
QueryWrapper<MaxRoad> wrapper2 = new QueryWrapper<>();
- wrapper2.eq("time",maxRoad.getTime());
- List<MaxRoad> maxRoads = maxRoadMapper.selectList(wrapper2);
+ wrapper2.eq("time",maxRoads.get(0).getTime());
+ List<MaxRoad> maxRoads1 = maxRoadMapper.selectList(wrapper2);
//������������
ArrayList<DustForm> dustForms = new ArrayList<>();
dustForms.addAll(list1);
dustForms.addAll(list2);
- for (MaxRoad road : maxRoads) {
+ for (MaxRoad road : maxRoads1) {
for (DustForm dustForm : dustForms) {
if (road.getName().equals(dustForm.getRoad())){
HashMap<String, Object> map = new HashMap<>();
diff --git a/screen-manage/src/main/java/com/moral/api/controller/ManageCoordinateController.java b/screen-manage/src/main/java/com/moral/api/controller/ManageCoordinateController.java
index a546546..efb40b6 100644
--- a/screen-manage/src/main/java/com/moral/api/controller/ManageCoordinateController.java
+++ b/screen-manage/src/main/java/com/moral/api/controller/ManageCoordinateController.java
@@ -43,7 +43,7 @@
*/
@PostMapping("interCruiserRoad")
public ResultMessage interCruiserRoad(@RequestBody Map<String,Object> params){
- if (!params.containsKey("startPoint") || !params.containsKey("endPoint")) {
+ if (!params.containsKey("startPoint") || !params.containsKey("mac")) {
return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
}
Integer integer = manageCoordinateService.interCoordinate(params);
@@ -89,12 +89,8 @@
* @return
*/
@GetMapping("selectCruiserRoad")
- public ResultMessage selectCruiser(){
- List<ManageCoordinate> manageCoordinates = manageCoordinateService.selectCoordinate();
- if (ObjectUtils.isEmpty(manageCoordinates)){
- return ResultMessage.fail(ResponseCodeEnum.TARGET_IS_NULL.getCode(),
- ResponseCodeEnum.TARGET_IS_NULL.getMsg());
- }
+ public ResultMessage selectCruiser(String name,String mac){
+ List<ManageCoordinate> manageCoordinates = manageCoordinateService.selectCoordinate(name,mac);
return ResultMessage.ok(manageCoordinates);
}
}
diff --git a/screen-manage/src/main/java/com/moral/api/service/ManageCoordinateService.java b/screen-manage/src/main/java/com/moral/api/service/ManageCoordinateService.java
index 7ce8b5f..3cac8e9 100644
--- a/screen-manage/src/main/java/com/moral/api/service/ManageCoordinateService.java
+++ b/screen-manage/src/main/java/com/moral/api/service/ManageCoordinateService.java
@@ -21,6 +21,6 @@
void deleteCoordinate(Integer id);
- List<ManageCoordinate> selectCoordinate();
+ List<ManageCoordinate> selectCoordinate(String name,String mac);
}
diff --git a/screen-manage/src/main/java/com/moral/api/service/impl/ManageCoordinateServiceImpl.java b/screen-manage/src/main/java/com/moral/api/service/impl/ManageCoordinateServiceImpl.java
index 0b79153..7139fb6 100644
--- a/screen-manage/src/main/java/com/moral/api/service/impl/ManageCoordinateServiceImpl.java
+++ b/screen-manage/src/main/java/com/moral/api/service/impl/ManageCoordinateServiceImpl.java
@@ -2,6 +2,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.List;
@@ -40,17 +41,14 @@
*/
@Override
public Integer interCoordinate(Map<String, Object> params) {
-// String mac = params.get("mac").toString();
- String mac ="p5dnd7a0243625";
+ String mac = params.get("mac").toString();
QueryWrapper<SpecialDevice> wrapper = new QueryWrapper<>();
wrapper.eq("mac",mac);
wrapper.eq("is_delete","0");
SpecialDevice specialDevice = specialDeviceMapper.selectOne(wrapper);
String startPoint = params.get("startPoint").toString();
- String endPoint = params.get("endPoint").toString();
QueryWrapper<ManageCoordinate> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("start_point",startPoint);
- queryWrapper.eq("end_point",endPoint);
Integer integer = manageCoordinateMapper.selectCount(queryWrapper);
if (integer>=1){
return null;
@@ -59,7 +57,6 @@
manageCoordinate.setCreateTime(new Date());
manageCoordinate.setUpdateTime(new Date());
manageCoordinate.setStartPoint(startPoint);
- manageCoordinate.setEndPoint(endPoint);
manageCoordinate.setIsDel(0);
manageCoordinate.setOrganizationId(specialDevice.getOrganizationId());
int code = manageCoordinateMapper.insert(manageCoordinate);
@@ -93,9 +90,22 @@
* @return
*/
@Override
- public List<ManageCoordinate> selectCoordinate() {
+ public List<ManageCoordinate> selectCoordinate(String name,String mac) {
+
QueryWrapper<ManageCoordinate> queryWrapper = new QueryWrapper<>();
+
+ if (!ObjectUtils.isEmpty(name)){
+ queryWrapper.like("start_point",name);
+ }
+ if(!ObjectUtils.isEmpty(mac)){
+ QueryWrapper<SpecialDevice> wrapper = new QueryWrapper<>();
+ wrapper.eq("mac",mac);
+ wrapper.eq("is_delete","0");
+ SpecialDevice specialDevice = specialDeviceMapper.selectOne(wrapper);
+ queryWrapper.eq("organization_id",specialDevice.getOrganizationId());
+ }
queryWrapper.eq("is_del",0);
+ queryWrapper.orderByDesc("coordinate_id");
List<ManageCoordinate> manageCoordinates = manageCoordinateMapper.selectList(queryWrapper);
return manageCoordinates;
}
--
Gitblit v1.8.0