| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | @Async("orderThreadPool") |
| | | public void OutHedTBScheduler() { |
| | | //log.info("OutHedTBScheduler开始了"); |
| | | if (!erpEnabled) return; |
| | |
| | | if (!inHeds.isEmpty()) { |
| | | for (OutHedTB inHed : inHeds) { |
| | | if (!Cools.isEmpty(inHed.getTemp3()) && inHed.getTemp3().equals("fault")) { |
| | | continue; |
| | | //continue; |
| | | } |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + inHed.getBillNo() + "'"); |
| | |
| | | hedAndDet.put("det", inDetTBS); |
| | | try { |
| | | inMS.createOutOrder(inHed, inDetTBS); |
| | | log.info("出库单据成功,{}", inHed); |
| | | move(hedAndDet); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String sql = "UPDATE erp_OutHedTB SET Temp3 = 'fault' WHERE BillNo = '" + inHed.getBillNo() + "'"; |
| | | erpSqlServer.update(sql); |
| | | } |
| | | log.info("出库单据成功,{}", inHed); |
| | | move(hedAndDet); |
| | | |
| | | } |
| | | } |
| | | } |