Explorar el Código

Merge remote-tracking branch 'origin/master'

zouxuan hace 4 años
padre
commit
18614e486c

+ 2 - 16
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesMessageServiceImpl.java

@@ -85,22 +85,8 @@ public class ExtracurricularExercisesMessageServiceImpl extends BaseServiceImpl<
 				}
 				if(change){
 					extracurricularExercisesReplyDao.update(extracurricularExercisesReply);
-					LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
-					LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
-					LocalDate createDateTime = LocalDateTime.ofInstant(extracurricularExercisesReply.getCreateTime().toInstant(), DateUtil.zoneId).toLocalDate();
-					LocalDate createMonday = createDateTime.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
-					if(createDateTime.isBefore(monDayDate)){
-						StudentExtracurricularExercisesSituation studentExercisesSituation = studentExtracurricularExercisesSituationDao.findStudentExercisesSituationsWithMonDay(createMonday.toString(), extracurricularExercisesReply.getUserId());
-						if(Objects.nonNull(studentExercisesSituation)){
-							if(new Integer(1).equals(extracurricularExercisesReply.getIsReplied())){
-								studentExercisesSituation.setExercisesMessageNum(1);
-							}
-							if(new Integer(1).equals(extracurricularExercisesReply.getIsRepliedTimely())){
-								studentExercisesSituation.setExercisesMessageTimelyNum(1);
-							}
-							studentExtracurricularExercisesSituationDao.update(studentExercisesSituation);
-						}
-					}
+
+					studentServeService.updateExercisesSituation(new Date(), new ArrayList<>(Arrays.asList(extracurricularExercisesReply.getUserId())), extracurricularExercisesMessage.getUserId());
 				}
 			}
 

+ 0 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesReplyServiceImpl.java

@@ -155,14 +155,6 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 		LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
 		LocalDate createDateTime = LocalDateTime.ofInstant(existExtra.getCreateTime().toInstant(), DateUtil.zoneId).toLocalDate();
 		LocalDate createMonday = createDateTime.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
-//		if(createDateTime.isBefore(monDayDate)){
-//			StudentExtracurricularExercisesSituation studentExercisesSituation = studentExtracurricularExercisesSituationDao.findStudentExercisesSituationsWithMonDay(createMonday.toString(), existExtra.getUserId());
-//			if(Objects.nonNull(studentExercisesSituation)){
-//				studentExercisesSituation.setExercisesReplyNum(1);
-//				studentExercisesSituation.setLastSubmitTime(now);
-//				studentExtracurricularExercisesSituationDao.update(studentExercisesSituation);
-//			}
-//		}
 
 		int submitStudentNum=extracurricularExercisesReplyDao.countIsSubmitStudents(existExtra.getExtracurricularExercisesId());
 		extracurricularExercises.setCompletedNum(submitStudentNum);

+ 1 - 18
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCourseHomeworkServiceImpl.java

@@ -140,14 +140,6 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
                 }
                 break;
         }
-//        if(createDateTime.isBefore(monDayDate)&&isOk){
-//            StudentExtracurricularExercisesSituation studentExercisesSituation = studentExtracurricularExercisesSituationDao.findStudentExercisesSituationsWithMonDay(createMonday.toString(), existHomework.getUserId());
-//            if(Objects.nonNull(studentExercisesSituation)){
-//                studentExercisesSituation.setExercisesReplyNum(1);
-//                studentExercisesSituation.setLastSubmitTime(now);
-//                studentExtracurricularExercisesSituationDao.update(studentExercisesSituation);
-//            }
-//        }
 
         studentServeService.updateExercisesSituation(courseSchedule.getClassDate(), new ArrayList<>(Arrays.asList(bean.getUserId())), courseSchedule.getTeacherId());
 
@@ -261,16 +253,7 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
                     break;
             }
             if(createDateTime.isBefore(monDayDate)&&isOk){
-                StudentExtracurricularExercisesSituation studentExercisesSituation = studentExtracurricularExercisesSituationDao.findStudentExercisesSituationsWithMonDay(createMonday.toString(), byStudentAndCourseHomewok.getUserId());
-                if(Objects.nonNull(studentExercisesSituation)){
-                    if(YesOrNoEnum.YES.equals(byStudentAndCourseHomewok.getIsReplied())){
-                        studentExercisesSituation.setExercisesMessageNum(1);
-                    }
-                    if(new Integer(1).equals(byStudentAndCourseHomewok.getIsRepliedTimely())){
-                        studentExercisesSituation.setExercisesMessageTimelyNum(1);
-                    }
-                    studentExtracurricularExercisesSituationDao.update(studentExercisesSituation);
-                }
+                studentServeService.updateExercisesSituation(new Date(), new ArrayList<>(Arrays.asList(byStudentAndCourseHomewok.getUserId())), teacherId);
             }
         }
         return true;

+ 10 - 0
mec-common/audit-log/src/main/java/com/yonge/log/dal/model/AuditLog.java

@@ -30,6 +30,16 @@ public class AuditLog implements Serializable {
 
 	private String token;
 
+	private String service;
+
+	public String getService() {
+		return service;
+	}
+
+	public void setService(String service) {
+		this.service = service;
+	}
+
 	public static long getSerialVersionUID() {
 		return serialVersionUID;
 	}

+ 3 - 0
mec-common/audit-log/src/main/java/com/yonge/log/interceptor/AuditLogInterceptor.java

@@ -15,6 +15,8 @@ import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
 import org.springframework.web.method.HandlerMethod;
 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
 
@@ -60,6 +62,7 @@ public class AuditLogInterceptor extends HandlerInterceptorAdapter {
 				auditLog.setInterfaceUrl(request.getRequestURI());
 			}
 			auditLog.setToken(request.getHeader("Authorization"));
+			auditLog.setService(clientName);
 			auditLog.setUserIp(WebUtil.getRemoteIp(request));
 
 			Map<String, Object> params = WebUtil.getParameterMap(request);

+ 0 - 1
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

@@ -141,7 +141,6 @@ public class VipGroupManageController extends BaseController {
     @ApiOperation(value = "全查询")
     @GetMapping("/queryAll")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/queryAll')")
-    @AuditLogAnnotation(operateName = "全查询")
     public Object queryAll(VipGroupQueryInfo queryInfo) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {