|
@ -22,6 +22,7 @@ import org.springframework.stereotype.Service; |
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.HashMap; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
@Slf4j |
|
|
@Slf4j |
|
@ -92,8 +93,8 @@ public class AppletMoneyLogServiceImpl implements AppletMoneyLogService { |
|
|
} |
|
|
} |
|
|
if(commonMoneyLog.getMoney().compareTo(balance)>0){ |
|
|
if(commonMoneyLog.getMoney().compareTo(balance)>0){ |
|
|
//提现金额大于推广佣金 |
|
|
//提现金额大于推广佣金 |
|
|
log.info("推广佣金不足,当前推广佣金:{}", balance); |
|
|
|
|
|
return Result.error("推广佣金不足"); |
|
|
|
|
|
|
|
|
log.info("用户余额不足,当前用户余额:{}", balance); |
|
|
|
|
|
return Result.error("用户余额不足"); |
|
|
} |
|
|
} |
|
|
//提现金额要为整数 |
|
|
//提现金额要为整数 |
|
|
if(commonMoneyLog.getMoney().scale()>0){ |
|
|
if(commonMoneyLog.getMoney().scale()>0){ |
|
@ -195,6 +196,7 @@ public class AppletMoneyLogServiceImpl implements AppletMoneyLogService { |
|
|
commonMoneyLog.setState(0); // 待处理状态 |
|
|
commonMoneyLog.setState(0); // 待处理状态 |
|
|
commonMoneyLog.setIsBrokerage("N"); // 不是佣金 |
|
|
commonMoneyLog.setIsBrokerage("N"); // 不是佣金 |
|
|
commonMoneyLog.setOldMoney(member.getMoney()); // 记录原始余额 |
|
|
commonMoneyLog.setOldMoney(member.getMoney()); // 记录原始余额 |
|
|
|
|
|
commonMoneyLog.setPackageInfo(response.packageInfo);//参数 |
|
|
|
|
|
|
|
|
// 更新用户余额 |
|
|
// 更新用户余额 |
|
|
BigDecimal newMoney = member.getMoney().subtract(commonMoneyLog.getMoney()); |
|
|
BigDecimal newMoney = member.getMoney().subtract(commonMoneyLog.getMoney()); |
|
@ -211,9 +213,13 @@ public class AppletMoneyLogServiceImpl implements AppletMoneyLogService { |
|
|
hanHaiMemberService.updateById(member); |
|
|
hanHaiMemberService.updateById(member); |
|
|
commonMoneyLogService.save(commonMoneyLog); |
|
|
commonMoneyLogService.save(commonMoneyLog); |
|
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> m = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
m.put("response", response); |
|
|
|
|
|
m.put("id", commonMoneyLog.getId()); |
|
|
|
|
|
|
|
|
//5、返回信息 |
|
|
//5、返回信息 |
|
|
return Result.OK(massage, response); |
|
|
|
|
|
|
|
|
return Result.OK(massage, m); |
|
|
}catch (Exception e){ |
|
|
}catch (Exception e){ |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
log.info("提现失败:" + e.getMessage()); |
|
|
log.info("提现失败:" + e.getMessage()); |
|
@ -273,4 +279,12 @@ public class AppletMoneyLogServiceImpl implements AppletMoneyLogService { |
|
|
|
|
|
|
|
|
return Result.OK(pageList); |
|
|
return Result.OK(pageList); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Result<?> withdrawSUccess(String token, String id) { |
|
|
|
|
|
CommonMoneyLog log = commonMoneyLogService.getById(id); |
|
|
|
|
|
log.setState(1); |
|
|
|
|
|
commonMoneyLogService.updateById(log); |
|
|
|
|
|
return Result.OK(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |