无关风月
2024-07-03 f138375f15c072d10335c20ecec9b35f1da78ee4
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java
@@ -914,6 +914,7 @@
            case 2:
                // 支付宝退款
                Map<String, String> stringStringMap1 = payMoneyUtil.aliRefund(transactionId, byId.getMoney().toString());
                System.err.println("支付宝退款数据"+ stringStringMap1);
                if (null == stringStringMap1) {
                    return R.fail("取消退款异常");
                }
@@ -928,7 +929,6 @@
                Calendar calendar = Calendar.getInstance();
                calendar.setTime(new Date());
                calendar.add(Calendar.MONTH, -byId.getCount());
                Date dateAfterOneMonth = calendar.getTime();
                Integer userId = byId.getUserId();
                TUser byId1 = userService.getById(userId);
                // 判断用户是不是第一次充值
@@ -1040,14 +1040,16 @@
        studyRecord.setMonthStudy(Math.round((float) monthStudy / 3600));
        // 总时长还需计算上游戏测试成绩时长
        List<TGameRecord> gameRecordList = gameRecordService.lambdaQuery().eq(TGameRecord::getUserId, dto.getId())
                .eq(TGameRecord::getDisabled, 0).list();
                .eq(TGameRecord::getDisabled, 0)
                .orderByDesc(TGameRecord::getCreateTime)
                .list();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd HH:mm");
        for (TGameRecord tGameRecord : gameRecordList) {
            tGameRecord.setTime(simpleDateFormat.format(tGameRecord.getCreateTime()));
        }
        int sum = gameRecordList.stream().map(TGameRecord::getUseTime).mapToInt(Integer::intValue).sum();
        Integer totalStudy = studyRecord.getTotalStudy();
        studyRecord.setTotalStudy(Math.round((float) (totalStudy + sum) / 3600));
        studyRecord.setTotalStudy(Math.round((float) (totalStudy) / 3600));
        res.setCurrent(studyRecord.getWeek()+"");
        // 剩余周目
        List<TStudy> studyList = studyService.lambdaQuery().eq(TStudy::getDisabled, 0)