提现 格式不规范
This commit is contained in:
@@ -207,6 +207,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, Course> implements
|
||||
m.put("courseDetailsCount", i == null ? 0 : i);
|
||||
m.put("courseId", m.get("courseId").toString());
|
||||
}
|
||||
|
||||
PageUtils pageUtils = PageUtils.page(pageInfo);
|
||||
setCache(cacheKey, JSONUtil.toJsonStr(pageUtils));
|
||||
return Result.success().put("data", pageUtils);
|
||||
|
||||
@@ -11,6 +11,7 @@ import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSONException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@@ -714,6 +715,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
||||
if (baseResp.getStatus() == null || !baseResp.getStatus().equals(10000)) {
|
||||
return Result.error(baseResp.getErrorMsg());
|
||||
}
|
||||
cashOut.setRefund(baseResp.getMsg());
|
||||
// if (baseResp.getStatus() != null && (baseResp.getStatus().equals(2) || baseResp.getStatus().equals(10000))) {
|
||||
// userMoneyDetails.setContent("成功提现:" + money);
|
||||
// cashOut.setState(1);
|
||||
@@ -903,7 +905,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
||||
new BigDecimal(entity.getMoney()), "提现失败存入余额" + entity.getMoney() + "元", 1);
|
||||
sysUserMoneyDetailsService.save(details);
|
||||
sysUserMoneyService.updateSysMoney(1, entity.getUserId(), Double.parseDouble(entity.getMoney()));
|
||||
}else {
|
||||
} else {
|
||||
updateByUserId(entity);
|
||||
UserMoneyDetails userMoneyDetails = new UserMoneyDetails(
|
||||
entity.getUserId(), entity.getSysUserId(), null, "[提现退款]", 4, 1, 2,
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.core.exceptions.ValidateException;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONException;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.sqx.common.exception.SqxException;
|
||||
import com.sqx.modules.common.entity.CommonInfo;
|
||||
@@ -13,6 +14,7 @@ import com.sqx.modules.common.service.CommonInfoService;
|
||||
import com.sqx.modules.pay.dao.CashOutDao;
|
||||
import com.sqx.modules.pay.entity.WithdrawTypeEnum;
|
||||
import com.sqx.modules.pay.service.CashOutService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -26,6 +28,7 @@ import java.util.Map;
|
||||
/**
|
||||
* @author GYJ
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class WuyouPay {
|
||||
|
||||
@@ -110,7 +113,7 @@ public class WuyouPay {
|
||||
|
||||
if (successCashCount >= Integer.parseInt(cashLimit.getValue())) {
|
||||
logger.warn("体现次数超限,当前限制{}次, 已经体现{}次", cashLimit.getValue(), successCashCount);
|
||||
throw new SqxException(StrUtil.format("超过当日提现限制次数{}次,请明天再试!", cashLimit.getValue()));
|
||||
throw new ValidateException(StrUtil.format("超过当日提现限制次数{}次,请明天再试!", cashLimit.getValue()));
|
||||
}
|
||||
checkCanCashByLimit(money);
|
||||
todayTotalLimit(userId, money.doubleValue());
|
||||
@@ -229,7 +232,16 @@ public class WuyouPay {
|
||||
params.put("business_attr", isUser ? "unionpay" : "alipay");
|
||||
}
|
||||
String body = request(Constants.EXTRACT_URL, params, "");
|
||||
return JSONObject.parseObject(body, BaseResp.class);
|
||||
BaseResp baseResp;
|
||||
try {
|
||||
baseResp = JSONObject.parseObject(body, BaseResp.class);
|
||||
} catch (JSONException e) {
|
||||
log.error("提现发起异常:{}", e.getMessage());
|
||||
baseResp = new BaseResp();
|
||||
baseResp.setStatus(10000);
|
||||
baseResp.setMsg(body);
|
||||
}
|
||||
return baseResp;
|
||||
}
|
||||
|
||||
public BaseResp queryExtractOrder(String outOrderNo, Long userId, boolean isUser, String amount) {
|
||||
@@ -278,28 +290,28 @@ public class WuyouPay {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
WuyouPay pay = new WuyouPay(null, null);
|
||||
|
||||
Map<String, Object> params = pay.getBaseParams();
|
||||
|
||||
params.put("out_trade_no", String.format("%s-%s:%s", "1111122223333", "26924", "us"));
|
||||
params.put("total", "0.1");
|
||||
params.put("bank_card", "6214831259609102");
|
||||
params.put("bank_account_name", "巩奕杰");
|
||||
params.put("bank_name", "招商银行");
|
||||
params.put("bank_branch", "1");
|
||||
params.put("province", "1");
|
||||
params.put("city", "1");
|
||||
params.put("notify_url", "https://test.baidu.com");
|
||||
|
||||
String sign = Encrypt.getParamsSign(params);
|
||||
params.put("sign", sign);
|
||||
|
||||
params.put("business_type", 0);
|
||||
params.put("business_attr", "unionpay");
|
||||
|
||||
String body = pay.request(Constants.EXTRACT_URL, params, "");
|
||||
BaseResp resp = JSONObject.parseObject(body, BaseResp.class);
|
||||
// WuyouPay pay = new WuyouPay(null, null);
|
||||
//
|
||||
// Map<String, Object> params = pay.getBaseParams();
|
||||
//
|
||||
// params.put("out_trade_no", String.format("%s-%s:%s", "1111122223333", "26924", "us"));
|
||||
// params.put("total", "0.1");
|
||||
// params.put("bank_card", "6214831259609102");
|
||||
// params.put("bank_account_name", "巩奕杰");
|
||||
// params.put("bank_name", "招商银行");
|
||||
// params.put("bank_branch", "1");
|
||||
// params.put("province", "1");
|
||||
// params.put("city", "1");
|
||||
// params.put("notify_url", "https://test.baidu.com");
|
||||
//
|
||||
// String sign = Encrypt.getParamsSign(params);
|
||||
// params.put("sign", sign);
|
||||
//
|
||||
// params.put("business_type", 0);
|
||||
// params.put("business_attr", "unionpay");
|
||||
//
|
||||
// String body = pay.request(Constants.EXTRACT_URL, params, "");
|
||||
BaseResp resp = JSONObject.parseObject("return JSONObject.parseObject(body, BaseResp.class);", BaseResp.class);
|
||||
System.out.println(resp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user