DatabusAdaptImpl.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * Copyright 2017-2020 吴学文 and java110 team.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.java110.job.adapt;
  17. import com.alibaba.fastjson.JSONObject;
  18. import com.java110.core.client.RestTemplate;
  19. import com.java110.dto.businessDatabus.CustomBusinessDatabusDto;
  20. import com.java110.dto.tempCarFeeConfig.TempCarPayOrderDto;
  21. import com.java110.entity.order.Business;
  22. import com.java110.job.adapt.hcIot.GetToken;
  23. import com.java110.po.machine.MachineRecordPo;
  24. import com.java110.vo.ResultVo;
  25. import org.springframework.http.HttpHeaders;
  26. import java.util.List;
  27. /**
  28. * @desc add by 吴学文 15:21
  29. */
  30. public abstract class DatabusAdaptImpl implements IDatabusAdapt {
  31. /**
  32. * 封装头信息
  33. *
  34. * @return
  35. */
  36. protected HttpHeaders getHeaders(RestTemplate outRestTemplate) {
  37. HttpHeaders httpHeaders = new HttpHeaders();
  38. httpHeaders.add("access_token", GetToken.get(outRestTemplate, false));
  39. //httpHeaders.add("Content-Type", "application/x-www-form-urlencoded");
  40. return httpHeaders;
  41. }
  42. /**
  43. * 开门
  44. *
  45. * @param paramIn 业务信息
  46. * @return
  47. */
  48. @Override
  49. public ResultVo openDoor(JSONObject paramIn) {
  50. return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
  51. }
  52. /**
  53. * 重启设备
  54. *
  55. * @param paramIn
  56. * @return
  57. */
  58. @Override
  59. public ResultVo restartMachine(JSONObject paramIn) {
  60. return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
  61. }
  62. /**
  63. * 失败重新送IOT
  64. *
  65. * @param paramIn
  66. * @return
  67. */
  68. @Override
  69. public ResultVo reSendToIot(JSONObject paramIn) {
  70. return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
  71. }
  72. /**
  73. * 查询 临时车待支付订单
  74. *
  75. * @param tempCarPayOrderDto
  76. * @return
  77. */
  78. @Override
  79. public ResultVo getTempCarFeeOrder(TempCarPayOrderDto tempCarPayOrderDto) {
  80. return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
  81. }
  82. /**
  83. * 查询 临时车待支付订单
  84. *
  85. * @param tempCarPayOrderDto
  86. * @return
  87. */
  88. @Override
  89. public ResultVo notifyTempCarFeeOrder(TempCarPayOrderDto tempCarPayOrderDto) {
  90. return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
  91. }
  92. /**
  93. * 业主处理执行
  94. *
  95. * @param business 当前处理业务
  96. * @param businesses 所有业务信息
  97. */
  98. @Override
  99. public void execute(Business business, List<Business> businesses) throws Exception {
  100. }
  101. /**
  102. * 手工 送数据
  103. * @param customBusinessDatabusDto
  104. */
  105. public void customExchange(CustomBusinessDatabusDto customBusinessDatabusDto){
  106. }
  107. }