huang
2025-10-30 a99650cb00bf5b0650c33f39a4221b765201d228
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
package com.mes.base.glassinfo.service.impl;
 
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.base.glassinfo.mapper.GlassInfoMapper;
import com.mes.base.glassinfo.service.GlassInfoService;
import com.mes.glassinfo.GlassInfo;
import com.mes.glassinfo.request.NotReportRequest;
import com.mes.tempering.compute.request.ProcessCardsRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author wu
 * @since 2024-04-29
 */
@Service
@Slf4j
public class GlassInfoServiceImpl extends ServiceImpl<GlassInfoMapper, GlassInfo> implements GlassInfoService {
 
    @Override
    public boolean swapGlassInfo(GlassInfo glassSource, GlassInfo target) {
        //将源信息中待替换的玻璃信息提取
        Integer horizontal = glassSource.getIsHorizontal();
        Integer temperingLayoutId = glassSource.getTemperingLayoutId();
        Integer temperingFeedSequence = glassSource.getTemperingFeedSequence();
        Integer xCoordinate = glassSource.getXCoordinate();
        Integer yCoordinate = glassSource.getYCoordinate();
        double angle = glassSource.getAngle();
        Integer ruleId = glassSource.getRuleId();
        //将源信息中待替换的玻璃信息替换为目标玻璃
        glassSource.setIsHorizontal(target.getIsHorizontal());
        glassSource.setTemperingLayoutId(target.getTemperingLayoutId());
        glassSource.setTemperingFeedSequence(target.getTemperingFeedSequence());
        glassSource.setXCoordinate(target.getXCoordinate());
        glassSource.setYCoordinate(target.getYCoordinate());
        glassSource.setAngle(target.getAngle());
        glassSource.setRuleId(target.getRuleId());
        //将目标信息替换为源信息
        target.setIsHorizontal(horizontal);
        target.setTemperingLayoutId(temperingLayoutId);
        target.setTemperingFeedSequence(temperingFeedSequence);
        target.setXCoordinate(xCoordinate);
        target.setYCoordinate(yCoordinate);
        target.setAngle(angle);
        target.setRuleId(ruleId);
        //将信息在数据库交换
        return this.updateById(glassSource) && this.updateById(target);
    }
 
    @Override
    public List<GlassInfo> queryGlassListByErp(String engineerId) {
        return baseMapper.queryGlassListByErp(engineerId);
    }
 
    @Override
    public List<GlassInfo> queryUnreportedList(String engineerId) {
        return baseMapper.queryUnreportedList(engineerId);
    }
 
    @Override
    public GlassInfo queryGlassId(String glassId) {
        return this.lambdaQuery()
                .eq(GlassInfo::getGlassId, glassId)
                .one();
    }
 
    @Override
    public List<GlassInfo> queryNotReport(NotReportRequest request) {
        return this.baseMapper.queryNotReport(request.getEngineerId());
    }
 
    @Override
    public ProcessCardsRequest queryGlassListByLayer(String flowCardId, Integer layer, List<Integer> orderNumberList) {
        return baseMapper.queryGlassListByLayer(flowCardId, layer, orderNumberList);
    }
}