diff --git a/sql/202201010-zhouyin.sql b/sql/202201010-zhouyin.sql index c5ffd9ba8..9eabbdf77 100644 --- a/sql/202201010-zhouyin.sql +++ b/sql/202201010-zhouyin.sql @@ -1,3 +1,3 @@ -- 新实训标添加组织id -alter table published_training2 add column org_id bigint; +alter table rts_published_training2 add column org_id bigint; diff --git a/sql/20220921-zhouyin.sql b/sql/20220921-zhouyin.sql index 7a938cfe3..e50200198 100644 --- a/sql/20220921-zhouyin.sql +++ b/sql/20220921-zhouyin.sql @@ -1,6 +1,6 @@ -- 新题库 -DROP TABLE IF EXISTS `paper_question`; -CREATE TABLE `paper_question` ( +DROP TABLE IF EXISTS `rts_paper_question`; +CREATE TABLE `rts_paper_question` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id', `type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '类型 选择题=select,判断题=judge,多选题=multi', `question` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '问题内容', diff --git a/sql/20221015-wei-projectDefaultOrg.sql b/sql/20221015-wei-projectDefaultOrg.sql new file mode 100644 index 000000000..37535a181 --- /dev/null +++ b/sql/20221015-wei-projectDefaultOrg.sql @@ -0,0 +1,2 @@ +alter table `joylink`.`project` +ADD COLUMN `default_org` bigint NULL comment '默认组织ID' AFTER `server_setting`; \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/controller/org/OrgProjectController.java b/src/main/java/club/joylink/rtss/controller/org/OrgProjectController.java index 998c1d9de..18697b298 100644 --- a/src/main/java/club/joylink/rtss/controller/org/OrgProjectController.java +++ b/src/main/java/club/joylink/rtss/controller/org/OrgProjectController.java @@ -20,7 +20,7 @@ public class OrgProjectController { */ @GetMapping("list") public List queryOrgList(@RequestAttribute LoginUserInfoVO loginInfo) { - return orgProjectService.queryOrgProjectListByProjectAndUid(loginInfo.getProject(), loginInfo.getAccountVO().getId()); + return orgProjectService.queryOrgProjectListByProjectAndUid(loginInfo.getProjectInfo(), loginInfo.getAccountVO().getId()); } /** diff --git a/src/main/java/club/joylink/rtss/controller/project/ProjectInfoController.java b/src/main/java/club/joylink/rtss/controller/project/ProjectInfoController.java index 4e4231f38..07f32ff55 100644 --- a/src/main/java/club/joylink/rtss/controller/project/ProjectInfoController.java +++ b/src/main/java/club/joylink/rtss/controller/project/ProjectInfoController.java @@ -1,13 +1,13 @@ package club.joylink.rtss.controller.project; +import club.joylink.rtss.controller.advice.AuthenticateInterceptor; import club.joylink.rtss.entity.project.Project; import club.joylink.rtss.entity.project.ProjectView; import club.joylink.rtss.services.project.ProjectService; +import club.joylink.rtss.vo.AccountVO; import club.joylink.rtss.vo.client.PageVO; -import club.joylink.rtss.vo.project.ProjectQueryVO; -import club.joylink.rtss.vo.project.ProjectVO; -import club.joylink.rtss.vo.project.ProjectViewQueryVO; -import club.joylink.rtss.vo.project.ProjectViewVO; +import club.joylink.rtss.vo.client.org.CompanyVO; +import club.joylink.rtss.vo.project.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -24,12 +24,12 @@ public class ProjectInfoController { private ProjectService projectService; @GetMapping("/page") - public PageVO pagingQuery(ProjectQueryVO queryVO) { + public PageVO pagingQuery(ProjectQueryVO queryVO) { return projectService.pagingQuery(queryVO); } @GetMapping("/all") - public List getAllProject() { + public List getAllProject() { return projectService.getAllProject(); } @@ -58,6 +58,22 @@ public class ProjectInfoController { return projectService.checkProjectCode(code); } + @PutMapping("/setDefaultOrg") + public void setProjectDefaultOrg(Long id, Long orgId) { + projectService.setProjectDefaultOrg(id, orgId); + } + + @GetMapping("/{id}/orgList") + public List orgList(@PathVariable Long id) { + return projectService.projectOrgList(id); + } + + @PostMapping("/{id}/createDefaultOrg") + public ProjectInfoVO quickCreateDefaultOrg(@PathVariable Long id, String name + , @RequestAttribute(AuthenticateInterceptor.LOGIN_USER_KEY) AccountVO user) { + return projectService.quickCreateDefaultOrg(id, name, user); + } + @GetMapping("/viewSetting/page") public PageVO projectViewPagingQuery(ProjectViewQueryVO queryVO) { return projectService.projectViewPagingQuery(queryVO); diff --git a/src/main/java/club/joylink/rtss/dao/paper/PaperQuestionDAO.java b/src/main/java/club/joylink/rtss/dao/paper/PaperQuestionDAO.java index af87d9172..696a4590f 100644 --- a/src/main/java/club/joylink/rtss/dao/paper/PaperQuestionDAO.java +++ b/src/main/java/club/joylink/rtss/dao/paper/PaperQuestionDAO.java @@ -15,7 +15,7 @@ import java.util.List; @Repository public interface PaperQuestionDAO { @Select("