| | |
| | | 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 |
| | |
| | | // 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; |
| | | |
| | |
| | | |
| | | //完成确认字 |
| | | 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);//完成确认字 |
| | | } |
| | | |
| | | } |
| | | } |
| | | |