| | |
| | | body.put("chargeId", orderId); |
| | | String paramOut = null; |
| | | try { |
| | | paramOut = DingdingChargeUtils.execute("net.equip.charge.slow.ru", body.toJSONString(), HttpMethod.GET); |
| | | paramOut = KeHangChargeUtils.execute("net.equip.charge.slow.run", body.toJSONString(), HttpMethod.GET); |
| | | } catch (Exception e) { |
| | | throw new IllegalArgumentException(e.getMessage()); |
| | | } |
| | |
| | | body.put("port", chargeMachinePortDto.getPortCode()); |
| | | String paramOut = null; |
| | | try { |
| | | paramOut = DingdingChargeUtils.execute("net.equip.charge.slow.run.stop", body.toJSONString(), HttpMethod.GET); |
| | | paramOut = KeHangChargeUtils.execute("net.equip.charge.slow.run.stop", body.toJSONString(), HttpMethod.GET); |
| | | } catch (Exception e) { |
| | | throw new IllegalArgumentException(e.getMessage()); |
| | | } |
| | |
| | | body.put("equipCd", chargeMachineDto.getMachineCode()); |
| | | String paramOut = null; |
| | | try { |
| | | paramOut = DingdingChargeUtils.execute("net.equip.charge.slow.port.query", body.toJSONString(), HttpMethod.GET); |
| | | paramOut = KeHangChargeUtils.execute("net.equip.charge.slow.port.query", body.toJSONString(), HttpMethod.GET); |
| | | } catch (Exception e) { |
| | | throw new IllegalArgumentException(e.getMessage()); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void queryChargeMachineState(ChargeMachineDto chargeMachineDto) { |
| | | JSONObject body = new JSONObject(); |
| | | body.put("equipCd", chargeMachineDto.getMachineCode()); |
| | | String paramOut = null; |
| | | try { |
| | | paramOut = KeHangChargeUtils.execute("net.equip.online.query", body.toJSONString(), HttpMethod.GET); |
| | | } catch (Exception e) { |
| | | throw new IllegalArgumentException(e.getMessage()); |
| | | } |
| | | |
| | | JSONObject paramObj = JSONObject.parseObject(paramOut); |
| | | if (paramObj.getIntValue("code") != 1) { |
| | | throw new IllegalArgumentException(paramObj.getString("msg")); |
| | | } |
| | | |
| | | JSONObject data = paramObj.getJSONObject("data"); |
| | | |
| | | if(data.getBoolean("online")){ |
| | | chargeMachineDto.setState(ChargeMachineDto.STATE_ONLINE); |
| | | chargeMachineDto.setStateName("在线"); |
| | | return ; |
| | | } |
| | | |
| | | chargeMachineDto.setState(ChargeMachineDto.STATE_OFFLINE); |
| | | chargeMachineDto.setStateName("离线"); |
| | | } |
| | | |
| | | @Override |
| | | public void workHeartbeat(ChargeMachineDto chargeMachineDto, String bodyParam) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<NotifyChargePortDto> getChargeHeartBeatParam(NotifyChargeOrderDto notifyChargeOrderDto) { |
| | | return null; |
| | | } |