无关风月
2024-11-15 353cf91d3679e68d9b8c07652e4f7791d606dbd4
代码提交
8个文件已修改
92 ■■■■■ 已修改文件
xinquan-modules/xinquan-course/src/main/java/com/xinquan/course/controller/client/ClientCourseController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xinquan-modules/xinquan-meditation/src/main/java/com/xinquan/meditation/controller/client/ClientMeditationController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xinquan-modules/xinquan-meditation/src/main/java/com/xinquan/meditation/service/impl/MeditationServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xinquan-modules/xinquan-order/src/main/java/com/xinquan/order/controller/client/ClientOrderController.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xinquan-modules/xinquan-order/src/main/java/com/xinquan/order/utils/JuHeFuUtil.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserTreeController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/service/impl/AppUserServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xinquan-modules/xinquan-course/src/main/java/com/xinquan/course/controller/client/ClientCourseController.java
@@ -725,6 +725,7 @@
        // 查询推荐课程
        List<Course> list = courseService.lambdaQuery().eq(Course::getCateId, byId.getCateId())
                .eq(Course::getCourseType,1)
                .eq(Course::getListingStatus,1)
                .ne(Course::getId,id)
                .eq(Course::getRecommend, 1).list();
        List<Course> courses = new ArrayList<>();
@@ -793,6 +794,8 @@
        // 查询推荐课程
        List<Course> list = courseService.lambdaQuery().eq(Course::getCateId, byId.getCateId())
                .eq(Course::getCourseType,1)
                .eq(Course::getListingStatus,1)
                .ne(Course::getId,id)
                .eq(Course::getRecommend, 1).list();
        List<Course> courses = new ArrayList<>();
        // 随机获取两个课程
