修改机器人接口
This commit is contained in:
parent
e1b9bc06df
commit
5559f732c6
|
|
@ -21,24 +21,24 @@
|
||||||
<version>5.3.2</version>
|
<version>5.3.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- SpringCloud Alibaba Nacos -->
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Sentinel -->
|
<!-- <!– SpringCloud Alibaba Sentinel –>-->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
<!-- <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
|
|
||||||
<!-- spring-boot-devtools -->
|
<!-- spring-boot-devtools -->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>org.springframework.boot</groupId>
|
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||||
<artifactId>spring-boot-devtools</artifactId>
|
<!-- <artifactId>spring-boot-devtools</artifactId>-->
|
||||||
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
<!-- <optional>true</optional> <!– 表示依赖不会传递 –>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
|
|
||||||
<!-- swagger3-->
|
<!-- swagger3-->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ package com.bonus;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -12,7 +11,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
@EnableDiscoveryClient
|
//@EnableDiscoveryClient
|
||||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||||
public class BonusBusinessApplication
|
public class BonusBusinessApplication
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ public class RobotController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询录音文件
|
* 删除录音文件
|
||||||
* @param vo
|
* @param vo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,11 @@ public class XxmSendUtils {
|
||||||
*/
|
*/
|
||||||
public static String ROBOT_MAP_STOP="C_ST_RobotStopBase";
|
public static String ROBOT_MAP_STOP="C_ST_RobotStopBase";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全部停止
|
||||||
|
*/
|
||||||
|
public static String ROBOT_ALL_STOP="C_ST_RobotStop";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 机器人-前往充电桩
|
* 机器人-前往充电桩
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -192,9 +192,7 @@ public class RobotEventXmlServiceImpl implements IRobotEventXmlService {
|
||||||
String res= QxVideotape.sendDevicePost(token, TVideoConfigUtil.Q2HTTPURL,puid,xml);
|
String res= QxVideotape.sendDevicePost(token, TVideoConfigUtil.Q2HTTPURL,puid,xml);
|
||||||
Map<String,String> map= XmlUtils.getRobotTaskImage(res);
|
Map<String,String> map= XmlUtils.getRobotTaskImage(res);
|
||||||
// 上传文件路径-配置生成
|
// 上传文件路径-配置生成
|
||||||
String dateTimeNow=DateUtils.dateTimeNow();
|
|
||||||
long millis=System.currentTimeMillis();
|
|
||||||
String filePath = RuoYiConfig.getUploadPath();
|
|
||||||
String url=map.get("url").split("\\?")[0];
|
String url=map.get("url").split("\\?")[0];
|
||||||
String lastPath=fileService.uploadFile(url,"task");
|
String lastPath=fileService.uploadFile(url,"task");
|
||||||
//生成图路径
|
//生成图路径
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,7 @@ public class RobotServiceImpl implements IRobotService {
|
||||||
return AjaxResult.success(XmlUtils.getSuccess(res));
|
return AjaxResult.success(XmlUtils.getSuccess(res));
|
||||||
}else if("9".equals(robotVo.getType())){
|
}else if("9".equals(robotVo.getType())){
|
||||||
//机器人 停止
|
//机器人 停止
|
||||||
String xml= QxUtils.getParamData(XxmSendUtils.CONTROLLER,XxmSendUtils.ROBOT_MAP_STOP);
|
String xml= QxUtils.getParamData(XxmSendUtils.CONTROLLER,XxmSendUtils.ROBOT_ALL_STOP);
|
||||||
String res=QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,robotVo.getPuId(),xml);
|
String res=QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,robotVo.getPuId(),xml);
|
||||||
return AjaxResult.success(XmlUtils.getSuccess(res));
|
return AjaxResult.success(XmlUtils.getSuccess(res));
|
||||||
}else if("10".equals(robotVo.getType())){
|
}else if("10".equals(robotVo.getType())){
|
||||||
|
|
@ -360,6 +360,9 @@ public class RobotServiceImpl implements IRobotService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult addTasks(PatrolTask vo) {
|
public AjaxResult addTasks(PatrolTask vo) {
|
||||||
|
if(StringHelper.isNullOrEmptyString(vo.getRobotId())){
|
||||||
|
vo.setRobotId("BNS_ROBOT");
|
||||||
|
}
|
||||||
String uuid= UUID.randomUUID().toString().replaceAll("-","");
|
String uuid= UUID.randomUUID().toString().replaceAll("-","");
|
||||||
vo.setId(uuid);
|
vo.setId(uuid);
|
||||||
vo.setTaskStatus("0");
|
vo.setTaskStatus("0");
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.bonus.business.service.impl;
|
package com.bonus.business.service.impl;
|
||||||
|
|
||||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
|
||||||
import com.bonus.business.mapper.SbdUserMapper;
|
import com.bonus.business.mapper.SbdUserMapper;
|
||||||
import com.bonus.business.minio.FileServiceImpl;
|
import com.bonus.business.minio.FileServiceImpl;
|
||||||
import com.bonus.business.robot.util.IdUtils;
|
import com.bonus.business.robot.util.IdUtils;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
# 数据源配置
|
# 数据源配置
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: bonus-robot
|
name: sbdRobot
|
||||||
cloud:
|
# application:
|
||||||
nacos:
|
# name: bonus-robot
|
||||||
username: nacos
|
# cloud:
|
||||||
password: Jjsp@nacos2023
|
# nacos:
|
||||||
discovery:
|
# username: nacos
|
||||||
server-addr: 127.0.0.1:18848
|
# password: Jjsp@nacos2023
|
||||||
namespace: robot
|
# discovery:
|
||||||
|
# server-addr: 127.0.0.1:18848
|
||||||
|
# namespace: robot
|
||||||
datasource:
|
datasource:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
|
@ -18,10 +20,14 @@ spring:
|
||||||
# url: jdbc:mysql://192.168.0.14:4417/sbd_robot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
# url: jdbc:mysql://192.168.0.14:4417/sbd_robot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
# username: root
|
# username: root
|
||||||
# password: Bonus@admin123!
|
# password: Bonus@admin123!
|
||||||
|
# master:
|
||||||
|
# url: jdbc:mysql://127.0.0.1:3306/sbd_robot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
|
# username: mroot
|
||||||
|
# password: bonus@admin123
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/sbd_robot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://127.0.0.1:23306/wunan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: mroot
|
username: root
|
||||||
password: bonus@admin123
|
password: youotech123#
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
|
@ -79,7 +85,7 @@ spring:
|
||||||
# secretKey: bonus@admin123
|
# secretKey: bonus@admin123
|
||||||
# bucketName: robot
|
# bucketName: robot
|
||||||
minio:
|
minio:
|
||||||
endpoint: http://192.168.0.14:9090
|
endpoint: http://10.138.55.114:9000
|
||||||
accessKey: minio
|
accessKey: minioadmin
|
||||||
secretKey: bonus@admin123
|
secretKey: minioadmin
|
||||||
bucketName: robot
|
bucketName: robot
|
||||||
|
|
@ -7,7 +7,7 @@ ruoyi:
|
||||||
# 版权年份
|
# 版权年份
|
||||||
copyrightYear: 2025
|
copyrightYear: 2025
|
||||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||||
profile: F:/Files/robot/upload
|
profile: D:/files/upload
|
||||||
# 获取ip地址开关
|
# 获取ip地址开关
|
||||||
addressEnabled: false
|
addressEnabled: false
|
||||||
# 验证码类型 math 数字计算 char 字符验证
|
# 验证码类型 math 数字计算 char 字符验证
|
||||||
|
|
@ -19,7 +19,7 @@ server:
|
||||||
port: 58080
|
port: 58080
|
||||||
servlet:
|
servlet:
|
||||||
# 应用的访问路径
|
# 应用的访问路径
|
||||||
context-path: /
|
context-path: /sbdRobot
|
||||||
tomcat:
|
tomcat:
|
||||||
# tomcat的URI编码
|
# tomcat的URI编码
|
||||||
uri-encoding: UTF-8
|
uri-encoding: UTF-8
|
||||||
|
|
@ -73,6 +73,7 @@ spring:
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: 7
|
database: 7
|
||||||
|
password: youotech123#
|
||||||
# 密码
|
# 密码
|
||||||
# password: Xbzbns@Redis123!
|
# password: Xbzbns@Redis123!
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ public class AuthWriteUtils {
|
||||||
public static List<String> getWriteUrl(){
|
public static List<String> getWriteUrl(){
|
||||||
List<String> whiteUrl=new ArrayList<>();
|
List<String> whiteUrl=new ArrayList<>();
|
||||||
whiteUrl.add("/robot/push/**");
|
whiteUrl.add("/robot/push/**");
|
||||||
|
whiteUrl.add("/sbdRobot/robot/push/**");
|
||||||
return whiteUrl;
|
return whiteUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,20 @@ import static com.bonus.framework.security.filter.JwtUtils.parseToken;
|
||||||
@Component
|
@Component
|
||||||
public class SbdUserJwtTokenFilter implements HandlerInterceptor {
|
public class SbdUserJwtTokenFilter implements HandlerInterceptor {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String uri="/sbdRobot/robot/push/xmlAnalysis";
|
||||||
|
System.err.println(uri);
|
||||||
|
if (StringUtils.matches(uri, AuthWriteUtils.getWriteUrl())) {
|
||||||
|
System.err.println(1);
|
||||||
|
}else{
|
||||||
|
System.err.println(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||||
String uri=request.getRequestURI();
|
String uri=request.getRequestURI();
|
||||||
|
System.err.println(uri);
|
||||||
if (StringUtils.matches(uri, AuthWriteUtils.getWriteUrl())) {
|
if (StringUtils.matches(uri, AuthWriteUtils.getWriteUrl())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
30
pom.xml
30
pom.xml
|
|
@ -47,22 +47,22 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- Nacos Discovery -->
|
<!-- Nacos Discovery -->
|
||||||
<!-- SpringCloud 微服务 -->
|
<!-- SpringCloud 微服务 -->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<!-- <groupId>org.springframework.cloud</groupId>-->
|
||||||
<artifactId>spring-cloud-dependencies</artifactId>
|
<!-- <artifactId>spring-cloud-dependencies</artifactId>-->
|
||||||
<version>${spring-cloud.version}</version>
|
<!-- <version>${spring-cloud.version}</version>-->
|
||||||
<type>pom</type>
|
<!-- <type>pom</type>-->
|
||||||
<scope>import</scope>
|
<!-- <scope>import</scope>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba 微服务 -->
|
<!-- <!– SpringCloud Alibaba 微服务 –>-->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
<!-- <artifactId>spring-cloud-alibaba-dependencies</artifactId>-->
|
||||||
<version>${spring-cloud-alibaba.version}</version>
|
<!-- <version>${spring-cloud-alibaba.version}</version>-->
|
||||||
<type>pom</type>
|
<!-- <type>pom</type>-->
|
||||||
<scope>import</scope>
|
<!-- <scope>import</scope>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<!-- 覆盖SpringFramework的依赖配置-->
|
<!-- 覆盖SpringFramework的依赖配置-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue