Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/DolphinEnglish
| | |
| | | // 初始化条件构造器 |
| | | QueryWrapper<TGoods> wrapper = new QueryWrapper<>(); |
| | | wrapper = keywords != null && !"".equals(keywords.trim()) ? wrapper.like("name", keywords) : wrapper; |
| | | |
| | | // 类型匹配 todo |
| | | if (goodQuery.getType() != null && !goodQuery.getType().isEmpty()) { |
| | | for (String s : goodQuery.getType()) { |
| | |
| | | } |
| | | } |
| | | wrapper.eq("isDelete", 0); |
| | | wrapper.orderByAsc("sort"); |
| | | return R.ok(goodsService.page(new PageInfo<>(goodQuery.getPageNumber(), goodQuery.getPageSize()), wrapper)); |
| | | } |
| | | |
| | |
| | | from t_order o |
| | | left join t_goods g on o.goodsId = g.id |
| | | where o.userId = #{userid} |
| | | order by o.createTime |
| | | </select> |
| | | </mapper> |
| | |
| | | wrapper.isNotNull("error"); |
| | | List<TStory> list1 = storyService.list(wrapper); |
| | | for (TStory tStory : list1) { |
| | | if (tStory.getError()!=null && (!tStory.getError().isEmpty())){ |
| | | if (tStory.getError() != null && (!tStory.getError().isEmpty())) { |
| | | tStories.add(tStory); |
| | | } |
| | | } |
| | |
| | | int sum = gameRecordList.stream().map(TGameRecord::getUseTime).mapToInt(Integer::intValue).sum(); |
| | | Integer totalStudy = studyRecord.getTotalStudy(); |
| | | studyRecord.setTotalStudy(Math.round((float) (totalStudy + sum) / 3600)); |
| | | studyRecord = studyService.studySchedule(studyRecord,week); |
| | | studyRecord = studyService.studySchedule(studyRecord, week); |
| | | } |
| | | return R.ok(studyRecord); |
| | | } |
| | |
| | | TUserStudy studyRecord = userStudyService.lambdaQuery().eq(TUserStudy::getUserId, userId) |
| | | .eq(TUserStudy::getDisabled, 0).one(); |
| | | // 总时长还需计算上游戏测试成绩时长 |
| | | List<TGameRecord> gameRecordList = gameRecordService.lambdaQuery().eq(TGameRecord::getUserId, userId) |
| | | .eq(TGameRecord::getDisabled, 0).list(); |
| | | List<TGameRecord> gameRecordList = gameRecordService.lambdaQuery() |
| | | .eq(TGameRecord::getUserId, userId) |
| | | .eq(TGameRecord::getDisabled, 0) |
| | | .orderByDesc(TGameRecord::getCreateTime) |
| | | .list(); |
| | | if (null != studyRecord) { |
| | | // 学习时长格式转换 |
| | | Integer todayStudy = studyRecord.getTodayStudy(); |
| | |
| | | studyRecord.setTotalStudy(Math.round((float) (totalStudy + sum) / 3600)); |
| | | return R.ok(new StudyRecordResultVO(studyRecord, gameRecordList)); |
| | | } |
| | | |
| | | @PostMapping("/recordManagement/{id}") |
| | | @ApiOperation(value = "游戏测试成绩", tags = {"管理后台-查看用户详情"}) |
| | | public R<StudyRecordResultVO> recordManagement(@PathVariable("id")Integer id) { |
| | | public R<StudyRecordResultVO> recordManagement(@PathVariable("id") Integer id) { |
| | | // 学习记录 |
| | | TUserStudy studyRecord = userStudyService.lambdaQuery().eq(TUserStudy::getUserId, id) |
| | | .eq(TUserStudy::getDisabled, 0).one(); |
| | |
| | | package com.ruoyi.study.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.web.domain.BaseModel; |
| | |
| | | * 错误语音 要么没有 要么两个逗号隔开 |
| | | */ |
| | | private String error; |
| | | |
| | | /** |
| | | * 排序规则 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Integer sort; |
| | | |
| | | |
| | | public Integer getId() { |
| | |
| | | this.error = error; |
| | | } |
| | | |
| | | public Integer getSort() { |
| | | return sort; |
| | | } |
| | | |
| | | public void setSort(Integer sort) { |
| | | this.sort = sort; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "TStory{" + |
| | | ", id=" + id + |
| | | ", name=" + name + |
| | | ", english=" + english + |
| | | ", type=" + type + |
| | | ", state=" + state + |
| | | ", img=" + img + |
| | | ", correct=" + correct + |
| | | ", error=" + error + |
| | | "}"; |
| | | ", id=" + id + |
| | | ", name=" + name + |
| | | ", english=" + english + |
| | | ", type=" + type + |
| | | ", state=" + state + |
| | | ", img=" + img + |
| | | ", correct=" + correct + |
| | | ", error=" + error + |
| | | "}"; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.study.vo.SubjectVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | List<TStory> storyList = new ArrayList<>(); |
| | | List<String> list; |
| | | // 分类 |
| | | String sort; |
| | | if (0 == type) { |
| | | list = Arrays.stream(storyListen.getLookStory().split(",")).collect(Collectors.toList()); |
| | | sort = storyListen.getLookSort(); |
| | | } else { |
| | | list = Arrays.stream(storyListen.getStory().split(",")).collect(Collectors.toList()); |
| | | sort = storyListen.getSort(); |
| | | } |
| | | List<String> collect = Arrays.stream(sort.split(",")).collect(Collectors.toList()); |
| | | // 获取图片及语音集合 |
| | | for (String s : list) { |
| | | for (int i = 0; i < list.size(); i++) { |
| | | String s = list.get(i); |
| | | TStory story = this.lambdaQuery().eq(TStory::getId, s).eq(TStory::getDisabled, 0).one(); |
| | | String sortIndex = collect.get(i); |
| | | story.setSort(Integer.parseInt(sortIndex)); |
| | | storyList.add(story); |
| | | } |
| | | // 根据配置的顺序进行排序,使用 Comparator 对象进行排序 |
| | | storyList.sort((story1, story2) -> { |
| | | // 首先比较 sort 字段 |
| | | int sortComparison = Integer.compare(story1.getSort(), story2.getSort()); |
| | | if (sortComparison != 0) { |
| | | // sort 不相等,按 sort 升序排序 |
| | | return sortComparison; |
| | | } else { |
| | | // 如果 sort 相等,则比较 createTime 字段 |
| | | return story1.getCreateTime().compareTo(story2.getCreateTime()); |
| | | } |
| | | }); |
| | | return storyList; |
| | | } |
| | | } |