wu
2024-05-29 50ae51c95b795d509cc877b1df97762255498523
更改判断逻辑,减少对数据库的查询量
2个文件已修改
27 ■■■■ 已修改文件
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
@@ -49,14 +49,14 @@
        try {
            //获取联机状态
            String inkageStatus =plcParameterObject.getPlcParameter("MesToPlc").getValue();
            if("1".equals(inkageStatus)) {
                //获取是否有上片请求
                String loadRequest = plcParameterObject.getPlcParameter("loadRequest").getValue();
                String mesToPlc = plcParameterObject.getPlcParameter("MesToPlc").getValue();
            //获取是否有上片请求
            String loadRequest = plcParameterObject.getPlcParameter("loadRequest").getValue();
            //mes状态
            String mesToPlc = plcParameterObject.getPlcParameter("MesToPlc").getValue();
            if("1".equals(inkageStatus)&&"1".equals(loadRequest)) {
                //判断开始上片的工程号
                Engineering engineering = engineeringService.selectInitiate(1);
                if ("1".equals(loadRequest) && engineering != null) {
                if (engineering != null) {
                    log.info("开始上片任务");
                    UpPattenUsage upPattenUsage = upWorkstationService.selectPriority(engineering);
                    log.info("当有请求时查询当前上片顺序的玻璃信息{}", upPattenUsage);
@@ -75,10 +75,11 @@
                    }
                }
                if ("1".equals(mesToPlc) && "0".equals(loadRequest)) {
                    //请求字为零时,任务字清零
                    S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("MesToPlc").getAddress(), 0);
                }
            }
            if ("1".equals(mesToPlc) && "0".equals(loadRequest)) {
                //请求字为零时,任务字清零
                S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("MesToPlc").getAddress(), 0);
            }
            //执行后休眠300毫秒
            //Thread.sleep(300);
@@ -115,7 +116,7 @@
        }
    }
    @Scheduled(fixedDelay = 300)
    @Scheduled(fixedDelay = 1000)
    public void loadGlassHome(){
        JSONObject jsonObject = new JSONObject();
        //正在进行的任务
hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml
@@ -7,5 +7,5 @@
    name: loadGlass
mybatis-plus:
  mapper-locations: classpath*:mapper/*.xml
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#  configuration:
#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl