mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
Merge branch 'dev_local' into dev
# Conflicts: # jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileStationInfoMapper.java # jsowell-pile/src/main/java/com/jsowell/pile/service/IPileStationInfoService.java # jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java # jsowell-pile/src/main/resources/mapper/pile/PileStationInfoMapper.xml
This commit is contained in:
@@ -1,21 +1,13 @@
|
||||
package com.jsowell.common.util;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.constant.HttpStatus;
|
||||
import com.jsowell.common.core.domain.entity.SysDept;
|
||||
import com.jsowell.common.core.domain.entity.SysRole;
|
||||
import com.jsowell.common.core.domain.entity.SysUser;
|
||||
import com.jsowell.common.core.domain.model.LoginUser;
|
||||
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
|
||||
import com.jsowell.common.exception.ServiceException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 安全服务工具类
|
||||
*
|
||||
@@ -108,7 +100,7 @@ public class SecurityUtils {
|
||||
}
|
||||
|
||||
// 查询登录用户权限
|
||||
public static AuthorizedDeptVO getAuthorizedMap() {
|
||||
/*public static AuthorizedDeptVO getAuthorizedMap() {
|
||||
// 登录用户
|
||||
LoginUser loginUser = getLoginUser();
|
||||
if (loginUser == null) {
|
||||
@@ -130,7 +122,6 @@ public class SecurityUtils {
|
||||
resultVO.setDeptId(deptId);
|
||||
log.info("用户id:{}, 所属部门信息:{}", user.getUserId(), JSONObject.toJSONString(dept));
|
||||
// 登录用户角色
|
||||
List<SysRole> roles = user.getRoles();
|
||||
Long parentId = dept.getParentId();
|
||||
resultVO.setParentId(String.valueOf(parentId));
|
||||
List<String> merchantDeptIds = Lists.newArrayList();
|
||||
@@ -147,5 +138,5 @@ public class SecurityUtils {
|
||||
resultVO.setStationDeptIds(stationDeptIds);
|
||||
}
|
||||
return resultVO;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.google.common.collect.Sets;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.RandomUtil;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -48,6 +50,32 @@ public class IdUtils {
|
||||
return UUID.fastUUID().toString(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过UUID生成16位唯一订单号
|
||||
*/
|
||||
public static String get16UUID(){
|
||||
// 1.开头两位,标识业务代码或机器代码(可变参数)
|
||||
String machineId = "89";
|
||||
// 2.中间四位整数,标识日期
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("MMdd");
|
||||
String dayTime = sdf.format(new Date());
|
||||
|
||||
// 2.生成四位随机整数
|
||||
int valueOf = (int)((Math.random()*9+1)*1000);
|
||||
|
||||
// 3.生成uuid的hashCode值
|
||||
int hashCode = UUID.randomUUID().toString().hashCode();
|
||||
// 4.可能为负数
|
||||
if(hashCode < 0){
|
||||
hashCode = -hashCode;
|
||||
}
|
||||
// 5.算法处理: 0-代表前面补充0; 10-代表长度为10; d-代表参数为正数型
|
||||
String value = machineId + valueOf + String.format("%010d", hashCode);
|
||||
// System.out.println(value);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成交易流水号
|
||||
* @param pileSn 桩编号 例如:32010600019236
|
||||
|
||||
Reference in New Issue
Block a user