diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBillingTemplateMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBillingTemplateMapper.java index 3622aacc5..efa70171f 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBillingTemplateMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBillingTemplateMapper.java @@ -102,7 +102,8 @@ public interface PileBillingTemplateMapper { * @param stationId 站点id * @return */ - List queryStationBillingTemplateList(String stationId); + List queryStationBillingTemplateList(@Param("stationId") String stationId, + @Param("stationDeptIds") List stationDeptIds); /** * 通过桩sn号查询计费模板 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java index f09382280..6a3521be6 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java @@ -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()); } /** diff --git a/jsowell-pile/src/main/resources/mapper/pile/PileBillingTemplateMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/PileBillingTemplateMapper.xml index 5efe1f55d..be77391f5 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/PileBillingTemplateMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/PileBillingTemplateMapper.xml @@ -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} + + + and t1.dept_id in + + #{stationDeptId,jdbcType=VARCHAR} + + order by t2.publish_time desc