mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 20:15:06 +08:00
update 华为Service
This commit is contained in:
@@ -13,6 +13,9 @@ import com.jsowell.pile.dto.QueryStationDTO;
|
||||
import com.jsowell.pile.dto.RemoteGroundLockDTO;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.vo.uniapp.BillingPriceVO;
|
||||
import com.jsowell.pile.vo.web.ThirdPartySnRelationVO;
|
||||
import com.jsowell.thirdparty.common.CommonService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -44,6 +47,12 @@ public class PileController extends BaseController {
|
||||
@Autowired
|
||||
private OrderPileOccupyService orderPileOccupyService;
|
||||
|
||||
@Autowired
|
||||
private IThirdpartySnRelationService snRelationService;
|
||||
|
||||
@Autowired
|
||||
private CommonService commonService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询充电站信息列表(主页)
|
||||
@@ -112,6 +121,9 @@ public class PileController extends BaseController {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
PageResponse pageResponse = pileConnectorInfoService.getUniAppConnectorInfoListByParams(dto);
|
||||
if (CollectionUtils.isNotEmpty(dto.getStationIdList())) {
|
||||
updateThirdPartyConnectorStatus(dto.getStationIdList());
|
||||
}
|
||||
response = new RestApiResponse<>(pageResponse);
|
||||
} catch (Exception e) {
|
||||
logger.error("查询充电枪口列表异常", e);
|
||||
@@ -171,4 +183,25 @@ public class PileController extends BaseController {
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改第三方平台枪口状态
|
||||
*/
|
||||
private void updateThirdPartyConnectorStatus(List<Long> stationIdList) {
|
||||
if (CollectionUtils.isEmpty(stationIdList)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (Long stationId : stationIdList) {
|
||||
String stationIdStr = String.valueOf(stationId);
|
||||
List<ThirdPartySnRelationVO> list = snRelationService.selectSnRelationListByParams(stationIdStr, null);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
for (ThirdPartySnRelationVO vo : list) {
|
||||
String thirdPartyType = vo.getThirdPartyType();
|
||||
// 调用通用查询实时数据接口(需在接口中修改枪口状态)
|
||||
commonService.commonQueryStationStatus(stationIdStr, thirdPartyType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user