diff --git a/pom.xml b/pom.xml index 03da5bf..ffc86d2 100644 --- a/pom.xml +++ b/pom.xml @@ -31,6 +31,8 @@ 5.2.0 5.4.1 3.10.3 + 3.3.0 + 3.2.2 @@ -132,11 +134,11 @@ ${swagger2.version} - - com.amdelamar - jhash - ${jhash.version} - + + + + + org.apache.poi @@ -190,6 +192,40 @@ jlatexmath 1.0.7 + + + org.springframework.boot + spring-boot-starter-data-redis + + + + org.springframework.boot + spring-boot-starter-quartz + + + + redis.clients + jedis + ${jedis.version} + + + + commons-collections + commons-collections + ${collections.version} + + + + + org.springframework.boot + spring-boot-starter-websocket + + + + + + + @@ -198,6 +234,7 @@ org.springframework.boot spring-boot-maven-plugin + 2.2.6.RELEASE diff --git a/src/main/java/com/subsidy/MeishuApplication.java b/src/main/java/com/subsidy/MeishuApplication.java index d863709..f94c800 100644 --- a/src/main/java/com/subsidy/MeishuApplication.java +++ b/src/main/java/com/subsidy/MeishuApplication.java @@ -1,11 +1,8 @@ package com.subsidy; -import com.alibaba.druid.support.http.StatViewServlet; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.servlet.ServletRegistrationBean; -import org.springframework.context.annotation.Bean; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.web.bind.annotation.RestController; @@ -21,19 +18,19 @@ public class MeishuApplication { SpringApplication.run(MeishuApplication.class, args); } - @Bean - public ServletRegistrationBean druidStatViewServlet() { - //先配置管理后台的servLet,访问的入口为/druid/ - ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean( - new StatViewServlet(), "/druid/*"); - // IP白名单 (没有配置或者为空,则允许所有访问) - servletRegistrationBean.addInitParameter("allow", "127.0.0.1"); - // IP黑名单 (存在共同时,deny优先于allow) - servletRegistrationBean.addInitParameter("deny", ""); - servletRegistrationBean.addInitParameter("loginUsername", "admin"); - servletRegistrationBean.addInitParameter("loginPassword", "yhkl1234"); - servletRegistrationBean.addInitParameter("resetEnable", "false"); - return servletRegistrationBean; - } + //@Bean + //public ServletRegistrationBean druidStatViewServlet() { + // //先配置管理后台的servLet,访问的入口为/druid/ + // ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean( + // new StatViewServlet(), "/druid/*"); + // // IP白名单 (没有配置或者为空,则允许所有访问) + // servletRegistrationBean.addInitParameter("allow", "127.0.0.1"); + // // IP黑名单 (存在共同时,deny优先于allow) + // servletRegistrationBean.addInitParameter("deny", ""); + // servletRegistrationBean.addInitParameter("loginUsername", "admin"); + // servletRegistrationBean.addInitParameter("loginPassword", "yhkl1234"); + // servletRegistrationBean.addInitParameter("resetEnable", "false"); + // return servletRegistrationBean; + //} } diff --git a/src/main/java/com/subsidy/common/Code.java b/src/main/java/com/subsidy/common/Code.java deleted file mode 100644 index 91afe9e..0000000 --- a/src/main/java/com/subsidy/common/Code.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.subsidy.common; - -public enum Code { - - USERNAMENOTFOUND(10001, "用户不存在"), - BADCREDENTIALS(10002,"账户或者密码错误"), - ACCOUNTEXPIRED(10003,"账户过期"), - LOCKEDEXCEPTION(10004, "账户已锁定"), - DISABLEDEXCEPTION(10005,"账户已禁用"), - ACCESSDENIED(10006,"无权限访问"), - AUTHENTICATION(10007,"身份验证异常"), - NOHANDLERFOUND(10008,"找不到相应的视图处理器"), - PARAM_INVALID(10009, "参数不合法"), - TOKEN_EXCEPTION(10010, "Token不合法"), - TOKEN_EXPIRED(10011, "Token已过期"), - OSS_ERROR(10012, "OSS文件上传异常"), - Network_ERROR(90000, "网络请求失败"), - SERVER_INTERNAL_ERROR(99999, "服务器内部错误"), - ; - - private Integer code; - - private String message; - - Code(Integer code, String message) { - this.code = code; - this.message = message; - } - - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/src/main/java/com/subsidy/common/RedisPrefixConstant.java b/src/main/java/com/subsidy/common/RedisPrefixConstant.java new file mode 100644 index 0000000..88a9271 --- /dev/null +++ b/src/main/java/com/subsidy/common/RedisPrefixConstant.java @@ -0,0 +1,35 @@ +package com.subsidy.common; + +public class RedisPrefixConstant { + + /** + * subsidyAdminister_accountName:AdministerDO 老师账号密码 + */ + public static final String SUBSIDY_ADMINISTER_PREFIX = "subsidyAdminister:"; + + /** + * subsidyMember_companyId_accountName:MemberDO 学员账号密码 + */ + public static final String SUBSIDY_COMPANY_MEMBER_PREFIX = "subsidyMember:"; + + ///** + // *subsidy_memberLogin_memberId_userName_companyName_now : 学员端审计记录 + // */ + //public static final String SUBSIDY_MEMBER_LOGIN_PREFIX = "subsidy:memberLogin:"; + + /** + * subsidySmsCode_telephone:code 手机验证码 + */ + public static final String SUBSIDY_TELEPHONE_PREFIX = "subsidySmsCode:"; + + /** + * subsidySettings:companyId:ClassHourDictDO 公司操作设置 + */ + public static final String SUBSIDY_SETTINGS_PREFIX = "subsidySettings:"; + + /** + * subsidySignInfo:memberId:1:classId:12:20211223:long,do 学生签到数据 + */ + public static final String SUBSIDY_SIGN_INFO_PREFIX = "subsidySignInfo:memberId:"; + +} diff --git a/src/main/java/com/subsidy/common/configure/ActivityDetectionConfig.java b/src/main/java/com/subsidy/common/configure/ActivityDetectionConfig.java new file mode 100644 index 0000000..3aca11a --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/ActivityDetectionConfig.java @@ -0,0 +1,18 @@ +package com.subsidy.common.configure; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Data +@Configuration +@ConfigurationProperties(prefix = "activity") +public class ActivityDetectionConfig { + + private Long captchaAppId; + + private String appSecretKey; + + private Long businessId; + +} diff --git a/src/main/java/com/subsidy/common/configure/JobFactory.java b/src/main/java/com/subsidy/common/configure/JobFactory.java new file mode 100644 index 0000000..9a0bdcb --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/JobFactory.java @@ -0,0 +1,31 @@ +package com.subsidy.common.configure; + +import org.quartz.spi.TriggerFiredBundle; +import org.springframework.beans.factory.config.AutowireCapableBeanFactory; +import org.springframework.scheduling.quartz.AdaptableJobFactory; +import org.springframework.stereotype.Component; + +/** + *

+ * JobFactory实例 + *

+ * + * @author DengMin + * @since 2020/12/9 + */ +@Component +public class JobFactory extends AdaptableJobFactory { + + private AutowireCapableBeanFactory factory; + + public JobFactory(AutowireCapableBeanFactory factory) { + this.factory = factory; + } + + @Override + protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception { + Object job = super.createJobInstance(bundle); + factory.autowireBean(job); + return job; + } +} diff --git a/src/main/java/com/subsidy/common/configure/QXueYouConfig.java b/src/main/java/com/subsidy/common/configure/QXueYouConfig.java new file mode 100644 index 0000000..0bf6873 --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/QXueYouConfig.java @@ -0,0 +1,18 @@ +package com.subsidy.common.configure; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Data +@Configuration +@ConfigurationProperties(prefix = "qxueyou") +public class QXueYouConfig { + + private String appId; + + private String securityKey; + + private String url; + +} diff --git a/src/main/java/com/subsidy/common/configure/QuartzConfig.java b/src/main/java/com/subsidy/common/configure/QuartzConfig.java new file mode 100644 index 0000000..b9c9a33 --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/QuartzConfig.java @@ -0,0 +1,46 @@ +package com.subsidy.common.configure; + +import org.quartz.Scheduler; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.ClassPathResource; +import org.springframework.scheduling.quartz.SchedulerFactoryBean; + +import javax.sql.DataSource; + +/** + *

+ * Quartz配置 + *

+ * + * @author DengMin + * @since 2020/12/8 + */ +@Configuration +public class QuartzConfig { + + @Autowired + private JobFactory jobFactory; + + @Autowired + private DataSource dataSource; + + @Bean + public SchedulerFactoryBean schedulerFactoryBean() { + SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean(); + schedulerFactoryBean.setOverwriteExistingJobs(true); + schedulerFactoryBean.setStartupDelay(60); + schedulerFactoryBean.setJobFactory(jobFactory); + schedulerFactoryBean.setOverwriteExistingJobs(true); + schedulerFactoryBean.setStartupDelay(1); + schedulerFactoryBean.setDataSource(dataSource); + schedulerFactoryBean.setConfigLocation(new ClassPathResource("/application-quartz.properties")); + return schedulerFactoryBean; + } + + @Bean + public Scheduler scheduler() { + return schedulerFactoryBean().getScheduler(); + } +} diff --git a/src/main/java/com/subsidy/common/configure/RedisConfig.java b/src/main/java/com/subsidy/common/configure/RedisConfig.java new file mode 100644 index 0000000..63cf2de --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/RedisConfig.java @@ -0,0 +1,122 @@ +package com.subsidy.common.configure; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.ListOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.SetOperations; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.data.redis.core.ZSetOperations; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +@EnableCaching + +/** + *

+ * Redis + *

+ * + * @author DengMin + * @since 2020/12/14 + */ +@Configuration +public class RedisConfig extends CachingConfigurerSupport { + + /** + * retemplate相关配置 + * @param factory + * @return + */ + @Bean + public RedisTemplate redisTemplate(RedisConnectionFactory factory) { + + RedisTemplate template = new RedisTemplate<>(); + // 配置连接工厂 + template.setConnectionFactory(factory); + + //使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式) + Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.class); + + ObjectMapper om = new ObjectMapper(); + // 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + // 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常 + om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); + jacksonSeial.setObjectMapper(om); + + // 值采用json序列化 + template.setValueSerializer(jacksonSeial); + //使用StringRedisSerializer来序列化和反序列化redis的key值 + template.setKeySerializer(new StringRedisSerializer()); + + // 设置hash key 和value序列化模式 + template.setHashKeySerializer(new StringRedisSerializer()); + template.setHashValueSerializer(jacksonSeial); + template.afterPropertiesSet(); + + return template; + } + + /** + * 对hash类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public HashOperations hashOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForHash(); + } + + /** + * 对redis字符串类型数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ValueOperations valueOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForValue(); + } + + /** + * 对链表类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ListOperations listOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForList(); + } + + /** + * 对无序集合类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public SetOperations setOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForSet(); + } + + /** + * 对有序集合类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ZSetOperations zSetOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForZSet(); + } +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/common/configure/WebConfig.java b/src/main/java/com/subsidy/common/configure/WebConfig.java index dc0d39f..07c78cd 100644 --- a/src/main/java/com/subsidy/common/configure/WebConfig.java +++ b/src/main/java/com/subsidy/common/configure/WebConfig.java @@ -1,8 +1,13 @@ package com.subsidy.common.configure; + import com.subsidy.common.interceptor.AuthenticationInterceptor; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; @@ -59,5 +64,15 @@ public class WebConfig implements WebMvcConfigurer { .addPathPatterns("/**"); } - + @Bean + public CorsFilter corsFilter() { + CorsConfiguration config = new CorsConfiguration(); + config.setMaxAge(3600L); + config.addAllowedOrigin("*"); + config.addAllowedMethod("*"); + config.addAllowedHeader("*"); + UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource(); + configSource.registerCorsConfiguration("/**", config); + return new CorsFilter(configSource); + } } \ No newline at end of file diff --git a/src/main/java/com/subsidy/common/configure/WebLogAspect.java b/src/main/java/com/subsidy/common/configure/WebLogAspect.java index 0f193cd..ebfe688 100644 --- a/src/main/java/com/subsidy/common/configure/WebLogAspect.java +++ b/src/main/java/com/subsidy/common/configure/WebLogAspect.java @@ -30,13 +30,13 @@ public class WebLogAspect { public void logBeforeController(JoinPoint joinPoint) { - RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); +// RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); //这个RequestContextHolder是Springmvc提供来获得请求的东西 - HttpServletRequest request = ((ServletRequestAttributes)requestAttributes).getRequest(); +// HttpServletRequest request = ((ServletRequestAttributes)requestAttributes).getRequest(); // 记录下请求内容 - logger.info("####requestUrl : " + request.getRequestURL().toString()); - logger.info("####requestParam : " + Arrays.toString(joinPoint.getArgs())); +// logger.info("####requestUrl : " + request.getRequestURL().toString()); +// logger.info("####requestParam : " + Arrays.toString(joinPoint.getArgs())); } diff --git a/src/main/java/com/subsidy/common/configure/WebSocketConfig.java b/src/main/java/com/subsidy/common/configure/WebSocketConfig.java new file mode 100644 index 0000000..3fd2091 --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/WebSocketConfig.java @@ -0,0 +1,37 @@ +package com.subsidy.common.configure; + +import com.subsidy.common.interceptor.WebSocketInterceptor; +import com.subsidy.util.websocket.WebSocketUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.config.annotation.EnableWebSocket; +import org.springframework.web.socket.config.annotation.WebSocketConfigurer; +import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; + +/** + *

+ * WebSocket 配置 + *

+ * + * @author DengMin + * @since 2022/7/13 + */ + +@Configuration +@EnableWebSocket +public class WebSocketConfig implements WebSocketConfigurer { + + @Autowired + private WebSocketUtil webSocketUtil; + + @Autowired + private WebSocketInterceptor webSocketInterceptor; + + @Override + public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { + registry + .addHandler(webSocketUtil, "socket") + .addInterceptors(webSocketInterceptor) // 自定义验证规则 + .setAllowedOrigins("*"); + } +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/common/configure/WechatConfig.java b/src/main/java/com/subsidy/common/configure/WechatConfig.java index 46e2034..050e82b 100644 --- a/src/main/java/com/subsidy/common/configure/WechatConfig.java +++ b/src/main/java/com/subsidy/common/configure/WechatConfig.java @@ -14,11 +14,11 @@ public class WechatConfig { private String appSecret; - private String msgUrl; - - private String templateId; - - private String agentId; + //private String msgUrl; + // + //private String templateId; + // + //private String agentId; } diff --git a/src/main/java/com/subsidy/common/constant/Code.java b/src/main/java/com/subsidy/common/constant/Code.java index d4a02f9..fbe57a0 100644 --- a/src/main/java/com/subsidy/common/constant/Code.java +++ b/src/main/java/com/subsidy/common/constant/Code.java @@ -15,7 +15,7 @@ public enum Code { NOHANDLERFOUND(1008,"找不到相应的视图处理器"), PARAM_INVALID(1009, "参数不合法"), TOKEN_EXCEPTION(1010, "无效的令牌"), - TOKEN_EXPIRED(1011, "令牌已过期"), + TOKEN_EXPIRED(1011, "当前账户已在其他设备登录"), TOKEN_VERIFICATION_FAILED(1013, "令牌验证失败"), OSS_ERROR(1012, "OSS文件上传异常"), Network_ERROR(9000, "网络请求失败"), diff --git a/src/main/java/com/subsidy/common/constant/CourseNotification.java b/src/main/java/com/subsidy/common/constant/CourseNotification.java new file mode 100644 index 0000000..0111f35 --- /dev/null +++ b/src/main/java/com/subsidy/common/constant/CourseNotification.java @@ -0,0 +1,8 @@ +package com.subsidy.common.constant; + +public class CourseNotification { + + public static final String UNSENT = "待发送"; + + public static final String SENT = "已发送"; +} diff --git a/src/main/java/com/subsidy/common/constant/SmsCode.java b/src/main/java/com/subsidy/common/constant/SmsCode.java new file mode 100644 index 0000000..aef2eb2 --- /dev/null +++ b/src/main/java/com/subsidy/common/constant/SmsCode.java @@ -0,0 +1,23 @@ +package com.subsidy.common.constant; + +import lombok.Getter; + +@Getter +public enum SmsCode { + + SIGN_IN("SMS_234409992", "签到通知"), + TEST("SMS_234414789", "测试通知"), + CLASS_START("SMS_228137810", "开课通知"), + ALL("SMS_228137810", "全部成员"), + NOT_SIGNED_IN("SMS_234409992","未签到成员"), + UNFINISHED("SMS_234414789","未完课成员"); + + private String type; + + private String code; + + SmsCode(String code, String type) { + this.code = code; + this.type = type; + } +} diff --git a/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java b/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java index 5f8117b..2e535e9 100644 --- a/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java +++ b/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java @@ -111,8 +111,9 @@ public class GlobalExceptionHandler { @ExceptionHandler(value = Exception.class) public ResponseVO serverInternalError(Exception e, HttpServletRequest request) { String url = request.getRequestURI(); - log.error("path:"+url); - log.error("---- error message: ---"+e.toString()); +// log.error("path:"+url); +// log.error("---- error message: ---"+e.toString()); + e.printStackTrace(); return ResponseData.generateCreatedResponse(Code.SERVER_INTERNAL_ERROR.getCode(), Code.SERVER_INTERNAL_ERROR.getMessage(), url); } } \ No newline at end of file diff --git a/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java b/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java index 94f2eeb..73c8225 100644 --- a/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java +++ b/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java @@ -1,20 +1,35 @@ package com.subsidy.common.interceptor; +import com.alibaba.fastjson.JSON; import com.auth0.jwt.interfaces.Claim; import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.constant.Code; import com.subsidy.common.exception.HttpException; import com.subsidy.mapper.AdministerMapper; +import com.subsidy.mapper.MemberMapper; import com.subsidy.model.AdministerDO; +import com.subsidy.model.MemberDO; +import com.subsidy.util.ConstantUtils; import com.subsidy.util.JwtUtil; import com.subsidy.util.Localstorage; +import com.subsidy.util.RedisUtil; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerInterceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; import java.lang.reflect.Method; +import java.nio.charset.StandardCharsets; +import java.util.Calendar; +import java.util.Date; import java.util.Map; /** @@ -31,7 +46,14 @@ public class AuthenticationInterceptor implements HandlerInterceptor { @Autowired private AdministerMapper administerMapper; + @Autowired + private MemberMapper memberMapper; + + @Autowired + private RedisUtil redisUtil; + @Override + @CrossOrigin() public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { // 不需要进行拦截 if (!(handler instanceof HandlerMethod)) { @@ -40,6 +62,16 @@ public class AuthenticationInterceptor implements HandlerInterceptor { HandlerMethod handlerMethod = (HandlerMethod) handler; Method method = handlerMethod.getMethod(); + + TimeRequired timeRequired = method.getAnnotation(TimeRequired.class); + if (timeRequired !=null){ + Calendar calendar = Calendar.getInstance(); + int hour = calendar.get(Calendar.HOUR_OF_DAY); + if (hour<6){ + throw new HttpException(17001); + } + } + LoginRequired methodAnnotation = method.getAnnotation(LoginRequired.class); if (methodAnnotation != null) { String authorization = request.getHeader("Authorization"); @@ -49,36 +81,47 @@ public class AuthenticationInterceptor implements HandlerInterceptor { token = authorization.replace("Bearer ", ""); } /*Token不存在*/ - if (token == null || JwtUtil.isExpired(token) || !JwtUtil.verifyToken(token)) { + if (token == null || !JwtUtil.verifyToken(token)) { throw new HttpException(1010); } Map claimMap = JwtUtil.getClaims(token); if (claimMap != null) { - String[] role = methodAnnotation.value(); + //String[] role = methodAnnotation.value(); String type = claimMap.get("type").asString(); - if (role.length > 0) { - if ("administer".equals(type)) { - AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong()); - if (administerDO != null) { - Localstorage.setUser(administerDO); - return true; - } - } else { - throw new HttpException(1010); - } - } else { + if (ConstantUtils.ADMINISTER_TERMINATE.equals(type)) { AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong()); if (administerDO != null) { Localstorage.setUser(administerDO); return true; } + } else if(ConstantUtils.MOBILE_TERMINATE.equals(type)) { + MemberDO memberDO = memberMapper.selectById(claimMap.get("id").asLong()); + if(memberDO != null) { + Localstorage.setUser(memberDO); + return true; + } + /** + * 学生端设置单设备登录 + */ + /* String tk = (String) redisUtil.get(ConstantUtils.MOBILE_TERMINATE+"_"+claimMap.get("id").asLong()); + if(StringUtils.isNotBlank(tk)) { + if(tk.equals(token)) { + return true; + } + + throw new HttpException(1011); + } else { + throw new HttpException(1010); + }*/ + } else { + throw new HttpException(1010); } } - //return true; } throw new HttpException(1010); } return true; } + } diff --git a/src/main/java/com/subsidy/common/interceptor/LoginRequired.java b/src/main/java/com/subsidy/common/interceptor/LoginRequired.java index 19e2615..7ff944a 100644 --- a/src/main/java/com/subsidy/common/interceptor/LoginRequired.java +++ b/src/main/java/com/subsidy/common/interceptor/LoginRequired.java @@ -16,5 +16,5 @@ import java.lang.annotation.*; @Inherited public @interface LoginRequired { - String[] value(); + //String[] value(); } \ No newline at end of file diff --git a/src/main/java/com/subsidy/common/interceptor/TimeRequired.java b/src/main/java/com/subsidy/common/interceptor/TimeRequired.java new file mode 100644 index 0000000..d720289 --- /dev/null +++ b/src/main/java/com/subsidy/common/interceptor/TimeRequired.java @@ -0,0 +1,10 @@ +package com.subsidy.common.interceptor; + +import java.lang.annotation.*; + +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface TimeRequired { +} diff --git a/src/main/java/com/subsidy/common/interceptor/WebSocketInterceptor.java b/src/main/java/com/subsidy/common/interceptor/WebSocketInterceptor.java new file mode 100644 index 0000000..cec09bf --- /dev/null +++ b/src/main/java/com/subsidy/common/interceptor/WebSocketInterceptor.java @@ -0,0 +1,55 @@ +package com.subsidy.common.interceptor; + +import com.subsidy.mapper.MemberMapper; +import com.subsidy.model.MemberDO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.server.ServerHttpRequest; +import org.springframework.http.server.ServerHttpResponse; +import org.springframework.http.server.ServletServerHttpRequest; +import org.springframework.stereotype.Component; +import org.springframework.web.socket.WebSocketHandler; +import org.springframework.web.socket.server.HandshakeInterceptor; +import javax.servlet.http.HttpServletRequest; +import java.util.Map; + +/** + *

+ * WebSocket握手拦截器 + *

+ * + * @author DengMin + * @since 2022/7/14 + */ +@Component +public class WebSocketInterceptor implements HandshakeInterceptor { + + @Autowired + private MemberMapper memberMapper; + + /** + * 自定义验证规则, 如果该用户不存在数据表中,拒绝此次连接 + * @param request + * @param serverHttpResponse + * @param webSocketHandler + * @param map + * @return + * @throws Exception + */ + @Override + public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse serverHttpResponse, WebSocketHandler webSocketHandler, Map map) throws Exception { + if(request instanceof ServletServerHttpRequest) { + HttpServletRequest httpServletRequest = ((ServletServerHttpRequest) request).getServletRequest(); + Long userId = Long.parseLong(httpServletRequest.getParameter("userId")); + MemberDO memberDO = memberMapper.selectById(userId); + if(null != memberDO) { + return true; + } + } + return false; + } + + @Override + public void afterHandshake(ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse, WebSocketHandler webSocketHandler, Exception e) { + + } +} diff --git a/src/main/java/com/subsidy/controller/AccessTokenController.java b/src/main/java/com/subsidy/controller/AccessTokenController.java new file mode 100644 index 0000000..0058e29 --- /dev/null +++ b/src/main/java/com/subsidy/controller/AccessTokenController.java @@ -0,0 +1,106 @@ +package com.subsidy.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.configure.RestTemplateConfig; +import com.subsidy.common.configure.WechatConfig; +import com.subsidy.mapper.AccessTokenMapper; +import com.subsidy.model.AccessTokenDO; +import com.subsidy.util.ConstantUtils; +import com.subsidy.util.SecretUtils; +import com.subsidy.vo.wechat.AccessTokenVO; +import com.subsidy.vo.wechat.AuthenRequestVO; +import com.subsidy.vo.wechat.AuthenTokenVO; +import com.subsidy.vo.wechat.JsSdkVO; +import com.subsidy.vo.wechat.SignVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + *

+ * 前端控制器 + *

+ * + * @author DengMin + * @since 2022-02-18 + */ +@RestController +@Api(tags = "微信") +@RequestMapping("/wechat") +public class AccessTokenController { + + @Autowired + private RestTemplateConfig restTemplateConfig; + + @Autowired + private WechatConfig wechatConfig; + + @Autowired + private AccessTokenMapper accessTokenMapper; + + @PostMapping("/getJsapiTicket") + @ApiOperation("通过token请求获得jsapi_ticket {url}") + public ResponseVO getJsapiTicket(@RequestBody SignVO signVO) { + + List accessTokens = accessTokenMapper.selectList(null); + + String accessToken = ""; + if (accessTokens.size()==0){ + String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wechatConfig.getAppId() + "&secret=" + wechatConfig.getAppSecret(); + ResponseEntity response = restTemplateConfig.restTemplate() + .exchange(url, HttpMethod.GET, null, AccessTokenVO.class); + accessToken = response.getBody().getAccess_token(); + AccessTokenDO accessToken1 = new AccessTokenDO(); + accessToken1.setAccessToken(accessToken); + accessToken1.setUpdateDate(LocalDateTime.now()); + accessTokenMapper.insert(accessToken1); + }else { + AccessTokenDO accessToken1 = accessTokens.get(0); + long diff = Duration.between(accessToken1.getUpdateDate(),LocalDateTime.now()).toMillis(); + if (diff>=2*60*60*1000-5*1000){ + String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wechatConfig.getAppId() + "&secret=" + wechatConfig.getAppSecret(); + ResponseEntity response = restTemplateConfig.restTemplate() + .exchange(url, HttpMethod.GET, null, AccessTokenVO.class); + accessToken = response.getBody().getAccess_token(); +// AccessToken accessToken2= new AccessToken(); + accessToken1.setAccessToken(accessToken); + accessToken1.setUpdateDate(LocalDateTime.now()); + accessTokenMapper.updateById(accessToken1); + }else { + accessToken = accessToken1.getAccessToken(); + } + } + signVO.setAccess_token(accessToken); + + String url1 = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + accessToken+ "&type=jsapi"; + ResponseEntity response1 = restTemplateConfig.restTemplate() + .exchange(url1, HttpMethod.GET, null, JsSdkVO.class); + String ticket = response1.getBody().getTicket(); + signVO.setJsapi_ticket(ticket); + signVO.setNoncestr("1rtgtafNdHhxADMD"); + signVO.setTimestamp(String.valueOf(System.currentTimeMillis())); + String signStr = "jsapi_ticket=" + signVO.getJsapi_ticket() + "&noncestr=" + signVO.getNoncestr() + "×tamp=" + signVO.getTimestamp() + + "&url=" + signVO.getUrl(); + + signVO.setSign(SecretUtils.getSHAString(signStr)); + return ResponseData.generateCreatedResponse(0,signVO); + } +} diff --git a/src/main/java/com/subsidy/controller/ActivityDetectionController.java b/src/main/java/com/subsidy/controller/ActivityDetectionController.java new file mode 100644 index 0000000..85ed646 --- /dev/null +++ b/src/main/java/com/subsidy/controller/ActivityDetectionController.java @@ -0,0 +1,53 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.TimeRequired; +import com.subsidy.dto.detection.VerifyDTO; +import com.subsidy.model.ActivityDetectionDO; +import com.subsidy.service.ActivityDetectionService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +import javax.servlet.http.HttpServletRequest; + +/** + *

+ * 活跃度检测表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-07-13 + */ +@RestController +@Api(tags = "活跃度检测表") +@RequestMapping("/activityDetection") +public class ActivityDetectionController { + + @Autowired + private ActivityDetectionService activityDetectionService; + + @PostMapping("verify") + @ApiOperation("验证滑块 ticket randStr memberId classId") + @TimeRequired + public ResponseVO verify(@RequestBody VerifyDTO verifyDTO, HttpServletRequest request){ + return ResponseData.generateCreatedResponse(0,activityDetectionService.verify(verifyDTO,request)); + } + + @PostMapping("getCheckHistory") + @ApiOperation("获取某个人某个课程的活跃度验证详情 memberId classId") + public ResponseVO getCheckHistory(@RequestBody ActivityDetectionDO activityDetectionDO){ + return ResponseData.generateCreatedResponse(0,activityDetectionService.getCheckHistory(activityDetectionDO)); + } + + + + +} diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java index 4077c35..bad6784 100644 --- a/src/main/java/com/subsidy/controller/AdministerController.java +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -4,29 +4,27 @@ package com.subsidy.controller; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; -import com.subsidy.dto.administer.ClassDetailDTO; -import com.subsidy.dto.administer.OperatorsDTO; +import com.subsidy.dto.administer.*; import com.subsidy.model.AdministerDO; -import com.subsidy.model.ClassDictDO; +import com.subsidy.model.ExerciseDoneHistoryDO; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.model.MemberDO; import com.subsidy.service.AdministerService; import com.subsidy.util.ConstantUtils; -import com.subsidy.util.excel.ExcelUtil; -import com.subsidy.vo.administer.ExerciseTestVO; -import com.subsidy.vo.classdict.ClassDetailVO; -import com.subsidy.vo.member.ClassSignVO; -import com.subsidy.vo.sign.AnswerRecordVO; -import com.subsidy.vo.sign.ClassSignInfoVO; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletResponse; import java.net.InetAddress; -import java.util.Arrays; -import java.util.List; /** *

@@ -44,12 +42,11 @@ public class AdministerController { @Autowired private AdministerService administerService; - @GetMapping("getIp") - public String getIp()throws Exception{ - InetAddress addr = InetAddress.getLocalHost(); - System.out.println("Local HostAddress:"+addr.getHostAddress()); - return addr.getHostAddress(); - } +// @GetMapping("getIp") +// public String getIp()throws Exception{ +// InetAddress addr = InetAddress.getLocalHost(); +// return addr.getHostAddress(); +// } @PostMapping("/login") @ApiOperation("登录接口 accountName password") @@ -59,116 +56,210 @@ public class AdministerController { @PostMapping("/getPermissions") @ApiOperation("权限查询") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO getPermissions() { return ResponseData.generateCreatedResponse(0, administerService.getPermissions()); } @PostMapping("/administers") @ApiOperation("查询所有运营者 { userName pageNum pageSize }") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) +// @LoginRequired public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){ return ResponseData.generateCreatedResponse(0,administerService.operators(operatorsDTO)); } @PostMapping("addAdminister") @ApiOperation("添加运营者 id userName 名称 accountName 账号 ") + @LoginRequired public ResponseVO addAdminister(@RequestBody AdministerDO administerDO){ return ResponseData.generateCreatedResponse(0,administerService.addAdminister(administerDO)); } @PostMapping("deleteAdminister") @ApiOperation("添加运营者 id ") + @LoginRequired public ResponseVO deleteAdminister(@RequestBody AdministerDO administerDO){ return ResponseData.generateCreatedResponse(0,administerService.deleteAdminister(administerDO)); } @PostMapping("updateAdminister") @ApiOperation("编辑运营者 id userName 名称 accountName 账号 password") + @LoginRequired public ResponseVO updateAdminister(@RequestBody AdministerDO administerDO){ return ResponseData.generateCreatedResponse(0,administerService.updateAdminister(administerDO)); } - @PostMapping("classSummary") - @ApiOperation("课程汇总 id 班级id ") - //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("班级详情--数据概览 id 班级id ") + @LoginRequired public ResponseVO classSummary(@RequestBody ClassDetailDTO classDetailDTO){ return ResponseData.generateCreatedResponse(0,administerService.classSummary(classDetailDTO)); } @PostMapping("classDetail") - @ApiOperation("班级管理--班级成员 id 班级id userName") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("班级管理--班级成员 id 班级id userName pageSize pageNum") + @LoginRequired public ResponseVO classDetail(@RequestBody ClassDetailDTO classDetailDTO){ return ResponseData.generateCreatedResponse(0,administerService.classDetail(classDetailDTO)); } @PostMapping("exportClassDetail") @ApiOperation("班级管理--班级成员--导出 id 班级id userName") - //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ classDetailDTO.setFlag(true); administerService.exportClassDetail(classDetailDTO); } @PostMapping("signDetail") - @ApiOperation("班级管理--注册签到 id 班级id userName") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("班级管理--注册签到 id 班级id userName pageSize pageNum") + @LoginRequired public ResponseVO signDetail(@RequestBody ClassDetailDTO classDetailDTO){ return ResponseData.generateCreatedResponse(0,administerService.signDetail(classDetailDTO)); } @PostMapping("exportSignDetail") @ApiOperation("班级管理--注册签到 id 班级id userName") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public void exportSignDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ classDetailDTO.setFlag(true); administerService.exportSignDetail(classDetailDTO); } @PostMapping("exerciseTest") - @ApiOperation("班级管理--测评成绩 id 班级id userName") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("班级管理--测评成绩 id 班级id userName paperId pageSize pageNum") + @LoginRequired public ResponseVO exerciseTest(@RequestBody ClassDetailDTO classDetailDTO){ return ResponseData.generateCreatedResponse(0,administerService.exerciseTest(classDetailDTO)); } @PostMapping("exportExerciseTest") - @ApiOperation("班级管理--测评成绩 id 班级id userName") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("班级管理--测评成绩 id 班级id userName paperId") + @LoginRequired public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ classDetailDTO.setFlag(true); administerService.exportExerciseTest(classDetailDTO); } + @PostMapping("getMemberPapers") + @ApiOperation("获取某个成员某个卷子的做题历史 memberId paperId") + @LoginRequired + public ResponseVO getMemberPapers(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){ + return ResponseData.generateCreatedResponse(0,administerService.getMemberPapers(exerciseDoneResultDO)); + } + + @PostMapping("getPaperDetail") + @ApiOperation("获取某个卷子做题详情 doneId getMemberPapers接口返回id memberId成员id") + @LoginRequired + public ResponseVO getPaperDetail(@RequestBody ExerciseDoneHistoryDO exerciseDoneHistoryDO){ + return ResponseData.generateCreatedResponse(0,administerService.getPaperDetail(exerciseDoneHistoryDO)); + } + @PostMapping("answerRecord") @ApiOperation("班级管理--答疑 id 班级id userName") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO answerRecord(@RequestBody ClassDetailDTO classDetailDTO){ return ResponseData.generateCreatedResponse(0,administerService.answerRecord(classDetailDTO)); } @PostMapping("exportAnswerRecord") @ApiOperation("班级管理--答疑 id 班级id userName") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public void exportAnswerRecord(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ classDetailDTO.setFlag(true); administerService.exportAnswerRecord(classDetailDTO); } + @PostMapping("classVodInfo") + @ApiOperation("学习记录---课件进度提醒 {courseId 课程id classId 班级id vodName视频名称}") + @LoginRequired + public ResponseVO classVodInfo(@RequestBody ClassVodInfoDTO classVodInfoDTO){ + return ResponseData.generateCreatedResponse(0,administerService.classVodInfo(classVodInfoDTO)); + } + + @PostMapping("classDailyInfo") + @ApiOperation("学习记录---每日学习时长 {courseId 课程id classId 班级id userName startDate endDate}") + @LoginRequired + public ResponseVO classDailyInfo(@RequestBody ClassDailyInfoDTO classDailyInfoDTO){ + return ResponseData.generateCreatedResponse(0,administerService.classDailyInfo(classDailyInfoDTO)); + } + + @PostMapping("exportClassDailyInfo") + @ApiParam("每日学习日志") + @LoginRequired + public void exportVodInfo(@RequestBody ClassDailyInfoDTO classDailyInfoDTO){ + administerService.exportClassDailyInfo(classDailyInfoDTO); + } + + @PostMapping("classVodDailyInfo") + @ApiOperation("学习记录---每日学习时长(视频维度)") + @LoginRequired + public ResponseVO classVodDailyInfo(@RequestBody ClassVodDailyInfoDTO classVodDailyInfoDTO ){ + return ResponseData.generateCreatedResponse(0,administerService.classVodDailyInfo(classVodDailyInfoDTO)); + } + + @PostMapping("exportClassVodDailyInfo") + @ApiOperation("学习记录---每日学习时长(视频维度) pageSize pageNum userName classId") + @LoginRequired + public void exportClassVodDailyInfo(@RequestBody ClassVodDailyInfoDTO classVodDailyInfoDTO ){ + administerService.exportClassVodDailyInfo(classVodDailyInfoDTO); + } + + @PostMapping("memberStudy") + @ApiOperation("学员学习日志 pageSize pageNum classId memberId") + @LoginRequired + public ResponseVO memberStudy(@RequestBody MemberStudyLogDTO memberStudyLogDTO){ + return ResponseData.generateCreatedResponse(0,administerService.memberStudy(memberStudyLogDTO)); + } + + @PostMapping("memberDetectionRecord") + @ApiOperation("获取某个班级活跃度检测记录 id userName pageSize pageNum ") + @LoginRequired + public ResponseVO memberDetectionRecord(@RequestBody ClassDetailDTO classDetailDTO ){ + return ResponseData.generateCreatedResponse(0,administerService.memberDetectionRecord(classDetailDTO)); + } + + @PostMapping("exportMemberDetectionRecord") + @ApiOperation("获取某个班级活跃度检测记录 id userName ") + @LoginRequired + public void exportMemberDetectionRecord(@RequestBody ClassDetailDTO classDetailDTO ){ + administerService.exportMemberDetectionRecord(classDetailDTO); + } + + @PostMapping("imageCheckDetail") + @ApiOperation("实名制验证详情 id 班级id userName pageSize pageNum") + @LoginRequired + public ResponseVO imageCheckDetail(@RequestBody ClassDetailDTO classDetailDTO){ + return ResponseData.generateCreatedResponse(0,administerService.imageCheckDetail(classDetailDTO)); + } + + @PostMapping("exportZip") @ApiOperation("下载压缩包 id 班级id") @CrossOrigin - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public void exportZip(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ administerService.export(classDetailDTO); } + @PostMapping("memberStudyLog") + @ApiOperation("学员学习日志 classId memberId") + @LoginRequired + public void memberStudyLog(@RequestBody MemberStudyLogDTO memberStudyLogDTO) throws Exception{ + administerService.memberStudyLog(memberStudyLogDTO); + } + @PostMapping("importMember") @ApiOperation("导入学生 {companyId 公司id file}") - public ResponseVO importMember(Long companyId,@RequestParam("file") MultipartFile file){ + @LoginRequired + public ResponseVO importMember(Long companyId,@RequestParam("file") MultipartFile file)throws Exception{ return ResponseData.generateCreatedResponse(0,administerService.importMember(companyId,file)); } + @PostMapping("manageMember") + @ApiOperation("用户管理 {pageSize pageNum userName:名字 【废弃】}") + @LoginRequired + public ResponseVO manageMember(@RequestBody ManageMemberDTO manageMemberDTO){ + return ResponseData.generateCreatedResponse(0,administerService.manageMember(manageMemberDTO)); + } } diff --git a/src/main/java/com/subsidy/controller/AnsweringQuestionController.java b/src/main/java/com/subsidy/controller/AnsweringQuestionController.java index 79f70ef..65b8ca9 100644 --- a/src/main/java/com/subsidy/controller/AnsweringQuestionController.java +++ b/src/main/java/com/subsidy/controller/AnsweringQuestionController.java @@ -3,14 +3,17 @@ package com.subsidy.controller; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; -import com.subsidy.dto.GetCourseQuestionDTO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.course.GetCourseQuestionDTO; import com.subsidy.model.AnsweringQuestionDO; import com.subsidy.service.AnsweringQuestionService; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** *

@@ -29,29 +32,39 @@ public class AnsweringQuestionController { private AnsweringQuestionService answeringQuestionService; @PostMapping("getCourseQuestion") - @ApiOperation("获取某个课程的答疑 {classId pageSize pageNum memberId}") + @ApiOperation(" 获取某个课程的答疑 {classId pageSize pageNum memberId}") + @LoginRequired public ResponseVO getCourseQuestion(@RequestBody GetCourseQuestionDTO getCourseQuestionDTO){ return ResponseData.generateCreatedResponse(0,answeringQuestionService.getCourseQuestion(getCourseQuestionDTO)); } @PostMapping("addQuestion") @ApiOperation("新增答疑 {classId askId title}") + @LoginRequired public ResponseVO addQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ return ResponseData.generateCreatedResponse(0,answeringQuestionService.addQuestion(answeringQuestionDO)); } @PostMapping("deleteQuestion") - @ApiOperation("删除答疑 {id}") + @ApiOperation(" 删除答疑 {id}") + @LoginRequired public ResponseVO deleteQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ return ResponseData.generateCreatedResponse(0,answeringQuestionService.deleteQuestion(answeringQuestionDO)); } @PostMapping("updateQuestion") @ApiOperation("编辑答疑 {id answerId answer}") + @LoginRequired public ResponseVO updateQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ return ResponseData.generateCreatedResponse(0, answeringQuestionService.updateQuestion(answeringQuestionDO)); } + @PostMapping("getNoAnswers") + @ApiOperation("获取某个课程没有回答的答疑个数 classId 课程id") + @LoginRequired + public ResponseVO getNoAnswers(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.getNoAnswers(answeringQuestionDO)); + } } diff --git a/src/main/java/com/subsidy/controller/BusinessScopeDictController.java b/src/main/java/com/subsidy/controller/BusinessScopeDictController.java new file mode 100644 index 0000000..244b9c2 --- /dev/null +++ b/src/main/java/com/subsidy/controller/BusinessScopeDictController.java @@ -0,0 +1,64 @@ +package com.subsidy.controller; + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.businessScope.BusinessScopeDTO; +import com.subsidy.model.BusinessScopeDictDO; +import com.subsidy.service.BusinessScopeDictService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 经营范围表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-07-25 + */ +@RestController +@Api(tags = "经营范围表") +@RequestMapping("/businessScopeDict") +public class BusinessScopeDictController { + + @Autowired + private BusinessScopeDictService businessScopeDictService; + + @PostMapping("addBusinessScope") + @ApiOperation("添加经营范围:businessScopeName/经营范围名称") + @LoginRequired + public ResponseVO addBusinessScope(@RequestBody BusinessScopeDictDO businessScopeDictDO) { + businessScopeDictService.save(businessScopeDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("updateBusinessScope") + @ApiOperation("修改经营范围:id/ID、businessScopeName/经营范围名称") + @LoginRequired + public ResponseVO updateBusinessScope(@RequestBody BusinessScopeDictDO businessScopeDictDO) { + businessScopeDictService.updateById(businessScopeDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("deleteBusinessScope") + @ApiOperation("删除经营范围:id/ID") + @LoginRequired + public ResponseVO deleteBusinessScope(@RequestBody BusinessScopeDictDO businessScopeDictDO) { + businessScopeDictService.removeById(businessScopeDictDO.getId()); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("queryBusinessScopePage") + @ApiOperation("分页查询经营范围:businessScopeName/经营范围名称、pageNum/当前页数、pageSize/每页显示条数") + @LoginRequired + public ResponseVO queryBusinessScopePage(@RequestBody BusinessScopeDTO businessScopeDictDO) { + return ResponseData.generateCreatedResponse(0, businessScopeDictService.queryBusinessScopePage(businessScopeDictDO)); + } + +} diff --git a/src/main/java/com/subsidy/controller/CategoryController.java b/src/main/java/com/subsidy/controller/CategoryController.java index 494576a..87ee8b9 100644 --- a/src/main/java/com/subsidy/controller/CategoryController.java +++ b/src/main/java/com/subsidy/controller/CategoryController.java @@ -8,14 +8,13 @@ import com.subsidy.dto.category.GetCategoriesDTO; import com.subsidy.model.CategoryDO; import com.subsidy.service.CategoryService; import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; - import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; /** *

@@ -34,38 +33,37 @@ public class CategoryController { private CategoryService categoryService; @PostMapping("getCategories") - @ApiOperation("查询类目 ** name 类目名称 companyId pageSize pageNum") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("查询类目 name 类目名称 companyId pageSize pageNum") + @LoginRequired public ResponseVO getCategories(@RequestBody GetCategoriesDTO getCategoriesDTO){ return ResponseData.generateCreatedResponse(0,categoryService.getCategories(getCategoriesDTO)); } @PostMapping("getAll") - @ApiOperation("查询所有类目 **companyId") + @ApiOperation("查询所有类目 companyId") public ResponseVO getAll(@RequestBody GetCategoriesDTO getCategoriesDTO){ return ResponseData.generateCreatedResponse(0,categoryService.getAll(getCategoriesDTO)); } @PostMapping("addCategory") - @ApiOperation("新增类目 **name companyId") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("新增类目 name companyId") + @LoginRequired public ResponseVO addCategory(@RequestBody CategoryDO categoryDO){ return ResponseData.generateCreatedResponse(0,categoryService.addCategory(categoryDO)); } @PostMapping("deleteCategory") @ApiOperation("删除类目 id") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO deleteCategory(@RequestBody CategoryDO categoryDO){ return ResponseData.generateCreatedResponse(0,categoryService.deleteCategory(categoryDO)); } @PostMapping("updateCategory") - @ApiOperation("修改类目 ** id name companyId") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("修改类目 id name companyId") + @LoginRequired public ResponseVO updateCategory(@RequestBody CategoryDO categoryDO){ return ResponseData.generateCreatedResponse(0,categoryService.updateCategory(categoryDO)); } - } diff --git a/src/main/java/com/subsidy/controller/CertCompanyMappingController.java b/src/main/java/com/subsidy/controller/CertCompanyMappingController.java new file mode 100644 index 0000000..286998f --- /dev/null +++ b/src/main/java/com/subsidy/controller/CertCompanyMappingController.java @@ -0,0 +1,53 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.dto.cert.ChangeCompanyCertsDTO; +import com.subsidy.dto.cert.GetCompanyCertsDTO; +import com.subsidy.dto.cert.GetCompanyCertsWithStatusDTO; +import com.subsidy.service.CertCompanyMappingService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import io.swagger.annotations.Api; + +/** + *

+ * 证书-公司映射表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@RestController +@Api(tags = "证书-公司映射表") +@RequestMapping("/certCompanyMapping") +public class CertCompanyMappingController { + + @Autowired + private CertCompanyMappingService certCompanyMappingService; + + @PostMapping("getCompanyCertsWithStatus") + @ApiOperation("获取某个公司的项目证书(返回学生报名状态) companyId 公司id typeId 类型id(查全部传空) memberId 学生id") + public ResponseVO getCompanyCertsWithStatus(@RequestBody GetCompanyCertsWithStatusDTO getCompanyCertsDTO){ + return ResponseData.generateCreatedResponse(0,certCompanyMappingService.getCompanyCertsWithStatus(getCompanyCertsDTO)); + } + + @PostMapping("getCompanyCerts") + @ApiOperation("获取某个公司的证书情况 companyId pageSize pageNum") + public ResponseVO getCompanyCerts(@RequestBody GetCompanyCertsDTO getCompanyCertsDTO){ + return ResponseData.generateCreatedResponse(0,certCompanyMappingService.getCompanyCerts(getCompanyCertsDTO)); + } + + @PostMapping("changeCompanyCerts") + @ApiOperation("开启/关闭权限 companyId certId signStatus") + public ResponseVO changeCompanyCerts(@RequestBody ChangeCompanyCertsDTO changeCompanyCertsDTO){ + return ResponseData.generateCreatedResponse(0,certCompanyMappingService.changeCompanyCerts(changeCompanyCertsDTO)); + } + + + + +} diff --git a/src/main/java/com/subsidy/controller/CertDictController.java b/src/main/java/com/subsidy/controller/CertDictController.java new file mode 100644 index 0000000..5f85275 --- /dev/null +++ b/src/main/java/com/subsidy/controller/CertDictController.java @@ -0,0 +1,72 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.dto.cert.AddCertDTO; +import com.subsidy.dto.cert.GetAllCertsDTO; +import com.subsidy.dto.cert.GetOneCertDTO; +import com.subsidy.model.CertDictDO; +import com.subsidy.service.CertDictService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 证书字典表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@RestController +@Api(tags = "证书字典表") +@RequestMapping("/certDict") +public class CertDictController { + + @Autowired + private CertDictService certDictService; + + @PostMapping("addCert") + @ApiOperation("添加证书 certName price coverPage title副标题 scribePrice 划线价格 certDesc 证书简介 detail chargeAndSubsidy 学费和补贴 serviceProcess服务流程 refundGuarantee 退费流程 typeIds[] 类型id requirementDesc 条件说明 submitDesc 提交说明") + public ResponseVO addCert(@RequestBody AddCertDTO addCertDTO){ + return ResponseData.generateCreatedResponse(0,certDictService.addCert(addCertDTO)); + } + + @PostMapping("deleteCert") + @ApiOperation("删除证书 id ") + public ResponseVO deleteCert(@RequestBody CertDictDO certDictDO){ + return ResponseData.generateCreatedResponse(0,certDictService.deleteCert(certDictDO)); + } + + @PostMapping("updateCert") + @ApiOperation("编辑证书 id certName price coverPage title副标题 scribePrice 划线价格 划线价格 detail chargeAndSubsidy 学费和补贴 serviceProcess服务流程 refundGuarantee 退费流程 typeId 类型id requirementDesc 条件说明 submitDesc 提交说明") + public ResponseVO updateCert(@RequestBody AddCertDTO addCertDTO){ + return ResponseData.generateCreatedResponse(0,certDictService.updateCert(addCertDTO)); + } + + @PostMapping("getOneCert") + @ApiOperation("获取一个证书 id userId") + public ResponseVO getOneCert(@RequestBody GetOneCertDTO getOneCertDTO){ + return ResponseData.generateCreatedResponse(0,certDictService.getOneCert(getOneCertDTO)); + } + + @PostMapping("getAllCerts") + @ApiOperation("获取全部的证书(包含项目类型) typeId certName pageSize pageNum ") + public ResponseVO getAllCerts(@RequestBody GetAllCertsDTO getAllCertsDTO){ + return ResponseData.generateCreatedResponse(0,certDictService.getAllCerts(getAllCertsDTO)); + } + + @PostMapping("getAllCertsWithoutType") + @ApiOperation("获取所有证书(下拉列表用)") + public ResponseVO getAllCertsWithoutType(){ + return ResponseData.generateCreatedResponse(0,certDictService.getAllCertsWithoutType()); + } + +} diff --git a/src/main/java/com/subsidy/controller/CertMemberFileMappingController.java b/src/main/java/com/subsidy/controller/CertMemberFileMappingController.java new file mode 100644 index 0000000..e566ab4 --- /dev/null +++ b/src/main/java/com/subsidy/controller/CertMemberFileMappingController.java @@ -0,0 +1,26 @@ +package com.subsidy.controller; + + +import com.subsidy.service.CertMemberFileMappingService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 前端控制器 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@RestController +@Api(tags = "学生报名材料 映射表") +@RequestMapping("/certMemberFileMapping") +public class CertMemberFileMappingController { + + +} diff --git a/src/main/java/com/subsidy/controller/CertMemberMappingController.java b/src/main/java/com/subsidy/controller/CertMemberMappingController.java new file mode 100644 index 0000000..0dfaf18 --- /dev/null +++ b/src/main/java/com/subsidy/controller/CertMemberMappingController.java @@ -0,0 +1,67 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.TimeRequired; +import com.subsidy.dto.cert.GetListDTO; +import com.subsidy.dto.cert.SignManagementDTO; +import com.subsidy.dto.cert.SignUpDTO; +import com.subsidy.model.CertMemberMappingDO; +import com.subsidy.service.CertMemberMappingService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 学生报名证书表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@RestController +@Api(tags = "学生报名证书表") +@RequestMapping("/certMemberMapping") +public class CertMemberMappingController { + + @Autowired + private CertMemberMappingService certMemberMappingService; + + @PostMapping("signUp") + @ApiOperation("报名 certId memberId files[fileName fileUrl requirementId] ") + public ResponseVO signUp(@RequestBody SignUpDTO signUpDTO){ + return ResponseData.generateCreatedResponse(0,certMemberMappingService.signUp(signUpDTO)); + } + + @PostMapping("signManagement") + @ApiOperation("报名管理 typeId 类目id certId 证书id startDate 开始时间 endDate 结束时间 item 搜索字段 pageSize pageNum") + public ResponseVO signManagement(@RequestBody SignManagementDTO signManagementDTO){ + return ResponseData.generateCreatedResponse(0,certMemberMappingService.signManagement(signManagementDTO)); + } + + @PostMapping("changeStatus") + @ApiOperation("编辑订单状态 id status") + public ResponseVO changeStatus(@RequestBody CertMemberMappingDO certMemberMappingDO){ + return ResponseData.generateCreatedResponse(0,certMemberMappingService.changeStatus(certMemberMappingDO)); + } + + @PostMapping("getList") + @ApiOperation("手机端---获取全部订单 memberId status pageSize pageNum") + @TimeRequired + public ResponseVO getList(@RequestBody GetListDTO getListDTO){ + return ResponseData.generateCreatedResponse(0,certMemberMappingService.getList(getListDTO)); + } + + @PostMapping("getSignInfo") + @ApiOperation("获取某人某个证书报名信息 memberId certId ") + public ResponseVO getSignInfo(@RequestBody CertMemberMappingDO certMemberMappingDO){ + return ResponseData.generateCreatedResponse(0,certMemberMappingService.getSignInfo(certMemberMappingDO)); + } + +} diff --git a/src/main/java/com/subsidy/controller/CertRequirementController.java b/src/main/java/com/subsidy/controller/CertRequirementController.java new file mode 100644 index 0000000..929e538 --- /dev/null +++ b/src/main/java/com/subsidy/controller/CertRequirementController.java @@ -0,0 +1,59 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.model.CertDictDO; +import com.subsidy.model.CertRequirementDO; +import com.subsidy.service.CertRequirementService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 报名条件表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-05-12 + */ +@RestController +@Api(tags = "报名条件表") +@RequestMapping("/certRequirement") +public class CertRequirementController { + + + @Autowired + private CertRequirementService certRequirementService; + + @PostMapping("getRequirements") + @ApiOperation("获取证书报名条件 certId") + public ResponseVO getRequirements(@RequestBody CertRequirementDO certRequirementDO){ + return ResponseData.generateCreatedResponse(0,certRequirementService.getRequirements(certRequirementDO)); + } + + @PostMapping("deleteRequirement") + @ApiOperation("删除条件 id") + public ResponseVO deleteRequirement(@RequestBody CertRequirementDO certRequirementDO){ + return ResponseData.generateCreatedResponse(0,certRequirementService.deleteRequirement(certRequirementDO)); + } + + @PostMapping("addRequirement") + @ApiOperation("添加条件 certId certRequirement status:true 必填 false 非必填") + public ResponseVO addRequirement(@RequestBody CertRequirementDO certRequirementDO){ + return ResponseData.generateCreatedResponse(0,certRequirementService.addRequirement(certRequirementDO)); + } + + @PostMapping("updateRequirement") + @ApiOperation("编辑条件 id certId certRequirement status:true 必填 false 非必填") + public ResponseVO updateRequirement(@RequestBody CertRequirementDO certRequirementDO){ + return ResponseData.generateCreatedResponse(0,certRequirementService.updateRequirement(certRequirementDO)); + } + +} diff --git a/src/main/java/com/subsidy/controller/CertTypeDictController.java b/src/main/java/com/subsidy/controller/CertTypeDictController.java new file mode 100644 index 0000000..d2255c4 --- /dev/null +++ b/src/main/java/com/subsidy/controller/CertTypeDictController.java @@ -0,0 +1,65 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.dto.cert.GetAllTypeDTO; +import com.subsidy.mapper.CertTypeDictMapper; +import com.subsidy.model.CertCompanyMappingDO; +import com.subsidy.model.CertRequirementDO; +import com.subsidy.model.CertTypeDictDO; +import com.subsidy.service.CertTypeDictService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import io.swagger.annotations.Api; + +/** + *

+ * 证书类目字典表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@RestController +@Api(tags = "证书类目字典表") +@RequestMapping("/certTypeDict") +public class CertTypeDictController { + + @Autowired + private CertTypeDictService certTypeDictService; + + @PostMapping("getCompanyCertTypes") + @ApiOperation("(手机端)获取某个公司所有的证书类型 companyId") + public ResponseVO getCompanyCertTypes(@RequestBody CertCompanyMappingDO certCompanyMappingDO){ + return ResponseData.generateCreatedResponse(0,certTypeDictService.getCompanyCertTypes(certCompanyMappingDO)); + } + + @PostMapping("addType") + @ApiOperation("添加类型 typeName ") + public ResponseVO addType(@RequestBody CertTypeDictDO certTypeDictDO){ + return ResponseData.generateCreatedResponse(0,certTypeDictService.addType(certTypeDictDO)); + } + + @PostMapping("deleteType") + @ApiOperation("删除类型 id ") + public ResponseVO deleteType(@RequestBody CertTypeDictDO certTypeDictDO){ + return ResponseData.generateCreatedResponse(0,certTypeDictService.deleteType(certTypeDictDO)); + } + + @PostMapping("updateType") + @ApiOperation("修改类型 id typeName") + public ResponseVO updateType(@RequestBody CertTypeDictDO certTypeDictDO){ + return ResponseData.generateCreatedResponse(0,certTypeDictService.updateType(certTypeDictDO)); + } + + @PostMapping("getAllType") + @ApiOperation("获取所有类型 pageSize pageNum") + public ResponseVO getAllType(@RequestBody GetAllTypeDTO getAllTypeDTO){ + return ResponseData.generateCreatedResponse(0,certTypeDictService.getAllType(getAllTypeDTO)); + } + + +} diff --git a/src/main/java/com/subsidy/controller/ClassMemberMappingController.java b/src/main/java/com/subsidy/controller/CertTypeMappingController.java similarity index 70% rename from src/main/java/com/subsidy/controller/ClassMemberMappingController.java rename to src/main/java/com/subsidy/controller/CertTypeMappingController.java index ec9096f..03b3196 100644 --- a/src/main/java/com/subsidy/controller/ClassMemberMappingController.java +++ b/src/main/java/com/subsidy/controller/CertTypeMappingController.java @@ -8,15 +8,18 @@ import io.swagger.annotations.Api; /** *

- * 班级成员映射表 前端控制器 + * 证书-类型映射表 前端控制器 *

* * @author DengMin - * @since 2021-10-12 + * @since 2022-05-11 */ @RestController -@Api(tags = "班级成员映射表") -@RequestMapping("/class-member-mapping-do") -public class ClassMemberMappingController { +@Api(tags = "证书-类型映射表") +@RequestMapping("/certTypeMapping") +public class CertTypeMappingController { + + + } diff --git a/src/main/java/com/subsidy/controller/ClassDictController.java b/src/main/java/com/subsidy/controller/ClassDictController.java index ba15b88..7cc6d6f 100644 --- a/src/main/java/com/subsidy/controller/ClassDictController.java +++ b/src/main/java/com/subsidy/controller/ClassDictController.java @@ -4,23 +4,22 @@ package com.subsidy.controller; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.common.interceptor.TimeRequired; import com.subsidy.dto.classDict.AddClassDTO; import com.subsidy.dto.classDict.AddMemberToClassDTO; -import com.subsidy.dto.classDict.GetAllClassesDTO; +import com.subsidy.dto.classDict.GetClassBaseInfoDTO; import com.subsidy.dto.classDict.GetSpareMembersDTO; import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassMemberMappingDO; -import com.subsidy.model.CourseDictDO; import com.subsidy.service.ClassDictService; import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; - import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; /** *

@@ -39,67 +38,73 @@ public class ClassDictController { private ClassDictService classDictService; @PostMapping("getAllClasses") - @ApiOperation("获取某老师下的所有课程 ** companyId 所选企业id className 班级名称") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) - public ResponseVO getAllClasses(@RequestBody ClassDictDO classDictDO){ + @ApiOperation("获取某公司下的所有班级 companyId 所选企业id className 班级名称 openStatus 开放状态 startDate 开始时间 endDate 结束时间") + @LoginRequired + public ResponseVO getAllClasses(@RequestBody ClassDictDO classDictDO)throws Exception{ return ResponseData.generateCreatedResponse(0,classDictService.getAllClasses(classDictDO)); } @PostMapping("deleteClasses") - @ApiOperation("删除课程 id") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation(" 删除班级 id") + @LoginRequired public ResponseVO deleteClasses(@RequestBody ClassDictDO classDictDO){ return ResponseData.generateCreatedResponse(0,classDictService.deleteClasses(classDictDO)); } @PostMapping("addClass") - @ApiOperation("添加课程 ** userId:登录人id companyId courseId className startDate endDate") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("添加班级 userId:登录人id companyId courseId classTypeId className startDate endDate testRule 是否视频看完再做测试 isOrder 是否按照顺序播放 isFastPlay 是否快进 memberIds [] 班级学员 classNoticeDOS[noticeType noticeTime]") + @LoginRequired public ResponseVO addClass(@RequestBody AddClassDTO addClassDTO){ return ResponseData.generateCreatedResponse(0,classDictService.addClass(addClassDTO)); } @PostMapping("updateClass") - @ApiOperation("修改课程 id ** companyId courseId className startDate endDate") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("修改班级 id companyId className classTypeId startDate endDate") + @LoginRequired public ResponseVO updateClass(@RequestBody ClassDictDO classDictDO){ return ResponseData.generateCreatedResponse(0,classDictService.updateClass(classDictDO)); } @PostMapping("classDetail") @ApiOperation("获取一个班级详情 id") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO classDetail(@RequestBody ClassDictDO classDictDO){ return ResponseData.generateCreatedResponse(0,classDictService.classDetail(classDictDO)); } @PostMapping("removeMember") @ApiOperation("移除班级 classId 班级id memberId人员id") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO removeMember(@RequestBody ClassMemberMappingDO classMemberMappingDO){ return ResponseData.generateCreatedResponse(0,classDictService.removeMember(classMemberMappingDO)); } @PostMapping("getSpareMembers") - @ApiOperation("获取不在某班级的某企业里所有成员 ** companyId 企业id classId 班级id") - //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("获取不在某班级的某企业里所有成员 companyId 企业id classId 班级id") + @LoginRequired public ResponseVO getSpareMembers(@RequestBody GetSpareMembersDTO getSpareMembersDTO){ return ResponseData.generateCreatedResponse(0,classDictService.getSpareMembers(getSpareMembersDTO)); } @PostMapping("addMemberToClass") - @ApiOperation("将某个成员加入到某个班级里 classId memberIds []") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("将多个成员加入到某个班级里 classId memberIds []") + @LoginRequired public ResponseVO addMemberToClass(@RequestBody AddMemberToClassDTO addMemberToClassDTO){ return ResponseData.generateCreatedResponse(0,classDictService.addMemberToClass(addMemberToClassDTO)); } - @PostMapping("batchSms") - @ApiOperation("批量发送班级短信 {id 班级id}") + @ApiOperation(" 批量发送班级短信通知 {id 班级id }") + @LoginRequired public ResponseVO batchSms(@RequestBody ClassDictDO classDictDO){ return ResponseData.generateCreatedResponse(0,classDictService.batchSms(classDictDO)); } - + @PostMapping("getClassBaseInfo") + @ApiOperation("班级详情--获取课程基本信息 id") + @LoginRequired + @TimeRequired + public ResponseVO getClassBaseInfo(@RequestBody GetClassBaseInfoDTO getClassBaseInfoDTO){ + return ResponseData.generateCreatedResponse(0,classDictService.getClassBaseInfo(getClassBaseInfoDTO)); + } } diff --git a/src/main/java/com/subsidy/controller/ClassHourDictController.java b/src/main/java/com/subsidy/controller/ClassHourDictController.java index cdb8982..c228d7f 100644 --- a/src/main/java/com/subsidy/controller/ClassHourDictController.java +++ b/src/main/java/com/subsidy/controller/ClassHourDictController.java @@ -4,15 +4,19 @@ package com.subsidy.controller; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.common.interceptor.TimeRequired; import com.subsidy.model.ClassHourDictDO; import com.subsidy.model.VodPlayHistoryDO; import com.subsidy.service.ClassHourDictService; import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.classdict.GetSettingVO; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** *

@@ -32,23 +36,26 @@ public class ClassHourDictController { @PostMapping("getSetting") @ApiOperation("查看当天设置的最大学习时长 companyId") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO getSetting(@RequestBody ClassHourDictDO classHourDictDO){ return ResponseData.generateCreatedResponse(0,classHourDictService.getSetting(classHourDictDO)); } @PostMapping("updateSetting") - @ApiOperation("修改当天设置时长 id 主键 classHour status") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) - public ResponseVO updateSetting(@RequestBody ClassHourDictDO classHourDictDO){ - return ResponseData.generateCreatedResponse(0,classHourDictService.updateSetting(classHourDictDO)); + @ApiOperation("修改当天设置时长 companyId 主键 logo classHour status interrupt interruptStatus repeatTime repeatStatus rotationImgDictDOS[companyId rotationImg]") + @LoginRequired + public ResponseVO updateSetting(@RequestBody GetSettingVO getSettingVO){ + return ResponseData.generateCreatedResponse(0,classHourDictService.updateSetting(getSettingVO)); } @PostMapping("pollingGet") @ApiOperation("轮询查询当前这个人当天有没有超过最长时长 memberId playLength") + @LoginRequired + @TimeRequired public ResponseVO pollingGet(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){ return ResponseData.generateCreatedResponse(0,classHourDictService.pollingGet(vodPlayHistoryDO)); } + } diff --git a/src/main/java/com/subsidy/controller/ClassNoticeController.java b/src/main/java/com/subsidy/controller/ClassNoticeController.java new file mode 100644 index 0000000..ae46912 --- /dev/null +++ b/src/main/java/com/subsidy/controller/ClassNoticeController.java @@ -0,0 +1,70 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.classNotice.SendNotificationDTO; +import com.subsidy.model.ClassNoticeDO; +import com.subsidy.service.ClassNoticeService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 前端控制器 + *

+ * + * @author DengMin + * @since 2022-01-21 + */ +@RestController +@Api(tags = "课程通知") +@RequestMapping("/classNotice") +public class ClassNoticeController { + + @Autowired + private ClassNoticeService classNoticeService; + + @PostMapping("addNotice") + @ApiOperation("新增一个通知 classId noticeType isAuto noticeTime") + @LoginRequired + public ResponseVO addNotice(@RequestBody ClassNoticeDO classNoticeDO){ + return ResponseData.generateCreatedResponse(0,classNoticeService.addNotice(classNoticeDO)); + } + + @PostMapping("updateNotice") + @ApiOperation("修改一个通知 id noticeType isAuto noticeTime") + @LoginRequired + public ResponseVO updateNotice(@RequestBody ClassNoticeDO classNoticeDO){ + return ResponseData.generateCreatedResponse(0,classNoticeService.updateNotice(classNoticeDO)); + } + + @PostMapping("deleteNotice") + @ApiOperation("删除一个通知 id") + @LoginRequired + public ResponseVO deleteNotice(@RequestBody ClassNoticeDO classNoticeDO){ + return ResponseData.generateCreatedResponse(0,classNoticeService.deleteNotice(classNoticeDO)); + } + + @PostMapping("queryClassNotices") + @ApiOperation("查看某个课程的通知提醒 classId 课程id status 状态(待发送/已发送)") + @LoginRequired + public ResponseVO queryClassNotices(@RequestBody ClassNoticeDO classNoticeDO){ + return ResponseData.generateCreatedResponse(0,classNoticeService.queryClassNotices(classNoticeDO)); + } + + @PostMapping("sendClassNotices") + @ApiOperation("发送通知:classId/课程Id sendType/发送类型(全部成员/未签到成员/未完课成员)") + @LoginRequired + public ResponseVO sendClassNotices(@RequestBody SendNotificationDTO sendNotificationDTO) { + classNoticeService.sendNotification(sendNotificationDTO); + return ResponseData.generateCreatedResponse(0); + } +} diff --git a/src/main/java/com/subsidy/controller/ClassTypeDictController.java b/src/main/java/com/subsidy/controller/ClassTypeDictController.java new file mode 100644 index 0000000..7d24892 --- /dev/null +++ b/src/main/java/com/subsidy/controller/ClassTypeDictController.java @@ -0,0 +1,63 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.classDict.ClassTypeDTO; +import com.subsidy.model.ClassTypeDictDO; +import com.subsidy.service.ClassTypeDictService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 班级类型字典表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-01-21 + */ +@RestController +@Api(tags = "班级类型字典表") +@RequestMapping("/classType") +public class ClassTypeDictController { + + @Autowired + private ClassTypeDictService classTypeDictService; + + @PostMapping("addClassType") + @ApiOperation("添加课程类型 companyId 运营者公司id不传 classType") + @LoginRequired + public ResponseVO addClassType(@RequestBody ClassTypeDictDO classTypeDictDO){ + return ResponseData.generateCreatedResponse(0,classTypeDictService.addClassType(classTypeDictDO)); + } + + @PostMapping("updateClassType") + @ApiOperation("修改课程类型 id companyId classType") + @LoginRequired + public ResponseVO updateClassType(@RequestBody ClassTypeDictDO classTypeDictDO){ + return ResponseData.generateCreatedResponse(0,classTypeDictService.updateClassType(classTypeDictDO)); + } + + @PostMapping("deleteClassType") + @ApiOperation("删除课程类型 id") + @LoginRequired + public ResponseVO deleteClassType(@RequestBody ClassTypeDictDO classTypeDictDO){ + return ResponseData.generateCreatedResponse(0,classTypeDictService.deleteClassType(classTypeDictDO)); + } + + @PostMapping("queryClassTypes") + @ApiOperation("查询某个公司的班级类型 userId 登录人id companyId") + @LoginRequired + public ResponseVO queryClassTypes(@RequestBody ClassTypeDTO classTypeDTO){ + return ResponseData.generateCreatedResponse(0,classTypeDictService.queryClassTypes(classTypeDTO)); + } + +} diff --git a/src/main/java/com/subsidy/controller/CompanyDictController.java b/src/main/java/com/subsidy/controller/CompanyDictController.java index 49e7a97..edace0a 100644 --- a/src/main/java/com/subsidy/controller/CompanyDictController.java +++ b/src/main/java/com/subsidy/controller/CompanyDictController.java @@ -6,18 +6,18 @@ import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.dto.company.AddCompanyDTO; -import com.subsidy.model.AdministerDO; +import com.subsidy.dto.company.GetCompanyMembersDTO; import com.subsidy.model.CompanyDictDO; +import com.subsidy.model.MemberDO; import com.subsidy.service.CompanyDictService; import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; - import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; /** *

@@ -36,31 +36,45 @@ public class CompanyDictController { private CompanyDictService companyDictService; @PostMapping("/administers") - @ApiOperation("查询所有企业 {id companyName pageNum pageSize }") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("查询所有企业 {id companyName fieldId 行业id superviseName 监管第三方名称 pageNum pageSize }") + @LoginRequired public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){ return ResponseData.generateCreatedResponse(0,companyDictService.operators(operatorsDTO)); } @PostMapping("addCompany") - @ApiOperation("添加企业 {accountName:账号 companyName:企业名称 shortName 简称 banner:标语 field:领域 role 1:超级管理员 2:普通成员}") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("添加企业 {accountName:账号 superviseName 第三方监管名称 companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员}") + @LoginRequired public ResponseVO addOperator(@RequestBody AddCompanyDTO addCompanyDTO){ return ResponseData.generateCreatedResponse(0,companyDictService.addOperator(addCompanyDTO)); } @PostMapping("deleteCompany") @ApiOperation("删除企业 id") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO deleteAdminister(@RequestBody CompanyDictDO companyDictDO){ return ResponseData.generateCreatedResponse(0,companyDictService.deleteAdminister(companyDictDO)); } @PostMapping("updateCompany") - @ApiOperation("修改企业 id accountName:账号 companyName:企业名称 shortName 简称 banner:标语 field:领域 role 1:超级管理员 2:普通成员") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("修改企业 id superviseName 第三方监管名称 accountName:账号 logo companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员") + @LoginRequired public ResponseVO updateAdminister(@RequestBody AddCompanyDTO addCompanyDTO){ return ResponseData.generateCreatedResponse(0,companyDictService.updateAdminister(addCompanyDTO)); } + @PostMapping("getAllCompany") + @ApiOperation("获取全部企业 {companyName}") + @LoginRequired + public ResponseVO getAllCompany(@RequestBody CompanyDictDO companyDictDO){ + return ResponseData.generateCreatedResponse(0,companyDictService.getAllCompany(companyDictDO)); + } + + @PostMapping("getCompanyMembers") + @ApiOperation("获取公司里的成员 pageNum pageSize companyId 公司id userName 成员名称") + @LoginRequired + public ResponseVO getCompanyMembers(@RequestBody GetCompanyMembersDTO getCompanyMembersDTO){ + return ResponseData.generateCreatedResponse(0,companyDictService.getCompanyMembers(getCompanyMembersDTO)); + } + } diff --git a/src/main/java/com/subsidy/controller/RoleAdministerMappingController.java b/src/main/java/com/subsidy/controller/CompanyFieldMappingController.java similarity index 82% rename from src/main/java/com/subsidy/controller/RoleAdministerMappingController.java rename to src/main/java/com/subsidy/controller/CompanyFieldMappingController.java index bfc1119..ad109eb 100644 --- a/src/main/java/com/subsidy/controller/RoleAdministerMappingController.java +++ b/src/main/java/com/subsidy/controller/CompanyFieldMappingController.java @@ -12,11 +12,11 @@ import io.swagger.annotations.Api; *

* * @author DengMin - * @since 2021-10-11 + * @since 2022-02-11 */ @RestController @Api(tags = "") -@RequestMapping("/role-administer-mapping-do") -public class RoleAdministerMappingController { +@RequestMapping("/company-field-mapping-do") +public class CompanyFieldMappingController { } diff --git a/src/main/java/com/subsidy/controller/ContentVodMappingController.java b/src/main/java/com/subsidy/controller/ContentVodMappingController.java new file mode 100644 index 0000000..756352a --- /dev/null +++ b/src/main/java/com/subsidy/controller/ContentVodMappingController.java @@ -0,0 +1,65 @@ +package com.subsidy.controller; + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.content.GetContendVodsDTO; +import com.subsidy.dto.contentVod.AddContentVod; +import com.subsidy.dto.contentVod.ContentVodDTO; +import com.subsidy.dto.vod.ChangeOrdersDTO; +import com.subsidy.service.ContentVodMappingService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 目录视频关系表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-07-19 + */ +@RestController +@Api(tags = "目录视频关系表") +@RequestMapping("/contentVodMapping") +public class ContentVodMappingController { + + @Autowired + private ContentVodMappingService contentVodMappingService; + + @PostMapping("getContendVods") + @ApiOperation("获取课程内容下的视频 {contentId vodName}") + @LoginRequired + public ResponseVO getContendVods(@RequestBody GetContendVodsDTO getContendVodsDTO) { + return ResponseData.generateCreatedResponse(0, contentVodMappingService.getContendVods(getContendVodsDTO)); + } + + @PostMapping("changeContentVodOrders") + @ApiOperation("课程内容视频排序 contentId/内容ID vodIds [] 视频的id") + public ResponseVO changeContentVodOrders(@RequestBody ChangeOrdersDTO changeOrdersDTO ){ + contentVodMappingService.changeContentVodOrders(changeOrdersDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("addContentVod") + @ApiOperation("添加课程内容视频:contentId/内容ID、vodIds [] /视频ID") + @LoginRequired + public ResponseVO addContentVod(@RequestBody AddContentVod addContentVod) { + contentVodMappingService.addContentVod(addContentVod); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("deleteContentVod") + @ApiOperation("删除课程内容下的视频: contentId/内容ID 、 vodId/视频ID") + @LoginRequired + public ResponseVO deleteContentVod(@RequestBody ContentVodDTO contentVodDTO) { + contentVodMappingService.deleteContentVod(contentVodDTO); + return ResponseData.generateCreatedResponse(0); + } + +} diff --git a/src/main/java/com/subsidy/controller/MemberDepartmentMappingController.java b/src/main/java/com/subsidy/controller/CourseCategoryMappingController.java similarity index 70% rename from src/main/java/com/subsidy/controller/MemberDepartmentMappingController.java rename to src/main/java/com/subsidy/controller/CourseCategoryMappingController.java index 640c491..a53fcce 100644 --- a/src/main/java/com/subsidy/controller/MemberDepartmentMappingController.java +++ b/src/main/java/com/subsidy/controller/CourseCategoryMappingController.java @@ -8,15 +8,15 @@ import io.swagger.annotations.Api; /** *

- * 老师部门映射表 前端控制器 + * 课程类目映射 前端控制器 *

* * @author DengMin - * @since 2021-11-01 + * @since 2022-02-14 */ @RestController -@Api(tags = "老师部门映射表") -@RequestMapping("/member-department-mapping-do") -public class MemberDepartmentMappingController { +@Api(tags = "课程类目映射") +@RequestMapping("/course-category-mapping-do") +public class CourseCategoryMappingController { } diff --git a/src/main/java/com/subsidy/controller/CourseContentController.java b/src/main/java/com/subsidy/controller/CourseContentController.java index 6fc1c10..2e55786 100644 --- a/src/main/java/com/subsidy/controller/CourseContentController.java +++ b/src/main/java/com/subsidy/controller/CourseContentController.java @@ -1,21 +1,20 @@ package com.subsidy.controller; - import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.content.GetContendVodsDTO; +import com.subsidy.dto.vod.ChangeOrdersDTO; import com.subsidy.model.CourseContentDO; -import com.subsidy.model.VodDictDO; import com.subsidy.service.CourseContentService; import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; - import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; /** *

@@ -35,31 +34,29 @@ public class CourseContentController { @PostMapping("getContents") @ApiOperation("获取课程目录 {courseId}") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO getContents(@RequestBody CourseContentDO courseContentDO){ return ResponseData.generateCreatedResponse(0,courseContentService.getContents(courseContentDO)); } @PostMapping("deleteContent") @ApiOperation("删除一个目录 {id} ") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO deleteContent(@RequestBody CourseContentDO courseContentDO){ return ResponseData.generateCreatedResponse(0,courseContentService.deleteContent(courseContentDO)); } @PostMapping("addContent") @ApiOperation("添加一个目录 {courseId content}") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO addContent(@RequestBody CourseContentDO courseContentDO){ return ResponseData.generateCreatedResponse(0,courseContentService.addContent(courseContentDO)); } @PostMapping("updateContent") @ApiOperation("更新一个目录 {id courseId content}") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO updateContent(@RequestBody CourseContentDO courseContentDO){ return ResponseData.generateCreatedResponse(0,courseContentService.updateContent(courseContentDO)); } - - } diff --git a/src/main/java/com/subsidy/controller/CourseDictController.java b/src/main/java/com/subsidy/controller/CourseDictController.java index 570cd58..7c1751d 100644 --- a/src/main/java/com/subsidy/controller/CourseDictController.java +++ b/src/main/java/com/subsidy/controller/CourseDictController.java @@ -4,15 +4,19 @@ package com.subsidy.controller; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.course.AddCourseDTO; import com.subsidy.dto.course.QueryCoursesDTO; +import com.subsidy.dto.course.UpdateCoursesDTO; import com.subsidy.model.CourseDictDO; import com.subsidy.service.CourseDictService; import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** *

@@ -31,38 +35,46 @@ public class CourseDictController { private CourseDictService courseDictService; @PostMapping("addCourse") - @ApiOperation("添加课程 **companyId courseName categoryId courseType courseSource") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) - public ResponseVO addCourse(@RequestBody CourseDictDO courseDictDO){ - return ResponseData.generateCreatedResponse(0,courseDictService.addCourse(courseDictDO)); + @ApiOperation("添加课程 companyId courseName courseType coverPage openStatus remark fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[]") + @LoginRequired + public ResponseVO addCourse(@RequestBody AddCourseDTO addCourseDTO){ + return ResponseData.generateCreatedResponse(0,courseDictService.addCourse(addCourseDTO)); } @PostMapping("deleteCourse") @ApiOperation("删除课程 id") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO deleteCourse(@RequestBody CourseDictDO courseDictDO){ return ResponseData.generateCreatedResponse(0,courseDictService.deleteCourse(courseDictDO)); } @PostMapping("queryCourses") - @ApiOperation("平台运营者--查询课程 pageSize pageNum administerId companyId courseName categoryId courseType courseSource") - //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("平台运营者--查询课程 pageSize pageNum courseName fieldId categoryId jobId rankId courseType openStatus") + @LoginRequired public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){ return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO)); } @PostMapping("updateCourses") - @ApiOperation("编辑课程 id ** companyId courseName categoryId courseType courseSource") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) - public ResponseVO updateCourses(@RequestBody CourseDictDO courseDictDO){ - return ResponseData.generateCreatedResponse(0,courseDictService.updateCourses(courseDictDO)); + @ApiOperation("编辑课程 id courseName courseType coverPage openStatus fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[]") + @LoginRequired + public ResponseVO updateCourses(@RequestBody UpdateCoursesDTO updateCoursesDTO){ + return ResponseData.generateCreatedResponse(0,courseDictService.updateCourses(updateCoursesDTO)); } @PostMapping("queryCompanyCourse") - @ApiOperation("企业内容管理-- { ** companyId 所选企业id}") + @ApiOperation("企业内容管理-- { companyId 所选企业id pageSize pageNum courseName categoryId jobId rankId openStatus}") + @LoginRequired public ResponseVO queryCompanyCourse(@RequestBody QueryCoursesDTO queryCoursesDTO){ return ResponseData.generateCreatedResponse(0,courseDictService.queryCompanyCourse(queryCoursesDTO)); } + @PostMapping("updateOpenStatus") + @ApiOperation("修改课程开放状态 id openStatus") + @LoginRequired + public ResponseVO updateOpenStatus(@RequestBody CourseDictDO courseDictDO){ + return ResponseData.generateCreatedResponse(0,courseDictService.updateOpenStatus(courseDictDO)); + } + } diff --git a/src/main/java/com/subsidy/controller/PermissionsDictController.java b/src/main/java/com/subsidy/controller/CourseFieldMappingController.java similarity index 70% rename from src/main/java/com/subsidy/controller/PermissionsDictController.java rename to src/main/java/com/subsidy/controller/CourseFieldMappingController.java index c257813..830b0a4 100644 --- a/src/main/java/com/subsidy/controller/PermissionsDictController.java +++ b/src/main/java/com/subsidy/controller/CourseFieldMappingController.java @@ -8,15 +8,15 @@ import io.swagger.annotations.Api; /** *

- * 权限表 前端控制器 + * 前端控制器 *

* * @author DengMin - * @since 2021-10-11 + * @since 2022-01-20 */ @RestController -@Api(tags = "权限表") -@RequestMapping("/permissions-dict-do") -public class PermissionsDictController { +@Api(tags = "") +@RequestMapping("/courseField") +public class CourseFieldMappingController { } diff --git a/src/main/java/com/subsidy/controller/RoleDictController.java b/src/main/java/com/subsidy/controller/CourseJobMappingController.java similarity index 70% rename from src/main/java/com/subsidy/controller/RoleDictController.java rename to src/main/java/com/subsidy/controller/CourseJobMappingController.java index 76b225c..e059c6c 100644 --- a/src/main/java/com/subsidy/controller/RoleDictController.java +++ b/src/main/java/com/subsidy/controller/CourseJobMappingController.java @@ -8,15 +8,15 @@ import io.swagger.annotations.Api; /** *

- * 角色表 前端控制器 + * 课程-岗位映射表 前端控制器 *

* * @author DengMin - * @since 2021-10-11 + * @since 2022-02-14 */ @RestController -@Api(tags = "角色表") -@RequestMapping("/role-dict-do") -public class RoleDictController { +@Api(tags = "课程-岗位映射表") +@RequestMapping("/course-job-mapping-do") +public class CourseJobMappingController { } diff --git a/src/main/java/com/subsidy/controller/RolePermissionMappingController.java b/src/main/java/com/subsidy/controller/CourseRankMappingController.java similarity index 70% rename from src/main/java/com/subsidy/controller/RolePermissionMappingController.java rename to src/main/java/com/subsidy/controller/CourseRankMappingController.java index a17f192..c6bbd5b 100644 --- a/src/main/java/com/subsidy/controller/RolePermissionMappingController.java +++ b/src/main/java/com/subsidy/controller/CourseRankMappingController.java @@ -8,15 +8,15 @@ import io.swagger.annotations.Api; /** *

- * 系统用户角色表 前端控制器 + * 课程职级映射表 前端控制器 *

* * @author DengMin - * @since 2021-10-11 + * @since 2022-02-14 */ @RestController -@Api(tags = "系统用户角色表") -@RequestMapping("/role-permission-mapping-do") -public class RolePermissionMappingController { +@Api(tags = "课程职级映射表") +@RequestMapping("/course-rank-mapping-do") +public class CourseRankMappingController { } diff --git a/src/main/java/com/subsidy/controller/DepartmentDictController.java b/src/main/java/com/subsidy/controller/DepartmentDictController.java index 3958245..bb68374 100644 --- a/src/main/java/com/subsidy/controller/DepartmentDictController.java +++ b/src/main/java/com/subsidy/controller/DepartmentDictController.java @@ -4,17 +4,18 @@ package com.subsidy.controller; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.department.GetDepartmentMembersDTO; import com.subsidy.model.DepartmentDictDO; import com.subsidy.service.DepartmentDictService; import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; /** *

@@ -34,32 +35,47 @@ public class DepartmentDictController { @PostMapping("getDepartments") @ApiOperation("获取所有部门 companyId 企业id") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO getDepartments(@RequestBody DepartmentDictDO departmentDictDO){ return ResponseData.generateCreatedResponse(0,departmentDictService.getDepartments(departmentDictDO)); } @PostMapping("addDepartment") - @ApiOperation("添加部门 ** companyId departmentName leaderName parentId 父节点") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("添加部门 companyId departmentName leaderName parentId 父节点") + @LoginRequired public ResponseVO addDepartment(@RequestBody DepartmentDictDO departmentDictDO){ return ResponseData.generateCreatedResponse(0,departmentDictService.addDepartment(departmentDictDO)); } @PostMapping("deleteDepartment") @ApiOperation("删除部门 id") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO deleteDepartment(@RequestBody DepartmentDictDO departmentDictDO){ return ResponseData.generateCreatedResponse(0,departmentDictService.deleteDepartment(departmentDictDO)); } @PostMapping("updateDepartment") - @ApiOperation("编辑部门 id ** companyId departmentName leaderName parentId") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("编辑部门 id companyId departmentName leaderName parentId") + @LoginRequired public ResponseVO updateDepartment(@RequestBody DepartmentDictDO departmentDictDO){ return ResponseData.generateCreatedResponse(0,departmentDictService.updateDepartment(departmentDictDO)); } + @PostMapping("getDepartmentMembers") + @ApiOperation("获取部门成员 companyId 公司id departmentId 部门id userName startDate endDate") + @LoginRequired + public ResponseVO getDepartmentMembers(@RequestBody GetDepartmentMembersDTO getDepartmentMembersDTO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.getDepartmentMembers(getDepartmentMembersDTO)); + } + + @PostMapping("getMembers") + @ApiOperation("获取成员(树) companyId 公司id startDate endDate ") + @LoginRequired + public ResponseVO getMembers(@RequestBody GetDepartmentMembersDTO getDepartmentMembersDTO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.getMembers(getDepartmentMembersDTO)); + } + + } diff --git a/src/main/java/com/subsidy/controller/ExerciseDictController.java b/src/main/java/com/subsidy/controller/ExerciseDictController.java index 192755e..350e37c 100644 --- a/src/main/java/com/subsidy/controller/ExerciseDictController.java +++ b/src/main/java/com/subsidy/controller/ExerciseDictController.java @@ -4,17 +4,21 @@ package com.subsidy.controller; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.common.interceptor.TimeRequired; import com.subsidy.dto.exercise.GetAllExercisesDTO; +import com.subsidy.dto.exercise.GetPaperExerciseDTO; import com.subsidy.dto.exercise.SubmitDTO; import com.subsidy.model.CourseDictDO; import com.subsidy.model.ExerciseDictDO; import com.subsidy.service.ExerciseDictService; import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** *

@@ -32,45 +36,40 @@ public class ExerciseDictController { @Autowired private ExerciseDictService exerciseDictService; - @PostMapping("getAllExercises") - @ApiOperation("查询所有题目 {courseId 课程id exerciseType 题目类型 difficulty 难度 title 题目 pageSize pageNum}") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) - public ResponseVO getAllExercises(@RequestBody GetAllExercisesDTO getAllExercisesDTO){ - return ResponseData.generateCreatedResponse(0,exerciseDictService.getAllExercises(getAllExercisesDTO)); - } - @PostMapping("addExercise") - @ApiOperation("添加题目 {courseId 课程id exerciseType 题目类型 difficulty 难度 title题目 items 选项 rightAnswer 正确答案 }") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("添加题目 {paperId 试卷id courseId 课程id exerciseType 题目类型 difficulty 难度 title题目 items 选项 rightAnswer 正确答案 }") + @LoginRequired public ResponseVO addExercise(@RequestBody ExerciseDictDO exerciseDictDO){ return ResponseData.generateCreatedResponse(0,exerciseDictService.addExercise(exerciseDictDO)); } @PostMapping("deleteExercise") @ApiOperation("删除题目 id") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO deleteExercise(@RequestBody ExerciseDictDO exerciseDictDO){ return ResponseData.generateCreatedResponse(0,exerciseDictService.deleteExercise(exerciseDictDO)); } @PostMapping("updateExercise") @ApiOperation("修改题目 id exerciseType 题目类型 difficulty 难度 title题目 items 选项 rightAnswer 正确答案") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO updateExercise(@RequestBody ExerciseDictDO exerciseDictDO){ return ResponseData.generateCreatedResponse(0,exerciseDictService.updateExercise(exerciseDictDO)); } - @PostMapping("getCourseExercises") - @ApiOperation("获取课程的习题 id 课程id") - public ResponseVO getCourseExercises(@RequestBody CourseDictDO courseDictDO){ - return ResponseData.generateCreatedResponse(0,exerciseDictService.getCourseExercises(courseDictDO)); - } - @PostMapping("submit") - @ApiOperation("提交答案 {memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ]} ") + @ApiOperation("提交答案 {paperId 卷子id memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ] length:做题时长} ") + @LoginRequired + @TimeRequired public ResponseVO submit(@RequestBody SubmitDTO submitDTO){ return ResponseData.generateCreatedResponse(0,exerciseDictService.submit(submitDTO)); } + @PostMapping("getPaperExercise") + @ApiOperation("获取某个卷子的所有题目 pageSize pageNum paperId 卷子id exerciseType 类型 difficulty难度 title题目名称") + @LoginRequired + public ResponseVO getPaperExercise(@RequestBody GetPaperExerciseDTO getPaperExerciseDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.getPaperExercise(getPaperExerciseDTO)); + } } diff --git a/src/main/java/com/subsidy/controller/ExerciseDoneHistoryController.java b/src/main/java/com/subsidy/controller/ExerciseDoneHistoryController.java new file mode 100644 index 0000000..c3a6c0a --- /dev/null +++ b/src/main/java/com/subsidy/controller/ExerciseDoneHistoryController.java @@ -0,0 +1,40 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.service.ExerciseDoneHistoryService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 做题历史记录表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-12-03 + */ +@RestController +@Api(tags = "做题历史记录表") +@RequestMapping("/exerciseDoneHistory") +public class ExerciseDoneHistoryController { + + @Autowired + private ExerciseDoneHistoryService exerciseDoneHistoryService; + + @PostMapping("getDoneHistoryDetail") + @ApiOperation("获取某一个试卷每个题目的做题详情 id 提交后返回的id memberId 成员id ") + @LoginRequired + public ResponseVO getDoneHistoryDetail(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){ + return ResponseData.generateCreatedResponse(0,exerciseDoneHistoryService.getDoneHistoryDetail(exerciseDoneResultDO)); + } + +} diff --git a/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java b/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java index 8c7191f..3da169f 100644 --- a/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java +++ b/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java @@ -1,10 +1,17 @@ package com.subsidy.controller; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.common.interceptor.TimeRequired; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.service.ExerciseDoneResultService; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; /** *

@@ -19,4 +26,21 @@ import io.swagger.annotations.Api; @RequestMapping("/exerciseDoneResult") public class ExerciseDoneResultController { + @Autowired + private ExerciseDoneResultService exerciseDoneResultService; + + @PostMapping("getDoneDetail") + @ApiOperation("提交后获取做题结果 id 提交后返回的id") + @LoginRequired + @TimeRequired + public ResponseVO getDoneDetail(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){ + return ResponseData.generateCreatedResponse(0,exerciseDoneResultService.getDoneDetail(exerciseDoneResultDO)); + } + + @PostMapping("importData") + public ResponseVO makeData(@RequestParam("file") MultipartFile file){ + exerciseDoneResultService.importData(file); + return null; + } + } diff --git a/src/main/java/com/subsidy/controller/FieldDictController.java b/src/main/java/com/subsidy/controller/FieldDictController.java new file mode 100644 index 0000000..3983e1e --- /dev/null +++ b/src/main/java/com/subsidy/controller/FieldDictController.java @@ -0,0 +1,63 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.field.QueryFieldsDTO; +import com.subsidy.model.FieldDictDO; +import com.subsidy.service.FieldDictService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 行业字典表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-01-20 + */ +@RestController +@Api(tags = "行业字典表") +@RequestMapping("/fieldDict") +public class FieldDictController { + + @Autowired + private FieldDictService fieldDictService; + + @PostMapping("addField") + @ApiOperation("添加行业 fieldName 行业名称") + @LoginRequired + public ResponseVO addField(@RequestBody FieldDictDO fieldDictDO){ + return ResponseData.generateCreatedResponse(0,fieldDictService.addField(fieldDictDO)); + } + + @PostMapping("updateField") + @ApiOperation("修改行业 id fieldName 行业名称") + @LoginRequired + public ResponseVO updateField(@RequestBody FieldDictDO fieldDictDO){ + return ResponseData.generateCreatedResponse(0,fieldDictService.updateField(fieldDictDO)); + } + + @PostMapping("deleteField") + @ApiOperation("删除行业 id") + @LoginRequired + public ResponseVO deleteField(@RequestBody FieldDictDO fieldDictDO){ + return ResponseData.generateCreatedResponse(0,fieldDictService.deleteField(fieldDictDO)); + } + + @PostMapping("queryFields") + @ApiOperation("查询行业 pageSize pageNum fieldName") + @LoginRequired + public ResponseVO queryFields(@RequestBody QueryFieldsDTO queryFieldsDTO){ + return ResponseData.generateCreatedResponse(0,fieldDictService.queryFields(queryFieldsDTO)); + } + +} diff --git a/src/main/java/com/subsidy/controller/FileDictController.java b/src/main/java/com/subsidy/controller/FileDictController.java index 61f84ba..fb48868 100644 --- a/src/main/java/com/subsidy/controller/FileDictController.java +++ b/src/main/java/com/subsidy/controller/FileDictController.java @@ -5,17 +5,15 @@ import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; import com.subsidy.model.FileDictDO; -import com.subsidy.model.VodDictDO; import com.subsidy.service.FileDictService; import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; - import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; /** *

@@ -35,28 +33,28 @@ public class FileDictController { @PostMapping("getContendFiles") @ApiOperation("获取目录下的视频 {contentId fileName}") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO getContendFiles(@RequestBody FileDictDO fileDictDO){ return ResponseData.generateCreatedResponse(0,fileDictService.getContendFiles(fileDictDO)); } @PostMapping("deleteFile") - @ApiOperation("删除视频 id ") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("** 删除视频 id ") + @LoginRequired public ResponseVO deleteFile(@RequestBody FileDictDO fileDictDO){ return ResponseData.generateCreatedResponse(0,fileDictService.deleteFile(fileDictDO)); } @PostMapping("addFile") - @ApiOperation("新增视频 contentId fileName fileSize fileType fileUrl") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("** 新增视频 contentId fileName fileSize fileType fileUrl") + @LoginRequired public ResponseVO addFile(@RequestBody FileDictDO fileDictDO){ return ResponseData.generateCreatedResponse(0,fileDictService.addFile(fileDictDO)); } @PostMapping("updateFile") - @ApiOperation("新增视频 id contentId fileName fileSize fileType fileUrl") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("** 新增视频 id contentId fileName fileSize fileType fileUrl") + @LoginRequired public ResponseVO updateFile(@RequestBody FileDictDO fileDictDO){ return ResponseData.generateCreatedResponse(0,fileDictService.updateFile(fileDictDO)); } diff --git a/src/main/java/com/subsidy/controller/ImageCheckRecordController.java b/src/main/java/com/subsidy/controller/ImageCheckRecordController.java new file mode 100644 index 0000000..b3db474 --- /dev/null +++ b/src/main/java/com/subsidy/controller/ImageCheckRecordController.java @@ -0,0 +1,45 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.model.ImageCheckRecordDO; +import com.subsidy.service.ImageCheckRecordService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 实名验证记录表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-07-14 + */ +@RestController +@Api(tags = "实名验证记录表") +@RequestMapping("/imageCheckRecord") +public class ImageCheckRecordController { + + + @Autowired + private ImageCheckRecordService imageCheckRecordService; + + + @PostMapping("getImageCheckHistory") + @ApiOperation("获取某人某个班级的验证历史 memberId classId ") + @LoginRequired + public ResponseVO getImageCheckHistory(@RequestBody ImageCheckRecordDO imageCheckRecordDO){ + return ResponseData.generateCreatedResponse(0,imageCheckRecordService.getImageCheckHistory(imageCheckRecordDO)); + } + + + +} diff --git a/src/main/java/com/subsidy/controller/JobDictController.java b/src/main/java/com/subsidy/controller/JobDictController.java new file mode 100644 index 0000000..561d6f3 --- /dev/null +++ b/src/main/java/com/subsidy/controller/JobDictController.java @@ -0,0 +1,66 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.model.JobDictDO; +import com.subsidy.service.JobDictService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 岗位表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-02-10 + */ +@RestController +@Api(tags = "岗位表") +@RequestMapping("/jobDict") +//TODO: 字段类型不全 +public class JobDictController { + + @Autowired + private JobDictService jobDictService; + + @PostMapping("queryJobs") + @ApiOperation("查询某公司的岗位 companyId") + @LoginRequired + public ResponseVO queryJobs(@RequestBody JobDictDO jobDictDO){ + return ResponseData.generateCreatedResponse(0,jobDictService.queryJobs(jobDictDO)); + } + + @PostMapping("deleteJob") + @ApiOperation("删除某个岗位 id") + @LoginRequired + public ResponseVO deleteJob(@RequestBody JobDictDO jobDictDO){ + return ResponseData.generateCreatedResponse(0,jobDictService.deleteJob(jobDictDO)); + } + + @PostMapping("addJob") + @ApiOperation("添加岗位 companyId jobName") + @LoginRequired + public ResponseVO addJob(@RequestBody JobDictDO jobDictDO){ + return ResponseData.generateCreatedResponse(0,jobDictService.addJob(jobDictDO)); + } + + @PostMapping("updateJob") + @ApiOperation("更新岗位 id jobName") + @LoginRequired + public ResponseVO updateJob(@RequestBody JobDictDO jobDictDO){ + return ResponseData.generateCreatedResponse(0,jobDictService.updateJob(jobDictDO)); + } + + + + +} diff --git a/src/main/java/com/subsidy/controller/JobMemberMappingController.java b/src/main/java/com/subsidy/controller/JobMemberMappingController.java new file mode 100644 index 0000000..fea9eeb --- /dev/null +++ b/src/main/java/com/subsidy/controller/JobMemberMappingController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 岗位人员表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-02-10 + */ +@RestController +@Api(tags = "岗位人员表") +@RequestMapping("/jobMemberMapping") +public class JobMemberMappingController { + +} diff --git a/src/main/java/com/subsidy/controller/MemberController.java b/src/main/java/com/subsidy/controller/MemberController.java index c74af9e..848cb43 100644 --- a/src/main/java/com/subsidy/controller/MemberController.java +++ b/src/main/java/com/subsidy/controller/MemberController.java @@ -1,26 +1,21 @@ package com.subsidy.controller; - import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.common.interceptor.TimeRequired; import com.subsidy.dto.administer.VerifyCodeDTO; -import com.subsidy.dto.member.AddMemberDTO; -import com.subsidy.dto.member.ContentMemberDTO; -import com.subsidy.dto.member.GetAllDTO; -import com.subsidy.dto.member.StudyHistoryDTO; +import com.subsidy.dto.member.*; +import com.subsidy.model.ExerciseDoneResultDO; import com.subsidy.model.MemberDO; import com.subsidy.service.MemberService; -import com.subsidy.util.ConstantUtils; -import com.subsidy.vo.member.ContentVodVO; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; - import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; /** *

@@ -39,29 +34,29 @@ public class MemberController { private MemberService memberService; @PostMapping("getAll") - @ApiOperation("查询某部门成员 pageNum pageSize departmentId userName status") - //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("查询某部门成员 pageNum pageSize departmentId userName status startDate endDate") + @LoginRequired public ResponseVO getAll(@RequestBody GetAllDTO getAllDTO){ return ResponseData.generateCreatedResponse(0,memberService.getAll(getAllDTO)); } @PostMapping("deleteMember") @ApiOperation("删除成员 id ") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired public ResponseVO deleteMember(@RequestBody MemberDO memberDO){ return ResponseData.generateCreatedResponse(0,memberService.deleteMember(memberDO)); } @PostMapping("addMember") - @ApiOperation("新增成员 departmentId userName accountName telephone gender image idCard") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("新增成员 companyId userName accountName accountNameEn telephone gender image idCard departmentIds jobIds workNo inductionDate email") + @LoginRequired public ResponseVO addMember(@RequestBody AddMemberDTO addMemberDTO){ return ResponseData.generateCreatedResponse(0,memberService.addMember(addMemberDTO)); } @PostMapping("updateMember") - @ApiOperation("编辑成员 {id departmentId userName accountName telephone gender image idCard status}") - //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @ApiOperation("编辑成员 {id companyId userName accountName accountNameEn telephone gender image idCard status departmentIds jobIds}") + @LoginRequired public ResponseVO updateMember(@RequestBody AddMemberDTO addMemberDTO){ return ResponseData.generateCreatedResponse(0,memberService.updateMember(addMemberDTO)); } @@ -73,52 +68,134 @@ public class MemberController { } @PostMapping("passwordLogin") - @ApiOperation("手机端:密码登录 {accountName password}") - public ResponseVO passwordLogin(@RequestBody MemberDO memberDO){ - return ResponseData.generateCreatedResponse(0,memberService.passwordLogin(memberDO)); + @ApiOperation("手机端:密码登录 { companyId accountName password}") + public ResponseVO passwordLogin(@RequestBody PasswordLoginDTO passwordLoginDTO){ + return ResponseData.generateCreatedResponse(0,memberService.passwordLogin(passwordLoginDTO)); + } + + @PostMapping("qingxuetangLogin") + @ApiOperation("轻学堂登录 手机号mobile") + @TimeRequired + public ResponseVO qingxuetangLogin(@RequestBody QingxuetangLoginDTO qingxuetangLoginDTO){ + return ResponseData.generateCreatedResponse(0,memberService.qingxuetangLogin(qingxuetangLoginDTO)); + } + + @PostMapping("kunchiLogin") + @ApiOperation("鲲驰登陆 authCorpName 手机号mobile nickname timestamp sign") + @TimeRequired + public ResponseVO kunchiLogin(@RequestBody QingxuetangLoginDTO qingxuetangLoginDTO){ + return ResponseData.generateCreatedResponse(0,memberService.kunchiLogin(qingxuetangLoginDTO)); + } + + @PostMapping("checkStatus") + @ApiOperation("实名制验证状态 memberId") + @TimeRequired + public ResponseVO checkStatus(@RequestBody MemberDO memberDO){ + return ResponseData.generateCreatedResponse(0,memberService.checkStatus(memberDO)); } @PostMapping("updatePassword") @ApiOperation("修改密码 {id password}") + @LoginRequired + @TimeRequired public ResponseVO updatePassword(@RequestBody MemberDO memberDO){ return ResponseData.generateCreatedResponse(0,memberService.updatePassword(memberDO)); } - @PostMapping("studyPage") - @ApiOperation("手机端:学习主页 id 学员id") - public ResponseVO studyPage(@RequestBody MemberDO memberDO){ - return ResponseData.generateCreatedResponse(0,memberService.studyPage(memberDO)); + @PostMapping("updateCheckImage") + @ApiOperation("上传采集照片 id checkImage") + @TimeRequired + public ResponseVO updateCheckImage(@RequestBody MemberDO memberDO){ + return ResponseData.generateCreatedResponse(0,memberService.updateCheckImage(memberDO)); + } + + @PostMapping("removeCheckImage") + @ApiOperation("清除采集照片 id ") + public ResponseVO removeCheckImage(@RequestBody MemberDO memberDO){ + return ResponseData.generateCreatedResponse(0,memberService.removeCheckImage(memberDO)); + } + + @PostMapping("myCourses") + @ApiOperation("手机端:我的学习--课程 memberId 学员id status 状态 0:全部 1:进行中 2:待开始 3:已完成 ") +// @LoginRequired + @TimeRequired + public ResponseVO myCourses(@RequestBody MyCoursesDTO myCoursesDTO){ + return ResponseData.generateCreatedResponse(0,memberService.myCourses(myCoursesDTO)); } @PostMapping("contentVod") - @ApiOperation("手机端:目录+视频 courseId 课程 memberId 学员id") + @ApiOperation("手机端:目录+视频 classId 班级id courseId 课程 memberId 学员id") +// @LoginRequired + @TimeRequired public ResponseVO contentVod(@RequestBody ContentMemberDTO contentVodDTO){ return ResponseData.generateCreatedResponse(0,memberService.contentVod(contentVodDTO)); } @PostMapping("contentFiles") @ApiOperation("手机端:目录+课件 courseId 课程 memberId 学员id") + @LoginRequired + @TimeRequired public ResponseVO contentFiles(@RequestBody ContentMemberDTO contentMemberDTO){ return ResponseData.generateCreatedResponse(0,memberService.contentFiles(contentMemberDTO)); } @PostMapping("studyHistory") - @ApiOperation("学习记录 id 成员id pageSize pageNum") + @ApiOperation("学习记录 memberId 成员id pageSize pageNum") + @LoginRequired + @TimeRequired public ResponseVO studyHistory(@RequestBody StudyHistoryDTO studyHistoryDTO){ return ResponseData.generateCreatedResponse(0,memberService.studyHistory(studyHistoryDTO)); } @PostMapping("getCourseTest") - @ApiOperation("获取课程下的测试情况 {memberId 成员id courseId 课程id classId}") + @ApiOperation("获取课程下的测试情况 {memberId 成员id 班级id classId courseId 课程id }") + @LoginRequired + @TimeRequired public ResponseVO getCourseTest(@RequestBody ContentMemberDTO contentMemberDTO){ return ResponseData.generateCreatedResponse(0,memberService.getCourseTest(contentMemberDTO)); } + @PostMapping("getTestDoneDetail") + @ApiOperation("获取某个测评学生的完成情况 paperId memberId") + @LoginRequired + public ResponseVO getPaperDoneDetail(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){ + return ResponseData.generateCreatedResponse(0,memberService.getPaperDoneDetail(exerciseDoneResultDO)); + } + @PostMapping("getStudyInfo") @ApiOperation("获取学生完成课程情况 id 学员id") + @LoginRequired + @TimeRequired public ResponseVO getStudyInfo(@RequestBody MemberDO memberDO){ return ResponseData.generateCreatedResponse(0,memberService.getStudyInfo(memberDO)); } + @PostMapping("checkTimes") + @ApiOperation("检测是否超过次数 memberId paperId classId") + @LoginRequired + public ResponseVO checkTimes(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){ + return ResponseData.generateCreatedResponse(0,memberService.checkTimes(exerciseDoneResultDO)); + } + + @PostMapping("importRedis") + @ApiOperation("导入学生账号到redis") + @LoginRequired + public void importRedis(){ + memberService.importRedis(); + } + + @PostMapping("changeDepartments") + @ApiOperation("修改部门 desDepId[] 目的部门 memberIds[] 成员id") + @LoginRequired + public ResponseVO changeDepartments(@RequestBody ChangeDepartmentsDTO changeDepartmentsDTO){ + return ResponseData.generateCreatedResponse(0,memberService.changeDepartments(changeDepartmentsDTO)); + } + + @PostMapping("qxy") + @ApiOperation("Q学友授权 telephone 手机号") + @TimeRequired + public ResponseVO qxy(@RequestBody MemberDO memberDO){ + return ResponseData.generateCreatedResponse(0,memberService.qxy(memberDO)); + } } diff --git a/src/main/java/com/subsidy/controller/MemberStudyLengthController.java b/src/main/java/com/subsidy/controller/MemberStudyLengthController.java new file mode 100644 index 0000000..3b49989 --- /dev/null +++ b/src/main/java/com/subsidy/controller/MemberStudyLengthController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 前端控制器 + *

+ * + * @author DengMin + * @since 2022-01-28 + */ +@RestController +@Api(tags = "") +@RequestMapping("/member-study-length-do") +public class MemberStudyLengthController { + +} diff --git a/src/main/java/com/subsidy/controller/OprAdmDictController.java b/src/main/java/com/subsidy/controller/OprAdmDictController.java new file mode 100644 index 0000000..2b38b26 --- /dev/null +++ b/src/main/java/com/subsidy/controller/OprAdmDictController.java @@ -0,0 +1,40 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.opr.GetHistoryDTO; +import com.subsidy.service.OprAdmDictService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 审计表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-12-13 + */ +@RestController +@Api(tags = "后台审计表") +@RequestMapping("/oprAdm") +public class OprAdmDictController { + + @Autowired + private OprAdmDictService oprAdmDictService; + + @PostMapping("getHistory") + @ApiOperation("获取后台用户审计 {pageSize pageNum userName startDate endDate}") + @LoginRequired + public ResponseVO getHistory(@RequestBody GetHistoryDTO getHistoryDTO){ + return ResponseData.generateCreatedResponse(0,oprAdmDictService.getHistory(getHistoryDTO)); + } + +} diff --git a/src/main/java/com/subsidy/controller/OprMemDictController.java b/src/main/java/com/subsidy/controller/OprMemDictController.java new file mode 100644 index 0000000..a522a88 --- /dev/null +++ b/src/main/java/com/subsidy/controller/OprMemDictController.java @@ -0,0 +1,40 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.opr.GetHistoryDTO; +import com.subsidy.service.OprMemDictService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 审计表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-12-13 + */ +@RestController +@Api(tags = "学员审计表") +@RequestMapping("/oprMem") +public class OprMemDictController { + + @Autowired + private OprMemDictService oprMemDictService; + + @PostMapping("getHistory") + @ApiOperation("获取学员审计 {pageSize pageNum userName startDate endDate}") + @LoginRequired + public ResponseVO getHistory(@RequestBody GetHistoryDTO getHistoryDTO){ + return ResponseData.generateCreatedResponse(0,oprMemDictService.getHistory(getHistoryDTO)); + } + +} diff --git a/src/main/java/com/subsidy/controller/PaperDictController.java b/src/main/java/com/subsidy/controller/PaperDictController.java new file mode 100644 index 0000000..d831ca5 --- /dev/null +++ b/src/main/java/com/subsidy/controller/PaperDictController.java @@ -0,0 +1,63 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.model.PaperDictDO; +import com.subsidy.service.PaperDictService; +import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 试卷字典表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-12-03 + */ +@RestController +@Api(tags = "试卷字典表") +@RequestMapping("/paper") +public class PaperDictController { + + @Autowired + private PaperDictService paperDictService; + + @PostMapping("queryPapers") + @ApiOperation("查看课程下的测试 {courseId paperName}") + @LoginRequired + public ResponseVO queryPapers(@RequestBody PaperDictDO paperDictDO) { + return ResponseData.generateCreatedResponse(0, paperDictService.queryPapers(paperDictDO)); + } + + @PostMapping("deletePaper") + @ApiOperation("删除卷子 {id}") + @LoginRequired + public ResponseVO deletePaper(@RequestBody PaperDictDO paperDictDO) { + return ResponseData.generateCreatedResponse(0, paperDictService.deletePaper(paperDictDO)); + } + + @PostMapping("update") + @ApiOperation("启用/禁用 {id paperStatus}") + @LoginRequired + public ResponseVO updateStatus(@RequestBody PaperDictDO paperDictDO) { + return ResponseData.generateCreatedResponse(0, paperDictService.updateStatus(paperDictDO)); + } + + @PostMapping("addPaper") + @ApiOperation("添加卷子 {courseId paperName}") + @LoginRequired + public ResponseVO addPaper(@RequestBody PaperDictDO paperDictDO) { + return ResponseData.generateCreatedResponse(0, paperDictService.addPaper(paperDictDO)); + } + + +} diff --git a/src/main/java/com/subsidy/controller/RankDictController.java b/src/main/java/com/subsidy/controller/RankDictController.java new file mode 100644 index 0000000..91e0f9f --- /dev/null +++ b/src/main/java/com/subsidy/controller/RankDictController.java @@ -0,0 +1,64 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.mapper.RankDictMapper; +import com.subsidy.model.RankDictDO; +import com.subsidy.service.RankDictService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 职级字典表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@RestController +@Api(tags = "职级字典表") +@RequestMapping("/rankDict") +public class RankDictController { + + @Autowired + private RankDictService rankDictService; + + @PostMapping("addRank") + @ApiOperation("添加职级 companyId rank") + @LoginRequired + public ResponseVO addRank(@RequestBody RankDictDO rankDictDO){ + return ResponseData.generateCreatedResponse(0,rankDictService.addRank(rankDictDO)); + } + + @PostMapping("deleteRank") + @ApiOperation("删除职级 id") + @LoginRequired + public ResponseVO deleteById(@RequestBody RankDictDO rankDictDO){ + return ResponseData.generateCreatedResponse(0,rankDictService.deleteRank(rankDictDO)); + } + + @PostMapping("updateRank") + @ApiOperation("添加职级 id rank") + @LoginRequired + public ResponseVO updateRank(@RequestBody RankDictDO rankDictDO){ + return ResponseData.generateCreatedResponse(0,rankDictService.updateRank(rankDictDO)); + } + + @PostMapping("queryRanks") + @ApiOperation("查看职级 companyId") + @LoginRequired + public ResponseVO queryRanks(@RequestBody RankDictDO rankDictDO){ + return ResponseData.generateCreatedResponse(0,rankDictService.queryRanks(rankDictDO)); + } + +} diff --git a/src/main/java/com/subsidy/controller/RotationImgDictController.java b/src/main/java/com/subsidy/controller/RotationImgDictController.java new file mode 100644 index 0000000..9b844ed --- /dev/null +++ b/src/main/java/com/subsidy/controller/RotationImgDictController.java @@ -0,0 +1,62 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.model.RotationImgDictDO; +import com.subsidy.service.RotationImgDictService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 轮播图 前端控制器 + *

+ * + * @author DengMin + * @since 2022-02-23 + */ +@RestController +@Api(tags = "轮播图") +@RequestMapping("/rotationImgDict") +public class RotationImgDictController { + + @Autowired + private RotationImgDictService rotationImgDictService; + + @PostMapping("addRotation") + @ApiOperation("添加轮播图 {companyId 公司id rotationImg 轮播图地址}") + @LoginRequired + public ResponseVO addRotation(@RequestBody RotationImgDictDO rotationImgDictDO){ + return ResponseData.generateCreatedResponse(0,rotationImgDictService.addRotation(rotationImgDictDO)); + } + + @PostMapping("deleteRotation") + @ApiOperation("删除轮播图 {id}") + @LoginRequired + public ResponseVO deleteRotation(@RequestBody RotationImgDictDO rotationImgDictDO){ + return ResponseData.generateCreatedResponse(0,rotationImgDictService.deleteRotation(rotationImgDictDO)); + } + + @PostMapping("updateRotation") + @ApiOperation("编辑轮播图 id") + @LoginRequired + public ResponseVO updateRotation(@RequestBody RotationImgDictDO rotationImgDictDO){ + return ResponseData.generateCreatedResponse(0,rotationImgDictService.updateRotation(rotationImgDictDO)); + } + + @PostMapping("getAllRotations") + @ApiOperation("获取某企业的轮播图 companyId") + @LoginRequired + public ResponseVO getAllRotations(@RequestBody RotationImgDictDO rotationImgDictDO){ + return ResponseData.generateCreatedResponse(0,rotationImgDictService.getAllRotations(rotationImgDictDO)); + } + +} diff --git a/src/main/java/com/subsidy/controller/SignInRecordController.java b/src/main/java/com/subsidy/controller/SignInRecordController.java index d2036b5..935e96d 100644 --- a/src/main/java/com/subsidy/controller/SignInRecordController.java +++ b/src/main/java/com/subsidy/controller/SignInRecordController.java @@ -4,21 +4,19 @@ package com.subsidy.controller; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.common.interceptor.TimeRequired; import com.subsidy.dto.member.GetMemberSignInfoDTO; -import com.subsidy.dto.sign.ClassSignInfoDTO; -import com.subsidy.dto.sign.SignInDTO; -import com.subsidy.model.MemberDO; +import com.subsidy.dto.sign.DataViewDTO; import com.subsidy.model.SignInRecordDO; import com.subsidy.service.SignInRecordService; import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; - import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; /** *

@@ -38,27 +36,37 @@ public class SignInRecordController { @PostMapping("getMemberSignInfo") @ApiOperation("获取某个成员的签到记录 id 成员id pageSize pageNum") - public ResponseVO getMemberSignInfo(@RequestBody GetMemberSignInfoDTO getMemberSignInfoDTO){ - return ResponseData.generateCreatedResponse(0,signInRecordService.getMemberSignInfo(getMemberSignInfoDTO)); + @LoginRequired + public ResponseVO getMemberSignInfo(@RequestBody GetMemberSignInfoDTO getMemberSignInfoDTO) { + return ResponseData.generateCreatedResponse(0, signInRecordService.getMemberSignInfo(getMemberSignInfoDTO)); } @PostMapping("signIn") @ApiOperation("签到 memberId") - public ResponseVO signIn(@RequestBody SignInRecordDO signInRecordDO){ - return ResponseData.generateCreatedResponse(0,signInRecordService.signIn(signInRecordDO)); + @LoginRequired + @TimeRequired + public ResponseVO signIn(@RequestBody SignInRecordDO signInRecordDO) { + return ResponseData.generateCreatedResponse(0, signInRecordService.signIn(signInRecordDO)); } - @PostMapping("classStudyHistory") - @ApiOperation("校区学习记录 id 校区id className courseName pageSize pageNum") - //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) - public ResponseVO classSignInfo(@RequestBody ClassSignInfoDTO classSignInfoDTO){ - return ResponseData.generateCreatedResponse(0,signInRecordService.classSignInfo(classSignInfoDTO)); + @PostMapping("dataView") + @ApiOperation("数据概览 id 校区id className pageSize pageNum") + @LoginRequired + public ResponseVO dataView(@RequestBody DataViewDTO classSignInfoDTO) { + return ResponseData.generateCreatedResponse(0, signInRecordService.dataView(classSignInfoDTO)); } @PostMapping("signInStatus") @ApiOperation("判断学生当天有没有打卡 {memberId 学生id}") - public ResponseVO signInStatus(@RequestBody SignInRecordDO signInRecordDO){ - return ResponseData.generateCreatedResponse(0,signInRecordService.signInStatus(signInRecordDO)); + @LoginRequired + @TimeRequired + public ResponseVO signInStatus(@RequestBody SignInRecordDO signInRecordDO) { + return ResponseData.generateCreatedResponse(0, signInRecordService.signInStatus(signInRecordDO)); + } + + @PostMapping("getRedisData") + public void test() { + signInRecordService.test(); } } diff --git a/src/main/java/com/subsidy/controller/SmsVerifyCodeController.java b/src/main/java/com/subsidy/controller/SmsVerifyCodeController.java index e8f1d91..6c17e9b 100644 --- a/src/main/java/com/subsidy/controller/SmsVerifyCodeController.java +++ b/src/main/java/com/subsidy/controller/SmsVerifyCodeController.java @@ -3,16 +3,16 @@ package com.subsidy.controller; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.TimeRequired; import com.subsidy.dto.sms.SendVerifyCodeDTO; import com.subsidy.service.SmsVerifyCodeService; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; - import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; /** *

@@ -32,6 +32,7 @@ public class SmsVerifyCodeController { @PostMapping(value = "/send") @ApiOperation("发送短信验证码 {telephone} ") + @TimeRequired public ResponseVO sendVerifyCode(@RequestBody SendVerifyCodeDTO sendVerifyCodeDTO ) { smsVerifyCodeService.sendVerifyCode(sendVerifyCodeDTO); return ResponseData.generateCreatedResponse(0); diff --git a/src/main/java/com/subsidy/controller/VodDictController.java b/src/main/java/com/subsidy/controller/VodDictController.java index 0b5e6be..e46b725 100644 --- a/src/main/java/com/subsidy/controller/VodDictController.java +++ b/src/main/java/com/subsidy/controller/VodDictController.java @@ -1,21 +1,19 @@ package com.subsidy.controller; - import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; -import com.subsidy.dto.content.GetContendVodsDTO; +import com.subsidy.dto.vod.ChangeOrdersDTO; import com.subsidy.model.VodDictDO; import com.subsidy.service.VodDictService; import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; - import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; /** *

@@ -35,38 +33,39 @@ public class VodDictController { @PostMapping("/signature") @ApiOperation("获取签名") - public ResponseVO signature()throws Exception{ - return ResponseData.generateCreatedResponse(0,vodDictService.signature()); - } - - @PostMapping("getContendVods") - @ApiOperation("获取目录下的视频 {contentId vodName}") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) - public ResponseVO getContendVods(@RequestBody GetContendVodsDTO getContendVodsDTO){ - return ResponseData.generateCreatedResponse(0,vodDictService.getContendVods(getContendVodsDTO)); + public ResponseVO signature() throws Exception { + return ResponseData.generateCreatedResponse(0, vodDictService.signature()); } @PostMapping("deleteVod") @ApiOperation("删除视频 id ") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) - public ResponseVO deleteVod(@RequestBody VodDictDO vodDictDO){ - return ResponseData.generateCreatedResponse(0,vodDictService.deleteVod(vodDictDO)); + @LoginRequired + public ResponseVO deleteVod(@RequestBody VodDictDO vodDictDO) { + vodDictService.deleteVod(vodDictDO); + return ResponseData.generateCreatedResponse(0); } @PostMapping("addVod") - @ApiOperation("新增视频 contentId vodName vodLength vodType vodSize vodUrl vodCode") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) - public ResponseVO addVod(@RequestBody VodDictDO vodDictDO){ - return ResponseData.generateCreatedResponse(0,vodDictService.addVod(vodDictDO)); + @ApiOperation("新增视频 labelId vodName vodLength vodType vodSize vodUrl vodCode") + @LoginRequired + public ResponseVO addVod(@RequestBody VodDictDO vodDictDO) { + vodDictService.addVod(vodDictDO); + return ResponseData.generateCreatedResponse(0, ConstantUtils.ADD_SUCCESS); } @PostMapping("updateVod") - @ApiOperation("新增视频 id contentId vodName vodLength vodType vodSize vodUrl vodCode") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) - public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO){ - return ResponseData.generateCreatedResponse(0,vodDictService.updateVod(vodDictDO)); + @ApiOperation("新增视频 id labelId vodName vodLength vodType vodSize vodUrl vodCode") + @LoginRequired + public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO) { + vodDictService.updateVod(vodDictDO); + return ResponseData.generateCreatedResponse(0, ConstantUtils.SET_SUCCESS); } - + @PostMapping("changeOrders") + @ApiOperation("排序 vodIds [] 视频的id") + public ResponseVO changeOrders(@RequestBody ChangeOrdersDTO changeOrdersDTO ){ + vodDictService.changeOrders(changeOrdersDTO); + return ResponseData.generateCreatedResponse(0,ConstantUtils.SET_SUCCESS); + } } diff --git a/src/main/java/com/subsidy/controller/VodLabelDictController.java b/src/main/java/com/subsidy/controller/VodLabelDictController.java new file mode 100644 index 0000000..7525d6c --- /dev/null +++ b/src/main/java/com/subsidy/controller/VodLabelDictController.java @@ -0,0 +1,70 @@ +package com.subsidy.controller; + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.label.VodLabelPageDTO; +import com.subsidy.model.VodLabelDictDO; +import com.subsidy.service.VodLableDictService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 视频库类目表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-07-19 + */ +@RestController +@Api(tags = "视频库类目表") +@RequestMapping("/vodLabelDict") +public class VodLabelDictController { + + @Autowired + private VodLableDictService vodLableDictService; + + @PostMapping(value = "addVodLabel") + @ApiOperation("添加视频类目: labelName/类目名称") + @LoginRequired + public ResponseVO addVodLabel(@RequestBody VodLabelDictDO vodLabelDictDO) { + vodLableDictService.save(vodLabelDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "updateVodLabel") + @ApiOperation("添加视频类目: id/类目ID、labelName/类目名称") + @LoginRequired + public ResponseVO updateVodLabel(@RequestBody VodLabelDictDO vodLabelDictDO) { + vodLableDictService.updateById(vodLabelDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "deleteVodLabel") + @ApiOperation("添加视频类目: id/类目ID") + @LoginRequired + public ResponseVO deleteVodLabel(@RequestBody VodLabelDictDO vodLabelDictDO) { + vodLableDictService.removeById(vodLabelDictDO.getId()); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "queryVodLabelPage") + @ApiOperation("分页查询视频类目: labelName/名称、pageNum/但前页数、pageSize/每页显示条数") + @LoginRequired + public ResponseVO queryVodLabelPage(@RequestBody VodLabelPageDTO vodLabelPageDTO) { + return ResponseData.generateCreatedResponse(0, vodLableDictService.queryVodLabelPage(vodLabelPageDTO)); + } + + @PostMapping(value = "queryVodLabel") + @ApiOperation("查询全部视频类目") + @LoginRequired + public ResponseVO queryVodLabel() { + return ResponseData.generateCreatedResponse(0, vodLableDictService.list()); + } +} diff --git a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java index 22fad72..1f6b79e 100644 --- a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java +++ b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java @@ -4,16 +4,20 @@ package com.subsidy.controller; import com.alibaba.fastjson.JSON; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.common.interceptor.TimeRequired; +import com.subsidy.dto.vod.InsertHistoryNewDTO; +import com.subsidy.dto.vod.RemainSecondsDTO; +import com.subsidy.dto.vod.SignDatePlaysDTO; import com.subsidy.model.VodPlayHistoryDO; import com.subsidy.service.VodPlayHistoryService; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; - import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; /** *

@@ -33,14 +37,54 @@ public class VodPlayHistoryController { @PostMapping("insertHistory") @ApiOperation("记录学生看视频位置 ajax请求 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点") + @LoginRequired + @TimeRequired public ResponseVO insertHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){ return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistory(vodPlayHistoryDO)); } @RequestMapping("insertHistoryNew") @ApiOperation("记录学生看视频位置 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点") +// @LoginRequired + @TimeRequired public ResponseVO insertHistoryNew(@RequestBody String param){ - VodPlayHistoryDO vodPlayHistoryDO = JSON.parseObject(param,VodPlayHistoryDO.class); - return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistoryNew(vodPlayHistoryDO)); + InsertHistoryNewDTO insertHistoryNewDTO = JSON.parseObject(param, InsertHistoryNewDTO.class); + return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistoryNew(insertHistoryNewDTO)); + } + + @PostMapping("dataFix") + @ApiOperation("每个视频都看一次") +// @LoginRequired + public void dadaFix(@RequestBody SignDatePlaysDTO dataFixDTO){ + vodPlayHistoryService.dataFix(dataFixDTO); + } + + @PostMapping("signDatePlays") + @ApiOperation("每天接着看几个视频 接dataFix的") +// @LoginRequired + public void signDatePlays(@RequestBody SignDatePlaysDTO signDatePlaysDTO ){ + vodPlayHistoryService.signDatePlays(signDatePlaysDTO); } + + @PostMapping("remainSeconds") + @ApiOperation("每个视频先看一下,然后剩余时长分配到每天里 classId memberId") +// @LoginRequired + public void remainSeconds(@RequestBody RemainSecondsDTO remainSecondsDTO){ + vodPlayHistoryService.remainSeconds(remainSecondsDTO); + } + + @PostMapping("playLengthFix") + @ApiOperation("按照时长去跑脚本 {classId memberId}") +// @LoginRequired + public void playLengthFix(@RequestBody RemainSecondsDTO remainSecondsDTO){ + vodPlayHistoryService.playLengthFix(remainSecondsDTO); + } + + + @PostMapping("testPlays") + @ApiOperation("解决有交叉时间的数据") + public ResponseVO testPlays(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){ + return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.testPlays(vodPlayHistoryDO)); + } + } diff --git a/src/main/java/com/subsidy/dto/administer/ClassDailyInfoDTO.java b/src/main/java/com/subsidy/dto/administer/ClassDailyInfoDTO.java new file mode 100644 index 0000000..5b5db3c --- /dev/null +++ b/src/main/java/com/subsidy/dto/administer/ClassDailyInfoDTO.java @@ -0,0 +1,22 @@ +package com.subsidy.dto.administer; + +import lombok.Data; + +@Data +public class ClassDailyInfoDTO { + + private Long classId; + + private String userName; + + private Long courseId; + + private String startDate; + + private String endDate; + + private Integer pageSize; + + private Integer pageNum; + +} diff --git a/src/main/java/com/subsidy/dto/administer/ClassDetailDTO.java b/src/main/java/com/subsidy/dto/administer/ClassDetailDTO.java index 4615d99..0c61956 100644 --- a/src/main/java/com/subsidy/dto/administer/ClassDetailDTO.java +++ b/src/main/java/com/subsidy/dto/administer/ClassDetailDTO.java @@ -15,4 +15,6 @@ public class ClassDetailDTO { Boolean flag; + private Long paperId; + } diff --git a/src/main/java/com/subsidy/dto/administer/ClassVodDailyInfoDTO.java b/src/main/java/com/subsidy/dto/administer/ClassVodDailyInfoDTO.java new file mode 100644 index 0000000..cc4ae0a --- /dev/null +++ b/src/main/java/com/subsidy/dto/administer/ClassVodDailyInfoDTO.java @@ -0,0 +1,16 @@ +package com.subsidy.dto.administer; + +import lombok.Data; + +@Data +public class ClassVodDailyInfoDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long classId; + + private String userName; + +} diff --git a/src/main/java/com/subsidy/dto/administer/ClassVodInfoDTO.java b/src/main/java/com/subsidy/dto/administer/ClassVodInfoDTO.java new file mode 100644 index 0000000..a6a2caf --- /dev/null +++ b/src/main/java/com/subsidy/dto/administer/ClassVodInfoDTO.java @@ -0,0 +1,15 @@ +package com.subsidy.dto.administer; + + +import lombok.Data; + +@Data +public class ClassVodInfoDTO { + + private Long classId; + + private String vodName; + + private Long courseId; + +} diff --git a/src/main/java/com/subsidy/dto/administer/ManageMemberDTO.java b/src/main/java/com/subsidy/dto/administer/ManageMemberDTO.java new file mode 100644 index 0000000..aa57883 --- /dev/null +++ b/src/main/java/com/subsidy/dto/administer/ManageMemberDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.administer; + +import lombok.Data; + +@Data +public class ManageMemberDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String userName; + +} diff --git a/src/main/java/com/subsidy/dto/administer/MemberStudyLogDTO.java b/src/main/java/com/subsidy/dto/administer/MemberStudyLogDTO.java new file mode 100644 index 0000000..4920263 --- /dev/null +++ b/src/main/java/com/subsidy/dto/administer/MemberStudyLogDTO.java @@ -0,0 +1,16 @@ +package com.subsidy.dto.administer; + +import lombok.Data; + +@Data +public class MemberStudyLogDTO { + + private Long memberId; + + private Long classId; + + private Integer pageSize; + + private Integer pageNum; + +} diff --git a/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java b/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java index 4e3ecbc..567085b 100644 --- a/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java +++ b/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java @@ -11,10 +11,14 @@ public class OperatorsDTO { private Integer role; + private Long fieldId; + private String companyName; private String userName; - private Integer id; + private Long id; + + private String superviseName; } diff --git a/src/main/java/com/subsidy/dto/businessScope/BusinessScopeDTO.java b/src/main/java/com/subsidy/dto/businessScope/BusinessScopeDTO.java new file mode 100644 index 0000000..2e4491e --- /dev/null +++ b/src/main/java/com/subsidy/dto/businessScope/BusinessScopeDTO.java @@ -0,0 +1,13 @@ +package com.subsidy.dto.businessScope; + +import lombok.Data; + +@Data +public class BusinessScopeDTO { + + private String businessScopeName; + + private Integer pageNum; + + private Integer pageSize; +} diff --git a/src/main/java/com/subsidy/dto/cert/AddCertDTO.java b/src/main/java/com/subsidy/dto/cert/AddCertDTO.java new file mode 100644 index 0000000..f216892 --- /dev/null +++ b/src/main/java/com/subsidy/dto/cert/AddCertDTO.java @@ -0,0 +1,13 @@ +package com.subsidy.dto.cert; + +import com.subsidy.model.CertDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddCertDTO extends CertDictDO { + + private List typeIds; + +} diff --git a/src/main/java/com/subsidy/dto/cert/ChangeCompanyCertsDTO.java b/src/main/java/com/subsidy/dto/cert/ChangeCompanyCertsDTO.java new file mode 100644 index 0000000..c10dec0 --- /dev/null +++ b/src/main/java/com/subsidy/dto/cert/ChangeCompanyCertsDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.cert; + +import lombok.Data; + +@Data +public class ChangeCompanyCertsDTO { + + private Long companyId; + + private Long certId; + + private Boolean signStatus; + +} diff --git a/src/main/java/com/subsidy/dto/cert/GetAllCertsDTO.java b/src/main/java/com/subsidy/dto/cert/GetAllCertsDTO.java new file mode 100644 index 0000000..b7bd620 --- /dev/null +++ b/src/main/java/com/subsidy/dto/cert/GetAllCertsDTO.java @@ -0,0 +1,17 @@ +package com.subsidy.dto.cert; + +import lombok.Data; + +@Data +public class GetAllCertsDTO { + + + private Integer pageSize; + + private Integer pageNum; + + private Long typeId; + + private String certName; + +} diff --git a/src/main/java/com/subsidy/dto/cert/GetAllTypeDTO.java b/src/main/java/com/subsidy/dto/cert/GetAllTypeDTO.java new file mode 100644 index 0000000..4f8e555 --- /dev/null +++ b/src/main/java/com/subsidy/dto/cert/GetAllTypeDTO.java @@ -0,0 +1,12 @@ +package com.subsidy.dto.cert; + +import lombok.Data; + +@Data +public class GetAllTypeDTO { + + private Integer pageSize; + + private Integer pageNum; + +} diff --git a/src/main/java/com/subsidy/dto/cert/GetCompanyCertsDTO.java b/src/main/java/com/subsidy/dto/cert/GetCompanyCertsDTO.java new file mode 100644 index 0000000..1c70b64 --- /dev/null +++ b/src/main/java/com/subsidy/dto/cert/GetCompanyCertsDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.cert; + +import lombok.Data; + +@Data +public class GetCompanyCertsDTO { + + private Long companyId; + + private Integer pageSize; + + private Integer pageNum; + +} diff --git a/src/main/java/com/subsidy/dto/cert/GetCompanyCertsWithStatusDTO.java b/src/main/java/com/subsidy/dto/cert/GetCompanyCertsWithStatusDTO.java new file mode 100644 index 0000000..c7093fe --- /dev/null +++ b/src/main/java/com/subsidy/dto/cert/GetCompanyCertsWithStatusDTO.java @@ -0,0 +1,15 @@ +package com.subsidy.dto.cert; + +import lombok.Data; + +@Data +public class GetCompanyCertsWithStatusDTO { + + private Long companyId; + + private Long typeId; + + private Long memberId; + + +} diff --git a/src/main/java/com/subsidy/dto/cert/GetListDTO.java b/src/main/java/com/subsidy/dto/cert/GetListDTO.java new file mode 100644 index 0000000..af2aff9 --- /dev/null +++ b/src/main/java/com/subsidy/dto/cert/GetListDTO.java @@ -0,0 +1,18 @@ +package com.subsidy.dto.cert; + +import lombok.Data; + +@Data +public class GetListDTO { + + + private Integer pageSize; + + private Integer pageNum; + + private String status; + + private Long memberId; + + +} diff --git a/src/main/java/com/subsidy/dto/cert/GetOneCertDTO.java b/src/main/java/com/subsidy/dto/cert/GetOneCertDTO.java new file mode 100644 index 0000000..fc93a88 --- /dev/null +++ b/src/main/java/com/subsidy/dto/cert/GetOneCertDTO.java @@ -0,0 +1,12 @@ +package com.subsidy.dto.cert; + +import lombok.Data; + +@Data +public class GetOneCertDTO { + + private Integer id; + + private Long userId; + +} diff --git a/src/main/java/com/subsidy/dto/cert/SignManagementDTO.java b/src/main/java/com/subsidy/dto/cert/SignManagementDTO.java new file mode 100644 index 0000000..507d65f --- /dev/null +++ b/src/main/java/com/subsidy/dto/cert/SignManagementDTO.java @@ -0,0 +1,24 @@ +package com.subsidy.dto.cert; + +import lombok.Data; + +@Data +public class SignManagementDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long typeId; + + private Long certId; + + private String startDate; + + private String endDate; + + private String item; + + private String status; + +} diff --git a/src/main/java/com/subsidy/dto/cert/SignUpDTO.java b/src/main/java/com/subsidy/dto/cert/SignUpDTO.java new file mode 100644 index 0000000..abc4a25 --- /dev/null +++ b/src/main/java/com/subsidy/dto/cert/SignUpDTO.java @@ -0,0 +1,17 @@ +package com.subsidy.dto.cert; + +import com.subsidy.model.CertMemberFileMappingDO; +import lombok.Data; + +import java.util.List; + +@Data +public class SignUpDTO { + + private Long certId; + + private Long memberId; + + private List files; + +} diff --git a/src/main/java/com/subsidy/dto/classDict/AddClassDTO.java b/src/main/java/com/subsidy/dto/classDict/AddClassDTO.java index 4736d2c..9933f04 100644 --- a/src/main/java/com/subsidy/dto/classDict/AddClassDTO.java +++ b/src/main/java/com/subsidy/dto/classDict/AddClassDTO.java @@ -1,11 +1,17 @@ package com.subsidy.dto.classDict; import com.subsidy.model.ClassDictDO; +import com.subsidy.model.ClassNoticeDO; import lombok.Data; +import java.util.List; + @Data public class AddClassDTO extends ClassDictDO { private Long userId; + private List memberIds; + + private List classNoticeDOS; } diff --git a/src/main/java/com/subsidy/dto/classDict/ClassTypeDTO.java b/src/main/java/com/subsidy/dto/classDict/ClassTypeDTO.java new file mode 100644 index 0000000..25e412c --- /dev/null +++ b/src/main/java/com/subsidy/dto/classDict/ClassTypeDTO.java @@ -0,0 +1,12 @@ +package com.subsidy.dto.classDict; + +import lombok.Data; + +@Data +public class ClassTypeDTO { + + private Long userId; + + private Long companyId; + +} diff --git a/src/main/java/com/subsidy/dto/classDict/GetClassBaseInfoDTO.java b/src/main/java/com/subsidy/dto/classDict/GetClassBaseInfoDTO.java new file mode 100644 index 0000000..615ec91 --- /dev/null +++ b/src/main/java/com/subsidy/dto/classDict/GetClassBaseInfoDTO.java @@ -0,0 +1,12 @@ +package com.subsidy.dto.classDict; + +import lombok.Data; + +@Data +public class GetClassBaseInfoDTO { + + private Long userId; + + private Long id; + +} diff --git a/src/main/java/com/subsidy/dto/classNotice/SendNotificationDTO.java b/src/main/java/com/subsidy/dto/classNotice/SendNotificationDTO.java new file mode 100644 index 0000000..bfa506d --- /dev/null +++ b/src/main/java/com/subsidy/dto/classNotice/SendNotificationDTO.java @@ -0,0 +1,11 @@ +package com.subsidy.dto.classNotice; + +import lombok.Data; + +@Data +public class SendNotificationDTO { + + private Long classId; + + private String sendType; +} diff --git a/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java b/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java index ef03529..bf6d2a4 100644 --- a/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java +++ b/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java @@ -3,6 +3,8 @@ package com.subsidy.dto.company; import com.subsidy.model.CompanyDictDO; import lombok.Data; +import java.util.List; + @Data public class AddCompanyDTO extends CompanyDictDO { @@ -14,4 +16,6 @@ public class AddCompanyDTO extends CompanyDictDO { private Integer role; + private List field; + } diff --git a/src/main/java/com/subsidy/dto/company/GetCompanyMembersDTO.java b/src/main/java/com/subsidy/dto/company/GetCompanyMembersDTO.java new file mode 100644 index 0000000..2c469c3 --- /dev/null +++ b/src/main/java/com/subsidy/dto/company/GetCompanyMembersDTO.java @@ -0,0 +1,16 @@ +package com.subsidy.dto.company; + +import lombok.Data; + +@Data +public class GetCompanyMembersDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long companyId; + + private String userName; + +} diff --git a/src/main/java/com/subsidy/dto/contentVod/AddContentVod.java b/src/main/java/com/subsidy/dto/contentVod/AddContentVod.java new file mode 100644 index 0000000..8bee165 --- /dev/null +++ b/src/main/java/com/subsidy/dto/contentVod/AddContentVod.java @@ -0,0 +1,13 @@ +package com.subsidy.dto.contentVod; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddContentVod { + + private List vodIds; + + private Long contentId; +} diff --git a/src/main/java/com/subsidy/dto/contentVod/ContentVodDTO.java b/src/main/java/com/subsidy/dto/contentVod/ContentVodDTO.java new file mode 100644 index 0000000..06f2edc --- /dev/null +++ b/src/main/java/com/subsidy/dto/contentVod/ContentVodDTO.java @@ -0,0 +1,11 @@ +package com.subsidy.dto.contentVod; + +import lombok.Data; + +@Data +public class ContentVodDTO { + + private Long contentId; + + private Long vodId; +} diff --git a/src/main/java/com/subsidy/dto/course/AddCourseDTO.java b/src/main/java/com/subsidy/dto/course/AddCourseDTO.java new file mode 100644 index 0000000..5b576b9 --- /dev/null +++ b/src/main/java/com/subsidy/dto/course/AddCourseDTO.java @@ -0,0 +1,65 @@ +package com.subsidy.dto.course; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddCourseDTO { + + /** + * 企业id + */ + private Long companyId; + + /** + * 课程名称 + */ + private String courseName; + + /** + * 课程类型 + */ + private String courseType; + + /** + * 课程来源 + */ + private String courseSource; + + /** + * 封面 + */ + private String coverPage; + + /** + * 备注 + */ + private String remark; + + /** + * 开放状态 + */ + private Integer openStatus; + + /** + * 行业范围 + */ + private List fieldDictDOS; + + /** + * 课程类目 + */ + private List categoryDOS; + + /** + * 适用岗位 + */ + private List jobDictDOS; + + /** + * 适用职级 + */ + private List rankDictDOS; + +} diff --git a/src/main/java/com/subsidy/dto/GetCourseQuestionDTO.java b/src/main/java/com/subsidy/dto/course/GetCourseQuestionDTO.java similarity index 88% rename from src/main/java/com/subsidy/dto/GetCourseQuestionDTO.java rename to src/main/java/com/subsidy/dto/course/GetCourseQuestionDTO.java index e544f88..0e4a22a 100644 --- a/src/main/java/com/subsidy/dto/GetCourseQuestionDTO.java +++ b/src/main/java/com/subsidy/dto/course/GetCourseQuestionDTO.java @@ -1,4 +1,4 @@ -package com.subsidy.dto; +package com.subsidy.dto.course; import lombok.Data; diff --git a/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java b/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java index 4e424a0..1e6db0c 100644 --- a/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java +++ b/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java @@ -2,8 +2,6 @@ package com.subsidy.dto.course; import lombok.Data; -import java.util.List; - @Data public class QueryCoursesDTO { @@ -17,12 +15,14 @@ public class QueryCoursesDTO { private String courseType; - private String courseSource; + private Long fieldId; + + private Long rankId; - private Long administerId; + private Long jobId; private Long companyId; - private List teacherIds; + private Integer openStatus; } diff --git a/src/main/java/com/subsidy/dto/course/UpdateCoursesDTO.java b/src/main/java/com/subsidy/dto/course/UpdateCoursesDTO.java new file mode 100644 index 0000000..f60bf41 --- /dev/null +++ b/src/main/java/com/subsidy/dto/course/UpdateCoursesDTO.java @@ -0,0 +1,58 @@ +package com.subsidy.dto.course; + +import lombok.Data; + +import java.util.List; + +@Data +public class UpdateCoursesDTO { + + private Long id; + + /** + * + */ + private Long companyId; + + /** + * 课程名称 + */ + private String courseName; + + /** + * 封面 + */ + private String coverPage; + + /** + * 课程类型 + */ + private String courseType; + + /** + * 备注 + */ + private String remark; + + /** + * 行业范围 + */ + private List fieldDictDOS; + + /** + * 课程类目 + */ + private List categoryDOS; + + /** + * 适用岗位 + */ + private List jobDictDOS; + + /** + * 适用职级 + */ + private List rankDictDOS; + + +} diff --git a/src/main/java/com/subsidy/dto/department/GetDepartmentMembersDTO.java b/src/main/java/com/subsidy/dto/department/GetDepartmentMembersDTO.java new file mode 100644 index 0000000..9608a82 --- /dev/null +++ b/src/main/java/com/subsidy/dto/department/GetDepartmentMembersDTO.java @@ -0,0 +1,21 @@ +package com.subsidy.dto.department; + +import lombok.Data; + +@Data +public class GetDepartmentMembersDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long departmentId; + + private Long companyId; + + private String userName; + + private String startDate; + + private String endDate; +} diff --git a/src/main/java/com/subsidy/dto/detection/VerifyDTO.java b/src/main/java/com/subsidy/dto/detection/VerifyDTO.java new file mode 100644 index 0000000..b2e963c --- /dev/null +++ b/src/main/java/com/subsidy/dto/detection/VerifyDTO.java @@ -0,0 +1,18 @@ +package com.subsidy.dto.detection; + +import lombok.Data; + +@Data +public class VerifyDTO { + + private String ticket; + + private String userIp; + + private String randStr; + + private Long memberId; + + private Long classId; + +} diff --git a/src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java b/src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java new file mode 100644 index 0000000..3612d04 --- /dev/null +++ b/src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java @@ -0,0 +1,20 @@ +package com.subsidy.dto.exercise; + +import lombok.Data; + +@Data +public class GetPaperExerciseDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String difficulty; + + private String exerciseType; + + private Long paperId; + + private String title; + +} diff --git a/src/main/java/com/subsidy/dto/exercise/ImportHistory.java b/src/main/java/com/subsidy/dto/exercise/ImportHistory.java new file mode 100644 index 0000000..ef478da --- /dev/null +++ b/src/main/java/com/subsidy/dto/exercise/ImportHistory.java @@ -0,0 +1,65 @@ +package com.subsidy.dto.exercise; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.subsidy.util.excel.ExcelColumnUtil; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +@Data +public class ImportHistory { + @ExcelColumnUtil(value = "id", col = 1) + private Long id; + + /** + * 卷子id + */ + @ExcelColumnUtil(value = "paper_id", col = 2) + private Long paperId; + + /** + * 成员id + */ + @ExcelColumnUtil(value = "member_id", col = 3) + private Long memberId; + + /** + * 班级id + */ + @ExcelColumnUtil(value = "class_id", col = 4) + private Long classId; + + /** + * 课程id + */ + @ExcelColumnUtil(value = "course_id", col = 5) + private Long courseId; + + /** + * 正确个数 + */ + @ExcelColumnUtil(value = "right_counts", col = 5) + private Integer rightCounts; + + /** + * 总共个数 + */ + @ExcelColumnUtil(value = "total_counts", col = 6) + private Integer totalCounts; + + /** + * 测试分数 + */ + @ExcelColumnUtil(value = "score", col = 8) + private Integer score; + + /** + * 是否合格 0:不合格 1:合格 + */ + @ExcelColumnUtil(value = "result", col = 9) + private String result; + + @ExcelColumnUtil(value = "create_date", col = 10) + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private String create_date; + +} diff --git a/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java b/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java index 2550af2..ac701c0 100644 --- a/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java +++ b/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java @@ -15,4 +15,8 @@ public class SubmitDTO { private Long courseId; private Long classId; + + private Long paperId; + + private Integer length; } diff --git a/src/main/java/com/subsidy/dto/field/QueryFieldsDTO.java b/src/main/java/com/subsidy/dto/field/QueryFieldsDTO.java new file mode 100644 index 0000000..8f27ad4 --- /dev/null +++ b/src/main/java/com/subsidy/dto/field/QueryFieldsDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.field; + +import lombok.Data; + +@Data +public class QueryFieldsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String fieldName; + +} diff --git a/src/main/java/com/subsidy/dto/label/VodLabelPageDTO.java b/src/main/java/com/subsidy/dto/label/VodLabelPageDTO.java new file mode 100644 index 0000000..bf44881 --- /dev/null +++ b/src/main/java/com/subsidy/dto/label/VodLabelPageDTO.java @@ -0,0 +1,13 @@ +package com.subsidy.dto.label; + +import lombok.Data; + +@Data +public class VodLabelPageDTO { + + private String labelName; + + private Integer pageNum; + + private Integer pageSize; +} diff --git a/src/main/java/com/subsidy/dto/member/AddMemberDTO.java b/src/main/java/com/subsidy/dto/member/AddMemberDTO.java index 8511410..ad7d53f 100644 --- a/src/main/java/com/subsidy/dto/member/AddMemberDTO.java +++ b/src/main/java/com/subsidy/dto/member/AddMemberDTO.java @@ -1,6 +1,5 @@ package com.subsidy.dto.member; -import com.subsidy.model.DepartmentDictDO; import com.subsidy.model.MemberDO; import lombok.Data; @@ -11,4 +10,6 @@ public class AddMemberDTO extends MemberDO { private List departmentIds; + private List jobIds; + } diff --git a/src/main/java/com/subsidy/dto/member/ChangeDepartmentsDTO.java b/src/main/java/com/subsidy/dto/member/ChangeDepartmentsDTO.java new file mode 100644 index 0000000..45ba5ea --- /dev/null +++ b/src/main/java/com/subsidy/dto/member/ChangeDepartmentsDTO.java @@ -0,0 +1,13 @@ +package com.subsidy.dto.member; + +import lombok.Data; + +import java.util.List; + +@Data +public class ChangeDepartmentsDTO { + + private List desDepId; + + private List memberIds; +} diff --git a/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java b/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java index 452b39b..ecee135 100644 --- a/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java +++ b/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java @@ -5,10 +5,10 @@ import lombok.Data; @Data public class ContentMemberDTO { - private Integer memberId; + private Long memberId; - private Integer courseId; + private Long courseId; - private Integer classId; + private Long classId; } diff --git a/src/main/java/com/subsidy/dto/member/GetAllDTO.java b/src/main/java/com/subsidy/dto/member/GetAllDTO.java index 8dae9dd..4ac9950 100644 --- a/src/main/java/com/subsidy/dto/member/GetAllDTO.java +++ b/src/main/java/com/subsidy/dto/member/GetAllDTO.java @@ -1,10 +1,19 @@ package com.subsidy.dto.member; -import com.subsidy.model.MemberDO; import lombok.Data; @Data -public class GetAllDTO extends MemberDO { +public class GetAllDTO{ + + private String userName; + + private String status; + + private Long departmentId; + + private String startDate; + + private String endDate; private Integer pageNum; diff --git a/src/main/java/com/subsidy/dto/member/ImportMemberDTO.java b/src/main/java/com/subsidy/dto/member/ImportMemberDTO.java index 4ba1069..b05f9b7 100644 --- a/src/main/java/com/subsidy/dto/member/ImportMemberDTO.java +++ b/src/main/java/com/subsidy/dto/member/ImportMemberDTO.java @@ -1,9 +1,12 @@ package com.subsidy.dto.member; +import com.fasterxml.jackson.annotation.JsonFormat; import com.subsidy.util.excel.ExcelColumn; import com.subsidy.util.excel.ExcelColumnUtil; import lombok.Data; +import java.util.Date; + @Data public class ImportMemberDTO { @@ -11,17 +14,29 @@ public class ImportMemberDTO { @ExcelColumnUtil(value = "姓名", col = 1) private String userName; - @ExcelColumnUtil(value = "性别", col = 2) + @ExcelColumnUtil(value = "手机号", col = 2) + private String telephone; + + @ExcelColumnUtil(value = "部门", col = 3) + private String departments; + + @ExcelColumnUtil(value = "身份证号码", col = 4) + private String idCard; + + @ExcelColumnUtil(value = "性别(男/女)", col = 5) private String gender; - @ExcelColumnUtil(value = "账号", col = 3) - private String accountName; + @ExcelColumnUtil(value = "英文名", col = 6) + private String accountNameEn; - @ExcelColumnUtil(value = "手机", col = 4) - private String telephone; + @ExcelColumnUtil(value = "邮箱", col = 7) + private String email; - @ExcelColumnUtil(value = "身份证号", col = 5) - private String idCard; + @ExcelColumnUtil(value = "工号", col = 8) + private String workNo; + + @ExcelColumnUtil(value = "入职时间", col = 9) + private String inductionDate; diff --git a/src/main/java/com/subsidy/dto/member/MyCoursesDTO.java b/src/main/java/com/subsidy/dto/member/MyCoursesDTO.java new file mode 100644 index 0000000..40b9523 --- /dev/null +++ b/src/main/java/com/subsidy/dto/member/MyCoursesDTO.java @@ -0,0 +1,12 @@ +package com.subsidy.dto.member; + +import lombok.Data; + +@Data +public class MyCoursesDTO { + + private Long memberId; + + private Integer status; + +} diff --git a/src/main/java/com/subsidy/dto/member/PasswordLoginDTO.java b/src/main/java/com/subsidy/dto/member/PasswordLoginDTO.java new file mode 100644 index 0000000..957e4b5 --- /dev/null +++ b/src/main/java/com/subsidy/dto/member/PasswordLoginDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.member; + +import lombok.Data; + +@Data +public class PasswordLoginDTO { + + private Long companyId; + + private String accountName; + + private String password; + +} diff --git a/src/main/java/com/subsidy/dto/member/QingxuetangLoginDTO.java b/src/main/java/com/subsidy/dto/member/QingxuetangLoginDTO.java new file mode 100644 index 0000000..a0ece89 --- /dev/null +++ b/src/main/java/com/subsidy/dto/member/QingxuetangLoginDTO.java @@ -0,0 +1,27 @@ +package com.subsidy.dto.member; + +import lombok.Data; + +@Data +public class QingxuetangLoginDTO { + +// private String telephone; + + private String appId; + + private String authCorpId; + + private String authCorpName; + + private String openId; + + private String mobile; + + private String nickname; + + private Long timestamp; + + private String sign; + + +} diff --git a/src/main/java/com/subsidy/dto/opr/GetHistoryDTO.java b/src/main/java/com/subsidy/dto/opr/GetHistoryDTO.java new file mode 100644 index 0000000..de3e498 --- /dev/null +++ b/src/main/java/com/subsidy/dto/opr/GetHistoryDTO.java @@ -0,0 +1,18 @@ +package com.subsidy.dto.opr; + +import lombok.Data; + +@Data +public class GetHistoryDTO { + + private Integer pageNum; + + private Integer pageSize; + + private String userName; + + private String startDate; + + private String endDate; + +} diff --git a/src/main/java/com/subsidy/dto/sign/ClassSignInfoDTO.java b/src/main/java/com/subsidy/dto/sign/DataViewDTO.java similarity index 80% rename from src/main/java/com/subsidy/dto/sign/ClassSignInfoDTO.java rename to src/main/java/com/subsidy/dto/sign/DataViewDTO.java index 57f6571..2f6feea 100644 --- a/src/main/java/com/subsidy/dto/sign/ClassSignInfoDTO.java +++ b/src/main/java/com/subsidy/dto/sign/DataViewDTO.java @@ -3,7 +3,7 @@ package com.subsidy.dto.sign; import lombok.Data; @Data -public class ClassSignInfoDTO { +public class DataViewDTO { private String className; @@ -14,6 +14,6 @@ public class ClassSignInfoDTO { private Integer pageNum; - private Integer companyId; + private Integer id; } diff --git a/src/main/java/com/subsidy/dto/vod/ChangeOrdersDTO.java b/src/main/java/com/subsidy/dto/vod/ChangeOrdersDTO.java new file mode 100644 index 0000000..3c5466b --- /dev/null +++ b/src/main/java/com/subsidy/dto/vod/ChangeOrdersDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.vod; + +import lombok.Data; + +import java.util.List; + +@Data +public class ChangeOrdersDTO { + + private Long contentId; + + private List vodIds; + +} diff --git a/src/main/java/com/subsidy/dto/vod/FixDataTwoDTO.java b/src/main/java/com/subsidy/dto/vod/FixDataTwoDTO.java new file mode 100644 index 0000000..c1cbafd --- /dev/null +++ b/src/main/java/com/subsidy/dto/vod/FixDataTwoDTO.java @@ -0,0 +1,12 @@ +package com.subsidy.dto.vod; + +import lombok.Data; + +@Data +public class FixDataTwoDTO { + + private String classId; + + private String step; + +} diff --git a/src/main/java/com/subsidy/dto/vod/InsertHistoryNewDTO.java b/src/main/java/com/subsidy/dto/vod/InsertHistoryNewDTO.java new file mode 100644 index 0000000..ee200dd --- /dev/null +++ b/src/main/java/com/subsidy/dto/vod/InsertHistoryNewDTO.java @@ -0,0 +1,11 @@ +package com.subsidy.dto.vod; + +import com.subsidy.model.VodPlayHistoryDO; +import lombok.Data; + +@Data +public class InsertHistoryNewDTO extends VodPlayHistoryDO { + + private String token; + +} diff --git a/src/main/java/com/subsidy/dto/vod/RemainSecondsDTO.java b/src/main/java/com/subsidy/dto/vod/RemainSecondsDTO.java new file mode 100644 index 0000000..e50bded --- /dev/null +++ b/src/main/java/com/subsidy/dto/vod/RemainSecondsDTO.java @@ -0,0 +1,12 @@ +package com.subsidy.dto.vod; + +import lombok.Data; + +@Data +public class RemainSecondsDTO { + + private Long classId; + + private Long memberId; + +} diff --git a/src/main/java/com/subsidy/dto/vod/SignDatePlaysDTO.java b/src/main/java/com/subsidy/dto/vod/SignDatePlaysDTO.java new file mode 100644 index 0000000..1e26c85 --- /dev/null +++ b/src/main/java/com/subsidy/dto/vod/SignDatePlaysDTO.java @@ -0,0 +1,10 @@ +package com.subsidy.dto.vod; + +import lombok.Data; + +@Data +public class SignDatePlaysDTO { + + private String classId; + +} diff --git a/src/main/java/com/subsidy/jobs/CourseNotificationJob.java b/src/main/java/com/subsidy/jobs/CourseNotificationJob.java new file mode 100644 index 0000000..d4b2a30 --- /dev/null +++ b/src/main/java/com/subsidy/jobs/CourseNotificationJob.java @@ -0,0 +1,75 @@ +package com.subsidy.jobs; + +import com.subsidy.common.constant.CourseNotification; +import com.subsidy.common.constant.SmsCode; +import com.subsidy.mapper.ClassDictMapper; +import com.subsidy.mapper.ClassNoticeMapper; +import com.subsidy.mapper.MemberMapper; +import com.subsidy.model.ClassNoticeDO; +import com.subsidy.model.MemberDO; +import com.subsidy.util.SMSUtils; +import com.subsidy.vo.classdict.ClassAndCompanyInfoVO; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + *

+ * 课程通知 + *

+ * + * @author DengMin + * @since 2022/2/14 + */ +@Component +public class CourseNotificationJob implements Job { + + @Autowired + private MemberMapper memberMapper; + + @Autowired + private ClassNoticeMapper classNoticeMapper; + + @Autowired + private ClassDictMapper classDictMapper; + + @Override + public void execute(JobExecutionContext jobExecutionContext) { + Map map = jobExecutionContext.getJobDetail().getJobDataMap(); + Map params = (Map) map.get("params"); + if(params != null) { + ClassNoticeDO classNoticeDO = classNoticeMapper.selectById((Long) params.get("id")); + if(classNoticeDO != null) { + ClassAndCompanyInfoVO cmInfo = classDictMapper.getClassAndCompanyInfoVO((Long) params.get("classId")); + List list = memberMapper.getMemberList((Long) params.get("classId")); + if(list != null && list.size() > 0) { + for (MemberDO memberDO : list) { + if(memberDO != null) { + String sms = ""; + if(classNoticeDO.getNoticeType().equals(SmsCode.CLASS_START.getType())) { + sms = "{\"company\":\""+ cmInfo.getCompany() +"\", \"course\":\""+ cmInfo.getCourseName() +"\", \"startDate\": \""+ cmInfo.getStartDate()+"\", \"endDate\": \""+ cmInfo.getEndDate()+"\"}"; + } else if(classNoticeDO.getNoticeType().equals(SmsCode.SIGN_IN.getType())) { + sms = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}"; + } else if(classNoticeDO.getNoticeType().equals(SmsCode.TEST.getType())) { + sms = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}"; + } + Map data = Arrays.stream(SmsCode.values()).collect(Collectors.toMap(SmsCode::getType, SmsCode::getCode)); + SMSUtils.sendNoticeSMS(data.get(classNoticeDO.getNoticeType()), memberDO.getTelephone(), sms); + } + } + } + ClassNoticeDO classNotice = new ClassNoticeDO(); + classNotice.setId(classNoticeDO.getId()); + classNotice.setStatus(CourseNotification.SENT); + classNoticeMapper.updateById(classNotice); + } + } + } +} diff --git a/src/main/java/com/subsidy/jobs/SchedulerJob.java b/src/main/java/com/subsidy/jobs/SchedulerJob.java new file mode 100644 index 0000000..433afaf --- /dev/null +++ b/src/main/java/com/subsidy/jobs/SchedulerJob.java @@ -0,0 +1,148 @@ +package com.subsidy.jobs; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.RedisPrefixConstant; +import com.subsidy.mapper.OprAdmDictMapper; +import com.subsidy.mapper.OprMemDictMapper; +import com.subsidy.mapper.SignInRecordMapper; +import com.subsidy.mapper.VodPlayHistoryMapper; +import com.subsidy.model.OprAdmDictDO; +import com.subsidy.model.SignInRecordDO; +import com.subsidy.util.DateFormatUtil; +//import com.subsidy.util.RedisUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Set; + +/** + *

+ * 定时器 + *

+ * + * @author DengMin + * @since 2021/12/21 + */ + +@Component +public class SchedulerJob { + + @Autowired + private OprAdmDictMapper oprAdmDictMapper; + + @Autowired + private OprMemDictMapper oprMemDictMapper; + + @Autowired + private VodPlayHistoryMapper vodPlayHistoryMapper; + + @Autowired + private SignInRecordMapper signInRecordMapper; + + //@Autowired + //private RedisUtil redisUtil; + + /** + 删除十天前登录记录(管理端) + */ + //@Scheduled(cron = "0 42 18 * * ?") + public void delOprAdmRecord() { + List list = oprAdmDictMapper.getRecordByDate(); + if(list != null) { + for (OprAdmDictDO oprAdmDictDO : list) { + //oprAdmDictMapper.deleteById(oprAdmDictDO.getId()); + } + } + } + + ///** + // * 删除十天前登录记录(学员) + // */ + ////@Scheduled(cron = "0 42 18 * * ?") + //public void delOprMemRecord() { + // List list = oprMemDictMapper.getRecordByDate(); + // if(list != null) { + // for (OprMemDictDO oprMemDictDO : list) { + // oprMemDictMapper.deleteById(oprMemDictDO.getId()); + // } + // } + //} + + ///** + // * 用户数据审计记录添加(学员) + // */ + ////@Scheduled(cron = "0 39 18 * * ?") + //public void getOprMemRecord() { + // Set set = redisUtil.scan("*memberLogin*"); + // if(set != null) { + // for (String str : set) { + // int result = (Integer) redisUtil.get(str); + // OprMemDictDO oprMemDictDO = new OprMemDictDO(); + // String [] opr = str.split("_"); + // LocalDateTime createDate = DateFormatUtil.secondToLocalDateTime(Long.valueOf(opr[3])); + // oprMemDictDO.setResult(result); + // oprMemDictDO.setOprType("登录"); + // oprMemDictDO.setUserId(Long.valueOf(opr[2])); + // oprMemDictDO.setCreateDate(createDate); + // oprMemDictMapper.insert(oprMemDictDO); + // redisUtil.del(str); + // } + // } + //} + + /** + * 视频播放记录缩量 + */ +// @Scheduled(cron = "0 48 14 * * ?") +// @Transactional(rollbackFor = Exception.class) +// public void condenseVodPlayHistory() { +// List list = vodPlayHistoryMapper.getVodPlayHistory(); +// vodPlayHistoryMapper.delete(null); +// //List vodPlayHistoryList = vodPlayHistoryMapper.selectList(null); +// //for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryList) { +// vodPlayHistoryMapper.deleteById(null); +// //} +// +// for (VodPlayHistoryDO vodPlayHistoryDO : list) { +// vodPlayHistoryMapper.insert(vodPlayHistoryDO); +// } +// } + + /** + * 定时同步Redis签到数据 + * 1天前的 + * 增量版 + */ + //@Transactional(rollbackFor = Exception.class) + //public void synchronizeSignInRecord() { + // List list = signInRecordMapper.getSignInRecord(); + // if(list != null && list.size() > 0) { + // for (SignInRecordDO signInRecordDO : list) { + // Set set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + signInRecordDO.getClassId() + ":" + DateFormatUtil.format(signInRecordDO.getSignInDate(), "yyyy-MM-dd")+":*"); + // if(set != null && set.size() > 0) { + // redisUtil.del(set); + // } + // redisUtil.set(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + signInRecordDO.getClassId() + ":" + DateFormatUtil.format(signInRecordDO.getSignInDate(), "yyyy-MM-dd") + ":" + DateFormatUtil.LocalDateTimeToSecond(signInRecordDO.getSignInDate()), null); + // } + // } + //} + + /** + * 全部同步Redis签到数据 + */ + //@Transactional(rollbackFor = Exception.class) + //public void synchronizeSignInRecordAll() { + // Set set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX+"*"); + // if(set != null && set.size() > 0) { + // redisUtil.del(set); + // } + // + // List list = signInRecordMapper.selectList(new QueryWrapper<>()); + // for (SignInRecordDO signInRecordDO : list) { + // redisUtil.set(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + signInRecordDO.getClassId() + ":" + DateFormatUtil.format(signInRecordDO.getSignInDate(), "yyyy-MM-dd") + ":" + DateFormatUtil.LocalDateTimeToSecond(signInRecordDO.getSignInDate()), null); + // } + // + //} +} diff --git a/src/main/java/com/subsidy/mapper/AccessTokenMapper.java b/src/main/java/com/subsidy/mapper/AccessTokenMapper.java new file mode 100644 index 0000000..3453dc6 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/AccessTokenMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.AccessTokenDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-02-18 + */ + @Repository +public interface AccessTokenMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/ActivityDetectionMapper.java b/src/main/java/com/subsidy/mapper/ActivityDetectionMapper.java new file mode 100644 index 0000000..caf5e1b --- /dev/null +++ b/src/main/java/com/subsidy/mapper/ActivityDetectionMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.ActivityDetectionDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 活跃度检测表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-07-13 + */ + @Repository +public interface ActivityDetectionMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/AdministerMapper.java b/src/main/java/com/subsidy/mapper/AdministerMapper.java index 313c9c5..0d07293 100644 --- a/src/main/java/com/subsidy/mapper/AdministerMapper.java +++ b/src/main/java/com/subsidy/mapper/AdministerMapper.java @@ -1,11 +1,11 @@ package com.subsidy.mapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.model.AdministerDO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.subsidy.vo.administer.ExerciseTestVO; -import com.subsidy.vo.administer.OperatorsVO; +import com.subsidy.vo.administer.ImageCheckDetailVO; +import com.subsidy.vo.administer.MemberDetectionRecordVO; import com.subsidy.vo.administer.PermissionsVO; import com.subsidy.vo.classdict.ClassDetailVO; import com.subsidy.vo.member.ClassSignVO; @@ -47,5 +47,14 @@ public interface AdministerMapper extends BaseMapper { */ IPage answerRecord(IPage iPage, Long classId, String userName); + /** + * 活跃度检测 + */ + IPage classActivityDetection(IPage iPage, Long classId, String userName); + + /** + * 实名验证 + */ + IPage imageCheckDetail(IPage iPage, Long classId, String userName); } diff --git a/src/main/java/com/subsidy/mapper/AnsweringQuestionMapper.java b/src/main/java/com/subsidy/mapper/AnsweringQuestionMapper.java index 7fa17a8..02c44b7 100644 --- a/src/main/java/com/subsidy/mapper/AnsweringQuestionMapper.java +++ b/src/main/java/com/subsidy/mapper/AnsweringQuestionMapper.java @@ -1,14 +1,11 @@ package com.subsidy.mapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.model.AnsweringQuestionDO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.subsidy.vo.answer.GetCourseQuestionVO; -import com.subsidy.vo.vod.GetContendVodsVO; import org.springframework.stereotype.Repository; -import java.util.List; - /** *

* 问题答疑表 Mapper 接口 diff --git a/src/main/java/com/subsidy/mapper/BusinessScopeDictMapper.java b/src/main/java/com/subsidy/mapper/BusinessScopeDictMapper.java new file mode 100644 index 0000000..06045ed --- /dev/null +++ b/src/main/java/com/subsidy/mapper/BusinessScopeDictMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.BusinessScopeDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 经营范围表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-07-25 + */ + @Repository +public interface BusinessScopeDictMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/CategoryMapper.java b/src/main/java/com/subsidy/mapper/CategoryMapper.java index 8835bd5..5ec704a 100644 --- a/src/main/java/com/subsidy/mapper/CategoryMapper.java +++ b/src/main/java/com/subsidy/mapper/CategoryMapper.java @@ -4,6 +4,8 @@ import com.subsidy.model.CategoryDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

* 类目名称 Mapper 接口 @@ -12,7 +14,13 @@ import org.springframework.stereotype.Repository; * @author DengMin * @since 2021-10-11 */ - @Repository +@Repository public interface CategoryMapper extends BaseMapper { + + /** + * 查看某个课程下的所有类目 + */ + List queryCourseCategory(Long courseId); + } diff --git a/src/main/java/com/subsidy/mapper/CertCompanyMappingMapper.java b/src/main/java/com/subsidy/mapper/CertCompanyMappingMapper.java new file mode 100644 index 0000000..826c383 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CertCompanyMappingMapper.java @@ -0,0 +1,29 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.model.CertCompanyMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.model.CertDictDO; +import com.subsidy.vo.cert.GetCompanyCertsVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 证书-公司映射表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Repository +public interface CertCompanyMappingMapper extends BaseMapper { + + //获取某个公司的某个类型下的证书 companyId typeId + List getCompanyCerts(Long companyId, Long typeId); + + //获取全部证书公司映射情况 分页 包含企业状态 + IPage getCompanyCertStatus(IPage page); + +} diff --git a/src/main/java/com/subsidy/mapper/CertDictMapper.java b/src/main/java/com/subsidy/mapper/CertDictMapper.java new file mode 100644 index 0000000..c9762c5 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CertDictMapper.java @@ -0,0 +1,33 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.model.CertDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.cert.GetAllCertsVO; +import com.subsidy.vo.cert.GetAllCertsWithoutTypeVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 证书字典表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Repository +public interface CertDictMapper extends BaseMapper { + + /** + * 获取所有证书 + */ + IPage getAllCerts(IPage iPage, Long typeId, String certName); + + /** + * 获取所有证书 下拉列表 不分页 + */ + List getAllCertsWithoutType(); + +} diff --git a/src/main/java/com/subsidy/mapper/CertMemberFileMappingMapper.java b/src/main/java/com/subsidy/mapper/CertMemberFileMappingMapper.java new file mode 100644 index 0000000..b100415 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CertMemberFileMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CertMemberFileMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ + @Repository +public interface CertMemberFileMappingMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/CertMemberMappingMapper.java b/src/main/java/com/subsidy/mapper/CertMemberMappingMapper.java new file mode 100644 index 0000000..b08f893 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CertMemberMappingMapper.java @@ -0,0 +1,40 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.model.CertMemberMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.cert.GetListVO; +import com.subsidy.vo.cert.GetSignInfoVO; +import com.subsidy.vo.cert.SignManagementVO; +import org.springframework.stereotype.Repository; + +/** + *

+ * 学生报名证书表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Repository +public interface CertMemberMappingMapper extends BaseMapper { + + /** + * 报名管理 + */ + IPage signManagement(IPage page,String status,Long typeId,Long certId,String item,String startDate,String endDate); + + /** + * 查看学生报了几个证书 + */ + IPage getList(IPage page,Long memberId,String status); + + /** + * 获取某个学生 某个证书报名信息 + */ + GetSignInfoVO getSignInfo(Long memberId,Long certId); + + int memberCertStatus(Long memberId,Long certId); + +} + diff --git a/src/main/java/com/subsidy/mapper/CertRequirementMapper.java b/src/main/java/com/subsidy/mapper/CertRequirementMapper.java new file mode 100644 index 0000000..23ade9a --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CertRequirementMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CertRequirementDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 报名条件表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-05-12 + */ + @Repository +public interface CertRequirementMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/CertTypeDictMapper.java b/src/main/java/com/subsidy/mapper/CertTypeDictMapper.java new file mode 100644 index 0000000..1eaddd3 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CertTypeDictMapper.java @@ -0,0 +1,30 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CertTypeDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 证书类目字典表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Repository +public interface CertTypeDictMapper extends BaseMapper { + + /** + * 获取某个公司的所有证书类型 + */ + List getCompanyCertTypes(Long companyId); + + /** + * 查看证书的所有证书类型 + */ + List getCertTypes(Long certId); + +} diff --git a/src/main/java/com/subsidy/mapper/CertTypeMappingMapper.java b/src/main/java/com/subsidy/mapper/CertTypeMappingMapper.java new file mode 100644 index 0000000..fffa683 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CertTypeMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CertTypeMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 证书-类型映射表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ + @Repository +public interface CertTypeMappingMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/ClassDictMapper.java b/src/main/java/com/subsidy/mapper/ClassDictMapper.java index 7058b5a..b33a537 100644 --- a/src/main/java/com/subsidy/mapper/ClassDictMapper.java +++ b/src/main/java/com/subsidy/mapper/ClassDictMapper.java @@ -1,12 +1,13 @@ package com.subsidy.mapper; -import com.subsidy.dto.classDict.GetAllClassesDTO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.subsidy.dto.classDict.GetSpareMembersDTO; import com.subsidy.model.ClassDictDO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.subsidy.model.MemberDO; import com.subsidy.model.VodDictDO; +import com.subsidy.vo.classdict.ClassAndCompanyInfoVO; import com.subsidy.vo.classdict.GetAllClassesVO; +import com.subsidy.vo.classdict.GetClassBaseInfoVO; import org.springframework.stereotype.Repository; import java.util.List; @@ -43,4 +44,13 @@ public interface ClassDictMapper extends BaseMapper { */ List classMembers(Long classId); + /** + * 班级详情--获取课程基本信息 + */ + GetClassBaseInfoVO getClassBaseInfo(Long classId); + + /** + * 班级信息 -- 获取课程信息 + 公司信息 + * */ + ClassAndCompanyInfoVO getClassAndCompanyInfoVO(Long classId); } diff --git a/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java b/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java index c979186..36a6ca5 100644 --- a/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java +++ b/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java @@ -1,10 +1,10 @@ package com.subsidy.mapper; -import com.subsidy.dto.classDict.GetSpareMembersDTO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassMemberMappingDO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.subsidy.model.MemberDO; +import com.subsidy.vo.administer.ClassDailyInfoVO; import org.springframework.stereotype.Repository; import java.util.List; @@ -25,4 +25,18 @@ public interface ClassMemberMappingMapper extends BaseMapper getMemberClass(Long memberId); + /** + * 获取班级成员id + */ + List getClassMembers(Long classId); + + /** + * 获取班级成员id + */ + IPage getClassMembersWithName(IPage iPage, Long classId, String userName); + + /** + * 获取学生当前有效班级 + */ + long getMemberClassCount(Long memberId); } diff --git a/src/main/java/com/subsidy/mapper/ClassNoticeMapper.java b/src/main/java/com/subsidy/mapper/ClassNoticeMapper.java new file mode 100644 index 0000000..1c4491a --- /dev/null +++ b/src/main/java/com/subsidy/mapper/ClassNoticeMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.ClassNoticeDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-01-21 + */ + @Repository +public interface ClassNoticeMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/ClassTypeDictMapper.java b/src/main/java/com/subsidy/mapper/ClassTypeDictMapper.java new file mode 100644 index 0000000..80f845c --- /dev/null +++ b/src/main/java/com/subsidy/mapper/ClassTypeDictMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.ClassTypeDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 班级类型字典表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-01-21 + */ + @Repository +public interface ClassTypeDictMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/CompanyDictMapper.java b/src/main/java/com/subsidy/mapper/CompanyDictMapper.java index fea1d20..6792b3e 100644 --- a/src/main/java/com/subsidy/mapper/CompanyDictMapper.java +++ b/src/main/java/com/subsidy/mapper/CompanyDictMapper.java @@ -1,12 +1,16 @@ package com.subsidy.mapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.subsidy.model.AdministerDO; import com.subsidy.model.CompanyDictDO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.model.MemberDO; import com.subsidy.vo.administer.OperatorsVO; +import com.subsidy.vo.company.GetAllCompanyVO; +import com.subsidy.vo.company.GetCompanyMembersVO; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

* 企业字典表 Mapper 接口 @@ -19,15 +23,21 @@ import org.springframework.stereotype.Repository; public interface CompanyDictMapper extends BaseMapper { /** - * 查找运营者 + * 企业管理--查找所有主账号 、运营者 * * @return */ - IPage operators(IPage page, String companyName,Integer id, String userName,Integer role); + IPage operators(IPage page, String companyName, Long fieldId, Long id, Integer role, String superviseName); /** - * 通过企业id查找企业的管理员 + * 查找所有的公司名称 */ - AdministerDO getAdministerByCompanyId(Long companyId); + List getAllCompany(CompanyDictDO companyDictDO); + + /** + * 查看某个公司的学生 + */ + IPage getCompanyMembers(IPage page, Long companyId, String userName); + } diff --git a/src/main/java/com/subsidy/mapper/CompanyFieldMappingMapper.java b/src/main/java/com/subsidy/mapper/CompanyFieldMappingMapper.java new file mode 100644 index 0000000..3052c8d --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CompanyFieldMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CompanyFieldMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-02-11 + */ + @Repository +public interface CompanyFieldMappingMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/ContentVodMappingMapper.java b/src/main/java/com/subsidy/mapper/ContentVodMappingMapper.java new file mode 100644 index 0000000..45b4ae0 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/ContentVodMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.ContentVodMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 目录视频关系表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-07-19 + */ + @Repository +public interface ContentVodMappingMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/CourseCategoryMappingMapper.java b/src/main/java/com/subsidy/mapper/CourseCategoryMappingMapper.java new file mode 100644 index 0000000..586c7e5 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CourseCategoryMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CourseCategoryMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 课程类目映射 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ + @Repository +public interface CourseCategoryMappingMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/CourseContentMapper.java b/src/main/java/com/subsidy/mapper/CourseContentMapper.java index c16dd53..3c156c2 100644 --- a/src/main/java/com/subsidy/mapper/CourseContentMapper.java +++ b/src/main/java/com/subsidy/mapper/CourseContentMapper.java @@ -1,11 +1,13 @@ package com.subsidy.mapper; -import com.subsidy.model.CourseContentDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.subsidy.model.CourseDictDO; +import com.subsidy.model.CourseContentDO; +import com.subsidy.model.FileDictDO; import com.subsidy.model.VodDictDO; +import com.subsidy.vo.member.MemberVodVO; import org.springframework.stereotype.Repository; +import java.io.File; import java.util.List; /** @@ -22,6 +24,17 @@ public interface CourseContentMapper extends BaseMapper { /** * 查看课程下有多少个视频 */ - List getCourseVods(Integer courseId); + List getCourseVods(Long courseId); + + /** + * 查看某个目录下 某个成员看视频的进度 + */ + List contentVodProcess(Long contentId, Long memberId,Long classId); + + /** + * 查看某个课程下的文件/课件 + */ + List contentFiles(Long courseId); + Integer selectMaxOrderNo(Long courseId); } diff --git a/src/main/java/com/subsidy/mapper/CourseDictMapper.java b/src/main/java/com/subsidy/mapper/CourseDictMapper.java index 750b60f..563613d 100644 --- a/src/main/java/com/subsidy/mapper/CourseDictMapper.java +++ b/src/main/java/com/subsidy/mapper/CourseDictMapper.java @@ -1,13 +1,11 @@ package com.subsidy.mapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.model.ClassMemberMappingDO; import com.subsidy.model.CourseDictDO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.subsidy.model.MemberDO; import com.subsidy.vo.course.QueryCoursesVO; import com.subsidy.vo.member.StudyPageVO; -import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @@ -24,10 +22,11 @@ import java.util.List; public interface CourseDictMapper extends BaseMapper { /** - * 查询全部课程 + * 运营者查询全部课程 + * courseName fieldId categoryId jobId courseRank courseType * @return */ - IPage queryCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId); + IPage queryCourses(IPage page, String courseName, Long fieldId,Long categoryId,Long jobId,Long rankId, String courseType,Long companyId,Integer openStatus); /** * 通过课程id查询课程下的学生-----弃用 @@ -41,9 +40,19 @@ public interface CourseDictMapper extends BaseMapper { IPage queryPublicCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource); /** - * 查询企业内部课程 + * 查看课程下有多少课时 + */ + Integer queryCourseCnt(Long courseId); + + /** + * 查看课程学习总时长 + */ + Integer queryCoursePlayLength(Long courseId); + + /** + * 修改课程的开放状态 */ - IPage queryCompanyCourse(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId); + void updateOpenStatus(CourseDictDO courseDictDO); } diff --git a/src/main/java/com/subsidy/mapper/CourseFieldMappingMapper.java b/src/main/java/com/subsidy/mapper/CourseFieldMappingMapper.java new file mode 100644 index 0000000..cd24adc --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CourseFieldMappingMapper.java @@ -0,0 +1,27 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CourseFieldMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.model.FieldDictDO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-01-20 + */ +@Repository +public interface CourseFieldMappingMapper extends BaseMapper { + + + /** + * 查看某个课程设计的行业 + */ + List courseFields(Long courseId); + +} diff --git a/src/main/java/com/subsidy/mapper/CourseJobMappingMapper.java b/src/main/java/com/subsidy/mapper/CourseJobMappingMapper.java new file mode 100644 index 0000000..242812b --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CourseJobMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CourseJobMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 课程-岗位映射表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ + @Repository +public interface CourseJobMappingMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/CourseRankMappingMapper.java b/src/main/java/com/subsidy/mapper/CourseRankMappingMapper.java new file mode 100644 index 0000000..aec6271 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CourseRankMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CourseRankMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 课程职级映射表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ + @Repository +public interface CourseRankMappingMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java b/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java index 0d71522..e0fdb00 100644 --- a/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java +++ b/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java @@ -1,12 +1,11 @@ package com.subsidy.mapper; -import com.subsidy.dto.department.GetDepartmentsVO; -import com.subsidy.model.DepartmentDictDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.MemberDO; import org.springframework.stereotype.Repository; -import java.util.List; - /** *

* 部门字典表 Mapper 接口 @@ -20,5 +19,4 @@ public interface DepartmentDictMapper extends BaseMapper { //List getDepartments(DepartmentDictDO departmentDictDO); - } diff --git a/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java b/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java index 8fa63fa..1770e6e 100644 --- a/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java +++ b/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java @@ -1,7 +1,9 @@ package com.subsidy.mapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.model.ExerciseDictDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.exercise.GetPaperExerciseVO; import org.springframework.stereotype.Repository; /** @@ -12,7 +14,16 @@ import org.springframework.stereotype.Repository; * @author DengMin * @since 2021-10-12 */ - @Repository +@Repository public interface ExerciseDictMapper extends BaseMapper { + /** + * 获取某一套卷子的题目 + */ + IPage getPaperExercise(IPage page, Long paperId, String difficulty, String exerciseType, String title); + + /** + * 获取某个卷子的最大排序号 + */ + Integer getMaximumNo(Long paperId); } diff --git a/src/main/java/com/subsidy/mapper/ExerciseDoneHistoryMapper.java b/src/main/java/com/subsidy/mapper/ExerciseDoneHistoryMapper.java new file mode 100644 index 0000000..86b0f4b --- /dev/null +++ b/src/main/java/com/subsidy/mapper/ExerciseDoneHistoryMapper.java @@ -0,0 +1,27 @@ +package com.subsidy.mapper; + +import com.subsidy.model.ExerciseDoneHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.exercise.GetDoneHistoryDetailVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 做题历史记录表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-12-03 + */ +@Repository +public interface ExerciseDoneHistoryMapper extends BaseMapper { + + /** + * 查看某套卷子的做题详情 + */ + List getDoneHistoryDetail(Long doneId, Long memberId); + + +} diff --git a/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java b/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java index 788d86d..c1db7a1 100644 --- a/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java +++ b/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java @@ -1,9 +1,16 @@ package com.subsidy.mapper; -import com.subsidy.model.ExerciseDoneResultDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.vo.administer.GetMemberPapersVO; +import com.subsidy.vo.administer.GetPaperDetailVO; +import com.subsidy.vo.done.GetMaxScoreVO; +import com.subsidy.vo.done.TestScoreInfoVO; +import com.subsidy.vo.exercise.GetDoneDetailVO; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

* 学生课程习题完成情况 Mapper 接口 @@ -12,7 +19,42 @@ import org.springframework.stereotype.Repository; * @author DengMin * @since 2021-10-15 */ - @Repository +@Repository public interface ExerciseDoneResultMapper extends BaseMapper { + + /** + * 学生某个课程某套卷子的完成情况 + */ + List queryExerciseDoneResult(Long memberId, Long classId, Long paperId); + + /** + * 查看某个卷子完成详情 id exercise_done_result的主键 + */ + List getPaperDetail(Long memberId,Long doneId); + + /** + * 根据主键id查看完成情况 + */ + GetDoneDetailVO getDoneDetail(Long id); + + /** + * 查看某个课程下学生完成卷子的最高分 + */ + List getMaxScore(Long classId, Long memberId); + + /** + * 查看某个人某个卷子完成的最好成绩 + */ + List getMaxScorePaper(Long paperId,Long memberId,Long classId); + + /** + * 测试成绩 最高成绩 测试测试 总评价 + */ + TestScoreInfoVO testScoreInfo(Long paperId, Long memberId,Long classId); + + /** + * 汇总 查看课程通过情况 + */ + Integer getClassTestPassRate(Long classId); } diff --git a/src/main/java/com/subsidy/mapper/FieldDictMapper.java b/src/main/java/com/subsidy/mapper/FieldDictMapper.java new file mode 100644 index 0000000..6c0760e --- /dev/null +++ b/src/main/java/com/subsidy/mapper/FieldDictMapper.java @@ -0,0 +1,36 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.field.QueryFieldsDTO; +import com.subsidy.model.FieldDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 行业字典表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-01-20 + */ +@Repository +public interface FieldDictMapper extends BaseMapper { + + IPage queryFields(IPage ipage, String fieldName); + + /** + * 查看公司所有的行业 + * @param companyId + * @return + */ + List queryCompanyFields(Long companyId); + + /** + * 查看课程所属行业 + */ + List queryCourseFields(Long courseId); + +} diff --git a/src/main/java/com/subsidy/mapper/FileDictMapper.java b/src/main/java/com/subsidy/mapper/FileDictMapper.java index 4ee1912..1f42b30 100644 --- a/src/main/java/com/subsidy/mapper/FileDictMapper.java +++ b/src/main/java/com/subsidy/mapper/FileDictMapper.java @@ -4,6 +4,8 @@ import com.subsidy.model.FileDictDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

* 课件表 Mapper 接口 @@ -15,4 +17,6 @@ import org.springframework.stereotype.Repository; @Repository public interface FileDictMapper extends BaseMapper { + List selectFiles(Long contentId,String fileName); + } diff --git a/src/main/java/com/subsidy/mapper/ImageCheckRecordMapper.java b/src/main/java/com/subsidy/mapper/ImageCheckRecordMapper.java new file mode 100644 index 0000000..8c29f55 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/ImageCheckRecordMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.ImageCheckRecordDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 实名验证记录表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-07-14 + */ + @Repository +public interface ImageCheckRecordMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/JobDictMapper.java b/src/main/java/com/subsidy/mapper/JobDictMapper.java new file mode 100644 index 0000000..9379e8a --- /dev/null +++ b/src/main/java/com/subsidy/mapper/JobDictMapper.java @@ -0,0 +1,33 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CompanyDictDO; +import com.subsidy.model.JobDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 岗位表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-02-10 + */ +@Repository +public interface JobDictMapper extends BaseMapper { + + + /** + * 获取某个课程适用的所有岗位 + */ + List queryCourseJobs(Long courseId); + + /** + * 获取某个人的岗位 + */ + List queryMemberJobs(Long memberId); + +} diff --git a/src/main/java/com/subsidy/mapper/JobMemberMappingMapper.java b/src/main/java/com/subsidy/mapper/JobMemberMappingMapper.java new file mode 100644 index 0000000..f792c08 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/JobMemberMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.JobMemberMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 岗位人员表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-02-10 + */ + @Repository +public interface JobMemberMappingMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/MemberMapper.java b/src/main/java/com/subsidy/mapper/MemberMapper.java index ffc118b..2a7a8e2 100644 --- a/src/main/java/com/subsidy/mapper/MemberMapper.java +++ b/src/main/java/com/subsidy/mapper/MemberMapper.java @@ -1,12 +1,15 @@ package com.subsidy.mapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.member.PasswordLoginDTO; import com.subsidy.model.DepartmentDictDO; import com.subsidy.model.MemberDO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.administer.ManageMemberVO; +import com.subsidy.vo.administer.UserRoleVO; import com.subsidy.vo.member.GetAllVO; +import com.subsidy.vo.member.MyCoursesVO; import com.subsidy.vo.member.StudyPageVO; -import io.swagger.models.auth.In; import org.springframework.stereotype.Repository; import java.util.List; @@ -23,18 +26,55 @@ import java.util.List; public interface MemberMapper extends BaseMapper { /** - * 查看学生的课程 + * 账号密码登录 + */ + UserRoleVO passwordLogin(PasswordLoginDTO passwordLoginDTO); + + /** + * 查看学生的课程[废弃] */ List studyPage(MemberDO memberDO); /** + * 查看学生的课程 + */ + List myCourses(Long memberId,Integer status); + + /** * 查询学生所在部门 */ List getDepartments(Long memberId); /** - * 查询部门所有的学生 + * 查询部门所有的学生 分页 + */ + IPage getMembers(IPage iPage,Long departmentId,String userName,String status,String startDate,String endDate); + + /** + * 查询某个部门的员工 不分页 */ - IPage getMembers(IPage iPage,Long departmentId,String userName,String status); + List getMemberWithoutPage(Long departmentId,String userName,String status,String startDate,String endDate); + + /** + * 查询某公司的学生 + */ + IPage getCompanyMember(IPage iPage,Long companyId,String userName,String status,String startDate,String endDate); + + /** + * 查询某公司所有的学生 公司不传就是查平台所有学生 + */ + IPage manageMember(IPage iPage,Long companyId,String userName,String startDate,String endDate); + + List getMemberList(Long classId); + + List getMemberListBySignInRecord(Long classId); + + List getUnfinishedMemberList(Long classId); + + /** + * 清除采集照片 + */ + void removeCheckImage(Long id); + } diff --git a/src/main/java/com/subsidy/mapper/MemberStudyLengthMapper.java b/src/main/java/com/subsidy/mapper/MemberStudyLengthMapper.java new file mode 100644 index 0000000..baf8f13 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/MemberStudyLengthMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.MemberStudyLengthDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-01-28 + */ + @Repository +public interface MemberStudyLengthMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/OprAdmDictMapper.java b/src/main/java/com/subsidy/mapper/OprAdmDictMapper.java new file mode 100644 index 0000000..4353a1c --- /dev/null +++ b/src/main/java/com/subsidy/mapper/OprAdmDictMapper.java @@ -0,0 +1,35 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.model.OprAdmDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.opr.GetHistoryVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 审计表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-12-13 + */ +@Repository +public interface OprAdmDictMapper extends BaseMapper { + + /** + * 查看管理员的登录审计 + */ + IPage getHistory(IPage page,String userName,String startDate,String endDate); + + /** + * 查看某为成员最近登录情况 五天超过次数 + */ + List getLoginInfo(Long userId); + + + List getRecordByDate(); + +} diff --git a/src/main/java/com/subsidy/mapper/OprMemDictMapper.java b/src/main/java/com/subsidy/mapper/OprMemDictMapper.java new file mode 100644 index 0000000..d05379c --- /dev/null +++ b/src/main/java/com/subsidy/mapper/OprMemDictMapper.java @@ -0,0 +1,26 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.model.OprMemDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.opr.GetHistoryVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 审计表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-12-13 + */ +@Repository +public interface OprMemDictMapper extends BaseMapper { + + IPage getHistory(IPage page,String userName,String startDate,String endDate); + + List getRecordByDate(); + +} diff --git a/src/main/java/com/subsidy/mapper/PaperDictMapper.java b/src/main/java/com/subsidy/mapper/PaperDictMapper.java new file mode 100644 index 0000000..14bdb23 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/PaperDictMapper.java @@ -0,0 +1,37 @@ +package com.subsidy.mapper; + +import com.subsidy.model.PaperDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.paper.QueryPapersVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 试卷字典表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-12-03 + */ +@Repository +public interface PaperDictMapper extends BaseMapper { + + /** + * 查看某个课程下的卷子 + * @return + */ + List queryPapers(Long courseId,String paperName,Integer paperStatus); + + /** + * 查看某个卷子有多少人完成 卷子id + */ + Integer completeCount(Long paperId,Long classId); + + /** + * 查看某个课程下有多少卷子 + */ + Integer queryCoursePapersCnt(Long courseId); + +} diff --git a/src/main/java/com/subsidy/mapper/RankDictMapper.java b/src/main/java/com/subsidy/mapper/RankDictMapper.java new file mode 100644 index 0000000..187c218 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/RankDictMapper.java @@ -0,0 +1,30 @@ +package com.subsidy.mapper; + +import com.subsidy.model.RankDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 职级字典表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Repository +public interface RankDictMapper extends BaseMapper { + + /** + * 查看某个课程的职级 + */ + List queryCourseRanks(Long courseId); + + /** + * 查看某个公司的职级 + */ + List queryCompanyRanks(Long companyId); + +} diff --git a/src/main/java/com/subsidy/mapper/RoleAdministerMappingMapper.java b/src/main/java/com/subsidy/mapper/RoleAdministerMappingMapper.java index f1c3259..7fc919a 100644 --- a/src/main/java/com/subsidy/mapper/RoleAdministerMappingMapper.java +++ b/src/main/java/com/subsidy/mapper/RoleAdministerMappingMapper.java @@ -1,5 +1,6 @@ package com.subsidy.mapper; +import com.subsidy.model.AdministerDO; import com.subsidy.model.RoleAdministerMappingDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.springframework.stereotype.Repository; @@ -15,4 +16,11 @@ import org.springframework.stereotype.Repository; @Repository public interface RoleAdministerMappingMapper extends BaseMapper { + /** + * 查看企业的管理者 + * @param companyId + * @return + */ + AdministerDO getAdminister(Long companyId); + } diff --git a/src/main/java/com/subsidy/mapper/RotationImgDictMapper.java b/src/main/java/com/subsidy/mapper/RotationImgDictMapper.java new file mode 100644 index 0000000..ff146ad --- /dev/null +++ b/src/main/java/com/subsidy/mapper/RotationImgDictMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.RotationImgDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 轮播图 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-02-23 + */ + @Repository +public interface RotationImgDictMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/SignInRecordMapper.java b/src/main/java/com/subsidy/mapper/SignInRecordMapper.java index 2e96e16..a84d591 100644 --- a/src/main/java/com/subsidy/mapper/SignInRecordMapper.java +++ b/src/main/java/com/subsidy/mapper/SignInRecordMapper.java @@ -1,28 +1,22 @@ package com.subsidy.mapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.subsidy.dto.sign.ClassSignInfoDTO; import com.subsidy.model.SignInRecordDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.subsidy.vo.sign.ClassSignInfoVO; +import com.subsidy.vo.sign.DataViewVO; import org.springframework.stereotype.Repository; -/** - *

- * 学生签到表 Mapper 接口 - *

- * - * @author DengMin - * @since 2021-10-18 - */ - @Repository +import java.util.List; + +@Repository public interface SignInRecordMapper extends BaseMapper { - /** - * 公司学习记录 - */ + /** + * 数据概览 + */ - IPage classSignInfo(IPage iPage,String className,String courseName,Integer id); + IPage classSignInfo(IPage iPage, String className, String courseName, Integer id); + List getSignInRecord(); } diff --git a/src/main/java/com/subsidy/mapper/VodDictMapper.java b/src/main/java/com/subsidy/mapper/VodDictMapper.java index 71dd0e3..3391cc8 100644 --- a/src/main/java/com/subsidy/mapper/VodDictMapper.java +++ b/src/main/java/com/subsidy/mapper/VodDictMapper.java @@ -3,7 +3,9 @@ package com.subsidy.mapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.model.VodDictDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.vod.ClassVodCompleteInfoVO; import com.subsidy.vo.vod.GetContendVodsVO; +import com.subsidy.vo.vod.VodPlayStateVO; import org.springframework.stereotype.Repository; import java.util.List; @@ -21,10 +23,26 @@ public interface VodDictMapper extends BaseMapper { /** * 查看某个目录下的视频 - * @param page - * @param vodName - * @param contentId - * @return */ - IPage getContendVods(IPage page,String vodName,Long contentId); + List getContendVods(String vodName,Long contentId); + + /** + * 查看某个课程下的视频 + */ + List getCourseVods(Long courseId,String vodName); + + /** + * 获取某课程下,学习人数和平均学习时长 + */ + ClassVodCompleteInfoVO classVodCompleteInfo(Long classId, Long vodId,List memberIds,String vodName); + + /** + * 修改某个视频的顺序 + */ + void updateVodOrderNo(Long id,Integer orderNo); + + /** + * 重复数据查找 + */ + List testPlays(Long memberId); } diff --git a/src/main/java/com/subsidy/mapper/VodLabelDictMapper.java b/src/main/java/com/subsidy/mapper/VodLabelDictMapper.java new file mode 100644 index 0000000..058bff9 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/VodLabelDictMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.VodLabelDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 视频库类目表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-07-19 + */ + @Repository +public interface VodLabelDictMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java index acae106..815deb6 100644 --- a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java +++ b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java @@ -1,11 +1,20 @@ package com.subsidy.mapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.model.VodPlayHistoryDO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.administer.MemberStudyLogVO; +import com.subsidy.vo.member.ContentVodNewVO; +import com.subsidy.vo.sign.DataViewVO; +import com.subsidy.vo.vod.ClassMemberPlayLengthVO; +import com.subsidy.vo.vod.GetMemberStudyInfoVO; import com.subsidy.vo.vod.StudyHistoryVO; import org.springframework.stereotype.Repository; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + /** *

* 视频播放历史记录表 Mapper 接口 @@ -20,7 +29,72 @@ public interface VodPlayHistoryMapper extends BaseMapper { /** * 查看某成员的学习历史 */ - IPage studyHistory(IPage iPage,Long memberId); + IPage studyHistory(IPage iPage, Long memberId); + + /** + * 从成员,日期的维度查看学生学习时长 + */ + List getMemberStudyInfo(Long classId, List memberIds, String startDate, String endDate); + + /** + * 缩量记录 + */ + List getVodPlayHistory(); + + /** + * 查看某人当天看了多少时间 + */ + int memberDailyStudyLength(Long memberId); + + /** + * 查看学生是否完成了某个视频 + */ + int completeVodOrNot(Long memberId, Long vodId,Long classId); + + ///** + // * 查看某个班级的学习记录 + // */ + //DataViewVO classStudyHistory(Long classId); + + /** + * 查看这个课程某个成员看的视频课程 + */ + List memberRecentPlay(Long classId, Long memberId); + + /** + * 查看某个成员某个课程的学习日志--分页 + */ + IPage memberStudy(IPage iPage,Long classId, Long memberId); + + /** + * 查看某个成员某个课程的学习日志 + */ + List memberStudyLog(Long classId, Long memberId); + + /** + * 查看某个人的学习累计时长 + */ + Integer memberTotalLength(Long memberId); + + /** + * 查看某个人某个视频的累计时长 + */ + Integer memberVodTotalLength(Long classId,Long memberId,Long vodId); + + /** + * 跑脚本 前一天的学习情况 + */ + List exPlayInfo(Long memberId, String classId, LocalDateTime localDateTime); + + /** + * 以班级、人的维度查询某个人的视频观看时长 + */ + List classMemberPlayLength(Long classId); + + /** + * 查找某个人某个课程某天看视频的全部数据---按照createDate排序 + */ + List getVodPlayDay(Long classId, Long memberId, Date endDate); } diff --git a/src/main/java/com/subsidy/model/AccessTokenDO.java b/src/main/java/com/subsidy/model/AccessTokenDO.java new file mode 100644 index 0000000..2803660 --- /dev/null +++ b/src/main/java/com/subsidy/model/AccessTokenDO.java @@ -0,0 +1,31 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author DengMin + * @since 2022-02-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("access_token") +public class AccessTokenDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + private String accessToken; + + +} diff --git a/src/main/java/com/subsidy/model/ActivityDetectionDO.java b/src/main/java/com/subsidy/model/ActivityDetectionDO.java new file mode 100644 index 0000000..73e9319 --- /dev/null +++ b/src/main/java/com/subsidy/model/ActivityDetectionDO.java @@ -0,0 +1,48 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 活跃度检测表 + *

+ * + * @author DengMin + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("activity_detection") +public class ActivityDetectionDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 班级id + */ + private Long classId; + + /** + * 人员id + */ + private Long memberId; + + /** + * 成功/失败 + */ + private Integer status; + + /** + * RequestId + */ + private String requestId; + +} diff --git a/src/main/java/com/subsidy/model/BusinessScopeDictDO.java b/src/main/java/com/subsidy/model/BusinessScopeDictDO.java new file mode 100644 index 0000000..ead9970 --- /dev/null +++ b/src/main/java/com/subsidy/model/BusinessScopeDictDO.java @@ -0,0 +1,34 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 经营范围表 + *

+ * + * @author DengMin + * @since 2022-07-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("business_scope_dict") +public class BusinessScopeDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 经营范围名称 + */ + private String businessScopeName; + + +} diff --git a/src/main/java/com/subsidy/model/CertCompanyMappingDO.java b/src/main/java/com/subsidy/model/CertCompanyMappingDO.java new file mode 100644 index 0000000..c90288f --- /dev/null +++ b/src/main/java/com/subsidy/model/CertCompanyMappingDO.java @@ -0,0 +1,39 @@ +package com.subsidy.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 证书-公司映射表 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("cert_company_mapping") +public class CertCompanyMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 公司id + */ + private Long companyId; + + /** + * 证书id + */ + private Long certId; + + +} diff --git a/src/main/java/com/subsidy/model/CertDictDO.java b/src/main/java/com/subsidy/model/CertDictDO.java new file mode 100644 index 0000000..bda7fc8 --- /dev/null +++ b/src/main/java/com/subsidy/model/CertDictDO.java @@ -0,0 +1,94 @@ +package com.subsidy.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import java.time.LocalDateTime; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 证书字典表 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("cert_dict") +public class CertDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 证书名称 + */ + private String certName; + + /** + * 副标题 + */ + private String title; + + /** + * 证书价格 + */ + private String price; + + /** + * 划线价格 + */ + private String scribePrice; + + /** + * 证书简介 + */ + private String certDesc; + + /** + * 证书封面 + */ + private String coverPage; + + /** + * 详情封面 + */ + private String detailPage; + + /** + * 详情 + */ + private String detail; + + /** + * 学费和补贴 + */ + private String chargeAndSubsidy; + + /** + * 服务流程 + */ + private String serviceProcess; + + /** + * 退费流程 + */ + private String refundGuarantee; + + /** + * 条件说明 + */ + private String requirementDesc; + + /** + * 提交说明 + */ + private String submitDesc; + +} diff --git a/src/main/java/com/subsidy/model/CertMemberFileMappingDO.java b/src/main/java/com/subsidy/model/CertMemberFileMappingDO.java new file mode 100644 index 0000000..f5aa2b1 --- /dev/null +++ b/src/main/java/com/subsidy/model/CertMemberFileMappingDO.java @@ -0,0 +1,39 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("cert_member_file_mapping") +public class CertMemberFileMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long certId; + + private Long memberId; + + private String fileName; + + private String fileUrl; + + private Long requirementId; + + +} diff --git a/src/main/java/com/subsidy/model/CertMemberMappingDO.java b/src/main/java/com/subsidy/model/CertMemberMappingDO.java new file mode 100644 index 0000000..c20bbd2 --- /dev/null +++ b/src/main/java/com/subsidy/model/CertMemberMappingDO.java @@ -0,0 +1,36 @@ +package com.subsidy.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 学生报名证书表 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("cert_member_mapping") +public class CertMemberMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long memberId; + + private Long certId; + + private String status; + + private Long orderNo; + +} diff --git a/src/main/java/com/subsidy/model/CertRequirementDO.java b/src/main/java/com/subsidy/model/CertRequirementDO.java new file mode 100644 index 0000000..ea3d05a --- /dev/null +++ b/src/main/java/com/subsidy/model/CertRequirementDO.java @@ -0,0 +1,44 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 报名条件表 + *

+ * + * @author DengMin + * @since 2022-05-12 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("cert_requirement") +public class CertRequirementDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 正式id + */ + private Long certId; + + /** + * 条件说明 + */ + private String certRequirement; + + /** + * 必填非必填 + */ + private Boolean status; + + +} diff --git a/src/main/java/com/subsidy/model/CertTypeDictDO.java b/src/main/java/com/subsidy/model/CertTypeDictDO.java new file mode 100644 index 0000000..e09acb1 --- /dev/null +++ b/src/main/java/com/subsidy/model/CertTypeDictDO.java @@ -0,0 +1,31 @@ +package com.subsidy.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 证书类目字典表 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("cert_type_dict") +public class CertTypeDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private String typeName; + + +} diff --git a/src/main/java/com/subsidy/model/CertTypeMappingDO.java b/src/main/java/com/subsidy/model/CertTypeMappingDO.java new file mode 100644 index 0000000..b343e32 --- /dev/null +++ b/src/main/java/com/subsidy/model/CertTypeMappingDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 证书-类型映射表 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("cert_type_mapping") +public class CertTypeMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long certId; + + private Long typeId; + + +} diff --git a/src/main/java/com/subsidy/model/ClassDictDO.java b/src/main/java/com/subsidy/model/ClassDictDO.java index ec59e43..98cdd7c 100644 --- a/src/main/java/com/subsidy/model/ClassDictDO.java +++ b/src/main/java/com/subsidy/model/ClassDictDO.java @@ -41,16 +41,44 @@ public class ClassDictDO extends BaseModel { /** * 班级类型 */ - private String classType; + private String classTypeId; /** * 课程id */ private Long courseId; + /** + * 开始时间 + */ private String startDate; + /** + * 结束时间 + */ private String endDate; + /** + * 是否按照顺序播放 + */ + private Integer isOrder; + + /** + * 是否允许快进 + */ + private Integer isFastPlay; + + ///** + // * 班级状态 + // */ + //private String openStatus; + + /** + * 测试规则 + */ + private Integer testRule; + + + } diff --git a/src/main/java/com/subsidy/model/ClassHourDictDO.java b/src/main/java/com/subsidy/model/ClassHourDictDO.java index b346cd3..f81135f 100644 --- a/src/main/java/com/subsidy/model/ClassHourDictDO.java +++ b/src/main/java/com/subsidy/model/ClassHourDictDO.java @@ -33,7 +33,27 @@ public class ClassHourDictDO extends BaseModel { private Integer classHour; /** - * 有效/无效 + * 断联时间,单位分钟 + */ + private Integer interrupt; + + /** + * 重复测试次数 + */ + private Integer repeatTime; + + /** + * 断联是否开启 + */ + private Integer interruptStatus; + + /** + * 重复测试是否开启 + */ + private Integer repeatStatus; + + /** + * 课时有效/无效 */ private Integer status; diff --git a/src/main/java/com/subsidy/model/ClassNoticeDO.java b/src/main/java/com/subsidy/model/ClassNoticeDO.java new file mode 100644 index 0000000..8f48268 --- /dev/null +++ b/src/main/java/com/subsidy/model/ClassNoticeDO.java @@ -0,0 +1,49 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author DengMin + * @since 2022-01-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("class_notice") +public class ClassNoticeDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 课程id + */ + private Long classId; + + /** + * 通知类型 + */ + private String noticeType; + + /** + * 通知时间 + */ + private String noticeTime; + + /** + * 发送状态 + */ + private String status; + +} diff --git a/src/main/java/com/subsidy/model/ClassTypeDictDO.java b/src/main/java/com/subsidy/model/ClassTypeDictDO.java new file mode 100644 index 0000000..96fbd9a --- /dev/null +++ b/src/main/java/com/subsidy/model/ClassTypeDictDO.java @@ -0,0 +1,39 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 班级类型字典表 + *

+ * + * @author DengMin + * @since 2022-01-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("class_type_dict") +public class ClassTypeDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 公司id + */ + private Long companyId; + + /** + * 课程类型 + */ + private String classType; + + +} diff --git a/src/main/java/com/subsidy/model/Collection.java b/src/main/java/com/subsidy/model/Collection.java new file mode 100644 index 0000000..abcf13b --- /dev/null +++ b/src/main/java/com/subsidy/model/Collection.java @@ -0,0 +1,13 @@ +package com.subsidy.model; + +import lombok.Data; + +@Data + +public class Collection { + + private String _id; + + private String name; + +} diff --git a/src/main/java/com/subsidy/model/CompanyDictDO.java b/src/main/java/com/subsidy/model/CompanyDictDO.java index 3e1700a..cf5d8be 100644 --- a/src/main/java/com/subsidy/model/CompanyDictDO.java +++ b/src/main/java/com/subsidy/model/CompanyDictDO.java @@ -46,10 +46,18 @@ public class CompanyDictDO extends BaseModel { private String banner; /** - * 领域 + * 地址 */ - private String field; + private String address; + /** + * 是否需要跳转到Q学友 + */ + private Boolean qxyStatus; + /** + * 第三方监管名称 + */ + private String superviseName; } diff --git a/src/main/java/com/subsidy/model/CompanyFieldMappingDO.java b/src/main/java/com/subsidy/model/CompanyFieldMappingDO.java new file mode 100644 index 0000000..0f0e1bb --- /dev/null +++ b/src/main/java/com/subsidy/model/CompanyFieldMappingDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author DengMin + * @since 2022-02-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("company_field_mapping") +public class CompanyFieldMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long companyId; + + private Long fieldId; + + +} diff --git a/src/main/java/com/subsidy/model/ContentVodMappingDO.java b/src/main/java/com/subsidy/model/ContentVodMappingDO.java new file mode 100644 index 0000000..98365e0 --- /dev/null +++ b/src/main/java/com/subsidy/model/ContentVodMappingDO.java @@ -0,0 +1,44 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 目录视频关系表 + *

+ * + * @author DengMin + * @since 2022-07-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("content_vod_mapping") +public class ContentVodMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 课程目录ID + */ + private Long contentId; + + /** + * 视频ID + */ + private Long vodId; + + /** + * 视频排序 + */ + private Integer orderNo; + + +} diff --git a/src/main/java/com/subsidy/model/CourseCategoryMappingDO.java b/src/main/java/com/subsidy/model/CourseCategoryMappingDO.java new file mode 100644 index 0000000..d9eb6b0 --- /dev/null +++ b/src/main/java/com/subsidy/model/CourseCategoryMappingDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 课程类目映射 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_category_mapping") +public class CourseCategoryMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long courseId; + + private Long categoryId; + + +} diff --git a/src/main/java/com/subsidy/model/CourseDictDO.java b/src/main/java/com/subsidy/model/CourseDictDO.java index a79f975..84d91b0 100644 --- a/src/main/java/com/subsidy/model/CourseDictDO.java +++ b/src/main/java/com/subsidy/model/CourseDictDO.java @@ -29,7 +29,7 @@ public class CourseDictDO extends BaseModel { private Long id; /** - * + * 企业id */ private Long companyId; @@ -39,23 +39,23 @@ public class CourseDictDO extends BaseModel { private String courseName; /** - * 类目id - */ - private Long categoryId; - - /** * 课程类型 */ private String courseType; /** - * 课程来源 + * 课程封面 */ - private String courseSource; - ///** - // * 习题截止时间 - // */ - //private LocalDateTime deadline; + private String coverPage; + + /** + * 课程开放状态 + */ + private Integer openStatus; + /** + * 备注 + */ + private String remark; } diff --git a/src/main/java/com/subsidy/model/CourseFieldMappingDO.java b/src/main/java/com/subsidy/model/CourseFieldMappingDO.java new file mode 100644 index 0000000..bed9f02 --- /dev/null +++ b/src/main/java/com/subsidy/model/CourseFieldMappingDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author DengMin + * @since 2022-01-20 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_field_mapping") +public class CourseFieldMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long courseId; + + private Long fieldId; + + +} diff --git a/src/main/java/com/subsidy/model/CourseJobMappingDO.java b/src/main/java/com/subsidy/model/CourseJobMappingDO.java new file mode 100644 index 0000000..05f6287 --- /dev/null +++ b/src/main/java/com/subsidy/model/CourseJobMappingDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 课程-岗位映射表 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_job_mapping") +public class CourseJobMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long jobId; + + private Long courseId; + + +} diff --git a/src/main/java/com/subsidy/model/CourseRankMappingDO.java b/src/main/java/com/subsidy/model/CourseRankMappingDO.java new file mode 100644 index 0000000..870cc32 --- /dev/null +++ b/src/main/java/com/subsidy/model/CourseRankMappingDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 课程职级映射表 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_rank_mapping") +public class CourseRankMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long courseId; + + private Long rankId; + + +} diff --git a/src/main/java/com/subsidy/model/DepartmentDictDO.java b/src/main/java/com/subsidy/model/DepartmentDictDO.java index f2215ed..6a71f6c 100644 --- a/src/main/java/com/subsidy/model/DepartmentDictDO.java +++ b/src/main/java/com/subsidy/model/DepartmentDictDO.java @@ -52,6 +52,11 @@ public class DepartmentDictDO extends BaseModel { private Long parentId; /** + * 部门全路径 + */ + private String fullName; + + /** * 为写程序方便,数据库里为null */ private List children; diff --git a/src/main/java/com/subsidy/model/ExerciseDictDO.java b/src/main/java/com/subsidy/model/ExerciseDictDO.java index 05347d8..3a59c9f 100644 --- a/src/main/java/com/subsidy/model/ExerciseDictDO.java +++ b/src/main/java/com/subsidy/model/ExerciseDictDO.java @@ -26,6 +26,11 @@ public class ExerciseDictDO extends BaseModel { private Long id; /** + * 试卷id + */ + private Long paperId; + + /** * 题目类型:单选/多选/是非 */ private String exerciseType; diff --git a/src/main/java/com/subsidy/model/ExerciseDoneHistoryDO.java b/src/main/java/com/subsidy/model/ExerciseDoneHistoryDO.java new file mode 100644 index 0000000..49e223b --- /dev/null +++ b/src/main/java/com/subsidy/model/ExerciseDoneHistoryDO.java @@ -0,0 +1,64 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 做题历史记录表 + *

+ * + * @author DengMin + * @since 2021-12-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_done_history") +public class ExerciseDoneHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * exercise_done_result的主键 + */ + private Long doneId; + + /** + * 卷子id + */ + private Long paperId; + + /** + * 学生id + */ + private Long memberId; + + /** + * 学习任务id + */ + private Long classId; + + /** + * 习题id + */ + private Long exerciseId; + + /** + * 做题答案 /已读 + */ + private String answer; + + /** + * 结果 0:错误 1:正确 + */ + private Integer result; + + +} diff --git a/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java b/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java index 3398bf1..243db90 100644 --- a/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java +++ b/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java @@ -25,6 +25,12 @@ public class ExerciseDoneResultDO extends BaseModel { @TableId(value = "id", type = IdType.AUTO) private Long id; + + /** + * 卷子id + */ + private Long paperId; + /** * 成员id */ @@ -50,5 +56,19 @@ public class ExerciseDoneResultDO extends BaseModel { */ private Integer totalCounts; + /** + * 测试分数 + */ + private Integer score; + + /** + * 是否合格 0:不合格 1:合格 + */ + private String result; + + /** + * 做题时长 + */ + private Integer length; } diff --git a/src/main/java/com/subsidy/model/FieldDictDO.java b/src/main/java/com/subsidy/model/FieldDictDO.java new file mode 100644 index 0000000..245ed24 --- /dev/null +++ b/src/main/java/com/subsidy/model/FieldDictDO.java @@ -0,0 +1,34 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 行业字典表 + *

+ * + * @author DengMin + * @since 2022-01-20 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("field_dict") +public class FieldDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 行业名称 + */ + private String fieldName; + + +} diff --git a/src/main/java/com/subsidy/model/ImageCheckRecordDO.java b/src/main/java/com/subsidy/model/ImageCheckRecordDO.java new file mode 100644 index 0000000..d47b9df --- /dev/null +++ b/src/main/java/com/subsidy/model/ImageCheckRecordDO.java @@ -0,0 +1,49 @@ +package com.subsidy.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 实名验证记录表 + *

+ * + * @author DengMin + * @since 2022-07-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("image_check_record") +public class ImageCheckRecordDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 班级id + */ + private Long classId; + + /** + * 试卷id + */ + private Long paperId; + + /** + * 成员id + */ + private Long memberId; + + private String requestId; + + /** + * 图片地址 + */ + private String imageUrl; +} diff --git a/src/main/java/com/subsidy/model/JobDictDO.java b/src/main/java/com/subsidy/model/JobDictDO.java new file mode 100644 index 0000000..87f6232 --- /dev/null +++ b/src/main/java/com/subsidy/model/JobDictDO.java @@ -0,0 +1,44 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 岗位表 + *

+ * + * @author DengMin + * @since 2022-02-10 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("job_dict") +public class JobDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 公司id + */ + private Long companyId; + + /** + * 岗位名称 + */ + private String jobName; + + /** + * 排序 + */ + private Integer orderNo; + + +} diff --git a/src/main/java/com/subsidy/model/JobMemberMappingDO.java b/src/main/java/com/subsidy/model/JobMemberMappingDO.java new file mode 100644 index 0000000..cb5ba77 --- /dev/null +++ b/src/main/java/com/subsidy/model/JobMemberMappingDO.java @@ -0,0 +1,36 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 岗位人员表 + *

+ * + * @author DengMin + * @since 2022-02-10 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("job_member_mapping") +public class JobMemberMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 岗位id + */ + private Long jobId; + + private Long memberId; + + +} diff --git a/src/main/java/com/subsidy/model/MemberDO.java b/src/main/java/com/subsidy/model/MemberDO.java index 6212c79..8f60de6 100644 --- a/src/main/java/com/subsidy/model/MemberDO.java +++ b/src/main/java/com/subsidy/model/MemberDO.java @@ -1,5 +1,6 @@ package com.subsidy.model; +import com.fasterxml.jackson.annotation.JsonFormat; import com.subsidy.util.BaseModel; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -7,6 +8,9 @@ import com.baomidou.mybatisplus.annotation.TableId; import lombok.Data; import lombok.EqualsAndHashCode; +import java.time.LocalDateTime; +import java.util.Date; + /** *

* 学生表 @@ -26,9 +30,9 @@ public class MemberDO extends BaseModel { private Long id; /** - * 部门id + * 公司id */ - private Long departmentId; + private Long companyId; /** * 账号 @@ -36,6 +40,11 @@ public class MemberDO extends BaseModel { private String accountName; /** + * 英文名 + */ + private String accountNameEn; + + /** * 姓名 */ private String userName; @@ -51,6 +60,22 @@ public class MemberDO extends BaseModel { private String password; /** + * 工号 + */ + private String workNo; + + /** + * 入职时间 + */ + @JsonFormat + private String inductionDate; + + /** + * 邮箱 + */ + private String email; + + /** * 性别 */ private String gender; @@ -61,11 +86,26 @@ public class MemberDO extends BaseModel { private String image; /** + * 人脸核验--照片 + */ + private String checkImage; + + /** + * 采集时间 + */ + private LocalDateTime checkTime; + + /** * 身份证号 */ private String idCard; /** + * 第一次登录 + */ + private Integer firstLogin; + + /** * 状态 */ private String status; diff --git a/src/main/java/com/subsidy/model/MemberStudyLengthDO.java b/src/main/java/com/subsidy/model/MemberStudyLengthDO.java new file mode 100644 index 0000000..3d1295b --- /dev/null +++ b/src/main/java/com/subsidy/model/MemberStudyLengthDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author DengMin + * @since 2022-01-28 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("member_study_length") +public class MemberStudyLengthDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long memberId; + + private Integer totalLength; + + +} diff --git a/src/main/java/com/subsidy/model/OprAdmDictDO.java b/src/main/java/com/subsidy/model/OprAdmDictDO.java new file mode 100644 index 0000000..491f27d --- /dev/null +++ b/src/main/java/com/subsidy/model/OprAdmDictDO.java @@ -0,0 +1,42 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.omg.CosNaming.NamingContextExtPackage.StringNameHelper; + +/** + *

+ * 审计表 + *

+ * + * @author DengMin + * @since 2021-12-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("opr_adm_dict") +public class OprAdmDictDO extends BaseModel{ + + private Long id; + + /** + * 用户id + */ + private Long userId; + + /** + * 操作类型 + */ + private String oprType; + + /** + * 登录结果 + */ + private Integer result; + + +} diff --git a/src/main/java/com/subsidy/model/OprMemDictDO.java b/src/main/java/com/subsidy/model/OprMemDictDO.java new file mode 100644 index 0000000..a62aa80 --- /dev/null +++ b/src/main/java/com/subsidy/model/OprMemDictDO.java @@ -0,0 +1,45 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 审计表 + *

+ * + * @author DengMin + * @since 2021-12-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("opr_mem_dict") +public class OprMemDictDO extends BaseModel { + + private Long id; + + /** + * 用户id + */ + private Long userId; + + /** + * 操作类型 + */ + private String oprType; + + /** + * 登录结果 + */ + private Integer result; + + /** + * 登录ip + */ + private String ipAddress; + +} diff --git a/src/main/java/com/subsidy/model/PaperDictDO.java b/src/main/java/com/subsidy/model/PaperDictDO.java new file mode 100644 index 0000000..ea61b8f --- /dev/null +++ b/src/main/java/com/subsidy/model/PaperDictDO.java @@ -0,0 +1,44 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 试卷字典表 + *

+ * + * @author DengMin + * @since 2021-12-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("paper_dict") +public class PaperDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 课程id + */ + private Long courseId; + + /** + * 卷子名称 + */ + private String paperName; + + /** + * 启用状态 0 :未启用 1:启用 + */ + private Integer paperStatus; + + +} diff --git a/src/main/java/com/subsidy/model/RankDictDO.java b/src/main/java/com/subsidy/model/RankDictDO.java new file mode 100644 index 0000000..0bcb376 --- /dev/null +++ b/src/main/java/com/subsidy/model/RankDictDO.java @@ -0,0 +1,36 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 职级字典表 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("rank_dict") +public class RankDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long companyId; + + /** + * 职级 + */ + private String rank; + + +} diff --git a/src/main/java/com/subsidy/model/RotationImgDictDO.java b/src/main/java/com/subsidy/model/RotationImgDictDO.java new file mode 100644 index 0000000..2805cdb --- /dev/null +++ b/src/main/java/com/subsidy/model/RotationImgDictDO.java @@ -0,0 +1,36 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 轮播图 + *

+ * + * @author DengMin + * @since 2022-02-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("rotation_img_dict") +public class RotationImgDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long companyId; + + /** + * 轮播图 + */ + private String rotationImg; + + +} diff --git a/src/main/java/com/subsidy/model/SignInRecordDO.java b/src/main/java/com/subsidy/model/SignInRecordDO.java index ce9fd79..90312ac 100644 --- a/src/main/java/com/subsidy/model/SignInRecordDO.java +++ b/src/main/java/com/subsidy/model/SignInRecordDO.java @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; + +import com.subsidy.util.excel.ExcelColumnUtil; import lombok.Data; import lombok.EqualsAndHashCode; @@ -29,16 +31,19 @@ public class SignInRecordDO extends BaseModel { /** * 学生id */ + @ExcelColumnUtil(value = "member_id", col = 3) private Long memberId; /** * 班级id */ + @ExcelColumnUtil(value = "class_id", col = 2) private Long classId; /** * 签到时间 */ + @ExcelColumnUtil(value = "sign_in_date", col = 4) private LocalDateTime signInDate; diff --git a/src/main/java/com/subsidy/model/VodDictDO.java b/src/main/java/com/subsidy/model/VodDictDO.java index 3661321..e65ed9f 100644 --- a/src/main/java/com/subsidy/model/VodDictDO.java +++ b/src/main/java/com/subsidy/model/VodDictDO.java @@ -26,9 +26,9 @@ public class VodDictDO extends BaseModel { private Long id; /** - * 目录id + * 类目id */ - private Long contentId; + private Long labelId; /** * 视频名称 @@ -70,4 +70,9 @@ public class VodDictDO extends BaseModel { */ private String coverPage; + /** + * 排序 + */ + private Integer orderNo; + } diff --git a/src/main/java/com/subsidy/model/VodLabelDictDO.java b/src/main/java/com/subsidy/model/VodLabelDictDO.java new file mode 100644 index 0000000..192431a --- /dev/null +++ b/src/main/java/com/subsidy/model/VodLabelDictDO.java @@ -0,0 +1,34 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 视频库类目表 + *

+ * + * @author DengMin + * @since 2022-07-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("vod_label_dict") +public class VodLabelDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 视频类目名称 + */ + private String labelName; + + +} diff --git a/src/main/java/com/subsidy/model/VodPlayHistoryDO.java b/src/main/java/com/subsidy/model/VodPlayHistoryDO.java index 1635b64..d5fc850 100644 --- a/src/main/java/com/subsidy/model/VodPlayHistoryDO.java +++ b/src/main/java/com/subsidy/model/VodPlayHistoryDO.java @@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId; import lombok.Data; import lombok.EqualsAndHashCode; +import java.time.LocalDateTime; + /** *

* 视频播放历史记录表 @@ -50,5 +52,12 @@ public class VodPlayHistoryDO extends BaseModel { */ private Integer playRecord; + /** + * 聚合 + */ + private Integer playCount; + + private LocalDateTime playDate; + } diff --git a/src/main/java/com/subsidy/mongodb/MongoController.java b/src/main/java/com/subsidy/mongodb/MongoController.java new file mode 100644 index 0000000..ff92950 --- /dev/null +++ b/src/main/java/com/subsidy/mongodb/MongoController.java @@ -0,0 +1,68 @@ +//package com.subsidy.mongodb; +// +//import com.subsidy.util.MongoUtil; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.data.mongodb.core.MongoTemplate; +//import org.springframework.web.bind.annotation.PostMapping; +//import org.springframework.web.bind.annotation.RequestMapping; +//import org.springframework.web.bind.annotation.RestController; +// +//@RestController +//@RequestMapping("/mango") +//public class MongoController { +// +// +// @Autowired +// private MongoTemplate mongoTemplate; +// +// @Autowired +// private MongoUtil mongoUtil; +// +// @PostMapping("getOne") +// public void getAll(){ +// ////Query query=new Query(); +// ////MongoDO user = mongoTemplate.getDb(query , MongoDO.class); +// ////List mongo= mongoTemplate.findAll(MongoDO.class); +// ////System.out.println(mongo); +// //System.out.println(mongoTemplate.getDb().getName()); +// // +// //Collection mongoDO = mongoTemplate.findById("61de944c5cdc5e3f896c95c7", Collection.class); +// //System.out.println(mongoDO); +// // +// //List collections = mongoTemplate.findAll(Collection.class); +// //System.out.println(collections); +// // +// //Query query = new Query(Criteria.where("name").regex("张"));//可累加条件 +// //List entrY = mongoTemplate.find(query,Collection.class); +// //System.out.println(entrY); +// +// //添加 +// //Collection collection = new Collection(); +// //collection.setName("bbbbbbbb"); +// //collection.set_id("61de944c5cdc5e3f896c95c7"); +// //mongoTemplate.save(collection,"collection"); +// +// //for (int i = 0 ; i < 100; i++){ +// // Collection collection1 = new Collection(); +// // collection1.setName("aaaa"+i); +// // mongoTemplate.save(collection1); +// //} +// +// //Query query =new Query(new Criteria()); +// //query.with(Sort.by("name")); +// ////mongoUtil.start(1,5,query); +// //List collections = mongoTemplate.find(query,Collection.class); +// //for (Collection collection : collections){ +// // System.out.println(collection+"========="); +// //} +// +// //OprAdmDictDO oprAdmDictDO = new OprAdmDictDO(); +// //oprAdmDictDO.setUserId(1L); +// //oprAdmDictDO.setResult(1); +// //oprAdmDictDO.setOprType("登录成功"); +// //mongoTemplate.save(oprAdmDictDO); +// +// +// } +// +//} diff --git a/src/main/java/com/subsidy/mongodb/PageVO.java b/src/main/java/com/subsidy/mongodb/PageVO.java new file mode 100644 index 0000000..cca0447 --- /dev/null +++ b/src/main/java/com/subsidy/mongodb/PageVO.java @@ -0,0 +1,26 @@ +package com.subsidy.mongodb; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.Data; + +import java.util.List; + +@Data +public class PageVO { + + + /** + * 分页记录列表 + * + * @return 分页对象记录列表 + */ + private List records; + + /** + * 设置当前满足条件总行数 + */ + private long total; + + + +} diff --git a/src/main/java/com/subsidy/service/AccessTokenService.java b/src/main/java/com/subsidy/service/AccessTokenService.java new file mode 100644 index 0000000..bd4ab7b --- /dev/null +++ b/src/main/java/com/subsidy/service/AccessTokenService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.AccessTokenDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author DengMin + * @since 2022-02-18 + */ +public interface AccessTokenService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/ActivityDetectionService.java b/src/main/java/com/subsidy/service/ActivityDetectionService.java new file mode 100644 index 0000000..3a0ab1e --- /dev/null +++ b/src/main/java/com/subsidy/service/ActivityDetectionService.java @@ -0,0 +1,25 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.detection.VerifyDTO; +import com.subsidy.model.ActivityDetectionDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + *

+ * 活跃度检测表 服务类 + *

+ * + * @author DengMin + * @since 2022-07-13 + */ +public interface ActivityDetectionService extends IService { + + String verify(VerifyDTO verifyDTO, HttpServletRequest request); + + IPage getCheckHistory(ActivityDetectionDO activityDetectionDO); + +} diff --git a/src/main/java/com/subsidy/service/AdministerService.java b/src/main/java/com/subsidy/service/AdministerService.java index ead20d2..beb7745 100644 --- a/src/main/java/com/subsidy/service/AdministerService.java +++ b/src/main/java/com/subsidy/service/AdministerService.java @@ -1,19 +1,17 @@ package com.subsidy.service; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.subsidy.dto.administer.ClassDetailDTO; -import com.subsidy.dto.administer.OperatorsDTO; -import com.subsidy.model.AdministerDO; import com.baomidou.mybatisplus.extension.service.IService; -import com.subsidy.model.ClassDictDO; -import com.subsidy.model.MemberDO; +import com.subsidy.dto.administer.*; +import com.subsidy.model.AdministerDO; +import com.subsidy.model.ExerciseDoneHistoryDO; +import com.subsidy.model.ExerciseDoneResultDO; import com.subsidy.vo.administer.*; import com.subsidy.vo.classdict.ClassDetailVO; import com.subsidy.vo.member.ClassSignVO; import com.subsidy.vo.sign.AnswerRecordVO; import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -48,16 +46,41 @@ public interface AdministerService extends IService { List exportSignDetail(ClassDetailDTO classDetailDTO)throws Exception; - IPage exerciseTest(ClassDetailDTO classDetailDTO); + IPage exerciseTest(ClassDetailDTO classDetailDTO); List exportExerciseTest(ClassDetailDTO classDetailDTO)throws Exception; + List getMemberPapers(ExerciseDoneResultDO exerciseDoneResultDO); + + List getPaperDetail(ExerciseDoneHistoryDO exerciseDoneHistoryDO); + IPage answerRecord(ClassDetailDTO classDetailDTO); List exportAnswerRecord(ClassDetailDTO classDetailDTO)throws Exception; + List classVodInfo(ClassVodInfoDTO classVodInfoDTO); + + IPage classDailyInfo(ClassDailyInfoDTO classDailyInfoDTO); + + void exportClassDailyInfo(ClassDailyInfoDTO classDailyInfoDTO); + + IPage classVodDailyInfo(ClassVodDailyInfoDTO classVodDailyInfoDTO); + + void exportClassVodDailyInfo(ClassVodDailyInfoDTO classVodDailyInfoDTO); + + IPage memberDetectionRecord(ClassDetailDTO classDetailDTO); + + void exportMemberDetectionRecord(ClassDetailDTO classDetailDTO); + + IPage imageCheckDetail(ClassDetailDTO classDetailDTO); + void export(ClassDetailDTO classDetailDTO)throws Exception; - String importMember(Long companyId, MultipartFile multipartFile); + IPage memberStudy(MemberStudyLogDTO memberStudyLogDTO); + + void memberStudyLog(MemberStudyLogDTO memberStudyLogDTO)throws Exception; + + String importMember(Long companyId, MultipartFile multipartFile)throws Exception; + IPage manageMember(ManageMemberDTO manageMemberDTO); } diff --git a/src/main/java/com/subsidy/service/AnsweringQuestionService.java b/src/main/java/com/subsidy/service/AnsweringQuestionService.java index 7af3159..5bd489f 100644 --- a/src/main/java/com/subsidy/service/AnsweringQuestionService.java +++ b/src/main/java/com/subsidy/service/AnsweringQuestionService.java @@ -1,7 +1,7 @@ package com.subsidy.service; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.subsidy.dto.GetCourseQuestionDTO; +import com.subsidy.dto.course.GetCourseQuestionDTO; import com.subsidy.model.AnsweringQuestionDO; import com.baomidou.mybatisplus.extension.service.IService; @@ -22,4 +22,6 @@ public interface AnsweringQuestionService extends IService String deleteQuestion(AnsweringQuestionDO answeringQuestionDO); String updateQuestion(AnsweringQuestionDO answeringQuestionDO); + + Integer getNoAnswers(AnsweringQuestionDO answeringQuestionDO); } diff --git a/src/main/java/com/subsidy/service/BusinessScopeDictService.java b/src/main/java/com/subsidy/service/BusinessScopeDictService.java new file mode 100644 index 0000000..10b089a --- /dev/null +++ b/src/main/java/com/subsidy/service/BusinessScopeDictService.java @@ -0,0 +1,19 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.businessScope.BusinessScopeDTO; +import com.subsidy.model.BusinessScopeDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 经营范围表 服务类 + *

+ * + * @author DengMin + * @since 2022-07-25 + */ +public interface BusinessScopeDictService extends IService { + + IPage queryBusinessScopePage(BusinessScopeDTO businessScopeDictDO); +} diff --git a/src/main/java/com/subsidy/service/CertCompanyMappingService.java b/src/main/java/com/subsidy/service/CertCompanyMappingService.java new file mode 100644 index 0000000..312cc2e --- /dev/null +++ b/src/main/java/com/subsidy/service/CertCompanyMappingService.java @@ -0,0 +1,30 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.cert.ChangeCompanyCertsDTO; +import com.subsidy.dto.cert.GetCompanyCertsDTO; +import com.subsidy.dto.cert.GetCompanyCertsWithStatusDTO; +import com.subsidy.model.CertCompanyMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.cert.GetCompanyCertsVO; +import com.subsidy.vo.cert.GetCompanyCertsWithStatusVO; + +import java.util.List; + +/** + *

+ * 证书-公司映射表 服务类 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +public interface CertCompanyMappingService extends IService { + + + List getCompanyCertsWithStatus(GetCompanyCertsWithStatusDTO getCompanyCertsDTO); + + IPage getCompanyCerts(GetCompanyCertsDTO getCompanyCertsDTO); + + String changeCompanyCerts(ChangeCompanyCertsDTO changeCompanyCertsDTO); +} diff --git a/src/main/java/com/subsidy/service/CertDictService.java b/src/main/java/com/subsidy/service/CertDictService.java new file mode 100644 index 0000000..1f9fb3b --- /dev/null +++ b/src/main/java/com/subsidy/service/CertDictService.java @@ -0,0 +1,37 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.cert.AddCertDTO; +import com.subsidy.dto.cert.GetAllCertsDTO; +import com.subsidy.dto.cert.GetOneCertDTO; +import com.subsidy.model.CertDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.cert.GetAllCertsVO; +import com.subsidy.vo.cert.GetAllCertsWithoutTypeVO; +import com.subsidy.vo.cert.GetOneCertVO; + +import java.util.List; + +/** + *

+ * 证书字典表 服务类 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +public interface CertDictService extends IService { + + String addCert(AddCertDTO addCertDTO); + + String deleteCert(CertDictDO certDictDO); + + String updateCert(AddCertDTO addCertDTO); + + GetOneCertVO getOneCert(GetOneCertDTO getOneCertDTO); + + IPage getAllCerts(GetAllCertsDTO getAllCertsDTO); + + List getAllCertsWithoutType(); + +} diff --git a/src/main/java/com/subsidy/service/CertMemberFileMappingService.java b/src/main/java/com/subsidy/service/CertMemberFileMappingService.java new file mode 100644 index 0000000..5a09aca --- /dev/null +++ b/src/main/java/com/subsidy/service/CertMemberFileMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.CertMemberFileMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +public interface CertMemberFileMappingService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/CertMemberMappingService.java b/src/main/java/com/subsidy/service/CertMemberMappingService.java new file mode 100644 index 0000000..202fefe --- /dev/null +++ b/src/main/java/com/subsidy/service/CertMemberMappingService.java @@ -0,0 +1,34 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.cert.GetListDTO; +import com.subsidy.dto.cert.SignManagementDTO; +import com.subsidy.dto.cert.SignUpDTO; +import com.subsidy.model.CertMemberMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.cert.GetListVO; +import com.subsidy.vo.cert.GetSignInfoVO; +import com.subsidy.vo.cert.SignManagementVO; + +import java.util.List; + +/** + *

+ * 学生报名证书表 服务类 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +public interface CertMemberMappingService extends IService { + + String signUp(SignUpDTO signUpDTO); + + IPage signManagement(SignManagementDTO signManagementDTO); + + String changeStatus(CertMemberMappingDO certMemberMappingDO); + + IPage getList(GetListDTO getListDTO); + + GetSignInfoVO getSignInfo(CertMemberMappingDO certMemberMappingDO); +} diff --git a/src/main/java/com/subsidy/service/CertRequirementService.java b/src/main/java/com/subsidy/service/CertRequirementService.java new file mode 100644 index 0000000..5ad6157 --- /dev/null +++ b/src/main/java/com/subsidy/service/CertRequirementService.java @@ -0,0 +1,26 @@ +package com.subsidy.service; + +import com.subsidy.model.CertDictDO; +import com.subsidy.model.CertRequirementDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 报名条件表 服务类 + *

+ * + * @author DengMin + * @since 2022-05-12 + */ +public interface CertRequirementService extends IService { + + List getRequirements(CertRequirementDO certRequirementDO); + + String deleteRequirement(CertRequirementDO certRequirementDO); + + String addRequirement(CertRequirementDO certRequirementDO); + + String updateRequirement(CertRequirementDO certRequirementDO); +} diff --git a/src/main/java/com/subsidy/service/CertTypeDictService.java b/src/main/java/com/subsidy/service/CertTypeDictService.java new file mode 100644 index 0000000..047ca6c --- /dev/null +++ b/src/main/java/com/subsidy/service/CertTypeDictService.java @@ -0,0 +1,30 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.cert.GetAllTypeDTO; +import com.subsidy.model.CertCompanyMappingDO; +import com.subsidy.model.CertTypeDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 证书类目字典表 服务类 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +public interface CertTypeDictService extends IService { + + List getCompanyCertTypes(CertCompanyMappingDO certCompanyMappingDO); + + String addType(CertTypeDictDO certTypeDictDO); + + String deleteType(CertTypeDictDO certTypeDictDO); + + String updateType(CertTypeDictDO certTypeDictDO); + + IPage getAllType(GetAllTypeDTO getAllTypeDTO); +} diff --git a/src/main/java/com/subsidy/service/CertTypeMappingService.java b/src/main/java/com/subsidy/service/CertTypeMappingService.java new file mode 100644 index 0000000..53cd0dc --- /dev/null +++ b/src/main/java/com/subsidy/service/CertTypeMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.CertTypeMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 证书-类型映射表 服务类 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +public interface CertTypeMappingService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/ClassDictService.java b/src/main/java/com/subsidy/service/ClassDictService.java index ca6f06b..96ccd31 100644 --- a/src/main/java/com/subsidy/service/ClassDictService.java +++ b/src/main/java/com/subsidy/service/ClassDictService.java @@ -1,15 +1,15 @@ package com.subsidy.service; +import com.baomidou.mybatisplus.extension.service.IService; import com.subsidy.dto.classDict.AddClassDTO; import com.subsidy.dto.classDict.AddMemberToClassDTO; -import com.subsidy.dto.classDict.GetAllClassesDTO; +import com.subsidy.dto.classDict.GetClassBaseInfoDTO; import com.subsidy.dto.classDict.GetSpareMembersDTO; import com.subsidy.model.ClassDictDO; -import com.baomidou.mybatisplus.extension.service.IService; import com.subsidy.model.ClassMemberMappingDO; -import com.subsidy.model.CourseDictDO; import com.subsidy.model.MemberDO; import com.subsidy.vo.classdict.GetAllClassesVO; +import com.subsidy.vo.classdict.GetClassBaseInfoVO; import java.util.List; @@ -23,11 +23,11 @@ import java.util.List; */ public interface ClassDictService extends IService { - List getAllClasses(ClassDictDO classDictDO); + List getAllClasses(ClassDictDO classDictDO)throws Exception; String deleteClasses(ClassDictDO classDictDO); - String addClass(AddClassDTO addClassDTO); + Long addClass(AddClassDTO addClassDTO); String updateClass(ClassDictDO classDictDO); @@ -40,4 +40,7 @@ public interface ClassDictService extends IService { String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO); String batchSms(ClassDictDO classDictDO); + + GetClassBaseInfoVO getClassBaseInfo(GetClassBaseInfoDTO getClassBaseInfoDTO); + } diff --git a/src/main/java/com/subsidy/service/ClassHourDictService.java b/src/main/java/com/subsidy/service/ClassHourDictService.java index 6196c30..fa47f7f 100644 --- a/src/main/java/com/subsidy/service/ClassHourDictService.java +++ b/src/main/java/com/subsidy/service/ClassHourDictService.java @@ -3,6 +3,7 @@ package com.subsidy.service; import com.subsidy.model.ClassHourDictDO; import com.baomidou.mybatisplus.extension.service.IService; import com.subsidy.model.VodPlayHistoryDO; +import com.subsidy.vo.classdict.GetSettingVO; import com.subsidy.vo.hour.PollingGetVO; /** @@ -15,9 +16,9 @@ import com.subsidy.vo.hour.PollingGetVO; */ public interface ClassHourDictService extends IService { - ClassHourDictDO getSetting(ClassHourDictDO classHourDictDO); + GetSettingVO getSetting(ClassHourDictDO classHourDictDO); - String updateSetting(ClassHourDictDO classHourDictDO); + String updateSetting(GetSettingVO getSettingVO); PollingGetVO pollingGet(VodPlayHistoryDO vodPlayHistoryDO); } diff --git a/src/main/java/com/subsidy/service/ClassNoticeService.java b/src/main/java/com/subsidy/service/ClassNoticeService.java new file mode 100644 index 0000000..58f800c --- /dev/null +++ b/src/main/java/com/subsidy/service/ClassNoticeService.java @@ -0,0 +1,28 @@ +package com.subsidy.service; + +import com.subsidy.dto.classNotice.SendNotificationDTO; +import com.subsidy.model.ClassNoticeDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 服务类 + *

+ * + * @author DengMin + * @since 2022-01-21 + */ +public interface ClassNoticeService extends IService { + + String addNotice(ClassNoticeDO classNoticeDO); + + String updateNotice(ClassNoticeDO classNoticeDO); + + String deleteNotice(ClassNoticeDO classNoticeDO); + + List queryClassNotices(ClassNoticeDO classNoticeDO); + + void sendNotification(SendNotificationDTO sendNotificationDTO); +} diff --git a/src/main/java/com/subsidy/service/ClassTypeDictService.java b/src/main/java/com/subsidy/service/ClassTypeDictService.java new file mode 100644 index 0000000..caf118d --- /dev/null +++ b/src/main/java/com/subsidy/service/ClassTypeDictService.java @@ -0,0 +1,27 @@ +package com.subsidy.service; + +import com.subsidy.dto.classDict.ClassTypeDTO; +import com.subsidy.model.ClassTypeDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 班级类型字典表 服务类 + *

+ * + * @author DengMin + * @since 2022-01-21 + */ +public interface ClassTypeDictService extends IService { + + String addClassType(ClassTypeDictDO classTypeDictDO); + + String updateClassType(ClassTypeDictDO classTypeDictDO); + + String deleteClassType(ClassTypeDictDO classTypeDictDO); + + List queryClassTypes(ClassTypeDTO classTypeDTO); + +} diff --git a/src/main/java/com/subsidy/service/CompanyDictService.java b/src/main/java/com/subsidy/service/CompanyDictService.java index 7d4fa7f..29b31d1 100644 --- a/src/main/java/com/subsidy/service/CompanyDictService.java +++ b/src/main/java/com/subsidy/service/CompanyDictService.java @@ -1,12 +1,17 @@ package com.subsidy.service; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.dto.company.AddCompanyDTO; -import com.subsidy.model.AdministerDO; +import com.subsidy.dto.company.GetCompanyMembersDTO; import com.subsidy.model.CompanyDictDO; -import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.model.MemberDO; import com.subsidy.vo.administer.OperatorsVO; +import com.subsidy.vo.company.GetAllCompanyVO; +import com.subsidy.vo.company.GetCompanyMembersVO; + +import java.util.List; /** *

@@ -26,4 +31,8 @@ public interface CompanyDictService extends IService { String updateAdminister(AddCompanyDTO addCompanyDTO); + List getAllCompany(CompanyDictDO companyDictDO); + + IPage getCompanyMembers(GetCompanyMembersDTO getCompanyMembersDTO); + } diff --git a/src/main/java/com/subsidy/service/CompanyFieldMappingService.java b/src/main/java/com/subsidy/service/CompanyFieldMappingService.java new file mode 100644 index 0000000..26b6517 --- /dev/null +++ b/src/main/java/com/subsidy/service/CompanyFieldMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.CompanyFieldMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author DengMin + * @since 2022-02-11 + */ +public interface CompanyFieldMappingService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/ContentVodMappingService.java b/src/main/java/com/subsidy/service/ContentVodMappingService.java new file mode 100644 index 0000000..a80b716 --- /dev/null +++ b/src/main/java/com/subsidy/service/ContentVodMappingService.java @@ -0,0 +1,30 @@ +package com.subsidy.service; + +import com.subsidy.dto.content.GetContendVodsDTO; +import com.subsidy.dto.contentVod.AddContentVod; +import com.subsidy.dto.contentVod.ContentVodDTO; +import com.subsidy.dto.vod.ChangeOrdersDTO; +import com.subsidy.model.ContentVodMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.vod.GetContendVodsVO; + +import java.util.List; + +/** + *

+ * 目录视频关系表 服务类 + *

+ * + * @author DengMin + * @since 2022-07-19 + */ +public interface ContentVodMappingService extends IService { + + List getContendVods(GetContendVodsDTO getContendVodsDTO); + + void changeContentVodOrders(ChangeOrdersDTO changeOrdersDTO); + + void deleteContentVod(ContentVodDTO contentVodDTO); + + void addContentVod(AddContentVod addContentVod); +} diff --git a/src/main/java/com/subsidy/service/CourseCategoryMappingService.java b/src/main/java/com/subsidy/service/CourseCategoryMappingService.java new file mode 100644 index 0000000..9cb3723 --- /dev/null +++ b/src/main/java/com/subsidy/service/CourseCategoryMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.CourseCategoryMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 课程类目映射 服务类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +public interface CourseCategoryMappingService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/CourseContentService.java b/src/main/java/com/subsidy/service/CourseContentService.java index 128b5c8..03b2605 100644 --- a/src/main/java/com/subsidy/service/CourseContentService.java +++ b/src/main/java/com/subsidy/service/CourseContentService.java @@ -1,10 +1,9 @@ package com.subsidy.service; -import com.subsidy.controller.CourseDictController; -import com.subsidy.model.CourseContentDO; import com.baomidou.mybatisplus.extension.service.IService; -import com.subsidy.model.CourseDictDO; -import com.subsidy.model.VodDictDO; +import com.subsidy.dto.content.GetContendVodsDTO; +import com.subsidy.dto.vod.ChangeOrdersDTO; +import com.subsidy.model.CourseContentDO; import com.subsidy.vo.vod.GetContendVodsVO; import java.util.List; diff --git a/src/main/java/com/subsidy/service/CourseDictService.java b/src/main/java/com/subsidy/service/CourseDictService.java index c345b91..c02d72d 100644 --- a/src/main/java/com/subsidy/service/CourseDictService.java +++ b/src/main/java/com/subsidy/service/CourseDictService.java @@ -1,7 +1,9 @@ package com.subsidy.service; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.course.AddCourseDTO; import com.subsidy.dto.course.QueryCoursesDTO; +import com.subsidy.dto.course.UpdateCoursesDTO; import com.subsidy.model.CourseDictDO; import com.baomidou.mybatisplus.extension.service.IService; @@ -15,14 +17,16 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface CourseDictService extends IService { - String addCourse(CourseDictDO courseDictDO); + String addCourse(AddCourseDTO addCourseDTO); String deleteCourse(CourseDictDO courseDictDO); IPage queryCourses(QueryCoursesDTO queryCoursesDTO); - String updateCourses(CourseDictDO courseDictDO); + String updateCourses(UpdateCoursesDTO updateCoursesDTO); IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO); + String updateOpenStatus(CourseDictDO courseDictDO); + } diff --git a/src/main/java/com/subsidy/service/ClassMemberMappingService.java b/src/main/java/com/subsidy/service/CourseFieldMappingService.java similarity index 71% rename from src/main/java/com/subsidy/service/ClassMemberMappingService.java rename to src/main/java/com/subsidy/service/CourseFieldMappingService.java index e5e7430..e581a28 100644 --- a/src/main/java/com/subsidy/service/ClassMemberMappingService.java +++ b/src/main/java/com/subsidy/service/CourseFieldMappingService.java @@ -1,16 +1,16 @@ package com.subsidy.service; -import com.subsidy.model.ClassMemberMappingDO; +import com.subsidy.model.CourseFieldMappingDO; import com.baomidou.mybatisplus.extension.service.IService; /** *

- * 班级成员映射表 服务类 + * 服务类 *

* * @author DengMin - * @since 2021-10-12 + * @since 2022-01-20 */ -public interface ClassMemberMappingService extends IService { +public interface CourseFieldMappingService extends IService { } diff --git a/src/main/java/com/subsidy/service/CourseJobMappingService.java b/src/main/java/com/subsidy/service/CourseJobMappingService.java new file mode 100644 index 0000000..bece06f --- /dev/null +++ b/src/main/java/com/subsidy/service/CourseJobMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.CourseJobMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 课程-岗位映射表 服务类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +public interface CourseJobMappingService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/CourseRankMappingService.java b/src/main/java/com/subsidy/service/CourseRankMappingService.java new file mode 100644 index 0000000..8593cb3 --- /dev/null +++ b/src/main/java/com/subsidy/service/CourseRankMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.CourseRankMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 课程职级映射表 服务类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +public interface CourseRankMappingService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/DepartmentDictService.java b/src/main/java/com/subsidy/service/DepartmentDictService.java index be78168..58e6fa8 100644 --- a/src/main/java/com/subsidy/service/DepartmentDictService.java +++ b/src/main/java/com/subsidy/service/DepartmentDictService.java @@ -1,8 +1,11 @@ package com.subsidy.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.department.GetDepartmentMembersDTO; import com.subsidy.dto.department.GetDepartmentsVO; import com.subsidy.model.DepartmentDictDO; import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.department.GetMembersVO; import java.util.List; @@ -23,4 +26,8 @@ public interface DepartmentDictService extends IService { String deleteDepartment(DepartmentDictDO departmentDictDO); String updateDepartment(DepartmentDictDO departmentDictDO); + + IPage getDepartmentMembers(GetDepartmentMembersDTO getDepartmentMembersDTO); + + List getMembers(GetDepartmentMembersDTO getDepartmentMembersDTO); } diff --git a/src/main/java/com/subsidy/service/ExerciseDictService.java b/src/main/java/com/subsidy/service/ExerciseDictService.java index 8f9782d..44a7f5f 100644 --- a/src/main/java/com/subsidy/service/ExerciseDictService.java +++ b/src/main/java/com/subsidy/service/ExerciseDictService.java @@ -2,6 +2,7 @@ package com.subsidy.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.dto.exercise.GetAllExercisesDTO; +import com.subsidy.dto.exercise.GetPaperExerciseDTO; import com.subsidy.dto.exercise.SubmitDTO; import com.subsidy.model.CourseDictDO; import com.subsidy.model.ExerciseDictDO; @@ -20,16 +21,13 @@ import java.util.List; */ public interface ExerciseDictService extends IService { - IPage getAllExercises(GetAllExercisesDTO getAllExercisesDTO); - String addExercise(ExerciseDictDO exerciseDictDO); String deleteExercise(ExerciseDictDO exerciseDictDO); String updateExercise(ExerciseDictDO exerciseDictDO); - List getCourseExercises(CourseDictDO courseDictDO); - - String submit(SubmitDTO submitDTO); + Long submit(SubmitDTO submitDTO); + IPage getPaperExercise(GetPaperExerciseDTO getPaperExerciseDTO); } diff --git a/src/main/java/com/subsidy/service/ExerciseDoneHistoryService.java b/src/main/java/com/subsidy/service/ExerciseDoneHistoryService.java new file mode 100644 index 0000000..41ded22 --- /dev/null +++ b/src/main/java/com/subsidy/service/ExerciseDoneHistoryService.java @@ -0,0 +1,22 @@ +package com.subsidy.service; + +import com.subsidy.model.ExerciseDoneHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.vo.exercise.GetDoneHistoryDetailVO; + +import java.util.List; + +/** + *

+ * 做题历史记录表 服务类 + *

+ * + * @author DengMin + * @since 2021-12-03 + */ +public interface ExerciseDoneHistoryService extends IService { + + List getDoneHistoryDetail(ExerciseDoneResultDO exerciseDoneResultDO); + +} diff --git a/src/main/java/com/subsidy/service/ExerciseDoneResultService.java b/src/main/java/com/subsidy/service/ExerciseDoneResultService.java index 5628acb..9e10269 100644 --- a/src/main/java/com/subsidy/service/ExerciseDoneResultService.java +++ b/src/main/java/com/subsidy/service/ExerciseDoneResultService.java @@ -2,6 +2,8 @@ package com.subsidy.service; import com.subsidy.model.ExerciseDoneResultDO; import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.exercise.GetDoneDetailVO; +import org.springframework.web.multipart.MultipartFile; /** *

@@ -13,4 +15,7 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface ExerciseDoneResultService extends IService { + GetDoneDetailVO getDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO); + + void importData(MultipartFile file); } diff --git a/src/main/java/com/subsidy/service/FieldDictService.java b/src/main/java/com/subsidy/service/FieldDictService.java new file mode 100644 index 0000000..eff4c10 --- /dev/null +++ b/src/main/java/com/subsidy/service/FieldDictService.java @@ -0,0 +1,27 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.field.QueryFieldsDTO; +import com.subsidy.model.FieldDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.tencentcloudapi.vpc.v20170312.models.Ip6Rule; + +/** + *

+ * 行业字典表 服务类 + *

+ * + * @author DengMin + * @since 2022-01-20 + */ +public interface FieldDictService extends IService { + + String addField(FieldDictDO fieldDictDO); + + String updateField(FieldDictDO fieldDictDO); + + String deleteField(FieldDictDO fieldDictDO); + + IPage queryFields(QueryFieldsDTO queryFieldsDTO); + +} diff --git a/src/main/java/com/subsidy/service/ImageCheckRecordService.java b/src/main/java/com/subsidy/service/ImageCheckRecordService.java new file mode 100644 index 0000000..d66abc4 --- /dev/null +++ b/src/main/java/com/subsidy/service/ImageCheckRecordService.java @@ -0,0 +1,20 @@ +package com.subsidy.service; + +import com.subsidy.model.ImageCheckRecordDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 实名验证记录表 服务类 + *

+ * + * @author DengMin + * @since 2022-07-14 + */ +public interface ImageCheckRecordService extends IService { + + List getImageCheckHistory(ImageCheckRecordDO imageCheckRecordDO); + +} diff --git a/src/main/java/com/subsidy/service/JobDictService.java b/src/main/java/com/subsidy/service/JobDictService.java new file mode 100644 index 0000000..20afcab --- /dev/null +++ b/src/main/java/com/subsidy/service/JobDictService.java @@ -0,0 +1,25 @@ +package com.subsidy.service; + +import com.subsidy.model.JobDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 岗位表 服务类 + *

+ * + * @author DengMin + * @since 2022-02-10 + */ +public interface JobDictService extends IService { + + List queryJobs(JobDictDO jobDictDO); + + String deleteJob(JobDictDO jobDictDO); + + String addJob(JobDictDO jobDictDO); + + String updateJob(JobDictDO jobDictDO); +} diff --git a/src/main/java/com/subsidy/service/JobMemberMappingService.java b/src/main/java/com/subsidy/service/JobMemberMappingService.java new file mode 100644 index 0000000..af8da78 --- /dev/null +++ b/src/main/java/com/subsidy/service/JobMemberMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.JobMemberMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 岗位人员表 服务类 + *

+ * + * @author DengMin + * @since 2022-02-10 + */ +public interface JobMemberMappingService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/MemberService.java b/src/main/java/com/subsidy/service/MemberService.java index d501328..df1526c 100644 --- a/src/main/java/com/subsidy/service/MemberService.java +++ b/src/main/java/com/subsidy/service/MemberService.java @@ -1,15 +1,15 @@ package com.subsidy.service; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; import com.subsidy.dto.administer.VerifyCodeDTO; -import com.subsidy.dto.member.AddMemberDTO; -import com.subsidy.dto.member.ContentMemberDTO; -import com.subsidy.dto.member.GetAllDTO; -import com.subsidy.dto.member.StudyHistoryDTO; +import com.subsidy.dto.member.*; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.model.FileDictDO; import com.subsidy.model.MemberDO; -import com.baomidou.mybatisplus.extension.service.IService; import com.subsidy.vo.administer.UserRoleVO; import com.subsidy.vo.member.*; +import com.subsidy.vo.paper.QueryPapersVO; import java.util.List; @@ -33,11 +33,21 @@ public interface MemberService extends IService { UserRoleVO login(VerifyCodeDTO verifyCodeDTO); - UserRoleVO passwordLogin(MemberDO memberDO); + MemberVO passwordLogin(PasswordLoginDTO passwordLoginDTO); + + UserRoleVO qingxuetangLogin(QingxuetangLoginDTO qingxuetangLoginDTO); + + UserRoleVO kunchiLogin(QingxuetangLoginDTO qingxuetangLoginDTO); + + CheckStatusVO checkStatus(MemberDO memberDO); String updatePassword(MemberDO memberDO); - MemberStudyPageVO studyPage(MemberDO memberDO); + String updateCheckImage(MemberDO memberDO); + + String removeCheckImage(MemberDO memberDO); + + List myCourses(MyCoursesDTO myCoursesDTO); ContentVodNewVO contentVod(ContentMemberDTO contentVodDTO); @@ -45,9 +55,17 @@ public interface MemberService extends IService { IPage studyHistory(StudyHistoryDTO studyHistoryDTO); - GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO); + List getCourseTest(ContentMemberDTO contentMemberDTO); + + List getPaperDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO); GetStudyInfoVO getStudyInfo(MemberDO memberDO); + String checkTimes(ExerciseDoneResultDO exerciseDoneResultDO); + + void importRedis(); + + String changeDepartments(ChangeDepartmentsDTO changeDepartmentsDTO); + QxyVO qxy(MemberDO memberDO); } diff --git a/src/main/java/com/subsidy/service/MemberStudyLengthService.java b/src/main/java/com/subsidy/service/MemberStudyLengthService.java new file mode 100644 index 0000000..17639a3 --- /dev/null +++ b/src/main/java/com/subsidy/service/MemberStudyLengthService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.MemberStudyLengthDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author DengMin + * @since 2022-01-28 + */ +public interface MemberStudyLengthService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/OprAdmDictService.java b/src/main/java/com/subsidy/service/OprAdmDictService.java new file mode 100644 index 0000000..80128d3 --- /dev/null +++ b/src/main/java/com/subsidy/service/OprAdmDictService.java @@ -0,0 +1,22 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.opr.GetHistoryDTO; +import com.subsidy.model.OprAdmDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.opr.GetHistoryVO; + +/** + *

+ * 审计表 服务类 + *

+ * + * @author DengMin + * @since 2021-12-13 + */ +public interface OprAdmDictService extends IService { + + //PageVO getHistory(GetHistoryDTO getHistoryDTO); + IPage getHistory(GetHistoryDTO getHistoryDTO); + +} diff --git a/src/main/java/com/subsidy/service/OprMemDictService.java b/src/main/java/com/subsidy/service/OprMemDictService.java new file mode 100644 index 0000000..7547fc8 --- /dev/null +++ b/src/main/java/com/subsidy/service/OprMemDictService.java @@ -0,0 +1,22 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.opr.GetHistoryDTO; +import com.subsidy.model.OprMemDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.mongodb.PageVO; +import com.subsidy.vo.opr.GetHistoryVO; + +/** + *

+ * 审计表 服务类 + *

+ * + * @author DengMin + * @since 2021-12-13 + */ +public interface OprMemDictService extends IService { + + //PageVO getHistory(GetHistoryDTO getHistoryDTO); + IPage getHistory(GetHistoryDTO getHistoryDTO); +} diff --git a/src/main/java/com/subsidy/service/PaperDictService.java b/src/main/java/com/subsidy/service/PaperDictService.java new file mode 100644 index 0000000..5a3ef27 --- /dev/null +++ b/src/main/java/com/subsidy/service/PaperDictService.java @@ -0,0 +1,26 @@ +package com.subsidy.service; + +import com.subsidy.model.PaperDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.paper.QueryPapersVO; + +import java.util.List; + +/** + *

+ * 试卷字典表 服务类 + *

+ * + * @author DengMin + * @since 2021-12-03 + */ +public interface PaperDictService extends IService { + + List queryPapers(PaperDictDO paperDictDO); + + String deletePaper(PaperDictDO paperDictDO); + + String updateStatus(PaperDictDO paperDictDO); + + String addPaper(PaperDictDO paperDictDO); +} diff --git a/src/main/java/com/subsidy/service/RankDictService.java b/src/main/java/com/subsidy/service/RankDictService.java new file mode 100644 index 0000000..af90805 --- /dev/null +++ b/src/main/java/com/subsidy/service/RankDictService.java @@ -0,0 +1,25 @@ +package com.subsidy.service; + +import com.subsidy.model.RankDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 职级字典表 服务类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +public interface RankDictService extends IService { + + String addRank(RankDictDO rankDictDO); + + String deleteRank(RankDictDO rankDictDO); + + String updateRank(RankDictDO rankDictDO); + + List queryRanks(RankDictDO rankDictDO); +} diff --git a/src/main/java/com/subsidy/service/RotationImgDictService.java b/src/main/java/com/subsidy/service/RotationImgDictService.java new file mode 100644 index 0000000..c582e60 --- /dev/null +++ b/src/main/java/com/subsidy/service/RotationImgDictService.java @@ -0,0 +1,25 @@ +package com.subsidy.service; + +import com.subsidy.model.RotationImgDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 轮播图 服务类 + *

+ * + * @author DengMin + * @since 2022-02-23 + */ +public interface RotationImgDictService extends IService { + + String addRotation(RotationImgDictDO rotationImgDictDO); + + String deleteRotation(RotationImgDictDO rotationImgDictDO); + + String updateRotation(RotationImgDictDO rotationImgDictDO); + + List getAllRotations(RotationImgDictDO rotationImgDictDO); +} diff --git a/src/main/java/com/subsidy/service/SignInRecordService.java b/src/main/java/com/subsidy/service/SignInRecordService.java index f285364..ab8071e 100644 --- a/src/main/java/com/subsidy/service/SignInRecordService.java +++ b/src/main/java/com/subsidy/service/SignInRecordService.java @@ -1,15 +1,12 @@ package com.subsidy.service; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; import com.subsidy.dto.member.GetMemberSignInfoDTO; -import com.subsidy.dto.sign.ClassSignInfoDTO; -import com.subsidy.dto.sign.SignInDTO; -import com.subsidy.model.MemberDO; +import com.subsidy.dto.sign.DataViewDTO; import com.subsidy.model.SignInRecordDO; -import com.baomidou.mybatisplus.extension.service.IService; import com.subsidy.vo.member.GetMemberSignInfoVO; import com.subsidy.vo.sign.SignInStatusVO; -import com.tencentcloudapi.common.Sign; /** *

@@ -25,7 +22,9 @@ public interface SignInRecordService extends IService { String signIn(SignInRecordDO signInRecordDO); - IPage classSignInfo(ClassSignInfoDTO classSignInfoDTO); + IPage dataView(DataViewDTO classSignInfoDTO); SignInStatusVO signInStatus(SignInRecordDO signInRecordDO); + + void test(); } diff --git a/src/main/java/com/subsidy/service/VodDictService.java b/src/main/java/com/subsidy/service/VodDictService.java index 1d5183a..82df320 100644 --- a/src/main/java/com/subsidy/service/VodDictService.java +++ b/src/main/java/com/subsidy/service/VodDictService.java @@ -1,14 +1,10 @@ package com.subsidy.service; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.subsidy.dto.content.GetContendVodsDTO; -import com.subsidy.model.VodDictDO; import com.baomidou.mybatisplus.extension.service.IService; -import com.subsidy.vo.vod.GetContendVodsVO; +import com.subsidy.dto.vod.ChangeOrdersDTO; +import com.subsidy.model.VodDictDO; import com.subsidy.vo.vod.SignatureVO; -import java.util.List; - /** *

* 视频表 服务类 @@ -21,11 +17,11 @@ public interface VodDictService extends IService { SignatureVO signature()throws Exception; - IPage getContendVods(GetContendVodsDTO getContendVodsDTO); + void deleteVod(VodDictDO vodDictDO); - String deleteVod(VodDictDO vodDictDO); + void addVod(VodDictDO vodDictDO); - String addVod(VodDictDO vodDictDO); + void updateVod(VodDictDO vodDictDO); - String updateVod(VodDictDO vodDictDO); + void changeOrders(ChangeOrdersDTO changeOrdersDTO); } diff --git a/src/main/java/com/subsidy/service/VodLableDictService.java b/src/main/java/com/subsidy/service/VodLableDictService.java new file mode 100644 index 0000000..b0fcb56 --- /dev/null +++ b/src/main/java/com/subsidy/service/VodLableDictService.java @@ -0,0 +1,19 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.label.VodLabelPageDTO; +import com.subsidy.model.VodLabelDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 视频库类目表 服务类 + *

+ * + * @author DengMin + * @since 2022-07-19 + */ +public interface VodLableDictService extends IService { + + IPage queryVodLabelPage(VodLabelPageDTO vodLabelPageDTO); +} diff --git a/src/main/java/com/subsidy/service/VodPlayHistoryService.java b/src/main/java/com/subsidy/service/VodPlayHistoryService.java index a355a19..230428c 100644 --- a/src/main/java/com/subsidy/service/VodPlayHistoryService.java +++ b/src/main/java/com/subsidy/service/VodPlayHistoryService.java @@ -1,7 +1,14 @@ package com.subsidy.service; +import com.subsidy.dto.vod.InsertHistoryNewDTO; +import com.subsidy.dto.vod.RemainSecondsDTO; +import com.subsidy.dto.vod.SignDatePlaysDTO; +import com.subsidy.dto.vod.FixDataTwoDTO; import com.subsidy.model.VodPlayHistoryDO; import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.vod.VodPlayStateVO; + +import java.util.List; /** *

@@ -15,5 +22,15 @@ public interface VodPlayHistoryService extends IService { String insertHistory(VodPlayHistoryDO vodPlayHistoryDO); - String insertHistoryNew(VodPlayHistoryDO vodPlayHistoryDO); + String insertHistoryNew(InsertHistoryNewDTO insertHistoryNewDTO); + + void dataFix(SignDatePlaysDTO dataFixDTO); + + void signDatePlays(SignDatePlaysDTO dataFixDTO); + + void remainSeconds(RemainSecondsDTO remainSecondsDTO); + + void playLengthFix(RemainSecondsDTO remainSecondsDTO); + + List testPlays(VodPlayHistoryDO vodPlayHistoryDO); } diff --git a/src/main/java/com/subsidy/service/impl/ClassMemberMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/AccessTokenServiceImpl.java similarity index 61% rename from src/main/java/com/subsidy/service/impl/ClassMemberMappingServiceImpl.java rename to src/main/java/com/subsidy/service/impl/AccessTokenServiceImpl.java index e0947c6..bdb62f9 100644 --- a/src/main/java/com/subsidy/service/impl/ClassMemberMappingServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AccessTokenServiceImpl.java @@ -1,20 +1,20 @@ package com.subsidy.service.impl; -import com.subsidy.model.ClassMemberMappingDO; -import com.subsidy.mapper.ClassMemberMappingMapper; -import com.subsidy.service.ClassMemberMappingService; +import com.subsidy.model.AccessTokenDO; +import com.subsidy.mapper.AccessTokenMapper; +import com.subsidy.service.AccessTokenService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** *

- * 班级成员映射表 服务实现类 + * 服务实现类 *

* * @author DengMin - * @since 2021-10-12 + * @since 2022-02-18 */ @Service -public class ClassMemberMappingServiceImpl extends ServiceImpl implements ClassMemberMappingService { +public class AccessTokenServiceImpl extends ServiceImpl implements AccessTokenService { } diff --git a/src/main/java/com/subsidy/service/impl/ActivityDetectionServiceImpl.java b/src/main/java/com/subsidy/service/impl/ActivityDetectionServiceImpl.java new file mode 100644 index 0000000..48cd2d9 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/ActivityDetectionServiceImpl.java @@ -0,0 +1,105 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.common.configure.ActivityDetectionConfig; +import com.subsidy.common.configure.VODConfig; +import com.subsidy.common.configure.WechatConfig; +import com.subsidy.dto.detection.VerifyDTO; +import com.subsidy.model.ActivityDetectionDO; +import com.subsidy.mapper.ActivityDetectionMapper; +import com.subsidy.service.ActivityDetectionService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.tencentcloudapi.captcha.v20190722.CaptchaClient; +import com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultRequest; +import com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultResponse; +import com.tencentcloudapi.common.Credential; +import com.tencentcloudapi.common.exception.TencentCloudSDKException; +import com.tencentcloudapi.common.profile.ClientProfile; +import com.tencentcloudapi.common.profile.HttpProfile; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; + +/** + *

+ * 活跃度检测表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-07-13 + */ +@Service +public class ActivityDetectionServiceImpl extends ServiceImpl implements ActivityDetectionService { + + @Autowired + private ActivityDetectionConfig activityDetectionConfig; + + @Autowired + private VODConfig vodConfig; + + public String verify(VerifyDTO verifyDTO, HttpServletRequest request){ + + try{ + // 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey,此处还需注意密钥对的保密 + // 密钥可前往https://console.cloud.tencent.com/cam/capi网站进行获取 + Credential cred = new Credential(vodConfig.getSecretId(),vodConfig.getSecretKey()); + // 实例化一个http选项,可选的,没有特殊需求可以跳过 + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("captcha.tencentcloudapi.com"); + // 实例化一个client选项,可选的,没有特殊需求可以跳过 + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + // 实例化要请求产品的client对象,clientProfile是可选的 + CaptchaClient client = new CaptchaClient(cred, "", clientProfile); + // 实例化一个请求对象,每个接口都会对应一个request对象 + DescribeCaptchaResultRequest req = new DescribeCaptchaResultRequest(); + req.setCaptchaType(9L); + req.setTicket(verifyDTO.getTicket()); +// String ip = request.getHeader("x-forwarded-for"); + String ip = request.getHeader( " x-forwarded-for " ); + if (ip == null || ip.length() == 0 || " unknown " .equalsIgnoreCase(ip)) { + ip = request.getHeader( " Proxy-Client-IP " ); + } + if (ip == null || ip.length() == 0 || " unknown " .equalsIgnoreCase(ip)) { + ip = request.getHeader( " WL-Proxy-Client-IP " ); + } + if (ip == null || ip.length() == 0 || " unknown " .equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + req.setUserIp(ip); + req.setRandstr(verifyDTO.getRandStr()); + req.setCaptchaAppId(activityDetectionConfig.getCaptchaAppId()); + req.setAppSecretKey(activityDetectionConfig.getAppSecretKey()); + req.setBusinessId(activityDetectionConfig.getBusinessId()); + // 返回的resp是一个DescribeCaptchaResultResponse的实例,与请求对象对应 + DescribeCaptchaResultResponse resp = client.DescribeCaptchaResult(req); + // 输出json格式的字符串回包 + System.out.println(DescribeCaptchaResultResponse.toJsonString(resp)); + ActivityDetectionDO activityDetectionDO = new ActivityDetectionDO(); + activityDetectionDO.setClassId(verifyDTO.getClassId()); + activityDetectionDO.setMemberId(verifyDTO.getMemberId()); + activityDetectionDO.setRequestId(resp.getRequestId()); + if (resp.getCaptchaCode()==1){ + activityDetectionDO.setStatus(1); + this.baseMapper.insert(activityDetectionDO); + return ConstantUtils.SUCCESS_VERIFY; + }else { + activityDetectionDO.setStatus(0); + this.baseMapper.insert(activityDetectionDO); + return ConstantUtils.FAIL_VERIFY; + } + } catch (TencentCloudSDKException e) { + System.out.println(e.toString()); + } + return null; + } + + public IPage getCheckHistory(ActivityDetectionDO activityDetectionDO){ + + + return null; + } + +} diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index 05321c8..7a16a08 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -3,35 +3,87 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.administer.ClassDailyInfoDTO; import com.subsidy.dto.administer.ClassDetailDTO; +import com.subsidy.dto.administer.ClassVodDailyInfoDTO; +import com.subsidy.dto.administer.ClassVodInfoDTO; +import com.subsidy.dto.administer.ManageMemberDTO; +import com.subsidy.dto.administer.MemberStudyLogDTO; import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.dto.member.ImportMemberDTO; -import com.subsidy.mapper.*; -import com.subsidy.model.*; +import com.subsidy.mapper.AdministerMapper; +import com.subsidy.mapper.AnsweringQuestionMapper; +import com.subsidy.mapper.ClassDictMapper; +import com.subsidy.mapper.ClassMemberMappingMapper; +import com.subsidy.mapper.CompanyDictMapper; +import com.subsidy.mapper.CourseDictMapper; +import com.subsidy.mapper.DepartmentDictMapper; +import com.subsidy.mapper.ExerciseDoneResultMapper; +import com.subsidy.mapper.FieldDictMapper; +import com.subsidy.mapper.MemberDepartmentMappingMapper; +import com.subsidy.mapper.MemberMapper; +import com.subsidy.mapper.OprAdmDictMapper; +import com.subsidy.mapper.PaperDictMapper; +import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.mapper.SignInRecordMapper; +import com.subsidy.mapper.VodDictMapper; +import com.subsidy.mapper.VodPlayHistoryMapper; +import com.subsidy.model.AdministerDO; +import com.subsidy.model.AnsweringQuestionDO; +import com.subsidy.model.ClassDictDO; +import com.subsidy.model.ClassMemberMappingDO; +import com.subsidy.model.CompanyDictDO; +import com.subsidy.model.CourseDictDO; +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.ExerciseDoneHistoryDO; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.model.MemberDO; +import com.subsidy.model.MemberDepartmentMappingDO; +import com.subsidy.model.OprAdmDictDO; +import com.subsidy.model.PaperDictDO; +import com.subsidy.model.RoleAdministerMappingDO; +import com.subsidy.model.RoleDictDO; +import com.subsidy.model.SignInRecordDO; +import com.subsidy.model.VodDictDO; import com.subsidy.service.AdministerService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.subsidy.util.*; -import com.subsidy.util.excel.ExcelColumn; +import com.subsidy.util.ConstantUtils; +import com.subsidy.util.ExcelFormatUtils; +import com.subsidy.util.JwtUtil; +import com.subsidy.util.Localstorage; +import com.subsidy.util.MathUtil; import com.subsidy.util.excel.ExcelUtil; import com.subsidy.vo.administer.*; import com.subsidy.vo.classdict.ClassDetailVO; +import com.subsidy.vo.done.GetMaxScoreVO; +import com.subsidy.vo.done.TestScoreInfoVO; import com.subsidy.vo.member.ClassSignVO; import com.subsidy.vo.sign.AnswerRecordVO; +import com.subsidy.vo.vod.ClassMemberPlayLengthVO; +import com.subsidy.vo.vod.ClassVodCompleteInfoVO; +import com.subsidy.vo.vod.DayInfoItemVO; +import com.subsidy.vo.vod.GetMemberStudyInfoVO; import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; -import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; import org.apache.poi.hssf.util.CellRangeAddress; +import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.streaming.SXSSFCell; import org.apache.poi.xssf.streaming.SXSSFRow; import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -42,11 +94,24 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.lang.reflect.Member; +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; import java.math.BigDecimal; +import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import java.util.*; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.concurrent.atomic.AtomicInteger; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; @@ -81,9 +146,6 @@ public class AdministerServiceImpl extends ServiceImpl() .lambda() .eq(AdministerDO::getAccountName, administerDO.getAccountName())); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_ADMINISTER_PREFIX + administerDO.getAccountName(), administerDO1); + //} + + if (null == administerDO1) { + throw new HttpException(10012); + } + + if ("0".equals(administerDO1.getStatus())) { + throw new HttpException(10013); + } + /** + * 最近5次都输入失败,5分钟后再验证 + */ + List oprAdmDictDOS = oprAdmDictMapper.getLoginInfo(administerDO1.getId()); + + //查mysql逻辑 + //List oprAdmDictDOS = oprAdmDictMapper.getLoginInfo(administerDO1.getId()); + + boolean flag = false; + for (int i = 0; i < oprAdmDictDOS.size(); i++) { + if (oprAdmDictDOS.get(i).getResult() == 1) { + flag = true; + break; + } + } + + if (!flag && oprAdmDictDOS.size() >= 4) { + throw new HttpException(10016); + } if (null != administerDO1) { if (administerDO.getPassword().equals(administerDO1.getPassword())) { String token = JwtUtil.generateToken(administerDO1.getId(), ConstantUtils.ADMINISTER_TERMINATE); + //登录成功,记录日志 + OprAdmDictDO oprAdmDictDO = new OprAdmDictDO(); + oprAdmDictDO.setUserId(administerDO1.getId()); + oprAdmDictDO.setOprType("登录"); + oprAdmDictDO.setResult(1); + //oprAdmDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprAdmDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprAdmDictDO.setUserName(administerDO1.getUserName()); + //oprAdmDictDO.setCompanyId(administerDO1.getCompanyId()); + oprAdmDictMapper.insert(oprAdmDictDO); + //mongoTemplate.insert(oprAdmDictDO); loginVO.setToken(token); return loginVO; } else { - throw new HttpException(10004); + //登录失败,记录日志 + OprAdmDictDO oprAdmDictDO = new OprAdmDictDO(); + oprAdmDictDO.setUserId(administerDO1.getId()); + oprAdmDictDO.setOprType("登录"); + oprAdmDictDO.setResult(0); + oprAdmDictMapper.insert(oprAdmDictDO); + //oprAdmDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprAdmDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprAdmDictDO.setUserName(administerDO1.getUserName()); + //oprAdmDictDO.setCompanyId(administerDO1.getCompanyId()); + //mongoTemplate.insert(oprAdmDictDO); + + int i = 0; + + for (OprAdmDictDO oad : oprAdmDictDOS) { + if (oad.getResult() == 1) { + break; + } + i++; + } + + if (i == 0) { + throw new HttpException(10024); + } else if (i == 1) { + throw new HttpException(10023); + } else if (i == 2) { + throw new HttpException(10022); + } else if (i == 3) { + throw new HttpException(10021); + } else { + throw new HttpException(10016); + } + } } else { throw new HttpException(10011); @@ -147,23 +310,25 @@ public class AdministerServiceImpl extends ServiceImpl() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId, administerDO.getId())); + administerPermissionVO.setRole(roleAdministerMappingDO.getRoleId()); return administerPermissionVO; } public IPage operators(OperatorsDTO operatorsDTO) { Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); - //判断该用户的角色 - Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper() - .lambda() - .eq(RoleAdministerMappingDO::getAdministerId, operatorsDTO.getId()) - .eq(RoleAdministerMappingDO::getRoleId, 1)); + IPage operatorsVOIPage = companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(), null, 1, null); - if (count > 0) { - operatorsDTO.setId(null); + List operatorsVOS = operatorsVOIPage.getRecords(); + for (OperatorsVO operatorsVO : operatorsVOS) { + operatorsVO.setField(fieldDictMapper.queryCompanyFields(operatorsVO.getCompanyId())); } - return companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getId(), operatorsDTO.getUserName(), 0); + return operatorsVOIPage; } public String addAdminister(AdministerDO administerDO) { @@ -176,7 +341,7 @@ public class AdministerServiceImpl extends ServiceImpl() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId, administerDO.getId())); return ConstantUtils.DELETE_SUCCESS; } @@ -205,98 +374,84 @@ public class AdministerServiceImpl extends ServiceImpl classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() .lambda() .eq(ClassMemberMappingDO::getClassId, classDetailDTO.getId())); classSummaryVO.setMemberCount(classMemberMappingDOS.size()); - //课程总数 + //课程由多少个视频 List vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId()); - classSummaryVO.setTotalVodCounts(vodDictDOS.size()); + int signCnt = 0; + int testCnt = 0; + int vodCnt = 0; - int totalStudyVods = 0; - int totalStudyLength = 0; - //学生总共学习课时数 - for (VodDictDO vodDictDO : vodDictDOS) { - for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { - List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() - .lambda() - .eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getMemberId()) - .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) - .orderByDesc(VodPlayHistoryDO::getPlayRecord)); + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { - for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { - totalStudyLength += vodPlayHistoryDO.getPlayLength(); - } + //签到 + Integer signCount = signInRecordMapper.selectCount(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, classMemberMappingDO.getMemberId()) + .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + if (signCount > 0) { + signCnt++; + } - if (vodPlayHistoryDOS.size() > 0) { - if (vodPlayHistoryDOS.get(0).getPlayRecord() >= vodDictDO.getVodLength() * 0.8) { - totalStudyVods++; - } + //测试 + int testCount = exerciseDoneResultMapper.selectCount(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getMemberId, classMemberMappingDO.getMemberId()) + .eq(ExerciseDoneResultDO::getClassId, classDetailDTO.getId())); + if (testCount > 0) { + testCnt++; + } + + //视频 + int i = 0; + for (VodDictDO vodDictDO : vodDictDOS) { + int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(), classMemberMappingDO.getMemberId(), vodDictDO.getId()); + if (totalPlayLength >= vodDictDO.getVodLength()) { + i++; } } + if (i == vodDictDOS.size()) { + vodCnt++; + } } - classSummaryVO.setStudyVodCounts(MathUtil.intDivCeil(totalStudyVods, classMemberMappingDOS.size())); - //平均完成时长 学生观看课程视频的全部时长/总人数 - int avg = MathUtil.intDivCeil(totalStudyLength, classMemberMappingDOS.size()); - classSummaryVO.setAvgVodPlayLength(avg); + //签到人数 这个人签到了就算签过了 + classSummaryVO.setSignCnt(signCnt); //测试通过率 - List exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper() - .lambda() - .eq(ExerciseDoneResultDO::getClassId, classDetailDTO.getId())); - - int passNum = 0; - - for (ExerciseDoneResultDO exerciseDoneResultDO : exerciseDoneResultDOS) { - if (exerciseDoneResultDO.getRightCounts() > exerciseDoneResultDO.getTotalCounts() * 0.6) { - passNum++; - } - } - classSummaryVO.setPassRate(MathUtil.intDivFloorPercent(passNum, classMemberMappingDOS.size())); + classSummaryVO.setPassCnt(testCnt); - - //平均签到数 向上取整 - //签到总次数 - Integer signCount = signInRecordMapper.selectCount(new QueryWrapper() - .lambda() - .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); - classSummaryVO.setAvgSignCount(MathUtil.intDivCeil(signCount, classMemberMappingDOS.size())); + //视频看完人数 + classSummaryVO.setVodCnt(vodCnt); //答疑数 Integer count = answeringQuestionMapper.selectCount(new QueryWrapper() .lambda() .eq(AnsweringQuestionDO::getClassId, classDetailDTO.getId())); - classSummaryVO.setAnswerCount(count); - + classSummaryVO.setAnswerCnt(count); return classSummaryVO; } + public IPage classDetail(ClassDetailDTO classDetailDTO) { Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); - IPage classDetailVOIPage = this.baseMapper.classMembers(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); List classDetailVOS = classDetailVOIPage.getRecords(); @@ -307,77 +462,68 @@ public class AdministerServiceImpl extends ServiceImpl vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() - .lambda() - .eq(VodPlayHistoryDO::getMemberId, classDetailVO.getId()) - .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) - .orderByDesc(VodPlayHistoryDO::getPlayRecord)); - - - if (vodPlayHistoryDOS.size() > 0) { - if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) { - i++; - } - } - - for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { - playLength += vodPlayHistoryDO.getPlayLength(); + int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(), classDetailVO.getId(), vodDictDO.getId()); + if (totalPlayLength >= vodDictDO.getVodLength()) { + i++; } - + playLength += totalPlayLength; } - classDetailVO.setStudyVodCounts(i); + //培训时长 + classDetailVO.setTrainingLength(playLength); - //学生测试完成情况 - ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper() - .lambda() - .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) - .eq(ExerciseDoneResultDO::getMemberId, classDetailVO.getId())); + //学生测试完成情况 多套卷子各返回最高成绩 + List getMaxScoreVOS = exerciseDoneResultMapper.getMaxScore(classDictDO.getId(), classDetailVO.getId()); + classDetailVO.setGetMaxScoreVOS(getMaxScoreVOS); - if (null != exerciseDoneResultDO) { - classDetailVO.setRightCounts(exerciseDoneResultDO.getRightCounts()); - classDetailVO.setTotalExeCounts(exerciseDoneResultDO.getTotalCounts()); - classDetailVO.setScore(MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts())); + Boolean flag = true; - if (classDetailVO.getScore() >= 60) { - classDetailVO.setResult("合格"); - } else { - classDetailVO.setResult("不合格"); + if (getMaxScoreVOS.size() > 0) { + for (GetMaxScoreVO getMaxScoreVO : getMaxScoreVOS) { + if (getMaxScoreVO.getScore() < 60) { + flag = false; + } } - + } else { + flag = false; } + //总评价 + classDetailVO.setResult(flag && i == vodDictDOS.size() ? "合格" : "不合格"); + + //课程进度 classDetailVO.setClassProcess(i + "/" + vodDictDOS.size()); + //答疑 Integer count = answeringQuestionMapper.selectCount(new QueryWrapper() .lambda() .eq(AnsweringQuestionDO::getAskId, classDetailVO.getId()) .eq(AnsweringQuestionDO::getClassId, classDetailDTO.getId())); classDetailVO.setAskCounts(count); - //签到次数 - Integer signCount = signInRecordMapper.selectCount(new QueryWrapper() + //long set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classDetailVO.getId() + ":classId:" + classDetailDTO.getId() + "*").stream().count(); + Integer set = signInRecordMapper.selectCount(new QueryWrapper() .lambda() - .eq(SignInRecordDO::getMemberId, classDetailVO.getId()) - .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); - classDetailVO.setSignCounts(signCount); + .eq(SignInRecordDO::getClassId, classDetailDTO.getId()) + .eq(SignInRecordDO::getMemberId, classDetailVO.getId())); + + classDetailVO.setSignCounts(set); - //培训时长 - classDetailVO.setTrainingLength(playLength); } classDetailVOIPage.setRecords(classDetailVOS); return classDetailVOIPage; } public List exportClassDetail(ClassDetailDTO classDetailDTO) throws Exception { - Page pager = new Page(1, 10000000); + Page pager = new Page(1, -1L); IPage classDetailVOIPage = this.baseMapper.classMembers(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); List classDetailVOS = classDetailVOIPage.getRecords(); @@ -390,45 +536,53 @@ public class AdministerServiceImpl extends ServiceImpl vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() - .lambda() - .eq(VodPlayHistoryDO::getMemberId, classDetailVO.getId()) - .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) - .orderByDesc(VodPlayHistoryDO::getPlayRecord)); - - if (vodPlayHistoryDOS.size() > 0) { - if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) { - i++; - } + int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(), classDetailVO.getId(), vodDictDO.getId()); + if (totalPlayLength >= vodDictDO.getVodLength()) { + i++; } + playLength += totalPlayLength; + } + //课程进度 + classDetailVO.setClassProcess(i + "/" + vodDictDOS.size()); + + //学生测试完成情况 多套卷子各返回最高成绩 + List getMaxScoreVOS = exerciseDoneResultMapper.getMaxScore(classDictDO.getId(), classDetailVO.getId()); + classDetailVO.setGetMaxScoreVOS(getMaxScoreVOS); + Boolean flag = true; - for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { - playLength += vodPlayHistoryDO.getPlayLength(); + StringBuilder stringBuilder = new StringBuilder(); + + if (getMaxScoreVOS.size() > 0) { + for (GetMaxScoreVO getMaxScoreVO : getMaxScoreVOS) { + stringBuilder.append(getMaxScoreVO.getPaperName() + ":" + getMaxScoreVO.getScore()); + if (getMaxScoreVO.getScore() < 60) { + flag = false; + } + stringBuilder.append(" "); } - } - //classDetailVO.setStudyVodCounts(i); - classDetailVO.setClassProcess(i + "/" + vodDictDOS.size()); - //学生测试完成情况 - ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper() - .lambda() - .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) - .eq(ExerciseDoneResultDO::getMemberId, classDetailVO.getId())); - if (null != exerciseDoneResultDO) { - classDetailVO.setScore(MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts())); } else { - classDetailVO.setScore(0); + flag = false; } + //总评价 + classDetailVO.setResult(flag && i == vodDictDOS.size() ? "合格" : "不合格"); + + classDetailVO.setScore(stringBuilder.toString()); + + //培训时长 小时 + classDetailVO.setTrainingLengthStr(MathUtil.secToTime(playLength)); + + //培训时长 分钟 + classDetailVO.setTrainingLengthMinute(Math.floorDiv(playLength, 60) + ""); + //答疑 Integer count = answeringQuestionMapper.selectCount(new QueryWrapper() .lambda() @@ -437,15 +591,14 @@ public class AdministerServiceImpl extends ServiceImpl() + //long set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classDetailVO.getId() + ":classId:" + classDetailDTO.getId() + "*").stream().count(); + Integer set = signInRecordMapper.selectCount(new QueryWrapper() .lambda() - .eq(SignInRecordDO::getMemberId, classDetailVO.getId()) - .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); - classDetailVO.setSignCounts(signCount); + .eq(SignInRecordDO::getClassId, classDetailDTO.getId()) + .eq(SignInRecordDO::getMemberId, classDetailVO.getId())); + + classDetailVO.setSignCounts(set); - //培训时长 - classDetailVO.setTrainingLength(playLength); - classDetailVO.setTrainingLengthStr(MathUtil.secToTime(playLength)); } if (classDetailDTO.getFlag()) { @@ -456,7 +609,6 @@ public class AdministerServiceImpl extends ServiceImpl signDetail(ClassDetailDTO classDetailDTO) { Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); @@ -469,46 +621,42 @@ public class AdministerServiceImpl extends ServiceImpl vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() - .lambda() - .eq(VodPlayHistoryDO::getMemberId, classSignVO.getId()) - .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) - .orderByDesc(VodPlayHistoryDO::getPlayRecord)); - - if (vodPlayHistoryDOS.size() > 0) { - if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) { - i++; - } - } - for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { - playLength += vodPlayHistoryDO.getPlayLength(); + int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(), classSignVO.getId(), vodDictDO.getId()); + if (totalPlayLength >= vodDictDO.getVodLength()) { + i++; } + playLength += totalPlayLength; } - classSignVO.setStudyVodCounts(i); + //课程进度 classSignVO.setClassProcess(i + "/" + vodDictDOS.size()); //完成率 String percent = MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(i), new BigDecimal(vodDictDOS.size())); classSignVO.setPercent(percent); + //培训时长 + classSignVO.setTrainingLength(playLength); + classSignVO.setTrainingLengthStr(MathUtil.secToTime(playLength)); + //签到 + //Set set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*"); List signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() .lambda() + .eq(SignInRecordDO::getClassId, classDetailDTO.getId()) .eq(SignInRecordDO::getMemberId, classSignVO.getId()) - .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + .orderByAsc(SignInRecordDO::getSignInDate)); classSignVO.setSignCounts(signInRecordDOS.size()); StringBuilder stringBuilder = new StringBuilder(); //签到时间 for (SignInRecordDO signInRecordDO : signInRecordDOS) { + //String[] array = signInRecordDO.split(":"); + //时间戳转时间 stringBuilder.append(signInRecordDO.getSignInDate().toString().replace("T", " ")).append(";"); } if (StringUtils.isNotBlank(stringBuilder.toString())) { @@ -516,15 +664,13 @@ public class AdministerServiceImpl extends ServiceImpl exportSignDetail(ClassDetailDTO classDetailDTO) throws Exception { - Page pager = new Page(1, 1000000); + Page pager = new Page(1, -1L); IPage classSignVOIPage = this.baseMapper.classSign(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); List classSignVOS = classSignVOIPage.getRecords(); @@ -534,56 +680,52 @@ public class AdministerServiceImpl extends ServiceImpl vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() - .lambda() - .eq(VodPlayHistoryDO::getMemberId, classSignVO.getId()) - .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) - .orderByDesc(VodPlayHistoryDO::getPlayRecord)); - - if (vodPlayHistoryDOS.size() > 0) { - if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) { - i++; - } - } - for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { - playLength += vodPlayHistoryDO.getPlayLength(); + int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(), classSignVO.getId(), vodDictDO.getId()); + if (totalPlayLength >= vodDictDO.getVodLength()) { + i++; } + playLength += totalPlayLength; } - //classSignVO.setStudyVodCounts(i); classSignVO.setClassProcess(i + "/" + vodDictDOS.size()); //完成率 String percent = MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(i), new BigDecimal(vodDictDOS.size())); classSignVO.setPercent(percent); + //培训时长 小时 + classSignVO.setTrainingLengthStr(MathUtil.secToTime(playLength)); + + //培训时长 分钟 + classSignVO.setTrainingLengthMinute(Math.floorDiv(playLength, 60) + ""); + //签到 + //Set set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*"); List signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() .lambda() + .eq(SignInRecordDO::getClassId, classDetailDTO.getId()) .eq(SignInRecordDO::getMemberId, classSignVO.getId()) - .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + .orderByAsc(SignInRecordDO::getSignInDate)); classSignVO.setSignCounts(signInRecordDOS.size()); + //sortSet.addAll(set); + StringBuilder stringBuilder = new StringBuilder(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //签到时间 for (SignInRecordDO signInRecordDO : signInRecordDOS) { + //String[] array = signInRecordDO.split(":"); + //时间戳转时间 stringBuilder.append(signInRecordDO.getSignInDate().toString().replace("T", " ")).append(";"); } if (StringUtils.isNotBlank(stringBuilder.toString())) { String signInDate = stringBuilder.toString().substring(0, stringBuilder.length() - 1); classSignVO.setSignInDateList(signInDate); } - - //培训时长 - classSignVO.setTrainingLength(playLength); - classSignVO.setTrainingLengthStr(MathUtil.secToTime(playLength)); } if (classDetailDTO.getFlag()) { @@ -597,49 +739,35 @@ public class AdministerServiceImpl extends ServiceImpl exerciseTest(ClassDetailDTO classDetailDTO) { Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); IPage exerciseTestVOIPage = this.baseMapper.exerciseTest(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); List classSignVOS = exerciseTestVOIPage.getRecords(); - //课程详情 - ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); - for (ExerciseTestVO exerciseTestVO : classSignVOS) { - - //学生测试完成情况 - ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper() - .lambda() - .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) - .eq(ExerciseDoneResultDO::getMemberId, exerciseTestVO.getId())); - - if (null != exerciseDoneResultDO) { - int rights = exerciseDoneResultDO.getRightCounts(); - int total = exerciseDoneResultDO.getTotalCounts(); - int score = MathUtil.intDivFloorPercent(rights, total); - exerciseTestVO.setScore(score); - if (score >= 60) { - exerciseTestVO.setResult("合格"); - } else { - exerciseTestVO.setResult("不合格"); - } - exerciseTestVO.setCount(1); - + //学生测试完成情况---以最后一次成绩为准 + TestScoreInfoVO testScoreInfoVO = exerciseDoneResultMapper.testScoreInfo(classDetailDTO.getPaperId(), exerciseTestVO.getId(), classDetailDTO.getId()); + exerciseTestVO.setPaperId(exerciseTestVO.getPaperId()); + if (null != testScoreInfoVO) { + exerciseTestVO.setScore(testScoreInfoVO.getScore()); + exerciseTestVO.setResult(testScoreInfoVO.getResult()); + //测评次数 + exerciseTestVO.setCount(testScoreInfoVO.getCnt()); } else { exerciseTestVO.setScore(0); exerciseTestVO.setResult("不合格"); exerciseTestVO.setCount(0); } } + exerciseTestVOIPage.setRecords(classSignVOS); return exerciseTestVOIPage; } public List exportExerciseTest(ClassDetailDTO classDetailDTO) throws Exception { - Page pager = new Page(0, 1000000); + Page pager = new Page(0, -1L); IPage exerciseTestVOIPage = this.baseMapper.exerciseTest(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); List exerciseTestVOS = exerciseTestVOIPage.getRecords(); @@ -648,26 +776,19 @@ public class AdministerServiceImpl extends ServiceImpl() - .lambda() - .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) - .eq(ExerciseDoneResultDO::getMemberId, exerciseTestVO.getId())); - - if (null != exerciseDoneResultDO) { - int rights = exerciseDoneResultDO.getRightCounts(); - int total = exerciseDoneResultDO.getTotalCounts(); - int score = MathUtil.intDivFloorPercent(rights, total); - exerciseTestVO.setScore(score); - if (score >= 60) { - exerciseTestVO.setResult("合格"); - } else { - exerciseTestVO.setResult("不合格"); - } + //查看课程卷子 + TestScoreInfoVO testScoreInfoVO = exerciseDoneResultMapper.testScoreInfo(classDetailDTO.getPaperId(), exerciseTestVO.getId(), classDetailDTO.getId()); + exerciseTestVO.setPaperId(exerciseTestVO.getPaperId()); + if (null != testScoreInfoVO) { + exerciseTestVO.setScore(testScoreInfoVO.getScore()); + exerciseTestVO.setResult(testScoreInfoVO.getResult()); + //测评次数 + exerciseTestVO.setCount(testScoreInfoVO.getCnt()); } else { exerciseTestVO.setScore(0); exerciseTestVO.setResult("不合格"); + exerciseTestVO.setCount(0); } } @@ -677,17 +798,24 @@ public class AdministerServiceImpl extends ServiceImpl getMemberPapers(ExerciseDoneResultDO exerciseDoneResultDO) { + return exerciseDoneResultMapper.queryExerciseDoneResult(exerciseDoneResultDO.getMemberId(), null, exerciseDoneResultDO.getPaperId()); + } + + public List getPaperDetail(ExerciseDoneHistoryDO exerciseDoneHistoryDO) { + return exerciseDoneResultMapper.getPaperDetail(exerciseDoneHistoryDO.getMemberId(), exerciseDoneHistoryDO.getDoneId()); + } + public IPage answerRecord(ClassDetailDTO classDetailDTO) { Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); return this.baseMapper.answerRecord(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); } public List exportAnswerRecord(ClassDetailDTO classDetailDTO) throws Exception { - Page pager = new Page(1, 1000000); + Page pager = new Page(1, -1L); IPage iPage = this.baseMapper.answerRecord(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); List answerRecordVOS = iPage.getRecords(); @@ -701,6 +829,392 @@ public class AdministerServiceImpl extends ServiceImpl classVodInfo(ClassVodInfoDTO classVodInfoDTO) { + + List result = new ArrayList<>(); + //获取班级成员 + List memberIds = classMemberMappingMapper.getClassMembers(classVodInfoDTO.getClassId()); + + //获取课程下的视频 + List vodDictDOS = vodDictMapper.getCourseVods(classVodInfoDTO.getCourseId(), classVodInfoDTO.getVodName()); + for (VodDictDO vodDictDO : vodDictDOS) { + //获取这个视频的学习人数和平均学习时长 + ClassVodCompleteInfoVO classVodCompleteInfoVO = vodDictMapper.classVodCompleteInfo(classVodInfoDTO.getClassId(), vodDictDO.getId(), memberIds, classVodInfoDTO.getVodName()); + ClassVodInfoVO classVodInfoVO = new ClassVodInfoVO(); + classVodInfoVO.setVodName(vodDictDO.getVodName()); + classVodInfoVO.setStudyCnt(classVodCompleteInfoVO.getCnt()); + classVodInfoVO.setStudyLength(classVodCompleteInfoVO.getStudyLength()); + result.add(classVodInfoVO); + } + return result; + } + + public IPage classDailyInfo(ClassDailyInfoDTO classDailyInfoDTO) { + + Page pager = new Page(classDailyInfoDTO.getPageNum(), classDailyInfoDTO.getPageSize()); + + //获取班级成员 + IPage classDailyInfoVOIPage = classMemberMappingMapper.getClassMembersWithName(pager, classDailyInfoDTO.getClassId(), classDailyInfoDTO.getUserName()); + //整理出这些学员id + List classDailyInfoVOS = classDailyInfoVOIPage.getRecords(); + List memberIds = new ArrayList<>(); + for (ClassDailyInfoVO classDailyInfoVO : classDailyInfoVOS) { + memberIds.add(classDailyInfoVO.getId()); + } + + //这些成员完成情况 + List getMemberStudyInfoVOS = vodPlayHistoryMapper.getMemberStudyInfo(classDailyInfoDTO.getClassId(), memberIds, classDailyInfoDTO.getStartDate(), classDailyInfoDTO.getEndDate()); + + for (ClassDailyInfoVO classDailyInfoVO : classDailyInfoVOS) { + List dayInfoItemVOS = new ArrayList<>(); + int total = 0; + for (GetMemberStudyInfoVO getMemberStudyInfoVO : getMemberStudyInfoVOS) { + if (classDailyInfoVO.getId().equals(getMemberStudyInfoVO.getMemberId())) { + DayInfoItemVO dayInfoItemVO = new DayInfoItemVO(); + dayInfoItemVO.setStudyDate(getMemberStudyInfoVO.getStudyDate()); + dayInfoItemVO.setTotalLength(getMemberStudyInfoVO.getPlayLength()); + total += getMemberStudyInfoVO.getPlayLength(); + dayInfoItemVOS.add(dayInfoItemVO); + } + } + classDailyInfoVO.setTotal(total); + classDailyInfoVO.setDayInfoItemVOS(dayInfoItemVOS); + } + return classDailyInfoVOIPage; + } + + public void exportClassDailyInfo(ClassDailyInfoDTO classDailyInfoDTO) { + Page pager = new Page(1, -1L); + + // 表头 + List title = new ArrayList<>(); + title.add("序号"); + title.add("姓名"); + title.addAll(findDaysStr(classDailyInfoDTO.getStartDate(), classDailyInfoDTO.getEndDate())); + title.add("合计时长(小时)"); + title.add("合计时长(分钟)"); + + //获取班级成员 + IPage classDailyInfoVOIPage = classMemberMappingMapper.getClassMembersWithName(pager, classDailyInfoDTO.getClassId(), classDailyInfoDTO.getUserName()); + //整理出这些学员id + List classDailyInfoVOS = classDailyInfoVOIPage.getRecords(); + List memberIds = new ArrayList<>(); + for (ClassDailyInfoVO classDailyInfoVO : classDailyInfoVOS) { + memberIds.add(classDailyInfoVO.getId()); + } + + //这些成员完成情况 + List getMemberStudyInfoVOS = vodPlayHistoryMapper.getMemberStudyInfo(classDailyInfoDTO.getClassId(), memberIds, classDailyInfoDTO.getStartDate(), classDailyInfoDTO.getEndDate()); + + HashMap> hashMap = new HashMap(); + + for (GetMemberStudyInfoVO getMemberStudyInfoVO : getMemberStudyInfoVOS) { + + if (!hashMap.containsKey(getMemberStudyInfoVO.getMemberId())) { + HashMap hashMap1 = new HashMap<>(); + hashMap1.put(getMemberStudyInfoVO.getStudyDate(), getMemberStudyInfoVO.getPlayLength()); + hashMap.put(getMemberStudyInfoVO.getMemberId(), hashMap1); + } else { + HashMap hashMap1 = hashMap.get(getMemberStudyInfoVO.getMemberId()); + hashMap1.put(getMemberStudyInfoVO.getStudyDate(), getMemberStudyInfoVO.getPlayLength()); + hashMap.put(getMemberStudyInfoVO.getMemberId(), hashMap1); + } + } + + writeExcel(memberIds, hashMap, title); + + } + + public IPage classVodDailyInfo(ClassVodDailyInfoDTO classVodDailyInfoDTO) { + + //查看班级里有多少人 + Page pager = new Page(classVodDailyInfoDTO.getPageNum(), classVodDailyInfoDTO.getPageSize()); + + //获取班级成员 + IPage classDailyInfoVOIPage = classMemberMappingMapper.getClassMembersWithName(pager, classVodDailyInfoDTO.getClassId(), classVodDailyInfoDTO.getUserName()); + + List classDailyInfoVOS = classDailyInfoVOIPage.getRecords(); + + //获取班级、每个学员维度的视频播放总时长 + List vodPlayHistoryDOS = vodPlayHistoryMapper.classMemberPlayLength(classVodDailyInfoDTO.getClassId()); + + HashMap hashMap = new HashMap<>(); + + //存在一个map里 + for (ClassMemberPlayLengthVO vodPlayHistoryDO : vodPlayHistoryDOS) { + hashMap.put(vodPlayHistoryDO.getMemberId() + "-" + vodPlayHistoryDO.getVodId(), vodPlayHistoryDO.getPlayLength()); + } + + //查询这个班级的所有视频 + ClassDictDO classDictDO = classDictMapper.selectById(classVodDailyInfoDTO.getClassId()); + List vodDictDOS = vodDictMapper.getCourseVods(classDictDO.getCourseId(), null); + + for (ClassDailyInfoVO classDailyInfoVO : classDailyInfoVOS) { + //查看这个人某个视频的长度 + int total = 0; + int playLengthTmp = 0; + List classVodDailyInfoItemVOS = new ArrayList<>(); + for (VodDictDO vodDictDO : vodDictDOS) { + Integer playLength = hashMap.get(classDailyInfoVO.getId() + "-" + vodDictDO.getId()); + ClassVodDailyInfoItemVO classVodDailyInfoItemVO = new ClassVodDailyInfoItemVO(); + classVodDailyInfoItemVO.setVodId(vodDictDO.getId()); + classVodDailyInfoItemVO.setVodName(vodDictDO.getVodName()); + if (null != playLength) { + classVodDailyInfoItemVO.setPlayLength(playLength); + classVodDailyInfoItemVOS.add(classVodDailyInfoItemVO); + if (playLength >= vodDictDO.getVodLength()) { + total++; + } + playLengthTmp += playLength; + } else { + classVodDailyInfoItemVO.setPlayLength(0); + classVodDailyInfoItemVOS.add(classVodDailyInfoItemVO); + } + } + classDailyInfoVO.setStudyLength(playLengthTmp); + classDailyInfoVO.setTotal(MathUtil.intDivFloorPercent(total, vodDictDOS.size())); + classDailyInfoVO.setClassVodDailyInfoItemVOS(classVodDailyInfoItemVOS); + } + return classDailyInfoVOIPage; + + } + + public void exportClassVodDailyInfo(ClassVodDailyInfoDTO classVodDailyInfoDTO) { + + //查看班级里有多少人 + Page pager = new Page(1, -1L); + + ClassDictDO classDictDO = classDictMapper.selectById(classVodDailyInfoDTO.getClassId()); + //查询所有视频 + List vodDictDOS = vodDictMapper.getCourseVods(classDictDO.getCourseId(), null); + + HashMap vodHashmap = new HashMap<>(); + for (VodDictDO vodDictDO : vodDictDOS) { + vodHashmap.put(vodDictDO.getVodName(), vodDictDO.getVodLength()); + } + + // 表头 + List title = new ArrayList<>(); + title.add("序号"); + title.add("姓名"); + title.add("完成率"); + title.add("学习时长(小时)"); + title.add("学习时长(分钟)"); + for (VodDictDO vodDictDO : vodDictDOS) { + title.add(vodDictDO.getVodName()); + } + + //获取班级成员 + IPage classDailyInfoVOIPage = classMemberMappingMapper.getClassMembersWithName(pager, classVodDailyInfoDTO.getClassId(), classVodDailyInfoDTO.getUserName()); + + List classDailyInfoVOS = classDailyInfoVOIPage.getRecords(); + + //获取班级、每个学员维度的视频播放总时长 + List classMemberPlayLengthVOS = vodPlayHistoryMapper.classMemberPlayLength(classVodDailyInfoDTO.getClassId()); + + HashMap hashMap = new HashMap<>(); + + //存在一个map里 + for (ClassMemberPlayLengthVO classMemberPlayLengthVO : classMemberPlayLengthVOS) { + hashMap.put(classMemberPlayLengthVO.getMemberId() + "-" + classMemberPlayLengthVO.getVodName(), classMemberPlayLengthVO.getPlayLength()); + } + + writeVodExcel(classDailyInfoVOS, hashMap, title, vodHashmap); + + } + + public IPage memberDetectionRecord(ClassDetailDTO classDetailDTO) { + Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); + return this.baseMapper.classActivityDetection(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + } + + public void exportMemberDetectionRecord(ClassDetailDTO classDetailDTO) { + Page pager = new Page(1, -1L); + IPage iPage = baseMapper.classActivityDetection(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List memberDetectionRecordVOS = iPage.getRecords(); + //TODO + } + + public IPage imageCheckDetail(ClassDetailDTO classDetailDTO){ + Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); + return this.baseMapper.imageCheckDetail(pager,classDetailDTO.getId(),classDetailDTO.getUserName()); + } + + public void writeVodExcel(List classDailyInfoVOS, HashMap hashMap, List title, HashMap vodHashmap) { + + ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = servletRequestAttributes.getResponse(); + + Workbook wb = new XSSFWorkbook(); + Sheet sheet = wb.createSheet(); + AtomicInteger ai = new AtomicInteger(); + + Row row = sheet.createRow(ai.getAndIncrement()); + AtomicInteger at = new AtomicInteger(); + title.forEach(field -> { + Cell cell = row.createCell(at.getAndIncrement()); + CellStyle cellStyle = wb.createCellStyle(); + cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + Font font = wb.createFont(); + font.setBoldweight(Font.BOLDWEIGHT_BOLD); + cellStyle.setFont(font); + cell.setCellStyle(cellStyle); + cell.setCellValue(field); + }); + + int i = 1; + if (hashMap != null) { + for (ClassDailyInfoVO classDailyInfoVO : classDailyInfoVOS) { + Row r = sheet.createRow(ai.getAndIncrement()); + AtomicInteger a = new AtomicInteger(); + Cell cell = r.createCell(at.getAndIncrement()); + CellStyle cellStyle = wb.createCellStyle(); + cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + cell.setCellStyle(cellStyle); + Cell seqcell = r.createCell(a.getAndIncrement()); + seqcell.setCellValue(i++); + + Cell namecell = r.createCell(a.getAndIncrement()); + namecell.setCellValue(classDailyInfoVO.getUserName()); + + Cell totalCell = r.createCell(a.getAndIncrement()); + Cell studyLengthCell = r.createCell(a.getAndIncrement()); + Cell studyLengthCellm = r.createCell(a.getAndIncrement()); + + Integer total = 0; + int studyLength = 0; + for (String tt : title) { + + if (!"姓名".equals(tt) && !"完成率".equals(tt) && !"学习时长(小时)".equals(tt) && !"序号".equals(tt) && !"学习时长".equals(tt)) { + Cell cell1 = r.createCell(a.getAndIncrement()); + if (null != hashMap) { + + Integer playLength = hashMap.get(classDailyInfoVO.getId() + "-" + tt); + if (null != playLength) { + cell1.setCellValue(MathUtil.secToTime(playLength)); + if (vodHashmap.get(tt) <= playLength) { + total++; + } + studyLength += playLength; + } else { + cell1.setCellValue("00:00:00"); + } + } + } + } + studyLengthCell.setCellValue(MathUtil.secToTime(studyLength)); + studyLengthCellm.setCellValue(Math.floorDiv(studyLength, 60)); + totalCell.setCellValue(MathUtil.intDivFloorPercent(total, vodHashmap.keySet().size()) + "%"); + } + } + String fileName = String.valueOf(new Date().getTime()); + try { + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader("content-disposition", "attachment;filename=" + URLEncoder.encode(fileName + ".xlsx", "utf-8")); + response.flushBuffer(); + wb.write(response.getOutputStream()); + } catch (IOException e) { + log.error(String.format("downLoad excel exception"), e); + } + + } + + + /** + * 导出excel文件 + */ + public void writeExcel(List memberIds, HashMap> hashMap, List dates) { + ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = servletRequestAttributes.getResponse(); + + Workbook wb = new XSSFWorkbook(); + Sheet sheet = wb.createSheet(); + AtomicInteger ai = new AtomicInteger(); + + Row row = sheet.createRow(ai.getAndIncrement()); + AtomicInteger at = new AtomicInteger(); + dates.forEach(field -> { + Cell cell = row.createCell(at.getAndIncrement()); + CellStyle cellStyle = wb.createCellStyle(); + cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + Font font = wb.createFont(); + font.setBoldweight(Font.BOLDWEIGHT_BOLD); + cellStyle.setFont(font); + cell.setCellStyle(cellStyle); + cell.setCellValue(field); + }); + + if (hashMap != null) { + int i = 1; + for (Long lg : memberIds) { + Row r = sheet.createRow(ai.getAndIncrement()); + AtomicInteger a = new AtomicInteger(); + Cell cell = r.createCell(at.getAndIncrement()); + CellStyle cellStyle = wb.createCellStyle(); + cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + cell.setCellStyle(cellStyle); + HashMap hashMap1 = hashMap.get(lg); + Cell seqcell = r.createCell(a.getAndIncrement()); + seqcell.setCellValue(i++); + Cell namecell = r.createCell(a.getAndIncrement()); + namecell.setCellValue(memberMapper.selectById(lg).getUserName()); + int total = 0; + for (String date : dates) { + if (!date.equals("姓名") && !"合计时长(小时)".equals(date) && !"序号".equals(date) && !"合计时长(分钟)".equals(date)) { + Cell cell1 = r.createCell(a.getAndIncrement()); + if (null != hashMap1) { + total += null == hashMap1.get(date) ? 0 : hashMap1.get(date); + cell1.setCellValue(null == hashMap1.get(date) ? "00:00:00" : MathUtil.secToTime(hashMap1.get(date))); + } else { + cell1.setCellValue("00:00:00"); + } + } + } + Cell totalCell = r.createCell(a.getAndIncrement()); + totalCell.setCellValue(MathUtil.secToTime(total)); + Cell totalCell1 = r.createCell(a.getAndIncrement()); + totalCell1.setCellValue(Math.floorDiv(total, 60)); + } + + } + String fileName = String.valueOf(new Date().getTime()); + try { + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader("content-disposition", "attachment;filename=" + URLEncoder.encode(fileName + ".xlsx", "utf-8")); + response.flushBuffer(); + wb.write(response.getOutputStream()); + } catch (IOException e) { + log.error(String.format("downLoad excel exception"), e); + } + + } + + //JAVA 获取时间段内的每一天 + public static List findDaysStr(String begintTime, String endTime) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Date dBegin = null; + Date dEnd = null; + try { + dBegin = sdf.parse(begintTime); + dEnd = sdf.parse(endTime); + } catch (ParseException e) { + e.printStackTrace(); + } + List daysStrList = new ArrayList(); + daysStrList.add(sdf.format(dBegin)); + Calendar calBegin = Calendar.getInstance(); + calBegin.setTime(dBegin); + Calendar calEnd = Calendar.getInstance(); + calEnd.setTime(dEnd); + while (dEnd.after(calBegin.getTime())) { + calBegin.add(Calendar.DAY_OF_MONTH, 1); + String dayStr = sdf.format(calBegin.getTime()); + daysStrList.add(dayStr); + } + return daysStrList; + } + + public void export(ClassDetailDTO classDetailDTO) throws Exception { ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); @@ -737,15 +1251,27 @@ public class AdministerServiceImpl extends ServiceImpl exerciseTestVOS = exportExerciseTest(classDetailDTO); - testListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2); - compressFileToZipStream(zipOutputStream, baos2, "test.xlsx"); + /** + * 测试成绩 + */ + //查看这个班级的课程下有几个试卷 + + //通过班级找课程 + ClassDictDO classDictDO1 = classDictMapper.selectById(classDetailDTO.getId()); + //通过课程id去找这个课程有几套卷子 + List paperDictDOS = paperDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(PaperDictDO::getCourseId, classDictDO1.getCourseId())); + + for (int i = 0; i < paperDictDOS.size(); i++) { + ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); + classDetailDTO.setFlag(false); + classDetailDTO.setPaperId(paperDictDOS.get(i).getId()); + List exerciseTestVOS = exportExerciseTest(classDetailDTO); + testListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2); + compressFileToZipStream(zipOutputStream, baos2, "test" + i + ".xlsx"); + } /** * 答疑记录 @@ -759,9 +1285,6 @@ public class AdministerServiceImpl extends ServiceImpl memberStudyLogVOS = iPage.getRecords(); + for (MemberStudyLogVO memberStudyLogVO : memberStudyLogVOS) { + memberStudyLogVO.setPlayLength(MathUtil.secToTime(Integer.valueOf(memberStudyLogVO.getPlayLength()))); + memberStudyLogVO.setTotalLength(MathUtil.secToTime(Integer.valueOf(memberStudyLogVO.getTotalLength()))); + } + return iPage; + } + + public void memberStudyLog(MemberStudyLogDTO memberStudyLogDTO) throws Exception { + + MemberDO memberDO = memberMapper.selectById(memberStudyLogDTO.getMemberId()); + + List memberStudyLog = vodPlayHistoryMapper.memberStudyLog(memberStudyLogDTO.getClassId(), memberStudyLogDTO.getMemberId()); + for (MemberStudyLogVO memberStudyLogVO : memberStudyLog) { + memberStudyLogVO.setPlayLength(MathUtil.secToTime(Integer.valueOf(memberStudyLogVO.getPlayLength()))); + memberStudyLogVO.setTotalLength(MathUtil.secToTime(Integer.valueOf(memberStudyLogVO.getTotalLength()))); + } + ExcelUtil.writeMemberStudyLog(memberDO, "学习记录", memberStudyLog, ExcelFormatUtils.studyLogList); + + } @Transactional(rollbackFor = Exception.class) - public String importMember(Long companyId, MultipartFile multipartFile) { + public String importMember(Long companyId, MultipartFile multipartFile) throws Exception { try { @@ -782,7 +1329,7 @@ public class AdministerServiceImpl extends ServiceImpl { + ExcelUtil.readExcelWithoutTitle(null, ImportMemberDTO.class, multipartFile).forEach(s -> { MemberDO memberDO = memberMapper.selectOne(new QueryWrapper() .lambda() @@ -794,57 +1341,81 @@ public class AdministerServiceImpl extends ServiceImpl memberDOS = memberMapper.selectList(new QueryWrapper() .lambda() - .eq(MemberDO::getAccountName, accountName)); + .eq(MemberDO::getAccountName, accountName) + .eq(MemberDO::getCompanyId, companyId)); if (memberDOS.size() > 0) { - String usernames = userName(accountName, 0); - memberDO1.setAccountName(usernames); + String usernames = userName(accountName, 0, companyId); + memberDO1.setAccountName(usernames.replace("u:", "v")); } else { - memberDO1.setAccountName(accountName); + memberDO1.setAccountName(accountName.replace("u:", "v")); } - } catch (BadHanyuPinyinOutputFormatCombination ex) { + } catch (Exception ex) { } + memberDO1.setCompanyId(companyId); + memberDO1.setFirstLogin(0); memberDO1.setTelephone(s.getTelephone()); memberDO1.setIdCard(s.getIdCard()); memberDO1.setStatus("启用"); memberDO1.setPassword("123456"); + memberDO1.setAccountNameEn(s.getAccountNameEn()); memberMapper.insert(memberDO1); - //找到该公司最大的部门 - DepartmentDictDO departmentDictDO = departmentDictMapper.selectOne(new QueryWrapper() - .lambda() - .isNull(DepartmentDictDO::getParentId) - .eq(DepartmentDictDO::getCompanyId, companyId)); + //找到对应的部门 + String[] fullName = s.getDepartments().split(","); + for (String dep : fullName) { + DepartmentDictDO departmentDictDO = departmentDictMapper.selectOne(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getFullName, dep)); - MemberDepartmentMappingDO memberDepartmentMappingDO = new MemberDepartmentMappingDO(); - memberDepartmentMappingDO.setDepartmentId(departmentDictDO.getId()); - memberDepartmentMappingDO.setMemberId(memberDO1.getId()); - memberDepartmentMappingMapper.insert(memberDepartmentMappingDO); + MemberDepartmentMappingDO memberDepartmentMappingDO = new MemberDepartmentMappingDO(); + memberDepartmentMappingDO.setDepartmentId(departmentDictDO.getId()); + memberDepartmentMappingDO.setMemberId(memberDO1.getId()); + memberDepartmentMappingMapper.insert(memberDepartmentMappingDO); + } } }); - } catch (Exception e) { + } catch ( + Exception e) { throw new HttpException(10001); } return ConstantUtils.ADD_SUCCESS; } - public String userName(String originName, int i) { + public IPage manageMember(ManageMemberDTO manageMemberDTO) { + Page pager = new Page(manageMemberDTO.getPageNum(), manageMemberDTO.getPageSize()); + return memberMapper.manageMember(pager, null, manageMemberDTO.getUserName(), null, null); + } + + public String userName(String originName, int i, Long companyId) { i++; List memberDOS = memberMapper.selectList(new QueryWrapper() .lambda() - .eq(MemberDO::getAccountName, originName + i)); + .eq(MemberDO::getAccountName, originName + i) + .eq(MemberDO::getCompanyId, companyId)); if (memberDOS.size() > 0) { - return userName(originName, i); + return userName(originName, i, companyId); } else { return originName + i; } } - public static void membersListExcel(String companyName, String studyDate, String courseName, String title, List headerList, List classDetailVOS, String datePattern, int colWidth, OutputStream out) { // 声明一个工作薄 @@ -955,7 +1526,7 @@ public class AdministerServiceImpl extends ServiceImpl= 60) { - newCell.setCellValue("合格"); - } else { - newCell.setCellValue("不合格"); - } + newCell.setCellValue(classDetailVO.getAskCounts()); + + newCell = dataRow.createCell(11); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getScore()); + + newCell = dataRow.createCell(12); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getResult()); + rowIndex++; seq++; } @@ -1065,7 +1640,6 @@ public class AdministerServiceImpl extends ServiceImpl headerList, List classSignVOS, String datePattern, int colWidth, OutputStream out) { // 声明一个工作薄 @@ -1176,7 +1750,7 @@ public class AdministerServiceImpl extends ServiceImpl= 60) { - newCell.setCellValue("合格"); - } else { - newCell.setCellValue("不合格"); - } + newCell.setCellValue(exerciseTestVO.getScore() >= 60 ? "合格" : "不合格"); rowIndex++; seq++; @@ -1683,7 +2254,6 @@ public class AdministerServiceImpl extends ServiceImpl() + .lambda() + .eq(AnsweringQuestionDO::getClassId, answeringQuestionDO.getClassId()) + .isNull(AnsweringQuestionDO::getAnswer)); + } + } diff --git a/src/main/java/com/subsidy/service/impl/BusinessScopeDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/BusinessScopeDictServiceImpl.java new file mode 100644 index 0000000..fe8520d --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/BusinessScopeDictServiceImpl.java @@ -0,0 +1,32 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.dto.businessScope.BusinessScopeDTO; +import com.subsidy.model.BusinessScopeDictDO; +import com.subsidy.mapper.BusinessScopeDictMapper; +import com.subsidy.service.BusinessScopeDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +/** + *

+ * 经营范围表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-07-25 + */ +@Service +public class BusinessScopeDictServiceImpl extends ServiceImpl implements BusinessScopeDictService { + + @Override + public IPage queryBusinessScopePage(BusinessScopeDTO businessScopeDictDO) { + Page page = new Page(businessScopeDictDO.getPageNum(), businessScopeDictDO.getPageSize()); + return this.baseMapper.selectPage(page, new QueryWrapper() + .lambda() + .like(StringUtils.isNotBlank(businessScopeDictDO.getBusinessScopeName()), BusinessScopeDictDO::getBusinessScopeName, businessScopeDictDO.getBusinessScopeName())); + } +} diff --git a/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java index dbb014b..99a4d5e 100644 --- a/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java @@ -10,6 +10,7 @@ import com.subsidy.mapper.CategoryMapper; import com.subsidy.service.CategoryService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import java.util.List; @@ -55,10 +56,9 @@ public class CategoryServiceImpl extends ServiceImpl } } - public String addCategory(CategoryDO categoryDO) { - int count = 0; + int count; if (null == categoryDO.getCompanyId()) { count = this.baseMapper.selectCount(new QueryWrapper() @@ -89,9 +89,11 @@ public class CategoryServiceImpl extends ServiceImpl int count = this.baseMapper.selectCount(new QueryWrapper() .lambda() - .eq(CategoryDO::getName, categoryDO.getName())); + .eq(CategoryDO::getName, categoryDO.getName()) + .eq(CategoryDO::getCompanyId, categoryDO.getCompanyId()) + .ne(CategoryDO::getId, categoryDO.getId())); - if (count > 2) { + if (count > 0) { throw new HttpException(90001); } diff --git a/src/main/java/com/subsidy/service/impl/CertCompanyMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CertCompanyMappingServiceImpl.java new file mode 100644 index 0000000..75cd0f6 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CertCompanyMappingServiceImpl.java @@ -0,0 +1,116 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.dto.cert.ChangeCompanyCertsDTO; +import com.subsidy.dto.cert.GetCompanyCertsDTO; +import com.subsidy.dto.cert.GetCompanyCertsWithStatusDTO; +import com.subsidy.mapper.CertMemberMappingMapper; +import com.subsidy.mapper.CertTypeDictMapper; +import com.subsidy.model.CertCompanyMappingDO; +import com.subsidy.mapper.CertCompanyMappingMapper; +import com.subsidy.model.CertDictDO; +import com.subsidy.model.CertMemberMappingDO; +import com.subsidy.model.CertTypeDictDO; +import com.subsidy.service.CertCompanyMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.cert.GetCompanyCertsVO; +import com.subsidy.vo.cert.GetCompanyCertsWithStatusVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 证书-公司映射表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Service +public class CertCompanyMappingServiceImpl extends ServiceImpl implements CertCompanyMappingService { + + @Autowired + private CertMemberMappingMapper certMemberMappingMapper; + + @Autowired + private CertTypeDictMapper certTypeDictMapper; + + @Autowired + private CertCompanyMappingMapper certCompanyMappingMapper; + + public List getCompanyCertsWithStatus(GetCompanyCertsWithStatusDTO getCompanyCertsDTO){ + + List getCompanyCertsWithStatusVOS = new ArrayList<>(); + + //查看某个公司所有的证书 + List certDictDOS = this.baseMapper.getCompanyCerts(getCompanyCertsDTO.getCompanyId(),getCompanyCertsDTO.getTypeId()); + for (CertDictDO certDictDO : certDictDOS){ + + GetCompanyCertsWithStatusVO getCompanyCertsWithStatusVO = new GetCompanyCertsWithStatusVO(); + BeanUtils.copyProperties(certDictDO,getCompanyCertsWithStatusVO); + + int count = certMemberMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(CertMemberMappingDO::getCertId,certDictDO.getId()) + .eq(CertMemberMappingDO::getMemberId,getCompanyCertsDTO.getMemberId())); + + if (count>0){ + getCompanyCertsWithStatusVO.setStatus(true); + }else { + getCompanyCertsWithStatusVO.setStatus(false); + } + getCompanyCertsWithStatusVOS.add(getCompanyCertsWithStatusVO); + } + return getCompanyCertsWithStatusVOS; + } + + public IPage getCompanyCerts(GetCompanyCertsDTO getCompanyCertsDTO){ + + Page pager = new Page(getCompanyCertsDTO.getPageNum(), getCompanyCertsDTO.getPageSize()); + + IPage getCompanyCertsVOIPage = this.baseMapper.getCompanyCertStatus(pager); + + List getCompanyCertsVOS = getCompanyCertsVOIPage.getRecords(); + + for (GetCompanyCertsVO getCompanyCertsVO : getCompanyCertsVOS){ + List certTypeDictDOS = certTypeDictMapper.getCertTypes(getCompanyCertsVO.getId()); + getCompanyCertsVO.setCertTypeDictDOS(certTypeDictDOS); + + int count = certCompanyMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(CertCompanyMappingDO::getCertId,getCompanyCertsVO.getId()) + .eq(CertCompanyMappingDO::getCompanyId,getCompanyCertsDTO.getCompanyId())); + + if (count>0){ + getCompanyCertsVO.setSignStatus(true); + }else { + getCompanyCertsVO.setSignStatus(false); + } + } + return getCompanyCertsVOIPage; + } + + public String changeCompanyCerts(ChangeCompanyCertsDTO changeCompanyCertsDTO){ + + if (changeCompanyCertsDTO.getSignStatus()){ + CertCompanyMappingDO certCompanyMappingDO = new CertCompanyMappingDO(); + certCompanyMappingDO.setCertId(changeCompanyCertsDTO.getCertId()); + certCompanyMappingDO.setCompanyId(changeCompanyCertsDTO.getCompanyId()); + this.baseMapper.insert(certCompanyMappingDO); + }else { + this.baseMapper.delete(new QueryWrapper() + .lambda() + .eq(CertCompanyMappingDO::getCertId,changeCompanyCertsDTO.getCertId()) + .eq(CertCompanyMappingDO::getCompanyId,changeCompanyCertsDTO.getCompanyId())); + } + return ConstantUtils.SET_SUCCESS; + } + +} diff --git a/src/main/java/com/subsidy/service/impl/CertDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CertDictServiceImpl.java new file mode 100644 index 0000000..4f625d0 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CertDictServiceImpl.java @@ -0,0 +1,149 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.dto.cert.AddCertDTO; +import com.subsidy.dto.cert.GetAllCertsDTO; +import com.subsidy.dto.cert.GetOneCertDTO; +import com.subsidy.mapper.*; +import com.subsidy.model.*; +import com.subsidy.service.CertDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.service.CertTypeDictService; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.cert.GetAllCertsVO; +import com.subsidy.vo.cert.GetAllCertsWithoutTypeVO; +import com.subsidy.vo.cert.GetOneCertVO; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 证书字典表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Service +public class CertDictServiceImpl extends ServiceImpl implements CertDictService { + + + @Autowired + private CertTypeMappingMapper certTypeMappingMapper; + + @Autowired + private CertTypeDictMapper certTypeDictMapper; + + @Autowired + private CertRequirementMapper certRequirementMapper; + + @Autowired + private CertMemberMappingMapper certMemberMappingMapper; + + @Transactional(rollbackFor = Exception.class) + public String addCert(AddCertDTO addCertDTO) { + + CertDictDO certDictDO = new CertDictDO(); + BeanUtils.copyProperties(addCertDTO, certDictDO); + this.baseMapper.insert(certDictDO); + + + List list = addCertDTO.getTypeIds(); + for (Long lg : list) { + CertTypeMappingDO certTypeMappingDO = new CertTypeMappingDO(); + certTypeMappingDO.setCertId(certDictDO.getId()); + certTypeMappingDO.setTypeId(lg); + certTypeMappingMapper.insert(certTypeMappingDO); + } + + return ConstantUtils.ADD_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String deleteCert(CertDictDO certDictDO) { + + //删除证书 + this.baseMapper.deleteById(certDictDO.getId()); + + //删除证书类目映射关系 + certTypeMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CertTypeMappingDO::getCertId,certDictDO.getId())); + + //删除证书相关条件 + certRequirementMapper.delete(new QueryWrapper() + .lambda() + .eq(CertRequirementDO::getCertId,certDictDO.getId())); + + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateCert(AddCertDTO addCertDTO) { + + CertDictDO certDictDO = new CertDictDO(); + BeanUtils.copyProperties(addCertDTO, certDictDO); + this.baseMapper.updateById(certDictDO); + + if (addCertDTO.getTypeIds().size() > 0) { + certTypeMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CertTypeMappingDO::getCertId, addCertDTO.getId())); + + List list = addCertDTO.getTypeIds(); + for (Long lg : list) { + CertTypeMappingDO certTypeMappingDO = new CertTypeMappingDO(); + certTypeMappingDO.setCertId(certDictDO.getId()); + certTypeMappingDO.setTypeId(lg); + certTypeMappingMapper.insert(certTypeMappingDO); + } + } + return ConstantUtils.SET_SUCCESS; + } + + public GetOneCertVO getOneCert(GetOneCertDTO getOneCertDTO) { + + GetOneCertVO getOneCertVO = new GetOneCertVO(); + CertDictDO certDictDO1 = this.baseMapper.selectById(getOneCertDTO.getId()); + BeanUtils.copyProperties(certDictDO1, getOneCertVO); + + //查看证书有哪些类型 + List certTypeDictDOS = certTypeDictMapper.getCertTypes(certDictDO1.getId()); + getOneCertVO.setCertTypeDictDOS(certTypeDictDOS); + + Integer count = certMemberMappingMapper.memberCertStatus(getOneCertDTO.getUserId(),certDictDO1.getId()); + + if (count > 0){ + getOneCertVO.setStatus(true); + }else { + getOneCertVO.setStatus(false); + } + + return getOneCertVO; + } + + public IPage getAllCerts(GetAllCertsDTO getAllCertsDTO) { + + Page pager = new Page(getAllCertsDTO.getPageNum(), getAllCertsDTO.getPageSize()); + IPage getAllCertsVOIPage = this.baseMapper.getAllCerts(pager,getAllCertsDTO.getTypeId(),getAllCertsDTO.getCertName()); + + List getAllCertsVOS = getAllCertsVOIPage.getRecords(); + for (GetAllCertsVO gav : getAllCertsVOS){ + List certTypeDictDOS = certTypeDictMapper.getCertTypes(gav.getId()); + gav.setCertTypeDictDOS(certTypeDictDOS); + } + return getAllCertsVOIPage; + } + + public List getAllCertsWithoutType(){ + return this.baseMapper.getAllCertsWithoutType(); + } + +} diff --git a/src/main/java/com/subsidy/service/impl/CertMemberFileMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CertMemberFileMappingServiceImpl.java new file mode 100644 index 0000000..aaf35e7 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CertMemberFileMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.CertMemberFileMappingDO; +import com.subsidy.mapper.CertMemberFileMappingMapper; +import com.subsidy.service.CertMemberFileMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Service +public class CertMemberFileMappingServiceImpl extends ServiceImpl implements CertMemberFileMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/CertMemberMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CertMemberMappingServiceImpl.java new file mode 100644 index 0000000..bc076f7 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CertMemberMappingServiceImpl.java @@ -0,0 +1,114 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.dto.cert.GetListDTO; +import com.subsidy.dto.cert.SignManagementDTO; +import com.subsidy.dto.cert.SignUpDTO; +import com.subsidy.mapper.CertMemberFileMappingMapper; +import com.subsidy.mapper.CertRequirementMapper; +import com.subsidy.mapper.CertTypeDictMapper; +import com.subsidy.model.CertMemberFileMappingDO; +import com.subsidy.model.CertMemberMappingDO; +import com.subsidy.mapper.CertMemberMappingMapper; +import com.subsidy.model.CertRequirementDO; +import com.subsidy.model.CertTypeDictDO; +import com.subsidy.service.CertMemberFileMappingService; +import com.subsidy.service.CertMemberMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.cert.GetListVO; +import com.subsidy.vo.cert.GetSignInfoVO; +import com.subsidy.vo.cert.SignManagementVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 学生报名证书表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Service +public class CertMemberMappingServiceImpl extends ServiceImpl implements CertMemberMappingService { + + @Autowired + private CertMemberFileMappingMapper certMemberFileMappingMapper; + + @Autowired + private CertTypeDictMapper certTypeDictMapper; + + @Autowired + private CertRequirementMapper certRequirementMapper; + + @Transactional(rollbackFor = Exception.class) + public String signUp(SignUpDTO signUpDTO) { + + List certMemberFileMappingDOS = signUpDTO.getFiles(); + + for (CertMemberFileMappingDO certMemberFileMappingDO : certMemberFileMappingDOS) { + certMemberFileMappingDO.setCertId(signUpDTO.getCertId()); + certMemberFileMappingDO.setMemberId(signUpDTO.getMemberId()); + certMemberFileMappingDO.setRequirementId(certMemberFileMappingDO.getRequirementId()); + certMemberFileMappingMapper.insert(certMemberFileMappingDO); + } + CertMemberMappingDO certMemberMappingDO = new CertMemberMappingDO(); + certMemberMappingDO.setCertId(signUpDTO.getCertId()); + certMemberMappingDO.setMemberId(signUpDTO.getMemberId()); + certMemberMappingDO.setOrderNo(System.currentTimeMillis()); + certMemberMappingDO.setStatus("等待确认"); + this.baseMapper.insert(certMemberMappingDO); + + //生成订单逻辑 TODO + return ConstantUtils.ADD_SUCCESS; + } + + public IPage signManagement(SignManagementDTO signManagementDTO) { + + Page pager = new Page(signManagementDTO.getPageNum(), signManagementDTO.getPageSize()); + + //获取报名订单 + IPage signManagementVOIPage = this.baseMapper.signManagement(pager, signManagementDTO.getStatus(), signManagementDTO.getTypeId(), signManagementDTO.getCertId(), signManagementDTO.getItem(), signManagementDTO.getStartDate(), signManagementDTO.getEndDate()); + + List signManagementVOS = signManagementVOIPage.getRecords(); + for (SignManagementVO signManagementVO : signManagementVOS) { + signManagementVO.setCnt("1"); + //类目 + List certTypeDictDOS = certTypeDictMapper.getCertTypes(signManagementVO.getCertId()); + signManagementVO.setCertTypeDictDOS(certTypeDictDOS); + + //附件 + List certRequirementDOS = certRequirementMapper.selectList(new QueryWrapper() + .lambda() + .eq(CertRequirementDO::getCertId, signManagementVO.getCertId())); + signManagementVO.setCertRequirementDOS(certRequirementDOS); + } + return signManagementVOIPage; + } + + public String changeStatus(CertMemberMappingDO certMemberMappingDO) { + CertMemberMappingDO certMemberMappingDO1 = this.baseMapper.selectById(certMemberMappingDO.getId()); + certMemberMappingDO1.setStatus(certMemberMappingDO.getStatus()); + this.baseMapper.updateById(certMemberMappingDO1); + return ConstantUtils.SET_SUCCESS; + } + + + public IPage getList(GetListDTO getListDTO) { + + Page pager = new Page(getListDTO.getPageNum(), getListDTO.getPageSize()); + return this.baseMapper.getList(pager,getListDTO.getMemberId(),getListDTO.getStatus()); + } + + public GetSignInfoVO getSignInfo(CertMemberMappingDO certMemberMappingDO){ + return this.baseMapper.getSignInfo(certMemberMappingDO.getMemberId(),certMemberMappingDO.getCertId()); + } + +} diff --git a/src/main/java/com/subsidy/service/impl/CertRequirementServiceImpl.java b/src/main/java/com/subsidy/service/impl/CertRequirementServiceImpl.java new file mode 100644 index 0000000..0dd84a5 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CertRequirementServiceImpl.java @@ -0,0 +1,82 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.exception.HttpException; +import com.subsidy.mapper.CertMemberFileMappingMapper; +import com.subsidy.model.CertMemberFileMappingDO; +import com.subsidy.model.CertRequirementDO; +import com.subsidy.mapper.CertRequirementMapper; +import com.subsidy.service.CertRequirementService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 报名条件表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-05-12 + */ +@Service +public class CertRequirementServiceImpl extends ServiceImpl implements CertRequirementService { + + @Autowired + private CertMemberFileMappingMapper certMemberFileMappingMapper; + + public List getRequirements(CertRequirementDO certRequirementDO) { + return this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(CertRequirementDO::getCertId, certRequirementDO.getCertId())); + } + + public String deleteRequirement(CertRequirementDO certRequirementDO) { + + //删除条件 + this.baseMapper.deleteById(certRequirementDO.getId()); + + //删除这个条件下的证书关联 + certMemberFileMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CertMemberFileMappingDO::getRequirementId, certRequirementDO.getCertId())); + return ConstantUtils.DELETE_SUCCESS; + } + + public String addRequirement(CertRequirementDO certRequirementDO) { + + //判断该条件是否已存在 + int count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(CertRequirementDO::getCertId, certRequirementDO.getCertId()) + .eq(CertRequirementDO::getCertRequirement, certRequirementDO.getCertRequirement())); + + if (count > 0) { + throw new HttpException(16001); + } + + this.baseMapper.insert(certRequirementDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateRequirement(CertRequirementDO certRequirementDO) { + + //判断该条件是否已存在 + int count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(CertRequirementDO::getCertId, certRequirementDO.getCertId()) + .eq(CertRequirementDO::getCertRequirement, certRequirementDO.getCertRequirement()) + .ne(CertRequirementDO::getId, certRequirementDO.getId())); + + if (count > 0) { + throw new HttpException(16001); + } + + this.baseMapper.updateById(certRequirementDO); + return ConstantUtils.SET_SUCCESS; + } + +} diff --git a/src/main/java/com/subsidy/service/impl/CertTypeDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CertTypeDictServiceImpl.java new file mode 100644 index 0000000..0f77607 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CertTypeDictServiceImpl.java @@ -0,0 +1,78 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.cert.GetAllTypeDTO; +import com.subsidy.mapper.CertTypeMappingMapper; +import com.subsidy.model.CertCompanyMappingDO; +import com.subsidy.model.CertTypeDictDO; +import com.subsidy.mapper.CertTypeDictMapper; +import com.subsidy.model.CertTypeMappingDO; +import com.subsidy.service.CertTypeDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 证书类目字典表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Service +public class CertTypeDictServiceImpl extends ServiceImpl implements CertTypeDictService { + + @Autowired + private CertTypeMappingMapper certTypeMappingMapper; + + + public List getCompanyCertTypes(CertCompanyMappingDO certCompanyMappingDO) { + return this.baseMapper.getCompanyCertTypes(certCompanyMappingDO.getCompanyId()); + } + + public String addType(CertTypeDictDO certTypeDictDO) { + + int count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(CertTypeDictDO::getTypeName, certTypeDictDO.getTypeName())); + + if (count > 0) { + throw new HttpException(15001); + } + this.baseMapper.insert(certTypeDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + + public String deleteType(CertTypeDictDO certTypeDictDO) { + + int count = certTypeMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(CertTypeMappingDO::getTypeId, certTypeDictDO.getId())); + + if (count > 0) { + throw new HttpException(15002); + } + + this.baseMapper.deleteById(certTypeDictDO.getId()); + + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateType(CertTypeDictDO certTypeDictDO) { + this.baseMapper.updateById(certTypeDictDO); + return ConstantUtils.DELETE_SUCCESS; + } + + public IPage getAllType(GetAllTypeDTO getAllTypeDTO){ + Page pager = new Page(getAllTypeDTO.getPageNum(), getAllTypeDTO.getPageSize()); + return this.baseMapper.selectPage(pager,null); + } +} diff --git a/src/main/java/com/subsidy/service/impl/CertTypeMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CertTypeMappingServiceImpl.java new file mode 100644 index 0000000..151eea2 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CertTypeMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.CertTypeMappingDO; +import com.subsidy.mapper.CertTypeMappingMapper; +import com.subsidy.service.CertTypeMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 证书-类型映射表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-05-11 + */ +@Service +public class CertTypeMappingServiceImpl extends ServiceImpl implements CertTypeMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java index 3cc38cf..f510627 100644 --- a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java @@ -1,26 +1,53 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.common.constant.CourseNotification; +import com.subsidy.common.exception.HttpException; import com.subsidy.dto.classDict.AddClassDTO; import com.subsidy.dto.classDict.AddMemberToClassDTO; -import com.subsidy.dto.classDict.GetAllClassesDTO; +import com.subsidy.dto.classDict.GetClassBaseInfoDTO; import com.subsidy.dto.classDict.GetSpareMembersDTO; -import com.subsidy.mapper.*; -import com.subsidy.model.*; +import com.subsidy.jobs.CourseNotificationJob; +import com.subsidy.mapper.AnsweringQuestionMapper; +import com.subsidy.mapper.ClassDictMapper; +import com.subsidy.mapper.ClassMemberMappingMapper; +import com.subsidy.mapper.ClassNoticeMapper; +import com.subsidy.mapper.CompanyDictMapper; +import com.subsidy.mapper.CourseDictMapper; +import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.mapper.VodDictMapper; +import com.subsidy.mapper.VodPlayHistoryMapper; +import com.subsidy.model.AnsweringQuestionDO; +import com.subsidy.model.ClassDictDO; +import com.subsidy.model.ClassMemberMappingDO; +import com.subsidy.model.ClassNoticeDO; +import com.subsidy.model.CompanyDictDO; +import com.subsidy.model.CourseDictDO; +import com.subsidy.model.FieldDictDO; +import com.subsidy.model.MemberDO; +import com.subsidy.model.RoleAdministerMappingDO; +import com.subsidy.model.VodDictDO; import com.subsidy.service.ClassDictService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; +import com.subsidy.util.DateFormatUtil; +import com.subsidy.util.QuartzUtil; import com.subsidy.util.SMSUtils; import com.subsidy.vo.classdict.GetAllClassesVO; +import com.subsidy.vo.classdict.GetClassBaseInfoVO; import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.management.relation.Role; -import java.util.ArrayList; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** *

@@ -37,17 +64,43 @@ public class ClassDictServiceImpl extends ServiceImpl getAllClasses(ClassDictDO classDictDO) { - return this.baseMapper.getAllClasses(classDictDO); + @Autowired + private VodPlayHistoryMapper vodPlayHistoryMapper; + + public List getAllClasses(ClassDictDO classDictDO) throws Exception { + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); + + List getAllClassesVOS = this.baseMapper.getAllClasses(classDictDO); + for (GetAllClassesVO getAllClassesVO : getAllClassesVOS) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(fmt.parse(getAllClassesVO.getEndDate())); + calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) + 1); + if (new Date().before(fmt.parse(getAllClassesVO.getStartDate()))) { + getAllClassesVO.setOpenStatus("1"); //待开始 + } else if (new Date().after(calendar.getTime())) { + getAllClassesVO.setOpenStatus("2"); + } else { + getAllClassesVO.setOpenStatus("0"); + } + } + return getAllClassesVOS; } @Transactional @@ -60,25 +113,42 @@ public class ClassDictServiceImpl extends ServiceImpl() - .lambda() - .eq(RoleAdministerMappingDO::getAdministerId,addClassDTO.getUserId()) - .eq(RoleAdministerMappingDO::getRoleId,1)); + @Transactional(rollbackFor = Exception.class) + public Long addClass(AddClassDTO addClassDTO) { + //新建一个班级 ClassDictDO classDictDO = new ClassDictDO(); - BeanUtils.copyProperties(addClassDTO,classDictDO); + BeanUtils.copyProperties(addClassDTO, classDictDO); + this.baseMapper.insert(classDictDO); - if (count>0){ - classDictDO.setClassType("平台支持"); - }else{ - classDictDO.setClassType("企业自建"); + //班级里添加成员 + List memberIds = addClassDTO.getMemberIds(); + for (Long lg : memberIds) { + ClassMemberMappingDO classMemberMappingDO = new ClassMemberMappingDO(); + classMemberMappingDO.setMemberId(lg); + classMemberMappingDO.setClassId(classDictDO.getId()); + classMemberMappingMapper.insert(classMemberMappingDO); } - this.baseMapper.insert(classDictDO); - return ConstantUtils.ADD_SUCCESS; + //添加通知 + if (null != addClassDTO.getClassNoticeDOS()) { + List classNoticeDOS = addClassDTO.getClassNoticeDOS(); + for (ClassNoticeDO classNoticeDO : classNoticeDOS) { + if (DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd HH").before(new Date())) { + throw new HttpException(70001); + } + classNoticeDO.setClassId(classDictDO.getId()); + classNoticeDO.setStatus(CourseNotification.UNSENT); + classNoticeMapper.insert(classNoticeDO); + Map params = new HashMap<>(); + params.put("classId", classNoticeDO.getClassId()); + params.put("id", classNoticeDO.getId()); + String name = classDictDO.getClassName() + "-" + classNoticeDO.getNoticeType() + "-" + classNoticeDO.getNoticeTime(); + quartzUtil.addSimpleJob(CourseNotificationJob.class, DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd HH:mm:ss"), params, name, "CourseNotificationJob"); + + } + } + return classDictDO.getId(); } public String updateClass(ClassDictDO classDictDO) { @@ -95,18 +165,27 @@ public class ClassDictServiceImpl extends ServiceImpl() + .lambda() + .eq(AnsweringQuestionDO::getAskId, classMemberMappingDO.getMemberId()) + .eq(AnsweringQuestionDO::getClassId, classMemberMappingDO.getClassId())); return ConstantUtils.DELETE_SUCCESS; } - public List getSpareMembers(GetSpareMembersDTO getSpareMembersDTO){ + public List getSpareMembers(GetSpareMembersDTO getSpareMembersDTO) { return this.baseMapper.getSpareMembers(getSpareMembersDTO); } - public String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO){ + public String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO) { List memberIds = addMemberToClassDTO.getMemberIds(); - for (Long lg : memberIds){ + for (Long lg : memberIds) { ClassMemberMappingDO classMemberMappingDO = new ClassMemberMappingDO(); classMemberMappingDO.setClassId(addMemberToClassDTO.getClassId()); classMemberMappingDO.setMemberId(lg); @@ -115,7 +194,7 @@ public class ClassDictServiceImpl extends ServiceImpl memberDOS = this.baseMapper.classMembers(classDictDO.getId()); StringBuilder telephone = new StringBuilder(); - String param = "{\"company\":\""+companyDictDO.getCompanyName()+ "\",\"course\":\""+courseDictDO.getCourseName()+ "\",\"startDate\":\""+classDictDO1.getStartDate() +"\",\"endDate\":\""+classDictDO1.getEndDate() +"\"}"; - if (memberDOS.size()>0){ - for (int i = 0 ;i< memberDOS.size();i++){ + String param = "{\"company\":\"" + companyDictDO.getCompanyName() + "\",\"course\":\"" + courseDictDO.getCourseName() + "\",\"startDate\":\"" + classDictDO1.getStartDate() + "\",\"endDate\":\"" + classDictDO1.getEndDate() + "\"}"; + if (memberDOS.size() > 0) { + for (int i = 0; i < memberDOS.size(); i++) { telephone.append(memberDOS.get(i).getTelephone()); - if (i!=memberDOS.size()-1){ + if (i != memberDOS.size() - 1) { telephone.append(","); } } - SMSUtils.sendNoticeSMS("SMS_228137810",telephone.toString(),param); + SMSUtils.sendNoticeSMS("SMS_228137810", telephone.toString(), param); } return ConstantUtils.SUCCESS_SEND_OUT; } + public GetClassBaseInfoVO getClassBaseInfo(GetClassBaseInfoDTO getClassBaseInfoDTO) { + + GetClassBaseInfoVO getClassBaseInfoVO = this.baseMapper.getClassBaseInfo(getClassBaseInfoDTO.getId()); + //查看课程完成状态 + //查看某个课程都有哪些视频 + List vodDictDOS = vodDictMapper.getCourseVods(getClassBaseInfoVO.getCourseId(),null); + int completeNum = 0 ; + //查看每个视频的状态 + for (VodDictDO vodDictDO : vodDictDOS){ + int i = vodPlayHistoryMapper.completeVodOrNot(getClassBaseInfoDTO.getUserId(),vodDictDO.getId(),getClassBaseInfoDTO.getId()); + completeNum += i; + } + if (completeNum == vodDictDOS.size()){ + getClassBaseInfoVO.setTestFlag(true); + }else { + getClassBaseInfoVO.setTestFlag(false); + } + return getClassBaseInfoVO; + } + } diff --git a/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java index f617547..138cc8d 100644 --- a/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java @@ -1,18 +1,29 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.common.RedisPrefixConstant; +import com.subsidy.mapper.ClassHourDictMapper; +import com.subsidy.mapper.CompanyDictMapper; +import com.subsidy.mapper.MemberMapper; +import com.subsidy.mapper.RotationImgDictMapper; import com.subsidy.mapper.VodPlayHistoryMapper; +import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassHourDictDO; -import com.subsidy.mapper.ClassHourDictMapper; +import com.subsidy.model.CompanyDictDO; +import com.subsidy.model.MemberDO; +import com.subsidy.model.RotationImgDictDO; import com.subsidy.model.VodPlayHistoryDO; import com.subsidy.service.ClassHourDictService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; +import com.subsidy.util.MyBeanUtils; +import com.subsidy.vo.classdict.GetSettingVO; import com.subsidy.vo.hour.PollingGetVO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.time.LocalDate; import java.util.List; /** @@ -27,68 +38,108 @@ import java.util.List; public class ClassHourDictServiceImpl extends ServiceImpl implements ClassHourDictService { @Autowired - private ClassHourDictMapper classHourDictMapper; + private VodPlayHistoryMapper vodPlayHistoryMapper; @Autowired - private VodPlayHistoryMapper vodPlayHistoryMapper; + private MemberMapper memberMapper; + + //@Autowired + //private RedisUtil redisUtil; + + @Autowired + private RotationImgDictMapper rotationImgDictMapper; + + @Autowired + private CompanyDictMapper companyDictMapper; + + public GetSettingVO getSetting(ClassHourDictDO classHourDictDO) { + + GetSettingVO getSettingVO = new GetSettingVO(); + + //ClassHourDictDO classDictDO = (ClassHourDictDO)redisUtil.get(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX+classHourDictDO.getCompanyId()); + //if (null == classDictDO){ + ClassHourDictDO classDictDO = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ClassHourDictDO::getCompanyId,classHourDictDO.getCompanyId())); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX+classHourDictDO.getCompanyId(),classDictDO); + //} + + BeanUtils.copyProperties(classDictDO,getSettingVO); + + List rotationImgDictDOS = rotationImgDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(RotationImgDictDO::getCompanyId,classHourDictDO.getCompanyId())); - public ClassHourDictDO getSetting(ClassHourDictDO classHourDictDO) { + getSettingVO.setRotationImgDictDOS(rotationImgDictDOS); + + CompanyDictDO companyDictDO = companyDictMapper.selectById(classHourDictDO.getCompanyId()); + getSettingVO.setLogo(companyDictDO.getLogo()); + return getSettingVO; + } + + public String updateSetting(GetSettingVO getSettingVO) { + + if (!StringUtils.isEmpty(getSettingVO.getLogo())){ + CompanyDictDO companyDictDO = companyDictMapper.selectById(getSettingVO.getCompanyId()); + companyDictDO.setLogo(getSettingVO.getLogo()); + companyDictMapper.updateById(companyDictDO); + } + + //ClassHourDictDO classHourDictDO1 = (ClassHourDictDO) redisUtil.get(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX + getSettingVO.getCompanyId()); + //getSettingVO.setId(classHourDictDO1.getId()); + //BeanUtils.copyProperties(getSettingVO, classHourDictDO1,nullParams); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX+getSettingVO.getCompanyId(), classHourDictDO1); ClassHourDictDO classHourDictDO1 = this.baseMapper.selectOne(new QueryWrapper() .lambda() - .eq(ClassHourDictDO::getCompanyId,classHourDictDO.getCompanyId())); - if (null==classHourDictDO){ - ClassHourDictDO classHourDictDO2 = new ClassHourDictDO(); - classHourDictDO2.setCompanyId(classHourDictDO.getCompanyId()); - classHourDictDO2.setStatus(0); - classHourDictDO2.setClassHour(6); - this.baseMapper.insert(classHourDictDO2); - return classHourDictDO2; + .eq(ClassHourDictDO::getCompanyId,getSettingVO.getCompanyId())); + String[] nullParams = MyBeanUtils.getNullPropertyNames(getSettingVO); + BeanUtils.copyProperties(getSettingVO,classHourDictDO1,nullParams); + this.baseMapper.updateById(classHourDictDO1); + + if (getSettingVO.getRotationImgDictDOS().size()>0){ + List rotationImgDictDOS = getSettingVO.getRotationImgDictDOS(); + rotationImgDictMapper.delete(new QueryWrapper() + .lambda() + .eq(RotationImgDictDO::getCompanyId,getSettingVO.getCompanyId())); + + for (RotationImgDictDO rotationImgDictDO : rotationImgDictDOS){ + rotationImgDictDO.setCompanyId(getSettingVO.getCompanyId()); + rotationImgDictMapper.insert(rotationImgDictDO); + } } - return classHourDictDO1; - } - - public String updateSetting(ClassHourDictDO classHourDictDO){ - this.baseMapper.updateById(classHourDictDO); - return ConstantUtils.ADD_SUCCESS; + return ConstantUtils.SET_SUCCESS; } - public PollingGetVO pollingGet(VodPlayHistoryDO vodPlayHistoryDO){ + public PollingGetVO pollingGet(VodPlayHistoryDO vodPlayHistoryDO) { PollingGetVO pollingGetVO = new PollingGetVO(); + MemberDO memberDO = memberMapper.selectById(vodPlayHistoryDO.getMemberId()); + //查看系统设定的时长 - ClassHourDictDO classHourDictDO = classHourDictMapper.selectOne(new QueryWrapper() + ClassHourDictDO classHourDictDO = this.baseMapper.selectOne (new QueryWrapper() .lambda() - .eq(ClassHourDictDO::getStatus,1)); - if (null == classHourDictDO){ + .eq(ClassHourDictDO::getCompanyId,memberDO.getCompanyId())); + + if (classHourDictDO.getStatus() == 0) { pollingGetVO.setBool(false); return pollingGetVO; } //查看当天这个人看了多少时间 - List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() - .lambda() - .eq(VodPlayHistoryDO::getMemberId,vodPlayHistoryDO.getMemberId()) - .eq(VodPlayHistoryDO::getCreateDate, LocalDate.now())); - - int total = 0 ; - - for (VodPlayHistoryDO vodPlayHistoryDO1 : vodPlayHistoryDOS){ - total += vodPlayHistoryDO1.getPlayLength(); - } + Integer total = vodPlayHistoryMapper.memberDailyStudyLength(memberDO.getId()); //是否超过时长 没超过 false 超过 true - if (classHourDictDO==null){ + if (classHourDictDO == null) { pollingGetVO.setBool(true); - }else { - if (total + vodPlayHistoryDO.getPlayLength() < classHourDictDO.getClassHour()*60*60){ + } else { + if (total + vodPlayHistoryDO.getPlayLength() < classHourDictDO.getClassHour() * 3600) { pollingGetVO.setBool(false); - }else { + } else { pollingGetVO.setBool(true); } } return pollingGetVO; } - } diff --git a/src/main/java/com/subsidy/service/impl/ClassNoticeServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassNoticeServiceImpl.java new file mode 100644 index 0000000..5959c56 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/ClassNoticeServiceImpl.java @@ -0,0 +1,122 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.constant.CourseNotification; +import com.subsidy.common.constant.SmsCode; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.classNotice.SendNotificationDTO; +import com.subsidy.jobs.CourseNotificationJob; +import com.subsidy.mapper.ClassDictMapper; +import com.subsidy.mapper.MemberMapper; +import com.subsidy.model.ClassDictDO; +import com.subsidy.model.ClassNoticeDO; +import com.subsidy.mapper.ClassNoticeMapper; +import com.subsidy.model.MemberDO; +import com.subsidy.service.ClassNoticeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.util.DateFormatUtil; +import com.subsidy.util.QuartzUtil; +import com.subsidy.util.SMSUtils; +import com.subsidy.vo.classdict.ClassAndCompanyInfoVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + *

+ * 服务实现类 + *

+ * + * @author DengMin + * @since 2022-01-21 + */ +@Service +public class ClassNoticeServiceImpl extends ServiceImpl implements ClassNoticeService { + + @Autowired + private QuartzUtil quartzUtil; + + @Autowired + private ClassDictMapper classDictMapper; + + @Autowired + private MemberMapper memberMapper; + + @Transactional(rollbackFor = Exception.class) + @Override + public String addNotice(ClassNoticeDO classNoticeDO) { + if(DateFormatUtil.parse(classNoticeDO.getNoticeTime(),"yyyy-MM-dd HH").before(new Date())) { + throw new HttpException(70001); + } + + classNoticeDO.setStatus(CourseNotification.UNSENT); + this.baseMapper.insert(classNoticeDO); + + ClassDictDO classDictDO = classDictMapper.selectById(classNoticeDO.getClassId()); + Map params = new HashMap<>(); + params.put("classId", classNoticeDO.getClassId()); + params.put("id", classNoticeDO.getId()); + String name = classDictDO.getClassName()+"-"+classNoticeDO.getNoticeType()+"-"+classNoticeDO.getNoticeTime(); + quartzUtil.addSimpleJob(CourseNotificationJob.class,DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd HH:mm:ss") , params, name, "CourseNotificationJob"); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateNotice(ClassNoticeDO classNoticeDO) { + this.baseMapper.updateById(classNoticeDO); + return ConstantUtils.SET_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String deleteNotice(ClassNoticeDO classNoticeDO) { + ClassNoticeDO noticeDO = this.baseMapper.selectById(classNoticeDO.getId()); + + this.baseMapper.deleteById(classNoticeDO.getId()); + + ClassDictDO classDictDO = classDictMapper.selectById(noticeDO.getClassId()); + String name = classDictDO.getClassName()+"-"+noticeDO.getNoticeType()+"-"+noticeDO.getNoticeTime(); + quartzUtil.deleteJob(name, "CourseNotificationJob"); + return ConstantUtils.DELETE_SUCCESS; + } + + public List queryClassNotices(ClassNoticeDO classNoticeDO){ + return this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassNoticeDO::getStatus, classNoticeDO.getStatus()) + .eq(ClassNoticeDO::getClassId,classNoticeDO.getClassId())); + } + + @Override + public void sendNotification(SendNotificationDTO sendNotificationDTO) { + ClassAndCompanyInfoVO cmInfo = classDictMapper.getClassAndCompanyInfoVO(sendNotificationDTO.getClassId()); + if(sendNotificationDTO.getSendType().equals(SmsCode.ALL.getType())) { + String params = "{\"company\":\""+ cmInfo.getCompany() +"\", \"course\":\""+ cmInfo.getCourseName() +"\", \"startDate\": \""+ cmInfo.getStartDate()+"\", \"endDate\": \""+ cmInfo.getEndDate()+"\"}"; + List list = memberMapper.getMemberList(sendNotificationDTO.getClassId()); + if(list != null) { + for (MemberDO memberDO : list) { + SMSUtils.sendNoticeSMS(SmsCode.ALL.getCode(), memberDO.getTelephone(), params); + } + } + } else if(sendNotificationDTO.getSendType().equals(SmsCode.NOT_SIGNED_IN.getType())) { + String params = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}"; + List list = memberMapper.getMemberListBySignInRecord(sendNotificationDTO.getClassId()); + if(list != null) { + for (MemberDO memberDO : list) { + SMSUtils.sendNoticeSMS(SmsCode.NOT_SIGNED_IN.getCode(), memberDO.getTelephone(), params); + } + } + } else if(sendNotificationDTO.getSendType().equals(SmsCode.UNFINISHED.getType())) { + String params = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}"; + List list = memberMapper.getUnfinishedMemberList(sendNotificationDTO.getClassId()); + if(list != null) { + for (MemberDO memberDO : list) { + SMSUtils.sendNoticeSMS(SmsCode.UNFINISHED.getCode(), memberDO.getTelephone(), params); + } + } + } + } +} diff --git a/src/main/java/com/subsidy/service/impl/ClassTypeDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassTypeDictServiceImpl.java new file mode 100644 index 0000000..16c71e9 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/ClassTypeDictServiceImpl.java @@ -0,0 +1,74 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.dto.classDict.ClassTypeDTO; +import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.model.ClassDictDO; +import com.subsidy.model.ClassTypeDictDO; +import com.subsidy.mapper.ClassTypeDictMapper; +import com.subsidy.model.RoleAdministerMappingDO; +import com.subsidy.service.ClassTypeDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 班级类型字典表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-01-21 + */ +@Service +public class ClassTypeDictServiceImpl extends ServiceImpl implements ClassTypeDictService { + + @Autowired + private RoleAdministerMappingMapper roleAdministerMappingMapper; + + public String addClassType(ClassTypeDictDO classTypeDictDO) { + this.baseMapper.insert(classTypeDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateClassType(ClassTypeDictDO classTypeDictDO) { + this.baseMapper.updateById(classTypeDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public String deleteClassType(ClassTypeDictDO classTypeDictDO) { + this.baseMapper.deleteById(classTypeDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public List queryClassTypes(ClassTypeDTO classTypeDTO) { + + List classTypeDictDOS = new ArrayList<>(); + + //查看当前登录人的角色 角色映射表 + int count = roleAdministerMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,classTypeDTO.getUserId()) + .eq(RoleAdministerMappingDO::getRoleId,1)); + + if (count>0){ + //平台支持 + ClassTypeDictDO classTypeDictDO = this.baseMapper.selectById(1); + classTypeDictDOS.add(classTypeDictDO); + } + + //企业自己的班级类型 + List classTypeDictDOList = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassTypeDictDO::getCompanyId,classTypeDTO.getCompanyId())); + + classTypeDictDOS.addAll(classTypeDictDOList); + return classTypeDictDOS; + } + +} diff --git a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java index b0980ce..1e709ec 100644 --- a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java @@ -4,25 +4,37 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.common.RedisPrefixConstant; import com.subsidy.common.exception.HttpException; import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.dto.company.AddCompanyDTO; +import com.subsidy.dto.company.GetCompanyMembersDTO; import com.subsidy.mapper.AdministerMapper; +import com.subsidy.mapper.ClassHourDictMapper; +import com.subsidy.mapper.ClassTypeDictMapper; +import com.subsidy.mapper.CompanyDictMapper; +import com.subsidy.mapper.CompanyFieldMappingMapper; import com.subsidy.mapper.DepartmentDictMapper; +import com.subsidy.mapper.FieldDictMapper; +import com.subsidy.mapper.JobDictMapper; +import com.subsidy.mapper.RankDictMapper; import com.subsidy.mapper.RoleAdministerMappingMapper; -import com.subsidy.model.AdministerDO; -import com.subsidy.model.CompanyDictDO; -import com.subsidy.mapper.CompanyDictMapper; -import com.subsidy.model.DepartmentDictDO; -import com.subsidy.model.RoleAdministerMappingDO; +import com.subsidy.mapper.RotationImgDictMapper; +import com.subsidy.model.*; import com.subsidy.service.CompanyDictService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; import com.subsidy.vo.administer.OperatorsVO; +import com.subsidy.vo.company.GetAllCompanyVO; +import com.subsidy.vo.company.GetCompanyMembersVO; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; + /** *

* 企业字典表 服务实现类 @@ -44,19 +56,50 @@ public class CompanyDictServiceImpl extends ServiceImpl operators(OperatorsDTO operatorsDTO) { Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); + + AdministerDO administerDO = administerMapper.selectById(operatorsDTO.getId()); + //判断该用户的角色 Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper() .lambda() - .eq(RoleAdministerMappingDO::getAdministerId,operatorsDTO.getId()) - .eq(RoleAdministerMappingDO::getRoleId,1)); + .eq(RoleAdministerMappingDO::getAdministerId, operatorsDTO.getId()) + .eq(RoleAdministerMappingDO::getRoleId, 1)); - if (count > 0){ - operatorsDTO.setId(null); + if (count > 0) { + administerDO.setCompanyId(null); } - - return this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getId(),operatorsDTO.getUserName(),1); + IPage page = this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(), administerDO.getCompanyId(), 2, operatorsDTO.getSuperviseName()); + List operatorsVOS = page.getRecords(); + for (OperatorsVO operatorsVO : operatorsVOS) { + //查看公司所在行业 + List fieldDictDOS = fieldDictMapper.queryCompanyFields(operatorsVO.getCompanyId()); + operatorsVO.setField(fieldDictDOS); + } + page.setRecords(operatorsVOS); + return page; } public String addOperator(AddCompanyDTO addCompanyDTO) { @@ -65,16 +108,20 @@ public class CompanyDictServiceImpl extends ServiceImpl 0) { + throw new HttpException(20002); + } + Integer count1 = administerMapper.selectCount(new QueryWrapper() - .lambda() - .eq(AdministerDO::getAccountName, addCompanyDTO.getAccountName())); + .lambda() + .eq(AdministerDO::getAccountName, addCompanyDTO.getAccountName())); - if (count > 0 || count1>0) { + if (count1 > 0) { throw new HttpException(20002); } - CompanyDictDO companyDictDO =new CompanyDictDO(); - BeanUtils.copyProperties(addCompanyDTO,companyDictDO); + CompanyDictDO companyDictDO = new CompanyDictDO(); + BeanUtils.copyProperties(addCompanyDTO, companyDictDO); this.baseMapper.insert(companyDictDO); AdministerDO administerDO = new AdministerDO(); @@ -82,7 +129,7 @@ public class CompanyDictServiceImpl extends ServiceImpl fields = addCompanyDTO.getField(); + for (Long lg : fields) { + CompanyFieldMappingDO companyFieldMappingDO = new CompanyFieldMappingDO(); + companyFieldMappingDO.setCompanyId(companyDictDO.getId()); + companyFieldMappingDO.setFieldId(lg); + companyFieldMappingMapper.insert(companyFieldMappingDO); + } + + //初始化平台的岗位到企业的岗位 + List jobDictDOS = jobDictMapper.selectList(new QueryWrapper() + .lambda() + .isNull(JobDictDO::getCompanyId)); + for (JobDictDO jobDictDO : jobDictDOS) { + jobDictDO.setCompanyId(companyDictDO.getId()); + jobDictMapper.insert(jobDictDO); + } + + //初始化运营者的职级 + List rankDictDOS = rankDictMapper.selectList(new QueryWrapper() + .lambda() + .isNull(RankDictDO::getCompanyId)); + for (RankDictDO rankDictDO : rankDictDOS) { + rankDictDO.setCompanyId(companyDictDO.getId()); + rankDictMapper.insert(rankDictDO); + } + + //初始化轮播图 + List rotationImgDictDOS = rotationImgDictMapper.selectList(new QueryWrapper() + .lambda() + .isNull(RotationImgDictDO::getCompanyId)); + for (RotationImgDictDO rotationImgDictDO : rotationImgDictDOS) { + rotationImgDictDO.setCompanyId(companyDictDO.getId()); + rotationImgDictMapper.insert(rotationImgDictDO); + } + + //班级类型 + ClassTypeDictDO classTypeDictDO = new ClassTypeDictDO(); + classTypeDictDO.setClassType("企业内训"); + classTypeDictDO.setCompanyId(companyDictDO.getId()); + classTypeDictMapper.insert(classTypeDictDO); return ConstantUtils.ADD_SUCCESS; + } public String deleteAdminister(CompanyDictDO companyDictDO) { this.baseMapper.deleteById(companyDictDO.getId()); administerMapper.delete(new QueryWrapper() - .lambda() - .eq(AdministerDO::getCompanyId,companyDictDO.getId())); + .lambda() + .eq(AdministerDO::getCompanyId, companyDictDO.getId())); + //redisUtil.del(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX + companyDictDO.getId()); return ConstantUtils.DELETE_SUCCESS; } public String updateAdminister(AddCompanyDTO addCompanyDTO) { CompanyDictDO companyDictDO = new CompanyDictDO(); - BeanUtils.copyProperties(addCompanyDTO,companyDictDO); + BeanUtils.copyProperties(addCompanyDTO, companyDictDO); this.baseMapper.updateById(companyDictDO); - //查找企业管理员 - AdministerDO administerDO = administerMapper.selectOne(new QueryWrapper() - .lambda() - .eq(AdministerDO::getCompanyId,addCompanyDTO.getId()) - .eq(AdministerDO::getRole,1)); - if (StringUtils.isNotBlank(addCompanyDTO.getAccountName())){ - administerDO.setAccountName(addCompanyDTO.getAccountName()); + if (null != addCompanyDTO.getField() && addCompanyDTO.getField().size() > 0) { + companyFieldMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CompanyFieldMappingDO::getCompanyId, addCompanyDTO.getId())); + + List longs = addCompanyDTO.getField(); + for (Long lg : longs) { + CompanyFieldMappingDO companyFieldMappingDO = new CompanyFieldMappingDO(); + companyFieldMappingDO.setFieldId(lg); + companyFieldMappingDO.setCompanyId(addCompanyDTO.getId()); + companyFieldMappingMapper.insert(companyFieldMappingDO); + } } - if (StringUtils.isBlank(addCompanyDTO.getPassword())){ - addCompanyDTO.setPassword(addCompanyDTO.getPassword()); + + //查找企业管理员 + AdministerDO administerDO = roleAdministerMappingMapper.getAdminister(addCompanyDTO.getId()); + if (null != administerDO) { + if (StringUtils.isNotBlank(addCompanyDTO.getAccountName())) { + administerDO.setAccountName(addCompanyDTO.getAccountName()); + } + if (StringUtils.isBlank(addCompanyDTO.getPassword())) { + addCompanyDTO.setPassword(addCompanyDTO.getPassword()); + } + administerMapper.updateById(administerDO); } - administerMapper.updateById(administerDO); return ConstantUtils.SET_SUCCESS; } + public List getAllCompany(CompanyDictDO companyDictDO) { + return this.baseMapper.getAllCompany(companyDictDO); + } + + public IPage getCompanyMembers(GetCompanyMembersDTO getCompanyMembersDTO) { + Page pager = new Page(getCompanyMembersDTO.getPageNum(), getCompanyMembersDTO.getPageSize()); + return this.baseMapper.getCompanyMembers(pager,getCompanyMembersDTO.getCompanyId(),getCompanyMembersDTO.getUserName()); + } + + } diff --git a/src/main/java/com/subsidy/service/impl/CompanyFieldMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CompanyFieldMappingServiceImpl.java new file mode 100644 index 0000000..3fe658a --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CompanyFieldMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.CompanyFieldMappingDO; +import com.subsidy.mapper.CompanyFieldMappingMapper; +import com.subsidy.service.CompanyFieldMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author DengMin + * @since 2022-02-11 + */ +@Service +public class CompanyFieldMappingServiceImpl extends ServiceImpl implements CompanyFieldMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/ContentVodMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/ContentVodMappingServiceImpl.java new file mode 100644 index 0000000..9280bf6 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/ContentVodMappingServiceImpl.java @@ -0,0 +1,88 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.content.GetContendVodsDTO; +import com.subsidy.dto.contentVod.AddContentVod; +import com.subsidy.dto.contentVod.ContentVodDTO; +import com.subsidy.dto.vod.ChangeOrdersDTO; +import com.subsidy.mapper.VodDictMapper; +import com.subsidy.model.ContentVodMappingDO; +import com.subsidy.mapper.ContentVodMappingMapper; +import com.subsidy.service.ContentVodMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.vo.vod.GetContendVodsVO; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + +/** + *

+ * 目录视频关系表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-07-19 + */ +@Service +public class ContentVodMappingServiceImpl extends ServiceImpl implements ContentVodMappingService { + + @Autowired + private VodDictMapper vodDictMapper; + + @Override + public List getContendVods(GetContendVodsDTO getContendVodsDTO) { + return vodDictMapper.getContendVods( getContendVodsDTO.getVodName(), getContendVodsDTO.getContentId()); + } + + @Override + public void changeContentVodOrders(ChangeOrdersDTO changeOrdersDTO){ + if(CollectionUtils.isNotEmpty(changeOrdersDTO.getVodIds())) { + for (int i = 0; i < changeOrdersDTO.getVodIds().size(); i++) { + ContentVodMappingDO contentVodMappingDO = this.baseMapper.selectOne(new QueryWrapper().lambda() + .eq(ContentVodMappingDO::getContentId, changeOrdersDTO.getContentId()) + .eq(ContentVodMappingDO::getVodId, changeOrdersDTO.getVodIds().get(i))); + ContentVodMappingDO contentVodMapping = new ContentVodMappingDO(); + contentVodMapping.setId(contentVodMappingDO.getId()); + contentVodMapping.setOrderNo(i+1); + this.baseMapper.updateById(contentVodMapping); + } + } + } + + @Override + public void deleteContentVod(ContentVodDTO contentVodDTO) { + ContentVodMappingDO contentVodMappingDO = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ContentVodMappingDO::getContentId, contentVodDTO.getContentId()) + .eq(ContentVodMappingDO::getVodId, contentVodDTO.getVodId())); + if(contentVodMappingDO == null) { + throw new HttpException(18001); + } + + this.baseMapper.deleteById(contentVodMappingDO.getId()); + } + + @Override + public void addContentVod(AddContentVod addContentVod) { + if(CollectionUtils.isNotEmpty(addContentVod.getVodIds())) { + List list = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(ContentVodMappingDO::getContentId, addContentVod.getContentId())); + if(CollectionUtils.isNotEmpty(list)) { + this.baseMapper.deleteBatchIds(list.stream().map(ContentVodMappingDO::getId).collect(Collectors.toList())); + } + + for (int i = 0; i < addContentVod.getVodIds().size(); i++) { + ContentVodMappingDO contentVodMappingDO = new ContentVodMappingDO(); + contentVodMappingDO.setContentId(addContentVod.getContentId()); + contentVodMappingDO.setVodId(addContentVod.getVodIds().get(i)); + contentVodMappingDO.setOrderNo(i+1); + this.baseMapper.insert(contentVodMappingDO); + } + } + } +} diff --git a/src/main/java/com/subsidy/service/impl/CourseCategoryMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseCategoryMappingServiceImpl.java new file mode 100644 index 0000000..dfc0a2f --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CourseCategoryMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.CourseCategoryMappingDO; +import com.subsidy.mapper.CourseCategoryMappingMapper; +import com.subsidy.service.CourseCategoryMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 课程类目映射 服务实现类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Service +public class CourseCategoryMappingServiceImpl extends ServiceImpl implements CourseCategoryMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java index 4ce8553..4880d14 100644 --- a/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java @@ -1,20 +1,13 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.common.exception.HttpException; -import com.subsidy.controller.CourseContentController; -import com.subsidy.mapper.VodDictMapper; -import com.subsidy.model.CourseContentDO; import com.subsidy.mapper.CourseContentMapper; -import com.subsidy.model.CourseDictDO; -import com.subsidy.model.VodDictDO; +import com.subsidy.model.CourseContentDO; import com.subsidy.service.CourseContentService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; -import com.subsidy.vo.vod.GetContendVodsVO; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - import java.util.List; /** @@ -28,6 +21,7 @@ import java.util.List; @Service public class CourseContentServiceImpl extends ServiceImpl implements CourseContentService { + @Override public List getContents(CourseContentDO courseContentDO) { return this.baseMapper.selectList(new QueryWrapper() .lambda() @@ -36,36 +30,37 @@ public class CourseContentServiceImpl extends ServiceImpl courseContentDOS = this.baseMapper.selectList(new QueryWrapper() - .lambda() - .eq(CourseContentDO::getCourseId,courseContentDO.getCourseId()) - .orderByDesc(CourseContentDO::getOrderNo)); + Integer orderNoTmp = this.baseMapper.selectMaxOrderNo(courseContentDO.getCourseId()); int orderNo = 1 ; - if (courseContentDOS.size()>0){ - orderNo = courseContentDOS.get(0).getOrderNo()+1; + if (null!=orderNoTmp){ + orderNo = orderNoTmp+1; } courseContentDO.setOrderNo(orderNo); this.baseMapper.insert(courseContentDO); return ConstantUtils.ADD_SUCCESS; } + @Override public String updateContent(CourseContentDO courseContentDO){ - List courseContentDOS = this.baseMapper.selectList(new QueryWrapper() + int count = this.baseMapper.selectCount(new QueryWrapper() .lambda() .eq(CourseContentDO::getCourseId,courseContentDO.getCourseId()) - .eq(CourseContentDO::getContent,courseContentDO.getContent())); + .eq(CourseContentDO::getContent,courseContentDO.getContent()) + .ne(CourseContentDO::getId,courseContentDO.getId())); - if (courseContentDOS.size()>0){ + if (count>0){ throw new HttpException(40001); } this.baseMapper.updateById(courseContentDO); diff --git a/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java index fd7b16e..d04cca1 100644 --- a/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java @@ -3,22 +3,45 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.course.AddCourseDTO; import com.subsidy.dto.course.QueryCoursesDTO; -import com.subsidy.mapper.AdministerMapper; -import com.subsidy.mapper.CompanyDictMapper; -import com.subsidy.mapper.RoleAdministerMappingMapper; -import com.subsidy.model.*; +import com.subsidy.dto.course.UpdateCoursesDTO; +import com.subsidy.dto.field.QueryFieldsDTO; +import com.subsidy.mapper.CategoryMapper; +import com.subsidy.mapper.CourseCategoryMappingMapper; import com.subsidy.mapper.CourseDictMapper; -import com.subsidy.service.CompanyDictService; +import com.subsidy.mapper.CourseFieldMappingMapper; +import com.subsidy.mapper.CourseJobMappingMapper; +import com.subsidy.mapper.CourseRankMappingMapper; +import com.subsidy.mapper.FieldDictMapper; +import com.subsidy.mapper.JobDictMapper; +import com.subsidy.mapper.PaperDictMapper; +import com.subsidy.mapper.RankDictMapper; +import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.model.CategoryDO; +import com.subsidy.model.CourseCategoryMappingDO; +import com.subsidy.model.CourseDictDO; +import com.subsidy.model.CourseFieldMappingDO; +import com.subsidy.model.CourseJobMappingDO; +import com.subsidy.model.CourseRankMappingDO; +import com.subsidy.model.FieldDictDO; +import com.subsidy.model.JobDictDO; +import com.subsidy.model.PaperDictDO; +import com.subsidy.model.RankDictDO; +import com.subsidy.model.RoleAdministerMappingDO; import com.subsidy.service.CourseDictService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; -import com.subsidy.util.SMSUtils; +import com.subsidy.util.excel.ExcelUtil; +import com.subsidy.vo.course.QueryCoursesVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; import java.util.List; /** @@ -32,112 +55,299 @@ import java.util.List; @Service public class CourseDictServiceImpl extends ServiceImpl implements CourseDictService { + @Autowired - private RoleAdministerMappingMapper roleAdministerMappingMapper; + private FieldDictMapper fieldDictMapper; - public String addCourse(CourseDictDO courseDictDO) { + @Autowired + private CategoryMapper categoryMapper; + + @Autowired + private JobDictMapper jobDictMapper; + + @Autowired + private CourseDictMapper courseDictMapper; - int count = 0; + @Autowired + private PaperDictMapper paperDictMapper; + + @Autowired + private CourseFieldMappingMapper courseFieldMappingMapper; + + @Autowired + private CourseJobMappingMapper courseJobMappingMapper; + + @Autowired + private CourseCategoryMappingMapper courseCategoryMappingMapper; + + @Autowired + private CourseRankMappingMapper courseRankMappingMapper; - if (null != courseDictDO.getCompanyId()) { + @Autowired + private RankDictMapper rankDictMapper; + + @Transactional(rollbackFor = Exception.class) + public String addCourse(AddCourseDTO addCourseDTO) { + + int count; + + if (null != addCourseDTO.getCompanyId()) { count = this.baseMapper.selectCount(new QueryWrapper() .lambda() - .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) + .eq(CourseDictDO::getCourseName, addCourseDTO.getCourseName()) .isNull(CourseDictDO::getCompanyId)); } else { count = this.baseMapper.selectCount(new QueryWrapper() .lambda() - .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) - .eq(CourseDictDO::getCompanyId, courseDictDO.getCompanyId())); + .eq(CourseDictDO::getCourseName, addCourseDTO.getCourseName()) + .eq(CourseDictDO::getCompanyId, addCourseDTO.getCompanyId())); } if (count > 0) { throw new HttpException(20001); } + CourseDictDO courseDictDO = new CourseDictDO(); + BeanUtils.copyProperties(addCourseDTO, courseDictDO); + courseDictDO.setOpenStatus(0); this.baseMapper.insert(courseDictDO); + + if (null != addCourseDTO.getCategoryDOS()) { + List categoryDOS = addCourseDTO.getCategoryDOS(); + for (Long lg : categoryDOS) { + CourseCategoryMappingDO courseCategoryMappingDO = new CourseCategoryMappingDO(); + courseCategoryMappingDO.setCategoryId(lg); + courseCategoryMappingDO.setCourseId(courseDictDO.getId()); + courseCategoryMappingMapper.insert(courseCategoryMappingDO); + } + } + + if (null != addCourseDTO.getJobDictDOS()) { + List jobDictDOS = addCourseDTO.getJobDictDOS(); + for (Long lg : jobDictDOS) { + CourseJobMappingDO courseJobMappingDO = new CourseJobMappingDO(); + courseJobMappingDO.setJobId(lg); + courseJobMappingDO.setCourseId(courseDictDO.getId()); + courseJobMappingMapper.insert(courseJobMappingDO); + } + } + + + if (null != addCourseDTO.getFieldDictDOS()) { + List fieldDictDOS = addCourseDTO.getFieldDictDOS(); + for (Long lg : fieldDictDOS) { + CourseFieldMappingDO courseFieldMappingDO = new CourseFieldMappingDO(); + courseFieldMappingDO.setCourseId(courseDictDO.getId()); + courseFieldMappingDO.setFieldId(lg); + courseFieldMappingMapper.insert(courseFieldMappingDO); + } + } + + if (null != addCourseDTO.getRankDictDOS()) { + List rankDictDOS = addCourseDTO.getRankDictDOS(); + for (Long lg : rankDictDOS) { + CourseRankMappingDO courseRankMappingDO = new CourseRankMappingDO(); + courseRankMappingDO.setCourseId(courseDictDO.getId()); + courseRankMappingDO.setRankId(lg); + courseRankMappingMapper.insert(courseRankMappingDO); + } + } + return ConstantUtils.ADD_SUCCESS; } public String deleteCourse(CourseDictDO courseDictDO) { this.baseMapper.deleteById(courseDictDO.getId()); + + //行业关联 + courseFieldMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CourseFieldMappingDO::getCourseId, courseDictDO.getId())); + + //课程类目关联 + courseCategoryMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CourseCategoryMappingDO::getCourseId, courseDictDO.getId())); + + //岗位关联 + courseJobMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CourseJobMappingDO::getCourseId, courseDictDO.getId())); + + paperDictMapper.delete(new QueryWrapper() + .lambda() + .eq(PaperDictDO::getCourseId, courseDictDO.getId())); + return ConstantUtils.DELETE_SUCCESS; } - public IPage queryCourses(QueryCoursesDTO queryCoursesDTO) { + public IPage queryCourses(QueryCoursesDTO queryCoursesDTO) { Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize()); + IPage iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getFieldId(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), queryCoursesDTO.getCourseType(), null, queryCoursesDTO.getOpenStatus()); - //判断当前用户是运营者还是企业者 - Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper() - .lambda() - .eq(RoleAdministerMappingDO::getAdministerId,queryCoursesDTO.getAdministerId()) - .eq(RoleAdministerMappingDO::getRoleId,1)); + List queryCoursesVOS = iPage.getRecords(); + for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) { + + //课程类目 + List categoryDOS = categoryMapper.queryCourseCategory(queryCoursesVO.getId()); + queryCoursesVO.setCategoryDOS(categoryDOS); + + //适用岗位 + List jobDictDOS = jobDictMapper.queryCourseJobs(queryCoursesVO.getId()); + queryCoursesVO.setJobDictDOS(jobDictDOS); + + //职级 + List rankDictDOS = rankDictMapper.queryCourseRanks(queryCoursesVO.getId()); + queryCoursesVO.setRankDictDOS(rankDictDOS); + + //行业范围 + List fieldDictDOS = fieldDictMapper.queryCourseFields(queryCoursesVO.getId()); + queryCoursesVO.setFieldDictDOS(fieldDictDOS); - if (count > 0){ - queryCoursesDTO.setCompanyId(null); + //课时 + Integer vodCnt = courseDictMapper.queryCourseCnt(queryCoursesVO.getId()); + queryCoursesVO.setVodCounts(vodCnt); + + //课程总时长 + Integer vodPlayLength = courseDictMapper.queryCoursePlayLength(queryCoursesVO.getId()); + queryCoursesVO.setVodLength(vodPlayLength); + + //测试数 + Integer paperCnt = paperDictMapper.queryCoursePapersCnt(queryCoursesVO.getId()); + queryCoursesVO.setPaperCount(paperCnt); } - return this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getCourseType(), queryCoursesDTO.getCourseSource(), queryCoursesDTO.getCompanyId()); + return iPage; } - public String updateCourses(CourseDictDO courseDictDO) { - int count = 0; + public String updateCourses(UpdateCoursesDTO updateCoursesDTO) { + int count; - if (null != courseDictDO.getCompanyId()) { + if (null != updateCoursesDTO.getCompanyId()) { count = this.baseMapper.selectCount(new QueryWrapper() .lambda() - .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) - .ne(CourseDictDO::getId, courseDictDO.getCompanyId())); + .eq(CourseDictDO::getCourseName, updateCoursesDTO.getCourseName()) + .ne(CourseDictDO::getId, updateCoursesDTO.getCompanyId())); } else { count = this.baseMapper.selectCount(new QueryWrapper() .lambda() - .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) - .isNull(CourseDictDO::getCompanyId)); + .eq(CourseDictDO::getCourseName, updateCoursesDTO.getCourseName()) + .isNull(CourseDictDO::getCompanyId) + .ne(CourseDictDO::getId, updateCoursesDTO.getId())); } if (count > 0) { throw new HttpException(20001); } + CourseDictDO courseDictDO = this.baseMapper.selectById(updateCoursesDTO.getId()); + BeanUtils.copyProperties(updateCoursesDTO, courseDictDO); this.baseMapper.updateById(courseDictDO); + + //行业 + if (null != updateCoursesDTO.getFieldDictDOS()) { + courseFieldMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CourseFieldMappingDO::getCourseId, updateCoursesDTO.getId())); + + List fieldDictDOS = updateCoursesDTO.getFieldDictDOS(); + for (Long lg : fieldDictDOS) { + CourseFieldMappingDO courseFieldMappingDO = new CourseFieldMappingDO(); + courseFieldMappingDO.setCourseId(updateCoursesDTO.getId()); + courseFieldMappingDO.setFieldId(lg); + courseFieldMappingMapper.insert(courseFieldMappingDO); + } + } + + //类目 + if (null != updateCoursesDTO.getCategoryDOS()) { + courseCategoryMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CourseCategoryMappingDO::getCourseId, updateCoursesDTO.getId())); + + List categoryDOS = updateCoursesDTO.getCategoryDOS(); + for (Long lg : categoryDOS) { + CourseCategoryMappingDO courseCategoryMappingDO = new CourseCategoryMappingDO(); + courseCategoryMappingDO.setCourseId(updateCoursesDTO.getId()); + courseCategoryMappingDO.setCategoryId(lg); + courseCategoryMappingMapper.insert(courseCategoryMappingDO); + } + } + + //岗位 + if (null != updateCoursesDTO.getJobDictDOS()) { + courseJobMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CourseJobMappingDO::getCourseId, updateCoursesDTO.getId())); + + List jobDictDOS = updateCoursesDTO.getJobDictDOS(); + for (Long lg : jobDictDOS) { + CourseJobMappingDO courseJobMappingDO = new CourseJobMappingDO(); + courseJobMappingDO.setCourseId(updateCoursesDTO.getId()); + courseJobMappingDO.setJobId(lg); + courseJobMappingMapper.insert(courseJobMappingDO); + } + } + + //职级 + if (null != updateCoursesDTO.getRankDictDOS()) { + courseRankMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(CourseRankMappingDO::getCourseId, updateCoursesDTO.getId())); + + List rankDictDOS = updateCoursesDTO.getRankDictDOS(); + for (Long lg : rankDictDOS) { + CourseRankMappingDO courseRankMappingDO = new CourseRankMappingDO(); + courseRankMappingDO.setCourseId(updateCoursesDTO.getId()); + courseRankMappingDO.setRankId(lg); + courseRankMappingMapper.insert(courseRankMappingDO); + } + } return ConstantUtils.DELETE_SUCCESS; } public IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO) { Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize()); + IPage iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), null, queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), null, queryCoursesDTO.getCompanyId(), queryCoursesDTO.getOpenStatus()); + + List queryCoursesVOS = iPage.getRecords(); + for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) { + + //行业范围 + List fieldDictDOS = fieldDictMapper.queryCourseFields(queryCoursesVO.getId()); + queryCoursesVO.setFieldDictDOS(fieldDictDOS); + + //课程类目 + List categoryDOS = categoryMapper.queryCourseCategory(queryCoursesVO.getId()); + queryCoursesVO.setCategoryDOS(categoryDOS); + + //适用岗位 + List jobDictDOS = jobDictMapper.queryCourseJobs(queryCoursesVO.getId()); + queryCoursesVO.setJobDictDOS(jobDictDOS); - ////判断角色 - //List roleAdministerMappingDOS = roleAdministerMappingMapper.selectList(new QueryWrapper() - //.lambda() - //.eq(RoleAdministerMappingDO::getAdministerId,roleAdministerMappingMapper)); - // - //Boolean flag = false; - //for (RoleAdministerMappingDO roleAdministerMappingDO : roleAdministerMappingDOS){ - // - // if (roleAdministerMappingDO.getRoleId() ==3){ - // flag= false; - // }else if(roleAdministerMappingDO.getRoleId()==2) { - // flag = true; - // } - //} - - //List longs = new ArrayList<>(); - //if (flag){ - // //运营者账号 该企业下的所有课程 管理员 - // //获取该企业下所有老师的课程 - // AdministerDO administerDO = administerMapper.selectById(queryCoursesDTO.getAdministerId()); - // - // List administerDOS = administerMapper.selectList(new QueryWrapper() - // .lambda() - // .eq(AdministerDO::getCompanyId,administerDO.getCompanyId())); - // for (AdministerDO administerDO1 : administerDOS){ - // longs.add(administerDO1.getId()); - // } - return this.baseMapper.queryCompanyCourse(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getCourseType(), queryCoursesDTO.getCourseSource(), queryCoursesDTO.getCompanyId()); - //} + //职级 + List rankDictDOS = rankDictMapper.queryCourseRanks(queryCoursesVO.getId()); + queryCoursesVO.setRankDictDOS(rankDictDOS); + //课时 + Integer vodCnt = courseDictMapper.queryCourseCnt(queryCoursesVO.getId()); + queryCoursesVO.setVodCounts(vodCnt); + + //课程总时长 + Integer vodPlayLength = courseDictMapper.queryCoursePlayLength(queryCoursesVO.getId()); + queryCoursesVO.setVodLength(vodPlayLength); + + //测试数 + Integer paperCnt = paperDictMapper.queryCoursePapersCnt(queryCoursesVO.getId()); + queryCoursesVO.setPaperCount(paperCnt); + } + return iPage; } + public String updateOpenStatus(CourseDictDO courseDictDO) { + this.baseMapper.updateOpenStatus(courseDictDO); + return ConstantUtils.SET_SUCCESS; + } } diff --git a/src/main/java/com/subsidy/service/impl/CourseFieldMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseFieldMappingServiceImpl.java new file mode 100644 index 0000000..cd364ed --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CourseFieldMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.CourseFieldMappingDO; +import com.subsidy.mapper.CourseFieldMappingMapper; +import com.subsidy.service.CourseFieldMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author DengMin + * @since 2022-01-20 + */ +@Service +public class CourseFieldMappingServiceImpl extends ServiceImpl implements CourseFieldMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/CourseJobMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseJobMappingServiceImpl.java new file mode 100644 index 0000000..956fbc7 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CourseJobMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.CourseJobMappingDO; +import com.subsidy.mapper.CourseJobMappingMapper; +import com.subsidy.service.CourseJobMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 课程-岗位映射表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Service +public class CourseJobMappingServiceImpl extends ServiceImpl implements CourseJobMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/CourseRankMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseRankMappingServiceImpl.java new file mode 100644 index 0000000..ad3ff5e --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CourseRankMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.CourseRankMappingDO; +import com.subsidy.mapper.CourseRankMappingMapper; +import com.subsidy.service.CourseRankMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 课程职级映射表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Service +public class CourseRankMappingServiceImpl extends ServiceImpl implements CourseRankMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java index 21378f0..70c38c1 100644 --- a/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java @@ -1,17 +1,27 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.department.GetDepartmentMembersDTO; import com.subsidy.dto.department.GetDepartmentsVO; import com.subsidy.mapper.MemberDepartmentMappingMapper; +import com.subsidy.mapper.MemberMapper; +import com.subsidy.model.AdministerDO; import com.subsidy.model.DepartmentDictDO; import com.subsidy.mapper.DepartmentDictMapper; +import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDepartmentMappingDO; import com.subsidy.service.DepartmentDictService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.department.GetMembersVO; +import com.subsidy.vo.member.MemberVodVO; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -31,6 +41,9 @@ public class DepartmentDictServiceImpl extends ServiceImpl getDepartments(DepartmentDictDO departmentDictDO) { //返回结果 @@ -44,14 +57,14 @@ public class DepartmentDictServiceImpl extends ServiceImpl() - .lambda() - .eq(MemberDepartmentMappingDO::getDepartmentId,dd.getId())); - getDepartmentsVO.setCnt(count); + BeanUtils.copyProperties(dd, getDepartmentsVO); + //Integer count = memberDepartmentMappingMapper.selectCount(new QueryWrapper() + // .lambda() + // .eq(MemberDepartmentMappingDO::getDepartmentId, dd.getId())); + //getDepartmentsVO.setCnt(count); getDepartmentsVO.setChildren(getChildNodes(getDepartmentsVO)); DepartmentDictDO departmentDictDO1 = this.baseMapper.selectById(dd.getParentId()); - if (null != departmentDictDO1){ + if (null != departmentDictDO1) { getDepartmentsVO.setParentDepartmentName(departmentDictDO1.getDepartmentName()); } getDepartmentsVOS.add(getDepartmentsVO); @@ -77,15 +90,15 @@ public class DepartmentDictServiceImpl extends ServiceImpl() - .lambda() - .eq(MemberDepartmentMappingDO::getDepartmentId,getDepartmentsVO.getId())); + .lambda() + .eq(MemberDepartmentMappingDO::getDepartmentId, getDepartmentsVO.getId())); getDepartmentsVO.setCnt(count); DepartmentDictDO departmentDictDO2 = this.baseMapper.selectById(departmentDictDO1.getParentId()); - if (null != departmentDictDO2){ + if (null != departmentDictDO2) { getDepartmentsVO.setParentDepartmentName(departmentDictDO2.getDepartmentName()); } getDepartmentsVOS.add(getDepartmentsVO); @@ -99,16 +112,32 @@ public class DepartmentDictServiceImpl extends ServiceImpl() .lambda() .eq(DepartmentDictDO::getCompanyId, departmentDictDO.getCompanyId()) - .eq(DepartmentDictDO::getDepartmentName, departmentDictDO.getDepartmentName())); + .eq(DepartmentDictDO::getFullName, departmentDictDO.getFullName())); if (counter > 0) { throw new HttpException(30001); } - this.baseMapper.insert(departmentDictDO); + List depNames = new ArrayList<>(); + + StringBuilder fullName = new StringBuilder(); + //fullName 遍历生成全名称 + do { + depNames.add("/"+departmentDictDO.getDepartmentName()); + departmentDictDO = this.baseMapper.selectById(departmentDictDO.getParentId()); + } while(null != departmentDictDO.getParentId()); + + depNames.add(departmentDictDO.getDepartmentName()); + + for (int i = depNames.size()-1; i >=0 ; i--){ + fullName.append(depNames.get(i)); + } + departmentDictDO1.setFullName(fullName.toString()); + this.baseMapper.insert(departmentDictDO1); return ConstantUtils.ADD_SUCCESS; } @@ -121,7 +150,7 @@ public class DepartmentDictServiceImpl extends ServiceImpl getMembers(GetDepartmentMembersDTO getDepartmentMembersDTO){ + + List getMembersVOS = new ArrayList<>(); + + GetMembersVO getMembersVO = new GetMembersVO(); + + //找到父节点 + DepartmentDictDO departmentDictDO = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getCompanyId,getDepartmentMembersDTO.getCompanyId()) + .isNull(DepartmentDictDO::getParentId)); + BeanUtils.copyProperties(departmentDictDO,getMembersVO); + + List departmentDictDOS = new ArrayList<>(); + departmentDictDOS.add(departmentDictDO); + + for (DepartmentDictDO dpt : departmentDictDOS){ + GetMembersVO gmv = new GetMembersVO(); + BeanUtils.copyProperties(dpt,gmv); + if (null!=departmentDictDO.getParentId()){ + DepartmentDictDO departmentDictDO1 =this.baseMapper.selectById(departmentDictDO.getParentId()); + gmv.setParentDepartmentName(departmentDictDO1.getDepartmentName()); + } + gmv.setChildren(getChildNodes(gmv)); + + if (dpt.getParentId()!=null){ + //部门人员 + List memberDOS1 = memberMapper.getMemberWithoutPage(dpt.getId(),getMembersVO.getUserName(),null,null,null); + gmv.setMemberDOS(memberDOS1); + getMembersVOS.add(gmv); + }else { + //公司人员 + List memberDOS = memberMapper.selectList(new QueryWrapper() + .lambda() + .eq(MemberDO::getCompanyId,getDepartmentMembersDTO.getCompanyId())); + gmv.setMemberDOS(memberDOS); + getMembersVOS.add(gmv); + } + } + return getMembersVOS; + } + + + /** + * 递归 带上部门总数,部门负责人等参数 + * + * @param getMembersVO 父节点查找该节点的children + * @return 子节点 + */ + public List getChildNodes(GetMembersVO getMembersVO) { + + List getAllDepartmentVOS = new ArrayList<>(); + + //查询该节点的子节点 + List departmentDictDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getParentId, getMembersVO.getId())); + + //递归 + for (DepartmentDictDO dd : departmentDictDOS) { + GetMembersVO gmv = new GetMembersVO(); + BeanUtils.copyProperties(dd, gmv); + if (null!=dd.getParentId()){ + DepartmentDictDO departmentDictDO = this.baseMapper.selectById(dd.getParentId()); + gmv.setParentDepartmentName(departmentDictDO.getDepartmentName()); + } + gmv.setChildren(getChildNodes(gmv)); + + + //部门人员 + List memberDOS = memberMapper.getMemberWithoutPage(dd.getId(),getMembersVO.getUserName(),null,null,null); + gmv.setMemberDOS(memberDOS); + getAllDepartmentVOS.add(gmv); + } + if (departmentDictDOS.size() == 0) { + return null; + } + + return getAllDepartmentVOS; + } } diff --git a/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java index ffd3268..a04de54 100644 --- a/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java @@ -1,25 +1,25 @@ package com.subsidy.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.subsidy.dto.exercise.GetAllExercisesDTO; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.dto.exercise.GetPaperExerciseDTO; import com.subsidy.dto.exercise.SubmitDTO; +import com.subsidy.mapper.ExerciseDictMapper; +import com.subsidy.mapper.ExerciseDoneHistoryMapper; import com.subsidy.mapper.ExerciseDoneResultMapper; -import com.subsidy.model.CourseDictDO; import com.subsidy.model.ExerciseDictDO; -import com.subsidy.mapper.ExerciseDictMapper; +import com.subsidy.model.ExerciseDoneHistoryDO; import com.subsidy.model.ExerciseDoneResultDO; import com.subsidy.service.ExerciseDictService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; -import com.subsidy.vo.course.ExerciseVO; +import com.subsidy.util.MathUtil; +import com.subsidy.vo.exercise.GetPaperExerciseVO; import com.subsidy.vo.exercise.MemberExerciseVO; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; import java.util.List; /** @@ -36,74 +36,49 @@ public class ExerciseDictServiceImpl extends ServiceImpl getAllExercises(GetAllExercisesDTO getAllExercisesDTO) { - - Page pager = new Page(getAllExercisesDTO.getPageNum(), getAllExercisesDTO.getPageSize()); - - return this.baseMapper.selectPage(pager, new QueryWrapper() - .lambda() - .eq(ExerciseDictDO::getCourseId, getAllExercisesDTO.getCourseId()) - .like(ExerciseDictDO::getDifficulty, getAllExercisesDTO.getDifficulty()) - .like(ExerciseDictDO::getExerciseType, getAllExercisesDTO.getExerciseType()) - .like(ExerciseDictDO::getTitle, getAllExercisesDTO.getTitle()) - .orderByAsc(ExerciseDictDO::getOrderNo)); - } + @Autowired + private ExerciseDoneHistoryMapper exerciseDoneHistoryMapper; public String addExercise(ExerciseDictDO exerciseDictDO){ - List exerciseDictDOS = this.baseMapper.selectList(new QueryWrapper() - .lambda() - .eq(ExerciseDictDO::getCourseId,exerciseDictDO.getCourseId()) - .orderByDesc(ExerciseDictDO::getOrderNo)); + Integer orderNoTmp = this.baseMapper.getMaximumNo(exerciseDictDO.getPaperId()); int orderNo = 1; - if (exerciseDictDOS.size() >0){ - orderNo = exerciseDictDOS.get(0).getOrderNo()+1; + if (null!= orderNoTmp) { + orderNo = orderNoTmp + 1; } exerciseDictDO.setOrderNo(orderNo); this.baseMapper.insert(exerciseDictDO); return ConstantUtils.ADD_SUCCESS; } - public String deleteExercise(ExerciseDictDO exerciseDictDO){ + public String deleteExercise(ExerciseDictDO exerciseDictDO) { this.baseMapper.deleteById(exerciseDictDO.getId()); return ConstantUtils.DELETE_SUCCESS; } - public String updateExercise(ExerciseDictDO exerciseDictDO){ + public String updateExercise(ExerciseDictDO exerciseDictDO) { this.baseMapper.updateById(exerciseDictDO); return ConstantUtils.SET_SUCCESS; } - public List getCourseExercises(CourseDictDO courseDictDO){ - - List exerciseVOS = new ArrayList<>(); - - List exerciseDictDOS = this.baseMapper.selectList(new QueryWrapper() - .lambda() - .eq(ExerciseDictDO::getCourseId,courseDictDO.getId())); - - for (ExerciseDictDO exerciseDictDO : exerciseDictDOS){ - ExerciseVO exerciseVO = new ExerciseVO(); - BeanUtils.copyProperties(exerciseDictDO,exerciseVO); - exerciseVOS.add(exerciseVO); - } - return exerciseVOS; - } - - public String submit(SubmitDTO submitDTO){ + @Transactional(rollbackFor = Exception.class) + public Long submit(SubmitDTO submitDTO) { ExerciseDoneResultDO exerciseDoneResultDO = new ExerciseDoneResultDO(); List memberExerciseVOS = submitDTO.getMemberExerciseVOS(); - int rightCounts = 0 ; + int rightCounts = 0; - for (MemberExerciseVO exerciseVO : memberExerciseVOS){ + for (MemberExerciseVO exerciseVO : memberExerciseVOS) { ExerciseDictDO exerciseDictDO = this.baseMapper.selectById(exerciseVO.getId()); - if (exerciseDictDO.getRightAnswer().equals(exerciseVO.getSelectAnswer())){ + if (exerciseDictDO.getRightAnswer().equals(exerciseVO.getSelectAnswer())) { + exerciseVO.setResult(1); rightCounts++; + }else { + exerciseVO.setResult(0); } } @@ -112,15 +87,33 @@ public class ExerciseDictServiceImpl extends ServiceImpl() - .lambda() - .eq(ExerciseDoneResultDO::getMemberId,submitDTO.getMemberId()) - .eq(ExerciseDoneResultDO::getCourseId,submitDTO.getCourseId())); + exerciseDoneResultDO.setPaperId(submitDTO.getPaperId()); + exerciseDoneResultDO.setLength(submitDTO.getLength()); + int score = MathUtil.intDivFloorPercent(rightCounts, memberExerciseVOS.size()); + exerciseDoneResultDO.setScore(score); + exerciseDoneResultDO.setResult(score>=60?"合格":"不合格"); exerciseDoneResultMapper.insert(exerciseDoneResultDO); - return ConstantUtils.COMMIT_SUCCESS; + for (MemberExerciseVO memberExerciseVO : memberExerciseVOS){ + + ExerciseDoneHistoryDO exerciseDoneHistoryDO = new ExerciseDoneHistoryDO(); + exerciseDoneHistoryDO.setPaperId(submitDTO.getPaperId()); + exerciseDoneHistoryDO.setDoneId(exerciseDoneResultDO.getId()); + exerciseDoneHistoryDO.setMemberId(submitDTO.getMemberId()); + exerciseDoneHistoryDO.setClassId(submitDTO.getClassId()); + exerciseDoneHistoryDO.setExerciseId(memberExerciseVO.getId()); + exerciseDoneHistoryDO.setAnswer(memberExerciseVO.getSelectAnswer()); + exerciseDoneHistoryDO.setResult(memberExerciseVO.getResult()); + exerciseDoneHistoryMapper.insert(exerciseDoneHistoryDO); + } + + return exerciseDoneResultDO.getId(); + } + + public IPage getPaperExercise(GetPaperExerciseDTO getPaperExerciseDTO) { + Page pager = new Page(getPaperExerciseDTO.getPageNum(), getPaperExerciseDTO.getPageSize()); + return this.baseMapper.getPaperExercise(pager,getPaperExerciseDTO.getPaperId(),getPaperExerciseDTO.getDifficulty(),getPaperExerciseDTO.getExerciseType(),getPaperExerciseDTO.getTitle()); } } diff --git a/src/main/java/com/subsidy/service/impl/ExerciseDoneHistoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/ExerciseDoneHistoryServiceImpl.java new file mode 100644 index 0000000..4abd1aa --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/ExerciseDoneHistoryServiceImpl.java @@ -0,0 +1,28 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.ExerciseDoneHistoryDO; +import com.subsidy.mapper.ExerciseDoneHistoryMapper; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.service.ExerciseDoneHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.vo.exercise.GetDoneHistoryDetailVO; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 做题历史记录表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-12-03 + */ +@Service +public class ExerciseDoneHistoryServiceImpl extends ServiceImpl implements ExerciseDoneHistoryService { + + public List getDoneHistoryDetail(ExerciseDoneResultDO exerciseDoneResultDO){ + return this.baseMapper.getDoneHistoryDetail(exerciseDoneResultDO.getId(),exerciseDoneResultDO.getMemberId()); + } + +} diff --git a/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java b/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java index 3575d56..2fa5167 100644 --- a/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java @@ -1,10 +1,29 @@ package com.subsidy.service.impl; -import com.subsidy.model.ExerciseDoneResultDO; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.dto.exercise.ImportHistory; +import com.subsidy.mapper.ExerciseDoneHistoryMapper; +import com.subsidy.model.*; import com.subsidy.mapper.ExerciseDoneResultMapper; import com.subsidy.service.ExerciseDoneResultService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.excel.ExcelUtil; +import com.subsidy.vo.exercise.GetDoneDetailVO; +import org.apache.poi.ss.usermodel.DateUtil; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import javax.swing.text.DateFormatter; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Random; /** *

@@ -17,4 +36,69 @@ import org.springframework.stereotype.Service; @Service public class ExerciseDoneResultServiceImpl extends ServiceImpl implements ExerciseDoneResultService { + + @Autowired + private ExerciseDoneResultMapper exerciseDoneResultMapper; + + @Autowired + private ExerciseDoneHistoryMapper exerciseDoneHistoryMapper; + + public GetDoneDetailVO getDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO) { + return this.baseMapper.getDoneDetail(exerciseDoneResultDO.getId()); + } + + public void importData(MultipartFile multipartFile) { + + try { + ExcelUtil.readExcel(null, ImportHistory.class, multipartFile).forEach(s -> { + + //找到相同卷子相同分数的人 + List exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getPaperId, s.getPaperId()) + .eq(ExerciseDoneResultDO::getScore, s.getScore())); + + //随机获取一个人 + Random random = new Random(); + ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultDOS.get(random.nextInt(exerciseDoneResultDOS.size())); + + + //找到这个人的答卷 + List exerciseDoneHistoryDOS = exerciseDoneHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(ExerciseDoneHistoryDO::getDoneId, exerciseDoneResultDO.getId()) + .eq(ExerciseDoneHistoryDO::getMemberId, exerciseDoneResultDO.getMemberId()) + .eq(ExerciseDoneHistoryDO::getPaperId, exerciseDoneResultDO.getPaperId())); + + DateTimeFormatter formatter = + DateTimeFormatter.ofPattern("EEE MMM dd HH:mm:ss zzz yyyy", Locale.ENGLISH); + //遍历写入 + for (ExerciseDoneHistoryDO exerciseDoneHistoryDO : exerciseDoneHistoryDOS) { + ExerciseDoneHistoryDO ex = new ExerciseDoneHistoryDO(); + BeanUtils.copyProperties(exerciseDoneHistoryDO, ex); + ex.setId(null); + ex.setMemberId(s.getMemberId()); + ex.setDoneId(s.getId()); + ex.setClassId(s.getClassId()); + ex.setPaperId(s.getPaperId()); +// DateUtil.getJavaDate() + + ex.setCreateDate(LocalDateTime.parse(s.getCreate_date(), formatter)); + exerciseDoneHistoryMapper.insert(ex); + } + + }); + } catch (Exception ex) { + ex.printStackTrace(); + } + + } + + public static void main(String[] args) { + while (true) { + System.out.println(new Random().nextInt(0)); + + } + } + } diff --git a/src/main/java/com/subsidy/service/impl/FieldDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/FieldDictServiceImpl.java new file mode 100644 index 0000000..f0c225a --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/FieldDictServiceImpl.java @@ -0,0 +1,65 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.field.QueryFieldsDTO; +import com.subsidy.model.FieldDictDO; +import com.subsidy.mapper.FieldDictMapper; +import com.subsidy.model.FileDictDO; +import com.subsidy.service.FieldDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import org.springframework.stereotype.Service; + +/** + *

+ * 行业字典表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-01-20 + */ +@Service +public class FieldDictServiceImpl extends ServiceImpl implements FieldDictService { + + + public String addField(FieldDictDO fieldDictDO) { + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(FieldDictDO::getFieldName, fieldDictDO.getFieldName())); + + if (count > 0) { + throw new HttpException(11001); + } + this.baseMapper.insert(fieldDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateField(FieldDictDO fieldDictDO) { + + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(FieldDictDO::getFieldName, fieldDictDO.getFieldName()) + .ne(FieldDictDO::getId, fieldDictDO.getId())); + + if (count > 0) { + throw new HttpException(11001); + } + this.baseMapper.updateById(fieldDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public String deleteField(FieldDictDO fieldDictDO){ + this.baseMapper.deleteById(fieldDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public IPage queryFields(QueryFieldsDTO queryFieldsDTO){ + Page pager = new Page(queryFieldsDTO.getPageNum(), queryFieldsDTO.getPageSize()); + return this.baseMapper.queryFields(pager,queryFieldsDTO.getFieldName()); + } + + +} diff --git a/src/main/java/com/subsidy/service/impl/FileDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/FileDictServiceImpl.java index 7619ebf..904a415 100644 --- a/src/main/java/com/subsidy/service/impl/FileDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/FileDictServiceImpl.java @@ -1,13 +1,12 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.subsidy.model.FileDictDO; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.mapper.FileDictMapper; -import com.subsidy.model.VodDictDO; +import com.subsidy.model.FileDictDO; import com.subsidy.service.FileDictService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; -import com.subsidy.vo.vod.GetContendVodsVO; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import java.util.List; @@ -24,10 +23,7 @@ import java.util.List; public class FileDictServiceImpl extends ServiceImpl implements FileDictService { public List getContendFiles(FileDictDO fileDictDO) { - return this.baseMapper.selectList(new QueryWrapper() - .lambda() - .eq(FileDictDO::getContentId,fileDictDO.getContentId()) - .like(FileDictDO::getFileName,fileDictDO.getFileName())); + return this.baseMapper.selectFiles(fileDictDO.getContentId(),fileDictDO.getFileName()); } public String deleteFile(FileDictDO fileDictDO) { diff --git a/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java new file mode 100644 index 0000000..d5a85c3 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java @@ -0,0 +1,31 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.model.ImageCheckRecordDO; +import com.subsidy.mapper.ImageCheckRecordMapper; +import com.subsidy.service.ImageCheckRecordService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 实名验证记录表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-07-14 + */ +@Service +public class ImageCheckRecordServiceImpl extends ServiceImpl implements ImageCheckRecordService { + + public List getImageCheckHistory(ImageCheckRecordDO imageCheckRecordDO){ + return this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(ImageCheckRecordDO::getClassId,imageCheckRecordDO.getClassId()) + .eq(ImageCheckRecordDO::getMemberId,imageCheckRecordDO.getMemberId()) + .orderByDesc(ImageCheckRecordDO::getCreateDate)); + } + +} diff --git a/src/main/java/com/subsidy/service/impl/JobDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/JobDictServiceImpl.java new file mode 100644 index 0000000..a7686de --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/JobDictServiceImpl.java @@ -0,0 +1,68 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.model.JobDictDO; +import com.subsidy.mapper.JobDictMapper; +import com.subsidy.service.JobDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.tencentcloudapi.tia.v20180226.models.Job; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 岗位表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-02-10 + */ +@Service +public class JobDictServiceImpl extends ServiceImpl implements JobDictService { + + public List queryJobs(JobDictDO jobDictDO) { + + if (null!=jobDictDO.getCompanyId()){ + return this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(JobDictDO::getCompanyId,jobDictDO.getCompanyId()) + .orderByDesc(JobDictDO::getCreateDate)); + }else { + return this.baseMapper.selectList(new QueryWrapper() + .lambda() + .isNull(JobDictDO::getCompanyId) + .orderByDesc(JobDictDO::getCreateDate)); + } + + } + + public String deleteJob(JobDictDO jobDictDO) { + this.baseMapper.deleteById(jobDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String addJob(JobDictDO jobDictDO) { + + int orderNo = 0; + List jobDictDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(JobDictDO::getCompanyId, jobDictDO.getCompanyId()) + .orderByDesc(JobDictDO::getOrderNo)); + + if (jobDictDOS.size() > 0) { + orderNo = jobDictDOS.get(0).getOrderNo(); + } + jobDictDO.setOrderNo(orderNo + 1); + this.baseMapper.insert(jobDictDO); + + return ConstantUtils.SUCCESS_SEND_OUT; + } + + public String updateJob(JobDictDO jobDictDO) { + this.baseMapper.updateById(jobDictDO); + return ConstantUtils.SET_SUCCESS; + } + +} diff --git a/src/main/java/com/subsidy/service/impl/JobMemberMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/JobMemberMappingServiceImpl.java new file mode 100644 index 0000000..841f5c8 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/JobMemberMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.JobMemberMappingDO; +import com.subsidy.mapper.JobMemberMappingMapper; +import com.subsidy.service.JobMemberMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 岗位人员表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-02-10 + */ +@Service +public class JobMemberMappingServiceImpl extends ServiceImpl implements JobMemberMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java index 903c1c9..66f430b 100644 --- a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java @@ -1,34 +1,79 @@ package com.subsidy.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.common.configure.QXueYouConfig; import com.subsidy.common.exception.HttpException; import com.subsidy.dto.administer.VerifyCodeDTO; -import com.subsidy.dto.member.AddMemberDTO; -import com.subsidy.dto.member.ContentMemberDTO; -import com.subsidy.dto.member.GetAllDTO; -import com.subsidy.dto.member.StudyHistoryDTO; -import com.subsidy.mapper.*; -import com.subsidy.model.*; +import com.subsidy.dto.member.*; +import com.subsidy.mapper.ClassDictMapper; +import com.subsidy.mapper.ClassHourDictMapper; +import com.subsidy.mapper.ClassMemberMappingMapper; +import com.subsidy.mapper.CompanyDictMapper; +import com.subsidy.mapper.CourseContentMapper; +import com.subsidy.mapper.CourseFieldMappingMapper; +import com.subsidy.mapper.DepartmentDictMapper; +import com.subsidy.mapper.ExerciseDoneResultMapper; +import com.subsidy.mapper.FileDictMapper; +import com.subsidy.mapper.JobDictMapper; +import com.subsidy.mapper.JobMemberMappingMapper; +import com.subsidy.mapper.MemberDepartmentMappingMapper; +import com.subsidy.mapper.MemberMapper; +import com.subsidy.mapper.OprMemDictMapper; +import com.subsidy.mapper.PaperDictMapper; +import com.subsidy.mapper.RotationImgDictMapper; +import com.subsidy.mapper.SmsVerifyCodeMapper; +import com.subsidy.mapper.VodDictMapper; +import com.subsidy.mapper.VodPlayHistoryMapper; +import com.subsidy.model.ClassDictDO; +import com.subsidy.model.ClassHourDictDO; +import com.subsidy.model.ClassMemberMappingDO; +import com.subsidy.model.CompanyDictDO; +import com.subsidy.model.CourseContentDO; +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.model.FieldDictDO; +import com.subsidy.model.FileDictDO; +import com.subsidy.model.JobDictDO; +import com.subsidy.model.JobMemberMappingDO; +import com.subsidy.model.MemberDO; +import com.subsidy.model.MemberDepartmentMappingDO; +import com.subsidy.model.OprMemDictDO; +import com.subsidy.model.RotationImgDictDO; +import com.subsidy.model.SmsVerifyCodeDO; +import com.subsidy.model.VodDictDO; import com.subsidy.service.MemberService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.subsidy.util.ConstantUtils; -import com.subsidy.util.MathUtil; +import com.subsidy.util.*; +//import com.subsidy.util.RedisUtil; import com.subsidy.vo.administer.UserRoleVO; import com.subsidy.vo.member.*; -import com.subsidy.vo.vod.StudyHistoryVO; +import com.subsidy.vo.paper.QueryPapersVO; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.client.methods.RequestBuilder; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.AsyncResult; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.lang.reflect.Member; import java.time.Duration; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; /** *

@@ -42,67 +87,101 @@ import java.util.List; public class MemberServiceImpl extends ServiceImpl implements MemberService { @Autowired - private SmsVerifyCodeMapper smsVerifyCodeMapper; - - @Autowired private CourseContentMapper courseContentMapper; @Autowired private VodPlayHistoryMapper vodPlayHistoryMapper; @Autowired - private CourseDictMapper courseDictMapper; + private FileDictMapper fileDictMapper; @Autowired - private VodDictMapper vodDictMapper; + private ExerciseDoneResultMapper exerciseDoneResultMapper; @Autowired - private FileDictMapper fileDictMapper; + private ClassMemberMappingMapper classMemberMappingMapper; @Autowired - private ExerciseDoneResultMapper exerciseDoneResultMapper; + private PaperDictMapper paperDictMapper; @Autowired - private ExerciseDictMapper exerciseDictMapper; + private ClassDictMapper classDictMapper; @Autowired - private DepartmentDictMapper departmentDictMapper; + private MemberDepartmentMappingMapper memberDepartmentMappingMapper; @Autowired - private ClassMemberMappingMapper classMemberMappingMapper; + private RedisUtil redisUtil; @Autowired - private ClassDictMapper classDictMapper; + private CourseFieldMappingMapper courseFieldMappingMapper; @Autowired private CompanyDictMapper companyDictMapper; @Autowired - private MemberDepartmentMappingMapper memberDepartmentMappingMapper; + private OprMemDictMapper oprMemDictMapper; + + @Autowired + private JobDictMapper jobDictMapper; + + @Autowired + private JobMemberMappingMapper jobMemberMappingMapper; + + @Autowired + private DepartmentDictMapper departmentDictMapper; + + @Autowired + private RotationImgDictMapper rotationImgDictMapper; + + @Autowired + private VodDictMapper vodDictMapper; + + @Autowired + private SmsVerifyCodeMapper smsVerifyCodeMapper; + + @Autowired + private ClassHourDictMapper classHourDictMapper; + + @Autowired + private QXueYouConfig qXueYouConfig; public IPage getAll(GetAllDTO getAllDTO) { Page pager = new Page(getAllDTO.getPageNum(), getAllDTO.getPageSize()); - IPage iPage = this.baseMapper.getMembers(pager, getAllDTO.getDepartmentId(), getAllDTO.getUserName(), getAllDTO.getStatus()); + + DepartmentDictDO departmentDictDO = departmentDictMapper.selectById(getAllDTO.getDepartmentId()); + + IPage iPage = null; + + if (null != departmentDictDO.getParentId()) { + iPage = this.baseMapper.getMembers(pager, getAllDTO.getDepartmentId(), getAllDTO.getUserName(), getAllDTO.getStatus(), getAllDTO.getStartDate(), getAllDTO.getEndDate()); + } else { + iPage = this.baseMapper.getCompanyMember(pager, departmentDictDO.getCompanyId(), getAllDTO.getUserName(), getAllDTO.getStatus(), getAllDTO.getStartDate(), getAllDTO.getEndDate()); + } List getAllVOS = iPage.getRecords(); for (GetAllVO getAllVO : getAllVOS) { + //获取这个人所在的部门 List departmentDictDOS = this.baseMapper.getDepartments(getAllVO.getId()); getAllVO.setDepartmentDictDOS(departmentDictDOS); + + //获取这个人所在的岗位 + List jobDictDOS = jobDictMapper.queryMemberJobs(getAllVO.getId()); + getAllVO.setJobDictDOS(jobDictDOS); } return iPage; } + @Transactional(rollbackFor = Exception.class) public String deleteMember(MemberDO memberDO) { - this.baseMapper.deleteById(memberDO.getId()); + this.baseMapper.deleteById(memberDO.getId()); classMemberMappingMapper.delete(new QueryWrapper() - .lambda() - .eq(ClassMemberMappingDO::getMemberId,memberDO.getId())); - + .lambda() + .eq(ClassMemberMappingDO::getMemberId, memberDO.getId())); memberDepartmentMappingMapper.delete(new QueryWrapper() - .lambda() - .eq(MemberDepartmentMappingDO::getMemberId,memberDO.getId())); - + .lambda() + .eq(MemberDepartmentMappingDO::getMemberId, memberDO.getId())); return ConstantUtils.DELETE_SUCCESS; } @@ -118,7 +197,8 @@ public class MemberServiceImpl extends ServiceImpl imple Integer count1 = this.baseMapper.selectCount(new QueryWrapper() .lambda() - .eq(MemberDO::getAccountName, addMemberDTO.getAccountName())); + .eq(MemberDO::getAccountName, addMemberDTO.getAccountName()) + .eq(MemberDO::getCompanyId, addMemberDTO.getCompanyId())); if (count1 > 0) { throw new HttpException(20002); @@ -128,15 +208,38 @@ public class MemberServiceImpl extends ServiceImpl imple BeanUtils.copyProperties(addMemberDTO, memberDO); memberDO.setPassword("123456"); memberDO.setStatus("启用"); + memberDO.setFirstLogin(0); + //公司赋值 + memberDO.setCompanyId(addMemberDTO.getCompanyId()); this.baseMapper.insert(memberDO); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_COMPANY_MEMBER_PREFIX + memberDO.getCompanyId() + ":" + memberDO.getAccountName(), memberDO); + + if (null != addMemberDTO.getDepartmentIds()) { + //部门 + List longs = addMemberDTO.getDepartmentIds(); - //部门 - List longs = addMemberDTO.getDepartmentIds(); - for (Long lg : longs) { - MemberDepartmentMappingDO memberDepartmentMappingDO = new MemberDepartmentMappingDO(); - memberDepartmentMappingDO.setMemberId(memberDO.getId()); - memberDepartmentMappingDO.setDepartmentId(lg); - memberDepartmentMappingMapper.insert(memberDepartmentMappingDO); + for (Long lg : longs) { + MemberDepartmentMappingDO memberDepartmentMappingDO = new MemberDepartmentMappingDO(); + memberDepartmentMappingDO.setMemberId(memberDO.getId()); + memberDepartmentMappingDO.setDepartmentId(lg); + memberDepartmentMappingMapper.insert(memberDepartmentMappingDO); + } + } + + + if (null != addMemberDTO.getJobIds()) { + jobMemberMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(JobMemberMappingDO::getMemberId, addMemberDTO.getId())); + + //岗位 + List longs = addMemberDTO.getJobIds(); + for (Long lg : longs) { + JobMemberMappingDO jobMemberMappingDO = new JobMemberMappingDO(); + jobMemberMappingDO.setMemberId(memberDO.getId()); + jobMemberMappingDO.setJobId(lg); + jobMemberMappingMapper.insert(jobMemberMappingDO); + } } return ConstantUtils.ADD_SUCCESS; @@ -144,30 +247,32 @@ public class MemberServiceImpl extends ServiceImpl imple public String updateMember(AddMemberDTO addMemberDTO) { - if (null!= addMemberDTO.getDepartmentIds()){ - Integer count = this.baseMapper.selectCount(new QueryWrapper() - .lambda() - .eq(MemberDO::getTelephone, addMemberDTO.getTelephone()) - .ne(MemberDO::getId, addMemberDTO.getId())); + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(MemberDO::getTelephone, addMemberDTO.getTelephone()) + .ne(MemberDO::getId, addMemberDTO.getId())); - if (count > 0) { - throw new HttpException(20002); - } - Integer count1 = this.baseMapper.selectCount(new QueryWrapper() - .lambda() - .eq(MemberDO::getAccountName, addMemberDTO.getAccountName()) - .ne(MemberDO::getId, addMemberDTO.getId())); + if (count > 0) { + throw new HttpException(20002); + } - if (count1 > 0) { - throw new HttpException(20002); - } + Integer count1 = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(MemberDO::getAccountName, addMemberDTO.getAccountName()) + .eq(MemberDO::getCompanyId, addMemberDTO.getCompanyId()) + .ne(MemberDO::getId, addMemberDTO.getId())); + + if (count1 > 0) { + throw new HttpException(20002); } MemberDO memberDO = new MemberDO(); BeanUtils.copyProperties(addMemberDTO, memberDO); this.baseMapper.updateById(memberDO); + //MemberDO memberDO1 = this.baseMapper.selectById(addMemberDTO.getId()); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_COMPANY_MEMBER_PREFIX + memberDO.getCompanyId() + ":" + memberDO.getAccountName(), memberDO1); - if (null != addMemberDTO.getDepartmentIds()){ + if (null != addMemberDTO.getDepartmentIds()) { memberDepartmentMappingMapper.delete(new QueryWrapper() .lambda() .eq(MemberDepartmentMappingDO::getMemberId, addMemberDTO.getId())); @@ -182,211 +287,527 @@ public class MemberServiceImpl extends ServiceImpl imple } } + if (null != addMemberDTO.getJobIds()) { + jobMemberMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(JobMemberMappingDO::getMemberId, addMemberDTO.getId())); + + //岗位 + List longs = addMemberDTO.getJobIds(); + for (Long lg : longs) { + JobMemberMappingDO jobMemberMappingDO = new JobMemberMappingDO(); + jobMemberMappingDO.setMemberId(memberDO.getId()); + jobMemberMappingDO.setJobId(lg); + jobMemberMappingMapper.insert(jobMemberMappingDO); + } + } + return ConstantUtils.SET_SUCCESS; } - @Override @Transactional(rollbackFor = Exception.class) public UserRoleVO login(VerifyCodeDTO verifyCodeDTO) { UserRoleVO userRoleVO = new UserRoleVO(); - MemberDO userRoleDO = this.baseMapper.selectOne(new QueryWrapper() + + //先从redis里拿 还得从数据库先查公司。。还是直接查人快 + MemberDO memberDO = this.baseMapper.selectOne(new QueryWrapper() .lambda() .eq(MemberDO::getTelephone, verifyCodeDTO.getTelephone())); - if (userRoleDO == null) { + if (memberDO == null) { throw new HttpException(10010); } - if ("冻结".equals(userRoleDO.getStatus())){ + CompanyDictDO companyDictDO = companyDictMapper.selectById(memberDO.getCompanyId()); + + if ("冻结".equals(memberDO.getStatus())) { + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setResult(0); + //oprMemDictDO.setUserName(memberDO.getUserName()); + //oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprMemDictDO.setCompanyId(companyDictDO.getId()); + //oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); + //mongoTemplate.insert(oprMemDictDO); + oprMemDictMapper.insert(oprMemDictDO); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_MEMBER_LOGIN_PREFIX + memberDO.getId() + ":" + memberDO.getUserName() + ":" + companyDictDO.getCompanyName() + ":" + LocalDateTime.now(), oprMemDictDO); throw new HttpException(10013); } - BeanUtils.copyProperties(userRoleDO, userRoleVO); + //是否登陆过 1:是 0:否 + if (0 == memberDO.getFirstLogin()) { + memberDO.setFirstLogin(1); + this.baseMapper.updateById(memberDO); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_COMPANY_MEMBER_PREFIX + memberDO.getCompanyId() + ":" + memberDO.getAccountName(), memberDO); + } + BeanUtils.copyProperties(memberDO, userRoleVO); + //String code = redisUtil.get(RedisPrefixConstant.SUBSIDY_TELEPHONE_PREFIX + verifyCodeDTO.getTelephone()).toString(); SmsVerifyCodeDO smsCodeDO = smsVerifyCodeMapper.selectOne(new QueryWrapper() .lambda() .eq(SmsVerifyCodeDO::getTelephone, verifyCodeDTO.getTelephone()) - .eq(SmsVerifyCodeDO::getVerifyCode, verifyCodeDTO.getVerifyCode())); - if (smsCodeDO == null) { + .eq(SmsVerifyCodeDO::getVerifyCode, verifyCodeDTO.getVerifyCode()) + .gt(SmsVerifyCodeDO::getCreateDate, LocalDateTime.now().minusMinutes(30L))); + + if (null == smsCodeDO || !verifyCodeDTO.getVerifyCode().equals(smsCodeDO.getVerifyCode())) { + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setResult(0); + //oprMemDictDO.setUserName(memberDO.getUserName()); + //oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprMemDictDO.setCompanyId(companyDictDO.getId()); + //oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); + //mongoTemplate.insert(oprMemDictDO); + oprMemDictMapper.insert(oprMemDictDO); throw new HttpException(70010); } + //审计日志 + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + //oprMemDictDO.setUserName(memberDO.getUserName()); + oprMemDictDO.setResult(1); + //oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprMemDictDO.setCompanyId(companyDictDO.getId()); + //oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); + oprMemDictMapper.insert(oprMemDictDO); + //mongoTemplate.insert(oprMemDictDO); + userRoleVO.setCompanyId(companyDictDO.getId()); + userRoleVO.setSuperviseName(companyDictDO.getSuperviseName()); + userRoleVO.setCompanyName(companyDictDO.getCompanyName()); + userRoleVO.setLogo(companyDictDO.getLogo()); + userRoleVO.setQxyStatus(companyDictDO.getQxyStatus()); + List rotationImgDictDOS = rotationImgDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(RotationImgDictDO::getCompanyId, companyDictDO.getId())); + userRoleVO.setRotationImgDictDOS(rotationImgDictDOS); + + String token = JwtUtil.generateToken(memberDO.getId(), ConstantUtils.MOBILE_TERMINATE); + //redisUtil.set(ConstantUtils.MOBILE_TERMINATE + "_" + memberDO.getId(), token); + Localstorage.setUser(memberDO); + userRoleVO.setToken(token); return userRoleVO; } - public UserRoleVO passwordLogin(MemberDO memberDO) { + public MemberVO passwordLogin(PasswordLoginDTO passwordLoginDTO) { + /** + * 先从redis里查 + */ + //MemberDO memberDO = (MemberDO) redisUtil.get(RedisPrefixConstant.SUBSIDY_COMPANY_MEMBER_PREFIX + passwordLoginDTO.getCompanyId() + ":" + passwordLoginDTO.getAccountName()); + MemberDO memberDO = null; + if (null == memberDO) { + /** + * redis里没有,从数据库里查 + */ + memberDO = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(MemberDO::getCompanyId, passwordLoginDTO.getCompanyId()) + .eq(MemberDO::getAccountName, passwordLoginDTO.getAccountName())); + if (memberDO == null) { + throw new HttpException(10017); + } + } + + CompanyDictDO companyDictDO = companyDictMapper.selectById(memberDO.getCompanyId()); + if (memberDO.getPassword().equals(passwordLoginDTO.getPassword()) && 1 == memberDO.getFirstLogin() && !"冻结".equals(memberDO.getStatus())) { + MemberVO memberVO = new MemberVO(); + BeanUtils.copyProperties(memberDO, memberVO); + memberVO.setCompanyId(companyDictDO.getId()); + memberVO.setCompanyName(companyDictDO.getCompanyName()); + memberVO.setQxyStatus(companyDictDO.getQxyStatus()); + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setResult(1); + //oprMemDictDO.setUserName(memberDO.getUserName()); + //oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprMemDictDO.setCompanyId(companyDictDO.getId()); + //oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); + //mongoTemplate.insert(oprMemDictDO); + oprMemDictMapper.insert(oprMemDictDO); + memberVO.setCompanyId(companyDictDO.getId()); + memberVO.setSuperviseName(companyDictDO.getSuperviseName()); + memberVO.setCompanyName(companyDictDO.getCompanyName()); + memberVO.setLogo(companyDictDO.getLogo()); + List rotationImgDictDOS = rotationImgDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(RotationImgDictDO::getCompanyId, companyDictDO.getId())); + memberVO.setRotationImgDictDOS(rotationImgDictDOS); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_COMPANY_MEMBER_PREFIX + passwordLoginDTO.getCompanyId() + ":" + passwordLoginDTO.getAccountName(), memberDO); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_MEMBER_LOGIN_PREFIX + memberDO.getId() + ":" + System.currentTimeMillis(), 1); + + String token = JwtUtil.generateToken(memberDO.getId(), ConstantUtils.MOBILE_TERMINATE); + //redisUtil.set(ConstantUtils.MOBILE_TERMINATE + "_" + memberDO.getId(), token); + Localstorage.setUser(memberDO); + memberVO.setToken(token); + return memberVO; + } else { + if (!memberDO.getPassword().equals(passwordLoginDTO.getPassword())) { + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setResult(0); + //oprMemDictDO.setUserName(memberDO.getUserName()); + //oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); + //oprMemDictDO.setCompanyId(companyDictDO.getId()); + //mongoTemplate.insert(oprMemDictDO); + oprMemDictMapper.insert(oprMemDictDO); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_MEMBER_LOGIN_PREFIX + memberDO.getId() + ":" + System.currentTimeMillis(), oprMemDictDO); + throw new HttpException(10016); + } + + if (0 == memberDO.getFirstLogin()) { + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setResult(0); + //oprMemDictDO.setUserName(memberDO.getUserName()); + //oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); + //oprMemDictDO.setCompanyId(companyDictDO.getId()); + //mongoTemplate.insert(oprMemDictDO); + oprMemDictMapper.insert(oprMemDictDO); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_MEMBER_LOGIN_PREFIX + memberDO.getId() + ":" + System.currentTimeMillis(), 0); + throw new HttpException(10015); + } + + if ("冻结".equals(memberDO.getStatus())) { + throw new HttpException(10014); + } + } + return null; + } + + // 9a79cda9ef6f4a52a8 +// 552a4147db2d4026bc4e9021acd614f8 + public static void main(String[] args) { + String uuid = UUID.randomUUID().toString().replace("-", ""); + System.out.println(uuid); + } + + public UserRoleVO qingxuetangLogin(QingxuetangLoginDTO qingxuetangLoginDTO) { + UserRoleVO userRoleVO = new UserRoleVO(); - MemberDO memberDO1 = this.baseMapper.selectOne(new QueryWrapper() + + /** + * 轻学堂秘钥 + * appId:b8fc3013c8ce409c90 + * appSecret:90876d91b3b7426c9184437a09358787 + */ + MemberDO memberDO = this.baseMapper.selectOne(new QueryWrapper() .lambda() - .eq(MemberDO::getPassword, memberDO.getPassword()) - .eq(MemberDO::getAccountName, memberDO.getAccountName())); - if (memberDO1 == null) { - throw new HttpException(10004); + .eq(MemberDO::getTelephone, qingxuetangLoginDTO.getMobile())); + + if (memberDO == null) { + throw new HttpException(10010); + } + + /** + * 时间戳有没有过期 + */ + if (qingxuetangLoginDTO.getTimestamp() - System.currentTimeMillis() >= 5 * 60 * 1000 || System.currentTimeMillis() - qingxuetangLoginDTO.getTimestamp() >= 5 * 60 * 1000) { + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setResult(0); + oprMemDictMapper.insert(oprMemDictDO); + throw new HttpException(14002); } - if ("冻结".equals(memberDO1.getStatus())){ - throw new HttpException(10014); + //鉴权逻辑 对不对 + String preAuthen = ""; + + if (!StringUtils.isEmpty(qingxuetangLoginDTO.getNickname())) { + preAuthen = "appId=b8fc3013c8ce409c90&authCorpId=" + qingxuetangLoginDTO.getAuthCorpId() + + "&authCorpName=" + qingxuetangLoginDTO.getAuthCorpName() + + "&mobile=" + qingxuetangLoginDTO.getMobile() + + "&nickname=" + qingxuetangLoginDTO.getNickname() + + "&openId=" + qingxuetangLoginDTO.getOpenId() + + "×tamp=" + qingxuetangLoginDTO.getTimestamp() + + "&appSecret=90876d91b3b7426c9184437a09358787"; + } else { + preAuthen = "appId=b8fc3013c8ce409c90&authCorpId=" + qingxuetangLoginDTO.getAuthCorpId() + + "&authCorpName=" + qingxuetangLoginDTO.getAuthCorpName() + + "&mobile=" + qingxuetangLoginDTO.getMobile() + + "&openId=" + qingxuetangLoginDTO.getOpenId() + + "×tamp=" + qingxuetangLoginDTO.getTimestamp() + + "&appSecret=90876d91b3b7426c9184437a09358787"; + } + + String result = SecretUtils.getMD5String(preAuthen); + if (!qingxuetangLoginDTO.getSign().equals(result)) { + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setResult(0); + oprMemDictMapper.insert(oprMemDictDO); + throw new HttpException(14001); + } + + CompanyDictDO companyDictDO = companyDictMapper.selectById(memberDO.getCompanyId()); + + if ("冻结".equals(memberDO.getStatus())) { + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setResult(0); + oprMemDictMapper.insert(oprMemDictDO); + throw new HttpException(10013); } - BeanUtils.copyProperties(memberDO1, userRoleVO); +// //是否登陆过 1:是 0:否 +// if (0 == memberDO.getFirstLogin()) { +// OprMemDictDO oprMemDictDO = new OprMemDictDO(); +// oprMemDictDO.setUserId(memberDO.getId()); +// oprMemDictDO.setOprType("登录"); +// oprMemDictDO.setResult(0); +// oprMemDictMapper.insert(oprMemDictDO); +// throw new HttpException(10015); +// } + BeanUtils.copyProperties(memberDO, userRoleVO); + + //审计日志 + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setResult(1); + oprMemDictMapper.insert(oprMemDictDO); + userRoleVO.setCompanyId(companyDictDO.getId()); + userRoleVO.setSuperviseName(companyDictDO.getSuperviseName()); + userRoleVO.setCompanyName(companyDictDO.getCompanyName()); + userRoleVO.setLogo(companyDictDO.getLogo()); + userRoleVO.setQxyStatus(companyDictDO.getQxyStatus()); + List rotationImgDictDOS = rotationImgDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(RotationImgDictDO::getCompanyId, companyDictDO.getId())); + userRoleVO.setRotationImgDictDOS(rotationImgDictDOS); + String token = JwtUtil.generateToken(memberDO.getId(), ConstantUtils.MOBILE_TERMINATE); + redisUtil.set(ConstantUtils.MOBILE_TERMINATE + "_" + memberDO.getId(), token); + userRoleVO.setToken(token); return userRoleVO; } - public String updatePassword(MemberDO memberDO) { - this.baseMapper.updateById(memberDO); - return ConstantUtils.SET_SUCCESS; + public UserRoleVO kunchiLogin(QingxuetangLoginDTO qingxuetangLoginDTO) { + + UserRoleVO userRoleVO = new UserRoleVO(); + +// appId:9a79cda9ef6f4a52a8 +// appSecret:552a4147db2d4026bc4e9021acd614f8 + MemberDO memberDO = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(MemberDO::getTelephone, qingxuetangLoginDTO.getMobile())); + + if (memberDO == null) { + throw new HttpException(10010); + } + + /** + * 时间戳有没有过期 + */ + if (qingxuetangLoginDTO.getTimestamp() - System.currentTimeMillis() >= 5 * 60 * 1000 || System.currentTimeMillis() - qingxuetangLoginDTO.getTimestamp() >= 5 * 60 * 1000) { + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setResult(0); + oprMemDictMapper.insert(oprMemDictDO); + throw new HttpException(14002); + } + + //鉴权逻辑 对不对 + String preAuthen = "appId=9a79cda9ef6f4a52a8" + + "&authCorpName=" + qingxuetangLoginDTO.getAuthCorpName() + + "&mobile=" + qingxuetangLoginDTO.getMobile() + + "&nickname=" + qingxuetangLoginDTO.getNickname() + + "×tamp=" + qingxuetangLoginDTO.getTimestamp() + + "&appSecret=552a4147db2d4026bc4e9021acd614f8"; + + String result = SecretUtils.getMD5String(preAuthen); + if (!qingxuetangLoginDTO.getSign().equals(result)) { + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setResult(0); + oprMemDictMapper.insert(oprMemDictDO); + throw new HttpException(14001); + } + + CompanyDictDO companyDictDO = companyDictMapper.selectById(memberDO.getCompanyId()); + + if ("冻结".equals(memberDO.getStatus())) { + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setResult(0); + oprMemDictMapper.insert(oprMemDictDO); + throw new HttpException(10013); + } + +// //是否登陆过 1:是 0:否 +// if (0 == memberDO.getFirstLogin()) { +// OprMemDictDO oprMemDictDO = new OprMemDictDO(); +// oprMemDictDO.setUserId(memberDO.getId()); +// oprMemDictDO.setOprType("登录"); +// oprMemDictDO.setResult(0); +// oprMemDictMapper.insert(oprMemDictDO); +// throw new HttpException(10015); +// } + BeanUtils.copyProperties(memberDO, userRoleVO); + + //审计日志 + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(memberDO.getId()); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setResult(1); + oprMemDictMapper.insert(oprMemDictDO); + userRoleVO.setCompanyId(companyDictDO.getId()); + userRoleVO.setSuperviseName(companyDictDO.getSuperviseName()); + userRoleVO.setCompanyName(companyDictDO.getCompanyName()); + userRoleVO.setLogo(companyDictDO.getLogo()); + userRoleVO.setQxyStatus(companyDictDO.getQxyStatus()); + List rotationImgDictDOS = rotationImgDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(RotationImgDictDO::getCompanyId, companyDictDO.getId())); + userRoleVO.setRotationImgDictDOS(rotationImgDictDOS); + String token = JwtUtil.generateToken(memberDO.getId(), ConstantUtils.MOBILE_TERMINATE); + redisUtil.set(ConstantUtils.MOBILE_TERMINATE + "_" + memberDO.getId(), token); + userRoleVO.setToken(token); + return userRoleVO; } - public MemberStudyPageVO studyPage(MemberDO memberDO) { + public CheckStatusVO checkStatus(MemberDO memberDO) { - MemberStudyPageVO memberStudyPageVO = new MemberStudyPageVO(); + CheckStatusVO checkStatusVO = new CheckStatusVO(); + MemberDO memberDO1 = this.baseMapper.selectById(memberDO.getId()); - List studyPageVOS = this.baseMapper.studyPage(memberDO); + if (StringUtils.isEmpty(memberDO1.getCheckImage())) { + checkStatusVO.setImageStatus(false); + } else { + checkStatusVO.setImageStatus(true); + } - for (StudyPageVO studyPageVO : studyPageVOS) { + if (memberDO1.getFirstLogin() == 1) { + checkStatusVO.setSMSStatus(true); + } else { + checkStatusVO.setSMSStatus(false); + } - //查看课程下有几节课 - List vodDictDOS = courseContentMapper.getCourseVods(studyPageVO.getId()); - studyPageVO.setTotalVods(vodDictDOS.size()); + return checkStatusVO; + } - int i = 0; + public String updatePassword(MemberDO memberDO) { + this.baseMapper.updateById(memberDO); + //MemberDO memberDO1 = this.baseMapper.selectById(memberDO.getId()); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_COMPANY_MEMBER_PREFIX + memberDO1.getCompanyId() + ":" + memberDO.getAccountName(), memberDO); + return ConstantUtils.SET_SUCCESS; + } - //该成员完成了几个视频 - for (VodDictDO vodDictDO : vodDictDOS) { - List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() - .lambda() - .eq(VodPlayHistoryDO::getMemberId, memberDO.getId()) - .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) - .orderByDesc(VodPlayHistoryDO::getPlayRecord)); + public String updateCheckImage(MemberDO memberDO) { + memberDO.setCheckTime(LocalDateTime.now()); + this.baseMapper.updateById(memberDO); + return ConstantUtils.SET_SUCCESS; + } - if (vodPlayHistoryDOS.size() > 0) { - if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) { - i++; - } - } - } - studyPageVO.setDoneVods(i); + public String removeCheckImage(MemberDO memberDO) { + this.baseMapper.removeCheckImage(memberDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } - //该班级课程下有多少人 - List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() - .lambda() - .eq(ClassMemberMappingDO::getClassId, studyPageVO.getClassId())); - studyPageVO.setTotalMember(classMemberMappingDOS.size()); - - //多少人完成 - //int completedCnt = 0; - //for (ClassMemberMappingDO cmmd : classMemberMappingDOS) { - // - // Boolean flag = true; - // - // for (VodDictDO vodDictDO : vodDictDOS) { - // List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() - // .lambda() - // .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) - // .eq(VodPlayHistoryDO::getMemberId, cmmd.getMemberId()) - // .orderByDesc(VodPlayHistoryDO::getPlayRecord)); - // if (vodPlayHistoryDOS.size() > 0) { - // if (vodPlayHistoryDOS.get(0).getPlayRecord() < vodDictDO.getVodLength()) { - // flag = false; - // //break; - // } - // } else { - // flag = false; - // } - // } - // if (flag) { - // completedCnt++; - // } - //} - //studyPageVO.setDoneMember(completedCnt); - } - - memberStudyPageVO.setStudyPageVOS(studyPageVOS); - - List departmentDictDOS = this.baseMapper.getDepartments(memberDO.getId()); - - if (departmentDictDOS.size() > 0) { - CompanyDictDO companyDictDO = companyDictMapper.selectById(departmentDictDOS.get(0).getId()); - if (null != companyDictDO) { - BeanUtils.copyProperties(companyDictDO, memberStudyPageVO); - } + public List myCourses(MyCoursesDTO myCoursesDTO) { + List myCoursesVOS = this.baseMapper.myCourses(myCoursesDTO.getMemberId(), myCoursesDTO.getStatus()); + for (MyCoursesVO myCoursesVO : myCoursesVOS) { + List fieldDictDOS = courseFieldMappingMapper.courseFields(myCoursesVO.getCourseId()); + myCoursesVO.setFieldDictDOS(fieldDictDOS); } - return memberStudyPageVO; + return myCoursesVOS; } public ContentVodNewVO contentVod(ContentMemberDTO contentVodDTO) { ContentVodNewVO contentVodNewVO = new ContentVodNewVO(); + //课程详细信息 + ClassDictDO classDictDO = classDictMapper.selectById(contentVodDTO.getClassId()); + contentVodNewVO.setIsFastPlay(classDictDO.getIsFastPlay()); + contentVodNewVO.setIsOrder(classDictDO.getIsOrder()); + contentVodNewVO.setTestRule(classDictDO.getTestRule()); + + List contentVodVOS = new ArrayList<>(); List courseContentDOS = courseContentMapper.selectList(new QueryWrapper() .lambda() .eq(CourseContentDO::getCourseId, contentVodDTO.getCourseId()) .orderByAsc(CourseContentDO::getOrderNo)); + ClassDictDO classDictDO1 = classDictMapper.selectById(contentVodDTO.getClassId()); + + //目录状态 + Boolean contentStatus = true; + for (CourseContentDO courseContentDO : courseContentDOS) { ContentVodVO contentVodVO = new ContentVodVO(); contentVodVO.setContent(courseContentDO.getContent()); - List memberVodVOS = new ArrayList<>(); + List memberVodVOS = courseContentMapper.contentVodProcess(courseContentDO.getId(), contentVodDTO.getMemberId(), contentVodDTO.getClassId()); - //目录下的视频 - List vodDictDOS = vodDictMapper.selectList(new QueryWrapper() - .lambda() - .eq(VodDictDO::getContentId, courseContentDO.getId())); - for (VodDictDO vodDictDO : vodDictDOS) { - MemberVodVO memberVodVO = new MemberVodVO(); - List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() - .lambda() - .eq(VodPlayHistoryDO::getMemberId, contentVodDTO.getMemberId()) - .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) - .orderByDesc(VodPlayHistoryDO::getPlayRecord)); - - memberVodVO.setStatus(false); - if (vodPlayHistoryDOS.size() > 0) { - int length = MathUtil.intDivCeil(100 * vodPlayHistoryDOS.get(0).getPlayRecord(), vodDictDO.getVodLength()); - if (length>=100){ - memberVodVO.setPercent(100); - }else { - memberVodVO.setPercent(length); - } - if (memberVodVO.getPercent() >= 80) { + Boolean flag = false; + int i = 0; + + if (1 == classDictDO1.getIsOrder()) { + for (MemberVodVO memberVodVO : memberVodVOS) { + + if (i == 0 && contentStatus) { + //第一个视频默认打开 + memberVodVO.setStatus(true); + } else if (memberVodVO.getPercent().equals("100")) { + //这个视频看完了,已解锁 memberVodVO.setStatus(true); + } else { + //这个视频没看完,未解锁 + if (!flag) { + //这个视频可见 ===> 第一个没看完但可以看的视频 + memberVodVO.setStatus(true); + flag = true; + } else { + memberVodVO.setStatus(false); + } + contentStatus = false; } - } else { - memberVodVO.setPercent(0); + + i++; } - List vodPlayHistoryDOS1 = vodPlayHistoryMapper.selectList(new QueryWrapper() - .lambda() - .eq(VodPlayHistoryDO::getMemberId, contentVodDTO.getMemberId()) - .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) - .orderByDesc(VodPlayHistoryDO::getCreateDate)); - if (vodPlayHistoryDOS1.size() > 0) { - memberVodVO.setPlayRecord(vodPlayHistoryDOS1.get(0).getPlayRecord()); + } else { + for (MemberVodVO memberVodVO : memberVodVOS) { + memberVodVO.setStatus(true); } - memberVodVO.setId(vodDictDO.getId()); - memberVodVO.setVodUrl(vodDictDO.getVodUrl()); - memberVodVO.setTeacherName(vodDictDO.getTeacherName()); - memberVodVO.setVodLength(vodDictDO.getVodLength()); - memberVodVO.setVodName(vodDictDO.getVodName()); - memberVodVOS.add(memberVodVO); } + + int playCount = 0; + for (MemberVodVO memberVodVO : memberVodVOS) { + if ("100".equals(memberVodVO.getPercent())) { + playCount++; + } + } + + contentVodVO.setPlayVods(playCount); contentVodVO.setMemberVodVOS(memberVodVOS); + contentVodVO.setTotalVods(memberVodVOS.size()); contentVodVOS.add(contentVodVO); } - contentVodNewVO.setContentVodVOS(contentVodVOS); - List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() - .lambda() - .eq(VodPlayHistoryDO::getClassId,contentVodDTO.getClassId()) - .eq(VodPlayHistoryDO::getMemberId,contentVodDTO.getMemberId()) - .orderByDesc(VodPlayHistoryDO::getCreateDate)); - if (vodPlayHistoryDOS.size()>0){ - VodPlayHistoryDO vodPlayHistoryDO = vodPlayHistoryDOS.get(0); - VodDictDO vodDictDO = vodDictMapper.selectById(vodPlayHistoryDO.getVodId()); - if (null!=vodDictDO){ - BeanUtils.copyProperties(vodDictDO,contentVodNewVO); - contentVodNewVO.setPlayRecord(vodPlayHistoryDO.getPlayRecord()); - } + //最新的视频记录 + List contentVodNewVOS = vodPlayHistoryMapper.memberRecentPlay(contentVodDTO.getClassId(), contentVodDTO.getMemberId()); + if (contentVodNewVOS.size() > 0) { + contentVodNewVO.setId(contentVodNewVOS.get(0).getId()); + contentVodNewVO.setPlayRecord(contentVodNewVOS.get(0).getPlayRecord()); } return contentVodNewVO; } @@ -418,94 +839,59 @@ public class MemberServiceImpl extends ServiceImpl imple public IPage studyHistory(StudyHistoryDTO studyHistoryDTO) { Page pager = new Page(studyHistoryDTO.getPageNum(), studyHistoryDTO.getPageSize()); + return vodPlayHistoryMapper.studyHistory(pager, studyHistoryDTO.getMemberId()); + } - IPage iPage = vodPlayHistoryMapper.studyHistory(pager, studyHistoryDTO.getMemberId()); - - List studyHistoryVOS = iPage.getRecords(); + public List getCourseTest(ContentMemberDTO contentMemberDTO) { - for (StudyHistoryVO studyHistoryVO : studyHistoryVOS) { - if (studyHistoryVO.getPercent() >= 80) { - studyHistoryVO.setStatus(true); + //查看该班级下的测试卷子(有效卷子) + ClassDictDO classDictDO = classDictMapper.selectById(contentMemberDTO.getClassId()); + List queryPapersVOS = paperDictMapper.queryPapers(contentMemberDTO.getCourseId(), null, 1); + for (QueryPapersVO queryPapersVO : queryPapersVOS) { + //多少人已完成 + Integer cnt = paperDictMapper.completeCount(queryPapersVO.getId(), contentMemberDTO.getClassId()); + queryPapersVO.setCompleteCnt(cnt); + //自己成绩 + List exerciseDoneResultDOS = exerciseDoneResultMapper.getMaxScorePaper(queryPapersVO.getId(), contentMemberDTO.getMemberId(), contentMemberDTO.getClassId()); + + if (exerciseDoneResultDOS.size() > 0) { + queryPapersVO.setRightCounts(exerciseDoneResultDOS.get(0).getRightCounts()); + queryPapersVO.setTotalCount(exerciseDoneResultDOS.get(0).getTotalCounts()); + queryPapersVO.setResult(exerciseDoneResultDOS.get(0).getResult()); } else { - studyHistoryVO.setStatus(false); + queryPapersVO.setResult("待完成"); } + //截止时间 + queryPapersVO.setEndDate(classDictDO.getEndDate()); } - iPage.setRecords(studyHistoryVOS); - - return iPage; + return queryPapersVOS; } - public GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO) { - - GetCourseTestVO getCourseTestVO = new GetCourseTestVO(); - - ClassDictDO classDictDO = classDictMapper.selectById(contentMemberDTO.getClassId()); - - CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); - getCourseTestVO.setCourseId(courseDictDO.getId()); - getCourseTestVO.setCourseName(courseDictDO.getCourseName()); - getCourseTestVO.setDeadline(classDictDO.getEndDate()); - - ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper() + public List getPaperDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO) { + return exerciseDoneResultMapper.selectList(new QueryWrapper() .lambda() - .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) - .eq(ExerciseDoneResultDO::getMemberId, contentMemberDTO.getMemberId())); - - if (null != exerciseDoneResultDO) { - getCourseTestVO.setRightCount(String.valueOf(exerciseDoneResultDO.getRightCounts())); - getCourseTestVO.setTotalCount(String.valueOf(exerciseDoneResultDO.getTotalCounts())); - - //正确率 - Integer percent = MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(),exerciseDoneResultDO.getTotalCounts()); - if(percent>=60){ - getCourseTestVO.setResult("合格"); - }else { - getCourseTestVO.setResult("不合格"); - } - getCourseTestVO.setPercent(String.valueOf(percent)); - } else { - getCourseTestVO.setRightCount("-"); - //该课程下有多少习题 - Integer count = exerciseDictMapper.selectCount(new QueryWrapper() - .lambda() - .eq(ExerciseDictDO::getCourseId, courseDictDO.getId())); - getCourseTestVO.setTotalCount(String.valueOf(count)); - getCourseTestVO.setPercent("-"); - getCourseTestVO.setResult("不合格"); - } - return getCourseTestVO; + .eq(ExerciseDoneResultDO::getMemberId, exerciseDoneResultDO.getMemberId()) + .eq(ExerciseDoneResultDO::getPaperId, exerciseDoneResultDO.getPaperId())); } public GetStudyInfoVO getStudyInfo(MemberDO memberDO) { GetStudyInfoVO getStudyInfoVO = new GetStudyInfoVO(); - MemberDO memberDO1 = this.baseMapper.selectById(memberDO.getId()); - - //第几天 - long diff = Duration.between(memberDO1.getCreateDate(),LocalDateTime.now()).toDays(); - getStudyInfoVO.setDiff(diff); - //已学课程 List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() .lambda() .eq(ClassMemberMappingDO::getMemberId, memberDO.getId())); /** - * 遍历课程,里面的视频都看过80% 则表示已学完 + * 遍历课程,累计学习时长超过视频时长 则表示已学完 */ int i = 0; //已学课程 for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { List vodDictDOS = classDictMapper.getClassVods(classMemberMappingDO.getClassId()); for (VodDictDO vodDictDO : vodDictDOS) { - List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() - .lambda() - .eq(VodPlayHistoryDO::getMemberId, memberDO.getId()) - .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) - .orderByDesc(VodPlayHistoryDO::getPlayRecord)); - if (vodPlayHistoryDOS.size() > 0) { - if (vodPlayHistoryDOS.get(0).getPlayRecord() < vodDictDO.getVodLength() * 0.8) { - break; - } + int playLength = vodPlayHistoryMapper.memberVodTotalLength(classMemberMappingDO.getClassId(), memberDO.getId(), vodDictDO.getId()); + if (playLength < vodDictDO.getVodLength()) { + break; } } i++; @@ -513,17 +899,113 @@ public class MemberServiceImpl extends ServiceImpl imple getStudyInfoVO.setStudyCourse(i); //累计学习时长 - int studyLength = 0; - List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + int studyLength = vodPlayHistoryMapper.memberTotalLength(memberDO.getId()); + getStudyInfoVO.setStudyLength(studyLength); + + //第几天 + MemberDO memberDO1 = this.baseMapper.selectById(memberDO.getId()); + long diff = Duration.between(memberDO1.getCreateDate(), LocalDateTime.now()).toDays(); + getStudyInfoVO.setDiff(diff); + + return getStudyInfoVO; + } + + public String checkTimes(ExerciseDoneResultDO exerciseDoneResultDO) { + + MemberDO memberDO = this.baseMapper.selectById(exerciseDoneResultDO.getMemberId()); + ClassHourDictDO classHourDictDO = classHourDictMapper.selectOne(new QueryWrapper() .lambda() - .eq(VodPlayHistoryDO::getMemberId, memberDO.getId())); + .eq(ClassHourDictDO::getCompanyId, memberDO.getCompanyId())); + + if (null != classHourDictDO) { + Integer status = classHourDictDO.getRepeatStatus(); + if (1 == status) { + int cnt = classHourDictDO.getRepeatTime(); + + //查看这个人这个卷子做了几次 + Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getMemberId, exerciseDoneResultDO.getMemberId()) + .eq(ExerciseDoneResultDO::getPaperId, exerciseDoneResultDO.getPaperId())); - for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { - studyLength += vodPlayHistoryDO.getPlayLength(); + if (cnt <= count) { + throw new HttpException(60001); + } + } } - getStudyInfoVO.setStudyLength(studyLength); + return ConstantUtils.CHECK_STATUS; + } - return getStudyInfoVO; + public void importRedis() { + List memberDOS = this.baseMapper.selectList(null); + for (MemberDO memberDO : memberDOS) { + //redisUtil.set(RedisPrefixConstant.SUBSIDY_COMPANY_MEMBER_PREFIX + memberDO.getCompanyId() + ":" + memberDO.getAccountName(), memberDO); + } } + public String changeDepartments(ChangeDepartmentsDTO changeDepartmentsDTO) { + + List memberIds = changeDepartmentsDTO.getMemberIds(); + + //清掉以前的部门 + for (Long lg : memberIds) { + memberDepartmentMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(MemberDepartmentMappingDO::getMemberId, lg)); + } + + //加入新的部门 + List depIds = changeDepartmentsDTO.getDesDepId(); + for (Long lg : memberIds) { + for (Long depId : depIds) { + MemberDepartmentMappingDO memberDepartmentMappingDO = new MemberDepartmentMappingDO(); + memberDepartmentMappingDO.setMemberId(lg); + memberDepartmentMappingDO.setDepartmentId(depId); + memberDepartmentMappingMapper.insert(memberDepartmentMappingDO); + } + } + return ConstantUtils.SET_SUCCESS; + } + + public QxyVO qxy(MemberDO memberDO) { + + CloseableHttpClient client = null; + CloseableHttpResponse response = null; + String resValue = ""; + + long timestamp = System.currentTimeMillis(); + String nonce = SecretUtils.getNonce(5); + String appId = qXueYouConfig.getAppId(); + + String appKey = qXueYouConfig.getSecurityKey(); + String mobile = memberDO.getTelephone(); + String signature = SecretUtils.gen(appKey, nonce, String.valueOf(timestamp), appId, mobile); + try { + client = HttpClients.createDefault(); + HttpUriRequest build = RequestBuilder + .post(qXueYouConfig.getUrl()) + .addHeader("Content-Type", "application/json") + .setEntity(new StringEntity("")) + .addParameter("appId", appId) + .addParameter("mobile", mobile) + .addParameter("timestamp", String.valueOf(timestamp)) + .addParameter("signature", signature) + .addParameter("nonce", nonce) + .build(); + //请求 + response = client.execute(build); + HttpEntity entity = response.getEntity(); + + if (entity != null) { + resValue = EntityUtils.toString(entity, "UTF-8"); + ResultMode resMode = JSON.parseObject(resValue, ResultMode.class); + QxyVO qxyVO = new QxyVO(); + qxyVO.setToken(resMode.getData().toString()); + return qxyVO; + } + } catch (Exception e) { + e.printStackTrace(); + } + return new QxyVO(); + } } diff --git a/src/main/java/com/subsidy/service/impl/MemberStudyLengthServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberStudyLengthServiceImpl.java new file mode 100644 index 0000000..503401b --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/MemberStudyLengthServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.MemberStudyLengthDO; +import com.subsidy.mapper.MemberStudyLengthMapper; +import com.subsidy.service.MemberStudyLengthService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author DengMin + * @since 2022-01-28 + */ +@Service +public class MemberStudyLengthServiceImpl extends ServiceImpl implements MemberStudyLengthService { + +} diff --git a/src/main/java/com/subsidy/service/impl/OprAdmDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/OprAdmDictServiceImpl.java new file mode 100644 index 0000000..f390a04 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/OprAdmDictServiceImpl.java @@ -0,0 +1,58 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.dto.opr.GetHistoryDTO; +import com.subsidy.model.OprAdmDictDO; +import com.subsidy.mapper.OprAdmDictMapper; +import com.subsidy.service.OprAdmDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.vo.opr.GetHistoryVO; +import org.springframework.stereotype.Service; + +/** + *

+ * 审计表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-12-13 + */ +@Service +public class OprAdmDictServiceImpl extends ServiceImpl implements OprAdmDictService { + + + //public PageVO getHistory(GetHistoryDTO getHistoryDTO){ + // + // PageVO pageVO = new PageVO(); + // + // List getHistoryVOS = new ArrayList<>(); + // + // //可累加条件 + // Query query = new Query(Criteria.where("userName").regex(getHistoryDTO.getUserName()) + // .andOperator(Criteria.where("loginDateFormat").gte(getHistoryDTO.getStartDate()), + // Criteria.where("loginDateFormat").lte(getHistoryDTO.getEndDate()))); + // Long count = mongoTemplate.count(query,OprAdmDictDO.class); + // mongoUtil.start(getHistoryDTO.getPageNum(),getHistoryDTO.getPageSize(),query); + // List oprAdmDictDOS = mongoTemplate.find(query,OprAdmDictDO.class); + // for (OprAdmDictDO oprAdmDictDO : oprAdmDictDOS){ + // AdministerDO administerDO = administerMapper.selectById(oprAdmDictDO.getUserId()); + // CompanyDictDO companyDictDO = companyDictMapper.selectById(administerDO.getCompanyId()); + // GetHistoryVO getHistoryVO = new GetHistoryVO(); + // BeanUtils.copyProperties(oprAdmDictDO,getHistoryVO); + // getHistoryVO.setCompanyName(companyDictDO.getCompanyName()); + // getHistoryVO.setUserName(administerDO.getUserName()); + // getHistoryVOS.add(getHistoryVO); + // } + // pageVO.setRecords(getHistoryVOS); + // pageVO.setTotal(count); + // + // return pageVO; + //} + + public IPage getHistory(GetHistoryDTO getHistoryDTO){ + Page pager = new Page(getHistoryDTO.getPageNum(), getHistoryDTO.getPageSize()); + return this.baseMapper.getHistory(pager,getHistoryDTO.getUserName(),getHistoryDTO.getStartDate(),getHistoryDTO.getEndDate()); + } + +} diff --git a/src/main/java/com/subsidy/service/impl/OprMemDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/OprMemDictServiceImpl.java new file mode 100644 index 0000000..2e9fd98 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/OprMemDictServiceImpl.java @@ -0,0 +1,66 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.dto.opr.GetHistoryDTO; +import com.subsidy.mapper.CompanyDictMapper; +import com.subsidy.mapper.MemberMapper; +import com.subsidy.mapper.OprMemDictMapper; +import com.subsidy.model.OprMemDictDO; +import com.subsidy.service.OprMemDictService; +import com.subsidy.vo.opr.GetHistoryVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + *

+ * 审计表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-12-13 + */ +@Service +public class OprMemDictServiceImpl extends ServiceImpl implements OprMemDictService { + + @Autowired + private MemberMapper memberMapper; + + @Autowired + private CompanyDictMapper companyDictMapper; + + //public PageVO getHistory(GetHistoryDTO getHistoryDTO) { + // + // PageVO pageVO = new PageVO(); + // + // List getHistoryVOS = new ArrayList<>(); + // + // //可累加条件 + // Query query = new Query(Criteria.where("userName").regex(getHistoryDTO.getUserName()) + // .andOperator(Criteria.where("loginDateFormat").gte(getHistoryDTO.getStartDate()), + // Criteria.where("loginDateFormat").lte(getHistoryDTO.getEndDate()))); + // Long count = mongoTemplate.count(query, OprMemDictDO.class); + // mongoUtil.start(getHistoryDTO.getPageNum(), getHistoryDTO.getPageSize(), query); + // List oprMemDictDOS = mongoTemplate.find(query, OprMemDictDO.class); + // for (OprMemDictDO oprMemDictDO : oprMemDictDOS) { + // MemberDO memberDO = memberMapper.selectById(oprMemDictDO.getUserId()); + // CompanyDictDO companyDictDO = companyDictMapper.selectById(memberDO.getCompanyId()); + // GetHistoryVO getHistoryVO = new GetHistoryVO(); + // BeanUtils.copyProperties(oprMemDictDO, getHistoryVO); + // getHistoryVO.setCompanyName(companyDictDO.getCompanyName()); + // getHistoryVO.setUserName(memberDO.getUserName()); + // getHistoryVOS.add(getHistoryVO); + // } + // pageVO.setRecords(getHistoryVOS); + // pageVO.setTotal(count); + // + // return pageVO; + //} + + public IPage getHistory(GetHistoryDTO getHistoryDTO){ + Page pager = new Page(getHistoryDTO.getPageNum(), getHistoryDTO.getPageSize()); + return this.baseMapper.getHistory(pager,getHistoryDTO.getUserName(),getHistoryDTO.getStartDate(),getHistoryDTO.getEndDate()); + } + +} diff --git a/src/main/java/com/subsidy/service/impl/PaperDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/PaperDictServiceImpl.java new file mode 100644 index 0000000..83b17a1 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/PaperDictServiceImpl.java @@ -0,0 +1,55 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.exception.HttpException; +import com.subsidy.model.PaperDictDO; +import com.subsidy.mapper.PaperDictMapper; +import com.subsidy.service.PaperDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.paper.QueryPapersVO; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 试卷字典表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-12-03 + */ +@Service +public class PaperDictServiceImpl extends ServiceImpl implements PaperDictService { + + public List queryPapers(PaperDictDO paperDictDO){ + return this.baseMapper.queryPapers(paperDictDO.getCourseId(),paperDictDO.getPaperName(),null); + } + + public String deletePaper(PaperDictDO paperDictDO){ + this.baseMapper.deleteById(paperDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateStatus(PaperDictDO paperDictDO){ + this.baseMapper.updateById(paperDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public String addPaper(PaperDictDO paperDictDO){ + + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(PaperDictDO::getCourseId,paperDictDO.getCourseId()) + .eq(PaperDictDO::getPaperName,paperDictDO.getPaperName())); + + if (count>0){ + throw new HttpException(50001); + } + paperDictDO.setPaperStatus(0); + this.baseMapper.insert(paperDictDO); + return ConstantUtils.ADD_SUCCESS; + } +} diff --git a/src/main/java/com/subsidy/service/impl/RankDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/RankDictServiceImpl.java new file mode 100644 index 0000000..e06df23 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/RankDictServiceImpl.java @@ -0,0 +1,62 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.exception.HttpException; +import com.subsidy.model.RankDictDO; +import com.subsidy.mapper.RankDictMapper; +import com.subsidy.service.RankDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import org.apache.poi.ss.formula.functions.Rank; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 职级字典表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-02-14 + */ +@Service +public class RankDictServiceImpl extends ServiceImpl implements RankDictService { + + public String addRank(RankDictDO rankDictDO) { + + int count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(RankDictDO::getCompanyId, rankDictDO.getCompanyId()) + .eq(RankDictDO::getRank, rankDictDO.getRank())); + if (count > 0) { + throw new HttpException(12001); + } + + this.baseMapper.insert(rankDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteRank(RankDictDO rankDictDO) { + this.baseMapper.deleteById(rankDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateRank(RankDictDO rankDictDO) { + int count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(RankDictDO::getCompanyId, rankDictDO.getCompanyId()) + .eq(RankDictDO::getRank, rankDictDO.getRank()) + .ne(RankDictDO::getId, rankDictDO.getId())); + if (count > 0) { + throw new HttpException(12001); + } + + this.baseMapper.updateById(rankDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public List queryRanks(RankDictDO rankDictDO){ + return this.baseMapper.queryCompanyRanks(rankDictDO.getCompanyId()); + } +} diff --git a/src/main/java/com/subsidy/service/impl/RotationImgDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/RotationImgDictServiceImpl.java new file mode 100644 index 0000000..59ee887 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/RotationImgDictServiceImpl.java @@ -0,0 +1,44 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.model.RotationImgDictDO; +import com.subsidy.mapper.RotationImgDictMapper; +import com.subsidy.service.RotationImgDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 轮播图 服务实现类 + *

+ * + * @author DengMin + * @since 2022-02-23 + */ +@Service +public class RotationImgDictServiceImpl extends ServiceImpl implements RotationImgDictService { + + public String addRotation(RotationImgDictDO rotationImgDictDO) { + this.baseMapper.insert(rotationImgDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteRotation(RotationImgDictDO rotationImgDictDO) { + this.baseMapper.deleteById(rotationImgDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateRotation(RotationImgDictDO rotationImgDictDO) { + this.baseMapper.updateById(rotationImgDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public List getAllRotations(RotationImgDictDO rotationImgDictDO){ + return this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(RotationImgDictDO::getCompanyId,rotationImgDictDO.getCompanyId())); + } +} diff --git a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java index 8459e40..c3e2445 100644 --- a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java @@ -3,25 +3,38 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.dto.member.GetMemberSignInfoDTO; -import com.subsidy.dto.sign.ClassSignInfoDTO; -import com.subsidy.dto.sign.SignInDTO; -import com.subsidy.mapper.*; -import com.subsidy.model.*; +import com.subsidy.dto.sign.DataViewDTO; +import com.subsidy.mapper.AnsweringQuestionMapper; +import com.subsidy.mapper.ClassDictMapper; +import com.subsidy.mapper.ClassMemberMappingMapper; +import com.subsidy.mapper.ExerciseDoneResultMapper; +import com.subsidy.mapper.SignInRecordMapper; +import com.subsidy.mapper.VodPlayHistoryMapper; +import com.subsidy.model.AnsweringQuestionDO; +import com.subsidy.model.ClassDictDO; +import com.subsidy.model.ClassMemberMappingDO; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.model.SignInRecordDO; +import com.subsidy.model.VodDictDO; import com.subsidy.service.SignInRecordService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; -import com.subsidy.util.MathUtil; +import com.subsidy.util.DateFormatUtil; import com.subsidy.vo.member.GetMemberSignInfoVO; -import com.subsidy.vo.sign.ClassSignInfoVO; +import com.subsidy.vo.sign.DataViewVO; import com.subsidy.vo.sign.SignInStatusVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.Date; import java.util.List; +//import com.subsidy.util.RedisUtil; + /** *

* 学生签到表 服务实现类 @@ -37,10 +50,16 @@ public class SignInRecordServiceImpl extends ServiceImpl classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId()); - this.baseMapper.delete(new QueryWrapper() - .lambda() - .eq(SignInRecordDO::getMemberId, signInRecordDO.getMemberId()) - .gt(SignInRecordDO::getSignInDate, LocalDate.now())); - for (ClassDictDO classDictDO : classDictDOS) { - SignInRecordDO signInRecordDO1 = new SignInRecordDO(); - signInRecordDO1.setClassId(classDictDO.getId()); - signInRecordDO1.setMemberId(signInRecordDO.getMemberId()); - signInRecordDO1.setSignInDate(LocalDateTime.now()); - this.baseMapper.insert(signInRecordDO1); + //Set set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + signInRecordDO.getClassId() + ":" + DateFormatUtil.format(signInRecordDO.getSignInDate(), "yyyy-MM-dd")+":*"); + //if(set != null && set.size() > 0) { + // redisUtil.del(set); + //} + //redisUtil.set(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + classDictDO.getId() + ":" + DateFormatUtil.format(new Date(), "yyyy-MM-dd") + ":" + System.currentTimeMillis(), null); + + // 存储到缓存到同时保存到数据库 + SignInRecordDO sign = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, signInRecordDO.getMemberId()) + .eq(SignInRecordDO::getClassId, classDictDO.getId()) + .like(SignInRecordDO::getSignInDate, DateFormatUtil.format(new Date(), "yyyy-MM-dd"))); + if(sign != null) { + this.baseMapper.deleteById(sign.getId()); + } + + signInRecordDO.setClassId(classDictDO.getId()); + signInRecordDO.setSignInDate(LocalDateTime.now()); + signInRecordDO.setCreateDate(LocalDateTime.now()); + this.baseMapper.insert(signInRecordDO); } return ConstantUtils.ADD_SUCCESS; } - public IPage classSignInfo(ClassSignInfoDTO classSignInfoDTO) { + public IPage dataView(DataViewDTO classSignInfoDTO) { Page pager = new Page(classSignInfoDTO.getPageNum(), classSignInfoDTO.getPageSize()); - IPage classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(), classSignInfoDTO.getCompanyId()); - List classSignInfoVOS = classSignInfoVOIPage.getRecords(); + IPage classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(), classSignInfoDTO.getId()); + List dataViewVOS = classSignInfoVOIPage.getRecords(); - for (ClassSignInfoVO classSignInfoVO : classSignInfoVOS) { + for (DataViewVO dataViewVO : dataViewVOS) { //班级人数 List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() .lambda() - .eq(ClassMemberMappingDO::getClassId, classSignInfoVO.getClassId())); + .eq(ClassMemberMappingDO::getClassId, dataViewVO.getClassId())); + dataViewVO.setMemberCount(classMemberMappingDOS.size()); - classSignInfoVO.setMemberCount(classMemberMappingDOS.size()); + //课程由多少个视频 + List vodDictDOS = classDictMapper.getClassVods(dataViewVO.getClassId()); + int signCnt = 0; + int testCnt = 0; + int vodCnt = 0; - //课程总数 - List vodDictDOS = classDictMapper.getClassVods(classSignInfoVO.getClassId()); - classSignInfoVO.setTotalVodCounts(vodDictDOS.size()); + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + //签到 + Integer signCount = signInRecordMapper.selectCount(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, classMemberMappingDO.getMemberId()) + .eq(SignInRecordDO::getClassId, dataViewVO.getClassId())); + if (signCount > 0) { + signCnt++; + } - int totalStudyVods = 0; - int totalStudyLength = 0; - //学生总共学习课时数 - for (VodDictDO vodDictDO : vodDictDOS) { - for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { - List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() - .lambda() - .eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getMemberId()) - .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) - .orderByDesc(VodPlayHistoryDO::getPlayRecord)); - for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { - totalStudyLength += vodPlayHistoryDO.getPlayLength(); - } - if (vodPlayHistoryDOS.size() > 0) { - if (vodPlayHistoryDOS.get(0).getPlayRecord() >= vodDictDO.getVodLength() * 0.8) { - totalStudyVods++; - } + //测试 + int testCount = exerciseDoneResultMapper.selectCount(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getMemberId, classMemberMappingDO.getMemberId()) + .eq(ExerciseDoneResultDO::getClassId, dataViewVO.getClassId())); + if (testCount > 0) { + testCnt++; + } + + //视频 + int i = 0; + for (VodDictDO vodDictDO : vodDictDOS) { + int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classMemberMappingDO.getClassId(),classMemberMappingDO.getMemberId(), vodDictDO.getId()); + if (totalPlayLength >= vodDictDO.getVodLength()) { + i++; } } + if (i == vodDictDOS.size()) { + vodCnt++; + } } - classSignInfoVO.setStudyVodCounts(MathUtil.intDivCeil(totalStudyVods, classMemberMappingDOS.size() )); - //平均完成时长 学生观看课程视频的全部时长/总人数 - int avg = MathUtil.intDivCeil(totalStudyLength, classMemberMappingDOS.size()); - classSignInfoVO.setAvgVodPlayLength(avg); + //签到人数 这个人签到了就算签过了 + dataViewVO.setSignCnt(signCnt); //测试通过率 - List exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper() - .lambda() - .eq(ExerciseDoneResultDO::getClassId, classSignInfoVO.getClassId())); - - int passNum = 0; - - for (ExerciseDoneResultDO exerciseDoneResultDO : exerciseDoneResultDOS) { - if (exerciseDoneResultDO.getRightCounts() > exerciseDoneResultDO.getTotalCounts() * 0.6) { - passNum++; - } - } - classSignInfoVO.setPassRate(MathUtil.intDivFloorPercent(passNum, classMemberMappingDOS.size())); + dataViewVO.setPassCnt(testCnt); - - //平均签到数 向上取整 - //签到总次数 - Integer signCount = this.baseMapper.selectCount(new QueryWrapper() - .lambda() - .eq(SignInRecordDO::getClassId, classSignInfoVO.getClassId())); - classSignInfoVO.setAvgSignCount(MathUtil.intDivCeil(signCount, classMemberMappingDOS.size())); + //视频看完人数 + dataViewVO.setVodCnt(vodCnt); //答疑数 Integer count = answeringQuestionMapper.selectCount(new QueryWrapper() .lambda() - .eq(AnsweringQuestionDO::getClassId, classSignInfoVO.getClassId())); - classSignInfoVO.setAnswerCount(count); + .eq(AnsweringQuestionDO::getClassId, dataViewVO.getClassId())); + dataViewVO.setAnswerCnt(count); } - - classSignInfoVOIPage.setRecords(classSignInfoVOS); + classSignInfoVOIPage.setRecords(dataViewVOS); return classSignInfoVOIPage; } @@ -166,8 +187,19 @@ public class SignInRecordServiceImpl extends ServiceImpl signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() + //.lambda() + //.eq(SignInRecordDO::getMemberId,signInRecordDO.getMemberId()) + //.eq(SignInRecordDO::getClassId)) + //if (size <= count) { + // signInStatusVO.setStatus(false); + //} //获取有效课程 List classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId()); @@ -179,14 +211,46 @@ public class SignInRecordServiceImpl extends ServiceImpl classHourDictDOS = classHourDictMapper.selectList(null); + //for (ClassHourDictDO classHourDictDO : classHourDictDOS) { + // redisUtil.set("subsidySettings:"+ classHourDictDO.getCompanyId(), classHourDictDO); + //} + + //预写学生账号数据 + //List memberDOS = memberMapper.selectList(null); + //for (MemberDO memberDO : memberDOS){ + // redisUtil.set(RedisPrefixConstant.SUBSIDY_COMPANY_MEMBER_PREFIX+memberDO.getCompanyId()+":"+memberDO.getAccountName(),memberDO); + //} + + //签到数据 + //List signInRecordDOS = signInRecordMapper.selectList(null); + //for (SignInRecordDO signInRecordDO : signInRecordDOS){ + // redisUtil.set(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX+signInRecordDO.getMemberId()+":classId:"+ + // signInRecordDO.getClassId()+":"+signInRecordDO.getSignInDate().toString().split("T")[0]+":"+signInRecordDO.getSignInDate().toInstant(ZoneOffset.of("+8")).toEpochMilli(),signInRecordDO); + //} + +// redisUtil.scan("*20220126*"); +// redisUtil.("*20220126*"); + + } + } diff --git a/src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java b/src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java index c135d69..390731e 100644 --- a/src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java @@ -1,22 +1,21 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.common.RedisPrefixConstant; import com.subsidy.common.exception.HttpException; import com.subsidy.dto.sms.SendVerifyCodeDTO; import com.subsidy.mapper.MemberMapper; +import com.subsidy.mapper.SmsVerifyCodeMapper; import com.subsidy.model.MemberDO; import com.subsidy.model.SmsVerifyCodeDO; -import com.subsidy.mapper.SmsVerifyCodeMapper; -import com.subsidy.service.MemberService; import com.subsidy.service.SmsVerifyCodeService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.RandomUtil; import com.subsidy.util.SMSUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; -import java.lang.reflect.Member; - /** *

* 短信验证码记录表 服务实现类 @@ -34,22 +33,29 @@ public class SmsVerifyCodeServiceImpl extends ServiceImpl() + //@Autowired + //private RedisUtil redisUtil; + + public void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO) { + MemberDO memberDO = memberMapper.selectOne(new QueryWrapper() .lambda() .eq(MemberDO::getTelephone, sendVerifyCodeDTO.getTelephone())); - if(memberDO == null) { + if (memberDO == null) { throw new HttpException(70012); } String code = RandomUtil.getRandomCode(6); smsUtils.send(sendVerifyCodeDTO.getTelephone(), code); + this.baseMapper.delete(new QueryWrapper() + .lambda() + .eq(SmsVerifyCodeDO::getTelephone,sendVerifyCodeDTO.getTelephone())); + + //redisUtil.set(RedisPrefixConstant.SUBSIDY_TELEPHONE_PREFIX + sendVerifyCodeDTO.getTelephone(), code, 30 * 60); SmsVerifyCodeDO smsCodeDO = new SmsVerifyCodeDO(); smsCodeDO.setVerifyCode(code); smsCodeDO.setTelephone(sendVerifyCodeDTO.getTelephone()); this.baseMapper.insert(smsCodeDO); - } } diff --git a/src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java index 0387d96..efa8cd4 100644 --- a/src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java @@ -1,27 +1,23 @@ package com.subsidy.service.impl; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.common.configure.VODConfig; import com.subsidy.common.exception.HttpException; import com.subsidy.dto.content.GetContendVodsDTO; -import com.subsidy.model.VodDictDO; +import com.subsidy.dto.vod.ChangeOrdersDTO; import com.subsidy.mapper.VodDictMapper; +import com.subsidy.model.VodDictDO; import com.subsidy.service.VodDictService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.subsidy.util.ConstantUtils; import com.subsidy.util.Signature; +import com.subsidy.util.VodUtil; import com.subsidy.vo.vod.GetContendVodsVO; import com.subsidy.vo.vod.SignatureVO; -import com.tencentcloudapi.common.Credential; -import com.tencentcloudapi.common.exception.TencentCloudSDKException; -import com.tencentcloudapi.common.profile.ClientProfile; -import com.tencentcloudapi.common.profile.HttpProfile; -import com.tencentcloudapi.vod.v20180717.VodClient; -import com.tencentcloudapi.vod.v20180717.models.*; +import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; - +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Random; @@ -39,9 +35,11 @@ public class VodDictServiceImpl extends ServiceImpl im @Autowired private VODConfig vodConfig; + @Value("${spring.profiles.active}") + private String env; - public SignatureVO signature() throws Exception { -// + @Override + public SignatureVO signature() { SignatureVO signatureVO = new SignatureVO(); Signature signature = new Signature(); @@ -57,83 +55,57 @@ public class VodDictServiceImpl extends ServiceImpl im signatureVO.setSign(sign); } catch (Exception ex) { ex.printStackTrace(); -// throw new MyException(ResultEnum.UNKNOWN_ERROR); } return signatureVO; } - public IPage getContendVods(GetContendVodsDTO getContendVodsDTO) { - Page pager = new Page(getContendVodsDTO.getPageNum(), getContendVodsDTO.getPageSize()); - return this.baseMapper.getContendVods(pager,getContendVodsDTO.getVodName(),getContendVodsDTO.getContentId()); - } - - public String deleteVod(VodDictDO vodDictDO) { - VodDictDO vodDictDO1 = this.baseMapper.selectById(vodDictDO.getId()); - this.baseMapper.deleteById(vodDictDO.getId()); - try{ - - //删除原视频 - Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); - - HttpProfile httpProfile = new HttpProfile(); - httpProfile.setEndpoint("vod.tencentcloudapi.com"); - - ClientProfile clientProfile = new ClientProfile(); - clientProfile.setHttpProfile(httpProfile); - - VodClient client = new VodClient(cred, "", clientProfile); - - // 实例化一个请求对象,每个接口都会对应一个request对象 - DeleteMediaRequest req = new DeleteMediaRequest(); - req.setFileId(vodDictDO1.getVodCode()); - // 返回的resp是一个DeleteMediaResponse的实例,与请求对象对应 - client.DeleteMedia(req); - } catch (TencentCloudSDKException e) { - System.out.println(e.toString()); + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteVod(VodDictDO vodDictDO) { + VodDictDO vod = this.baseMapper.selectById(vodDictDO.getId()); + if(null == vod) { + throw new HttpException(18000); } + this.baseMapper.deleteById(vodDictDO.getId()); - return ConstantUtils.DELETE_SUCCESS; + VodUtil.deleteMedia(vodDictDO.getVodCode()); } - public String addVod(VodDictDO vodDictDO) { + @Override + public void addVod(VodDictDO vodDictDO) { + int orderNo = 1;//排序 + List vodDictDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodDictDO::getLabelId, vodDictDO.getLabelId()) + .orderByDesc(VodDictDO::getOrderNo)); + + if (CollectionUtils.isNotEmpty(vodDictDOS)){ + VodDictDO vod = vodDictDOS.get(0); + if (null != vod){ + orderNo = vod.getOrderNo() + 1; + } + } + vodDictDO.setOrderNo(orderNo); this.baseMapper.insert(vodDictDO); - //上传后直接转码 - Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); - - HttpProfile httpProfile = new HttpProfile(); - httpProfile.setEndpoint("vod.tencentcloudapi.com"); - - ClientProfile clientProfile = new ClientProfile(); - clientProfile.setHttpProfile(httpProfile); - - VodClient client = new VodClient(cred, "", clientProfile); - - ProcessMediaRequest processMediaRequest = new ProcessMediaRequest(); - MediaProcessTaskInput mediaProcessTaskInput1 = new MediaProcessTaskInput(); - TranscodeTaskInput[] transcodeTaskInputs1 = new TranscodeTaskInput[1]; - TranscodeTaskInput transcodeTaskInput1 = new TranscodeTaskInput(); - transcodeTaskInput1.setDefinition(ConstantUtils.TEMPLATE_VOD); - transcodeTaskInputs1[0] = transcodeTaskInput1; - mediaProcessTaskInput1.setTranscodeTaskSet(transcodeTaskInputs1); - processMediaRequest.setMediaProcessTask(mediaProcessTaskInput1); - processMediaRequest.setFileId(vodDictDO.getVodCode()); - ProcessMediaResponse processMediaResponse = null; - try { - processMediaResponse = client.ProcessMedia(processMediaRequest); - System.out.println(processMediaResponse); - } catch (Exception ex) { - throw new HttpException(50001); + //测试环境就不转码了 + if (env.equals("prod")){ + VodUtil.processMedia(vodDictDO.getVodCode()); } - - return ConstantUtils.ADD_SUCCESS; } - public String updateVod(VodDictDO vodDictDO) { + @Override + public void updateVod(VodDictDO vodDictDO) { this.baseMapper.updateById(vodDictDO); - return ConstantUtils.SET_SUCCESS; } - + @Override + public void changeOrders(ChangeOrdersDTO changeOrdersDTO){ + int i = 1 ; + List longs = changeOrdersDTO.getVodIds(); + for (Long lg : longs){ + this.baseMapper.updateVodOrderNo(lg,i++); + } + } } diff --git a/src/main/java/com/subsidy/service/impl/VodLabelDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodLabelDictServiceImpl.java new file mode 100644 index 0000000..09e650b --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/VodLabelDictServiceImpl.java @@ -0,0 +1,32 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.dto.label.VodLabelPageDTO; +import com.subsidy.model.VodLabelDictDO; +import com.subsidy.mapper.VodLabelDictMapper; +import com.subsidy.service.VodLableDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +/** + *

+ * 视频库类目表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-07-19 + */ +@Service +public class VodLabelDictServiceImpl extends ServiceImpl implements VodLableDictService { + + @Override + public IPage queryVodLabelPage(VodLabelPageDTO vodLabelPageDTO) { + Page page = new Page(vodLabelPageDTO.getPageNum(), vodLabelPageDTO.getPageSize()); + return this.baseMapper.selectPage(page, new QueryWrapper() + .lambda().like(StringUtils.isNotBlank(vodLabelPageDTO.getLabelName()), + VodLabelDictDO::getLabelName, vodLabelPageDTO.getLabelName())); + } +} diff --git a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java index db73e96..19e71f0 100644 --- a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java @@ -1,12 +1,32 @@ package com.subsidy.service.impl; -import com.subsidy.model.VodPlayHistoryDO; -import com.subsidy.mapper.VodPlayHistoryMapper; -import com.subsidy.service.VodPlayHistoryService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.vod.FixDataTwoDTO; +import com.subsidy.dto.vod.InsertHistoryNewDTO; +import com.subsidy.dto.vod.RemainSecondsDTO; +import com.subsidy.dto.vod.SignDatePlaysDTO; +import com.subsidy.mapper.*; +import com.subsidy.model.*; +import com.subsidy.service.VodPlayHistoryService; import com.subsidy.util.ConstantUtils; +import com.subsidy.util.RedisUtil; +import com.subsidy.vo.vod.VodPlayStateVO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Random; + /** *

* 视频播放历史记录表 服务实现类 @@ -18,14 +38,761 @@ import org.springframework.stereotype.Service; @Service public class VodPlayHistoryServiceImpl extends ServiceImpl implements VodPlayHistoryService { + @Autowired + private ClassMemberMappingMapper classMemberMappingMapper; + + @Autowired + private ClassDictMapper classDictMapper; + + @Autowired + private CourseContentMapper courseContentMapper; + + @Autowired + private SignInRecordMapper signInRecordMapper; + + @Autowired + private VodPlayHistoryMapper vodPlayHistoryMapper; + + @Autowired + private VodDictMapper vodDictMapper; + + @Autowired + private MemberStudyLengthMapper memberStudyLengthMapper; + + @Autowired + private ClassHourDictMapper classHourDictMapper; + + @Autowired + private MemberMapper memberMapper; + +// @Autowired +// private RedisUtil redisUtil; + public String insertHistory(VodPlayHistoryDO vodPlayHistoryDO) { - this.baseMapper.insert(vodPlayHistoryDO); + + if (vodPlayHistoryDO.getPlayLength() > 3) { + MemberDO memberDO = memberMapper.selectById(vodPlayHistoryDO.getMemberId()); + //查看系统设定的时长 + ClassHourDictDO classHourDictDO = classHourDictMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ClassHourDictDO::getCompanyId, memberDO.getCompanyId())); + + if (classHourDictDO.getStatus() == 1) { + //查看当天这个人看了多少时间 + Integer total = vodPlayHistoryMapper.memberDailyStudyLength(memberDO.getId()); + + if (total == classHourDictDO.getClassHour() * 3600){ + throw new HttpException(13001); + } + + //是否超过时长 没超过 false 超过 true + if (total + vodPlayHistoryDO.getPlayLength() > classHourDictDO.getClassHour() * 3600) { + int playLength = classHourDictDO.getClassHour() * 3600 - total; + vodPlayHistoryDO.setPlayLength(playLength); + vodPlayHistoryDO.setPlayCount(1); + if (playLength>3){ + this.baseMapper.insert(vodPlayHistoryDO); + } + throw new HttpException(13001); + } + } + vodPlayHistoryDO.setPlayCount(1); + this.baseMapper.insert(vodPlayHistoryDO); + } return ConstantUtils.ADD_SUCCESS; } - public String insertHistoryNew(VodPlayHistoryDO vodPlayHistoryDO){ - this.baseMapper.insert(vodPlayHistoryDO); + public String insertHistoryNew(InsertHistoryNewDTO insertHistoryNewDTO) { + + if (insertHistoryNewDTO.getPlayLength() > 3) { + + VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO(); + BeanUtils.copyProperties(insertHistoryNewDTO, vodPlayHistoryDO); + + MemberDO memberDO = memberMapper.selectById(vodPlayHistoryDO.getMemberId()); + //查看系统设定的时长 + ClassHourDictDO classHourDictDO = classHourDictMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ClassHourDictDO::getCompanyId, memberDO.getCompanyId())); + + if (classHourDictDO.getStatus() == 1) { + //查看当天这个人看了多少时间 + Integer total = vodPlayHistoryMapper.memberDailyStudyLength(memberDO.getId()); + + if (total == classHourDictDO.getClassHour() * 3600){ + throw new HttpException(13001); + } + + //是否超过时长 没超过 false 超过 true + if (total + vodPlayHistoryDO.getPlayLength() > classHourDictDO.getClassHour() * 3600) { + int playLength = classHourDictDO.getClassHour() * 3600 - total; + vodPlayHistoryDO.setPlayLength(playLength); + vodPlayHistoryDO.setPlayCount(1); + if (playLength >3){ + this.baseMapper.insert(vodPlayHistoryDO); + } + throw new HttpException(13001); + } + } + vodPlayHistoryDO.setPlayCount(1); + this.baseMapper.insert(vodPlayHistoryDO); + } + return ConstantUtils.ADD_SUCCESS; } -} + public void dataFix(SignDatePlaysDTO dataFixDTO) { + + //班级ids + String[] classIds = new String[]{dataFixDTO.getClassId()}; + + for (String str : classIds) { + + ClassDictDO classDictDO = classDictMapper.selectById(str); + + //找到班级里的学生 + List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassMemberMappingDO::getClassId, Long.valueOf(str))); + + + //查找课程里的所有视频 + List vodDictDOS = courseContentMapper.getCourseVods(classDictDO.getCourseId()); + + //遍历班级学生 + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + + //查询这个人 这节课 签到记录 排序 + List signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, classMemberMappingDO.getMemberId()) + .eq(SignInRecordDO::getClassId, str) + .orderByAsc(SignInRecordDO::getSignInDate)); + List localDateTimes = new ArrayList<>(); + for (SignInRecordDO signInrecord : signInRecordDOS) { + if (signInrecord.getSignInDate().getHour() >= 6 && signInrecord.getSignInDate().getHour() < 15) { + localDateTimes.add(signInrecord.getSignInDate()); + } + } + int signInrecord = localDateTimes.size(); + int vodSize = vodDictDOS.size(); + + LinkedHashMap hashMap = new LinkedHashMap<>(); + List integers = new ArrayList<>(); + + int m = 0; + + int rdm_total = 0; + for (int k = 0; k < signInrecord; k++) { +// int n = getRandom(); + int n = vodSize / signInrecord + 1; + rdm_total += n; + if ((m + n) < vodSize && k != signInrecord - 1) { + m += n; + //if (n > 11 || n < 5) { + // System.out.println("error" + "==================="); + //} + hashMap.put(localDateTimes.get(k), n); + integers.add(localDateTimes.get(k)); + } else { + //if (vodSize - rdm_total + n > 10 || vodSize - rdm_total + n < 5) { + // System.out.println("error+=================="); + //} + hashMap.put(localDateTimes.get(k), vodSize - rdm_total + n); + integers.add(localDateTimes.get(k)); + break; + } + } + + //是否是最后一天的 + int key_index = 0; +// for (LocalDateTime localDateTime : hashMap.keySet()){ +// if (hashMap.get(localDateTime)>10||hashMap.get(localDateTime)<5){ +// System.out.println("================"); +// } +// } + + // 根据签到时间,对学生学习的课程做插入操作 + for (LocalDateTime localDateTime : hashMap.keySet()) { + //今天应该看几个视频 + int total = hashMap.get(localDateTime); + + //今天已看视频时长 + int totalPlay = 0; + + //先续播前一天未看完的视频 + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getMemberId()) + .eq(VodPlayHistoryDO::getClassId, str) + .orderByDesc(VodPlayHistoryDO::getPlayDate)); + //续播 + if (vodPlayHistoryDOS.size() > 0) { + VodPlayHistoryDO vodPlayHistoryDO1 = vodPlayHistoryDOS.get(0); + VodDictDO vodDictDO = vodDictMapper.selectById(vodPlayHistoryDO1.getVodId()); + //剩下的学习时长 + int leftLength = vodDictDO.getVodLength() - vodPlayHistoryDO1.getPlayLength(); + if (leftLength > 0) { + totalPlay += leftLength; + VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO(); + vodPlayHistoryDO.setPlayCount(1); + vodPlayHistoryDO.setClassId(Long.valueOf(str)); + vodPlayHistoryDO.setMemberId(classMemberMappingDO.getMemberId()); + vodPlayHistoryDO.setPlayRecord(vodDictDO.getVodLength()); + vodPlayHistoryDO.setPlayLength(leftLength); + vodPlayHistoryDO.setVodId(vodDictDO.getId()); + vodPlayHistoryDO.setPlayDate(localDateTime.plusSeconds(leftLength)); + vodPlayHistoryMapper.insert(vodPlayHistoryDO); + } + } + + //今天已看几个视频 + int alreadyPlay = 0; + Random random = new Random(); + //查找这个人应该学的课程 + for (VodDictDO vodDictDO : vodDictDOS) { + //从历史记录里找中这个人有没有学过 + Integer count = vodPlayHistoryMapper.selectCount(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getMemberId()) + .eq(VodPlayHistoryDO::getClassId, str) + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId())); + //表示这个视频没有学过 + if (count == 0) { + if (alreadyPlay == total) { + //最后一天最后一个视频 + if (key_index == integers.size()) { + VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO(); + vodPlayHistoryDO.setPlayCount(1); + vodPlayHistoryDO.setClassId(Long.valueOf(str)); + vodPlayHistoryDO.setMemberId(classMemberMappingDO.getMemberId()); + vodPlayHistoryDO.setPlayRecord(vodDictDO.getVodLength()); + vodPlayHistoryDO.setPlayLength(vodDictDO.getVodLength()); + vodPlayHistoryDO.setVodId(vodDictDO.getId()); + vodPlayHistoryDO.setPlayDate(localDateTime.plusSeconds(totalPlay)); + vodPlayHistoryMapper.insert(vodPlayHistoryDO); + alreadyPlay++; + } else { + //当天看的最后一个视频 + VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO(); + vodPlayHistoryDO.setPlayCount(1); + vodPlayHistoryDO.setClassId(Long.valueOf(str)); + vodPlayHistoryDO.setMemberId(classMemberMappingDO.getMemberId()); + int rdm = random.nextInt(vodDictDO.getVodLength()); + vodPlayHistoryDO.setPlayLength(rdm); + vodPlayHistoryDO.setPlayRecord(rdm); + vodPlayHistoryDO.setVodId(vodDictDO.getId()); + vodPlayHistoryDO.setPlayDate(localDateTime.plusSeconds(totalPlay + rdm)); + vodPlayHistoryMapper.insert(vodPlayHistoryDO); + alreadyPlay++; + break; + } + } else { + totalPlay += vodDictDO.getVodLength(); + VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO(); + vodPlayHistoryDO.setPlayCount(1); + vodPlayHistoryDO.setClassId(Long.valueOf(str)); + vodPlayHistoryDO.setMemberId(classMemberMappingDO.getMemberId()); + vodPlayHistoryDO.setPlayRecord(vodDictDO.getVodLength()); + vodPlayHistoryDO.setPlayLength(vodDictDO.getVodLength()); + vodPlayHistoryDO.setVodId(vodDictDO.getId()); + vodPlayHistoryDO.setPlayDate(localDateTime.plusSeconds(totalPlay)); + vodPlayHistoryMapper.insert(vodPlayHistoryDO); + alreadyPlay++; + } + } + } + key_index++; + } + } + } + } + + public void signDatePlays(SignDatePlaysDTO signDatePlaysDTO) { + + //班级ids + String[] classIds = new String[]{signDatePlaysDTO.getClassId()}; + + for (String str : classIds) { + + ClassDictDO classDictDO = classDictMapper.selectById(str); + + //找到班级里的学生 + List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassMemberMappingDO::getClassId, Long.valueOf(str))); + + //查找课程里的所有视频 + List vodDictDOS = courseContentMapper.getCourseVods(classDictDO.getCourseId()); + + //遍历班级学生 + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + + //查询这个人 这节课 签到记录 排序 + List localDateTimes = new ArrayList<>(); + List signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, classMemberMappingDO.getMemberId()) + .eq(SignInRecordDO::getClassId, str)); + + for (SignInRecordDO signInrecord : signInRecordDOS) { + localDateTimes.add(signInrecord.getSignInDate()); + } + if (localDateTimes.size() > 0) { + for (LocalDateTime localDateTime : localDateTimes) { + + //查看当天这人已经看的视频时长 + List vodPlayHistoryDOS = vodPlayHistoryMapper.exPlayInfo(classMemberMappingDO.getMemberId(), str, localDateTime); + + int playLength = 0; + + for (int m = 0; m < vodPlayHistoryDOS.size(); m++) { + playLength += vodPlayHistoryDOS.get(m).getPlayLength(); + } + int playCounts = new Random().nextInt(4); + + for (int i = 0; i < playCounts; i++) { + VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO(); + Random random1 = new Random(); + int j = random1.nextInt(vodDictDOS.size()); + vodPlayHistoryDO.setPlayCount(1); + vodPlayHistoryDO.setClassId(Long.valueOf(str)); + vodPlayHistoryDO.setMemberId(classMemberMappingDO.getMemberId()); + int h = new Random().nextInt(vodDictDOS.get(j).getVodLength() - 10) + 1; + vodPlayHistoryDO.setPlayRecord(h); + vodPlayHistoryDO.setPlayLength(new Random().nextInt(vodPlayHistoryDO.getPlayRecord())); + playLength += vodPlayHistoryDO.getPlayLength(); + vodPlayHistoryDO.setVodId(vodDictDOS.get(j).getId()); + vodPlayHistoryDO.setPlayDate(localDateTime.plusSeconds(playLength)); + vodPlayHistoryMapper.insert(vodPlayHistoryDO); + } + } + } + } + } + } + + public void remainSeconds(RemainSecondsDTO remainSecondsDTO) { + + Long classId = remainSecondsDTO.getClassId(); + + ClassDictDO classDictDO = classDictMapper.selectById(classId); + +// //找到班级里的学生 +// List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() +// .lambda() +// .eq(ClassMemberMappingDO::getClassId, Long.valueOf(classId))); + + //查找课程里的所有视频 + List vodDictDOS = courseContentMapper.getCourseVods(classDictDO.getCourseId()); + + + //查看每个人看视频的时长 +// for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + + //查看每个人的剩余时长 + MemberStudyLengthDO memberStudyLengthDO = memberStudyLengthMapper.selectOne(new QueryWrapper() + .lambda() + .eq(MemberStudyLengthDO::getMemberId, remainSecondsDTO.getMemberId())); + + + //查询这个人 这节课 签到记录 排序 + List signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, remainSecondsDTO.getMemberId()) + .eq(SignInRecordDO::getClassId, classId)); + + //确定每日最大学习时长 + int maxLength = memberStudyLengthDO.getTotalLength() / signInRecordDOS.size() + 650; + + + for (int k = signInRecordDOS.size() - 1; k >= 0; k--) { + + //查看当天这人已经看的视频时长 + List vodPlayHistoryDOS = vodPlayHistoryMapper.exPlayInfo(remainSecondsDTO.getMemberId(), String.valueOf(classId), signInRecordDOS.get(k).getSignInDate()); + + //查看学生已看视频时长 + int totalLength = 0; + System.out.println("111111111111111"); + List vodPlayHistoryDOS1 = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, remainSecondsDTO.getMemberId()) + .eq(VodPlayHistoryDO::getClassId, classId)); + for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS1) { + totalLength += vodPlayHistoryDO.getPlayLength(); + } + + int leftLength = 0; + + System.out.println("22222222222222222222222"); + if (memberStudyLengthDO != null) { + //这个人还剩多少时长 + leftLength = memberStudyLengthDO.getTotalLength() - totalLength; + } + + System.out.println("2.5==============================="); + //当天已经看了多少时间视频 + int playLength = 0; + + for (int m = 0; m < vodPlayHistoryDOS.size(); m++) { + playLength += vodPlayHistoryDOS.get(m).getPlayLength(); + } + + if (maxLength > playLength) { + if (leftLength > 0) { + //随机看几个视频 + int playCounts = new Random().nextInt(4) + 2; + System.out.println("4444444444444444"); + for (int i = 0; i < playCounts; i++) { + + VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO(); + Random random1 = new Random(); + System.out.println("55555555555555555555"); + int j = random1.nextInt(vodDictDOS.size()); + vodPlayHistoryDO.setPlayCount(1); + vodPlayHistoryDO.setClassId(classId); + vodPlayHistoryDO.setMemberId(remainSecondsDTO.getMemberId()); + int h = new Random().nextInt(vodDictDOS.get(j).getVodLength() - 10) + 1; + System.out.println("666666666666666666"); + vodPlayHistoryDO.setPlayRecord(new Random().nextInt(h)); + if (leftLength - h > 0) { + vodPlayHistoryDO.setPlayLength(h); + playLength += h; + vodPlayHistoryDO.setVodId(vodDictDOS.get(j).getId()); + vodPlayHistoryDO.setPlayDate(signInRecordDOS.get(k).getSignInDate().plusSeconds(playLength)); + leftLength = leftLength - h; + vodPlayHistoryMapper.insert(vodPlayHistoryDO); + } else { + vodPlayHistoryDO.setPlayLength(leftLength); + playLength += leftLength; + vodPlayHistoryDO.setVodId(vodDictDOS.get(j).getId()); + vodPlayHistoryDO.setPlayDate(signInRecordDOS.get(k).getSignInDate().plusSeconds(playLength)); + vodPlayHistoryMapper.insert(vodPlayHistoryDO); + break; + } + } + } + } + System.out.println("33333333333333333333"); + } +// } + } + + public void playLengthFix(RemainSecondsDTO remainSecondsDTO) { + + // 查看签到次数 + ClassDictDO classDictDO = classDictMapper.selectById(remainSecondsDTO.getClassId()); + +// //找到班级里的学生 +// List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() +// .lambda() +// .eq(ClassMemberMappingDO::getClassId, classDictDO.getId())); + + //查找课程里的所有视频 + List vodDictDOS = courseContentMapper.getCourseVods(classDictDO.getCourseId()); + + //查看每个人看视频的时长 +// for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + + //查看签到次数,得到学习时长 + //查询这个人 这节课 签到记录 排序 + List signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, remainSecondsDTO.getMemberId()) + .eq(SignInRecordDO::getClassId, classDictDO.getId()) + .orderByAsc(SignInRecordDO::getSignInDate)); + + List localDateTimes = new ArrayList<>(); + for (SignInRecordDO signInrecord : signInRecordDOS) { + if (signInrecord.getSignInDate().getHour() >= 6 && signInrecord.getSignInDate().getHour() < 17) { + localDateTimes.add(signInrecord.getSignInDate()); + } + } + int signInrecord = localDateTimes.size(); + int vodSize = vodDictDOS.size(); + + LinkedHashMap hashMap = new LinkedHashMap<>(); + List integers = new ArrayList<>(); + + int m = 0; + + int rdm_total = 0; + for (int k = 0; k < signInrecord; k++) { + int n = getRandom(); + rdm_total += n; + if ((m + n) < vodSize && k != signInrecord - 1) { + m += n; + //if (n > 11 || n < 5) { + // System.out.println("error" + "==================="); + //} + hashMap.put(localDateTimes.get(k), n); + integers.add(localDateTimes.get(k)); + } else { + //if (vodSize - rdm_total + n > 10 || vodSize - rdm_total + n < 5) { + // System.out.println("error+=================="); + //} + hashMap.put(localDateTimes.get(k), vodSize - rdm_total + n); + integers.add(localDateTimes.get(k)); + break; + } + } + + //是否是最后一天的 + int key_index = 0; +// for (LocalDateTime localDateTime : hashMap.keySet()){ +// if (hashMap.get(localDateTime)>10||hashMap.get(localDateTime)<5){ +// System.out.println("================"); +// } +// } + + for (LocalDateTime localDateTime : localDateTimes) { + + //今天应该看多久视频 + int totalPlayLength = 0; + if (localDateTimes.size() == 3) { + totalPlayLength = _3times(); + } else if (localDateTimes.size() == 4) { + totalPlayLength = _4times(); + } else if (localDateTimes.size() == 5) { + totalPlayLength = _5times(); + } else if (localDateTimes.size() == 6) { + totalPlayLength = _6times(); + } else { + totalPlayLength = _7times(); + } + + //今天已看视频时长 + int totalPlay = 0; + + //先续播前一天未看完的视频 + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, remainSecondsDTO.getMemberId()) + .eq(VodPlayHistoryDO::getClassId, classDictDO.getId()) + .orderByDesc(VodPlayHistoryDO::getPlayDate)); + //续播 + if (vodPlayHistoryDOS.size() > 0) { + VodPlayHistoryDO vodPlayHistoryDO1 = vodPlayHistoryDOS.get(0); + int count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getVodId, vodPlayHistoryDO1.getVodId()) + .eq(VodPlayHistoryDO::getMemberId, remainSecondsDTO.getMemberId())); + + if (count < 2) { + VodDictDO vodDictDO = vodDictMapper.selectById(vodPlayHistoryDO1.getVodId()); + //剩下的学习时长 + int leftLength = vodDictDO.getVodLength() - vodPlayHistoryDO1.getPlayLength(); + if (leftLength > 0) { + totalPlay += leftLength; + VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO(); + vodPlayHistoryDO.setPlayCount(1); + vodPlayHistoryDO.setClassId(classDictDO.getId()); + vodPlayHistoryDO.setMemberId(remainSecondsDTO.getMemberId()); + vodPlayHistoryDO.setPlayRecord(vodDictDO.getVodLength()); + vodPlayHistoryDO.setPlayLength(leftLength); + vodPlayHistoryDO.setVodId(vodDictDO.getId()); + vodPlayHistoryDO.setPlayDate(localDateTime.plusSeconds(leftLength)); + vodPlayHistoryMapper.insert(vodPlayHistoryDO); + } + } + } + + //查找这个人应该学的课程 + for (VodDictDO vodDictDO : vodDictDOS) { + //从历史记录里找中这个人有没有学过 + Integer count = vodPlayHistoryMapper.selectCount(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, remainSecondsDTO.getMemberId()) + .eq(VodPlayHistoryDO::getClassId, classDictDO.getId()) + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId())); + //表示这个视频没有学过 + if (count == 0) { + if (totalPlayLength > totalPlay) { //说明今天还可以学 + VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO(); + vodPlayHistoryDO.setPlayCount(1); + vodPlayHistoryDO.setClassId(classDictDO.getId()); + vodPlayHistoryDO.setMemberId(remainSecondsDTO.getMemberId()); + vodPlayHistoryDO.setPlayRecord(vodDictDO.getVodLength()); + if (totalPlay + vodDictDO.getVodLength() <= totalPlayLength) { + vodPlayHistoryDO.setPlayLength(vodDictDO.getVodLength()); + totalPlay += vodDictDO.getVodLength(); + } else { + vodPlayHistoryDO.setPlayLength(totalPlayLength - totalPlay); + totalPlay = totalPlayLength; + } + vodPlayHistoryDO.setVodId(vodDictDO.getId()); + vodPlayHistoryDO.setPlayDate(localDateTime.plusSeconds(totalPlay)); + vodPlayHistoryMapper.insert(vodPlayHistoryDO); + } + } + } + key_index++; + } +// } + } + + public List testPlays(VodPlayHistoryDO vodPlayHistoryDO) { + + String classIds = "261"; + +// String classIds = "122,150"; + List classIdArr = Arrays.asList(classIds.split(",")); + + List result = new ArrayList<>(); + for (String classId : classIdArr) { + List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassMemberMappingDO::getClassId, classId)); + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + List vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId()); + for (int i = 0; i < vodPlayStateVOS.size(); i++) { + for (int k = i + 1; k < vodPlayStateVOS.size(); k++) { + VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(k); + VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); + if (vodPlayStateVO.getStartDate().after(vodPlayStateVO1.getStartDate()) && vodPlayStateVO.getStartDate().before(vodPlayStateVO1.getEndDate())) { + System.out.println("111111111"+vodPlayStateVO); + //这一条数据有问题 + //查看这个人 这个课程 当天的全部数据 按照createDate升序排序 +// List vodPlayHistoryDOS = this.baseMapper.getVodPlayDay(Long.valueOf(classId), vodPlayStateVO.getMemberId(), vodPlayStateVO.getEndDate()); + //从第一条开始看,顺延减去第二条的playlength得到第二条的create_date 以此类推 +// for (int l = 0; l < vodPlayHistoryDOS.size() - 1; l++) { +// VodPlayHistoryDO vph1 = vodPlayHistoryDOS.get(l); +// VodPlayHistoryDO vph2 = vodPlayHistoryDOS.get(l + 1); +// LocalDateTime dateTmp = vph1.getCreateDate().minusSeconds(-vph2.getPlayLength() - getRandom1_2()); +// vph2.setCreateDate(dateTmp); +// this.baseMapper.updateById(vph2); + result.add(vodPlayStateVO.getId()); +// } + } + } + } + } + } + return result; + } + + //19为基数的话,3次签到6.5到8,4次签到4.8-6, + // 5次4-6,6次3.2-6,7次及以上2.5-6吧 + //int randNumber =rand.nextInt(MAX - MIN + 1) + MIN; + + /** + * 3次签到 23400---28800 + */ + public Integer _3times () { + return new Random().nextInt(28800 - 23400 + 1) + 23400; + } + + /** + * 4次签到 23400---28800 + */ + public Integer _4times () { + return new Random().nextInt(6 * 60 * 60 - 48 * 6 * 60 + 1) + 48 * 6 * 60; + } + + /** + * 5次签到 23400---28800 + */ + public Integer _5times () { + return new Random().nextInt(6 * 60 * 60 - 4 * 60 * 60 + 1) + 4 * 60 * 60; + } + + /** + * 6次签到 23400---28800 + */ + public Integer _6times () { + return new Random().nextInt(6 * 60 * 60 - 32 * 6 * 60 + 1) + 32 * 60 * 6; + } + + /** + * 7次签到 23400---28800 + */ + public Integer _7times () { + return new Random().nextInt(6 * 60 * 60 - 25 * 6 * 60 + 1) + 25 * 6 * 60; + } + + public static void main (String[]args){ + while (true) { + System.out.println(getRandom()); + } +// int m = 0; +// +// int signInrecord = 4; +// int vodSize = 24; +// List integers = new ArrayList<>(); +// +// +// int rdm_total = 0; +// for (int k = 0; k < signInrecord; k++) { +// int n = getRandom(); +// rdm_total += n; +// if ((m + n) < vodSize && k != signInrecord - 1) { +// m += n; +// integers.add(n); +// } else { +// integers.add(vodSize - rdm_total + n); +// break; +// } +// } +// +// int h = 0 ; +// while (true) { +// for (Integer integer : integers) { +//// System.out.println(integer + "====="); +// h += integer; +// } +// System.out.println(h+"=============="); +// +// if (h != 24) { +// System.out.println(integers); +// } +// h= 0; +// } +// int key_index = 0; + +// for (int i = 1 ; i< 100 ; i ++){ +// System.out.println((int)(Math.random()*11/2+5)); +// } + +// int m = 0 ; +// int signInRecordDOS = 3; +// int vodDictDOS = 24; +// List integers = new ArrayList<>(); +// +// for (int k = 0 ; k < signInRecordDOS ; k++){ +// if (k!=signInRecordDOS-1){ +// int n = getRandom(); +// if ((m+n)<=vodDictDOS){ +// m+=n; +// integers.add(n); +// } +// }else { +// if (m 11 || i < 5) { + // System.out.println("error"); + // } + //} + } + + public static Integer getRandom () { + return (int) (Math.random() * 3 / 2 + 5); + } + + public static Integer getRandom1_2 () { + return (int) (Math.random() * 3 / 2 + 1); + } + + + } diff --git a/src/main/java/com/subsidy/util/CodeGenerator.java b/src/main/java/com/subsidy/util/CodeGenerator.java index ae1381a..7b488bc 100644 --- a/src/main/java/com/subsidy/util/CodeGenerator.java +++ b/src/main/java/com/subsidy/util/CodeGenerator.java @@ -6,7 +6,12 @@ import com.baomidou.mybatisplus.core.toolkit.StringPool; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.generator.AutoGenerator; import com.baomidou.mybatisplus.generator.InjectionConfig; -import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.DataSourceConfig; +import com.baomidou.mybatisplus.generator.config.FileOutConfig; +import com.baomidou.mybatisplus.generator.config.GlobalConfig; +import com.baomidou.mybatisplus.generator.config.PackageConfig; +import com.baomidou.mybatisplus.generator.config.StrategyConfig; +import com.baomidou.mybatisplus.generator.config.TemplateConfig; import com.baomidou.mybatisplus.generator.config.po.TableInfo; import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; diff --git a/src/main/java/com/subsidy/util/ConstantUtils.java b/src/main/java/com/subsidy/util/ConstantUtils.java index 977b5e2..5f05c6f 100644 --- a/src/main/java/com/subsidy/util/ConstantUtils.java +++ b/src/main/java/com/subsidy/util/ConstantUtils.java @@ -52,8 +52,6 @@ public class ConstantUtils { public static final String COMPRESS_SUCCESS = "压缩成功"; - public static final String SCHOOL = "上海市市西中学"; - public static final String CHECK_STATUS = "审核通过"; /** diff --git a/src/main/java/com/subsidy/util/DateFormatUtil.java b/src/main/java/com/subsidy/util/DateFormatUtil.java index fc5aced..f39120e 100644 --- a/src/main/java/com/subsidy/util/DateFormatUtil.java +++ b/src/main/java/com/subsidy/util/DateFormatUtil.java @@ -1,6 +1,11 @@ package com.subsidy.util; +import java.awt.SystemTray; import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.util.Date; /** @@ -37,6 +42,22 @@ public class DateFormatUtil { } /** + * LocalDateTime转String,自定义格式 + * @param localDateTime + * @param pattern + * @return + */ + public static String format(LocalDateTime localDateTime, String pattern) { + try { + SimpleDateFormat sdf = new SimpleDateFormat(pattern); + return sdf.format(localDateTime); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** * String转Date,自定义格式 * @param date * @param pattern @@ -73,4 +94,27 @@ public class DateFormatUtil { SimpleDateFormat sdf = new SimpleDateFormat("s m H d M ? yyyy"); return sdf.format(date); } + + public static Date localDateTimeToDate(LocalDateTime dateTime) { + if(dateTime == null) { + return null; + } + ZoneId zoneId = ZoneId.systemDefault(); + ZonedDateTime zdt = dateTime.atZone(zoneId); + return Date.from(zdt.toInstant()); + } + + public static LocalDateTime secondToLocalDateTime(Long second) { + if(second != null) { + return LocalDateTime.ofEpochSecond(second, 0, ZoneOffset.ofHours(8)); + } + return LocalDateTime.now(); + } + + public static Long LocalDateTimeToSecond(LocalDateTime localDateTime) { + if(localDateTime != null) { + return localDateTime.atZone(ZoneOffset.ofHours(8)).toInstant().toEpochMilli(); + } + return System.currentTimeMillis(); + } } diff --git a/src/main/java/com/subsidy/util/EncryptUtil.java b/src/main/java/com/subsidy/util/EncryptUtil.java index 7055849..9db0ff2 100644 --- a/src/main/java/com/subsidy/util/EncryptUtil.java +++ b/src/main/java/com/subsidy/util/EncryptUtil.java @@ -1,35 +1,35 @@ -package com.subsidy.util; - -import com.amdelamar.jhash.Hash; -import com.amdelamar.jhash.algorithms.Type; -import com.amdelamar.jhash.exception.InvalidHashException; - -public class EncryptUtil { - - /** - * 设置密文密码 - * - * @param password 原始密码 - * @return 加密密码 - */ - public static String encrypt(String password) { - char[] chars = password.toCharArray(); - return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).create(); - } - - /** - * 验证加密密码 - * - * @param encryptedPassword 密文密码 - * @param plainPassword 明文密码 - * @return 验证是否成功 - */ - public static boolean verify(String encryptedPassword, String plainPassword) { - char[] chars = plainPassword.toCharArray(); - try { - return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).verify(encryptedPassword); - } catch (InvalidHashException e) { - return false; - } - } -} +//package com.subsidy.util; +// +//import com.amdelamar.jhash.Hash; +//import com.amdelamar.jhash.algorithms.Type; +//import com.amdelamar.jhash.exception.InvalidHashException; +// +//public class EncryptUtil { +// +// /** +// * 设置密文密码 +// * +// * @param password 原始密码 +// * @return 加密密码 +// */ +// public static String encrypt(String password) { +// char[] chars = password.toCharArray(); +// return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).create(); +// } +// +// /** +// * 验证加密密码 +// * +// * @param encryptedPassword 密文密码 +// * @param plainPassword 明文密码 +// * @return 验证是否成功 +// */ +// public static boolean verify(String encryptedPassword, String plainPassword) { +// char[] chars = plainPassword.toCharArray(); +// try { +// return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).verify(encryptedPassword); +// } catch (InvalidHashException e) { +// return false; +// } +// } +//} diff --git a/src/main/java/com/subsidy/util/ExcelFormatUtils.java b/src/main/java/com/subsidy/util/ExcelFormatUtils.java index a109629..aa4eee3 100644 --- a/src/main/java/com/subsidy/util/ExcelFormatUtils.java +++ b/src/main/java/com/subsidy/util/ExcelFormatUtils.java @@ -6,12 +6,14 @@ import java.util.List; public class ExcelFormatUtils { - public static final List memberList = Arrays.asList("序号", "成员名称", "身份证号码", "账号", "联系方式", "签到次数", "课程进度", "培训时长", "答疑数", "测试成绩", "总评价"); + public static final List memberList = Arrays.asList("序号", "成员名称","身份证号码", "性别", "账号", "联系方式", "签到次数", "课程进度", "学习时长(小时)","学习时长(分钟)", "答疑数", "测试成绩", "总评价"); - public static final List signList = Arrays.asList("序号", "成员名称", "身份证号码", "手机号码", "培训时长", "课程进度", "完成率", "签到次数", "签到日期"); + public static final List signList = Arrays.asList("序号", "成员名称", "身份证号码", "联系方式", "学习时长(小时)","学习时长(分钟)", "课程进度", "完成率", "签到次数", "签到日期"); - public static final List scoreList = Arrays.asList("序号", "成员名称", "身份证号码", "手机号码", "测试最高成绩", "测试次数", "总评价"); + public static final List scoreList = Arrays.asList("序号", "成员名称", "身份证号码", "联系方式", "测试成绩", "测试次数", "总评价"); public static final List answersList = Arrays.asList("序号", "提问", "答疑", "提问时间", "提问成员", "答疑时间"); + public static final List studyLogList = Arrays.asList("开始时间","结束时间","课程","类型","学习时长","累计有效时长"); + } diff --git a/src/main/java/com/subsidy/util/IpAddressUtil.java b/src/main/java/com/subsidy/util/IpAddressUtil.java new file mode 100644 index 0000000..dfd1e0f --- /dev/null +++ b/src/main/java/com/subsidy/util/IpAddressUtil.java @@ -0,0 +1,36 @@ +package com.subsidy.util; + +import javax.servlet.http.HttpServletRequest; +import java.net.InetAddress; +import java.net.UnknownHostException; + +public class IpAddressUtil { + + public static String getIpAddress(HttpServletRequest request) { + String ipAddress = request.getHeader("x-forwarded-for"); + if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { + ipAddress = request.getHeader("Proxy-Client-IP"); + } + if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { + ipAddress = request.getHeader("WL-Proxy-Client-IP"); + } + if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { + ipAddress = request.getRemoteAddr(); + if (ipAddress.equals("127.0.0.1") || ipAddress.equals("0:0:0:0:0:0:0:1")) { + InetAddress inet = null; + try { + inet = InetAddress.getLocalHost(); + } catch (UnknownHostException e) { + e.printStackTrace(); + } + ipAddress = inet.getHostAddress(); + } + } + if (ipAddress != null && ipAddress.length() > 15) { + if (ipAddress.indexOf(",") > 0) { + ipAddress = ipAddress.substring(0, ipAddress.indexOf(",")); + } + } + return ipAddress; + } +} diff --git a/src/main/java/com/subsidy/util/LatexUtils.java b/src/main/java/com/subsidy/util/LatexUtils.java deleted file mode 100644 index ac6fddb..0000000 --- a/src/main/java/com/subsidy/util/LatexUtils.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.subsidy.util; - -import org.scilab.forge.jlatexmath.TeXConstants; -import org.scilab.forge.jlatexmath.TeXFormula; -import org.scilab.forge.jlatexmath.TeXIcon; - -import javax.imageio.ImageIO; -import javax.swing.*; -import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.*; - -/** - * @author: tuyp - * @create: 2020-08-08 21:19 - */ -public class LatexUtils { - - /** - * @Description: 将base64编码字符串转换为图片 - * @Author: - * @CreateTime: - * @param imgStr - * base64编码字符串 - * @param path - * 图片路径-具体到文件 - * @return - */ - public static boolean generateImage(String imgStr, String path) { - if (imgStr == null) { - return false; - } -// BASE64Decoder decoder = new BASE64Decoder(); - try { -// byte[] b = decoder.decodeBuffer(imgStr); -// for (int i = 0; i < b.length; i++) { -// if (b[i] < 0) { -// b[i] += 256; -// } -// } -// OutputStream out = new FileOutputStream(path); -// out.write(b); -// out.flush(); -// out.close(); - return true; - } catch (Exception e) { - // TODO: handle exception - return false; - } - } - - /** - * @Description: 根据图片地址转换为base64编码字符串 - * @Author: - * @CreateTime: - * @return - */ -// public static String getImageStr(String imgFile) { -// InputStream inputStream = null; -// byte[] data = null; -// try { -// inputStream = new FileInputStream(imgFile); -// data = new byte[inputStream.available()]; -// inputStream.read(data); -// inputStream.close(); -// } catch (IOException e) { -// e.printStackTrace(); -// } -// // 加密 -// BASE64Encoder encoder = new BASE64Encoder(); -// return encoder.encode(data); -// } - - // latex 转 imgbase64 - public static String latex2Png(String latex) { - try { - TeXFormula formula = new TeXFormula(latex); - // render the formla to an icon of the same size as the formula. - TeXIcon icon = formula.createTeXIcon(TeXConstants.STYLE_DISPLAY, 20); - // insert a border - icon.setInsets(new Insets(1, 1, 1, 1)); - // now create an actual image of the rendered equation - BufferedImage image = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_BYTE_GRAY); - Graphics2D g2 = image.createGraphics(); - g2.setColor(Color.white); - g2.fillRect(0, 0, icon.getIconWidth(), icon.getIconHeight()); - JLabel jl = new JLabel(); - jl.setForeground(new Color(0, 0, 0)); - icon.paintIcon(jl, g2, 0, 0); - // at this point the image is created, you could also save it with ImageIO - // saveImage(image, "png", "F:\\b.png"); -// ImageIO.write(image, "png", new File("F:\\c.png")); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - try { - ImageIO.write(image, "png", outputStream); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - return null; - } - byte[] buffer = outputStream.toByteArray(); -// BASE64Encoder encoder = new BASE64Encoder(); - return ("data:image/png;base64,"); - } catch (Exception e) { - // e.printStackTrace(); - // ExceptionUtil.log(log, e); - System.err.println("公式解析有误:\n" + latex); - // e.printStackTrace(); - return null; - } - } - - public static void main(String[] args) { - String str = latex2Png("\\(\\sqrt[3]{2+x}\\)"); - System.out.println(str); - - - - -// String omml =Latex_Word.latexToWord(str); -// System.out.println(omml); - } - -} diff --git a/src/main/java/com/subsidy/util/MathUtil.java b/src/main/java/com/subsidy/util/MathUtil.java index 580af1a..70a9d8e 100644 --- a/src/main/java/com/subsidy/util/MathUtil.java +++ b/src/main/java/com/subsidy/util/MathUtil.java @@ -137,17 +137,17 @@ public class MathUtil { // } public static String secToTime(int time) { - String timeStr = null; - int hour = 0; - int minute = 0; - int second = 0; + String timeStr ; + int hour; + int minute; + int second; if (time <= 0) { - return "00:00"; + return "00:00:00"; } else { minute = time / 60; if (minute < 60) { second = time % 60; - timeStr = unitFormat(minute) + ":" + unitFormat(second); + timeStr = "00:"+unitFormat(minute) + ":" + unitFormat(second); } else { hour = minute / 60; minute = minute % 60; @@ -157,7 +157,6 @@ public class MathUtil { } return timeStr; } - public static String unitFormat(int i) { String retStr = null; if (i >= 0 && i < 10) { diff --git a/src/main/java/com/subsidy/util/MongoUtil.java b/src/main/java/com/subsidy/util/MongoUtil.java new file mode 100644 index 0000000..6c53fbc --- /dev/null +++ b/src/main/java/com/subsidy/util/MongoUtil.java @@ -0,0 +1,52 @@ +//package com.subsidy.util; +// +//import lombok.Data; +//import org.springframework.stereotype.Component; +// +//import java.util.List; +//import java.util.regex.Pattern; +// +//@Data +//@Component +//public class MongoUtil { +// public Integer pageSize; +// private Integer currentPage; +// +// +// public void start(Integer currentPage, Integer pageSize, Query query) { +// pageSize = pageSize == 0 ? 10 : pageSize; +// query.limit(pageSize); +// query.skip((currentPage - 1) * pageSize); +// this.pageSize = pageSize; +// this.currentPage = currentPage; +// } +// +// public PageHelper pageHelper(long total, List list) { +// return new PageHelper(this.currentPage, total, this.pageSize, list); +// } +// +// public PageHelper pageHelper(List list) { +// return new PageHelper(this.currentPage, this.pageSize, list); +// } +// +// public PageHelper pageHelper(long currentPage, long total, long pageSize, List list) { +// return new PageHelper(currentPage, total, pageSize, list); +// } +// +// public PageHelper pageHelper(long currentPage, long pageSize, List list) { +// return new PageHelper(currentPage, pageSize, list); +// } +// +// +// /** +// * 用于模糊查询忽略大小写 +// * +// * @param string +// * @return +// */ +// public Pattern getPattern(String string) { +// Pattern pattern = Pattern.compile("^.*" + string + ".*$", Pattern.CASE_INSENSITIVE); +// return pattern; +// } +// +//} diff --git a/src/main/java/com/subsidy/util/MyBeanUtils.java b/src/main/java/com/subsidy/util/MyBeanUtils.java new file mode 100644 index 0000000..919f1fd --- /dev/null +++ b/src/main/java/com/subsidy/util/MyBeanUtils.java @@ -0,0 +1,29 @@ +package com.subsidy.util; + +import org.springframework.beans.BeanWrapper; +import org.springframework.beans.BeanWrapperImpl; + +import java.beans.PropertyDescriptor; +import java.util.HashSet; +import java.util.Set; + +public class MyBeanUtils { + + public static String[] getNullPropertyNames (Object source) { + final BeanWrapper src = new BeanWrapperImpl(source); + PropertyDescriptor[] pds = src.getPropertyDescriptors(); + + Set emptyNames = new HashSet<>(); + for(PropertyDescriptor pd : pds) { + Object srcValue = src.getPropertyValue(pd.getName()); + // 此处判断可根据需求修改 + if (srcValue == null) { + emptyNames.add(pd.getName()); + } + } + String[] result = new String[emptyNames.size()]; + return emptyNames.toArray(result); + } + + +} diff --git a/src/main/java/com/subsidy/util/PageHelper.java b/src/main/java/com/subsidy/util/PageHelper.java new file mode 100644 index 0000000..bf37716 --- /dev/null +++ b/src/main/java/com/subsidy/util/PageHelper.java @@ -0,0 +1,30 @@ +package com.subsidy.util; + +import lombok.Data; +import org.apache.poi.ss.formula.functions.T; + +import java.util.List; + +@Data +public class PageHelper { + + private long currentPage; + private long total; + private long pageSize; + private List list; + + public PageHelper(long pageNum, long total, long pageSize, List list) { + this.currentPage = pageNum; + this.total = total; + this.pageSize = pageSize; + this.list = list; + } + + public PageHelper(long pageNum, long pageSize, List list) { + this.currentPage = pageNum; + this.pageSize = pageSize; + this.list = list; + } + + +} diff --git a/src/main/java/com/subsidy/util/QuartzUtil.java b/src/main/java/com/subsidy/util/QuartzUtil.java new file mode 100644 index 0000000..d4ec58c --- /dev/null +++ b/src/main/java/com/subsidy/util/QuartzUtil.java @@ -0,0 +1,113 @@ +package com.subsidy.util; + +import com.subsidy.common.exception.HttpException; +import org.quartz.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +import static org.quartz.DateBuilder.futureDate; + +@Component +public class QuartzUtil { + + @Autowired + private Scheduler scheduler; + + public static void main(String[] args) { + System.out.println(DateFormatUtil.parse("2022-06-28 11:30:47", "yyyy-MM-dd HH:mm:ss").getTime() -System.currentTimeMillis()); + } + + /** + * 添加定时任务,只执行一次的定时任务 + * + * @param cls 执行类 + * @param date 时间 + * @param params 参数 + * @param name 定时器名称 + * @param group 定时器组名 + */ + public void addSimpleJob(Class cls, Date date, Map params, String name, String group) { + try { + JobKey key = new JobKey(name, group); + List triggers = (List) scheduler.getTriggersOfJob(key); + if (triggers.size() == 0) { + Long time = (date.getTime() - System.currentTimeMillis()) / 1000; + JobDataMap jobDataMap = new JobDataMap(); + jobDataMap.put("params", params); + JobDetail jobDetail = JobBuilder.newJob(cls) + .withIdentity(name, group) + .usingJobData(jobDataMap) + .build(); + SimpleTrigger trigger = (SimpleTrigger) TriggerBuilder.newTrigger() + .withIdentity(name, group) + .startAt(futureDate(Math.toIntExact(time), DateBuilder.IntervalUnit.SECOND)) + .build(); + scheduler.scheduleJob(jobDetail, trigger); + if (!scheduler.isShutdown()) { + scheduler.start(); + } + } + } catch (Exception e) { + throw new HttpException(70002); + } + } + + /** + * 添加定时任务,循环不断执行的定时任务 + * + * @param cls 执行类 + * @param cron cron 表达式 + * @param params 参数 + * @param name 定时器名称 + * @param group 定时器组名 + */ + public void addCronJob(Class cls, String cron, Map params, String name, String group) { + try { + JobKey key = new JobKey(name, group); + List triggers = (List) scheduler.getTriggersOfJob(key); + if (triggers.size() == 0) { + JobDataMap jobDataMap = new JobDataMap(); + jobDataMap.put("params", params); + JobDetail jobDetail = JobBuilder.newJob(cls) + .withIdentity(name, group) + .usingJobData(jobDataMap) + .build(); + CronTrigger trigger = TriggerBuilder.newTrigger() + .withIdentity(name, group) + .withSchedule(CronScheduleBuilder.cronSchedule(cron)) + .build(); + scheduler.scheduleJob(jobDetail, trigger); + if (!scheduler.isShutdown()) { + scheduler.start(); + } + } + } catch (Exception e) { + throw new HttpException(70002); + } + } + + /** + * 删除定时器 + * + * @param name 定时器名称 + * @param group 定时器组名 + */ + public void deleteJob(String name, String group) { + try { + JobKey key = new JobKey(name, group); + List triggers = (List) scheduler.getTriggersOfJob(key); + if (triggers.size() > 0) { + TriggerKey triggerKey = TriggerKey.triggerKey(name, group); + scheduler.pauseTrigger(triggerKey); + scheduler.unscheduleJob(triggerKey); + scheduler.deleteJob(JobKey.jobKey(name, group)); + } + } catch (Exception e) { + throw new HttpException(70003); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/util/RedisUtil.java b/src/main/java/com/subsidy/util/RedisUtil.java new file mode 100644 index 0000000..0b7e9dc --- /dev/null +++ b/src/main/java/com/subsidy/util/RedisUtil.java @@ -0,0 +1,620 @@ +package com.subsidy.util; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.BoundListOperations; +import org.springframework.data.redis.core.Cursor; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ScanOptions; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + *

+ * redisTemplate封装 + *

+ * + * @author DengMin + * @since 2020/12/17 + */ + +@Component +public class RedisUtil { + + @Autowired + private RedisTemplate redisTemplate; + + public RedisUtil(RedisTemplate redisTemplate) { + this.redisTemplate = redisTemplate; + } + + /** + * 指定缓存失效时间 + * @param key 键 + * @param time 时间(秒) + * @return + */ + public boolean expire(String key,long time){ + try { + if(time>0){ + redisTemplate.expire(key, time, TimeUnit.SECONDS); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 根据key 获取过期时间 + * @param key 键 不能为null + * @return 时间(秒) 返回0代表为永久有效 + */ + public long getExpire(String key){ + return redisTemplate.getExpire(key,TimeUnit.SECONDS); + } + + /** + * 判断key是否存在 + * @param key 键 + * @return true 存在 false不存在 + */ + public boolean hasKey(String key){ + try { + return redisTemplate.hasKey(key); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 删除缓存 + * @param key 可以传一个值 或多个 + */ + @SuppressWarnings("unchecked") + public void del(String ... key){ + if(key!=null&&key.length>0){ + if(key.length==1){ + redisTemplate.delete(key[0]); + }else{ + redisTemplate.delete(CollectionUtils.arrayToList(key)); + } + } + } + + /** + * 删除缓存 + * @param key 集合数据 + */ + public void del(Set key) { + if (key != null && key.size() > 0) { + redisTemplate.delete(key); + } + } + + //============================String============================= + /** + * 普通缓存获取 + * @param key 键 + * @return 值 + */ + public Object get(String key){ + return key==null?null:redisTemplate.opsForValue().get(key); + } + + /** + * 普通缓存放入 + * @param key 键 + * @param value 值 + * @return true成功 false失败 + */ + public boolean set(String key,Object value) { + try { + redisTemplate.opsForValue().set(key, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 普通缓存放入并设置时间 + * @param key 键 + * @param value 值 + * @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期 + * @return true成功 false 失败 + */ + public boolean set(String key,Object value,long time){ + try { + if(time>0){ + redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS); + }else{ + set(key, value); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 递增 + * @param key 键 + * @param delta 要增加几(大于0) + * @return + */ + public long incr(String key, long delta){ + if(delta<0){ + throw new RuntimeException("递增因子必须大于0"); + } + return redisTemplate.opsForValue().increment(key, delta); + } + + /** + * 递减 + * @param key 键 + * @param delta 要减少几(小于0) + * @return + */ + public long decr(String key, long delta){ + if(delta<0){ + throw new RuntimeException("递减因子必须大于0"); + } + return redisTemplate.opsForValue().increment(key, -delta); + } + + //================================Map================================= + /** + * HashGet + * @param key 键 不能为null + * @param item 项 不能为null + * @return 值 + */ + public Object hget(String key,String item){ + return redisTemplate.opsForHash().get(key, item); + } + + /** + * 获取hashKey对应的所有键值 + * @param key 键 + * @return 对应的多个键值 + */ + public Map hmget(String key){ + return redisTemplate.opsForHash().entries(key); + } + + /** + * HashSet + * @param key 键 + * @param map 对应多个键值 + * @return true 成功 false 失败 + */ + public boolean hmset(String key, Map map){ + try { + redisTemplate.opsForHash().putAll(key, map); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * HashSet 并设置时间 + * @param key 键 + * @param map 对应多个键值 + * @param time 时间(秒) + * @return true成功 false失败 + */ + public boolean hmset(String key, Map map, long time){ + try { + redisTemplate.opsForHash().putAll(key, map); + if(time>0){ + expire(key, time); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 向一张hash表中放入数据,如果不存在将创建 + * @param key 键 + * @param item 项 + * @param value 值 + * @return true 成功 false失败 + */ + public boolean hset(String key,String item,Object value) { + try { + redisTemplate.opsForHash().put(key, item, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 向一张hash表中放入数据,如果不存在将创建 + * @param key 键 + * @param item 项 + * @param value 值 + * @param time 时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间 + * @return true 成功 false失败 + */ + public boolean hset(String key,String item,Object value,long time) { + try { + redisTemplate.opsForHash().put(key, item, value); + if(time>0){ + expire(key, time); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 删除hash表中的值 + * @param key 键 不能为null + * @param item 项 可以使多个 不能为null + */ + public void hdel(String key, Object... item){ + redisTemplate.opsForHash().delete(key,item); + } + + /** + * 判断hash表中是否有该项的值 + * @param key 键 不能为null + * @param item 项 不能为null + * @return true 存在 false不存在 + */ + public boolean hHasKey(String key, String item){ + return redisTemplate.opsForHash().hasKey(key, item); + } + + /** + * hash递增 如果不存在,就会创建一个 并把新增后的值返回 + * @param key 键 + * @param item 项 + * @param by 要增加几(大于0) + * @return + */ + public double hincr(String key, String item,double by){ + return redisTemplate.opsForHash().increment(key, item, by); + } + + /** + * hash递减 + * @param key 键 + * @param item 项 + * @param by 要减少记(小于0) + * @return + */ + public double hdecr(String key, String item,double by){ + return redisTemplate.opsForHash().increment(key, item,-by); + } + + //============================set============================= + /** + * 根据key获取Set中的所有值 + * @param key 键 + * @return + */ + public Set sGet(String key){ + try { + return redisTemplate.opsForSet().members(key); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 根据value从一个set中查询,是否存在 + * @param key 键 + * @param value 值 + * @return true 存在 false不存在 + */ + public boolean sHasKey(String key,Object value){ + try { + return redisTemplate.opsForSet().isMember(key, value); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 将数据放入set缓存 + * @param key 键 + * @param values 值 可以是多个 + * @return 成功个数 + */ + public long sSet(String key, Object...values) { + try { + return redisTemplate.opsForSet().add(key, values); + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 将set数据放入缓存 + * @param key 键 + * @param time 时间(秒) + * @param values 值 可以是多个 + * @return 成功个数 + */ + public long sSetAndTime(String key,long time,Object...values) { + try { + Long count = redisTemplate.opsForSet().add(key, values); + if(time>0) { + expire(key, time); + } + return count; + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 获取set缓存的长度 + * @param key 键 + * @return + */ + public long sGetSetSize(String key){ + try { + return redisTemplate.opsForSet().size(key); + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 移除值为value的 + * @param key 键 + * @param values 值 可以是多个 + * @return 移除的个数 + */ + public long setRemove(String key, Object ...values) { + try { + Long count = redisTemplate.opsForSet().remove(key, values); + return count; + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + //===============================list================================= + + /** + * 获取list缓存的内容 + * @param key 键 + * @param start 开始 + * @param end 结束 0 到 -1代表所有值 + * @return + */ + public List lGet(String key, long start, long end){ + try { + return redisTemplate.opsForList().range(key, start, end); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 获取list缓存的长度 + * @param key 键 + * @return + */ + public long lGetListSize(String key){ + try { + return redisTemplate.opsForList().size(key); + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 通过索引 获取list中的值 + * @param key 键 + * @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推 + * @return + */ + public Object lGetIndex(String key,long index){ + try { + return redisTemplate.opsForList().index(key, index); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 将list放入缓存 + * @param key 键 + * @param value 值 + * @return + */ + public boolean lSet(String key, Object value) { + try { + redisTemplate.opsForList().rightPush(key, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 将list放入缓存 + * @param key 键 + * @param value 值 + * @param time 时间(秒) + * @return + */ + public boolean lSet(String key, Object value, long time) { + try { + redisTemplate.opsForList().rightPush(key, value); + if (time > 0) { + expire(key, time); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 将list放入缓存 + * @param key 键 + * @param value 值 + * @return + */ + public boolean lSet(String key, List value) { + try { + redisTemplate.opsForList().rightPushAll(key, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 将list放入缓存 + * @param key 键 + * @param value 值 + * @param time 时间(秒) + * @return + */ + public boolean lSet(String key, List value, long time) { + try { + redisTemplate.opsForList().rightPushAll(key, value); + if (time > 0) { + expire(key, time); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 根据索引修改list中的某条数据 + * @param key 键 + * @param index 索引 + * @param value 值 + * @return + */ + public boolean lUpdateIndex(String key, long index,Object value) { + try { + redisTemplate.opsForList().set(key, index, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 移除N个值为value + * @param key 键 + * @param count 移除多少个 + * @param value 值 + * @return 移除的个数 + */ + public long lRemove(String key,long count,Object value) { + try { + Long remove = redisTemplate.opsForList().remove(key, count, value); + return remove; + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + ///** + // * 模糊查询获取key值 + // * @param pattern + // * @return + // */ + public Set keys(String pattern){ + return redisTemplate.keys(pattern); + } + + /** + * 模糊查询 + * @param pattern + * @return + */ + public Set scan(String pattern) { + return redisTemplate.execute((RedisCallback>) redisConnection -> { + Set keys = new HashSet<>(); + Cursor cursor = redisConnection.scan(new ScanOptions.ScanOptionsBuilder().match(pattern).count(Integer.MAX_VALUE).build()); + while (cursor.hasNext()) { + keys.add(new String(cursor.next())); + } + return keys; + }); + } + + /** + * 使用Redis的消息队列 + * @param channel + * @param message 消息内容 + */ + public void convertAndSend(String channel, Object message){ + redisTemplate.convertAndSend(channel,message); + } + + + //=========BoundListOperations 用法 start============ + + + /** + * 根据起始结束序号遍历Redis中的list + * @param listKey + * @param start 起始序号 + * @param end 结束序号 + * @return + */ + public List rangeList(String listKey, long start, long end) { + //绑定操作 + BoundListOperations boundValueOperations = redisTemplate.boundListOps(listKey); + //查询数据 + return boundValueOperations.range(start, end); + } + /** + * 弹出右边的值 --- 并且移除这个值 + * @param listKey + */ + public Object rifhtPop(String listKey){ + //绑定操作 + BoundListOperations boundValueOperations = redisTemplate.boundListOps(listKey); + return boundValueOperations.rightPop(); + } + + //=========BoundListOperations 用法 End============ + +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/util/ResultMode.java b/src/main/java/com/subsidy/util/ResultMode.java new file mode 100644 index 0000000..91c758b --- /dev/null +++ b/src/main/java/com/subsidy/util/ResultMode.java @@ -0,0 +1,56 @@ +package com.subsidy.util; + +public class ResultMode { + + /** + * 成功:true,失败:false + */ + private boolean success; + + /** + * 返回编码 + */ + private int resultCode; + + /** + * 返回消息 + */ + private String msg; + + /** + * 结果数据 + */ + private Object data; + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public int getResultCode() { + return resultCode; + } + + public void setResultCode(int resultCode) { + this.resultCode = resultCode; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public Object getData() { + return data; + } + + public void setData(Object data) { + this.data = data; + } +} diff --git a/src/main/java/com/subsidy/util/SMSUtils.java b/src/main/java/com/subsidy/util/SMSUtils.java index e038dd6..6a8c408 100644 --- a/src/main/java/com/subsidy/util/SMSUtils.java +++ b/src/main/java/com/subsidy/util/SMSUtils.java @@ -1,5 +1,7 @@ package com.subsidy.util; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.aliyuncs.CommonRequest; import com.aliyuncs.CommonResponse; import com.aliyuncs.DefaultAcsClient; @@ -19,6 +21,8 @@ import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombi import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.Map; + /** * 短信发送工具类 */ @@ -122,15 +126,17 @@ public class SMSUtils { // } request.putQueryParameter("TemplateParam",param); CommonResponse response = null; - try - - { + try { response = client.getCommonResponse(request); - return ConstantUtils.SUCCESS_SEND_OUT; - } catch( - Exception e) - - { + if(response != null) { + JSONObject data = JSON.parseObject(response.getData()); + if(data.get("Code").equals("OK")) { + return ConstantUtils.SUCCESS_SEND_OUT; + } + throw new HttpException(1000, data.get("Message").toString()); + } + return ConstantUtils.FAIL_SEND_OUT; + } catch(Exception e) { e.printStackTrace(); return ConstantUtils.FAIL_SEND_OUT; } diff --git a/src/main/java/com/subsidy/util/SecretUtils.java b/src/main/java/com/subsidy/util/SecretUtils.java index b8b12c2..4bff771 100644 --- a/src/main/java/com/subsidy/util/SecretUtils.java +++ b/src/main/java/com/subsidy/util/SecretUtils.java @@ -1,8 +1,13 @@ package com.subsidy.util; +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.lang3.StringUtils; + import java.math.BigInteger; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; +import java.util.Arrays; +import java.util.Random; import java.util.UUID; public class SecretUtils { @@ -17,13 +22,15 @@ public class SecretUtils { public static String getMD5String(String str) { try { // 生成一个MD5加密计算摘要 - MessageDigest md = MessageDigest.getInstance("MD5"); + return DigestUtils.md5Hex(str.toString()).toUpperCase(); + // MessageDigest md = MessageDigest.getInstance("MD5"); // 计算md5函数 - md.update(str.getBytes()); +// md.update(str.getBytes("utf-8")); // digest()最后确定返回md5 hash值,返回值为8位字符串。因为md5 hash值是16位的hex值,实际上就是8位的字符 // BigInteger函数则将8位的字符串转换成16位hex值,用字符串来表示;得到字符串形式的hash值 //一个byte是八位二进制,也就是2位十六进制字符(2的8次方等于16的2次方) - return new BigInteger(1, md.digest()).toString(16); +// byte[] digest = md.digest(str.getBytes("utf-8")); +// return new BigInteger(1, digest).toString(16); } catch (Exception e) { e.printStackTrace(); return null; @@ -57,6 +64,38 @@ public class SecretUtils { } + /** + * Q学友SHA加密 + * @param arr + * @return + */ + public static String gen(String... arr) { + if (StringUtils.isAnyEmpty(arr)) { + throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); + } else { + Arrays.sort(arr); + StringBuilder sb = new StringBuilder(); + String[] var2 = arr; + int var3 = arr.length; + + for (int var4 = 0; var4 < var3; ++var4) { + String a = var2[var4]; + sb.append(a); + } + + return DigestUtils.sha1Hex(sb.toString()); + } + } + + public static String getNonce(int length) { + String val = ""; + Random random = new Random(); + //参数length,表示生成几位随机数 + for (int i = 0; i < length; i++) { + val += String.valueOf(random.nextInt(10)); + } + return val; + } private static byte[] md5(String s) { @@ -108,9 +147,13 @@ public class SecretUtils { } } + + + public static void main(String[] args) { String uuid = UUID.randomUUID().toString(); - System.out.println(uuid); - System.out.println(hash(uuid+"ixihs")); + System.out.println(uuid.replace("-","")); +// System.out.println(hash(uuid+"ixihs")); +// System.out.println(System.currentTimeMillis()); } } \ No newline at end of file diff --git a/src/main/java/com/subsidy/util/Student.java b/src/main/java/com/subsidy/util/Student.java deleted file mode 100644 index 77f6c1c..0000000 --- a/src/main/java/com/subsidy/util/Student.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.subsidy.util; - -import lombok.Data; - -import java.util.Date; - -@Data -public class Student { - - private String name; - private int age; - private Date birthday; - private float height; - private double weight; - private boolean sex; - -} diff --git a/src/main/java/com/subsidy/util/TestMain.java b/src/main/java/com/subsidy/util/TestMain.java index 547881b..83c4e2b 100644 --- a/src/main/java/com/subsidy/util/TestMain.java +++ b/src/main/java/com/subsidy/util/TestMain.java @@ -5,11 +5,28 @@ import java.util.Random; public class TestMain { - public static void main(String[] args) { - String password = "123456"; - String saltCode = getRandomCharAndNumr(5); - String encryptString = encrypt("91ebn" + password); - System.out.println(encryptString); + public static void main(String[] args) throws Exception{ +// String password = "123456"; +// String saltCode = getRandomCharAndNumr(5); +// String encryptString = encrypt("91ebn" + password); +// System.out.println(encryptString); + + Thread thread1 = new Thread(() -> { + System.out.println("thread1"); + }); + Thread thread2 = new Thread(() -> { + System.out.println("thread2"); + }); + Thread thread3 = new Thread(() -> { + System.out.println("thread3"); + }); + thread1.start(); + thread1.join(); + thread2.start(); + thread2.join(); + thread3.start(); + thread3.join(); + } public static String encrypt(String string) { diff --git a/src/main/java/com/subsidy/util/VodUtil.java b/src/main/java/com/subsidy/util/VodUtil.java new file mode 100644 index 0000000..9676482 --- /dev/null +++ b/src/main/java/com/subsidy/util/VodUtil.java @@ -0,0 +1,81 @@ +package com.subsidy.util; + +import com.subsidy.common.configure.VODConfig; +import com.subsidy.common.exception.HttpException; +import com.tencentcloudapi.common.Credential; +import com.tencentcloudapi.common.exception.TencentCloudSDKException; +import com.tencentcloudapi.common.profile.ClientProfile; +import com.tencentcloudapi.common.profile.HttpProfile; +import com.tencentcloudapi.cvm.v20170312.models.DescribeZonesResponse; +import com.tencentcloudapi.vod.v20180717.VodClient; +import com.tencentcloudapi.vod.v20180717.models.DeleteMediaRequest; +import com.tencentcloudapi.vod.v20180717.models.MediaProcessTaskInput; +import com.tencentcloudapi.vod.v20180717.models.ProcessMediaRequest; +import com.tencentcloudapi.vod.v20180717.models.ProcessMediaResponse; +import com.tencentcloudapi.vod.v20180717.models.TranscodeTaskInput; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; + +public class VodUtil { + + @Autowired + private static VODConfig vodConfig; + + private static String endpoint = "vod.tencentcloudapi.com"; + + /** + * 根据视频模版进行转码 + * @param vodCode + * @return + */ + public static ProcessMediaResponse processMedia(String vodCode) { + try { + //上传后直接转码 + Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint(endpoint); + + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + + VodClient client = new VodClient(cred, "", clientProfile); + + ProcessMediaRequest processMediaRequest = new ProcessMediaRequest(); + MediaProcessTaskInput mediaProcessTaskInput1 = new MediaProcessTaskInput(); + TranscodeTaskInput[] transcodeTaskInputs1 = new TranscodeTaskInput[1]; + TranscodeTaskInput transcodeTaskInput1 = new TranscodeTaskInput(); + transcodeTaskInput1.setDefinition(ConstantUtils.TEMPLATE_VOD); + transcodeTaskInputs1[0] = transcodeTaskInput1; + mediaProcessTaskInput1.setTranscodeTaskSet(transcodeTaskInputs1); + processMediaRequest.setMediaProcessTask(mediaProcessTaskInput1); + processMediaRequest.setFileId(vodCode); + return client.ProcessMedia(processMediaRequest); + } catch (Exception ex) { + throw new HttpException(50001); + } + } + + /** + * 删除腾讯云上原视频 + * @param vodCode + */ + public static void deleteMedia(String vodCode) { + try { + //删除原视频 + Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint(endpoint); + + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + + VodClient client = new VodClient(cred, "", clientProfile); + // 实例化一个请求对象,每个接口都会对应一个request对象 + DeleteMediaRequest req = new DeleteMediaRequest(); + req.setFileId(vodCode); + // 返回的resp是一个DeleteMediaResponse的实例,与请求对象对应 + client.DeleteMedia(req); + } catch (TencentCloudSDKException e) { + } + } +} diff --git a/src/main/java/com/subsidy/util/ZipTestUtils.java b/src/main/java/com/subsidy/util/ZipTestUtils.java deleted file mode 100644 index 9ed291c..0000000 --- a/src/main/java/com/subsidy/util/ZipTestUtils.java +++ /dev/null @@ -1,300 +0,0 @@ -package com.subsidy.util; - -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.util.CellRangeAddress; -import org.apache.poi.ss.usermodel.CellStyle; -import org.apache.poi.ss.usermodel.Font; -import org.apache.poi.xssf.streaming.SXSSFCell; -import org.apache.poi.xssf.streaming.SXSSFRow; -import org.apache.poi.xssf.streaming.SXSSFSheet; -import org.apache.poi.xssf.streaming.SXSSFWorkbook; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.nio.charset.StandardCharsets; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - -public class ZipTestUtils { - - /* - 原链接:https://blog.csdn.net/houxuehan/article/details/89189820 - */ - - public static String NO_DEFINE = "no_define";//未定义的字段 - public static String DEFAULT_DATE_PATTERN = "yyyy年MM月dd日";//默认日期格式 - public static int DEFAULT_COLOUMN_WIDTH = 17; - - /** - * 导出Excel 2007 OOXML (.xlsx)格式 - * - * @param title 标题行 - * @param headList 属性-列头 - * @param students 数据集 - * @param datePattern 日期格式,传null值则默认 年月日 - * @param colWidth 列宽 默认 至少17个字节 - * @param out 输出流 - */ - public static void exportExcelX(String title, List headList, List students, String datePattern, int colWidth, OutputStream out) { - if (datePattern == null) { - datePattern = DEFAULT_DATE_PATTERN; - } - // 声明一个工作薄 - SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 - workbook.setCompressTempFiles(true); - //表头样式 - CellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); - Font titleFont = workbook.createFont(); - titleFont.setFontHeightInPoints((short) 20); - titleFont.setBoldweight((short) 700); - titleStyle.setFont(titleFont); - // 列头样式 - CellStyle headerStyle = workbook.createCellStyle(); - headerStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - headerStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); - headerStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); - headerStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); - headerStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); - headerStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); - Font headerFont = workbook.createFont(); - headerFont.setFontHeightInPoints((short) 12); - headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); - headerStyle.setFont(headerFont); - // 单元格样式 - CellStyle cellStyle = workbook.createCellStyle(); - cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); - cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); - cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); - cellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); - cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); - cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); - Font cellFont = workbook.createFont(); - cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); - cellStyle.setFont(cellFont); - // 生成一个(带标题)表格 - SXSSFSheet sheet = workbook.createSheet(); - //设置列宽 - int minBytes = colWidth < DEFAULT_COLOUMN_WIDTH ? DEFAULT_COLOUMN_WIDTH : colWidth;//至少字节数 - int[] arrColWidth = new int[headList.size()]; - // 产生表格标题行,以及设置列宽 - String[] properties = new String[headList.size()]; - String[] headers = new String[headList.size()]; - int ii = 0; - for (int i = 0 ;i < headList.size(); i++) { - - //properties[ii] = fieldName; - headers[ii] = headList.get(i); - - int bytes = headList.get(i).getBytes().length; - arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; - sheet.setColumnWidth(ii, arrColWidth[ii] * 256); - ii++; - } - // 遍历集合数据,产生数据行 - int rowIndex = 0; - for (Student student : students) { - if (rowIndex == 65535 || rowIndex == 0) { - if (rowIndex != 0) { - sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 - } - SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 - titleRow.createCell(0).setCellValue(title); - titleRow.getCell(0).setCellStyle(titleStyle); - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headList.size() - 1)); - - SXSSFRow headerRow = sheet.createRow(1); //列头 rowIndex =1 - for (int i = 0; i < headers.length; i++) { - headerRow.createCell(i).setCellValue(headers[i]); - headerRow.getCell(i).setCellStyle(headerStyle); - - } - rowIndex = 2;//数据内容从 rowIndex=2开始 - } - - SXSSFRow dataRow = sheet.createRow(rowIndex); - - SXSSFCell newCell = dataRow.createCell(0); - newCell.setCellStyle(cellStyle); - newCell.setCellValue(student.getName()); - - newCell = dataRow.createCell(1); - //newCell.setCellStyle(cellStyle); - newCell.setCellValue(student.getAge()); - - newCell = dataRow.createCell(2); - newCell.setCellValue(new SimpleDateFormat(datePattern).format(student.getBirthday())); - - newCell = dataRow.createCell(3); - newCell.setCellValue(student.getHeight()); - - newCell = dataRow.createCell(4); - newCell.setCellValue(student.getWeight()); - - newCell = dataRow.createCell(5); - newCell.setCellValue(student.isSex()); - - // - //for (int i = 0; i < properties.length; i++) { - // - // Object o = jo.get(properties[i]); - // String cellValue = ""; - // if (o == null) { - // cellValue = ""; - // } else if (o instanceof Date) { - // cellValue = new SimpleDateFormat(datePattern).format(o); - // } - // /*else if(o instanceof Float || o instanceof Double) { - // double d = (double) o; - // if(d%1==0) cellValue=o.toString(); - // else cellValue= new BigDecimal(o.toString()).setScale(2,BigDecimal.ROUND_HALF_UP).toString(); - // }*/ - // else { - // cellValue = o.toString(); - // } - // newCell.setCellValue(cellValue); - // newCell.setCellStyle(cellStyle); - //} - rowIndex++; - } - // 自动调整宽度 - /*for (int i = 0; i < headers.length; i++) { - sheet.autoSizeColumn(i); - }*/ - try { - workbook.write(out); - workbook.close(); - workbook.dispose(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * 压缩单个excel文件的输出流 到zip输出流,注意zipOutputStream未关闭,需要交由调用者关闭之 - * - * @param zipOutputStream zip文件的输出流 - * @param excelOutputStream excel文件的输出流 - * @param excelFilename 文件名可以带目录,例如 TestDir/test1.xlsx - */ - public static void compressFileToZipStream(ZipOutputStream zipOutputStream, - ByteArrayOutputStream excelOutputStream, String excelFilename) { - byte[] buf = new byte[1024]; - try { - // Compress the files - byte[] content = excelOutputStream.toByteArray(); - ByteArrayInputStream is = new ByteArrayInputStream(content); - BufferedInputStream bis = new BufferedInputStream(is); - // Add ZIP entry to output stream. - zipOutputStream.putNextEntry(new ZipEntry(excelFilename)); - // Transfer bytes from the file to the ZIP file - int len; - while ((len = bis.read(buf)) > 0) { - zipOutputStream.write(buf, 0, len); - } - // Complete the entry - //excelOutputStream.close();//关闭excel输出流 - zipOutputStream.closeEntry(); - bis.close(); - is.close(); - // Complete the ZIP file - } catch (IOException e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) throws IOException { - int count = 100; - List list = new ArrayList<>(); - for (int i = 0; i < count; i++) { - Student s = new Student(); - s.setName("POI" + i); - s.setAge(i); - s.setBirthday(new Date()); - s.setHeight(i); - s.setWeight(i); - s.setSex(i / 2 != 0); - list.add(s); - } - //Map headMap = new LinkedHashMap(); - //headMap.put("name", "姓名"); - //headMap.put("age", "年龄"); - //headMap.put("birthday", "生日"); - //headMap.put("height", "身高"); - //headMap.put("weight", "体重"); - //headMap.put("sex", "性别"); - - List memberList = Arrays.asList("成员名称","账号","联系方式","签到次数","课程进度","培训时长","评级测试","答疑"); - - - //导出zip - OutputStream outXlsx = new FileOutputStream("E://test.zip"); - ZipOutputStream zipOutputStream = new ZipOutputStream(outXlsx); - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - exportExcelX("testExcel", memberList, list, null, 0, baos); - compressFileToZipStream(zipOutputStream, baos, "/test/aaa.xlsx"); - baos.close(); - - zipOutputStream.flush(); - zipOutputStream.close(); - outXlsx.close(); - - System.out.println("导出zip完成"); - } - - - public void exportZip(HttpServletResponse response, List students) throws Exception { - - ServletOutputStream sos = response.getOutputStream(); - ZipOutputStream zipOutputStream = new ZipOutputStream(sos); - String zipname = "test.zip"; - response.reset(); - response.setContentType("application/x-download"); - response.setHeader("Content-Disposition", "attachment;filename=" + new String((zipname).getBytes(), StandardCharsets.ISO_8859_1)); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - - /** - * 班级成员 - */ - List memberList = Arrays.asList("成员名称","账号","联系方式","签到次数","课程进度","培训时长","评级测试","答疑"); - - /** - * 注册签到 - */ - List signList = Arrays.asList("成员名称","培训时长","课程进度","完成率"); - - /** - * 测试成绩 - */ - List scoreList = Arrays.asList("成员名称","测试结果","最高分"); - - /** - * 答疑记录 - */ - List answerList = Arrays.asList("提问","答疑","提问时间","提问成员","答疑时间"); - - //Map headMap = new LinkedHashMap(); - //headMap.put("name", "成员名称"); - //headMap.put("age", "年龄"); - //headMap.put("birthday", "生日"); - //headMap.put("height", "身高"); - //headMap.put("weight", "体重"); - //headMap.put("sex", "性别"); - - exportExcelX("title", memberList, students, null, 0, baos); - compressFileToZipStream(zipOutputStream, baos, "/test/aaa.xlsx"); - baos.close(); - - zipOutputStream.flush(); - zipOutputStream.close(); - sos.close(); - System.out.println("导出zip完成"); - } - -} diff --git a/src/main/java/com/subsidy/util/ZipUtils.java b/src/main/java/com/subsidy/util/ZipUtils.java deleted file mode 100644 index d4e9c17..0000000 --- a/src/main/java/com/subsidy/util/ZipUtils.java +++ /dev/null @@ -1,260 +0,0 @@ -package com.subsidy.util; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.util.CellRangeAddress; -import org.apache.poi.ss.usermodel.CellStyle; -import org.apache.poi.ss.usermodel.Font; -import org.apache.poi.xssf.streaming.SXSSFCell; -import org.apache.poi.xssf.streaming.SXSSFRow; -import org.apache.poi.xssf.streaming.SXSSFSheet; -import org.apache.poi.xssf.streaming.SXSSFWorkbook; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.nio.charset.StandardCharsets; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - -public class ZipUtils { - - /* - 原链接:https://blog.csdn.net/houxuehan/article/details/89189820 - */ - - public static String NO_DEFINE = "no_define";//未定义的字段 - public static String DEFAULT_DATE_PATTERN = "yyyy年MM月dd日";//默认日期格式 - public static int DEFAULT_COLOUMN_WIDTH = 17; - - /** - * 导出Excel 2007 OOXML (.xlsx)格式 - * - * @param title 标题行 - * @param headMap 属性-列头 - * @param jsonArray 数据集 - * @param datePattern 日期格式,传null值则默认 年月日 - * @param colWidth 列宽 默认 至少17个字节 - * @param out 输出流 - */ - public static void exportExcelX(String title, Map headMap, JSONArray jsonArray, String datePattern, int colWidth, OutputStream out) { - if (datePattern == null) { - datePattern = DEFAULT_DATE_PATTERN; - } - // 声明一个工作薄 - SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 - workbook.setCompressTempFiles(true); - //表头样式 - CellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); - Font titleFont = workbook.createFont(); - titleFont.setFontHeightInPoints((short) 20); - titleFont.setBoldweight((short) 700); - titleStyle.setFont(titleFont); - // 列头样式 - CellStyle headerStyle = workbook.createCellStyle(); - headerStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - headerStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); - headerStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); - headerStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); - headerStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); - headerStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); - Font headerFont = workbook.createFont(); - headerFont.setFontHeightInPoints((short) 12); - headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); - headerStyle.setFont(headerFont); - // 单元格样式 - CellStyle cellStyle = workbook.createCellStyle(); - cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); - cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); - cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); - cellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); - cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); - cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); - Font cellFont = workbook.createFont(); - cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); - cellStyle.setFont(cellFont); - // 生成一个(带标题)表格 - SXSSFSheet sheet = workbook.createSheet(); - //设置列宽 - int minBytes = colWidth < DEFAULT_COLOUMN_WIDTH ? DEFAULT_COLOUMN_WIDTH : colWidth;//至少字节数 - int[] arrColWidth = new int[headMap.size()]; - // 产生表格标题行,以及设置列宽 - String[] properties = new String[headMap.size()]; - String[] headers = new String[headMap.size()]; - int ii = 0; - for (Iterator iter = headMap.keySet().iterator(); iter - .hasNext(); ) { - String fieldName = iter.next(); - - properties[ii] = fieldName; - headers[ii] = headMap.get(fieldName); - - int bytes = fieldName.getBytes().length; - arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; - sheet.setColumnWidth(ii, arrColWidth[ii] * 256); - ii++; - } - // 遍历集合数据,产生数据行 - int rowIndex = 0; - for (Object obj : jsonArray) { - if (rowIndex == 65535 || rowIndex == 0) { - if (rowIndex != 0) { - sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 - } - SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 - titleRow.createCell(0).setCellValue(title); - titleRow.getCell(0).setCellStyle(titleStyle); - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headMap.size() - 1)); - - SXSSFRow headerRow = sheet.createRow(1); //列头 rowIndex =1 - for (int i = 0; i < headers.length; i++) { - headerRow.createCell(i).setCellValue(headers[i]); - headerRow.getCell(i).setCellStyle(headerStyle); - - } - rowIndex = 2;//数据内容从 rowIndex=2开始 - } - JSONObject jo = (JSONObject) JSONObject.toJSON(obj); - SXSSFRow dataRow = sheet.createRow(rowIndex); - for (int i = 0; i < properties.length; i++) { - SXSSFCell newCell = dataRow.createCell(i); - - Object o = jo.get(properties[i]); - String cellValue = ""; - if (o == null) { - cellValue = ""; - } else if (o instanceof Date) { - cellValue = new SimpleDateFormat(datePattern).format(o); - } - /*else if(o instanceof Float || o instanceof Double) { - double d = (double) o; - if(d%1==0) cellValue=o.toString(); - else cellValue= new BigDecimal(o.toString()).setScale(2,BigDecimal.ROUND_HALF_UP).toString(); - }*/ - else { - cellValue = o.toString(); - } - newCell.setCellValue(cellValue); - newCell.setCellStyle(cellStyle); - } - rowIndex++; - } - // 自动调整宽度 - /*for (int i = 0; i < headers.length; i++) { - sheet.autoSizeColumn(i); - }*/ - try { - workbook.write(out); - workbook.close(); - workbook.dispose(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * 压缩单个excel文件的输出流 到zip输出流,注意zipOutputStream未关闭,需要交由调用者关闭之 - * - * @param zipOutputStream zip文件的输出流 - * @param excelOutputStream excel文件的输出流 - * @param excelFilename 文件名可以带目录,例如 TestDir/test1.xlsx - */ - public static void compressFileToZipStream(ZipOutputStream zipOutputStream, - ByteArrayOutputStream excelOutputStream, String excelFilename) { - byte[] buf = new byte[1024]; - try { - // Compress the files - byte[] content = excelOutputStream.toByteArray(); - ByteArrayInputStream is = new ByteArrayInputStream(content); - BufferedInputStream bis = new BufferedInputStream(is); - // Add ZIP entry to output stream. - zipOutputStream.putNextEntry(new ZipEntry(excelFilename)); - // Transfer bytes from the file to the ZIP file - int len; - while ((len = bis.read(buf)) > 0) { - zipOutputStream.write(buf, 0, len); - } - // Complete the entry - //excelOutputStream.close();//关闭excel输出流 - zipOutputStream.closeEntry(); - bis.close(); - is.close(); - // Complete the ZIP file - } catch (IOException e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) throws IOException { - int count = 100; - JSONArray ja = new JSONArray(); - for (int i = 0; i < count; i++) { - Student s = new Student(); - s.setName("POI" + i); - s.setAge(i); - s.setBirthday(new Date()); - s.setHeight(i); - s.setWeight(i); - s.setSex(i / 2 != 0); - ja.add(s); - } - Map headMap = new LinkedHashMap(); - headMap.put("name", "姓名"); - headMap.put("age", "年龄"); - headMap.put("birthday", "生日"); - headMap.put("height", "身高"); - headMap.put("weight", "体重"); - headMap.put("sex", "性别"); - //导出zip - OutputStream outXlsx = new FileOutputStream("E://test.zip"); - ZipOutputStream zipOutputStream = new ZipOutputStream(outXlsx); - - for (int i = 1; i < 6; i++) { - String dir = i % 2 == 0 ? "dirA" : "dirB"; - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - exportExcelX("testExcel", headMap, ja, null, 0, baos); - compressFileToZipStream(zipOutputStream, baos, dir + "/test" + i + ".xlsx"); - baos.close(); - } - zipOutputStream.flush(); - zipOutputStream.close(); - outXlsx.close(); - - System.out.println("导出zip完成"); - } - - - public void exportZip(HttpServletResponse response) throws Exception { - - ServletOutputStream sos = response.getOutputStream(); - ZipOutputStream zipOutputStream = new ZipOutputStream(sos); - String zipname = "test.zip"; - response.reset(); - response.setContentType("application/x-download"); - response.setHeader("Content-Disposition", "attachment;filename=" + new - - String((zipname). - - getBytes(), StandardCharsets.ISO_8859_1)); - for (int i = 1; i < 6; i++) { - String dir = i % 2 == 0 ? "dirA" : "dirB"; - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - //exportExcelX(title, headMap, ja, null, 0, baos); - compressFileToZipStream(zipOutputStream, baos, dir + "/test" + i + ".xlsx"); - baos.close(); - } - zipOutputStream.flush(); - zipOutputStream.close(); - sos.close(); - System.out.println("导出zip完成"); - } -} diff --git a/src/main/java/com/subsidy/util/excel/ExcelColumn.java b/src/main/java/com/subsidy/util/excel/ExcelColumn.java index ca1690d..4344502 100644 --- a/src/main/java/com/subsidy/util/excel/ExcelColumn.java +++ b/src/main/java/com/subsidy/util/excel/ExcelColumn.java @@ -1,6 +1,11 @@ package com.subsidy.util.excel; -import java.lang.annotation.*; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/com/subsidy/util/excel/ExcelColumnUtil.java b/src/main/java/com/subsidy/util/excel/ExcelColumnUtil.java index 873ab06..e54be8f 100644 --- a/src/main/java/com/subsidy/util/excel/ExcelColumnUtil.java +++ b/src/main/java/com/subsidy/util/excel/ExcelColumnUtil.java @@ -1,6 +1,11 @@ package com.subsidy.util.excel; -import java.lang.annotation.*; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** *

diff --git a/src/main/java/com/subsidy/util/excel/ExcelUtil.java b/src/main/java/com/subsidy/util/excel/ExcelUtil.java index fe908b4..86d6ad2 100644 --- a/src/main/java/com/subsidy/util/excel/ExcelUtil.java +++ b/src/main/java/com/subsidy/util/excel/ExcelUtil.java @@ -1,6 +1,8 @@ package com.subsidy.util.excel; +import com.subsidy.model.MemberDO; import com.subsidy.vo.administer.ExerciseTestVO; +import com.subsidy.vo.administer.MemberStudyLogVO; import com.subsidy.vo.classdict.ClassDetailVO; import com.subsidy.vo.member.ClassSignVO; import com.subsidy.vo.sign.AnswerRecordVO; @@ -14,7 +16,14 @@ import org.apache.poi.hssf.usermodel.HSSFDateUtil; import org.apache.poi.hssf.usermodel.HSSFFont; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.util.CellRangeAddress; -import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.DateUtil; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.streaming.SXSSFCell; import org.apache.poi.xssf.streaming.SXSSFRow; import org.apache.poi.xssf.streaming.SXSSFSheet; @@ -24,18 +33,26 @@ import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.multipart.MultipartFile; -import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; -import java.io.*; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.math.BigDecimal; import java.net.URLEncoder; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import java.util.stream.Stream; -import java.util.zip.ZipOutputStream; /** * Excel工具 @@ -174,78 +191,173 @@ public class ExcelUtil { } /** - * 导出excel文件 + * 导入excel文件 * - * @param list + * @param path * @param cls + * @param file * @param + * @return */ - public static void writeExcel(List list, Class cls) { - ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); - HttpServletResponse response = servletRequestAttributes.getResponse(); - Field[] fields = cls.getDeclaredFields(); - List fieldList = Arrays.stream(fields).filter(field -> { - ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); - if (annotation != null) { - field.setAccessible(true); - return true; + public static List readExcelWithoutTitle(String path, Class cls, MultipartFile file) { + String fileName = file.getOriginalFilename(); + if (!fileName.matches("^.+\\.(?i)(xls)$") && !fileName.matches("^.+\\.(?i)(xlsx)$")) { + log.info("上传文件格式不正确"); +// throw new HTTPException(10022); + } + + List dataList = new ArrayList<>(); + Workbook workbook = null; + try { + InputStream is = file.getInputStream(); + if (fileName.endsWith(EXCEL2007)) { + // FileInputStream is = new FileInputStream(new File(path)); + workbook = new XSSFWorkbook(is); } - return false; - }).sorted(Comparator.comparing(field -> { - int col = 0; - ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); - if (annotation != null) { - col = annotation.col(); + + if (fileName.endsWith(EXCEL2003)) { + // FileInputStream is = new FileInputStream(new File(path)); + workbook = new HSSFWorkbook(is); } - return col; - })).collect(Collectors.toList()); - Workbook wb = new XSSFWorkbook(); - Sheet sheet = wb.createSheet(); - AtomicInteger ai = new AtomicInteger(); - { - Row row = sheet.createRow(ai.getAndIncrement()); - AtomicInteger at = new AtomicInteger(); - fieldList.forEach(field -> { - ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); - String columnName = ""; - if (annotation != null) { - columnName = annotation.value(); - } - Cell cell = row.createCell(at.getAndIncrement()); - CellStyle cellStyle = wb.createCellStyle(); - cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); - Font font = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - cellStyle.setFont(font); - cell.setCellStyle(cellStyle); - cell.setCellValue(columnName); - }); + if (workbook != null) { + Map> classMap = new HashMap<>(); + List fields = Stream.of(cls.getDeclaredFields()).collect(Collectors.toList()); + fields.forEach(field -> { + ExcelColumnUtil annotation = field.getAnnotation(ExcelColumnUtil.class); + if (annotation != null) { + String value = annotation.value(); + if (StringUtils.isBlank(value)) { + return; + } + + if (!classMap.containsKey(value)) { + classMap.put(value, new ArrayList<>()); + } + + field.setAccessible(true); + classMap.get(value).add(field); + } + }); + //索引-->columns + Map> reflectionMap = new HashMap<>(); + //默认读取第一个sheet + Sheet sheet = workbook.getSheetAt(0); + + boolean firstRow = true; + for (int i = 1; i <= sheet.getLastRowNum(); i++) { + Row row = sheet.getRow(i); + //提取标题 + if (firstRow) { + for (int j = 0; j <= row.getLastCellNum(); j++) { + Cell cell = row.getCell(j); + String cellValue = getCellValue(cell); + if (classMap.containsKey(cellValue)) { + reflectionMap.put(j, classMap.get(cellValue)); + } + } + + firstRow = false; + } else { + //忽略空白行 + if (row == null) { + continue; + } - if (list != null) { - list.forEach(data -> { - Row r = sheet.createRow(ai.getAndIncrement()); - AtomicInteger a = new AtomicInteger(); - fieldList.forEach(field -> { try { - Class type = field.getType(); - Object value = field.get(data); - Cell cell = r.createCell(a.getAndIncrement()); - if (value != null) { - cell.setCellValue(value.toString()); + T t = cls.newInstance(); + //判断是否为空白行 + boolean allBlank = true; + for (int j = 0; j <= row.getLastCellNum(); j++) { + if (reflectionMap.containsKey(j)) { + Cell cell = row.getCell(j); + String cellValue = getCellValue(cell); + if (StringUtils.isNotBlank(cellValue)) { + allBlank = false; + } + List fieldList = reflectionMap.get(j); + fieldList.forEach(x -> { + try { + handleField(t, cellValue, x); + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("reflect field:%s value:%s exception!", x.getName(), cellValue), e); + } + }); + } } - } catch (IllegalAccessException e) { + + if (!allBlank) { + dataList.add(t); + } + } catch (Exception e) { e.printStackTrace(); + log.error(String.format("parse row:%s exception!", i), e); } - }); - }); - for (int i = 0; i < list.size(); i++) { - sheet.autoSizeColumn(i); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse excel exception!"), e); + } finally { + if (workbook != null) { + try { + workbook.close(); + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse excel exception!"), e); } } - String fileName = String.valueOf(new Date().getTime()); - buildExcelDocument(fileName + "." + EXCEL2007, wb, response); } + return dataList; + } + + public static void writeExcel(List memberIds, HashMap> hashMap, List dates) { + ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = servletRequestAttributes.getResponse(); + + Workbook wb = new XSSFWorkbook(); + Sheet sheet = wb.createSheet(); + AtomicInteger ai = new AtomicInteger(); + + Row row = sheet.createRow(ai.getAndIncrement()); + AtomicInteger at = new AtomicInteger(); + dates.forEach(field -> { + Cell cell = row.createCell(at.getAndIncrement()); + CellStyle cellStyle = wb.createCellStyle(); + cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + Font font = wb.createFont(); + font.setBoldweight(Font.BOLDWEIGHT_BOLD); + cellStyle.setFont(font); + cell.setCellStyle(cellStyle); + cell.setCellValue(field); + }); + + if (hashMap != null) { + memberIds.forEach(data -> { + Row r = sheet.createRow(ai.getAndIncrement()); + AtomicInteger a = new AtomicInteger(); + Cell cell = r.createCell(at.getAndIncrement()); + CellStyle cellStyle = wb.createCellStyle(); + cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + cell.setCellStyle(cellStyle); + HashMap hashMap1 = hashMap.get(data); + dates.forEach(field -> { + System.out.println(data + "========"); + System.out.println(field); + Cell cell1 = r.createCell(a.getAndIncrement()); + if (null != hashMap1) { + cell1.setCellValue(null == hashMap1.get(field) ? 0 : hashMap1.get(field)); + } else { + cell1.setCellValue(0); + } + }); + }); + } + String fileName = String.valueOf(new Date().getTime()); + buildExcelDocument(fileName + "." + EXCEL2007, wb, response); + } public static void writeMemberExcel(String companyName, String studyDate, String courseName, String title, List list, List headerList) throws Exception { @@ -354,7 +466,7 @@ public class ExcelUtil { sheet.addMergedRegion(cellRangeAddress21); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 - CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 10); + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 12); sheet.addMergedRegion(cellRangeAddress22); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 @@ -370,7 +482,7 @@ public class ExcelUtil { sheet.addMergedRegion(cellRangeAddress31); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 - CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 10); + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 12); sheet.addMergedRegion(cellRangeAddress32); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 thirdRow.createCell(0).setCellValue(thirdHead[0]); @@ -415,42 +527,45 @@ public class ExcelUtil { newCell.setCellStyle(cellStyle); newCell.setCellValue(classDetailVO.getIdCard()); - newCell = dataRow.createCell(3); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classDetailVO.getAccountName()); + newCell.setCellValue(classDetailVO.getGender()); newCell = dataRow.createCell(4); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classDetailVO.getTelephone()); + newCell.setCellValue(classDetailVO.getAccountName()); newCell = dataRow.createCell(5); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classDetailVO.getSignCounts()); + newCell.setCellValue(classDetailVO.getTelephone()); newCell = dataRow.createCell(6); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classDetailVO.getClassProcess()); + newCell.setCellValue(classDetailVO.getSignCounts()); newCell = dataRow.createCell(7); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classDetailVO.getTrainingLengthStr()); + newCell.setCellValue(classDetailVO.getClassProcess()); newCell = dataRow.createCell(8); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classDetailVO.getAskCounts()); + newCell.setCellValue(classDetailVO.getTrainingLengthStr()); newCell = dataRow.createCell(9); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classDetailVO.getScore()); + newCell.setCellValue(classDetailVO.getTrainingLengthMinute()); newCell = dataRow.createCell(10); newCell.setCellStyle(cellStyle); - if (classDetailVO.getScore() >= 60) { - newCell.setCellValue("合格"); - } else { - newCell.setCellValue("不合格"); - } + newCell.setCellValue(classDetailVO.getAskCounts()); + + newCell = dataRow.createCell(11); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getScore()); + + newCell = dataRow.createCell(12); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getResult()); rowIndex++; seq++; @@ -466,7 +581,7 @@ public class ExcelUtil { } } - public static void writeSignExcel(String companyName, String studyDate, String courseName, String title, Listlist, List headerList) throws Exception { + public static void writeSignExcel(String companyName, String studyDate, String courseName, String title, List list, List headerList) throws Exception { ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); HttpServletResponse response = requestAttributes.getResponse(); @@ -582,7 +697,7 @@ public class ExcelUtil { sheet.addMergedRegion(cellRangeAddress21); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 - CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 8); + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 9); sheet.addMergedRegion(cellRangeAddress22); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 @@ -598,7 +713,7 @@ public class ExcelUtil { sheet.addMergedRegion(cellRangeAddress31); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 - CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 8); + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 9); sheet.addMergedRegion(cellRangeAddress32); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 thirdRow.createCell(0).setCellValue(thirdHead[0]); @@ -654,18 +769,22 @@ public class ExcelUtil { newCell = dataRow.createCell(5); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classSignVO.getClassProcess()); + newCell.setCellValue(classSignVO.getTrainingLengthMinute()); newCell = dataRow.createCell(6); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classSignVO.getPercent()); + newCell.setCellValue(classSignVO.getClassProcess()); newCell = dataRow.createCell(7); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classSignVO.getSignCounts()); + newCell.setCellValue(classSignVO.getPercent()); newCell = dataRow.createCell(8); newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getSignCounts()); + + newCell = dataRow.createCell(9); + newCell.setCellStyle(cellStyle); newCell.setCellValue(classSignVO.getSignInDateList()); rowIndex++; @@ -872,17 +991,17 @@ public class ExcelUtil { //次数 newCell = dataRow.createCell(5); newCell.setCellStyle(cellStyle); - if (exerciseTestVO.getScore()!=0){ - newCell.setCellValue(1); - }else { + if (exerciseTestVO.getScore() != 0) { + newCell.setCellValue(exerciseTestVO.getCount()); + } else { newCell.setCellValue(0); } newCell = dataRow.createCell(6); newCell.setCellStyle(cellStyle); - if (exerciseTestVO.getScore()>=60){ + if (exerciseTestVO.getScore() >= 60) { newCell.setCellValue("合格"); - }else { + } else { newCell.setCellValue("不合格"); } @@ -1033,7 +1152,7 @@ public class ExcelUtil { sheet.addMergedRegion(cellRangeAddress31); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 - CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 3,5); + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 3, 5); sheet.addMergedRegion(cellRangeAddress32); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 thirdRow.createCell(0).setCellValue(thirdHead[0]); @@ -1107,6 +1226,171 @@ public class ExcelUtil { } } + public static void writeMemberStudyLog(MemberDO memberDO, String title, List list, List headerList) throws Exception { + + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = requestAttributes.getResponse(); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.addHeader("content-disposition", "attachment;filename=" + + java.net.URLEncoder.encode("studyLog.xlsx", "utf-8")); + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + titleStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + titleStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + titleStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + titleStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + titleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + secondFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[6]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[6]; + List secondList = Arrays.asList("成员名称:" + memberDO.getUserName(), "性别:" + memberDO.getGender(), "身份证号码", memberDO.getIdCard(), "联系方式", memberDO.getTelephone()); + + ii = 0; + for (int i = 0; i < 6; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + ////第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + //CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 4); + //sheet.addMergedRegion(cellRangeAddress21); + //setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + // + //CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 10); + //sheet.addMergedRegion(cellRangeAddress22); + //setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + // + + for (int j = 0; j < secondList.size(); j++) { + Cell cell = secondRow.createCell(j); + cell.setCellStyle(secondStyle); + cell.setCellValue(secondList.get(j)); + + } + + //标题 3 + SXSSFRow headerRow = sheet.createRow(2); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + //内容 + int rowIndex = 0; + for (MemberStudyLogVO memberStudyLogVO : list) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 3;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(memberStudyLogVO.getStartDate()); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(memberStudyLogVO.getEndDate()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(memberStudyLogVO.getVodName()); + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(memberStudyLogVO.getStudyType()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(memberStudyLogVO.getPlayLength()); + + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(memberStudyLogVO.getTotalLength()); + + rowIndex++; + + } + + try { + OutputStream outputStream = response.getOutputStream(); + workbook.write(outputStream); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + private static void setStyle(CellStyle cellStyle) { // 水平居中 cellStyle.setAlignment(CellStyle.ALIGN_CENTER); diff --git a/src/main/java/com/subsidy/util/websocket/WebSocketUtil.java b/src/main/java/com/subsidy/util/websocket/WebSocketUtil.java new file mode 100644 index 0000000..f9d6cc5 --- /dev/null +++ b/src/main/java/com/subsidy/util/websocket/WebSocketUtil.java @@ -0,0 +1,187 @@ +package com.subsidy.util.websocket; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.ResponseData; +import com.subsidy.mapper.OprMemDictMapper; +import com.subsidy.model.OprMemDictDO; +import com.subsidy.util.DateFormatUtil; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.socket.CloseStatus; +import org.springframework.web.socket.TextMessage; +import org.springframework.web.socket.WebSocketHandler; +import org.springframework.web.socket.WebSocketMessage; +import org.springframework.web.socket.WebSocketSession; +import java.io.IOException; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +/** + *

+ * WebSocket + *

+ * + * @author DengMin + * @since 2022/7/13 + */ +@Slf4j +@Component +public class WebSocketUtil implements WebSocketHandler { + + @Autowired + private OprMemDictMapper oprMemDictMapper; + + /** + * 存放建立连接webSocket对象 + */ + private ConcurrentHashMap webSocketMap = new ConcurrentHashMap(); + + ConcurrentHashMap taskMap = new ConcurrentHashMap<>(1); + + /** + * 处理成功连接WebSocket + * @param session + */ + @Override + public void afterConnectionEstablished(WebSocketSession session) throws IOException { + if(null != session) { + String params = session.getUri().getQuery(); + Long id = Long.valueOf(params.split("=")[1]); + if(null != webSocketMap && webSocketMap.get(id) != null) { + if(webSocketMap.get(id).isOpen()) { + /* + 相同账户进行挤号,发送消息给前者WebSocket通知账户已在其他地方登录 + */ + webSocketMap.get(id).sendMessage(new TextMessage(JSONObject.toJSONString(ResponseData.generateCreatedResponse(1011)))); + webSocketMap.get(id).close(); + } else { + /* + * 如果上次连接的WebSocket状态是关闭,并且上一次记录时间大于60秒的,则判断为这次登陆是免密码登陆的重新记录上线时间 + */ + List list = oprMemDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(OprMemDictDO::getUserId, id) + .orderByDesc(OprMemDictDO::getCreateDate)); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateFormatUtil.localDateTimeToDate(list.get(0).getCreateDate())); + calendar.add(Calendar.SECOND,60); + if(calendar.getTime().after(DateFormatUtil.localDateTimeToDate(list.get(0).getCreateDate()))) { + if(list.get(0).getOprType().equals("登出")) { + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(id); + oprMemDictDO.setResult(1); + oprMemDictDO.setOprType("登录"); + oprMemDictDO.setIpAddress(session.getRemoteAddress().getHostName()); + oprMemDictMapper.insert(oprMemDictDO); + } + } + } + webSocketMap.remove(id); + } + webSocketMap.put(id, session); + + String httpSessionId = session.getId(); + String host = session.getUri().getHost(); + String query = session.getUri().getQuery(); + log.info("----> webSocket connection success"); + log.info("parameter:[ httpSessionId: {}, host: {}, {} ]", httpSessionId, host, query); + log.info("connection time: {}", DateFormatUtil.format(new Date(), DateFormatUtil.FMT_sdf14_L)); + } + } + + /** + * 处理WebSocket transport error + * @param session + * @param throwable + * @throws Exception + */ + @Override + public void handleTransportError(WebSocketSession session, Throwable throwable) throws Exception { + if(session.isOpen()) { + session.close(); + } + + String params = session.getUri().getQuery(); + Long id = Long.valueOf(params.split("=")[1]); + webSocketMap.remove(id); + log.error("<---- webSocket transport error"); + log.error("error message: {}", throwable.getMessage()); + } + + /** + * 在两端WebSocket connection都关闭或transport error发生后执行 + * @param session + * @param closeStatus + * @throws Exception + */ + @Override + public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception{ + if(null != session) { + /* + 断开连接后不会马上判断为下线状态,而是进入60秒的心跳检测机制,如果60秒内没有进行重连,则判断为下线,记录下线时间和状态 + */ + if(null != webSocketMap) { + String params = session.getUri().getQuery(); + Long id = Long.valueOf(params.split("=")[1]); + heartbeat(webSocketMap.get(id)); + } + log.info("<---- webSocket is close"); + log.info("session {} close, status: {}", session.getId(), closeStatus); + } + } + + /** + * 断开连接后60秒后进行判断是否重新连接了,如果没有连接成功则判断为下线 + * + * @param session + */ + public void heartbeat(WebSocketSession session) { + ScheduledExecutorService service = Executors.newScheduledThreadPool(1); + ScheduledFuture scheduledFuture = service.scheduleAtFixedRate(new Runnable() { + @SneakyThrows + @Override + public void run() { + if(null != session && !session.isOpen()) { + String params = session.getUri().getQuery(); + Long id = Long.valueOf(params.split("=")[1]); + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setUserId(id); + oprMemDictDO.setResult(1); + oprMemDictDO.setOprType("登出"); + oprMemDictDO.setIpAddress(session.getRemoteAddress().getHostName()); + oprMemDictMapper.insert(oprMemDictDO); + taskMap.get(session.getId()).cancel(true); + } + } + }, 1, 1, TimeUnit.MINUTES); + taskMap.put(session.getId(), scheduledFuture); + } + + /** + * 接收WebSocket客户端Message + * @param session + * @param message + * @throws Exception + */ + @Override + public void handleMessage(WebSocketSession session, WebSocketMessage message) throws Exception { + if(message instanceof TextMessage) { + System.out.println(message.getPayload()); + } + } + + @Override + public boolean supportsPartialMessages() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java b/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java index d60b7f1..39fc8cc 100644 --- a/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java +++ b/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java @@ -11,7 +11,7 @@ public class AdministerPermissionVO { private String userName; - private String role; + private Long role; private String img; diff --git a/src/main/java/com/subsidy/vo/administer/ClassDailyInfoVO.java b/src/main/java/com/subsidy/vo/administer/ClassDailyInfoVO.java new file mode 100644 index 0000000..2cf924b --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/ClassDailyInfoVO.java @@ -0,0 +1,22 @@ +package com.subsidy.vo.administer; + +import com.subsidy.vo.vod.DayInfoItemVO; +import lombok.Data; + +import java.util.List; + +@Data +public class ClassDailyInfoVO { + + private Long id; + + private String userName; + + private List dayInfoItemVOS; + + private Integer total; + + private Integer studyLength; + + private List classVodDailyInfoItemVOS; +} diff --git a/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java b/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java index a85c1e3..28252ab 100644 --- a/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java +++ b/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java @@ -7,48 +7,29 @@ public class ClassSummaryVO { private Long classId; - private String className; - - private String courseName; - - private String startDate; - - private String endDate; - /** * 学员总数 */ private Integer memberCount; /** - * 课程进度 - */ - private Integer studyVodCounts; - - /** - * 总课时 - */ - private Integer totalVodCounts; - - - /** - * 平均时长 + * 视频学习完人数 */ - private Integer avgVodPlayLength; + private Integer vodCnt; /** - * 测试通过率 + * 测试人数 */ - private Integer passRate; + private Integer passCnt; /** - * 平均签到数 + * 签到数 */ - private Integer avgSignCount; + private Integer signCnt; /** * 答疑数 */ - private Integer answerCount; + private Integer answerCnt; } diff --git a/src/main/java/com/subsidy/vo/administer/ClassVodDailyInfoItemVO.java b/src/main/java/com/subsidy/vo/administer/ClassVodDailyInfoItemVO.java new file mode 100644 index 0000000..4458034 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/ClassVodDailyInfoItemVO.java @@ -0,0 +1,15 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class ClassVodDailyInfoItemVO { + + private Long vodId; + + private String vodName; + + private Integer playLength; + + +} diff --git a/src/main/java/com/subsidy/vo/administer/ClassVodDailyInfoVO.java b/src/main/java/com/subsidy/vo/administer/ClassVodDailyInfoVO.java new file mode 100644 index 0000000..866e08e --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/ClassVodDailyInfoVO.java @@ -0,0 +1,20 @@ +package com.subsidy.vo.administer; + +import com.subsidy.vo.vod.DayInfoItemVO; +import lombok.Data; + +import java.util.List; + +@Data +public class ClassVodDailyInfoVO { + + private Long id; + + private String userName; + + private List dayInfoItemVOS; + + private Integer total; + + +} diff --git a/src/main/java/com/subsidy/vo/administer/ClassVodInfoVO.java b/src/main/java/com/subsidy/vo/administer/ClassVodInfoVO.java new file mode 100644 index 0000000..53e4352 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/ClassVodInfoVO.java @@ -0,0 +1,14 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class ClassVodInfoVO { + + private String vodName; + + private Integer studyCnt; + + private Long studyLength; + +} diff --git a/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java b/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java index 24114d9..0a0e649 100644 --- a/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java +++ b/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java @@ -25,4 +25,6 @@ public class ExerciseTestVO { private String telephone; private Integer count; + + private Long paperId; } diff --git a/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java b/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java new file mode 100644 index 0000000..20d7767 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java @@ -0,0 +1,24 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class GetMemberPapersVO { + + private Long id; + + private Long paperId; + + private String score; + + private Integer cnt; + + private Integer rightCounts; + + private Integer totalCounts; + + private String result; + + private String createDate; + +} diff --git a/src/main/java/com/subsidy/vo/administer/GetPaperDetailVO.java b/src/main/java/com/subsidy/vo/administer/GetPaperDetailVO.java new file mode 100644 index 0000000..f4f0c1a --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/GetPaperDetailVO.java @@ -0,0 +1,20 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class GetPaperDetailVO { + + private String title; + + private String result; + + private String answer; + + private String rightAnswer; + + private String items; + + private String detail; + +} diff --git a/src/main/java/com/subsidy/vo/administer/ImageCheckDetailVO.java b/src/main/java/com/subsidy/vo/administer/ImageCheckDetailVO.java new file mode 100644 index 0000000..1f8e658 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/ImageCheckDetailVO.java @@ -0,0 +1,7 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class ImageCheckDetailVO { +} diff --git a/src/main/java/com/subsidy/vo/administer/LoginVO.java b/src/main/java/com/subsidy/vo/administer/LoginVO.java index d97ab86..1594562 100644 --- a/src/main/java/com/subsidy/vo/administer/LoginVO.java +++ b/src/main/java/com/subsidy/vo/administer/LoginVO.java @@ -7,5 +7,4 @@ public class LoginVO { private String token; - } diff --git a/src/main/java/com/subsidy/vo/administer/ManageMemberVO.java b/src/main/java/com/subsidy/vo/administer/ManageMemberVO.java new file mode 100644 index 0000000..f34a728 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/ManageMemberVO.java @@ -0,0 +1,20 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class ManageMemberVO { + + private Long id; + + private String userName; + + private String telephone; + + private String idCard; + + private String companyName; + + private String accountName; + +} diff --git a/src/main/java/com/subsidy/vo/administer/MemberDetectionRecordVO.java b/src/main/java/com/subsidy/vo/administer/MemberDetectionRecordVO.java new file mode 100644 index 0000000..2462926 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/MemberDetectionRecordVO.java @@ -0,0 +1,27 @@ +package com.subsidy.vo.administer; + +import com.subsidy.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class MemberDetectionRecordVO { + + + private Long id; + + @ExcelColumn(col = 1,value = "成员名称") + private String userName; + + @ExcelColumn(col = 2,value = "账号") + private String accountName; + + @ExcelColumn(col = 3,value = "身份证号") + private String idCard; + + @ExcelColumn(col = 4,value = "身份证号") + private String telephone; + + @ExcelColumn(col = 5,value = "检测次数") + private Integer cnt; + +} diff --git a/src/main/java/com/subsidy/vo/administer/MemberStudyLogVO.java b/src/main/java/com/subsidy/vo/administer/MemberStudyLogVO.java new file mode 100644 index 0000000..188cd1f --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/MemberStudyLogVO.java @@ -0,0 +1,20 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class MemberStudyLogVO { + + private String startDate; + + private String endDate; + + private String vodName; + + private String studyType; + + private String playLength; + + private String totalLength; + +} diff --git a/src/main/java/com/subsidy/vo/administer/OperatorsVO.java b/src/main/java/com/subsidy/vo/administer/OperatorsVO.java index 8b3d2f3..e2fda11 100644 --- a/src/main/java/com/subsidy/vo/administer/OperatorsVO.java +++ b/src/main/java/com/subsidy/vo/administer/OperatorsVO.java @@ -1,7 +1,10 @@ package com.subsidy.vo.administer; +import com.subsidy.model.FieldDictDO; import lombok.Data; +import java.util.List; + @Data public class OperatorsVO { @@ -11,7 +14,7 @@ public class OperatorsVO { private String telephone; - private String field; + private List field; private String banner; @@ -19,11 +22,15 @@ public class OperatorsVO { private String img; + private String address; + private String companyName; private String accountName; - private Integer companyId; + private Long companyId; private String logo; + + private String superviseName; } diff --git a/src/main/java/com/subsidy/vo/administer/UserRoleVO.java b/src/main/java/com/subsidy/vo/administer/UserRoleVO.java index c9fb0fa..91425a8 100644 --- a/src/main/java/com/subsidy/vo/administer/UserRoleVO.java +++ b/src/main/java/com/subsidy/vo/administer/UserRoleVO.java @@ -1,7 +1,10 @@ package com.subsidy.vo.administer; +import com.subsidy.model.RotationImgDictDO; import lombok.Data; +import java.util.List; + @Data public class UserRoleVO { @@ -11,7 +14,26 @@ public class UserRoleVO { private String userName; - private String img; + private String accountName; + + private String image; + + private String status; + + private Integer firstLogin; + + private String companyName; + + private Boolean qxyStatus; + + private Long companyId; + + private String logo; + + private List rotationImgDictDOS; + + private String token; + private String superviseName; } diff --git a/src/main/java/com/subsidy/vo/answer/GetCourseQuestionVO.java b/src/main/java/com/subsidy/vo/answer/GetCourseQuestionVO.java index c9db152..782aff7 100644 --- a/src/main/java/com/subsidy/vo/answer/GetCourseQuestionVO.java +++ b/src/main/java/com/subsidy/vo/answer/GetCourseQuestionVO.java @@ -44,6 +44,5 @@ public class GetCourseQuestionVO { private String updateDate; - private String deleteDate; } diff --git a/src/main/java/com/subsidy/vo/cert/GetAllCertsVO.java b/src/main/java/com/subsidy/vo/cert/GetAllCertsVO.java new file mode 100644 index 0000000..71beea8 --- /dev/null +++ b/src/main/java/com/subsidy/vo/cert/GetAllCertsVO.java @@ -0,0 +1,14 @@ +package com.subsidy.vo.cert; + +import com.subsidy.model.CertDictDO; +import com.subsidy.model.CertTypeDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllCertsVO extends CertDictDO { + + private List certTypeDictDOS; + +} diff --git a/src/main/java/com/subsidy/vo/cert/GetAllCertsWithoutTypeVO.java b/src/main/java/com/subsidy/vo/cert/GetAllCertsWithoutTypeVO.java new file mode 100644 index 0000000..c225b0b --- /dev/null +++ b/src/main/java/com/subsidy/vo/cert/GetAllCertsWithoutTypeVO.java @@ -0,0 +1,12 @@ +package com.subsidy.vo.cert; + +import lombok.Data; + +@Data +public class GetAllCertsWithoutTypeVO { + + private Long id; + + private String certName; + +} diff --git a/src/main/java/com/subsidy/vo/cert/GetCompanyCertsVO.java b/src/main/java/com/subsidy/vo/cert/GetCompanyCertsVO.java new file mode 100644 index 0000000..f29107b --- /dev/null +++ b/src/main/java/com/subsidy/vo/cert/GetCompanyCertsVO.java @@ -0,0 +1,16 @@ +package com.subsidy.vo.cert; + +import com.subsidy.model.CertDictDO; +import com.subsidy.model.CertTypeDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetCompanyCertsVO extends CertDictDO { + + List certTypeDictDOS; + + private Boolean signStatus; + +} diff --git a/src/main/java/com/subsidy/vo/cert/GetCompanyCertsWithStatusVO.java b/src/main/java/com/subsidy/vo/cert/GetCompanyCertsWithStatusVO.java new file mode 100644 index 0000000..eb0faac --- /dev/null +++ b/src/main/java/com/subsidy/vo/cert/GetCompanyCertsWithStatusVO.java @@ -0,0 +1,11 @@ +package com.subsidy.vo.cert; + +import com.subsidy.model.CertDictDO; +import lombok.Data; + +@Data +public class GetCompanyCertsWithStatusVO extends CertDictDO { + + private Boolean status; + +} diff --git a/src/main/java/com/subsidy/vo/cert/GetListVO.java b/src/main/java/com/subsidy/vo/cert/GetListVO.java new file mode 100644 index 0000000..7cecb91 --- /dev/null +++ b/src/main/java/com/subsidy/vo/cert/GetListVO.java @@ -0,0 +1,19 @@ +package com.subsidy.vo.cert; + +import lombok.Data; + +@Data +public class GetListVO { + + private Integer id; + + private String certName; + + private Integer certId; + + private String coverPage; + + private String createDate; + + private String status; +} diff --git a/src/main/java/com/subsidy/vo/cert/GetOneCertVO.java b/src/main/java/com/subsidy/vo/cert/GetOneCertVO.java new file mode 100644 index 0000000..6806288 --- /dev/null +++ b/src/main/java/com/subsidy/vo/cert/GetOneCertVO.java @@ -0,0 +1,16 @@ +package com.subsidy.vo.cert; + +import com.subsidy.model.CertDictDO; +import com.subsidy.model.CertTypeDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetOneCertVO extends CertDictDO { + + private List certTypeDictDOS; + + private Boolean status; + +} diff --git a/src/main/java/com/subsidy/vo/cert/GetSignInfoVO.java b/src/main/java/com/subsidy/vo/cert/GetSignInfoVO.java new file mode 100644 index 0000000..37a7e59 --- /dev/null +++ b/src/main/java/com/subsidy/vo/cert/GetSignInfoVO.java @@ -0,0 +1,19 @@ +package com.subsidy.vo.cert; + +import lombok.Data; + +@Data +public class GetSignInfoVO { + +// private Long memberId; + +// private Long certId; + + private String userName; + + private String orderNo; + + private String certName; + + private String status; +} diff --git a/src/main/java/com/subsidy/vo/cert/SignManagementVO.java b/src/main/java/com/subsidy/vo/cert/SignManagementVO.java new file mode 100644 index 0000000..6211b58 --- /dev/null +++ b/src/main/java/com/subsidy/vo/cert/SignManagementVO.java @@ -0,0 +1,34 @@ +package com.subsidy.vo.cert; + + +import com.subsidy.model.CertRequirementDO; +import com.subsidy.model.CertTypeDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class SignManagementVO { + + private Long id; + + private Long certId; + + private String createDate; + + private String certName; + + private String price; + + private String userName; + + private String companyName; + + private String status; + + private String cnt; + + private List certTypeDictDOS; + + private List certRequirementDOS; +} diff --git a/src/main/java/com/subsidy/vo/classdict/ClassAndCompanyInfoVO.java b/src/main/java/com/subsidy/vo/classdict/ClassAndCompanyInfoVO.java new file mode 100644 index 0000000..32fbc29 --- /dev/null +++ b/src/main/java/com/subsidy/vo/classdict/ClassAndCompanyInfoVO.java @@ -0,0 +1,17 @@ +package com.subsidy.vo.classdict; + +import lombok.Data; + +@Data +public class ClassAndCompanyInfoVO { + + private String company; + + private String name; + + private String courseName; + + private String startDate; + + private String endDate; +} diff --git a/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java b/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java index 8132f30..9bb46d7 100644 --- a/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java +++ b/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java @@ -1,8 +1,11 @@ package com.subsidy.vo.classdict; import com.subsidy.util.excel.ExcelColumn; +import com.subsidy.vo.done.GetMaxScoreVO; import lombok.Data; +import java.util.List; + @Data public class ClassDetailVO{ @@ -15,36 +18,44 @@ public class ClassDetailVO{ @ExcelColumn(col = 2,value = "账号") private String accountName; - @ExcelColumn(col = 3,value = "身份证号") + /** + * 性别 + */ + @ExcelColumn(col = 3,value = "性别") + private String gender; + + @ExcelColumn(col = 4,value = "身份证号") private String idCard; - @ExcelColumn(col = 4,value = "联系方式") + @ExcelColumn(col = 5,value = "联系方式") private String telephone; /** * 签到次数 */ - @ExcelColumn(col = 5,value = "签到次数") + @ExcelColumn(col = 6,value = "签到次数") private Integer signCounts; /** * 已看视频 */ - private Integer studyVodCounts; + //private Integer studyVodCounts; /** * 全部视频 */ - private Integer allVodCounts; + //private Integer allVodCounts; - @ExcelColumn(col = 6,value = "课程进度") + @ExcelColumn(col = 7,value = "课程进度") private String classProcess; private Integer trainingLength; - @ExcelColumn(col = 7,value = "培训时长") + @ExcelColumn(col = 8,value = "培训时长(小时)") private String trainingLengthStr; + @ExcelColumn(col = 9,value = "培训时长(分钟)") + private String trainingLengthMinute; /** * 作对个数 @@ -59,18 +70,19 @@ public class ClassDetailVO{ /** * 评价测试 */ - @ExcelColumn(col = 8,value = "评价测试") - private Integer score; + @ExcelColumn(col = 10,value = "评价测试") + private String score; /** * 答疑个数 */ - @ExcelColumn(col = 9,value = "答题数") + @ExcelColumn(col = 11,value = "答题数") private Integer askCounts; private String result; + private List getMaxScoreVOS; } diff --git a/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java b/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java index 29cd7a5..ed22a59 100644 --- a/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java +++ b/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java @@ -21,4 +21,8 @@ public class GetAllClassesVO { private String classType; + private String openStatus; + + private Long classTypeId; + } diff --git a/src/main/java/com/subsidy/vo/classdict/GetClassBaseInfoVO.java b/src/main/java/com/subsidy/vo/classdict/GetClassBaseInfoVO.java new file mode 100644 index 0000000..b325aa5 --- /dev/null +++ b/src/main/java/com/subsidy/vo/classdict/GetClassBaseInfoVO.java @@ -0,0 +1,36 @@ +package com.subsidy.vo.classdict; + +import lombok.Data; + +@Data +public class GetClassBaseInfoVO { + + private String classType; + + private String courseName; + + private Integer count; + + private String className; + + private String startDate; + + private String endDate; + + private Long courseId; + + private Long classTypeId; + + private Integer isOrder; + + private Integer isFastPlay; + + private Integer testRule; + + private Boolean testFlag; + + private String coverPage; + + + +} diff --git a/src/main/java/com/subsidy/vo/classdict/GetSettingVO.java b/src/main/java/com/subsidy/vo/classdict/GetSettingVO.java new file mode 100644 index 0000000..4dd97a0 --- /dev/null +++ b/src/main/java/com/subsidy/vo/classdict/GetSettingVO.java @@ -0,0 +1,16 @@ +package com.subsidy.vo.classdict; + +import com.subsidy.model.ClassHourDictDO; +import com.subsidy.model.RotationImgDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetSettingVO extends ClassHourDictDO { + + private List rotationImgDictDOS; + + private String logo; + +} diff --git a/src/main/java/com/subsidy/vo/company/GetAllCompanyVO.java b/src/main/java/com/subsidy/vo/company/GetAllCompanyVO.java new file mode 100644 index 0000000..4b1ce36 --- /dev/null +++ b/src/main/java/com/subsidy/vo/company/GetAllCompanyVO.java @@ -0,0 +1,12 @@ +package com.subsidy.vo.company; + +import lombok.Data; + +@Data +public class GetAllCompanyVO { + + private Long id; + + private String companyName; + +} diff --git a/src/main/java/com/subsidy/vo/company/GetCompanyMembersVO.java b/src/main/java/com/subsidy/vo/company/GetCompanyMembersVO.java new file mode 100644 index 0000000..8ab3ea2 --- /dev/null +++ b/src/main/java/com/subsidy/vo/company/GetCompanyMembersVO.java @@ -0,0 +1,22 @@ +package com.subsidy.vo.company; + +import lombok.Data; + +@Data +public class GetCompanyMembersVO { + + private Long id; + + private String userName; + + private String idCard; + + private String companyName; + + private Integer firstLogin; + + private String checkImage; + + private String checkTime; + +} diff --git a/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java b/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java index ba7ead4..575819e 100644 --- a/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java +++ b/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java @@ -1,11 +1,84 @@ package com.subsidy.vo.course; +import com.subsidy.model.CategoryDO; import com.subsidy.model.CourseDictDO; +import com.subsidy.model.FieldDictDO; +import com.subsidy.model.JobDictDO; +import com.subsidy.model.RankDictDO; import lombok.Data; +import org.apache.poi.ss.formula.functions.Rank; + +import java.util.List; @Data -public class QueryCoursesVO extends CourseDictDO { +public class QueryCoursesVO { + + private Long id; + + /** + * + */ + private Long companyId; + + /** + * 课程名称 + */ + private String courseName; + + /** + * 封面 + */ + private String coverPage; + + /** + * 课程类型 + */ + private String courseType; + + /** + * 课程时长 + */ + private Integer vodLength; + + /** + * 课时 + */ + private Integer vodCounts; + + /** + * 备注 + */ + private String remark; + + /** + * 测试数量 + */ + private Integer paperCount; + + /** + * 开放状态 + */ + private Integer openStatus; + + /** + * 行业范围 + */ + private List fieldDictDOS; + + /** + * 课程类目 + */ + private List categoryDOS; + + /** + * 适用岗位 + */ + private List jobDictDOS; + + /** + * 适用职级 + */ + private List rankDictDOS; - private String name; } diff --git a/src/main/java/com/subsidy/vo/department/GetMembersVO.java b/src/main/java/com/subsidy/vo/department/GetMembersVO.java new file mode 100644 index 0000000..9c70059 --- /dev/null +++ b/src/main/java/com/subsidy/vo/department/GetMembersVO.java @@ -0,0 +1,35 @@ +package com.subsidy.vo.department; + +import com.subsidy.model.AdministerDO; +import com.subsidy.model.MemberDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetMembersVO { + + private Long id; + + private String departmentName; + + private Long parentId; + + private String parentDepartmentName; + + private Long administerId; + + private String userName; + + private String img; + + private List memberDOS; + + //private List administerDepartmentMappingDOS; + + private List children; + + + + +} diff --git a/src/main/java/com/subsidy/vo/done/GetMaxScoreVO.java b/src/main/java/com/subsidy/vo/done/GetMaxScoreVO.java new file mode 100644 index 0000000..acd8d34 --- /dev/null +++ b/src/main/java/com/subsidy/vo/done/GetMaxScoreVO.java @@ -0,0 +1,15 @@ +package com.subsidy.vo.done; + +import lombok.Data; + +@Data +public class GetMaxScoreVO { + + private Long paperId; + + private String paperName; + + private Long score; + + private Integer result; +} diff --git a/src/main/java/com/subsidy/vo/done/TestScoreInfoVO.java b/src/main/java/com/subsidy/vo/done/TestScoreInfoVO.java new file mode 100644 index 0000000..855d040 --- /dev/null +++ b/src/main/java/com/subsidy/vo/done/TestScoreInfoVO.java @@ -0,0 +1,16 @@ +package com.subsidy.vo.done; + +import lombok.Data; + +@Data +public class TestScoreInfoVO { + + private Long paperId; + + private Integer score; + + private Integer cnt; + + private String result; + +} diff --git a/src/main/java/com/subsidy/vo/exercise/GetDoneDetailVO.java b/src/main/java/com/subsidy/vo/exercise/GetDoneDetailVO.java new file mode 100644 index 0000000..ebad311 --- /dev/null +++ b/src/main/java/com/subsidy/vo/exercise/GetDoneDetailVO.java @@ -0,0 +1,16 @@ +package com.subsidy.vo.exercise; + +import lombok.Data; + +@Data +public class GetDoneDetailVO { + + private Integer rightCounts; + + private Integer totalCounts; + + private String result; + + private String createDate; + +} diff --git a/src/main/java/com/subsidy/vo/exercise/GetDoneHistoryDetailVO.java b/src/main/java/com/subsidy/vo/exercise/GetDoneHistoryDetailVO.java new file mode 100644 index 0000000..738106f --- /dev/null +++ b/src/main/java/com/subsidy/vo/exercise/GetDoneHistoryDetailVO.java @@ -0,0 +1,25 @@ +package com.subsidy.vo.exercise; + +import lombok.Data; + +@Data +public class GetDoneHistoryDetailVO { + + private Long id; + + private String title; + + private String items; + + private String rightAnswer; + + private String difficulty; + + private String answer; + + private Integer result; + + private String exerciseType; + + +} diff --git a/src/main/java/com/subsidy/vo/exercise/GetPaperExerciseVO.java b/src/main/java/com/subsidy/vo/exercise/GetPaperExerciseVO.java new file mode 100644 index 0000000..0768c79 --- /dev/null +++ b/src/main/java/com/subsidy/vo/exercise/GetPaperExerciseVO.java @@ -0,0 +1,27 @@ +package com.subsidy.vo.exercise; + +import lombok.Data; + + +@Data +public class GetPaperExerciseVO { + + private Long id; + + private String exerciseType; + + private Long courseId; + + private String difficulty; + + private String title; + + private String items; + + private String rightAnswer; + + private String detail; + + private Integer orderNo; + +} diff --git a/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java b/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java index 9417ae1..72b1479 100644 --- a/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java +++ b/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java @@ -9,4 +9,6 @@ public class MemberExerciseVO { private String selectAnswer; + private Integer result; + } diff --git a/src/main/java/com/subsidy/vo/member/CheckStatusVO.java b/src/main/java/com/subsidy/vo/member/CheckStatusVO.java new file mode 100644 index 0000000..5c56033 --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/CheckStatusVO.java @@ -0,0 +1,12 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class CheckStatusVO { + + private Boolean SMSStatus; + + private Boolean imageStatus; + +} diff --git a/src/main/java/com/subsidy/vo/member/ClassSignVO.java b/src/main/java/com/subsidy/vo/member/ClassSignVO.java index 9390669..4e7228b 100644 --- a/src/main/java/com/subsidy/vo/member/ClassSignVO.java +++ b/src/main/java/com/subsidy/vo/member/ClassSignVO.java @@ -31,26 +31,19 @@ public class ClassSignVO { */ private Integer trainingLength; - @ExcelColumn(col = 4,value = "培训时长") + @ExcelColumn(col = 4,value = "培训时长(小时)") private String trainingLengthStr; - /** - * 已看视频 - */ - private Integer studyVodCounts; - - /** - * 全部视频 - */ - private Integer allVodCounts; + @ExcelColumn(col = 5,value = "培训时长(分钟)") + private String trainingLengthMinute; - @ExcelColumn(col = 5,value = "课程进度") + @ExcelColumn(col = 6,value = "课程进度") private String classProcess; /** * 完成率 */ - @ExcelColumn(col = 6,value = "完成率") + @ExcelColumn(col = 7,value = "完成率") private String percent; diff --git a/src/main/java/com/subsidy/vo/member/ContentVodNewVO.java b/src/main/java/com/subsidy/vo/member/ContentVodNewVO.java index c4ec7a3..b9cb0a0 100644 --- a/src/main/java/com/subsidy/vo/member/ContentVodNewVO.java +++ b/src/main/java/com/subsidy/vo/member/ContentVodNewVO.java @@ -1,8 +1,5 @@ package com.subsidy.vo.member; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.subsidy.model.VodDictDO; import lombok.Data; import java.util.List; @@ -10,54 +7,15 @@ import java.util.List; @Data public class ContentVodNewVO { - private Integer playRecord; - private Long id; - /** - * 目录id - */ - private Long contentId; - - /** - * 视频名称 - */ - private String vodName; - - /** - * 视频时长 - */ - private Integer vodLength; - - /** - * 视频格式 - */ - private String vodType; - - /** - * 视频大小 - */ - private String vodSize; - - /** - * 视频地址 - */ - private String vodUrl; + private Integer playRecord; - /** - * 视频编码 - */ - private String vodCode; + private Integer isFastPlay; - /** - * 讲师名称 - */ - private String teacherName; + private Integer testRule; - /** - * 封面 - */ - private String coverPage; + private Integer isOrder; private List contentVodVOS; diff --git a/src/main/java/com/subsidy/vo/member/ContentVodVO.java b/src/main/java/com/subsidy/vo/member/ContentVodVO.java index 09d7c8e..bd51af0 100644 --- a/src/main/java/com/subsidy/vo/member/ContentVodVO.java +++ b/src/main/java/com/subsidy/vo/member/ContentVodVO.java @@ -9,6 +9,10 @@ public class ContentVodVO { private String content; + private Integer totalVods; + + private Integer playVods; + private List memberVodVOS; } diff --git a/src/main/java/com/subsidy/vo/member/GetAllVO.java b/src/main/java/com/subsidy/vo/member/GetAllVO.java index 18a4e21..712e9b1 100644 --- a/src/main/java/com/subsidy/vo/member/GetAllVO.java +++ b/src/main/java/com/subsidy/vo/member/GetAllVO.java @@ -1,14 +1,44 @@ package com.subsidy.vo.member; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.JobDictDO; import com.subsidy.model.MemberDO; import lombok.Data; +import java.util.Date; import java.util.List; @Data -public class GetAllVO extends MemberDO { +public class GetAllVO { + + private Long id; + + private String accountName; + + private String accountNameEn; + + private String userName; + + private String telephone; + + private String gender; + + private String idCard; + + private String status; + + private String email; + + private String workNo; + + //@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private String inductionDate; private List departmentDictDOS; + private List jobDictDOS; + } diff --git a/src/main/java/com/subsidy/vo/member/GetPaperDetailVO.java b/src/main/java/com/subsidy/vo/member/GetPaperDetailVO.java new file mode 100644 index 0000000..99ad45a --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/GetPaperDetailVO.java @@ -0,0 +1,9 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class GetPaperDetailVO { + + +} diff --git a/src/main/java/com/subsidy/vo/member/GetPaperDoneDetailVO.java b/src/main/java/com/subsidy/vo/member/GetPaperDoneDetailVO.java new file mode 100644 index 0000000..1d8746f --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/GetPaperDoneDetailVO.java @@ -0,0 +1,9 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class GetPaperDoneDetailVO { + + +} diff --git a/src/main/java/com/subsidy/vo/member/MemberStudyPageVO.java b/src/main/java/com/subsidy/vo/member/MemberStudyPageVO.java index f9730e3..ea7e975 100644 --- a/src/main/java/com/subsidy/vo/member/MemberStudyPageVO.java +++ b/src/main/java/com/subsidy/vo/member/MemberStudyPageVO.java @@ -17,5 +17,6 @@ public class MemberStudyPageVO { private String img; - private String logo; + //private String logo; + } diff --git a/src/main/java/com/subsidy/vo/member/MemberVO.java b/src/main/java/com/subsidy/vo/member/MemberVO.java new file mode 100644 index 0000000..a0e4d6b --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/MemberVO.java @@ -0,0 +1,38 @@ +package com.subsidy.vo.member; + +import com.subsidy.model.RotationImgDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class MemberVO { + + private Long id; + + private String gender; + + private String telephone; + + private String userName; + + private String accountName; + + private String image; + + private Integer firstLogin; + + private String companyName; + + private Long companyId; + + private Boolean qxyStatus; + + private String logo; + + private List rotationImgDictDOS; + + private String token; + + private String superviseName; +} diff --git a/src/main/java/com/subsidy/vo/member/MemberVodVO.java b/src/main/java/com/subsidy/vo/member/MemberVodVO.java index 0abb10b..090c120 100644 --- a/src/main/java/com/subsidy/vo/member/MemberVodVO.java +++ b/src/main/java/com/subsidy/vo/member/MemberVodVO.java @@ -9,10 +9,11 @@ public class MemberVodVO { private Integer vodLength; - private String teacherName; - - private Integer percent; + private String percent; + /** + * 解锁状态 + */ private Boolean status; private String vodUrl; @@ -21,4 +22,6 @@ public class MemberVodVO { private Integer playRecord; + private String leftLength; + } diff --git a/src/main/java/com/subsidy/vo/member/MyCoursesVO.java b/src/main/java/com/subsidy/vo/member/MyCoursesVO.java new file mode 100644 index 0000000..79cad1d --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/MyCoursesVO.java @@ -0,0 +1,36 @@ +package com.subsidy.vo.member; + +import com.subsidy.model.FieldDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class MyCoursesVO { + + private Long courseId; + + private Long classId; + + private String className; + + private String courseName; + + private String startDate; + + private String endDate; + + private Integer totalCnt; + + private Integer studyCnt; + + private Integer diffDate; + + private Integer ttlMember; + + private Integer isOrder; + + private Integer isFastPlay; + + private List fieldDictDOS; +} diff --git a/src/main/java/com/subsidy/vo/member/QXTSign.java b/src/main/java/com/subsidy/vo/member/QXTSign.java new file mode 100644 index 0000000..80328ae --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/QXTSign.java @@ -0,0 +1,10 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class QXTSign { + + private String sign; + +} diff --git a/src/main/java/com/subsidy/vo/member/QxyVO.java b/src/main/java/com/subsidy/vo/member/QxyVO.java new file mode 100644 index 0000000..999923b --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/QxyVO.java @@ -0,0 +1,10 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class QxyVO { + + private String token; + +} diff --git a/src/main/java/com/subsidy/vo/member/StudyPageVO.java b/src/main/java/com/subsidy/vo/member/StudyPageVO.java index dc234c6..e799af0 100644 --- a/src/main/java/com/subsidy/vo/member/StudyPageVO.java +++ b/src/main/java/com/subsidy/vo/member/StudyPageVO.java @@ -5,22 +5,18 @@ import lombok.Data; @Data public class StudyPageVO { - private Integer id; + private Long id; - private Integer classId; + private Long classId; private String courseName; - private String endDate; + private Integer diffDates; private Integer totalVods; private Integer doneVods; - private Integer totalMember; - - private Integer doneMember; - - private String className; + //private String className; } diff --git a/src/main/java/com/subsidy/vo/opr/GetHistoryVO.java b/src/main/java/com/subsidy/vo/opr/GetHistoryVO.java new file mode 100644 index 0000000..efba8ef --- /dev/null +++ b/src/main/java/com/subsidy/vo/opr/GetHistoryVO.java @@ -0,0 +1,20 @@ +package com.subsidy.vo.opr; + +import lombok.Data; + +@Data +public class GetHistoryVO { + + private String _id; + + private String userName; + + private String companyName; + + private String oprType; + + private String createDate; + + private Integer result; + +} diff --git a/src/main/java/com/subsidy/vo/paper/QueryPapersVO.java b/src/main/java/com/subsidy/vo/paper/QueryPapersVO.java new file mode 100644 index 0000000..00a303f --- /dev/null +++ b/src/main/java/com/subsidy/vo/paper/QueryPapersVO.java @@ -0,0 +1,24 @@ +package com.subsidy.vo.paper; + +import lombok.Data; + +@Data +public class QueryPapersVO { + + private Long id; + + private String paperName; + + private String paperStatus; + + private Integer completeCnt; + + private Integer rightCounts; + + private Integer totalCount; + + private String result; + + private String endDate; + +} diff --git a/src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java b/src/main/java/com/subsidy/vo/sign/DataViewVO.java similarity index 70% rename from src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java rename to src/main/java/com/subsidy/vo/sign/DataViewVO.java index 91a0d04..f226f01 100644 --- a/src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java +++ b/src/main/java/com/subsidy/vo/sign/DataViewVO.java @@ -3,7 +3,7 @@ package com.subsidy.vo.sign; import lombok.Data; @Data -public class ClassSignInfoVO { +public class DataViewVO { private Long classId; @@ -23,38 +23,24 @@ public class ClassSignInfoVO { private Integer memberCount; /** - * 课程进度 + * 视频学习人数 */ - private Integer studyVodCounts; - - /** - * 总课时 - */ - private Integer totalVodCounts; - - - /** - * 平均时长 - */ - private Integer avgVodPlayLength; + private Integer vodCnt; /** * 测试通过率 */ - private Integer passRate; + private Integer passCnt; /** * 平均签到数 */ - private Integer avgSignCount; + private Integer signCnt; /** * 答疑数 */ - private Integer answerCount; - - private String classType; - + private Integer answerCnt; } diff --git a/src/main/java/com/subsidy/vo/vod/ClassMemberPlayLengthVO.java b/src/main/java/com/subsidy/vo/vod/ClassMemberPlayLengthVO.java new file mode 100644 index 0000000..a01105e --- /dev/null +++ b/src/main/java/com/subsidy/vo/vod/ClassMemberPlayLengthVO.java @@ -0,0 +1,32 @@ +package com.subsidy.vo.vod; + +import lombok.Data; + +@Data +public class ClassMemberPlayLengthVO { + + private Long id; + + /** + * 班级id + */ + private Long classId; + + /** + * 视频id + */ + private Long vodId; + + /** + * 学生id + */ + private Long memberId; + + /** + * 观看时长 + */ + private Integer playLength; + + private String vodName; + +} diff --git a/src/main/java/com/subsidy/vo/vod/ClassVodCompleteInfoVO.java b/src/main/java/com/subsidy/vo/vod/ClassVodCompleteInfoVO.java new file mode 100644 index 0000000..b769a97 --- /dev/null +++ b/src/main/java/com/subsidy/vo/vod/ClassVodCompleteInfoVO.java @@ -0,0 +1,13 @@ +package com.subsidy.vo.vod; + +import lombok.Data; + +@Data +public class ClassVodCompleteInfoVO { + + private Integer cnt; + + private Long studyLength; + + +} diff --git a/src/main/java/com/subsidy/vo/vod/DayInfoItemVO.java b/src/main/java/com/subsidy/vo/vod/DayInfoItemVO.java new file mode 100644 index 0000000..20340e6 --- /dev/null +++ b/src/main/java/com/subsidy/vo/vod/DayInfoItemVO.java @@ -0,0 +1,14 @@ +package com.subsidy.vo.vod; + +import lombok.Data; + +@Data +public class DayInfoItemVO { + + private String studyDate; + + private Integer totalLength; + + private Integer distinctLength; + +} diff --git a/src/main/java/com/subsidy/vo/vod/GetMemberStudyInfoVO.java b/src/main/java/com/subsidy/vo/vod/GetMemberStudyInfoVO.java new file mode 100644 index 0000000..b73ba7d --- /dev/null +++ b/src/main/java/com/subsidy/vo/vod/GetMemberStudyInfoVO.java @@ -0,0 +1,16 @@ +package com.subsidy.vo.vod; + +import lombok.Data; + +@Data +public class GetMemberStudyInfoVO { + + private Long memberId; + + private String studyDate; + + private Integer playLength; + + private Integer distinctLength; + +} diff --git a/src/main/java/com/subsidy/vo/vod/GetVodPlayHistoryVO.java b/src/main/java/com/subsidy/vo/vod/GetVodPlayHistoryVO.java new file mode 100644 index 0000000..c70fd71 --- /dev/null +++ b/src/main/java/com/subsidy/vo/vod/GetVodPlayHistoryVO.java @@ -0,0 +1,22 @@ +package com.subsidy.vo.vod; + +import lombok.Data; + +@Data +public class GetVodPlayHistoryVO { + + /** + * 观看时长 + */ + private Integer playLength; + + /** + * 播放视频位置 + */ + private Integer playRecord; + + /** + * 聚合 + */ + private Integer playCount; +} diff --git a/src/main/java/com/subsidy/vo/vod/VodPlayStateVO.java b/src/main/java/com/subsidy/vo/vod/VodPlayStateVO.java new file mode 100644 index 0000000..a6e4f4e --- /dev/null +++ b/src/main/java/com/subsidy/vo/vod/VodPlayStateVO.java @@ -0,0 +1,23 @@ +package com.subsidy.vo.vod; + +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.Date; + +@Data +public class VodPlayStateVO { + + private Long id; + + private Long memberId; + + private Date startDate; + + private Date endDate; + + private Long playLength; + + private LocalDateTime createDate; + +} diff --git a/src/main/java/com/subsidy/vo/wechat/AccessTokenVO.java b/src/main/java/com/subsidy/vo/wechat/AccessTokenVO.java new file mode 100644 index 0000000..f08fa68 --- /dev/null +++ b/src/main/java/com/subsidy/vo/wechat/AccessTokenVO.java @@ -0,0 +1,12 @@ +package com.subsidy.vo.wechat; + +import lombok.Data; + +@Data +public class AccessTokenVO { + + private String access_token; + + private String expires_in; + +} diff --git a/src/main/java/com/subsidy/vo/wechat/AuthenRequestVO.java b/src/main/java/com/subsidy/vo/wechat/AuthenRequestVO.java new file mode 100644 index 0000000..015cfe7 --- /dev/null +++ b/src/main/java/com/subsidy/vo/wechat/AuthenRequestVO.java @@ -0,0 +1,15 @@ +package com.subsidy.vo.wechat; + + +import lombok.Data; + +@Data +public class AuthenRequestVO { + + private String code; + + private String phone; + + private String openId; + +} diff --git a/src/main/java/com/subsidy/vo/wechat/AuthenTokenVO.java b/src/main/java/com/subsidy/vo/wechat/AuthenTokenVO.java new file mode 100644 index 0000000..978bcf0 --- /dev/null +++ b/src/main/java/com/subsidy/vo/wechat/AuthenTokenVO.java @@ -0,0 +1,30 @@ +package com.subsidy.vo.wechat; + + +import lombok.Data; + +@Data +public class AuthenTokenVO { + + private String access_token; + + private String openid; + + private String nickname; + + private String sex; + + private String province; + + private String city; + + private String country; + + private String headimgurl; + + private Object privilege; + + private String unionid; + + +} diff --git a/src/main/java/com/subsidy/vo/wechat/JsSdkVO.java b/src/main/java/com/subsidy/vo/wechat/JsSdkVO.java new file mode 100644 index 0000000..ab25cf4 --- /dev/null +++ b/src/main/java/com/subsidy/vo/wechat/JsSdkVO.java @@ -0,0 +1,17 @@ +package com.subsidy.vo.wechat; + +import lombok.Data; + +@Data +public class JsSdkVO { + + private String errcode; + + private String errmsg; + + private String ticket; + + private String expires_in; + + +} diff --git a/src/main/java/com/subsidy/vo/wechat/SignVO.java b/src/main/java/com/subsidy/vo/wechat/SignVO.java new file mode 100644 index 0000000..9f4e922 --- /dev/null +++ b/src/main/java/com/subsidy/vo/wechat/SignVO.java @@ -0,0 +1,22 @@ +package com.subsidy.vo.wechat; + + +import lombok.Data; + +@Data +public class SignVO { + + private String access_token; + + private String noncestr; + + private String jsapi_ticket; + + private String timestamp; + + private String url; + + private String sign; + + private String code; +} diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index a8eeafc..eda7c57 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -1,8 +1,9 @@ # 本地环境配置 +spring.server.port=23457 # 数据源配置 -#spring.datasource.url=jdbc:mysql://rm-uf6n0xuw1x835h2f7ro.mysql.rds.aliyuncs.com:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 -spring.datasource.url=jdbc:mysql://116.62.57.92:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 +spring.datasource.url=jdbc:mysql://47.97.19.66:3306/subsidy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 +#spring.datasource.url=jdbc:mysql://rm-uf6rab73w0qg843opxo.mysql.rds.aliyuncs.com:3306/subsidy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver #spring.datasource.username=ykadmin_new @@ -25,4 +26,32 @@ spring.datasource.druid.maxPoolPreparedStatementPerConnectionSize=20 spring.datasource.druid.useGlobalDataSourceStat=true # 控制台日志打印 -mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl \ No newline at end of file +mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl + +#spring.redis.host=r-uf6meywj6ysuehg148pd.redis.rds.aliyuncs.com +#spring.redis.password=r-uf6meywj6ysuehg148:Ykhl@208 +#spring.redis.port=6379 +#spring.redis.lettuce.pool.max-idle=16 +#spring.redis.lettuce.pool.max-active=32 +#spring.redis.lettuce.pool.min-idle=8 + +#spring.application.name=spring-boot-mongodb +## mongodb +##spring.data.mongodb.uri=mongodb://47.97.19.66:27017/subsidy +#spring.data.mongodb.username=root +#spring.data.mongodb.password=123456 +##spring.data.mongodb.authentication-database=subsidy +#spring.data.mongodb.database=subsidy +#spring.data.mongodb.host=47.97.19.66 +#spring.data.mongodb.port=27017 + +spring.redis.host=47.97.19.66 +spring.redis.password=Ykhl@208 +spring.redis.port=6389 +spring.redis.lettuce.pool.max-idle=16 +spring.redis.lettuce.pool.max-active=32 +spring.redis.lettuce.pool.min-idle=8 + +qxueyou.appId=qxywz5nnWMI77CM3Tx +qxueyou.securityKey=626737T1-65K0-5xC2-0Y0V-2Aq95qxy +qxueyou.url=https://dev.qxueyou.com/auth/user/token \ No newline at end of file diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index 9fb27c2..602d9bb 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -1,4 +1,5 @@ # 生产环境配置 +spring.server.port=23459 # 数据源配置 spring.datasource.url=jdbc:mysql://rm-uf69w46mo6agw0ahao.mysql.rds.aliyuncs.com:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 @@ -27,7 +28,24 @@ mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl spring.servlet.multipart.max-file-size=2048KB spring.servlet.multipart.max-request-size=4098KB -wechat.appId= wx7785293ff5e31f14 -wechat.appSecret= 25d57cad61fc1b45b3afa46d4c35e8f6 -wechat.msgUrl= https://teachai.youkehulian.com/login -wechat.templateId= Z1HNPLOrKiHEjfR1KMP-cC-uH3BWqDJIHv365Ev20yQ +#wechat.appId= wx7785293ff5e31f14 +#wechat.appSecret= 25d57cad61fc1b45b3afa46d4c35e8f6 +#wechat.msgUrl= https://teachai.youkehulian.com/login +#wechat.templateId= Z1HNPLOrKiHEjfR1KMP-cC-uH3BWqDJIHv365Ev20yQ + +#spring.redis.cluster.nodes=47.97.19.66:6377,47.97.19.66:6378,47.97.16.66:6379 +#spring.redis.password=Ykhl@208 +#spring.redis.lettuce.pool.max-idle=16 +#spring.redis.lettuce.pool.max-active=32 +#spring.redis.lettuce.pool.min-idle=8 + +spring.redis.host=sh-crs-hq5xbrsq.sql.tencentcdb.com +spring.redis.password=Ykhl@302 +spring.redis.port=20260 +spring.redis.lettuce.pool.max-idle=16 +spring.redis.lettuce.pool.max-active=32 +spring.redis.lettuce.pool.min-idle=8 + +qxueyou.appId=qxy1a2n6h16012nJ6x +qxueyou.securityKey=44420Tlu-P463-9041-2h1q-29Z59qxy +qxueyou.url=https://www.qxueyou.com/auth/user/token \ No newline at end of file diff --git a/src/main/resources/application-quartz.properties b/src/main/resources/application-quartz.properties new file mode 100755 index 0000000..0d1f6b6 --- /dev/null +++ b/src/main/resources/application-quartz.properties @@ -0,0 +1,7 @@ +spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX +spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate +spring.quartz.properties.org.quartz.jobStore.tablePrefix=QRTZ_ +spring.quartz.properties.org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool +spring.quartz.properties.org.quartz.threadPool.threadCount=15 +spring.quartz.properties.org.quartz.threadPool.threadPriority=5 +spring.quartz.properties.org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f65f337..f8eae84 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,17 +1,14 @@ # 环境配置 spring.profiles.active=dev -# 端口号 -spring.server.port=23454 -#嵌入tomcat配置 #和CPU数 -spring.server.acceptorThreadCount=200 +spring.server.acceptorThreadCount=600 spring.server.minSpareThreads=100 spring.server.maxSpareThreads=500 -spring.server.maxThreads=800 -spring.server.maxConnections=50000 +spring.server.maxThreads=500 +spring.server.maxConnections=1000 #10秒超时 spring.server.connectionTimeout=20000 -spring.server.protocol=org.apache.coyote.http11.Http11Nio2Protocol +spring.server.protocol=org.apache.coyote.http11.Http11AprProtocol spring.server.redirectPort=8443 spring.server.compression=on #文件请求大小 @@ -63,3 +60,18 @@ spring.quartz.overwrite-existing-jobs=false # 自动建表,如果已经存在表请勿使用,会覆盖数据表 #spring.quartz.jdbc.initialize-schema=always #spring.datasource.initialization-mode=embedded + +#spring.redis.host=r-uf6m4cpkjrgpzywjm3pd.redis.rds.aliyuncs.com +#spring.redis.port=6379 +#spring.redis.password=r-uf6m4cpkjrgpzywjm3:Ykhl@208 + +wechat: +#pro +appId: wx5e1ecb9c9bd33451 +appSecret: 4f5e1abb6fb4f68f5273820b6295ec6b + + +#活体检测配置 +activity.captchaAppId: 2013197365 +activity.appSecretKey: 04ABoF0ZVuMje8NP84DE5Sg** +activity.businessId: 1 \ No newline at end of file diff --git a/src/main/resources/code.properties b/src/main/resources/code.properties index 1e16acb..c677260 100644 --- a/src/main/resources/code.properties +++ b/src/main/resources/code.properties @@ -1,13 +1,22 @@ meishu.code-message[0]=成功 meishu.code-message[1010]=无效的令牌 +meishu.code-message[1011]=当前账户已在其他设备登录 meishu.code-message[10003]=验证码错误 meishu.code-message[10004]=账号或密码错误 meishu.code-message[10010]=学生信息不存在 meishu.code-message[10011]=成员信息不存在 +meishu.code-message[10012]=该账号不存在 meishu.code-message[10013]=账户已冻结,请联系账户管理员 meishu.code-message[10014]=该成员已存在,请勿重复添加 +meishu.code-message[10015]=首次登录请使用验证码登录 +meishu.code-message[10016]=密码输入错误,请稍后再试 +meishu.code-message[10017]=该公司不存在该员工 +meishu.code-message[10021]=密码输入错误,您还可以输入1次密码 +meishu.code-message[10022]=密码输入错误,您还可以输入2次密码 +meishu.code-message[10023]=密码输入错误,您还可以输入3次密码 +meishu.code-message[10024]=密码输入错误,您还可以输入4次密码 meishu.code-message[20001]=该课程已存在 @@ -17,6 +26,11 @@ meishu.code-message[30001]=该部门已存在 meishu.code-message[40001]=该目录已存在 +meishu.code-message[50001]=该试卷已存在 + +meishu.code-message[60001]=已超过最大测试次数 + + meishu.code-message[70010]=验证码错误 meishu.code-message[70011]=验证码发送频繁 meishu.code-message[70012]=手机号未注册 @@ -30,3 +44,27 @@ meishu.code-message[90001]=该类目已存在 meishu.code-message[10001]=导入失败 +meishu.code-message[11001]=该行业已存在 + +meishu.code-message[70001]=添加通知失败,通知时间不能小于一小时 +meishu.code-message[70002]=定时任务创建失败 +meishu.code-message[70003]=定时任务删除失败 + +meishu.code-message[12001]=该职级已存在 + +meishu.code-message[13001]=已达到当日最大时长 + +meishu.code-message[14001]=认证失败,签名不通过 +meishu.code-message[14002]=认证失败,签名已过期 + +meishu.code-message[15001]=类型已存在 +meishu.code-message[15002]=类型已存在证书,删除失败 + +meishu.code-message[16001]=该条件已存在 + + +meishu.code-message[17001]=系统不支持00:00:00~06:00:00学习 +meishu.code-message[18000]=视频不存在 +meishu.code-message[18001]=删除失败,目录下没有该视频 + + diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index dfd4cbb..0006c90 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -7,7 +7,7 @@ - debug + info %d [%t] %5p %c:%L - %m%n @@ -42,12 +42,13 @@ ${LOG_PATH}${APP_NAME}/error/%d{yyyy-MM-dd}-%i.log.gz - 30 + 180 - + + @@ -56,14 +57,15 @@ - + + - + diff --git a/src/main/resources/mapper/AccessTokenMapper.xml b/src/main/resources/mapper/AccessTokenMapper.xml new file mode 100644 index 0000000..28f635b --- /dev/null +++ b/src/main/resources/mapper/AccessTokenMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + create_date, + update_date, + id, access_token + + + diff --git a/src/main/resources/mapper/ActivityDetectionMapper.xml b/src/main/resources/mapper/ActivityDetectionMapper.xml new file mode 100644 index 0000000..9fc0b42 --- /dev/null +++ b/src/main/resources/mapper/ActivityDetectionMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, class_id, member_id, status + + + diff --git a/src/main/resources/mapper/AdministerMapper.xml b/src/main/resources/mapper/AdministerMapper.xml index f88f415..ab76a16 100644 --- a/src/main/resources/mapper/AdministerMapper.xml +++ b/src/main/resources/mapper/AdministerMapper.xml @@ -47,6 +47,7 @@ SELECT t2.id, t2.user_name, + t2.gender, t2.id_card, t2.account_name, t2.telephone @@ -119,4 +120,77 @@ + + + + diff --git a/src/main/resources/mapper/AnsweringQuestionMapper.xml b/src/main/resources/mapper/AnsweringQuestionMapper.xml index efd56ac..595c4d7 100644 --- a/src/main/resources/mapper/AnsweringQuestionMapper.xml +++ b/src/main/resources/mapper/AnsweringQuestionMapper.xml @@ -4,15 +4,15 @@ - - - - - - - - - + + + + + + + + + @@ -25,23 +25,30 @@ diff --git a/src/main/resources/mapper/BusinessScopeDictMapper.xml b/src/main/resources/mapper/BusinessScopeDictMapper.xml new file mode 100644 index 0000000..234f87a --- /dev/null +++ b/src/main/resources/mapper/BusinessScopeDictMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, business_scope_name + + + diff --git a/src/main/resources/mapper/CategoryMapper.xml b/src/main/resources/mapper/CategoryMapper.xml index d896583..1c21f9a 100644 --- a/src/main/resources/mapper/CategoryMapper.xml +++ b/src/main/resources/mapper/CategoryMapper.xml @@ -19,4 +19,15 @@ id, name + diff --git a/src/main/resources/mapper/CertCompanyMappingMapper.xml b/src/main/resources/mapper/CertCompanyMappingMapper.xml new file mode 100644 index 0000000..c5832c2 --- /dev/null +++ b/src/main/resources/mapper/CertCompanyMappingMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, company_id, cert_id + + + + + + diff --git a/src/main/resources/mapper/CertDictMapper.xml b/src/main/resources/mapper/CertDictMapper.xml new file mode 100644 index 0000000..66f3357 --- /dev/null +++ b/src/main/resources/mapper/CertDictMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + id, cert_name, price, cover_page, end_date + + + + + + diff --git a/src/main/resources/mapper/CertMemberFileMappingMapper.xml b/src/main/resources/mapper/CertMemberFileMappingMapper.xml new file mode 100644 index 0000000..1fdc518 --- /dev/null +++ b/src/main/resources/mapper/CertMemberFileMappingMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, cert_id, file_name, file_url + + + diff --git a/src/main/resources/mapper/CertMemberMappingMapper.xml b/src/main/resources/mapper/CertMemberMappingMapper.xml new file mode 100644 index 0000000..3499548 --- /dev/null +++ b/src/main/resources/mapper/CertMemberMappingMapper.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, member_id, cert_id + + + + + + + + + + diff --git a/src/main/resources/mapper/CertRequirementMapper.xml b/src/main/resources/mapper/CertRequirementMapper.xml new file mode 100644 index 0000000..07c9272 --- /dev/null +++ b/src/main/resources/mapper/CertRequirementMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, cert_id, cert_requirement + + + diff --git a/src/main/resources/mapper/CertTypeDictMapper.xml b/src/main/resources/mapper/CertTypeDictMapper.xml new file mode 100644 index 0000000..b410e4c --- /dev/null +++ b/src/main/resources/mapper/CertTypeDictMapper.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, type_name + + + + + + + diff --git a/src/main/resources/mapper/CertTypeMappingMapper.xml b/src/main/resources/mapper/CertTypeMappingMapper.xml new file mode 100644 index 0000000..41f6fa6 --- /dev/null +++ b/src/main/resources/mapper/CertTypeMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, cert_id, type_id + + + diff --git a/src/main/resources/mapper/ClassDictMapper.xml b/src/main/resources/mapper/ClassDictMapper.xml index 7d84003..5b0726d 100644 --- a/src/main/resources/mapper/ClassDictMapper.xml +++ b/src/main/resources/mapper/ClassDictMapper.xml @@ -31,19 +31,26 @@ t.start_date, t.end_date, t4.cnt, - t.class_type + t5.class_type, + t5.id as class_type_id FROM class_dict t + left join class_type_dict t5 on t.class_type_id = t5.id LEFT JOIN course_dict t2 ON t.course_id = t2.id LEFT JOIN ( SELECT t3.class_id, sum( 1 ) AS cnt FROM class_member_mapping t3 WHERE t3.delete_date IS NULL GROUP BY t3.class_id ) t4 ON t.id = t4.class_id WHERE t.delete_date IS NULL AND t2.delete_date IS NULL + and t5.delete_date is null and t.company_id = #{companyId} and t.class_name like concat('%',#{className} ,'%') + + and t.end_date >= DATE_FORMAT( #{startDate}, '%Y-%m-%d' ) + and t.start_date < DATE_FORMAT( #{endDate}, '%Y-%m-%d' ) + order by t.create_date desc @@ -53,19 +60,31 @@ FROM class_dict t LEFT JOIN course_content t2 ON t.course_id = t2.course_id - LEFT JOIN vod_dict t3 ON t2.id = t3.content_id + LEFT JOIN content_vod_mapping t4 ON t4.content_id = t2.id + LEFT JOIN vod_dict t3 ON t3.id = t4.vod_id WHERE t.delete_date IS NULL AND t2.delete_date IS NULL AND t3.delete_date IS NULL - and t3.id is not null - and t.id = #{classId} + AND t4.delete_date IS NULL + AND t3.id IS NOT NULL + AND t.id = #{classId} SELECT - t2.* + t2.id, + t2.company_id, + t2.user_name, + t2.account_name, + t2.telephone, + t2.PASSWORD, + t2.gender, + t2.image, + t2.id_card, + t2.STATUS, + t2.first_login FROM class_member_mapping t LEFT JOIN member t2 ON t.member_id = t2.id @@ -97,4 +126,47 @@ AND t.class_id = #{classId} + + + diff --git a/src/main/resources/mapper/ClassHourDictMapper.xml b/src/main/resources/mapper/ClassHourDictMapper.xml index f96ac25..14853ec 100644 --- a/src/main/resources/mapper/ClassHourDictMapper.xml +++ b/src/main/resources/mapper/ClassHourDictMapper.xml @@ -4,12 +4,12 @@ - - - - - - + + + + + + diff --git a/src/main/resources/mapper/ClassMemberMappingMapper.xml b/src/main/resources/mapper/ClassMemberMappingMapper.xml index 712a3c4..74790ff 100644 --- a/src/main/resources/mapper/ClassMemberMappingMapper.xml +++ b/src/main/resources/mapper/ClassMemberMappingMapper.xml @@ -29,8 +29,50 @@ WHERE t.delete_date IS NULL AND t2.delete_date IS NULL - and t2.start_date <= now() - and t2.end_date >= now() + and DATE_FORMAT(t2.end_date ,'%Y-%m-%d')>=DATE_FORMAT(now(), '%Y-%m-%d') + and DATE_FORMAT(t2.start_date ,'%Y-%m-%d')<= DATE_FORMAT(now(), '%Y-%m-%d') + and t.member_id = #{memberId} + + + + + + + diff --git a/src/main/resources/mapper/ClassNoticeMapper.xml b/src/main/resources/mapper/ClassNoticeMapper.xml new file mode 100644 index 0000000..c4f205b --- /dev/null +++ b/src/main/resources/mapper/ClassNoticeMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, course_id, notice_type, notice_time + + + diff --git a/src/main/resources/mapper/ClassTypeDictMapper.xml b/src/main/resources/mapper/ClassTypeDictMapper.xml new file mode 100644 index 0000000..5a7fa2c --- /dev/null +++ b/src/main/resources/mapper/ClassTypeDictMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, company_id, class_type + + + diff --git a/src/main/resources/mapper/CompanyDictMapper.xml b/src/main/resources/mapper/CompanyDictMapper.xml index 6dc792b..a9ad5f9 100644 --- a/src/main/resources/mapper/CompanyDictMapper.xml +++ b/src/main/resources/mapper/CompanyDictMapper.xml @@ -21,45 +21,78 @@ - SELECT - * + t.id, + t.company_name FROM - administer t - LEFT JOIN role_administer_mapping t2 ON t.id = t2.administer_id - WHERE - t.delete_date IS NOT NULL - AND t2.delete_date IS NOT NULL - AND t.company_id = #{companyId} - AND t2.role_id = 2 + company_dict t + where t.delete_date is null + + and t.company_name like concat('%',#{companyName} ,'%') + + + diff --git a/src/main/resources/mapper/CompanyFieldMappingMapper.xml b/src/main/resources/mapper/CompanyFieldMappingMapper.xml new file mode 100644 index 0000000..15928af --- /dev/null +++ b/src/main/resources/mapper/CompanyFieldMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, company_id, field_id + + + diff --git a/src/main/resources/mapper/ContentVodMappingMapper.xml b/src/main/resources/mapper/ContentVodMappingMapper.xml new file mode 100644 index 0000000..192c893 --- /dev/null +++ b/src/main/resources/mapper/ContentVodMappingMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, content_id, vod_id, order_no + + + diff --git a/src/main/resources/mapper/CourseCategoryMappingMapper.xml b/src/main/resources/mapper/CourseCategoryMappingMapper.xml new file mode 100644 index 0000000..b1dbeb3 --- /dev/null +++ b/src/main/resources/mapper/CourseCategoryMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, course_id, category_id + + + diff --git a/src/main/resources/mapper/CourseContentMapper.xml b/src/main/resources/mapper/CourseContentMapper.xml index 2b17ffb..e0ee625 100644 --- a/src/main/resources/mapper/CourseContentMapper.xml +++ b/src/main/resources/mapper/CourseContentMapper.xml @@ -21,9 +21,18 @@ id, course_id, content, order_no - SELECT - t2.* + t2.id, + t2.content_id, + t2.vod_name, + t2.vod_length, + t2.vod_type, + t2.vod_size, + t2.vod_url, + t2.vod_code, + t2.teacher_name, + t2.cover_page FROM course_content t LEFT JOIN vod_dict t2 ON t.id = t2.content_id @@ -31,7 +40,112 @@ t.delete_date IS NULL AND t2.delete_date IS NULL and t.course_id = #{courseId} - and t2.id is not null + and t2.id is not null + + + + + + + diff --git a/src/main/resources/mapper/CourseDictMapper.xml b/src/main/resources/mapper/CourseDictMapper.xml index f4f8fbf..82802c4 100644 --- a/src/main/resources/mapper/CourseDictMapper.xml +++ b/src/main/resources/mapper/CourseDictMapper.xml @@ -9,40 +9,58 @@ - - @@ -90,32 +108,36 @@ AND t.administer_id is null - SELECT - t.*, - t2.name + count( t2.id ) FROM - course_dict t - left join category t2 on t.category_id = t2.id + course_content t1 + LEFT JOIN content_vod_mapping t3 ON t3.content_id = t1.id + LEFT JOIN vod_dict t2 ON t2.id = t3.vod_id WHERE - t.delete_date IS NULL - - AND t.category_id = #{categoryId} - - - AND t.course_name like concat('%',#{courseName} ,'%') - - - AND t.course_source = #{courseSource} - - - AND t.course_type = #{courseType} - - - AND t.company_id = #{companyId} - + t1.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + AND t1.course_id = #{courseId} + + + update course_dict set open_status = #{openStatus} where id = #{id} + diff --git a/src/main/resources/mapper/CourseFieldMappingMapper.xml b/src/main/resources/mapper/CourseFieldMappingMapper.xml new file mode 100644 index 0000000..d9b4ebd --- /dev/null +++ b/src/main/resources/mapper/CourseFieldMappingMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, course_id, field_mapping + + + + + diff --git a/src/main/resources/mapper/CourseJobMappingMapper.xml b/src/main/resources/mapper/CourseJobMappingMapper.xml new file mode 100644 index 0000000..4e6ae89 --- /dev/null +++ b/src/main/resources/mapper/CourseJobMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, job_id, course_id + + + diff --git a/src/main/resources/mapper/CourseRankMappingMapper.xml b/src/main/resources/mapper/CourseRankMappingMapper.xml new file mode 100644 index 0000000..156b9eb --- /dev/null +++ b/src/main/resources/mapper/CourseRankMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, course_id, rank_id + + + diff --git a/src/main/resources/mapper/DepartmentDictMapper.xml b/src/main/resources/mapper/DepartmentDictMapper.xml index bb55b2c..23af1a9 100644 --- a/src/main/resources/mapper/DepartmentDictMapper.xml +++ b/src/main/resources/mapper/DepartmentDictMapper.xml @@ -33,4 +33,5 @@ + diff --git a/src/main/resources/mapper/ExerciseDictMapper.xml b/src/main/resources/mapper/ExerciseDictMapper.xml index 7c0cd4f..360ac6b 100644 --- a/src/main/resources/mapper/ExerciseDictMapper.xml +++ b/src/main/resources/mapper/ExerciseDictMapper.xml @@ -25,4 +25,42 @@ id, exercise_type, course_id, difficulty, title, items, right_answer, detail + + + + diff --git a/src/main/resources/mapper/ExerciseDoneHistoryMapper.xml b/src/main/resources/mapper/ExerciseDoneHistoryMapper.xml new file mode 100644 index 0000000..2547a0d --- /dev/null +++ b/src/main/resources/mapper/ExerciseDoneHistoryMapper.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, paper_id, member_id, class_id, exercise_id, answer, result, length + + + + + + + diff --git a/src/main/resources/mapper/ExerciseDoneResultMapper.xml b/src/main/resources/mapper/ExerciseDoneResultMapper.xml index 4b35529..081c5a0 100644 --- a/src/main/resources/mapper/ExerciseDoneResultMapper.xml +++ b/src/main/resources/mapper/ExerciseDoneResultMapper.xml @@ -22,4 +22,176 @@ id, member_id, course_id, right_counts, total_counts + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/FieldDictMapper.xml b/src/main/resources/mapper/FieldDictMapper.xml new file mode 100644 index 0000000..a1785f9 --- /dev/null +++ b/src/main/resources/mapper/FieldDictMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, field_name + + + + + + + + diff --git a/src/main/resources/mapper/FileDictMapper.xml b/src/main/resources/mapper/FileDictMapper.xml index 8ef3647..1a0fd0c 100644 --- a/src/main/resources/mapper/FileDictMapper.xml +++ b/src/main/resources/mapper/FileDictMapper.xml @@ -22,4 +22,22 @@ id, content_id, file_name, file_size, order_no + + diff --git a/src/main/resources/mapper/ImageCheckRecordMapper.xml b/src/main/resources/mapper/ImageCheckRecordMapper.xml new file mode 100644 index 0000000..9ce170f --- /dev/null +++ b/src/main/resources/mapper/ImageCheckRecordMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, class_id, paper_id, request_id + + + diff --git a/src/main/resources/mapper/JobDictMapper.xml b/src/main/resources/mapper/JobDictMapper.xml new file mode 100644 index 0000000..e7462e6 --- /dev/null +++ b/src/main/resources/mapper/JobDictMapper.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, company_id, job_name, order_no + + + + + + + diff --git a/src/main/resources/mapper/JobMemberMappingMapper.xml b/src/main/resources/mapper/JobMemberMappingMapper.xml new file mode 100644 index 0000000..d0719eb --- /dev/null +++ b/src/main/resources/mapper/JobMemberMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, job_id, member_id + + + diff --git a/src/main/resources/mapper/MemberMapper.xml b/src/main/resources/mapper/MemberMapper.xml index a13b963..3be171e 100644 --- a/src/main/resources/mapper/MemberMapper.xml +++ b/src/main/resources/mapper/MemberMapper.xml @@ -24,6 +24,24 @@ id, user_name, telephone, password, gender, image, id_card + + + + SELECT - t2.* + t2.id, + t2.user_name, + t2.account_name, + t2.account_name_en, + t2.telephone, + t2.gender, + t2.id_card, + t2.status, + t2.email, + t2.work_no, + t2.induction_date FROM member_department_mapping t LEFT JOIN member t2 ON t.member_id = t2.id @@ -72,6 +192,141 @@ and t2.status = #{status} + + and DATE_FORMAT(t2.induction_date ,'%Y-%m-%d')>=DATE_FORMAT(#{startDate}, '%Y-%m-%d') + + + and DATE_FORMAT(t2.induction_date ,'%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d') + + + + + + + + + + + + + + + update member set check_image = nulll where id = #{id} + diff --git a/src/main/resources/mapper/MemberStudyLengthMapper.xml b/src/main/resources/mapper/MemberStudyLengthMapper.xml new file mode 100644 index 0000000..9f45e93 --- /dev/null +++ b/src/main/resources/mapper/MemberStudyLengthMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, member_id, total_length + + + diff --git a/src/main/resources/mapper/OprAdmDictMapper.xml b/src/main/resources/mapper/OprAdmDictMapper.xml new file mode 100644 index 0000000..eba47cb --- /dev/null +++ b/src/main/resources/mapper/OprAdmDictMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, user_id, opr_type + + + + + + + + + + diff --git a/src/main/resources/mapper/OprMemDictMapper.xml b/src/main/resources/mapper/OprMemDictMapper.xml new file mode 100644 index 0000000..5312914 --- /dev/null +++ b/src/main/resources/mapper/OprMemDictMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, user_id, opr_type + + + + + + + diff --git a/src/main/resources/mapper/PaperDictMapper.xml b/src/main/resources/mapper/PaperDictMapper.xml new file mode 100644 index 0000000..a6e33a4 --- /dev/null +++ b/src/main/resources/mapper/PaperDictMapper.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, course_id, paper_name, paper_status + + + + + + + + + diff --git a/src/main/resources/mapper/RankDictMapper.xml b/src/main/resources/mapper/RankDictMapper.xml new file mode 100644 index 0000000..8b4d9f0 --- /dev/null +++ b/src/main/resources/mapper/RankDictMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, rank + + + + + + + diff --git a/src/main/resources/mapper/RoleAdministerMappingMapper.xml b/src/main/resources/mapper/RoleAdministerMappingMapper.xml index be38418..fc4f383 100644 --- a/src/main/resources/mapper/RoleAdministerMappingMapper.xml +++ b/src/main/resources/mapper/RoleAdministerMappingMapper.xml @@ -20,4 +20,17 @@ id, administer_id, role_id + + diff --git a/src/main/resources/mapper/RotationImgDictMapper.xml b/src/main/resources/mapper/RotationImgDictMapper.xml new file mode 100644 index 0000000..cf4be5f --- /dev/null +++ b/src/main/resources/mapper/RotationImgDictMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, company_id, rotation_img + + + diff --git a/src/main/resources/mapper/SignInRecordMapper.xml b/src/main/resources/mapper/SignInRecordMapper.xml index 59b954b..48c992a 100644 --- a/src/main/resources/mapper/SignInRecordMapper.xml +++ b/src/main/resources/mapper/SignInRecordMapper.xml @@ -21,15 +21,14 @@ id, student_id, class_id, sign_in_date - SELECT t.id AS classId, t2.id AS courseId, t.class_name, t2.course_name, t.start_date, - t.end_date, - t.class_type + t.end_date FROM class_dict t LEFT JOIN company_dict t3 ON t3.id = t.company_id @@ -37,6 +36,7 @@ WHERE t.delete_date IS NULL AND t2.delete_date IS NULL + and t3.delete_date is null and t3.id = #{id} AND t.course_name like concat('%',#{courseName} ,'%') @@ -46,4 +46,16 @@ + + diff --git a/src/main/resources/mapper/VodDictMapper.xml b/src/main/resources/mapper/VodDictMapper.xml index a7efd42..13e12fc 100644 --- a/src/main/resources/mapper/VodDictMapper.xml +++ b/src/main/resources/mapper/VodDictMapper.xml @@ -8,7 +8,7 @@ - + @@ -22,23 +22,92 @@ create_date, update_date, delete_date, - id, content_id, vod_name, vod_length, vod_type, vod_size, vod_url, vod_code + id, label_id, vod_name, vod_length, vod_type, vod_size, vod_url, vod_code + + + + + + update vod_dict t set t.order_no = #{orderNo} where t.id = #{id} + + + diff --git a/src/main/resources/mapper/VodLabelDictMapper.xml b/src/main/resources/mapper/VodLabelDictMapper.xml new file mode 100644 index 0000000..7467d2a --- /dev/null +++ b/src/main/resources/mapper/VodLabelDictMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, label_name + + + diff --git a/src/main/resources/mapper/VodPlayHistoryMapper.xml b/src/main/resources/mapper/VodPlayHistoryMapper.xml index 5b71efc..e9c63b4 100644 --- a/src/main/resources/mapper/VodPlayHistoryMapper.xml +++ b/src/main/resources/mapper/VodPlayHistoryMapper.xml @@ -4,15 +4,15 @@ - - - - - - - - - + + + + + + + + + @@ -22,23 +22,30 @@ delete_date, id, class_id, vod_id, member_id, play_length, play_record + + + - + SELECT t2.id, t2.vod_length, t2.teacher_name, t2.vod_url, t2.vod_name, t3.play_record, - round( t3.play_record * 100 / t2.vod_length, 0 ) AS percent, - t.playDate + t3.create_date, + IF + ( + round( t.play_length * 100 / t2.vod_length )>= 100, + 100, + round( t.play_length * 100 / t2.vod_length )) AS percent FROM ( SELECT t.vod_id, t.member_id, - max( t.create_date ) AS playDate + sum( t.play_length ) AS play_length FROM vod_play_history t WHERE @@ -48,13 +55,347 @@ t.vod_id, t.member_id ) t - LEFT JOIN vod_play_history t3 ON t.playDate = t3.create_date - AND t.vod_id = t3.vod_id + LEFT JOIN vod_play_history t3 ON t.vod_id = t3.vod_id AND t.member_id = t3.member_id LEFT JOIN vod_dict t2 ON t.vod_id = t2.id WHERE t2.delete_date IS NULL - order by t.playDate desc + ORDER BY + t3.create_date DESC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/mybatis-plus.properties b/src/main/resources/mybatis-plus.properties index 2e774c5..b25caa2 100644 --- a/src/main/resources/mybatis-plus.properties +++ b/src/main/resources/mybatis-plus.properties @@ -6,7 +6,7 @@ setParent=com.subsidy # mapper.xml文件生成路径 mapperPath=/src/main/resources/mapper/ # 数据库地址 -url=jdbc:mysql://116.62.57.92:3306/subsidy?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true&useAffectedRows=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true +url=jdbc:mysql://47.97.19.66:3306/subsidy_test?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true&useAffectedRows=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true driverName=com.mysql.cj.jdbc.Driver userName=devloper password=dev@1553$ \ No newline at end of file