| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.ReportToDismantleTheStackHandler; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | private void execute(){//拆垛信息上传 |
| | | int[] staNos =new int[]{118,120,121}; |
| | | List<Integer> integersStaArr = new ArrayList<>(); |
| | | List<Long[]> stalistArr = new ArrayList<>(); |
| | | for(Integer staNo : staNos){ |
| | | BasDevp basDevp = basDevpService.selectById(staNo); |
| | | if (Cools.isEmpty(basDevp) || basDevp.getWrkNo()==0){ |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | if (staProtocol == null || !staProtocol.isAutoing() || staProtocol.getWorkNo()==0) { |
| | | continue; |
| | | } |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", basDevp.getWrkNo())); |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", staProtocol.getWorkNo())); |
| | | if (Cools.isEmpty(wrkMast) || Cools.isEmpty(wrkMast.getSheetNo()) || !wrkMast.getSheetNo().equals("0")){ |
| | | continue; |
| | | } |