update 权限

This commit is contained in:
2023-03-09 11:58:11 +08:00
parent 393ac73f33
commit 391ed56713
2 changed files with 22 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import com.google.common.collect.Maps;
import com.jsowell.common.annotation.DataScope;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
import com.jsowell.common.core.redis.RedisCache;
@@ -19,6 +20,7 @@ import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.SecurityUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.bean.BeanUtils;
import com.jsowell.common.util.id.SnowflakeIdWorker;
@@ -147,9 +149,16 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
* @return 订单
*/
@Override
@DataScope(deptAlias = "t3")
// @DataScope(deptAlias = "t3")
public List<OrderListVO> selectOrderBasicInfoList(QueryOrderDTO dto) {
// 权限过滤
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
if (authorizedMap == null) {
// 为空表示没有权限,返回空数组
return Lists.newArrayList();
}
dto.setStationDeptIds(authorizedMap.getStationDeptIds());
dto.setMerchantDeptIds(authorizedMap.getMerchantDeptIds());
List<OrderListVO> orderListVOS = orderBasicInfoMapper.selectOrderBasicInfoList(dto);
if (CollectionUtils.isNotEmpty(orderListVOS)) {

View File

@@ -196,7 +196,18 @@
and t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
<!--<if test="merchantDeptIds != null and merchantDeptIds.size() != 0">
and t3.dept_id in
<foreach collection="merchantDeptIds" item="merchantDeptId" open="(" separator="," close=")">
#{merchantDeptId}
</foreach>
</if>-->
<if test="stationDeptIds != null and stationDeptIds.size() != 0">
and t3.dept_id in
<foreach collection="stationDeptIds" item="stationDeptId" open="(" separator="," close=")">
#{stationDeptId}
</foreach>
</if>
order by t1.create_time desc
</select>