| | |
| | | } |
| | | |
| | | XpOrder order = this.getById(id); |
| | | Long appUserId = order.getAppUserId(); |
| | | |
| | | if (Objects.isNull(order)) { |
| | | throw new ServiceException("订单不存在", I18nKeyConstant.ORDER_NOT_EXISTS); |
| | | } |
| | |
| | | if (!updated) { |
| | | throw new ServiceException("订单改价失败,请稍后重试", I18nKeyConstant.ORDER_CHANGE_AMOUNT_FAILED); |
| | | } |
| | | |
| | | |
| | | // 消息推送 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | Map<String, Object> content = new HashMap<>(); |
| | | content.put("orderId", order.getId().toString()); |
| | | content.put("status", OrderStatusEnum.APPROVAL_REJECTION.getCode()); |
| | | params.put("type", PushMessageTypeEnum.ORDER_UPDATE_PRICE.getDesc()); |
| | | params.put("content", JSONObject.toJSONString(content)); |
| | | params.put("timestamp", new Date().getTime() + ""); |
| | | String message = JSONObject.toJSONString(params); |
| | | SendMessageDTO sendMessageDTO = new SendMessageDTO(); |
| | | sendMessageDTO.setMessage(message); |
| | | sendMessageDTO.setAppUserId(String.valueOf(appUserId)); |
| | | xpPushMessageClient.sendStatus(sendMessageDTO); |
| | | log.info("订单修改价格推送消息完毕"); |
| | | } |
| | | } |