|
@@ -2,11 +2,16 @@ package com.usky.dxtop.service.api;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.usky.dxtop.common.exception.CustomException;
|
|
import com.usky.dxtop.common.utils.StringUtils;
|
|
import com.usky.dxtop.common.utils.StringUtils;
|
|
import com.usky.dxtop.common.utils.http.HttpUtils;
|
|
import com.usky.dxtop.common.utils.http.HttpUtils;
|
|
import com.usky.dxtop.common.utils.sign.Md5Utils;
|
|
import com.usky.dxtop.common.utils.sign.Md5Utils;
|
|
|
|
+import org.apache.poi.hssf.record.SSTRecord;
|
|
|
|
+import org.apache.poi.ss.usermodel.FontUnderline;
|
|
|
|
+import sun.security.timestamp.TSRequest;
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
+import java.util.function.Function;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author yq
|
|
* @author yq
|
|
@@ -17,10 +22,14 @@ public class OneCardApi {
|
|
private static final String URL = "http://10.208.2.158:7002/";
|
|
private static final String URL = "http://10.208.2.158:7002/";
|
|
|
|
|
|
private static final Integer VERSION = 3;
|
|
private static final Integer VERSION = 3;
|
|
-
|
|
|
|
- public static final String CARD_LOSS_url = String.format("%s%s",URL,"partner/card/loss");
|
|
|
|
-
|
|
|
|
- public static final String CARD_REISSUE = String.format("%s%s",URL,"caih/reissue");
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 卡消费
|
|
|
|
+ */
|
|
|
|
+ public static final String CARD_PAY_URL = String.format("%s%s",URL,"partner/card/loss");
|
|
|
|
+ /**
|
|
|
|
+ * 消费检查
|
|
|
|
+ */
|
|
|
|
+ public static final String CARD_PAYCHECK = String.format("%s%s",URL,"caih/reissue");
|
|
/**
|
|
/**
|
|
* 餐厅编号
|
|
* 餐厅编号
|
|
*/
|
|
*/
|
|
@@ -80,6 +89,19 @@ public class OneCardApi {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 卡消费
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public static TreeMap<String,String> cardPay(){
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static TreeMap<String,String> cardPayBack(Integer seq){
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 验签
|
|
* 验签
|
|
@@ -133,4 +155,14 @@ public class OneCardApi {
|
|
String changeBuf = buf.toString();
|
|
String changeBuf = buf.toString();
|
|
return changeBuf.substring(0, changeBuf.length() - 1);
|
|
return changeBuf.substring(0, changeBuf.length() - 1);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public Boolean commonRequest(String url, String param, Function<JSONObject,Boolean> function){
|
|
|
|
+ String result = HttpUtils.sendPost(url, JSONObject.toJSONString(param), null);
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
|
+ if ("1".equals(jsonObject.get("code").toString())) {
|
|
|
|
+ return function.apply(jsonObject);
|
|
|
|
+ } else {
|
|
|
|
+ throw new CustomException("接口异常"+jsonObject.get("msg"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|