|
|
@@ -22,6 +22,7 @@ import com.kym.entity.miniapp.ChargeOrder;
|
|
|
import com.kym.entity.miniapp.queryParams.OrderQueryParams;
|
|
|
import com.kym.entity.miniapp.vo.ChargeOrderVo;
|
|
|
import com.kym.mapper.miniapp.ChargeOrderMapper;
|
|
|
+import com.kym.service.admin.EquipmentRelationService;
|
|
|
import com.kym.service.admin.ExportService;
|
|
|
import com.kym.service.admin.StationStatDayService;
|
|
|
import com.kym.service.admin.StationStatMonthService;
|
|
|
@@ -65,6 +66,7 @@ public class ChargeOrderServiceImpl extends MyBaseServiceImpl<ChargeOrderMapper,
|
|
|
|
|
|
|
|
|
private final ExportService exportService;
|
|
|
+ private final EquipmentRelationService equipmentRelationService;
|
|
|
private final UserCouponService userCouponService;
|
|
|
private final UserRechargeRightsService userRechargeRightsService;
|
|
|
private final StationStatDayService stationStatDayService;
|
|
|
@@ -76,9 +78,11 @@ public class ChargeOrderServiceImpl extends MyBaseServiceImpl<ChargeOrderMapper,
|
|
|
public String saasClose;
|
|
|
|
|
|
|
|
|
- public ChargeOrderServiceImpl(ExportService exportService, @Lazy UserCouponService userCouponService, UserRechargeRightsService userRechargeRightsService,
|
|
|
+ public ChargeOrderServiceImpl(ExportService exportService, EquipmentRelationService equipmentRelationService,
|
|
|
+ @Lazy UserCouponService userCouponService, UserRechargeRightsService userRechargeRightsService,
|
|
|
StationStatDayService stationStatDayService, StationStatMonthService stationStatMonthService, StringRedisTemplate redisTemplate) {
|
|
|
this.exportService = exportService;
|
|
|
+ this.equipmentRelationService = equipmentRelationService;
|
|
|
this.userCouponService = userCouponService;
|
|
|
this.userRechargeRightsService = userRechargeRightsService;
|
|
|
this.stationStatDayService = stationStatDayService;
|
|
|
@@ -106,6 +110,7 @@ public class ChargeOrderServiceImpl extends MyBaseServiceImpl<ChargeOrderMapper,
|
|
|
var connectorId = KymCache.INSTANCE.getConnectorId(params.getConnectorId());
|
|
|
params.setConnectorId(connectorId);
|
|
|
}
|
|
|
+ resolvePlatformStationIds(params);
|
|
|
// 判断数据权限
|
|
|
if (params.getStationIds() == null) {
|
|
|
params.setStationIds(CommUtil.isEmptyOrNull(KymCache.INSTANCE.getAdminUserStationIds(StpUtil.getLoginIdAsLong())) ? null : KymCache.INSTANCE.getAdminUserStationIds(StpUtil.getLoginIdAsLong()));
|
|
|
@@ -122,6 +127,17 @@ public class ChargeOrderServiceImpl extends MyBaseServiceImpl<ChargeOrderMapper,
|
|
|
return page.setExtraData(map);
|
|
|
}
|
|
|
|
|
|
+ private void resolvePlatformStationIds(CustomChargeOrdersQueryParam params) {
|
|
|
+ if (params.getPlatformName() != null && !params.getPlatformName().isEmpty()) {
|
|
|
+ var platformStationIds = equipmentRelationService.getStationIdsByPlatformName(params.getPlatformName());
|
|
|
+ if (params.getStationIds() == null) {
|
|
|
+ params.setStationIds(platformStationIds);
|
|
|
+ } else {
|
|
|
+ params.getStationIds().retainAll(platformStationIds);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@SneakyThrows
|
|
|
@Override
|
|
|
public void exportCustomChargeOrders(CustomChargeOrdersQueryParam params, HttpServletResponse response) {
|
|
|
@@ -130,6 +146,7 @@ public class ChargeOrderServiceImpl extends MyBaseServiceImpl<ChargeOrderMapper,
|
|
|
var connectorId = KymCache.INSTANCE.getConnectorId(params.getConnectorId());
|
|
|
params.setConnectorId(connectorId);
|
|
|
}
|
|
|
+ resolvePlatformStationIds(params);
|
|
|
// 判断数据权限
|
|
|
if (params.getStationIds() == null) {
|
|
|
params.setStationIds(CommUtil.isEmptyOrNull(KymCache.INSTANCE.getAdminUserStationIds(StpUtil.getLoginIdAsLong())) ? null : KymCache.INSTANCE.getAdminUserStationIds(StpUtil.getLoginIdAsLong()));
|