| | |
| | | package com.zy.asrs.wms.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.wms.asrs.entity.Loc; |
| | | import com.zy.asrs.wms.asrs.mapper.LanewayRuleMapper; |
| | | import com.zy.asrs.wms.asrs.entity.LanewayRule; |
| | | import com.zy.asrs.wms.asrs.service.LanewayRuleService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("lanewayRuleService") |
| | | public class LanewayRuleServiceImpl extends ServiceImpl<LanewayRuleMapper, LanewayRule> implements LanewayRuleService { |
| | | |
| | | @Override |
| | | public LanewayRule getLaneByLoc(Loc loc) { |
| | | List<LanewayRule> list = this.list(); |
| | | for (LanewayRule rule : list) { |
| | | List<Integer> laneX = rule.getLaneX$(); |
| | | List<Integer> laneY = rule.getLaneY$(); |
| | | laneX.addAll(laneY); |
| | | |
| | | if (laneX.contains(loc.getRow1())) { |
| | | return rule; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |