1、卧式理片笼对接过程中bug修复
2、上片机协议修改
3、临时解决json文件打包后读取不到文件问题
4、上片新增接口修改上片机联动请求
14个文件已修改
4个文件已添加
675 ■■■■■ 已修改文件
JsonFile/PlcCacheGlass.json 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JsonFile/PlcCacheVerticalGlass.json 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JsonFile/PlcLoadGlass.json 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JsonFile/PlcdownGlass.json 362 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/device/PlcParameterInfo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/S7object.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/S7object.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/controller/UpWorkstationController.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/mapper/LoadGlassMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/UpWorkstationService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/impl/UpWorkstationServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/JsonFile/PlcLoadGlass.json 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/common/S7object.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
JsonFile/PlcCacheGlass.json
New file
@@ -0,0 +1,64 @@
{
   "plcAddressBegin":"DB11.0",
   "plcAddressLenght":"80",
   "dataType":"word",
   "parameteInfor":[
      {
         "codeId": "A06_request_word",
         "addressIndex":"0",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
          "codeId": "A05_scanning_ID",
          "addressIndex":"2",
          "addressLenght":"30",
          "ratio":"1",
          "unit":""
       },
       {
          "codeId": "Current_slot",
          "addressIndex":"36",
          "addressLenght":"2",
          "ratio":"1",
          "unit":""
       },
        {
          "codeId": "MES_confirmation_word",
          "addressIndex":"38",
          "addressLenght":"2",
          "ratio":"1",
          "unit":""
       },
       {
          "codeId": "A08_glass_status",
          "addressIndex":"68",
          "addressLenght":"2",
          "ratio":"1",
          "unit":""
       },
       {
          "codeId": "A10_glass_status",
          "addressIndex":"70",
          "addressLenght":"2",
          "ratio":"1",
          "unit":""
       },
       {
          "codeId": "A09_prohibit_film_production",
          "addressIndex":"72",
          "addressLenght":"2",
          "ratio":"1",
          "unit":""
       }
       ,
       {
          "codeId": "A10_prohibit_film_production",
          "addressIndex":"74",
          "addressLenght":"2",
          "ratio":"1",
          "unit":""
       }
   ]
}
JsonFile/PlcCacheVerticalGlass.json
New file
@@ -0,0 +1,57 @@
{
  "plcAddressBegin":"DB.0",
  "plcAddressLenght":"72",
  "dataType":"word",
  "parameteInfor":[
    {
      "codeId": "D01Request",
      "addressIndex":"0",
      "addressLenght":"2",
      "ratio":"1",
      "unit":"m/min"
    },
    {
      "codeId": "D01ID1",
      "addressIndex":"2",
      "addressLenght":"6",
      "ratio":"1",
      "unit":""
    },
    {
      "codeId": "D04Request",
      "addressIndex":"8",
      "addressLenght":"2",
      "ratio":"1",
      "unit":""
    },
    {
      "codeId": "D04ID1",
      "addressIndex":"10",
      "addressLenght":"6",
      "ratio":"1",
      "unit":""
    },
    {
      "codeId": "D02Go",
      "addressIndex":"20",
      "addressLenght":"2",
      "ratio":"1",
      "unit":""
    },
    {
      "codeId": "D05Go",
      "addressIndex":"22",
      "addressLenght":"2",
      "ratio":"1",
      "unit":""
    }
  ,
    {
      "codeId": "DeviceStatus",
      "addressIndex":"70",
      "addressLenght":"2",
      "ratio":"1",
      "unit":""
    }
  ]
}
JsonFile/PlcLoadGlass.json
New file
@@ -0,0 +1,78 @@
{
  "plcAddressBegin":"DB1.2000",
  "plcAddressLenght":"100",
  "dataType":"word",
  "parameteInfor":[
    {
      "codeId": "loadRequest",
      "addressIndex":"0",
      "addressLenght":"2",
      "ratio":"1",
      "unit":"m/min"
    },
    {
      "codeId": "PlcStatus",
      "addressIndex":"10",
      "addressLenght":"2",
      "ratio":"1",
      "unit":""
    },
    {
      "codeId": "MesToPlc",
      "addressIndex":"20",
      "addressLenght":"2",
      "ratio":"1",
      "unit":""
    },
    {
      "codeId": "InkageStatus",
      "addressIndex":"22",
      "addressLenght":"2",
      "ratio":"1",
      "unit":""
    },
    {
      "codeId": "WorkId",
      "addressIndex":"24",
      "addressLenght":"2",
      "ratio":"1",
      "unit":""
    },
    {
      "codeId": "GlassWidth",
      "addressIndex":"26",
      "addressLenght":"2",
      "ratio":"1",
      "unit":""
    },
    {
      "codeId": "GlassHeight",
      "addressIndex":"28",
      "addressLenght":"2",
      "ratio":"1",
      "unit":""
    }
  ,
    {
      "codeId": "MesToPlcStatus",
      "addressIndex":"40",
      "addressLenght":"2",
      "ratio":"1",
      "unit":""
    },
    {
      "codeId": "MesToPlcStatusId",
      "addressIndex":"42",
      "addressLenght":"2",
      "ratio":"1",
      "unit":""
    },
    {
      "codeId": "MesTaskStatus",
      "addressIndex":"56",
      "addressLenght":"2",
      "ratio":"1",
      "unit":""
    }
  ]
}
JsonFile/PlcdownGlass.json
New file
@@ -0,0 +1,362 @@
{
  "plcAddressBegin": "DB100.0",
  "plcAddressLenght": "142",
  "dataType": "word",
  "parameteInfor": [
    {
      "codeId": "RequestWord",
      "addressIndex": "0",
      "addressLenght": "2"
    },
    {
      "codeId": "G04ID",
      "addressIndex": "2",
      "addressLenght": "2"
    },
    {
      "codeId": "G06RobotTaskRequestWord",
      "addressIndex": "4",
      "addressLenght": "2"
    },
    {
      "codeId": "G06ID",
      "addressIndex": "6",
      "addressLenght": "2"
    },
    {
      "codeId": "G11RobotTaskRequestWord",
      "addressIndex": "8",
      "addressLenght": "2"
    },
    {
      "codeId": "G011ID",
      "addressIndex": "10",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "12",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "14",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "16",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "18",
      "addressLenght": "2"
    },
    {
      "codeId": "MESSendingWord",
      "addressIndex": "20",
      "addressLenght": "2"
    },
    {
      "codeId": "InputGrid",
      "addressIndex": "22",
      "addressLenght": "2"
    },
    {
      "codeId": "OutputGrid",
      "addressIndex": "24",
      "addressLenght": "2"
    },
    {
      "codeId": "OutputID",
      "addressIndex": "26",
      "addressLenght": "2"
    },
    {
      "codeId": "FrontOrRearLowerSlice",
      "addressIndex": "28",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "30",
      "addressLenght": "2"
    },
    {
      "codeId": "G06RobotTaskReply",
      "addressIndex": "32",
      "addressLenght": "2"
    },
    {
      "codeId": "G06Rack",
      "addressIndex": "34",
      "addressLenght": "2"
    },
    {
      "codeId": "G11RobotTaskReply",
      "addressIndex": "36",
      "addressLenght": "2"
    },
    {
      "codeId": "G11Rack",
      "addressIndex": "38",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "40",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "42",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "44",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "46",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "48",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "50",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "52",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "54",
      "addressLenght": "2"
    },
    {
      "codeId": "MESTaskState",
      "addressIndex": "56",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "58",
      "addressLenght": "2"
    },
    {
      "codeId": "AlarmState",
      "addressIndex": "60",
      "addressLenght": "2"
    },
    {
      "codeId": "Alarm1",
      "addressIndex": "62",
      "addressLenght": "2"
    },
    {
      "codeId": "Alarm2",
      "addressIndex": "64",
      "addressLenght": "2"
    },
    {
      "codeId": "Alarm3",
      "addressIndex": "66",
      "addressLenght": "2"
    },
    {
      "codeId": "Alarm4",
      "addressIndex": "68",
      "addressLenght": "2"
    },
    {
      "codeId": "neirong",
      "addressIndex": "70",
      "addressLenght": "2"
    },
    {
      "codeId": "device",
      "addressIndex": "72",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "74",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "76",
      "addressLenght": "2"
    },
    {
      "codeId": "InOut1",
      "addressIndex": "78",
      "addressLenght": "2"
    },
    {
      "codeId": "InOut2",
      "addressIndex": "80",
      "addressLenght": "2"
    },
    {
      "codeId": "InOut3",
      "addressIndex": "82",
      "addressLenght": "2"
    },
    {
      "codeId": "InOut4",
      "addressIndex": "84",
      "addressLenght": "2"
    },
    {
      "codeId": "InOut5",
      "addressIndex": "86",
      "addressLenght": "2"
    },
    {
      "codeId": "InOut6",
      "addressIndex": "88",
      "addressLenght": "2"
    },
    {
      "codeId": "InOut7",
      "addressIndex": "90",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "92",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "94",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "96",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "98",
      "addressLenght": "2"
    },
    {
      "codeId": "spare",
      "addressIndex": "100",
      "addressLenght": "2"
    },
    {
      "codeId": "G04ActionState",
      "addressIndex": "102",
      "addressLenght": "2"
    },
    {
      "codeId": "G05ActionState",
      "addressIndex": "104",
      "addressLenght": "2"
    },
    {
      "codeId": "G06ActionState",
      "addressIndex": "106",
      "addressLenght": "2"
    },
    {
      "codeId": "G07ActionState",
      "addressIndex": "108",
      "addressLenght": "2"
    },
    {
      "codeId": "G08ActionState",
      "addressIndex": "110",
      "addressLenght": "2"
    },
    {
      "codeId": "G09ActionState",
      "addressIndex": "112",
      "addressLenght": "2"
    },
    {
      "codeId": "G10ActionState",
      "addressIndex": "114",
      "addressLenght": "2"
    },
    {
      "codeId": "G11ActionState",
      "addressIndex": "116",
      "addressLenght": "2"
    },
    {
      "codeId": "G12ActionState",
      "addressIndex": "118",
      "addressLenght": "2"
    },
    {
      "codeId": "G13ActionState",
      "addressIndex": "120",
      "addressLenght": "2"
    },
    {
      "codeId": "G04IDS",
      "addressIndex": "122",
      "addressLenght": "2"
    },
    {
      "codeId": "G05IDS",
      "addressIndex": "124",
      "addressLenght": "2"
    },
    {
      "codeId": "G06IDS",
      "addressIndex": "126",
      "addressLenght": "2"
    },
    {
      "codeId": "G07IDS",
      "addressIndex": "128",
      "addressLenght": "2"
    },
    {
      "codeId": "G08IDS",
      "addressIndex": "130",
      "addressLenght": "2"
    },
    {
      "codeId": "G09IDS",
      "addressIndex": "132",
      "addressLenght": "2"
    },
    {
      "codeId": "G10IDS",
      "addressIndex": "134",
      "addressLenght": "2"
    },
    {
      "codeId": "G11IDS",
      "addressIndex": "136",
      "addressLenght": "2"
    },
    {
      "codeId": "G12IDS",
      "addressIndex": "138",
      "addressLenght": "2"
    },
    {
      "codeId": "G13ID",
      "addressIndex": "140",
      "addressLenght": "2"
    }
  ]
}
hangzhoumesParent/common/servicebase/src/main/java/com/mes/device/PlcParameterInfo.java
@@ -105,7 +105,7 @@
        if (addressLength < 2) {
            return null;
        }
        int wordindex = index;
        int wordindex = Integer.parseInt(stringdatas[1]) + index;
        return stringdatas[0] + "." + wordindex;
      /*  if (addressLength == 2) {
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/S7object.java
@@ -6,7 +6,6 @@
import com.mes.tools.S7control;
/**
 * @Author : zhoush
 * @Date: 2024/4/9 15:13
@@ -25,10 +24,9 @@
    private S7object() {
        if (plccontrol == null) {
            plccontrol = new S7control(plcType, ip, port, 0, 0);
            String PlcCacheGlass=S7object.class.getResource("/JsonFile/PlcCacheGlass.json").getPath();
            //log.info(PLCAutoMes.class.getResource("").getPath());
            PlcMesObject = InitUtil.initword(PlcCacheGlass);
            String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcCacheGlass.json";
//            String PlcLoadGlass=S7object.class.getResource("/JsonFile/PlcCacheGlass.json").getPath();
            PlcMesObject = InitUtil.initword(PlcLoadGlass);
        }
    }
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageServiceImpl.java
@@ -1,5 +1,6 @@
package com.mes.edgstoragecage.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
@@ -37,14 +38,18 @@
    @Override
    public EdgStorageCage selectNearestEmpty(int currentSlot) {
        return this.selectJoinOne(EdgStorageCage.class, new MPJLambdaWrapper<EdgStorageCage>()
        List<EdgStorageCage> emptyList = this.selectJoinList(EdgStorageCage.class, new MPJLambdaWrapper<EdgStorageCage>()
                .selectAll(EdgStorageCage.class)
                .leftJoin(EdgStorageCageDetails.class, on -> on
                        .eq(EdgStorageCageDetails::getSlot, EdgStorageCage::getSlot)
                        .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN))
                .isNull(EdgStorageCageDetails::getSlot)
                .last("order by abs(t.slot - " + currentSlot + ")  asc limit 1")
                .last("order by abs(t.slot - " + currentSlot + ")  asc limit 2")
        );
        if (CollectionUtil.isEmpty(emptyList) || emptyList.size() < 2) {
            return null;
        }
        return emptyList.get(0);
    }
    /**
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
@@ -55,7 +55,7 @@
    /**
     * 膜系
     */
    private Integer filmsid;
    private String filmsid;
    /**
     * 磨前宽
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java
@@ -7,6 +7,7 @@
import com.github.yulichang.query.MPJQueryWrapper;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.mes.common.S7object;
import com.mes.common.WebSocketServer;
import com.mes.common.config.Const;
import com.mes.device.PlcParameterObject;
import com.mes.edgglasstask.entity.EdgGlassTaskInfo;
@@ -51,6 +52,9 @@
    @Autowired
    EdgGlassTaskInfoService edgGlassTaskInfoService;
    @Autowired
    WebSocketServer webServerService;
    @Value("${mes.threshold}")
    private int threshold;
@@ -111,6 +115,27 @@
                inTo(glassIdeValue, confirmationWrodAddress, currentSlot);
            }
        }
    }
    public void plcToHomeEdgTask() {
        // log.info("推数据");
        // jsonObject.append("params", new short[] { 30, 40, });
//        ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Home");
//        if (sendwServer != null) {
//            for (WebSocketServer webserver : sendwServer) {
//                webserver.sendMessage(jsonObject.toString());
//                if (webserver != null) {
//
//                    List<String> messages = webserver.getMessages();
//
//                    if (!messages.isEmpty()) {
//                        // // 将最后一个消息转换为整数类型的列表
//                        webserver.clearMessages();
//                    }
//                }
//
//            }
//        }
    }
    /**
@@ -191,7 +216,7 @@
            }
            EdgStorageCageDetails a09EdgGlass = queryGlassByTaskCache(Const.A09_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT);
            EdgStorageCageDetails a10EdgGlass = queryGlassByTaskCache(Const.A10_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT);
            endcell = queryLineByGlassInfo(a09EdgGlass, a10EdgGlass, glassInfo, out08Glassstate, out08Glassstate);
            endcell = queryLineByGlassInfo(a09EdgGlass, a10EdgGlass, glassInfo, out08Glassstate, out10Glassstate);
        } else {
            //判断两条线是否都空闲
            endcell = out08Glassstate == 1 ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION;
@@ -249,11 +274,13 @@
    private List<EdgStorageCageDetails> queryEdgAllGlass(String glassId) {
        List<EdgStorageCageDetails> glassList = new ArrayList<>();
        //获取待进片玻璃
        if(StringUtils.isNotBlank(glassId)){
        GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>()
                .eq(GlassInfo::getGlassId, glassId));
        EdgStorageCageDetails resultDetails = new EdgStorageCageDetails();
        BeanUtils.copyProperties(one, resultDetails);
        glassList.add(resultDetails);
        }
        //获取笼内玻璃
        List<EdgStorageCageDetails> details = edgStorageCageDetailsService.list(new LambdaQueryWrapper<EdgStorageCageDetails>()
                .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN));
@@ -399,9 +426,13 @@
        MPJLambdaWrapper<EdgStorageCageDetails> wrapper = new MPJLambdaWrapper<>();
        wrapper.select(EdgStorageCageDetails::getWidth, EdgStorageCageDetails::getHeight)
                .selectCount(EdgStorageCageDetails::getGlassId, EdgStorageCageDetails::getCount)
                .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)
                .groupBy(EdgStorageCageDetails::getWidth, EdgStorageCageDetails::getHeight)
                .last("order by count(t.glass_id) desc limit 2");
        List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(wrapper);
        if (CollectionUtil.isEmpty(list)){
            return null;
        }
        log.info("获取笼子内数量前二的玻璃数量:{}", list);
        //获取宽高拍第一的玻璃信息
        EdgStorageCageDetails firstSize = list.get(0);
@@ -526,7 +557,7 @@
    private boolean saveGlassSize(EdgStorageCageDetails glassInfo) {
        EdgGlassTaskInfo edgGlassTaskInfo = new EdgGlassTaskInfo();
        BeanUtils.copyProperties(glassInfo, edgGlassTaskInfo);
        edgGlassTaskInfo.setHeight((int) (glassInfo.getEdgHeight() * ratio));
        edgGlassTaskInfo.setHeight((int) (glassInfo.getHeight() * ratio));
        edgGlassTaskInfo.setWidth((int) (glassInfo.getWidth() * ratio));
        edgGlassTaskInfo.setThickness((int) (glassInfo.getThickness() * ratio));
        edgGlassTaskInfo.setStatus(Const.EDG_GLASS_BEFORE);
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/S7object.java
@@ -24,9 +24,7 @@
    private S7object() {
        if (plccontrol == null) {
            plccontrol = new S7control(plcType, ip, port, 0, 0);
            String PlcLoadGlass=S7object.class.getResource("/JsonFile/PlcCacheVerticalGlass.json").getPath();
            //log.info(PLCAutoMes.class.getResource("").getPath());
            String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcCacheVerticalGlass.json";
            PlcMesObject = InitUtil.initword(PlcLoadGlass);
        }
    }
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
@@ -2,9 +2,10 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
 * <p>
@@ -54,7 +55,7 @@
    /**
     * 膜系
     */
    private Integer filmsid;
    private String filmsid;
    /**
     * 磨前宽
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java
@@ -13,8 +13,8 @@
 */
