Commit 6dad6971 by 涂亚平

班级通知表同步下

1 parent 49d090c5
Showing with 1257 additions and 161 deletions
......@@ -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));
}
}
......@@ -66,5 +66,4 @@ public class CategoryController {
return ResponseData.generateCreatedResponse(0,categoryService.updateCategory(categoryDO));
}
}
......@@ -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));
}
}
......@@ -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));
......
package com.subsidy.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 课程类目映射 前端控制器
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
@RestController
@Api(tags = "课程类目映射")
@RequestMapping("/course-category-mapping-do")
public class CourseCategoryMappingController {
}
......@@ -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));
}
}
package com.subsidy.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 课程-岗位映射表 前端控制器
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
@RestController
@Api(tags = "课程-岗位映射表")
@RequestMapping("/course-job-mapping-do")
public class CourseJobMappingController {
}
package com.subsidy.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 课程职级映射表 前端控制器
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
@RestController
@Api(tags = "课程职级映射表")
@RequestMapping("/course-rank-mapping-do")
public class CourseRankMappingController {
}
......@@ -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));
}
}
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;
/**
* <p>
* 职级字典表 前端控制器
* </p>
*
* @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));
}
}
package com.subsidy.dto.administer;
import lombok.Data;
@Data
public class ManageMemberDTO {
private Integer pageSize;
private Integer pageNum;
private String userName;
}
......@@ -11,6 +11,8 @@ public class OperatorsDTO {
private Integer role;
private Long fieldId;
private String companyName;
private String userName;
......
......@@ -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<Long> field;
}
......@@ -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<Long> teacherIds;
private Long companyId;
}
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<FieldDictDO> fieldDictDOS;
/**
* 课程类目
*/
private List<CategoryDO> categoryDOS;
/**
* 适用岗位
*/
private List<JobDictDO> jobDictDOS;
/**
* 适用职级
*/
private List<RankDictDO> rankDictDOS;
}
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;
}
......@@ -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;
/**
* <p>
* 类目名称 Mapper 接口
......@@ -12,7 +14,13 @@ import org.springframework.stereotype.Repository;
* @author DengMin
* @since 2021-10-11
*/
@Repository
@Repository
public interface CategoryMapper extends BaseMapper<CategoryDO> {
/**
* 查看某个课程下的所有类目
*/
List<CategoryDO> queryCourseCategory(Long courseId);
}
......@@ -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<ClassDictDO> {
*/
List<MemberDO> classMembers(Long classId);
/**
* 班级详情--获取课程基本信息
*/
GetClassBaseInfoVO getClassBaseInfo(Long classId);
}
......@@ -21,11 +21,10 @@ import java.util.List;
public interface CompanyDictMapper extends BaseMapper<CompanyDictDO> {
/**
* 查找运营者
*
* 企业管理--查找所有主账号
* @return
*/
IPage<OperatorsVO> operators(IPage page, String companyName,Integer id, String userName,Integer role);
IPage<OperatorsVO> operators(IPage page, String companyName,Long fieldId);
/**
* 查找所有的公司名称
......
package com.subsidy.mapper;
import com.subsidy.model.CourseCategoryMappingDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 课程类目映射 Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
@Repository
public interface CourseCategoryMappingMapper extends BaseMapper<CourseCategoryMappingDO> {
}
......@@ -22,10 +22,11 @@ import java.util.List;
public interface CourseDictMapper extends BaseMapper<CourseDictDO> {
/**
* 查询全部课程
* 运营者查询全部课程
* courseName fieldId categoryId jobId courseRank courseType
* @return
*/
IPage<QueryCoursesVO > queryCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId);
IPage<QueryCoursesVO > 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<CourseDictDO> {
IPage<QueryCoursesVO > queryPublicCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource);
/**
* 查询企业内部课程
* 查看课程下有多少课时
*/
IPage<QueryCoursesVO> 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);
}
package com.subsidy.mapper;
import com.subsidy.model.CourseJobMappingDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 课程-岗位映射表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
@Repository
public interface CourseJobMappingMapper extends BaseMapper<CourseJobMappingDO> {
}
package com.subsidy.mapper;
import com.subsidy.model.CourseRankMappingDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 课程职级映射表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
@Repository
public interface CourseRankMappingMapper extends BaseMapper<CourseRankMappingDO> {
}
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<DepartmentDictDO> {
//List<GetDepartmentsVO> getDepartments(DepartmentDictDO departmentDictDO);
}
......@@ -21,5 +21,16 @@ public interface FieldDictMapper extends BaseMapper<FieldDictDO> {
IPage<FieldDictDO> queryFields(IPage ipage, String fieldName);
/**
* 查看公司所有的行业
* @param companyId
* @return
*/
List<FieldDictDO> queryCompanyFields(Long companyId);
/**
* 查看课程所属行业
*/
List<FieldDictDO> queryCourseFields(Long courseId);
}
......@@ -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;
/**
* <p>
* 岗位表 Mapper 接口
......@@ -12,7 +14,13 @@ import org.springframework.stereotype.Repository;
* @author DengMin
* @since 2022-02-10
*/
@Repository
@Repository
public interface JobDictMapper extends BaseMapper<JobDictDO> {
/**
* 获取某个课程适用的所有岗位
*/
List<JobDictDO> queryCourseJobs(Long courseId);
}
......@@ -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<MemberDO> {
*/
UserRoleVO passwordLogin(PasswordLoginDTO passwordLoginDTO);
/**
* 查看学生的课程[废弃]
*/
......@@ -48,6 +48,11 @@ public interface MemberMapper extends BaseMapper<MemberDO> {
/**
* 查询部门所有的学生
*/
IPage<GetAllVO > getMembers(IPage iPage,Long departmentId,String userName,String status);
IPage<GetAllVO> getMembers(IPage iPage,Long departmentId,String userName,String status);
/**
* 查询某公司所有的学生 公司不传就是查平台所有学生
*/
IPage<ManageMemberVO> manageMember(IPage iPage,Long companyId,String userName);
}
......@@ -28,4 +28,10 @@ public interface PaperDictMapper extends BaseMapper<PaperDictDO> {
* 查看某个卷子有多少人完成 卷子id
*/
Integer completeCount(Long paperId);
/**
* 查看某个课程下有多少卷子
*/
Integer queryCoursePapersCnt(Long courseId);
}
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;
/**
* <p>
* 职级字典表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
@Repository
public interface RankDictMapper extends BaseMapper<RankDictDO> {
/**
* 查看某个课程的职级
*/
List<RankDictDO> queryCourseRanks(Long courseId);
/**
* 查看某个公司的职级
*/
List<RankDictDO> queryCompanyRanks(Long companyId);
}
......@@ -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;
}
......@@ -44,7 +44,11 @@ public class ClassNoticeDO extends BaseModel {
/**
* 通知时间
*/
private LocalDateTime noticeTime;
private String noticeTime;
/**
* 发送状态
*/
private String status;
}
......@@ -46,10 +46,9 @@ public class CompanyDictDO extends BaseModel {
private String banner;
/**
* 领域
* 地址
*/
private String field;
private String address;
}
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;
/**
* <p>
* 课程类目映射
* </p>
*
* @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;
}
......@@ -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;
}
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;
/**
* <p>
* 课程-岗位映射表
* </p>
*
* @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;
}
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;
/**
* <p>
* 课程职级映射表
* </p>
*
* @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;
}
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;
/**
* <p>
* 职级字典表
* </p>
*
* @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;
}
......@@ -76,4 +76,5 @@ public interface AdministerService extends IService<AdministerDO> {
String importMember(Long companyId, MultipartFile multipartFile);
IPage<ManageMemberVO> manageMember(ManageMemberDTO manageMemberDTO);
}
......@@ -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<ClassDictDO> {
String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO);
String batchSms(ClassDictDO classDictDO);
GetClassBaseInfoVO getClassBaseInfo(ClassDictDO classDictDO);
}
package com.subsidy.service;
import com.subsidy.model.CourseCategoryMappingDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 课程类目映射 服务类
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
public interface CourseCategoryMappingService extends IService<CourseCategoryMappingDO> {
}
......@@ -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<CourseDictDO> {
IPage queryCourses(QueryCoursesDTO queryCoursesDTO);
String updateCourses(CourseDictDO courseDictDO);
String updateCourses(UpdateCoursesDTO updateCoursesDTO);
IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO);
String updateOpenStatus(CourseDictDO courseDictDO);
}
package com.subsidy.service;
import com.subsidy.model.CourseJobMappingDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 课程-岗位映射表 服务类
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
public interface CourseJobMappingService extends IService<CourseJobMappingDO> {
}
package com.subsidy.service;
import com.subsidy.model.CourseRankMappingDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 课程职级映射表 服务类
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
public interface CourseRankMappingService extends IService<CourseRankMappingDO> {
}
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<DepartmentDictDO> {
String deleteDepartment(DepartmentDictDO departmentDictDO);
String updateDepartment(DepartmentDictDO departmentDictDO);
IPage getDepartmentMembers(GetDepartmentMembersDTO getDepartmentMembersDTO);
}
package com.subsidy.service;
import com.subsidy.model.RankDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 职级字典表 服务类
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
public interface RankDictService extends IService<RankDictDO> {
String addRank(RankDictDO rankDictDO);
String deleteRank(RankDictDO rankDictDO);
String updateRank(RankDictDO rankDictDO);
List<RankDictDO> queryRanks(RankDictDO rankDictDO);
}
......@@ -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<ClassDictMapper, ClassDict
@Autowired
private ClassNoticeMapper classNoticeMapper;
@Autowired
private AnsweringQuestionMapper answeringQuestionMapper;
public List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO) {
return this.baseMapper.getAllClasses(classDictDO);
......@@ -72,12 +77,12 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
//新建一个班级
ClassDictDO classDictDO = new ClassDictDO();
BeanUtils.copyProperties(addClassDTO,classDictDO);
BeanUtils.copyProperties(addClassDTO, classDictDO);
this.baseMapper.insert(classDictDO);
//班级里添加成员
List<Long> 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<ClassDictMapper, ClassDict
//添加通知
List<ClassNoticeDO> 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<ClassDictMapper, ClassDict
.lambda()
.eq(ClassMemberMappingDO::getClassId, classMemberMappingDO.getClassId())
.eq(ClassMemberMappingDO::getMemberId, classMemberMappingDO.getMemberId()));
//签到记录
//做题记录
//答疑记录也删除
answeringQuestionMapper.delete(new QueryWrapper<AnsweringQuestionDO>()
.lambda()
.eq(AnsweringQuestionDO::getAskId,classMemberMappingDO.getMemberId())
.eq(AnsweringQuestionDO::getClassId,classMemberMappingDO.getClassId()));
return ConstantUtils.DELETE_SUCCESS;
}
public List<MemberDO> getSpareMembers(GetSpareMembersDTO getSpareMembersDTO){
public List<MemberDO> getSpareMembers(GetSpareMembersDTO getSpareMembersDTO) {
return this.baseMapper.getSpareMembers(getSpareMembersDTO);
}
public String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO){
public String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO) {
List<Long> 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<ClassDictMapper, ClassDict
return ConstantUtils.ADD_SUCCESS;
}
public String batchSms(ClassDictDO classDictDO){
public String batchSms(ClassDictDO classDictDO) {
ClassDictDO classDictDO1 = this.baseMapper.selectById(classDictDO.getId());
CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO1.getCourseId());
......@@ -136,17 +150,21 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
List<MemberDO> 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());
}
}
......@@ -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<CompanyDictMapper, Compa
@Autowired
private RedisUtil redisUtil;
@Autowired
private FieldDictMapper fieldDictMapper;
@Autowired
private CompanyFieldMappingMapper companyFieldMappingMapper;
public IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO) {
Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize());
//判断该用户的角色
Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper<RoleAdministerMappingDO>()
.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<OperatorsVO> operatorsVOS = page.getRecords();
for (OperatorsVO operatorsVO : operatorsVOS) {
//查看公司所在行业
List<FieldDictDO> 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<CompanyDictMapper, Compa
.lambda()
.eq(CompanyDictDO::getCompanyName, addCompanyDTO.getAccountName()));
if (count > 0 ) {
if (count > 0) {
throw new HttpException(20002);
}
......@@ -124,6 +132,15 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
classHourDictDO2.setRepeatStatus(0);
classHourDictDO2.setRepeatTime(3);
redisUtil.set(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX + companyDictDO.getId(), classHourDictDO2);
//行业
List<Long> 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<CompanyDictMapper, Compa
.lambda()
.eq(AdministerDO::getCompanyId, companyDictDO.getId()));
redisUtil.del(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX+companyDictDO.getId());
redisUtil.del(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX + companyDictDO.getId());
return ConstantUtils.DELETE_SUCCESS;
}
......@@ -145,6 +162,20 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
BeanUtils.copyProperties(addCompanyDTO, companyDictDO);
this.baseMapper.updateById(companyDictDO);
if (addCompanyDTO.getField().size() > 0) {
companyFieldMappingMapper.delete(new QueryWrapper<CompanyFieldMappingDO>()
.lambda()
.eq(CompanyFieldMappingDO::getCompanyId, addCompanyDTO.getId()));
List<Long> 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<AdministerDO>()
.lambda()
......
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;
/**
* <p>
* 课程类目映射 服务实现类
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
@Service
public class CourseCategoryMappingServiceImpl extends ServiceImpl<CourseCategoryMappingMapper, CourseCategoryMappingDO> implements CourseCategoryMappingService {
}
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;
/**
* <p>
* 课程-岗位映射表 服务实现类
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
@Service
public class CourseJobMappingServiceImpl extends ServiceImpl<CourseJobMappingMapper, CourseJobMappingDO> implements CourseJobMappingService {
}
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;
/**
* <p>
* 课程职级映射表 服务实现类
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
@Service
public class CourseRankMappingServiceImpl extends ServiceImpl<CourseRankMappingMapper, CourseRankMappingDO> implements CourseRankMappingService {
}
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<DepartmentDictMapper,
@Autowired
private MemberDepartmentMappingMapper memberDepartmentMappingMapper;
@Autowired
private MemberMapper memberMapper;
public List<GetDepartmentsVO> getDepartments(DepartmentDictDO departmentDictDO) {
//返回结果
......@@ -45,14 +52,14 @@ public class DepartmentDictServiceImpl extends ServiceImpl<DepartmentDictMapper,
for (DepartmentDictDO dd : parentNodes) {
GetDepartmentsVO getDepartmentsVO = new GetDepartmentsVO();
BeanUtils.copyProperties(dd,getDepartmentsVO);
BeanUtils.copyProperties(dd, getDepartmentsVO);
Integer count = memberDepartmentMappingMapper.selectCount(new QueryWrapper<MemberDepartmentMappingDO>()
.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<DepartmentDictMapper,
for (DepartmentDictDO departmentDictDO1 : departmentDictDOS) {
GetDepartmentsVO getDepartmentsVO = new GetDepartmentsVO();
BeanUtils.copyProperties(departmentDictDO1,getDepartmentsVO);
BeanUtils.copyProperties(departmentDictDO1, getDepartmentsVO);
getDepartmentsVO.setChildren(getChildNodes(getDepartmentsVO));
Integer count = memberDepartmentMappingMapper.selectCount(new QueryWrapper<MemberDepartmentMappingDO>()
.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<DepartmentDictMapper,
.eq(DepartmentDictDO::getParentId, departmentDictDO.getId())
);
for (DepartmentDictDO departmentDictDO1:departmentDictDOS){
for (DepartmentDictDO departmentDictDO1 : departmentDictDOS) {
deleteChildNode(departmentDictDO1);
}
......@@ -157,4 +164,19 @@ public class DepartmentDictServiceImpl extends ServiceImpl<DepartmentDictMapper,
return ConstantUtils.SET_SUCCESS;
}
public IPage getDepartmentMembers(GetDepartmentMembersDTO getDepartmentMembersDTO) {
Page pager = new Page(getDepartmentMembersDTO.getPageNum(), getDepartmentMembersDTO.getPageSize());
if (null != getDepartmentMembersDTO.getDepartmentId()){
//查询某个部门
IPage iPage = memberMapper.getMembers(pager,getDepartmentMembersDTO.getDepartmentId(),getDepartmentMembersDTO.getUserName(),null);
return iPage;
}else {
//查询整个公司
IPage iPage = memberMapper.manageMember(pager,getDepartmentMembersDTO.getCompanyId(),getDepartmentMembersDTO.getUserName());
return iPage;
}
}
}
package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.subsidy.common.exception.HttpException;
import com.subsidy.model.RankDictDO;
import com.subsidy.mapper.RankDictMapper;
import com.subsidy.service.RankDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
import org.apache.poi.ss.formula.functions.Rank;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 职级字典表 服务实现类
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
@Service
public class RankDictServiceImpl extends ServiceImpl<RankDictMapper, RankDictDO> implements RankDictService {
public String addRank(RankDictDO rankDictDO) {
int count = this.baseMapper.selectCount(new QueryWrapper<RankDictDO>()
.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<RankDictDO>()
.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<RankDictDO> queryRanks(RankDictDO rankDictDO){
return this.baseMapper.queryCompanyRanks(rankDictDO.getCompanyId());
}
}
......@@ -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;
/**
* 答疑数
......
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;
}
......@@ -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;
}
......@@ -21,4 +21,7 @@ public class GetAllClassesVO {
private String classType;
private String openStatus;
}
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;
}
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<FieldDictDO> fieldDictDOS;
/**
* 课程类目
*/
private List<CategoryDO> categoryDOS;
/**
* 适用岗位
*/
private List<JobDictDO> jobDictDOS;
/**
* 适用职级
*/
private String courseSource;
private List<RankDictDO> rankDictDOS;
}
# 环境配置
spring.profiles.active=prod
spring.profiles.active=dev
# 端口号
spring.server.port=23459
spring.server.port=23457
#嵌入tomcat配置
#和CPU数
spring.server.acceptorThreadCount=600
......
......@@ -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]=该职级已存在
......@@ -19,4 +19,15 @@
id, name
</sql>
<select id="queryCourseCategory" parameterType="long" resultType="com.subsidy.model.CategoryDO">
SELECT
t2.*
FROM
course_category_mapping t
LEFT JOIN category t2 ON t.category_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
and t.course_id = #{courseId}
</select>
</mapper>
......@@ -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}
<if test="className != null and className !=''">
and t.class_name like concat('%',#{className} ,'%')
</if>
<if test="startDate != null and endDate != null">
and t.end_date >= DATE_FORMAT( #{startDate}, '%Y-%m-%d' )
and t.start_date &lt; DATE_FORMAT( #{endDateDate}, '%Y-%m-%d' )
</if>
<if test="openStatus != null and openStatus != ''">
and t.open_status = #{openStatus}
</if>
order by t.create_date desc
</select>
......@@ -117,4 +127,22 @@
AND t.class_id = #{classId}
</select>
<select id="getClassBaseInfo" parameterType="long" resultType="com.subsidy.vo.classdict.GetClassBaseInfoVO">
SELECT
t3.class_type,
t2.course_name,
t.start_date,
t.end_date,
ifnull( t4.cnt, 0 ) AS cnt
FROM
class_dict t
LEFT JOIN course_dict t2 ON t.course_id = t2.id
LEFT JOIN class_type_dict t3 ON t.class_type_id = t3.id
LEFT JOIN ( SELECT t.class_id, count( 1 ) AS cnt FROM class_member_mapping t WHERE t.delete_date IS NULL AND t.class_id = #{classId} ) t4 ON t.id = t4.class_id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
AND t.id = #{classId}
</select>
</mapper>
......@@ -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
<if test="companyName != null and companyName != ''">
and t2.company_name like concat('%',#{companyName} ,'%')
and t2.company_name like concat('%',#{companyName} ,'%')
</if>
<if test="userName != null and userName != ''">
and t.user_name like concat('%',#{userName} ,'%')
</if>
<if test="id != null and id !=''">
and t.id = #{id}
<if test="fieldId != null and fieldId != ''">
and t3.field_id = #{fieldId}
</if>
</select>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.CourseCategoryMappingMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.CourseCategoryMappingDO">
<id column="id" property="id" />
<result column="create_date" property="createDate" />
<result column="update_date" property="updateDate" />
<result column="delete_date" property="deleteDate" />
<result column="course_id" property="courseId" />
<result column="category_id" property="categoryId" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, course_id, category_id
</sql>
</mapper>
......@@ -17,32 +17,47 @@
<!-- 通用查询结果列 -->
<select id="queryCourses" resultType="com.subsidy.vo.course.QueryCoursesVO">
SELECT
t.*,
t2.name
t.id,
t.course_name,
t.course_rank,
t.course_type,
t.open_status
FROM
course_dict t
left join category t2 on t.category_id = t2.id
course_dict t
LEFT JOIN course_field_mapping t2 ON t.id = t2.course_id
LEFT JOIN course_category_mapping t3 ON t.id = t3.course_id
LEFT JOIN course_job_mapping t4 ON t.id = t4.course_id
left join course_rank_mapping t5 on t.id = t5.course_id
WHERE
t.delete_date IS NULL
<if test="companyId != null and companyId !=''" >
and t.company_id = #{companyId}
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
AND t4.delete_date IS NULL
and t5.delete_date is null
<if test="companyId != null and companyId != ''">
and t.company_id = #{companyId}
</if>
<if test="companyId ==null">
<if test="companyId == null">
and t.company_id is null
</if>
<if test="categoryId != null">
AND t.category_id = #{categoryId}
</if>
<if test="courseName != null and courseName !=''">
AND t.course_name like concat('%',#{courseName} ,'%')
</if>
<if test="courseSource != null and courseSource != ''">
AND t.course_source = #{courseSource}
</if>
<if test="courseType != null and courseType !=''">
AND t.course_type = #{courseType}
</if>
<if test="jobId != null and jobId != ''">
and t4.job_id = #{jobId}
</if>
<if test="categoryId != null and categoryId != ''">
and t3.category_id = #{categoryId}
</if>
<if test="fieldId != null and fieldId != ''">
and t2.field_id = #{field}
</if>
<if test="rankId != null and rankId != ''">
and t5.rank_id = #{rankId}
</if>
</select>
<sql id="Base_Column_List">
......@@ -90,37 +105,32 @@
AND t.administer_id is null
</select>
<select id="queryCompanyCourse" resultType="com.subsidy.vo.course.QueryCoursesVO">
<select id="queryCourseCnt" parameterType="long" resultType="integer">
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
<if test="categoryId != null">
AND t.category_id = #{categoryId}
</if>
<if test="courseName != null and courseName !=''">
AND t.course_name like concat('%',#{courseName} ,'%')
</if>
<if test="courseSource != null and courseSource != ''">
AND t.course_source = #{courseSource}
</if>
<if test="courseType != null and courseType !=''">
AND t.course_type = #{courseType}
</if>
<if test="companyId !=null and companyId !='' ">
AND t.company_id = #{companyId}
</if>
t1.delete_date IS NULL
AND t2.delete_date IS NULL
AND t1.course_id = #{courseId}
</select>
<select id="queryCoursePlayLength" parameterType="long" resultType="integer">
SELECT
sum( t2.vod_length )
FROM
course_content t1
LEFT JOIN vod_dict t2 ON t1.id = t2.content_id
WHERE
t1.delete_date IS NULL
AND t2.delete_date IS NULL
AND t1.course_id = #{courseId}
</select>
<update id="updateOpenStatus">
update course_dict set open_status = #{openStatus} where id = #{id}
</update>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.CourseJobMappingMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.CourseJobMappingDO">
<id column="id" property="id" />
<result column="create_date" property="createDate" />
<result column="update_date" property="updateDate" />
<result column="delete_date" property="deleteDate" />
<result column="job_id" property="jobId" />
<result column="course_id" property="courseId" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, job_id, course_id
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.CourseRankMappingMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.CourseRankMappingDO">
<id column="id" property="id" />
<result column="create_date" property="createDate" />
<result column="update_date" property="updateDate" />
<result column="delete_date" property="deleteDate" />
<result column="course_id" property="courseId" />
<result column="rank_id" property="rankId" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, course_id, rank_id
</sql>
</mapper>
......@@ -33,4 +33,5 @@
<!-- AND t.company_id =#{companyId}-->
<!-- </select>-->
</mapper>
......@@ -30,4 +30,27 @@
AND t.field_name LIKE concat('%',#{fieldName} ,'%')
</select>
<select id="queryCompanyFields" parameterType="long" resultType="com.subsidy.model.FieldDictDO">
SELECT
t2.*
FROM
company_field_mapping t
LEFT JOIN field_dict t2 ON t.field_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.company_id = #{companyId}
</select>
<select id="queryCourseFields" parameterType="long" resultType="com.subsidy.model.FieldDictDO">
SELECT
t2.*
FROM
course_field_mapping t
LEFT JOIN field_dict t2 ON t.field_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.course_id = #{courseId}
</select>
</mapper>
......@@ -21,4 +21,16 @@
id, company_id, job_name, order_no
</sql>
<select id="queryCourseJobs" parameterType="long" resultType="com.subsidy.model.JobDictDO">
SELECT
t2.*
FROM
course_job_mapping t
LEFT JOIN job_dict t2 ON t.job_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.course_id = #{courseId}
</select>
</mapper>
......@@ -184,4 +184,26 @@
</if>
</select>
<select id="manageMember" parameterType="string" resultType="com.subsidy.vo.administer.ManageMemberVO">
SELECT
t.id,
t.user_name,
t.telephone,
t.id_card,
t.account_name,
t2.company_name
FROM
member t
LEFT JOIN company_dict t2 ON t.company_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
<if test="userName != null and userName != ''">
AND t.user_name LIKE concat('%',#{userName} ,'%')
</if>
<if test="companyId != null and companyId != ''">
and t2.company_id = #{companyId}
</if>
</select>
</mapper>
......@@ -49,4 +49,14 @@
AND t.paper_id = #{paperId}
</select>
<select id="queryCoursePapersCnt" parameterType="long" resultType="integer">
SELECT
count( 1 )
FROM
paper_dict t
WHERE
t.delete_date IS NULL
AND t.course_id = #{courseId}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.RankDictMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.RankDictDO">
<id column="id" property="id" />
<result column="create_date" property="createDate" />
<result column="update_date" property="updateDate" />
<result column="delete_date" property="deleteDate" />
<result column="rank" property="rank" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, rank
</sql>
<select id="queryCourseRanks" parameterType="long" resultType="com.subsidy.model.RankDictDO">
SELECT
t2.*
FROM
course_rank_mapping t
LEFT JOIN rank_dict t2 ON t.rank_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.course_id = #{courseId}
</select>
<select id="queryCompanyRanks" parameterType="long" resultType="com.subsidy.model.RankDictDO">
select * from rank_dict t where t.delete_date is null
<if test="companyId!=null and companyId != ''">
and t.company_id = #{companyId}
</if>
<if test="companyId == null">
and t.company_id is null
</if>
</select>
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!