bugfix 华为启动充电不再重复生成订单

This commit is contained in:
Lemon
2024-04-03 11:46:39 +08:00
parent 2b62f01a38
commit 994b9cd809
3 changed files with 36 additions and 26 deletions

View File

@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.stream.Collectors;
/**
* 充电桩枪口信息Controller
@@ -74,10 +75,8 @@ public class PileConnectorInfoController extends BaseController {
public TableDataInfo getConnectorInfoListByParams(@RequestBody QueryConnectorListDTO dto) {
logger.info("查询接口列表 param:{}", JSON.toJSONString(dto));
List<PileConnectorInfoVO> list = pileConnectorInfoService.getConnectorInfoListByParams(dto);
if (CollectionUtils.isNotEmpty(dto.getStationIdList())) {
// 修改对接第三方平台的枪口状态
updateThirdPartyConnectorStatus(dto.getStationIdList());
}
// 修改对接第三方平台的枪口状态
updateThirdPartyConnectorStatus(list);
logger.info("查询接口列表 result:{}", JSON.toJSONString(list));
return getDataTable(list);
}
@@ -146,12 +145,15 @@ public class PileConnectorInfoController extends BaseController {
/**
* 修改第三方平台枪口状态
*/
public void updateThirdPartyConnectorStatus(List<Long> stationIdList) {
if (CollectionUtils.isEmpty(stationIdList)) {
public void updateThirdPartyConnectorStatus(List<PileConnectorInfoVO> connectorList) {
if (CollectionUtils.isEmpty(connectorList)) {
return;
}
List<String> stationIdList = connectorList.stream()
.map(PileConnectorInfoVO::getStationId)
.collect(Collectors.toList());
for (Long stationId : stationIdList) {
for (String stationId : stationIdList) {
String stationIdStr = String.valueOf(stationId);
List<ThirdPartySnRelationVO> list = snRelationService.selectSnRelationListByParams(stationIdStr, null);
if (CollectionUtils.isEmpty(list)) {