Althars123 2 年之前
父节点
当前提交
0dae6c7132

+ 1 - 1
nbjk-admin/src/main/java/com/miaxis/app/controller/vip/RecommendCodeController.java

@@ -46,7 +46,7 @@ public class RecommendCodeController extends BaseController{
         }
         //当前学员更新绑定推荐码
         UserInfo student = SecurityUtils.getLoginUser().getStudent();
-        student.setBindRecommendCode(recommendCode);
+       // student.setBindRecommendCode(recommendCode);
         userInfoService.updateById(student);
         return Response.success("验证成功");
     }

+ 22 - 22
nbjk-admin/src/main/java/com/miaxis/app/controller/wx/WxNotifyController.java

@@ -279,28 +279,28 @@ public class WxNotifyController {
             userInfo.setIsVip(isVip);
             userInfoService.updateById(userInfo);
             //充值普通会员 进行分佣
-            if (isVip == 2){
-                //根据订单查询推荐主播
-                UserInfo zhubo = userInfoService.getById(wxOrder.getReferralUserId());
-                //根据主播查询合伙人
-                UserInfo hehuoren = userInfoService.getOne(new QueryWrapper<UserInfo>().eq("union_id",zhubo.getParentUnionId()));
-                //根据合伙人查询合伙人以及主播的分佣
-                List<SysDictData> partnerConfigs = sysDictTypeService.selectDictDataByType("partner_config");
-                Optional<SysDictData> first = partnerConfigs.stream().filter(o -> hehuoren.getUnionId().equals(o.getDictLabel())).findFirst();
-                String[] partnerConfig = first.get().getDictValue().split(",");
-                Integer hehuorenPencents = Integer.valueOf(partnerConfig[1]);
-                Integer zhuboPencents =Integer.valueOf(partnerConfig[2]);
-                Integer pay = wxOrder.getTotal();
-                Integer hehuorenFencheng =pay*hehuorenPencents/100;
-                Integer zhuboFencheng =pay*zhuboPencents/100;
-                wxOrder.setCommissionPrice(zhuboFencheng);
-                zhubo.setProfitPrice(zhubo.getProfitPrice()+zhuboFencheng);
-                hehuoren.setProfitPrice(hehuoren.getProfitPrice()+hehuorenFencheng);
-                userInfoService.addProfitPrice(zhubo.getId(),zhuboFencheng);
-                userInfoService.addProfitPrice(hehuoren.getId(),hehuorenFencheng);
-
-
-            }
+//            if (isVip == 2){
+//                //根据订单查询推荐主播
+//                UserInfo zhubo = userInfoService.getById(wxOrder.getReferralUserId());
+//                //根据主播查询合伙人
+//               // UserInfo hehuoren = userInfoService.getOne(new QueryWrapper<UserInfo>().eq("union_id",zhubo.getParentUnionId()));
+//                //根据合伙人查询合伙人以及主播的分佣
+//                List<SysDictData> partnerConfigs = sysDictTypeService.selectDictDataByType("partner_config");
+//                Optional<SysDictData> first = partnerConfigs.stream().filter(o -> hehuoren.getUnionId().equals(o.getDictLabel())).findFirst();
+//                String[] partnerConfig = first.get().getDictValue().split(",");
+//                Integer hehuorenPencents = Integer.valueOf(partnerConfig[1]);
+//                Integer zhuboPencents =Integer.valueOf(partnerConfig[2]);
+//                Integer pay = wxOrder.getTotal();
+//                Integer hehuorenFencheng =pay*hehuorenPencents/100;
+//                Integer zhuboFencheng =pay*zhuboPencents/100;
+//                wxOrder.setCommissionPrice(zhuboFencheng);
+////                zhubo.setProfitPrice(zhubo.getProfitPrice()+zhuboFencheng);
+////                hehuoren.setProfitPrice(hehuoren.getProfitPrice()+hehuorenFencheng);
+//                userInfoService.addProfitPrice(zhubo.getId(),zhuboFencheng);
+//                userInfoService.addProfitPrice(hehuoren.getId(),hehuorenFencheng);
+//
+//
+//            }
             wxOrderService.updateById(wxOrder);
         }
         return outTradeNo;

