李林
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
package com.chinaztt.mes.production.service;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chinaztt.mes.plan.dto.ManufacturingOrderSnGenerateDTO;
import com.chinaztt.mes.plan.entity.MoStructureComponent;
import com.chinaztt.mes.production.dto.*;
import com.chinaztt.mes.production.entity.ProductInput;
import com.chinaztt.mes.production.entity.ProductMain;
import com.chinaztt.mes.production.entity.ProductOutput;
import com.chinaztt.mes.production.excel.ProductOutPutData;
import com.chinaztt.mes.technology.dto.StepDTO;
import com.chinaztt.mes.technology.entity.Step;
import com.chinaztt.mes.warehouse.dto.StockDTO;
import com.chinaztt.ztt.common.core.util.R;
 
import java.util.List;
import java.util.Map;
 
/**
 * 报工主表
 *
 * @author cxf
 * @date 2020-11-17 10:12:27
 */
public interface ProductMainService extends IService<ProductMain> {
 
    /**
     * 根据id取消报工
     *
     * @param id
     * @return
     */
    boolean cancelProductMainById(Long id);
 
    /**
     * 新增产出
     *
     * @param productMainDTO
     * @return
     */
    Long saveProductOutput(ProductMainDTO productMainDTO);
 
    /**
     * 新增产出
     *
     * @param productMainDTO
     * @return
     */
    Long batchSaveProductOutput(ProductMainDTO productMainDTO);
 
    /**
     * 批量新增报工
     *
     * @param productMainDTO
     * @return
     */
    Boolean batchSaveProductMain(List<ProductMainDTO> productMainDTOList);
 
    /**
     * 批量更新报工
     *
     * @param productMainDTOList
     * @return
     */
    Boolean batchUpdateProductMain(List<ProductMainDTO> productMainDTOList);
 
    /**
     * 更新产出
     *
     * @param productMainDTO
     * @return
     */
    boolean updateProductOutput(ProductMainDTO productMainDTO);
 
    /**
     * 删除产出
     *
     * @param id
     * @return
     */
    boolean deleteProductOutputById(Long id);
 
    /**
     * 删除产出
     *
     * @param
     * @return
     */
    boolean deleteProductOutputByIds(List<Long> ids);
 
    /**
     * 新增投入
     *
     * @param productInputDTO
     * @return
     */
    Boolean saveProductInput(ProductInputDTO productInputDTO);
 
    /**
     * 更新投入
     *
     * @param productInput
     * @return
     */
    boolean updateProductInput(ProductInput productInput);
 
    /**
     * 删除投入
     *
     * @param id
     * @return
     */
    boolean deleteProductInputById(Long id);
 
    /**
     * 根据报工主表id获取投入产出明细
     *
     * @param id
     * @return
     */
    ProductMainDTO getProductMainById(Long id);
 
    /**
     * 分页查询生产进度
     *
     * @param page
     * @param gen
     * @return
     */
    IPage getProductionProgress(Page page, QueryWrapper<ProductOutputDTO> gen);
 
    /**
     * 更改状态
     *
     * @param id
     * @param event
     * @return
     */
    R<Boolean> changeState(Long id, String event);
 
    /**
     * 根据产出id获取产出明细
     *
     * @param id
     * @return
     */
    List<ProductOutputDTO> getProductOutPutById(Long id);
 
    /**
     * 分页查询汇报产出
     *
     * @param page
     * @param gen
     * @return
     */
    IPage getOutputList(Page page, QueryWrapper<ProductOutputDTO> gen, ProductOutputDTO productOutputDTO);
 
    /**
     * 扫码查询汇报产出
     *
     * @param productOutputDTO
     * @return
     */
    List<ProductOutputDTO> getOutputListByScan(ProductOutputDTO productOutputDTO);
 
    /**
     * 根据工单id获取绑定的工序的工步
     *
     * @param id
     * @return
     */
    List<Step> getStep(Long id);
 
    /**
     * 根据工单id获取已经绑定的工步
     *
     * @param id
     * @return
     */
    List<StepDTO> getProductStep(Long id);
 
    /**
     * 根据工单id和sn号获取已经绑定的工步
     *
     * @param id
     * @param sn
     * @return
     */
    List<StepDTO> getProductStepBySn(Long id,String sn);
 
    /**
     * 根据工步记录id,查询出工步记录的所有信息
     *
     * @param id
     * @return
     */
    ProductStepDTO getAllProductStep(Long id);
 
    /**
     * 新增或修改工步信息
     *
     * @param productStepDTO
     * @return
     */
    List<StepDTO> addOrUpdateStep(ProductStepDTO productStepDTO);
 
    /**
     * 根据工步记录id,查询出工步记录的所有信息
     *
     * @param id
     * @return
     */
    boolean deleteProductStep(Long id);
 
    /**
     * 工作站id获取报工产出
     *
     * @param page
     * @param gen
     * @param id
     * @return
     */
    IPage<List<ProductOutputDTO>> getProductOut(Page page, QueryWrapper<ProductOutputDTO> gen, Long id);
 
    /**
     * 更改状态
     *
     * @param ids
     * @param event
     * @return
     */
    R<Boolean> changeProductOutPutState(List<Long> ids, String event);
 
