mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-08 12:00:11 +08:00
新增 重发结算订单信息到mq
This commit is contained in:
@@ -877,4 +877,17 @@ public class TempController extends BaseController {
|
|||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/retrySendOrderData2Mq")
|
||||||
|
public RestApiResponse<?> retrySendOrderData2Mq(@RequestBody QueryOrderDTO dto) {
|
||||||
|
RestApiResponse<?> response;
|
||||||
|
try {
|
||||||
|
tempService.sendOrderData2Mq(dto.getOrderCode());
|
||||||
|
response = new RestApiResponse<>();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("重试分账接口error,", e);
|
||||||
|
response = new RestApiResponse<>(e);
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1187,5 +1187,30 @@ public class TempService {
|
|||||||
logger.info("debugOrder结束, resultMap:{}", JSONObject.toJSONString(resultMap));
|
logger.info("debugOrder结束, resultMap:{}", JSONObject.toJSONString(resultMap));
|
||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void sendOrderData2Mq(String orderCode) {
|
||||||
|
// 通过订单编号查询订单信息
|
||||||
|
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
|
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||||
|
if (orderBasicInfo == null || orderDetail == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 发送消息
|
||||||
|
AfterSettleOrderDTO afterSettleOrderDTO = AfterSettleOrderDTO.builder()
|
||||||
|
.orderCode(orderBasicInfo.getOrderCode())
|
||||||
|
.merchantId(orderBasicInfo.getMerchantId())
|
||||||
|
.stationId(orderBasicInfo.getStationId())
|
||||||
|
.orderPayAmount(orderBasicInfo.getPayAmount()) // 支付金额
|
||||||
|
.orderConsumeAmount(orderBasicInfo.getOrderAmount()) // 消费金额
|
||||||
|
.orderSettleAmount(orderBasicInfo.getSettleAmount()) // 结算金额
|
||||||
|
.orderElectricityAmount(orderDetail.getTotalElectricityAmount()) // 电费金额
|
||||||
|
.orderElectricityDiscountAmount(orderDetail.getDiscountElectricityAmount()) // 电费折扣金额
|
||||||
|
.orderServiceAmount(orderDetail.getTotalServiceAmount()) // 服务费金额
|
||||||
|
.orderServiceDiscountAmount(orderDetail.getDiscountServiceAmount()) // 服务费折扣金额
|
||||||
|
.orderRefundAmount(orderBasicInfo.getRefundAmount()) // 退款金额
|
||||||
|
.build();
|
||||||
|
|
||||||
|
rabbitTemplate.convertAndSend(RabbitConstants.YKC_EXCHANGE_NAME, RabbitConstants.QUEUE_CHARGE_ORDER_DATA, afterSettleOrderDTO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user