瀏覽代碼

班级树

大数据与最优化研究所 4 月之前
父節點
當前提交
1f709285b9

+ 1 - 0
src/main/java/com/xjrsoft/module/form/service/impl/FormExecuteServiceImpl.java

@@ -656,6 +656,7 @@ public class FormExecuteServiceImpl implements IFormExecuteService {
                             Entity childDeleteWhere = Entity.create(tableConfig.getTableName()).
                                     set(childTableConfig.get().getRelationField(), keyValues);
                             Boolean result = SqlRunnerAdapter.db().dynamicDelete(childTableConfig.get().getTableName(), childDeleteWhere);
+                            // TODO 当子表没有添加数据的时候,删除结果为false。
                             if (!result) {
                                 throw new MyException("删除数据失败");
                             }

+ 1 - 62
src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java

@@ -89,8 +89,6 @@ public class StudentManagerController {
 
     private final IStudentManagerService studentManagerService;
     private final IBaseGradeService baseGradeService;
-    private final IDepartmentService baseDeparmentService;
-    private final IBaseMajorService baseMajorService;
     private final IBaseClassService baseClassService;
     private final IXjrUserService xjrUserService;
     private final IRoomBedService roomBedService;
@@ -214,66 +212,7 @@ public class StudentManagerController {
     @ApiOperation(value = "学生部门专业年级班级树")
     @SaCheckPermission("studentmanager:detail")
     public RT<List<BaseDepMajorGradeClassStudenTreeVo>> tree2() {
-        List<BaseDepMajorGradeClassStudenTreeVo> voList = new ArrayList<>();
-        MPJLambdaWrapper<BaseClass> baseClassMPJLambdaWrapper = new MPJLambdaWrapper<>();
-        baseClassMPJLambdaWrapper
-                .selectAs(BaseClass::getId, BaseClassMajorSetVo::getClassId)
-                .selectAs(BaseMajorSet::getMajorId, BaseClassMajorSetVo::getMajorId)
-                .selectAs(BaseClass::getName, BaseClassMajorSetVo::getClassName)
-                .selectAs(BaseClass::getGradeId, BaseClassMajorSetVo::getGradeId)
-                .leftJoin(BaseClassMajorSet.class, BaseClassMajorSet::getClassId, BaseClass::getId)
-                .leftJoin(BaseMajorSet.class, BaseMajorSet::getId, BaseClassMajorSet::getMajorSetId)
-        ;
-
-        List<BaseClassMajorSetVo> majorSetList = baseClassService.selectJoinList(BaseClassMajorSetVo.class, baseClassMPJLambdaWrapper);
-
-
-        List<BaseGrade> gradeList = baseGradeService.list(
-                new QueryWrapper<BaseGrade>().lambda().eq(BaseGrade::getDeleteMark, DeleteMark.NODELETE.getCode())
-        );
-        List<BaseMajor> majorList = baseMajorService.list(
-                new QueryWrapper<BaseMajor>().lambda().eq(BaseMajor::getDeleteMark, DeleteMark.NODELETE.getCode())
-        );
-        List<Department> departmentList =baseDeparmentService.list(
-                new QueryWrapper<Department>().lambda().eq(Department::getDeleteMark, DeleteMark.NODELETE.getCode())
-                        .eq(Department::getParentId,"1684107782861680008")
-        );
-        departmentList.forEach((node) -> {
-            voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
-                setId(node.getId().toString());
-                setTreeType(1);
-                setName(node.getName());
-                setParentId("0");
-            }});
-        });
-        majorList.forEach((node)->{
-            voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
-                setId(node.getId().toString());
-                setName(node.getName());
-                setTreeType(2);
-                setParentId(node.getDepartmentId().toString());
-            }});
-            gradeList.forEach((DDD)->{
-                voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
-                    setId(node.getId().toString()+"_"+DDD.getId().toString());
-                    setName(DDD.getName());
-                    setTreeType(3);
-                    setParentId(node.getId().toString());
-                }});
-            });
-        });
-        majorSetList.forEach((node)->{
-            voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
-                setId(node.getClassId().toString());
-                setName(node.getClassName());
-                setTreeType(4);
-                setParentId(node.getMajorId().toString()+"_"+node.getGradeId());
-            }});
-        });
-
-        List<BaseDepMajorGradeClassStudenTreeVo> treeVoList = TreeUtil.build(voList);
-
-        return RT.ok(treeVoList);
+        return RT.ok(studentManagerService.tree2());
     }
 
 

+ 3 - 0
src/main/java/com/xjrsoft/module/student/service/IStudentManagerService.java

