diff --git a/bonus-business/pom.xml b/bonus-business/pom.xml index 8032a68..ad1626a 100644 --- a/bonus-business/pom.xml +++ b/bonus-business/pom.xml @@ -16,6 +16,19 @@ + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + org.springframework.boot diff --git a/bonus-business/src/main/java/com/bonus/BonusBusinessApplication.java b/bonus-business/src/main/java/com/bonus/BonusBusinessApplication.java index 64d0308..458320d 100644 --- a/bonus-business/src/main/java/com/bonus/BonusBusinessApplication.java +++ b/bonus-business/src/main/java/com/bonus/BonusBusinessApplication.java @@ -3,12 +3,14 @@ package com.bonus; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; /** * 启动程序 * * @author ruoyi */ +@EnableDiscoveryClient @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) public class BonusBusinessApplication { diff --git a/bonus-business/src/main/java/com/bonus/business/robot/util/QxUtils.java b/bonus-business/src/main/java/com/bonus/business/robot/util/QxUtils.java index 50907a2..f36c8eb 100644 --- a/bonus-business/src/main/java/com/bonus/business/robot/util/QxUtils.java +++ b/bonus-business/src/main/java/com/bonus/business/robot/util/QxUtils.java @@ -116,7 +116,7 @@ public class QxUtils { try{ builder.append(""); builder.append(""); - builder.append(""); + builder.append(""); builder.append(""); builder.append(""); builder.append(""); @@ -141,7 +141,7 @@ public class QxUtils { builder.append("").append(""); } diff --git a/bonus-business/src/main/java/com/bonus/business/service/impl/RobotServiceImpl.java b/bonus-business/src/main/java/com/bonus/business/service/impl/RobotServiceImpl.java index b9ed543..ac91d12 100644 --- a/bonus-business/src/main/java/com/bonus/business/service/impl/RobotServiceImpl.java +++ b/bonus-business/src/main/java/com/bonus/business/service/impl/RobotServiceImpl.java @@ -337,15 +337,7 @@ public class RobotServiceImpl implements IRobotService { public AjaxResult issuedTask(PatrolTask vo) { try{ String token=QxVideotape.login(TVideoConfigUtil.getMaps(),TVideoConfigUtil.Q2HTTPURL); - String xml2= QxUtils.getParamData(XxmSendUtils.QUERY,XxmSendUtils.ROBOT_TASK_LIST); - String res2=QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,vo.getPuid(),xml2); - JSONArray array= XmlUtils.getRobotTask(res2); - List list2= JSONArray.parseArray(array.toString(),PatrolTask.class); - RobotTask vo2=new RobotTask(); - vo2.setPatrolTasks(list2); - String data= QxUtils.setRobotInspection(XxmSendUtils.SET,XxmSendUtils.ROBOT_TASK_LIST,vo2); - String res3=QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,vo.getPuid(),data); - // mapper.updateTaskStatus(vo); + // mapper.updateTaskStatus(vo); //下发任务 RobotTask robotTask=new RobotTask(); //进行任务查询 diff --git a/bonus-business/src/main/resources/application-druid.yml b/bonus-business/src/main/resources/application-druid.yml index f718fd9..b14692f 100644 --- a/bonus-business/src/main/resources/application-druid.yml +++ b/bonus-business/src/main/resources/application-druid.yml @@ -1,5 +1,15 @@ # 数据源配置 spring: + application: + name: bonus-robot + cloud: + nacos: + username: nacos + password: Jjsp@nacos2023 + discovery: + server-addr: 127.0.0.1:18848 + namespace: robot + datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver diff --git a/bonus-framework/src/main/java/com/bonus/framework/config/SecurityConfig.java b/bonus-framework/src/main/java/com/bonus/framework/config/SecurityConfig.java index 21034d8..d063665 100644 --- a/bonus-framework/src/main/java/com/bonus/framework/config/SecurityConfig.java +++ b/bonus-framework/src/main/java/com/bonus/framework/config/SecurityConfig.java @@ -111,7 +111,7 @@ public class SecurityConfig .authorizeHttpRequests((requests) -> { permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll()); // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - requests.antMatchers("/login", "/register","/getToken", "/captchaImage").permitAll() + requests.antMatchers("/login", "/register","/getToken","/**", "/captchaImage").permitAll() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/robot/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() diff --git a/bonus-system/src/main/java/com/bonus/system/service/impl/SysConfigServiceImpl.java b/bonus-system/src/main/java/com/bonus/system/service/impl/SysConfigServiceImpl.java index c1aa792..816affc 100644 --- a/bonus-system/src/main/java/com/bonus/system/service/impl/SysConfigServiceImpl.java +++ b/bonus-system/src/main/java/com/bonus/system/service/impl/SysConfigServiceImpl.java @@ -34,7 +34,7 @@ public class SysConfigServiceImpl implements ISysConfigService /** * 项目启动时,初始化参数到缓存 */ - @PostConstruct + // @PostConstruct public void init() { loadingConfigCache(); diff --git a/bonus-system/src/main/java/com/bonus/system/service/impl/SysDictTypeServiceImpl.java b/bonus-system/src/main/java/com/bonus/system/service/impl/SysDictTypeServiceImpl.java index 0d6d06a..4d381ef 100644 --- a/bonus-system/src/main/java/com/bonus/system/service/impl/SysDictTypeServiceImpl.java +++ b/bonus-system/src/main/java/com/bonus/system/service/impl/SysDictTypeServiceImpl.java @@ -35,7 +35,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService /** * 项目启动时,初始化字典到缓存 */ - @PostConstruct + // @PostConstruct public void init() { loadingDictCache(); diff --git a/pom.xml b/pom.xml index 1af398f..90d593b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,15 +3,18 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + com.bonus bonus-robot 3.8.9 - ruoyi http://www.ruoyi.vip 若依管理系统 - + + org.springframework.boot + spring-boot-starter-parent + 2.7.18 + 3.8.9 UTF-8 @@ -35,12 +38,31 @@ 1.2.13 5.7.12 5.3.39 + 2021.0.4 + 2021.0.4.0 + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + com.alibaba.cloud + spring-cloud-alibaba-dependencies + ${spring-cloud-alibaba.version} + pom + import + org.springframework