feat: 体现增加每次体现次数上限
This commit is contained in:
parent
ce9d92508e
commit
650b3bc4ea
|
|
@ -1,8 +1,8 @@
|
|||
package com.sqx.modules.callback;
|
||||
|
||||
import com.sqx.modules.callback.dao.UniAdCallBackDTO;
|
||||
import com.sqx.modules.callback.service.UniAdCallbackRecordService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import com.sqx.modules.callback.dao.UniAdCallBackDTO;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ public class DiscSpinningServiceImpl extends ServiceImpl<DiscSpinningDao, DiscSp
|
|||
if (one2 == null || money <= Double.parseDouble(one2.getValue())) {
|
||||
String outOrderNo = AliPayOrderUtil.createOrderId();
|
||||
cashOut.setOrderNumber(outOrderNo);
|
||||
BaseResp baseResp = WuyouPay.extractOrder(outOrderNo, cashOut.getMoney(), cashOut.getZhifubao(), cashOut.getZhifubaoName());
|
||||
BaseResp baseResp = WuyouPay.extractOrder(userInfo.getUserId(), outOrderNo, cashOut.getMoney(), cashOut.getZhifubao(), cashOut.getZhifubaoName());
|
||||
if (baseResp.getStatus() != null && (baseResp.getStatus().equals(2) || baseResp.getStatus().equals(10000))) {
|
||||
UserMoneyDetails userMoneyDetails = new UserMoneyDetails(
|
||||
userInfo.getUserId(), null, null, title, 4, 2, 1,
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class CashOutTask implements ITask {
|
|||
for (CashOut cashOut : cashOuts) {
|
||||
String outOrderNo = AliPayOrderUtil.createOrderId();
|
||||
cashOut.setOrderNumber(outOrderNo);
|
||||
BaseResp baseResp = WuyouPay.extractOrder(outOrderNo, cashOut.getMoney(), cashOut.getZhifubao(), cashOut.getZhifubaoName());
|
||||
BaseResp baseResp = WuyouPay.extractOrder(cashOut.getUserId(), outOrderNo, cashOut.getMoney(), cashOut.getZhifubao(), cashOut.getZhifubaoName());
|
||||
if (baseResp.getStatus() != null && baseResp.getStatus().equals(2)) {
|
||||
cashOut.setState(1);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -495,6 +495,7 @@ public class CashController {
|
|||
@ApiImplicitParam(name = "money", value = "提现金额", dataTypeClass = Double.class, paramType = "param"),
|
||||
@ApiImplicitParam(name = "msg", value = "验证码", dataTypeClass = String.class, paramType = "param"),
|
||||
})
|
||||
|
||||
@Debounce(interval = 3000, value = "#userId")
|
||||
public Result withdraw(Long userId, Double money, String msg) {
|
||||
if (StringUtils.isBlank(msg)) {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public interface CashOutDao extends BaseMapper<CashOut> {
|
|||
List<CashOut> selectYesterday();
|
||||
|
||||
Double selectCashOutSum(@Param("userId") Long userId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
Integer selectTodayCashCount(@Param("userId") Long userId, @Param("state") Integer state);
|
||||
Double selectSysUserCashOutSum(@Param("sysUserId") Long sysUserId, @Param("time") String time);
|
||||
|
||||
Double sumMoney(@Param("time") String time, @Param("flag") Integer flag);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.sqx.modules.pay.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,17 @@
|
|||
package com.sqx.modules.pay.wuyou;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.common.dao.CommonInfoDao;
|
||||
import com.sqx.modules.common.entity.CommonInfo;
|
||||
import com.sqx.modules.common.service.CommonInfoService;
|
||||
import com.sqx.modules.pay.dao.CashOutDao;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
@ -12,14 +19,24 @@ import java.util.Map;
|
|||
/**
|
||||
* @author GYJ
|
||||
*/
|
||||
@Component
|
||||
public class WuyouPay {
|
||||
|
||||
static String NOTIFY_URL = "";
|
||||
static String EXTRACT_NOTIFY_URL = "";
|
||||
static String H5_BASE_URL = "";
|
||||
|
||||
private static CashOutDao cashOutDao;
|
||||
private static CommonInfoService commonInfoService;
|
||||
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(WuyouPay.class);
|
||||
|
||||
public WuyouPay(CashOutDao cashOutDao, CommonInfoService commonInfoService) {
|
||||
WuyouPay.cashOutDao = cashOutDao;
|
||||
WuyouPay.commonInfoService = commonInfoService;
|
||||
}
|
||||
|
||||
public static void setNotifyUrl(String notifyUrl) {
|
||||
NOTIFY_URL = notifyUrl;
|
||||
}
|
||||
|
|
@ -71,7 +88,25 @@ public class WuyouPay {
|
|||
* @param userName 支付宝名称
|
||||
* @return
|
||||
*/
|
||||
public static BaseResp extractOrder(String outOrderNo, String amount, String account, String userName) {
|
||||
public static BaseResp extractOrder(long userId, String outOrderNo, String amount, String account, String userName) {
|
||||
|
||||
// 查询当日体现次数
|
||||
Integer successCashCount = cashOutDao.selectTodayCashCount(userId, 1);
|
||||
CommonInfo cashLimit = commonInfoService.findOne(922);
|
||||
if (cashLimit == null || StrUtil.isBlank(cashLimit.getValue())) {
|
||||
BaseResp baseResp = new BaseResp();
|
||||
baseResp.setStatus(0);
|
||||
baseResp.setErrorMsg("提现必要参数未配置,请联系管理员");
|
||||
return baseResp;
|
||||
}
|
||||
|
||||
if (successCashCount >= Integer.parseInt(cashLimit.getValue())) {
|
||||
BaseResp baseResp = new BaseResp();
|
||||
baseResp.setStatus(0);
|
||||
baseResp.setErrorMsg("每日提现次数限制" + cashLimit.getValue() + "次, 您已超过上限");
|
||||
return baseResp;
|
||||
}
|
||||
|
||||
Map<String, Object> params = getBaseParams();
|
||||
|
||||
params.put("out_trade_no", outOrderNo);
|
||||
|
|
@ -131,7 +166,7 @@ public class WuyouPay {
|
|||
payOrder("20221118123456794", "0.1", "Mozilla/5.0", "1230-98688", "h5");
|
||||
// queryOrder("20221118123456791", "0.1", "Mozilla/5.0");
|
||||
|
||||
extractOrder("20221118123456793", "1", "1157756119@qq.com", "巩奕杰");
|
||||
// extractOrder("20221118123456793", "1", "1157756119@qq.com", "巩奕杰");
|
||||
// queryExtractOrder("20221118123456793", "1");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,6 +164,10 @@
|
|||
order by c.create_at desc
|
||||
</select>
|
||||
|
||||
<select id="selectTodayCashCount" resultType="java.lang.Integer">
|
||||
select count(*) from cash_out where create_at > CURDATE() and user_id=#{userId} and state=#{state};
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateMayMoney">
|
||||
update user_money set
|
||||
|
|
@ -177,4 +181,4 @@
|
|||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue