|
@@ -86,19 +86,19 @@ public class WxOrderServiceImpl extends ServiceImpl<WxOrderMapper, WxOrder> impl
|
|
|
//成为高级vip
|
|
|
wxOrder.setOrderDataJson("1");
|
|
|
}else if ("nbjk_vip".equals(sysDictData.getDictLabel())){
|
|
|
- if (userInfo.getBindRecommendCode()!=null){
|
|
|
- price = sysDictData.getDictValue().split(",")[0];
|
|
|
- //根据绑定的推荐码获取推荐主播
|
|
|
- QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<UserInfo>();
|
|
|
- queryWrapper.eq("recommend_code",userInfo.getBindRecommendCode());
|
|
|
- UserInfo zhubo = userInfoService.getOne(queryWrapper);
|
|
|
- wxOrder.setReferralUserId(zhubo.getId());
|
|
|
- wxOrder.setGoodsName(sysDictData.getRemark());
|
|
|
- //成为普通vip
|
|
|
- wxOrder.setOrderDataJson("2");
|
|
|
- }else{
|
|
|
- throw new CustomException("该学员未绑定推荐码,不能使用此套餐");
|
|
|
- }
|
|
|
+// if (userInfo.getBindRecommendCode()!=null){
|
|
|
+// price = sysDictData.getDictValue().split(",")[0];
|
|
|
+// //根据绑定的推荐码获取推荐主播
|
|
|
+// QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<UserInfo>();
|
|
|
+// queryWrapper.eq("recommend_code",userInfo.getBindRecommendCode());
|
|
|
+// UserInfo zhubo = userInfoService.getOne(queryWrapper);
|
|
|
+// wxOrder.setReferralUserId(zhubo.getId());
|
|
|
+// wxOrder.setGoodsName(sysDictData.getRemark());
|
|
|
+// //成为普通vip
|
|
|
+// wxOrder.setOrderDataJson("2");
|
|
|
+// }else{
|
|
|
+// throw new CustomException("该学员未绑定推荐码,不能使用此套餐");
|
|
|
+// }
|
|
|
}else if ("nbjk_up_sp_vip".equals(sysDictData.getDictLabel())){
|
|
|
if (userInfo.getIsVip()==2){
|
|
|
price = sysDictData.getDictValue().split(",")[0];
|
|
@@ -144,16 +144,16 @@ public class WxOrderServiceImpl extends ServiceImpl<WxOrderMapper, WxOrder> impl
|
|
|
public String wxwithdrawal(Integer amount) throws Exception {
|
|
|
UserInfo student = SecurityUtils.getLoginUser().getStudent();
|
|
|
UserInfo dbUserInfo = userInfoService.getById(student.getId());
|
|
|
- if (dbUserInfo.getProfitPrice() < amount){
|
|
|
- throw new CustomException("提现金额不能大于可提现金额");
|
|
|
- }
|
|
|
+// if (dbUserInfo.getProfitPrice() < amount){
|
|
|
+// throw new CustomException("提现金额不能大于可提现金额");
|
|
|
+// }
|
|
|
|
|
|
Map<String, String> sortMap = new TreeMap<String, String>();
|
|
|
sortMap.put("mch_appid",appid);
|
|
|
sortMap.put("mchid",wxpayConfig.getMerchantId());
|
|
|
sortMap.put("nonce_str", RandomStringUtils.randomAlphanumeric(32));
|
|
|
sortMap.put("partner_trade_no",getOrderCode(null));
|
|
|
- sortMap.put("openid",student.getGzhOpenid());
|
|
|
+ //sortMap.put("openid",student.getGzhOpenid());
|
|
|
sortMap.put("check_name","NO_CHECK");
|
|
|
sortMap.put("amount",String.valueOf(amount));
|
|
|
sortMap.put("desc","用户提现");
|
|
@@ -172,14 +172,14 @@ public class WxOrderServiceImpl extends ServiceImpl<WxOrderMapper, WxOrder> impl
|
|
|
}
|
|
|
//新增提现记录
|
|
|
WxExtract wxExtract = new WxExtract();
|
|
|
- wxExtract.setOpenid(student.getGzhOpenid());
|
|
|
+ //wxExtract.setOpenid(student.getGzhOpenid());
|
|
|
wxExtract.setExtractPrice(amount);
|
|
|
wxExtract.setPartnerTradeNo(resMap.get("partner_trade_no"));
|
|
|
wxExtract.setStatus("1");
|
|
|
wxExtractService.save(wxExtract);
|
|
|
|
|
|
//更新余额
|
|
|
- dbUserInfo.setProfitPrice(dbUserInfo.getProfitPrice()-amount);
|
|
|
+// dbUserInfo.setProfitPrice(dbUserInfo.getProfitPrice()-amount);
|
|
|
userInfoService.updateById(dbUserInfo);
|
|
|
|
|
|
return resMap.get("return_msg");
|
|
@@ -190,9 +190,9 @@ public class WxOrderServiceImpl extends ServiceImpl<WxOrderMapper, WxOrder> impl
|
|
|
public String wxwithbankdrawal(WxExtractBankDTO dto) throws Exception {
|
|
|
UserInfo student = SecurityUtils.getLoginUser().getStudent();
|
|
|
UserInfo dbUserInfo = userInfoService.getById(student.getId());
|
|
|
- if (dbUserInfo.getProfitPrice() < dto.getAmount()){
|
|
|
- throw new CustomException("提现金额不能大于可提现金额");
|
|
|
- }
|
|
|
+// if (dbUserInfo.getProfitPrice() < dto.getAmount()){
|
|
|
+// throw new CustomException("提现金额不能大于可提现金额");
|
|
|
+// }
|
|
|
|
|
|
Map<String, String> sortMap = new TreeMap<String, String>();
|
|
|
sortMap.put("mch_id",wxpayConfig.getMerchantId());
|
|
@@ -225,7 +225,7 @@ public class WxOrderServiceImpl extends ServiceImpl<WxOrderMapper, WxOrder> impl
|
|
|
}
|
|
|
//新增提现记录
|
|
|
WxExtract wxExtract = new WxExtract();
|
|
|
- wxExtract.setOpenid(student.getGzhOpenid());
|
|
|
+ //wxExtract.setOpenid(student.getGzhOpenid());
|
|
|
wxExtract.setExtractPrice(dto.getAmount());
|
|
|
wxExtract.setPartnerTradeNo(resMap.get("partner_trade_no"));
|
|
|
wxExtract.setStatus("1");
|
|
@@ -238,13 +238,13 @@ public class WxOrderServiceImpl extends ServiceImpl<WxOrderMapper, WxOrder> impl
|
|
|
wxExtractBank.setBankCode(dto.getBankCode());
|
|
|
wxExtractBank.setEncBankNo(dto.getEncBankNo());
|
|
|
wxExtractBank.setEncTrueName(dto.getEncTrueName());
|
|
|
- wxExtractBank.setOpenid(SecurityUtils.getLoginUser().getStudent().getGzhOpenid());
|
|
|
+ //wxExtractBank.setOpenid(SecurityUtils.getLoginUser().getStudent().getGzhOpenid());
|
|
|
wxExtractBankService.save(wxExtractBank);
|
|
|
}
|
|
|
|
|
|
|
|
|
//更新余额
|
|
|
- dbUserInfo.setProfitPrice(dbUserInfo.getProfitPrice()-dto.getAmount());
|
|
|
+ //dbUserInfo.setProfitPrice(dbUserInfo.getProfitPrice()-dto.getAmount());
|
|
|
userInfoService.updateById(dbUserInfo);
|
|
|
|
|
|
return resMap.get("return_msg");
|