Browse Source

市北5个站采集程序

dev-shibei
yj 1 year ago
parent
commit
534049f6ee
  1. 20
      device_cars/src/main/java/com/xr/device_car/modules/analysis/controller/MeterConfigController.java
  2. 1
      device_cars/src/main/java/com/xr/device_car/modules/analysis/controller/MeterReadController.java
  3. 4
      device_cars/src/main/java/com/xr/device_car/modules/analysis/entity/MeterConfig.java
  4. 4
      device_cars/src/main/resources/application-dev.yml
  5. 4
      device_cars/src/main/resources/application-prod.yml
  6. 2
      device_cars/src/main/resources/modules/analysis/MeterConfigMapper.xml
  7. 3
      device_gather/src/main/java/com/xr/device/common/configvalue/StaticProperties.java
  8. 5
      device_gather/src/main/java/com/xr/device/common/utils/StaticPropUtil.java
  9. 22
      device_gather/src/main/java/com/xr/device/common/utils/UploadUtil.java
  10. 2
      device_gather/src/main/java/com/xr/device/model/mapper/MeterConfigMapper.java
  11. 2
      device_gather/src/main/java/com/xr/device/model/service/MeterConfigService.java
  12. 4
      device_gather/src/main/java/com/xr/device/model/service/impl/MeterConfigServiceImpl.java
  13. 11
      device_gather/src/main/java/com/xr/device/schedule/GetMeterSchedule.java
  14. 6
      device_gather/src/main/resources/application-jcDev.yml
  15. 6
      device_gather/src/main/resources/application-jcProd.yml
  16. 82
      device_gather/src/main/resources/application-jiangcDev.yml
  17. 82
      device_gather/src/main/resources/application-jiangcProd.yml
  18. 82
      device_gather/src/main/resources/application-ppDev.yml
  19. 82
      device_gather/src/main/resources/application-ppProd.yml
  20. 82
      device_gather/src/main/resources/application-psDev.yml
  21. 82
      device_gather/src/main/resources/application-psProd.yml
  22. 82
      device_gather/src/main/resources/application-sbDev.yml
  23. 82
      device_gather/src/main/resources/application-sbProd.yml
  24. 2
      device_gather/src/main/resources/application.yml
  25. 2
      device_gather/src/main/resources/mapper/MeterConfigMapper.xml

20
device_cars/src/main/java/com/xr/device_car/modules/analysis/controller/MeterConfigController.java

@ -154,7 +154,7 @@ public class MeterConfigController {
UpdateWrapper<MeterConfig> updateWrapper=new UpdateWrapper<>(); UpdateWrapper<MeterConfig> updateWrapper=new UpdateWrapper<>();
updateWrapper.in("id",ids).set("status",status); updateWrapper.in("id",ids).set("status",status);
meterConfigService.update(null,updateWrapper); meterConfigService.update(null,updateWrapper);
scheduleSettingService.meterStart(ids,Integer.valueOf(status)); //scheduleSettingService.meterStart(ids,Integer.valueOf(status));
return Result.OK(status.equals("1")?"启动":"停止"+"成功!"); return Result.OK(status.equals("1")?"启动":"停止"+"成功!");
} }
@RequestMapping("/saveCamera") @RequestMapping("/saveCamera")
@ -232,6 +232,21 @@ public class MeterConfigController {
return Result.OK("解绑成功!"); return Result.OK("解绑成功!");
} }
@RequestMapping("/saveCalibration")
public Result<?> saveCalibration(MeterConfig config){
if(StringUtils.isEmpty(config.getJzVal())){
return Result.error("保存失败,校准值不能为空");
}
UpdateWrapper<MeterConfig> update = new UpdateWrapper<>();
if(StringUtils.isNotEmpty(config.getIsJz())){
update.set("is_jz",config.getIsJz());
}
update.set("jz_val",config.getJzVal());
update.eq("id",config.getId());
meterConfigService.update(update);
return Result.OK("保存成功!");
}
@RequestMapping("/hisFocal") @RequestMapping("/hisFocal")
public Result<?> hisFocal(@RequestBody String str){ public Result<?> hisFocal(@RequestBody String str){
List<Integer> ids = JSONObject.parseObject(str,List.class); List<Integer> ids = JSONObject.parseObject(str,List.class);
@ -344,4 +359,7 @@ public class MeterConfigController {
return sum; return sum;
} }
} }

