mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
停车平台
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.parking.request;
|
||||
package com.jsowell.thirdparty.parking.common.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.parking.request;
|
||||
package com.jsowell.thirdparty.parking.common.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.parking.request;
|
||||
package com.jsowell.thirdparty.parking.common.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.parking.response;
|
||||
package com.jsowell.thirdparty.parking.common.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.parking.response;
|
||||
package com.jsowell.thirdparty.parking.common.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.jsowell.thirdparty.parking.common.response;
|
||||
|
||||
public class ResponseDiscountCreate {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.jsowell.thirdparty.parking.common.response;
|
||||
|
||||
public class ResponseDiscountDestroy {
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.jsowell.thirdparty.parking.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class RequestDiscountDestroy {
|
||||
/**
|
||||
* 停车场编号
|
||||
*/
|
||||
private String parkId;
|
||||
/**
|
||||
* 优惠券派发流水
|
||||
*/
|
||||
private String grantSerial;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.jsowell.thirdparty.parking.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @desc:获取通道信息实体类
|
||||
* @date: 2021-11-16 14:50
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class RequestLaneInfoList {
|
||||
|
||||
//车场ID
|
||||
Integer parkId;
|
||||
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
package com.jsowell.thirdparty.parking.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @desc:固定车续费实体类
|
||||
* @date: 2021-10-30 15:46
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class RequestPayNotify {
|
||||
//停车场ID
|
||||
Integer parkId;
|
||||
//车牌号(可空-临时车无牌车支付时)
|
||||
String plate;
|
||||
//外部订单号
|
||||
String outTradeNo;
|
||||
//金额
|
||||
Double amount;
|
||||
// 支付类型 0-现金,1-电子支付
|
||||
Integer payType;
|
||||
//车型(1-按临时车计费 2-按固定车计费 3-储值车计费)
|
||||
Integer carType;
|
||||
//月租车主键ID
|
||||
Integer carId;
|
||||
//计费车类型 0-代表临时车 ,其他-对应(登记车型表)
|
||||
Integer chargeType;
|
||||
//通道id 不为null时,通道扫码支付
|
||||
Integer laneId;
|
||||
//平台进出场ID (平台ID与本地ID不能同时为空)
|
||||
Integer recordId;
|
||||
//本地进出场ID (平台ID与本地ID不能同时为空)
|
||||
Integer localId;
|
||||
//[月租] 月租车截止日期 (carType!=2 为空)
|
||||
String endDate;
|
||||
//[月租] 月租车充值月数 (carType!=2 为空)
|
||||
Integer number;
|
||||
//支付方式 1-微信 2-支付宝 用于获取用户openID或者userId
|
||||
Integer sourceType;
|
||||
//公众号 openId
|
||||
String openId;
|
||||
//支付详情
|
||||
String payRemark;
|
||||
|
||||
public RequestPayNotify() {
|
||||
}
|
||||
|
||||
public RequestPayNotify(Integer parkId, Integer carType, Integer chargeType, String plate, Double amount, Integer laneId, Integer recordId, Integer localId, String endDate, Integer number, Integer sourceType, String openId, String payRemark) {
|
||||
this.parkId = parkId;
|
||||
this.carType = carType;
|
||||
this.chargeType = chargeType;
|
||||
this.plate = plate;
|
||||
this.amount = amount;
|
||||
this.laneId = laneId;
|
||||
this.recordId = recordId;
|
||||
this.localId = localId;
|
||||
this.endDate = endDate;
|
||||
this.number = number;
|
||||
this.sourceType = sourceType;
|
||||
this.openId = openId;
|
||||
this.payRemark = payRemark;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.jsowell.thirdparty.parking.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @desc:请求参数,车主扫码通道二维码,入场or出场(支持无牌车)
|
||||
* @auther: wb
|
||||
* @date: 2021-12-02 10:53
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class RequestScanLaneQr {
|
||||
|
||||
Integer parkId; //车场ID
|
||||
Integer laneId; //通道ID
|
||||
Integer laneType; //通道Type 1-入 2-出
|
||||
String noPlate; //无牌车
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.jsowell.thirdparty.parking.response;
|
||||
|
||||
public class ResponseDiscountCreate {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.jsowell.thirdparty.parking.response;
|
||||
|
||||
public class ResponseDiscountDestroy {
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.jsowell.thirdparty.parking.response;
|
||||
|
||||
import com.pay.api.bean.LaneInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @desc:续费通知接口
|
||||
* @date: 2021-10-30 15:46
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class ResponseLaneInfoList {
|
||||
|
||||
int parkId;
|
||||
String parkName;
|
||||
List<LaneInfo> laneList; //通道List
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.jsowell.thirdparty.parking.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @desc:续费通知接口
|
||||
* @date: 2021-10-30 15:46
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class ResponsePayNotify {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.jsowell.thirdparty.parking.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @desc:响应参数,车主扫码通道二维码,入场or出场(支持无牌车)
|
||||
* @date: 2021-11-16 14:50
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class ResponseScanLaneQr {
|
||||
|
||||
Integer parkId; //车场ID
|
||||
Integer laneId; //通道ID
|
||||
Integer laneType; //通道类型
|
||||
String plate; //车牌号
|
||||
Object inQrResponse; //入场响应
|
||||
Object outQrResponse; //出场响应
|
||||
}
|
||||
@@ -1,13 +1,17 @@
|
||||
package com.jsowell.thirdparty.parking.service.impl;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jsowell.common.core.domain.parking.ParkingCommonParam;
|
||||
import com.jsowell.common.util.ParkingUtil;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.id.UUID;
|
||||
import com.jsowell.thirdparty.parking.common.ServiceApiCmd;
|
||||
import com.jsowell.thirdparty.parking.common.response.DataResponse;
|
||||
import com.jsowell.thirdparty.parking.service.QcyunsService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -15,6 +19,7 @@ import java.util.Map;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class QcyunsServiceImpl implements QcyunsService {
|
||||
|
||||
@@ -34,24 +39,58 @@ public class QcyunsServiceImpl implements QcyunsService {
|
||||
if (StringUtils.isBlank(parkId)) {
|
||||
parkId = "11609";
|
||||
}
|
||||
// 业务参数
|
||||
Map<String, String> data = Maps.newHashMap();
|
||||
data.put("ParkId", parkId);
|
||||
data.put("PlateNumber", plateNumber);
|
||||
|
||||
// 组装请求体
|
||||
ParkingCommonParam param = new ParkingCommonParam();
|
||||
param.setService("CarInfo");
|
||||
param.setService(ServiceApiCmd.CarInfo);
|
||||
param.setVersion("01");
|
||||
param.setMsgId(UUID.randomUUID().toString());
|
||||
param.setOrgId("BTTEST01");
|
||||
param.setData(data);
|
||||
|
||||
String secretKey = "";
|
||||
// 生成sign
|
||||
ParkingUtil.generateAndSetSign(param, secretKey);
|
||||
|
||||
// 发送请求
|
||||
String result = HttpUtil.post(URL, JSON.toJSONString(param));
|
||||
System.out.println(result);
|
||||
DataResponse dataResponse = JSONUtil.toBean(result, DataResponse.class);
|
||||
log.info("获取车辆信息接口成功, response:{}", JSON.toJSONString(dataResponse));
|
||||
if (dataResponse.getRetCode() == 0) {
|
||||
return dataResponse.getRetData().toString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商家减免
|
||||
* @return
|
||||
*/
|
||||
public boolean createDiscountCoupon() {
|
||||
// 业务参数
|
||||
Map<String, String> data = Maps.newHashMap();
|
||||
data.put("parkingSerial", "");
|
||||
data.put("grantSerial", "");
|
||||
data.put("plate", ""); // 车牌号
|
||||
data.put("storeName", ""); // 商家名称
|
||||
data.put("type", ""); // 优惠类型: 1.金额, 2.时长, 3.全免
|
||||
data.put("value", ""); // 当type=1时单位为分;当type=2时单位为分钟
|
||||
data.put("parkId", ""); //
|
||||
// 组装请求体
|
||||
ParkingCommonParam param = new ParkingCommonParam();
|
||||
param.setService(ServiceApiCmd.DiscountCreate);
|
||||
param.setVersion("01");
|
||||
param.setMsgId(UUID.randomUUID().toString());
|
||||
param.setOrgId("BTTEST01");
|
||||
param.setData(data);
|
||||
// 生成sign
|
||||
ParkingUtil.generateAndSetSign(param, secretKey);
|
||||
// 发送请求
|
||||
String result = HttpUtil.post(URL, JSON.toJSONString(param));
|
||||
DataResponse dataResponse = JSONUtil.toBean(result, DataResponse.class);
|
||||
log.info("创建优惠券成功, response:{}", JSON.toJSONString(dataResponse));
|
||||
if (dataResponse.getRetCode() == 0) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user