修改教学管理功能

This commit is contained in:
joylink_zhangsai 2021-03-25 15:03:43 +08:00
parent cec0d058cd
commit 38da216a31
90 changed files with 1555 additions and 1042 deletions

60
sql/20210324-zhangsai.sql Normal file
View File

@ -0,0 +1,60 @@
alter table org_lesson
add creator_id bigint not null comment '创建人id';
alter table org_lesson
add create_time datetime default current_timestamp not null comment '创建时间';
-- 删除外键
alter table org drop foreign key FK_company_department_company_department1;
alter table org_lesson drop foreign key org_lesson_ibfk_1;
alter table org_lesson drop foreign key org_lesson_ibfk_2;
alter table org_user drop foreign key FK_department_user_company_department1;
alter table org_user drop foreign key FK_department_user_sys_use1r;
alter table org_exam drop foreign key org_exam_ibfk_1;
alter table org_exam drop foreign key org_exam_ibfk_2;
-- 修改id数据类型
alter table org modify id bigint auto_increment;
alter table org modify parent_id bigint null comment '父级id';
alter table org modify root_id bigint null comment '单位id';
alter table race_question_progress modify company_id bigint null;
alter table race_result modify company_id bigint null comment '公司id';
alter table race_question modify company_id bigint null comment '公司题库';
alter table race_questions_rules modify company_id bigint null;
-- 添加字段
alter table org_scoring_rule_rel
add rule_org_id bigint not null comment '规则关联的顶级组织id',
add rule_school_year varchar(16) not null comment '规则所属学年',
add rule_term int(1) not null comment '规则所属学期',
add rule_creator_id bigint not null comment '创建者id';
alter table org_scoring_rule_rel modify org_id bigint not null;
alter table org_lesson modify org_id bigint not null comment '班级id';
alter table org_scoring_rule modify org_id bigint not null comment '该规则属于哪个顶级组织';
alter table org_user modify org_id bigint not null comment '部门id';

View File

