Commit 3780314a authored by hezhen's avatar hezhen

123

parent 48983eaf
...@@ -92,6 +92,15 @@ public class MyWalletCath implements Serializable { ...@@ -92,6 +92,15 @@ public class MyWalletCath implements Serializable {
@ApiModelProperty(value = "订单状态:0-未提现,待审核,1-已审核") @ApiModelProperty(value = "订单状态:0-未提现,待审核,1-已审核")
private Integer stauts; private Integer stauts;
/**
* 失败原因
*/
@Column(name = "reason")
@ApiModelProperty(value = "失败原因")
private String reason;
/** /**
* 提现日期 * 提现日期
*/ */
......
...@@ -311,16 +311,17 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> { ...@@ -311,16 +311,17 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
//提现审核 //提现审核
public ObjectRestResponse verifyCath(Integer cathId,String cono){ public ObjectRestResponse verifyCath(Integer cathId,String cono,String reason,Integer status){
if (StringUtils.isBlank(cono)||cathId==null||cathId==0){ if ((status==1&&StringUtils.isBlank(cono))||(status==2&&StringUtils.isBlank(reason))||cathId==null||cathId==0){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "参数不能为空"); return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "参数不能为空");
} }
MyWalletCath cath=myWalletCathBiz.selectById(cathId); MyWalletCath cath=myWalletCathBiz.selectById(cathId);
if (cath==null){ if (cath==null){
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "提现记录不存在"); return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "提现记录不存在");
} }
cath.setStauts(1); cath.setStauts(status);
cath.setCono(cono); cath.setCono(cono);
cath.setReason(reason);
cath.setFinishTime(System.currentTimeMillis()); cath.setFinishTime(System.currentTimeMillis());
int num=myWalletCathBiz.updateSelectiveByIdRe(cath); int num=myWalletCathBiz.updateSelectiveByIdRe(cath);
if (num>0){ if (num>0){
...@@ -329,9 +330,11 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> { ...@@ -329,9 +330,11 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
wallet.setUserId(userId); wallet.setUserId(userId);
wallet=selectOne(wallet); wallet=selectOne(wallet);
if (wallet!=null){ if (wallet!=null){
//当时钱包的余额
BigDecimal balance=cath.getBalance(); BigDecimal balance=cath.getBalance();
BigDecimal realAmount=cath.getRealAmount(); BigDecimal realAmount=cath.getRealAmount();
BigDecimal commission=cath.getCommission(); BigDecimal commission=cath.getCommission();
if (status==1){
MyWalletDetail detail=new MyWalletDetail(); MyWalletDetail detail=new MyWalletDetail();
detail.setUserId(userId); detail.setUserId(userId);
detail.setItype(1); detail.setItype(1);
...@@ -346,6 +349,15 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> { ...@@ -346,6 +349,15 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
detail.setBalance(balance); detail.setBalance(balance);
detail.setAmount(commission); detail.setAmount(commission);
myWalletDetailBiz.insertSelective(detail); 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(); return ObjectRestResponse.succ();
......
...@@ -37,9 +37,11 @@ public class WalletCathAdminController { ...@@ -37,9 +37,11 @@ public class WalletCathAdminController {
@ApiOperation("提现审核") @ApiOperation("提现审核")
public ObjectRestResponse verifyCath( public ObjectRestResponse verifyCath(
@RequestParam(value = "cathId",defaultValue = "0") Integer cathId, @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 { try {
return myWalletBiz.verifyCath(cathId,cono); return myWalletBiz.verifyCath(cathId,cono,reason,status);
}catch (Exception e) { }catch (Exception e) {
throw new BaseException(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