|
|
@@ -8,6 +8,8 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.template.common.exception.MyCustomException;
|
|
|
import com.template.common.result.ResponseStatusEnum;
|
|
|
import com.template.common.utils.CreateSign1;
|
|
|
+import com.template.common.utils.TimeExchange;
|
|
|
+import com.template.common.utils.TimeExchange2;
|
|
|
import com.template.component.bo.AddVisitorCarBO;
|
|
|
import com.template.config.ParkingFeeSysOfMxhConfig;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
@@ -28,22 +30,64 @@ public class ParkingFeeSystemComponent {
|
|
|
|
|
|
private final ParkingFeeSysOfMxhConfig parkingFeeSysOfMxhConfig;
|
|
|
|
|
|
+// /**
|
|
|
+// * 墨轩湖小区新增访客车辆
|
|
|
+// * @param addCarRecordBo 新增访客车辆bo
|
|
|
+// */
|
|
|
+// public void addVisitorCarOfMxh(AddVisitorCarBO addCarRecordBo) {
|
|
|
+// String sign = CreateSign1.MD5(JSON.toJSONString(addCarRecordBo) + "key=" + parkingFeeSysOfMxhConfig.getKey()).toUpperCase();
|
|
|
+// Map<String, Object> param = MapUtil.<String, Object>builder()
|
|
|
+// .put("park_id", parkingFeeSysOfMxhConfig.getParkId())
|
|
|
+// .put("service_name", parkingFeeSysOfMxhConfig.getServiceName())
|
|
|
+// .put("sign", sign)
|
|
|
+// .put("data", addCarRecordBo)
|
|
|
+// .build();
|
|
|
+//
|
|
|
+// System.out.println("parkingFeeSysOfMxhConfig.getParkId()"+parkingFeeSysOfMxhConfig.getParkId());
|
|
|
+// System.out.println("parkingFeeSysOfMxhConfig.getKey()"+parkingFeeSysOfMxhConfig.getKey());
|
|
|
+// System.out.println("parkingFeeSysOfMxhConfig.getServiceName()"+parkingFeeSysOfMxhConfig.getServiceName());
|
|
|
+//
|
|
|
+// String result;
|
|
|
+// try {
|
|
|
+// result = HttpRequest.post(parkingFeeSysOfMxhConfig.getUrl()).body(JSON.toJSONString(param)).execute().body();
|
|
|
+// System.out.println("车牌预约"+result);
|
|
|
+// System.out.println("parkingFeeSysOfMxhConfig.getUrl()"+parkingFeeSysOfMxhConfig.getUrl());
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error("调用第三方接口异常", e);
|
|
|
+// throw new MyCustomException(ResponseStatusEnum.THIRD_API_ERROR);
|
|
|
+// }
|
|
|
+//
|
|
|
+// JSONObject jsonObject = JSON.parseObject(result);
|
|
|
+// String state = jsonObject.getString("state");
|
|
|
+// // 1 表示新增成功
|
|
|
+// if (!StrUtil.equals(state, "1")) {
|
|
|
+// log.error("新增车牌失败,返回信息为:{}", result);
|
|
|
+// throw new MyCustomException(ResponseStatusEnum.THIRD_API_ERROR);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
/**
|
|
|
* 墨轩湖小区新增访客车辆
|
|
|
* @param addCarRecordBo 新增访客车辆bo
|
|
|
*/
|
|
|
public void addVisitorCarOfMxh(AddVisitorCarBO addCarRecordBo) {
|
|
|
- String sign = CreateSign1.MD5(JSON.toJSONString(addCarRecordBo) + "key=" + parkingFeeSysOfMxhConfig.getKey()).toUpperCase();
|
|
|
Map<String, Object> param = MapUtil.<String, Object>builder()
|
|
|
- .put("park_id", parkingFeeSysOfMxhConfig.getParkId())
|
|
|
- .put("service_name", parkingFeeSysOfMxhConfig.getServiceName())
|
|
|
- .put("sign", sign)
|
|
|
- .put("data", addCarRecordBo)
|
|
|
+ .put("visitorName", addCarRecordBo.getName())
|
|
|
+ .put("visitorPhone",addCarRecordBo.getMobile())
|
|
|
+ .put("cardNumber", addCarRecordBo.getCarNumber())
|
|
|
+ .put("reason", addCarRecordBo.getVisitorReason())
|
|
|
+ .put("memberName", "南昌交通学院")
|
|
|
+ .put("memberPhone", "0791-82293610")
|
|
|
+ .put("memberOrg", "墨轩湖")
|
|
|
+ .put("carNumber", "赣A66778")
|
|
|
+ .put("visitStartTime", TimeExchange2.StringToTimestamp( addCarRecordBo.getBeginTime()))
|
|
|
+ .put("visitEndTime", TimeExchange2.StringToTimestamp(addCarRecordBo.getEndTime()))
|
|
|
.build();
|
|
|
|
|
|
String result;
|
|
|
try {
|
|
|
- result = HttpRequest.post(parkingFeeSysOfMxhConfig.getUrl()).body(JSON.toJSONString(param)).execute().body();
|
|
|
+ result = HttpRequest.post("http://172.16.20.43:8080/carstop/yxVisitoraddCar.action").body(JSON.toJSONString(param)).execute().body();
|
|
|
+ System.out.println("车牌预约"+result);
|
|
|
} catch (Exception e) {
|
|
|
log.error("调用第三方接口异常", e);
|
|
|
throw new MyCustomException(ResponseStatusEnum.THIRD_API_ERROR);
|