Commit 4ef9011d authored by caotao's avatar caotao

智能分析指标权限配置权限过滤问题处理

parent 223138e1
...@@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jxiop.biz.amosprojectentity.StdUserEmpower;
import com.yeejoin.amos.boot.module.jxiop.biz.amosprojectmapper.UserEmpowerMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBiz3yudDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBiz3yudDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWeight; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWeight;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWeight; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWeight;
...@@ -15,6 +18,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -15,6 +18,7 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.exception.BaseException; import org.typroject.tyboot.core.foundation.exception.BaseException;
...@@ -43,12 +47,20 @@ public class IdxBizFanWeightController extends BaseController { ...@@ -43,12 +47,20 @@ public class IdxBizFanWeightController extends BaseController {
@Autowired @Autowired
IdxBizFanWeightMapper idxBizFanWeightMapper; IdxBizFanWeightMapper idxBizFanWeightMapper;
@Autowired
UserEmpowerMapper userEmpowerMapper;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/queryPage") @GetMapping(value = "/queryPage")
@ApiOperation(httpMethod = "GET",value = "场站列表", notes = "场站列表") @ApiOperation(httpMethod = "GET",value = "场站列表", notes = "场站列表")
public ResponseModel<com.baomidou.mybatisplus.extension.plugins.pagination.Page<IdxBizFanWeight>> queryForDealerReviewPage(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<com.baomidou.mybatisplus.extension.plugins.pagination.Page<IdxBizFanWeight>> queryForDealerReviewPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, IdxBizFanWeight reviewDto) { (value = "size") int size, IdxBizFanWeight reviewDto) {
ReginParams reginParams = getSelectedOrgInfo();
String userId = reginParams.getUserModel().getUserId();
StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH"));
String orgCode = "86";
if (ObjectUtils.isEmpty(stdUserEmpower)) {
orgCode = stdUserEmpower.getAmosOrgCode().get(0);
}
LambdaQueryWrapper<IdxBizFanWeight> qu=new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizFanWeight> qu=new LambdaQueryWrapper<>();
qu.eq(!StringUtils.isEmpty(reviewDto.getType()),IdxBizFanWeight::getType,reviewDto.getType()); qu.eq(!StringUtils.isEmpty(reviewDto.getType()),IdxBizFanWeight::getType,reviewDto.getType());
qu.eq(!StringUtils.isEmpty(reviewDto.getArae()),IdxBizFanWeight::getArae,reviewDto.getArae()); qu.eq(!StringUtils.isEmpty(reviewDto.getArae()),IdxBizFanWeight::getArae,reviewDto.getArae());
...@@ -56,6 +68,7 @@ public class IdxBizFanWeightController extends BaseController { ...@@ -56,6 +68,7 @@ public class IdxBizFanWeightController extends BaseController {
qu.eq(!StringUtils.isEmpty(reviewDto.getSubarray()),IdxBizFanWeight::getSubarray,reviewDto.getSubarray()); qu.eq(!StringUtils.isEmpty(reviewDto.getSubarray()),IdxBizFanWeight::getSubarray,reviewDto.getSubarray());
qu.eq(!StringUtils.isEmpty(reviewDto.getEquipmentName()),IdxBizFanWeight::getEquipmentName,reviewDto.getEquipmentName()); qu.eq(!StringUtils.isEmpty(reviewDto.getEquipmentName()),IdxBizFanWeight::getEquipmentName,reviewDto.getEquipmentName());
qu.eq(!StringUtils.isEmpty(reviewDto.getPointName()),IdxBizFanWeight::getPointName,reviewDto.getPointName()); qu.eq(!StringUtils.isEmpty(reviewDto.getPointName()),IdxBizFanWeight::getPointName,reviewDto.getPointName());
qu.like(IdxBizFanWeight::getOrgCode,orgCode);
Integer total = idxBizFanWeightMapper.selectCount(qu); Integer total = idxBizFanWeightMapper.selectCount(qu);
qu.orderByAsc(IdxBizFanWeight::getType); qu.orderByAsc(IdxBizFanWeight::getType);
...@@ -105,6 +118,14 @@ public class IdxBizFanWeightController extends BaseController { ...@@ -105,6 +118,14 @@ public class IdxBizFanWeightController extends BaseController {
// ,String subarray // ,String subarray
// ,String pointName // ,String pointName
) { ) {
ReginParams reginParams = getSelectedOrgInfo();
String userId = reginParams.getUserModel().getUserId();
StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH"));
String orgCode = "86";
if (ObjectUtils.isEmpty(stdUserEmpower)) {
orgCode = stdUserEmpower.getAmosOrgCode().get(0);
}
QueryWrapper< IdxBizFanWeight> qu=new QueryWrapper<>(); QueryWrapper< IdxBizFanWeight> qu=new QueryWrapper<>();
String name=""; String name="";
switch(type){ switch(type){
...@@ -139,6 +160,7 @@ public class IdxBizFanWeightController extends BaseController { ...@@ -139,6 +160,7 @@ public class IdxBizFanWeightController extends BaseController {
// qu.eq("POINT_NAME",pointName); // qu.eq("POINT_NAME",pointName);
break; break;
} }
qu.like("ORG_CODE",orgCode);
qu.isNotNull(name); qu.isNotNull(name);
qu.groupBy(name); qu.groupBy(name);
qu.orderByAsc(name); qu.orderByAsc(name);
......
...@@ -8,7 +8,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -8,7 +8,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jxiop.biz.amosprojectentity.StdUserEmpower;
import com.yeejoin.amos.boot.module.jxiop.biz.amosprojectmapper.UserEmpowerMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBiz3yudDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBiz3yudDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWeight; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWeight;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWeight; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWeight;
...@@ -20,6 +23,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -20,6 +23,7 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.exception.BaseException; import org.typroject.tyboot.core.foundation.exception.BaseException;
...@@ -48,13 +52,20 @@ public class IdxBizPvWeightController extends BaseController { ...@@ -48,13 +52,20 @@ public class IdxBizPvWeightController extends BaseController {
@Autowired @Autowired
IdxBizPvWeightMapper idxBizPvWeightMapper; IdxBizPvWeightMapper idxBizPvWeightMapper;
@Autowired
UserEmpowerMapper userEmpowerMapper;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/queryPage") @GetMapping(value = "/queryPage")
@ApiOperation(httpMethod = "GET",value = "场站列表", notes = "场站列表") @ApiOperation(httpMethod = "GET",value = "场站列表", notes = "场站列表")
public ResponseModel<Page<IdxBizPvWeight>> queryForDealerReviewPage(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<IdxBizPvWeight>> queryForDealerReviewPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, IdxBizPvWeight reviewDto) { (value = "size") int size, IdxBizPvWeight reviewDto) {
ReginParams reginParams = getSelectedOrgInfo();
String userId = reginParams.getUserModel().getUserId();
StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH"));
String orgCode = "86";
if (ObjectUtils.isEmpty(stdUserEmpower)) {
orgCode = stdUserEmpower.getAmosOrgCode().get(0);
}
LambdaQueryWrapper<IdxBizPvWeight> qu=new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizPvWeight> qu=new LambdaQueryWrapper<>();
qu.eq(!StringUtils.isEmpty(reviewDto.getType()),IdxBizPvWeight::getType,reviewDto.getType()); qu.eq(!StringUtils.isEmpty(reviewDto.getType()),IdxBizPvWeight::getType,reviewDto.getType());
qu.eq(!StringUtils.isEmpty(reviewDto.getArae()),IdxBizPvWeight::getArae,reviewDto.getArae()); qu.eq(!StringUtils.isEmpty(reviewDto.getArae()),IdxBizPvWeight::getArae,reviewDto.getArae());
...@@ -62,8 +73,7 @@ public class IdxBizPvWeightController extends BaseController { ...@@ -62,8 +73,7 @@ public class IdxBizPvWeightController extends BaseController {
qu.eq(!StringUtils.isEmpty(reviewDto.getSubarray()),IdxBizPvWeight::getSubarray,reviewDto.getSubarray()); qu.eq(!StringUtils.isEmpty(reviewDto.getSubarray()),IdxBizPvWeight::getSubarray,reviewDto.getSubarray());
qu.eq(!StringUtils.isEmpty(reviewDto.getEquipmentName()),IdxBizPvWeight::getEquipmentName,reviewDto.getEquipmentName()); qu.eq(!StringUtils.isEmpty(reviewDto.getEquipmentName()),IdxBizPvWeight::getEquipmentName,reviewDto.getEquipmentName());
qu.eq(!StringUtils.isEmpty(reviewDto.getPointName()),IdxBizPvWeight::getPointName,reviewDto.getPointName()); qu.eq(!StringUtils.isEmpty(reviewDto.getPointName()),IdxBizPvWeight::getPointName,reviewDto.getPointName());
qu.like(IdxBizPvWeight::getOrgCode,orgCode);
Integer total = idxBizPvWeightMapper.selectCount(qu); Integer total = idxBizPvWeightMapper.selectCount(qu);
qu.orderByAsc(IdxBizPvWeight::getType); qu.orderByAsc(IdxBizPvWeight::getType);
qu.last(" limit "+ (current-1)*size+","+size); qu.last(" limit "+ (current-1)*size+","+size);
...@@ -116,6 +126,13 @@ public class IdxBizPvWeightController extends BaseController { ...@@ -116,6 +126,13 @@ public class IdxBizPvWeightController extends BaseController {
if(type==null){ if(type==null){
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
ReginParams reginParams = getSelectedOrgInfo();
String userId = reginParams.getUserModel().getUserId();
StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH"));
String orgCode = "86";
if (ObjectUtils.isEmpty(stdUserEmpower)) {
orgCode = stdUserEmpower.getAmosOrgCode().get(0);
}
QueryWrapper< IdxBizPvWeight> qu=new QueryWrapper<>(); QueryWrapper< IdxBizPvWeight> qu=new QueryWrapper<>();
String name=""; String name="";
IdxBizPvWeight qt=new IdxBizPvWeight(); IdxBizPvWeight qt=new IdxBizPvWeight();
...@@ -152,7 +169,7 @@ public class IdxBizPvWeightController extends BaseController { ...@@ -152,7 +169,7 @@ public class IdxBizPvWeightController extends BaseController {
// qu.eq("POINT_NAME",pointName); // qu.eq("POINT_NAME",pointName);
break; break;
} }
qu.like("ORG_CODE",orgCode);
qu.isNotNull(name); qu.isNotNull(name);
qu.groupBy(name); qu.groupBy(name);
qu.orderByAsc(name); qu.orderByAsc(name);
......
...@@ -64,6 +64,13 @@ public class IdxBizFanWeight { ...@@ -64,6 +64,13 @@ public class IdxBizFanWeight {
*/ */
@TableField("VALUE") @TableField("VALUE")
private Float value; private Float value;
/**
* orgCode
*/
@TableField("ORG_CODE")
private String orgCode;
@TableField(exist=false) @TableField(exist=false)
private String Symbol_key; private String Symbol_key;
} }
...@@ -65,6 +65,13 @@ public class IdxBizPvWeight { ...@@ -65,6 +65,13 @@ public class IdxBizPvWeight {
*/ */
@TableField("VALUE") @TableField("VALUE")
private Float value; private Float value;
/**
* orgCode
*/
@TableField("ORG_CODE")
private String orgCode;
@TableField(exist=false) @TableField(exist=false)
private String Symbol_key; private String Symbol_key;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment