| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.AgvLocDetl; |
| | | import com.zy.asrs.entity.AgvWaitPakin; |
| | | import com.zy.asrs.entity.AgvWrkDetl; |
| | | import com.zy.asrs.entity.AgvWrkMast; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | |
| | | @Transactional |
| | | public ReturnT<String> startCarryWrk(List<AgvWrkMast> agvWrkMastList) throws IOException { |
| | | log.info(agvWrkMastList.toString()); |
| | | //任务过滤,过滤掉已存在相同目标库位的工作档 |
| | | agvWrkMastList = filter(agvWrkMastList); |
| | | int code = agvWrkMastService.startWrk(agvWrkMastList,"carry"); |
| | | log.info(agvWrkMastList.toString()); |
| | | if (Cools.isEmpty(agvWrkMastList)){ |
| | | return SUCCESS; |
| | | } |
| | | if(code == 0){ |
| | | agvWrkMastList.forEach(agvWrkMast -> { |
| | | //202.RCS取货中 |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | private List<AgvWrkMast> filter(List<AgvWrkMast> agvWrkMastList){ |
| | | return agvWrkMastList.stream().filter(agvWrkMast -> { |
| | | AgvWrkMast agvWrkMastWroking = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("source_loc_no", agvWrkMast.getLocNo())); |
| | | if(!Cools.isEmpty(agvWrkMastWroking) && agvWrkMastWroking.getWrkSts()<=202){ |
| | | System.out.println("source_loc_no > 1"); |
| | | return false; |
| | | } |
| | | log.info(agvWrkMast.toString()); |
| | | int num = agvWrkMastService.selectCount(new EntityWrapper<AgvWrkMast>().eq("loc_no", agvWrkMast.getLocNo())); |
| | | return num <= maxWrokNum; |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | } |