无关风月
2025-01-16 9dc9647ed17359280a21e98050e9bb77df21c796
Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/qijisheng
4个文件已修改
44 ■■■■ 已修改文件
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SeckillActivityInfoController.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianSubscribeVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SeckillActivityInfoController.java
@@ -26,6 +26,7 @@
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
@@ -90,13 +91,44 @@
        GoodsSeckill goodsSeckill = goodsSeckillService.getOne(new LambdaQueryWrapper<GoodsSeckill>().eq(GoodsSeckill::getSeckillActivityInfoId, one.getId()).eq(GoodsSeckill::getVip, info.getVip()));
        if(null != goodsSeckill){
            LocalDateTime endTime = one.getEndTime();
//            // 转时间戳
            // 转时间戳
            long timeStamp = endTime.toInstant(ZoneOffset.of("+8")).toEpochMilli();
            goodsSeckill.setEndTime(timeStamp);
        }
        return R.ok(goodsSeckill);
    }
    public static void main(String[] args) {
        // 创建 LocalDateTime 对象
        LocalDateTime localDateTime = LocalDateTime.of(2025, 1, 16, 9, 34, 55);
        // 转换为 UTC 时间戳(毫秒)
        long l = localDateTime.toEpochSecond(ZoneOffset.UTC) * 1000;
        System.out.println("UTC 时间戳: " + l);
        // 转换为 UTC+8 时间戳(毫秒)
        long l2 = localDateTime.toInstant(ZoneOffset.of("+8")).toEpochMilli();
        System.out.println("UTC+8 时间戳: " + l2);
        // 将时间戳转换为 yyyy-MM-dd HH:mm:ss 格式的字符串
        String utcTime = formatTimestamp(l, ZoneOffset.UTC);
        String utcPlus8Time = formatTimestamp(l2, ZoneOffset.of("+8"));
        System.out.println("UTC 时间: " + utcTime);
        System.out.println("UTC+8 时间: " + utcPlus8Time);
    }
    /**
     * 将时间戳转换为指定时区的 yyyy-MM-dd HH:mm:ss 格式字符串
     *
     * @param timestamp 时间戳(毫秒)
     * @param zoneOffset 时区偏移量
     * @return 格式化后的时间字符串
     */
    private static String formatTimestamp(long timestamp, ZoneOffset zoneOffset) {
        return LocalDateTime.ofEpochSecond(timestamp / 1000, 0, zoneOffset)
                .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
@@ -124,8 +124,10 @@
        }
        for (TechnicianSubscribeVO technicianSubscribeVO : technicianSubscribeByUserAndShop1) {
            AppUser appUser = appUserClient.getAppUserById(technicianSubscribeVO.getAppUserId());
            technicianSubscribeVO.setUserName(appUser.getName());
            technicianSubscribeVO.setPhone(appUser.getPhone());
            if(appUser!=null){
                technicianSubscribeVO.setUserName(appUser.getName());
                technicianSubscribeVO.setPhone(appUser.getPhone());
            }
        }
        return pageInfo.setRecords(technicianSubscribeByUserAndShop1);
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianSubscribeVO.java
@@ -52,7 +52,7 @@
    /**
     * 预约状态:0=待服务,1=已服务,2=已取消
     */
    @ApiModelProperty(value = "预约状态:0=待服务,1=已服务,2=已取消 4 已到期")
    @ApiModelProperty(value = "预约状态:0=待服务,1=已服务,2=已取消 3 已到期")
    private Integer status;
    @ApiModelProperty(value = "经度")
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml
@@ -74,7 +74,7 @@
            tts.subscribe_time,
            tts.service_mode,
        CASE
        WHEN tts.subscribe_time <![CDATA[<]]> NOW()  THEN 4
        WHEN tts.subscribe_time <![CDATA[<]]> NOW()  THEN 3
        ELSE tts.status
        END AS status
        FROM