@@ -6,6 +6,7 @@ import com.xjrsoft.module.student.dto.AddBaseStudentUserDto;
 import com.xjrsoft.module.student.dto.BaseStudentUserPageDto;
 import com.xjrsoft.module.student.dto.UpdateBaseStudentUserDto;
 import com.xjrsoft.module.student.entity.BaseStudentUser;
+import com.xjrsoft.module.student.vo.BaseDepMajorGradeClassStudenTreeVo;
 import com.xjrsoft.module.student.vo.BaseStudentClassVo;
 import com.xjrsoft.module.student.vo.BaseStudentUserPageVo;
 import com.xjrsoft.module.student.vo.PersonalPortraitPersonalInfoVo;
@@ -63,4 +64,6 @@ public interface IStudentManagerService extends MPJBaseService<BaseStudentUser>
     Page<BaseStudentUserPageVo> getStudentPage(Page<BaseStudentUserPageVo> page, BaseStudentUserPageDto dto);
 
     Boolean uploadImage(Long userId, MultipartFile file) throws IOException;
+
+    List<BaseDepMajorGradeClassStudenTreeVo> tree2();
 }

+ 78 - 17
src/main/java/com/xjrsoft/module/student/service/impl/StudentManagerServiceImpl.java

@@ -20,6 +20,7 @@ import com.xjrsoft.common.enums.RoleEnum;
 import com.xjrsoft.common.enums.YesOrNoEnum;
 import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.common.utils.RedisUtil;
+import com.xjrsoft.common.utils.TreeUtil;
 import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseGrade;
@@ -27,37 +28,27 @@ import com.xjrsoft.module.base.entity.BaseMajorSet;
 import com.xjrsoft.module.base.mapper.BaseClassMapper;
 import com.xjrsoft.module.base.mapper.BaseGradeMapper;
 import com.xjrsoft.module.base.mapper.BaseMajorSetMapper;
+import com.xjrsoft.module.base.service.IBaseClassService;
+import com.xjrsoft.module.base.service.IBaseGradeService;
+import com.xjrsoft.module.organization.entity.Department;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.entity.UserDeptRelation;
 import com.xjrsoft.module.organization.entity.UserRoleRelation;
 import com.xjrsoft.module.organization.mapper.UserDeptRelationMapper;
 import com.xjrsoft.module.organization.mapper.UserRoleRelationMapper;
+import com.xjrsoft.module.organization.service.IDepartmentService;
 import com.xjrsoft.module.organization.service.IUserDeptRelationService;
 import com.xjrsoft.module.organization.service.IUserService;
 import com.xjrsoft.module.student.dto.AddBaseStudentUserDto;
 import com.xjrsoft.module.student.dto.BaseStudentUserPageDto;
 import com.xjrsoft.module.student.dto.UpdateBaseStudentUserDto;
-import com.xjrsoft.module.student.entity.BaseStudent;
-import com.xjrsoft.module.student.entity.BaseStudentContact;
-import com.xjrsoft.module.student.entity.BaseStudentFamily;
-import com.xjrsoft.module.student.entity.BaseStudentFamilyMember;
-import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
-import com.xjrsoft.module.student.entity.BaseStudentSubsidize;
-import com.xjrsoft.module.student.entity.BaseStudentUser;
+import com.xjrsoft.module.student.entity.*;
 import com.xjrsoft.module.student.mapper.BaseStudentFamilyMapper;
 import com.xjrsoft.module.student.mapper.BaseStudentFamilyMemberMapper;
 import com.xjrsoft.module.student.mapper.BaseStudentMapper;
 import com.xjrsoft.module.student.mapper.BaseStudentUserMapper;
-import com.xjrsoft.module.student.service.IBaseStudentContactService;
-import com.xjrsoft.module.student.service.IBaseStudentFamilyService;
-import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
-import com.xjrsoft.module.student.service.IBaseStudentService;
-import com.xjrsoft.module.student.service.IBaseStudentSubsidizeService;
-import com.xjrsoft.module.student.service.IStudentManagerService;
-import com.xjrsoft.module.student.vo.BaseStudentClassVo;
-import com.xjrsoft.module.student.vo.BaseStudentUserPageVo;
-import com.xjrsoft.module.student.vo.PersonalPortraitPersonalInfoVo;
-import com.xjrsoft.module.student.vo.StudentPersonalInfoVo;
+import com.xjrsoft.module.student.service.*;
+import com.xjrsoft.module.student.vo.*;
 import com.xjrsoft.module.system.entity.Area;
 import com.xjrsoft.module.system.entity.DictionaryDetail;
 import com.xjrsoft.module.system.entity.DictionaryItem;
