Переглянути джерело

Merge remote-tracking branch 'origin/dev' into dev

大数据与最优化研究所 7 місяців тому
батько
коміт
f10d7eb23c

+ 1 - 0
src/main/java/com/xjrsoft/module/job/JianyuekbScheduleTask.java

@@ -387,6 +387,7 @@ public class JianyuekbScheduleTask {
                         .in(!courseAdjustIds.isEmpty(), WfCourseAdjust::getId, courseAdjustIds)
                         .and(wq -> wq.between(WfCourseAdjust::getAdjustDate, startDate, endDate).or().between(WfCourseAdjust::getExchangeDate, startDate, endDate))
                         .eq(WorkflowFormRelation::getCurrentState, HistoricProcessInstance.STATE_COMPLETED)
+                        .eq(WfCourseAdjust::getEnabledMark, EnabledMark.ENABLED.getCode())
         );
         List<WfCourseAdjust> cancelList = new ArrayList<>();//需要作废的申请
 

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

@@ -139,4 +139,7 @@ public class AddBaseStudentSchoolRollDto {
      */
     @ApiModelProperty("备注")
     private String remark;
+
+    @ApiModelProperty("实习状态")
+    private String internshipState;
 }

+ 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/dto/UpdateBaseStudentSchoolRollDto.java

@@ -144,4 +144,7 @@ public class UpdateBaseStudentSchoolRollDto {
      */
     @ApiModelProperty("备注")
     private String remark;
+
+    @ApiModelProperty("实习状态")
+    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;
+
 }

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

@@ -5,8 +5,10 @@ import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.banding.vo.IdManyCountVo;
 import com.xjrsoft.module.outint.vo.IdCountVo;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
+import com.xjrsoft.module.student.dto.BaseStudentSimpleInfoDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
 import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
+import com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo;
 import com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo;
 import com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo;
 import org.apache.ibatis.annotations.Mapper;
@@ -40,4 +42,6 @@ public interface BaseNewStudentMapper extends MPJBaseMapper<BaseNewStudent> {
     List<IdCountVo> getSecondAmbitionStudentCount(@Param("gradeId") Long gradeId, @Param("enrollType") String enrollType);
 
     List<IdManyCountVo> getMajorStudentCount(@Param("id") Long bandingTaskId);
+
+    List<BaseStudentSompleInfoVo> getInfosByParam(@Param("dto") BaseStudentSimpleInfoDto dto);
 }

+ 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);

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

@@ -18,6 +18,7 @@ import com.xjrsoft.module.room.vo.RoomBedInfoVo;
 import com.xjrsoft.module.student.dto.*;
 import com.xjrsoft.module.student.entity.BaseStudent;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
+import com.xjrsoft.module.student.mapper.BaseNewStudentMapper;
 import com.xjrsoft.module.student.mapper.BaseStudentMapper;
 import com.xjrsoft.module.student.mapper.BaseStudentSchoolRollMapper;
 import com.xjrsoft.module.student.mapper.PbSemesterConfigMapper;
@@ -53,6 +54,7 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
     private final UserMapper userMapper;
     private final IStudentChangeRecordService recordService;
     private final BaseStudentMapper baseStudentMapper;
+    private final BaseNewStudentMapper newStudentMapper;
 
 
     @Override
@@ -102,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(),
@@ -114,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(),
@@ -126,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(),
@@ -219,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;
     }
 
@@ -260,6 +275,9 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
     @Override
     public List<BaseStudentSompleInfoVo> getInfosByParam(BaseStudentSimpleInfoDto dto) {
         List<BaseStudentSompleInfoVo> userList = userMapper.getInfosByParam(dto);
+        if(userList.isEmpty()){
+            userList = newStudentMapper.getInfosByParam(dto);
+        }
         return userList;
     }
 

+ 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;
 }

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

@@ -439,4 +439,28 @@
         WHERE t1.delete_mark = 0 and t1.enabled_mark = 1
     </select>
 
+    <select id="getInfosByParam" parameterType="com.xjrsoft.module.student.dto.BaseStudentSimpleInfoDto" resultType="com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo">
+        SELECT t1.id, t1.name AS student_name, t1.enabled_mark, t1.credential_number, t3.name AS class_name,t1.mobile,
+        t1.family_mobile AS parent_mobile,
+        t1.gender,t3.id AS class_id, t3.teacher_id,t6.name AS teacher_name,t6.user_name AS teacher_user_name,t6.mobile AS teacher_mobile,t5.name AS classroom_name,
+        t8.id AS grade_id,t8.name AS grade_name
+        FROM base_new_student t1
+        INNER JOIN banding_task_class_student t2 ON t1.id = t2.new_student_id AND t2.delete_mark = 0
+        INNER JOIN banding_task_class t3 ON t2.banding_task_class_id = t3.id AND t3.delete_mark = 0
+        LEFT JOIN base_classroom t5 ON t3.classroom_id = t5.id
+        LEFT JOIN xjr_user t6 ON t3.teacher_id = t6.id
+        LEFT JOIN banding_task t7 ON t3.banding_task_id = t7.id
+        LEFT JOIN base_grade t8 ON t7.grade_id = t8.id
+        WHERE t1.delete_mark = 0 AND t1.delete_reason IS NULL
+        <if test="dto.keyword != null and dto.keyword != ''">
+            AND (t1.name like concat('%', #{dto.keyword}, '%') OR t1.credential_number like concat('%', #{dto.keyword}, '%'))
+        </if>
+        <if test="dto.name != null and dto.name != '' and dto.idNumber != null and dto.idNumber != ''">
+            AND t1.name = #{dto.name} and t1.credential_number = #{dto.idNumber}
+        </if>
+        <if test="dto.userId != null">
+            AND t1.id = #{dto.userId}
+        </if>
+    </select>
+
 </mapper>

+ 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 - 0
src/main/resources/sqlScript/20250421_sql.sql

@@ -14,3 +14,10 @@ create index user_id_textbook_id_index
 
 # 上面已经在正式服运行-------------------------------------------------------------
 
+
+
+
+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';

+ 1 - 0
src/test/java/com/xjrsoft/module/job/JianyuekbScheduleTaskTest.java

@@ -386,6 +386,7 @@ class JianyuekbScheduleTaskTest {
                         .in(!courseAdjustIds.isEmpty(), WfCourseAdjust::getId, courseAdjustIds)
                         .and(wq -> wq.between(WfCourseAdjust::getAdjustDate, startDate, endDate).or().between(WfCourseAdjust::getExchangeDate, startDate, endDate))
                         .eq(WorkflowFormRelation::getCurrentState, HistoricProcessInstance.STATE_COMPLETED)
+                        .eq(WfCourseAdjust::getEnabledMark, EnabledMark.ENABLED.getCode())
         );
         List<WfCourseAdjust> cancelList = new ArrayList<>();//需要作废的申请