dzx 7 місяців тому
батько
коміт
5c8b21fa75

+ 3 - 0
src/main/java/com/xjrsoft/module/student/dto/UpdateBaseStudentInfoDto.java

@@ -36,4 +36,7 @@ public class UpdateBaseStudentInfoDto implements Serializable {
 
     @ApiModelProperty("学生userIds")
     private List<Long> userIds;
+
+    @ApiModelProperty("实习状态(xjr_dictionary_item[internship_state])")
+    private String internshipState;
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/entity/BaseStudentSchoolRoll.java

@@ -203,4 +203,7 @@ public class BaseStudentSchoolRoll implements Serializable {
     @ApiModelProperty("学习形式")
     private String rollModality;
 
+    @ApiModelProperty("实习状态(xjr_dictionary_item[internship_state])")
+    private String internshipState;
+
 }

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

@@ -46,6 +46,8 @@ public interface BaseStudentSchoolRollMapper extends MPJBaseMapper<BaseStudentSc
      */
     List<BaseStudentInfoCategoryVo> getStudyStatusCount(@Param("dto") BaseStudentInfoPageDto dto);
 
+    List<BaseStudentInfoCategoryVo> getInternshipStateCount(@Param("dto") BaseStudentInfoPageDto dto);
+
 
     @Update("UPDATE base_student_school_roll SET class_id = #{classId},major_set_id=#{majorSetId} where user_id = #{userId}")
     Boolean updateStudentClass1(Long classId, Long majorSetId, Long userId);

+ 16 - 3
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentSchoolRollServiceImpl.java

@@ -104,7 +104,7 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
     public Boolean updateInfo(UpdateBaseStudentInfoDto dto) {
         for (Long id : dto.getUserIds()) {
             BaseStudentSchoolRoll schoolRoll = this.getOne(new QueryWrapper<BaseStudentSchoolRoll>().lambda().eq(BaseStudentSchoolRoll::getUserId, id));
-            if (!dto.getStduyStatus().equals(schoolRoll.getStduyStatus())) {
+            if (dto.getStduyStatus() !=null && !dto.getStduyStatus().equals(schoolRoll.getStduyStatus())) {
                 recordService.insertData(
                         StudyStatusEnum.fromCode(schoolRoll.getStduyStatus()),
                         schoolRoll.getStduyStatus(),
@@ -116,7 +116,7 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
                         2
                 );
             }
-            if (!dto.getRollModality().equals(schoolRoll.getLearnStatus())) {
+            if (dto.getRollModality() !=null && !dto.getRollModality().equals(schoolRoll.getLearnStatus())) {
                 recordService.insertData(
                         RollModalityEnum.fromCode(schoolRoll.getLearnStatus()),
                         schoolRoll.getLearnStatus(),
@@ -128,7 +128,7 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
                         2
                 );
             }
-            if (schoolRoll.getArchivesStatus() != null && !schoolRoll.getArchivesStatus().equals(dto.getArchivesStatus())) {
+            if (dto.getArchivesStatus() !=null && schoolRoll.getArchivesStatus() != null && !schoolRoll.getArchivesStatus().equals(dto.getArchivesStatus())) {
                 recordService.insertData(
                         ArchivesStatusEnum.fromCode(schoolRoll.getArchivesStatus()),
                         schoolRoll.getArchivesStatus(),
@@ -221,6 +221,19 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
         result.setStayCount(stayCount);
         result.setNotStayCount(notStayCount);
 
+        List<BaseStudentInfoCategoryVo> internshipStateCount = baseStudentSchoolRollMapper.getInternshipStateCount(dto);
+        int internshipCount = 0;
+        int atSchoolCount = 0;
+        for (BaseStudentInfoCategoryVo categoryVo : internshipStateCount) {
+            if ("IT-0001".equals(categoryVo.getCategory())) {
+                atSchoolCount = atSchoolCount + categoryVo.getNumber();
+            } else if ("IT-0002".equals(categoryVo.getCategory())) {
+                internshipCount = internshipCount + categoryVo.getNumber();
+            }
+        }
+        result.setAtSchoolCount(atSchoolCount);
+        result.setInternshipCount(internshipCount);
+
         return result;
     }
 

+ 8 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentInfoPageDataVo.java

@@ -49,4 +49,12 @@ public class BaseStudentInfoPageDataVo {
     @ApiModelProperty("走读女生人数")
     private Integer femaleNotStayCount;
 
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("在校学习人数")
+    private Integer atSchoolCount;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("外出实习人数")
+    private Integer internshipCount;
+
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentInfoPageVo.java

@@ -123,4 +123,7 @@ public class BaseStudentInfoPageVo {
 
     @ApiModelProperty("身份证号")
     private String credentialNumber;
+
+    @ApiModelProperty("实习状态")
+    private String internshipStateCn;
 }

+ 36 - 0
src/main/resources/mapper/student/BaseStudentSchoolRollMapper.xml

@@ -32,6 +32,7 @@
             t13.name AS roll_modality,
             t11.name AS student_form,
             t2.credential_number,
+            t17.name as internship_state_cn,
         CONCAT(t16.name, ' ', t15.room_name, ' ', t14.bed_number) AS bed_info
         FROM base_student t1
         INNER JOIN xjr_user t2 ON t1.user_id = t2.id
@@ -48,6 +49,7 @@
         LEFT JOIN room_bed t14 ON t14.student_user_id = t2.id
         LEFT JOIN room t15 ON t14.room_id = t15.id
         LEFT JOIN base_office_build t16 ON t15.office_build_id = t16.id
+        LEFT JOIN xjr_dictionary_detail t17 ON t3.internship_state = t17.code
         WHERE t2.delete_mark = 0
         AND t1.delete_mark = 0 and t1.is_normal = 1
         AND t3.archives_status = 'FB2901'
@@ -198,6 +200,40 @@
         group by t3.stduy_status,t2.gender
     </select>
 
+    <select id="getInternshipStateCount" parameterType="com.xjrsoft.module.student.dto.BaseStudentInfoPageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentInfoCategoryVo">
+        SELECT t3.internship_state as category,COUNT(*) as number FROM base_student t1
+        INNER JOIN xjr_user t2 ON t1.user_id = t2.id
+        INNER JOIN base_student_school_roll t3 ON t1.user_id = t3.user_id
+        LEFT JOIN base_class t4 ON t3.class_id = t4.id
+        LEFT JOIN xjr_user t5 ON t4.teacher_id = t5.id
+        LEFT JOIN base_student_family_member t6 ON t6.user_id = t2.id AND t6.delete_mark = 0 AND t6.is_guardian = 1
+        WHERE t2.delete_mark = 0
+        AND t1.delete_mark = 0 and t1.is_normal = 1
+        and t3.archives_status = 'FB2901'
+        <if test="dto.gradeId != null">
+            and t4.grade_id = #{dto.gradeId}
+        </if>
+        <if test="dto.majorSetId != null">
+            and t3.major_set_id = #{dto.majorSetId}
+        </if>
+        <if test="dto.classId != null">
+            and t4.id = #{dto.classId}
+        </if>
+        <if test="dto.teacherId != null">
+            and t4.teacher_id = #{dto.teacherId}
+        </if>
+        <if test="dto.keyWord != null and dto.keyWord != ''">
+            and (t4.name like concat('%', #{dto.keyWord}, '%')
+            or t2.name like concat('%', #{dto.keyWord}, '%')
+            or t5.name like concat('%', #{dto.keyWord}, '%')
+            or t1.student_id like concat('%', #{dto.keyWord}, '%')
+            or t2.mobile like concat('%', #{dto.keyWord}, '%')
+            or t6.mobile LIKE concat('%', #{dto.keyWord}, '%')
+            )
+        </if>
+        group by t3.internship_state
+    </select>
+
     <select id="getClassNameByUserId" resultType="java.lang.String">
         SELECT t1.name FROM base_class t1
         INNER JOIN base_student_school_roll t2 ON t1.id = t2.class_id

+ 7 - 1
src/main/resources/sqlScript/20250421_sql.sql

@@ -1 +1,7 @@
-ALTER TABLE professional_title ADD UNIQUE (professional_title_no);
+ALTER TABLE professional_title ADD UNIQUE (professional_title_no);
+
+
+ALTER TABLE base_student_school_roll
+  ADD COLUMN internship_state VARCHAR (20) NULL COMMENT '实习状态(xjr_dictionary_item[internship_state])' AFTER candidate_number;
+
+UPDATE base_student_school_roll SET internship_state = 'IT_0001' WHERE archives_status = 'FB2901';