diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java index eccdb17..5e3310f 100644 --- a/src/main/java/com/subsidy/controller/AdministerController.java +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -8,6 +8,7 @@ import com.subsidy.dto.administer.*; import com.subsidy.model.AdministerDO; import com.subsidy.model.ExerciseDoneHistoryDO; import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.model.MemberDO; import com.subsidy.service.AdministerService; import com.subsidy.util.ConstantUtils; import io.swagger.annotations.Api; @@ -86,8 +87,8 @@ public class AdministerController { } @PostMapping("classSummary") - @ApiOperation("课程汇总 id 班级id ") - //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("班级详情--数据概览 id 班级id ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO classSummary(@RequestBody ClassDetailDTO classDetailDTO){ return ResponseData.generateCreatedResponse(0,administerService.classSummary(classDetailDTO)); } @@ -220,4 +221,9 @@ public class AdministerController { return ResponseData.generateCreatedResponse(0,administerService.importMember(companyId,file)); } + @PostMapping("manageMember") + @ApiOperation("用户管理 {pageSize pageNum userName:名字}") + public ResponseVO manageMember(@RequestBody ManageMemberDTO manageMemberDTO){ + return ResponseData.generateCreatedResponse(0,administerService.manageMember(manageMemberDTO)); + } } diff --git a/src/main/java/com/subsidy/controller/CategoryController.java b/src/main/java/com/subsidy/controller/CategoryController.java index b51184a..80ccfac 100644 --- a/src/main/java/com/subsidy/controller/CategoryController.java +++ b/src/main/java/com/subsidy/controller/CategoryController.java @@ -66,5 +66,4 @@ public class CategoryController { return ResponseData.generateCreatedResponse(0,categoryService.updateCategory(categoryDO)); } - } diff --git a/src/main/java/com/subsidy/controller/ClassDictController.java b/src/main/java/com/subsidy/controller/ClassDictController.java index 2a1511a..0990c0a 100644 --- a/src/main/java/com/subsidy/controller/ClassDictController.java +++ b/src/main/java/com/subsidy/controller/ClassDictController.java @@ -36,7 +36,7 @@ public class ClassDictController { private ClassDictService classDictService; @PostMapping("getAllClasses") - @ApiOperation("获取某公司下的所有课程 companyId 所选企业id className 班级名称") + @ApiOperation("获取某公司下的所有课程 companyId 所选企业id className 班级名称 openStatus 开放状态 startDate 开始时间 endDate 结束时间") @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO getAllClasses(@RequestBody ClassDictDO classDictDO){ return ResponseData.generateCreatedResponse(0,classDictService.getAllClasses(classDictDO)); @@ -97,5 +97,12 @@ public class ClassDictController { return ResponseData.generateCreatedResponse(0,classDictService.batchSms(classDictDO)); } + @PostMapping("getClassBaseInfo") + @ApiOperation("班级详情--获取课程基本信息") + public ResponseVO getClassBaseInfo(@RequestBody ClassDictDO classDictDO){ + return ResponseData.generateCreatedResponse(0,classDictService.getClassBaseInfo(classDictDO)); + } + + } diff --git a/src/main/java/com/subsidy/controller/CompanyDictController.java b/src/main/java/com/subsidy/controller/CompanyDictController.java index 734b052..b4c0a4d 100644 --- a/src/main/java/com/subsidy/controller/CompanyDictController.java +++ b/src/main/java/com/subsidy/controller/CompanyDictController.java @@ -34,14 +34,14 @@ public class CompanyDictController { private CompanyDictService companyDictService; @PostMapping("/administers") - @ApiOperation("查询所有企业 {id companyName pageNum pageSize }") + @ApiOperation("查询所有企业 {id companyName fieldId 行业id pageNum pageSize }") @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){ return ResponseData.generateCreatedResponse(0,companyDictService.operators(operatorsDTO)); } @PostMapping("addCompany") - @ApiOperation("添加企业 {accountName:账号 companyName:企业名称 shortName 简称 banner:标语 field:领域 role 1:超级管理员 2:普通成员}") + @ApiOperation("添加企业 {accountName:账号 companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员}") @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO addOperator(@RequestBody AddCompanyDTO addCompanyDTO){ return ResponseData.generateCreatedResponse(0,companyDictService.addOperator(addCompanyDTO)); @@ -55,7 +55,7 @@ public class CompanyDictController { } @PostMapping("updateCompany") - @ApiOperation("修改企业 id accountName:账号 companyName:企业名称 shortName 简称 banner:标语 field:领域 role 1:超级管理员 2:普通成员") + @ApiOperation("修改企业 id accountName:账号 companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员") @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO updateAdminister(@RequestBody AddCompanyDTO addCompanyDTO){ return ResponseData.generateCreatedResponse(0,companyDictService.updateAdminister(addCompanyDTO)); diff --git a/src/main/java/com/subsidy/controller/CourseCategoryMappingController.java b/src/main/java/com/subsidy/controller/CourseCategoryMappingController.java new file mode 100644 index 0000000..a53fcce --- /dev/null +++ b/src/main/java/com/subsidy/controller/CourseCategoryMappingController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 课程类目映射 前端控制器 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@RestController +@Api(tags = "课程类目映射") +@RequestMapping("/course-category-mapping-do") +public class CourseCategoryMappingController { + +} diff --git a/src/main/java/com/subsidy/controller/CourseDictController.java b/src/main/java/com/subsidy/controller/CourseDictController.java index 4b4f8e7..da148b4 100644 --- a/src/main/java/com/subsidy/controller/CourseDictController.java +++ b/src/main/java/com/subsidy/controller/CourseDictController.java @@ -5,6 +5,7 @@ import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; import com.subsidy.dto.course.QueryCoursesDTO; +import com.subsidy.dto.course.UpdateCoursesDTO; import com.subsidy.model.CourseDictDO; import com.subsidy.service.CourseDictService; import com.subsidy.util.ConstantUtils; @@ -47,24 +48,30 @@ public class CourseDictController { } @PostMapping("queryCourses") - @ApiOperation("平台运营者--查询课程 pageSize pageNum administerId companyId courseName categoryId courseType courseSource") + @ApiOperation("平台运营者--查询课程 pageSize pageNum courseName fieldId categoryId jobId rankId courseType") @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){ return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO)); } @PostMapping("updateCourses") - @ApiOperation("编辑课程 id companyId courseName categoryId courseType courseSource") + @ApiOperation("编辑课程 id courseName courseType coverPage fieldDictDOS categoryDOS jobDictDOS rankDictDOS ") @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) - public ResponseVO updateCourses(@RequestBody CourseDictDO courseDictDO){ - return ResponseData.generateCreatedResponse(0,courseDictService.updateCourses(courseDictDO)); + public ResponseVO updateCourses(@RequestBody UpdateCoursesDTO updateCoursesDTO){ + return ResponseData.generateCreatedResponse(0,courseDictService.updateCourses(updateCoursesDTO)); } @PostMapping("queryCompanyCourse") - @ApiOperation("企业内容管理-- { companyId 所选企业id}") + @ApiOperation("企业内容管理-- { companyId 所选企业id pageSize pageNum courseName categoryId jobId rankId }") public ResponseVO queryCompanyCourse(@RequestBody QueryCoursesDTO queryCoursesDTO){ return ResponseData.generateCreatedResponse(0,courseDictService.queryCompanyCourse(queryCoursesDTO)); } + @PostMapping("updateOpenStatus") + @ApiOperation("修改课程开放状态 id openStatus") + public ResponseVO updateOpenStatus(@RequestBody CourseDictDO courseDictDO){ + return ResponseData.generateCreatedResponse(0,courseDictService.updateOpenStatus(courseDictDO)); + } + } diff --git a/src/main/java/com/subsidy/controller/CourseJobMappingController.java b/src/main/java/com/subsidy/controller/CourseJobMappingController.java new file mode 100644 index 0000000..e059c6c --- /dev/null +++ b/src/main/java/com/subsidy/controller/CourseJobMappingController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 课程-岗位映射表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@RestController +@Api(tags = "课程-岗位映射表") +@RequestMapping("/course-job-mapping-do") +public class CourseJobMappingController { + +} diff --git a/src/main/java/com/subsidy/controller/CourseRankMappingController.java b/src/main/java/com/subsidy/controller/CourseRankMappingController.java new file mode 100644 index 0000000..c6bbd5b --- /dev/null +++ b/src/main/java/com/subsidy/controller/CourseRankMappingController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 课程职级映射表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@RestController +@Api(tags = "课程职级映射表") +@RequestMapping("/course-rank-mapping-do") +public class CourseRankMappingController { + +} diff --git a/src/main/java/com/subsidy/controller/DepartmentDictController.java b/src/main/java/com/subsidy/controller/DepartmentDictController.java index f902875..37683e0 100644 --- a/src/main/java/com/subsidy/controller/DepartmentDictController.java +++ b/src/main/java/com/subsidy/controller/DepartmentDictController.java @@ -4,6 +4,7 @@ package com.subsidy.controller; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.department.GetDepartmentMembersDTO; import com.subsidy.model.DepartmentDictDO; import com.subsidy.service.DepartmentDictService; import com.subsidy.util.ConstantUtils; @@ -13,6 +14,7 @@ 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.RequestParam; import org.springframework.web.bind.annotation.RestController; /** @@ -59,6 +61,13 @@ public class DepartmentDictController { return ResponseData.generateCreatedResponse(0,departmentDictService.updateDepartment(departmentDictDO)); } + @PostMapping("getDepartmentMembers") + @ApiOperation("获取部门成员 companyId 公司id id 部门id") + public ResponseVO getDepartmentMembers(@RequestBody GetDepartmentMembersDTO getDepartmentMembersDTO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.getDepartmentMembers(getDepartmentMembersDTO)); + } + + } diff --git a/src/main/java/com/subsidy/controller/RankDictController.java b/src/main/java/com/subsidy/controller/RankDictController.java new file mode 100644 index 0000000..4520b73 --- /dev/null +++ b/src/main/java/com/subsidy/controller/RankDictController.java @@ -0,0 +1,59 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.mapper.RankDictMapper; +import com.subsidy.model.RankDictDO; +import com.subsidy.service.RankDictService; +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.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 职级字典表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@RestController +@Api(tags = "职级字典表") +@RequestMapping("/rankDict") +public class RankDictController { + + @Autowired + private RankDictService rankDictService; + + @PostMapping("addRank") + @ApiOperation("添加职级 companyId rank") + public ResponseVO addRank(@RequestBody RankDictDO rankDictDO){ + return ResponseData.generateCreatedResponse(0,rankDictService.addRank(rankDictDO)); + } + + @PostMapping("deleteRank") + @ApiOperation("删除职级 id") + public ResponseVO deleteById(@RequestBody RankDictDO rankDictDO){ + return ResponseData.generateCreatedResponse(0,rankDictService.deleteRank(rankDictDO)); + } + + @PostMapping("updateRank") + @ApiOperation("添加职级 id companyId rank") + public ResponseVO updateRank(@RequestBody RankDictDO rankDictDO){ + return ResponseData.generateCreatedResponse(0,rankDictService.updateRank(rankDictDO)); + } + + @PostMapping("queryRanks") + @ApiOperation("查看职级 companyId") + public ResponseVO queryRanks(@RequestBody RankDictDO rankDictDO){ + return ResponseData.generateCreatedResponse(0,rankDictService.queryRanks(rankDictDO)); + } + +} diff --git a/src/main/java/com/subsidy/dto/administer/ManageMemberDTO.java b/src/main/java/com/subsidy/dto/administer/ManageMemberDTO.java new file mode 100644 index 0000000..aa57883 --- /dev/null +++ b/src/main/java/com/subsidy/dto/administer/ManageMemberDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.administer; + +import lombok.Data; + +@Data +public class ManageMemberDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String userName; + +} diff --git a/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java b/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java index 4e3ecbc..f4f033e 100644 --- a/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java +++ b/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java @@ -11,6 +11,8 @@ public class OperatorsDTO { private Integer role; + private Long fieldId; + private String companyName; private String userName; diff --git a/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java b/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java index ef03529..bf6d2a4 100644 --- a/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java +++ b/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java @@ -3,6 +3,8 @@ package com.subsidy.dto.company; import com.subsidy.model.CompanyDictDO; import lombok.Data; +import java.util.List; + @Data public class AddCompanyDTO extends CompanyDictDO { @@ -14,4 +16,6 @@ public class AddCompanyDTO extends CompanyDictDO { private Integer role; + private List field; + } diff --git a/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java b/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java index 4e424a0..689da22 100644 --- a/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java +++ b/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java @@ -2,8 +2,6 @@ package com.subsidy.dto.course; import lombok.Data; -import java.util.List; - @Data public class QueryCoursesDTO { @@ -17,12 +15,12 @@ public class QueryCoursesDTO { private String courseType; - private String courseSource; + private Long fieldId; - private Long administerId; + private Long rankId; - private Long companyId; + private Long jobId; - private List teacherIds; + private Long companyId; } diff --git a/src/main/java/com/subsidy/dto/course/UpdateCoursesDTO.java b/src/main/java/com/subsidy/dto/course/UpdateCoursesDTO.java new file mode 100644 index 0000000..d95adaf --- /dev/null +++ b/src/main/java/com/subsidy/dto/course/UpdateCoursesDTO.java @@ -0,0 +1,57 @@ +package com.subsidy.dto.course; + +import com.subsidy.model.CategoryDO; +import com.subsidy.model.FieldDictDO; +import com.subsidy.model.JobDictDO; +import com.subsidy.model.RankDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class UpdateCoursesDTO { + + private Long id; + + /** + * + */ + private Long companyId; + + /** + * 课程名称 + */ + private String courseName; + + /** + * 封面 + */ + private String coverPage; + + /** + * 课程类型 + */ + private String courseType; + + /** + * 行业范围 + */ + private List fieldDictDOS; + + /** + * 课程类目 + */ + private List categoryDOS; + + /** + * 适用岗位 + */ + private List jobDictDOS; + + /** + * 适用职级 + */ + private List rankDictDOS; + + +} diff --git a/src/main/java/com/subsidy/dto/department/GetDepartmentMembersDTO.java b/src/main/java/com/subsidy/dto/department/GetDepartmentMembersDTO.java new file mode 100644 index 0000000..3229730 --- /dev/null +++ b/src/main/java/com/subsidy/dto/department/GetDepartmentMembersDTO.java @@ -0,0 +1,17 @@ +package com.subsidy.dto.department; + +import lombok.Data; + +@Data +public class GetDepartmentMembersDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long departmentId; + + private Long companyId; + + private String userName; +} diff --git a/src/main/java/com/subsidy/mapper/CategoryMapper.java b/src/main/java/com/subsidy/mapper/CategoryMapper.java index 8835bd5..5ec704a 100644 --- a/src/main/java/com/subsidy/mapper/CategoryMapper.java +++ b/src/main/java/com/subsidy/mapper/CategoryMapper.java @@ -4,6 +4,8 @@ import com.subsidy.model.CategoryDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

