| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | |
| | | DownGlassInfoService downGlassInfoService; |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private DownWorkstationTaskService downWorkstationTaskService; |
| | | |
| | | // @Value("${mes.threshold}") |
| | | private int threshold; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void autoBindRack() { |
| | | log.info("根据缓存中已经进片的玻璃种数量最多的流程卡号自动绑定一个启用状态的空架子"); |
| | | |
| | | List<DownStorageCageDetails> Details = downStorageCageService.selectCacheMax(); |
| | | if (Details.size() > 0) { |
| | | DownStorageCageDetails downStorageCageDetails = Details.get(0); |
| | | String flowCardId = downStorageCageDetails.getFlowCardId(); |
| | | int glassInfoCount = glassInfoService.getGlassInfoCountByFlowCardId(flowCardId); |
| | | DownWorkstation downWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getFlowCardId, null)); |
| | | List<DownWorkstation> downWorkstations = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getEnableState, 1)); |
| | | |
| | | if (!downWorkstations.stream().anyMatch(workstation -> workstation.getFlowCardId().equals(flowCardId))) { |
| | | downWorkstationService.updateFlowCardIdAndCount(flowCardId, glassInfoCount, downWorkstation.getWorkstationId()); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void plcdownGlassTask() { |
| | |
| | | //自动绑定架子,如果工位表没有绑定架子,默认将笼子中数量最多的流程卡号绑定机器手2的空架子 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 进片任务 |
| | | * |
| | | * @param glassId |
| | | * @param confirmationWrodAddress |
| | | * @param |
| | |
| | | DownStorageCageDetails item = list.get(0); |
| | | |
| | | |
| | | |
| | | log.info("5、查询卧式理片笼里面的空格:{}", list); |
| | | log.info("6、将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo); |
| | | DownStorageCageDetails details = new DownStorageCageDetails(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | log.info("9、发送确认字完成"); |
| | | //S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 1); |
| | |
| | | * 出片任务 |
| | | * |
| | | * @param confirmationWrodAddress |
| | | * |
| | | */ |
| | | private Boolean outTo(String confirmationWrodAddress) { |
| | | log.info("单片情况根据传入的料架号 查询符合按照版图id和片序出片,并且优先出满架的小片"); |
| | |
| | | // S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 2); |
| | | |
| | | return true; |
| | | } else if (!list2.isEmpty() && !list3.isEmpty()) { |
| | | } |
| | | else if (!list2.isEmpty() && !list3.isEmpty()) { |
| | | log.info("前后端都空闲 优先后端出片并且优先满架"); |
| | | DownStorageCageDetails item4 = list2.get(0); |
| | | |