| package com.zy.asrs.service.impl; | 
|   | 
| import com.baomidou.mybatisplus.service.impl.ServiceImpl; | 
| import com.core.exception.CoolException; | 
| import com.zy.asrs.entity.BasDevp; | 
| import com.zy.asrs.mapper.BasDevpMapper; | 
| import com.zy.asrs.service.BasDevpService; | 
| import com.zy.asrs.service.WrkMastService; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.stereotype.Service; | 
|   | 
| import java.util.List; | 
|   | 
| @Service("basDevpService") | 
| public class BasDevpServiceImpl extends ServiceImpl<BasDevpMapper, BasDevp> implements BasDevpService { | 
|   | 
|     @Autowired | 
|     private WrkMastService wrkMastService; | 
|   | 
|     @Override | 
|     public List<Integer> getAvailableInSite() { | 
|         return this.baseMapper.getAvailableInSite(1); | 
|     } | 
|   | 
|     @Override | 
|     public List<Integer> getAvailableEmptyInSite() { | 
|         return this.baseMapper.getAvailableInSite(10); | 
|     } | 
|   | 
|     @Override | 
|     public List<Integer> getAvailableOutSite(Integer typeNo) { | 
|         return this.baseMapper.getAvailableOutSite(typeNo); | 
|     } | 
|   | 
|     @Override | 
|     public List<Integer> getAvailableEmptyOutSite() { | 
|         return this.baseMapper.getAvailableOutSite(110); | 
|     } | 
|   | 
|     @Override | 
|     public BasDevp checkSiteStatus(Integer devpNo) { | 
|         return checkSiteStatus(devpNo, false); | 
|     } | 
|   | 
|     @Override | 
|     public BasDevp checkSiteStatus(Integer devpNo, boolean put) { | 
|         BasDevp station = selectById(devpNo); | 
|         if (station == null){ | 
|             throw new CoolException(devpNo+"站点不存在"); | 
|         } | 
|         if (put) { | 
|             if(station.getAutoing()==null || !station.getAutoing().equals("Y")) { | 
|                 throw new CoolException(devpNo+"站点不是自动状态"); | 
|             } | 
|             if(station.getLoading()==null || !station.getLoading().equals("Y")) { | 
|                 throw new CoolException(devpNo+"站点无物"); | 
|             } | 
|             if(station.getWrkNo()!=null && station.getWrkNo()>0) { | 
|                 throw new CoolException(devpNo+"站点已有工作号"); | 
|             } | 
|             if(wrkMastService.getWorkingMast(devpNo)>0){ | 
|                 throw new CoolException(devpNo+"站点不能同时生成两笔入库工作档"); | 
|             } | 
|         } | 
|         return station; | 
|     } | 
| } |