update 站点查询计费模板增加权限校验

This commit is contained in:
DESKTOP-D9QDT1P\JS-ZZA
2023-03-13 11:43:04 +08:00
parent 9480a7d6d9
commit 1687e9bd92
3 changed files with 17 additions and 2 deletions

View File

@@ -102,7 +102,8 @@ public interface PileBillingTemplateMapper {
* @param stationId 站点id
* @return
*/
List<BillingTemplateVO> queryStationBillingTemplateList(String stationId);
List<BillingTemplateVO> queryStationBillingTemplateList(@Param("stationId") String stationId,
@Param("stationDeptIds") List<String> stationDeptIds);
/**
* 通过桩sn号查询计费模板

View File

@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.primitives.Bytes;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
import com.jsowell.common.enums.DelFlagEnum;
import com.jsowell.common.enums.ykc.BillingTimeEnum;
import com.jsowell.common.util.BytesUtil;
@@ -350,7 +351,12 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
if (StringUtils.isBlank(stationId)) {
return Lists.newArrayList();
}
return pileBillingTemplateMapper.queryStationBillingTemplateList(stationId);
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
if (authorizedMap == null) {
// 为空表示没有权限,返回空数组
return Lists.newArrayList();
}
return pileBillingTemplateMapper.queryStationBillingTemplateList(stationId, authorizedMap.getStationDeptIds());
}
/**