李林
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
package com.chinaztt.mes.production.mapper;
 
import com.baomidou.mybatisplus.annotation.SqlParser;
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.production.dto.EmsMachineYieldDTO;
import com.chinaztt.mes.production.dto.ProductOutputDTO;
import com.chinaztt.mes.production.dto.ProductOutputLabelDTO;
import com.chinaztt.mes.production.entity.ProductOutput;
import com.chinaztt.mes.production.excel.ProductOutPutData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
 
import java.math.BigDecimal;
import java.util.List;
 
/**
 * 报工产出表
 *
 * @author cxf
 * @date 2020-11-17 10:12:32
 */
@Mapper
public interface ProductOutputMapper extends BaseMapper<ProductOutput> {
 
    /**
     * 根据主表id查询
     *
     * @param mainId
     * @return
     */
    List<ProductOutputDTO> getByMainId(Long mainId);
 
    /**
     * 分页查询生产进度
     *
     * @param page
     * @param gen
     * @return
     */
    IPage<List<ProductOutputDTO>> getProductionProgress(Page page, @Param("ew") QueryWrapper<ProductOutputDTO> gen);
 
 
    /**
     * 根据报工主表删除员工产出记录
     *
     * @param mainId
     */
    void deleteStaffOutByMainId(Long mainId);
 
    /**
     * 根据报工主表删除人工记录
     *
     * @param mainId
     * @return
     */
    int deleteArtificialInformationByMainId(Long mainId);
 
    /**
     * 根据产出id获取产出明细
     *
     * @param id
     * @return
     */
    List<ProductOutputDTO> getProductOutPutById(Long id);
 
    /**
     * 通过上班记录id查询产量
     *
     * @param dutyRecordId
     * @return
     */
    List<ProductOutputDTO> getOutputByDutyRecordId(Long dutyRecordId);
 
    /**
     * 通过上班记录idList查询产量
     *
     * @param dutyRecordIdList
     * @return
     */
    List<ProductOutputDTO> getOutputByDutyRecordIdList(@Param("dutyRecordIdList")List<Long> dutyRecordIdList);
 
    /**
     * 分页查询汇报产出
     *
     * @param page
     * @param gen
     * @return
     */
    IPage<ProductOutputDTO> getOutputList(Page page, @Param("ew") QueryWrapper<ProductOutputDTO> gen, @Param("dto") ProductOutputDTO productOutputDTO);
 
    /**
     * 扫码查询汇报产出
     *
     * @param productOutputDTO
     * @return
     */
    List<ProductOutputDTO> getOutputListByScan(@Param("dto") ProductOutputDTO productOutputDTO);
 
    /**
     * 查询产出汇总数量
     *
     * @param gen
     * @return
     */
    BigDecimal getSumProductQty(@Param("ew") QueryWrapper<ProductOutputDTO> gen,@Param("dto") ProductOutputDTO productOutputDTO);
 
    /**
     * 工作站id获取报工产出
     *
     * @param page
     * @param gen
     * @param id
     * @return
     */
    IPage<List<ProductOutputDTO>> getProductOut(Page page, @Param("ew") QueryWrapper<ProductOutputDTO> gen, @Param("id") Long id);
 
 
    /**
     * 根据产出id  逻辑删除数据
     *
     * @param id
     * @return
     */
    int deleteProductOutPutById(Long id);
 
 
    /**
     * 查询交接班的产出
     *
     * @param opeartionTaskId 工单id
     * @param workstationId   工作站id
     * @return
     */
    List<ProductOutputDTO> getShiftProductOutByOpIdAndWsId(@Param("workstationId") Long workstationId, @Param("opeartionTaskId") Long opeartionTaskId);
 
    /**
     * 根据报工产出SN查询产出明细
     * @param sn
     * @return
     */
    List<ProductOutputDTO> getProductOutDetailsBySN(@Param("sn") String sn);
 
    /**
     * 获取交班后产出数量
     *
     * @param outputIds
     * @return
     */
    Integer getShiftedNumberByOutputIds(@Param("outputIds") List<Long> outputIds);
 
    /**
     * 清空交班id数据
     * @param id
     */
    void clearShiftOutputId(Long id);
 
    int batchInsert(@Param("list") List<ProductOutputDTO> list);
    /**
     * 报工产出的导出
     *
     * @param operationTaskId
     * @return
     */
    List<ProductOutPutData> exportList(@Param("operationTaskId") Long operationTaskId, @Param("workstationId") Long workstationId);
 
    /**
     * 批量标签打印
     * @param ids
     * @return
     */
    List<ProductOutputLabelDTO> batchLabelPrint(@Param("ids") List<Long> ids);
    /**
     * 根据产出批次号汇总产出数量(将交接班的产量一起汇总)
     * @param batchNo
     * @return
     */
    BigDecimal sumProdOutQtyByBatchNo(@Param("batchNo") String batchNo);
 
    /**
     * 根据工单id查找产出
     * @param operationTaskId
     * @return
     */
    List<ProductOutputDTO> selectByTaskId(@Param("id") Long operationTaskId);
 
    /**
     * 根据工单id查询草稿状态产出
     * @param id
     * @return
     */
    List<ProductOutputDTO> getDraftProductOut(@Param("id") Long id);
 
    /**
     * 根据班次id查询人员产量工资
     * @param dutyRecordId
     * @return
     */
    List<ProductOutputDTO> getStaffProductionWage(@Param("dutyRecordId") Long dutyRecordId);
 
    /**
     * 获取工单交班状态(参照 报工单查询交班状态方法)
     * 实际生产环境下,一条报工单对应一条产出记录
     * @param productMainId
     * @return
     */
    String judgeChangeshift(@Param("productMainId") Long productMainId);
 
 
    /**
     * 查找超报所需参数
     * @param operationTaskId
     * @return
     */
    List<ProductOutputDTO> selectCheckOverProduction(@Param("id") Long operationTaskId);
 
 
    /**
     * 获取工单交班状态(参照 报工单查询交班状态方法)
     * 实际生产环境下,一条报工单对应一条产出记录
     * @param productMainIdList
     * @return
     */
    Integer countChangeshiftByList(@Param("productMainIdList") List<Long> productMainIdList);
 
    /**
     * 查询该上班记录下报工状态
     * @param dutyRecordId
     * @return
     */
    List<String> getStateByDutyRecordId(@Param("dutyRecordId") Long dutyRecordId);
 
 
 
    List<ProductOutputDTO> getDutyRecordByOutputId(@Param("productOutId") Long productOutId);
 
    List<EmsMachineYieldDTO.MachineYieldDetailInfo> getEmsMachineYield(@Param("machineCode") String machineCode,
                                                                       @Param("beginDate") String beginDate,
                                                                       @Param("endDate") String endDate,
                                                                       @Param("sqlDateFormat") String sqlDateFormat,
                                                                       @Param("showDateFormat") String showDateFormat);
}