wuyouming666
2024-04-18 78ca7ed85c42d183b5c0c039a9d3897f1529339a
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownGlassCacheLogic.java
@@ -18,6 +18,8 @@
import java.util.List;
import static jdk.nashorn.internal.runtime.regexp.joni.Config.log;
@Data
@Service
public class DownGlassCacheLogic {
@@ -35,20 +37,20 @@
     * @param Number //识别逻辑    不交互
     */
    public void identify(String Number) {
        //查询任务
        PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 1);
        String s = S7control.getinstance().ReadWord("DB14.26", 1).get(0) + "";
        boolean isexist = isExist(Number);
        if (isexist) {
            //存在逻辑    1.添加信息 2.回复PLC存在
//    public void identify(String Number) {
//        //查询任务
//        PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
            //S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1);
        } else {
            //不存在逻辑  1.回复PLC不存在
            //S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 2);
        }
    }
//        String s = S7control.getinstance().ReadWord("DB14.26", 1).get(0) + "";
//        boolean isexist = isExist(Number);
//        if (isexist) {
//            //存在逻辑    1.添加信息 2.回复PLC存在
//            //S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1);
//        } else {
//            //不存在逻辑  1.回复PLC不存在
//            //S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 2);
//        }
//    }
    public void process() {
        String result = S7control.getinstance().ReadWord("DB14.0", 1).get(0) + "";
@@ -84,10 +86,11 @@
        PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
        //存在此玻璃编号
        if (GlassInfo != null) {
            //同钢化版图内的栅格号
            //同钢化版图内的栅格号    找到相同版图id并且大于前面的顺序的空格
            List<DownStorageCageDetails> list = selectInfo.SelectIsExistIntoCache(GlassInfo.getTemperingLayoutId(), GlassInfo.getTemperingFeedSequence(), GlassInfo.getWidth());
            //空栅格号
            if (list.size() == 0) {
                //查询笼子内空闲
                list = selectInfo.SelectCacheLeisure();
            }
            //小于此玻璃钢化版图序号的栅格号
@@ -102,6 +105,7 @@
                selectInfo.insertCacheTask(GlassInfo.getId() + "", "0", item.getSlot() + "", "1", GlassInfo.getWidth(), GlassInfo.getHeight(), GlassInfo.getFilmsid(), GlassInfo.getThickness(), GlassInfo.getFlowcardId());
                S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 1);
               //完成后插入小片数据到缓存表
                return true;
            }
@@ -119,6 +123,7 @@
        String G11 = S7control.getinstance().ReadWord("DB14.58", 1).get(0) + "";
        String G13 = S7control.getinstance().ReadWord("DB14.58", 1).get(0) + "";
        PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
        log.println("666"); ;
        List<DownStorageCageDetails> list = selectInfo.SelectCacheOut(1, 5);
        List<DownStorageCageDetails> list2 = selectInfo.SelectCacheOut(6, 10);
        List<DownStorageCageDetails> list3 = selectInfo.SelectCacheOut(1, 10);