Commit fae10663 authored by wanghao's avatar wanghao

1 老化过程中 获取卡号,获取IOT状态调整中

parent e750be92
......@@ -265,10 +265,10 @@ public class PalletDeviceBindingServiceImpl implements IPalletDeviceBindingServi
});
tTrayInfoMapper.updateToBoundWhenStateIsIdle(palletDeviceBindingList.get(0).getTrayId());
palletDeviceBindingMapper.batchUpdateDeviceCodeAndUnbindingTime(palletDeviceBindingList);
eventPublisher.publishEvent(new ReceivedNbCodeEvent(this, null,palletDeviceBindingList.get(0).getTrayId()));
log.info("主线程时间:{}",DateUtils.getTime());
return palletDeviceBindingMapper.batchUpdateDeviceCodeAndUnbindingTime(palletDeviceBindingList);
return 1;
}
/**
......
......@@ -185,8 +185,10 @@ public class AgingStageOneProcessJob implements Job {
// 设置卡号
StringBuilder simCardNoBuilder = new StringBuilder();
for (int i = 17; i <= 36; i++) {
simCardNoBuilder.append(result[i]);
for (int i = 16; i <= 35; i++) {
int i1 = result[i];
String hex = Integer.toHexString(i1).toUpperCase();
simCardNoBuilder.append(hex);
}
String simCardNo = simCardNoBuilder.toString();
......
......@@ -225,8 +225,10 @@ public class AgingStageThreeProcessJob implements Job {
// 设置卡号
StringBuilder simCardNoBuilder = new StringBuilder();
for (int i = 17; i <= 36; i++) {
simCardNoBuilder.append(result[i]);
for (int i = 16; i <= 35; i++) {
int i1 = result[i];
String hex = Integer.toHexString(i1).toUpperCase();
simCardNoBuilder.append(hex);
}
String simCardNo = simCardNoBuilder.toString();
binding.setSimCardNo(simCardNo);
......
......@@ -252,8 +252,10 @@ public class AgingStageTwoProcessJob implements Job {
// 设置卡号
StringBuilder simCardNoBuilder = new StringBuilder();
for (int i = 17; i <= 36; i++) {
simCardNoBuilder.append(result[i]);
for (int i = 16; i <= 35; i++) {
int i1 = result[i];
String hex = Integer.toHexString(i1).toUpperCase();
simCardNoBuilder.append(hex);
}
String simCardNo = simCardNoBuilder.toString();
binding.setSimCardNo(simCardNo);
......
......@@ -20,7 +20,7 @@ import java.util.stream.Collectors;
@Component
public class RealTimeReadAgingDataFunction {
private static final int SINGLE_DEVICE_TIMEOUT_SEC = 10; // 单个设备超时:10秒
private static final int SINGLE_DEVICE_TIMEOUT_SEC = 20; // 单个设备超时:10秒
private static final int TOTAL_TASK_TIMEOUT_SEC = 240; // 任务总超时:4分钟
private static final Logger log = LoggerFactory.getLogger(RealTimeReadAgingDataFunction.class);
......@@ -53,11 +53,12 @@ public class RealTimeReadAgingDataFunction {
// 并行处理3个端口,并收集结果
portFutures = Arrays.asList(
processPort(storeyInfo, 501, Arrays.asList(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27)),
processPort(storeyInfo, 502, Arrays.asList(28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54)),
processPort(storeyInfo, 503, Arrays.asList(55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72))
processPort(storeyInfo, 501, Arrays.asList(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27))
);
// processPort(storeyInfo, 502, Arrays.asList(28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54)),
// processPort(storeyInfo, 503, Arrays.asList(55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72))
// 等待所有端口完成,带总超时
CompletableFuture<Void> allPorts = CompletableFuture.allOf(
portFutures.toArray(new CompletableFuture[0])
......@@ -382,8 +383,12 @@ public class RealTimeReadAgingDataFunction {
result.setModbusResult(modbusResult);
// 设置卡号
StringBuilder simCardNoBuilder = new StringBuilder();
for (int i = 17; i <= 36; i++) {
simCardNoBuilder.append(modbusResult[i]);
for (int i = 16; i <= 35; i++) {
int i1 = modbusResult[i];
String hex = Integer.toHexString(i1).toUpperCase();
simCardNoBuilder.append(hex);
}
String simCardNo = simCardNoBuilder.toString();
result.setSimCard(simCardNo);
......
......@@ -797,6 +797,15 @@ export default {
// 空闲状态 - 绑定设备
const palletDeviceBindingId = this.devices[0].palletDeviceBindingId;
if (this.filledCount > 0) {
// 创建loading实例
const loadingInstance = this.$loading({
lock: true,
text: '提交中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
try {
if(palletDeviceBindingId == null) {
batchAdd(this.devices).then(res => {
if (res.code === 200) {
......@@ -819,6 +828,9 @@ export default {
}
})
}
} finally {
loadingInstance.close();
}
}
} else if (this.trayStatus === '3') {
// 标定完成状态 - 不再需要提交修复,改为解绑操作
......
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