| | |
| | | if (ObjectUtil.isNotNull(stationStatusObjcet)) { |
| | | String stationStatus = stationStatusObjcet.toString(); |
| | | if (Constants.OP010.equals(device)) { |
| | | CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { |
| | | updateOrderStatus(snCode, "3");//OP010工位更新工单状态为执行中 |
| | | reportFactoryMes(snCode, device, format.format(new Date()));//工厂MES报工 |
| | | }); |
| | | Object housingCodeObjcet = miloService.readFromOpcUa(thoroughfare + "." + device + ".HousingCode").getValue();//壳体条码,存到工单,返修用 |
| | | if (ObjectUtil.isNull(housingCodeObjcet)){ |
| | | result = 25; |
| | | }else{ |
| | | String housingCode = housingCodeObjcet.toString();//壳体条码,存到工单,返修用 |
| | | if(housingCode.length()<10){ |
| | | result = 25; |
| | | }else{ |
| | | CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { |
| | | updateOrderStatus(snCode, "3",housingCode);//OP010工位更新工单状态为执行中,并更新主物料壳体条码 |
| | | reportFactoryMes(snCode, device, format.format(new Date()));//工厂MES报工 |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | result = savePassingStation(thoroughfare, device, snCode, orderNumber, stationStatus);//保存过站 |
| | | if(result == 21){ |
| | | result = savePassingStation(thoroughfare, device, snCode, orderNumber, stationStatus);//保存过站 |
| | | } |
| | | if (result == 21) { |
| | | result = saveParamCollection(device, snCode, orderNumber, stationStatus);//保存参数,发送工厂MES |
| | | } |
| | |
| | | * @param orderStatus 工单状态 |
| | | * @throws Exception e |
| | | */ |
| | | private static void updateOrderStatus(String snCode,String orderStatus){ |
| | | private static void updateOrderStatus(String snCode,String orderStatus,String materialCode){ |
| | | try { |
| | | //更新工单状态为已执行 |
| | | LambdaUpdateWrapper<OmProductionOrdeInfo> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.set(OmProductionOrdeInfo::getOrderStatus,orderStatus); |
| | | updateWrapper.set(OmProductionOrdeInfo::getMaterialCode,materialCode); |
| | | updateWrapper.eq(OmProductionOrdeInfo::getProductNum,snCode); |
| | | omProductionOrdeInfoService.update(new OmProductionOrdeInfo(),updateWrapper); |
| | | } catch (Exception e) { |