* 类目名称 Mapper 接口 @@ -12,7 +14,13 @@ import org.springframework.stereotype.Repository; * @author DengMin * @since 2021-10-11 */ - @Repository +@Repository public interface CategoryMapper extends BaseMapper { + + /** + * 查看某个课程下的所有类目 + */ + List queryCourseCategory(Long courseId); + } diff --git a/src/main/java/com/subsidy/mapper/ClassDictMapper.java b/src/main/java/com/subsidy/mapper/ClassDictMapper.java index a810e25..6a55eec 100644 --- a/src/main/java/com/subsidy/mapper/ClassDictMapper.java +++ b/src/main/java/com/subsidy/mapper/ClassDictMapper.java @@ -6,6 +6,7 @@ import com.subsidy.model.ClassDictDO; import com.subsidy.model.MemberDO; import com.subsidy.model.VodDictDO; import com.subsidy.vo.classdict.GetAllClassesVO; +import com.subsidy.vo.classdict.GetClassBaseInfoVO; import org.springframework.stereotype.Repository; import java.util.List; @@ -42,4 +43,9 @@ public interface ClassDictMapper extends BaseMapper { */ List classMembers(Long classId); + /** + * 班级详情--获取课程基本信息 + */ + GetClassBaseInfoVO getClassBaseInfo(Long classId); + } diff --git a/src/main/java/com/subsidy/mapper/CompanyDictMapper.java b/src/main/java/com/subsidy/mapper/CompanyDictMapper.java index 9441538..13913df 100644 --- a/src/main/java/com/subsidy/mapper/CompanyDictMapper.java +++ b/src/main/java/com/subsidy/mapper/CompanyDictMapper.java @@ -21,11 +21,10 @@ import java.util.List; public interface CompanyDictMapper extends BaseMapper { /** - * 查找运营者 - * + * 企业管理--查找所有主账号 * @return */ - IPage operators(IPage page, String companyName,Integer id, String userName,Integer role); + IPage operators(IPage page, String companyName,Long fieldId); /** * 查找所有的公司名称 diff --git a/src/main/java/com/subsidy/mapper/CourseCategoryMappingMapper.java b/src/main/java/com/subsidy/mapper/CourseCategoryMappingMapper.java new file mode 100644 index 0000000..586c7e5 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CourseCategoryMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CourseCategoryMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 课程类目映射 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ + @Repository +public interface CourseCategoryMappingMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/CourseDictMapper.java b/src/main/java/com/subsidy/mapper/CourseDictMapper.java index a789085..05310e4 100644 --- a/src/main/java/com/subsidy/mapper/CourseDictMapper.java +++ b/src/main/java/com/subsidy/mapper/CourseDictMapper.java @@ -22,10 +22,11 @@ import java.util.List; public interface CourseDictMapper extends BaseMapper { /** - * 查询全部课程 + * 运营者查询全部课程 + * courseName fieldId categoryId jobId courseRank courseType * @return */ - IPage queryCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId); + IPage queryCourses(IPage page, String courseName, Long fieldId,Long categoryId,Long jobId,Long rankId, String courseType,Long companyId); /** * 通过课程id查询课程下的学生-----弃用 @@ -39,9 +40,19 @@ public interface CourseDictMapper extends BaseMapper { IPage queryPublicCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource); /** - * 查询企业内部课程 + * 查看课程下有多少课时 */ - IPage queryCompanyCourse(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId); + Integer queryCourseCnt(Long courseId); + + /** + * 查看课程学习总时长 + */ + Integer queryCoursePlayLength(Long courseId); + + /** + * 修改课程的开放状态 + */ + void updateOpenStatus(CourseDictDO courseDictDO); } diff --git a/src/main/java/com/subsidy/mapper/CourseJobMappingMapper.java b/src/main/java/com/subsidy/mapper/CourseJobMappingMapper.java new file mode 100644 index 0000000..242812b --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CourseJobMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CourseJobMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 课程-岗位映射表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ + @Repository +public interface CourseJobMappingMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/CourseRankMappingMapper.java b/src/main/java/com/subsidy/mapper/CourseRankMappingMapper.java new file mode 100644 index 0000000..aec6271 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CourseRankMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CourseRankMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 课程职级映射表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ + @Repository +public interface CourseRankMappingMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java b/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java index c91ca73..e0fdb00 100644 --- a/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java +++ b/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java @@ -1,7 +1,9 @@ package com.subsidy.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.MemberDO; import org.springframework.stereotype.Repository; /** @@ -17,5 +19,4 @@ public interface DepartmentDictMapper extends BaseMapper { //List getDepartments(DepartmentDictDO departmentDictDO); - } diff --git a/src/main/java/com/subsidy/mapper/FieldDictMapper.java b/src/main/java/com/subsidy/mapper/FieldDictMapper.java index 3875870..6c0760e 100644 --- a/src/main/java/com/subsidy/mapper/FieldDictMapper.java +++ b/src/main/java/com/subsidy/mapper/FieldDictMapper.java @@ -21,5 +21,16 @@ public interface FieldDictMapper extends BaseMapper { IPage queryFields(IPage ipage, String fieldName); + /** + * 查看公司所有的行业 + * @param companyId + * @return + */ + List queryCompanyFields(Long companyId); + + /** + * 查看课程所属行业 + */ + List queryCourseFields(Long courseId); } diff --git a/src/main/java/com/subsidy/mapper/JobDictMapper.java b/src/main/java/com/subsidy/mapper/JobDictMapper.java index 796a81f..240d7a1 100644 --- a/src/main/java/com/subsidy/mapper/JobDictMapper.java +++ b/src/main/java/com/subsidy/mapper/JobDictMapper.java @@ -4,6 +4,8 @@ import com.subsidy.model.JobDictDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

