huang
2025-05-20 2c2413760b6467bf62402dba7338bd3bbcbd7341
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineThread.java
@@ -13,6 +13,7 @@
import com.mes.service.PlcParameter;
import com.mes.utils.HexUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.protocol.HTTP;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -42,6 +43,23 @@
    public Long machineId = 2L;
    public List<Map> sendRecords = new ArrayList<>();
//    public void plcStart1(PlcAgreement plcAgreement,String zuKey) {
//        //逻辑组 :请求组,完成组,其他组
//        //List<Map<String,String>> map=new ArrayList<>();//逻辑组
//        Map<String,Map<String,Map<String,String>>> map=new HashMap<>();//请求逻辑组
//        Map<String,Map<String,String>> zuMap=map.get(zuKey);
//
//        for(String key:map.keySet()){
//            boolean istrue=false;
//            if(plcAgreement.getPlcParameter(key).getValueString()==map.get(key)){
//                istrue=true;
//            }
//            map.put(key,plcAgreement.getPlcParameter(key).getValueString());
//        }
//
//    }
    public void plcStart() {
        Machine machine=machineMapper.selectById(machineId);
        ModbusTcp modbusTcp1 =new ModbusTcp(machine.getIp(),machine.getPort(),"PlcLoad");