1
device_cars/src/main/java/com/xr/device_car/modules/analysis/controller/MeterReadController.java

@ -34,6 +34,7 @@ public class MeterReadController {
if(StringUtils.isNotEmpty(readingRecord.getDeviceIp())){ if(StringUtils.isNotEmpty(readingRecord.getDeviceIp())){
query.like("d.device_ip",readingRecord.getDeviceIp()); query.like("d.device_ip",readingRecord.getDeviceIp());
} }
query.orderByDesc("reading_time");
IPage<MeterReadingRecord> ipage = meterReadingRecordService.pageList(page,query); IPage<MeterReadingRecord> ipage = meterReadingRecordService.pageList(page,query);
return ipage; return ipage;
} }

4
device_cars/src/main/java/com/xr/device_car/modules/analysis/entity/MeterConfig.java

@ -145,6 +145,10 @@ public class MeterConfig implements Serializable {
private Integer stationId; private Integer stationId;
private Integer isJz;
private String jzVal;
/** /**
* 修改时间 * 修改时间
*/ */

4
device_cars/src/main/resources/application-dev.yml

@ -64,8 +64,8 @@ analysis:
upload: upload:
img: img:
url: http://192.168.1.83:18081/file/img/zs/ url: http://192.168.1.83:18081/file/img/
path: D:\\service\\fileService\\img\\zs\\ path: D:\\service\\fileService\\img\\
python: python:
path: C:\\Users\\admin\\Anaconda3\\envs\\myconda310\\python.exe path: C:\\Users\\admin\\Anaconda3\\envs\\myconda310\\python.exe
modelPath: D:\\smartGrid\\smartGrid\\models modelPath: D:\\smartGrid\\smartGrid\\models

4
device_cars/src/main/resources/application-prod.yml

@ -64,8 +64,8 @@ analysis:
upload: upload:
img: img:
url: http://192.168.1.94:18081/file/img/zs/ url: http://192.168.1.94:18081/file/img/
path: E:\\service\\fileService\\img\\zs\\ path: E:\\service\\fileService\\img\\
python: python:
path: C:\\Users\\admin\\Anaconda3\\envs\\myconda310\\python.exe path: C:\\Users\\admin\\Anaconda3\\envs\\myconda310\\python.exe
modelPath: D:\\smartGrid\\smartGrid\\models modelPath: D:\\smartGrid\\smartGrid\\models

2
device_cars/src/main/resources/modules/analysis/MeterConfigMapper.xml

@ -41,7 +41,7 @@
a.type_id,a.status,a.first_time, a.type_id,a.status,a.first_time,
a.algorithm_type,a.interval_time,a.focal_number, a.algorithm_type,a.interval_time,a.focal_number,
a.parameter_config,a.remarks,a.init_status,a.create_user, a.parameter_config,a.remarks,a.init_status,a.create_user,
a.create_time,a.update_user,a.update_time,a.station_id, a.create_time,a.update_user,a.update_time,a.station_id,a.jz_val,
</sql> </sql>
<select id="selectConfigByPage" resultType="com.xr.device_car.modules.analysis.entity.MeterConfig"> <select id="selectConfigByPage" resultType="com.xr.device_car.modules.analysis.entity.MeterConfig">
select select

3
device_gather/src/main/java/com/xr/device/common/configvalue/StaticProperties.java

@ -20,4 +20,7 @@ public class StaticProperties {
@Value("${python.modelPath}") @Value("${python.modelPath}")
private String modelPath; private String modelPath;
@Value("${station.id}")
private Integer stationId;
} }

5
device_gather/src/main/java/com/xr/device/common/utils/StaticPropUtil.java

