Commit 3780314a authored by hezhen's avatar hezhen

123

parent 48983eaf
......@@ -92,6 +92,15 @@ public class MyWalletCath implements Serializable {
@ApiModelProperty(value = "订单状态:0-未提现,待审核,1-已审核")
private Integer stauts;
/**
* 失败原因
*/
@Column(name = "reason")
@ApiModelProperty(value = "失败原因")
private String reason;
/**
* 提现日期
*/
......
......@@ -304,23 +304,24 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
myWallet.setUserId(userId);
myWallet.setBalance(balnece);
myWallet.setWithdrawals(withdrawals);
myWallet.setVersion(sumDto.getVersion());
myWallet.setVersion(sumDto.getVersion());
mapper.updMyWater(myWallet);
return ObjectRestResponse.succ(walletCath.getId());
}
//提现审核
public ObjectRestResponse verifyCath(Integer cathId,String cono){
if (StringUtils.isBlank(cono)||cathId==null||cathId==0){
public ObjectRestResponse verifyCath(Integer cathId,String cono,String reason,Integer status){
if ((status==1&&StringUtils.isBlank(cono))||(status==2&&StringUtils.isBlank(reason))||cathId==null||cathId==0){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "参数不能为空");
}
MyWalletCath cath=myWalletCathBiz.selectById(cathId);
if (cath==null){
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "提现记录不存在");
}
cath.setStauts(1);
cath.setStauts(status);
cath.setCono(cono);
cath.setReason(reason);
cath.setFinishTime(System.currentTimeMillis());
int num=myWalletCathBiz.updateSelectiveByIdRe(cath);
if (num>0){
......@@ -329,23 +330,34 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
wallet.setUserId(userId);
wallet=selectOne(wallet);
if (wallet!=null){
//当时钱包的余额
BigDecimal balance=cath.getBalance();
BigDecimal realAmount=cath.getRealAmount();
BigDecimal commission=cath.getCommission();
MyWalletDetail detail=new MyWalletDetail();
detail.setUserId(userId);
detail.setItype(1);
detail.setCono(cathId);
detail.setBalance(balance);
detail.setAmount(realAmount);
detail.setSource(10);
myWalletDetailBiz.insertSelective(detail);
detail.setId(null);
detail.setSource(13);
balance=balance.subtract(realAmount).setScale(2, RoundingMode.HALF_UP);
detail.setBalance(balance);
detail.setAmount(commission);
myWalletDetailBiz.insertSelective(detail);
if (status==1){
MyWalletDetail detail=new MyWalletDetail();
detail.setUserId(userId);
detail.setItype(1);
detail.setCono(cathId);
detail.setBalance(balance);
detail.setAmount(realAmount);
detail.setSource(10);
myWalletDetailBiz.insertSelective(detail);
detail.setId(null);
detail.setSource(13);
balance=balance.subtract(realAmount).setScale(2, RoundingMode.HALF_UP);
detail.setBalance(balance);
detail.setAmount(commission);
myWalletDetailBiz.insertSelective(detail);
}else {
BigDecimal amount=realAmount.add(commission);
balance=wallet.getBalance().add(amount);
BigDecimal withdrawals=wallet.getWithdrawals().subtract(amount);
wallet.setBalance(balance);
wallet.setWithdrawals(withdrawals);
mapper.updMyWater(wallet);
}
}
}
return ObjectRestResponse.succ();
......
......@@ -37,9 +37,11 @@ public class WalletCathAdminController {
@ApiOperation("提现审核")
public ObjectRestResponse verifyCath(
@RequestParam(value = "cathId",defaultValue = "0") Integer cathId,
@RequestParam(value = "cono",defaultValue = "") String cono){
@RequestParam(value = "cono",defaultValue = "") String cono,
@RequestParam(value = "reason",defaultValue = "") String reason,
@RequestParam(value = "status",defaultValue = "1") Integer status){
try {
return myWalletBiz.verifyCath(cathId,cono);
return myWalletBiz.verifyCath(cathId,cono,reason,status);
}catch (Exception e) {
throw new BaseException(e);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment