严智鑫
2024-04-22 efa1d4bc8ba02a6d3951c1c2850f9cb5aa6964e1
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
package com.mes.edgstoragecage.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.query.MPJQueryWrapper;
import com.mes.edgstoragecage.entity.EdgStorageCage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.edgstoragecage.entity.EdgStorageCageDetails;
import com.mes.edgstoragecage.mapper.EdgStorageCageMapper;
import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper;
import com.mes.edgstoragecage.service.EdgStorageCageService;
import com.mes.uppattenusage.entity.UpPattenUsage;
import com.mes.uppattenusage.mapper.UpPattenUsageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
 
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhoush
 * @since 2024-04-07
 */
@Service
public class EdgStorageCageServiceImpl extends MPJBaseServiceImpl<EdgStorageCageMapper, EdgStorageCage> implements EdgStorageCageService {
 
    @Autowired
    EdgStorageCageDetailsMapper edgStorageCageDetailsMapper;
    @Autowired
    UpPattenUsageMapper upPattenUsageMapper;
 
    /**
     * 查询笼内空格
     * @return
     */
    @Override
    public List<Map> selectCacheEmpty(){
        return baseMapper.selectJoinList(
                Map.class,new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class)
                        .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height")
                        .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot")
                        .isNull("escd.slot")
        );
    }
 
    /**
     * 查询笼内出片任务   按钢化版图号+版图内序号
     * @return
     */
    @Override
    public List<Map> selectCacheOut(){
        return upPattenUsageMapper.selectJoinList(
                Map.class,new MPJQueryWrapper<UpPattenUsage>().selectAll(UpPattenUsage.class)
                        .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height")
                        .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot")
                        .isNotNull("escd.slot")
                        .orderByAsc("escd.tempering_layout_id","escd.tempering_feed_sequence")
        );
    }
 
    /**
     * 理片缓存详情
     * @return
     */
    @Override
    public List<Map> selectEdgStorageCages(){
        return baseMapper.selectJoinList(
                Map.class,new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class)
                        .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height")
                        .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot")
        );
    }
 
    /**
     * 修改理片笼内信息 功能:对笼内栅格玻璃 【添加/删除/更换】
     * @param edgStorageCage
     * @return
     */
    @Override
    public boolean updateEdgStorageCage(EdgStorageCage edgStorageCage){
        baseMapper.updateById(edgStorageCage);
        return true;
    }
 
}