@ -13,11 +13,14 @@ public class StaticPropUtil {
public static String modelPath; public static String modelPath;
public static Integer stationId;
public static void initDingDingProp(StaticProperties dingProperties){ public static void initDingDingProp(StaticProperties dingProperties){
imgUrl = dingProperties.getImgUrl(); imgUrl = dingProperties.getImgUrl();
imgPath = dingProperties.getImgPath(); imgPath = dingProperties.getImgPath();
pythonPath = dingProperties.getPythonPath(); pythonPath = dingProperties.getPythonPath();
modelPath=dingProperties.getModelPath(); modelPath = dingProperties.getModelPath();
stationId = dingProperties.getStationId();
} }
} }

22
device_gather/src/main/java/com/xr/device/common/utils/UploadUtil.java

@ -153,19 +153,21 @@ public class UploadUtil {
g2d.drawString(currentTime, currentTimeX, currentTimeY); g2d.drawString(currentTime, currentTimeX, currentTimeY);
// 绘制文本2的背景矩形 // 绘制文本2的背景矩形
int text2Width = fm.stringWidth(text2); if(text2!=null){
int text2Height = fm.getHeight(); int text2Width = fm.stringWidth(text2);
g2d.setColor(new Color(0, 0, 0, 50)); // 黑色半透明背景 int text2Height = fm.getHeight();
g2d.fillRect(padding, padding + currentTimeHeight + rectPadding * 2, text2Width + 2 * rectPadding, text2Height + 2 * rectPadding); g2d.setColor(new Color(0, 0, 0, 50)); // 黑色半透明背景
g2d.fillRect(padding, padding + currentTimeHeight + rectPadding * 2, text2Width + 2 * rectPadding, text2Height + 2 * rectPadding);
// 绘制文本2在时间的下面,内边距为20px // 绘制文本2在时间的下面,内边距为20px
g2d.setColor(Color.WHITE); g2d.setColor(Color.WHITE);
int text2X = padding + rectPadding + (text2Width + rectPadding - text2Width) / 2; int text2X = padding + rectPadding + (text2Width + rectPadding - text2Width) / 2;
int text2Y = padding + currentTimeHeight + rectPadding * 3 + fm.getAscent(); int text2Y = padding + currentTimeHeight + rectPadding * 3 + fm.getAscent();
g2d.drawString(text2, text2X, text2Y); g2d.drawString(text2, text2X, text2Y);
}
// 计算文本1的右上角位置 // 计算文本1的右上角位置
int text1Width = fm.stringWidth(text1);
int text1X = (int) (x1 + wid); // 框的右上角位置 int text1X = (int) (x1 + wid); // 框的右上角位置
int text1Y = (int) (y1 + fm.getAscent()); // 框的右上角紧挨着框 int text1Y = (int) (y1 + fm.getAscent()); // 框的右上角紧挨着框
g2d.setColor(Color.RED); g2d.setColor(Color.RED);

2
device_gather/src/main/java/com/xr/device/model/mapper/MeterConfigMapper.java

@ -15,7 +15,7 @@ import java.util.List;
@Mapper @Mapper
public interface MeterConfigMapper extends BaseMapper<MeterConfig> { public interface MeterConfigMapper extends BaseMapper<MeterConfig> {
List<MeterConfig> getMeterList(); List<MeterConfig> getMeterList(Integer stationId);
} }

2
device_gather/src/main/java/com/xr/device/model/service/MeterConfigService.java

@ -12,6 +12,6 @@ import java.util.List;
*/ */
public interface MeterConfigService extends IService<MeterConfig> { public interface MeterConfigService extends IService<MeterConfig> {
List<MeterConfig> getMeterList(); List<MeterConfig> getMeterList(Integer station);
} }

4
device_gather/src/main/java/com/xr/device/model/service/impl/MeterConfigServiceImpl.java

@ -20,8 +20,8 @@ public class MeterConfigServiceImpl extends ServiceImpl<MeterConfigMapper, Meter
implements MeterConfigService{ implements MeterConfigService{
@Override @Override
public List<MeterConfig> getMeterList() { public List<MeterConfig> getMeterList(Integer stationId) {
return ((MeterConfigMapper)this.baseMapper).getMeterList(); return ((MeterConfigMapper)this.baseMapper).getMeterList(stationId);
} }
} }

11
device_gather/src/main/java/com/xr/device/schedule/GetMeterSchedule.java

@ -44,9 +44,9 @@ public class GetMeterSchedule {
private final MeterTypeService meterTypeService; private final MeterTypeService meterTypeService;
@Scheduled(cron = "0 0 0/3 * * ?") @Scheduled(cron = "0 0/3 * * * ?")
public void getMeterSchedule(){ public void getMeterSchedule(){
List<MeterConfig> configs = meterConfigService.getMeterList(); List<MeterConfig> configs = meterConfigService.getMeterList(StaticPropUtil.stationId);
int pageSize = 10; // 每页的设备数量 int pageSize = 10; // 每页的设备数量
int totalDevices = configs.size(); // 总设备数量 int totalDevices = configs.size(); // 总设备数量
int totalPages = (int) Math.ceil((double) totalDevices / pageSize); // 总页数 int totalPages = (int) Math.ceil((double) totalDevices / pageSize); // 总页数
@ -138,7 +138,7 @@ public class GetMeterSchedule {
meterReadingRecord.setReadingType(2); meterReadingRecord.setReadingType(2);
String value = ""; String value = "";
if(config.getTypeId() == 5 || config.getTypeId() == 7){ if(config.getTypeId() == 5 || config.getTypeId() == 7){
value = ValueFormatUtil.getZZl(f,config);
} }
if(config.getTypeId() == 3 ){ if(config.getTypeId() == 3 ){
value = ValueFormatUtil.getYwj(f,config); value = ValueFormatUtil.getYwj(f,config);
@ -153,10 +153,7 @@ public class GetMeterSchedule {
if(config.getTypeId() == 10){//放电计数器 if(config.getTypeId() == 10){//放电计数器
value=ValueFormatUtil.getfdjsq(f); value=ValueFormatUtil.getfdjsq(f);
} }
if(config.getIsJz() == 1){ if(config.getIsJz()!=null && config.getIsJz() == 1){
value = config.getJzVal();
}
if(config.getIsJz() == 1){
value = config.getJzVal(); value = config.getJzVal();
} }
meterReadingRecord.setReadingValue(value); meterReadingRecord.setReadingValue(value);

6
device_gather/src/main/resources/application-jc-dev.yml → device_gather/src/main/resources/application-jcDev.yml

@ -1,5 +1,5 @@
server: server:
port: 8085 port: 8173
servlet: servlet:
context-path: /cars-api context-path: /cars-api
#context-path: / #context-path: /
@ -19,7 +19,7 @@ spring:
db2: db2:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/image_analysis_zs?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false url: jdbc:mysql://116.196.120.81:3306/image_analysix_wz?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root username: root
password: 5ea47c0bdd7146ebbd53020eca@672307 password: 5ea47c0bdd7146ebbd53020eca@672307
#Hikari连接池配置 #Hikari连接池配置
@ -78,3 +78,5 @@ eureka:
enabled: true enabled: true
service-url: service-url:
defaultZone: http://localhost:8084/eureka defaultZone: http://localhost:8084/eureka
station:
id: 2

6
device_gather/src/main/resources/application-jc-prod.yml → device_gather/src/main/resources/application-jcProd.yml

@ -1,5 +1,5 @@
server: server:
port: 8085 port: 8173
servlet: servlet:
context-path: /cars-api context-path: /cars-api
#context-path: / #context-path: /
@ -19,7 +19,7 @@ spring:
db2: db2:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/image_analysis_zs?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false url: jdbc:mysql://116.196.120.81:3306/image_analysix_wz?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root username: root
password: 5ea47c0bdd7146ebbd53020eca@672307 password: 5ea47c0bdd7146ebbd53020eca@672307
#Hikari连接池配置 #Hikari连接池配置
@ -78,3 +78,5 @@ eureka:
enabled: true enabled: true
service-url: service-url:
defaultZone: http://localhost:8084/eureka defaultZone: http://localhost:8084/eureka
station:
id: 2

82
device_gather/src/main/resources/application-jiangcDev.yml

@ -0,0 +1,82 @@
server:
port: 8173
servlet:
context-path: /cars-api
#context-path: /
spring:
datasource:
dynamic:
primary: db1
strict: false
datasource:
db1:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/device_system?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
db2:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/image_analysix_wz?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
#Hikari连接池配置
hikari:
#池中维护的最小空闲连接数
minimum-idle: 5
#池中最大连接数,包括闲置和使用中的连接
maximum-pool-size: 15
#自动提交从池中返回的连接
auto-commit: true
#连接允许在池中闲置的最长时间
idle-timeout: 30000
#连接池的用户定义名称,主要出现在日志记录和JMX管理控制台中以识别池和池配置
pool-name: DatebookHikariCP
#池中连接最长生命周期
max-lifetime: 18000000
#等待来自池的连接的最大毫秒数
connection-timeout: 30000
#验证该连接是否是有效的查询语句
connection-test-query: select 1 from dual
cloud:
inetutils:
timeout-seconds: 1000
config:
enabled: false
# redis 相关
redis:
host: ${REDIS_URL:localhost}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:111111}
timeout: 10000
jedis:
pool:
max-active: 1000
max-wait: -1ms
max-idle: 10
min-idle: 5
swagger:
show: true
analysis:
url: http://192.168.1.123:9000/vi/syncrec
upload:
img:
url: http://192.168.1.83:18081/file/img/zs/
path: D:\\service\\fileService\\img\\zs\\
python:
path: C:\\Users\\admin\\Anaconda3\\envs\\myconda310\\python.exe
modelPath: D:\\smartGrid\\smartGrid\\models
eureka:
instance:
instance-id: ${spring.cloud.client.ip-address}:${server.port}
prefer-ip-address: true
client:
healthcheck:
enabled: true
service-url:
defaultZone: http://localhost:8084/eureka
station:
id: 5

82
device_gather/src/main/resources/application-jiangcProd.yml

@ -0,0 +1,82 @@
server:
port: 8173
servlet:
context-path: /cars-api
#context-path: /
spring:
datasource:
dynamic:
primary: db1
strict: false
datasource:
db1:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/device_system?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
db2:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/image_analysix_wz?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
#Hikari连接池配置
hikari:
#池中维护的最小空闲连接数
minimum-idle: 5
#池中最大连接数,包括闲置和使用中的连接
maximum-pool-size: 15
#自动提交从池中返回的连接
auto-commit: true
#连接允许在池中闲置的最长时间
idle-timeout: 30000
#连接池的用户定义名称,主要出现在日志记录和JMX管理控制台中以识别池和池配置
pool-name: DatebookHikariCP
#池中连接最长生命周期
max-lifetime: 18000000
#等待来自池的连接的最大毫秒数
connection-timeout: 30000
#验证该连接是否是有效的查询语句
connection-test-query: select 1 from dual
cloud:
inetutils:
timeout-seconds: 1000
config:
enabled: false
# redis 相关
redis:
host: ${REDIS_URL:localhost}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:111111}
timeout: 10000
jedis:
pool:
max-active: 1000
max-wait: -1ms
max-idle: 10
min-idle: 5
swagger:
show: true
analysis:
url: http://192.168.1.123:9000/vi/syncrec
upload:
img:
url: http://192.168.1.83:18081/file/img/zs/
path: D:\\service\\fileService\\img\\zs\\
python:
path: C:\\Users\\admin\\Anaconda3\\envs\\myconda310\\python.exe
modelPath: D:\\smartGrid\\smartGrid\\models
eureka:
instance:
instance-id: ${spring.cloud.client.ip-address}:${server.port}
prefer-ip-address: true
client:
healthcheck:
enabled: true
service-url:
defaultZone: http://localhost:8084/eureka
station:
id: 5

82
device_gather/src/main/resources/application-ppDev.yml

@ -0,0 +1,82 @@
server:
port: 8173
servlet:
context-path: /cars-api
#context-path: /
spring:
datasource:
dynamic:
primary: db1
strict: false
datasource:
db1:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/device_system?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
db2:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/image_analysix_wz?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
#Hikari连接池配置
hikari:
#池中维护的最小空闲连接数
minimum-idle: 5
#池中最大连接数,包括闲置和使用中的连接
maximum-pool-size: 15
#自动提交从池中返回的连接
auto-commit: true
#连接允许在池中闲置的最长时间
idle-timeout: 30000
#连接池的用户定义名称,主要出现在日志记录和JMX管理控制台中以识别池和池配置
pool-name: DatebookHikariCP
#池中连接最长生命周期
max-lifetime: 18000000
#等待来自池的连接的最大毫秒数
connection-timeout: 30000
#验证该连接是否是有效的查询语句
connection-test-query: select 1 from dual
cloud:
inetutils:
timeout-seconds: 1000
config:
enabled: false
# redis 相关
redis:
host: ${REDIS_URL:localhost}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:111111}
timeout: 10000
jedis:
pool:
max-active: 1000
max-wait: -1ms
max-idle: 10
min-idle: 5
swagger:
show: true
analysis:
url: http://192.168.1.123:9000/vi/syncrec
upload:
img:
url: http://192.168.1.83:18081/file/img/zs/
path: D:\\service\\fileService\\img\\zs\\
python:
path: C:\\Users\\admin\\Anaconda3\\envs\\myconda310\\python.exe
modelPath: D:\\smartGrid\\smartGrid\\models
eureka:
instance:
instance-id: ${spring.cloud.client.ip-address}:${server.port}
prefer-ip-address: true
client:
healthcheck:
enabled: true
service-url:
defaultZone: http://localhost:8084/eureka
station:
id: 4

82
device_gather/src/main/resources/application-ppProd.yml

@ -0,0 +1,82 @@
server:
port: 8173
servlet:
context-path: /cars-api
#context-path: /
spring:
datasource:
dynamic:
primary: db1
strict: false
datasource:
db1:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/device_system?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
db2:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/image_analysix_wz?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
#Hikari连接池配置
hikari:
#池中维护的最小空闲连接数
minimum-idle: 5
#池中最大连接数,包括闲置和使用中的连接
maximum-pool-size: 15
#自动提交从池中返回的连接
auto-commit: true
#连接允许在池中闲置的最长时间
idle-timeout: 30000
#连接池的用户定义名称,主要出现在日志记录和JMX管理控制台中以识别池和池配置
pool-name: DatebookHikariCP
#池中连接最长生命周期
max-lifetime: 18000000
#等待来自池的连接的最大毫秒数
connection-timeout: 30000
#验证该连接是否是有效的查询语句
connection-test-query: select 1 from dual
cloud:
inetutils:
timeout-seconds: 1000
config:
enabled: false
# redis 相关
redis:
host: ${REDIS_URL:localhost}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:111111}
timeout: 10000
jedis:
pool:
max-active: 1000
max-wait: -1ms
max-idle: 10
min-idle: 5
swagger:
show: true
analysis:
url: http://192.168.1.123:9000/vi/syncrec
upload:
img:
url: http://192.168.1.83:18081/file/img/zs/
path: D:\\service\\fileService\\img\\zs\\
python:
path: C:\\Users\\admin\\Anaconda3\\envs\\myconda310\\python.exe
modelPath: D:\\smartGrid\\smartGrid\\models
eureka:
instance:
instance-id: ${spring.cloud.client.ip-address}:${server.port}
prefer-ip-address: true
client:
healthcheck:
enabled: true
service-url:
defaultZone: http://localhost:8084/eureka
station:
id: 4

82
device_gather/src/main/resources/application-psDev.yml

@ -0,0 +1,82 @@
server:
port: 8173
servlet:
context-path: /cars-api
#context-path: /
spring:
datasource:
dynamic:
primary: db1
strict: false
datasource:
db1:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/device_system?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
db2:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/image_analysix_wz?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
#Hikari连接池配置
hikari:
#池中维护的最小空闲连接数
minimum-idle: 5
#池中最大连接数,包括闲置和使用中的连接
maximum-pool-size: 15
#自动提交从池中返回的连接
auto-commit: true
#连接允许在池中闲置的最长时间
idle-timeout: 30000
#连接池的用户定义名称,主要出现在日志记录和JMX管理控制台中以识别池和池配置
pool-name: DatebookHikariCP
#池中连接最长生命周期
max-lifetime: 18000000
#等待来自池的连接的最大毫秒数
connection-timeout: 30000
#验证该连接是否是有效的查询语句
connection-test-query: select 1 from dual
cloud:
inetutils:
timeout-seconds: 1000
config:
enabled: false
# redis 相关
redis:
host: ${REDIS_URL:localhost}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:111111}
timeout: 10000
jedis:
pool:
max-active: 1000
max-wait: -1ms
max-idle: 10
min-idle: 5
swagger:
show: true
analysis:
url: http://192.168.1.123:9000/vi/syncrec
upload:
img:
url: http://192.168.1.83:18081/file/img/zs/
path: D:\\service\\fileService\\img\\zs\\
python:
path: C:\\Users\\admin\\Anaconda3\\envs\\myconda310\\python.exe
modelPath: D:\\smartGrid\\smartGrid\\models
eureka:
instance:
instance-id: ${spring.cloud.client.ip-address}:${server.port}
prefer-ip-address: true
client:
healthcheck:
enabled: true
service-url:
defaultZone: http://localhost:8084/eureka
station:
id: 3

82
device_gather/src/main/resources/application-psProd.yml

@ -0,0 +1,82 @@
server:
port: 8173
servlet:
context-path: /cars-api
#context-path: /
spring:
datasource:
dynamic:
primary: db1
strict: false
datasource:
db1:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/device_system?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
db2:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/image_analysix_wz?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
#Hikari连接池配置
hikari:
#池中维护的最小空闲连接数
minimum-idle: 5
#池中最大连接数,包括闲置和使用中的连接
maximum-pool-size: 15
#自动提交从池中返回的连接
auto-commit: true
#连接允许在池中闲置的最长时间
idle-timeout: 30000
#连接池的用户定义名称,主要出现在日志记录和JMX管理控制台中以识别池和池配置
pool-name: DatebookHikariCP
#池中连接最长生命周期
max-lifetime: 18000000
#等待来自池的连接的最大毫秒数
connection-timeout: 30000
#验证该连接是否是有效的查询语句
connection-test-query: select 1 from dual
cloud:
inetutils:
timeout-seconds: 1000
config:
enabled: false
# redis 相关
redis:
host: ${REDIS_URL:localhost}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:111111}
timeout: 10000
jedis:
pool:
max-active: 1000
max-wait: -1ms
max-idle: 10
min-idle: 5
swagger:
show: true
analysis:
url: http://192.168.1.123:9000/vi/syncrec
upload:
img:
url: http://192.168.1.83:18081/file/img/zs/
path: D:\\service\\fileService\\img\\zs\\
python:
path: C:\\Users\\admin\\Anaconda3\\envs\\myconda310\\python.exe
modelPath: D:\\smartGrid\\smartGrid\\models
eureka:
instance:
instance-id: ${spring.cloud.client.ip-address}:${server.port}
prefer-ip-address: true
client:
healthcheck:
enabled: true
service-url:
defaultZone: http://localhost:8084/eureka
station:
id: 3

82
device_gather/src/main/resources/application-sbDev.yml

@ -0,0 +1,82 @@
server:
port: 8173
servlet:
context-path: /cars-api
#context-path: /
spring:
datasource:
dynamic:
primary: db1
strict: false
datasource:
db1:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/device_system?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
db2:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/image_analysix_wz?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
#Hikari连接池配置
hikari:
#池中维护的最小空闲连接数
minimum-idle: 5
#池中最大连接数,包括闲置和使用中的连接
maximum-pool-size: 15
#自动提交从池中返回的连接
auto-commit: true
#连接允许在池中闲置的最长时间
idle-timeout: 30000
#连接池的用户定义名称,主要出现在日志记录和JMX管理控制台中以识别池和池配置
pool-name: DatebookHikariCP
#池中连接最长生命周期
max-lifetime: 18000000
#等待来自池的连接的最大毫秒数
connection-timeout: 30000
#验证该连接是否是有效的查询语句
connection-test-query: select 1 from dual
cloud:
inetutils:
timeout-seconds: 1000
config:
enabled: false
# redis 相关
redis:
host: ${REDIS_URL:localhost}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:111111}
timeout: 10000
jedis:
pool:
max-active: 1000
max-wait: -1ms
max-idle: 10
min-idle: 5
swagger:
show: true
analysis:
url: http://192.168.1.123:9000/vi/syncrec
upload:
img:
url: http://192.168.1.83:18081/file/img/zs/
path: D:\\service\\fileService\\img\\zs\\
python:
path: C:\\Users\\admin\\Anaconda3\\envs\\myconda310\\python.exe
modelPath: D:\\smartGrid\\smartGrid\\models
eureka:
instance:
instance-id: ${spring.cloud.client.ip-address}:${server.port}
prefer-ip-address: true
client:
healthcheck:
enabled: true
service-url:
defaultZone: http://localhost:8084/eureka
station:
id: 1

