如果查询订单状态只有异常的情况下,排除个人桩的异常订单

This commit is contained in:
Guoqs
2025-11-13 16:15:48 +08:00
parent 776c0279be
commit a96c374b94
3 changed files with 30 additions and 0 deletions

View File

@@ -107,4 +107,9 @@ public class QueryOrderDTO extends BaseEntity {
* 车牌号
*/
private String plateNumber;
/**
* 排除的站点Id列表
*/
private List<Integer> excludeStationIdList;
}

View File

@@ -291,6 +291,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
*/
@Override
public List<OrderListVO> selectOrderBasicInfoList(QueryOrderDTO dto) {
excludePersonalPileStation(dto); // 筛选个人桩站点
List<OrderListVO> orderListVOS = orderBasicInfoMapper.selectOrderBasicInfoList(dto);
if (CollectionUtils.isEmpty(orderListVOS)) {
return orderListVOS;
@@ -339,6 +340,24 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
return orderListVOS;
}
/**
* 如果查询订单状态只有异常的情况下,排除个人桩的异常订单
*/
private void excludePersonalPileStation(QueryOrderDTO dto) {
// 如果orderStatus不等于异常直接返回
if (!OrderStatusEnum.ABNORMAL.getValue().equals(dto.getOrderStatus())) {
return;
}
// 如果dto中除了订单状态还有其他查询条件则返回
if (dto.getMerchantId() != null || dto.getStationId() != null || dto.getOrderCode() != null
|| dto.getMobileNumber() != null || dto.getTransactionCode() != null || dto.getPileSn() != null
|| dto.getPlateNumber() != null) {
return;
}
// 设置个人桩站id, 148-个人桩站点; 684-7KW小直流个人桩站点
dto.setExcludeStationIdList(Lists.newArrayList(148, 684));
}
private void batchQueryFeeAmt(List<OrderListVO> orderListVOS) {
// 批量查手续费
List<String> orderCodeList = orderListVOS.stream().map(OrderListVO::getOrderCode).collect(Collectors.toList());

View File

@@ -1988,6 +1988,12 @@
#{stationDeptId}
</foreach>
</if>
<if test="excludeStationIdList != null and excludeStationIdList.size() != 0">
and t1.station_id not in
<foreach close=")" collection="excludeStationIdList" item="excludeStationId" open="(" separator=",">
#{excludeStationId}
</foreach>
</if>
order by t1.create_time desc
</select>