| | |
| | | import com.zy.asrs.service.WorkService; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.service.CommonService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service("locMastService") |
| | | public class LocMastServiceImpl extends ServiceImpl<LocMastMapper, LocMast> implements LocMastService { |
| | | |
| | |
| | | } else { |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | LocMast result = null; |
| | | // 入库外层库位滞空 |
| | | for (int i = 0; i<locNos.size() - 1; i++) { |
| | | LocMast locMast = this.selectById(locNos.get(i)); |
| | | |
| | | // plan second |
| | | LocMast finalRes = null; |
| | | for (String locNo0 : locNos) { |
| | | LocMast locMast = this.selectById(locNo0); |
| | | if (locMast.getLocSts().equals("O")) { |
| | | if (i == 0) { |
| | | result = locMast; |
| | | } else { |
| | | LocMast lastLoc = this.selectById(locNos.get(i - 1)); |
| | | if (lastLoc.getLocSts().equals("F") || lastLoc.getLocSts().equals("D") |
| | | || lastLoc.getLocSts().equals("S") || lastLoc.getLocSts().equals("X")) { |
| | | if (result == null) { |
| | | result = locMast; |
| | | } |
| | | } |
| | | if (finalRes == null) { |
| | | finalRes = locMast; |
| | | } |
| | | } else if (locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D") |
| | | || locMast.getLocSts().equals("P") || locMast.getLocSts().equals("R")) { |
| | | if (result != null) { |
| | | result = null; |
| | | } else { |
| | | if (finalRes != null) { |
| | | log.error("{}库位异常:{}库位状态为O.空库位,但{}库位状态为{}", finalRes.getLocNo(), finalRes.getLocNo(), locMast.getLocNo(), locMast.getLocSts()); |
| | | finalRes = null; |
| | | break; |
| | | } |
| | | if (locMast.getLocSts().equals("R") || locMast.getLocSts().equals("P")) { |
| | | finalRes = null; |
| | | break; |
| | | } |
| | | finalRes = null; |
| | | } |
| | | } |
| | | return result; |
| | | return finalRes; |
| | | } |
| | | |
| | | @Override |