82
device_gather/src/main/resources/application-sbProd.yml

@ -0,0 +1,82 @@
server:
port: 8173
servlet:
context-path: /cars-api
#context-path: /
spring:
datasource:
dynamic:
primary: db1
strict: false
datasource:
db1:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/device_system?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
db2:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://116.196.120.81:3306/image_analysix_wz?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: 5ea47c0bdd7146ebbd53020eca@672307
#Hikari连接池配置
hikari:
#池中维护的最小空闲连接数
minimum-idle: 5
#池中最大连接数,包括闲置和使用中的连接
maximum-pool-size: 15
#自动提交从池中返回的连接
auto-commit: true
#连接允许在池中闲置的最长时间
idle-timeout: 30000
#连接池的用户定义名称,主要出现在日志记录和JMX管理控制台中以识别池和池配置
pool-name: DatebookHikariCP
#池中连接最长生命周期
max-lifetime: 18000000
#等待来自池的连接的最大毫秒数
connection-timeout: 30000
#验证该连接是否是有效的查询语句
connection-test-query: select 1 from dual
cloud:
inetutils:
timeout-seconds: 1000
config:
enabled: false
# redis 相关
redis:
host: ${REDIS_URL:localhost}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:111111}
timeout: 10000
jedis:
pool:
max-active: 1000
max-wait: -1ms
max-idle: 10
min-idle: 5
swagger:
show: true
analysis:
url: http://192.168.1.123:9000/vi/syncrec
upload:
img:
url: http://192.168.1.83:18081/file/img/zs/
path: D:\\service\\fileService\\img\\zs\\
python:
path: C:\\Users\\admin\\Anaconda3\\envs\\myconda310\\python.exe
modelPath: D:\\smartGrid\\smartGrid\\models
eureka:
instance:
instance-id: ${spring.cloud.client.ip-address}:${server.port}
prefer-ip-address: true
client:
healthcheck:
enabled: true
service-url:
defaultZone: http://localhost:8084/eureka
station:
id: 1

2
device_gather/src/main/resources/application.yml

@ -2,7 +2,7 @@ spring:
profiles: profiles:
#active: dev #开发环境 #active: dev #开发环境
# active: test #测试环境5 # active: test #测试环境5
active: jc-dev active: jcDev
# active: prod #生产环境 # active: prod #生产环境
application: application:
name: gather name: gather

2
device_gather/src/main/resources/mapper/MeterConfigMapper.xml

@ -54,6 +54,6 @@
<select id="getMeterList" resultType="com.xr.device.model.entity.MeterConfig"> <select id="getMeterList" resultType="com.xr.device.model.entity.MeterConfig">
select a.*,b.device_ip from meter_config a left join device_camera b select a.*,b.device_ip from meter_config a left join device_camera b
on a.camera_id = b.id where a.status = 1 on a.camera_id = b.id where a.status = 1 and a.station_id = #{stationId}
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save