切换分支备份

dev2.0
anthonywj 2 years ago
parent 13ada50cc3
commit 79033ac6b1

@ -540,6 +540,8 @@ public class IoCheckInoutService {
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
//生成缺失码
genLostCode(orderEntity.getBillNo());
checkThird(orderEntity);

@ -1,5 +1,6 @@
package com.glxp.api.service.sync;
import cn.hutool.core.thread.ThreadUtil;
import com.glxp.api.constant.SocketMsgType;
import com.glxp.api.dao.system.SyncDataSetDao;
import com.glxp.api.entity.system.SyncDataSetEntity;
@ -30,43 +31,45 @@ public class WebSocketComponent implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet();
String ip = syncDataSetEntity.getSyncIp();
ip = ip.replace("http://", "");
ThreadUtil.execAsync(() -> {
SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet();
String ip = syncDataSetEntity.getSyncIp();
ip = ip.replace("http://", "");
// ip = ip.replace("/SP_SYNC_SERVER", "");
try {
SpsWebSocketClient client = new SpsWebSocketClient("ws://" + ip + "/sps/web/sync/2/" + socketToken);
client.setSocketMsgService(socketMsgService);
initConnect(client);
//等待服务端响应
while (!client.getReadyState().equals(ReadyState.OPEN)) {
log.info("连接中···请稍后");
Thread.sleep(1000);
}
//等待WebSocket服务端响应
String message = null;
while (true) {
while ((message = client.getExcptMessage()) == null) {
log.info("已连接,等待接收数据--------");
try {
SpsWebSocketClient client = new SpsWebSocketClient("ws://" + ip + "/sps/web/sync/2/" + socketToken);
client.setSocketMsgService(socketMsgService);
initConnect(client);
//等待服务端响应
while (!client.getReadyState().equals(ReadyState.OPEN)) {
log.info("连接中···请稍后");
Thread.sleep(1000);
if (client.isClosed()) {
initConnect(client);
}
}
if (message.equals(SocketMsgType.DL_ALL_DATA)) {
heartTaskService.pullData();
//等待WebSocket服务端响应
String message = null;
while (true) {
while ((message = client.getExcptMessage()) == null) {
log.info("已连接,等待接收数据--------");
Thread.sleep(1000);
if (client.isClosed()) {
initConnect(client);
}
}
if (message.equals(SocketMsgType.DL_ALL_DATA)) {
heartTaskService.pullData();
}
//打印服务端返回的数据
log.info("成功获取数据:" + message);
}
//打印服务端返回的数据
log.info("成功获取数据:" + message);
}
} catch (URISyntaxException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
} catch (URISyntaxException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
});
}

@ -4,7 +4,7 @@ server:
spring:
datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pzh?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 123456
hikari:

Loading…
Cancel
Save