Przeglądaj źródła

fix:1、作业改造

Joburgess 4 lat temu
rodzic
commit
877f0d4385

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentExtracurricularExercisesSituationDao.java

@@ -38,7 +38,8 @@ public interface StudentExtracurricularExercisesSituationDao extends BaseDAO<Lon
      * @param studentId: 学员编号
      * @return int
      */
-    int deleteByStudent(@Param("studentId") Integer studentId);
+    int deleteByStudent(@Param("studentId") Integer studentId,
+                        @Param("monday") String monday);
 
     List<StudentExercisesSituationDto> findExercisesSituations(Map<String, Object> params);
     int countExercisesSituations(Map<String, Object> params);

+ 7 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -1,6 +1,9 @@
 package com.ym.mec.biz.service.impl;
 
 import java.math.BigDecimal;
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -13,6 +16,7 @@ import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.service.SysConfigService;
 
 import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.util.date.DateUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -577,7 +581,9 @@ public class StudentManageServiceImpl implements StudentManageService {
         student.setTeacherId(student.getTeacherId());
         studentService.upSet(student);
         if (new Integer(2).equals(student.getServiceTag())) {
-            studentExtracurricularExercisesSituationDao.deleteByStudent(student.getId());
+            LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
+            LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
+            studentExtracurricularExercisesSituationDao.deleteByStudent(student.getId(), monDayDate.toString());
         }
         return userId;
     }

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

@@ -180,6 +180,9 @@
 	</delete>
 	<delete id="deleteByStudent">
 		DELETE FROM student_extracurricular_exercises_situation_ WHERE student_id_ = #{studentId}
+		<if test="monday!=null and monday!=''">
+			AND monday_=#{monday}
+		</if>
 	</delete>
 
 	<!-- 分页查询 -->