| | |
| | | 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; |
| | |
| | | // @Value("${mes.threshold}") |
| | | private int threshold; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void autoBindRack() { |
| | | log.info("根据缓存中已经进片的玻璃种数量最多的流程卡号自动绑定一个启用状态的空架子"); |
| | | |
| | |
| | | // return; |
| | | // } |
| | | // log.info("2、获取到的请求字为0,将确认字改为0"); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, (short) 0); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, 0); |
| | | // return; |
| | | // } |
| | | // if (!"0".equals(confirmationWrodValue)) { |
| | | // log.info("2、获取到的请求字不为0,将确认字改为0"); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, (short) 0); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, 0); |
| | | // return; |
| | | // } |
| | | |
| | |
| | | |
| | | } |
| | | log.info("9、发送确认字完成"); |
| | | //S7object.getinstance().plccontrol.WriteWord(MESSendingWord, (short) 1); |
| | | //S7object.getinstance().plccontrol.WriteWord(MESSendingWord, 1); |
| | | } |
| | | |
| | | /** |
| | |
| | | updateDetail.setState(Const.GLASS_STATE_OUT); |
| | | downStorageCageDetailsService.update(updateDetail, wrapper); |
| | | log.info("更新出片玻璃的状态为{}", Const.GLASS_STATE_OUT); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, (short) 2); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, 2); |
| | | |
| | | return true; |
| | | } |
| | |
| | | // 创建新的 DownGlassInfo 对象并设置相关属性 |
| | | DownGlassInfo newdownGlassInfo = new DownGlassInfo(); |
| | | |
| | | Integer maxSequence = downGlassInfoService.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId()); |
| | | Integer maxSequence = downGlassInfoService.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | // 初始化顺序字段值 |
| | | int sequence = maxSequence != null ? maxSequence + 1 : 1; |
| | | BeanUtils.copyProperties(downGlassInfo, newdownGlassInfo); |