李林
2023-10-07 658d4927d468c47208fd012d9128b09249c07eff
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
/*
 *    Copyright (c) 2018-2025, ztt All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: ztt
 */
 
package com.chinaztt.mes.quality.mapper;
 
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chinaztt.mes.quality.dto.*;
import com.chinaztt.mes.quality.entity.ApplyPart;
import com.chinaztt.mes.quality.entity.TestStandard;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
 
import java.util.List;
import java.util.Set;
 
/**
 * 检测申请材料表
 *
 * @author cxf
 * @date 2021-04-01 13:34:51
 */
@Mapper
public interface ApplyPartMapper extends BaseMapper<ApplyPart> {
    /**
     * 分页查询
     *
     * @param page
     * @param gen
     * @return
     */
    IPage<List<ApplyPartDTO>> getApplyPartPage(Page page, @Param("ew") QueryWrapper<ApplyPartDTO> gen);
 
    /**
     * 分页查询未被汇报的申请材料
     *
     * @param page
     * @param gen
     * @return
     */
    IPage<List<ApplyPartDTO>> getApplyPartPageForReport(Page page, @Param("ew") QueryWrapper<ApplyPartDTO> gen);
 
    /**
     * 分页查询不合格的申请材料
     *
     * @param page
     * @param gen
     * @param unqualifiedProcessId
     * @return
     */
    IPage<ApplyPartDTO> getApplyPartPageForUnqualified(Page page, @Param("ew") QueryWrapper<ApplyPartDTO> gen, @Param("unqualifiedProcessId") Long unqualifiedProcessId);
 
    /**
     * 通过id删除检测报告材料表
     *
     * @param id
     * @return
     */
    int deleteByIdForReport(Long id);
 
    /**
     * 查询制造订单-检测标准
     *
     * @param systemNo
     * @return
     */
    List<TestStandard> findTestStandardNoBySystemNo(String systemNo);
 
    /**
     * 获取DTO
     *
     * @param id
     * @return
     */
    ApplyPartDTO getApplyPartDtoById(Long id);
 
    /**
     * 根据系统编号查询产出零件信息
     *
     * @param systemNo
     * 改造(22-09-13)报检时需要对交接班的产出进行产量的汇总
     * @return
     */
    JSONObject selectShowInfoBySystemNo(String systemNo);
 
    /**
     * 根据材料申请的id查询材料申请表(erp移库进合格库的)
     *
     * @param idList
     * @param locationNo
     * @return
     */
    List<JSONObject> selectApplyPart(@Param("idList") Set<Long> idList, @Param("locationNo") String locationNo);
 
    /**
     * 根据材料申请的id查询材料申请表(erp移库进不合格库的)
     *
     * @param idList
     * @param locationNo
     * @return
     */
    List<JSONObject> selectUnApplyPart(@Param("idList") Set<Long> idList, @Param("locationNo") String locationNo);
 
    /**
     * 根据系统唯一编号查出零件id
     *
     * @param systemNo
     * @return
     */
    Long selectPartIdBySystemNo(String systemNo);
 
    /**
     * 根据申请零件查询申请类型
     *
     * @param applyPartId
     * @return
     */
    String selectApplyTypeByApplyPartId(Long applyPartId);
 
    /**
     * 根据材料申请的id查询材料申请表(登记检验结果的)
     *
     * @param idList
     * @param locationNo
     * @return
     */
    List<JSONObject> selectRegistrationApplyPart(@Param("idList") Set<Long> idList, @Param("locationNo") String locationNo);
 
    /**
     * 根据系统号查询工序id
     *
     * @param systemNo 系统号
     * @return 工序id
     */
    Long selectOperationIdBySystemNo(String systemNo);
 
    /**
     * 根据汇报id清空材料表汇报id
     *
     * @param reportId
     */
    void clearReportId(Long reportId);
 
    List<ApplyPart> selectListByReportId(Long reportId);
 
    /**
     * 根据检测类型和SN号码查询applyPart
     *
     * @param lotBatchNo
     * @param applyType
     * @return
     */
    List<ApplyPart> selectApplyApertByInspState(@Param("lotBatchNo") String lotBatchNo, @Param("applyType") String applyType);
 
    /**
     * 根据检测类型和系统编号查询ApplyPartDTO
     * @param systemNo
     * @return
     */
    List<ApplyPartDTO> getApplyPartDtoBySysNoAndAppType(@Param("systemNo") String systemNo);
 
    /**
     * 根据系统编号查询对应的成品检检测汇报编号
     * @param systemNo 系统编号
     * @return
     */
    String getFinishedProductReportNo(@Param("systemNo") String systemNo);
 
    /**
     * 根据系统编号判断产出是否是最后一道工序
     * @param systemNo 系统编号
     * @return
     */
    Boolean isLastOperationBySystemNo(@Param("systemNo") String systemNo);
 
    /**
     * 根据产出系统编号获取对应的工序编号
     * @param systemNo 系统编号
     * @return 工序编号
     */
    String selectOperationNoBySystemNo(@Param("systemNo") String systemNo);
 
    /**
     * 根据产出系统编号判断是否需要自动创建成品检检测申请
     * @param systemNo 系统编号
     * @return true:需要自动创建成品检;false:不需要自动创建成品检
     */
    Boolean isConfigFinishedProdTest(@Param("systemNo") String systemNo);
 
    /**
     * 根据产出系统编号判断是否存在工序检、尾检这种从待检移合格或不合格的检测申请规则配置
     * @param systemNo 系统编号
     * @return true:存在该配置;false:不存在该配置
     */
    Boolean isConfigMoveLibraryTest(@Param("systemNo") String systemNo);
 
    /**
     * 根据系统编号判断是否存在检测申请配置
     * @param systemNo 产出系统编号
     * @return
     */
    Boolean isExistTestApplyConfigBySystemNo(@Param("systemNo") String systemNo);
 
    /**
     * 根据检测类型及批次号判断是否存在该申请材料
     * @param applyType  申请类型
     * @param systemNo  系统号
     * @return
     */
    Long isAutoApplyPartExist(@Param("applyType") String applyType,@Param("systemNo") String systemNo);
 
    /**
     * 根据检测申请表id查找对应库存是否为工序库存
     * @param id
     * @return
     */
    List<Boolean> selectStockOperationStatus(@Param("systemNo") String systemNo);
 
    /**
     * 质检合格率统计报表
     * @param qualityCheckRateInputDTO
     * @return
     */
    IPage<List<QualityCheckRateDTO>> getQualityCheckRate(Page page,@Param("input") QualityCheckRateInputDTO qualityCheckRateInputDTO);
 
    /**
     * 质检合格率统计柱状图
     * @param qualityCheckRateInputDTO
     * @return
     */
    List<QualityCheckRatePictureDTO> getQualityCheckRatePicture(@Param("input") QualityCheckRateInputDTO qualityCheckRateInputDTO);
 
    /**
     * 根据系统编号查询是否存在成品检测申请
     * @param systemNo 系统编号
     * @return
     */
    boolean isExistFinishedApplyPart(@Param("systemNo") String systemNo);
 
    /**
     * 跟据系统编号查询车间订单配置的所有检测规则
     * @param systemNo
     * @return
     */
    List<String> selectTestRulesBySystemNo(String systemNo);
 
    IPage<ApplyPartDTO> getTestApplyPage(Page page, @Param("ew") QueryWrapper<ApplyPartDTO> gen, @Param("queryType") Integer queryType);
 
    void removeReplacePart(Long id);
}