This commit is contained in:
YAS\29473
2026-01-04 11:40:37 +08:00
parent ccd2f96466
commit 2768c6597c
6 changed files with 70 additions and 27 deletions

View File

@@ -117,4 +117,15 @@ public class QueryOrderDTO extends BaseEntity {
* 排除的站点Id列表
*/
private List<Integer> excludeStationIdList;
/**
* 启动方式
* 0-后管启动1-用户app启动2-卡启动3-离线卡启动; 4-第三方平台启动; 5-车辆vin码启动
*/
private String startMode;
/**
* 站点名称(用于模糊查询)
*/
private String stationName;
}

View File

@@ -37,6 +37,12 @@ public class QueryBusinessOrderDTO {
*/
private String orderStatus;
/**
* 启动方式
* 0-后管启动1-用户app启动2-卡启动3-离线卡启动; 4-第三方平台启动; 5-车辆vin码启动
*/
private String startMode;
/**
* 页码默认1
*/

View File

@@ -6276,30 +6276,19 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
}
// 根据站点名称过滤
List<String> stationIdList = new ArrayList<>();
if (StringUtils.isNotBlank(dto.getStationName())) {
List<PileStationInfo> filteredStations = allStations.stream()
.filter(s -> s.getStationName() != null && s.getStationName().contains(dto.getStationName()))
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(filteredStations)) {
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
}
stationIdList = filteredStations.stream()
.map(s -> String.valueOf(s.getId()))
.collect(Collectors.toList());
} else {
stationIdList = allStations.stream()
.map(s -> String.valueOf(s.getId()))
.collect(Collectors.toList());
}
// 获取所有站点ID列表
List<String> stationIdList = allStations.stream()
.map(s -> String.valueOf(s.getId()))
.collect(Collectors.toList());
// 构建QueryOrderDTO
// 构建QueryOrderDTO包含启动方式和站点名称由SQL进行过滤
QueryOrderDTO queryOrderDTO = QueryOrderDTO.builder()
.stationIdList(stationIdList)
.startTime(dto.getCreateTime())
.endTime(dto.getEndTime())
.orderStatus(dto.getOrderStatus())
.startMode(dto.getStartMode())
.stationName(dto.getStationName())
.build();
// 1. 分页参数处理

View File

@@ -1998,11 +1998,17 @@
</foreach>
</if>
<if test="stationIdList != null and stationIdList.size() != 0">
and station_id in
and t1.station_id in
<foreach collection="stationIdList" item="stationId" open="(" separator="," close=")">
#{stationId}
</foreach>
</if>
<if test="startMode != null and startMode != ''">
and t1.start_mode = #{startMode,jdbcType=VARCHAR}
</if>
<if test="stationName != null and stationName != ''">
and t3.station_name like concat('%', #{stationName,jdbcType=VARCHAR}, '%')
</if>
order by t1.create_time desc
</select>
@@ -2083,18 +2089,18 @@
COUNT(*) AS orderCount,
IFNULL(SUM(order_amount), 0) AS orderAmount
FROM (
SELECT DISTINCT
t1.order_code,
SELECT DISTINCT
t1.order_code,
t1.order_amount
FROM order_basic_info t1
LEFT JOIN member_basic_info t2
ON t1.member_id = t2.member_id
LEFT JOIN member_basic_info t2
ON t1.member_id = t2.member_id
AND t2.del_flag = '0'
JOIN pile_station_info t3
ON t1.station_id = t3.id
JOIN pile_station_info t3
ON t1.station_id = t3.id
AND t3.del_flag = '0'
JOIN order_detail t4
ON t4.order_code = t1.order_code
JOIN order_detail t4
ON t4.order_code = t1.order_code
AND t4.del_flag = '0'
WHERE t1.del_flag = '0'
<if test="orderStatus != null and orderStatus != ''">
@@ -2118,6 +2124,12 @@
#{stationId}
</foreach>
</if>
<if test="startMode != null and startMode != ''">
AND t1.start_mode = #{startMode,jdbcType=VARCHAR}
</if>
<if test="stationName != null and stationName != ''">
AND t3.station_name LIKE CONCAT('%', #{stationName,jdbcType=VARCHAR}, '%')
</if>
<if test="stationDeptIds != null and stationDeptIds.size() != 0">
AND t3.dept_id IN
<foreach collection="stationDeptIds" item="stationDeptId" open="(" separator="," close=")">

View File

@@ -671,6 +671,9 @@
#{stationDeptId}
</foreach>
</if>
<if test="dto.stationName != null and dto.stationName != ''">
AND t1.station_name LIKE CONCAT('%', #{dto.stationName,jdbcType=VARCHAR}, '%')
</if>
</select>
<select id="getStationInfoForAmap" resultMap="PileStationInfoResult">