@ -42,108 +42,84 @@ public class OrgController {
@ApiOperation(value = "创建顶级组织")
@PostMapping
public CompanyVO create(@RequestBody @Validated CompanyVO company, @RequestAttribute(AuthenticateInterceptor.LOGIN_USER_KEY) UserVO user) {
return iOrgUserService.create(company, user);
return iOrgService.createTopOrg(company, user);
}
@ApiOperation(value = "获取公司列表")
@GetMapping
public List<CompanyVO> queryAll() {
List<CompanyVO> list = iOrgUserService.queryOrganizations();
return list;
return iOrgService.queryAllTopOrg();
}
@ApiOperation(value = "分页获取公司列表")
@GetMapping("paging")
public PageVO<CompanyVO> pagingQueryAll(OrgQueryVO queryVO) {
return iOrgUserService.queryPageOrganizations(queryVO);
}
@ApiOperation(value = "删除公司信息")
@DeleteMapping("{id}")
public void delete(@PathVariable Integer id) {
iOrgUserService.deleteCompanyById(id);
return iOrgService.pagedQueryAllTopOrg(queryVO);
}
@ApiOperation(value = "查询公司信息")
@GetMapping("{id}")
public CompanyVO get(@PathVariable Integer id) {
return iOrgUserService.getCompanyById(id);
public CompanyVO get(@PathVariable Long id) {
return iOrgService.get(id);
}
@ApiOperation(value = "更新公司信息")
@PutMapping("{id}")
public CompanyVO updateCompany(@PathVariable Integer id, @RequestBody @Validated CompanyVO company, @RequestAttribute UserVO user) {
public CompanyVO updateCompany(@PathVariable Long id, @RequestBody @Validated CompanyVO company, @RequestAttribute UserVO user) {
return iOrgService.updateOrg(id, company, user);
}
// @Role({RoleEnum.Admin, RoleEnum.SuperAdmin})
// @ApiOperation("添加公司管理者")
// @PutMapping("/{companyId}/addManager")
// public void addManager(@PathVariable Integer companyId, @RequestBody List<Long> userIds, @RequestAttribute @ApiIgnore UserVO user) {
// iOrgUserService.addManager(companyId, userIds, user);
// }
//
// @Role({RoleEnum.Admin, RoleEnum.SuperAdmin})
// @ApiOperation("取消公司管理者")
// @PutMapping("/{companyId}/removeManager")
// public void addManager(@PathVariable Integer companyId, @RequestBody List<Long> userIds, @RequestAttribute @ApiIgnore UserVO user) {
// iOrgUserService.removeManager(companyId, userIds, user);
// }
@ApiOperation(value = "微信小程用户绑定为单位管理员")
@PutMapping(path = "/bind/company")
public CompanyVO userScanCodeBindCompany(Long userId, @NotBlank Integer companyId) {
public CompanyVO userScanCodeBindCompany(Long userId, @NotBlank Long companyId) {
return iOrgUserService.userScanCodeBindCompanyManager(userId, companyId);
}
@ApiOperation(value = "添加部门信息")
@PostMapping(path = "/dept")
public DepartmentVO createDepart(@RequestBody @Validated DepartmentVO departmentVO) {
DepartmentVO vo = iOrgUserService.createDepart(departmentVO);
return vo;
return iOrgUserService.createDepart(departmentVO);
}
@ApiOperation(value = "获取单位部门树")
@GetMapping(path = "{companyId}/dept/tree")
public List<DepartmentVO> queryCompanyDepartTree(@PathVariable Integer companyId) {
List<DepartmentVO> list = iOrgUserService.getCompanyDepartTree(companyId);
return list;
public List<DepartmentVO> queryCompanyDepartTree(@PathVariable Long companyId) {
return iOrgUserService.getCompanyDepartTree(companyId);
}
@ApiOperation(value = "获取单位所有部门")
@GetMapping(path = "{companyId}/dept")
public List<DepartmentVO> queryCompanyDepart(@PathVariable Integer companyId) {
List<DepartmentVO> list = iOrgUserService.getCompanyAllDepart(companyId);
return list;
public List<DepartmentVO> queryCompanyDepart(@PathVariable Long companyId) {
return iOrgUserService.getCompanyAllDepart(companyId);
}
@ApiOperation(value = "获取部门及其子树")
@GetMapping(path = "{companyId}/dept/{deptId}/tree")
public DepartmentVO queryDepartTree(@PathVariable Integer deptId, @PathVariable Integer companyId) {
public DepartmentVO queryDepartTree(@PathVariable Long deptId, @PathVariable Long companyId) {
return iOrgUserService.getDepartTree(companyId, deptId);
}
@ApiOperation(value = "获取部门及其子部门")
@GetMapping(path = "{companyId}/dept/{deptId}")
public List<DepartmentVO> queryDepart(@PathVariable Integer deptId, @PathVariable Integer companyId) {
public List<DepartmentVO> queryDepart(@PathVariable Long deptId, @PathVariable Long companyId) {
return iOrgUserService.getDepartAndChild(companyId, deptId);
}
@ApiOperation(value = "删除部门信息")
@DeleteMapping("/dept/{deptId}")
public void deleteDepart(@PathVariable Integer deptId) {
public void deleteDepart(@PathVariable Long deptId) {
iOrgService.deleteNonTopOrg(deptId);
}
@ApiOperation(value = "查询部门信息")
@GetMapping("/dept/{deptId}")
public DepartmentVO getDepart(@PathVariable Integer deptId) {
public DepartmentVO getDepart(@PathVariable Long deptId) {
return iOrgUserService.getDepartById(deptId);
}
@ApiOperation(value = "更新部门信息")
@PutMapping("/dept/{id}")
public void updateDepartInfo(@PathVariable Integer id, @RequestBody @Validated DepartmentVO departmentVO) {
public void updateDepartInfo(@PathVariable Long id, @RequestBody @Validated DepartmentVO departmentVO) {
iOrgUserService.updateDepartInfo(id, departmentVO);
}
@ -173,7 +149,7 @@ public class OrgController {
@ApiOperation(value = "导入单位成员信息")
@PostMapping("{clsId}/departUserInfo/import")
public void importCompanyUserInfo(@RequestAttribute @ApiIgnore UserVO user, @PathVariable Integer clsId, @RequestBody List<ImportOrgUserVO> importOrgUsers) {
public void importCompanyUserInfo(@RequestAttribute @ApiIgnore UserVO user, @PathVariable Long clsId, @RequestBody List<ImportOrgUserVO> importOrgUsers) {
iOrgUserService.importCompanyUserInfo(user, clsId, importOrgUsers);
}
@ -185,19 +161,19 @@ public class OrgController {
@ApiOperation("查询组织(班级)的课程")
@GetMapping("/orgLesson/{orgId}/list")
public List<LessonVO> queryOrgLesson(@PathVariable Integer orgId) {
public List<LessonVO> queryOrgLesson(@PathVariable Long orgId) {
return iOrgLessonService.queryOrgLesson(orgId);
}
@ApiOperation("修改班级-课程关系")
@PutMapping("/orgLesson/{clsId}/update")
public void updateOrgLesson(@PathVariable Integer clsId, @RequestBody List<Long> lessonIds) {
iOrgLessonService.updateOrgLesson(clsId, lessonIds);
public void updateOrgLesson(@PathVariable Long clsId, @RequestBody List<Long> lessonIds, @RequestAttribute UserVO user) {
iOrgLessonService.updateOrgLesson(clsId, lessonIds, user);
}
@ApiOperation("给班级添加学生")
@PostMapping("/orgUser/{clsId}/addStudent")
public void addStudent(@PathVariable Integer clsId, @RequestBody ImportOrgUserVO importVO, @RequestAttribute UserVO user) {
public void addStudent(@PathVariable Long clsId, @RequestBody ImportOrgUserVO importVO, @RequestAttribute UserVO user) {
iOrgUserService.addStudent(clsId, importVO, user);
}
@ -207,16 +183,16 @@ public class OrgController {
iOrgService.createCls(createVO, loginInfo);
}
@ApiOperation("分页查询个人创建的班级")
@GetMapping("/paged/cls/self")
@ApiOperation("分页查询班级")
@GetMapping("/paged/cls")
public PageVO<DepartmentVO> pagedQuerySelfCls(OrgQueryVO queryVO, @RequestAttribute LoginUserInfoVO loginInfo) {
return iOrgService.pagedQueryCls(queryVO, loginInfo, true);
return iOrgService.pagedQueryCls(queryVO, loginInfo);
}
@ApiOperation("查询个人创建的班级")
@GetMapping("/list/cls/self")
@ApiOperation("查询班级")
@GetMapping("/list/cls")
public List<DepartmentVO> querySelfCls(OrgQueryVO queryVO, @RequestAttribute LoginUserInfoVO loginInfo) {
return iOrgService.queryCls(queryVO, loginInfo, true);
return iOrgService.queryCls(queryVO, loginInfo);
}
@ApiOperation("创建评价规则")
@ -225,7 +201,7 @@ public class OrgController {
iOrgScoringRuleService.createScoringRule(orgScoringRuleVO, loginInfo);
}
@ApiOperation("保存评价规则")
@ApiOperation("更新评价规则")
@PutMapping("/orgScoringRule")
public void UpdateScoringRule(@RequestBody OrgScoringRuleVO orgScoringRuleVO, @RequestAttribute UserVO user) {
iOrgScoringRuleService.updateScoringRule(orgScoringRuleVO, user);
@ -239,7 +215,7 @@ public class OrgController {
@ApiOperation("查询自己创建的指定评价规则详细信息")
@GetMapping("/orgScoringRule/details/self/{orgId}/{schoolYear}/{term}")
public OrgScoringRuleVO queryOrgScoringRuleDetails(@PathVariable Integer orgId, @PathVariable String schoolYear,
public OrgScoringRuleVO queryOrgScoringRuleDetails(@PathVariable Long orgId, @PathVariable String schoolYear,
@PathVariable Integer term, @RequestAttribute LoginUserInfoVO loginInfo) {
return iOrgScoringRuleService.queryOrgScoringRuleDetails(orgId, schoolYear, term, loginInfo);
}
@ -250,9 +226,9 @@ public class OrgController {
return iOrgScoringRuleService.getOrgScoringRuleDetails(ruleId);
}
@ApiOperation("使用评价规则评分")
@ApiOperation("获取评价规则的评分结果")
@GetMapping("/orgScoringRule/score/{orgId}/{schoolYear}/{term}")
public List<OrgScoringResultVO> score(@PathVariable Integer orgId, @PathVariable String schoolYear,
public List<OrgScoringResultVO> score(@PathVariable Long orgId, @PathVariable String schoolYear,
@PathVariable Integer term, @RequestAttribute LoginUserInfoVO loginInfo) {
return iOrgScoringRuleService.score(orgId, schoolYear, term, loginInfo);
}
@ -271,7 +247,7 @@ public class OrgController {
@ApiOperation("将评价规则应用到")
@PostMapping("/orgScoringRule/{ruleId}/apply")
public void applyOrgScoringRule(@PathVariable Long ruleId, @RequestBody List<Integer> orgIds) {
public void applyOrgScoringRule(@PathVariable Long ruleId, @RequestBody List<Long> orgIds) {
iOrgScoringRuleService.applyOrgScoringRule(ruleId, orgIds);
}

View File

@ -47,7 +47,7 @@ public class RaceTheoryController {
@ApiOperation(value = "清除理论考试结果")
@DeleteMapping(path = "/project/{projectCode}")
@Role(RoleEnum.SuperAdmin)
public void submitProjectTheory(@PathVariable String projectCode, @RequestParam(required = false) Integer companyId) {
public void submitProjectTheory(@PathVariable String projectCode, @RequestParam(required = false) Long companyId) {
iRaceTheoryService.deleteRaceTheoryResult(projectCode, companyId);
}
@ -56,7 +56,7 @@ public class RaceTheoryController {
*/
@ApiOperation(value = "评分员获取考生理论考试结果详情")
@GetMapping(path = "/project/{projectCode}/result/detail")
public List<RaceResultDetailVO> getTheoryAnswerDetails(@PathVariable String projectCode, @RequestParam(required = false) Integer companyId, Long id) {
public List<RaceResultDetailVO> getTheoryAnswerDetails(@PathVariable String projectCode, @RequestParam(required = false) Long companyId, Long id) {
return iRaceTheoryService.getTheoryResultDetails(projectCode, companyId, id);
}
}

View File

@ -59,7 +59,7 @@ public class QuestionBankController {
@ApiOperation(value = "导入项目或单位试题库")
@PostMapping(path = "/questions/import")
public void importProjectQuestion(@Validated @RequestBody List<QuestionVO> questions,@RequestAttribute LoginUserInfoVO loginInfo,
@ApiIgnore @RequestAttribute UserVO user, @RequestParam(required = false, name = "id") Integer companyId) {
@ApiIgnore @RequestAttribute UserVO user, @RequestParam(required = false, name = "id") Long companyId) {
iQuestionBankService.importProjectQuestion(questions, loginInfo.getProject().name(), companyId,user);
}
@ -85,14 +85,14 @@ public class QuestionBankController {
@ApiOperation(value = "根据题型获取题目数量")
@GetMapping(path = "/number")
public Integer getNumberUnderKnowledgeAndType(@RequestAttribute LoginUserInfoVO loginInfo, String type, Integer companyId) {
public Integer getNumberUnderKnowledgeAndType(@RequestAttribute LoginUserInfoVO loginInfo, String type, Long companyId) {
return iQuestionBankService.getNumberWithType(type, loginInfo.getProject().name(), companyId);
}
@ApiOperation(value = "获取题型数量")
@GetMapping(path = "/type/number")
public List<TheoryQuestionCountVO> getNumberUnderKnowledgeAndType(@RequestAttribute LoginUserInfoVO loginInfo, @RequestParam(required = false) Integer companyId) {
public List<TheoryQuestionCountVO> getNumberUnderKnowledgeAndType(@RequestAttribute LoginUserInfoVO loginInfo, @RequestParam(required = false) Long companyId) {
String projectCode = Project.isDefault(loginInfo.getProject()) ? null : loginInfo.getProject().name();
return iQuestionBankService.countNumByType(projectCode, companyId);

View File

@ -112,21 +112,21 @@ public class ExamController {
this.iExamService.update(id, examDefinitionVO);
}
@ApiOperation(value = "分页查询当前登录项目下自己创建的试卷")
@GetMapping("/paged/loginProject/self")
public PageVO<ExamDefinitionVO> pagedQuerySelfExam(ExamDefinitionQueryVO queryVO, @RequestAttribute LoginUserInfoVO loginInfo) {
return this.iExamService.pagedQueryExamICreated(queryVO, loginInfo);
@ApiOperation(value = "分页查询当前登录项目下的试卷")
@GetMapping("/paged/loginProject")
public PageVO<ExamDefinitionVO> pagedQueryByLoginProject(ExamDefinitionQueryVO queryVO, @RequestAttribute LoginUserInfoVO loginInfo) {
return this.iExamService.pagedQueryByLoginProject(queryVO, loginInfo);
}
@ApiOperation(value = "不分页查询当前登录项目下自己创建的试卷")
@GetMapping("/list/loginProject/self")
public List<ExamDefinitionVO> listQueryExamICreated(ExamDefinitionQueryVO queryVO, @RequestAttribute LoginUserInfoVO loginInfo) {
return this.iExamService.listQueryExamICreated(queryVO, loginInfo);
@GetMapping("/list/loginProject")
public List<ExamDefinitionVO> listQueryExamByLoginProject(ExamDefinitionQueryVO queryVO, @RequestAttribute LoginUserInfoVO loginInfo) {
return this.iExamService.listQueryExamByLoginProject(queryVO, loginInfo);
}
@ApiOperation(value = "不分页查询组织下自己创建的试卷")
@GetMapping("/list/org/self")
public List<ExamDefinitionVO> listQueryOrgExamOfSelf(Integer clsId, @RequestAttribute LoginUserInfoVO loginInfo) {
public List<ExamDefinitionVO> listQueryOrgExamOfSelf(Long clsId, @RequestAttribute LoginUserInfoVO loginInfo) {
return this.iExamService.listQueryOrgExamICreated(clsId, loginInfo);
}
}

View File

@ -57,7 +57,7 @@ public class LessonController {
@ApiOperation(value = "根据部门获取关联课程列表")
@GetMapping(path = "/depart/{departId}")
public List<LessonVO> queryLessons(@PathVariable Integer departId) {
public List<LessonVO> queryLessons(@PathVariable Long departId) {
return this.iOrgUserService.getLessonsByDepart(departId);
}
@ -123,21 +123,22 @@ public class LessonController {
}
@ApiOperation(value = "分页查询用户当前登录的项目下的课程")
@GetMapping(path = "/paged/self")
public PageVO<LessonVO> pagedQueryPersonalLesson(LessonQueryVO queryVO,
@GetMapping(path = "/paged/byLoginProject")
public PageVO<LessonVO> pagedQueryByLoginProject(LessonQueryVO queryVO,
@RequestAttribute(AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginInfo) {
return iLessonService.pagedQueryPersonalLesson(queryVO, loginInfo);
return iLessonService.pagedQueryByLoginProject(queryVO, loginInfo);
}
@ApiOperation(value = "查询用户当前登录的项目下的课程")
@GetMapping(path = "/unPaged/self")
public List<LessonVO> queryPersonalLesson(@RequestAttribute(AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginInfo) {
return iLessonService.queryLessonICreatedInLoginProject(loginInfo);
@GetMapping(path = "/list/byLoginProject")
public List<LessonVO> queryByLoginProject(LessonQueryVO queryVO,
@RequestAttribute(AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginInfo) {
return iLessonService.queryByLoginProject(queryVO, loginInfo);
}
@ApiOperation(value = "查询自己给指定班级创建的课程")
@GetMapping(path = "/list/org/self")
public List<LessonVO> queryOrgLessonOfSelf(Integer clsId, @RequestAttribute LoginUserInfoVO loginInfo) {
public List<LessonVO> queryOrgLessonOfSelf(Long clsId, @RequestAttribute LoginUserInfoVO loginInfo) {
return iLessonService.queryOrgLessonOfSelf(clsId, loginInfo);
}
}

View File

@ -73,7 +73,7 @@ public class UserExamController {
@ApiOperation("查询组织成员的考试成绩")
@GetMapping("/paged/orgUser/{orgId}/{examId}")
public PageVO<UserExamVO> pagedQueryOrgUserExamResult(@PathVariable Integer orgId, @PathVariable Long examId, PageQueryVO queryVO) {
public PageVO<UserExamVO> pagedQueryOrgUserExamResult(@PathVariable Long orgId, @PathVariable Long examId, PageQueryVO queryVO) {
return this.iUserExamService.pagedQueryOrgUserExamResult(orgId, examId, queryVO);
}
}

View File

@ -8,5 +8,5 @@ import org.springframework.stereotype.Repository;
* OrgDAO继承基类
*/
@Repository
public interface OrgDAO extends MyBatisBaseDao<Org, Integer, OrgExample> {
public interface OrgDAO extends MyBatisBaseDao<Org, Long, OrgExample> {
}

View File

@ -17,7 +17,7 @@ public interface OrgUserDAO extends MyBatisBaseDao<OrgUser, Long, OrgUserExample
List<CompanyDepartUserVO> getCompanyDepartUsers(CompanyUserQueryVO companyUserQueryVO);
List<CompanyDepartUserVO>getUserCompanyDeparts(@Param("companyId")Integer companyId, @Param("userId")Long userId);
List<CompanyDepartUserVO> getUserCompanyDeparts(@Param("companyId")Integer companyId, @Param("userId")Long userId);
List<OrgUser> getCompanyManger(@Param("userId") Long userId);
}

View File

@ -15,6 +15,6 @@ import java.util.List;
@Repository
public interface RaceQuestionDAO extends MyBatisBaseDao<RaceQuestion, Long, RaceQuestionExample> {
List<QuestionVO> selectWithRef(@Param("topic") String topic, @Param("type") String type, @Param("projectCode") String projectCode, @Param("companyId") Integer companyId);
List<TheoryQuestionCountVO> countNumByType(@Param("projectCode") String projectCode, @Param("companyId") Integer companyId);
List<QuestionVO> selectWithRef(@Param("topic") String topic, @Param("type") String type, @Param("projectCode") String projectCode, @Param("companyId") Long companyId);
List<TheoryQuestionCountVO> countNumByType(@Param("projectCode") String projectCode, @Param("companyId") Long companyId);
}

View File

@ -2,7 +2,6 @@ package club.joylink.rtss.dao;
import club.joylink.rtss.entity.RaceQuestionProgress;
import club.joylink.rtss.entity.RaceQuestionProgressExample;
import org.apache.ibatis.annotations.Insert;
import org.springframework.stereotype.Repository;
/**
@ -10,20 +9,4 @@ import org.springframework.stereotype.Repository;
*/
@Repository
public interface RaceQuestionProgressDAO extends MyBatisBaseDao<RaceQuestionProgress, Long, RaceQuestionProgressExample> {
@Insert("<script>" +
"INSERT INTO race_question_progress " +
"(id,user_id,project_code,company_id,question_index,incorrect)" +
"VALUES " +
"(#{id,jdbcType=BIGINT},#{userId,jdbcType=BIGINT}, #{projectCode,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{questionIndex,jdbcType=BIGINT}, #{incorrect,jdbcType=VARCHAR}) " +
"ON DUPLICATE KEY UPDATE " +
"<trim suffixOverrides=\",\"> " +
"<if test=\"questionIndex != null\"> " +
"question_index=VALUES (question_index), " +
"</if> " +
"<if test=\"incorrect != null\"> " +
"incorrect=VALUES (incorrect) " +
"</if> " +
"</trim> " +
"</script>")
void insertOrUpdateSelective(RaceQuestionProgress record);
}
}

View File

@ -2,37 +2,11 @@ package club.joylink.rtss.dao;
import club.joylink.rtss.entity.RaceResult;
import club.joylink.rtss.entity.RaceResultExample;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* RaceResultDAO继承基类
*/
@Repository
public interface RaceResultDAO extends MyBatisBaseDao<RaceResult, Long, RaceResultExample> {
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
@Insert(value = "<script>" +
" insert into race_result (user_race_id, question_topic, question_id, question_option_id, answer_content, correct, score, total_score, remarks,user_id,project_code)\n" +
" values " +
" <foreach collection=\"list\" item=\"entity\" separator=\",\"> " +
" (#{entity.userRaceId,jdbcType=BIGINT}, \n" +
" #{entity.questionTopic,jdbcType=VARCHAR}, \n" +
" #{entity.questionId,jdbcType=BIGINT}, \n" +
" #{entity.questionOptionId,jdbcType=VARCHAR}, \n" +
" #{entity.answerContent,jdbcType=VARCHAR}, " +
" #{entity.correct,jdbcType=TINYINT}, \n" +
" #{entity.score,jdbcType=INTEGER}, \n" +
" #{entity.totalScore,jdbcType=INTEGER}, \n" +
" #{entity.remarks,jdbcType=VARCHAR}," +
" #{entity.userId,jdbcType=BIGINT}," +
" #{entity.projectCode,jdbcType=VARCHAR})" +
" </foreach>" +
"</script>")
int batchInsert(@Param("list") List<RaceResult> list);
}
}

View File

@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@Repository
@ -66,13 +67,13 @@ public interface UserTrainingStatsMapper {
"ut.user_id AS userId " +
"FROM user_training_stats ut " +
"LEFT JOIN sys_user u ON u.id = ut.user_id " +
"WHERE u.id = #{userId} " +
"WHERE u.id = #{userId} AND finishTime >= #{startTime} AND finishTime <= #{endTime} " +
"AND ut.lesson_id IN" +
"<foreach collection='lessonIds' item='lessonId' open='(' separator=',' close=')'>" +
"#{lessonId}" +
"</foreach>" +
"</script>")
UserRankStatsVO selectRank(List<Long> lessonIds, Long userId);
UserRankStatsVO selectRank(LocalDateTime startTime, LocalDateTime endTime, List<Long> lessonIds, Long userId);
@Select("<script>" +
"SELECT dd.name AS statsProjectName, " +

View File

@ -8,7 +8,7 @@ import java.time.LocalDateTime;
* 组织树
*/
public class Org implements Serializable {
private Integer id;
private Long id;
/**
* 部门名称
@ -18,12 +18,12 @@ public class Org implements Serializable {
/**
* 父级id
*/
private Integer parentId;
private Long parentId;
/**
* 单位id
*/
private Integer rootId;
private Long rootId;
/**
* 关联项目code
@ -62,11 +62,11 @@ public class Org implements Serializable {
private static final long serialVersionUID = 1L;
public Integer getId() {
public Long getId() {
return id;
}
public void setId(Integer id) {
public void setId(Long id) {
this.id = id;
}
@ -78,19 +78,19 @@ public class Org implements Serializable {
this.name = name;
}
public Integer getParentId() {
public Long getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public Integer getRootId() {
public Long getRootId() {
return rootId;
}
public void setRootId(Integer rootId) {
public void setRootId(Long rootId) {
this.rootId = rootId;
}

View File

@ -4,12 +4,12 @@ import java.io.Serializable;
/**
* org_exam
* @author
* @author
*/
public class OrgExam implements Serializable {
private Long examId;
private Integer orgId;
private Long orgId;
private static final long serialVersionUID = 1L;
@ -21,11 +21,11 @@ public class OrgExam implements Serializable {
this.examId = examId;
}
public Integer getOrgId() {
public Long getOrgId() {
return orgId;
}
public void setOrgId(Integer orgId) {
public void setOrgId(Long orgId) {
this.orgId = orgId;
}
@ -66,4 +66,4 @@ public class OrgExam implements Serializable {
sb.append("]");
return sb.toString();
}
}
}

View File

@ -135,52 +135,52 @@ public class OrgExample {
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
@ -265,52 +265,52 @@ public class OrgExample {
return (Criteria) this;
}
public Criteria andParentIdEqualTo(Integer value) {
public Criteria andParentIdEqualTo(Long value) {
addCriterion("parent_id =", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotEqualTo(Integer value) {
public Criteria andParentIdNotEqualTo(Long value) {
addCriterion("parent_id <>", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThan(Integer value) {
public Criteria andParentIdGreaterThan(Long value) {
addCriterion("parent_id >", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThanOrEqualTo(Integer value) {
public Criteria andParentIdGreaterThanOrEqualTo(Long value) {
addCriterion("parent_id >=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThan(Integer value) {
public Criteria andParentIdLessThan(Long value) {
addCriterion("parent_id <", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThanOrEqualTo(Integer value) {
public Criteria andParentIdLessThanOrEqualTo(Long value) {
addCriterion("parent_id <=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdIn(List<Integer> values) {
public Criteria andParentIdIn(List<Long> values) {
addCriterion("parent_id in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotIn(List<Integer> values) {
public Criteria andParentIdNotIn(List<Long> values) {
addCriterion("parent_id not in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdBetween(Integer value1, Integer value2) {
public Criteria andParentIdBetween(Long value1, Long value2) {
addCriterion("parent_id between", value1, value2, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotBetween(Integer value1, Integer value2) {
public Criteria andParentIdNotBetween(Long value1, Long value2) {
addCriterion("parent_id not between", value1, value2, "parentId");
return (Criteria) this;
}
@ -325,52 +325,52 @@ public class OrgExample {
return (Criteria) this;
}
public Criteria andRootIdEqualTo(Integer value) {
public Criteria andRootIdEqualTo(Long value) {
addCriterion("root_id =", value, "rootId");
return (Criteria) this;
}
public Criteria andRootIdNotEqualTo(Integer value) {
public Criteria andRootIdNotEqualTo(Long value) {
addCriterion("root_id <>", value, "rootId");
return (Criteria) this;
}
public Criteria andRootIdGreaterThan(Integer value) {
public Criteria andRootIdGreaterThan(Long value) {
addCriterion("root_id >", value, "rootId");
return (Criteria) this;
}
public Criteria andRootIdGreaterThanOrEqualTo(Integer value) {
public Criteria andRootIdGreaterThanOrEqualTo(Long value) {
addCriterion("root_id >=", value, "rootId");
return (Criteria) this;
}
public Criteria andRootIdLessThan(Integer value) {
public Criteria andRootIdLessThan(Long value) {
addCriterion("root_id <", value, "rootId");
return (Criteria) this;
}
public Criteria andRootIdLessThanOrEqualTo(Integer value) {
public Criteria andRootIdLessThanOrEqualTo(Long value) {
addCriterion("root_id <=", value, "rootId");
return (Criteria) this;
}
public Criteria andRootIdIn(List<Integer> values) {
public Criteria andRootIdIn(List<Long> values) {
addCriterion("root_id in", values, "rootId");
return (Criteria) this;
}
public Criteria andRootIdNotIn(List<Integer> values) {
public Criteria andRootIdNotIn(List<Long> values) {
addCriterion("root_id not in", values, "rootId");
return (Criteria) this;
}
public Criteria andRootIdBetween(Integer value1, Integer value2) {
public Criteria andRootIdBetween(Long value1, Long value2) {
addCriterion("root_id between", value1, value2, "rootId");
return (Criteria) this;
}
public Criteria andRootIdNotBetween(Integer value1, Integer value2) {
public Criteria andRootIdNotBetween(Long value1, Long value2) {
addCriterion("root_id not between", value1, value2, "rootId");
return (Criteria) this;
}

View File

@ -1,9 +1,10 @@
package club.joylink.rtss.entity;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @author
* @author
* 班级课程表
*/
public class OrgLesson implements Serializable {
@ -15,7 +16,17 @@ public class OrgLesson implements Serializable {
/**
* 班级id
*/
private Integer orgId;
private Long orgId;
/**
* 创建人id
*/
private Long creatorId;
/**
* 创建时间
*/
private LocalDateTime createTime;
private static final long serialVersionUID = 1L;
@ -27,14 +38,30 @@ public class OrgLesson implements Serializable {
this.lessonId = lessonId;
}
public Integer getOrgId() {
public Long getOrgId() {
return orgId;
}
public void setOrgId(Integer orgId) {
public void setOrgId(Long orgId) {
this.orgId = orgId;
}
public Long getCreatorId() {
return creatorId;
}
public void setCreatorId(Long creatorId) {
this.creatorId = creatorId;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
@Override
public boolean equals(Object that) {
if (this == that) {
@ -48,7 +75,9 @@ public class OrgLesson implements Serializable {
}
OrgLesson other = (OrgLesson) that;
return (this.getLessonId() == null ? other.getLessonId() == null : this.getLessonId().equals(other.getLessonId()))
&& (this.getOrgId() == null ? other.getOrgId() == null : this.getOrgId().equals(other.getOrgId()));
&& (this.getOrgId() == null ? other.getOrgId() == null : this.getOrgId().equals(other.getOrgId()))
&& (this.getCreatorId() == null ? other.getCreatorId() == null : this.getCreatorId().equals(other.getCreatorId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
}
@Override
@ -57,6 +86,8 @@ public class OrgLesson implements Serializable {
int result = 1;
result = prime * result + ((getLessonId() == null) ? 0 : getLessonId().hashCode());
result = prime * result + ((getOrgId() == null) ? 0 : getOrgId().hashCode());
result = prime * result + ((getCreatorId() == null) ? 0 : getCreatorId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
return result;
}
@ -68,8 +99,10 @@ public class OrgLesson implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", lessonId=").append(lessonId);
sb.append(", orgId=").append(orgId);
sb.append(", creatorId=").append(creatorId);
sb.append(", createTime=").append(createTime);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
}

View File

@ -1,5 +1,6 @@
package club.joylink.rtss.entity;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@ -194,55 +195,175 @@ public class OrgLessonExample {
return (Criteria) this;
}
public Criteria andOrgIdEqualTo(Integer value) {
public Criteria andOrgIdEqualTo(Long value) {
addCriterion("org_id =", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotEqualTo(Integer value) {
public Criteria andOrgIdNotEqualTo(Long value) {
addCriterion("org_id <>", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdGreaterThan(Integer value) {
public Criteria andOrgIdGreaterThan(Long value) {
addCriterion("org_id >", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdGreaterThanOrEqualTo(Integer value) {
public Criteria andOrgIdGreaterThanOrEqualTo(Long value) {
addCriterion("org_id >=", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLessThan(Integer value) {
public Criteria andOrgIdLessThan(Long value) {
addCriterion("org_id <", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLessThanOrEqualTo(Integer value) {
public Criteria andOrgIdLessThanOrEqualTo(Long value) {
addCriterion("org_id <=", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdIn(List<Integer> values) {
public Criteria andOrgIdIn(List<Long> values) {
addCriterion("org_id in", values, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotIn(List<Integer> values) {
public Criteria andOrgIdNotIn(List<Long> values) {
addCriterion("org_id not in", values, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdBetween(Integer value1, Integer value2) {
public Criteria andOrgIdBetween(Long value1, Long value2) {
addCriterion("org_id between", value1, value2, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotBetween(Integer value1, Integer value2) {
public Criteria andOrgIdNotBetween(Long value1, Long value2) {
addCriterion("org_id not between", value1, value2, "orgId");
return (Criteria) this;
}
public Criteria andCreatorIdIsNull() {
addCriterion("creator_id is null");
return (Criteria) this;
}
public Criteria andCreatorIdIsNotNull() {
addCriterion("creator_id is not null");
return (Criteria) this;
}
public Criteria andCreatorIdEqualTo(Long value) {
addCriterion("creator_id =", value, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdNotEqualTo(Long value) {
addCriterion("creator_id <>", value, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdGreaterThan(Long value) {
addCriterion("creator_id >", value, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) {
addCriterion("creator_id >=", value, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdLessThan(Long value) {
addCriterion("creator_id <", value, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdLessThanOrEqualTo(Long value) {
addCriterion("creator_id <=", value, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdIn(List<Long> values) {
addCriterion("creator_id in", values, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdNotIn(List<Long> values) {
addCriterion("creator_id not in", values, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdBetween(Long value1, Long value2) {
addCriterion("creator_id between", value1, value2, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdNotBetween(Long value1, Long value2) {
addCriterion("creator_id not between", value1, value2, "creatorId");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(LocalDateTime value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(LocalDateTime value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(LocalDateTime value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(LocalDateTime value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(LocalDateTime value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(LocalDateTime value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<LocalDateTime> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<LocalDateTime> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
}
/**

View File

@ -18,7 +18,7 @@ public class OrgScoringRule implements Serializable {
/**
* 该规则属于哪个顶级组织
*/
private Integer orgId;
private Long orgId;
/**
* 学年
@ -68,11 +68,11 @@ public class OrgScoringRule implements Serializable {
this.name = name;
}
public Integer getOrgId() {
public Long getOrgId() {
return orgId;
}
public void setOrgId(Integer orgId) {
public void setOrgId(Long orgId) {
this.orgId = orgId;
}
@ -182,4 +182,4 @@ public class OrgScoringRule implements Serializable {
sb.append("]");
return sb.toString();
}
}
}

View File

@ -265,52 +265,52 @@ public class OrgScoringRuleExample {
return (Criteria) this;
}
public Criteria andOrgIdEqualTo(Integer value) {
public Criteria andOrgIdEqualTo(Long value) {
addCriterion("org_id =", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotEqualTo(Integer value) {
public Criteria andOrgIdNotEqualTo(Long value) {
addCriterion("org_id <>", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdGreaterThan(Integer value) {
public Criteria andOrgIdGreaterThan(Long value) {
addCriterion("org_id >", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdGreaterThanOrEqualTo(Integer value) {
public Criteria andOrgIdGreaterThanOrEqualTo(Long value) {
addCriterion("org_id >=", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLessThan(Integer value) {
public Criteria andOrgIdLessThan(Long value) {
addCriterion("org_id <", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLessThanOrEqualTo(Integer value) {
public Criteria andOrgIdLessThanOrEqualTo(Long value) {
addCriterion("org_id <=", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdIn(List<Integer> values) {
public Criteria andOrgIdIn(List<Long> values) {
addCriterion("org_id in", values, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotIn(List<Integer> values) {
public Criteria andOrgIdNotIn(List<Long> values) {
addCriterion("org_id not in", values, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdBetween(Integer value1, Integer value2) {
public Criteria andOrgIdBetween(Long value1, Long value2) {
addCriterion("org_id between", value1, value2, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotBetween(Integer value1, Integer value2) {
public Criteria andOrgIdNotBetween(Long value1, Long value2) {
addCriterion("org_id not between", value1, value2, "orgId");
return (Criteria) this;
}
@ -780,4 +780,4 @@ public class OrgScoringRuleExample {
this(condition, value, secondValue, null);
}
}
}
}

View File

@ -3,21 +3,41 @@ package club.joylink.rtss.entity;
import java.io.Serializable;
/**
* @author
* @author
* 班级与评价规则关联表
*/
public class OrgScoringRuleRel implements Serializable {
private Integer orgId;
private Long orgId;
private Long ruleId;
/**
* 规则关联的顶级组织id
*/
private Long ruleOrgId;
/**
* 规则所属学年
*/
private String ruleSchoolYear;
/**
* 规则所属学期
*/
private Integer ruleTerm;
/**
* 创建者id
*/
private Long ruleCreatorId;
private static final long serialVersionUID = 1L;
public Integer getOrgId() {
public Long getOrgId() {
return orgId;
}
public void setOrgId(Integer orgId) {
public void setOrgId(Long orgId) {
this.orgId = orgId;
}
@ -29,6 +49,38 @@ public class OrgScoringRuleRel implements Serializable {
this.ruleId = ruleId;
}
public Long getRuleOrgId() {
return ruleOrgId;
}
public void setRuleOrgId(Long ruleOrgId) {
this.ruleOrgId = ruleOrgId;
}
public String getRuleSchoolYear() {
return ruleSchoolYear;
}
public void setRuleSchoolYear(String ruleSchoolYear) {
this.ruleSchoolYear = ruleSchoolYear;
}
public Integer getRuleTerm() {
return ruleTerm;
}
public void setRuleTerm(Integer ruleTerm) {
this.ruleTerm = ruleTerm;
}
public Long getRuleCreatorId() {
return ruleCreatorId;
}
public void setRuleCreatorId(Long ruleCreatorId) {
this.ruleCreatorId = ruleCreatorId;
}
@Override
public boolean equals(Object that) {
if (this == that) {
@ -42,7 +94,11 @@ public class OrgScoringRuleRel implements Serializable {
}
OrgScoringRuleRel other = (OrgScoringRuleRel) that;
return (this.getOrgId() == null ? other.getOrgId() == null : this.getOrgId().equals(other.getOrgId()))
&& (this.getRuleId() == null ? other.getRuleId() == null : this.getRuleId().equals(other.getRuleId()));
&& (this.getRuleId() == null ? other.getRuleId() == null : this.getRuleId().equals(other.getRuleId()))
&& (this.getRuleOrgId() == null ? other.getRuleOrgId() == null : this.getRuleOrgId().equals(other.getRuleOrgId()))
&& (this.getRuleSchoolYear() == null ? other.getRuleSchoolYear() == null : this.getRuleSchoolYear().equals(other.getRuleSchoolYear()))
&& (this.getRuleTerm() == null ? other.getRuleTerm() == null : this.getRuleTerm().equals(other.getRuleTerm()))
&& (this.getRuleCreatorId() == null ? other.getRuleCreatorId() == null : this.getRuleCreatorId().equals(other.getRuleCreatorId()));
}
@Override
@ -51,6 +107,10 @@ public class OrgScoringRuleRel implements Serializable {
int result = 1;
result = prime * result + ((getOrgId() == null) ? 0 : getOrgId().hashCode());
result = prime * result + ((getRuleId() == null) ? 0 : getRuleId().hashCode());
result = prime * result + ((getRuleOrgId() == null) ? 0 : getRuleOrgId().hashCode());
result = prime * result + ((getRuleSchoolYear() == null) ? 0 : getRuleSchoolYear().hashCode());
result = prime * result + ((getRuleTerm() == null) ? 0 : getRuleTerm().hashCode());
result = prime * result + ((getRuleCreatorId() == null) ? 0 : getRuleCreatorId().hashCode());
return result;
}
@ -62,8 +122,12 @@ public class OrgScoringRuleRel implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", orgId=").append(orgId);
sb.append(", ruleId=").append(ruleId);
sb.append(", ruleOrgId=").append(ruleOrgId);
sb.append(", ruleSchoolYear=").append(ruleSchoolYear);
sb.append(", ruleTerm=").append(ruleTerm);
sb.append(", ruleCreatorId=").append(ruleCreatorId);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
}

View File

@ -134,52 +134,52 @@ public class OrgScoringRuleRelExample {
return (Criteria) this;
}
public Criteria andOrgIdEqualTo(Integer value) {
public Criteria andOrgIdEqualTo(Long value) {
addCriterion("org_id =", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotEqualTo(Integer value) {
public Criteria andOrgIdNotEqualTo(Long value) {
addCriterion("org_id <>", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdGreaterThan(Integer value) {
public Criteria andOrgIdGreaterThan(Long value) {
addCriterion("org_id >", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdGreaterThanOrEqualTo(Integer value) {
public Criteria andOrgIdGreaterThanOrEqualTo(Long value) {
addCriterion("org_id >=", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLessThan(Integer value) {
public Criteria andOrgIdLessThan(Long value) {
addCriterion("org_id <", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLessThanOrEqualTo(Integer value) {
public Criteria andOrgIdLessThanOrEqualTo(Long value) {
addCriterion("org_id <=", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdIn(List<Integer> values) {
public Criteria andOrgIdIn(List<Long> values) {
addCriterion("org_id in", values, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotIn(List<Integer> values) {
public Criteria andOrgIdNotIn(List<Long> values) {
addCriterion("org_id not in", values, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdBetween(Integer value1, Integer value2) {
public Criteria andOrgIdBetween(Long value1, Long value2) {
addCriterion("org_id between", value1, value2, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotBetween(Integer value1, Integer value2) {
public Criteria andOrgIdNotBetween(Long value1, Long value2) {
addCriterion("org_id not between", value1, value2, "orgId");
return (Criteria) this;
}
@ -243,6 +243,256 @@ public class OrgScoringRuleRelExample {
addCriterion("rule_id not between", value1, value2, "ruleId");
return (Criteria) this;
}
public Criteria andRuleOrgIdIsNull() {
addCriterion("rule_org_id is null");
return (Criteria) this;
}
public Criteria andRuleOrgIdIsNotNull() {
addCriterion("rule_org_id is not null");
return (Criteria) this;
}
public Criteria andRuleOrgIdEqualTo(Long value) {
addCriterion("rule_org_id =", value, "ruleOrgId");
return (Criteria) this;
}
public Criteria andRuleOrgIdNotEqualTo(Long value) {
addCriterion("rule_org_id <>", value, "ruleOrgId");
return (Criteria) this;
}
public Criteria andRuleOrgIdGreaterThan(Long value) {
addCriterion("rule_org_id >", value, "ruleOrgId");
return (Criteria) this;
}
public Criteria andRuleOrgIdGreaterThanOrEqualTo(Long value) {
addCriterion("rule_org_id >=", value, "ruleOrgId");
return (Criteria) this;
}
public Criteria andRuleOrgIdLessThan(Long value) {
addCriterion("rule_org_id <", value, "ruleOrgId");
return (Criteria) this;
}
public Criteria andRuleOrgIdLessThanOrEqualTo(Long value) {
addCriterion("rule_org_id <=", value, "ruleOrgId");
return (Criteria) this;
}
public Criteria andRuleOrgIdIn(List<Long> values) {
addCriterion("rule_org_id in", values, "ruleOrgId");
return (Criteria) this;
}
public Criteria andRuleOrgIdNotIn(List<Long> values) {
addCriterion("rule_org_id not in", values, "ruleOrgId");
return (Criteria) this;
}
public Criteria andRuleOrgIdBetween(Long value1, Long value2) {
addCriterion("rule_org_id between", value1, value2, "ruleOrgId");
return (Criteria) this;
}
public Criteria andRuleOrgIdNotBetween(Long value1, Long value2) {
addCriterion("rule_org_id not between", value1, value2, "ruleOrgId");
return (Criteria) this;
}
public Criteria andRuleSchoolYearIsNull() {
addCriterion("rule_school_year is null");
return (Criteria) this;
}
public Criteria andRuleSchoolYearIsNotNull() {
addCriterion("rule_school_year is not null");
return (Criteria) this;
}
public Criteria andRuleSchoolYearEqualTo(String value) {
addCriterion("rule_school_year =", value, "ruleSchoolYear");
return (Criteria) this;
}
public Criteria andRuleSchoolYearNotEqualTo(String value) {
addCriterion("rule_school_year <>", value, "ruleSchoolYear");
return (Criteria) this;
}
public Criteria andRuleSchoolYearGreaterThan(String value) {
addCriterion("rule_school_year >", value, "ruleSchoolYear");
return (Criteria) this;
}
public Criteria andRuleSchoolYearGreaterThanOrEqualTo(String value) {
addCriterion("rule_school_year >=", value, "ruleSchoolYear");
return (Criteria) this;
}
public Criteria andRuleSchoolYearLessThan(String value) {
addCriterion("rule_school_year <", value, "ruleSchoolYear");
return (Criteria) this;
}
public Criteria andRuleSchoolYearLessThanOrEqualTo(String value) {
addCriterion("rule_school_year <=", value, "ruleSchoolYear");
return (Criteria) this;
}
public Criteria andRuleSchoolYearLike(String value) {
addCriterion("rule_school_year like", value, "ruleSchoolYear");
return (Criteria) this;
}
public Criteria andRuleSchoolYearNotLike(String value) {
addCriterion("rule_school_year not like", value, "ruleSchoolYear");
return (Criteria) this;
}
public Criteria andRuleSchoolYearIn(List<String> values) {
addCriterion("rule_school_year in", values, "ruleSchoolYear");
return (Criteria) this;
}
public Criteria andRuleSchoolYearNotIn(List<String> values) {
addCriterion("rule_school_year not in", values, "ruleSchoolYear");
return (Criteria) this;
}
public Criteria andRuleSchoolYearBetween(String value1, String value2) {
addCriterion("rule_school_year between", value1, value2, "ruleSchoolYear");
return (Criteria) this;
}
public Criteria andRuleSchoolYearNotBetween(String value1, String value2) {
addCriterion("rule_school_year not between", value1, value2, "ruleSchoolYear");
return (Criteria) this;
}
public Criteria andRuleTermIsNull() {
addCriterion("rule_term is null");
return (Criteria) this;
}
public Criteria andRuleTermIsNotNull() {
addCriterion("rule_term is not null");
return (Criteria) this;
}
public Criteria andRuleTermEqualTo(Integer value) {
addCriterion("rule_term =", value, "ruleTerm");
return (Criteria) this;
}
public Criteria andRuleTermNotEqualTo(Integer value) {
addCriterion("rule_term <>", value, "ruleTerm");
return (Criteria) this;
}
public Criteria andRuleTermGreaterThan(Integer value) {
addCriterion("rule_term >", value, "ruleTerm");
return (Criteria) this;
}
public Criteria andRuleTermGreaterThanOrEqualTo(Integer value) {
addCriterion("rule_term >=", value, "ruleTerm");
return (Criteria) this;
}
public Criteria andRuleTermLessThan(Integer value) {
addCriterion("rule_term <", value, "ruleTerm");
return (Criteria) this;
}
public Criteria andRuleTermLessThanOrEqualTo(Integer value) {
addCriterion("rule_term <=", value, "ruleTerm");
return (Criteria) this;
}
public Criteria andRuleTermIn(List<Integer> values) {
addCriterion("rule_term in", values, "ruleTerm");
return (Criteria) this;
}
public Criteria andRuleTermNotIn(List<Integer> values) {
addCriterion("rule_term not in", values, "ruleTerm");
return (Criteria) this;
}
public Criteria andRuleTermBetween(Integer value1, Integer value2) {
addCriterion("rule_term between", value1, value2, "ruleTerm");
return (Criteria) this;
}
public Criteria andRuleTermNotBetween(Integer value1, Integer value2) {
addCriterion("rule_term not between", value1, value2, "ruleTerm");
return (Criteria) this;
}
public Criteria andRuleCreatorIdIsNull() {
addCriterion("rule_creator_id is null");
return (Criteria) this;
}
public Criteria andRuleCreatorIdIsNotNull() {
addCriterion("rule_creator_id is not null");
return (Criteria) this;
}
public Criteria andRuleCreatorIdEqualTo(Long value) {
addCriterion("rule_creator_id =", value, "ruleCreatorId");
return (Criteria) this;
}
public Criteria andRuleCreatorIdNotEqualTo(Long value) {
addCriterion("rule_creator_id <>", value, "ruleCreatorId");
return (Criteria) this;
}
public Criteria andRuleCreatorIdGreaterThan(Long value) {
addCriterion("rule_creator_id >", value, "ruleCreatorId");
return (Criteria) this;
}
public Criteria andRuleCreatorIdGreaterThanOrEqualTo(Long value) {
addCriterion("rule_creator_id >=", value, "ruleCreatorId");
return (Criteria) this;
}
public Criteria andRuleCreatorIdLessThan(Long value) {
addCriterion("rule_creator_id <", value, "ruleCreatorId");
return (Criteria) this;
}
public Criteria andRuleCreatorIdLessThanOrEqualTo(Long value) {
addCriterion("rule_creator_id <=", value, "ruleCreatorId");
return (Criteria) this;
}
public Criteria andRuleCreatorIdIn(List<Long> values) {
addCriterion("rule_creator_id in", values, "ruleCreatorId");
return (Criteria) this;
}
public Criteria andRuleCreatorIdNotIn(List<Long> values) {
addCriterion("rule_creator_id not in", values, "ruleCreatorId");
return (Criteria) this;
}
public Criteria andRuleCreatorIdBetween(Long value1, Long value2) {
addCriterion("rule_creator_id between", value1, value2, "ruleCreatorId");
return (Criteria) this;
}
public Criteria andRuleCreatorIdNotBetween(Long value1, Long value2) {
addCriterion("rule_creator_id not between", value1, value2, "ruleCreatorId");
return (Criteria) this;
}
}
/**
@ -339,4 +589,4 @@ public class OrgScoringRuleRelExample {
this(condition, value, secondValue, null);
}
}
}
}

View File

@ -90,4 +90,4 @@ public class OrgScoringRuleWithBLOBs extends OrgScoringRule implements Serializa
sb.append("]");
return sb.toString();
}
}
}

View File

@ -4,8 +4,8 @@ import java.io.Serializable;
import java.time.LocalDateTime;
/**
* org_user
* @author
* 用户部门关联表
*/
public class OrgUser implements Serializable {
private Long id;
@ -18,7 +18,7 @@ public class OrgUser implements Serializable {
/**
* 部门id
*/
private Integer orgId;
private Long orgId;
/**
* 部门管理员
@ -53,11 +53,11 @@ public class OrgUser implements Serializable {
this.userId = userId;
}
public Integer getOrgId() {
public Long getOrgId() {
return orgId;
}
public void setOrgId(Integer orgId) {
public void setOrgId(Long orgId) {
this.orgId = orgId;
}

View File

@ -255,52 +255,52 @@ public class OrgUserExample {
return (Criteria) this;
}
public Criteria andOrgIdEqualTo(Integer value) {
public Criteria andOrgIdEqualTo(Long value) {
addCriterion("org_id =", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotEqualTo(Integer value) {
public Criteria andOrgIdNotEqualTo(Long value) {
addCriterion("org_id <>", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdGreaterThan(Integer value) {
public Criteria andOrgIdGreaterThan(Long value) {
addCriterion("org_id >", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdGreaterThanOrEqualTo(Integer value) {
public Criteria andOrgIdGreaterThanOrEqualTo(Long value) {
addCriterion("org_id >=", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLessThan(Integer value) {
public Criteria andOrgIdLessThan(Long value) {
addCriterion("org_id <", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLessThanOrEqualTo(Integer value) {
public Criteria andOrgIdLessThanOrEqualTo(Long value) {
addCriterion("org_id <=", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdIn(List<Integer> values) {
public Criteria andOrgIdIn(List<Long> values) {
addCriterion("org_id in", values, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotIn(List<Integer> values) {
public Criteria andOrgIdNotIn(List<Long> values) {
addCriterion("org_id not in", values, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdBetween(Integer value1, Integer value2) {
public Criteria andOrgIdBetween(Long value1, Long value2) {
addCriterion("org_id between", value1, value2, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotBetween(Integer value1, Integer value2) {
public Criteria andOrgIdNotBetween(Long value1, Long value2) {
addCriterion("org_id not between", value1, value2, "orgId");
return (Criteria) this;
}

View File

@ -4,8 +4,8 @@ import java.io.Serializable;
import java.time.LocalDateTime;
/**
* race_question
* @author
* 试题
*/
public class RaceQuestion implements Serializable {
private Long id;
@ -38,7 +38,7 @@ public class RaceQuestion implements Serializable {
/**
* 公司题库
*/
private Integer companyId;
private Long companyId;
private static final long serialVersionUID = 1L;
@ -90,11 +90,11 @@ public class RaceQuestion implements Serializable {
this.projectCode = projectCode;
}
public Integer getCompanyId() {
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Integer companyId) {
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}

View File

@ -525,52 +525,52 @@ public class RaceQuestionExample {
return (Criteria) this;
}
public Criteria andCompanyIdEqualTo(Integer value) {
public Criteria andCompanyIdEqualTo(Long value) {
addCriterion("company_id =", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotEqualTo(Integer value) {
public Criteria andCompanyIdNotEqualTo(Long value) {
addCriterion("company_id <>", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThan(Integer value) {
public Criteria andCompanyIdGreaterThan(Long value) {
addCriterion("company_id >", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThanOrEqualTo(Integer value) {
public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) {
addCriterion("company_id >=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThan(Integer value) {
public Criteria andCompanyIdLessThan(Long value) {
addCriterion("company_id <", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThanOrEqualTo(Integer value) {
public Criteria andCompanyIdLessThanOrEqualTo(Long value) {
addCriterion("company_id <=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdIn(List<Integer> values) {
public Criteria andCompanyIdIn(List<Long> values) {
addCriterion("company_id in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotIn(List<Integer> values) {
public Criteria andCompanyIdNotIn(List<Long> values) {
addCriterion("company_id not in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdBetween(Integer value1, Integer value2) {
public Criteria andCompanyIdBetween(Long value1, Long value2) {
addCriterion("company_id between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotBetween(Integer value1, Integer value2) {
public Criteria andCompanyIdNotBetween(Long value1, Long value2) {
addCriterion("company_id not between", value1, value2, "companyId");
return (Criteria) this;
}

View File

@ -3,8 +3,8 @@ package club.joylink.rtss.entity;
import java.io.Serializable;
/**
* race_question_progress
* @author
* 题库练习进展
*/
public class RaceQuestionProgress implements Serializable {
private Long id;
@ -17,7 +17,7 @@ public class RaceQuestionProgress implements Serializable {
private String incorrect;
private Integer companyId;
private Long companyId;
private static final long serialVersionUID = 1L;
@ -61,11 +61,11 @@ public class RaceQuestionProgress implements Serializable {
this.incorrect = incorrect;
}
public Integer getCompanyId() {
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Integer companyId) {
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}

View File

@ -454,52 +454,52 @@ public class RaceQuestionProgressExample {
return (Criteria) this;
}
public Criteria andCompanyIdEqualTo(Integer value) {
public Criteria andCompanyIdEqualTo(Long value) {
addCriterion("company_id =", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotEqualTo(Integer value) {
public Criteria andCompanyIdNotEqualTo(Long value) {
addCriterion("company_id <>", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThan(Integer value) {
public Criteria andCompanyIdGreaterThan(Long value) {
addCriterion("company_id >", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThanOrEqualTo(Integer value) {
public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) {
addCriterion("company_id >=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThan(Integer value) {
public Criteria andCompanyIdLessThan(Long value) {
addCriterion("company_id <", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThanOrEqualTo(Integer value) {
public Criteria andCompanyIdLessThanOrEqualTo(Long value) {
addCriterion("company_id <=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdIn(List<Integer> values) {
public Criteria andCompanyIdIn(List<Long> values) {
addCriterion("company_id in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotIn(List<Integer> values) {
public Criteria andCompanyIdNotIn(List<Long> values) {
addCriterion("company_id not in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdBetween(Integer value1, Integer value2) {
public Criteria andCompanyIdBetween(Long value1, Long value2) {
addCriterion("company_id between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotBetween(Integer value1, Integer value2) {
public Criteria andCompanyIdNotBetween(Long value1, Long value2) {
addCriterion("company_id not between", value1, value2, "companyId");
return (Criteria) this;
}

View File

@ -3,15 +3,15 @@ package club.joylink.rtss.entity;
import java.io.Serializable;
/**
* race_questions_rules
* @author
* 理论题出题规则
*/
public class RaceQuestionsRules implements Serializable {
private Integer id;
private String projectCode;
private Integer companyId;
private Long companyId;
private String rules;
@ -33,11 +33,11 @@ public class RaceQuestionsRules implements Serializable {
this.projectCode = projectCode;
}
public Integer getCompanyId() {
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Integer companyId) {
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}

View File

@ -264,52 +264,52 @@ public class RaceQuestionsRulesExample {
return (Criteria) this;
}
public Criteria andCompanyIdEqualTo(Integer value) {
public Criteria andCompanyIdEqualTo(Long value) {
addCriterion("company_id =", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotEqualTo(Integer value) {
public Criteria andCompanyIdNotEqualTo(Long value) {
addCriterion("company_id <>", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThan(Integer value) {
public Criteria andCompanyIdGreaterThan(Long value) {
addCriterion("company_id >", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThanOrEqualTo(Integer value) {
public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) {
addCriterion("company_id >=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThan(Integer value) {
public Criteria andCompanyIdLessThan(Long value) {
addCriterion("company_id <", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThanOrEqualTo(Integer value) {
public Criteria andCompanyIdLessThanOrEqualTo(Long value) {
addCriterion("company_id <=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdIn(List<Integer> values) {
public Criteria andCompanyIdIn(List<Long> values) {
addCriterion("company_id in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotIn(List<Integer> values) {
public Criteria andCompanyIdNotIn(List<Long> values) {
addCriterion("company_id not in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdBetween(Integer value1, Integer value2) {
public Criteria andCompanyIdBetween(Long value1, Long value2) {
addCriterion("company_id between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotBetween(Integer value1, Integer value2) {
public Criteria andCompanyIdNotBetween(Long value1, Long value2) {
addCriterion("company_id not between", value1, value2, "companyId");
return (Criteria) this;
}

View File

@ -3,8 +3,8 @@ package club.joylink.rtss.entity;
import java.io.Serializable;
/**
* race_result
* @author
* 比赛结果
*/
public class RaceResult implements Serializable {
private Long id;
@ -67,7 +67,7 @@ public class RaceResult implements Serializable {
/**
* 公司id
*/
private Integer companyId;
private Long companyId;
private static final long serialVersionUID = 1L;
@ -167,11 +167,11 @@ public class RaceResult implements Serializable {
this.projectCode = projectCode;
}
public Integer getCompanyId() {
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Integer companyId) {
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}

View File

@ -904,52 +904,52 @@ public class RaceResultExample {
return (Criteria) this;
}
public Criteria andCompanyIdEqualTo(Integer value) {
public Criteria andCompanyIdEqualTo(Long value) {
addCriterion("company_id =", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotEqualTo(Integer value) {
public Criteria andCompanyIdNotEqualTo(Long value) {
addCriterion("company_id <>", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThan(Integer value) {
public Criteria andCompanyIdGreaterThan(Long value) {
addCriterion("company_id >", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThanOrEqualTo(Integer value) {
public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) {
addCriterion("company_id >=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThan(Integer value) {
public Criteria andCompanyIdLessThan(Long value) {
addCriterion("company_id <", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThanOrEqualTo(Integer value) {
public Criteria andCompanyIdLessThanOrEqualTo(Long value) {
addCriterion("company_id <=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdIn(List<Integer> values) {
public Criteria andCompanyIdIn(List<Long> values) {
addCriterion("company_id in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotIn(List<Integer> values) {
public Criteria andCompanyIdNotIn(List<Long> values) {
addCriterion("company_id not in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdBetween(Integer value1, Integer value2) {
public Criteria andCompanyIdBetween(Long value1, Long value2) {
addCriterion("company_id between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotBetween(Integer value1, Integer value2) {
public Criteria andCompanyIdNotBetween(Long value1, Long value2) {
addCriterion("company_id not between", value1, value2, "companyId");
return (Criteria) this;
}

View File

@ -603,28 +603,34 @@ public class ExamService implements IExamService {
}
@Override
public PageVO<ExamDefinitionVO> pagedQueryExamICreated(ExamDefinitionQueryVO queryVO, LoginUserInfoVO loginInfo) {
public PageVO<ExamDefinitionVO> pagedQueryByLoginProject(ExamDefinitionQueryVO queryVO, LoginUserInfoVO loginInfo) {
List<Long> lessonIds;
if (queryVO.getLessonId() != null) {
lessonIds = List.of(queryVO.getLessonId());
} else {
lessonIds = iLessonService.queryLessonICreatedInLoginProject(loginInfo).stream().map(LessonVO::getId).collect(Collectors.toList());
List<LessonVO> lessonVOS = iLessonService.queryNonDefaultLessons(null, loginInfo.getProject(), BusinessConsts.STATUS_USE);
lessonIds = lessonVOS.stream().map(LessonVO::getId).collect(Collectors.toList());
}
if (CollectionUtils.isEmpty(lessonIds)) {
return new PageVO<>(queryVO.getPageNum(), queryVO.getPageSize(), 0, new ArrayList<>());
} else {
List<OrgLesson> orgLessons = iOrgLessonService.findEntitiesByLessonIds(lessonIds);
Map<Long, List<Integer>> lessonOrgMap = orgLessons.stream()
Map<Long, List<Long>> lessonOrgMap = orgLessons.stream()
.collect(Collectors.groupingBy(OrgLesson::getLessonId, Collectors.mapping(OrgLesson::getOrgId, Collectors.toList())));
ExamDefinitionExample example = new ExamDefinitionExample();
ExamDefinitionExample.Criteria criteria = example.createCriteria().andLessonIdIn(lessonIds).andCreatorIdEqualTo(loginInfo.getUserVO().getId());
ExamDefinitionExample.Criteria criteria = example.createCriteria().andLessonIdIn(lessonIds);
if (StringUtils.hasText(queryVO.getName())) {
criteria.andNameLike(String.format("%%%s%%", queryVO.getName()));
}
if (queryVO.isSelf()) {
criteria.andCreatorIdEqualTo(loginInfo.getUserVO().getId());
}
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
Page<ExamDefinition> page = (Page<ExamDefinition>) examDefinitionDAO.selectByExample(example);
Map<Long, SysUser> creatorMap = iSysUserService.findEntity(page.stream().map(ExamDefinition::getCreatorId).collect(Collectors.toList()), null)
.stream().collect(Collectors.toMap(SysUser::getId, Function.identity()));
List<ExamDefinitionVO> list = page.getResult().stream().map(examDefinition -> {
ExamDefinitionVO vo = new ExamDefinitionVO(examDefinition);
ExamDefinitionVO vo = new ExamDefinitionVO(examDefinition, creatorMap.get(examDefinition.getCreatorId()));
vo.setClsIds(lessonOrgMap.get(vo.getLessonId()));
return vo;
}).collect(Collectors.toList());
@ -633,15 +639,15 @@ public class ExamService implements IExamService {
}
@Override
public List<ExamDefinitionVO> listQueryOrgExamICreated(Integer clsId, LoginUserInfoVO loginInfo) {
public List<ExamDefinitionVO> listQueryOrgExamICreated(Long clsId, LoginUserInfoVO loginInfo) {
List<Long> lessonIds;
if (clsId == null) {
Org topOrg = iOrgService.getEntity(loginInfo.getProject(), BusinessConsts.Org.Status.VALID);
List<Org> clsList = iOrgService.findEntitiesByParentId(topOrg.getId(), "id", BusinessConsts.Org.Status.VALID);
List<Integer> clsIds = clsList.stream().map(Org::getId).collect(Collectors.toList());
List<Long> clsIds = clsList.stream().map(Org::getId).collect(Collectors.toList());
lessonIds = iOrgLessonService.findEntitiesByOrgIds(clsIds).stream().map(OrgLesson::getLessonId).collect(Collectors.toList());
} else {
lessonIds = iOrgLessonService.findEntities(clsId).stream().map(OrgLesson::getLessonId).collect(Collectors.toList());
lessonIds = iOrgLessonService.findEntitiesByOrgId(clsId).stream().map(OrgLesson::getLessonId).collect(Collectors.toList());
}
return findEntityByLessonIdList(lessonIds).stream()
.filter(exam -> loginInfo.getUserVO().getId().equals(exam.getCreatorId()))
@ -649,18 +655,18 @@ public class ExamService implements IExamService {
}
@Override
public List<ExamDefinitionVO> listQueryExamICreated(ExamDefinitionQueryVO queryVO, LoginUserInfoVO loginInfo) {
public List<ExamDefinitionVO> listQueryExamByLoginProject(ExamDefinitionQueryVO queryVO, LoginUserInfoVO loginInfo) {
List<Long> lessonIds;
if (queryVO.getLessonId() != null) {
lessonIds = List.of(queryVO.getLessonId());
} else {
lessonIds = iLessonService.queryLessonICreatedInLoginProject(loginInfo).stream().map(LessonVO::getId).collect(Collectors.toList());
lessonIds = iLessonService.queryByLoginProject(new LessonQueryVO(), loginInfo).stream().map(LessonVO::getId).collect(Collectors.toList());
}
if (CollectionUtils.isEmpty(lessonIds)) {
return new ArrayList<>();
} else {
List<OrgLesson> orgLessons = iOrgLessonService.findEntitiesByLessonIds(lessonIds);
Map<Long, List<Integer>> lessonOrgMap = orgLessons.stream()
Map<Long, List<Long>> lessonOrgMap = orgLessons.stream()
.collect(Collectors.groupingBy(OrgLesson::getLessonId, Collectors.mapping(OrgLesson::getOrgId, Collectors.toList())));
ExamDefinitionExample example = new ExamDefinitionExample();
ExamDefinitionExample.Criteria criteria = example.createCriteria().andLessonIdIn(lessonIds).andCreatorIdEqualTo(loginInfo.getUserVO().getId());

View File

@ -84,17 +84,17 @@ public interface IExamService {
/**
* 分页查询组织老师个人创建的考试
*/
PageVO<ExamDefinitionVO> pagedQueryExamICreated(ExamDefinitionQueryVO queryVO, LoginUserInfoVO loginInfo);
PageVO<ExamDefinitionVO> pagedQueryByLoginProject(ExamDefinitionQueryVO queryVO, LoginUserInfoVO loginInfo);
/**
* 不分页查询组织老师个人创建的考试
*/
List<ExamDefinitionVO> listQueryOrgExamICreated(Integer clsId, LoginUserInfoVO loginInfo);
List<ExamDefinitionVO> listQueryOrgExamICreated(Long clsId, LoginUserInfoVO loginInfo);
/**
* 查询当前项目下创建的考试
*/
List<ExamDefinitionVO> listQueryExamICreated(ExamDefinitionQueryVO queryVO, LoginUserInfoVO loginInfo);
List<ExamDefinitionVO> listQueryExamByLoginProject(ExamDefinitionQueryVO queryVO, LoginUserInfoVO loginInfo);
ExamDefinition getEntity(Long examId);

View File

@ -78,7 +78,7 @@ public interface ILessonService {
/**
* 根据课程id集合查询课程数据列表
*/
List<LessonVO> queryByIds(List<Long> lessonIds);
List<LessonVO> queryByIds(List<Long> lessonIds, String status);
/**
* 根据实训id删除章节-实训关系
@ -149,22 +149,22 @@ public interface ILessonService {
void addChapterTrainingRelAfterDelete(List<LessonChapterTrainingRelVO> relVOS);
/**
* 分页查询用户当前登录的项目下的课程仅课程的信息
* 结合条件分页查询用户当前登录的项目下非默认的课程仅课程的信息
*/
PageVO<LessonVO> pagedQueryPersonalLesson(LessonQueryVO queryVO, LoginUserInfoVO loginInfo);
PageVO<LessonVO> pagedQueryByLoginProject(LessonQueryVO queryVO, LoginUserInfoVO loginInfo);
/**
* 查询自己创建的当前登录的项目下的课程仅课程的信息
*/
List<LessonVO> queryLessonICreatedInLoginProject(LoginUserInfoVO loginInfo);
List<LessonVO> queryByLoginProject(LessonQueryVO queryVO, LoginUserInfoVO loginInfo);
/**
* 查询自己为指定班级创建的课程
*/
List<LessonVO> queryOrgLessonOfSelf(Integer clsId, LoginUserInfoVO loginInfo);
List<LessonVO> queryOrgLessonOfSelf(Long clsId, LoginUserInfoVO loginInfo);
/**
* 查询由该用户创建的在这个项目下的课程
* 按条件查询非默认课程
*/
List<LessonVO> queryLessons(Long userId, Project project);
List<LessonVO> queryNonDefaultLessons(Long creatorId, Project project, String status);
}

View File

@ -270,7 +270,7 @@ public interface ISysUserService {
*/
void userBindWm(String code, Long userId);
CompanyVO userScanCodeBindCompanyManager(Long userId, Integer companyId);
CompanyVO userScanCodeBindCompanyManager(Long userId, Long companyId);
UserVO getUserBaseInfoById(Long id);
@ -289,7 +289,7 @@ public interface ISysUserService {
void superAdminUpdateUserInfo(UserVO updateUser, UserVO superAdmin);
void userBindCompanyManager(UserVO userVO, Integer companyId);
void userBindCompanyManager(UserVO userVO, Long companyId);
/**
* 查询所有的销售人员

View File

@ -69,7 +69,7 @@ public interface IUserExamService {
/**
* 查询组织成员的考试成绩
*/
PageVO<UserExamVO> pagedQueryOrgUserExamResult(Integer orgId, Long examId, PageQueryVO queryVO);
PageVO<UserExamVO> pagedQueryOrgUserExamResult(Long orgId, Long examId, PageQueryVO queryVO);
/**
* 查询用户对指定试卷的最高分

View File

@ -4,6 +4,7 @@ import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.UsageTotalStatsVO;
import club.joylink.rtss.vo.client.UserRankStatsVO;
import java.time.LocalDate;
import java.util.List;
public interface IUserUsageStatsService {
@ -27,9 +28,8 @@ public interface IUserUsageStatsService {
/**
* 统计课程的学习时长
* @return
*/
UserRankStatsVO statisticsLessonLearningDuration(List<Long> lessonId, Long userId);
UserRankStatsVO statisticsLessonLearningDuration(LocalDate startDate, LocalDate endDate, List<Long> lessonId, Long userId);
/**
* 个人课程实训统计

View File

@ -85,6 +85,9 @@ public class LessonService implements ILessonService {
@Autowired
private IOrgLessonService iOrgLessonService;
@Autowired
private ISysUserService iSysUserService;
@Override
public LessonTreeVO getLessonTree(Long id, UserVO userVO) {
LessonTreeVO lessonTreeVO = new LessonTreeVO();
@ -222,7 +225,7 @@ public class LessonService implements ILessonService {
LessonVO sysFaultLesson = findSysFaultByMapAndPrdType(publishVO.getMapId(), publishVO.getPrdType());
if (sysFaultLesson != null) {
BusinessExceptionAssertEnum.INVALID_OPERATION.assertNotTrue(Objects.equals(publishVO.getName(),sysFaultLesson.getName()),"与系统默认课程重名,请修改名称");
BusinessExceptionAssertEnum.INVALID_OPERATION.assertNotTrue(Objects.equals(publishVO.getName(), sysFaultLesson.getName()), "与系统默认课程重名,请修改名称");
}
// 更新
newLesson.setId(publishedLesson.getId());
@ -233,7 +236,7 @@ public class LessonService implements ILessonService {
List<OrgLesson> departmentLessonRefs = this.departmentLessonDAO.selectByExample(departmentLessonExample);
if (!CollectionUtils.isEmpty(publishVO.getClassIdList())) {
if (!CollectionUtils.isEmpty(departmentLessonRefs)) {
List<Integer> existedClassIds = departmentLessonRefs.stream().map(OrgLesson::getOrgId).collect(Collectors.toList());
List<Long> existedClassIds = departmentLessonRefs.stream().map(OrgLesson::getOrgId).collect(Collectors.toList());
Collections.sort(existedClassIds);
Collections.sort(publishVO.getClassIdList());
if (!existedClassIds.equals(publishVO.getClassIdList())) {
@ -383,9 +386,12 @@ public class LessonService implements ILessonService {
}
@Override
public List<LessonVO> queryByIds(List<Long> lessonIds) {
public List<LessonVO> queryByIds(List<Long> lessonIds, String status) {
LsLessonExample lessonExample = new LsLessonExample();
lessonExample.createCriteria().andIdIn(lessonIds);
Criteria criteria = lessonExample.createCriteria().andIdIn(lessonIds);
if (StringUtils.hasText(status)) {
criteria.andStatusEqualTo(status);
}
List<LsLesson> lessonList = this.lessonDAO.selectByExample(lessonExample);
return LessonVO.convert(lessonList);
}
@ -518,7 +524,7 @@ public class LessonService implements ILessonService {
@Transactional
@Override
public void generateLessonAndExam(List<Long> mapIds, UserVO userVO) {
BusinessExceptionAssertEnum.INVALID_OPERATION.assertNotTrue(CollectionUtils.isEmpty(mapIds),"请选择地图后生成");
BusinessExceptionAssertEnum.INVALID_OPERATION.assertNotTrue(CollectionUtils.isEmpty(mapIds), "请选择地图后生成");
mapIds.parallelStream().forEach(mapId -> {
MapVO mapVO = iMapService.findMapBaseInfoById(mapId);
if (Objects.isNull(mapVO)) return;
@ -534,7 +540,7 @@ public class LessonService implements ILessonService {
@Override
public List<LessonVO> getValidLesson(Long mapId, @NotEmpty List<Long> ids, String prdType) {
return lessonDAO.getValidLesson(mapId,ids, prdType);
return lessonDAO.getValidLesson(mapId, ids, prdType);
}
@Override
@ -553,51 +559,64 @@ public class LessonService implements ILessonService {
}
@Override
public PageVO<LessonVO> pagedQueryPersonalLesson(LessonQueryVO queryVO, LoginUserInfoVO loginInfo) {
public PageVO<LessonVO> pagedQueryByLoginProject(LessonQueryVO queryVO, LoginUserInfoVO loginInfo) {
List<MapVO> maps = iMapService.findOnlineMapByProjectCode(loginInfo.getProject().name());
if (CollectionUtils.isEmpty(maps)) {
return new PageVO<>();
} else {
List<Long> mapIds = maps.stream().map(MapVO::getId).collect(Collectors.toList());
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
LsLessonExample example = new LsLessonExample();
Criteria criteria = example.createCriteria();
criteria.andMapIdIn(mapIds)
.andCreatorIdEqualTo(loginInfo.getUserVO().getId())
.andSysfaultEqualTo(false);
criteria.andMapIdIn(mapIds).andSysfaultEqualTo(false);
if (queryVO.isSelf()) {
criteria.andCreatorIdEqualTo(loginInfo.getUserVO().getId());
}
if (StringUtils.hasText(queryVO.getName())) {
criteria.andNameLike(String.format("%%%s%%", queryVO.getName()));
}
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
Page<LsLesson> page = (Page<LsLesson>) lessonDAO.selectByExample(example);
return PageVO.convert(page, LessonVO.convert(page.getResult()));
Map<Long, SysUser> creators = iSysUserService.findEntity(page.stream().map(LsLesson::getCreatorId).collect(Collectors.toList()), null)
.stream().collect(Collectors.toMap(SysUser::getId, Function.identity()));
List<LessonVO> lessonVOList = LessonVO.convert(page.getResult(), creators);
return PageVO.convert(page, lessonVOList);
}
}
@Override
public List<LessonVO> queryLessonICreatedInLoginProject(LoginUserInfoVO loginInfo) {
return queryLessons(loginInfo.getUserVO().getId(), loginInfo.getProject());
public List<LessonVO> queryByLoginProject(LessonQueryVO queryVO, LoginUserInfoVO loginInfo) {
if (queryVO.isSelf()) {
return queryNonDefaultLessons(loginInfo.getUserVO().getId(), loginInfo.getProject(), BusinessConsts.STATUS_USE);
} else {
return queryNonDefaultLessons(null, loginInfo.getProject(), BusinessConsts.STATUS_USE);
}
}
@Override
public List<LessonVO> queryOrgLessonOfSelf(Integer clsId, LoginUserInfoVO loginInfo) {
List<Long> lessonIds = iOrgLessonService.findEntities(clsId).stream().map(OrgLesson::getLessonId).collect(Collectors.toList());
public List<LessonVO> queryOrgLessonOfSelf(Long clsId, LoginUserInfoVO loginInfo) {
List<Long> lessonIds = iOrgLessonService.findEntitiesByOrgId(clsId).stream().map(OrgLesson::getLessonId).collect(Collectors.toList());
List<LsLesson> lessonEntities = findLessonEntities(lessonIds);
return lessonEntities.stream()
.filter(lesson->loginInfo.getUserVO().getId().equals(lesson.getCreatorId())).map(LessonVO::new).collect(Collectors.toList());
.filter(lesson -> loginInfo.getUserVO().getId().equals(lesson.getCreatorId())).map(LessonVO::new).collect(Collectors.toList());
}
@Override
public List<LessonVO> queryLessons(Long userId, Project project) {
public List<LessonVO> queryNonDefaultLessons(Long creatorId, @NonNull Project project, String status) {
List<MapVO> maps = iMapService.findOnlineMapByProjectCode(project.name());
if (CollectionUtils.isEmpty(maps)) {
return new ArrayList<>();
} else {
List<Long> mapIds = maps.stream().map(MapVO::getId).collect(Collectors.toList());
LsLessonExample example = new LsLessonExample();
example.createCriteria()
Criteria criteria = example.createCriteria()
.andMapIdIn(mapIds)
.andCreatorIdEqualTo(userId)
.andSysfaultEqualTo(false);
if (creatorId != null) {
criteria.andCreatorIdEqualTo(creatorId);
}
if (StringUtils.hasText(status)) {
criteria.andStatusEqualTo(status);
}
List<LsLesson> list = lessonDAO.selectByExample(example);
return LessonVO.convert(list);
}

View File

@ -2,10 +2,10 @@ package club.joylink.rtss.services;
import club.joylink.rtss.constants.*;
import club.joylink.rtss.dao.MapSystemDAO;
import club.joylink.rtss.entity.MapSystem;
import club.joylink.rtss.entity.MapSystemExample;
import club.joylink.rtss.entity.OrgLesson;
import club.joylink.rtss.entity.*;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.org.IOrgLessonService;
import club.joylink.rtss.services.org.IOrgService;
import club.joylink.rtss.services.org.IOrgUserService;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.UserVO;
@ -13,7 +13,6 @@ import club.joylink.rtss.vo.client.LessonVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.TreeNode;
import club.joylink.rtss.vo.client.map.MapVO;
import club.joylink.rtss.vo.client.org.UserDepartRelVO;
import club.joylink.rtss.vo.client.runplan.RunPlanVO;
import club.joylink.rtss.vo.client.sub.MapSystemDetailVO;
import club.joylink.rtss.vo.client.sub.MapSystemQueryVO;
@ -31,6 +30,7 @@ import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
@Service
@ -58,6 +58,12 @@ public class MapSystemService implements IMapSystemService {
@Autowired
private IOrgUserService iOrgUserService;
@Autowired
private IOrgService iOrgService;
@Autowired
private IOrgLessonService iOrgLessonService;
@Override
@Transactional
public void generateSystem(Long mapId) {
@ -214,39 +220,31 @@ public class MapSystemService implements IMapSystemService {
mapSystem.getMapId(), mapSystem.getPrdType());
mapSystemDetailVO.setPermissionList(permissionVOList);
} else if (MapSystemType.Lesson.name().equals(mapSystem.getType())
|| MapSystemType.Exam.name().equals(mapSystem.getType())) {
List<LessonVO> lessonVOList = new ArrayList<>();
//用户存在部门关系时根据部门课程关系查询课程
if(iOrgUserService.isCompanyUser(userVO.getId())){
List<UserDepartRelVO> userDepartRelVOS = this.iOrgUserService.getDepartRefByUserId(userVO.getId());
if(!CollectionUtils.isEmpty(userDepartRelVOS)){
List<OrgLesson> departLessonRefs = userDepartRelVOS.stream()
.flatMap(userDepartRelVO -> this.iOrgUserService.getDepartLessonRefs(userDepartRelVO.getDepartmentId()).stream()).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(departLessonRefs)){
lessonVOList = iLessonService.getValidLesson( mapSystem.getMapId(),departLessonRefs.stream().map(OrgLesson::getLessonId).collect(Collectors.toList()), mapSystem.getPrdType());
}
} else if (MapSystemType.Lesson.name().equals(mapSystem.getType()) || MapSystemType.Exam.name().equals(mapSystem.getType())) {
Org topOrg = iOrgService.findEntity(loginInfo.getProject(), BusinessConsts.Org.Status.VALID);
List<LessonVO> lessonVOList;
if (!Project.CGY.equals(loginInfo.getProject()) && topOrg != null) { //由于成都工业的特殊性先防一下
lessonVOList = new ArrayList<>();
LessonVO defaultLesson = iLessonService.findSysFaultByMapAndPrdType(mapSystem.getMapId(), mapSystem.getPrdType());
if (defaultLesson != null && MapStatus.Online.getCode().equals(defaultLesson.getStatus())) {
lessonVOList.add(defaultLesson);
}
} else{
lessonVOList = iLessonService.getByMapIdAndPrdType(mapSystem.getMapId(), mapSystem.getPrdType());
}
// BusinessConsts.Lesson.PrdInfo prdInfo = BusinessConsts.Lesson.PrdInfo.getBy(mapSystem.getPrdType());
// if (Objects.nonNull(prdInfo)) {
// String defaultLessonName = String.join("-", mapVO.getName(), prdInfo.getName());
//默认课程展示
LessonVO existedDefaultLesson = iLessonService.findSysFaultByMapAndPrdType(mapSystem.getMapId(), mapSystem.getPrdType());
if (Objects.nonNull(existedDefaultLesson) && Objects.equals(MapStatus.Online.getCode(),existedDefaultLesson.getStatus())) {
if (lessonVOList.stream().noneMatch(lessonVO -> lessonVO.getId().equals(existedDefaultLesson.getId()))) {
// existedDefaultLesson.setSystemFault(true);
lessonVOList.add(existedDefaultLesson);
}else{
lessonVOList.stream().filter(lessonVO -> lessonVO.getId().equals(existedDefaultLesson.getId())).findAny().ifPresent(lessonVO ->lessonVO.setSystemFault(true) );
}
}
// }
List<LessonVO> lessonsICreated = iLessonService.queryNonDefaultLessons(loginInfo.getUserVO().getId(),
loginInfo.getProject(), BusinessConsts.STATUS_USE);
lessonVOList.addAll(lessonsICreated);
//如果当前用户有所属班级查询所属有效班级关联的有效课程
List<OrgUser> orgUsers = iOrgUserService.findEntities(loginInfo.getUserVO().getId(), null);
List<Long> orgIds = orgUsers.stream().map(OrgUser::getOrgId).collect(Collectors.toList());
List<Long> validOrgIds = iOrgService.findEntities(orgIds, BusinessConsts.Org.Status.VALID)
.stream().map(Org::getId).collect(Collectors.toList());
Set<Long> lessonIdSet = lessonVOList.stream().map(LessonVO::getId).collect(Collectors.toSet());
List<Long> orgLessonIds = iOrgLessonService.findEntitiesByOrgIds(validOrgIds).stream().map(OrgLesson::getLessonId)
.filter(lessonId -> !lessonIdSet.contains(lessonId)).distinct().collect(Collectors.toList());
lessonVOList.addAll(iLessonService.queryByIds(orgLessonIds, BusinessConsts.STATUS_USE));
//
} else {
lessonVOList = iLessonService.getByMapIdAndPrdType(mapSystem.getMapId(), mapSystem.getPrdType());
}
if (CollectionUtils.isEmpty(lessonVOList)) {
return mapSystemDetailVO;
@ -254,7 +252,7 @@ public class MapSystemService implements IMapSystemService {
//查询课程关联的班级列表
lessonVOList.forEach(lessonVO -> {
List<String> classNames = this.iOrgUserService.getDepartNamesByLesson(lessonVO.getId());
if(!CollectionUtils.isEmpty(classNames)){
if (!CollectionUtils.isEmpty(classNames)) {
lessonVO.setClassNames(classNames);
}
});

View File

@ -313,7 +313,7 @@ public class SysUserService implements ISysUserService {
@Override
@Transactional
public CompanyVO userScanCodeBindCompanyManager(Long userId, Integer companyId) {
public CompanyVO userScanCodeBindCompanyManager(Long userId, Long companyId) {
Org company = companyDAO.selectByPrimaryKey(companyId);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(company, String.format("id为[%s]的组织不存在", companyId));
SysUser sysUser = sysUserDAO.selectByPrimaryKey(userId);
@ -743,7 +743,7 @@ public class SysUserService implements ISysUserService {
@Override
@Transactional
public void userBindCompanyManager(UserVO userVO, Integer companyId) {
public void userBindCompanyManager(UserVO userVO, Long companyId) {
OrgExample companyExample = new OrgExample();
companyExample.createCriteria().andParentIdIsNull().andIdEqualTo(companyId);
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(companyDAO.countByExample(companyExample) > 0, "不存在的单位");
@ -760,7 +760,7 @@ public class SysUserService implements ISysUserService {
companyManager.setRole(BusinessConsts.OrgRole.Admin.name());
orgUserDAO.insertSelective(companyManager);
} else {
Integer orgId = orgUsers.get(0).getOrgId();
Long orgId = orgUsers.get(0).getOrgId();
Org org = companyDAO.selectByPrimaryKey(orgId);
if (!Objects.equals(org.getRootId(), companyId)) {
orgUserDAO.deleteByExample(oe);
@ -818,9 +818,6 @@ public class SysUserService implements ISysUserService {
SysUserExample example = new SysUserExample();
example.createCriteria()
.andEmailEqualTo(email);
if (sysUserDAO.countByExample(example) > 0) {
return true;
}
return false;
return sysUserDAO.countByExample(example) > 0;
}
}

View File

@ -305,8 +305,8 @@ public class UserExamService implements IUserExamService {
}
@Override
public PageVO<UserExamVO> pagedQueryOrgUserExamResult(Integer orgId, Long examId, PageQueryVO queryVO) {
List<Long> userIds = iOrgUserService.findEntities(orgId, BusinessConsts.OrgRole.Student).stream().map(OrgUser::getUserId).collect(Collectors.toList());
public PageVO<UserExamVO> pagedQueryOrgUserExamResult(Long orgId, Long examId, PageQueryVO queryVO) {
List<Long> userIds = iOrgUserService.findEntitiesByOrgId(orgId, BusinessConsts.OrgRole.Student).stream().map(OrgUser::getUserId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(userIds)) {
return new PageVO<>(queryVO.getPageNum(), queryVO.getPageSize(), 0, new ArrayList<>());
} else {

View File

@ -18,6 +18,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -58,9 +61,11 @@ public class UserUsageStatsService implements IUserUsageStatsService {
}
@Override
public UserRankStatsVO statisticsLessonLearningDuration(List<Long> lessonIds, Long userId) {
public UserRankStatsVO statisticsLessonLearningDuration(LocalDate startDate, LocalDate endDate, List<Long> lessonIds, Long userId) {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(lessonIds);
return this.userTrainingStatsMapper.selectRank(lessonIds, userId);
LocalDateTime startTime = LocalDateTime.of(startDate, LocalTime.of(0, 0, 0));
LocalDateTime endTime = LocalDateTime.of(endDate, LocalTime.of(23, 59, 59));
return this.userTrainingStatsMapper.selectRank(startTime, endTime, lessonIds, userId);
}
@Override

View File

@ -14,15 +14,13 @@ public interface IRaceQuestionsRuleService {
TheoryQuestionsRuleVO create(TheoryQuestionsRuleVO ruleVO);
TheoryQuestionsRuleVO get(String projectCode, Integer companyId);
TheoryQuestionsRuleVO get(String projectCode, Long companyId);
TheoryQuestionsRuleVO update(Integer ruleId, TheoryQuestionsRuleVO ruleVO);
void deleteById(Integer ruleId);
void deleteByCompanyId(Integer companyId);
TheoryQuestionsRuleVO getById(Integer ruleId);
boolean isExist(String projectCode, Integer companyId);
boolean isExist(String projectCode, Long companyId);
}

View File

@ -9,11 +9,11 @@ import java.util.List;
public interface IRaceTheoryService {
List<QuestionVO> getProjectTheory(String mode, String projectCode, Integer companyId, UserVO user);
List<QuestionVO> getProjectTheory(String mode, String projectCode, Long companyId, UserVO user);
List<RaceResultDetailVO> submitProjectTheory(UserVO user, String projectCode, Integer companyId, ProjectTheoryAnswerVO theoryAnswers);
List<RaceResultDetailVO> submitProjectTheory(UserVO user, String projectCode, Long companyId, ProjectTheoryAnswerVO theoryAnswers);
void deleteRaceTheoryResult(String projectCode, Integer companyId);
void deleteRaceTheoryResult(String projectCode, Long companyId);
List<RaceResultDetailVO> getTheoryResultDetails(String projectCode, Integer companyId, Long userId);
List<RaceResultDetailVO> getTheoryResultDetails(String projectCode, Long companyId, Long userId);
}

View File

@ -6,20 +6,20 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.List;
public interface IUserQuestionProgressService {
RaceQuestionProgressVO getQuestionProgress(Long userId, String projectCode, Integer companyId);
RaceQuestionProgressVO getQuestionProgress(Long userId, String projectCode, Long companyId);
void deleteUserQuestionProgress(Long userId, String projectCode);
void deleteUserQuestionProgress(Long userId, String projectCode, Integer companyId);
void deleteUserQuestionProgress(Long userId, String projectCode, Long companyId);
void addQuestionProgress(Long userId, String projectCode, Integer companyId, Long questionIndex);
void addQuestionProgress(Long userId, String projectCode, Long companyId, Long questionIndex);
@Transactional
void addIncorrectQuestion(Long userId, String projectCode, Integer companyId, Long questionId);
void addIncorrectQuestion(Long userId, String projectCode, Long companyId, Long questionId);
@Transactional
void addIncorrectQuestions(Long userId, String projectCode, Integer companyId, List<Long> questionIds);
void addIncorrectQuestions(Long userId, String projectCode, Long companyId, List<Long> questionIds);
@Transactional
void deleteIncorrectQuestion(Long userId, String projectCode, Integer companyId, Long questionId);
void deleteIncorrectQuestion(Long userId, String projectCode, Long companyId, Long questionId);
}

View File

@ -61,7 +61,7 @@ public class RaceQuestionsRuleService implements IRaceQuestionsRuleService {
}
@Override
public TheoryQuestionsRuleVO get(String projectCode, Integer companyId) {
public TheoryQuestionsRuleVO get(String projectCode, Long companyId) {
RaceQuestionsRulesExample example = new RaceQuestionsRulesExample();
RaceQuestionsRulesExample.Criteria criteria = example.createCriteria();
boolean isDefault = Project.isDefault(Project.valueOf(projectCode));
@ -96,13 +96,6 @@ public class RaceQuestionsRuleService implements IRaceQuestionsRuleService {
raceQuestionsRulesDAO.deleteByPrimaryKey(ruleId);
}
@Override
public void deleteByCompanyId(Integer companyId) {
RaceQuestionsRulesExample example = new RaceQuestionsRulesExample();
example.createCriteria().andCompanyIdEqualTo(companyId);
raceQuestionsRulesDAO.deleteByExample(example);
}
@Override
public TheoryQuestionsRuleVO getById(Integer ruleId) {
RaceQuestionsRules entity = raceQuestionsRulesDAO.selectByPrimaryKey(ruleId);
@ -111,7 +104,7 @@ public class RaceQuestionsRuleService implements IRaceQuestionsRuleService {
}
@Override
public boolean isExist(String projectCode, Integer companyId) {
public boolean isExist(String projectCode, Long companyId) {
RaceQuestionsRulesExample example = new RaceQuestionsRulesExample();
RaceQuestionsRulesExample.Criteria criteria = example.createCriteria();
boolean isDefault = Project.isDefault(Project.valueOf(projectCode));

View File

@ -20,11 +20,11 @@ import club.joylink.rtss.vo.client.question.QuestionQueryVO;
import club.joylink.rtss.vo.client.question.QuestionVO;
import club.joylink.rtss.vo.client.race.RaceResultDetailVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@ -61,10 +61,11 @@ public class RaceTheoryService implements IRaceTheoryService {
*
* @param mode
* @param projectCode
* @param companyId
* @return
*/
@Override
public List<QuestionVO> getProjectTheory(String mode, String projectCode, Integer companyId, UserVO user) {
public List<QuestionVO> getProjectTheory(String mode, String projectCode, Long companyId, UserVO user) {
boolean isDefault = Project.isDefault(Project.valueOf(projectCode));
//相关竞赛项目下所有题目
QuestionQueryVO questionQueryVO = new QuestionQueryVO();
@ -130,7 +131,7 @@ public class RaceTheoryService implements IRaceTheoryService {
@Override
@Transactional
public List<RaceResultDetailVO> submitProjectTheory(UserVO user, String projectCode, Integer companyId, ProjectTheoryAnswerVO theoryAnswers) {
public List<RaceResultDetailVO> submitProjectTheory(UserVO user, String projectCode, Long companyId, ProjectTheoryAnswerVO theoryAnswers) {
List<Float> scores = new ArrayList<>() {{
add(0f);
}};
@ -280,7 +281,7 @@ public class RaceTheoryService implements IRaceTheoryService {
/**清除考试结果*/
@Override
public void deleteRaceTheoryResult(String projectCode, Integer companyId) {
public void deleteRaceTheoryResult(String projectCode, Long companyId) {
RaceResultExample example = new RaceResultExample();
RaceResultExample.Criteria criteria = example.createCriteria();
boolean isDefault = Project.isDefault(Project.valueOf(projectCode));
@ -300,7 +301,7 @@ public class RaceTheoryService implements IRaceTheoryService {
@Override
public List<RaceResultDetailVO> getTheoryResultDetails(String projectCode, Integer companyId, Long userId) {
public List<RaceResultDetailVO> getTheoryResultDetails(String projectCode, Long companyId, Long userId) {
//根据参赛id获取参赛成绩信息
RaceResultExample example = new RaceResultExample();
RaceResultExample.Criteria criteria = example.createCriteria();

View File

@ -22,7 +22,7 @@ public class UserQuestionProgressService implements IUserQuestionProgressService
private RaceQuestionProgressDAO raceQuestionProgressDAO;
@Override
public RaceQuestionProgressVO getQuestionProgress(Long userId, String projectCode, Integer companyId) {
public RaceQuestionProgressVO getQuestionProgress(Long userId, String projectCode, Long companyId) {
boolean isDefault = Project.isDefault(Project.valueOf(projectCode));
RaceQuestionProgressExample example = new RaceQuestionProgressExample();
RaceQuestionProgressExample.Criteria criteria = example.createCriteria();
@ -53,7 +53,7 @@ public class UserQuestionProgressService implements IUserQuestionProgressService
}
@Override
public void deleteUserQuestionProgress(Long userId, String projectCode, Integer companyId) {
public void deleteUserQuestionProgress(Long userId, String projectCode, Long companyId) {
RaceQuestionProgressExample example = new RaceQuestionProgressExample();
RaceQuestionProgressExample.Criteria criteria = example.createCriteria();
criteria.andProjectCodeIsNull().andUserIdEqualTo(userId);
@ -68,7 +68,7 @@ public class UserQuestionProgressService implements IUserQuestionProgressService
@Override
@Transactional
public void addQuestionProgress(Long userId, String projectCode, Integer companyId, Long questionIndex) {
public void addQuestionProgress(Long userId, String projectCode, Long companyId, Long questionIndex) {
// raceQuestionProgressDAO.insertOrUpdateSelective(entity);
boolean isDefault = Project.isDefault(Project.valueOf(projectCode));
@ -106,7 +106,7 @@ public class UserQuestionProgressService implements IUserQuestionProgressService
@Override
@Transactional
public void addIncorrectQuestion(Long userId, String projectCode, Integer companyId, Long questionId) {
public void addIncorrectQuestion(Long userId, String projectCode, Long companyId, Long questionId) {
RaceQuestionProgressExample example = new RaceQuestionProgressExample();
@ -142,7 +142,7 @@ public class UserQuestionProgressService implements IUserQuestionProgressService
@Override
@Transactional
public void addIncorrectQuestions(Long userId, String projectCode, Integer companyId, List<Long> questionIds) {
public void addIncorrectQuestions(Long userId, String projectCode, Long companyId, List<Long> questionIds) {
RaceQuestionProgressExample example = new RaceQuestionProgressExample();
@ -178,7 +178,7 @@ public class UserQuestionProgressService implements IUserQuestionProgressService
@Override
@Transactional
public void deleteIncorrectQuestion(Long userId, String projectCode, Integer companyId, Long questionId) {
public void deleteIncorrectQuestion(Long userId, String projectCode, Long companyId, Long questionId) {
RaceQuestionProgressExample example = new RaceQuestionProgressExample();
RaceQuestionProgressExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);

View File

@ -44,7 +44,7 @@ public interface IQuestionBankService {
@Transactional
void importProjectQuestion(List<QuestionVO> questions, String projectCode, Integer companyId, UserVO userVO);
void importProjectQuestion(List<QuestionVO> questions, String projectCode, Long companyId, UserVO userVO);
/**
* 更新题目
@ -73,11 +73,12 @@ public interface IQuestionBankService {
* 根据知识点和题型获取题目数量
*
* @param type
* @param companyId
* @return
*/
Integer getNumberWithType(String type, String projectCode, Integer companyId);
Integer getNumberWithType(String type, String projectCode, Long companyId);
List<TheoryQuestionCountVO> countNumByType(String projectCode, Integer companyId);
List<TheoryQuestionCountVO> countNumByType(String projectCode, Long companyId);
/**
* 获取题目答案

View File

@ -173,7 +173,7 @@ public class QuestionBankService implements IQuestionBankService {
@Override
@Transactional
public void importProjectQuestion(List<QuestionVO> questions, String projectCode, Integer companyId, UserVO userVO) {
public void importProjectQuestion(List<QuestionVO> questions, String projectCode, Long companyId, UserVO userVO) {
questions.forEach(questionVO -> {
String topic = questionVO.getTopic();
@ -285,7 +285,7 @@ public class QuestionBankService implements IQuestionBankService {
@Override
public Integer getNumberWithType(String type, String projectCode, Integer companyId) {
public Integer getNumberWithType(String type, String projectCode, Long companyId) {
RaceQuestionExample questionExample = new RaceQuestionExample();
RaceQuestionExample.Criteria criteria = questionExample.createCriteria();
criteria.andTypeEqualTo(type);
@ -304,7 +304,7 @@ public class QuestionBankService implements IQuestionBankService {
}
@Override
public List<TheoryQuestionCountVO> countNumByType(String projectCode, Integer companyId) {
public List<TheoryQuestionCountVO> countNumByType(String projectCode, Long companyId) {
return questionDAO.countNumByType(projectCode, companyId);
}

View File

@ -1,26 +1,29 @@
package club.joylink.rtss.services.org;
import club.joylink.rtss.entity.OrgLesson;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.LessonVO;
import java.util.List;
public interface IOrgLessonService {
void updateOrgLesson(Integer clsId, List<Long> lessonIds);
void updateOrgLesson(Long clsId, List<Long> lessonIds, UserVO user);
/**
* 查询该组织的课程
* @param orgId
*/
List<LessonVO> queryOrgLesson(Integer orgId);
List<LessonVO> queryOrgLesson(Long orgId);
/**
* 查询这些组织的课程关联关系
* @param orgIds
*/
List<OrgLesson> findEntitiesByOrgIds(List<Integer> orgIds);
List<OrgLesson> findEntitiesByOrgIds(List<Long> orgIds);
List<OrgLesson> findEntitiesByLessonIds(List<Long> lessonIds);
List<OrgLesson> findEntities(Long lessonId);
List<OrgLesson> findEntitiesByLessonId(Long lessonId);
List<OrgLesson> findEntities(Integer orgId);
List<OrgLesson> findEntitiesByOrgId(Long orgId);
}

View File

@ -30,7 +30,7 @@ public interface IOrgScoringRuleService {
/**
* 查询自己创建的指定评价规则的详细信息
*/
OrgScoringRuleVO queryOrgScoringRuleDetails(Integer orgId, String schoolYear, Integer term, LoginUserInfoVO loginInfo);
OrgScoringRuleVO queryOrgScoringRuleDetails(Long orgId, String schoolYear, Integer term, LoginUserInfoVO loginInfo);
/**
* 根据id获取规则详情
@ -45,13 +45,13 @@ public interface IOrgScoringRuleService {
/**
* 使用评分规则进行评分
*/
List<OrgScoringResultVO> score(Integer orgId, String schoolYear, Integer term, LoginUserInfoVO loginInfo);
List<OrgScoringResultVO> score(Long orgId, String schoolYear, Integer term, LoginUserInfoVO loginInfo);
/**
* 将评价规则应用到
*/
@Transactional
void applyOrgScoringRule(Long ruleId, List<Integer> orgIds);
void applyOrgScoringRule(Long ruleId, List<Long> orgIds);
/**
* 查询评价规则能应用到的组织

View File

@ -9,47 +9,59 @@ import club.joylink.rtss.vo.client.org.CompanyVO;
import club.joylink.rtss.vo.client.org.DepartmentVO;
import club.joylink.rtss.vo.client.org.NonTopOrgCreateVO;
import club.joylink.rtss.vo.client.org.OrgQueryVO;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
public interface IOrgService {
void confirmExist(Integer orgId);
@Transactional
CompanyVO createTopOrg(CompanyVO companyVO, UserVO user);
List<CompanyVO> queryAllTopOrg();
PageVO<CompanyVO> pagedQueryAllTopOrg(OrgQueryVO queryVO);
void confirmExist(Long orgId);
void createCls(NonTopOrgCreateVO createVO, LoginUserInfoVO loginInfo);
Org getEntity(Integer orgId);
Org getEntity(Long orgId);
Org getEntity(Project project, String status);
CompanyVO updateOrg(Integer id, CompanyVO companyVO, UserVO user);
Org findEntity(Project project, String status);
CompanyVO updateOrg(Long id, CompanyVO companyVO, UserVO user);
/**
* 删除非顶级组织
* @param nonTopOrgId
*/
void deleteNonTopOrg(Integer nonTopOrgId);
void deleteNonTopOrg(Long nonTopOrgId);
List<Org> findEntitiesByParentId(Integer parentId, String orderBy, String status);
List<Org> findEntitiesByParentId(Long parentId, String orderBy, String status);
/**
* 分页查询自己创建的班级
* @param self 是否仅查询自己创建的
*/
PageVO<DepartmentVO> pagedQueryCls(OrgQueryVO queryVO, LoginUserInfoVO loginInfo, boolean self);
PageVO<DepartmentVO> pagedQueryCls(OrgQueryVO queryVO, LoginUserInfoVO loginInfo);
/**
* 查询自己创建的班级
*/
List<DepartmentVO> queryCls(OrgQueryVO queryVO, LoginUserInfoVO loginInfo, boolean self);
List<DepartmentVO> queryCls(OrgQueryVO queryVO, LoginUserInfoVO loginInfo);
/**
* 获取该组织所属的顶级组织
*/
Org getTopOrgEntity(Integer orgId, String status);
Org getTopOrgEntity(Long orgId, String status);
List<Org> findEntities(List<Integer> orgIds, String status);
List<Org> findEntities(List<Long> orgIds, String status);
/**
* 管理员分页查询组织
*/
PageVO<DepartmentVO> adminPagedQueryOrg(OrgQueryVO queryVO);
CompanyVO get(Long id);
}

View File

@ -1,7 +1,6 @@
package club.joylink.rtss.services.org;
import club.joylink.rtss.constants.BusinessConsts;
import club.joylink.rtss.entity.Org;
import club.joylink.rtss.entity.OrgLesson;
import club.joylink.rtss.entity.OrgUser;
import club.joylink.rtss.vo.UserVO;
@ -13,40 +12,26 @@ import java.util.List;
public interface IOrgUserService {
List<CompanyVO> queryOrganizations();
CompanyVO create(CompanyVO organization, UserVO user);
void deleteCompanyById(Integer companyId);
CompanyVO getCompanyById(Integer companyId);
boolean isExistWithCompanyName(String name);
PageVO<CompanyVO> queryPageOrganizations(OrgQueryVO queryVO);
/**
* 用户绑定为单位管理员
*/
CompanyVO userScanCodeBindCompanyManager(Long userId, Integer companyId);
Org getCompanyByProjectCode(String projectCode);
CompanyVO userScanCodeBindCompanyManager(Long userId, Long companyId);
boolean isCompanyUser(Long userId);
DepartmentVO createDepart(DepartmentVO departmentVO);
void updateDepartInfo(Integer id, DepartmentVO departmentVO);
void updateDepartInfo(Long id, DepartmentVO departmentVO);
DepartmentVO getDepartById(Integer deptId);
DepartmentVO getDepartById(Long deptId);
List<DepartmentVO> getCompanyDepartTree(Integer companyId);
List<DepartmentVO> getCompanyDepartTree(Long companyId);
List<DepartmentVO> getCompanyAllDepart(Integer companyId);
List<DepartmentVO> getCompanyAllDepart(Long companyId);
DepartmentVO getDepartTree(Integer companyId, Integer deptId);
DepartmentVO getDepartTree(Long companyId, Long deptId);
List<DepartmentVO> getDepartAndChild(Integer companyId, Integer deptId);
List<DepartmentVO> getDepartAndChild(Long companyId, Long deptId);
List<UserDepartRelVO> getDepartRefByUserId(Long userId);
@ -61,41 +46,41 @@ public interface IOrgUserService {
PageVO<CompanyDepartUserVO> getCompanyDepartUserInfoList(UserVO user, Integer companyId, CompanyUserQueryVO companyUserQueryVO);
void importCompanyUserInfo(UserVO user, Integer clsId, List<ImportOrgUserVO> importOrgUsers);
void importCompanyUserInfo(UserVO user, Long clsId, List<ImportOrgUserVO> importOrgUsers);
List<DepartmentVO> getDepartsByLesson(Long lessonId);
List<DepartmentVO> getDepartsByExamId(Long examId);
List<Long> getExamIdsByDepartId(Integer departId);
void deleteDepartsExam(Long examId);
void addDepartExam(Long examId, Integer departId);
void addDepartExam(Long examId, Long departId);
List<OrgLesson> getDepartLessonRefs(Integer departId);
List<OrgLesson> getDepartLessonRefs(Long departId);
List<LessonVO> getLessonsByDepart(Integer departId);
List<LessonVO> getLessonsByDepart(Long departId);
List<String> getDepartNamesByLesson(Long LessonId);
/**
* 给班级添加一个学生
*/
void addStudent(Integer orgId, ImportOrgUserVO importVO, UserVO user);
void addStudent(Long orgId, ImportOrgUserVO importVO, UserVO user);
/**
* 获取组织下某种角色的成员数量
*/
int getQuantities(Integer orgId, BusinessConsts.OrgRole role);
int getQuantities(Long orgId, BusinessConsts.OrgRole role);
boolean isTheRoleInThisOrg(Long userId, Integer orgId, BusinessConsts.OrgRole role);
boolean isTheRoleInThisOrg(Long userId, Long orgId, BusinessConsts.OrgRole role);
void confirmIsTheRoleInThisOrg(Long userId, Integer orgId, BusinessConsts.OrgRole role);
void confirmIsTheRoleInThisOrg(Long userId, Long orgId, BusinessConsts.OrgRole role);
void createOrgUser(Integer orgId, Long userId, BusinessConsts.OrgRole role);
void createOrgUser(Long orgId, Long userId, BusinessConsts.OrgRole role);
List<OrgUser> findEntities(Integer orgId, BusinessConsts.OrgRole role);
List<OrgUser> findEntitiesByOrgId(Long orgId, BusinessConsts.OrgRole role);
List<OrgUser> findEntities(List<Integer> orgIds, BusinessConsts.OrgRole role);
List<OrgUser> findEntities(List<Long> orgIds, BusinessConsts.OrgRole role);
List<OrgUser> findEntities(Long userId, BusinessConsts.OrgRole role);
}

View File

@ -1,9 +1,11 @@
package club.joylink.rtss.services.org;
import club.joylink.rtss.constants.BusinessConsts;
import club.joylink.rtss.dao.OrgLessonDAO;
import club.joylink.rtss.entity.OrgLesson;
import club.joylink.rtss.entity.OrgLessonExample;
import club.joylink.rtss.services.ILessonService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.LessonVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -19,14 +21,15 @@ public class OrgLessonService implements IOrgLessonService {
private OrgLessonDAO orgLessonDAO;
@Autowired
private OrgService orgService;
private IOrgService iOrgService;
@Autowired
private ILessonService iLessonService;
@Override
public void updateOrgLesson(Integer clsId, List<Long> lessonIds) {
orgService.confirmExist(clsId);
public void updateOrgLesson(Long clsId, List<Long> lessonIds, UserVO user) {
iOrgService.confirmExist(clsId);
//确认是该
//删除该组织的所有旧数据
OrgLessonExample example = new OrgLessonExample();
example.createCriteria().andOrgIdEqualTo(clsId);
@ -41,18 +44,18 @@ public class OrgLessonService implements IOrgLessonService {
}
@Override
public List<LessonVO> queryOrgLesson(Integer orgId) {
public List<LessonVO> queryOrgLesson(Long orgId) {
List<OrgLesson> orgLessons = findEntitiesByOrgId(orgId);
if (CollectionUtils.isEmpty(orgLessons)) {
return new ArrayList<>();
} else {
List<Long> lessonIds = orgLessons.stream().map(OrgLesson::getLessonId).collect(Collectors.toList());
return iLessonService.queryByIds(lessonIds);
return iLessonService.queryByIds(lessonIds, BusinessConsts.STATUS_USE);
}
}
@Override
public List<OrgLesson> findEntitiesByOrgIds(List<Integer> orgIds) {
public List<OrgLesson> findEntitiesByOrgIds(List<Long> orgIds) {
if (CollectionUtils.isEmpty(orgIds)) {
return new ArrayList<>();
} else {
@ -74,20 +77,14 @@ public class OrgLessonService implements IOrgLessonService {
}
@Override
public List<OrgLesson> findEntities(Long lessonId) {
public List<OrgLesson> findEntitiesByLessonId(Long lessonId) {
OrgLessonExample example = new OrgLessonExample();
example.createCriteria().andLessonIdEqualTo(lessonId);
return orgLessonDAO.selectByExample(example);
}
@Override
public List<OrgLesson> findEntities(Integer orgId) {
OrgLessonExample example = new OrgLessonExample();
example.createCriteria().andOrgIdEqualTo(orgId);
return orgLessonDAO.selectByExample(example);
}
public List<OrgLesson> findEntitiesByOrgId(Integer orgId) {
public List<OrgLesson> findEntitiesByOrgId(Long orgId) {
OrgLessonExample example = new OrgLessonExample();
example.createCriteria().andOrgIdEqualTo(orgId);
return orgLessonDAO.selectByExample(example);

View File

@ -29,7 +29,6 @@ import org.springframework.util.StringUtils;
import java.time.LocalDateTime;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
@ -79,6 +78,7 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
orgScoringRuleDAO.insert(rule);
}
// TODO: 2021/3/24 评价规则应用到班级之后不能修改班级排课检查应用规则算分时0处理老师和班级的关系不要了
@Override
public void updateScoringRule(OrgScoringRuleVO orgScoringRuleVO, UserVO user) {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(orgScoringRuleVO.getId(), "id不能为null");
@ -94,7 +94,7 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
public PageVO<OrgScoringRuleVO> queryBasicInfo(OrgScoringRuleQueryVO queryVO, UserVO user) {
List<Long> ruleIds = null;
if (queryVO.getOrgId() != null) {
ruleIds = findRelEntities(queryVO.getOrgId()).stream().map(OrgScoringRuleRel::getRuleId).collect(Collectors.toList());
ruleIds = findRelEntitiesByOrgId(queryVO.getOrgId()).stream().map(OrgScoringRuleRel::getRuleId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(ruleIds)) {
return new PageVO<>(queryVO.getPageNum(), queryVO.getPageSize(), 0, new ArrayList<>());
}
@ -115,7 +115,7 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
if (CollectionUtils.isEmpty(page)) {
return new PageVO<>(queryVO.getPageNum(), queryVO.getPageSize(), 0, new ArrayList<>());
} else {
Map<Long, List<Integer>> rule_org_map = findRelEntities(page.stream().map(OrgScoringRule::getId).collect(Collectors.toList()))
Map<Long, List<Long>> rule_org_map = findRelEntities(page.stream().map(OrgScoringRule::getId).collect(Collectors.toList()))
.stream().collect(Collectors.groupingBy(OrgScoringRuleRel::getRuleId,
Collectors.mapping(OrgScoringRuleRel::getOrgId, Collectors.toList())));
List<OrgScoringRuleVO> voList = page.stream().map(rule -> OrgScoringRuleVO.buildBasicInfo(rule, rule_org_map.get(rule.getId())))
@ -125,7 +125,7 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
}
@Override
public OrgScoringRuleVO queryOrgScoringRuleDetails(Integer orgId, String schoolYear, Integer term, LoginUserInfoVO loginInfo) {
public OrgScoringRuleVO queryOrgScoringRuleDetails(Long orgId, String schoolYear, Integer term, LoginUserInfoVO loginInfo) {
Org topOrg = iOrgService.getEntity(loginInfo.getProject(), BusinessConsts.Org.Status.VALID);
OrgScoringRuleExample example = new OrgScoringRuleExample();
example.createCriteria()
@ -146,9 +146,13 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
} else {
OrgScoringRuleWithBLOBs rule = rules.stream().filter(orgRule -> orgRule.getId().equals(rel.getRuleId()))
.limit(1).findAny().orElse(null);
List<Integer> orgIds = rels.stream().filter(orgRuleRel -> orgRuleRel.getRuleId().equals(rule.getId()))
.map(OrgScoringRuleRel::getOrgId).collect(Collectors.toList());
return OrgScoringRuleVO.buildDetails(rule, orgIds);
if (rule == null) {
return null;
} else {
List<Long> orgIds = rels.stream().filter(orgRuleRel -> orgRuleRel.getRuleId().equals(rule.getId()))
.map(OrgScoringRuleRel::getOrgId).collect(Collectors.toList());
return OrgScoringRuleVO.buildDetails(rule, orgIds);
}
}
}
} else {
@ -159,7 +163,7 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
@Override
public OrgScoringRuleVO getOrgScoringRuleDetails(Long ruleId) {
OrgScoringRuleWithBLOBs rule = getRuleEntity(ruleId);
List<Integer> orgIds = findRelEntities(ruleId).stream().map(OrgScoringRuleRel::getOrgId).collect(Collectors.toList());
List<Long> orgIds = findRelEntities(ruleId).stream().map(OrgScoringRuleRel::getOrgId).collect(Collectors.toList());
return OrgScoringRuleVO.buildDetails(rule, orgIds);
}
@ -170,53 +174,32 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertEquals(rule.getCreatorId(), userId,
"非本人创建的评价规则不能删除");
orgScoringRuleDAO.deleteByPrimaryKey(id);
deleteRelEntities(id);
}
}
@Override
public List<OrgScoringResultVO> score(@NonNull Integer orgId, @NonNull String schoolYear, @NonNull Integer term, LoginUserInfoVO loginInfo) {
public List<OrgScoringResultVO> score(Long orgId, @NonNull String schoolYear, @NonNull Integer term, LoginUserInfoVO loginInfo) {
OrgScoringRuleVO ruleVO = queryOrgScoringRuleDetails(orgId, schoolYear, term, loginInfo);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(ruleVO, "评价规则不存在");
return score(ruleVO, orgId);
}
// TODO: 2021/3/24 组织id改成long
@Override
public void applyOrgScoringRule(Long ruleId, List<Integer> orgIds) {
public void applyOrgScoringRule(Long ruleId, List<Long> orgIds) {
//校验
if (!CollectionUtils.isEmpty(orgIds)) {
OrgScoringRuleWithBLOBs rule = getRuleEntity(ruleId);
OrgScoringRuleExample ruleExample = new OrgScoringRuleExample();
ruleExample.createCriteria()
.andOrgIdEqualTo(rule.getOrgId())
.andCreatorIdEqualTo(rule.getCreatorId())
.andSchoolYearEqualTo(rule.getSchoolYear())
.andTermEqualTo(rule.getTerm())
.andIdNotEqualTo(ruleId);
List<OrgScoringRule> otherRules = orgScoringRuleDAO.selectByExample(ruleExample); //与操作的规则同顶级组织同创建者同学年同学期的其它规则
if (!CollectionUtils.isEmpty(otherRules)) {
List<Long> otherRuleIds = otherRules.stream()
.map(OrgScoringRule::getId).collect(Collectors.toList());
OrgScoringRuleRelExample relExample = new OrgScoringRuleRelExample();
relExample.createCriteria()
.andRuleIdIn(otherRuleIds)
.andOrgIdIn(orgIds);
List<OrgScoringRuleRel> relList = orgScoringRuleRelDAO.selectByExample(relExample);
if (!CollectionUtils.isEmpty(relList)) {
List<Integer> ruleRelOrgIds = relList.stream().map(OrgScoringRuleRel::getOrgId).collect(Collectors.toList());
Map<Integer, Org> orgMap = iOrgService.findEntities(ruleRelOrgIds, BusinessConsts.Org.Status.VALID).stream().collect(Collectors.toMap(Org::getId, Function.identity()));
Map<Long, OrgScoringRule> ruleMap = otherRules.stream().collect(Collectors.toMap(OrgScoringRule::getId, Function.identity()));
StringBuilder builder = new StringBuilder();
relList.forEach(rel -> {
Org org = orgMap.get(rel.getOrgId());
if (org != null) {
builder.append(String.format("组织[%s]已被应用规则[%s]", org.getName(), ruleMap.get(rel.getRuleId()).getName()));
builder.append("\n");
}
});
throw BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.exception(builder.toString());
}
}
}
OrgScoringRuleWithBLOBs rule = getRuleEntity(ruleId);
OrgScoringRuleRelExample relExample = new OrgScoringRuleRelExample();
relExample.createCriteria()
.andRuleOrgIdEqualTo(rule.getOrgId())
.andRuleCreatorIdEqualTo(rule.getCreatorId())
.andRuleSchoolYearEqualTo(rule.getSchoolYear())
.andRuleTermEqualTo(rule.getTerm())
.andRuleIdNotEqualTo(ruleId)
.andOrgIdIn(orgIds);
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(orgScoringRuleRelDAO.countByExample(relExample) == 0,
"所选的部分班级已经被应用了同学期的其它评价规则");
//处理
deleteRelEntities(ruleId);
if (!CollectionUtils.isEmpty(orgIds)) {
@ -234,13 +217,9 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
public List<DepartmentVO> queryRuleCanApplyTo(Long ruleId) {
OrgScoringRuleWithBLOBs rule = getRuleEntity(ruleId);
OrgScoringRuleVO vo = OrgScoringRuleVO.buildDetails(rule, null);
OrgScoringRuleVO.ScoringRule scoringRule = vo.getScoringRule();
Set<Long> lessonIdSet = new HashSet<>();
if (!CollectionUtils.isEmpty(scoringRule.getLearningTimeList())) {
scoringRule.getLearningTimeList().forEach(learningTime -> lessonIdSet.addAll(learningTime.getLessonIds()));
}
if (!CollectionUtils.isEmpty(scoringRule.getExams())) {
List<Long> examIds = scoringRule.getExams().stream().map(OrgScoringRuleVO.Exam::getExamId).collect(Collectors.toList());
Set<Long> lessonIdSet = new HashSet<>(vo.getAllLessonIds());
List<Long> examIds = vo.getAllExamIds();
if (!CollectionUtils.isEmpty(examIds)) {
List<ExamDefinition> examDefinitions = iExamService.findEntities(examIds);
examDefinitions.forEach(examDefinition -> lessonIdSet.add(examDefinition.getLessonId()));
}
@ -254,9 +233,9 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
if (CollectionUtils.isEmpty(orgLessonList)) {
return new ArrayList<>();
} else {
Map<Integer, Set<Long>> org_lessons_map = orgLessonList.stream().collect(Collectors.groupingBy(OrgLesson::getOrgId,
Map<Long, Set<Long>> org_lessons_map = orgLessonList.stream().collect(Collectors.groupingBy(OrgLesson::getOrgId,
Collectors.mapping(OrgLesson::getLessonId, Collectors.toSet())));
List<Integer> orgIds = org_lessons_map.entrySet().stream().filter(entry -> entry.getValue().containsAll(lessonIdSet))
List<Long> orgIds = org_lessons_map.entrySet().stream().filter(entry -> entry.getValue().containsAll(lessonIdSet))
.map(Map.Entry::getKey).collect(Collectors.toList());
if (CollectionUtils.isEmpty(orgIds)) {
return new ArrayList<>();
@ -277,7 +256,7 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
orgScoringRuleVO.check4Save();
OrgScoringRuleWithBLOBs rule = getRuleEntity(orgScoringRuleVO.getId());
if (!rule.getSchoolYear().equals(orgScoringRuleVO.getSchoolYear()) || !rule.getTerm().equals(orgScoringRuleVO.getTerm())) { //学年或学期有改动
List<Integer> relOrgList = findRelEntities(rule.getId()).stream()
List<Long> relOrgList = findRelEntities(rule.getId()).stream()
.map(OrgScoringRuleRel::getOrgId).collect(Collectors.toList()); //要更新的评价规则关联的组织id
if (!CollectionUtils.isEmpty(relOrgList)) {
OrgScoringRuleRelExample relExample = new OrgScoringRuleRelExample();
@ -298,7 +277,7 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
}
}
private List<OrgScoringResultVO> score(@NonNull OrgScoringRuleVO orgScoringRuleVO, Integer clsId) {
private List<OrgScoringResultVO> score(@NonNull OrgScoringRuleVO orgScoringRuleVO, Long clsId) {
//校验
orgScoringRuleVO.check4Use();
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(orgScoringRuleVO.getOrgIds(),
@ -308,12 +287,12 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
&& orgScoringRuleVO.getOrgIds().contains(clsId),
String.format("评价规则[%s]可应用的班级不包含[%s]", orgScoringRuleVO.getId(), clsId));
}
// TODO: 2021/3/24 评价结果保存确认流程
List<OrgUser> students;
if (clsId == null) {
students = iOrgUserService.findEntities(orgScoringRuleVO.getOrgIds(), BusinessConsts.OrgRole.Student);
} else {
students = iOrgUserService.findEntities(clsId, BusinessConsts.OrgRole.Student);
students = iOrgUserService.findEntitiesByOrgId(clsId, BusinessConsts.OrgRole.Student);
}
List<Long> userIds = students.stream().map(OrgUser::getUserId).collect(Collectors.toList());
List<SysUser> users = iSysUserService.findEntity(userIds, "id");
@ -323,57 +302,74 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
return new OrgScoringResultVO(sysUser.getId(), account, sysUser.getName());
}).collect(Collectors.toList());
List<String> projects = List.of(topOrg.getProjectCode().split(","));
this.score(results, orgScoringRuleVO.getScoringRule(), projects);
this.score(results, orgScoringRuleVO.getScoringRules(), projects);
return results;
}
private void check4Create(OrgScoringRuleVO orgScoringRuleVO, Integer orgId, Long userId) {
private void check4Create(OrgScoringRuleVO orgScoringRuleVO, Long orgId, Long userId) {
orgScoringRuleVO.check4Save();
confirmNameUnique(orgScoringRuleVO, orgId, userId);
}
private void confirmNameUnique(OrgScoringRuleVO orgScoringRuleVO, Integer orgId, Long userId) {
private void confirmNameUnique(OrgScoringRuleVO orgScoringRuleVO, Long orgId, Long userId) {
OrgScoringRuleExample example = new OrgScoringRuleExample();
example.createCriteria().andOrgIdEqualTo(orgId).andCreatorIdEqualTo(userId).andNameEqualTo(orgScoringRuleVO.getName());
BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertTrue(orgScoringRuleDAO.countByExample(example) == 0,
"有重名的规则");
}
private void score(List<OrgScoringResultVO> results, @NonNull OrgScoringRuleVO.ScoringRule rule, List<String> projects) {
/**
* 根据规则算分并填入results
*/
private void score(List<OrgScoringResultVO> results, List<OrgScoringRuleVO.ScoringRule> rules, List<String> projects) {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(results);
Map<Long, Integer> examScoreMap = new HashMap<>(); //考试及其满分
for (OrgScoringResultVO result : results) {
Long userId = result.getUserId();
//考勤分
OrgScoringRuleVO.Attendance attendance = rule.getAttendance();
if (attendance != null) {
int loginDays = iSysUserLoginService.getLoginDays(userId, attendance.getStartDate(), attendance.getEndDate(), projects);
result.setAttendanceScore(attendance.calculateScore(loginDays));
}
//课时分
List<OrgScoringRuleVO.LearningTime> learningTimeList = rule.getLearningTimeList();
if (!CollectionUtils.isEmpty(learningTimeList)) {
int score = learningTimeList.stream().mapToInt(learningTime -> {
UserRankStatsVO vo = iUserUsageStatsService.statisticsLessonLearningDuration(learningTime.getLessonIds(), userId);
return learningTime.calculateScore(vo.getDuration());
}).sum();
result.setLearningTimeScore(score);
}
//考试分
List<OrgScoringRuleVO.Exam> exams = rule.getExams();
if (!CollectionUtils.isEmpty(exams)) {
int score = exams.stream().mapToInt(exam -> {
Integer userScore = iUserExamService.queryHeightScoreOfUserExam(userId, exam.getExamId());
Integer examFullMarks = examScoreMap.get(exam.getExamId());
if (examFullMarks == null) {
ExamDefinition examDefinition = iExamService.getEntity(exam.getExamId());
examFullMarks = examDefinition.getFullPoint();
examScoreMap.put(exam.getExamId(), examFullMarks);
}
return exam.calculateScore(userScore, examFullMarks);
}).sum();
result.setExamScore(score);
int attendanceScore = 0;
int learningScore = 0;
int examScore = 0;
for (OrgScoringRuleVO.ScoringRule rule : rules) {
switch (rule.getType()) {
case ATTENDANCE:
if (rule.getDays4FullMarks() <= 0) {
attendanceScore += rule.getFullMarks();
} else {
int loginDays = iSysUserLoginService.getLoginDays(userId, rule.getStartDate(), rule.getEndDate(), projects);
double percent = Math.min((double) loginDays / rule.getDays4FullMarks(), 1);
attendanceScore += (int) (percent * rule.getFullMarks());
}
break;
case LEARNING_TIME:
if (rule.getDuration4FullMarks() <= 0) {
learningScore += rule.getFullMarks();
} else {
UserRankStatsVO vo = iUserUsageStatsService.statisticsLessonLearningDuration(rule.getStartDate(),
rule.getEndDate(), rule.getLessonIds(), userId);
if (vo.getDuration() != null) {
double percent = Math.min(vo.getDuration() / (rule.getDuration4FullMarks() * 60d), 1);
learningScore += (int) (percent * rule.getFullMarks());
}
}
break;
case EXAM_RESULTS:
Integer userScore = iUserExamService.queryHeightScoreOfUserExam(userId, rule.getExamId());
if (userScore != null && userScore != 0) {
Integer examFullMarks = examScoreMap.get(rule.getExamId());
if (examFullMarks == null) {
ExamDefinition examDefinition = iExamService.getEntity(rule.getExamId());
examFullMarks = examDefinition.getFullPoint();
examScoreMap.put(rule.getExamId(), examFullMarks);
}
double percent = Math.min((double) userScore / examFullMarks, 1);
examScore += (int) (percent * rule.getFullMarks());
}
break;
}
}
result.setAttendanceScore(attendanceScore);
result.setLearningTimeScore(learningScore);
result.setExamScore(examScore);
}
}
@ -388,13 +384,13 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
return orgScoringRuleDAO.selectByPrimaryKey(id);
}
private List<OrgScoringRule> findBasicRuleEntities(Integer orgId, Long creatorId) {
private List<OrgScoringRule> findBasicRuleEntities(Long orgId, Long creatorId) {
OrgScoringRuleExample example = new OrgScoringRuleExample();
example.createCriteria().andOrgIdEqualTo(orgId).andCreatorIdEqualTo(creatorId);
return orgScoringRuleDAO.selectByExample(example);
}
private List<OrgScoringRuleRel> findRelEntities(Integer orgId) {
private List<OrgScoringRuleRel> findRelEntitiesByOrgId(Long orgId) {
OrgScoringRuleRelExample example = new OrgScoringRuleRelExample();
example.createCriteria().andOrgIdEqualTo(orgId);
return orgScoringRuleRelDAO.selectByExample(example);

View File

@ -5,7 +5,9 @@ import club.joylink.rtss.constants.Project;
import club.joylink.rtss.dao.OrgDAO;
import club.joylink.rtss.entity.Org;
import club.joylink.rtss.entity.OrgExample;
import club.joylink.rtss.entity.SysUser;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.ISysUserService;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
@ -25,6 +27,8 @@ import org.springframework.util.StringUtils;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
@ -35,8 +39,59 @@ public class OrgService implements IOrgService {
@Autowired
private IOrgUserService iOrgUserService;
@Autowired
private ISysUserService iSysUserService;
public final static String companyCodePrefix = "C";
@Transactional
@Override
public void confirmExist(Integer orgId) {
public CompanyVO createTopOrg(CompanyVO companyVO, UserVO user) {
//检查
if (StringUtils.hasText(companyVO.getProjectCode())) {
Org org = findEntity(Project.valueOf(companyVO.getProjectCode()), BusinessConsts.Org.Status.VALID);
BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertNull(org, "项目已被绑定到其他单位!");
}
OrgExample example = new OrgExample();
example.createCriteria().andNameEqualTo(companyVO.getName()).andStatusEqualTo(BusinessConsts.Org.Status.VALID);
BusinessExceptionAssertEnum.DATA_UNIQUE_PROPERTY_REPEAT.assertTrue(orgDAO.countByExample(example) == 0,
"名称重复");
//处理
Org entity = companyVO.toDB();
entity.setCreatorId(user.getId());
entity.setCreateTime(LocalDateTime.now());
entity.setCode(nextCompanyCode());
entity.setStatus(BusinessConsts.Org.Status.VALID);
this.orgDAO.insert(entity);
entity.setRootId(entity.getId());
orgDAO.updateByPrimaryKey(entity);
return new CompanyVO(entity);
}
@Override
public List<CompanyVO> queryAllTopOrg() {
OrgExample example = new OrgExample();
example.createCriteria().andParentIdIsNull();
List<Org> list = this.orgDAO.selectByExample(example);
return CompanyVO.convert2VOList(list);
}
@Override
public PageVO<CompanyVO> pagedQueryAllTopOrg(OrgQueryVO queryVO) {
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
OrgExample example = new OrgExample();
OrgExample.Criteria criteria = example.createCriteria();
criteria.andParentIdIsNull();
if (StringUtils.hasText(queryVO.getName())) {
criteria.andNameLike(String.format("%%%s%%", queryVO.getName()));
}
Page<Org> page = (Page<Org>) orgDAO.selectByExample(example);
List<CompanyVO> voList = CompanyVO.convert2VOList(page.getResult());
return PageVO.convert(page, voList);
}
@Override
public void confirmExist(Long orgId) {
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(orgDAO.selectByPrimaryKey(orgId),
String.format("id为[%s]的组织不存在", orgId));
}
@ -46,7 +101,7 @@ public class OrgService implements IOrgService {
public void createCls(NonTopOrgCreateVO createVO, LoginUserInfoVO loginInfo) {
//检查
Org topOrg = getEntity(loginInfo.getProject(), BusinessConsts.Org.Status.VALID);
Integer topOrgId = topOrg.getId();
Long topOrgId = topOrg.getId();
Long userId = loginInfo.getUserVO().getId();
iOrgUserService.confirmIsTheRoleInThisOrg(userId, topOrgId, BusinessConsts.OrgRole.Admin);
Org cls = createNonTopOrg(createVO.getName(), topOrgId, topOrgId, userId);
@ -54,7 +109,7 @@ public class OrgService implements IOrgService {
}
@Override
public Org getEntity(Integer orgId) {
public Org getEntity(Long orgId) {
Org org = orgDAO.selectByPrimaryKey(orgId);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(org, String.format("id为[%s]的组织不存在", orgId));
return org;
@ -62,18 +117,28 @@ public class OrgService implements IOrgService {
@Override
public Org getEntity(Project project, String status) {
Org org = findEntity(project, status);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(org, String.format("关联项目为[%s]的组织不存在", project));
return org;
}
@Override
public Org findEntity(Project project, String status) {
OrgExample example = new OrgExample();
OrgExample.Criteria criteria = example.createCriteria().andProjectCodeEqualTo(project.name());
if (StringUtils.hasText(status)) {
criteria.andStatusEqualTo(status);
}
List<Org> orgs = orgDAO.selectByExample(example);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(orgs, String.format("关联项目为[%s]的组织不存在", project));
return orgs.get(0);
List<Org> orgList = orgDAO.selectByExample(example);
if (CollectionUtils.isEmpty(orgList)) {
return null;
} else {
return orgList.get(0);
}
}
@Override
public CompanyVO updateOrg(Integer id, CompanyVO companyVO, UserVO user) {
public CompanyVO updateOrg(Long id, CompanyVO companyVO, UserVO user) {
//校验
Org org = getEntity(id);
if (!isTopOrg(org)) {
@ -90,7 +155,7 @@ public class OrgService implements IOrgService {
}
@Override
public void deleteNonTopOrg(Integer nonTopOrgId) {
public void deleteNonTopOrg(Long nonTopOrgId) {
confirmIsNonTopOrg(nonTopOrgId);
Org org = new Org();
org.setId(nonTopOrgId);
@ -99,7 +164,7 @@ public class OrgService implements IOrgService {
}
@Override
public List<Org> findEntitiesByParentId(Integer parentId, String orderBy, String status) {
public List<Org> findEntitiesByParentId(Long parentId, String orderBy, String status) {
OrgExample example = new OrgExample();
if (StringUtils.hasText(orderBy)) {
example.setOrderByClause(orderBy);
@ -112,32 +177,35 @@ public class OrgService implements IOrgService {
}
@Override
public PageVO<DepartmentVO> pagedQueryCls(OrgQueryVO queryVO, LoginUserInfoVO loginInfo, boolean self) {
OrgExample example = buildQueryClsExample(queryVO, loginInfo.getUserVO().getId(), loginInfo.getProject(), self);
public PageVO<DepartmentVO> pagedQueryCls(OrgQueryVO queryVO, LoginUserInfoVO loginInfo) {
OrgExample example = buildQueryClsExample(queryVO, loginInfo.getUserVO().getId(), loginInfo.getProject(), queryVO.isSelf());
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
Page<Org> page = (Page<Org>) orgDAO.selectByExample(example);
List<Long> creatorIds = page.stream().map(Org::getCreatorId).collect(Collectors.toList());
Map<Long, SysUser> creatorMap = iSysUserService.findEntity(creatorIds, null).stream()
.collect(Collectors.toMap(SysUser::getId, Function.identity()));
List<DepartmentVO> list = page.getResult().stream().map(entity -> {
int numberOfPeople = iOrgUserService.getQuantities(entity.getId(), BusinessConsts.OrgRole.Student);
return new DepartmentVO(entity, numberOfPeople);
return new DepartmentVO(entity, numberOfPeople, creatorMap.get(entity.getCreatorId()));
}).collect(Collectors.toList());
return PageVO.convert(page, list);
}
@Override
public List<DepartmentVO> queryCls(OrgQueryVO queryVO, LoginUserInfoVO loginInfo, boolean self) {
OrgExample example = buildQueryClsExample(queryVO, loginInfo.getUserVO().getId(), loginInfo.getProject(), self);
public List<DepartmentVO> queryCls(OrgQueryVO queryVO, LoginUserInfoVO loginInfo) {
OrgExample example = buildQueryClsExample(queryVO, loginInfo.getUserVO().getId(), loginInfo.getProject(), queryVO.isSelf());
List<Org> clsList = orgDAO.selectByExample(example);
return clsList.stream().map(DepartmentVO::new).collect(Collectors.toList());
}
@Override
public Org getTopOrgEntity(Integer orgId, String status) {
public Org getTopOrgEntity(Long orgId, String status) {
Org entity = getEntity(orgId);
return getEntity(entity.getRootId());
}
@Override
public List<Org> findEntities(List<Integer> orgIds, String status) {
public List<Org> findEntities(List<Long> orgIds, String status) {
if (CollectionUtils.isEmpty(orgIds)) {
return new ArrayList<>();
} else {
@ -170,6 +238,12 @@ public class OrgService implements IOrgService {
return PageVO.convert(page, list);
}
@Override
public CompanyVO get(Long id) {
Org entity = getEntity(id);
return new CompanyVO(entity);
}
private OrgExample buildQueryClsExample(OrgQueryVO queryVO, Long userId, Project project, boolean self) {
Org topOrg = getEntity(project, BusinessConsts.Org.Status.VALID);
OrgExample example = new OrgExample();
@ -190,7 +264,7 @@ public class OrgService implements IOrgService {
/**
* 创建非顶级组织
*/
private Org createNonTopOrg(@NonNull String name, @NonNull Integer parentId, @NonNull Integer rootId, Long creatorId) {
private Org createNonTopOrg(@NonNull String name, @NonNull Long parentId, @NonNull Long rootId, Long creatorId) {
//检查顶级组织
confirmIsTopOrg(rootId);
//检查同级同名组织
@ -206,14 +280,16 @@ public class OrgService implements IOrgService {
org.setRootId(rootId);
org.setCreatorId(creatorId);
org.setCreateTime(LocalDateTime.now());
org.setStatus(BusinessConsts.Org.Status.VALID);
orgDAO.insert(org);
return org;
}
/**
* 确认是顶级组织
* @param id
*/
private void confirmIsTopOrg(@NonNull Integer id) {
private void confirmIsTopOrg(@NonNull Long id) {
Org org = getEntity(id);
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(isTopOrg(org),
String.format("组织[%s]不是顶级组织", id));
@ -225,14 +301,15 @@ public class OrgService implements IOrgService {
/**
* 确认是顶级组织
* @param id
*/
private void confirmIsNonTopOrg(@NonNull Integer id) {
private void confirmIsNonTopOrg(Long id) {
Org org = getEntity(id);
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(!isTopOrg(org),
String.format("组织[%s]是顶级组织", id));
}
private List<Org> findEntitiesByRootId(Integer rootId, String orderBy, String status) {
private List<Org> findEntitiesByRootId(Long rootId, String orderBy, String status) {
OrgExample example = new OrgExample();
if (StringUtils.hasText(orderBy)) {
example.setOrderByClause(orderBy);
@ -246,4 +323,17 @@ public class OrgService implements IOrgService {
String.format("没有顶级组织id为[%s]的组织", rootId));
return orgs;
}
private String nextCompanyCode() {
OrgExample e = new OrgExample();
e.setLimit(1);
e.setOrderByClause(" code DESC");
e.createCriteria().andParentIdIsNull().andCodeIsNotNull();
List<Org> orgs = orgDAO.selectByExample(e);
if (CollectionUtils.isEmpty(orgs)) {
return companyCodePrefix + "001";
}
int seq = Integer.parseInt(orgs.get(0).getCode().substring(1));
return companyCodePrefix + (String.format("%03d", ++seq));
}
}

View File

@ -16,6 +16,7 @@ import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.org.*;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.NonNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -26,13 +27,12 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
@Service
public class OrgUserService implements IOrgUserService {
public final static String companyCodePrefix = "C";
@Autowired
private OrgDAO orgDAO;
@ -55,68 +55,13 @@ public class OrgUserService implements IOrgUserService {
@Autowired
private IOrgService iOrgService;
//************************************单位管理**********************************************
@Override
public List<CompanyVO> queryOrganizations() {
OrgExample example = new OrgExample();
example.createCriteria().andParentIdIsNull();
List<Org> list = this.orgDAO.selectByExample(example);
return CompanyVO.convert2VOList(list);
}
@Override
public PageVO<CompanyVO> queryPageOrganizations(OrgQueryVO queryVO) {
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
OrgExample example = new OrgExample();
OrgExample.Criteria criteria = example.createCriteria();
criteria.andParentIdIsNull();
if (StringUtils.hasText(queryVO.getName())) {
criteria.andNameLike(String.format("%%%s%%", queryVO.getName()));
}
Page<Org> page = (Page<Org>) orgDAO.selectByExample(example);
List<CompanyVO> voList = CompanyVO.convert2VOList(page.getResult());
return PageVO.convert(page, voList);
}
@Override
public CompanyVO userScanCodeBindCompanyManager(Long userId, Integer companyId) {
public CompanyVO userScanCodeBindCompanyManager(Long userId, Long companyId) {
return iSysUserService.userScanCodeBindCompanyManager(userId, companyId);
}
@Override
@Transactional
public CompanyVO create(CompanyVO companyVO, UserVO user) {
BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertNotTrue(isExistWithCompanyName(companyVO.getName()), "名称重复!");
if (StringUtils.hasText(companyVO.getProjectCode())) {
Org company = getCompanyByProjectCode(companyVO.getProjectCode());
BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertNull(company, "项目已被绑定到其他单位!");
}
Org entity = companyVO.toDB();
entity.setCreatorId(user.getId());
entity.setCreateTime(LocalDateTime.now());
entity.setCode(nextCompanyCode());
this.orgDAO.insert(entity);
entity.setRootId(entity.getId());
orgDAO.updateByPrimaryKey(entity);
return new CompanyVO(entity);
}
@Transactional
@Override
public void deleteCompanyById(Integer companyId) {
orgDAO.deleteByPrimaryKey(companyId);
IRaceQuestionsRuleService.deleteByCompanyId(companyId);
}
@Override
public CompanyVO getCompanyById(Integer companyId) {
Org entity = orgDAO.selectByPrimaryKey(companyId);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(entity,
String.format("id为[%s]的组织不存在", companyId));
return new CompanyVO(entity);
}
//
//
// @Override
// public void addManager(Integer companyId, List<Long> userIds, UserVO user) {
// CompanyUserExample e = new CompanyUserExample();
@ -135,31 +80,6 @@ public class OrgUserService implements IOrgUserService {
// companyUserDAO.updateByExampleSelective(cu,e);
// }
@Override
public boolean isExistWithCompanyName(String name) {
OrgExample e = new OrgExample();
e.createCriteria().andNameEqualTo(name).andParentIdIsNull();
if (orgDAO.countByExample(e) > 0) {
return true;
}
return false;
}
@Override
public Org getCompanyByProjectCode(String projectCode) {
OrgExample e = new OrgExample();
e.createCriteria().andProjectCodeEqualTo(projectCode).andParentIdIsNull();
List<Org> orgs = orgDAO.selectByExample(e);
if (CollectionUtils.isEmpty(orgs)) return null;
return orgs.get(0);
}
private Org getCompanyEntity(Integer id) {
Org company = orgDAO.selectByPrimaryKey(id);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(company, String.format("单位[%s]不存在", id));
return company;
}
@Override
public boolean isCompanyUser(Long userId) {
OrgUserExample e = new OrgUserExample();
@ -185,7 +105,7 @@ public class OrgUserService implements IOrgUserService {
* 修改部门
*/
@Override
public void updateDepartInfo(Integer deptId, DepartmentVO departmentVO) {
public void updateDepartInfo(Long deptId, DepartmentVO departmentVO) {
Org entity = departmentVO.toDB();
entity.setId(deptId);
entity.setRootId(null);
@ -195,9 +115,10 @@ public class OrgUserService implements IOrgUserService {
/**
* 查询部门信息
* @param deptId
*/
@Override
public DepartmentVO getDepartById(Integer deptId) {
public DepartmentVO getDepartById(Long deptId) {
Org entity = orgDAO.selectByPrimaryKey(deptId);
if (Objects.isNull(entity)) {
return null;
@ -207,9 +128,10 @@ public class OrgUserService implements IOrgUserService {
/**
* 根据单位id查询部门及其子部门信息
* @param companyId
*/
@Override
public List<DepartmentVO> getCompanyDepartTree(Integer companyId) {
public List<DepartmentVO> getCompanyDepartTree(Long companyId) {
OrgExample example = new OrgExample();
example.createCriteria().andRootIdEqualTo(companyId);
List<Org> orgList = orgDAO.selectByExample(example);
@ -217,7 +139,7 @@ public class OrgUserService implements IOrgUserService {
}
@Override
public List<DepartmentVO> getCompanyAllDepart(Integer companyId) {
public List<DepartmentVO> getCompanyAllDepart(Long companyId) {
OrgExample example = new OrgExample();
example.createCriteria().andRootIdEqualTo(companyId).andParentIdIsNotNull();
List<Org> companyDepartments = orgDAO.selectByExample(example);
@ -225,7 +147,7 @@ public class OrgUserService implements IOrgUserService {
}
@Override
public DepartmentVO getDepartTree(Integer companyId, Integer deptId) {
public DepartmentVO getDepartTree(Long companyId, Long deptId) {
Org companyDepartment = orgDAO.selectByPrimaryKey(deptId);
OrgExample example = new OrgExample();
example.createCriteria().andRootIdEqualTo(companyId).andParentIdIsNotNull();
@ -237,7 +159,7 @@ public class OrgUserService implements IOrgUserService {
}
@Override
public List<DepartmentVO> getDepartAndChild(Integer companyId, Integer deptId) {
public List<DepartmentVO> getDepartAndChild(Long companyId, Long deptId) {
var example = new OrgExample();
example.createCriteria().andRootIdEqualTo(companyId).andParentIdIsNotNull();
var companyDepartments = orgDAO.selectByExample(example);
@ -259,13 +181,10 @@ public class OrgUserService implements IOrgUserService {
criteria.andParentIdEqualTo(departmentVO.getParentId());
}
if (orgDAO.countByExample(example) == 0) {
return false;
}
return true;
return orgDAO.countByExample(example) != 0;
}
private OrgUser getDepartUseRelEntity(Long userId, Integer departId) {
private OrgUser getDepartUseRelEntity(Long userId, Long departId) {
OrgUserExample example = new OrgUserExample();
example.createCriteria()
.andUserIdEqualTo(userId)
@ -341,11 +260,12 @@ public class OrgUserService implements IOrgUserService {
@Transactional
@Override
public void importCompanyUserInfo(UserVO user, Integer clsId, List<ImportOrgUserVO> importOrgUsers) {
public void importCompanyUserInfo(UserVO user, Long clsId, List<ImportOrgUserVO> importOrgUsers) {
Org cls = iOrgService.getEntity(clsId);
Org topOrg = iOrgService.getEntity(cls.getRootId());
confirmIsTheRoleInThisOrg(user.getId(), clsId, BusinessConsts.OrgRole.Teacher);
importOrgUsers.forEach(vo->importOrgUser(topOrg, cls.getId(), vo));
Set<Long> studentIdSet = findEntitiesByOrgId(clsId, BusinessConsts.OrgRole.Student).stream().map(OrgUser::getUserId).collect(Collectors.toSet());
importOrgUsers.forEach(vo -> importOrgUser(topOrg, cls.getId(), studentIdSet, vo));
// //验证操作人员
// Org company = getCompanyEntity(clsId);
@ -418,30 +338,33 @@ public class OrgUserService implements IOrgUserService {
/**
* 导入组织用户
* @param topOrg 导入的组织所属的顶级组织
* @param topOrg 导入的组织所属的顶级组织
* @param orgId
* @param orgUserIdSet 导入的组织当前已有的成员
*/
private void importOrgUser(Org topOrg, Integer departmentId, ImportOrgUserVO importOrgUser) {
private void importOrgUser(Org topOrg, Long orgId, Set<Long> orgUserIdSet, ImportOrgUserVO importOrgUser) {
SysUser sysUser = importOrgUser.convert2DB();
sysUser.setAccount(sysUser.getAccount() + topOrg.getCode());
UserVO userVO = iSysUserService.queryUserByAccount(sysUser.getAccount());
if (Objects.isNull(userVO)) {
iSysUserService.createUser(sysUser);
userVO = new UserVO(sysUser);
UserDepartRelVO userDepartRelVO = new UserDepartRelVO(userVO.getId(), departmentId, BusinessConsts.OrgRole.Student.name());
UserDepartRelVO userDepartRelVO = new UserDepartRelVO(userVO.getId(), orgId, BusinessConsts.OrgRole.Student.name());
orgUserDAO.insertSelective(userDepartRelVO.toDB());
} else {
OrgUserExample e = new OrgUserExample();
e.createCriteria().andUserIdEqualTo(userVO.getId());
List<OrgUser> orgUsers = orgUserDAO.selectByExample(e);
BusinessExceptionAssertEnum.INVALID_OPERATION.assertCollectionNotEmpty(orgUsers, sysUser.getAccount() + "账号已存在且不属于任何组织");
OrgExample oe = new OrgExample();
oe.createCriteria().andRootIdEqualTo(topOrg.getId());
List<Integer> orgIds = orgDAO.selectByExample(oe).stream().map(Org::getId).collect(Collectors.toList());
BusinessExceptionAssertEnum.INVALID_OPERATION.assertTrue(orgUsers.stream().allMatch(orgUser -> orgIds.contains(orgUser.getOrgId())),
sysUser.getAccount() + "账号重复");
if (orgUsers.stream().anyMatch(orgUser -> Objects.equals(orgUser.getOrgId(), departmentId))) return;
UserDepartRelVO userDepartRelVO = new UserDepartRelVO(userVO.getId(), departmentId, BusinessConsts.OrgRole.Student.name());
orgUserDAO.insertSelective(userDepartRelVO.toDB());
// OrgUserExample e = new OrgUserExample();
// e.createCriteria().andUserIdEqualTo(userVO.getId());
// List<OrgUser> orgUsers = orgUserDAO.selectByExample(e);
// BusinessExceptionAssertEnum.INVALID_OPERATION.assertCollectionNotEmpty(orgUsers, sysUser.getAccount() + "账号已存在且不属于任何组织");
// Set<Integer> clsIdSet = iOrgService.findEntitiesByParentId(topOrg.getId(), null, BusinessConsts.Org.Status.VALID)
// .stream().map(Org::getId).collect(Collectors.toSet());
// BusinessExceptionAssertEnum.INVALID_OPERATION.assertTrue(orgUsers.stream().allMatch(orgUser -> clsIdSet.contains(orgUser.getOrgId())),
// sysUser.getAccount() + "账号重复");
// if (orgUsers.stream().anyMatch(orgUser -> Objects.equals(orgUser.getOrgId(), departmentId))) return;
if (!orgUserIdSet.contains(userVO.getId())) {
UserDepartRelVO userDepartRelVO = new UserDepartRelVO(userVO.getId(), orgId, BusinessConsts.OrgRole.Student.name());
orgUserDAO.insertSelective(userDepartRelVO.toDB());
}
}
}
@ -461,14 +384,6 @@ public class OrgUserService implements IOrgUserService {
return DepartmentVO.convert2VOList(classes);
}
@Override
public List<Long> getExamIdsByDepartId(Integer departId) {
OrgExamExample example = new OrgExamExample();
example.createCriteria().andOrgIdEqualTo(departId);
List<OrgExam> departmentExamRefs = this.orgExamDAO.selectByExample(example);
return departmentExamRefs.stream().map(OrgExam::getExamId).collect(Collectors.toList());
}
@Override
public void deleteDepartsExam(Long examId) {
OrgExamExample example = new OrgExamExample();
@ -478,7 +393,7 @@ public class OrgUserService implements IOrgUserService {
//TODO 判是否存在
@Override
public void addDepartExam(Long examId, Integer departId) {
public void addDepartExam(Long examId, Long departId) {
OrgExam departmentExam = new OrgExam();
departmentExam.setExamId(examId);
departmentExam.setOrgId(departId);
@ -486,15 +401,14 @@ public class OrgUserService implements IOrgUserService {
}
@Override
public List<OrgLesson> getDepartLessonRefs(Integer departId) {
public List<OrgLesson> getDepartLessonRefs(Long departId) {
OrgLessonExample example = new OrgLessonExample();
example.createCriteria().andOrgIdEqualTo(departId);
List<OrgLesson> departmentLessonRef = this.orgLessonDAO.selectByExample(example);
return departmentLessonRef;
return this.orgLessonDAO.selectByExample(example);
}
@Override
public List<LessonVO> getLessonsByDepart(Integer departId) {
public List<LessonVO> getLessonsByDepart(Long departId) {
List<Long> lessonIds = getDepartLessonRefs(departId).stream().map(OrgLesson::getLessonId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(lessonIds)) return new ArrayList<>();
return lessonService.getValidLesson(null, lessonIds, null);
@ -508,18 +422,19 @@ public class OrgUserService implements IOrgUserService {
@Transactional
@Override
public void addStudent(Integer clsId, ImportOrgUserVO importVO, UserVO user) {
public void addStudent(Long clsId, ImportOrgUserVO importVO, UserVO user) {
Org cls = iOrgService.getEntity(clsId);
confirmIsTheRoleInThisOrg(user.getId(), clsId, BusinessConsts.OrgRole.Teacher);
Org topOrg = iOrgService.getEntity(cls.getRootId());
this.importOrgUser(topOrg, cls.getId(), importVO);
Set<Long> studentIdSet = findEntitiesByOrgId(clsId, BusinessConsts.OrgRole.Student).stream().map(OrgUser::getUserId).collect(Collectors.toSet());
this.importOrgUser(topOrg, cls.getId(), studentIdSet, importVO);
}
/**
* 统计该组织的指定角色人数
*/
@Override
public int getQuantities(Integer orgId, BusinessConsts.OrgRole role) {
public int getQuantities(Long orgId, BusinessConsts.OrgRole role) {
OrgUserExample example = new OrgUserExample();
example.createCriteria()
.andOrgIdEqualTo(orgId)
@ -531,7 +446,7 @@ public class OrgUserService implements IOrgUserService {
* 该用户在该组织中是否是这个角色
*/
@Override
public boolean isTheRoleInThisOrg(Long userId, Integer orgId, BusinessConsts.OrgRole role) {
public boolean isTheRoleInThisOrg(Long userId, Long orgId, BusinessConsts.OrgRole role) {
OrgUserExample example = new OrgUserExample();
example.createCriteria()
.andUserIdEqualTo(userId)
@ -544,13 +459,13 @@ public class OrgUserService implements IOrgUserService {
* 确认该用户在该组织中是这个角色
*/
@Override
public void confirmIsTheRoleInThisOrg(Long userId, Integer orgId, BusinessConsts.OrgRole role) {
public void confirmIsTheRoleInThisOrg(Long userId, Long orgId, BusinessConsts.OrgRole role) {
BusinessExceptionAssertEnum.INSUFFICIENT_PERMISSIONS.assertTrue(isTheRoleInThisOrg(userId, orgId, role),
String.format("用户[%s]不是组织[%s]的[%s]", userId, orgId, role));
}
@Override
public void createOrgUser(Integer orgId, Long userId, BusinessConsts.OrgRole role) {
public void createOrgUser(Long orgId, Long userId, BusinessConsts.OrgRole role) {
OrgUser orgUser = new OrgUser();
orgUser.setOrgId(orgId);
orgUser.setUserId(userId);
@ -561,16 +476,17 @@ public class OrgUserService implements IOrgUserService {
}
@Override
public List<OrgUser> findEntities(Integer orgId, BusinessConsts.OrgRole role) {
public List<OrgUser> findEntitiesByOrgId(Long orgId, BusinessConsts.OrgRole role) {
OrgUserExample example = new OrgUserExample();
example.createCriteria()
.andOrgIdEqualTo(orgId)
.andRoleEqualTo(role.name());
OrgUserExample.Criteria criteria = example.createCriteria().andOrgIdEqualTo(orgId);
if (role != null) {
criteria.andRoleEqualTo(role.name());
}
return orgUserDAO.selectByExample(example);
}
@Override
public List<OrgUser> findEntities(List<Integer> orgIds, BusinessConsts.OrgRole role) {
public List<OrgUser> findEntities(List<Long> orgIds, BusinessConsts.OrgRole role) {
if (CollectionUtils.isEmpty(orgIds)) {
return new ArrayList<>();
} else {
@ -582,17 +498,14 @@ public class OrgUserService implements IOrgUserService {
}
}
private String nextCompanyCode() {
OrgExample e = new OrgExample();
e.setLimit(1);
e.setOrderByClause(" code DESC");
e.createCriteria().andParentIdIsNull().andCodeIsNotNull();
List<Org> orgs = orgDAO.selectByExample(e);
if (CollectionUtils.isEmpty(orgs)) {
return companyCodePrefix + "001";
@Override
public List<OrgUser> findEntities(@NonNull Long userId, BusinessConsts.OrgRole role) {
OrgUserExample example = new OrgUserExample();
OrgUserExample.Criteria criteria = example.createCriteria().andUserIdEqualTo(userId);
if (role != null) {
criteria.andRoleEqualTo(role.name());
}
int seq = Integer.parseInt(orgs.get(0).getCode().substring(1));
return companyCodePrefix + (String.format("%03d", ++seq));
return orgUserDAO.selectByExample(example);
}
}

View File

@ -229,7 +229,7 @@ public class DepartUserStaticServiceImpl implements IDepartUserStatisticService
departmentUserExample.createCriteria().andOrgIdEqualTo(infoExportParam.getClassId()).andRoleEqualTo(BusinessConsts.OrgRole.Student.name());
List<OrgUser> departmentUsers = this.departmentUserDAO.selectByExample(departmentUserExample);
//课程关联实训数
Map<String, Long> prd2TrainNums = infoExportParam.getPrdParams().stream().collect(Collectors.toMap(prdParam -> prdParam.getPrdType(), prdParam -> {
Map<String, Long> prd2TrainNums = infoExportParam.getPrdParams().stream().collect(Collectors.toMap(StudentInfoExportPrdParam::getPrdType, prdParam -> {
LsRelChapterTrainingExample lsRelChapterTrainingExample = new LsRelChapterTrainingExample();
lsRelChapterTrainingExample.createCriteria().andLessonIdEqualTo(prdParam.getLessonId());
return this.lsRelChapterTrainingDAO.countByExample(lsRelChapterTrainingExample);

View File

@ -6,8 +6,10 @@ import club.joylink.rtss.constants.MapPrdTypeEnum;
import club.joylink.rtss.constants.Project;
import club.joylink.rtss.constants.ProjectDeviceType;
import club.joylink.rtss.constants.SystemEnv;
import club.joylink.rtss.entity.Org;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.*;
import club.joylink.rtss.services.org.IOrgService;
import club.joylink.rtss.services.org.IOrgUserService;
import club.joylink.rtss.services.script.IScriptService;
import club.joylink.rtss.services.script.IScriptSimulationService;
@ -49,7 +51,6 @@ import club.joylink.rtss.vo.client.fault.FaultRuleVO;
import club.joylink.rtss.vo.client.map.DestinationCodeVO;
import club.joylink.rtss.vo.client.map.MapVO;
import club.joylink.rtss.vo.client.map.newmap.MapStationNewVO;
import club.joylink.rtss.vo.client.org.CompanyVO;
import club.joylink.rtss.vo.client.project.ProjectDeviceVO;
import club.joylink.rtss.vo.client.runplan.*;
import club.joylink.rtss.vo.client.schedulingNew.SchedulingPlanNewVO;
@ -148,6 +149,9 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
@Autowired
private IUserPermissionService iUserPermissionService;
@Autowired
private IOrgService iOrgService;
/**
* 创建仿真并进行缓存
*
@ -973,9 +977,9 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
return true;
}
if (userVO.getCompanyId() != null) {
CompanyVO company = iOrgUserService.getCompanyById(userVO.getCompanyId());
Org org = iOrgService.getEntity(userVO.getCompanyId());
String mapProject = mapDetail.getProjectCode();
String companyProject = company.getProjectCode();
String companyProject = org.getProjectCode();
if (StringUtils.hasText(mapProject) && mapProject.equals(companyProject)) {
return true;
}

View File

@ -107,7 +107,7 @@ public class UserVO implements Serializable {
private LocalDateTime createTime;
//单位信息
private Integer companyId;
private Long companyId;
private String companyName;
private Boolean companyAdmin;

View File

@ -35,4 +35,6 @@ public class ExamDefinitionQueryVO extends PageQueryVO {
private String status;
private Integer clsId;
private boolean self;
}

View File

@ -1,6 +1,7 @@
package club.joylink.rtss.vo.client;
import club.joylink.rtss.entity.ExamDefinition;
import club.joylink.rtss.entity.SysUser;
import club.joylink.rtss.vo.client.org.DepartmentVO;
import club.joylink.rtss.vo.client.validGroup.ExamDefinitionCheck;
import club.joylink.rtss.vo.client.validGroup.ExamDefinitionRulesCheck;
@ -125,7 +126,7 @@ public class ExamDefinitionVO {
/**关联班级列表*/
private List<DepartmentVO> classes;
private List<Integer> clsIds;
private List<Long> clsIds;
@Valid
@NotNull(message = "考试规则不能为空", groups = {ExamDefinitionCheck.class, ExamDefinitionRulesCheck.class})
@ -153,6 +154,12 @@ public class ExamDefinitionVO {
this.trial = examDefinition.getTrial();
}
public ExamDefinitionVO(ExamDefinition examDefinition, SysUser creator) {
this(examDefinition);
this.creatorName = creator.getName();
this.creatorNickname = creator.getNickname();
}
public ExamDefinition toDB() {
ExamDefinition definition = new ExamDefinition();
definition.setLessonId(this.getLessonId());

View File

@ -31,5 +31,5 @@ public class LessonPublishVO {
private String prdType;
@ApiModelProperty(value = "班级id集合")
private List<Integer> classIdList;
private List<Long> classIdList;
}

View File

@ -16,4 +16,9 @@ public class LessonQueryVO extends PageQueryVO {
@ApiModelProperty(value = "地图id")
private Long mapId;
/**
* 是否仅查询自己的
*/
private boolean self;
}

View File

@ -2,6 +2,7 @@ package club.joylink.rtss.vo.client;
import club.joylink.rtss.entity.LsDraftLesson;
import club.joylink.rtss.entity.LsLesson;
import club.joylink.rtss.entity.SysUser;
import club.joylink.rtss.vo.client.userPermission.UserPermissionVO;
import club.joylink.rtss.vo.client.validGroup.DraftLessonCreateCheck;
import club.joylink.rtss.vo.client.validGroup.DraftLessonCreateFromCheck;
@ -23,6 +24,8 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ApiModel(value = "课程对象")
@NoArgsConstructor
@ -109,6 +112,10 @@ public class LessonVO {
private boolean systemFault;
private String creatorName;
private String creatorNickName;
public LessonVO(LsDraftLesson lesson) {
this.id = lesson.getId();
this.name = lesson.getName();
@ -136,6 +143,20 @@ public class LessonVO {
this.systemFault = lesson.getSysfault();
}
public LessonVO(LsLesson lesson, SysUser creator) {
this(lesson);
this.creatorName = creator.getName();
this.creatorNickName = creator.getNickname();
}
public static List<LessonVO> convert(List<LsLesson> result, Map<Long, SysUser> creators) {
if (CollectionUtils.isEmpty(result)) {
return new ArrayList<>();
} else {
return result.stream().map(lesson -> new LessonVO(lesson, creators.get(lesson.getCreatorId()))).collect(Collectors.toList());
}
}
public LsDraftLesson convert2Draft() {
LsDraftLesson lesson = new LsDraftLesson();
lesson.setId(getId());

View File

@ -30,7 +30,7 @@ public class RaceQuestionProgressVO {
private String projectCode;
private Integer companyId;
private Long companyId;
/**错题列表*/
private List<Long> incorrectList;
@ -46,14 +46,14 @@ public class RaceQuestionProgressVO {
}
}
public RaceQuestionProgressVO(Long userId, Long questionIndex, String projectCode, Integer companyId) {
public RaceQuestionProgressVO(Long userId, Long questionIndex, String projectCode, Long companyId) {
this.userId = userId;
this.questionIndex = questionIndex;
this.projectCode = projectCode;
this.companyId = companyId;
}
public RaceQuestionProgressVO(Long userId, List<Long> incorrectQuestions, String projectCode, Integer companyId) {
public RaceQuestionProgressVO(Long userId, List<Long> incorrectQuestions, String projectCode, Long companyId) {
this.userId = userId;
this.incorrectList = incorrectQuestions;
this.projectCode = projectCode;

View File

@ -7,8 +7,8 @@ import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.util.StringUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
@ -39,7 +39,7 @@ public class TheoryQuestionsRuleVO {
private String projectCode;
/**公司/单位id*/
private Integer companyId;
private Long companyId;
@Getter
@Setter

View File

@ -1,6 +1,6 @@
package club.joylink.rtss.vo.client.org;
import club.joylink.rtss.services.org.OrgUserService;
import club.joylink.rtss.services.org.OrgService;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@ -10,7 +10,7 @@ import java.util.Objects;
@Getter
@Setter
@NoArgsConstructor
public class CompanyDepartUserVO{
public class CompanyDepartUserVO {
private Long userId;
@ -27,8 +27,8 @@ public class CompanyDepartUserVO{
private String orgRole;
public String getAccount() {
if(Objects.nonNull(account)){
return account.substring(0,account.indexOf(OrgUserService.companyCodePrefix));
if (Objects.nonNull(account)) {
return account.substring(0, account.indexOf(OrgService.companyCodePrefix));
}
return null;
}

View File

@ -17,7 +17,7 @@ import java.util.List;
public class CompanyVO {
@JsonSerialize(using = ToStringSerializer.class)
private Integer id;
private Long id;
/**公司名称*/
@NotBlank(message = "公司名称不能为空")

View File

@ -1,6 +1,7 @@
package club.joylink.rtss.vo.client.org;
import club.joylink.rtss.entity.Org;
import club.joylink.rtss.entity.SysUser;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ -20,7 +21,7 @@ import java.util.Objects;
public class DepartmentVO {
@JsonSerialize(using = ToStringSerializer.class)
private Integer id;
private Long id;
@NotBlank(message = "部门名称不能为空")
private String name;
@ -29,13 +30,13 @@ public class DepartmentVO {
@JsonIgnore
private Integer parentId;
private Long parentId;
/**
* 上级组织名称
*/
private String parentName;
private Integer rootId;
private Long rootId;
private LocalDateTime createTime;
@ -46,6 +47,12 @@ public class DepartmentVO {
private List<DepartmentVO> childDept;
private Long creatorId;
private String creatorName;
private String creatorNickName;
public DepartmentVO(Org entity) {
this.id = entity.getId();
this.name = entity.getName();
@ -65,17 +72,11 @@ public class DepartmentVO {
this.numberOfPeople = numberOfPeople;
}
public DepartmentVO(String name,Integer parentId,Integer rootId) {
this.name = name;
this.parentId = parentId;
this.rootId = rootId;
}
public DepartmentVO(Integer id, String name,Integer parentId,Integer rootId) {
this.id = id;
this.name = name;
this.parentId = parentId;
this.rootId = rootId;
public DepartmentVO(Org entity, Integer numberOfPeople, SysUser creator) {
this(entity, numberOfPeople);
this.creatorId = creator.getId();
this.creatorName = creator.getName();
this.creatorNickName = creator.getNickname();
}
public static List<DepartmentVO> convert2VOList(List<Org> dataList) {
@ -107,7 +108,7 @@ public class DepartmentVO {
return rootDeparts;
}
public static List<DepartmentVO> getChildDept(Integer parentId, List<DepartmentVO> list) {
public static List<DepartmentVO> getChildDept(Long parentId, List<DepartmentVO> list) {
List<DepartmentVO> child = new ArrayList<>();
list.forEach(c -> {
if (parentId == c.getParentId()) {
@ -123,7 +124,7 @@ public class DepartmentVO {
return child;
}
public static List<DepartmentVO> getChildDeptList(Integer parentId, List<DepartmentVO> list) {
public static List<DepartmentVO> getChildDeptList(Long parentId, List<DepartmentVO> list) {
List<DepartmentVO> child = new ArrayList<>();
list.forEach(c -> {
if (parentId == c.getParentId()) {

View File

@ -12,5 +12,7 @@ public class OrgQueryVO extends PageQueryVO {
private String name;
private Integer topOrgId;
private Long topOrgId;
private boolean self;
}

View File

@ -9,7 +9,7 @@ import lombok.Setter;
@Setter
@NoArgsConstructor
public class OrgScoringRuleQueryVO extends PageQueryVO {
private Integer orgId;
private Long orgId;
private String schoolYear;

View File

@ -4,6 +4,7 @@ import club.joylink.rtss.entity.OrgScoringRule;
import club.joylink.rtss.entity.OrgScoringRuleWithBLOBs;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.util.JsonUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Getter;
@ -16,8 +17,8 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 评分规则
@ -34,7 +35,7 @@ public class OrgScoringRuleVO {
/**
* 组织班级id
*/
private List<Integer> orgIds;
private List<Long> orgIds;
/**
* 学年
@ -46,15 +47,10 @@ public class OrgScoringRuleVO {
*/
private Integer term;
// /**
// * 平时分评价规则
// */
// private ScoringRule usualScoringRule;
/**
* 评价规则
*/
private ScoringRule scoringRule;
private List<ScoringRule> scoringRules;
@JsonSerialize(using = ToStringSerializer.class)
private Long creatorId;
@ -69,7 +65,7 @@ public class OrgScoringRuleVO {
/**
* 构建基础信息
*/
public static OrgScoringRuleVO buildBasicInfo(OrgScoringRule rule, List<Integer> orgIds) {
public static OrgScoringRuleVO buildBasicInfo(OrgScoringRule rule, List<Long> orgIds) {
OrgScoringRuleVO vo = new OrgScoringRuleVO();
vo.setId(rule.getId());
vo.setName(rule.getName());
@ -86,10 +82,10 @@ public class OrgScoringRuleVO {
/**
* 构建详细信息
*/
public static OrgScoringRuleVO buildDetails(OrgScoringRuleWithBLOBs rule, List<Integer> orgIds) {
public static OrgScoringRuleVO buildDetails(OrgScoringRuleWithBLOBs rule, List<Long> orgIds) {
OrgScoringRuleVO vo = buildBasicInfo(rule, orgIds);
if (StringUtils.hasText(rule.getFinalScoringRule())) {
vo.setScoringRule(JsonUtils.read(rule.getFinalScoringRule(), ScoringRule.class));
vo.setScoringRules(JsonUtils.readCollection(rule.getFinalScoringRule(), List.class, ScoringRule.class));
}
return vo;
}
@ -100,6 +96,9 @@ public class OrgScoringRuleVO {
public void check4Save() {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(schoolYear, "学年不能不选");
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(term, "学期不能不选");
if (!CollectionUtils.isEmpty(scoringRules)) {
scoringRules.forEach(ScoringRule::check4Use);
}
}
/**
@ -107,8 +106,8 @@ public class OrgScoringRuleVO {
*/
public void check4Use() {
check4Save();
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(scoringRule, "评价规则未填写");
scoringRule.check4Use();
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(scoringRules, "评价细则未填写");
scoringRules.forEach(ScoringRule::check4Use);
}
public OrgScoringRuleWithBLOBs convert2DB() {
@ -117,8 +116,8 @@ public class OrgScoringRuleVO {
rule.setName(name);
rule.setSchoolYear(schoolYear);
rule.setTerm(term);
if (scoringRule != null) {
rule.setFinalScoringRule(JsonUtils.writeValueAsString(scoringRule));
if (scoringRules != null) {
rule.setFinalScoringRule(JsonUtils.writeValueAsString(scoringRules));
}
return rule;
}
@ -126,12 +125,34 @@ public class OrgScoringRuleVO {
public OrgScoringRuleWithBLOBs cover4Update(OrgScoringRuleWithBLOBs entity) {
entity.setSchoolYear(schoolYear);
entity.setTerm(term);
entity.setFinalScoringRule(JsonUtils.writeValueAsString(scoringRule));
entity.setFinalScoringRule(JsonUtils.writeValueAsString(scoringRules));
return entity;
}
public int calculateTotalMarks() {
return scoringRule.calculateTotalMarks();
/**
* 获取评价规则中选择的所有课程
*/
@JsonIgnore
public List<Long> getAllLessonIds() {
if (CollectionUtils.isEmpty(scoringRules)) {
return new ArrayList<>();
} else {
return scoringRules.stream().filter(rule -> ScoringRuleType.LEARNING_TIME.equals(rule.getType()))
.flatMap(rule -> rule.getLessonIds().stream()).collect(Collectors.toList());
}
}
/**
* 获取评价规则中选择的所有考试
*/
@JsonIgnore
public List<Long> getAllExamIds() {
if (CollectionUtils.isEmpty(scoringRules)) {
return new ArrayList<>();
} else {
return scoringRules.stream().filter(rule -> ScoringRuleType.EXAM_RESULTS.equals(rule.getType()))
.map(ScoringRule::getExamId).collect(Collectors.toList());
}
}
/**
@ -141,72 +162,15 @@ public class OrgScoringRuleVO {
@Setter
@NoArgsConstructor
public static class ScoringRule {
/**
* 考勤评分规则和权重
*/
private Attendance attendance;
private ScoringRuleType type;
/**
* 学习时长
*/
private List<LearningTime> learningTimeList;
/**
* 考试及分值权重
*/
private List<Exam> exams;
/**
* 获取总权重
*/
public int calculateTotalMarks() {
int weight = 0;
if (this.attendance != null) {
weight += this.attendance.getFullMarks();
}
if (!CollectionUtils.isEmpty(learningTimeList)) {
for (LearningTime learningTime : learningTimeList) {
weight += learningTime.getFullMarks();
}
}
if (!CollectionUtils.isEmpty(exams)) {
for (Exam exam : exams) {
weight += exam.getFullMarks();
}
}
return weight;
}
public void check4Use() {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(attendance != null
|| !CollectionUtils.isEmpty(learningTimeList) || !CollectionUtils.isEmpty(exams),
"评价规则的细则未填写");
if (attendance != null) {
attendance.check4Use();
}
if (!CollectionUtils.isEmpty(learningTimeList)) {
learningTimeList.forEach(LearningTime::check4Use);
}
if (!CollectionUtils.isEmpty(exams)) {
exams.forEach(Exam::check4Use);
}
}
}
/**
* 考勤规则
*/
@Getter
@Setter
@NoArgsConstructor
public static class Attendance {
/**
* 考勤起始时间
* 考勤/学习时长考核的起始日期
*/
private LocalDate startDate;
/**
* 考勤截止时间
* 考勤/学习时长考核的截止日期
*/
private LocalDate endDate;
@ -215,99 +179,57 @@ public class OrgScoringRuleVO {
*/
private Integer days4FullMarks;
/**
* 考勤得分规则
* key - 出勤天数
* val - 得分
*/
private Map<Integer, Integer> scoringRules;
/**
* 满分
*/
private Integer fullMarks;
/**
* 根据登录天数计算得分
*/
public int calculateScore(int loginDays) {
double percent = Math.min((double) loginDays / days4FullMarks, 1);
return (int) (percent * fullMarks);
}
public void check4Use() {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(startDate, "考勤评价的开始时间未填写");
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(endDate, "考勤评价的截止时间未填写");
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(days4FullMarks, "满分的考勤次数未填写");
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(fullMarks, "考勤评价的满分未填写");
}
}
@Getter
@Setter
@NoArgsConstructor
public static class LearningTime {
@JsonSerialize(contentUsing = ToStringSerializer.class)
private List<Long> lessonIds;
private LocalDateTime startTime;
private LocalDateTime endTime;
/**
* 得满分的学习时长/分钟
*/
private Integer duration4FullMarks;
/**
* 得分规则
* key - 学习时长/分钟
* val - 得分
*/
private Map<Integer, Integer> scoringRules;
@JsonSerialize(using = ToStringSerializer.class)
private Long examId;
/**
* 满分
*/
private Integer fullMarks;
public int calculateScore(Long durationInSecond) {
if (durationInSecond == null) {
return 0;
}
double percent = Math.min(1, durationInSecond / (duration4FullMarks * 60d));
return (int) (percent * fullMarks);
}
public void check4Use() {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(lessonIds, "学习时长评价课程未选择");
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(duration4FullMarks, "学习时长评价的满分学习时长未填写");
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(fullMarks, "学习时长评价的总分未填写");
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(type, "评价细则类型不能为空");
switch (type) {
case ATTENDANCE: {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(startDate, type.getName() + "的开始时间未填写");
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(endDate, type.getName() + "的截止时间未填写");
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(days4FullMarks, type.getName() + "的满分考勤次数未填写");
}
break;
case LEARNING_TIME: {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(lessonIds, type.getName() + "的课程未选择");
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(duration4FullMarks, type.getName() + "的满分学习时长未填写");
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(startDate, type.getName() + "的开始时间未填写");
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(endDate, type.getName() + "的截止时间未填写");
}
break;
case EXAM_RESULTS: {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(examId, type.getName() + "的考试未选择");
}
break;
}
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(fullMarks, type.getName() + "的满分未填写");
}
}
@Getter
@Setter
@NoArgsConstructor
public static class Exam {
@JsonSerialize(using = ToStringSerializer.class)
private Long examId;
public enum ScoringRuleType {
ATTENDANCE("考勤评价"),
LEARNING_TIME("学习时长评价"),
EXAM_RESULTS("考试成绩评价");
private Integer fullMarks;
private final String name;
/**
* 计算得分
* @param userScore 用户考试得分
* @param examFullMarks 考试满分
*/
public int calculateScore(Integer userScore, int examFullMarks) {
if (userScore == null) {
return 0;
}
double percent = (double) userScore / examFullMarks;
return (int) (percent * fullMarks);
}
public void check4Use() {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(examId, "考试评价的考试未选择");
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(fullMarks, "考试评价的满分未填写");
ScoringRuleType(String name) {
this.name = name;
}
}
}

View File

@ -17,11 +17,11 @@ public class UserDepartRelVO {
private Long userId;
private Integer departmentId;
private Long departmentId;
private String orgRole;
public UserDepartRelVO(Long userId, Integer departmentId, String orgRole) {
public UserDepartRelVO(Long userId, Long departmentId, String orgRole) {
this.userId = userId;
this.departmentId = departmentId;
this.orgRole = orgRole;

View File

@ -15,6 +15,6 @@ public class QuestionQueryVO extends PageQueryVO {
private String type;
private String projectCode;
private Integer companyId;
private Long companyId;
}

View File

@ -41,7 +41,7 @@ public class QuestionVO implements Cloneable {
private String createUserName;
private String projectCode;
private Integer companyId;
private Long companyId;
@ApiModelProperty("分值")
private Float score = 1f;

View File

@ -1,6 +1,6 @@
package club.joylink.rtss.vo.client.student;
import club.joylink.rtss.services.org.OrgUserService;
import club.joylink.rtss.services.org.OrgService;
import io.swagger.annotations.ApiModel;
import lombok.Getter;
import lombok.Setter;
@ -32,7 +32,7 @@ public class ExportStudentInfo {
public String getStudentID() {
if(Objects.nonNull(studentID)){
return studentID.substring(0,studentID.indexOf(OrgUserService.companyCodePrefix));
return studentID.substring(0,studentID.indexOf(OrgService.companyCodePrefix));
}
return null;
}

View File

@ -19,7 +19,7 @@ public class StudentInfoExportParam {
/**班级id*/
@ApiModelProperty(value = "班级id")
@NotNull(message = "班级id不能为空")
private Integer classId;
private Long classId;
/**考勤天数*/
@ApiModelProperty(value = "考勤天数")

View File

@ -2,10 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="club.joylink.rtss.dao.OrgDAO">
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.Org">
<id column="id" jdbcType="INTEGER" property="id" />
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="parent_id" jdbcType="INTEGER" property="parentId" />
<result column="root_id" jdbcType="INTEGER" property="rootId" />
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
<result column="root_id" jdbcType="BIGINT" property="rootId" />
<result column="project_code" jdbcType="VARCHAR" property="projectCode" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="creator_id" jdbcType="BIGINT" property="creatorId" />
@ -98,15 +98,15 @@
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from org
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from org
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.OrgExample">
delete from org
@ -119,7 +119,7 @@
project_code, code, creator_id,
create_time, update_id, update_time,
`status`)
values (#{name,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{rootId,jdbcType=INTEGER},
values (#{name,jdbcType=VARCHAR}, #{parentId,jdbcType=BIGINT}, #{rootId,jdbcType=BIGINT},
#{projectCode,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT},
#{createTime,jdbcType=TIMESTAMP}, #{updateId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP},
#{status,jdbcType=VARCHAR})
@ -163,10 +163,10 @@
#{name,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=INTEGER},
#{parentId,jdbcType=BIGINT},
</if>
<if test="rootId != null">
#{rootId,jdbcType=INTEGER},
#{rootId,jdbcType=BIGINT},
</if>
<if test="projectCode != null">
#{projectCode,jdbcType=VARCHAR},
@ -201,16 +201,16 @@
update org
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.parentId != null">
parent_id = #{record.parentId,jdbcType=INTEGER},
parent_id = #{record.parentId,jdbcType=BIGINT},
</if>
<if test="record.rootId != null">
root_id = #{record.rootId,jdbcType=INTEGER},
root_id = #{record.rootId,jdbcType=BIGINT},
</if>
<if test="record.projectCode != null">
project_code = #{record.projectCode,jdbcType=VARCHAR},
@ -240,10 +240,10 @@
</update>
<update id="updateByExample" parameterType="map">
update org
set id = #{record.id,jdbcType=INTEGER},
set id = #{record.id,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
root_id = #{record.rootId,jdbcType=INTEGER},
parent_id = #{record.parentId,jdbcType=BIGINT},
root_id = #{record.rootId,jdbcType=BIGINT},
project_code = #{record.projectCode,jdbcType=VARCHAR},
code = #{record.code,jdbcType=VARCHAR},
creator_id = #{record.creatorId,jdbcType=BIGINT},
@ -262,10 +262,10 @@
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=INTEGER},
parent_id = #{parentId,jdbcType=BIGINT},
</if>
<if test="rootId != null">
root_id = #{rootId,jdbcType=INTEGER},
root_id = #{rootId,jdbcType=BIGINT},
</if>
<if test="projectCode != null">
project_code = #{projectCode,jdbcType=VARCHAR},
@ -289,13 +289,13 @@
`status` = #{status,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.Org">
update org
set `name` = #{name,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
root_id = #{rootId,jdbcType=INTEGER},
parent_id = #{parentId,jdbcType=BIGINT},
root_id = #{rootId,jdbcType=BIGINT},
project_code = #{projectCode,jdbcType=VARCHAR},
code = #{code,jdbcType=VARCHAR},
creator_id = #{creatorId,jdbcType=BIGINT},
@ -303,6 +303,6 @@
update_id = #{updateId,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=TIMESTAMP},
`status` = #{status,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@ -3,7 +3,9 @@
<mapper namespace="club.joylink.rtss.dao.OrgLessonDAO">
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.OrgLesson">
<result column="lesson_id" jdbcType="BIGINT" property="lessonId" />
<result column="org_id" jdbcType="INTEGER" property="orgId" />
<result column="org_id" jdbcType="BIGINT" property="orgId" />
<result column="creator_id" jdbcType="BIGINT" property="creatorId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -64,7 +66,7 @@
</where>
</sql>
<sql id="Base_Column_List">
lesson_id, org_id
lesson_id, org_id, creator_id, create_time
</sql>
<select id="selectByExample" parameterType="club.joylink.rtss.entity.OrgLessonExample" resultMap="BaseResultMap">
select
@ -95,8 +97,10 @@
</if>
</delete>
<insert id="insert" parameterType="club.joylink.rtss.entity.OrgLesson">
insert into org_lesson (lesson_id, org_id)
values (#{lessonId,jdbcType=BIGINT}, #{orgId,jdbcType=INTEGER})
insert into org_lesson (lesson_id, org_id, creator_id,
create_time)
values (#{lessonId,jdbcType=BIGINT}, #{orgId,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT},
#{createTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="club.joylink.rtss.entity.OrgLesson">
insert into org_lesson
@ -107,13 +111,25 @@
<if test="orgId != null">
org_id,
</if>
<if test="creatorId != null">
creator_id,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="lessonId != null">
#{lessonId,jdbcType=BIGINT},
</if>
<if test="orgId != null">
#{orgId,jdbcType=INTEGER},
#{orgId,jdbcType=BIGINT},
</if>
<if test="creatorId != null">
#{creatorId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
@ -130,7 +146,13 @@
lesson_id = #{record.lessonId,jdbcType=BIGINT},
</if>
<if test="record.orgId != null">
org_id = #{record.orgId,jdbcType=INTEGER},
org_id = #{record.orgId,jdbcType=BIGINT},
</if>
<if test="record.creatorId != null">
creator_id = #{record.creatorId,jdbcType=BIGINT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
@ -140,7 +162,9 @@
<update id="updateByExample" parameterType="map">
update org_lesson
set lesson_id = #{record.lessonId,jdbcType=BIGINT},
org_id = #{record.orgId,jdbcType=INTEGER}
org_id = #{record.orgId,jdbcType=BIGINT},
creator_id = #{record.creatorId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>

View File

@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.OrgScoringRule">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="org_id" jdbcType="INTEGER" property="orgId" />
<result column="org_id" jdbcType="BIGINT" property="orgId" />
<result column="school_year" jdbcType="VARCHAR" property="schoolYear" />
<result column="term" jdbcType="INTEGER" property="term" />
<result column="creator_id" jdbcType="BIGINT" property="creatorId" />
@ -127,7 +127,7 @@
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
select
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
@ -145,13 +145,13 @@
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.OrgScoringRuleWithBLOBs" useGeneratedKeys="true">
insert into org_scoring_rule (`name`, org_id, school_year,
term, creator_id, create_time,
update_id, update_time, usual_scoring_rule,
insert into org_scoring_rule (`name`, org_id, school_year,
term, creator_id, create_time,
update_id, update_time, usual_scoring_rule,
final_scoring_rule)
values (#{name,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER}, #{schoolYear,jdbcType=VARCHAR},
#{term,jdbcType=INTEGER}, #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{usualScoringRule,jdbcType=LONGVARCHAR},
values (#{name,jdbcType=VARCHAR}, #{orgId,jdbcType=BIGINT}, #{schoolYear,jdbcType=VARCHAR},
#{term,jdbcType=INTEGER}, #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{usualScoringRule,jdbcType=LONGVARCHAR},
#{finalScoringRule,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.OrgScoringRuleWithBLOBs" useGeneratedKeys="true">
@ -193,7 +193,7 @@
#{name,jdbcType=VARCHAR},
</if>
<if test="orgId != null">
#{orgId,jdbcType=INTEGER},
#{orgId,jdbcType=BIGINT},
</if>
<if test="schoolYear != null">
#{schoolYear,jdbcType=VARCHAR},
@ -237,7 +237,7 @@
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.orgId != null">
org_id = #{record.orgId,jdbcType=INTEGER},
org_id = #{record.orgId,jdbcType=BIGINT},
</if>
<if test="record.schoolYear != null">
school_year = #{record.schoolYear,jdbcType=VARCHAR},
@ -272,7 +272,7 @@
update org_scoring_rule
set id = #{record.id,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
org_id = #{record.orgId,jdbcType=INTEGER},
org_id = #{record.orgId,jdbcType=BIGINT},
school_year = #{record.schoolYear,jdbcType=VARCHAR},
term = #{record.term,jdbcType=INTEGER},
creator_id = #{record.creatorId,jdbcType=BIGINT},
@ -289,7 +289,7 @@
update org_scoring_rule
set id = #{record.id,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
org_id = #{record.orgId,jdbcType=INTEGER},
org_id = #{record.orgId,jdbcType=BIGINT},
school_year = #{record.schoolYear,jdbcType=VARCHAR},
term = #{record.term,jdbcType=INTEGER},
creator_id = #{record.creatorId,jdbcType=BIGINT},
@ -307,7 +307,7 @@
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="orgId != null">
org_id = #{orgId,jdbcType=INTEGER},
org_id = #{orgId,jdbcType=BIGINT},
</if>
<if test="schoolYear != null">
school_year = #{schoolYear,jdbcType=VARCHAR},
@ -339,7 +339,7 @@
<update id="updateByPrimaryKeyWithBLOBs" parameterType="club.joylink.rtss.entity.OrgScoringRuleWithBLOBs">
update org_scoring_rule
set `name` = #{name,jdbcType=VARCHAR},
org_id = #{orgId,jdbcType=INTEGER},
org_id = #{orgId,jdbcType=BIGINT},
school_year = #{schoolYear,jdbcType=VARCHAR},
term = #{term,jdbcType=INTEGER},
creator_id = #{creatorId,jdbcType=BIGINT},
@ -353,7 +353,7 @@
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.OrgScoringRule">
update org_scoring_rule
set `name` = #{name,jdbcType=VARCHAR},
org_id = #{orgId,jdbcType=INTEGER},
org_id = #{orgId,jdbcType=BIGINT},
school_year = #{schoolYear,jdbcType=VARCHAR},
term = #{term,jdbcType=INTEGER},
creator_id = #{creatorId,jdbcType=BIGINT},
@ -362,4 +362,4 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
</mapper>

View File

@ -2,8 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="club.joylink.rtss.dao.OrgScoringRuleRelDAO">
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.OrgScoringRuleRel">
<result column="org_id" jdbcType="INTEGER" property="orgId" />
<result column="org_id" jdbcType="BIGINT" property="orgId" />
<result column="rule_id" jdbcType="BIGINT" property="ruleId" />
<result column="rule_org_id" jdbcType="BIGINT" property="ruleOrgId" />
<result column="rule_school_year" jdbcType="VARCHAR" property="ruleSchoolYear" />
<result column="rule_term" jdbcType="INTEGER" property="ruleTerm" />
<result column="rule_creator_id" jdbcType="BIGINT" property="ruleCreatorId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -64,7 +68,7 @@
</where>
</sql>
<sql id="Base_Column_List">
org_id, rule_id
org_id, rule_id, rule_org_id, rule_school_year, rule_term, rule_creator_id
</sql>
<select id="selectByExample" parameterType="club.joylink.rtss.entity.OrgScoringRuleRelExample" resultMap="BaseResultMap">
select
@ -95,8 +99,12 @@
</if>
</delete>
<insert id="insert" parameterType="club.joylink.rtss.entity.OrgScoringRuleRel">
insert into org_scoring_rule_rel (org_id, rule_id)
values (#{orgId,jdbcType=INTEGER}, #{ruleId,jdbcType=BIGINT})
insert into org_scoring_rule_rel (org_id, rule_id, rule_org_id,
rule_school_year, rule_term, rule_creator_id
)
values (#{orgId,jdbcType=BIGINT}, #{ruleId,jdbcType=BIGINT}, #{ruleOrgId,jdbcType=BIGINT},
#{ruleSchoolYear,jdbcType=VARCHAR}, #{ruleTerm,jdbcType=INTEGER}, #{ruleCreatorId,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="club.joylink.rtss.entity.OrgScoringRuleRel">
insert into org_scoring_rule_rel
@ -107,14 +115,38 @@
<if test="ruleId != null">
rule_id,
</if>
<if test="ruleOrgId != null">
rule_org_id,
</if>
<if test="ruleSchoolYear != null">
rule_school_year,
</if>
<if test="ruleTerm != null">
rule_term,
</if>
<if test="ruleCreatorId != null">
rule_creator_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orgId != null">
#{orgId,jdbcType=INTEGER},
#{orgId,jdbcType=BIGINT},
</if>
<if test="ruleId != null">
#{ruleId,jdbcType=BIGINT},
</if>
<if test="ruleOrgId != null">
#{ruleOrgId,jdbcType=BIGINT},
</if>
<if test="ruleSchoolYear != null">
#{ruleSchoolYear,jdbcType=VARCHAR},
</if>
<if test="ruleTerm != null">
#{ruleTerm,jdbcType=INTEGER},
</if>
<if test="ruleCreatorId != null">
#{ruleCreatorId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="club.joylink.rtss.entity.OrgScoringRuleRelExample" resultType="java.lang.Long">
@ -127,11 +159,23 @@
update org_scoring_rule_rel
<set>
<if test="record.orgId != null">
org_id = #{record.orgId,jdbcType=INTEGER},
org_id = #{record.orgId,jdbcType=BIGINT},
</if>
<if test="record.ruleId != null">
rule_id = #{record.ruleId,jdbcType=BIGINT},
</if>
<if test="record.ruleOrgId != null">
rule_org_id = #{record.ruleOrgId,jdbcType=BIGINT},
</if>
<if test="record.ruleSchoolYear != null">
rule_school_year = #{record.ruleSchoolYear,jdbcType=VARCHAR},
</if>
<if test="record.ruleTerm != null">
rule_term = #{record.ruleTerm,jdbcType=INTEGER},
</if>
<if test="record.ruleCreatorId != null">
rule_creator_id = #{record.ruleCreatorId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -139,8 +183,12 @@
</update>
<update id="updateByExample" parameterType="map">
update org_scoring_rule_rel
set org_id = #{record.orgId,jdbcType=INTEGER},
rule_id = #{record.ruleId,jdbcType=BIGINT}
set org_id = #{record.orgId,jdbcType=BIGINT},
rule_id = #{record.ruleId,jdbcType=BIGINT},
rule_org_id = #{record.ruleOrgId,jdbcType=BIGINT},
rule_school_year = #{record.ruleSchoolYear,jdbcType=VARCHAR},
rule_term = #{record.ruleTerm,jdbcType=INTEGER},
rule_creator_id = #{record.ruleCreatorId,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>

View File

@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.OrgUser">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="org_id" jdbcType="INTEGER" property="orgId" />
<result column="org_id" jdbcType="BIGINT" property="orgId" />
<result column="role" jdbcType="VARCHAR" property="role" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
@ -111,7 +111,7 @@
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.OrgUser" useGeneratedKeys="true">
insert into org_user (user_id, org_id, `role`,
create_time, update_time)
values (#{userId,jdbcType=BIGINT}, #{orgId,jdbcType=INTEGER}, #{role,jdbcType=VARCHAR},
values (#{userId,jdbcType=BIGINT}, #{orgId,jdbcType=BIGINT}, #{role,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.OrgUser" useGeneratedKeys="true">
@ -138,7 +138,7 @@
#{userId,jdbcType=BIGINT},
</if>
<if test="orgId != null">
#{orgId,jdbcType=INTEGER},
#{orgId,jdbcType=BIGINT},
</if>
<if test="role != null">
#{role,jdbcType=VARCHAR},
@ -167,7 +167,7 @@
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.orgId != null">
org_id = #{record.orgId,jdbcType=INTEGER},
org_id = #{record.orgId,jdbcType=BIGINT},
</if>
<if test="record.role != null">
`role` = #{record.role,jdbcType=VARCHAR},
@ -187,7 +187,7 @@
update org_user
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
org_id = #{record.orgId,jdbcType=INTEGER},
org_id = #{record.orgId,jdbcType=BIGINT},
`role` = #{record.role,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
@ -202,7 +202,7 @@
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="orgId != null">
org_id = #{orgId,jdbcType=INTEGER},
org_id = #{orgId,jdbcType=BIGINT},
</if>
<if test="role != null">
`role` = #{role,jdbcType=VARCHAR},
@ -219,7 +219,7 @@
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.OrgUser">
update org_user
set user_id = #{userId,jdbcType=BIGINT},
org_id = #{orgId,jdbcType=INTEGER},
org_id = #{orgId,jdbcType=BIGINT},
`role` = #{role,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}

View File

@ -8,7 +8,7 @@
<result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="project_code" jdbcType="VARCHAR" property="projectCode" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
<result column="company_id" jdbcType="BIGINT" property="companyId" />
</resultMap>
<resultMap id="ResultMapRef" type="club.joylink.rtss.vo.client.question.QuestionVO">
@ -173,7 +173,7 @@
create_time, project_code, company_id
)
values (#{topic,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{createUserId,jdbcType=BIGINT},
#{createTime,jdbcType=TIMESTAMP}, #{projectCode,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}
#{createTime,jdbcType=TIMESTAMP}, #{projectCode,jdbcType=VARCHAR}, #{companyId,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.RaceQuestion" useGeneratedKeys="true">
@ -215,7 +215,7 @@
#{projectCode,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
#{companyId,jdbcType=BIGINT},
</if>
</trim>
</insert>
@ -247,7 +247,7 @@
project_code = #{record.projectCode,jdbcType=VARCHAR},
</if>
<if test="record.companyId != null">
company_id = #{record.companyId,jdbcType=INTEGER},
company_id = #{record.companyId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
@ -262,7 +262,7 @@
create_user_id = #{record.createUserId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
project_code = #{record.projectCode,jdbcType=VARCHAR},
company_id = #{record.companyId,jdbcType=INTEGER}
company_id = #{record.companyId,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -286,7 +286,7 @@
project_code = #{projectCode,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
company_id = #{companyId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
@ -298,7 +298,7 @@
create_user_id = #{createUserId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
project_code = #{projectCode,jdbcType=VARCHAR},
company_id = #{companyId,jdbcType=INTEGER}
company_id = #{companyId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@ -7,7 +7,7 @@
<result column="question_index" jdbcType="BIGINT" property="questionIndex" />
<result column="project_code" jdbcType="VARCHAR" property="projectCode" />
<result column="incorrect" jdbcType="VARCHAR" property="incorrect" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
<result column="company_id" jdbcType="BIGINT" property="companyId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -112,7 +112,7 @@
insert into race_question_progress (user_id, question_index, project_code,
incorrect, company_id)
values (#{userId,jdbcType=BIGINT}, #{questionIndex,jdbcType=BIGINT}, #{projectCode,jdbcType=VARCHAR},
#{incorrect,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER})
#{incorrect,jdbcType=VARCHAR}, #{companyId,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.RaceQuestionProgress" useGeneratedKeys="true">
insert into race_question_progress
@ -147,7 +147,7 @@
#{incorrect,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
#{companyId,jdbcType=BIGINT},
</if>
</trim>
</insert>
@ -176,7 +176,7 @@
incorrect = #{record.incorrect,jdbcType=VARCHAR},
</if>
<if test="record.companyId != null">
company_id = #{record.companyId,jdbcType=INTEGER},
company_id = #{record.companyId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
@ -190,7 +190,7 @@
question_index = #{record.questionIndex,jdbcType=BIGINT},
project_code = #{record.projectCode,jdbcType=VARCHAR},
incorrect = #{record.incorrect,jdbcType=VARCHAR},
company_id = #{record.companyId,jdbcType=INTEGER}
company_id = #{record.companyId,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -211,7 +211,7 @@
incorrect = #{incorrect,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
company_id = #{companyId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
@ -222,7 +222,7 @@
question_index = #{questionIndex,jdbcType=BIGINT},
project_code = #{projectCode,jdbcType=VARCHAR},
incorrect = #{incorrect,jdbcType=VARCHAR},
company_id = #{companyId,jdbcType=INTEGER}
company_id = #{companyId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.RaceQuestionsRules">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="project_code" jdbcType="VARCHAR" property="projectCode" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
<result column="company_id" jdbcType="BIGINT" property="companyId" />
<result column="rules" jdbcType="VARCHAR" property="rules" />
</resultMap>
<sql id="Example_Where_Clause">
@ -109,7 +109,7 @@
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.RaceQuestionsRules" useGeneratedKeys="true">
insert into race_questions_rules (project_code, company_id, rules
)
values (#{projectCode,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{rules,jdbcType=VARCHAR}
values (#{projectCode,jdbcType=VARCHAR}, #{companyId,jdbcType=BIGINT}, #{rules,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.RaceQuestionsRules" useGeneratedKeys="true">
@ -130,7 +130,7 @@
#{projectCode,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
#{companyId,jdbcType=BIGINT},
</if>
<if test="rules != null">
#{rules,jdbcType=VARCHAR},
@ -153,7 +153,7 @@
project_code = #{record.projectCode,jdbcType=VARCHAR},
</if>
<if test="record.companyId != null">
company_id = #{record.companyId,jdbcType=INTEGER},
company_id = #{record.companyId,jdbcType=BIGINT},
</if>
<if test="record.rules != null">
rules = #{record.rules,jdbcType=VARCHAR},
@ -167,7 +167,7 @@
update race_questions_rules
set id = #{record.id,jdbcType=INTEGER},
project_code = #{record.projectCode,jdbcType=VARCHAR},
company_id = #{record.companyId,jdbcType=INTEGER},
company_id = #{record.companyId,jdbcType=BIGINT},
rules = #{record.rules,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -180,7 +180,7 @@
project_code = #{projectCode,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
company_id = #{companyId,jdbcType=BIGINT},
</if>
<if test="rules != null">
rules = #{rules,jdbcType=VARCHAR},
@ -191,7 +191,7 @@
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.RaceQuestionsRules">
update race_questions_rules
set project_code = #{projectCode,jdbcType=VARCHAR},
company_id = #{companyId,jdbcType=INTEGER},
company_id = #{companyId,jdbcType=BIGINT},
rules = #{rules,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>

View File

@ -8,13 +8,13 @@
<result column="question_option_id" jdbcType="VARCHAR" property="questionOptionId" />
<result column="question_topic" jdbcType="VARCHAR" property="questionTopic" />
<result column="answer_content" jdbcType="VARCHAR" property="answerContent" />
<result column="correct" jdbcType="BIT" property="correct" />
<result column="correct" jdbcType="TINYINT" property="correct" />
<result column="score" jdbcType="REAL" property="score" />
<result column="total_score" jdbcType="REAL" property="totalScore" />
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="project_code" jdbcType="VARCHAR" property="projectCode" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
<result column="company_id" jdbcType="BIGINT" property="companyId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -123,9 +123,9 @@
user_id, project_code, company_id
)
values (#{userRaceId,jdbcType=BIGINT}, #{questionId,jdbcType=BIGINT}, #{questionOptionId,jdbcType=VARCHAR},
#{questionTopic,jdbcType=VARCHAR}, #{answerContent,jdbcType=VARCHAR}, #{correct,jdbcType=BIT},
#{questionTopic,jdbcType=VARCHAR}, #{answerContent,jdbcType=VARCHAR}, #{correct,jdbcType=TINYINT},
#{score,jdbcType=REAL}, #{totalScore,jdbcType=REAL}, #{remarks,jdbcType=VARCHAR},
#{userId,jdbcType=BIGINT}, #{projectCode,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}
#{userId,jdbcType=BIGINT}, #{projectCode,jdbcType=VARCHAR}, #{companyId,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.RaceResult" useGeneratedKeys="true">
@ -185,7 +185,7 @@
#{answerContent,jdbcType=VARCHAR},
</if>
<if test="correct != null">
#{correct,jdbcType=BIT},
#{correct,jdbcType=TINYINT},
</if>
<if test="score != null">
#{score,jdbcType=REAL},
@ -203,7 +203,7 @@
#{projectCode,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
#{companyId,jdbcType=BIGINT},
</if>
</trim>
</insert>
@ -235,7 +235,7 @@
answer_content = #{record.answerContent,jdbcType=VARCHAR},
</if>
<if test="record.correct != null">
correct = #{record.correct,jdbcType=BIT},
correct = #{record.correct,jdbcType=TINYINT},
</if>
<if test="record.score != null">
score = #{record.score,jdbcType=REAL},
@ -253,7 +253,7 @@
project_code = #{record.projectCode,jdbcType=VARCHAR},
</if>
<if test="record.companyId != null">
company_id = #{record.companyId,jdbcType=INTEGER},
company_id = #{record.companyId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
@ -268,13 +268,13 @@
question_option_id = #{record.questionOptionId,jdbcType=VARCHAR},
question_topic = #{record.questionTopic,jdbcType=VARCHAR},
answer_content = #{record.answerContent,jdbcType=VARCHAR},
correct = #{record.correct,jdbcType=BIT},
correct = #{record.correct,jdbcType=TINYINT},
score = #{record.score,jdbcType=REAL},
total_score = #{record.totalScore,jdbcType=REAL},
remarks = #{record.remarks,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=BIGINT},
project_code = #{record.projectCode,jdbcType=VARCHAR},
company_id = #{record.companyId,jdbcType=INTEGER}
company_id = #{record.companyId,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -298,7 +298,7 @@
answer_content = #{answerContent,jdbcType=VARCHAR},
</if>
<if test="correct != null">
correct = #{correct,jdbcType=BIT},
correct = #{correct,jdbcType=TINYINT},
</if>
<if test="score != null">
score = #{score,jdbcType=REAL},
@ -316,7 +316,7 @@
project_code = #{projectCode,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
company_id = #{companyId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
@ -328,13 +328,13 @@
question_option_id = #{questionOptionId,jdbcType=VARCHAR},
question_topic = #{questionTopic,jdbcType=VARCHAR},
answer_content = #{answerContent,jdbcType=VARCHAR},
correct = #{correct,jdbcType=BIT},
correct = #{correct,jdbcType=TINYINT},
score = #{score,jdbcType=REAL},
total_score = #{totalScore,jdbcType=REAL},
remarks = #{remarks,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=BIGINT},
project_code = #{projectCode,jdbcType=VARCHAR},
company_id = #{companyId,jdbcType=INTEGER}
company_id = #{companyId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>