改造
This commit is contained in:
@@ -235,6 +235,7 @@ public enum ErrorCodeEnum {
|
||||
GET_JURIDICAL_ID_CARD_NO_FAIL(131002,"获取法人身份证信息失败!",null),
|
||||
UPDATE_INVESTMENT_MANAGER_FAIL(131005,"当前用户已经为该门店招商经理",null),
|
||||
CONFIRM_THE_APPROVER(131006,"您提交的铺位暂时找不到选址审批人,请联系系统管理员配置选址审批权限后再提交铺位审批",null),
|
||||
CREATE_PASSWORD_FAIL(131007,"身份证号信息错误",null),
|
||||
|
||||
TALLY_BOOK_NOT_EXIST(180001, "记账本数据不存在", null),
|
||||
|
||||
|
||||
@@ -77,6 +77,8 @@ public enum MessageEnum {
|
||||
MESSAGE_49("您有一个门店美团外卖初审已通过,请查收","门店名称:${storeName}\n加盟商姓名:${partnerUsername}\n加盟商手机号码:${partnerMobile}\n"),
|
||||
MESSAGE_50("您有一个门店开业运营方案审核未通过,请查收","门店名称:${storeName}\n加盟商姓名:${partnerUsername}\n加盟商手机号码:${partnerMobile}\n"),
|
||||
MESSAGE_51("您有一个加盟商提交了铺位,请查收","铺位名称:${pointName}\n加盟商姓名:${partnerUsername}\n加盟商手机号码:${partnerMobile}\n"),
|
||||
MESSAGE_52("您有一个门店建店资料的订货信息待提交,请查收","门店名称:${storeName}\n加盟商姓名:${partnerUsername}\n加盟商手机号码:${partnerMobile}\n"),
|
||||
MESSAGE_53("您有一个门店建店资料的总部订货收款账户信息待提交,请查收","门店名称:${storeName}\n加盟商姓名:${partnerUsername}\n加盟商手机号码:${partnerMobile}\n"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/04/06/17:08
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public enum OrderSysTypeEnum {
|
||||
|
||||
ORDER_SYS_TYPE_1(1,"订货信息"),
|
||||
ORDER_SYS_TYPE_2(2,"总部订货收款账户");
|
||||
private Integer type;
|
||||
private String name;
|
||||
OrderSysTypeEnum(Integer type, String name) {
|
||||
this.type = type;
|
||||
this.name = name;
|
||||
}
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -77,6 +77,8 @@ public enum ShopSubStageStatusEnum {
|
||||
|
||||
//平台资料提交
|
||||
SHOP_SUB_STAGE_STATUS_150(ShopSubStageEnum.SHOP_STAGE_15, 1500, "待提交", Boolean.FALSE),
|
||||
SHOP_SUB_STAGE_STATUS_151(ShopSubStageEnum.SHOP_STAGE_15, 1510, "订货信息待提交", Boolean.TRUE),
|
||||
SHOP_SUB_STAGE_STATUS_152(ShopSubStageEnum.SHOP_STAGE_15, 1520, "总部订货收款账户待提交",Boolean.TRUE),
|
||||
SHOP_SUB_STAGE_STATUS_153(ShopSubStageEnum.SHOP_STAGE_15, 1530, "已完成", Boolean.TRUE),
|
||||
|
||||
//POS
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/04/06/15:03
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public class PasswordUtil {
|
||||
|
||||
/**
|
||||
* 生成随机盐值
|
||||
*
|
||||
* @return 随机生成的盐值(字节数组)
|
||||
*/
|
||||
public static byte[] generateSalt() {
|
||||
SecureRandom secureRandom = new SecureRandom();
|
||||
// 16 字节的盐值
|
||||
byte[] salt = new byte[16];
|
||||
secureRandom.nextBytes(salt);
|
||||
return salt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字节数组转换为十六进制字符串
|
||||
*
|
||||
* @param bytes 字节数组
|
||||
* @return 十六进制字符串
|
||||
*/
|
||||
public static String bytesToHex(byte[] bytes) {
|
||||
StringBuilder hexString = new StringBuilder();
|
||||
for (byte b : bytes) {
|
||||
String hex = Integer.toHexString(0xff & b);
|
||||
if (hex.length() == 1) {
|
||||
hexString.append('0');
|
||||
}
|
||||
hexString.append(hex);
|
||||
}
|
||||
return hexString.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用 SHA-256 加密密码
|
||||
*
|
||||
* @param plainPassword 明文密码
|
||||
* @param salt 盐值
|
||||
* @return 加密后的密码(十六进制字符串)
|
||||
*/
|
||||
public static String encryptPassword(String plainPassword, byte[] salt) {
|
||||
try {
|
||||
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
|
||||
// 将盐值和明文密码拼接后进行哈希计算
|
||||
messageDigest.update(salt);
|
||||
byte[] hashedBytes = messageDigest.digest(plainPassword.getBytes());
|
||||
|
||||
// 将字节数组转换为十六进制字符串
|
||||
return bytesToHex(hashedBytes);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException("Error encrypting password", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user