dzx преди 7 месеца
родител
ревизия
5b4fe5a768

+ 42 - 1
src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java

@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xjrsoft.common.annotation.XjrLog;
 import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.model.result.RT;
@@ -30,7 +31,6 @@ import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.entity.UserRoleRelation;
 import com.xjrsoft.module.organization.service.IUserRoleRelationService;
 import com.xjrsoft.module.organization.service.IUserService;
-import com.xjrsoft.module.room.entity.RoomBed;
 import com.xjrsoft.module.student.dto.ActiveAccountDto;
 import com.xjrsoft.module.student.dto.AddBaseNewStudentDto;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
@@ -42,6 +42,7 @@ import com.xjrsoft.module.student.entity.BaseStudentFamilyMember;
 import com.xjrsoft.module.student.service.IBaseNewStudentService;
 import com.xjrsoft.module.student.service.IBaseStudentFamilyMemberService;
 import com.xjrsoft.module.student.vo.BaseNewStudentExportVo;
+import com.xjrsoft.module.student.vo.BaseNewStudentListExcelVo;
 import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
 import com.xjrsoft.module.student.vo.BaseNewStudentScoreExcelVo;
 import com.xjrsoft.module.student.vo.BaseNewStudentTreeVo;
@@ -425,4 +426,44 @@ public class BaseNewStudentController {
         return RT.ok(true);
     }
 
+
+    @PostMapping(value = "/export-query")
+    @ApiOperation(value="新生信息导出")
+    @SaCheckPermission("basenewstudent:detail")
+    @XjrLog(value = "新生信息导出")
+    public ResponseEntity<byte[]> exportQuerty(@Valid @RequestBody BaseNewStudentPageDto dto){
+        List<BaseNewStudentListExcelVo> dataList = new ArrayList<>();
+
+        List<BaseNewStudentPageVo> list = baseNewStudentService.getList(dto);
+
+        int sortCode = 1;
+        for (BaseNewStudentPageVo pageVo : list) {
+            BaseNewStudentListExcelVo excelVo = BeanUtil.toBean(pageVo, BaseNewStudentListExcelVo.class);
+            excelVo.setSortCode(sortCode);
+            if(pageVo.getStatus() != null && pageVo.getStatus() == 1){
+                excelVo.setClassState("是");
+            }else{
+                excelVo.setClassState("否");
+            }
+            if(pageVo.getIsCanBanding() != null && pageVo.getIsCanBanding() == 1){
+                excelVo.setCanBandingState("是");
+            }else{
+                excelVo.setCanBandingState("否");
+            }
+            if(pageVo.getOperateMode() != null && pageVo.getOperateMode() == 1){
+                excelVo.setOperateMode("自动分班");
+            }else if(pageVo.getOperateMode() != null && pageVo.getOperateMode() == 0){
+                excelVo.setCanBandingState("手动分班");
+            }
+
+            dataList.add(excelVo);
+
+            sortCode ++;
+        }
+        ByteArrayOutputStream bot = new ByteArrayOutputStream();
+        EasyExcel.write(bot, BaseNewStudentListExcelVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(dataList);
+        String fileName = "exportQuerty" + ExcelTypeEnum.XLSX.getValue();
+        return RT.fileStream(bot.toByteArray(), fileName);
+    }
+
 }

+ 2 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseNewStudentMapper.java

