|
|
|
|
@@ -19,6 +19,7 @@ import com.sqx.common.utils.Result;
|
|
|
|
|
import com.sqx.modules.app.dao.MsgDao;
|
|
|
|
|
import com.sqx.modules.app.dao.UserDao;
|
|
|
|
|
import com.sqx.modules.app.entity.*;
|
|
|
|
|
import com.sqx.modules.app.mapper.TbWithdrawBlacklistMapper;
|
|
|
|
|
import com.sqx.modules.app.service.UserInfoService;
|
|
|
|
|
import com.sqx.modules.app.service.UserMoneyDetailsService;
|
|
|
|
|
import com.sqx.modules.app.service.UserMoneyService;
|
|
|
|
|
@@ -57,6 +58,7 @@ import weixin.popular.bean.message.templatemessage.TemplateMessageItem;
|
|
|
|
|
import weixin.popular.bean.message.templatemessage.TemplateMessageResult;
|
|
|
|
|
import weixin.popular.support.TokenManager;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.websocket.SendResult;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
@@ -109,6 +111,8 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private WuyouPay wuyouPay;
|
|
|
|
|
@Resource
|
|
|
|
|
private TbWithdrawBlacklistMapper tbWithdrawBlacklistMapper;
|
|
|
|
|
|
|
|
|
|
public CashOutServiceImpl(UserInfoService userInfoService) {
|
|
|
|
|
this.userInfoService = userInfoService;
|
|
|
|
|
@@ -498,7 +502,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|
|
|
|
|
|
|
|
|
String alipayAccount;
|
|
|
|
|
String alipayName;
|
|
|
|
|
|
|
|
|
|
Set<String> withdrawCheckNameSet = new HashSet<>();
|
|
|
|
|
if (isSys) {
|
|
|
|
|
SysUserEntity sysUserEntity = sysUserService.getById(userId);
|
|
|
|
|
Msg msg1 = msgDao.findByPhoneAndCode(sysUserEntity.getMobile(), msg);
|
|
|
|
|
@@ -510,6 +514,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|
|
|
|
}
|
|
|
|
|
alipayAccount = sysUserEntity.getZhiFuBao();
|
|
|
|
|
alipayName = sysUserEntity.getZhiFuBaoName();
|
|
|
|
|
withdrawCheckNameSet.add(alipayName);
|
|
|
|
|
} else {
|
|
|
|
|
UserEntity userInfo = userService.queryByUserId(userId);
|
|
|
|
|
if (userInfo.getStatus().equals(0)) {
|
|
|
|
|
@@ -529,6 +534,9 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|
|
|
|
}
|
|
|
|
|
alipayAccount = userInfo.getZhiFuBao();
|
|
|
|
|
alipayName = userInfo.getZhiFuBaoName();
|
|
|
|
|
String certName = userDetailInfo.getCertName();
|
|
|
|
|
withdrawCheckNameSet.add(alipayName);
|
|
|
|
|
withdrawCheckNameSet.add(certName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 最低提现金额
|
|
|
|
|
@@ -612,21 +620,29 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|
|
|
|
if (userMoney.getAmount().doubleValue() < money) {
|
|
|
|
|
return Result.success("可提现余额不足!");
|
|
|
|
|
}
|
|
|
|
|
if (wuyouPay.checkCanCash(userId, WithdrawTypeEnum.MANUAL, new BigDecimal(money.toString()))) {
|
|
|
|
|
cashOut.setStatus(4);
|
|
|
|
|
BaseResp baseResp = wuyouPay.extractOrder(outOrderNo, cashOut.getUserId(), true, cashOut.getMoney(), cashOut.getZhifubao(), cashOut.getZhifubaoName());
|
|
|
|
|
if (baseResp.getStatus() != null && (baseResp.getStatus().equals(2) || baseResp.getStatus().equals(10000))) {
|
|
|
|
|
userMoneyDetails.setContent("成功提现:" + money);
|
|
|
|
|
cashOut.setState(1);
|
|
|
|
|
cashOut.setOutAt(DateUtil.date().toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (baseResp.getErrorMsg() != null) {
|
|
|
|
|
return Result.error(baseResp.getErrorMsg());
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// 禁止该姓名的用户提现
|
|
|
|
|
Integer count = tbWithdrawBlacklistMapper.selectCount(Wrappers.<TbWithdrawBlacklist>lambdaQuery().in(TbWithdrawBlacklist::getRealName, withdrawCheckNameSet));
|
|
|
|
|
if(count > 0){
|
|
|
|
|
userMoneyDetails.setContent("成功提现:" + money);
|
|
|
|
|
cashOut.setState(3);
|
|
|
|
|
cashOut.setRelationId("提现黑名单用户,请谨慎审核!");
|
|
|
|
|
}else{
|
|
|
|
|
if (wuyouPay.checkCanCash(userId, WithdrawTypeEnum.MANUAL, new BigDecimal(money.toString()))) {
|
|
|
|
|
cashOut.setStatus(4);
|
|
|
|
|
BaseResp baseResp = wuyouPay.extractOrder(outOrderNo, cashOut.getUserId(), true, cashOut.getMoney(), cashOut.getZhifubao(), cashOut.getZhifubaoName());
|
|
|
|
|
if (baseResp.getStatus() != null && (baseResp.getStatus().equals(2) || baseResp.getStatus().equals(10000))) {
|
|
|
|
|
userMoneyDetails.setContent("成功提现:" + money);
|
|
|
|
|
cashOut.setState(1);
|
|
|
|
|
cashOut.setOutAt(DateUtil.date().toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (baseResp.getErrorMsg() != null) {
|
|
|
|
|
return Result.error(baseResp.getErrorMsg());
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
userMoneyDetails.setContent("成功提现:" + money);
|
|
|
|
|
cashOut.setState(3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
userMoneyDetailsService.save(userMoneyDetails);
|
|
|
|
|
baseMapper.insert(cashOut);
|
|
|
|
|
|