|
|
|
@@ -61,7 +61,7 @@ public class HaiKangWeiShiV3Util { |
|
|
|
|
|
|
|
|
|
|
|
public static final String QUERY_PRICE = "/api/pms/v1/pay/preBill"; |
|
|
|
//public static final String COUPON_USE = "/api/pms/v1/coupon/addition"; |
|
|
|
public static final String COUPON_USE = "/api/pms/v1/coupon/addition"; |
|
|
|
public static final String NOTIFY_PAID = "/api/pms/v2/pay/receipt"; |
|
|
|
|
|
|
|
|
|
|
|
@@ -123,21 +123,12 @@ public class HaiKangWeiShiV3Util { |
|
|
|
/** |
|
|
|
* 查询停车费 |
|
|
|
**/ |
|
|
|
public JSONObject getCarStopFee(WxPark wxPark,String carNumber,ArtemisConfig config,WxCoupon coupon){ |
|
|
|
public JSONObject getCarStopFee(WxPark wxPark,String carNumber,ArtemisConfig config){ |
|
|
|
String vendroParams = wxPark.getVendorParams(); |
|
|
|
JSONObject vp = JSON.parseObject(vendroParams); |
|
|
|
JSONObject ob = new JSONObject(); |
|
|
|
ob.put("plateNo", carNumber); |
|
|
|
ob.put("parkSyscode", wxPark.getParkingId()); |
|
|
|
if (null != coupon) { |
|
|
|
if (coupon.getUnit().intValue() == EnumCouponUnit.MONEY.getCode().intValue()) { |
|
|
|
ob.put("deductRuleType", 0); |
|
|
|
ob.put("deductContent", new BigDecimal(coupon.getPrice()).intValue()); |
|
|
|
}else { |
|
|
|
ob.put("deductRuleType", 4); |
|
|
|
ob.put("deductContent", new BigDecimal(coupon.getPrice()).divide(new BigDecimal(100)).multiply(new BigDecimal(60)).intValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
|
String retCode = callPostApi(config,QUERY_PRICE, JSON.toJSONString(ob)); |
|
|
|
if (StringUtils.isBlank(retCode)) { |
|
|
|
@@ -160,49 +151,49 @@ public class HaiKangWeiShiV3Util { |
|
|
|
/** |
|
|
|
* 使用优惠券 |
|
|
|
**/ |
|
|
|
// public JSONObject useCoupon(WxPark wxPark,ArtemisConfig config,String carNumber,String couponCode,String start,String end,WxCoupon coupon){ |
|
|
|
// String vendroParams = wxPark.getVendorParams(); |
|
|
|
// JSONObject vp = JSON.parseObject(vendroParams); |
|
|
|
// |
|
|
|
// String merchantSysCode = vp.getString("merchantSyscode"); |
|
|
|
// |
|
|
|
// JSONArray array = new JSONArray(); |
|
|
|
// JSONObject ob = new JSONObject(); |
|
|
|
// //ob.put("ruleSyscode", ruleSyscode); |
|
|
|
// ob.put("merchantSyscode", merchantSysCode); |
|
|
|
// ob.put("couponCode", couponCode); |
|
|
|
// ob.put("plateNo", carNumber); |
|
|
|
// ob.put("parkSyscode", wxPark.getParkingId()); |
|
|
|
// if (coupon.getUnit().intValue() == EnumCouponUnit.MONEY.getCode().intValue()) { |
|
|
|
// ob.put("deductRuleType", 0); |
|
|
|
// ob.put("deductContent", new BigDecimal(coupon.getPrice()).intValue()); |
|
|
|
// }else { |
|
|
|
// ob.put("deductRuleType", 4); |
|
|
|
// ob.put("deductContent", new BigDecimal(coupon.getPrice()).divide(new BigDecimal(100)).multiply(new BigDecimal(60)).intValue()); |
|
|
|
// } |
|
|
|
// ob.put("startTime", start); |
|
|
|
// ob.put("endTime", end); |
|
|
|
// array.add(ob); |
|
|
|
// |
|
|
|
// Map param = new HashMap(); |
|
|
|
// param.put("coupons", array); |
|
|
|
// try { |
|
|
|
// String retCode = callPostApi(config,COUPON_USE, JSON.toJSONString(param)); |
|
|
|
// if (StringUtils.isBlank(retCode)) { |
|
|
|
// throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "haikangv3 useCoupon error. has no result"); |
|
|
|
// } |
|
|
|
// JSONObject result = JSON.parseObject(retCode); |
|
|
|
// String code = result.getString("code"); |
|
|
|
// if (!code.equals("0") ) { |
|
|
|
// String message = result.getString("msg"); |
|
|
|
// throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "haikangv3 useCoupon error.["+code+"]"+message); |
|
|
|
// } |
|
|
|
// return result; |
|
|
|
// } catch (Exception e) { |
|
|
|
// log.error("haikangweishiv3 useCoupon error.",e); |
|
|
|
// throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "haikangv3 useCoupon error."+e.getMessage()); |
|
|
|
// } |
|
|
|
// } |
|
|
|
public JSONObject useCoupon(WxPark wxPark,ArtemisConfig config,String carNumber,String couponCode,String start,String end,WxCoupon coupon){ |
|
|
|
String vendroParams = wxPark.getVendorParams(); |
|
|
|
JSONObject vp = JSON.parseObject(vendroParams); |
|
|
|
|
|
|
|
String merchantSysCode = vp.getString("merchantSyscode"); |
|
|
|
|
|
|
|
JSONArray array = new JSONArray(); |
|
|
|
JSONObject ob = new JSONObject(); |
|
|
|
//ob.put("ruleSyscode", ruleSyscode); |
|
|
|
ob.put("merchantSyscode", merchantSysCode); |
|
|
|
ob.put("couponCode", couponCode); |
|
|
|
ob.put("plateNo", carNumber); |
|
|
|
ob.put("parkSyscode", wxPark.getParkingId()); |
|
|
|
if (coupon.getUnit().intValue() == EnumCouponUnit.MONEY.getCode().intValue()) { |
|
|
|
ob.put("deductRuleType", 0); |
|
|
|
ob.put("deductContent", new BigDecimal(coupon.getPrice()).intValue()); |
|
|
|
}else { |
|
|
|
ob.put("deductRuleType", 4); |
|
|
|
ob.put("deductContent", new BigDecimal(coupon.getPrice()).divide(new BigDecimal(100)).multiply(new BigDecimal(60)).intValue()); |
|
|
|
} |
|
|
|
ob.put("startTime", start); |
|
|
|
ob.put("endTime", end); |
|
|
|
array.add(ob); |
|
|
|
|
|
|
|
Map param = new HashMap(); |
|
|
|
param.put("coupons", array); |
|
|
|
try { |
|
|
|
String retCode = callPostApi(config,COUPON_USE, JSON.toJSONString(param)); |
|
|
|
if (StringUtils.isBlank(retCode)) { |
|
|
|
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "haikangv3 useCoupon error. has no result"); |
|
|
|
} |
|
|
|
JSONObject result = JSON.parseObject(retCode); |
|
|
|
String code = result.getString("code"); |
|
|
|
if (!code.equals("0") ) { |
|
|
|
String message = result.getString("msg"); |
|
|
|
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "haikangv3 useCoupon error.["+code+"]"+message); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("haikangweishiv3 useCoupon error.",e); |
|
|
|
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "haikangv3 useCoupon error."+e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//查询车场列表 |
|
|
|
public String queryParkList(ArtemisConfig config) { |
|
|
|
|