diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index 1a262655..e0d86055 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -321,11 +321,11 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { logger.info("==========================母工单报工开始"); pHzWork.setQuantityFeedback(sHzWorks.getQuantityFeedback()); pHzWork.setSac1(sHzWorks.getSac1()); - this.reportHzToSap(pHzWork); + R sapR = this.reportHzToSap(pHzWork); logger.info("==========================母工单报工结束"); - //最终报工标识:关闭子母工单 + //最终报工标识且sap报工成功:关闭子母工单 MesReportWork endReport = mesReportWorkMapper.getEndReport(pHzWork); - if("1".equals(endReport.getEndReport())){ + if("1".equals(endReport.getEndReport())&&sapR.getCode()==200){ logger.info("报工======母sap工单编码:"+sapWorkOrders.get(0).getWorkorderCodeSap()+ "子sap工单编码:"+sapWorkOrders.get(1).getWorkorderCodeSap() ); @@ -405,6 +405,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { } else { workOrder.setUploadStatus("2"); workOrder.setUploadMsg(r.getMsg()); + return r; } workOrder.setUploadTime(DateUtils.getNowDate()); mesReportWorkMapper.updateSyncSapStatus(workOrder);