自动化立体仓库 - WMS系统
zyx
2023-10-04 45c2bf51fae3030c8e22fa2f2016b64a28928547
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
51
52
53
54
55
56
57
58
59
60
61
62
package com.zy.asrs.service.impl;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.entity.Mat;
import com.zy.asrs.mapper.LocRuleMapper;
import com.zy.asrs.entity.LocRule;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.LocRuleService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zy.asrs.service.MatService;
import com.zy.asrs.utils.Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.ArrayList;
import java.util.List;
 
@Service("locRuleService")
public class LocRuleServiceImpl extends ServiceImpl<LocRuleMapper, LocRule> implements LocRuleService {
 
    @Autowired
    private MatService matService;
    @Autowired
    private LocMastService locMastService;
 
    @Override
    public List<LocRule> find(String matnr) {
        if (Cools.isEmpty(matnr)) {
            return null;
        }
        Mat mat = matService.selectByMatnr(matnr);
        if (Cools.isEmpty(mat)) {
            return null;
        }
 
        return this.baseMapper.selectByMatnr(matnr);
    }
 
    //找混载库位规则
    @Override
    public List<LocRule> findMixed() {
        return this.baseMapper.selectByMixed(1);//搜索混载库位规则
    }
 
    //将库位规则转换为库位组(能查出来的都是空库位)
    @Override
    public List<LocMast> locRuleToLocNos(LocRule locRule) {
        return locMastService.queryFreeLocMast2(null, locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd());
    }
 
    @Override
    public int updateKeepGoByMatnr(String matnr, Integer keepGo) {
        return this.baseMapper.updateKeepGoByMatnr(matnr, keepGo);
    }
 
    @Override
    public int updateKeepGoByMixed(Integer keepGo) {
        return this.baseMapper.updateKeepGoByMixed(keepGo);
    }
}