自动化立体仓库 - WMS系统
13
zhang
昨天 82de5a307466894bbb0258f8a63a26a7bb96d80d
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package com.zy.asrs.service.impl;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.core.common.Cools;
import com.core.common.R;
import com.core.common.SnowflakeIdWorker;
import com.core.exception.CoolException;
import com.zy.asrs.entity.Mat;
import com.zy.asrs.entity.Node;
import com.zy.asrs.entity.param.InitPakoutParam;
import com.zy.asrs.entity.param.MatnrDto;
import com.zy.asrs.entity.param.PakinParam;
import com.zy.asrs.mapper.NodeMapper;
import com.zy.asrs.service.MatService;
import com.zy.asrs.service.NodeService;
import com.zy.asrs.utils.SaasUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
import java.beans.Transient;
import java.util.Date;
import java.util.List;
 
@Service("nodeService")
public class NodeServiceImpl extends ServiceImpl<NodeMapper, Node> implements NodeService {
    @Autowired
    private NodeService nodeService;
    @Autowired
    private MatService matService;
    @Autowired
    private SnowflakeIdWorker snowflakeIdWorker;
    @Override
    public Node getTop() {
        Node top = this.selectOne(new EntityWrapper<Node>().eq("type", 0).eq("level", 0));
        if (top == null) {
            top = new Node();
            top.setName("全部");
            top.setUuid("全部");
            top.setType(0);
            top.setLevel(0);
            top.setSort(0);
            top.setStatus(1);
            top.setCreateTime(new Date());
            top.setUpdateTime(new Date());
            Integer insert = this.baseMapper.insert(top);
            if (insert == 0) {
                throw new CoolException("服务器异常");
            }
        }
        return top;
    }
 
    @Override
    public Node selectByUuid(String uuid) {
        return selectOne(new EntityWrapper<Node>().eq("uuid", uuid));
    }
 
    @Override
    public Node selectByUuid(String uuid, Long hostId) {
        return this.baseMapper.selectByUuid(uuid, hostId);
    }
 
    @Override
    public Node selectByUuid(String uuid, Long hostId, Integer type) {
        return selectOne(new EntityWrapper<Node>().eq("host_id", hostId).eq("uuid", uuid).eq("type", type));
    }
 
    @Override
    public Node selectByUuid(String uuid, Long hostId, Integer type, Long parentId) {
        return selectOne(new EntityWrapper<Node>().eq("host_id", hostId).eq("uuid", uuid).eq("type", type).eq("parent_id", parentId));
    }
 
 
 
 
}