wuyouming666
2024-04-17 5d70dcef9c9b4f7eb1cd092dcc4f4b8b802c5d30
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
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();
            }
        }
 
    }
}