1. 调整日志

This commit is contained in:
邱贞招 2024-09-02 14:38:49 +08:00
parent 1b4833fde2
commit 426608a239
2 changed files with 7 additions and 6 deletions

View File

@ -308,10 +308,10 @@ public class ReceiveController {
/** 超出运营区断电*/
private void outAreaOutage(LogEntry.LocationValue value, AsDevice device, BigDecimal lon, BigDecimal lat, EtOperatingArea area, String isAdminUnlocking, boolean noRidingArea) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException {
String nearBoundaryDistanceConfig = sysConfigService.selectConfigByKey("near.boundary.distance");// 靠近运营区边界时的播报距离
log.info("靠近运营区边界时的播报距离==================" + nearBoundaryDistanceConfig);
// log.info("靠近运营区边界时的播报距离==================" + nearBoundaryDistanceConfig);
double nearBoundaryDistance = Double.parseDouble(nearBoundaryDistanceConfig);
String exceedArea = sysConfigService.selectConfigByKey("exceed.area.distance");// 超出运营区外断电距离
log.info("超出运营区外断电距离================" + exceedArea);
// log.info("超出运营区外断电距离================" + exceedArea);
int exceedDistance = Integer.parseInt(exceedArea);
// 创建多边形对象
@ -323,18 +323,18 @@ public class ReceiveController {
boolean isNearBoundary = GeoUtils.isInPolygonWithTolerance(lon.toString(), lat.toString(), polygon, exceedDistance );
if(inPolygonWithTolerance1){//是否在运营区边界内
// 在靠近运营区边界时发警报
log.info("靠近运营区边界发警告命令--SN" + device.getSn());
log.info("靠近运营区边界发警告命令===============--SN" + device.getSn());
asDeviceService.sendCommand(device.getMac(), Token.getToken(), IotConstants.COMMAND_PLAY2, "靠近运营区边界", null, null);
returnPower(device, noRidingArea);
}else if(isNearBoundary){ // 是否在超出运营区边界多少米内
//在20米范围内发报警
log.info("超出运营区"+exceedDistance+"米内发送警告命令--SN" + device.getSn());
log.info("超出运营区"+exceedDistance+"米内发送警告命令==============--SN" + device.getSn());
asDeviceService.sendCommand(device.getMac(), Token.getToken(), IotConstants.COMMAND_PLAY3, "超出运营区"+exceedDistance+"米内",null,null);
}else{
// 超出运营区外断电
String areaOutOutage = area.getAreaOutOutage();
if (areaOutOutage.equals("1")) { // 超出营运区断电
log.info("超出营运区断电命令--SN" + device.getSn());
log.info("超出营运区断电命令=================--SN" + device.getSn());
asDeviceService.sendCommand(device.getMac(), Token.getToken(), IotConstants.COMMAND_QLOSE+IotConstants.COMMAND_FREQUENCY_5, "超出营运区断电",null,null);
device.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE);
int updateAsDevice = asDeviceService.updateAsDevice(device);
@ -344,6 +344,7 @@ public class ReceiveController {
}
}
}else{
log.info("在缩短后的运营区边界内====================" + device.getSn());
returnPower(device, noRidingArea);
}
}

View File

@ -6,7 +6,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/electripper?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3306/ele2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
# url: jdbc:mysql://117.26.179.22:61110/electripper?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8