fix: 指令取消
This commit is contained in:
@@ -241,10 +241,8 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
else if (phase == 0xFF) {
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到指令号{}对应的指令", ikey);
|
||||
} else {
|
||||
instructionService.forceCancel(inst.getInstruction_id());
|
||||
}
|
||||
ndcApi.replyPhase(index, phase);
|
||||
ndcApi.replyPhase(ikey, phase);
|
||||
} else if (phase == 0x50) {
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
@@ -299,8 +297,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
|
||||
String carnoKey = String.valueOf(arr[20]);
|
||||
int phaseForCarno = arr[16] * 256 + arr[17];
|
||||
if (phaseForCarno == 0x67 || phaseForCarno == 0x70 || phaseForCarno == 0x71 || phaseForCarno == 0x72 || phaseForCarno == 0x73 || phaseForCarno == 0x74
|
||||
|| phaseForCarno == 0x112) {
|
||||
if (phaseForCarno == 0x67 || phaseForCarno == 0x70 || phaseForCarno == 0x71 || phaseForCarno == 0x72 || phaseForCarno == 0x73 || phaseForCarno == 0x74) {
|
||||
carnoKey = String.valueOf(arr[18] * 256 + arr[19]);
|
||||
}
|
||||
final int[] arrCopy = new int[count];
|
||||
|
||||
@@ -587,7 +587,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
// 根据路由类型,调用对应的系统的取消任务接口
|
||||
if (StrUtil.equals(shortPathLines.get(0).getType(), RouteTypeEnum.NDC.getCode())) {
|
||||
log.info("调用NDC删除任务:{}", JSONObject.toJSONString(entity));
|
||||
ndcApi.deleteTask(Integer.parseInt(entity.getInstruction_id()));
|
||||
ndcApi.deleteTask(Integer.parseInt(entity.getInstruction_code()));
|
||||
} else if (StrUtil.equals(shortPathLines.get(0).getType(), RouteTypeEnum.KUKA.getCode())) {
|
||||
MissionCancelRequest request = new MissionCancelRequest();
|
||||
request.setRequestId(IdUtil.getSnowflakeNextIdStr());
|
||||
|
||||
@@ -151,6 +151,7 @@ public class NdcApi {
|
||||
0x00, 0x02, // 参数长度
|
||||
indexhigh, indexlow
|
||||
};
|
||||
log.info("取消任务{}报文:{}", index, toHex(b, b.length));
|
||||
NDCSocketConnectionAutoRun.write(b);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.List;
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Order(100)
|
||||
@ConditionalOnProperty(value = "spring.profiles.active",havingValue = "prod")
|
||||
@ConditionalOnProperty(value = "spring.profiles.active")
|
||||
public class JobRunner implements ApplicationRunner {
|
||||
private static final Logger log = LoggerFactory.getLogger(JobRunner.class);
|
||||
private final ISysQuartzJobService quartzJobService;
|
||||
|
||||
Reference in New Issue
Block a user