@@ -118,6 +109,14 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
     private final IUserService userService;
     private final CommonPropertiesConfig propertiesConfig;
 
+    private final IDepartmentService baseDeparmentService;
+    private final IBaseMajorService baseMajorService;
+
+
+    private final IBaseClassService baseClassService;
+
+    private final IBaseGradeService baseGradeService;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Long add(AddBaseStudentUserDto dto){
@@ -990,6 +989,68 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
         return true;
     }
 
+    @Override
+    public List<BaseDepMajorGradeClassStudenTreeVo> tree2() {
+        List<BaseDepMajorGradeClassStudenTreeVo> voList = new ArrayList<>();
+        MPJLambdaWrapper<BaseClass> baseClassMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        baseClassMPJLambdaWrapper
+                .selectAs(BaseClass::getId, BaseClassMajorSetVo::getClassId)
+                .selectAs(BaseMajorSet::getMajorId, BaseClassMajorSetVo::getMajorId)
+                .selectAs(BaseClass::getName, BaseClassMajorSetVo::getClassName)
+                .selectAs(BaseClass::getGradeId, BaseClassMajorSetVo::getGradeId)
+                .leftJoin(BaseClassMajorSet.class, BaseClassMajorSet::getClassId, BaseClass::getId)
+                .leftJoin(BaseMajorSet.class, BaseMajorSet::getId, BaseClassMajorSet::getMajorSetId)
+        ;
+
+        List<BaseClassMajorSetVo> majorSetList = baseClassService.selectJoinList(BaseClassMajorSetVo.class, baseClassMPJLambdaWrapper);
+
+
+        List<BaseGrade> gradeList = baseGradeService.list(
+                new QueryWrapper<BaseGrade>().lambda().eq(BaseGrade::getDeleteMark, DeleteMark.NODELETE.getCode())
+        );
+        List<BaseMajor> majorList = baseMajorService.list(
+                new QueryWrapper<BaseMajor>().lambda().eq(BaseMajor::getDeleteMark, DeleteMark.NODELETE.getCode())
+        );
+        List<Department> departmentList =baseDeparmentService.list(
+                new QueryWrapper<Department>().lambda().eq(Department::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(Department::getParentId,"1684107782861680008")
+        );
+        departmentList.forEach((node) -> {
+            voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
+                setId(node.getId().toString());
+                setTreeType(1);
+                setName(node.getName());
+                setParentId("0");
+            }});
+        });
+        majorList.forEach((node)->{
+            voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
+                setId(node.getId().toString());
+                setName(node.getName());
+                setTreeType(2);
+                setParentId(node.getDepartmentId().toString());
+            }});
+            gradeList.forEach((DDD)->{
+                voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
+                    setId(node.getId().toString()+"_"+DDD.getId().toString());
+                    setName(DDD.getName());
+                    setTreeType(3);
+                    setParentId(node.getId().toString());
+                }});
+            });
+        });
+        majorSetList.forEach((node)->{
+            voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
+                setId(node.getClassId().toString());
+                setName(node.getClassName());
+                setTreeType(4);
+                setParentId(node.getMajorId().toString()+"_"+node.getGradeId());
+            }});
+        });
+
+        return TreeUtil.build(voList);
+    }
+
     /**
      * 初始化字典信息
      * 身份证类型、

+ 5 - 5
src/main/resources/sqlScript/20240708_sql.sql

@@ -93,13 +93,13 @@ CREATE TABLE student_cert_table
     class_name         varchar(64)  not null comment '学生班级',
     teacher_id         bigint       NOT NULL COMMENT '教师id',
     teacher_name       varchar(64)  NOT NULL COMMENT '教师姓名',
-    cert_name          varchar(255) NOT NULL COMMENT '证书名称',
-    cert_id            varchar(128) NOT NULL COMMENT '证书编号',
-    cert_grade         varchar(64)  NOT NULL COMMENT '证书等级',
+    cert_name          varchar(512) NOT NULL COMMENT '证书名称',
+    cert_id            varchar(256) NOT NULL COMMENT '证书编号',
+    cert_grade         varchar(64)  NULL COMMENT '证书等级',
     cert_organizations varchar(255) NOT NULL COMMENT '证书发放机构',
-    cert_date          date         NOT NULL COMMENT '证书发放日期',
+    cert_date          date         NULL COMMENT '证书发放日期',
     cert_electronic    varchar(64)  NOT NULL COMMENT '是否支持电子证书(0:否,1:是)',
-    remark             varchar(255) DEFAULT NULL COMMENT '备注',
+    remark             varchar(1024) DEFAULT NULL COMMENT '备注',
     file_id            longtext     NOT NULL COMMENT '附件',
     status             int          NOT NULL COMMENT '状态(1:结束 0:未结束)'
 ) ENGINE = InnoDB

+ 7 - 6
src/main/resources/sqlScript/20240711_sql.sql

@@ -39,8 +39,8 @@ CREATE TABLE `training_protuct`
     `training_number`           varchar(32)  NOT NULL COMMENT '实训室号',
     `department_id`             bigint       NOT NULL COMMENT '所属机构(xjr_department)',
     `department_name`           varchar(255) NOT NULL COMMENT '所属机构',
-    `school_training_base_id`   bigint       NOT NULL COMMENT '所属实训基地id(school_training_base)',
-    `school_training_base_name` varchar(255) NOT NULL COMMENT '所属实训基地',
+    `school_training_base_id`   bigint       NULL COMMENT '所属实训基地id(school_training_base)',
+    `school_training_base_name` varchar(255) NULL COMMENT '所属实训基地',
     `training_createdate`       date         NOT NULL COMMENT '实验室建立日期',
     `contact_id`                bigint       NOT NULL COMMENT '负责人(xjr_user)',
     `contact_name`              varchar(255) NOT NULL COMMENT '负责人',
@@ -73,18 +73,19 @@ create table training_project_safe
     dummy_pro              varchar(25)  not null comment '是否虚拟仿真实训项目',
     skill_request          varchar(255) NULL comment '技能要求',
     assorted_resource_name varchar(512) NULL comment '配套实训资源名称',
-    model_count            int NULL comment '模块数量',
+    model_count            int          NULL comment '模块数量',
     assess_manner          varchar(255) NULL comment '考核方式',
     out_service            varchar(25)  not null comment '是否对外服务',
-    student_class_count    double NULL comment '学生实训课时数',
+    student_class_count    double       NULL comment '学生实训课时数',
     study_year             varchar(255) not null comment '学年(度)',
-    base_semester_id       bigint not null comment '学期id(base_semester)',
+    base_semester_id       bigint       not null comment '学期id(base_semester)',
     base_semester_name     varchar(255) not null comment '学期名称',
     training_address       varchar(255) NULL comment '实训地点',
-    training_protuct_id    bigint NULL comment '校内实训室id',
+    training_protuct_id    bigint       NULL comment '校内实训室id',
     training_protuct_name  varchar(255) NULL comment '校内实训室'
 ) comment '实训项目维护';
 
+-- 实训教学过程
 DROP TABLE IF EXISTS `practical_tt_records`;
 CREATE TABLE `practical_tt_records`
 (

+ 1 - 0
src/main/resources/sqlScript/20240717_sql.sql

@@ -12,6 +12,7 @@ CREATE TABLE party_member_manage
     sort_code         int          null comment '序号',
     party_member_name VARCHAR(36)  not null comment '党员姓名',
     party_member_id   bigint       not null comment '党员编号',
+    party_member_oa   VARCHAR(64)  not null comment '党员oa',
     party_tissue_name VARCHAR(256) not null comment '所属党组织名称',
     party_tissue_code bigint       not null comment '所属党组织编号',
     party_tissue_type varchar(256) not null comment '党组织类型',

+ 3 - 3
src/main/resources/sqlScript/20240718_sql.sql

@@ -81,7 +81,7 @@ CREATE TABLE `party_cadre_study_participant`
 # 10 在线教育网站           party_way10
 # 11 参观学习             party_way11
 # 99 其他                   party_way99
-
+-- 党课管理数据表
 DROP TABLE IF EXISTS party_class_manage;
 CREATE TABLE party_class_manage
 (
@@ -98,7 +98,7 @@ CREATE TABLE party_class_manage
     party_tissue_code         varchar(256) not null comment '党组织编号',
     party_tissue_id           bigint       not null comment '党组织主键id(party_tissue_manager)',
 
-    activity_type             varchar(256) not null comment '活动形式',
+    activity_type             varchar(256) null comment '活动形式',
     speaker_name              varchar(256) null comment '党课主讲人',
 
     start_time                date         not null comment '活动开始时间',
@@ -113,7 +113,7 @@ CREATE TABLE party_class_manage
   DEFAULT CHARSET = utf8mb4
     COMMENT ='党课管理数据表';
 
-
+-- 党课活动参与人表
 DROP TABLE IF EXISTS party_class_manage_participant;
 CREATE TABLE party_class_manage_participant
 (