提交 | 用户 | 时间
|
0ca254
|
1 |
package com.jcdm.main.da.paramCollection.service.impl; |
A |
2 |
|
|
3 |
import cn.hutool.core.collection.CollUtil; |
|
4 |
import cn.hutool.core.date.DateUtil; |
|
5 |
import cn.hutool.core.util.ObjectUtil; |
|
6 |
import cn.hutool.core.util.StrUtil; |
|
7 |
import cn.hutool.db.Db; |
|
8 |
import cn.hutool.http.HttpRequest; |
|
9 |
import cn.hutool.http.HttpResponse; |
|
10 |
import cn.hutool.json.JSONObject; |
|
11 |
import cn.hutool.json.JSONUtil; |
|
12 |
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
13 |
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
14 |
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
15 |
import com.jcdm.common.core.domain.AjaxResult; |
|
16 |
import com.jcdm.common.utils.DateUtils; |
|
17 |
import com.jcdm.common.utils.SecurityUtils; |
|
18 |
import com.jcdm.common.utils.StringUtils; |
|
19 |
import com.jcdm.main.bs.formula.service.IBsFormulaInfoService; |
|
20 |
import com.jcdm.main.bs.formula.service.impl.BsFormulaInfoServiceImpl; |
|
21 |
import com.jcdm.main.bs.formulaChild.domain.BsFormulaChildInfo; |
|
22 |
import com.jcdm.main.bs.formulaChild.mapper.BsFormulaChildInfoMapper; |
|
23 |
import com.jcdm.main.bs.formulaChild.service.IBsFormulaChildInfoService; |
|
24 |
import com.jcdm.main.constant.Constants; |
|
25 |
import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf; |
|
26 |
import com.jcdm.main.da.collectionParamConf.mapper.DaCollectionParamConfMapper; |
|
27 |
import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService; |
|
28 |
import com.jcdm.main.da.paramCollection.domain.DaParamCollection; |
|
29 |
import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper; |
|
30 |
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService; |
|
31 |
import com.jcdm.main.da.paramCollectionTemp.domain.DaParamCollectionTemp; |
|
32 |
import com.jcdm.main.da.paramCollectionTemp.service.IDaParamCollectionTempService; |
|
33 |
import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection; |
|
34 |
import com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper; |
|
35 |
import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService; |
|
36 |
import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo; |
|
37 |
import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService; |
|
38 |
import com.jcdm.main.plcserver.sub.OPCUaSubscription; |
|
39 |
import com.jcdm.main.restful.factoryMes.service.RestfulService; |
|
40 |
import com.jcdm.main.restful.qingYan.doman.ChildVO; |
|
41 |
import com.jcdm.main.restful.qingYan.doman.ParentVO; |
|
42 |
import com.kangaroohy.milo.model.ReadWriteEntity; |
|
43 |
import com.kangaroohy.milo.service.MiloService; |
|
44 |
import lombok.extern.slf4j.Slf4j; |
|
45 |
import org.apache.ibatis.session.ExecutorType; |
|
46 |
import org.apache.ibatis.session.SqlSession; |
|
47 |
import org.apache.ibatis.session.SqlSessionFactory; |
|
48 |
import org.slf4j.Logger; |
|
49 |
import org.slf4j.LoggerFactory; |
|
50 |
import org.springframework.beans.factory.annotation.Autowired; |
|
51 |
import org.springframework.security.core.parameters.P; |
|
52 |
import org.springframework.stereotype.Service; |
|
53 |
|
|
54 |
import javax.annotation.Resource; |
|
55 |
import java.text.SimpleDateFormat; |
|
56 |
import java.time.Instant; |
|
57 |
import java.util.*; |
|
58 |
import java.util.concurrent.CompletableFuture; |
|
59 |
import java.util.stream.Collectors; |
|
60 |
|
|
61 |
/** |
|
62 |
* 设备产品过程参数采集Service业务层处理 |
|
63 |
* |
|
64 |
* @author yyt |
|
65 |
* @date 2023-12-13 |
|
66 |
*/ |
|
67 |
@Slf4j |
|
68 |
@Service |
|
69 |
public class DaParamCollectionServiceImpl extends ServiceImpl<DaParamCollectionMapper,DaParamCollection> implements IDaParamCollectionService |
|
70 |
{ |
|
71 |
private static final Logger logger = LoggerFactory.getLogger("sys-user"); |
|
72 |
|
|
73 |
@Autowired |
|
74 |
private DaParamCollectionMapper daParamCollectionMapper; |
|
75 |
|
|
76 |
@Autowired |
|
77 |
private DaCollectionParamConfMapper daCollectionParamConfMapper; |
|
78 |
|
|
79 |
@Autowired |
|
80 |
private BsFormulaChildInfoMapper bsFormulaChildInfoMapper; |
|
81 |
|
|
82 |
@Autowired |
|
83 |
private IBsFormulaChildInfoService bsFormulaChildInfoService; |
|
84 |
|
|
85 |
@Autowired |
|
86 |
private MiloService miloService; |
|
87 |
|
|
88 |
@Autowired |
|
89 |
private DaPassingStationCollectionMapper daPassingStationCollectionMapper; |
|
90 |
|
|
91 |
@Resource |
|
92 |
private SqlSessionFactory sqlSessionFactory; |
|
93 |
|
|
94 |
@Autowired |
|
95 |
private IDaParamCollectionService daParamCollectionService; |
|
96 |
|
|
97 |
@Autowired |
|
98 |
private IDaCollectionParamConfService daCollectionParamConfService; |
|
99 |
|
|
100 |
@Autowired |
|
101 |
private IDaParamCollectionTempService daParamCollectionTempService; |
|
102 |
|
|
103 |
@Autowired |
|
104 |
private IOmProductionOrdeInfoService omProductionOrdeInfoService; |
|
105 |
|
|
106 |
@Autowired |
|
107 |
private IDaPassingStationCollectionService daPassingStationCollectionService; |
|
108 |
|
|
109 |
public SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
110 |
|
|
111 |
/** |
|
112 |
* 查询设备产品过程参数采集 |
|
113 |
* |
|
114 |
* @param id 设备产品过程参数采集主键 |
|
115 |
* @return 设备产品过程参数采集 |
|
116 |
*/ |
|
117 |
@Override |
|
118 |
public DaParamCollection selectDaParamCollectionById(Long id) |
|
119 |
{ |
|
120 |
return daParamCollectionMapper.selectDaParamCollectionById(id); |
|
121 |
} |
|
122 |
|
|
123 |
/** |
|
124 |
* 查询设备产品过程参数采集列表 |
|
125 |
* |
|
126 |
* @param daParamCollection 设备产品过程参数采集 |
|
127 |
* @return 设备产品过程参数采集 |
|
128 |
*/ |
|
129 |
@Override |
|
130 |
public List<DaParamCollection> selectDaParamCollectionList(DaParamCollection daParamCollection) |
|
131 |
{ |
|
132 |
return daParamCollectionMapper.selectDaParamCollectionList(daParamCollection); |
|
133 |
} |
|
134 |
|
|
135 |
@Override |
|
136 |
public void saveBeachDaParamCollection(List<DaParamCollection> list) { |
|
137 |
// ExecutorType.SIMPLE: 这个执行器类型不做特殊的事情。它为每个语句的执行创建一个新的预处理语句。 |
|
138 |
// ExecutorType.REUSE: 这个执行器类型会复用预处理语句。 |
|
139 |
// ExecutorType.BATCH: 这个执行器会批量执行所有更新语句,如果 SELECT 在它们中间执行还会标定它们是 必须的,来保证一个简单并易于理解的行为。 |
|
140 |
logger.info("进入乐工批量方法saveBeachDaParamCollection"); |
|
141 |
|
|
142 |
// 关闭session的自动提交 |
|
143 |
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); |
|
144 |
try { |
|
145 |
DaParamCollectionMapper userMapper = sqlSession.getMapper(DaParamCollectionMapper.class); |
|
146 |
list.stream().forEach(DaParamCollection -> userMapper.insertDaParamCollection(DaParamCollection)); |
|
147 |
// 提交数据 |
|
148 |
sqlSession.commit(); |
|
149 |
sqlSession.rollback(); |
|
150 |
logger.info("结束乐工批量方法saveBeachDaParamCollection"); |
|
151 |
|
|
152 |
} catch (Exception e) { |
|
153 |
sqlSession.rollback(); |
|
154 |
} finally { |
|
155 |
sqlSession.close(); |
|
156 |
} |
|
157 |
} |
|
158 |
|
|
159 |
/** |
|
160 |
* 新增设备产品过程参数采集 |
|
161 |
* |
|
162 |
* @param daParamCollection 设备产品过程参数采集 |
|
163 |
* @return 结果 |
|
164 |
*/ |
|
165 |
@Override |
|
166 |
public int insertDaParamCollection(DaParamCollection daParamCollection) |
|
167 |
{ |
|
168 |
daParamCollection.setCreateTime(DateUtils.getNowDate()); |
|
169 |
return daParamCollectionMapper.insertDaParamCollection(daParamCollection); |
|
170 |
} |
|
171 |
|
|
172 |
/** |
|
173 |
* 修改设备产品过程参数采集 |
|
174 |
* |
|
175 |
* @param daParamCollection 设备产品过程参数采集 |
|
176 |
* @return 结果 |
|
177 |
*/ |
|
178 |
@Override |
|
179 |
public int updateDaParamCollection(DaParamCollection daParamCollection) |
|
180 |
{ |
|
181 |
daParamCollection.setUpdateTime(DateUtils.getNowDate()); |
|
182 |
return daParamCollectionMapper.updateDaParamCollection(daParamCollection); |
|
183 |
} |
|
184 |
|
|
185 |
/** |
|
186 |
* 批量删除设备产品过程参数采集 |
|
187 |
* |
|
188 |
* @param ids 需要删除的设备产品过程参数采集主键 |
|
189 |
* @return 结果 |
|
190 |
*/ |
|
191 |
@Override |
|
192 |
public int deleteDaParamCollectionByIds(Long[] ids) |
|
193 |
{ |
|
194 |
return daParamCollectionMapper.deleteDaParamCollectionByIds(ids); |
|
195 |
} |
|
196 |
|
|
197 |
/** |
|
198 |
* 删除设备产品过程参数采集信息 |
|
199 |
* |
|
200 |
* @param id 设备产品过程参数采集主键 |
|
201 |
* @return 结果 |
|
202 |
*/ |
|
203 |
@Override |
|
204 |
public int deleteDaParamCollectionById(Long id) |
|
205 |
{ |
|
206 |
return daParamCollectionMapper.deleteDaParamCollectionById(id); |
|
207 |
} |
|
208 |
|
|
209 |
@Override |
|
210 |
public void addBasicParameters(DaParamCollection daParamCollection) { |
|
211 |
// 假设这是从数据库或其他地方获取的参数数据 |
|
212 |
Map<String, String> map = new HashMap<>(); |
|
213 |
map.put("GC", "南浔工厂"); |
|
214 |
map.put("CXBH", "Pack线"); |
|
215 |
map.put("SBBH", "设备001"); |
|
216 |
map.put("YGBH", "员工001"); |
|
217 |
map.put("GDBH", daParamCollection.getWorkOrderNo()); |
|
218 |
map.put("CPXH", daParamCollection.getModel()); |
|
219 |
map.put("INT", DateUtil.formatDateTime(new Date())); |
|
220 |
|
|
221 |
map.forEach((key, value) -> { |
|
222 |
DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf(); |
|
223 |
daCollectionParamConf.setProcessesCode(daParamCollection.getLocationCode()); |
|
224 |
daCollectionParamConf.setCollectParameterId(key); |
|
225 |
List<DaCollectionParamConf> daCollectionParamConfs = daCollectionParamConfMapper.selectDaCollectionParamConfList(daCollectionParamConf); |
|
226 |
DaParamCollection saveData = new DaParamCollection(); |
|
227 |
saveData.setWorkOrderNo(daParamCollection.getWorkOrderNo()); |
|
228 |
saveData.setProductCode(daParamCollection.getProductCode()); |
|
229 |
saveData.setLocationCode(daParamCollection.getLocationCode()); |
|
230 |
saveData.setSfcCode(daParamCollection.getProductBarcode()); |
|
231 |
saveData.setParamCode(daCollectionParamConfs.get(0).getCollectParameterId()); |
|
232 |
saveData.setParamName(daCollectionParamConfs.get(0).getCollectParameterName()); |
|
233 |
saveData.setCollectionTime(new Date()); |
|
234 |
saveData.setParamValue(value); |
|
235 |
daParamCollectionMapper.insertDaParamCollection(saveData); |
|
236 |
}); |
|
237 |
} |
|
238 |
|
|
239 |
@Override |
|
240 |
public void addTighteningParameters(DaParamCollection daParamCollection) { |
|
241 |
String paramCode = daParamCollection.getParamCode(); |
|
242 |
String tightenData = daParamCollection.getTightenTheArray(); |
|
243 |
if(StringUtils.isNotBlank(paramCode)&&StringUtils.isNotBlank(tightenData)){ |
|
244 |
tightenData = tightenData.replace("[", "").replace("]", "").replace(" ", ""); |
|
245 |
String[] tightenDataParts = tightenData.split(","); |
|
246 |
String[] paramCodeParts = paramCode.split(","); |
|
247 |
for (int i = 0; i < paramCodeParts.length; i++) { |
|
248 |
daParamCollection.setParamValue(tightenDataParts[i]); |
|
249 |
daParamCollection.setParamCode(paramCodeParts[i]); |
|
250 |
daParamCollection.setCollectionTime(new Date()); |
|
251 |
daParamCollection.setSfcCode(daParamCollection.getProductBarcode()); |
|
252 |
daParamCollectionMapper.insertDaParamCollection(daParamCollection); |
|
253 |
|
|
254 |
DaParamCollectionTemp daParamCollectionTemp = new DaParamCollectionTemp(); |
|
255 |
daParamCollectionTemp.setParamValue(tightenDataParts[i]); |
|
256 |
daParamCollectionTemp.setParamCode(paramCodeParts[i]); |
|
257 |
daParamCollectionTemp.setCollectionTime(new Date()); |
|
258 |
daParamCollectionTemp.setSfcCode(daParamCollection.getProductBarcode()); |
|
259 |
daParamCollectionTemp.setLocationCode(daParamCollection.getLocationCode()); |
|
260 |
daParamCollectionTemp.setProductCode(daParamCollection.getProductCode()); |
|
261 |
daParamCollectionTempService.save(daParamCollectionTemp); |
|
262 |
} |
|
263 |
} |
|
264 |
} |
|
265 |
|
|
266 |
@Override |
|
267 |
public void saveCampaignTimeParameters(DaParamCollection daParamCollection) { |
|
268 |
// List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() |
|
269 |
// .eq(BsFormulaChildInfo::getProcessesCode, daParamCollection.getLocationCode()) |
|
270 |
// .eq(BsFormulaChildInfo::getSpareField4, "1") |
|
271 |
// ); |
|
272 |
BsFormulaChildInfo childInfo = daParamCollection.getFormulaChildEntity(); |
|
273 |
if(StringUtils.isNotBlank(childInfo.getResults())){ |
|
274 |
if(!childInfo.getResults().equals("OK")){ |
|
275 |
try { |
|
276 |
miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+daParamCollection.getLocationCode()+".RecordDataDone").value(22).build()); |
|
277 |
} catch (Exception e) { |
|
278 |
throw new RuntimeException(e); |
|
279 |
} |
|
280 |
return; |
|
281 |
} |
|
282 |
}else { |
|
283 |
try { |
|
284 |
miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+daParamCollection.getLocationCode()+".RecordDataDone").value(22).build()); |
|
285 |
} catch (Exception e) { |
|
286 |
throw new RuntimeException(e); |
|
287 |
} |
|
288 |
return; |
|
289 |
} |
|
290 |
// BsFormulaChildInfo bsFormulaChildInfo = new BsFormulaChildInfo(); |
|
291 |
// bsFormulaChildInfo.setProcessesCode(daParamCollection.getLocationCode()); |
|
292 |
// bsFormulaChildInfo.setProductCode(daParamCollection.getProductCode()); |
|
293 |
// bsFormulaChildInfo.setSpareField4("1"); |
|
294 |
// List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(bsFormulaChildInfo); |
|
295 |
String result = childInfo.getResults(); |
|
296 |
if(result != null && !result.isEmpty()){ |
|
297 |
try { |
|
298 |
// //更新参数采集配置表 |
|
299 |
// DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf(); |
|
300 |
// daCollectionParamConf.setProcessesCode(daParamCollection.getLocationCode()); |
|
301 |
// daCollectionParamConf.setCollectParameterId("OUTT"); |
|
302 |
// List<DaCollectionParamConf> daCollectionParamConfs = daCollectionParamConfMapper.selectDaCollectionParamConfList(daCollectionParamConf); |
|
303 |
// DaParamCollection saveData = new DaParamCollection(); |
|
304 |
// saveData.setWorkOrderNo(daParamCollection.getWorkOrderNo()); |
|
305 |
// saveData.setProductCode(daParamCollection.getProductCode()); |
|
306 |
// saveData.setLocationCode(daParamCollection.getLocationCode()); |
|
307 |
// saveData.setSfcCode(daParamCollection.getProductBarcode()); |
|
308 |
// saveData.setParamCode(daCollectionParamConfs.get(0).getCollectParameterId()); |
|
309 |
// saveData.setParamName(daCollectionParamConfs.get(0).getCollectParameterName()); |
|
310 |
// saveData.setCollectionTime(new Date()); |
|
311 |
// saveData.setParamValue(DateUtil.formatDateTime(new Date())); |
|
312 |
// daParamCollectionMapper.insertDaParamCollection(saveData); |
|
313 |
|
|
314 |
//增加过站记录 |
|
315 |
DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection(); |
|
316 |
daPassingStationCollection.setWorkOrderNo(daParamCollection.getWorkOrderNo()); |
|
317 |
daPassingStationCollection.setSfcCode(daParamCollection.getProductBarcode()); |
|
318 |
daPassingStationCollection.setProductCode(daParamCollection.getProductCode()); |
|
319 |
daPassingStationCollection.setLocationCode(daParamCollection.getLocationCode()); |
|
320 |
daPassingStationCollection.setInboundTime(daParamCollection.getInboundTime()); |
|
321 |
daPassingStationCollection.setOutboundTime(new Date()); |
|
322 |
daPassingStationCollection.setCreateTime(new Date()); |
|
323 |
daPassingStationCollection.setOutRsSign("1"); |
|
324 |
boolean save = daPassingStationCollectionService.save(daPassingStationCollection); |
|
325 |
|
|
326 |
//添加基础参数 |
|
327 |
this.manualWorkstationsAddBasicParameters(daParamCollection); |
|
328 |
|
|
329 |
// //更新过站记录表出站时间 |
|
330 |
// DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection(); |
|
331 |
// daPassingStationCollection.setWorkOrderNo(daParamCollection.getWorkOrderNo()); |
|
332 |
// daPassingStationCollection.setLocationCode(daParamCollection.getLocationCode()); |
|
333 |
// List<DaPassingStationCollection> daPassingStationCollections = daPassingStationCollectionMapper.selectDaPassingStationCollectionList(daPassingStationCollection); |
|
334 |
// daPassingStationCollections.get(0).setOutboundTime(new Date()); |
|
335 |
// int i = daPassingStationCollectionMapper.updateDaPassingStationCollection(daPassingStationCollections.get(0)); |
|
336 |
|
|
337 |
// OPCUaSubscription.SaveParamData(daParamCollection.getProductBarcode(),"OP",daParamCollection.getLocationCode(),daParamCollection.getWorkOrderNo(),daParamCollection.getProductCode()); |
|
338 |
|
|
339 |
//给opc发21 |
|
340 |
miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+daParamCollection.getLocationCode()+".RecordDataDone").value(21).build()); |
|
341 |
if(daParamCollection.getLocationCode().equals("OP240")){ |
|
342 |
try{ |
|
343 |
CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { |
|
344 |
logger.info("OP230报工开始-工厂MES异步方法"); |
|
345 |
String reportResult = RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(), "OP230", format.format(new Date())); |
|
346 |
JSONObject jsonObject = new JSONObject(reportResult); |
|
347 |
String code = jsonObject.getStr("code"); |
|
348 |
if("success".equals(code)){ |
|
349 |
//如果成功,执行报工成功方法,修改是否报工为1,添加报工时间 |
|
350 |
omProductionOrdeInfoService.updateOrderByProductNum("1",daParamCollection.getProductBarcode(),"OP230"); |
|
351 |
}else{ |
|
352 |
//解析工厂mes返回结果,如果失败,执行报工失败方法,修改是否报工为2,添加报工时间 |
|
353 |
omProductionOrdeInfoService.updateOrderByProductNum("2",daParamCollection.getProductBarcode(),"OP230"); |
|
354 |
} |
|
355 |
logger.info("OP230报工结束-工厂MES异步方法{}"+reportResult); |
|
356 |
}); |
|
357 |
}catch (Exception e){ |
|
358 |
System.out.println(e.getMessage()); |
|
359 |
} |
|
360 |
// RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(),"OP230",format.format(new Date())); |
|
361 |
} |
|
362 |
|
|
363 |
|
|
364 |
} catch (Exception e) { |
|
365 |
throw new RuntimeException(e); |
|
366 |
} |
|
367 |
} |
|
368 |
} |
|
369 |
|
|
370 |
@Override |
|
371 |
public void insertBatch(List<DaParamCollection> confList){ |
|
372 |
try{ |
|
373 |
this.saveBatch(confList); |
|
374 |
}catch (Exception e){ |
|
375 |
return; |
|
376 |
} |
|
377 |
|
|
378 |
} |
|
379 |
|
|
380 |
@Override |
|
381 |
public void replaceAssemblyCode(DaParamCollection daParamCollection) { |
|
382 |
List<DaParamCollection> list = daParamCollectionService.list(new LambdaQueryWrapper<DaParamCollection>() |
|
383 |
.eq(DaParamCollection::getSfcCode, daParamCollection.getYzSfcCode()) |
|
384 |
); |
|
385 |
if(list.size() > 0){ |
|
386 |
for (DaParamCollection paramCollection : list) { |
|
387 |
paramCollection.setSfcCode(daParamCollection.getSfcCode()); |
|
388 |
daParamCollectionService.saveOrUpdate(paramCollection); |
|
389 |
} |
|
390 |
} |
|
391 |
|
|
392 |
} |
|
393 |
|
|
394 |
@Override |
|
395 |
public void yzAddBasicParameters(DaParamCollection daParamCollection) { |
|
396 |
// 假设这是从数据库或其他地方获取的参数数据 |
|
397 |
Map<String, String> map = new HashMap<>(); |
|
398 |
// map.put("GC", "南浔工厂"); |
|
399 |
// map.put("CXBH", "Pack线"); |
|
400 |
// map.put("SBBH", "设备001"); |
|
401 |
// map.put("YGBH", "员工001"); |
|
402 |
// map.put("GDBH", daParamCollection.getWorkOrderNo()); |
|
403 |
// map.put("CPXH", daParamCollection.getModel()); |
|
404 |
map.put("INT", DateUtil.formatDateTime(new Date())); |
|
405 |
|
|
406 |
map.forEach((key, value) -> { |
|
407 |
DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf(); |
|
408 |
daCollectionParamConf.setProcessesCode(daParamCollection.getLocationCode()); |
|
409 |
daCollectionParamConf.setCollectParameterId(key); |
|
410 |
List<DaCollectionParamConf> daCollectionParamConfs = daCollectionParamConfMapper.selectDaCollectionParamConfList(daCollectionParamConf); |
|
411 |
DaParamCollection saveData = new DaParamCollection(); |
|
412 |
saveData.setWorkOrderNo(daParamCollection.getWorkOrderNo()); |
|
413 |
saveData.setProductCode(daParamCollection.getProductCode()); |
|
414 |
saveData.setLocationCode(daParamCollection.getLocationCode()); |
|
415 |
saveData.setSfcCode(daParamCollection.getProductBarcode()); |
|
416 |
saveData.setParamCode(daCollectionParamConfs.get(0).getCollectParameterId()); |
|
417 |
saveData.setParamName(daCollectionParamConfs.get(0).getCollectParameterName()); |
|
418 |
saveData.setCollectionTime(new Date()); |
|
419 |
saveData.setParamValue(value); |
|
420 |
daParamCollectionMapper.insertDaParamCollection(saveData); |
|
421 |
}); |
|
422 |
} |
|
423 |
|
|
424 |
@Override |
|
425 |
public void jrmSaveCampaignTimeParameters(DaParamCollection daParamCollection) { |
|
426 |
DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf(); |
|
427 |
daCollectionParamConf.setProcessesCode(daParamCollection.getLocationCode()); |
|
428 |
daCollectionParamConf.setCollectParameterId("OUTT"); |
|
429 |
List<DaCollectionParamConf> daCollectionParamConfs = daCollectionParamConfMapper.selectDaCollectionParamConfList(daCollectionParamConf); |
|
430 |
DaParamCollection saveData = new DaParamCollection(); |
|
431 |
saveData.setWorkOrderNo(daParamCollection.getWorkOrderNo()); |
|
432 |
saveData.setProductCode(daParamCollection.getProductCode()); |
|
433 |
saveData.setLocationCode(daParamCollection.getLocationCode()); |
|
434 |
saveData.setSfcCode(daParamCollection.getProductBarcode()); |
|
435 |
saveData.setParamCode(daCollectionParamConfs.get(0).getCollectParameterId()); |
|
436 |
saveData.setParamName(daCollectionParamConfs.get(0).getCollectParameterName()); |
|
437 |
saveData.setCollectionTime(new Date()); |
|
438 |
saveData.setParamValue(DateUtil.formatDateTime(new Date())); |
|
439 |
daParamCollectionMapper.insertDaParamCollection(saveData); |
|
440 |
|
|
441 |
//更新过站记录表出站时间 |
|
442 |
DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection(); |
|
443 |
daPassingStationCollection.setWorkOrderNo(daParamCollection.getWorkOrderNo()); |
|
444 |
daPassingStationCollection.setLocationCode(daParamCollection.getLocationCode()); |
|
445 |
List<DaPassingStationCollection> daPassingStationCollections = daPassingStationCollectionMapper.selectDaPassingStationCollectionList(daPassingStationCollection); |
|
446 |
daPassingStationCollections.get(0).setOutboundTime(new Date()); |
|
447 |
int i = daPassingStationCollectionMapper.updateDaPassingStationCollection(daPassingStationCollections.get(0)); |
|
448 |
|
|
449 |
// OPCUaSubscription.SaveParamData(daParamCollection.getProductBarcode(),"OP",daParamCollection.getLocationCode(),daParamCollection.getWorkOrderNo(),daParamCollection.getProductCode()); |
|
450 |
|
|
451 |
//给opc发21 |
|
452 |
try { |
|
453 |
// miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+daParamCollection.getLocationCode()+".RecordDataDone").value(21).build()); |
|
454 |
String strA = daParamCollection.getLocationCode(); |
|
455 |
miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+strA+".RecordDataDone").value(21).build()); |
|
456 |
} catch (Exception e) { |
|
457 |
throw new RuntimeException(e); |
|
458 |
} |
|
459 |
} |
|
460 |
|
|
461 |
|
|
462 |
public void sendToFactoryMes(String stationCode,String productNum ){ |
|
463 |
// String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; |
|
464 |
String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; |
|
465 |
ParentVO vo =new ParentVO(); |
|
466 |
List<ChildVO> checkList = new ArrayList<>(); |
|
467 |
List<DaParamCollection> list = this.list(new LambdaQueryWrapper<DaParamCollection>() |
|
468 |
.eq(DaParamCollection::getSfcCode, productNum) |
|
469 |
.eq(DaParamCollection::getLocationCode, stationCode)); |
|
470 |
vo.setTotalResult("1"); |
|
471 |
String string = new Random(10).toString(); |
|
472 |
vo.setRecordId(string); |
|
473 |
vo.setProductNum(productNum); |
|
474 |
vo.setSiteCode("3983"); |
|
475 |
vo.setStationCode(stationCode); |
|
476 |
if (CollUtil.isNotEmpty(list)){ |
|
477 |
List<DaParamCollection> collect = list.stream().filter(x -> Constants.NG.equals(x.getParamValue())).collect(Collectors.toList()); |
|
478 |
if (CollUtil.isNotEmpty(collect)){ |
|
479 |
vo.setTotalResult("0"); |
|
480 |
} |
|
481 |
List<BsFormulaChildInfo> bsFormulaChildInfoList = bsFormulaChildInfoService.list(); |
|
482 |
for (DaParamCollection daParamCollection : list) { |
|
483 |
ChildVO childVO = new ChildVO(); |
|
484 |
childVO.setItemCode(daParamCollection.getParamCode()); |
|
485 |
String time = daParamCollection.getCollectionTime() != null ? daParamCollection.getCollectionTime().toString() : ""; |
|
486 |
childVO.setCheckResult("1"); |
|
487 |
if (StrUtil.isNotBlank(daParamCollection.getParamValue())){ |
|
488 |
if (Constants.NG.equals(daParamCollection.getParamValue())){ |
|
489 |
childVO.setCheckResult("0"); |
|
490 |
} |
|
491 |
} |
|
492 |
childVO.setCheckTime(time); |
|
493 |
childVO.setItemValue(daParamCollection.getParamValue()); |
|
494 |
childVO.setItemType("3"); |
|
495 |
childVO.setItemText(daParamCollection.getParamName()); |
|
496 |
if (StrUtil.isNotBlank(daParamCollection.getParamCode())){ |
|
497 |
List<BsFormulaChildInfo> collect1 = bsFormulaChildInfoList.stream().filter(x -> daParamCollection.getParamCode().equals(x.getParamCode())).collect(Collectors.toList()); |
|
498 |
if (CollUtil.isNotEmpty(collect1)){ |
|
499 |
BsFormulaChildInfo bsFormulaChildInfo = collect1.get(0); |
|
500 |
childVO.setItemType(bsFormulaChildInfo.getOperationType()); |
|
501 |
} |
|
502 |
} |
|
503 |
|
|
504 |
checkList.add(childVO); |
|
505 |
} |
|
506 |
} |
|
507 |
vo.setCheckList(checkList); |
|
508 |
HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(vo)).execute(); |
|
509 |
|
|
510 |
} |
|
511 |
|
|
512 |
@Override |
|
513 |
public void pushGeelycvMesFeedback(String packID, String stationCode) { |
|
514 |
logger.info("进入人工工位推送工厂MES数据方法-pushGeelycvMesFeedback-工位{}-pack码{}",stationCode,packID); |
|
515 |
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
516 |
String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; |
|
517 |
// String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; |
|
518 |
String totalResult = "0"; |
|
519 |
List<DaParamCollectionTemp> paramList = daParamCollectionTempService.list(new LambdaQueryWrapper<DaParamCollectionTemp>().eq(DaParamCollectionTemp::getSfcCode, packID).eq(DaParamCollectionTemp::getLocationCode, stationCode)); |
|
520 |
if(paramList.size() > 0){ |
|
521 |
ParentVO parentVO = new ParentVO(); |
|
522 |
parentVO.setSiteCode("3983"); |
|
523 |
parentVO.setRecordId(String.valueOf(Instant.now().toEpochMilli())); |
|
524 |
parentVO.setStationCode(stationCode); |
|
525 |
parentVO.setProductNum(packID); |
|
526 |
parentVO.setTotalResult("1"); |
|
527 |
List<ChildVO> listChildVo = new ArrayList<>(); |
|
528 |
|
|
529 |
for (DaParamCollectionTemp daParamCollection : paramList) { |
|
530 |
ChildVO childVO = new ChildVO(); |
|
531 |
childVO.setItemCode(daParamCollection.getParamCode()); |
|
532 |
// BsFormulaChildInfo childOne = bsFormulaChildInfoService.getOne(new LambdaQueryWrapper<BsFormulaChildInfo>().eq(BsFormulaChildInfo::getParamCode, daParamCollection.getParamCode())); |
|
533 |
// DaCollectionParamConf paramConfOne = daCollectionParamConfService.getOne(new LambdaQueryWrapper<DaCollectionParamConf>().eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode())); |
|
534 |
List<DaCollectionParamConf> paramConfOneList = daCollectionParamConfService.list(new LambdaQueryWrapper<DaCollectionParamConf>().eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode())); |
|
535 |
DaCollectionParamConf paramConfOne = paramConfOneList.get(0); |
|
536 |
// if(childOne!=null){ |
|
537 |
// String operationType = childOne.getOperationType(); |
|
538 |
// if(operationType.equals("1")){ |
|
539 |
// childVO.setItemType("2"); |
|
540 |
// }else if(operationType.equals("2")){ |
|
541 |
// childVO.setItemType("1"); |
|
542 |
// } |
|
543 |
// }else { |
|
544 |
// childVO.setItemType("3"); |
|
545 |
// } |
|
546 |
if(paramConfOne!=null){ |
|
547 |
childVO.setItemType(paramConfOne.getSpareField1()); |
|
548 |
childVO.setItemText(paramConfOne.getCollectParameterName()); |
|
549 |
}else { |
|
550 |
childVO.setItemType("3"); |
|
551 |
childVO.setItemText(""); |
|
552 |
} |
|
553 |
childVO.setItemValue(daParamCollection.getParamValue()); |
|
554 |
|
|
555 |
if(daParamCollection.getParamValue().equals("1")){ |
|
556 |
childVO.setCheckResult("1"); |
|
557 |
}else if(daParamCollection.getParamValue().equals("2")){ |
|
558 |
childVO.setCheckResult("0"); |
|
559 |
parentVO.setTotalResult("0"); |
|
560 |
totalResult = "1"; |
|
561 |
}else { |
|
562 |
childVO.setCheckResult("1"); |
|
563 |
} |
|
564 |
childVO.setCheckTime(format.format(daParamCollection.getCollectionTime())); |
|
565 |
listChildVo.add(childVO); |
|
566 |
|
|
567 |
} |
|
568 |
parentVO.setCheckList(listChildVo); |
|
569 |
try{ |
|
570 |
CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { |
|
571 |
logger.info("开始执行异步方法"); |
|
572 |
HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); |
|
573 |
logger.info("异步方法执行结束"); |
|
574 |
logger.info("手动工位传工厂MES异步方法{}"+execute.body()); |
|
575 |
|
|
576 |
DaParamCollectionTemp daParamCollectionTemp = new DaParamCollectionTemp(); |
|
577 |
daParamCollectionTemp.setSfcCode(packID); |
|
578 |
daParamCollectionTemp.setLocationCode(stationCode); |
|
579 |
int i = daParamCollectionTempService.deleteDaParamCollectionTempBySfcCodeAndLocationCode(daParamCollectionTemp); |
|
580 |
logger.info("删除临时表数据条数{}-工位{}-pack码{}",i,stationCode,packID); |
|
581 |
// List<Long> idsList = paramList.stream().map(DaParamCollectionTemp::getId).collect(Collectors.toList()); |
|
582 |
// Long[] array = idsList.toArray(new Long[0]); |
|
583 |
// int i = daParamCollectionTempService.deleteDaParamCollectionTempByIds(array); |
|
584 |
// logger.info("删除临时表数据条数{}-工位{}-pack码{}",i,stationCode,packID); |
|
585 |
}); |
|
586 |
}catch (Exception e){ |
|
587 |
System.out.println(e.getMessage()); |
|
588 |
} |
|
589 |
// HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); |
|
590 |
|
|
591 |
// System.out.println(execute.body()); |
|
592 |
System.out.println("-----------------------"+totalResult); |
|
593 |
logger.info("结束人工工位推送工厂MES数据方法-pushGeelycvMesFeedback-工位{}-pack码{}",stationCode,packID); |
|
594 |
} |
|
595 |
|
|
596 |
} |
|
597 |
|
|
598 |
@Override |
|
599 |
public void automaticWorkstationPushGeelycvMesFeedback(String packID, String stationCode,List<DaParamCollection> paramList) { |
|
600 |
logger.info("进入工位{}-工厂MES推送数据方法automaticWorkstationPushGeelycvMesFeedback",stationCode); |
|
601 |
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
602 |
// String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; |
|
603 |
String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; |
|
604 |
String totalResult = "0"; |
|
605 |
if(paramList.size() > 0){ |
|
606 |
logger.info("进入工位{}-拼数据",stationCode); |
|
607 |
ParentVO parentVO = new ParentVO(); |
|
608 |
parentVO.setSiteCode("3983"); |
|
609 |
parentVO.setRecordId(String.valueOf(Instant.now().toEpochMilli())); |
|
610 |
parentVO.setStationCode(stationCode); |
|
611 |
parentVO.setProductNum(packID); |
|
612 |
parentVO.setTotalResult("1"); |
|
613 |
List<ChildVO> listChildVo = new ArrayList<>(); |
|
614 |
|
|
615 |
for (DaParamCollection daParamCollection : paramList) { |
|
616 |
ChildVO childVO = new ChildVO(); |
|
617 |
childVO.setItemCode(daParamCollection.getParamCode()); |
|
618 |
// BsFormulaChildInfo childOne = bsFormulaChildInfoService.getOne(new LambdaQueryWrapper<BsFormulaChildInfo>().eq(BsFormulaChildInfo::getParamCode, daParamCollection.getParamCode())); |
|
619 |
// DaCollectionParamConf paramConfOne = daCollectionParamConfService.getOne(new LambdaQueryWrapper<DaCollectionParamConf>().eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode())); |
|
620 |
List<DaCollectionParamConf> paramConfOneList = daCollectionParamConfService.list(new LambdaQueryWrapper<DaCollectionParamConf>().eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode())); |
|
621 |
DaCollectionParamConf paramConfOne = paramConfOneList.get(0); |
|
622 |
// if(childOne!=null){ |
|
623 |
// String operationType = childOne.getOperationType(); |
|
624 |
// if(operationType.equals("1")){ |
|
625 |
// childVO.setItemType("2"); |
|
626 |
// }else if(operationType.equals("2")){ |
|
627 |
// childVO.setItemType("1"); |
|
628 |
// } |
|
629 |
// }else { |
|
630 |
// childVO.setItemType("3"); |
|
631 |
// } |
|
632 |
if(paramConfOne!=null){ |
|
633 |
childVO.setItemType(paramConfOne.getSpareField1()); |
|
634 |
childVO.setItemText(paramConfOne.getCollectParameterName()); |
|
635 |
}else { |
|
636 |
childVO.setItemType("3"); |
|
637 |
childVO.setItemText(""); |
|
638 |
} |
|
639 |
childVO.setItemValue(daParamCollection.getParamValue()); |
|
640 |
|
|
641 |
if(daParamCollection.getParamValue().equals("1")){ |
|
642 |
childVO.setCheckResult("1"); |
|
643 |
}else if(daParamCollection.getParamValue().equals("2")){ |
|
644 |
childVO.setCheckResult("0"); |
|
645 |
parentVO.setTotalResult("0"); |
|
646 |
totalResult = "1"; |
|
647 |
}else { |
|
648 |
childVO.setCheckResult("1"); |
|
649 |
} |
|
650 |
childVO.setCheckTime(format.format(daParamCollection.getCollectionTime())); |
|
651 |
listChildVo.add(childVO); |
|
652 |
} |
|
653 |
parentVO.setCheckList(listChildVo); |
|
654 |
logger.info("结束工位{}-拼数据",stationCode); |
|
655 |
logger.info("进入工位{}-工厂MES推送数据方法HttpResponseSend",stationCode); |
|
656 |
try{ |
|
657 |
CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { |
|
658 |
logger.info("开始执行异步方法"); |
|
659 |
HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); |
|
660 |
System.out.println(execute.body()); |
|
661 |
logger.info("异步方法执行结束"); |
|
662 |
logger.info("自动工位传工厂MES异步方法{}"+execute.body()); |
|
663 |
}); |
|
664 |
}catch (Exception e){ |
|
665 |
System.out.println(e.getMessage()); |
|
666 |
} |
|
667 |
// HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); |
|
668 |
logger.info("结束工位{}-工厂MES推送数据方法HttpResponseSend",stationCode); |
|
669 |
System.out.println("-----------------------"+totalResult); |
|
670 |
} |
|
671 |
logger.info("结束工位{}-工厂MES推送数据方法automaticWorkstationPushGeelycvMesFeedback",stationCode); |
|
672 |
} |
|
673 |
|
|
674 |
@Override |
|
675 |
public AjaxResult checkRecordDataDone(DaParamCollection daParamCollection) { |
|
676 |
String result = ""; |
|
677 |
|
|
678 |
|
|
679 |
try { |
|
680 |
List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>().eq(BsFormulaChildInfo::getSpareField4, "1").eq(BsFormulaChildInfo::getProcessesCode, daParamCollection.getLocationCode())); |
|
681 |
if(list.size()>0){ |
|
682 |
String results = list.get(0).getResults(); |
|
683 |
if(results!= null && !results.equals("") && results.equals("OK")){ |
|
684 |
result = "21"; |
|
685 |
} |
|
686 |
} |
|
687 |
/*Object recordDataDone = miloService.readFromOpcUa("PACK" + "." + daParamCollection.getLocationCode() + ".RecordDataDone").getValue(); |
|
688 |
if(ObjectUtil.isNotNull(recordDataDone)){ |
|
689 |
result = recordDataDone.toString(); |
|
690 |
}*/ |
|
691 |
} catch (Exception e) { |
|
692 |
throw new RuntimeException(e); |
|
693 |
} |
|
694 |
return AjaxResult.success(result); |
|
695 |
} |
|
696 |
|
|
697 |
@Override |
|
698 |
public void enterWeighing(DaParamCollection daParamCollection) { |
|
699 |
String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; |
|
700 |
long timestampMillis = Instant.now().toEpochMilli(); |
|
701 |
ParentVO parentVO = new ParentVO(); |
|
702 |
ChildVO childVO = new ChildVO(); |
|
703 |
List<ChildVO> childVOList = new ArrayList<>(); |
|
704 |
childVO.setItemCode("PWD_PW"); |
|
705 |
childVO.setItemType("3"); |
|
706 |
childVO.setItemText("Pack重量值"); |
|
707 |
childVO.setItemValue(daParamCollection.getWeightValue()); |
|
708 |
childVO.setCheckTime(format.format(new Date())); |
|
709 |
childVO.setCheckResult("1"); |
|
710 |
childVOList.add(childVO); |
|
711 |
parentVO.setSiteCode("3983"); |
|
712 |
parentVO.setRecordId(""+timestampMillis); |
|
713 |
parentVO.setStationCode("OP500"); |
|
714 |
parentVO.setProductNum(daParamCollection.getSfcCode()); |
|
715 |
parentVO.setTotalResult("1"); |
|
716 |
parentVO.setCheckList(childVOList); |
|
717 |
HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); |
|
718 |
// try{ |
|
719 |
// CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { |
|
720 |
// logger.info("开始执行异步方法"); |
|
721 |
// HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); |
|
722 |
// System.out.println(execute.body()); |
|
723 |
// logger.info("异步方法执行结束"); |
|
724 |
// logger.info("称重异步方法{}",execute.body()); |
|
725 |
// }); |
|
726 |
// }catch (Exception e){ |
|
727 |
// System.out.println(e.getMessage()); |
|
728 |
// } |
|
729 |
RestfulService.getWorkReportResultFeedback(daParamCollection.getSfcCode(),"OP500",format.format(new Date())); |
|
730 |
} |
|
731 |
|
|
732 |
@Override |
|
733 |
public void manualWorkstationsAddBasicParameters(DaParamCollection daParamCollection) { |
|
734 |
// 假设这是从数据库或其他地方获取的参数数据 |
|
735 |
Map<String, String> map = new HashMap<>(); |
|
736 |
map.put("GC", "南浔工厂"); |
|
737 |
map.put("CXBH", "Pack线"); |
|
738 |
map.put("SBBH", "设备001"); |
|
739 |
map.put("YGBH", SecurityUtils.getUsername()); |
|
740 |
map.put("GDBH", daParamCollection.getWorkOrderNo()); |
|
741 |
map.put("CPXH", daParamCollection.getProductCode()); |
|
742 |
map.put("INT", format.format(daParamCollection.getInboundTime())); |
|
743 |
map.put("OUTT",format.format(new Date())); |
|
744 |
|
|
745 |
map.forEach((key, value) -> { |
|
746 |
DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf(); |
|
747 |
daCollectionParamConf.setProcessesCode(daParamCollection.getLocationCode()); |
|
748 |
daCollectionParamConf.setCollectParameterId(key); |
|
749 |
List<DaCollectionParamConf> daCollectionParamConfs = daCollectionParamConfMapper.selectDaCollectionParamConfList(daCollectionParamConf); |
|
750 |
DaParamCollection saveData = new DaParamCollection(); |
|
751 |
saveData.setWorkOrderNo(daParamCollection.getWorkOrderNo()); |
|
752 |
saveData.setProductCode(daParamCollection.getProductCode()); |
|
753 |
saveData.setLocationCode(daParamCollection.getLocationCode()); |
|
754 |
saveData.setSfcCode(daParamCollection.getProductBarcode()); |
|
755 |
saveData.setParamCode(daCollectionParamConfs.get(0).getCollectParameterId()); |
|
756 |
saveData.setParamName(daCollectionParamConfs.get(0).getCollectParameterName()); |
|
757 |
saveData.setCollectionTime(new Date()); |
|
758 |
saveData.setParamValue(value); |
|
759 |
daParamCollectionMapper.insertDaParamCollection(saveData); |
|
760 |
}); |
|
761 |
} |
|
762 |
|
|
763 |
@Override |
|
764 |
public void preInstallOut(DaParamCollection daParamCollection) { |
|
765 |
//增加过站记录 |
|
766 |
DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection(); |
|
767 |
daPassingStationCollection.setSfcCode(daParamCollection.getProductBarcode()); |
|
768 |
daPassingStationCollection.setLocationCode(daParamCollection.getLocationCode()); |
|
769 |
daPassingStationCollection.setInboundTime(daParamCollection.getInboundTime()); |
|
770 |
daPassingStationCollection.setOutboundTime(new Date()); |
|
771 |
daPassingStationCollection.setCreateTime(new Date()); |
|
772 |
daPassingStationCollection.setOutRsSign("1"); |
|
773 |
boolean save = daPassingStationCollectionService.save(daPassingStationCollection); |
|
774 |
//添加基础参数 |
|
775 |
this.manualWorkstationsAddBasicParameters(daParamCollection); |
|
776 |
} |
|
777 |
|
|
778 |
} |