|  |  | 
 |  |  | import com.zy.common.model.enums.WorkNoType; | 
 |  |  | import com.zy.common.service.CommonService; | 
 |  |  | import com.zy.common.utils.NodeUtils; | 
 |  |  | import com.zy.third.erp.task.ERPOutHedTBScheduler; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Resource | 
 |  |  |     private WrkMastService wrkMastService; | 
 |  |  |  | 
 |  |  |     @Resource | 
 |  |  |     private ERPOutHedTBScheduler erpOutHedTBScheduler; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  | 
 |  |  |         // 获取单据 | 
 |  |  |         Order order = orderService.selectByNo(orderNo); | 
 |  |  |         if (order == null) { | 
 |  |  |             int i = 30; | 
 |  |  |             while (i >= 0) { | 
 |  |  |                 try { | 
 |  |  |                     Thread.sleep(1000); | 
 |  |  |                 } catch (InterruptedException e) { | 
 |  |  |                     throw new RuntimeException(e); | 
 |  |  |                 } | 
 |  |  |                 order = orderService.selectByNo(orderNo); | 
 |  |  |                 if (order != null) { | 
 |  |  |                     break; | 
 |  |  |                 } | 
 |  |  |                 i--; | 
 |  |  |             } | 
 |  |  |             erpOutHedTBScheduler.OutHedTBScheduler(orderNo); | 
 |  |  |             order = orderService.selectByNo(orderNo); | 
 |  |  | //            int i = 30; | 
 |  |  | //            while (i >= 0) { | 
 |  |  | //                try { | 
 |  |  | //                    Thread.sleep(1000); | 
 |  |  | //                    System.out.println(i); | 
 |  |  | //                } catch (InterruptedException e) { | 
 |  |  | //                    throw new RuntimeException(e); | 
 |  |  | //                } | 
 |  |  | //                order = orderService.selectByNo(orderNo); | 
 |  |  | //                if (order != null) { | 
 |  |  | //                    break; | 
 |  |  | //                } | 
 |  |  | //                i--; | 
 |  |  | //            } | 
 |  |  |         } | 
 |  |  |         if (order == null) { | 
 |  |  |             return R.parse("单据不存在:" + orderNo); |