    /**
     * @param workstationId
     * @param opeartionTaskId
     * @return
     */
    ProductOutput getShiftedProductByWidAndOpId(Long workstationId, Long opeartionTaskId);
 
    /**
     * 获取报工单列表
     *
     * @param page
     * @param gen
     * @return
     */
    IPage<List<ProductMainListDTO>> getList(Page page,QueryWrapper<ProductMainListDTO> gen);
 
    /**
     * 根据报工单id交班或取消
     *
     * @param id
     * @param event
     * @return
     */
    R<Boolean> changeProductOutPutStateByMainId(Long id, String event);
 
    /**
     * 批量删除报工单
     *
     * @param ids
     * @return
     */
    Boolean batchCancelProductMain(List<Long> ids);
 
    /**
     * 批量修改报工单状态
     *
     * @param ids
     * @param event
     * @return
     */
    Boolean batchChange(List<Long> ids, String event);
 
    /**
     * 获取报工页签装备或射频打印url
     *
     * @param id
     * @param type 1 装备 2射频 3装备射频sn打印 4射频小页签打印
     * @return
     */
    String getPrintUrl(Integer type, Long id, String sn);
 
    Map<Long, List<MoStructureComponent>> getComponentList(Long operationTaskId);
 
    /**
     * 根据工单id获取已经绑定的工步
     *
     * @param gen
     * @return
     */
    IPage<List<StepDTO>> getProductStep(Page page, QueryWrapper<ProductStepDTO> gen);
 
    /**
     * 判断投料是否足够
     *
     * @param productStepDTO
     * @return
     */
    Boolean judgeAddInput(ProductStepDTO productStepDTO);
 
    /**
     * 查询批量段长
     *
     * @param operationTaskId
     * @return
     */
    List<ManufacturingOrderSnGenerateDTO> getGenerateSN(Long operationTaskId);
 
    /**
     * 报工产出的导出
     *
     * @param operationTaskId
     * @return
     */
    List<ProductOutPutData> exportList(Long operationTaskId, Long workstationId);
 
    /**
     * 根据客户订单号查询productSn号码
     *
     * @param customerOrderNo
     * @return
     */
    List<String> getGenerateSnByCustomerOrderNo(String customerOrderNo);
 
    /**
     * 根据工单查找sn
     * @param taskId
     * @return
     */
    String getSNByTaskId(Long taskId);
 
    /**
     * 获取当前产出批次号的产出记录条数
     * @param outBatchNo
     * @return
     */
    long getOutputByBatchNo(String outBatchNo);
 
    /**
     * 多次批量标签打印
     * @param ids
     * @return
     */
    Boolean batchLabelPrintTimes(List<Long> ids);
 
    /**
     * check批量标签打印
     * @param ids
     * @return
     */
    Boolean checkBatchLabelPrint(List<Long> ids,Boolean isSubmit);
 
    /**
     * 批量标签打印
     * @param ids
     * @return
     */
    List<ProductOutputLabelDTO> batchLabelPrint(List<Long> ids);
 
    /**
     * 批量标签打印密码校验
     * @param password
     * @param ids
     * @return
     */
    R checkLabelPrintPassword(String password,List<Long> ids,Boolean isSubmit);
 
    /**
     * 批量更新打印次数
     * @param ids
     * @return
     */
    R updatePrintNum(List<Long> ids);
 
    List<String> getPartNamesByOrderNo(String customerOrderNo);
 
    List<String> getProductSnByCustomerNoAndPartName(String customerOrderNo, String partName);
 
    /**
     * 校验当前报工后是否会超出工单计划产量
     * @param productMainDTOList
     */
    R validateOverProduction(List<ProductMainDTO> productMainDTOList);
 
    /**
     * 校验零件是否为原材料
     * @param partNoList
     */
    R checkRawPart(List<String> partNoList);
 
    /**
     * 校验当前报工投料是否充足
     *
     * @param productMainDTOList
     * @return
     */
    R validateOverFeed(List<ProductMainDTO> productMainDTOList);
 
    /**
     * 将报工单状态更新为处理中
     * @param ids
     * @return
     */
    R process(List<Long> ids);
 
    /**
     * 校验当前工单是否是最后一道工序工单
     * @param id
     * @return
     */
    Boolean validateIsLastOperation(Long id);
 
    /**
     * 校验是否是交班后产出
     * @param snList
     * @return
     */
    List<ProductOutput> validateChangeProductOut(List<ProductOutput> list);
 
 
    /**
     * 报工单状态重置为草稿
     * @param ids
     * @return
     */
    Boolean resetState(List<Long> ids);
    /**
     * 获取工单下草稿状态报工产出
     * @param id 工单id
     * @return
     */
    List<ProductOutputDTO> getDraftProductOut(Long id);
 
    /**
     * 根据SN号校验工步流程是否走完
     * @param outBatchNo
     * @return
     */
    Boolean validateStepFinish(String outBatchNo);
 
    /**
     * 新增库存新增SN号校重
     * @param stockDTO
     * @return
     */
    Boolean checkSn(StockDTO stockDTO);
 
}