yangys
2024-03-28 23a939ed820ee32f9a4309f9c81b7bab5a566f30
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
package com.qianwen.smartman.modules.cps.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import java.lang.invoke.SerializedLambda;
import java.util.List;
import com.qianwen.smartman.common.utils.MessageUtils;
import com.qianwen.core.mp.service.impl.BladeServiceImpl;
import com.qianwen.smartman.modules.cps.convert.TraySurfaceConvert;
import com.qianwen.smartman.modules.cps.entity.TraySurface;
import com.qianwen.smartman.modules.cps.excel.TrayFixtureImport;
import com.qianwen.smartman.modules.cps.mapper.TraySurfaceMapper;
import com.qianwen.smartman.modules.cps.service.ITrayFixtureService;
import com.qianwen.smartman.modules.cps.service.ITraySurfaceService;
import com.qianwen.smartman.modules.cps.utils.ThrowFun;
import com.qianwen.smartman.modules.cps.vo.TrayFaceAddVO;
import com.qianwen.smartman.modules.cps.vo.TrayFaceUpdateVO;
import com.qianwen.smartman.modules.cps.vo.TraySurfaceVO;
import org.springframework.stereotype.Service;
 
@Service
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/service/impl/TraySurfaceServiceImpl.class */
public class TraySurfaceServiceImpl extends BladeServiceImpl<TraySurfaceMapper, TraySurface> implements ITraySurfaceService {
    private final ITrayFixtureService fixtureService;
 
    private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
        String implMethodName = lambda.getImplMethodName();
        boolean z = true;
        switch (implMethodName.hashCode()) {
            case -75622813:
                if (implMethodName.equals("getCode")) {
                    z = true;
                    break;
                }
                break;
            case -75308287:
                if (implMethodName.equals("getName")) {
                    z = false;
                    break;
                }
                break;
            case 98245393:
                if (implMethodName.equals("getId")) {
                    z = true;
                    break;
                }
                break;
            case 413851470:
                if (implMethodName.equals("getFaceId")) {
                    z = true;
                    break;
                }
                break;
            case 830319079:
                if (implMethodName.equals("getTrayId")) {
                    z = true;
                    break;
                }
                break;
        }
        switch (z) {
            case false:
                if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/TraySurface") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
                    return (v0) -> {
                        return v0.getName();
                    };
                }
                break;
            case true:
                if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/TrayFixture") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
                    return (v0) -> {
                        return v0.getFaceId();
                    };
                }
                break;
            case true:
                if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/TrayFixture") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
                    return (v0) -> {
                        return v0.getTrayId();
                    };
                }
                if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/TraySurface") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
                    return (v0) -> {
                        return v0.getTrayId();
                    };
                }
                break;
            case true:
                if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
                    return (v0) -> {
                        return v0.getId();
                    };
                }
                break;
            case true:
                if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/TraySurface") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
                    return (v0) -> {
                        return v0.getCode();
                    };
                }
                break;
        }
        throw new IllegalArgumentException("Invalid lambda deserialization");
    }
 
    public TraySurfaceServiceImpl(final ITrayFixtureService fixtureService) {
        this.fixtureService = fixtureService;
    }
 
    @Override // org.springblade.modules.cps.service.ITraySurfaceService
    public Boolean removeFace(Long trayId, Long faceId) {
        int count = this.baseMapper.removeFixture(trayId, faceId);
        ThrowFun.isTrue(count > 0).throwMessage(MessageUtils.message("cps.face.fixture.station.fixture", new Object[0]));
        boolean removeFixture = this.fixtureService.remove((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
            return v0.getTrayId();
        }, trayId)).eq((v0) -> {
            return v0.getFaceId();
        }, faceId));
        this.fixtureService.updateFixtureStatusByTray(Lists.newArrayList(new Long[]{trayId}));
        return Boolean.valueOf(removeById(faceId) && removeFixture);
    }
 
    @Override // org.springblade.modules.cps.service.ITraySurfaceService
    public List<TraySurfaceVO> listTraySurface(Long trayId) {
        return this.baseMapper.listTraySurface(trayId);
    }
 
    @Override // org.springblade.modules.cps.service.ITraySurfaceService
    public TraySurfaceVO saveTrayFave(TrayFaceAddVO vo) {
        Long trayId = vo.getTrayId();
        validFaceCode(vo.getCode(), trayId);
        TraySurface surface = TraySurfaceConvert.INSTANCE.convert(vo);
        save(surface);
        return TraySurfaceConvert.INSTANCE.convert(surface).setFixtureNum(0);
    }
 
    @Override // org.springblade.modules.cps.service.ITraySurfaceService
    public Boolean updateTraySurface(TrayFaceUpdateVO vo) {
        return Boolean.valueOf(update((Wrapper) ((LambdaUpdateWrapper) Wrappers.lambdaUpdate().set((v0) -> {
            return v0.getName();
        }, vo.getName())).eq((v0) -> {
            return v0.getId();
        }, vo.getId())));
    }
 
    @Override // org.springblade.modules.cps.service.ITraySurfaceService
    public List<TraySurface> listByTrayCodeName(Wrapper<TrayFixtureImport> wrapper) {
        return this.baseMapper.listByTrayCodeName(wrapper);
    }
 
    public void validFaceCode(String code, Long trayId) {
        long count = count((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
            return v0.getTrayId();
        }, trayId)).eq((v0) -> {
            return v0.getCode();
        }, code));
        ThrowFun.isTrue(count > 0).throwMessage(MessageUtils.message("cps.tray.face.name.exist", new Object[0]));
    }
}