liujie
2026-02-26 31fd52f2d974d86000b6920cfed68fed4b3ef4ff
Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/Robotaxi
1个文件已添加
4个文件已修改
168 ■■■■■ 已修改文件
xp-robotaxi-account-boot/src/main/resources/mapper/account/XpQualificationAuditMapper.xml 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/maintenance/XpVehicleDetection.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpChargingRecordServiceImpl.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpShiftMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/AliPushUtil.java 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-account-boot/src/main/resources/mapper/account/XpQualificationAuditMapper.xml
@@ -14,7 +14,7 @@
        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
        <where>
        where xqa.is_deleted = 0
            <if test="query.nickName != null and query.nickName != ''">
                and xou.nick_name like concat('%',#{query.nickName},'%')
            </if>
@@ -27,8 +27,6 @@
            <if test="query.auditStatus != null">
                and xqa.audit_status = #{query.auditStatus}
            </if>
            AND xqa.is_deleted = 0
        </where>
        order by xqa.create_time desc
    </select>
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/maintenance/XpVehicleDetection.java
@@ -6,6 +6,7 @@
import java.time.LocalDateTime;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xiaopeng.common.core.web.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -91,6 +92,7 @@
    private Long operationsUserId;
    @ApiModelProperty(value = "检测时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime checkTime;
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpChargingRecordServiceImpl.java
@@ -202,7 +202,6 @@
        // 查询车辆当前充电信息
        XpChargingRecord xpChargingRecord = this.getOne(new LambdaQueryWrapper<XpChargingRecord>()
                .eq(XpChargingRecord::getVehicleId, vehicleId)
                .isNull(XpChargingRecord::getEndRemainingBattery)
                .isNull(XpChargingRecord::getTaskId)
                .orderByDesc(XpChargingRecord::getCreateTime)
                .last("LIMIT 1"));
xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpShiftMapper.xml
@@ -6,6 +6,7 @@
        select id, shift_name, shift_color, start_time, end_time, is_rest,
       rest_start_time, rest_end_time, create_by, create_time, update_by, update_time, is_deleted
        from xp_shift
        where is_deleted = 0
        order by create_time desc
    </select>
</mapper>
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/AliPushUtil.java
New file
@@ -0,0 +1,160 @@
package com.xiaopeng.pushMessage.utils;
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 org.springframework.beans.factory.annotation.Value;
//import javax.net.ssl.KeyManager;
//import javax.net.ssl.X509TrustManager;
import java.util.concurrent.CompletableFuture;
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;
    /**
     * 消息类型  MESSAGE 消息  NOTICE  通知
     */
    private final String PUSH_TYPE = "MESSAGE";
    /**
     * 设备类型 ALL 全部 HARMONY 鸿蒙  IOS ios设备 ANDROID 安卓设备
     */
    private final String DEVICE_TYPE_ALL = "ALL";
    private final String DEVICE_TYPE_HARMONY = "HARMONY";
    private final String DEVICE_TYPE_IOS = "IOS";
    private final String DEVICE_TYPE_ANDROID = "ANDROID";
    /**
     * 推送目标
     * DEVICE:根据设备推送。
     * ACCOUNT:根据账号推送。
     * ALIAS:根据别名推送。
     * TAG:根据标签推送。
     * ALL:推送给全部设备(同一种 DeviceType 的两次全推的间隔至少为 1 秒)。
     */
    private final String TARGET = "ACCOUNT";
    /**
     *
     * @param account 运维手机号
     * @param title 标题
     * @param body 消息内容
     * @throws Exception
     */
    public void push(String account, String title, String body) throws Exception {
        StaticCredentialProvider credentialProvider = StaticCredentialProvider.create(
                Credential.builder()
                        .accessKeyId(accessKeyId)
                        .accessKeySecret(accessKeySecret)
                        .build()
        );
        // Configure the Client
        try (AsyncClient client = AsyncClient.builder()
                .region(regionId) // Region ID
                .credentialsProvider(credentialProvider)
                .overrideConfiguration(
                    ClientOverrideConfiguration.create()
                    .setEndpointOverride("cloudpush.aliyuncs.com")
                )
                .build()) {
            // Parameter settings for API request
            PushRequest pushRequest = PushRequest.builder()
                    .appKey(appKey)
                    .pushType(PUSH_TYPE)
                    .deviceType(DEVICE_TYPE_ALL)
                    .target(TARGET)
                    .targetValue(account)
                    .title(title)
                    .body(body)
                    .build();
            CompletableFuture<PushResponse> response = client.push(pushRequest);
            PushResponse resp = response.get();
            System.out.println(new Gson().toJson(resp));
        }
    }
    public static void main(String[] args) throws Exception {
        // HttpClient Configuration
        /*HttpClient httpClient = new ApacheAsyncHttpClientBuilder()
                .connectionTimeout(Duration.ofSeconds(10)) // Set the connection timeout time, the default is 10 seconds
                .responseTimeout(Duration.ofSeconds(10)) // Set the response timeout time, the default is 20 seconds
                .maxConnections(128) // Set the connection pool size
                .maxIdleTimeOut(Duration.ofSeconds(50)) // Set the connection pool timeout, the default is 30 seconds
                // Configure the proxy
                .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<your-proxy-hostname>", 9001))
                        .setCredentials("<your-proxy-username>", "<your-proxy-password>"))
                // If it is an https connection, you need to configure the certificate, or ignore the certificate(.ignoreSSL(true))
                .x509TrustManagers(new X509TrustManager[]{})
                .keyManagers(new KeyManager[]{})
                .ignoreSSL(false)
                .build();*/
        // Configure Credentials authentication information
        StaticCredentialProvider credentialProvider = StaticCredentialProvider.create(
                Credential.builder()
                        .accessKeyId("LTAI5tRNNQCCPn6Hc42RJYLj")
                        .accessKeySecret("5b9sMu7b5Ab87e3Oa1qujQsBXwvjFx")
                        .build()
        );
        // Configure the Client
        try (AsyncClient client = AsyncClient.builder()
                .region("cn-hangzhou") // Region ID
                //.httpClient(httpClient) // Use the configured HttpClient, otherwise use the default HttpClient (Apache HttpClient)
                .credentialsProvider(credentialProvider)
                //.serviceConfiguration(Configuration.create()) // Service-level configuration
                // Client-level configuration rewrite, can set Endpoint, Http request parameters, etc.
                .overrideConfiguration(
                        ClientOverrideConfiguration.create()
                                // Endpoint 请参考 https://api.aliyun.com/product/Push
                                .setEndpointOverride("cloudpush.aliyuncs.com")
                        //.setConnectTimeout(Duration.ofSeconds(30))
                )
                .build()) {
            // Parameter settings for API request
            PushRequest pushRequest = PushRequest.builder()
                    .appKey(335666344L)
                    .pushType("MESSAGE")
                    .deviceType("ALL")
                    .target("ACCOUNT")
                    .targetValue("account1")
                    .title("消息通知")
                    .body("测试")
                    // Request-level configuration rewrite, can set Http request parameters, etc.
                    // .requestConfiguration(RequestConfiguration.create().setHttpHeaders(new HttpHeaders()))
                    .build();
            // Asynchronously get the return value of the API request
            CompletableFuture<PushResponse> response = client.push(pushRequest);
            // Synchronously get the return value of the API request
            PushResponse resp = response.get();
            System.out.println(new Gson().toJson(resp));
            // Asynchronous processing of return values
            /*response.thenAccept(resp -> {
                System.out.println(new Gson().toJson(resp));
            }).exceptionally(throwable -> { // Handling exceptions
                System.out.println(throwable.getMessage());
                return null;
            });*/
        }
    }
}