| | |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void OutHedTBScheduler() { |
| | | log.info("OutHedTBScheduler开始了"); |
| | | //log.info("OutHedTBScheduler开始了"); |
| | | if (!erpEnabled) return; |
| | | String sqlInHed = "select * from erp_OutHedTB where LKName='中扬二期'"; |
| | | List<OutHedTB> inHeds = erpSqlServer.select(sqlInHed, OutHedTB.class); |
| | | if (!inHeds.isEmpty()) { |
| | | for (OutHedTB inHed : inHeds) { |
| | | System.out.println(inHed); |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + inHed.getBillNo() + "'"); |
| | | List<OutDetTB> inDetTBS = erpSqlServer.selectList(OutDetTB.class, condition); |
| | |
| | | hedAndDet.put("det", inDetTBS); |
| | | boolean result = inMS.createOutOrder(inHed, inDetTBS); |
| | | if (result) { |
| | | log.info("出库单据成功,{}", inHed.getBillNo()); |
| | | move(hedAndDet); |
| | | } else { |
| | | String sql = "UPDATE erp_OutHedTB SET Temp3 = ‘fault’ WHERE BillNo = '" + inHed.getBillNo() + "'"; |