“mitao”
2026-02-26 3d5fc25f40766220a8ec0ec119c77d086115e63f
Merge remote-tracking branch 'origin/master'
2个文件已修改
39 ■■■■■ 已修改文件
xp-robotaxi-account-boot/src/main/resources/mapper/account/XpQualificationAuditMapper.xml 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/AliPushUtil.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-account-boot/src/main/resources/mapper/account/XpQualificationAuditMapper.xml
@@ -13,7 +13,7 @@
        xou.nick_name, xou.phone_number, xou.avatar,xou.unique_number
        from xp_qualification_audit xqa
        left join xp_operations_user xou on xqa.operations_user_id = xou.id
        left join xp_operations_role xor on xou.id = xor.operations_user_id
        left join xp_operations_role xore on xou.id = xore.operations_user_id
        where xqa.is_deleted = 0
            <if test="query.nickName != null and query.nickName != ''">
                and xou.nick_name like concat('%',#{query.nickName},'%')
@@ -22,7 +22,7 @@
                and xou.phone_number like concat('%',#{query.phoneNumber},'%')
            </if>
            <if test="query.roleId != null">
                and xor.role_id = #{query.roleId}
                and xore.role_id = #{query.roleId}
            </if>
            <if test="query.auditStatus != null">
                and xqa.audit_status = #{query.auditStatus}
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/AliPushUtil.java
@@ -1,27 +1,32 @@
package com.xiaopeng.pushMessage.utils;
import com.alibaba.fastjson2.JSONObject;
import com.aliyun.auth.credentials.Credential;
import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
import com.aliyun.sdk.service.push20160801.models.*;
import com.aliyun.sdk.service.push20160801.*;
import com.google.gson.Gson;
import darabonba.core.client.ClientOverrideConfiguration;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
//import javax.net.ssl.KeyManager;
//import javax.net.ssl.X509TrustManager;
import java.util.concurrent.CompletableFuture;
@Slf4j
public class AliPushUtil {
    @Value("${ali.push.accessKeyId}")
    private String accessKeyId;
    @Value("${ali.push.accessKeySecret}")
    private String accessKeySecret;
    @Value("${ali.push.appKey}")
    private Long appKey;
    @Value("${ali.push.regionId}")
    private String regionId;
    @Value("${ali.push.appKey}")
    private Long appKey;
    @Value("${ali.push.iosAppKey}")
    private Long iosAppKey;
    /**
     * 消息类型  MESSAGE 消息  NOTICE  通知
     */
@@ -51,7 +56,7 @@
     * @param body 消息内容
     * @throws Exception
     */
    public void push(String account, String title, String body) throws Exception {
    public String pushMessage(Integer deviceType,String account, String title, String body) throws Exception {
        StaticCredentialProvider credentialProvider = StaticCredentialProvider.create(
                Credential.builder()
@@ -70,9 +75,14 @@
                )
                .build()) {
            // Parameter settings for API request
            // 判断账号类型
            Long appKeys = appKey;
            if(deviceType == 2){
                appKeys = iosAppKey;
            }
            PushRequest pushRequest = PushRequest.builder()
                    .appKey(appKey)
                    .appKey(appKeys)
                    .pushType(PUSH_TYPE)
                    .deviceType(DEVICE_TYPE_ALL)
                    .target(TARGET)
@@ -82,10 +92,21 @@
                    .build();
            CompletableFuture<PushResponse> response = client.push(pushRequest);
            PushResponse resp = response.get();
            System.out.println(new Gson().toJson(resp));
            String json = new Gson().toJson(resp);
            log.info("运维APP-消息推送:{}",json);
            JSONObject jsonObject = JSONObject.parseObject(json);
            Integer statusCode = jsonObject.getInteger("statusCode");
            if(statusCode == 200){
                log.info("运维APP-消息推送成功");
                JSONObject resultBody = jsonObject.getJSONObject("body");
                return resultBody.getString("messageId");
            }else{
                log.info("运维APP-消息推送失败");
                return null;
            }
        }
    }
    public static void main(String[] args) throws Exception {