yyy
2026-05-06 b59bca62353f93424818a4dd39068b10948c5267
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/utils/OfficialPartnerUtil.java
@@ -16,6 +16,7 @@
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.format.DateTimeFormatter;
/**
 * 合作商工具类
@@ -30,12 +31,14 @@
    private UserResourcesClient userResourcesClient;
    /**
     * 推送新的订单给合作商
     * @param officialPartnerId
     * @return
     */
    public R<?> pusNewOrder(Integer officialPartnerId, XpOrder xpOrder) {
    public R<?> pushNewOrder(Integer officialPartnerId, XpOrder xpOrder) {
        XpOfficialPartner xpOfficialPartner = xpOfficialPartnerService.getById(officialPartnerId);
        String createOrderUrl = xpOfficialPartner.getCreateOrderUrl();
        PushNewOrderVo pushNewOrderVo = buildNewOrder(xpOrder);
@@ -43,13 +46,13 @@
        post.body(JSON.toJSONString(pushNewOrderVo));
        HttpResponse execute = post.execute();
        if(!execute.isOk()){
            throw new ServiceException("调用合作商接口失败-通知新订单接口");
            throw new ServiceException("[" + xpOfficialPartner.getName() + "]调用合作商接口失败-通知新订单接口");
        }
        OfficialPartnerResult officialPartnerResult = JSON.parseObject(execute.body(), OfficialPartnerResult.class);
        if(0 == officialPartnerResult.getCode()){
            return R.ok();
        }
        return R.fail(officialPartnerResult.getMsg());
        throw new ServiceException("[" + xpOfficialPartner.getName() + "]" + officialPartnerResult.getMsg());
    }
@@ -77,8 +80,13 @@
        if(ucUserInfo != null){
            vo.setUserPhone(ucUserInfo.getMobile());
        }
        vo.setCreateTime(xpOrder.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        return vo;
    }
    public R<?> pushCancelOrder(Integer officialPartnerId, XpOrder xpOrder) {
    }
}