package com.mes.component; import com.mes.bigstorage.entity.BigStorageCageDetails; import com.mes.bigstorage.service.BigStorageCageDetailsService; import com.mes.bigstorage.service.BigStorageCageService; import com.mes.glassinfo.entity.GlassInfo; import com.mes.glassinfo.service.GlassInfoService; import com.mes.temperingglass.service.TemperingGlassInfoService; import org.springframework.beans.factory.annotation.Autowired; public class PlcStorageCage extends Thread { @Autowired private BigStorageCageService bigStorageCageService; @Autowired private BigStorageCageDetailsService bigStorageCageDetailsService; @Autowired private TemperingGlassInfoService temperingGlassInfoService; @Autowired private GlassInfoService glassInfoService; @Override public void run() { while (this != null) { try { Thread.sleep(500); String plcFeedReq = "0"; String plcFeedGlassid = "111"; //Plc进片请求时 if ("1".equals(plcFeedReq)) { BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); //传入玻璃id GlassInfo glassInfo = glassInfoService.getById(plcFeedGlassid); BigStorageCageDetails SlotInfo = bigStorageCageService.feedGlass(glassInfo, bigStorageCageDetails); if (SlotInfo != null) { //plc任务发送字 } } //出片请求 String plcOutReq = "0"; boolean result = false; if ("1".equals(plcOutReq)) { //获取钢化小片表未出笼信息 if (result == true) { //plc任务发送字 } } } catch (Exception e) { e.printStackTrace(); } } } }