public class S7object extends Thread {
    public S7control plccontrol; // PLC通讯类实例
    private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型
    private String ip = "192.168.10.1"; // plc ip地址
    private EPlcType plcType = EPlcType.S200_SMART; // 西门子PLC类型
    private String ip = "192.168.10.100"; // plc ip地址
    private int port = 102; // plc 端口号
@@ -24,9 +24,7 @@
    private S7object() {
        if (plccontrol == null) {
            plccontrol = new S7control(plcType, ip, port, 0, 0);
            String PlcLoadGlass = S7object.class.getResource("/JsonFile/PlcLoadGlass.json").getPath();
            //log.info(PLCAutoMes.class.getResource("").getPath());
            String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcLoadGlass.json";
            PlcMesObject = InitUtil.initword(PlcLoadGlass);
        }
    }
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/controller/UpWorkstationController.java
@@ -2,8 +2,6 @@
import com.mes.utils.Result;
import com.mes.workstation.entity.GlassInfo;
import com.mes.workstation.entity.UpWorkSequence;
import com.mes.workstation.entity.UpWorkstation;
import com.mes.workstation.service.UpWorkstationService;
import io.swagger.annotations.ApiOperation;
@@ -55,5 +53,14 @@
//
//    }
    @ApiOperation("修改上片mes联动请求字")
    @PostMapping("/updateMesInkageLoad")
    @ResponseBody
    public Result<String> updateMesInkageLoad(@RequestBody short inKageWord) {
        String result = upWorkstationService.updateMesInkageLoad(inKageWord);
        return Result.success(result);
    }
}
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/mapper/LoadGlassMapper.java
@@ -11,7 +11,7 @@
public interface LoadGlassMapper extends BaseMapper<UpWorkstation> {
    //判断优先工位吸片
    @Select("select b.layout_sequence,a.number from up_workstation a left join up_patten_usage b " +
            "on a.pattern_width=b.width and a.pattern_heigth=b.width " +
            "on a.pattern_width=b.width and a.pattern_height=b.height " +
            "and a.pattern_thickness=b.thickness where a.workstation_id=#{id}")
    Map<String, Object> selectPriority(int id);
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/UpWorkstationService.java
@@ -37,5 +37,6 @@
    void updateGlassMessage(UpWorkstation upwork);
    String updateMesInkageLoad(short inKageWord);
}
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/impl/UpWorkstationServiceImpl.java
@@ -3,10 +3,11 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.common.S7object;
import com.mes.device.PlcParameterObject;
import com.mes.engineering.entity.Engineering;
import com.mes.uppattenusage.entity.UpPattenUsage;
import com.mes.uppattenusage.mapper.UpPattenUsageMapper;
import com.mes.workstation.entity.UpWorkSequence;
import com.mes.workstation.entity.UpWorkstation;
import com.mes.workstation.mapper.UpWorkstationMapper;
import com.mes.workstation.service.UpWorkstationService;
@@ -84,7 +85,12 @@
            }
        }
    @Override
    public String updateMesInkageLoad(short inKageWord) {
        PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
        log.info("修改设备两栋请求为{}:0联线;1联动", inKageWord);
        S7object.getinstance().plccontrol.WriteWord(plcParameterObject.getPlcParameter("InkageStatus").getAddress(), inKageWord);
        return "success";
}
}
hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/JsonFile/PlcLoadGlass.json
@@ -1,6 +1,6 @@
{
  "plcAddressBegin":"DB14.0",
  "plcAddressLenght":"98",
  "plcAddressBegin":"DB1.2000",
  "plcAddressLenght":"100",
  "dataType":"word",
  "parameteInfor":[
    {
@@ -25,6 +25,13 @@
      "unit":""
    },
    {
          "codeId": "InkageStatus",
          "addressIndex":"22",
          "addressLenght":"2",
          "ratio":"1",
          "unit":""
    },
    {
      "codeId": "WorkId",
      "addressIndex":"24",
      "addressLenght":"2",
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/common/S7object.java
@@ -24,9 +24,7 @@
    private S7object() {
        if (plccontrol == null) {
            plccontrol = new S7control(plcType, ip, port, 0, 0);
            String PlcCacheGlass=S7object.class.getResource("/JsonFile/PlcdownGlass.json").getPath();
            //log.info(PLCAutoMes.class.getResource("").getPath());
            String PlcCacheGlass = System.getProperty("user.dir") + "/JsonFile/PlcdownGlass.json";
            PlcMesObject = InitUtil.initword(PlcCacheGlass);
        }
    }