新增 后管站点下拉列表查询方法

This commit is contained in:
Lemon
2023-09-23 09:11:02 +08:00
parent 7ec1c5cb47
commit 49c8bcc4b8
7 changed files with 77 additions and 4 deletions

View File

@@ -80,6 +80,18 @@ public class PileStationInfoController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询充电站下拉列表
*/
@PreAuthorize("@ss.hasPermi('pile:station:list')")
@GetMapping("/StationSelectList")
public TableDataInfo getStationSelectList(QueryStationDTO dto) {
logger.info("dto:{}", JSON.toJSONString(dto));
startPage();
List<PileStationVO> list = pileStationInfoService.getStationSelectList(dto);
return getDataTable(list);
}
/** /**
* 快速建站接口 * 快速建站接口
*/ */

View File

@@ -94,4 +94,11 @@ public interface PileStationInfoMapper {
* @param stationId * @param stationId
*/ */
int updateParkingPlatform(@Param("parkingId") String parkingId, @Param("stationId") String stationId); int updateParkingPlatform(@Param("parkingId") String parkingId, @Param("stationId") String stationId);
/**
* 获取站点下拉列表
* @param dto
* @return
*/
List<PileStationVO> getStationSelectList(@Param("dto") QueryStationDTO dto);
} }

View File

@@ -112,4 +112,9 @@ public interface IPileStationInfoService {
* @param dto * @param dto
*/ */
int bindParkingPlatform(BindParkingPlatformDTO dto); int bindParkingPlatform(BindParkingPlatformDTO dto);
/**
* 查询充电站下拉列表
*/
List<PileStationVO> getStationSelectList(QueryStationDTO dto);
} }

View File

@@ -533,5 +533,23 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
return pileStationInfoMapper.updateParkingPlatform(parkingId, stationId); return pileStationInfoMapper.updateParkingPlatform(parkingId, stationId);
} }
/**
* 查询充电站下拉列表
* @param dto
* @return
*/
@Override
public List<PileStationVO> getStationSelectList(QueryStationDTO dto) {
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
if (authorizedMap == null) {
// 为空表示没有权限,返回空数组
return Lists.newArrayList();
}
dto.setStationDeptIds(authorizedMap.getStationDeptIds());
dto.setMerchantDeptIds(authorizedMap.getMerchantDeptIds());
return pileStationInfoMapper.getStationSelectList(dto);
}
} }

View File

@@ -448,4 +448,26 @@
where where
id = #{stationId,jdbcType=VARCHAR} id = #{stationId,jdbcType=VARCHAR}
</update> </update>
<select id="getStationSelectList" resultType="com.jsowell.pile.vo.web.PileStationVO">
select
t1.id,
t1.station_name as stationName
from pile_station_info t1
left join pile_merchant_info t2 on t2.id = t1.merchant_id and t2.del_flag = '0'
where t1.del_flag = '0'
<!-- 数据范围过滤 -->
<if test="dto.merchantDeptIds != null and dto.merchantDeptIds.size() != 0">
and t2.dept_id in
<foreach collection="dto.merchantDeptIds" item="merchantDeptId" open="(" separator="," close=")">
#{merchantDeptId}
</foreach>
</if>
<if test="dto.stationDeptIds != null and dto.stationDeptIds.size() != 0">
and t1.dept_id in
<foreach collection="dto.stationDeptIds" item="stationDeptId" open="(" separator="," close=")">
#{stationDeptId}
</foreach>
</if>
</select>
</mapper> </mapper>

View File

@@ -10,6 +10,14 @@ export function listStation(query) {
}); });
} }
export function getStationSelectList(query) {
return request({
url: "/pile/station/StationSelectList",
method: "get",
params: query,
});
}
// 查询充电站信息详细 // 查询充电站信息详细
export function getStation(id) { export function getStation(id) {
return request({ return request({

View File

@@ -167,7 +167,7 @@ import {
totalData, totalData,
} from "@/api/order/order"; } from "@/api/order/order";
import Template from "@/views/billing/template"; import Template from "@/views/billing/template";
import { listStation } from "@/api/pile/station"; import {getStationSelectList, listStation} from "@/api/pile/station";
import { getDay } from "@/utils/common"; import { getDay } from "@/utils/common";
export default { export default {
@@ -523,10 +523,11 @@ export default {
getStationList() { getStationList() {
const queryStationParams = { const queryStationParams = {
pageNum: 1, pageNum: 1,
pageSize: 999, pageSize: 10,
}; };
listStation(queryStationParams).then((response) => { console.log("订单列表页-查询站点列表 param", queryStationParams)
// console.log("订单列表页-查询站点列表", response) getStationSelectList(queryStationParams).then((response) => {
console.log("订单列表页-查询站点列表", response)
this.stationList = response.rows; this.stationList = response.rows;
}); });
}, },