springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
@@ -1,25 +1,17 @@ package com.example.springboot.component; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import com.example.springboot.service.JdbcConnections; import com.example.springboot.service.SpianServiceNew; import com.example.springboot.entity.north_glass_buffer1; import com.example.springboot.service.StorageCageService; import com.example.springboot.entity.device.PlcParameterObject; import com.example.springboot.mapper.AlarmMapper; import com.example.springboot.mapper.AlbaniaMapper; import com.example.springboot.mapper.SpianMapper; public class PlcHoldNew extends Thread { private AlarmMapper alarmMapper; @Autowired private JdbcConnections jdbcConnections; private AlbaniaMapper albaniaMapper; private SpianServiceNew spianService; private StorageCageService storageCageService; int aaa; @Override @@ -37,7 +29,7 @@ // if (S7control.getinstance().CheckConnected() == false) { spianService = WebSocketServer.applicationContext.getBean(SpianServiceNew.class); albaniaMapper = WebSocketServer.applicationContext.getBean(AlbaniaMapper.class); spianService.selectAll(albaniaMapper.SelectGlass()); // spianService.selectAll(albaniaMapper.SelectGlass()); //读取DB14区文件 PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; @@ -75,13 +67,12 @@ //完成确认字 for(int i=1;i<7;i++){ String Tastover=plcmes.getPlcParameter("IDStatus"+i).getValue();//依次获取任务类型 String Glassid=plcmes.getPlcParameter("MESID"+i).getValue();//依次获取任务类型 if(Tastover.equals("1")){ String Glassid=plcmes.getPlcParameter("MESID"+i).getValue();//依次获取任务ID int tastid=albaniaMapper.SelectTaskId(Glassid.substring(0,14)); storageCageService.FinishTask(tastid); //调用完成任务 Glassid S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStatus"+i).getAddress(), (short) 1);//完成确认字 } } } springboot-vue3/src/main/java/com/example/springboot/component/PlchomeNew.java
@@ -137,14 +137,14 @@ // public static PlcParameterObject PlcReadObject = initUtil.initword(PlcRead); // public static PlcParameterObject PlcframeObject = initUtil.initword(Plcframe); PlcParameterObject PlcParameter = PLCAutoMes.plcParameterObject;// plc参数地址DB100 PlcBitObject PlcTest = PLCAutoMes.plcPlcTest;// plc标识地址DB101 PlcBitObject PlcSign = PLCAutoMes.plcBitObject;// plc设备状态地址DB102 PlcParameterObject PlcState = PLCAutoMes.plcStateObject;// plc状态地址DB103 PlcBitObject PlcAlarm = PLCAutoMes.plcPlcAlarm;// plc报警地址DB104 PlcParameterObject MesMission = PLCAutoMes.PlcMesObject;// mes任MES务地址DB105 PlcParameterObject PLCMission = PLCAutoMes.PlcReadObject;// plc任务地址DB106 PlcParameterObject Plcframe = PLCAutoMes.PlcframeObject;// plc铝框地址DB17 // PlcParameterObject PlcParameter = PLCAutoMes.plcParameterObject;// plc参数地址DB100 // PlcBitObject PlcTest = PLCAutoMes.plcPlcTest;// plc标识地址DB101 // PlcBitObject PlcSign = PLCAutoMes.plcBitObject;// plc设备状态地址DB102 // PlcParameterObject PlcState = PLCAutoMes.plcStateObject;// plc状态地址DB103 // PlcBitObject PlcAlarm = PLCAutoMes.plcPlcAlarm;// plc报警地址DB104 // PlcParameterObject MesMission = PLCAutoMes.PlcMesObject;// mes任MES务地址DB105 // PlcParameterObject PLCMission = PLCAutoMes.PlcReadObject;// plc任务地址DB106 // PlcParameterObject Plcframe = PLCAutoMes.PlcframeObject;// plc铝框地址DB17 // if (S7control.getinstance().CheckConnected() == true) { springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
@@ -18,7 +18,7 @@ System.out.println("启动完成"); // new PlcHold().start(); // new PlcHoldNew().start(); new PlcHoldNew().start(); // new PLCAutoMes().start(); new Plchome().start(); springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java
@@ -46,6 +46,7 @@ //发送出片后增加已发数量 @Update("update glassinfo set finishnumber=finishnumber+1 where flowcard=#{flowcard} and mateid=#{mateid} and tier=#{tier};") void AddFinishNumber(String flowcard,int mateid,int tier); @Select("select id from storage_task where state=0 glassid=#{glassid} LIMIT 1") int SelectTaskId(String glassid); } springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
@@ -237,7 +237,7 @@ } //手动完成任务 public Result FinishTask(Integer tasktype, Integer id) { public Result FinishTask( Integer id) { StorageTask storageTask = homeMapper.SelectStorageTaskById(id);//获取任务信息 homeMapper.FinishTask(storageTask.getId());//完成任务 if(storageTask.getTaskType().equals("0")){