@@ -25,6 +25,8 @@ public interface BaseNewStudentMapper extends MPJBaseMapper<BaseNewStudent> {
 
     Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
 
+    List<BaseNewStudentPageVo> getList(@Param("dto") BaseNewStudentPageDto dto);
+
     Page<BaseNewStudentPageVo> getReportPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
 
     List<BaseNewStudentPageVo> getReportList(@Param("dto") BaseNewStudentPageDto dto);

+ 2 - 0
src/main/java/com/xjrsoft/module/student/service/IBaseNewStudentService.java

@@ -28,6 +28,8 @@ public interface IBaseNewStudentService extends MPJBaseService<BaseNewStudent> {
 
     Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
 
+    List<BaseNewStudentPageVo> getList(BaseNewStudentPageDto dto);
+
     Page<BaseNewStudentPageVo> getReportPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
 
     List<BaseNewStudentPageVo> getReportList(BaseNewStudentPageDto dto);

+ 121 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentListExcelVo.java

@@ -0,0 +1,121 @@
+package com.xjrsoft.module.student.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @title: 新生维护信息分页列表出参
+ * @Author dzx
+ * @Date: 2024-06-27
+ * @Version 1.0
+ */
+@Data
+public class BaseNewStudentListExcelVo {
+
+    @ExcelProperty("序号")
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+
+    @ExcelProperty("状态")
+    @ApiModelProperty("状态")
+    private String canBandingState;
+
+    @ExcelProperty("学生姓名")
+    @ApiModelProperty("学生姓名")
+    private String name;
+
+    @ExcelProperty("性别")
+    @ApiModelProperty("性别")
+    private String genderCn;
+
+    @ExcelProperty("身份证号")
+    @ApiModelProperty("身份证号")
+    private String credentialNumber;
+
+    @ExcelProperty("班级状态")
+    @ApiModelProperty("班级状态")
+    private String classState;
+
+    @ExcelProperty("在读班级班名称")
+    @ApiModelProperty("在读班级班名称")
+    private String className;
+
+    @ExcelProperty("在读班级班主任")
+    @ApiModelProperty("在读班级班主任")
+    private String teacherName;
+
+    @ExcelProperty("分班类型")
+    @ApiModelProperty("分班类型")
+    private String operateMode;
+
+    @ExcelProperty("分班班级")
+    @ApiModelProperty("分班班级")
+    private String bandingClassName;
+
+    @ExcelProperty("分班班主任")
+    @ApiModelProperty("分班班主任")
+    private String bandingTeacherName;
+
+    @ExcelProperty("毕业学校")
+    @ApiModelProperty("毕业学校")
+    private String graduateSchool;
+
+    @ExcelProperty("身高")
+    @ApiModelProperty("身高")
+    private String height;
+
+    @ExcelProperty("体重")
+    @ApiModelProperty("体重")
+    private String weight;
+
+    @ExcelProperty("成绩")
+    @ApiModelProperty("成绩")
+    private String score;
+
+    @ExcelProperty("毕业班级")
+    @ApiModelProperty("毕业班级")
+    private String graduateClass;
+
+    @ExcelProperty("学生来源")
+    @ApiModelProperty("学生来源")
+    private String sourceCn;
+
+    @ExcelProperty("住宿类型")
+    @ApiModelProperty("住宿类型")
+    private String stduyStatusCn;
+
+    @ExcelProperty("手机号")
+    @ApiModelProperty("手机号")
+    private String mobile;
+
+    @ExcelProperty("第一志愿")
+    @ApiModelProperty("第一志愿")
+    private String firstAmbition;
+
+    @ExcelProperty("第二志愿")
+    @ApiModelProperty("第二志愿")
+    private String secondAmbition;
+
+    @ExcelProperty("缴费状态")
+    @ApiModelProperty("缴费状态")
+    private String paymnystate;
+
+    @ExcelProperty("是否往届生")
+    @ApiModelProperty("是否往届生")
+    private String previous;
+
+    @ExcelProperty("户籍所属省")
+    @ApiModelProperty("户籍所属省")
+    private String province;
+
+    @ExcelProperty("户籍所属市")
+    @ApiModelProperty("户籍所属市")
+    private String city;
+
+    @ExcelProperty("户籍所属区")
+    @ApiModelProperty("户籍所属区")
+    private String myarea;
+
+
+}

+ 103 - 0
src/main/resources/mapper/student/BaseNewStudentMapper.xml

@@ -106,6 +106,109 @@
             </if>
         </if>
     </select>
+    <select id="getList" parameterType="com.xjrsoft.module.student.dto.BaseNewStudentPageDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
+        SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
+        t1.score,t1.graduate_class,t1.source,t5.name AS source_cn,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t7.name AS first_ambition,
+        t8.name AS second_ambition,t1.is_adjust,t1.status,IFNULL(t11.name,t1.delete_reason) AS class_name,t12.name AS teacher_name,
+        t1.paymnystate,t1.userdef6,t1.previous,t1.province,t1.city,t1.myarea,t1.remarks,t1.is_can_banding,t1.operate_mode,
+        t14.name AS banding_class_name,t15.name AS banding_teacher_name FROM base_new_student t1
+        LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
+        LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
+        LEFT JOIN xjr_dictionary_detail t5 ON t1.source = t5.code AND t5.item_id = 2023000000000000028
+        LEFT JOIN enrollment_plan t4 ON t1.enrollment_plan_id = t4.id
+        LEFT JOIN base_major_set t7 ON t1.first_ambition = t7.id
+        LEFT JOIN base_major_set t8 ON t1.second_ambition = t8.id
+        LEFT JOIN xjr_user t9 ON t1.credential_number = t9.credential_number AND t9.delete_mark = 0
+        LEFT JOIN base_student_school_roll t10 ON t9.id = t10.user_id AND t10.delete_mark = 0
+        LEFT JOIN base_class t11 ON t10.class_id = t11.id
+        LEFT JOIN xjr_user t12 ON t11.teacher_id = t12.id
+        LEFT JOIN banding_task_class_student t13 ON t1.id = t13.new_student_id AND t13.delete_mark = 0 AND t13.status = 1
+        LEFT JOIN banding_task_class t14 ON t13.banding_task_class_id = t14.id AND t14.delete_mark = 0
+        LEFT JOIN xjr_user t15 ON t14.teacher_id = t15.id
+        WHERE t1.delete_mark = 0
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name}, '%')
+        </if>
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            and t1.credential_number like concat('%', #{dto.credentialNumber}, '%')
+        </if>
+        <if test="dto.graduateSchool != null and dto.graduateSchool != ''">
+            and t1.graduate_school like concat('%', #{dto.graduateSchool}, '%')
+        </if>
+        <if test="dto.isImportScore != null">
+            <if test="dto.isImportScore == 1">
+                and t1.score is not null
+            </if>
+            <if test="dto.isImportScore == 0">
+                and t1.score is null
+            </if>
+        </if>
+        <if test="dto.firstAmbition != null and dto.firstAmbition != ''">
+            and t1.first_ambition = #{dto.firstAmbition}
+        </if>
+        <if test="dto.secondAmbition != null and dto.secondAmbition != ''">
+            and t1.second_ambition = #{dto.secondAmbition}
+        </if>
+
+        <if test="dto.startDate != null and dto.endDate != null">
+            AND t1.create_date between #{dto.startDate} and #{dto.endDate}
+        </if>
+        <if test="dto.gender != null and dto.gender != ''">
+            AND t1.gender = #{dto.gender}
+        </if>
+        <if test="dto.teacherName != null and dto.teacherName != ''">
+            AND t12.name like concat('%', #{dto.teacherName}, '%')
+        </if>
+        <if test="dto.gender != null and dto.gender != ''">
+            AND t1.gender = #{dto.gender}
+        </if>
+        <if test="dto.status != null">
+            AND t1.status = #{dto.status}
+        </if>
+        <if test="dto.isAdjust != null">
+            AND t1.is_adjust = #{dto.isAdjust}
+        </if>
+        <if test="dto.enrollmentPlanId != null">
+            AND t1.enrollment_plan_id = #{dto.enrollmentPlanId}
+        </if>
+
+        <if test="dto.isCanBanding != null">
+            and t1.is_can_banding = #{dto.isCanBanding}
+        </if>
+        <if test="dto.operateMode != null">
+            and t1.operate_mode = #{dto.operateMode}
+        </if>
+        <if test="dto.paymnystate != null and dto.paymnystate != ''">
+            AND t1.paymnystate = #{dto.paymnystate}
+        </if>
+        <if test="dto.previous != null and dto.previous != ''">
+            AND t1.previous = #{dto.previous}
+        </if>
+        <if test="dto.city != null and dto.city != ''">
+            AND (
+            t1.province like concat('%', #{dto.city}, '%')
+            or t1.city like concat('%', #{dto.city}, '%')
+            or t1.myarea like concat('%', #{dto.city}, '%')
+            )
+        </if>
+
+        <if test="dto.treeId != null and dto.treeType != null">
+            <if test="dto.treeType == 1">
+                AND t4.grade_id = #{dto.treeId}
+            </if>
+            <if test="dto.treeType == 2">
+                AND t4.enroll_type = #{dto.treeId}
+            </if>
+        </if>
+        <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+            <if test="dto.order == 'descend'">
+                order by t1.score desc
+            </if>
+            <if test="dto.order == 'ascend'">
+                order by t1.score asc
+            </if>
+        </if>
+    </select>
     <select id="getReportPage" parameterType="com.xjrsoft.module.student.dto.BaseNewStudentPageDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
         SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,t1.family_mobile,
         t1.score,t1.graduate_class,t1.source,t5.name as source_cn,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t7.name as first_ambition,