From d4c8d478007e72916a92516c42338ed0d9a84f58 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期四, 02 十一月 2023 17:30:30 +0800
Subject: [PATCH] 清淤
---
ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java | 14 ++++
ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessNum.java | 6 +-
ard-work/src/main/java/com/ruoyi/utils/forest/SYClient.java | 2
ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java | 19 ++++++
ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java | 12 ++-
ard-work/src/main/java/com/ruoyi/sy/service/ArdSyCarLockService.java | 5 +
ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessNumServiceImpl.java | 14 +++-
ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessFence.java | 3
ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessNumService.java | 4
ard-work/src/main/java/com/ruoyi/sy/vo/CarVo.java | 1
ard-work/src/main/java/com/ruoyi/sy/controller/OilWallController.java | 2
ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessFenceService.java | 5 +
ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessFenceServiceImpl.java | 18 ++++++
ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java | 2
ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java | 56 ++++++++++++------
ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java | 12 ++++
16 files changed, 141 insertions(+), 34 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
index 2e7b366..a68a2e4 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
@@ -5,6 +5,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
+import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
@@ -389,4 +390,22 @@
String time = map.get("time");
return ardSyCarService.getExistTraceByCarIdAndMonth(userId,carId,time);
}
+
+ @GetMapping("getCarPicture")
+ @ApiOperation("娓呮筏鑾峰彇鐓х墖")
+ public AjaxResult getCarNearPositionByCarId(String carId){
+ String usersId = SecurityUtils.getUserId();
+ ArdSyUser ardSyUser = iArdSyUserService.userById(usersId);
+ String syURL = sysConfigService.getSYURL();
+ Map<String, Object> result = ardSyCarService.getCarPicture(carId,syURL,ardSyUser);
+ String vs = "";
+ try {
+ Map<String,Object> map = ((List<Map<String,Object>>)result.get("list")).get(0);
+ Map<String, Object> videos = (Map<String, Object>) JSON.parse((String) map.get("videos"));
+ vs = (String) videos.get("vs");
+ } catch (Exception e) {
+ return AjaxResult.error("璇ヨ溅杈嗘病鏈夋憚鍍忛�氶亾鏃犵収鐗囨暟鎹紒");
+ }
+ return AjaxResult.success(vs);
+ }
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java
index fc95160..c73e34b 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java
@@ -135,6 +135,44 @@
return Results.succeed("鎴愬姛淇敼"+ardSyCarLockService.updRtuCar(ardSyCarRtu)+"鏉℃暟鎹�");
}
+ @GetMapping("/queryCar")
+ @ApiOperation("娓呮筏鎵嬪姩娣诲姞杞﹁締鏌ヨ")
+ public AjaxResult queryCar(){
+ List<ArdAccessFence> ardAccessFences = ardAccessFenceService.all();
+ List<String> carIdList = new ArrayList<>();
+ for (int i = 0; i < ardAccessFences.size(); i++) {
+ String carId = ardAccessFences.get(i).getCarId();
+ carIdList.add(carId);
+ }
+ List<CarVo> list = ardSyCarLockService.queryCar(carIdList);
+ analysis(list);
+ return AjaxResult.success(list);
+ }
+
+ @PostMapping("/addCar")
+ @ApiOperation("娓呮筏鎵嬪姩娣诲姞杞﹁締淇濆瓨")
+ public AjaxResult addCar(String carId){
+ List<CarVo> list = ardSyCarLockService.addCarBefore(carId);
+ analysis(list);
+ if(list.size()>0){
+ return AjaxResult.success(ardAccessFenceService.addCar(list.get(0)));
+ }
+ return AjaxResult.success();
+ }
+
+ @DeleteMapping("/delCar")
+ @ApiOperation("娓呮筏鎵嬪姩娣诲姞杞﹁締鍒犻櫎")
+ public AjaxResult delCar(String id){
+ return AjaxResult.success(ardAccessFenceService.delCar(id));
+ }
+
+ @PutMapping("/addCar")
+ @ApiOperation("娓呯┖鎶ヨ")
+ public AjaxResult updCarAlarm(String id){
+ return AjaxResult.success(ardAccessFenceService.updCarAlarm(id));
+ }
+
+ //鑾峰彇31杞﹁締杞︾墝鍙烽┚椹跺憳鍜岀數璇�
public List<CarVo> analysis(List<CarVo> list){
String usersId = SecurityUtils.getUserId();
ArdSyUser ardSyUser = iArdSyUserService.userById(usersId);
@@ -156,23 +194,5 @@
return list;
}
- @GetMapping("/addCar")
- @ApiOperation("娓呮筏鎵嬪姩娣诲姞杞﹁締鏌ヨ")
- public AjaxResult queryCar(){
- List<ArdAccessFence> ardAccessFences = ardAccessFenceService.all();
- List<String> carIdList = new ArrayList<>();
- for (int i = 0; i < ardAccessFences.size(); i++) {
- String carId = ardAccessFences.get(i).getCarId();
- carIdList.add(carId);
- }
- List<CarVo> list = ardSyCarLockService.queryCar(carIdList);
- analysis(list);
- return AjaxResult.success(list);
- }
- @PostMapping("/addCar")
- @ApiOperation("娓呮筏鎵嬪姩娣诲姞杞﹁締淇濆瓨")
- public AjaxResult queryCar(@RequestBody CarVo carVo){
- return AjaxResult.success(ardAccessFenceService.addCar(carVo));
- }
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/controller/OilWallController.java b/ard-work/src/main/java/com/ruoyi/sy/controller/OilWallController.java
index 56f7333..79ba2c3 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/controller/OilWallController.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/controller/OilWallController.java
@@ -98,7 +98,7 @@
@PostMapping("/updTime")
@ApiOperation("淇濆瓨鏃堕棿姝ラ暱")
public AjaxResult updTime(@RequestBody ArdAccessNum ardAccessNum){
- return AjaxResult.success(ardAccessNumService.add(ardAccessNum));
+ return AjaxResult.success(ardAccessNumService.upd(ardAccessNum));
}
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessFence.java b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessFence.java
index 4615aa5..c3dd83c 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessFence.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessFence.java
@@ -21,8 +21,9 @@
private String outShipmentId;
private String outShipmentTime;
private String lastTime;
- private String isWarning;
+ private Integer isWarning;
private String nowWallName;
private String alarmLng;
private String alarmLat;
+ private String carModel;
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessNum.java b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessNum.java
index e266ef9..1a9792e 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessNum.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessNum.java
@@ -7,7 +7,7 @@
*/
@Data
public class ArdAccessNum {
- private int carousel;
- private int call;
- private int alarm;
+ private int carousel = 0;
+ private int call = 0;
+ private int alarm = 0;
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java b/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java
index 71b2c3e..011952a 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java
@@ -90,6 +90,7 @@
String time = (String) gpsMap.get("result");//瀹氫綅鏃堕棿
String deptNum = (String) result.get("deptId").toString();//鑾峰彇閮ㄩ棬ID
String deptName = (String) result.get("deptName");//鑾峰彇閮ㄩ棬鍚嶇О
+ String carModel = (String) result.get("carModel");//鑾峰彇杞﹁締妯″瀷
//瀹氫箟2缁寸┖闂�
Point2D.Double point = new Point2D.Double(Double.parseDouble(lng), Double.parseDouble(lat));
List<Point2D.Double> pts = new ArrayList<Point2D.Double>();
@@ -121,6 +122,8 @@
ardAccessFence1.setLat(lat);
ardAccessFence1.setLastTime(time);
ardAccessFence1.setNowWallName(ardOilWall.getName());
+ ardAccessFence1.setCarModel(carModel);
+ ardAccessFence1.setIsWarning(0);
((ArdAccessFenceServiceImpl)SpringUtils.getBean("ArdAccessFenceServiceImpl")).access(ardAccessFence1);
break;
}
@@ -200,6 +203,7 @@
}
}
if(isRoad){
+ ardAccessFence.setNowWallName(null);
//濡傛灉鍦ㄨ矾涓婂垽鏂潗鏍囨槸鍚︿笌涓婃涓�鏍�
if(ardAccessFence.getLng().equals(lng) && ardAccessFence.getLat().equals(lat)){
//濡傛灉鍧愭爣涓�鏍锋椂闂寸浉鍑�
@@ -207,11 +211,11 @@
Date nowTime = sdf.parse(time);
Date lastTime = sdf.parse(ardAccessFence.getLastTime());
Long diff = (nowTime.getTime() - lastTime.getTime())/1000;
- List<ArdAccessNum> list = ((ArdAccessNumServiceImpl) SpringUtils.getBean("ArdAccessNumServiceImpl")).queryNum();
- if(list.size()>0){
- int alarm = list.get(0).getAlarm();
+ ArdAccessNum list = ((ArdAccessNumServiceImpl) SpringUtils.getBean("ArdAccessNumServiceImpl")).queryNum();
+ if(list==null){
+ int alarm = list.getAlarm();
if(diff>=alarm){
- ardAccessFence.setIsWarning("1");
+ ardAccessFence.setIsWarning(1);
ardAccessFence.setAlarmLat(lat);
ardAccessFence.setAlarmLng(lng);
((ArdAccessFenceServiceImpl) SpringUtils.getBean("ArdAccessFenceServiceImpl")).updAccess(ardAccessFence);
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessFenceService.java b/ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessFenceService.java
index 8d752cd..b6c6024 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessFenceService.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessFenceService.java
@@ -1,6 +1,7 @@
package com.ruoyi.sy.service;
import com.ruoyi.sy.domain.ArdAccessFence;
+import com.ruoyi.sy.domain.ArdSyCar;
import com.ruoyi.sy.param.OilWallParam;
import com.ruoyi.sy.vo.CarVo;
@@ -18,5 +19,9 @@
List<ArdAccessFence> all();
+ int delCar(String id);
+
+ int updCarAlarm(String id);
+
int addCar(CarVo carVo);
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessNumService.java b/ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessNumService.java
index 316b89f..d075917 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessNumService.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessNumService.java
@@ -6,7 +6,7 @@
public interface ArdAccessNumService {
- List<ArdAccessNum> queryNum();
+ ArdAccessNum queryNum();
- int add(ArdAccessNum ardAccessNum);
+ int upd(ArdAccessNum ardAccessNum);
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/ArdSyCarLockService.java b/ard-work/src/main/java/com/ruoyi/sy/service/ArdSyCarLockService.java
index 841ea2b..df4d06e 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/ArdSyCarLockService.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/ArdSyCarLockService.java
@@ -1,6 +1,7 @@
package com.ruoyi.sy.service;
import com.ruoyi.sy.domain.ArdAccessFence;
+import com.ruoyi.sy.domain.ArdSyCar;
import com.ruoyi.sy.domain.ArdSyCarLock;
import com.ruoyi.sy.domain.ArdSyCarRtu;
import com.ruoyi.sy.vo.CarLockVo;
@@ -36,4 +37,8 @@
List<CarVo> queryCar(List<String> list);
+ List<CarVo> addCarBefore(String id);
+
+
+
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java b/ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java
index 566a64f..447814c 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java
@@ -128,6 +128,8 @@
Results getCarGPSBycarId(String usersId, String carId, String syURL, ArdSyUser ardSyUser);
+ Map<String, Object> getCarPicture(String carId, String syURL, ArdSyUser ardSyUser);
+
/**
* 鏍规嵁鐢ㄦ埛鍙婅溅杈嗕富閿拷韪溅杈�
*/
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessFenceServiceImpl.java b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessFenceServiceImpl.java
index 1f53ad3..54d03ed 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessFenceServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessFenceServiceImpl.java
@@ -2,7 +2,9 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.sy.domain.ArdAccessFence;
+import com.ruoyi.sy.domain.ArdSyCar;
import com.ruoyi.sy.mapper.ArdAccessFenceMapper;
+import com.ruoyi.sy.mapper.ArdSyCarMapper;
import com.ruoyi.sy.param.OilWallParam;
import com.ruoyi.sy.service.ArdAccessFenceService;
import com.ruoyi.sy.vo.CarVo;
@@ -17,6 +19,8 @@
@Autowired
private ArdAccessFenceMapper ardAccessFenceMapper;
+ @Autowired
+ private ArdSyCarMapper carMapper;
@Override
public int access(ArdAccessFence ardAccessFence) {
@@ -56,6 +60,18 @@
}
@Override
+ public int delCar(String id) {
+ return ardAccessFenceMapper.deleteById(id);
+ }
+
+ @Override
+ public int updCarAlarm(String id) {
+ ArdAccessFence ardAccessFence = ardAccessFenceMapper.selectById(id);
+ ardAccessFence.setIsWarning(0);
+ return ardAccessFenceMapper.updateById(ardAccessFence);
+ }
+
+ @Override
public int addCar(CarVo carVo) {
ArdAccessFence ardAccessFence = new ArdAccessFence();
ardAccessFence.setId(String.valueOf(UUID.randomUUID()));
@@ -63,6 +79,8 @@
ardAccessFence.setCarName(carVo.getCarPlate());
ardAccessFence.setDeptId(carVo.getDeptId());
ardAccessFence.setDeptName(carVo.getDeptName());
+ ardAccessFence.setCarModel(carVo.getCarModel());
+ ardAccessFence.setIsWarning(0);
return ardAccessFenceMapper.insert(ardAccessFence);
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessNumServiceImpl.java b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessNumServiceImpl.java
index d799a92..06ccf47 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessNumServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessNumServiceImpl.java
@@ -15,12 +15,18 @@
private ArdAccessNumMapper ardAccessNumMapper;
@Override
- public List<ArdAccessNum> queryNum() {
- return ardAccessNumMapper.selectList(null);
+ public ArdAccessNum queryNum() {
+ List<ArdAccessNum> list = ardAccessNumMapper.selectList(null);
+ if(list.size()>0){
+ return list.get(0);
+ }else {
+ ArdAccessNum ardAccessNum = new ArdAccessNum();
+ return ardAccessNum;
+ }
}
@Override
- public int add(ArdAccessNum ardAccessNum) {
- return ardAccessNumMapper.insert(ardAccessNum);
+ public int upd(ArdAccessNum ardAccessNum) {
+ return ardAccessNumMapper.update(ardAccessNum,null);
}
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java
index 9b0600d..f16e24a 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java
@@ -166,12 +166,23 @@
@Override
public List<CarVo> queryCar(List<String> list) {
QueryWrapper<ArdSyCar> queryWrapper = new QueryWrapper<>();
- queryWrapper.ne("reserved_1","").ne("car_id",list);
+ queryWrapper.ne("reserved_1","").notIn("car_id",list);
List<ArdSyCar> ardSyCars = ardSyCarMapper.selectList(queryWrapper);
return carAnalysis(ardSyCars);
}
+ @Override
+ public List<CarVo> addCarBefore(String id) {
+ QueryWrapper<ArdSyCar> ardSyCarQueryWrapper = new QueryWrapper<>();
+ ardSyCarQueryWrapper.eq("car_id",id);
+ List<ArdSyCar> carList = ardSyCarMapper.selectList(ardSyCarQueryWrapper);
+ return carAnalysis(carList);
+ }
+
+
+
+ //杞﹁締鍒楄〃灏佽
public List<CarVo> carAnalysis(List<ArdSyCar> ardSyCars){
List<CarVo> list = new ArrayList<>();
for (int i = 0; i < ardSyCars.size(); i++) {
@@ -184,6 +195,7 @@
SysDept sysDept = sysDeptMapper.selectById(ardSyCar.getDeptId());
carVo.setDeptName(sysDept.getDeptName());
carVo.setRtu(ardSyCar.getReserved1());
+ carVo.setCarModel(ardSyCar.getCarModel());
list.add(carVo);
}
return list;
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
index 479655e..f0133ad 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
@@ -796,6 +796,18 @@
}
@Override
+ public Map<String, Object> getCarPicture(String carId, String syURL, ArdSyUser ardSyUser) {
+ //31鐢ㄦ埛鍚嶅瘑鐮�
+ String username31 = ardSyUser.getUserId();
+ String password31 = ardSyUser.getPassword();
+ String passwordMd5 = DigestUtils.md5Hex(password31);
+ Map<String, Object> result1 = sYClient.logIn(syURL, passwordMd5, username31);
+ Map<String, Object> result0 = new HashMap();
+ result0 = sYClient.getCarPicture(syURL, carId, (String) result1.get("sessionId"));
+ return result0;
+ }
+
+ @Override
public Results chaseCarByCarId(String usersId, String carId, String cycle) {
try {
/*Map<String,Map<String,Object>> map = new HashMap();
diff --git a/ard-work/src/main/java/com/ruoyi/sy/vo/CarVo.java b/ard-work/src/main/java/com/ruoyi/sy/vo/CarVo.java
index b448f73..47eba1b 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/vo/CarVo.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/vo/CarVo.java
@@ -9,6 +9,7 @@
public class CarVo {
private String carId;
private String carPlate;
+ private String carModel;
private String drvName;
private String drvPhone;
private String carType;
diff --git a/ard-work/src/main/java/com/ruoyi/utils/forest/SYClient.java b/ard-work/src/main/java/com/ruoyi/utils/forest/SYClient.java
index b070074..16076fe 100644
--- a/ard-work/src/main/java/com/ruoyi/utils/forest/SYClient.java
+++ b/ard-work/src/main/java/com/ruoyi/utils/forest/SYClient.java
@@ -27,4 +27,6 @@
@Get(url = "${syURL}/gps-web/api/get_gps_r.jsp?teamId=&carIds=${carId}&simple=false&userId=${userId}&loginType=user&loginWay=interface&loginLang=zh_CN&appDevId=&appId=android&sessionId=${sessionId}")
Map<String,Object> getCarNearPositionByCarId(@Var("syURL") String syURL, @Var("carId") String carId, @Var("userId") String userId,@Var("sessionId") String sessionId);
+ @Get(url = "${syURL}/gps-web/api/get_car_list.jsp?carIds=${carId}&detail=true&sessionId=${sessionId}")
+ Map<String,Object> getCarPicture(@Var("syURL") String syURL, @Var("carId") String carId,@Var("sessionId") String sessionId);
}
--
Gitblit v1.9.3