自动化立体仓库 - WMS系统
#
luxiaotao1123
2020-06-13 944c35175669e8af1c4dc47ce7921e0134978c6d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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();
    }
 
    @Override
    public List<Integer> getAvailableOutSite() {
        return this.baseMapper.getAvailableOutSite();
    }
 
    @Override
    public BasDevp checkSiteStatus(Integer devpNo) {
        BasDevp station = selectById(devpNo);
        if (station == null){
            throw new CoolException("站点不存在");
        }
        if(station.getAutoing()==null || !station.getAutoing().equals("Y")) {
            throw new CoolException("入库站点不是自动状态");
        }
        if(station.getLoading()==null || !station.getLoading().equals("Y")) {
            throw new CoolException("入库站点无物");
        }
        if(station.getWrkNo()!=null && station.getWrkNo()>0) {
            throw new CoolException("入库站点已有工作号");
        }
        if(wrkMastService.getWorkingMast(devpNo)>0){
            throw new CoolException("同一站点不能同时生成两笔入库工作档");
        }
        return station;
    }
}