Fixiaobai
2023-11-09 01d08428dd6cd9dc518a9a2ecbcb1f0e82788068
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
/*
 *    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.technology.service;
 
import com.alibaba.fastjson.JSONObject;
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.technology.dto.RoutingDTO;
import com.chinaztt.mes.technology.dto.RoutingOperationDTO;
import com.chinaztt.mes.technology.entity.Routing;
import com.chinaztt.mes.technology.entity.RoutingOperationParam;
import com.chinaztt.mes.technology.entity.RoutingOperationTemplate;
import com.chinaztt.mes.technology.excel.RoutingData;
import com.chinaztt.mes.technology.excel.RoutingExcelData;
import com.chinaztt.mes.technology.excel.StructureData;
import com.chinaztt.ztt.common.core.util.R;
 
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
 
/**
 * 工艺
 *
 * @author zhangxy
 * @date 2020-08-19 09:36:29
 */
public interface RoutingService extends IService<Routing> {
 
 
    /**
     * 分页查询
     *
     * @param page
     * @param ew
     * @return
     */
    IPage<List<RoutingDTO>> getPage(Page page, QueryWrapper<RoutingDTO> ew);
 
    /**
     * 关联查询
     *
     * @param id
     * @return
     */
    RoutingDTO getRoutingById(Long id);
 
    /**
     * 级联保存
     *
     * @param routingDTO
     * @return
     */
    RoutingDTO fullSave(RoutingDTO routingDTO);
 
    /**
     * 级联更新
     *
     * @param routingDTO
     * @return
     */
    RoutingDTO fullUpdate(RoutingDTO routingDTO);
 
    /**
     * 更改状态
     *
     * @param id
     * @param event
     * @return
     */
    R<Boolean> changeState(Long id, String event);
 
 
    /**
     * 更改状态
     *
     * @param ids
     * @param event
     * @return
     */
    boolean changeState(List<Long> ids, String event);
 
    /**
     * 修改工艺路线的数据
     *
     * @param routingOperation
     * @return
     */
    boolean routingOperationChange(RoutingOperationDTO routingOperation);
 
    /**
     * 工序详情
     *
     * @param operationId
     * @param routingOperationId
     * @return
     */
    JSONObject operationDetail(Long operationId, Long routingOperationId);
 
 
    /**
     * 查询工艺工序详情
     *
     * @param id
     * @return
     */
    RoutingOperationDTO getDtoByPk(Long id);
 
    /**
     * 导入excel数据
     *
     * @param data
     */
    void importExcel(List<RoutingExcelData> data);
 
    /**
     * 导入
     *
     * @param dataList
     */
    void importExcelExt(Map<Integer, String> headMap, List<Map<Integer, String>> dataList);
 
    /**
     * 复制工艺路线
     *
     * @param routing
     * @return
     */
    R<List<Routing>> copyRoutingSave(List<RoutingDTO> routing);
 
    /**
     * 根据工艺id和工序id获取复制的工序模板
     *
     * @param routingDTO
     * @return
     */
    List<RoutingOperationTemplate> getOperationTemplate(RoutingDTO routingDTO);
 
    /**
     * 根据工艺工序id和工序模板id获取工序参数
     *
     * @param routingDTO
     * @return
     */
    List<RoutingOperationParam> getOperationTemplateParam(RoutingDTO routingDTO);
 
    /**
     * 查询模板与参数
     *
     * @param routingOperationId
     * @return
     */
    R getOperationTemplateAndParam(Long routingOperationId);
 
    /**
     * 根据工艺工序id关联添加工序模板
     *
     * @param routingDTO
     * @return
     */
    List<RoutingOperationTemplate> addOperationTemplate(RoutingDTO routingDTO);
 
    /**
     * 根据复制工序模板的id删除工序模板
     *
     * @param id
     * @return
     */
    boolean deleteOperationTemplate(Long id);
 
    /**
     * 根据工艺工序id和工序模板id新增工序参数
     *
     * @param routingDTO
     * @return
     */
    boolean addOperationTemplateParam(RoutingDTO routingDTO);
 
    /**
     * 根据复制工序参数的id删除工序参数
     *
     * @param id
     * @return
     */
    boolean deleteOperationTemplateParam(Long id);
 
    /**
     * 工序参数的参数值的修改
     *
     * @param routing
     * @return
     */
    R updateRoutingTemplateParamById(RoutingDTO routing);
 
    /**
     * 获取工艺工序参数集
     *
     * @param page
     * @param gen
     * @return
     */
    IPage<List<RoutingOperationTemplate>> getRoutingOperationTemplatePage(Page page, QueryWrapper<RoutingOperationTemplate> gen);
 
    /**
     * 根据查询条件导出
     *
     * @param response
     * @throws IOException
     */
    void exportModel(HttpServletResponse response) throws IOException;
 
    /**
     * 对接ifs
     *
     * @param ids
     * @return
     */
    boolean routingIfsSync(List<Long> ids);
 
    /**
     * 提前计算
     * @param ids
     * @return
     */
    boolean routingIfsCal(List<Long> ids);
 
    List<RoutingDTO> getRoutingByDocumentIdAndOperationId(Long documentId, Long operationId);
}