update 华为Service

This commit is contained in:
Lemon
2024-04-01 16:17:00 +08:00
parent 7064f4e4b2
commit 60d54f8fea
12 changed files with 338 additions and 163 deletions

View File

@@ -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);
}
}
}
}