严智鑫
2024-03-26 8202416bb5fae55d50fd1d598acc56d79846f776
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.mes.service.CacheGlassService;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import com.mes.common.PlcTools.S7control;
import com.mes.entity.GlassInfo;
import com.mes.mapper.SelectInfo;
 
 
@Service
public class Logic {
    @Autowired
    private SelectInfo selectInfo;
    //识别逻辑
    public void identify(String Number){
        //查询任务
        // PlcParameterObject plcmes=PLCAutoMes.PlcMesObject;
        // S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1);
        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 imagePath){
        //查询消息队列里的玻璃
 
        //返回结果
    }
    //理片 出
    public void processOut(String imagePath){
        //查询任务
 
        //返回结果
    }
    //磨边
    public void processMb(String imagePath){
        //查询任务
 
        //返回结果
    }
 
    //查询消息队列里此玻璃ID的数据   
    public boolean SelectMessageId(String Number){
        //查询是否存在
        GlassInfo GlassInfo=selectInfo.SelectGlassId(Number);
        if(GlassInfo==null){
            return false;//返回 不存在
        }
        return true;//返回 存在
    }
    //删除消息队列里此玻璃ID的数据   
    public boolean DeleteMessageId(String Number){
        //查询是否存在
        GlassInfo GlassInfo=selectInfo.SelectGlassId(Number);
        if(GlassInfo==null){
            return false;//返回 不存在
        }
        return true;//返回 存在
    }
    //是否存在此编号玻璃 
    public boolean isExist(String Number){
        //查询是否存在
        GlassInfo GlassInfo=selectInfo.SelectGlassId(Number);
        if(GlassInfo==null){
            return false;//返回 不存在
        }
        return true;//返回 存在
    }
    
}