|
|
@@ -3,7 +3,6 @@ package com.sckw.freight.service;
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.alibaba.fastjson2.TypeReference;
|
|
|
-
|
|
|
import com.sckw.freight.exception.BusinessException;
|
|
|
import com.sckw.freight.model.dto.*;
|
|
|
import com.sckw.freight.model.enums.ChannelEnum;
|
|
|
@@ -143,6 +142,9 @@ public class PayCenterService {
|
|
|
}
|
|
|
|
|
|
private String changeRes(String sync) {
|
|
|
+ if (StringUtils.isEmpty(sync)) {
|
|
|
+ return sync;
|
|
|
+ }
|
|
|
JSONObject jsonObject = JSONObject.parseObject(sync);
|
|
|
//我的泛型是对象 返回值有可能 是对象或数组 {} []
|
|
|
//data:[]->转换成 data:null 进入if
|
|
|
@@ -167,8 +169,7 @@ public class PayCenterService {
|
|
|
put("channel", channelEnum);
|
|
|
put("channels", "xinwang");
|
|
|
}});
|
|
|
- return JSONObject.parseObject(sync, new TypeReference<>() {
|
|
|
- });
|
|
|
+ return JSONObject.parseObject(sync, new TypeReference<R<JSONObject>>(){});
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -209,8 +210,7 @@ public class PayCenterService {
|
|
|
put("uid", uid);
|
|
|
put("order_no", orderNo);
|
|
|
}});
|
|
|
- return JSONObject.parseObject(sync, new TypeReference<>() {
|
|
|
- });
|
|
|
+ return JSONObject.parseObject(sync, new TypeReference<R<Object>>(){});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -238,8 +238,7 @@ public class PayCenterService {
|
|
|
put("money", money);
|
|
|
put("remarks", remarks);
|
|
|
}});
|
|
|
- return JSONObject.parseObject(sync, new TypeReference<>() {
|
|
|
- });
|
|
|
+ return JSONObject.parseObject(sync, new TypeReference<R<Order>>(){});
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -271,8 +270,7 @@ public class PayCenterService {
|
|
|
put("money", money);
|
|
|
put("filter", filter);
|
|
|
}});
|
|
|
- return JSONObject.parseObject(sync, new TypeReference<>() {
|
|
|
- });
|
|
|
+ return JSONObject.parseObject(sync, new TypeReference<R<Order>>(){});
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -304,8 +302,8 @@ public class PayCenterService {
|
|
|
public R<MemberRes> memberIndex(MemberCreate memberCreate) {
|
|
|
|
|
|
String sync = jsonHttp(PayCenterEnum.MEMBER_INDEX, memberCreate);
|
|
|
- return JSONObject.parseObject(sync, new TypeReference<>() {
|
|
|
- });
|
|
|
+ //return JSONObject.parseObject(sync, new R<MemberRes>().getClass());
|
|
|
+ return JSONObject.parseObject(sync, new TypeReference<R<MemberRes>>(){});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -324,9 +322,15 @@ public class PayCenterService {
|
|
|
put("channel", channel);
|
|
|
put("money", money);
|
|
|
}});
|
|
|
-
|
|
|
- return JSONObject.parseObject(sync, new TypeReference<>() {
|
|
|
- });
|
|
|
+// Object object = JSONObject.parseObject(sync);
|
|
|
+// R<PayIndex> object1 = JSONObject.parseObject(sync,new R<PayIndex>().getClass());
|
|
|
+// return JSONObject.parseObject(sync, new TypeReference<>() {
|
|
|
+// });
|
|
|
+
|
|
|
+ TypeReference<R<PayIndex>> typeRef = new TypeReference<R<PayIndex>>() {};
|
|
|
+ return JSONObject.parseObject(sync, typeRef);
|
|
|
+ //return JSONObject.parseObject(sync,new R<PayIndex>().getClass());
|
|
|
+ //return (R<PayIndex>) ((JSONObject) JSONObject.parseObject(sync)).values();
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -351,8 +355,8 @@ public class PayCenterService {
|
|
|
put("money", money);
|
|
|
put("business_no", businessNo);
|
|
|
}});
|
|
|
- return JSONObject.parseObject(sync, new TypeReference<>() {
|
|
|
- });
|
|
|
+ TypeReference<R<Freeze>> typeRef = new TypeReference<R<Freeze>>() {};
|
|
|
+ return JSONObject.parseObject(sync, typeRef);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -441,6 +445,7 @@ public class PayCenterService {
|
|
|
return JSONObject.parseObject(sync, new TypeReference<>() {
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* @description: 根据单号,获取充值记录详情
|
|
|
* @author: xj
|