ZengTao
2024-04-29 7687eb6cc76ab8ca20b39e7567255939abc4ff66
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -12,6 +12,8 @@
import java.util.Map;
import com.example.springboot.service.*;
import org.apache.ibatis.annotations.Result;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.springboot.entity.Glass;
@@ -51,6 +53,8 @@
    public static Boolean FeedState = false;
    public static StringBuilder feedglassid;
    // public Plchome() throws IOException {
    // config = new Configuration("config.properties");
    // }
@@ -61,6 +65,7 @@
    public void run() {
        while (this != null) {
            JSONObject jsonObject = new JSONObject();
            jsonObject.append("feedglassid", feedglassid);
            try {
                Thread.sleep(1000);
                // 注入mapper
@@ -216,7 +221,7 @@
                    // }
                    // // 获取铝框idDB106.DBW64,添加到出片队列
                    // String frameno="X21763329601FB";
                    String frameno = spianService.queGlassid("DB103.270", 14).toString();
                    String frameno = spianService.queGlassid("DB103.270", 11).toString();
                    if (!frameno.equals(Plchome.FrameNo)) {
                        Plchome.FrameNo = frameno;
                        try {
@@ -272,11 +277,16 @@
                    // jsonObject.append("D01RequestState", D01RequestState);
                    // 自动进片
                    if (isConfirm == true && form3.getglassId() != null && form3.getglassId() != "") {
                        if ((form3.getglassheight() < 380 || form3.getglasswidth() < 390
                                || form3.getglassheight() > 1810
                                || form3.getglasswidth() > 2760)
                                || (form3.getglassheight() < 390 || form3.getglasswidth() < 380
                                        || form3.getglassheight() > 2760 || form3.getglasswidth() > 1810)) {
                        double width = 0;
                        double height = 0;
                        if (form3.getglassheight() < form3.getglasswidth()) {
                            height = form3.getglassheight();
                            width = form3.getglasswidth();
                        } else {
                            height = form3.getglasswidth();
                            width = form3.getglassheight();
                        }
                        if (height < 380 || width < 380 || height > 1810 || width > 2760) {
                            FeedState = true;
                            jsonObject.append("FeedState", FeedState);
                            FeedState = false;
@@ -286,13 +296,7 @@
                            }
                        }
                    }
                }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            boolean dbconnected = false;
            try {
                dbserve.getConn();
@@ -321,6 +325,10 @@
                }
            }
            } catch (InterruptedException | SQLException e) {
                e.printStackTrace();
            }
        }
    }
}