wuyouming666
2024-04-19 7357691a222745887ca1c336d8c458964a0d3ab8
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package com.mes.downstorage.service.impl;
 
import com.github.yulichang.query.MPJQueryWrapper;
import com.mes.downstorage.entity.DownStorageCage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.downstorage.entity.DownStorageCageDetails;
import com.mes.downstorage.mapper.DownStorageCageMapper;
import com.mes.downstorage.service.DownStorageCageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
import java.util.Map;
 
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhoush
 * @since 2024-03-27
 */
@Slf4j
@Service
public class DownStorageCageServiceImpl extends ServiceImpl<DownStorageCageMapper, DownStorageCage> implements DownStorageCageService {
    @Autowired
    private DownStorageCageMapper downStorageCageMapper;
    @Override
    public List<Map> gettask(){
        downStorageCageMapper.selectList(null);
//        downStorageCageMapper.selectJoin();
        return null;
    };
 
 
 
    @Override
    public List<DownStorageCageDetails> getCacheLeisure() {
        log.info(" 查询笼子内空闲");
        List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList(
                DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>()
                        .select("escd.*")
                        .leftJoin("down_storage_cage_details escd on t.slot = escd.slot")
                        .isNull("escd.slot")
                        .orderByAsc("escd.slot")
        );
        return list;
    }
 
 
//    @Override
//    public List<Map> getCacheOut(int start, int end) {
//        log.info(" 根据传入的工位查询符合按照顺序和大小出片的小片");
//        List<Map> map = downStorageCageMapper.selectJoinList(
//                Map.class, new MPJQueryWrapper<DownStorageCageDetails>()
//                        .select("escd.*")
//                        .leftJoin("down_storage_cage_details escd on t.slot = escd.slot")
//                        .leftJoin("down_workstation dw on escd.flow_card_id = dw.flow_card_id")
//                        .isNotNull("escd.slot")
//                        .between("dw.workstation_id", start, end)
//                        .orderByAsc("escd.tempering_layout_id, escd.tempering_feed_sequence")
//        );
//        return map;
//    }
 
 
 
 
 
    @Override
    public List<DownStorageCageDetails> getCacheOut(int start, int end) {
        log.info("根据传入的工位查询符合按照顺序和大小出片的小片");
        List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList(
                DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>()
                        .select("escd.*")
                        .leftJoin("down_storage_cage_details escd on t.slot = escd.slot")
                        .leftJoin("down_workstation dw on escd.flow_card_id = dw.flow_card_id")
                        .leftJoin("glass_info gi on dw.flow_card_id = gi.flowcard_id  and gi.flowcard_id=escd.flow_card_id ")
                        .isNotNull("escd.slot")
                        .between("dw.workstation_id", start, end)
                        .orderByDesc("escd.width")
                        .orderByDesc("escd.height")
        );
        return list;
    }
 
 
 
 
 
    @Override
    public List<Map> getCacheInfo() {
        log.info(" 查询笼子内信息");
        List<Map> map = downStorageCageMapper.selectJoinList(
                Map.class, new MPJQueryWrapper<DownStorageCageDetails>()
                        .select("escd.*")
                        .leftJoin("down_storage_cage_details escd on t.slot = escd.slot")
                        .orderByAsc("t.slot")
        );
        return map;
    }
 
    @Override
    public List<DownStorageCageDetails> getIsExistIntoCacheByLayoutAndSequence(Integer tempering_layout_id, Integer tempering_feed_sequence, double width) {
        log.info(" 查询可进此片玻璃的栅格号  找到相同版图id并且大于前面的顺序的空格");
 
        List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList(
                DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>()
                        .select("escd.*")
                        .leftJoin("down_storage_cage_details escd on t.slot = escd.slot")
                        .isNotNull("escd.slot")
                        .eq("escd.tempering_layout_id", tempering_layout_id)
                        .lt("escd.tempering_feed_sequence", tempering_feed_sequence)
                        .gt("t.remain_width", width)
                        .orderByAsc("escd.tempering_feed_sequence")
        );
        return list;
    }
 
    @Override
    public List<DownStorageCageDetails> getIsExistIntoCacheByLayout(Integer tempering_layout_id, double width) {
        log.info(" 查询可进此片玻璃的栅格号");
        List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList(
                DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>()
                        .select("escd.*")
                        .leftJoin("down_storage_cage_details escd on t.slot = escd.slot")
                        .isNotNull("escd.slot")
                        .lt("escd.tempering_layout_id", tempering_layout_id)
                        // 条件 t.remain_width - width > 0
                        .apply("t.remain_width - " + width + " > 0")
                        .orderByDesc("escd.tempering_layout_id, escd.tempering_feed_sequence")
        );
        return list;
    }
 
 
 
 
 
 
}