+ 1 - 1
nbjk-admin/src/main/java/com/miaxis/gzh/controller/WxExtractBankController.java

@@ -42,7 +42,7 @@ public class WxExtractBankController extends BaseController {
     public ResponsePageInfo<WxExtractBank> list(){
         startPage();
         WxExtractBank wxExtractBank = new WxExtractBank();
-        wxExtractBank.setOpenid(SecurityUtils.getLoginUser().getStudent().getGzhOpenid());
+        //wxExtractBank.setOpenid(SecurityUtils.getLoginUser().getStudent().getGzhOpenid());
         List<WxExtractBank> list = wxExtractBankService.selectWxExtractBankList(wxExtractBank);
         return toResponsePageInfo(list);
     }

+ 1 - 1
nbjk-admin/src/main/java/com/miaxis/gzh/controller/WxExtractController.java

@@ -46,7 +46,7 @@ public class WxExtractController extends BaseController {
     })
     public ResponsePageInfo<WxExtract> list(){
         WxExtract wxExtract = new WxExtract();
-        wxExtract.setOpenid(SecurityUtils.getLoginUser().getStudent().getGzhOpenid());
+       // wxExtract.setOpenid(SecurityUtils.getLoginUser().getStudent().getGzhOpenid());
         startPage();
         List<WxExtract> list = wxExtractService.selectWxExtractList(wxExtract);
         return toResponsePageInfo(list);

+ 0 - 9
nbjk-framework/src/main/java/com/miaxis/framework/web/service/UserDetailsServiceImpl.java

@@ -75,7 +75,6 @@ public class UserDetailsServiceImpl implements UserDetailsService
                     UserInfo userInfo = new UserInfo();
                     userInfo.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
                     userInfo.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
-                    userInfo.setThirdPlatform(third);
                     userInfo.setAppOpenid(openid);
                     userInfo.setUnionId(identification);
                     userInfo.setIsVip(0);
@@ -85,7 +84,6 @@ public class UserDetailsServiceImpl implements UserDetailsService
                     UserInfo userInfo = userInfoGetByUnionId != null ? userInfoGetByUnionId:userInfoGetByOpenId;
                     userInfo.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
                     userInfo.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
-                    userInfo.setThirdPlatform(third);
                     userInfo.setUnionId(identification);
                     userService.updateStudent(userInfo);
                     return createLoginUser(userService.getStudentByUnionId(identification));
@@ -102,8 +100,6 @@ public class UserDetailsServiceImpl implements UserDetailsService
                     UserInfo userInfo = new UserInfo();
                     userInfo.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
                     userInfo.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
-                    userInfo.setThirdPlatform("weixin");
-                    userInfo.setGzhOpenid(gzhOpenid);
                     userInfo.setUnionId(identification);
                     userInfo.setIsVip(0);
                     userService.saveUserInfo(userInfo);
@@ -111,7 +107,6 @@ public class UserDetailsServiceImpl implements UserDetailsService
                 }else {
                     userInfoGetByUnionId.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
                     userInfoGetByUnionId.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
-                    userInfoGetByUnionId.setThirdPlatform("weixin");
                     userService.updateStudent(userInfoGetByUnionId);
                     return createLoginUser(userService.getStudentByUnionId(identification));
                 }
@@ -126,7 +121,6 @@ public class UserDetailsServiceImpl implements UserDetailsService
                     UserInfo userInfo = new UserInfo();
                     userInfo.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
                     userInfo.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
-                    userInfo.setThirdPlatform(third);
                     userInfo.setAppOpenid(openid);
                     userInfo.setUnionId(identification);
                     userInfo.setIsVip(0);
@@ -151,15 +145,12 @@ public class UserDetailsServiceImpl implements UserDetailsService
                 UserInfo userInfo = new UserInfo();
 //                userInfo.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
 //                userInfo.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
