| | |
| | | } |
| | | |
| | | /** |
| | | * 完成销售订单 |
| | | * 完成采购退货订单 |
| | | */ |
| | | @Scheduled(cron = "0/10 * * * * ? ") |
| | | @Transactional |
| | |
| | | /** |
| | | * 获取取消订单 |
| | | */ |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | @Scheduled(cron = "0/10 * * * * ? ") |
| | | @Transactional |
| | | // @PostConstruct |
| | | public void getCancelOrdersExecute(){ |
| | | try { |
| | | Map<String, Object> json = new HashMap<>(); |
| | | json.put("vchType", 151); |
| | | json.put("flag", 2); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(URI) |
| | | .setPath(OVER_BILL) |
| | | .setPath(GET_ORDERS) |
| | | .setJson(JSON.toJSONString(json)) |
| | | .build() |
| | | .doPost(); |
| | |
| | | } |
| | | List<GetOrderResult0> list = JSON.parseArray(result.getData(), GetOrderResult0.class); |
| | | if (!Cools.isEmpty(list)) { |
| | | boolean complete = true; |
| | | Set<String> existNumbers = new HashSet<>(); |
| | | |
| | | String cancelNumber = ""; |
| | | if (!orderService.updateSettle(cancelNumber, 5L)) { |
| | | throw new CoolException("修改订单状态失败"); |
| | | for (GetOrderResult0 result0 : list) { |
| | | existNumbers.add(result0.getNumber()); |
| | | } |
| | | |
| | | for (String number : existNumbers) { |
| | | if (!orderService.updateSettle(number, 3L)) { |
| | | // throw new CoolException("修改订单状态失败"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |