| | |
| | | package com.zy.acs.conveyor.core; |
| | | |
| | | import com.zy.acs.common.utils.News; |
| | | import com.zy.acs.conveyor.core.properties.CtuOperationConfig; |
| | | import com.zy.acs.conveyor.core.properties.CtuServiceProperties; |
| | | import com.zy.acs.conveyor.core.properties.SystemProperties; |
| | |
| | | |
| | | private final AtomicBoolean running = new AtomicBoolean(false); |
| | | |
| | | private long lastDbUpdateTime = 0; |
| | | |
| | | |
| | | private static final int LOG_INTERVAL_MS = 30000; |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | | // 初始化线程池 |
| | |
| | | log.debug("系统未运行或服务已停止,跳过输送线任务处理"); |
| | | return; |
| | | } |
| | | |
| | | long currentTime = System.currentTimeMillis(); |
| | | if (currentTime - lastDbUpdateTime > LOG_INTERVAL_MS) { |
| | | News.info("执行输送线操作"); |
| | | lastDbUpdateTime = currentTime; |
| | | } |
| | | try { |
| | | // 执行配置的操作序列 |
| | | for (CtuOperationConfig config : properties.getOperations()) { |
| | | //log.info("执行输送线操作: {}", config.getType()); |
| | | operationExecutor.execute(config); |
| | | } |
| | | |
| | | //log.info("输送线任务处理完成"); |
| | | } catch (Exception e) { |
| | | log.error("输送线任务处理异常", e); |
| | | } |
| | |
| | | package com.zy.acs.conveyor.core.operation.handler; |
| | | |
| | | import com.zy.acs.common.utils.News; |
| | | import com.zy.acs.common.utils.RedisSupport; |
| | | import com.zy.acs.conveyor.controller.vo.ApplyInDto; |
| | | import com.zy.acs.conveyor.controller.vo.ApplyInRepsonseDto; |
| | |
| | | if (staProtocol.getWorkNo() > 0 && staProtocol.isAutoing()) { |
| | | String barcode = staProtocol.getBarcode(); |
| | | if (Cools.isEmpty(barcode)) { |
| | | log.error("站点:{},未扫到码值:{}", staProtocol.getSiteId(), barcode); |
| | | News.error("站点:{},未扫到码值:{}", staProtocol.getSiteId(), barcode); |
| | | //log.error("站点:{},未扫到码值:{}", staProtocol.getSiteId(), barcode); |
| | | return; |
| | | } |
| | | // 9991是空板,9992是满板 |
| | |
| | | staProtocol.setStaNo(inSta.getTargetSta()); |
| | | redis.push(RedisConveyorConstant.CONVEYOR_TASK_FLAG, staProtocol); |
| | | if (jobService.insert(initJob(locOfWms, barcode, workNo, inSta.getTargetSta() + ""))) { |
| | | log.info("申请入库成功,条码:{},站点:{}", barcode, inSta.getStaNo()); |
| | | News.info("申请入库成功,条码:{},站点:{}", barcode, inSta.getStaNo()); |
| | | //log.info("申请入库成功,条码:{},站点:{}", barcode, inSta.getStaNo()); |
| | | } |
| | | } else { |
| | | log.info("WMS未返回库位信息,条码:{},站点:{}", barcode, inSta.getStaNo()); |
| | | News.error("WMS未返回库位信息,条码:{},站点:{}", barcode, inSta.getStaNo()); |
| | | //log.info("WMS未返回库位信息,条码:{},站点:{}", barcode, inSta.getStaNo()); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.zy.acs.conveyor.core.operation.handler; |
| | | |
| | | import com.zy.acs.common.utils.News; |
| | | import com.zy.acs.common.utils.RedisSupport; |
| | | import com.zy.acs.conveyor.core.constant.RedisConveyorConstant; |
| | | import com.zy.acs.conveyor.core.enums.ConveyorStateType; |
| | |
| | | staProtocol.setStaNo(0); |
| | | redis.push(RedisConveyorConstant.CONVEYOR_TASK_FLAG, staProtocol); |
| | | |
| | | log.info("" + config.getMark() + "站点清空失败:{},{}", takeSta.getStaNo(), staProtocol.getWorkNo()); |
| | | job.setJobSts(ConveyorStateType.CLEARSIGNAL.getStatus()); |
| | | jobService.updateById(job); |
| | | |
| | | //log.info("" + config.getMark() + "站点清空:{},{}", takeSta.getStaNo(), staProtocol.getWorkNo()); |
| | | News.info("" + config.getMark() + "站点清空:{},{}", takeSta.getStaNo(), staProtocol.getWorkNo()); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.zy.acs.conveyor.core.operation.handler; |
| | | |
| | | import com.zy.acs.common.utils.News; |
| | | import com.zy.acs.common.utils.RedisSupport; |
| | | import com.zy.acs.conveyor.core.constant.RedisConveyorConstant; |
| | | import com.zy.acs.conveyor.core.enums.ConveyorStateType; |
| | |
| | | // 判断是否满足条件 |
| | | if (!staProtocol.isLoading()) { |
| | | if (staProtocol.getWorkNo() > 0) { |
| | | log.error("输送线上有任务号无货,需要人工处理:{}", staProtocol.getSiteId()); |
| | | News.error("输送线上有任务号无货,需要人工处理:{}", staProtocol.getSiteId()); |
| | | //log.error("输送线上有任务号无货,需要人工处理:{}", staProtocol.getSiteId()); |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | if (staProtocol.isAutoing() && staProtocol.getWorkNo() == 0) { |
| | | if (staProtocol.isInEnable()) { |
| | | log.error("没有可入信号:{}", staProtocol.getSiteId()); |
| | | News.error("没有可入信号:{}", staProtocol.getSiteId()); |
| | | //log.error("没有可入信号:{}", staProtocol.getSiteId()); |
| | | continue; |
| | | } |
| | | String seqNum = ctuMainService.checkStationStatus(releaseSta.getStaNo()); |
| | |
| | | log.info("输送线下发:{},{}", staProtocol.getWorkNo(), releaseSta.getTargetSta()); |
| | | } |
| | | } else { |
| | | log.info("站点信息不符合入库条件!!!" + " 调用RCS检验未通过,站点:{}", staProtocol.getSiteId()); |
| | | News.error("站点信息不符合入库条件!!!" + " 调用RCS检验未通过,站点:{}", staProtocol.getSiteId()); |
| | | //log.info("站点信息不符合入库条件!!!" + " 调用RCS检验未通过,站点:{}", staProtocol.getSiteId()); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.zy.acs.conveyor.core.operation.handler; |
| | | |
| | | |
| | | import com.zy.acs.common.utils.News; |
| | | import com.zy.acs.common.utils.RedisSupport; |
| | | import com.zy.acs.conveyor.controller.vo.OpenBusSubmitParam; |
| | | import com.zy.acs.conveyor.controller.vo.TaskDto; |
| | |
| | | // 判断是否满足条件 |
| | | if (!staProtocol.isLoading()) { |
| | | if (staProtocol.getWorkNo() > 0) { |
| | | log.error("输送线上有任务号无货,需要人工处理:{}", staProtocol.getSiteId()); |
| | | News.error("输送线上有货无任务号,需要人工处理:{}", staProtocol.getSiteId()); |
| | | //log.error("输送线上有任务号无货,需要人工处理:{}", staProtocol.getSiteId()); |
| | | } |
| | | continue; |
| | | } |
| | | if (staProtocol.getWorkNo() == 0) { |
| | | log.error("输送线上有货无任务号,需要人工处理:{}", staProtocol.getSiteId()); |
| | | News.error("输送线上有货无任务号,需要人工处理:{}", staProtocol.getSiteId()); |
| | | //log.error("输送线上有货无任务号,需要人工处理:{}", staProtocol.getSiteId()); |
| | | continue; |
| | | } |
| | | if (staProtocol.isAutoing()) { |
| | |
| | | } |
| | | } |
| | | } else { |
| | | log.error("输送线为自动,需要开启:{}", staProtocol.getSiteId()); |
| | | log.error("输送线未自动,需要开启:{}", staProtocol.getSiteId()); |
| | | } |
| | | } |
| | | } |