mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-09 04:20:08 +08:00
update 站点查询计费模板增加权限校验
This commit is contained in:
@@ -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号查询计费模板
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -298,6 +298,7 @@
|
||||
t6.apply_time AS valleyApplyDate
|
||||
from
|
||||
pile_billing_template t2
|
||||
left join pile_station_info t1 on t1.id = t2.station_id
|
||||
left JOIN pile_billing_detail t3 ON t3.template_code = t2.template_code AND t3.time_type = '1'
|
||||
left JOIN pile_billing_detail t4 ON t4.template_code = t2.template_code AND t4.time_type = '2'
|
||||
left JOIN pile_billing_detail t5 ON t5.template_code = t2.template_code AND t5.time_type = '3'
|
||||
@@ -305,6 +306,13 @@
|
||||
where
|
||||
t2.del_flag = '0'
|
||||
and t2.station_id = #{stationId,jdbcType=VARCHAR}
|
||||
<!--数据范围过滤-->
|
||||
<if test="stationDeptIds != null and stationDeptIds.size() != 0">
|
||||
and t1.dept_id in
|
||||
<foreach collection="stationDeptIds" item="stationDeptId" open="(" separator="," close=")">
|
||||
#{stationDeptId,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</if>
|
||||
order by t2.publish_time desc
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user