| | |
| | | import java.util.concurrent.CompletableFuture; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static org.apache.commons.lang3.SystemUtils.getUserName; |
| | | |
| | | /** |
| | | * 设备产品过程参数采集Service业务层处理 |
| | | * |
| | |
| | | daParamCollectionTempService.insertBatch(saveParamListTemp); |
| | | } |
| | | } |
| | | |
| | | public void addCollectParamBasicData(String stationCode,String modelCode){ |
| | | List<DaCollectionParamConf> confList = daCollectionParamConfService.list(new LambdaQueryWrapper<DaCollectionParamConf>().like(DaCollectionParamConf::getCollectParameterId, "YGBH")); |
| | | if(!confList.isEmpty()){ |
| | | DaCollectionParamConf daCollectionParamConf = confList.get(0); |
| | | DaParamCollection collection = new DaParamCollection(); |
| | | collection.setSfcCode(modelCode);//模组码 |
| | | collection.setParamCode(daCollectionParamConf.getCollectParameterId());//参数编码 |
| | | collection.setParamName(daCollectionParamConf.getCollectParameterName());//参数名称 |
| | | collection.setParamValue(getUserName());//参数值 |
| | | collection.setLocationCode(stationCode);//工位 |
| | | collection.setCollectionTime(new Date());//采集时间 |
| | | daParamCollectionService.save(collection); |
| | | |
| | | DaParamCollectionTemp collectionTemp = new DaParamCollectionTemp(); |
| | | collectionTemp.setSfcCode(modelCode);//模组码 |
| | | collectionTemp.setParamCode(daCollectionParamConf.getCollectParameterId());//参数编码 |
| | | collectionTemp.setParamName(daCollectionParamConf.getCollectParameterName());//参数名称 |
| | | collectionTemp.setParamValue(getUserName());//参数值 |
| | | collectionTemp.setLocationCode(stationCode);//工位 |
| | | collectionTemp.setCollectionTime(new Date());//采集时间 |
| | | daParamCollectionTempService.save(collectionTemp); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void pushStartStopTime(String paramCode, String paramName, String productNum) { |
| | | ParentVO parentVO = new ParentVO(); |
| | | parentVO.setSiteCode("3983"); |
| | | parentVO.setRecordId(String.valueOf(Instant.now().toEpochMilli())); |
| | | parentVO.setStationCode("OP165"); |
| | | parentVO.setProductNum(productNum); |
| | | parentVO.setTotalResult("1"); |
| | | List<ChildVO> listChildVo = new ArrayList<>(); |
| | | ChildVO childVO = new ChildVO(); |
| | | childVO.setItemCode(paramCode); |
| | | childVO.setItemType("3"); |
| | | childVO.setItemText(paramName); |
| | | childVO.setItemValue(format.format(new Date())); |
| | | childVO.setCheckResult("1"); |
| | | childVO.setCheckTime(format.format(new Date())); |
| | | listChildVo.add(childVO); |
| | | parentVO.setCheckList(listChildVo); |
| | | try{ |
| | | CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { |
| | | HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_GET_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute(); |
| | | System.out.println(execute.body()); |
| | | }); |
| | | }catch (Exception e){ |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void insertBatch(List<DaParamCollection> confList){ |
| | | try{ |
| | |
| | | |
| | | @Override |
| | | public void pushGeelycvMesFeedback(String packID, String stationCode) { |
| | | //添加基础参数(登陆人信息) |
| | | try { |
| | | addCollectParamBasicData(stationCode,packID); |
| | | }catch (Exception e){ |
| | | throw new RuntimeException(e); |
| | | } |
| | | logger.info("进入人工工位推送工厂MES数据方法-pushGeelycvMesFeedback-工位{}-pack码{}",stationCode,packID); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String totalResult = "0"; |