Commit 9b4c1b34 authored by 赵啸非's avatar 赵啸非

修改上下线通知

parent 1792c075
...@@ -385,33 +385,37 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -385,33 +385,37 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
deviceReq.setDeviceInFloor(entity.getDeviceInFloor() == null ? 0 : entity.getDeviceInFloor()); deviceReq.setDeviceInFloor(entity.getDeviceInFloor() == null ? 0 : entity.getDeviceInFloor());
//http://192.168.0.98:8090/inter/device/deviceIn //http://192.168.0.98:8090/inter/device/deviceIn
//判断是否是php,如果不是 则是java 则内部调用 //判断是否是php,如果不是 则是java 则内部调用
if ("smartOffice".equals(platformEntity.getPlatformSn())) {
deviceReq.setReceiveMethod(update.getValue());
//todo 调用智慧办公系统
Rest<String> officeRest = officeDeviceFeign.deviceCall(deviceReq);
log.info("office resp ==>{}", JSON.toJSONString(officeRest));
}
if ("ybxt".equals(platformEntity.getPlatformSn())) {
deviceReq.setReceiveMethod(update.getValue());
//调用样表系统系统
Rest<String> sampleRest = sampleDeviceFeign.deviceCall(deviceReq);
log.info("sample resp ==>{}", JSON.toJSONString(sampleRest));
}
if ("xxgk".equals(platformEntity.getPlatformSn())) { try {
deviceReq.setReceiveMethod(update.getValue());
//调用样表系统系统
Rest<String> sampleRest = infoPublishDeviceFeign.deviceCall(deviceReq);
log.info("info publish resp ==>{}", JSON.toJSONString(sampleRest));
}
if ("tdxt".equals(platformEntity.getPlatformSn())) {
deviceReq.setReceiveMethod(update.getValue()); if ("smartOffice".equals(platformEntity.getPlatformSn())) {
//调用样表系统系统 deviceReq.setReceiveMethod(update.getValue());
Rest<String> fillRest = fillDeviceFeign.deviceCall(deviceReq); //todo 调用智慧办公系统
log.info("fill resp ==>{}", JSON.toJSONString(fillRest)); Rest<String> officeRest = officeDeviceFeign.deviceCall(deviceReq);
} else { log.info("office resp ==>{}", JSON.toJSONString(officeRest));
cacheService.lpush(RedisKey.KEY_DEVICE_THIRDPARTY_QUEUE, deviceReq); }
if ("ybxt".equals(platformEntity.getPlatformSn())) {
deviceReq.setReceiveMethod(update.getValue());
//调用样表系统系统
Rest<String> sampleRest = sampleDeviceFeign.deviceCall(deviceReq);
log.info("sample resp ==>{}", JSON.toJSONString(sampleRest));
}
if ("xxgk".equals(platformEntity.getPlatformSn())) {
deviceReq.setReceiveMethod(update.getValue());
//调用样表系统系统
Rest<String> sampleRest = infoPublishDeviceFeign.deviceCall(deviceReq);
log.info("info publish resp ==>{}", JSON.toJSONString(sampleRest));
}
if ("tdxt".equals(platformEntity.getPlatformSn())) {
deviceReq.setReceiveMethod(update.getValue());
//调用样表系统系统
Rest<String> fillRest = fillDeviceFeign.deviceCall(deviceReq);
log.info("fill resp ==>{}", JSON.toJSONString(fillRest));
} else {
cacheService.lpush(RedisKey.KEY_DEVICE_THIRDPARTY_QUEUE, deviceReq);
// log.info("lpush:{}",lpush); // log.info("lpush:{}",lpush);
// String phpInUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_IN_HTTP_URL, "http://172.15.28.116:8090"); // String phpInUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_IN_HTTP_URL, "http://172.15.28.116:8090");
// ApiResp<String> resp = messageService.sendThirdParty(UrlBuilder.of(phpInUrl).addPath(thirdPartyPath).build(), deviceReq); // ApiResp<String> resp = messageService.sendThirdParty(UrlBuilder.of(phpInUrl).addPath(thirdPartyPath).build(), deviceReq);
...@@ -422,6 +426,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -422,6 +426,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
// } else { // } else {
// return Rest.fail("发送失败"); // return Rest.fail("发送失败");
// } // }
}
} catch (Exception e) {
log.error("feign调用异常!");
} }
return Rest.ok(); return Rest.ok();
...@@ -691,7 +698,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -691,7 +698,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
@Override @Override
public void downMsg(List<DeviceMsgReq> list) { public void downMsg(List<DeviceMsgReq> list) {
try { try {
// ArrayList<DeviceLogEntity> deviceLogList = new ArrayList<>(); // ArrayList<DeviceLogEntity> deviceLogList = new ArrayList<>();
List<DeviceMsgReq> collect = list.stream().sorted(Comparator.comparing(DeviceMsgReq::getTimestamp)).collect(Collectors.toList()); List<DeviceMsgReq> collect = list.stream().sorted(Comparator.comparing(DeviceMsgReq::getTimestamp)).collect(Collectors.toList());
for (DeviceMsgReq item : collect) { for (DeviceMsgReq item : collect) {
......
...@@ -70,23 +70,6 @@ spring: ...@@ -70,23 +70,6 @@ spring:
url: @profiles.datasource.uri@ url: @profiles.datasource.uri@
username: @profiles.datasource.username@ username: @profiles.datasource.username@
password: @profiles.datasource.password@ password: @profiles.datasource.password@
# 连接池
# hikari:
# #连接池名
# pool-name: DateHikariCP
# #最小空闲连接数
# minimum-idle: 5
# # 空闲连接存活最大时间,默认600000(10分钟)
# idle-timeout: 180000
# # 连接池最大连接数,默认是10
# maximum-pool-size: 15
# # 此属性控制从池返回的连接的默认自动提交行为,默认值:true
# auto-commit: true
# # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
# max-lifetime: 1800000
# # 数据库连接超时时间,默认30秒,即30000
# connection-timeout: 30000
# connection-test-query: SELECT 1
mybatis: mybatis:
root-path: com.mortals root-path: com.mortals
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment