diff --git a/src/main/java/com/subsidy/common/RedisPrefixConstant.java b/src/main/java/com/subsidy/common/RedisPrefixConstant.java index b8d5ea3..103795b 100644 --- a/src/main/java/com/subsidy/common/RedisPrefixConstant.java +++ b/src/main/java/com/subsidy/common/RedisPrefixConstant.java @@ -23,7 +23,7 @@ public class RedisPrefixConstant { public static final String SUBSIDY_TELEPHONE_PREFIX = "subsidySmsCode:"; /** - * subsidySettings_companyId:ClassHourDictDO 公司操作设置 + * subsidySettings:companyId:ClassHourDictDO 公司操作设置 */ public static final String SUBSIDY_SETTINGS_PREFIX = "subsidySettings:"; diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java index 61f4e2a..a2f5857 100644 --- a/src/main/java/com/subsidy/controller/AdministerController.java +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -139,7 +139,6 @@ public class AdministerController { @PostMapping("getMemberPapers") @ApiOperation("获取某个成员某个卷子的做题历史 memberId paperId") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO getMemberPapers(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){ return ResponseData.generateCreatedResponse(0,administerService.getMemberPapers(exerciseDoneResultDO)); } diff --git a/src/main/java/com/subsidy/controller/ClassHourDictController.java b/src/main/java/com/subsidy/controller/ClassHourDictController.java index 178a7a2..9cfe407 100644 --- a/src/main/java/com/subsidy/controller/ClassHourDictController.java +++ b/src/main/java/com/subsidy/controller/ClassHourDictController.java @@ -40,8 +40,8 @@ public class ClassHourDictController { } @PostMapping("updateSetting") - @ApiOperation("修改当天设置时长 id 主键 classHour status interrupt interruptStatus repeatTime repeatStatus") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("修改当天设置时长 companyId 主键 classHour status interrupt interruptStatus repeatTime repeatStatus") + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO updateSetting(@RequestBody ClassHourDictDO classHourDictDO){ return ResponseData.generateCreatedResponse(0,classHourDictService.updateSetting(classHourDictDO)); } diff --git a/src/main/java/com/subsidy/controller/FieldDictController.java b/src/main/java/com/subsidy/controller/FieldDictController.java index 729e7d3..889199a 100644 --- a/src/main/java/com/subsidy/controller/FieldDictController.java +++ b/src/main/java/com/subsidy/controller/FieldDictController.java @@ -1,6 +1,15 @@ package com.subsidy.controller; +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.dto.field.QueryFieldsDTO; +import com.subsidy.model.FieldDictDO; +import com.subsidy.service.FieldDictService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -16,7 +25,34 @@ import io.swagger.annotations.Api; */ @RestController @Api(tags = "行业字典表") -@RequestMapping("/field-dict-do") +@RequestMapping("/fieldDict") public class FieldDictController { + @Autowired + private FieldDictService fieldDictService; + + @PostMapping("addField") + @ApiOperation("添加行业 fieldName 行业名称") + public ResponseVO addField(@RequestBody FieldDictDO fieldDictDO){ + return ResponseData.generateCreatedResponse(0,fieldDictService.addField(fieldDictDO)); + } + + @PostMapping("updateField") + @ApiOperation("修改行业 id fieldName 行业名称") + public ResponseVO updateField(@RequestBody FieldDictDO fieldDictDO){ + return ResponseData.generateCreatedResponse(0,fieldDictService.updateField(fieldDictDO)); + } + + @PostMapping("deleteField") + @ApiOperation("删除行业 id") + public ResponseVO deleteField(@RequestBody FieldDictDO fieldDictDO){ + return ResponseData.generateCreatedResponse(0,fieldDictService.deleteField(fieldDictDO)); + } + + @PostMapping("queryFields") + @ApiOperation("查询行业 pageSize pageNum fieldName") + public ResponseVO queryFields(@RequestBody QueryFieldsDTO queryFieldsDTO){ + return ResponseData.generateCreatedResponse(0,fieldDictService.queryFields(queryFieldsDTO)); + } + } diff --git a/src/main/java/com/subsidy/controller/SignInRecordController.java b/src/main/java/com/subsidy/controller/SignInRecordController.java index c7a3662..26e42c2 100644 --- a/src/main/java/com/subsidy/controller/SignInRecordController.java +++ b/src/main/java/com/subsidy/controller/SignInRecordController.java @@ -47,7 +47,7 @@ public class SignInRecordController { @PostMapping("classStudyHistory") @ApiOperation("校区学习记录 id 校区id className courseName pageSize pageNum") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO classSignInfo(@RequestBody ClassSignInfoDTO classSignInfoDTO) { return ResponseData.generateCreatedResponse(0, signInRecordService.classSignInfo(classSignInfoDTO)); } diff --git a/src/main/java/com/subsidy/dto/field/QueryFieldsDTO.java b/src/main/java/com/subsidy/dto/field/QueryFieldsDTO.java new file mode 100644 index 0000000..8f27ad4 --- /dev/null +++ b/src/main/java/com/subsidy/dto/field/QueryFieldsDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.field; + +import lombok.Data; + +@Data +public class QueryFieldsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String fieldName; + +} diff --git a/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java b/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java index b273887..01e6463 100644 --- a/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java +++ b/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java @@ -46,7 +46,7 @@ public interface ExerciseDoneResultMapper extends BaseMapper getMaxScorePaper(Long paperId,Long memberId); /** * 测试成绩 最高成绩 测试测试 总评价 diff --git a/src/main/java/com/subsidy/mapper/FieldDictMapper.java b/src/main/java/com/subsidy/mapper/FieldDictMapper.java index 356bccf..ebc9271 100644 --- a/src/main/java/com/subsidy/mapper/FieldDictMapper.java +++ b/src/main/java/com/subsidy/mapper/FieldDictMapper.java @@ -1,5 +1,7 @@ package com.subsidy.mapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.field.QueryFieldsDTO; import com.subsidy.model.FieldDictDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.springframework.stereotype.Repository; @@ -12,7 +14,9 @@ import org.springframework.stereotype.Repository; * @author DengMin * @since 2022-01-20 */ - @Repository +@Repository public interface FieldDictMapper extends BaseMapper { + IPage queryFields(IPage ipage, String fieldName); + } diff --git a/src/main/java/com/subsidy/service/FieldDictService.java b/src/main/java/com/subsidy/service/FieldDictService.java index 7771935..eff4c10 100644 --- a/src/main/java/com/subsidy/service/FieldDictService.java +++ b/src/main/java/com/subsidy/service/FieldDictService.java @@ -1,7 +1,10 @@ package com.subsidy.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.field.QueryFieldsDTO; import com.subsidy.model.FieldDictDO; import com.baomidou.mybatisplus.extension.service.IService; +import com.tencentcloudapi.vpc.v20170312.models.Ip6Rule; /** *

@@ -13,4 +16,12 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface FieldDictService extends IService { + String addField(FieldDictDO fieldDictDO); + + String updateField(FieldDictDO fieldDictDO); + + String deleteField(FieldDictDO fieldDictDO); + + IPage queryFields(QueryFieldsDTO queryFieldsDTO); + } diff --git a/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java index 504acef..a36748c 100644 --- a/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java @@ -11,6 +11,7 @@ import com.subsidy.model.VodPlayHistoryDO; import com.subsidy.service.ClassHourDictService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; +import com.subsidy.util.MyBeanUtils; import com.subsidy.util.RedisUtil; import com.subsidy.vo.hour.PollingGetVO; import org.springframework.beans.BeanUtils; @@ -21,6 +22,7 @@ import org.springframework.stereotype.Service; import java.time.LocalDate; import java.util.List; +import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; @@ -46,15 +48,16 @@ public class ClassHourDictServiceImpl extends ServiceImpl implements FieldDictService { + + public String addField(FieldDictDO fieldDictDO) { + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(FieldDictDO::getFieldName, fieldDictDO.getFieldName())); + + if (count > 0) { + throw new HttpException(11001); + } + this.baseMapper.insert(fieldDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateField(FieldDictDO fieldDictDO) { + + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(FieldDictDO::getFieldName, fieldDictDO.getFieldName()) + .ne(FieldDictDO::getId, fieldDictDO.getId())); + + if (count > 0) { + throw new HttpException(11001); + } + this.baseMapper.updateById(fieldDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public String deleteField(FieldDictDO fieldDictDO){ + this.baseMapper.deleteById(fieldDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public IPage queryFields(QueryFieldsDTO queryFieldsDTO){ + Page pager = new Page(queryFieldsDTO.getPageNum(), queryFieldsDTO.getPageSize()); + return this.baseMapper.queryFields(pager,queryFieldsDTO.getFieldName()); + } + + } diff --git a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java index e9360d6..fde6eb6 100644 --- a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java @@ -50,6 +50,7 @@ import com.subsidy.vo.member.GetAllVO; import com.subsidy.vo.member.GetStudyInfoVO; import com.subsidy.vo.member.MemberStudyPageVO; import com.subsidy.vo.member.MemberVO; +import com.subsidy.vo.member.MemberVodVO; import com.subsidy.vo.member.MyCoursesVO; import com.subsidy.vo.member.StudyPageVO; import com.subsidy.vo.paper.QueryPapersVO; @@ -231,7 +232,7 @@ public class MemberServiceImpl extends ServiceImpl imple public UserRoleVO login(VerifyCodeDTO verifyCodeDTO) { UserRoleVO userRoleVO = new UserRoleVO(); - //TODO 先从redis里拿 ??? + //先从redis里拿 还得从数据库先查公司。。还是直接查人快 MemberDO memberDO = this.baseMapper.selectOne(new QueryWrapper() .lambda() .eq(MemberDO::getTelephone, verifyCodeDTO.getTelephone())); @@ -316,6 +317,7 @@ public class MemberServiceImpl extends ServiceImpl imple if (memberDO.getPassword().equals(passwordLoginDTO.getPassword()) && 1 == memberDO.getFirstLogin() && !"冻结".equals(memberDO.getStatus())) { MemberVO memberVO = new MemberVO(); BeanUtils.copyProperties(memberDO, memberVO); + memberVO.setCompanyName(companyDictDO.getCompanyName()); OprMemDictDO oprMemDictDO = new OprMemDictDO(); oprMemDictDO.setUserId(memberDO.getId()); oprMemDictDO.setOprType("登录"); @@ -432,7 +434,19 @@ public class MemberServiceImpl extends ServiceImpl imple for (CourseContentDO courseContentDO : courseContentDOS) { ContentVodVO contentVodVO = new ContentVodVO(); contentVodVO.setContent(courseContentDO.getContent()); - contentVodVO.setMemberVodVOS(courseContentMapper.contentVodProcess(courseContentDO.getId(), contentVodDTO.getMemberId())); + + List memberVodVOS = courseContentMapper.contentVodProcess(courseContentDO.getId(), contentVodDTO.getMemberId()); + + int playCount = 0; + for (MemberVodVO memberVodVO : memberVodVOS){ + if (100 == memberVodVO.getPercent()){ + playCount++; + } + } + + contentVodVO.setPlayVods(playCount); + contentVodVO.setMemberVodVOS(memberVodVOS); + contentVodVO.setTotalVods(memberVodVOS.size()); contentVodVOS.add(contentVodVO); } contentVodNewVO.setContentVodVOS(contentVodVOS); @@ -479,32 +493,26 @@ public class MemberServiceImpl extends ServiceImpl imple //查看该班级下的测试卷子(有效卷子) ClassDictDO classDictDO = classDictMapper.selectById(contentMemberDTO.getClassId()); List queryPapersVOS = paperDictMapper.queryPapers(contentMemberDTO.getCourseId(), null, 1); - ExecutorService executorService = Executors.newCachedThreadPool(); for (QueryPapersVO queryPapersVO : queryPapersVOS) { - executorService.execute(() -> getCourseTestTask(queryPapersVO, contentMemberDTO.getMemberId(), classDictDO)); + //多少人已完成 + Integer cnt = paperDictMapper.completeCount(queryPapersVO.getId()); + queryPapersVO.setCompleteCnt(cnt); + //自己成绩 + List exerciseDoneResultDOS = exerciseDoneResultMapper.getMaxScorePaper(queryPapersVO.getId(), contentMemberDTO.getMemberId()); + + if (exerciseDoneResultDOS.size()>0) { + queryPapersVO.setRightCounts(exerciseDoneResultDOS.get(0).getRightCounts()); + queryPapersVO.setTotalCount(exerciseDoneResultDOS.get(0).getTotalCounts()); + queryPapersVO.setResult(exerciseDoneResultDOS.get(0).getResult()); + } else { + queryPapersVO.setResult("待完成"); + } + //截止时间 + queryPapersVO.setEndDate(classDictDO.getEndDate()); } - executorService.shutdown(); return queryPapersVOS; } - public void getCourseTestTask(QueryPapersVO queryPapersVO, Long memberId, ClassDictDO classDictDO) { - //多少人已完成 - Integer cnt = paperDictMapper.completeCount(queryPapersVO.getId()); - queryPapersVO.setCompleteCnt(cnt); - //自己成绩 - ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.getMaxScorePaper(queryPapersVO.getId(), memberId); - - if (null != exerciseDoneResultDO) { - queryPapersVO.setRightCounts(exerciseDoneResultDO.getRightCounts()); - queryPapersVO.setTotalCount(exerciseDoneResultDO.getTotalCounts()); - queryPapersVO.setResult(exerciseDoneResultDO.getResult()); - } else { - queryPapersVO.setResult("待完成"); - } - //截止时间 - queryPapersVO.setEndDate(classDictDO.getEndDate()); - } - public List getPaperDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO) { return exerciseDoneResultMapper.selectList(new QueryWrapper() .lambda() diff --git a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java index 10b4ffd..3c6a1cb 100644 --- a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java @@ -20,6 +20,7 @@ import com.subsidy.service.SignInRecordService; import com.subsidy.util.ConstantUtils; import com.subsidy.util.DateFormatUtil; import com.subsidy.util.MathUtil; +import com.subsidy.util.MyBeanUtils; import com.subsidy.util.RedisUtil; import com.subsidy.vo.member.GetMemberSignInfoVO; import com.subsidy.vo.sign.ClassSignInfoVO; @@ -87,24 +88,19 @@ public class SignInRecordServiceImpl extends ServiceImpl classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(), classSignInfoDTO.getCompanyId()); List classSignInfoVOS = classSignInfoVOIPage.getRecords(); - final ExecutorService newCachedThreadPool = Executors.newCachedThreadPool(); - for (ClassSignInfoVO classSignInfoVO : classSignInfoVOS) { - newCachedThreadPool.execute(()->classSignInfoTask(classSignInfoVO)); + ClassSignInfoVO classSignInfoVO1 = vodPlayHistoryMapper.classStudyHistory(classSignInfoVO.getClassId()); + String[] nullParams = MyBeanUtils.getNullPropertyNames(classSignInfoVO1); + BeanUtils.copyProperties(classSignInfoVO1,classSignInfoVO,nullParams); + + //平均签到数 向下取整 + long signCount = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + "*:classId:" + classSignInfoVO.getClassId() + ":*").stream().count(); + classSignInfoVO.setAvgSignCount(MathUtil.intDivCeil(signCount, classSignInfoVO1.getMemberCount())); } - newCachedThreadPool.shutdown(); classSignInfoVOIPage.setRecords(classSignInfoVOS); return classSignInfoVOIPage; } - public void classSignInfoTask(ClassSignInfoVO classSignInfoVO){ - ClassSignInfoVO classSignInfoVO1 = vodPlayHistoryMapper.classStudyHistory(classSignInfoVO.getClassId()); - BeanUtils.copyProperties(classSignInfoVO1,classSignInfoVO); - - //平均签到数 向下取整 - long signCount = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + "*:classId:" + classSignInfoVO.getClassId() + ":*").stream().count(); - classSignInfoVO.setAvgSignCount(MathUtil.intDivCeil(signCount, classSignInfoVO1.getMemberCount())); - } public SignInStatusVO signInStatus(SignInRecordDO signInRecordDO) { @@ -117,7 +113,7 @@ public class SignInRecordServiceImpl extends ServiceImpl classHourDictDOS = classHourDictMapper.selectList(null); for (ClassHourDictDO classHourDictDO : classHourDictDOS) { - redisUtil.set("subsidySettings:" + classHourDictDO.getCompanyId(), classHourDictDO); + redisUtil.set("subsidySettings:"+ classHourDictDO.getCompanyId(), classHourDictDO); } //预写学生账号数据 diff --git a/src/main/java/com/subsidy/util/BaseModel.java b/src/main/java/com/subsidy/util/BaseModel.java index 9297672..7504dd0 100644 --- a/src/main/java/com/subsidy/util/BaseModel.java +++ b/src/main/java/com/subsidy/util/BaseModel.java @@ -16,7 +16,7 @@ public abstract class BaseModel { * 创建时间 */ @JsonIgnore -// @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "create_date", fill = FieldFill.INSERT) + @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "create_date", fill = FieldFill.INSERT) private LocalDateTime createDate; /** diff --git a/src/main/java/com/subsidy/util/MyBeanUtils.java b/src/main/java/com/subsidy/util/MyBeanUtils.java new file mode 100644 index 0000000..919f1fd --- /dev/null +++ b/src/main/java/com/subsidy/util/MyBeanUtils.java @@ -0,0 +1,29 @@ +package com.subsidy.util; + +import org.springframework.beans.BeanWrapper; +import org.springframework.beans.BeanWrapperImpl; + +import java.beans.PropertyDescriptor; +import java.util.HashSet; +import java.util.Set; + +public class MyBeanUtils { + + public static String[] getNullPropertyNames (Object source) { + final BeanWrapper src = new BeanWrapperImpl(source); + PropertyDescriptor[] pds = src.getPropertyDescriptors(); + + Set emptyNames = new HashSet<>(); + for(PropertyDescriptor pd : pds) { + Object srcValue = src.getPropertyValue(pd.getName()); + // 此处判断可根据需求修改 + if (srcValue == null) { + emptyNames.add(pd.getName()); + } + } + String[] result = new String[emptyNames.size()]; + return emptyNames.toArray(result); + } + + +} diff --git a/src/main/java/com/subsidy/util/RedisUtil.java b/src/main/java/com/subsidy/util/RedisUtil.java index 03e08ff..f8d317a 100644 --- a/src/main/java/com/subsidy/util/RedisUtil.java +++ b/src/main/java/com/subsidy/util/RedisUtil.java @@ -562,9 +562,9 @@ public class RedisUtil { // * @param pattern // * @return // */ - //public Set keys(String pattern){ - // return redisTemplate.keys(pattern); - //} + public Set keys(String pattern){ + return redisTemplate.keys(pattern); + } /** * 模糊查询 @@ -574,7 +574,7 @@ public class RedisUtil { public Set scan(String pattern) { return redisTemplate.execute((RedisCallback>) redisConnection -> { Set keys = new HashSet<>(); - Cursor cursor = redisConnection.scan(new ScanOptions.ScanOptionsBuilder().match(pattern).count(1000).build()); + Cursor cursor = redisConnection.scan(new ScanOptions.ScanOptionsBuilder().match(pattern).count(Integer.MAX_VALUE).build()); while (cursor.hasNext()) { keys.add(new String(cursor.next())); } diff --git a/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java b/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java index d75e3c4..1027224 100644 --- a/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java +++ b/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java @@ -5,12 +5,18 @@ import lombok.Data; @Data public class GetMemberPapersVO { + private Long id; + private Long paperId; private String score; private Integer cnt; - private Integer result; + private Integer rightCounts; + + private Integer totalCounts; + + private String result; } diff --git a/src/main/java/com/subsidy/vo/member/ContentVodVO.java b/src/main/java/com/subsidy/vo/member/ContentVodVO.java index 09d7c8e..bd51af0 100644 --- a/src/main/java/com/subsidy/vo/member/ContentVodVO.java +++ b/src/main/java/com/subsidy/vo/member/ContentVodVO.java @@ -9,6 +9,10 @@ public class ContentVodVO { private String content; + private Integer totalVods; + + private Integer playVods; + private List memberVodVOS; } diff --git a/src/main/java/com/subsidy/vo/member/MemberVO.java b/src/main/java/com/subsidy/vo/member/MemberVO.java index 79ac09c..c0ca4d9 100644 --- a/src/main/java/com/subsidy/vo/member/MemberVO.java +++ b/src/main/java/com/subsidy/vo/member/MemberVO.java @@ -16,4 +16,6 @@ public class MemberVO { private String image; private Integer firstLogin; + + private String companyName; } diff --git a/src/main/java/com/subsidy/vo/member/MyCoursesVO.java b/src/main/java/com/subsidy/vo/member/MyCoursesVO.java index 99ba946..63eea18 100644 --- a/src/main/java/com/subsidy/vo/member/MyCoursesVO.java +++ b/src/main/java/com/subsidy/vo/member/MyCoursesVO.java @@ -12,6 +12,8 @@ public class MyCoursesVO { private Long classId; + private String className; + private String courseName; private String endDate; diff --git a/src/main/resources/code.properties b/src/main/resources/code.properties index bada075..ad05e28 100644 --- a/src/main/resources/code.properties +++ b/src/main/resources/code.properties @@ -42,3 +42,4 @@ meishu.code-message[90001]=该类目已存在 meishu.code-message[10001]=导入失败 +meishu.code-message[11001]=该行业已存在 \ No newline at end of file diff --git a/src/main/resources/mapper/CourseContentMapper.xml b/src/main/resources/mapper/CourseContentMapper.xml index fc16137..fbfb0d5 100644 --- a/src/main/resources/mapper/CourseContentMapper.xml +++ b/src/main/resources/mapper/CourseContentMapper.xml @@ -45,70 +45,70 @@ SELECT - max( t.score ), - t.right_counts, - t.total_counts, - t.result + t2.right_counts, + t2.total_counts, + t2.result, + t2.score FROM - exercise_done_result t + ( + SELECT + max( t.score ) AS score + FROM + exercise_done_result t + WHERE + t.delete_date IS NULL + AND t.paper_id = #{paperId} + AND t.member_id = #{memberId} + ) t1 + LEFT JOIN exercise_done_result t2 ON t1.score = t2.score WHERE - t.delete_date IS NULL - AND t.paper_id = #{paperId} - AND t.member_id = #{memberId} + t2.paper_id = #{paperId} + AND t2.member_id = #{memberId} + SELECT + t.id, + t.field_name + FROM + field_dict t + WHERE + t.delete_date IS NULL + AND t.field_name LIKE concat('%',#{fieldName} ,'%') + + diff --git a/src/main/resources/mapper/MemberMapper.xml b/src/main/resources/mapper/MemberMapper.xml index f9df845..3bd8c95 100644 --- a/src/main/resources/mapper/MemberMapper.xml +++ b/src/main/resources/mapper/MemberMapper.xml @@ -64,6 +64,7 @@ SELECT t3.id AS courseId, t2.id AS classId, + t2.class_name, t3.course_name, t2.end_date, t4.cnt AS totalCnt, diff --git a/src/main/resources/mapper/VodPlayHistoryMapper.xml b/src/main/resources/mapper/VodPlayHistoryMapper.xml index 13a3c03..1d7f48a 100644 --- a/src/main/resources/mapper/VodPlayHistoryMapper.xml +++ b/src/main/resources/mapper/VodPlayHistoryMapper.xml @@ -47,8 +47,7 @@ vod_play_history t WHERE t.delete_date IS NULL - AND t.member_id = #{member_id} - + AND t.member_id = #{memberId} GROUP BY t.vod_id, t.member_id @@ -231,21 +230,14 @@ @@ -303,7 +295,7 @@