Selaa lähdekoodia

试读报道报错调整

dzx 8 kuukautta sitten
vanhempi
commit
1d37bbcdd5

+ 2 - 2
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassServiceImpl.java

@@ -499,12 +499,12 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
 
         //女生人数
         List<StudentReportRecordPlanPageVo> femaleList = tryReadingList.stream()
-                .filter(x -> x.getGender() != null && GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender()))
+                .filter(x -> x.getGender() != null && GenderDictionaryEnum.FEMALE.getValue().equals(x.getGender()))
                 .collect(Collectors.toList());
         result.setMaleCount(femaleList.size());
         //男生人数
         List<StudentReportRecordPlanPageVo> maleList = tryReadingList.stream()
-                .filter(x -> x.getGender() != null && GenderDictionaryEnum.MALE.getCode().equals(x.getGender()))
+                .filter(x -> x.getGender() != null && GenderDictionaryEnum.MALE.getValue().equals(x.getGender()))
                 .collect(Collectors.toList());
         result.setFemaleCount(maleList.size());
         //已到人数

+ 7 - 1
src/main/java/com/xjrsoft/module/student/service/impl/StudentReportRecordServiceImpl.java

@@ -16,6 +16,7 @@ import com.xjrsoft.common.enums.RoleEnum;
 import com.xjrsoft.common.enums.StudentChangeTypeEnum;
 import com.xjrsoft.common.enums.StudyStatusEnum;
 import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.common.utils.LocalDateTimeUtil;
 import com.xjrsoft.common.utils.LocalDateUtil;
 import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
@@ -310,6 +311,12 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
     @Transactional(rollbackFor = Exception.class)
     public Boolean tryReadingSign(StudentReportSignDto dto) {
         StudentReportRecord record = this.getById(dto.getId());
+        LocalDateTime now = LocalDateTime.now();
+        StudentReportPlan reportPlan = planMapper.selectById(record.getStudentReportPlanId());
+        if(!LocalDateTimeUtil.isDateTimeInRange(now, reportPlan.getStartTime(), reportPlan.getEndTime())){
+            throw new MyException("不在修改时间内,无法修改");
+        }
+
         BaseNewStudent student = newStudentMapper.selectById(record.getUserId());
         if(record.getReportTime() == null){
             record.setReportTime(new Date());
@@ -343,7 +350,6 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
                 rollService.activateStudent(user.getId());
             }else{
                 LocalDate birthDate = getBirthDate(student.getCredentialNumber());
-                LocalDateTime now = LocalDateTime.now();
                 User xjrUser = new User() {{
                     setCreateDate(now);
                     setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));

+ 1 - 1
src/main/resources/mapper/student/StudentReportRecordMapper.xml

@@ -363,6 +363,6 @@
         <if test="dto.reportTimeStart != null and dto.reportTimeEnd != null">
             and t1.report_time between #{dto.reportTimeStart} and #{dto.reportTimeEnd}
         </if>
-        ORDER BY t1.report_time IS NULL DESC, t1.report_time DESC,t5.name is null,t5.name
+        ORDER BY t5.name IS NULL,t5.name DESC,t1.report_time IS NULL DESC, t1.report_time DESC
     </select>
 </mapper>