mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 19:45:09 +08:00
update 电单车协议
This commit is contained in:
@@ -16,9 +16,9 @@ import com.jsowell.pile.service.PileStationInfoService;
|
||||
import com.jsowell.pile.vo.base.LoginUserDetailVO;
|
||||
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -33,7 +33,6 @@ import java.util.stream.Collectors;
|
||||
public class UserUtils {
|
||||
|
||||
// 2.注入想引用的对象的静态实例
|
||||
private static MemberBasicInfoService memberBasicInfoService;
|
||||
|
||||
private static PileMerchantInfoService pileMerchantInfoService;
|
||||
|
||||
@@ -43,7 +42,6 @@ public class UserUtils {
|
||||
@Autowired
|
||||
public UserUtils(MemberBasicInfoService memberBasicInfoService, PileMerchantInfoService pileMerchantInfoService,
|
||||
PileStationInfoService pileStationInfoService) {
|
||||
UserUtils.memberBasicInfoService = memberBasicInfoService;
|
||||
UserUtils.pileMerchantInfoService = pileMerchantInfoService;
|
||||
UserUtils.pileStationInfoService = pileStationInfoService;
|
||||
}
|
||||
@@ -195,4 +193,21 @@ public class UserUtils {
|
||||
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
||||
return loginUserDetail.getFirstMerchantIdList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验当前登录用户是否有操作站点权限
|
||||
* @param stationId 站点id
|
||||
* @return boolean true:有权限,false:无权限
|
||||
*/
|
||||
public static boolean checkStationAuth(String stationId) {
|
||||
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
|
||||
if (authorizedMap == null) {
|
||||
return false;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(authorizedMap.getStationDeptIds())) {
|
||||
return false;
|
||||
}
|
||||
List<String> list = pileStationInfoService.queryByStationDeptIds(authorizedMap.getStationDeptIds());
|
||||
return list.contains(stationId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user