| File was renamed from xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/BootCommonService.java |
| | |
| | | package com.xiaopeng.order.service; |
| | | package com.xiaopeng.order.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.xiaopeng.api.feignClient.operation.XpPricingClient; |
| | |
| | | import com.xiaopeng.common.core.enums.OrderStatusEnum; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import com.xiaopeng.order.service.IXpOrderService; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Service |
| | | @Component |
| | | public class BootCommonService { |
| | | |
| | | @Resource |
| | |
| | | @Resource |
| | | private XpVehicleClient xpVehicleClient; |
| | | @Resource |
| | | @Lazy |
| | | private IXpOrderService xpOrderService; |
| | | @Resource |
| | | private RedisService redisService; |
| | |
| | | if(order == null){ |
| | | order = xpOrderService.getById(xpOrderId); |
| | | } |
| | | redisService.setCacheObject("ORDER_STATUS:" + xpOrderId, status.getCode(), 24L, TimeUnit.HOURS); |
| | | redisService.setCacheObject("ORDER_STATUS:" + xpOrderId, order.getStatus(), 24L, TimeUnit.HOURS); |
| | | |
| | | SendSubscribeMessageVo vo = new SendSubscribeMessageVo(); |
| | | vo.setUserId(order.getAppUserId()); |
| | |
| | | vo.setTemplateId(MessageTemplateEnum.A.getTemplateId()); |
| | | json = MessageTemplateEnum.A.getRemarks(); |
| | | json = json.replace("订单编号", order.getOrderNumber()); |
| | | json = json.replace("订单状态", status.getDesc() ); |
| | | json = json.replace("订单状态", OrderStatusEnum.getDescByCode(order.getStatus())); |
| | | json = json.replace("备注", bz); |
| | | json = json.replace("时间", LocalDateTime.now().toString()); |