|
@@ -17,6 +17,7 @@ import com.platform.service.impl.ZhiHouseService;
|
|
import com.platform.utils.*;
|
|
import com.platform.utils.*;
|
|
import com.platform.vo.BrandBindUserVo;
|
|
import com.platform.vo.BrandBindUserVo;
|
|
import com.platform.vo.BrandRspVo;
|
|
import com.platform.vo.BrandRspVo;
|
|
|
|
+import com.platform.vos.CurrentUserLoginVo;
|
|
import com.platform.vos.TbUser;
|
|
import com.platform.vos.TbUser;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -112,10 +113,10 @@ public class BrandController extends AbstractController{
|
|
List<Long> deptIdList = new ArrayList<>();
|
|
List<Long> deptIdList = new ArrayList<>();
|
|
Long userId = null;
|
|
Long userId = null;
|
|
//如果不是超级管理员,则只能查询本部门及子部门数据
|
|
//如果不是超级管理员,则只能查询本部门及子部门数据
|
|
- if (getUserId() != Constant.SUPER_ADMIN) {
|
|
|
|
- Long roleId = getUser().getRoleId();
|
|
|
|
|
|
+ List<Long> roleIdList = getUser().getRoleIdList();
|
|
|
|
+ if (!roleIdList.contains(1L) && !roleIdList.contains(5L)) {
|
|
// 公司员工只能看到已经绑定自身为主播的数据
|
|
// 公司员工只能看到已经绑定自身为主播的数据
|
|
- if (roleId == 8) {
|
|
|
|
|
|
+ if (roleIdList.contains(8L)) {
|
|
userId = getUserId();
|
|
userId = getUserId();
|
|
}else{
|
|
}else{
|
|
if(ObjectUtils.isEmpty(getUser().getCompanyId())){
|
|
if(ObjectUtils.isEmpty(getUser().getCompanyId())){
|
|
@@ -306,8 +307,8 @@ public class BrandController extends AbstractController{
|
|
*/
|
|
*/
|
|
@RequestMapping("/queryAll")
|
|
@RequestMapping("/queryAll")
|
|
public Result queryAll(@RequestBody Map<String, Object> params) {
|
|
public Result queryAll(@RequestBody Map<String, Object> params) {
|
|
- Long userId = getUserId();
|
|
|
|
- if(Constant.SUPER_ADMIN != userId){
|
|
|
|
|
|
+ List<Long> roleIds = zhiHouseService.getCurrentUser().getRoleIdList();
|
|
|
|
+ if(!roleIds.contains(5) && !roleIds.contains(1)){
|
|
//通过部门ID过滤数据
|
|
//通过部门ID过滤数据
|
|
if(null == getDeptId()){
|
|
if(null == getDeptId()){
|
|
return Result.success(new ArrayList<>());
|
|
return Result.success(new ArrayList<>());
|
|
@@ -328,9 +329,9 @@ public class BrandController extends AbstractController{
|
|
//查询列表数据
|
|
//查询列表数据
|
|
Query query = new Query(params);
|
|
Query query = new Query(params);
|
|
|
|
|
|
- Long userId = getUserId();
|
|
|
|
- if(Constant.SUPER_ADMIN != userId){
|
|
|
|
- params.put("idList", mySysUserBrandService.queryBrandIdList(userId));
|
|
|
|
|
|
+ List<Long> roleIdList = getUser().getRoleIdList();
|
|
|
|
+ if(!roleIdList.contains(1L) && !roleIdList.contains(5L)){
|
|
|
|
+ params.put("idList", mySysUserBrandService.queryBrandIdList(getUserId()));
|
|
}
|
|
}
|
|
HttpRequestorUtil util = new HttpRequestorUtil();
|
|
HttpRequestorUtil util = new HttpRequestorUtil();
|
|
List<BrandEntity> list = brandService.queryList(params);
|
|
List<BrandEntity> list = brandService.queryList(params);
|
|
@@ -522,42 +523,4 @@ public class BrandController extends AbstractController{
|
|
}
|
|
}
|
|
return Result.failure("删除热点商品关联失败");
|
|
return Result.failure("删除热点商品关联失败");
|
|
}
|
|
}
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 跳转到场景编辑页面
|
|
|
|
- */
|
|
|
|
- @RequestMapping("/goSceneEditUrl")
|
|
|
|
- public void goSceneEditUrl(HttpServletRequest request, HttpServletResponse response){
|
|
|
|
- TbUser sysUserEntity = zhiHouseService.getByUserId((long)Constant.SUPER_ADMIN);
|
|
|
|
- String sceneUrl = request.getParameter("sceneUrl");
|
|
|
|
- if(!StringUtils.isEmpty(sceneUrl)){
|
|
|
|
- String sceneNum = sceneUrl.split("\\?m=")[1];
|
|
|
|
- sceneNum = sceneNum.substring(0, sceneNum.indexOf("&"));
|
|
|
|
-
|
|
|
|
- String scenePath = this.scenePath;
|
|
|
|
- String editHtml = ResourceUtil.getConfigByName("editHtml");
|
|
|
|
- String origin = ResourceUtil.getConfigByName("origin");
|
|
|
|
- HttpRequestorUtil util = new HttpRequestorUtil();
|
|
|
|
-
|
|
|
|
- JSONObject post = new JSONObject();
|
|
|
|
- post.put("phoneNum", sysUserEntity.getFdkkUser());
|
|
|
|
- post.put("password", PasswordUtils.decrypt(sysUserEntity.getFdkkPassword(), sysUserEntity.getFdkkUser(), PasswordUtils.getStaticSalt()));
|
|
|
|
-
|
|
|
|
- String result = util.postJson(scenePath + "login", post.toString(), "POST");
|
|
|
|
- JSONObject object = JSON.parseObject(result);
|
|
|
|
-
|
|
|
|
- if(object.getIntValue("code") == 0){
|
|
|
|
- String token = object.getJSONObject("data").getString("token");
|
|
|
|
-
|
|
|
|
- try{
|
|
|
|
- //登录成功
|
|
|
|
- response.sendRedirect(scenePath + editHtml + "?m=" + sceneNum + "&origin=" + origin +
|
|
|
|
- "&t=" +System.currentTimeMillis() + "&token=" + token);
|
|
|
|
- return;
|
|
|
|
- }catch (Exception e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|