* 岗位表 Mapper 接口 @@ -12,7 +14,13 @@ import org.springframework.stereotype.Repository; * @author DengMin * @since 2022-02-10 */ - @Repository +@Repository public interface JobDictMapper extends BaseMapper { + + /** + * 获取某个课程适用的所有岗位 + */ + List queryCourseJobs(Long courseId); + } diff --git a/src/main/java/com/subsidy/mapper/MemberMapper.java b/src/main/java/com/subsidy/mapper/MemberMapper.java index 3dc662f..33f39d1 100644 --- a/src/main/java/com/subsidy/mapper/MemberMapper.java +++ b/src/main/java/com/subsidy/mapper/MemberMapper.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.dto.member.PasswordLoginDTO; import com.subsidy.model.DepartmentDictDO; import com.subsidy.model.MemberDO; +import com.subsidy.vo.administer.ManageMemberVO; import com.subsidy.vo.administer.UserRoleVO; import com.subsidy.vo.member.GetAllVO; import com.subsidy.vo.member.MyCoursesVO; @@ -29,7 +30,6 @@ public interface MemberMapper extends BaseMapper { */ UserRoleVO passwordLogin(PasswordLoginDTO passwordLoginDTO); - /** * 查看学生的课程[废弃] */ @@ -48,6 +48,11 @@ public interface MemberMapper extends BaseMapper { /** * 查询部门所有的学生 */ - IPage getMembers(IPage iPage,Long departmentId,String userName,String status); + IPage getMembers(IPage iPage,Long departmentId,String userName,String status); + + /** + * 查询某公司所有的学生 公司不传就是查平台所有学生 + */ + IPage manageMember(IPage iPage,Long companyId,String userName); } diff --git a/src/main/java/com/subsidy/mapper/PaperDictMapper.java b/src/main/java/com/subsidy/mapper/PaperDictMapper.java index 8be15e6..c5c16de 100644 --- a/src/main/java/com/subsidy/mapper/PaperDictMapper.java +++ b/src/main/java/com/subsidy/mapper/PaperDictMapper.java @@ -28,4 +28,10 @@ public interface PaperDictMapper extends BaseMapper { * 查看某个卷子有多少人完成 卷子id */ Integer completeCount(Long paperId); + + /** + * 查看某个课程下有多少卷子 + */ + Integer queryCoursePapersCnt(Long courseId); + } diff --git a/src/main/java/com/subsidy/mapper/RankDictMapper.java b/src/main/java/com/subsidy/mapper/RankDictMapper.java new file mode 100644 index 0000000..187c218 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/RankDictMapper.java @@ -0,0 +1,30 @@ +package com.subsidy.mapper; + +import com.subsidy.model.RankDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 职级字典表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Repository +public interface RankDictMapper extends BaseMapper { + + /** + * 查看某个课程的职级 + */ + List queryCourseRanks(Long courseId); + + /** + * 查看某个公司的职级 + */ + List queryCompanyRanks(Long companyId); + +} diff --git a/src/main/java/com/subsidy/model/ClassDictDO.java b/src/main/java/com/subsidy/model/ClassDictDO.java index f5ab4c6..75f9fd3 100644 --- a/src/main/java/com/subsidy/model/ClassDictDO.java +++ b/src/main/java/com/subsidy/model/ClassDictDO.java @@ -41,7 +41,7 @@ public class ClassDictDO extends BaseModel { /** * 班级类型 */ - private String classType; + private String classTypeId; /** * 课程id @@ -68,5 +68,10 @@ public class ClassDictDO extends BaseModel { */ private Integer isFastPlay; + /** + * 班级状态 + */ + private String openStatus; + } diff --git a/src/main/java/com/subsidy/model/ClassNoticeDO.java b/src/main/java/com/subsidy/model/ClassNoticeDO.java index 520016e..abd5943 100644 --- a/src/main/java/com/subsidy/model/ClassNoticeDO.java +++ b/src/main/java/com/subsidy/model/ClassNoticeDO.java @@ -44,7 +44,11 @@ public class ClassNoticeDO extends BaseModel { /** * 通知时间 */ - private LocalDateTime noticeTime; + private String noticeTime; + /** + * 发送状态 + */ + private String status; } diff --git a/src/main/java/com/subsidy/model/CompanyDictDO.java b/src/main/java/com/subsidy/model/CompanyDictDO.java index 3e1700a..76c7ed1 100644 --- a/src/main/java/com/subsidy/model/CompanyDictDO.java +++ b/src/main/java/com/subsidy/model/CompanyDictDO.java @@ -46,10 +46,9 @@ public class CompanyDictDO extends BaseModel { private String banner; /** - * 领域 + * 地址 */ - private String field; - + private String address; } diff --git a/src/main/java/com/subsidy/model/CourseCategoryMappingDO.java b/src/main/java/com/subsidy/model/CourseCategoryMappingDO.java new file mode 100644 index 0000000..d9eb6b0 --- /dev/null +++ b/src/main/java/com/subsidy/model/CourseCategoryMappingDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 课程类目映射 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_category_mapping") +public class CourseCategoryMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long courseId; + + private Long categoryId; + + +} diff --git a/src/main/java/com/subsidy/model/CourseDictDO.java b/src/main/java/com/subsidy/model/CourseDictDO.java index a79f975..0cf012d 100644 --- a/src/main/java/com/subsidy/model/CourseDictDO.java +++ b/src/main/java/com/subsidy/model/CourseDictDO.java @@ -29,7 +29,7 @@ public class CourseDictDO extends BaseModel { private Long id; /** - * + * 企业id */ private Long companyId; @@ -53,9 +53,5 @@ public class CourseDictDO extends BaseModel { */ private String courseSource; - ///** - // * 习题截止时间 - // */ - //private LocalDateTime deadline; } diff --git a/src/main/java/com/subsidy/model/CourseJobMappingDO.java b/src/main/java/com/subsidy/model/CourseJobMappingDO.java new file mode 100644 index 0000000..05f6287 --- /dev/null +++ b/src/main/java/com/subsidy/model/CourseJobMappingDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 课程-岗位映射表 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_job_mapping") +public class CourseJobMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long jobId; + + private Long courseId; + + +} diff --git a/src/main/java/com/subsidy/model/CourseRankMappingDO.java b/src/main/java/com/subsidy/model/CourseRankMappingDO.java new file mode 100644 index 0000000..870cc32 --- /dev/null +++ b/src/main/java/com/subsidy/model/CourseRankMappingDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 课程职级映射表 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_rank_mapping") +public class CourseRankMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long courseId; + + private Long rankId; + + +} diff --git a/src/main/java/com/subsidy/model/RankDictDO.java b/src/main/java/com/subsidy/model/RankDictDO.java new file mode 100644 index 0000000..0bcb376 --- /dev/null +++ b/src/main/java/com/subsidy/model/RankDictDO.java @@ -0,0 +1,36 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 职级字典表 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("rank_dict") +public class RankDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long companyId; + + /** + * 职级 + */ + private String rank; + + +} diff --git a/src/main/java/com/subsidy/service/AdministerService.java b/src/main/java/com/subsidy/service/AdministerService.java index 8197926..f26f37a 100644 --- a/src/main/java/com/subsidy/service/AdministerService.java +++ b/src/main/java/com/subsidy/service/AdministerService.java @@ -76,4 +76,5 @@ public interface AdministerService extends IService { String importMember(Long companyId, MultipartFile multipartFile); + IPage manageMember(ManageMemberDTO manageMemberDTO); } diff --git a/src/main/java/com/subsidy/service/ClassDictService.java b/src/main/java/com/subsidy/service/ClassDictService.java index fd64d05..41473ce 100644 --- a/src/main/java/com/subsidy/service/ClassDictService.java +++ b/src/main/java/com/subsidy/service/ClassDictService.java @@ -8,6 +8,7 @@ import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassMemberMappingDO; import com.subsidy.model.MemberDO; import com.subsidy.vo.classdict.GetAllClassesVO; +import com.subsidy.vo.classdict.GetClassBaseInfoVO; import java.util.List; @@ -38,4 +39,7 @@ public interface ClassDictService extends IService { String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO); String batchSms(ClassDictDO classDictDO); + + GetClassBaseInfoVO getClassBaseInfo(ClassDictDO classDictDO); + } diff --git a/src/main/java/com/subsidy/service/CourseCategoryMappingService.java b/src/main/java/com/subsidy/service/CourseCategoryMappingService.java new file mode 100644 index 0000000..9cb3723 --- /dev/null +++ b/src/main/java/com/subsidy/service/CourseCategoryMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.CourseCategoryMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 课程类目映射 服务类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +public interface CourseCategoryMappingService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/CourseDictService.java b/src/main/java/com/subsidy/service/CourseDictService.java index c345b91..080c9c3 100644 --- a/src/main/java/com/subsidy/service/CourseDictService.java +++ b/src/main/java/com/subsidy/service/CourseDictService.java @@ -2,6 +2,7 @@ package com.subsidy.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.dto.course.QueryCoursesDTO; +import com.subsidy.dto.course.UpdateCoursesDTO; import com.subsidy.model.CourseDictDO; import com.baomidou.mybatisplus.extension.service.IService; @@ -21,8 +22,10 @@ public interface CourseDictService extends IService { IPage queryCourses(QueryCoursesDTO queryCoursesDTO); - String updateCourses(CourseDictDO courseDictDO); + String updateCourses(UpdateCoursesDTO updateCoursesDTO); IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO); + String updateOpenStatus(CourseDictDO courseDictDO); + } diff --git a/src/main/java/com/subsidy/service/CourseJobMappingService.java b/src/main/java/com/subsidy/service/CourseJobMappingService.java new file mode 100644 index 0000000..bece06f --- /dev/null +++ b/src/main/java/com/subsidy/service/CourseJobMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.CourseJobMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 课程-岗位映射表 服务类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +public interface CourseJobMappingService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/CourseRankMappingService.java b/src/main/java/com/subsidy/service/CourseRankMappingService.java new file mode 100644 index 0000000..8593cb3 --- /dev/null +++ b/src/main/java/com/subsidy/service/CourseRankMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.CourseRankMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 课程职级映射表 服务类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +public interface CourseRankMappingService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/DepartmentDictService.java b/src/main/java/com/subsidy/service/DepartmentDictService.java index be78168..cf2eccc 100644 --- a/src/main/java/com/subsidy/service/DepartmentDictService.java +++ b/src/main/java/com/subsidy/service/DepartmentDictService.java @@ -1,5 +1,7 @@ package com.subsidy.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.department.GetDepartmentMembersDTO; import com.subsidy.dto.department.GetDepartmentsVO; import com.subsidy.model.DepartmentDictDO; import com.baomidou.mybatisplus.extension.service.IService; @@ -23,4 +25,6 @@ public interface DepartmentDictService extends IService { String deleteDepartment(DepartmentDictDO departmentDictDO); String updateDepartment(DepartmentDictDO departmentDictDO); + + IPage getDepartmentMembers(GetDepartmentMembersDTO getDepartmentMembersDTO); } diff --git a/src/main/java/com/subsidy/service/RankDictService.java b/src/main/java/com/subsidy/service/RankDictService.java new file mode 100644 index 0000000..af90805 --- /dev/null +++ b/src/main/java/com/subsidy/service/RankDictService.java @@ -0,0 +1,25 @@ +package com.subsidy.service; + +import com.subsidy.model.RankDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 职级字典表 服务类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +public interface RankDictService extends IService { + + String addRank(RankDictDO rankDictDO); + + String deleteRank(RankDictDO rankDictDO); + + String updateRank(RankDictDO rankDictDO); + + List queryRanks(RankDictDO rankDictDO); +} diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index cab624c..7f68f78 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -10,6 +10,7 @@ import com.subsidy.dto.administer.ClassDailyInfoDTO; import com.subsidy.dto.administer.ClassDetailDTO; import com.subsidy.dto.administer.ClassVodDailyInfoDTO; import com.subsidy.dto.administer.ClassVodInfoDTO; +import com.subsidy.dto.administer.ManageMemberDTO; import com.subsidy.dto.administer.MemberStudyLogDTO; import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.dto.member.ImportMemberDTO; @@ -21,10 +22,12 @@ import com.subsidy.mapper.CompanyDictMapper; import com.subsidy.mapper.CourseDictMapper; import com.subsidy.mapper.DepartmentDictMapper; import com.subsidy.mapper.ExerciseDoneResultMapper; +import com.subsidy.mapper.FieldDictMapper; import com.subsidy.mapper.MemberDepartmentMappingMapper; import com.subsidy.mapper.MemberMapper; import com.subsidy.mapper.OprAdmDictMapper; import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.mapper.SignInRecordMapper; import com.subsidy.mapper.VodDictMapper; import com.subsidy.mapper.VodPlayHistoryMapper; import com.subsidy.model.AdministerDO; @@ -61,6 +64,7 @@ import com.subsidy.vo.administer.ExerciseTestVO; import com.subsidy.vo.administer.GetMemberPapersVO; import com.subsidy.vo.administer.GetPaperDetailVO; import com.subsidy.vo.administer.LoginVO; +import com.subsidy.vo.administer.ManageMemberVO; import com.subsidy.vo.administer.MemberStudyLogVO; import com.subsidy.vo.administer.OperatorsVO; import com.subsidy.vo.administer.PermissionsVO; @@ -183,7 +187,10 @@ public class AdministerServiceImpl extends ServiceImpl operators(OperatorsDTO operatorsDTO) { Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); - //判断该用户的角色 - Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper() - .lambda() - .eq(RoleAdministerMappingDO::getAdministerId, operatorsDTO.getId()) - .eq(RoleAdministerMappingDO::getRoleId, 1)); - - if (count > 0) { - operatorsDTO.setId(null); - } - - IPage operatorsVOIPage = companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getId(), operatorsDTO.getUserName(), 0); + IPage operatorsVOIPage = companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId()); List operatorsVOS = operatorsVOIPage.getRecords(); - for (OperatorsVO operatorsVO : operatorsVOS){ - //operatorsVO.getField() + for (OperatorsVO operatorsVO : operatorsVOS) { + operatorsVO.setField(fieldDictMapper.queryCompanyFields(operatorsVO.getCompanyId())); } return operatorsVOIPage; @@ -392,57 +389,65 @@ public class AdministerServiceImpl extends ServiceImpl classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() .lambda() .eq(ClassMemberMappingDO::getClassId, classDetailDTO.getId())); classSummaryVO.setMemberCount(classMemberMappingDOS.size()); - //课程总数 + //课程由多少个视频 List vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId()); - classSummaryVO.setTotalVodCounts(vodDictDOS.size()); - /** - * 学生平均学习时长和平均学习次数 - */ - int totalStudyVods = 0; - int totalStudyLength = 0; - //学生总共学习课时数 - for (VodDictDO vodDictDO : vodDictDOS) { - for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { - int totalLength = vodPlayHistoryMapper.memberVodTotalLength(classMemberMappingDO.getMemberId(), vodDictDO.getId()); - if (totalLength >= vodDictDO.getVodLength()) { - totalStudyVods++; + int signCnt = 0; + int testCnt = 0; + int vodCnt = 0; + + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + + //签到 + Integer signCount = signInRecordMapper.selectCount(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, classMemberMappingDO.getMemberId()) + .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + if (signCount > 0) { + signCnt++; + } + + //测试 + int testCount = exerciseDoneResultMapper.selectCount(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getMemberId, classMemberMappingDO.getMemberId()) + .eq(ExerciseDoneResultDO::getClassId, classDetailDTO.getId())); + if (testCount > 0) { + testCnt++; + } + + //视频 + int i = 0; + for (VodDictDO vodDictDO : vodDictDOS) { + int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classMemberMappingDO.getMemberId(), vodDictDO.getId()); + if (totalPlayLength >= vodDictDO.getVodLength()) { + i++; } - totalStudyLength+=totalLength; + } + if (i == vodDictDOS.size()) { + vodCnt++; } } - classSummaryVO.setStudyVodCounts(MathUtil.intDivCeil(totalStudyVods, classMemberMappingDOS.size())); - //平均完成时长 学生观看课程视频的全部时长/总人数 - int avg = MathUtil.intDivCeil(totalStudyLength, classMemberMappingDOS.size()); - classSummaryVO.setAvgVodPlayLength(avg); + //签到人数 这个人签到了就算签过了 + classSummaryVO.setSignCount(signCnt); //测试通过率 - Integer passNum = exerciseDoneResultMapper.getClassTestPassRate(classDictDO.getId()); - classSummaryVO.setPassRate(MathUtil.intDivFloorPercent(passNum, classSummaryVO.getMemberCount())); + classSummaryVO.setPassCnt(testCnt); + + //视频看完人数 + classSummaryVO.setVodCnt(vodCnt); - //签到总次数 - long signCount = redisUtil.scan("subsidySignInfo*:classId:" + classDictDO.getId() + "*").stream().count(); - classSummaryVO.setAvgSignCount(MathUtil.intDivCeil(signCount, classSummaryVO.getMemberCount())); //答疑数 Integer count = answeringQuestionMapper.selectCount(new QueryWrapper() .lambda() - .eq(AnsweringQuestionDO::getClassId, classDictDO.getId())); + .eq(AnsweringQuestionDO::getClassId, classDetailDTO.getId())); classSummaryVO.setAnswerCount(count); return classSummaryVO; } @@ -1036,7 +1041,7 @@ public class AdministerServiceImpl extends ServiceImpl hashMap1 = hashMap.get(lg); - Cell seqcell = r.createCell(a.getAndIncrement()); - seqcell.setCellValue(i++); - Cell namecell = r.createCell(a.getAndIncrement()); - namecell.setCellValue(memberMapper.selectById(lg).getUserName()); - int total = 0; - for (String date : dates) { - if (!date.equals("姓名") && !"合计时长".equals(date)&& !"序号".equals(date)) { - Cell cell1 = r.createCell(a.getAndIncrement()); - if (null != hashMap1) { - total += null == hashMap1.get(date) ? 0 : hashMap1.get(date); - cell1.setCellValue(null == hashMap1.get(date) ? "00:00:00" : MathUtil.secToTime(hashMap1.get(date))); - } else { - cell1.setCellValue("00:00:00"); + int i = 1; + for (Long lg : memberIds) { + Row r = sheet.createRow(ai.getAndIncrement()); + AtomicInteger a = new AtomicInteger(); + Cell cell = r.createCell(at.getAndIncrement()); + CellStyle cellStyle = wb.createCellStyle(); + cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + cell.setCellStyle(cellStyle); + HashMap hashMap1 = hashMap.get(lg); + Cell seqcell = r.createCell(a.getAndIncrement()); + seqcell.setCellValue(i++); + Cell namecell = r.createCell(a.getAndIncrement()); + namecell.setCellValue(memberMapper.selectById(lg).getUserName()); + int total = 0; + for (String date : dates) { + if (!date.equals("姓名") && !"合计时长".equals(date) && !"序号".equals(date)) { + Cell cell1 = r.createCell(a.getAndIncrement()); + if (null != hashMap1) { + total += null == hashMap1.get(date) ? 0 : hashMap1.get(date); + cell1.setCellValue(null == hashMap1.get(date) ? "00:00:00" : MathUtil.secToTime(hashMap1.get(date))); + } else { + cell1.setCellValue("00:00:00"); + } } } + Cell totalCell = r.createCell(a.getAndIncrement()); + totalCell.setCellValue(MathUtil.secToTime(total)); } - Cell totalCell = r.createCell(a.getAndIncrement()); - totalCell.setCellValue(MathUtil.secToTime(total)); - } } String fileName = String.valueOf(new Date().getTime()); @@ -1338,6 +1343,11 @@ public class AdministerServiceImpl extends ServiceImpl manageMember(ManageMemberDTO manageMemberDTO) { + Page pager = new Page(manageMemberDTO.getPageNum(), manageMemberDTO.getPageSize()); + return memberMapper.manageMember(pager, null, manageMemberDTO.getUserName()); + } + public String userName(String originName, int i, Long companyId) { i++; List memberDOS = memberMapper.selectList(new QueryWrapper() diff --git a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java index dfb6d5d..399de93 100644 --- a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java @@ -5,12 +5,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.dto.classDict.AddClassDTO; import com.subsidy.dto.classDict.AddMemberToClassDTO; import com.subsidy.dto.classDict.GetSpareMembersDTO; +import com.subsidy.mapper.AnsweringQuestionMapper; import com.subsidy.mapper.ClassDictMapper; import com.subsidy.mapper.ClassMemberMappingMapper; import com.subsidy.mapper.ClassNoticeMapper; import com.subsidy.mapper.CompanyDictMapper; import com.subsidy.mapper.CourseDictMapper; import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.model.AnsweringQuestionDO; import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassMemberMappingDO; import com.subsidy.model.ClassNoticeDO; @@ -22,6 +24,7 @@ import com.subsidy.service.ClassDictService; import com.subsidy.util.ConstantUtils; import com.subsidy.util.SMSUtils; import com.subsidy.vo.classdict.GetAllClassesVO; +import com.subsidy.vo.classdict.GetClassBaseInfoVO; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; @@ -53,6 +56,8 @@ public class ClassDictServiceImpl extends ServiceImpl getAllClasses(ClassDictDO classDictDO) { return this.baseMapper.getAllClasses(classDictDO); @@ -72,12 +77,12 @@ public class ClassDictServiceImpl extends ServiceImpl memberIds = addClassDTO.getMemberIds(); - for (Long lg : memberIds){ + for (Long lg : memberIds) { ClassMemberMappingDO classMemberMappingDO = new ClassMemberMappingDO(); classMemberMappingDO.setMemberId(lg); classMemberMappingDO.setClassId(classDictDO.getId()); @@ -85,7 +90,7 @@ public class ClassDictServiceImpl extends ServiceImpl classNoticeDOS = addClassDTO.getClassNoticeDOS(); - for (ClassNoticeDO classNoticeDO :classNoticeDOS){ + for (ClassNoticeDO classNoticeDO : classNoticeDOS) { classNoticeDO.setClassId(classDictDO.getId()); classNoticeMapper.insert(classNoticeDO); } @@ -106,18 +111,27 @@ public class ClassDictServiceImpl extends ServiceImpl() + .lambda() + .eq(AnsweringQuestionDO::getAskId,classMemberMappingDO.getMemberId()) + .eq(AnsweringQuestionDO::getClassId,classMemberMappingDO.getClassId())); return ConstantUtils.DELETE_SUCCESS; } - public List getSpareMembers(GetSpareMembersDTO getSpareMembersDTO){ + public List getSpareMembers(GetSpareMembersDTO getSpareMembersDTO) { return this.baseMapper.getSpareMembers(getSpareMembersDTO); } - public String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO){ + public String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO) { List memberIds = addMemberToClassDTO.getMemberIds(); - for (Long lg : memberIds){ + for (Long lg : memberIds) { ClassMemberMappingDO classMemberMappingDO = new ClassMemberMappingDO(); classMemberMappingDO.setClassId(addMemberToClassDTO.getClassId()); classMemberMappingDO.setMemberId(lg); @@ -126,7 +140,7 @@ public class ClassDictServiceImpl extends ServiceImpl memberDOS = this.baseMapper.classMembers(classDictDO.getId()); StringBuilder telephone = new StringBuilder(); - String param = "{\"company\":\""+companyDictDO.getCompanyName()+ "\",\"course\":\""+courseDictDO.getCourseName()+ "\",\"startDate\":\""+classDictDO1.getStartDate() +"\",\"endDate\":\""+classDictDO1.getEndDate() +"\"}"; - if (memberDOS.size()>0){ - for (int i = 0 ;i< memberDOS.size();i++){ + String param = "{\"company\":\"" + companyDictDO.getCompanyName() + "\",\"course\":\"" + courseDictDO.getCourseName() + "\",\"startDate\":\"" + classDictDO1.getStartDate() + "\",\"endDate\":\"" + classDictDO1.getEndDate() + "\"}"; + if (memberDOS.size() > 0) { + for (int i = 0; i < memberDOS.size(); i++) { telephone.append(memberDOS.get(i).getTelephone()); - if (i!=memberDOS.size()-1){ + if (i != memberDOS.size() - 1) { telephone.append(","); } } - SMSUtils.sendNoticeSMS("SMS_228137810",telephone.toString(),param); + SMSUtils.sendNoticeSMS("SMS_228137810", telephone.toString(), param); } return ConstantUtils.SUCCESS_SEND_OUT; } + public GetClassBaseInfoVO getClassBaseInfo(ClassDictDO classDictDO) { + return this.baseMapper.getClassBaseInfo(classDictDO.getId()); + } + } diff --git a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java index bb7c3ac..631a5cc 100644 --- a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java @@ -10,12 +10,16 @@ import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.dto.company.AddCompanyDTO; import com.subsidy.mapper.AdministerMapper; import com.subsidy.mapper.CompanyDictMapper; +import com.subsidy.mapper.CompanyFieldMappingMapper; import com.subsidy.mapper.DepartmentDictMapper; +import com.subsidy.mapper.FieldDictMapper; import com.subsidy.mapper.RoleAdministerMappingMapper; import com.subsidy.model.AdministerDO; import com.subsidy.model.ClassHourDictDO; import com.subsidy.model.CompanyDictDO; +import com.subsidy.model.CompanyFieldMappingDO; import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.FieldDictDO; import com.subsidy.model.RoleAdministerMappingDO; import com.subsidy.service.CompanyDictService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -28,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -54,20 +59,23 @@ public class CompanyDictServiceImpl extends ServiceImpl operators(OperatorsDTO operatorsDTO) { Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); - //判断该用户的角色 - Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper() - .lambda() - .eq(RoleAdministerMappingDO::getAdministerId, operatorsDTO.getId()) - .eq(RoleAdministerMappingDO::getRoleId, 1)); - - if (count > 0) { - //后台管理员 - operatorsDTO.setId(null); + IPage page = this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId()); + List operatorsVOS = page.getRecords(); + for (OperatorsVO operatorsVO : operatorsVOS) { + //查看公司所在行业 + List fieldDictDOS = fieldDictMapper.queryCompanyFields(operatorsVO.getCompanyId()); + operatorsVO.setField(fieldDictDOS); } - - return this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getId(), operatorsDTO.getUserName(), 1); + page.setRecords(operatorsVOS); + return page; } public String addOperator(AddCompanyDTO addCompanyDTO) { @@ -76,7 +84,7 @@ public class CompanyDictServiceImpl extends ServiceImpl 0 ) { + if (count > 0) { throw new HttpException(20002); } @@ -124,6 +132,15 @@ public class CompanyDictServiceImpl extends ServiceImpl fields = addCompanyDTO.getField(); + for (Long lg : fields) { + CompanyFieldMappingDO companyFieldMappingDO = new CompanyFieldMappingDO(); + companyFieldMappingDO.setCompanyId(companyDictDO.getId()); + companyFieldMappingDO.setFieldId(lg); + companyFieldMappingMapper.insert(companyFieldMappingDO); + } return ConstantUtils.ADD_SUCCESS; } @@ -135,7 +152,7 @@ public class CompanyDictServiceImpl extends ServiceImpl 0) { + companyFieldMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CompanyFieldMappingDO::getCompanyId, addCompanyDTO.getId())); + + List longs = addCompanyDTO.getField(); + for (Long lg : longs) { + CompanyFieldMappingDO companyFieldMappingDO = new CompanyFieldMappingDO(); + companyFieldMappingDO.setFieldId(lg); + companyFieldMappingDO.setCompanyId(addCompanyDTO.getId()); + companyFieldMappingMapper.insert(companyFieldMappingDO); + } + } + //查找企业管理员 AdministerDO administerDO = administerMapper.selectOne(new QueryWrapper() .lambda() diff --git a/src/main/java/com/subsidy/service/impl/CourseCategoryMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseCategoryMappingServiceImpl.java new file mode 100644 index 0000000..dfc0a2f --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CourseCategoryMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.CourseCategoryMappingDO; +import com.subsidy.mapper.CourseCategoryMappingMapper; +import com.subsidy.service.CourseCategoryMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 课程类目映射 服务实现类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Service +public class CourseCategoryMappingServiceImpl extends ServiceImpl implements CourseCategoryMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java index f403608..8683dbf 100644 --- a/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java @@ -6,16 +6,40 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.common.exception.HttpException; import com.subsidy.dto.course.QueryCoursesDTO; +import com.subsidy.dto.course.UpdateCoursesDTO; +import com.subsidy.dto.field.QueryFieldsDTO; +import com.subsidy.mapper.CategoryMapper; +import com.subsidy.mapper.CourseCategoryMappingMapper; import com.subsidy.mapper.CourseDictMapper; +import com.subsidy.mapper.CourseFieldMappingMapper; +import com.subsidy.mapper.CourseJobMappingMapper; +import com.subsidy.mapper.CourseRankMappingMapper; +import com.subsidy.mapper.FieldDictMapper; +import com.subsidy.mapper.JobDictMapper; +import com.subsidy.mapper.PaperDictMapper; +import com.subsidy.mapper.RankDictMapper; import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.model.CategoryDO; +import com.subsidy.model.CourseCategoryMappingDO; import com.subsidy.model.CourseDictDO; +import com.subsidy.model.CourseFieldMappingDO; +import com.subsidy.model.CourseJobMappingDO; +import com.subsidy.model.CourseRankMappingDO; +import com.subsidy.model.FieldDictDO; +import com.subsidy.model.JobDictDO; +import com.subsidy.model.PaperDictDO; +import com.subsidy.model.RankDictDO; import com.subsidy.model.RoleAdministerMappingDO; import com.subsidy.service.CourseDictService; import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.course.QueryCoursesVO; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; +import java.util.List; + /** *

* 服务实现类 @@ -27,8 +51,36 @@ import org.springframework.stereotype.Service; @Service public class CourseDictServiceImpl extends ServiceImpl implements CourseDictService { + + @Autowired + private FieldDictMapper fieldDictMapper; + + @Autowired + private CategoryMapper categoryMapper; + + @Autowired + private JobDictMapper jobDictMapper; + + @Autowired + private CourseDictMapper courseDictMapper; + + @Autowired + private PaperDictMapper paperDictMapper; + + @Autowired + private CourseFieldMappingMapper courseFieldMappingMapper; + + @Autowired + private CourseJobMappingMapper courseJobMappingMapper; + @Autowired - private RoleAdministerMappingMapper roleAdministerMappingMapper; + private CourseCategoryMappingMapper courseCategoryMappingMapper; + + @Autowired + private CourseRankMappingMapper courseRankMappingMapper; + + @Autowired + private RankDictMapper rankDictMapper; public String addCourse(CourseDictDO courseDictDO) { @@ -57,53 +109,190 @@ public class CourseDictServiceImpl extends ServiceImpl() + .lambda() + .eq(CourseFieldMappingDO::getCourseId, courseDictDO.getId())); + + //课程类目关联 + courseCategoryMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CourseCategoryMappingDO::getCourseId, courseDictDO.getId())); + + //岗位关联 + courseJobMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CourseJobMappingDO::getCourseId, courseDictDO.getId())); + + paperDictMapper.delete(new QueryWrapper() + .lambda() + .eq(PaperDictDO::getCourseId, courseDictDO.getId())); + return ConstantUtils.DELETE_SUCCESS; } - public IPage queryCourses(QueryCoursesDTO queryCoursesDTO) { + public IPage queryCourses(QueryCoursesDTO queryCoursesDTO) { Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize()); + IPage iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getFieldId(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), queryCoursesDTO.getCourseType(), null); - //判断当前用户是运营者还是企业者 - Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper() - .lambda() - .eq(RoleAdministerMappingDO::getAdministerId,queryCoursesDTO.getAdministerId()) - .eq(RoleAdministerMappingDO::getRoleId,1)); + List queryCoursesVOS = iPage.getRecords(); + for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) { + + //课程类目 + List categoryDOS = categoryMapper.queryCourseCategory(queryCoursesVO.getId()); + queryCoursesVO.setCategoryDOS(categoryDOS); + + //适用岗位 + List jobDictDOS = jobDictMapper.queryCourseJobs(queryCoursesVO.getId()); + queryCoursesVO.setJobDictDOS(jobDictDOS); - if (count > 0){ - //后台管理员 - queryCoursesDTO.setCompanyId(null); + //职级 + List rankDictDOS = rankDictMapper.queryCourseRanks(queryCoursesVO.getId()); + queryCoursesVO.setRankDictDOS(rankDictDOS); + + //课时 + Integer vodCnt = courseDictMapper.queryCourseCnt(queryCoursesVO.getId()); + queryCoursesVO.setVodCounts(vodCnt); + + //课程总时长 + Integer vodPlayLength = courseDictMapper.queryCoursePlayLength(queryCoursesVO.getId()); + queryCoursesVO.setVodLength(vodPlayLength); + + //测试数 + Integer paperCnt = paperDictMapper.queryCoursePapersCnt(queryCoursesVO.getId()); + queryCoursesVO.setPaperCount(paperCnt); } - return this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getCourseType(), queryCoursesDTO.getCourseSource(), queryCoursesDTO.getCompanyId()); + return iPage; } - public String updateCourses(CourseDictDO courseDictDO) { + public String updateCourses(UpdateCoursesDTO updateCoursesDTO) { int count; - if (null != courseDictDO.getCompanyId()) { + if (null != updateCoursesDTO.getCompanyId()) { count = this.baseMapper.selectCount(new QueryWrapper() .lambda() - .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) - .ne(CourseDictDO::getId, courseDictDO.getCompanyId())); + .eq(CourseDictDO::getCourseName, updateCoursesDTO.getCourseName()) + .ne(CourseDictDO::getId, updateCoursesDTO.getCompanyId())); } else { count = this.baseMapper.selectCount(new QueryWrapper() .lambda() - .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) + .eq(CourseDictDO::getCourseName, updateCoursesDTO.getCourseName()) .isNull(CourseDictDO::getCompanyId)); } if (count > 0) { throw new HttpException(20001); } + CourseDictDO courseDictDO = this.baseMapper.selectById(updateCoursesDTO.getId()); + BeanUtils.copyProperties(updateCoursesDTO, courseDictDO); this.baseMapper.updateById(courseDictDO); + + //行业 + if (updateCoursesDTO.getFieldDictDOS().size() > 0) { + courseFieldMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CourseFieldMappingDO::getCourseId, updateCoursesDTO.getId())); + + List fieldDictDOS = updateCoursesDTO.getFieldDictDOS(); + for (FieldDictDO fieldDictDO : fieldDictDOS) { + CourseFieldMappingDO courseFieldMappingDO = new CourseFieldMappingDO(); + courseFieldMappingDO.setCourseId(updateCoursesDTO.getId()); + courseFieldMappingDO.setFieldMapping(fieldDictDO.getId()); + courseFieldMappingMapper.insert(courseFieldMappingDO); + } + } + + //类目 + if (updateCoursesDTO.getCategoryDOS().size() > 0) { + courseCategoryMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CourseCategoryMappingDO::getCourseId, updateCoursesDTO.getId())); + + List categoryDOS = updateCoursesDTO.getCategoryDOS(); + for (CategoryDO categoryDO : categoryDOS) { + CourseCategoryMappingDO courseCategoryMappingDO = new CourseCategoryMappingDO(); + courseCategoryMappingDO.setCourseId(updateCoursesDTO.getId()); + courseCategoryMappingDO.setCategoryId(categoryDO.getId()); + courseCategoryMappingMapper.insert(courseCategoryMappingDO); + } + } + + //岗位 + if (updateCoursesDTO.getJobDictDOS().size() > 0) { + courseJobMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CourseJobMappingDO::getCourseId, updateCoursesDTO.getId())); + + List jobDictDOS = updateCoursesDTO.getJobDictDOS(); + for (JobDictDO jobDictDO : jobDictDOS) { + CourseJobMappingDO courseJobMappingDO = new CourseJobMappingDO(); + courseJobMappingDO.setCourseId(updateCoursesDTO.getId()); + courseJobMappingDO.setJobId(jobDictDO.getId()); + courseJobMappingMapper.insert(courseJobMappingDO); + } + } + + //职级 + if (updateCoursesDTO.getRankDictDOS().size() > 0) { + courseJobMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CourseJobMappingDO::getCourseId, updateCoursesDTO.getId())); + + List rankDictDOS = updateCoursesDTO.getRankDictDOS(); + for (RankDictDO rankDictDO : rankDictDOS) { + CourseRankMappingDO courseRankMappingDO = new CourseRankMappingDO(); + courseRankMappingDO.setCourseId(updateCoursesDTO.getId()); + courseRankMappingDO.setRankId(rankDictDO.getId()); + courseRankMappingMapper.insert(courseRankMappingDO); + } + } return ConstantUtils.DELETE_SUCCESS; } public IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO) { Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize()); - return this.baseMapper.queryCompanyCourse(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getCourseType(), queryCoursesDTO.getCourseSource(), queryCoursesDTO.getCompanyId()); + IPage iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), null, queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(),null, queryCoursesDTO.getCompanyId()); + + List queryCoursesVOS = iPage.getRecords(); + for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) { + + //行业范围 + List fieldDictDOS = fieldDictMapper.queryCourseFields(queryCoursesVO.getId()); + queryCoursesVO.setFieldDictDOS(fieldDictDOS); + + //课程类目 + List categoryDOS = categoryMapper.queryCourseCategory(queryCoursesVO.getId()); + queryCoursesVO.setCategoryDOS(categoryDOS); + + //适用岗位 + List jobDictDOS = jobDictMapper.queryCourseJobs(queryCoursesVO.getId()); + queryCoursesVO.setJobDictDOS(jobDictDOS); + + //职级 + List rankDictDOS = rankDictMapper.queryCourseRanks(queryCoursesVO.getId()); + queryCoursesVO.setRankDictDOS(rankDictDOS); + + //课时 + Integer vodCnt = courseDictMapper.queryCourseCnt(queryCoursesVO.getId()); + queryCoursesVO.setVodCounts(vodCnt); + + //课程总时长 + Integer vodPlayLength = courseDictMapper.queryCoursePlayLength(queryCoursesVO.getId()); + queryCoursesVO.setVodLength(vodPlayLength); + + //测试数 + Integer paperCnt = paperDictMapper.queryCoursePapersCnt(queryCoursesVO.getId()); + queryCoursesVO.setPaperCount(paperCnt); + } + return this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getFieldId(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), queryCoursesDTO.getCourseType(), queryCoursesDTO.getCompanyId()); } + public String updateOpenStatus(CourseDictDO courseDictDO){ + this.baseMapper.updateOpenStatus(courseDictDO); + return ConstantUtils.SET_SUCCESS; + } } diff --git a/src/main/java/com/subsidy/service/impl/CourseJobMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseJobMappingServiceImpl.java new file mode 100644 index 0000000..956fbc7 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CourseJobMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.CourseJobMappingDO; +import com.subsidy.mapper.CourseJobMappingMapper; +import com.subsidy.service.CourseJobMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 课程-岗位映射表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Service +public class CourseJobMappingServiceImpl extends ServiceImpl implements CourseJobMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/CourseRankMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseRankMappingServiceImpl.java new file mode 100644 index 0000000..ad3ff5e --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CourseRankMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.CourseRankMappingDO; +import com.subsidy.mapper.CourseRankMappingMapper; +import com.subsidy.service.CourseRankMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 课程职级映射表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Service +public class CourseRankMappingServiceImpl extends ServiceImpl implements CourseRankMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java index 6a78594..847aa34 100644 --- a/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java @@ -1,9 +1,13 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.department.GetDepartmentMembersDTO; import com.subsidy.dto.department.GetDepartmentsVO; import com.subsidy.mapper.MemberDepartmentMappingMapper; +import com.subsidy.mapper.MemberMapper; import com.subsidy.model.DepartmentDictDO; import com.subsidy.mapper.DepartmentDictMapper; import com.subsidy.model.MemberDepartmentMappingDO; @@ -32,6 +36,9 @@ public class DepartmentDictServiceImpl extends ServiceImpl getDepartments(DepartmentDictDO departmentDictDO) { //返回结果 @@ -45,14 +52,14 @@ public class DepartmentDictServiceImpl extends ServiceImpl() - .lambda() - .eq(MemberDepartmentMappingDO::getDepartmentId,dd.getId())); + .lambda() + .eq(MemberDepartmentMappingDO::getDepartmentId, dd.getId())); getDepartmentsVO.setCnt(count); getDepartmentsVO.setChildren(getChildNodes(getDepartmentsVO)); DepartmentDictDO departmentDictDO1 = this.baseMapper.selectById(dd.getParentId()); - if (null != departmentDictDO1){ + if (null != departmentDictDO1) { getDepartmentsVO.setParentDepartmentName(departmentDictDO1.getDepartmentName()); } getDepartmentsVOS.add(getDepartmentsVO); @@ -78,15 +85,15 @@ public class DepartmentDictServiceImpl extends ServiceImpl() - .lambda() - .eq(MemberDepartmentMappingDO::getDepartmentId,getDepartmentsVO.getId())); + .lambda() + .eq(MemberDepartmentMappingDO::getDepartmentId, getDepartmentsVO.getId())); getDepartmentsVO.setCnt(count); DepartmentDictDO departmentDictDO2 = this.baseMapper.selectById(departmentDictDO1.getParentId()); - if (null != departmentDictDO2){ + if (null != departmentDictDO2) { getDepartmentsVO.setParentDepartmentName(departmentDictDO2.getDepartmentName()); } getDepartmentsVOS.add(getDepartmentsVO); @@ -122,7 +129,7 @@ public class DepartmentDictServiceImpl extends ServiceImpl + * 职级字典表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Service +public class RankDictServiceImpl extends ServiceImpl implements RankDictService { + + public String addRank(RankDictDO rankDictDO) { + + int count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(RankDictDO::getCompanyId, rankDictDO.getCompanyId()) + .eq(RankDictDO::getRank, rankDictDO.getRank())); + if (count > 0) { + throw new HttpException(12001); + } + + this.baseMapper.insert(rankDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteRank(RankDictDO rankDictDO) { + this.baseMapper.deleteById(rankDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateRank(RankDictDO rankDictDO) { + int count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(RankDictDO::getCompanyId, rankDictDO.getCompanyId()) + .eq(RankDictDO::getRank, rankDictDO.getRank()) + .ne(RankDictDO::getId, rankDictDO.getId())); + if (count > 0) { + throw new HttpException(12001); + } + + this.baseMapper.updateById(rankDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public List queryRanks(RankDictDO rankDictDO){ + return this.baseMapper.queryCompanyRanks(rankDictDO.getCompanyId()); + } +} diff --git a/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java b/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java index a85c1e3..104a321 100644 --- a/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java +++ b/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java @@ -7,44 +7,25 @@ public class ClassSummaryVO { private Long classId; - private String className; - - private String courseName; - - private String startDate; - - private String endDate; - /** * 学员总数 */ private Integer memberCount; /** - * 课程进度 - */ - private Integer studyVodCounts; - - /** - * 总课时 - */ - private Integer totalVodCounts; - - - /** - * 平均时长 + * 视频学习完人数 */ - private Integer avgVodPlayLength; + private Integer vodCnt; /** - * 测试通过率 + * 测试人数 */ - private Integer passRate; + private Integer passCnt; /** - * 平均签到数 + * 签到数 */ - private Integer avgSignCount; + private Integer signCount; /** * 答疑数 diff --git a/src/main/java/com/subsidy/vo/administer/ManageMemberVO.java b/src/main/java/com/subsidy/vo/administer/ManageMemberVO.java new file mode 100644 index 0000000..f34a728 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/ManageMemberVO.java @@ -0,0 +1,20 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class ManageMemberVO { + + private Long id; + + private String userName; + + private String telephone; + + private String idCard; + + private String companyName; + + private String accountName; + +} diff --git a/src/main/java/com/subsidy/vo/administer/OperatorsVO.java b/src/main/java/com/subsidy/vo/administer/OperatorsVO.java index c921359..bf2e7a7 100644 --- a/src/main/java/com/subsidy/vo/administer/OperatorsVO.java +++ b/src/main/java/com/subsidy/vo/administer/OperatorsVO.java @@ -22,11 +22,13 @@ public class OperatorsVO { private String img; + private String address; + private String companyName; private String accountName; - private Integer companyId; + private Long companyId; private String logo; } diff --git a/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java b/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java index 29cd7a5..a151b2e 100644 --- a/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java +++ b/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java @@ -21,4 +21,7 @@ public class GetAllClassesVO { private String classType; + private String openStatus; + + } diff --git a/src/main/java/com/subsidy/vo/classdict/GetClassBaseInfoVO.java b/src/main/java/com/subsidy/vo/classdict/GetClassBaseInfoVO.java new file mode 100644 index 0000000..fc659d7 --- /dev/null +++ b/src/main/java/com/subsidy/vo/classdict/GetClassBaseInfoVO.java @@ -0,0 +1,18 @@ +package com.subsidy.vo.classdict; + +import lombok.Data; + +@Data +public class GetClassBaseInfoVO { + + private String classType; + + private String courseName; + + private Integer count; + + private String startDate; + + private String endDate; + +} diff --git a/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java b/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java index fa3c8d0..2f20fbd 100644 --- a/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java +++ b/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java @@ -1,13 +1,18 @@ package com.subsidy.vo.course; +import com.subsidy.model.CategoryDO; import com.subsidy.model.CourseDictDO; +import com.subsidy.model.FieldDictDO; +import com.subsidy.model.JobDictDO; +import com.subsidy.model.RankDictDO; import lombok.Data; +import org.apache.poi.ss.formula.functions.Rank; + +import java.util.List; @Data public class QueryCoursesVO { - private String name; - private Long id; /** @@ -21,9 +26,9 @@ public class QueryCoursesVO { private String courseName; /** - * 类目id + * 封面 */ - private Long categoryId; + private String coverPage; /** * 课程类型 @@ -31,8 +36,44 @@ public class QueryCoursesVO { private String courseType; /** - * 课程来源 + * 课程时长 + */ + private Integer vodLength; + + /** + * 课时 + */ + private Integer vodCounts; + + /** + * 测试数量 + */ + private Integer paperCount; + + /** + * 开放状态 + */ + private Integer openStatus; + + /** + * 行业范围 + */ + private List fieldDictDOS; + + /** + * 课程类目 + */ + private List categoryDOS; + + /** + * 适用岗位 + */ + private List jobDictDOS; + + /** + * 适用职级 */ - private String courseSource; + private List rankDictDOS; + } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index dbc0753..cf4411d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ # 环境配置 -spring.profiles.active=prod +spring.profiles.active=dev # 端口号 -spring.server.port=23459 +spring.server.port=23457 #嵌入tomcat配置 #和CPU数 spring.server.acceptorThreadCount=600 diff --git a/src/main/resources/code.properties b/src/main/resources/code.properties index ad05e28..6e59202 100644 --- a/src/main/resources/code.properties +++ b/src/main/resources/code.properties @@ -42,4 +42,6 @@ meishu.code-message[90001]=该类目已存在 meishu.code-message[10001]=导入失败 -meishu.code-message[11001]=该行业已存在 \ No newline at end of file +meishu.code-message[11001]=该行业已存在 + +meishu.code-message[12001]=该职级已存在 diff --git a/src/main/resources/mapper/CategoryMapper.xml b/src/main/resources/mapper/CategoryMapper.xml index d896583..1c21f9a 100644 --- a/src/main/resources/mapper/CategoryMapper.xml +++ b/src/main/resources/mapper/CategoryMapper.xml @@ -19,4 +19,15 @@ id, name + diff --git a/src/main/resources/mapper/ClassDictMapper.xml b/src/main/resources/mapper/ClassDictMapper.xml index b621c71..30c2560 100644 --- a/src/main/resources/mapper/ClassDictMapper.xml +++ b/src/main/resources/mapper/ClassDictMapper.xml @@ -31,19 +31,29 @@ t.start_date, t.end_date, t4.cnt, - t.class_type + t5.class_type, + t.open_status FROM class_dict t + left join class_type_dict t5 on t.class_type_id = t5.id LEFT JOIN course_dict t2 ON t.course_id = t2.id LEFT JOIN ( SELECT t3.class_id, sum( 1 ) AS cnt FROM class_member_mapping t3 WHERE t3.delete_date IS NULL GROUP BY t3.class_id ) t4 ON t.id = t4.class_id WHERE t.delete_date IS NULL AND t2.delete_date IS NULL + and t5.delete_date is null and t.company_id = #{companyId} and t.class_name like concat('%',#{className} ,'%') + + and t.end_date >= DATE_FORMAT( #{startDate}, '%Y-%m-%d' ) + and t.start_date < DATE_FORMAT( #{endDateDate}, '%Y-%m-%d' ) + + + and t.open_status = #{openStatus} + order by t.create_date desc @@ -117,4 +127,22 @@ AND t.class_id = #{classId} + diff --git a/src/main/resources/mapper/CompanyDictMapper.xml b/src/main/resources/mapper/CompanyDictMapper.xml index fc958df..95b7e1f 100644 --- a/src/main/resources/mapper/CompanyDictMapper.xml +++ b/src/main/resources/mapper/CompanyDictMapper.xml @@ -30,21 +30,20 @@ t.account_name, t.img, t2.company_name, - t2.logo + t2.logo, + t2.address FROM administer t left join company_dict t2 on t.company_id = t2.id + left join company_field_mapping t3 on t2.id = t3.company_id WHERE t.delete_date IS NULL - AND t.role = #{role} + and role = 1 - and t2.company_name like concat('%',#{companyName} ,'%') + and t2.company_name like concat('%',#{companyName} ,'%') - - and t.user_name like concat('%',#{userName} ,'%') - - - and t.id = #{id} + + and t3.field_id = #{fieldId} diff --git a/src/main/resources/mapper/CourseCategoryMappingMapper.xml b/src/main/resources/mapper/CourseCategoryMappingMapper.xml new file mode 100644 index 0000000..b1dbeb3 --- /dev/null +++ b/src/main/resources/mapper/CourseCategoryMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, course_id, category_id + + + diff --git a/src/main/resources/mapper/CourseDictMapper.xml b/src/main/resources/mapper/CourseDictMapper.xml index af12a15..e1c2d9d 100644 --- a/src/main/resources/mapper/CourseDictMapper.xml +++ b/src/main/resources/mapper/CourseDictMapper.xml @@ -17,32 +17,47 @@ @@ -90,37 +105,32 @@ AND t.administer_id is null - SELECT - t.id, - t.company_id, - t.course_name, - t.category_id, - t.course_type, - t.course_source, - t2.name + count( 1 ) FROM - course_dict t - left join category t2 on t.category_id = t2.id + course_content t1 + LEFT JOIN vod_dict t2 ON t1.id = t2.content_id WHERE - t.delete_date IS NULL - - AND t.category_id = #{categoryId} - - - AND t.course_name like concat('%',#{courseName} ,'%') - - - AND t.course_source = #{courseSource} - - - AND t.course_type = #{courseType} - - - AND t.company_id = #{companyId} - + t1.delete_date IS NULL + AND t2.delete_date IS NULL + AND t1.course_id = #{courseId} + + + update course_dict set open_status = #{openStatus} where id = #{id} + diff --git a/src/main/resources/mapper/CourseJobMappingMapper.xml b/src/main/resources/mapper/CourseJobMappingMapper.xml new file mode 100644 index 0000000..4e6ae89 --- /dev/null +++ b/src/main/resources/mapper/CourseJobMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, job_id, course_id + + + diff --git a/src/main/resources/mapper/CourseRankMappingMapper.xml b/src/main/resources/mapper/CourseRankMappingMapper.xml new file mode 100644 index 0000000..156b9eb --- /dev/null +++ b/src/main/resources/mapper/CourseRankMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, course_id, rank_id + + + diff --git a/src/main/resources/mapper/DepartmentDictMapper.xml b/src/main/resources/mapper/DepartmentDictMapper.xml index bb55b2c..23af1a9 100644 --- a/src/main/resources/mapper/DepartmentDictMapper.xml +++ b/src/main/resources/mapper/DepartmentDictMapper.xml @@ -33,4 +33,5 @@ + diff --git a/src/main/resources/mapper/FieldDictMapper.xml b/src/main/resources/mapper/FieldDictMapper.xml index c7e254d..a1785f9 100644 --- a/src/main/resources/mapper/FieldDictMapper.xml +++ b/src/main/resources/mapper/FieldDictMapper.xml @@ -30,4 +30,27 @@ AND t.field_name LIKE concat('%',#{fieldName} ,'%') + + + diff --git a/src/main/resources/mapper/JobDictMapper.xml b/src/main/resources/mapper/JobDictMapper.xml index cf66439..2d2b86c 100644 --- a/src/main/resources/mapper/JobDictMapper.xml +++ b/src/main/resources/mapper/JobDictMapper.xml @@ -21,4 +21,16 @@ id, company_id, job_name, order_no + + diff --git a/src/main/resources/mapper/MemberMapper.xml b/src/main/resources/mapper/MemberMapper.xml index 3bd8c95..1a7fcc0 100644 --- a/src/main/resources/mapper/MemberMapper.xml +++ b/src/main/resources/mapper/MemberMapper.xml @@ -184,4 +184,26 @@ + + diff --git a/src/main/resources/mapper/PaperDictMapper.xml b/src/main/resources/mapper/PaperDictMapper.xml index 1452d50..640b614 100644 --- a/src/main/resources/mapper/PaperDictMapper.xml +++ b/src/main/resources/mapper/PaperDictMapper.xml @@ -49,4 +49,14 @@ AND t.paper_id = #{paperId} + + diff --git a/src/main/resources/mapper/RankDictMapper.xml b/src/main/resources/mapper/RankDictMapper.xml new file mode 100644 index 0000000..8b4d9f0 --- /dev/null +++ b/src/main/resources/mapper/RankDictMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, rank + + + + + + +