zouxuan 5 éve
szülő
commit
d8f1700a6d

+ 4 - 6
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/config/WebMvcConfig.java

@@ -1,8 +1,7 @@
 package com.ym.mec.auth.config;
 
-import java.util.ArrayList;
-import java.util.List;
-
+import com.ym.mec.common.config.EnumConverterFactory;
+import com.ym.mec.common.config.LocalFastJsonHttpMessageConverter;
 import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -10,8 +9,8 @@ import org.springframework.format.FormatterRegistry;
 import org.springframework.http.MediaType;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
-import com.ym.mec.common.config.EnumConverterFactory;
-import com.ym.mec.common.config.LocalFastJsonHttpMessageConverter;
+import java.util.ArrayList;
+import java.util.List;
 
 @Configuration
 public class WebMvcConfig implements WebMvcConfigurer {
@@ -32,5 +31,4 @@ public class WebMvcConfig implements WebMvcConfigurer {
         converter.setSupportedMediaTypes(fastMediaTypes);
         return new HttpMessageConverters(converter);
     }
-
 }

+ 0 - 74
mec-biz/src/main/java/com/ym/mec/biz/dal/aspects/UserLog.java

@@ -1,74 +0,0 @@
-package com.ym.mec.biz.dal.aspects;
-
-import com.alibaba.fastjson.JSONObject;
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.common.exception.BizException;
-import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Before;
-import org.aspectj.lang.annotation.Pointcut;
-import org.aspectj.lang.reflect.MethodSignature;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import java.lang.reflect.Method;
-
-@Aspect
-@Component
-public class UserLog {
-
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
-
-    @Pointcut("@annotation(com.ym.mec.biz.dal.aspects.UserLogAnnotation)")
-    public void userLogPoint(){
-    }
-
-    @Before("userLogPoint()")
-    public void saveUserLog(JoinPoint joinPoint){
-        //从切面织入点处通过反射机制获取织入点处的方法
-        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
-        //获取切入点所在的方法
-        Method method = signature.getMethod();
-        UserLogAnnotation logAnnotation = method.getAnnotation(UserLogAnnotation.class);
-        String operationType = "";
-        String describe = "";
-        if(logAnnotation != null){
-            describe = logAnnotation.describe();
-            operationType = logAnnotation.operationType();
-        }
-        //获取请求的类名
-        String className = joinPoint.getTarget().getClass().getName();
-        //获取请求的方法名
-        String methodName = method.getName();
-        //请求的参数
-        Object[] args = joinPoint.getArgs();
-        Object[] arguments  = new Object[args.length];
-        for (int i = 0; i < args.length; i++) {
-            if (args[i] instanceof ServletRequest || args[i] instanceof ServletResponse || args[i] instanceof MultipartFile) {
-                //ServletRequest不能序列化,从入参里排除,否则报异常:java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
-                //ServletResponse不能序列化 从入参里排除,否则报异常:java.lang.IllegalStateException: getOutputStream() has already been called for this response
-                continue;
-            }
-            arguments[i] = args[i];
-        }
-        //将参数所在的数组转换成json
-        String params = "";
-        if (arguments != null) {
-            try {
-                params = JSONObject.toJSONString(arguments);
-            } catch (Exception e) {
-                params = arguments.toString();
-            }
-        }
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if(sysUser == null){
-            throw new BizException("获取用户信息失败");
-        }
-        System.out.println("记录用户操作日志: {}" + params);
-    }
-}

+ 0 - 16
mec-biz/src/main/java/com/ym/mec/biz/dal/aspects/UserLogAnnotation.java

@@ -1,16 +0,0 @@
-package com.ym.mec.biz.dal.aspects;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface UserLogAnnotation {
-    //操作类型
-    String operationType() default "";
-
-    //操作描述
-    String describe() default "";
-}

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -294,6 +294,10 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             return;
         }
         Date now = new Date();
+        Date date = DateUtil.addMonths(now, -1);
+        Date startDate = DateUtil.getFirstDayOfMonth(date);
+        Date endDate = DateUtil.getLastDayOfMonth(date);
+        vipGroupService.updateHistoryTeacherSalaryOfOnline(startDate, endDate);
         //获取未结算课程编号列表
         List<Long> courseScheduleIds = someDayAgoTeacherCourseSalaryNoSettlement.stream().map(CourseScheduleTeacherSalary::getCourseScheduleId).collect(Collectors.toList());