-                userInfo.setThirdPlatform(third);
-                userInfo.setXcxOpenid(openid);
                 userInfo.setUnionId(identification);
                 userInfo.setIsVip(0);
                 userService.saveUserInfo(userInfo);
                 return createLoginUser(userService.getStudentByUnionId(identification));
             }else {
                 UserInfo userInfo = userInfoGetByUnionId;
-                userInfo.setXcxOpenid(openid);
 //                userInfo.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
 //                userInfo.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
                 userService.updateStudent(userInfo);

+ 27 - 27
nbjk-service/src/main/java/com/miaxis/wx/service/impl/WxGzhServiceImpl.java

@@ -143,22 +143,22 @@ public class WxGzhServiceImpl implements IWxGzhService {
                     }
                 }
                 //推荐码生成
-                if (parentUnionId!= null){
-                    String unionId = userInfoJson.getString("unionid");
-                    UserInfo user = userService.getStudentByUnionid(unionId);
-                    //如果推荐码为空,则生成一个
-                    if (user.getRecommendCode()== null){
-                        String code = null ;
-                        do {
-                            code  = getRandomString(4);
-                        }while (isRepeat(code));
-                        user.setRecommendCode(code);
-                        user.setParentUnionId(parentUnionId);
-                        userInfoService.updateById(user);
-                    }
-                    messageCustomSend(fromUserName,this.getGzhToken(),"您的推荐码是:↓↓↓");
-                    return MessageUtil.initText(fromUserName, toUserName, user.getRecommendCode());
-                }
+//                if (parentUnionId!= null){
+//                    String unionId = userInfoJson.getString("unionid");
+//                    UserInfo user = userService.getStudentByUnionid(unionId);
+//                    //如果推荐码为空,则生成一个
+//                    if (user.getRecommendCode()== null){
+//                        String code = null ;
+//                        do {
+//                            code  = getRandomString(4);
+//                        }while (isRepeat(code));
+//                        user.setRecommendCode(code);
+//                        user.setParentUnionId(parentUnionId);
+//                        userInfoService.updateById(user);
+//                    }
+//                    messageCustomSend(fromUserName,this.getGzhToken(),"您的推荐码是:↓↓↓");
+//                    return MessageUtil.initText(fromUserName, toUserName, user.getRecommendCode());
+//                }
 
 
             } else if (MessageUtil.MESSAGE_IMAGE.equals(msgType)) { // 图片消息
@@ -174,17 +174,17 @@ public class WxGzhServiceImpl implements IWxGzhService {
 
                     String unionId = userInfoJson.getString("unionid");
                     //如果是新用户,则保存用户
-                    UserInfo user = userService.getStudentByUnionid(unionId);
-                    if (user == null){
-                        UserInfo userInfo = new UserInfo();
-                        userInfo.setGzhOpenid(fromUserName);
-                        userInfo.setUnionId(unionId);
-                        userInfo.setThirdPlatform("weixin");
-                        userInfoService.save(userInfo);
-                    }else if(user.getGzhOpenid()==null){
-                        user.setGzhOpenid(fromUserName);
-                        userInfoService.updateById(user);
-                    }
+//                    UserInfo user = userService.getStudentByUnionid(unionId);
+//                    if (user == null){
+//                        UserInfo userInfo = new UserInfo();
+//                        userInfo.setGzhOpenid(fromUserName);
+//                        userInfo.setUnionId(unionId);
+//                        userInfo.setThirdPlatform("weixin");
+//                        userInfoService.save(userInfo);
+//                    }else if(user.getGzhOpenid()==null){
+//                        user.setGzhOpenid(fromUserName);
+//                        userInfoService.updateById(user);
+//                    }
 
                     //存在Ticket为扫码关注
                     if (org.apache.commons.lang3.StringUtils.isNotEmpty(jsonObjectData.getStr("Ticket"))){

+ 25 - 25
nbjk-service/src/main/java/com/miaxis/wx/service/impl/WxOrderServiceImpl.java

@@ -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");