@@ -948,6 +951,7 @@
        Long userId = loginUser.getUserid();
        Course byId = courseService.getById(courseId);
        List<Course> list = courseService.lambdaQuery().eq(Course::getCateId, byId.getCateId())
                .eq(Course::getListingStatus,1)
                .ne(Course::getId,courseId)
                .eq(Course::getCourseType, 1).list();
        for (Course course : list) {
xinquan-modules/xinquan-meditation/src/main/java/com/xinquan/meditation/controller/client/ClientMeditationController.java
@@ -123,6 +123,7 @@
        Long userId = loginUser.getUserid();
        Meditation byId = meditationService.getById(meditationId);
        List<Meditation> list = meditationService.lambdaQuery().eq(Meditation::getCateId, byId.getCateId())
                .eq(Meditation::getListingStatus,1)
                .ne(Meditation::getId,meditationId)
                .list();
xinquan-modules/xinquan-meditation/src/main/java/com/xinquan/meditation/service/impl/MeditationServiceImpl.java
@@ -147,6 +147,7 @@
        AppUser appUser = getCurrentUser();
        LambdaQueryWrapper<Meditation> meditationLambdaQueryWrapper = new LambdaQueryWrapper<>();
        meditationLambdaQueryWrapper.eq(Meditation::getCateId, cateId);
        meditationLambdaQueryWrapper.eq(Meditation::getListingStatus, 1);
        if (appUser!=null){
            if (appUser.getSanskritFlag() == 2){
                meditationLambdaQueryWrapper.eq(Meditation::getSanskrit, 2);
xinquan-modules/xinquan-order/src/main/java/com/xinquan/order/controller/client/ClientOrderController.java
@@ -620,12 +620,12 @@
                        case 1:
                            Meditation data1 = remoteMeditationService.getMeditationById(one.getBusinessId()).getData();
                            appUserWalletRecord.setChangeType(2);
                            reason = "购买【"+data1.getMeditationTitle()+"】";
                            reason = "购买疗愈【"+data1.getMeditationTitle()+"】";
                            break;
                        case 2:
                            Course data2 = remoteCourseService.getCourseById(one.getBusinessId()).getData();
                            reason = "购买【"+data2.getCourseTitle()+"】";
                            reason = "购买课程【"+data2.getCourseTitle()+"】";
                            appUserWalletRecord.setChangeType(2);
                            // 增加用户与课程的关系表
                            if (one.getGiveUserId()!=null){
@@ -637,7 +637,7 @@
                            break;
                        case 3:
                            // 会员
                            reason = "购买【"+one.getBuyContent()+"】";
                            reason = "购买会员【"+one.getBuyContent()+"】";
                            appUserWalletRecord.setChangeType(2);
                            break;
                        case 4:
@@ -817,12 +817,12 @@
                        case 1:
                            Meditation data1 = remoteMeditationService.getMeditationById(one.getBusinessId()).getData();
                            appUserWalletRecord.setChangeType(2);
                            reason = "购买【"+data1.getMeditationTitle()+"】";
                            reason = "购买疗愈【"+data1.getMeditationTitle()+"】";
                            break;
                        case 2:
                            Course data2 = remoteCourseService.getCourseById(one.getBusinessId()).getData();
                            reason = "购买【"+data2.getCourseTitle()+"】";
                            reason = "购买课程【"+data2.getCourseTitle()+"】";
                            appUserWalletRecord.setChangeType(2);
                            // 增加用户与课程的关系表
                            if (one.getGiveUserId()!=null){
@@ -834,7 +834,7 @@
                            break;
                        case 3:
                            // 会员
                            reason = "购买【"+one.getBuyContent()+"】";
                            reason = "购买会员【"+one.getBuyContent()+"】";
                            appUserWalletRecord.setChangeType(2);
                            break;
                        case 4:
xinquan-modules/xinquan-order/src/main/java/com/xinquan/order/utils/JuHeFuUtil.java
@@ -35,6 +35,7 @@
    private static Logger logger = LoggerFactory.getLogger(JuHeFuUtil.class);
    // 商户RSA私钥 TODO
    private static final String MERCHANT_PRIVATE_KEY = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMQPsMj4OYgjHFWS8wDIQOoMeAx9Ad1wKfIks7Oz5Kw8EVnmZ9o1ZY14goMMr1vJo/XxLLYXDvwj+EhV4MqT6ji2QDVqlhA4f6WFFmKOsvxgNnu0zAysfDpVpYihWC5uOf4ece9fWVci8DYFeXcawYGNB6GrJuo186sqMYwkE90/AgMBAAECgYAnMvfmhnKCPHraxSGeo2sPIGUUIh4wVs+cIShoomvy36OcdMuIvipKqbB2YR/iWyNT9d85nMybLtniJIFoH0CxshmLH/yg31vYhyLfVyih1RVFBRYuDMnIjvmNTBgXM/9vaAwkzonIQnoF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w2EoG/gFSim57U/OApLab22ljAkBoL0xzWZWOkHfaYHTcB0P9KJTgKzfsUQXYrHdZzlTfRMdrsYb4/K13FeJ6XVQFfZ5ke+sZ/TysK+yOHFAgSL0BAkAXLdYuYIOLfPwffCNyXgERRJVd245A1uO+iu/mZSaP+5H3ROu24eYF9Jmze2X/48eSSojochwKgz4UX+LOy1K1AkBQycFQjRWCjPi8biMhdLzzX47CNFkwigVp0At6VcZmb86cS9ohoTHCbeG0+hlX7p9eNMiFKLVnnCdjY6j1xqtv";
    // 平台RSA公钥 TODO
    private static final String PLAT_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOKBBFXirWIJth+SNJCY4mhbATbL60sKV66bRixHMVz8vpBqONio9X6A+Pm9LNutBe+hLpI1BMmFJk3Mb1/QEcklWptRGgHqIrBxR4b19qc/2/pSxyqlpaifYJFZhOg2+OcQ/fqpAmhNXN5uc1pcYvbvWTam0j+6+nBNQeAAku5QIDAQAB";
    // 应用的app_id TODO
@@ -63,11 +64,20 @@
    // 微信小程序id TODO
    private static final String WX_APP_ID = "";
    public static void main(String[] args) throws Exception {
//        createPaymentCode("CZ1928183312398", 1, "0.01",
//                "充值", "充值",
//                "127.0.0.1", "openId",
////                "https://v7ro848ar5jx.ngrok.xiaomiqiu123.top/order/client/order/order/base/callback")
//        "https://xq.xqzhihui.com/api/order/client/order/order/base/callback");
//        String orderNo = OrderUtil.getOrderNoForPrefix("User");
        createUser("test129837182731");
//          balancePay("12345678912", "0.01", "http://www.baidu.com");
    }
    /**
     * 创建用户
     *
     * @param memberId 用户id
     * @param memberP  用户信息
     * @return boolean
     * @throws Exception
     */
@@ -80,36 +90,40 @@
        memberP.put("tel_no","19983174515");
        memberP.put("card_id","6228480469852935177");
        JSONObject data = new JSONObject();
        data.put("app_id", APP_ID);
//        data.put("app_id", APP_ID);
        data.put("app_id", "app_e7301b75-19f1-40e5-96ac-0fee847d4da0");
        data.put("member_id", memberId);
        data.put("member_type", "01");
        String jsonString = JSON.toJSONString(JSONObject.parseObject(data.toString(), TreeMap.class));
        String jsonString = JSON.toJSONString(memberP);
        jsonString = JSON.toJSONString(JSONObject.parseObject(jsonString, TreeMap.class));
        data.put("member_p", jsonString);
        System.err.println(data);
        JSONObject body = new JSONObject();
        body.put("merId", MER_ID);
//        body.put("merId", MER_ID);
        body.put("merId", "1120241105365033");
        body.put("sign", sign(JSONObject.toJSONString(data)));
//        body.put("reqCipher",
//                EncryptUtils.aes256ECBPkcs7PaddingEncrypt(JSONObject.toJSONString(data), AES_KEY));
        body.put("reqCipher",
                EncryptUtils.aes256ECBPkcs7PaddingEncrypt(JSONObject.toJSONString(data), AES_KEY));
                EncryptUtils.aes256ECBPkcs7PaddingEncrypt(JSONObject.toJSONString(data), "6d548eb01bad44bbbb4a23743e733103"));
        body.put("reqTime", DateUtils.dateTimeNow("yyyyMMddHHmmsssss"));
        System.err.println(body);
        String result = sendPost(BASE_URL + CREATE_USER_INTERFACE, body);
//        String result = sendPost(BASE_URL + CREATE_USER_INTERFACE, body);
        String result = sendPost("https://payapi.juhefu.com/" + CREATE_USER_INTERFACE, body);
        JSONObject resJsonObject = JSONObject.parseObject(result);
        System.err.println(resJsonObject);
        return false;
    }
    public static void main(String[] args) throws Exception {
        createPaymentCode("CZ19281833123", 1, "0.01",
                "充值", "充值",
                "127.0.0.1", "openId",
//                "https://v7ro848ar5jx.ngrok.xiaomiqiu123.top/order/client/order/order/base/callback")
        "https://xq.xqzhihui.com/api/order/client/order/order/base/callback");
//        String orderNo = OrderUtil.getOrderNoForPrefix("User");
//        createUser("usera12937812893718297391");
//    public static void main(String[] args) throws Exception {
////        createPaymentCode("CZ1928183312398", 1, "0.01",
////                "充值", "充值",
////                "127.0.0.1", "openId",
//////                "https://v7ro848ar5jx.ngrok.xiaomiqiu123.top/order/client/order/order/base/callback")
////        "https://xq.xqzhihui.com/api/order/client/order/order/base/callback");
////        String orderNo = OrderUtil.getOrderNoForPrefix("User");
//        createUser("testuser12937812893718297391");
////          balancePay("12345678912", "0.01", "http://www.baidu.com");
    }
//    }
    public static JSONObject balancePay(String orderNo,  String payAmt, String notifyUrl) throws Exception {
        JSONObject data = new JSONObject();
@@ -395,6 +409,7 @@
        data = JSON.toJSONString(JSONObject.parseObject(data, TreeMap.class));
        // Base64 --> Key
        try {
//            byte[] bytes = Base64.getDecoder().decode(MERCHANT_PRIVATE_KEY);
            byte[] bytes = Base64.getDecoder().decode(MERCHANT_PRIVATE_KEY);
            PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(bytes);
            KeyFactory keyFactory;
xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserController.java
@@ -457,6 +457,7 @@
        SysUser data = remoteUserService.getSysUserById(userid + "").getData();
        byId.setFreezingOperator(data.getNickName()+"("+data.getUserName()+")");
        appUserService.updateById(byId);
        // 将被冻结的用户token清除
        return R.ok();
    }
    @GetMapping("/detail")
xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserTreeController.java
@@ -32,6 +32,7 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.temporal.ChronoUnit;
@@ -424,6 +425,10 @@
        Long userId = loginUser.getUserid();
        // 给用户加10能量
        AppUser byId = appUserService.getById(userId);
        if (byId.getSignTime()!=null
                && byId.getSignTime().toLocalDate().equals(LocalDate.now())){
        return R.fail("您今日已签到");
        }
        byId.setEnergyValue(byId.getEnergyValue()+10);
        byId.setSignTime(LocalDateTime.now());
        byId.setTotalEnergyValue(byId.getTotalEnergyValue()+10);
xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/service/impl/AppUserServiceImpl.java
@@ -635,25 +635,14 @@
            List<AppUserQuestion> appUserQuestionList = BeanUtils.copyList(
                    dto.getUserAnswerOneDTOList(), AppUserQuestion.class);
            // 查询用户已填写的答案
            List<AppUserQuestion> baseAppUserQuestionList = appUserQuestionService.lambdaQuery()
                    .eq(AppUserQuestion::getAppUserId, appUser.getUserId())
                    .list();
            if (CollUtils.isNotEmpty(baseAppUserQuestionList)) {
            // 删除之前答案
            appUserQuestionService.lambdaUpdate().eq(AppUserQuestion::getAppUserId,userId).remove();
                // 根据类型更新答案
                for (AppUserQuestion appUserQuestion : appUserQuestionList) {
                    Optional<AppUserQuestion> baseAppUserQuestionOptional = baseAppUserQuestionList.stream()
                            .filter(baseAppUserQuestion -> baseAppUserQuestion.getType()
                                    .equals(appUserQuestion.getType())).findFirst();
                    baseAppUserQuestionOptional.ifPresent(
                            userQuestion -> appUserQuestion.setId(userQuestion.getId()));
                    appUserQuestion.setAppUserId(userId);
                }
            }
            for (AppUserQuestion appUserQuestion : appUserQuestionList) {
                appUserQuestion.setAppUserId(userId);
            }
            appUserQuestionService.saveOrUpdateBatch(appUserQuestionList);
            appUserQuestionService.saveBatch(appUserQuestionList);
            // 筛选答案为是和偶尔有的问题,为用户设置对应的标签
            List<AppUserQuestion> appUserQuestionYesList = appUserQuestionList.stream()
                    .filter(appUserQuestion -> appUserQuestion.getAnswer().equals("1")