|
|
|
@ -137,12 +137,18 @@ public class RequestCore {
|
|
|
|
|
* @param payTwoOrder
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public JSONObject updateSellerAccount(PayTwoOrder payTwoOrder) {
|
|
|
|
|
public JSONObject updateSellerAccount(PayTwoOrder payTwoOrder, Boolean type) {
|
|
|
|
|
String reqUrl = url + API_PREFIX + "/account/updateSellerAccount";
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("accountBalance", payTwoOrder.getAmount());
|
|
|
|
|
map.put("id", payTwoOrder.getMasterUserId());
|
|
|
|
|
map.put("synchronizationDay", DateUtil.betweenDay(payTwoOrder.getOrderStartTime(), payTwoOrder.getOrderEndTime(), true));
|
|
|
|
|
map.put("type", type);
|
|
|
|
|
if (type) {
|
|
|
|
|
map.put("freeSyncEndTime", payTwoOrder.getOrderEndTime());
|
|
|
|
|
} else {
|
|
|
|
|
map.put("massNum", NumberUtil.add(payTwoOrder.getHistoryNum(), payTwoOrder.getAnticipateNum()));
|
|
|
|
|
}
|
|
|
|
|
String post = HttpUtil.post(reqUrl, JSONUtil.parseObj(map).toString());
|
|
|
|
|
JSONObject jsonObject;
|
|
|
|
|
try {
|
|
|
|
@ -213,26 +219,6 @@ public class RequestCore {
|
|
|
|
|
return getTaoBaoSaleSizeApi(reqUrl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 同步历史订单信息,修改账号信息
|
|
|
|
|
*
|
|
|
|
|
* @param payTwoOrder
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Integer updateAccount(PayTwoOrder payTwoOrder) {
|
|
|
|
|
String reqUrl = url + API_PREFIX + "/account/updateAccount";
|
|
|
|
|
if (ObjectUtil.isEmpty(payTwoOrder)) {
|
|
|
|
|
return DefaultNumberConstants.ZERO_NUMBER;
|
|
|
|
|
}
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("id", payTwoOrder.getMasterUserId());
|
|
|
|
|
map.put("accountBalance", payTwoOrder.getAmount() + payTwoOrder.getIdenticalAmount());
|
|
|
|
|
map.put("massNum", NumberUtil.add(payTwoOrder.getHistoryNum(), payTwoOrder.getAnticipateNum()));
|
|
|
|
|
String post = HttpUtil.post(reqUrl, JSONUtil.parseObj(map).toString());
|
|
|
|
|
return Integer.parseInt(post);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Integer getTaoBaoSaleSizeApi(String url) {
|
|
|
|
|
String getResult = HttpUtil
|
|
|
|
|
.createGet(url)
|
|
|
|
|