|
@@ -22,32 +22,33 @@ public class ParamUtils {
|
|
|
*/
|
|
|
public static void setQueryPowerByRoleType(Map params, String storeKey, String merchKey, boolean bothSet) {
|
|
|
SysUserEntity user = ShiroUtils.getUserEntity();
|
|
|
- if (user != null) {
|
|
|
- if (bothSet) {
|
|
|
- if (Dict.roleType.item_2.getItem().equals(user.getRoleType()) ||
|
|
|
- Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
|
|
|
- if (storeKey == null && merchKey == null) {
|
|
|
- throw new RRException("参数错误");
|
|
|
- }
|
|
|
-
|
|
|
- if (storeKey != null && merchKey != null) {
|
|
|
- throw new RRException("参数错误");
|
|
|
- }
|
|
|
-
|
|
|
- if (storeKey != null) {
|
|
|
- params.put(storeKey, user.getStoreId());
|
|
|
- } else if (merchKey != null) {
|
|
|
- params.put(merchKey, user.getMerchSn());
|
|
|
- }
|
|
|
+ if (user == null) {
|
|
|
+ throw new RRException("用户登录超时,请重新登录");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (bothSet) {
|
|
|
+ if (Dict.roleType.item_2.getItem().equals(user.getRoleType()) ||
|
|
|
+ Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
|
|
|
+ if (storeKey == null && merchKey == null) {
|
|
|
+ throw new RRException("参数错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (storeKey != null && merchKey != null) {
|
|
|
+ throw new RRException("参数错误");
|
|
|
}
|
|
|
- } else {
|
|
|
- if (Dict.roleType.item_2.getItem().equals(user.getRoleType())) {
|
|
|
+
|
|
|
+ if (storeKey != null) {
|
|
|
params.put(storeKey, user.getStoreId());
|
|
|
- } else if (Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
|
|
|
+ } else if (merchKey != null) {
|
|
|
params.put(merchKey, user.getMerchSn());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ } else {
|
|
|
+ if (Dict.roleType.item_2.getItem().equals(user.getRoleType())) {
|
|
|
+ params.put(storeKey, user.getStoreId());
|
|
|
+ } else if (Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
|
|
|
+ params.put(merchKey, user.getMerchSn());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|