| | |
| | | package com.mes.component; |
| | | |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.impl.BigStorageCageServiceImpl; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.impl.TemperingGlassInfoServiceImpl; |
| | | import com.mes.uppattenusage.entity.GlassInfo; |
| | | import com.mes.uppattenusage.service.impl.GlassInfoServiceImpl; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.List; |
| | |
| | | public class PlcStorageCage extends Thread { |
| | | |
| | | @Autowired |
| | | private BigStorageCageServiceImpl bigStorageCageServiceImpl; |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Autowired |
| | | private TemperingGlassInfoServiceImpl temperingGlassInfoServiceImpl; |
| | | private BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Autowired |
| | | private GlassInfoServiceImpl glassInfoServiceImpl; |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | |
| | | Thread.sleep(500); |
| | | String plcFeedReq ="0"; |
| | | String plcFeedGlassid ="111"; |
| | | String plcFeedReq = "0"; |
| | | String plcFeedGlassid = "111"; |
| | | //Plc进片请求时 |
| | | if("1".equals(plcFeedReq)){ |
| | | BigStorageCageDetails bigStorageCageDetails=new BigStorageCageDetails(); |
| | | if ("1".equals(plcFeedReq)) { |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | //传入玻璃id |
| | | GlassInfo glassInfo=glassInfoServiceImpl.getById(plcFeedGlassid); |
| | | GlassInfo glassInfo = glassInfoService.getById(plcFeedGlassid); |
| | | |
| | | BigStorageCageDetails SlotInfo=bigStorageCageServiceImpl.FeedGlass(glassInfo,bigStorageCageDetails); |
| | | if(SlotInfo!=null){ |
| | | //发送任务给Plc |
| | | BigStorageCageDetails SlotInfo = bigStorageCageService.feedGlass(glassInfo, bigStorageCageDetails); |
| | | if (SlotInfo != null) { |
| | | //plc任务发送字 |
| | | } |
| | | } |
| | | |
| | | //出片请求 |
| | | String plcOutReq ="0"; |
| | | if("1".equals(plcOutReq)){ |
| | | String plcOutReq = "0"; |
| | | boolean result = false; |
| | | if ("1".equals(plcOutReq)) { |
| | | //获取钢化小片表未出笼信息 |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoServiceImpl.SelectTemperingGlassInfo(); |
| | | //没有可出的玻璃时 |
| | | if(temperingGlassInfoList!=null){ |
| | | //查询是否有小片全部到齐的钢化版图 |
| | | }else{ |
| | | //继续当前钢化版图的任务 |
| | | temperingGlassInfoServiceImpl.addOutTask(temperingGlassInfoList); |
| | | |
| | | |
| | | if (result == true) { |
| | | //plc任务发送字 |
| | | } |
| | | } |
| | | |