jiangqs
2023-06-06 92da9546e1b37b06f78671b34389b1dec9dfadfc
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/util/CodeFactoryUtil.java
@@ -28,8 +28,8 @@
    //静态住入到自己的类中
    private static RedisService redisService;
    //将静态属性以入参(形参)的方式传入一个方法中,然后将此方法通过 @Autowired 注入到Spring容器中
    @Autowired
    //将静态属性以入参(形参)的方式传入一个方法中,然后将此方法通过 @Resource 注入到Spring容器中
    @Resource
    public void setService(RedisService redisService) {
        CodeFactoryUtil.redisService = redisService;
    }
@@ -58,7 +58,7 @@
     * 用户id和随机数总长度
     */
    private static final int maxLength = 4;
    private static final int MAX_LENGTH = 4;
    /**
     * 更具id进行加密+加随机数组成固定长度编码
@@ -78,7 +78,7 @@
     */
    public static String getShopNo(Long shopId) {
        String prefix = SHOP_PREFIX;
        return toFillZeroCode(prefix, maxLength, shopId);
        return toFillZeroCode(prefix, MAX_LENGTH, shopId);
    }
    public static String getShopOrderNo() {