|
|
|
@@ -19,6 +19,7 @@ import com.iformall.domain.po.WxCoupon; |
|
|
|
import com.iformall.domain.po.WxPark; |
|
|
|
import com.iformall.domain.vo.WxCouponOrderCarCVo; |
|
|
|
import com.iformall.enums.EnumCarVendor; |
|
|
|
import com.iformall.enums.EnumCouponUnit; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.service.park.ParkAdapterService; |
|
|
|
import com.iformall.service.park.impl.BaseParkService; |
|
|
|
@@ -66,8 +67,7 @@ public class CYFParkService extends BaseParkService implements ParkAdapterServic |
|
|
|
String ret = cyf.registerCar(token,park.getNumber(),feeGroupId,park.getParkingId(),carNumber,null,member.getNickName()); |
|
|
|
JSONObject retObj = JSON.parseObject(ret); |
|
|
|
if (retObj.getIntValue("result") == 1){ |
|
|
|
//TODO 返回vendorPersonId |
|
|
|
return null; |
|
|
|
return retObj.get("localPersonId").toString(); |
|
|
|
}else { |
|
|
|
logger.error("cyfBindCar error. paramMap: {} . cyfResult: {}",JSON.toJSONString(paramMap),ret); |
|
|
|
String msg = retObj.getString("strError"); |
|
|
|
@@ -128,9 +128,45 @@ public class CYFParkService extends BaseParkService implements ParkAdapterServic |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 优惠券支付流程:(1):调取openapi/getFee路径获取当前停车费,入参:plate,parkingId,token |
|
|
|
(2):调用地址:http://wechat.cheyifu2016.com/fm-pay/#/transit?encodeURIComponent('orderNo=123&couponFee=2&actualFee=20') |
|
|
|
注: 详细参考接口文档参数 |
|
|
|
* @param token |
|
|
|
* @param orderNo |
|
|
|
* @param couponFee |
|
|
|
* @param actualFee |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public ResultData useCoupon(Map<String, String> paramMap, WxPark park, WxCouponOrderCarCVo userCar,WxCoupon coupon,String carNumber) throws Exception{ |
|
|
|
return new ResultData(); |
|
|
|
String params = park.getVendorParams(); |
|
|
|
JSONObject objParams = JSON.parseObject(params); |
|
|
|
String token = objParams.getString("token"); |
|
|
|
//先获取停车费,然后再提交停车费 |
|
|
|
String ret = cyf.getCarStopFee(token,park.getParkingId(),carNumber); |
|
|
|
JSONObject retObj = JSON.parseObject(ret); |
|
|
|
if (retObj.getIntValue("result") == 1){ |
|
|
|
String orderId = retObj.getString("orderId"); |
|
|
|
if (StringUtils.isBlank(orderId)) { |
|
|
|
logger.error("cyfCarStopFee error. paramMap: {} . cyfResult: {}",JSON.toJSONString(paramMap),ret); |
|
|
|
return new ResultData(ErrorCode.CYF_STOP_FEE_FAIL.getCode(), "车易付停车费查询未返回订单编号:"+orderId); |
|
|
|
} |
|
|
|
if (!coupon.getUnit().equals(EnumCouponUnit.MONEY.getCode())) { |
|
|
|
return new ResultData(ErrorCode.CYF_STOP_FEE_FAIL.getCode(), "车易付只能支持金额券,不能使用小时券:"+orderId); |
|
|
|
} |
|
|
|
int fee = retObj.getInteger("fee"); |
|
|
|
int amount = Integer.parseInt(coupon.getPriceStr()); |
|
|
|
Map retmap = new HashMap(); |
|
|
|
retmap.put("orderNo", orderId); |
|
|
|
retmap.put("couponFee", amount); |
|
|
|
retmap.put("actualFee", fee-amount); |
|
|
|
return new ResultData(); |
|
|
|
}else { |
|
|
|
logger.error("cyfCarStopFee error. paramMap: {} . cyfResult: {}",JSON.toJSONString(paramMap),ret); |
|
|
|
String msg = retObj.getString("strError"); |
|
|
|
return new ResultData(ErrorCode.CYF_STOP_FEE_FAIL.getCode(), "停车费获取失败:"+msg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|