| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.common.core.utils.SpringUtils; |
| | | import com.ruoyi.integration.drainage.kuaidian.model.NotificationStationChangeResult; |
| | | import com.ruoyi.integration.drainage.kuaidian.model.StationChange; |
| | | import com.ruoyi.integration.drainage.model.*; |
| | | import com.ruoyi.integration.drainage.model.enu.InterfaceUrlEnum; |
| | | import com.ruoyi.other.api.domain.Operator; |
| | |
| | | import java.time.ZoneOffset; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 中电联TCEC标准 |
| | |
| | | |
| | | |
| | | /** |
| | | * 站点变更通知 |
| | | * @param operator |
| | | * @param type |
| | | * @param siteIds |
| | | * @return |
| | | */ |
| | | public static NotificationStationChangeResult notificationStationChange(Operator operator, Integer type, List<Integer> siteIds) { |
| | | StationChange stationChange = new StationChange(); |
| | | stationChange.setOperatorId(OperatorID); |
| | | stationChange.setType(type); |
| | | List<String> collect = siteIds.stream().map(String::valueOf).collect(Collectors.toList()); |
| | | stationChange.setStationIds(collect); |
| | | HttpRequest post = HttpUtil.createPost(operator.getTestUrl() + InterfaceUrlEnum.NOTIFICATION_STATION_CHANGE.getUrl()); |
| | | buildBody(post, stationChange, operator); |
| | | HttpResponse execute = post.execute(); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("推送站点变更通知失败:" + execute.body()); |
| | | return null; |
| | | } |
| | | return JSON.parseObject(execute.body(), NotificationStationChangeResult.class); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 推送启动充电结果 |
| | | * @param info |
| | | * @return |