|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.service.impl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.mapper.EntityWrapper; | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.zy.asrs.mapper.BasSteMapper; | 
|---|
|  |  |  | import com.zy.asrs.entity.BasSte; | 
|---|
|  |  |  | import com.zy.asrs.service.BasSteService; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.service.impl.ServiceImpl; | 
|---|
|  |  |  | import com.zy.asrs.entity.BasSte; | 
|---|
|  |  |  | import com.zy.asrs.mapper.BasSteMapper; | 
|---|
|  |  |  | import com.zy.asrs.service.BasSteService; | 
|---|
|  |  |  | import com.zy.asrs.utils.Utils; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | public class BasSteServiceImpl extends ServiceImpl<BasSteMapper, BasSte> implements BasSteService { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public BasSte findByCrnNo(Integer crnNo) { | 
|---|
|  |  |  | List<BasSte> basStes = this.selectList(new EntityWrapper<BasSte>().eq("crn_no", crnNo)); | 
|---|
|  |  |  | if (Cools.isEmpty(basStes)) { | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (basStes.size() > 1) { | 
|---|
|  |  |  | log.warn("目前有{}台穿梭车归属于{}号堆垛机!!!", basStes.size(), crnNo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return basStes.get(0); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public Boolean updatePos(Integer steNo, Integer row, Integer bay, Integer lev) { | 
|---|
|  |  |  | return this.baseMapper.updatePos(steNo, row, bay, lev) > 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return this.baseMapper.updatePakMk(steNo, pakMk) > 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public Integer hasCarOfLocNo(String locNo) { | 
|---|
|  |  |  | List<BasSte> basStes = this.selectList(new EntityWrapper<>()); | 
|---|
|  |  |  | for (BasSte basSte : basStes) { | 
|---|
|  |  |  | if (Utils.getRow(locNo) == basSte.getRow() | 
|---|
|  |  |  | && Utils.getBay(locNo) == basSte.getBay() | 
|---|
|  |  |  | && Utils.getLev(locNo) == basSte.getLev()){ | 
|---|
|  |  |  | return basSte.getSteNo(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|