Commit c06779f7 by 涂亚平

去掉了redis

1 parent 8fab15d4
Showing with 1149 additions and 331 deletions
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<itext-asian.version>5.2.0</itext-asian.version> <itext-asian.version>5.2.0</itext-asian.version>
<itextpdf.version>5.4.1</itextpdf.version> <itextpdf.version>5.4.1</itextpdf.version>
<java-jwt.version>3.10.3</java-jwt.version> <java-jwt.version>3.10.3</java-jwt.version>
<jedis.version>3.3.0</jedis.version> <!-- <jedis.version>3.3.0</jedis.version>-->
</properties> </properties>
<dependencies> <dependencies>
...@@ -192,21 +192,21 @@ ...@@ -192,21 +192,21 @@
<version>1.0.7</version> <version>1.0.7</version>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>org.springframework.boot</groupId> <!-- <groupId>org.springframework.boot</groupId>-->
<artifactId>spring-boot-starter-data-redis</artifactId> <!-- <artifactId>spring-boot-starter-data-redis</artifactId>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId> <artifactId>spring-boot-starter-quartz</artifactId>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>redis.clients</groupId> <!-- <groupId>redis.clients</groupId>-->
<artifactId>jedis</artifactId> <!-- <artifactId>jedis</artifactId>-->
<version>${jedis.version}</version> <!-- <version>${jedis.version}</version>-->
</dependency> <!-- </dependency>-->
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>--> <!-- <groupId>org.springframework.boot</groupId>-->
......
package com.subsidy.common.configure; //package com.subsidy.common.configure;
//
import com.fasterxml.jackson.annotation.JsonAutoDetect; //import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor; //import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper; //import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.cache.annotation.CachingConfigurerSupport; //import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching; //import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory; //
import org.springframework.data.redis.core.*; //@EnableCaching
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; //
import org.springframework.data.redis.serializer.StringRedisSerializer; ///**
// * <p>
@EnableCaching // * Redis
// * </p>
/** // *
* <p> // * @author DengMin
* Redis // * @since 2020/12/14
* </p> // */
* //@Configuration
* @author DengMin //public class RedisConfig extends CachingConfigurerSupport {
* @since 2020/12/14 //
*/ // /**
@Configuration // * retemplate相关配置
public class RedisConfig extends CachingConfigurerSupport { // * @param factory
// * @return
/** // */
* retemplate相关配置 // @Bean
* @param factory // public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
* @return //
*/ // RedisTemplate<String, Object> template = new RedisTemplate<>();
@Bean // // 配置连接工厂
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) { // template.setConnectionFactory(factory);
//
RedisTemplate<String, Object> template = new RedisTemplate<>(); // //使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式)
// 配置连接工厂 // Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.class);
template.setConnectionFactory(factory); //
// ObjectMapper om = new ObjectMapper();
//使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式) // // 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public
Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.class); // om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
// // 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常
ObjectMapper om = new ObjectMapper(); // om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
// 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public // jacksonSeial.setObjectMapper(om);
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); //
// 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常 // // 值采用json序列化
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); // template.setValueSerializer(jacksonSeial);
jacksonSeial.setObjectMapper(om); // //使用StringRedisSerializer来序列化和反序列化redis的key值
// template.setKeySerializer(new StringRedisSerializer());
// 值采用json序列化 //
template.setValueSerializer(jacksonSeial); // // 设置hash key 和value序列化模式
//使用StringRedisSerializer来序列化和反序列化redis的key值 // template.setHashKeySerializer(new StringRedisSerializer());
template.setKeySerializer(new StringRedisSerializer()); // template.setHashValueSerializer(jacksonSeial);
// template.afterPropertiesSet();
// 设置hash key 和value序列化模式 //
template.setHashKeySerializer(new StringRedisSerializer()); // return template;
template.setHashValueSerializer(jacksonSeial); // }
template.afterPropertiesSet(); //
// /**
return template; // * 对hash类型的数据操作
} // *
// * @param redisTemplate
/** // * @return
* 对hash类型的数据操作 // */
* // @Bean
* @param redisTemplate // public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
* @return // return redisTemplate.opsForHash();
*/ // }
@Bean //
public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) { // /**
return redisTemplate.opsForHash(); // * 对redis字符串类型数据操作
} // *
// * @param redisTemplate
/** // * @return
* 对redis字符串类型数据操作 // */
* // @Bean
* @param redisTemplate // public ValueOperations<String, Object> valueOperations(RedisTemplate<String, Object> redisTemplate) {
* @return // return redisTemplate.opsForValue();
*/ // }
@Bean //
public ValueOperations<String, Object> valueOperations(RedisTemplate<String, Object> redisTemplate) { // /**
return redisTemplate.opsForValue(); // * 对链表类型的数据操作
} // *
// * @param redisTemplate
/** // * @return
* 对链表类型的数据操作 // */
* // @Bean
* @param redisTemplate // public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) {
* @return // return redisTemplate.opsForList();
*/ // }
@Bean //
public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) { // /**
return redisTemplate.opsForList(); // * 对无序集合类型的数据操作
} // *
// * @param redisTemplate
/** // * @return
* 对无序集合类型的数据操作 // */
* // @Bean
* @param redisTemplate // public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) {
* @return // return redisTemplate.opsForSet();
*/ // }
@Bean //
public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) { // /**
return redisTemplate.opsForSet(); // * 对有序集合类型的数据操作
} // *
// * @param redisTemplate
/** // * @return
* 对有序集合类型的数据操作 // */
* // @Bean
* @param redisTemplate // public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) {
* @return // return redisTemplate.opsForZSet();
*/ // }
@Bean //
public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) { //
return redisTemplate.opsForZSet(); //}
} \ No newline at end of file
}
\ No newline at end of file
...@@ -63,7 +63,7 @@ public class AdministerController { ...@@ -63,7 +63,7 @@ public class AdministerController {
@PostMapping("/administers") @PostMapping("/administers")
@ApiOperation("查询所有运营者 { userName pageNum pageSize }") @ApiOperation("查询所有运营者 { userName pageNum pageSize }")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){ public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){
return ResponseData.generateCreatedResponse(0,administerService.operators(operatorsDTO)); return ResponseData.generateCreatedResponse(0,administerService.operators(operatorsDTO));
} }
...@@ -125,7 +125,7 @@ public class AdministerController { ...@@ -125,7 +125,7 @@ public class AdministerController {
@PostMapping("exerciseTest") @PostMapping("exerciseTest")
@ApiOperation("班级管理--测评成绩 id 班级id userName paperId") @ApiOperation("班级管理--测评成绩 id 班级id userName paperId")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO exerciseTest(@RequestBody ClassDetailDTO classDetailDTO){ public ResponseVO exerciseTest(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.exerciseTest(classDetailDTO)); return ResponseData.generateCreatedResponse(0,administerService.exerciseTest(classDetailDTO));
} }
...@@ -198,7 +198,7 @@ public class AdministerController { ...@@ -198,7 +198,7 @@ public class AdministerController {
@PostMapping("exportZip") @PostMapping("exportZip")
@ApiOperation("下载压缩包 id 班级id") @ApiOperation("下载压缩包 id 班级id")
@CrossOrigin @CrossOrigin
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportZip(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ public void exportZip(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
administerService.export(classDetailDTO); administerService.export(classDetailDTO);
} }
......
...@@ -6,6 +6,7 @@ import com.subsidy.common.ResponseVO; ...@@ -6,6 +6,7 @@ import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired; import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.classDict.AddClassDTO; import com.subsidy.dto.classDict.AddClassDTO;
import com.subsidy.dto.classDict.AddMemberToClassDTO; import com.subsidy.dto.classDict.AddMemberToClassDTO;
import com.subsidy.dto.classDict.GetClassBaseInfoDTO;
import com.subsidy.dto.classDict.GetSpareMembersDTO; import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassMemberMappingDO; import com.subsidy.model.ClassMemberMappingDO;
...@@ -92,15 +93,15 @@ public class ClassDictController { ...@@ -92,15 +93,15 @@ public class ClassDictController {
} }
@PostMapping("batchSms") @PostMapping("batchSms")
@ApiOperation(" 批量发送班级短信 {id 班级id}") @ApiOperation(" 批量发送班级短信通知 {id 班级id }")
public ResponseVO batchSms(@RequestBody ClassDictDO classDictDO){ public ResponseVO batchSms(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.batchSms(classDictDO)); return ResponseData.generateCreatedResponse(0,classDictService.batchSms(classDictDO));
} }
@PostMapping("getClassBaseInfo") @PostMapping("getClassBaseInfo")
@ApiOperation("班级详情--获取课程基本信息") @ApiOperation("班级详情--获取课程基本信息 id")
public ResponseVO getClassBaseInfo(@RequestBody ClassDictDO classDictDO){ public ResponseVO getClassBaseInfo(@RequestBody GetClassBaseInfoDTO getClassBaseInfoDTO){
return ResponseData.generateCreatedResponse(0,classDictService.getClassBaseInfo(classDictDO)); return ResponseData.generateCreatedResponse(0,classDictService.getClassBaseInfo(getClassBaseInfoDTO));
} }
......
...@@ -8,6 +8,7 @@ import com.subsidy.model.ClassHourDictDO; ...@@ -8,6 +8,7 @@ import com.subsidy.model.ClassHourDictDO;
import com.subsidy.model.VodPlayHistoryDO; import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.service.ClassHourDictService; import com.subsidy.service.ClassHourDictService;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.classdict.GetSettingVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -40,10 +41,10 @@ public class ClassHourDictController { ...@@ -40,10 +41,10 @@ public class ClassHourDictController {
} }
@PostMapping("updateSetting") @PostMapping("updateSetting")
@ApiOperation("修改当天设置时长 companyId 主键 classHour status interrupt interruptStatus repeatTime repeatStatus") @ApiOperation("修改当天设置时长 companyId 主键 logo classHour status interrupt interruptStatus repeatTime repeatStatus rotationImgDictDOS[companyId rotationImg]")
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateSetting(@RequestBody ClassHourDictDO classHourDictDO){ public ResponseVO updateSetting(@RequestBody GetSettingVO getSettingVO){
return ResponseData.generateCreatedResponse(0,classHourDictService.updateSetting(classHourDictDO)); return ResponseData.generateCreatedResponse(0,classHourDictService.updateSetting(getSettingVO));
} }
@PostMapping("pollingGet") @PostMapping("pollingGet")
......
...@@ -51,7 +51,7 @@ public class ClassNoticeController { ...@@ -51,7 +51,7 @@ public class ClassNoticeController {
@PostMapping("queryClassNotices") @PostMapping("queryClassNotices")
@ApiOperation("查看某个课程的通知提醒 classId 课程id status 状态(待发送/已发送)") @ApiOperation("查看某个课程的通知提醒 classId 课程id status 状态(待发送/已发送)")
public ResponseVO queryClassNotices(ClassNoticeDO classNoticeDO){ public ResponseVO queryClassNotices(@RequestBody ClassNoticeDO classNoticeDO){
return ResponseData.generateCreatedResponse(0,classNoticeService.queryClassNotices(classNoticeDO)); return ResponseData.generateCreatedResponse(0,classNoticeService.queryClassNotices(classNoticeDO));
} }
......
...@@ -55,7 +55,7 @@ public class CompanyDictController { ...@@ -55,7 +55,7 @@ public class CompanyDictController {
} }
@PostMapping("updateCompany") @PostMapping("updateCompany")
@ApiOperation("修改企业 id accountName:账号 companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员") @ApiOperation("修改企业 id accountName:账号 logo companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateAdminister(@RequestBody AddCompanyDTO addCompanyDTO){ public ResponseVO updateAdminister(@RequestBody AddCompanyDTO addCompanyDTO){
return ResponseData.generateCreatedResponse(0,companyDictService.updateAdminister(addCompanyDTO)); return ResponseData.generateCreatedResponse(0,companyDictService.updateAdminister(addCompanyDTO));
......
...@@ -35,7 +35,7 @@ public class CourseDictController { ...@@ -35,7 +35,7 @@ public class CourseDictController {
private CourseDictService courseDictService; private CourseDictService courseDictService;
@PostMapping("addCourse") @PostMapping("addCourse")
@ApiOperation("添加课程 companyId courseName courseType coverPage openStatus fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[]") @ApiOperation("添加课程 companyId courseName courseType coverPage openStatus remark fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[]")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addCourse(@RequestBody AddCourseDTO addCourseDTO){ public ResponseVO addCourse(@RequestBody AddCourseDTO addCourseDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.addCourse(addCourseDTO)); return ResponseData.generateCreatedResponse(0,courseDictService.addCourse(addCourseDTO));
......
...@@ -42,7 +42,7 @@ public class DepartmentDictController { ...@@ -42,7 +42,7 @@ public class DepartmentDictController {
@PostMapping("addDepartment") @PostMapping("addDepartment")
@ApiOperation("添加部门 companyId departmentName leaderName parentId 父节点") @ApiOperation("添加部门 companyId departmentName leaderName parentId 父节点")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addDepartment(@RequestBody DepartmentDictDO departmentDictDO){ public ResponseVO addDepartment(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.addDepartment(departmentDictDO)); return ResponseData.generateCreatedResponse(0,departmentDictService.addDepartment(departmentDictDO));
} }
...@@ -62,11 +62,17 @@ public class DepartmentDictController { ...@@ -62,11 +62,17 @@ public class DepartmentDictController {
} }
@PostMapping("getDepartmentMembers") @PostMapping("getDepartmentMembers")
@ApiOperation("获取部门成员 companyId 公司id departmentId 部门id userName") @ApiOperation("获取部门成员 companyId 公司id departmentId 部门id userName startDate endDate")
public ResponseVO getDepartmentMembers(@RequestBody GetDepartmentMembersDTO getDepartmentMembersDTO){ public ResponseVO getDepartmentMembers(@RequestBody GetDepartmentMembersDTO getDepartmentMembersDTO){
return ResponseData.generateCreatedResponse(0,departmentDictService.getDepartmentMembers(getDepartmentMembersDTO)); return ResponseData.generateCreatedResponse(0,departmentDictService.getDepartmentMembers(getDepartmentMembersDTO));
} }
@PostMapping("getMembers")
@ApiOperation("获取成员(树) companyId 公司id startDate endDate ")
public ResponseVO getMembers(@RequestBody GetDepartmentMembersDTO getDepartmentMembersDTO){
return ResponseData.generateCreatedResponse(0,departmentDictService.getMembers(getDepartmentMembersDTO));
}
......
...@@ -6,6 +6,7 @@ import com.subsidy.common.ResponseVO; ...@@ -6,6 +6,7 @@ import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired; import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.administer.VerifyCodeDTO; import com.subsidy.dto.administer.VerifyCodeDTO;
import com.subsidy.dto.member.AddMemberDTO; import com.subsidy.dto.member.AddMemberDTO;
import com.subsidy.dto.member.ChangeDepartmentsDTO;
import com.subsidy.dto.member.ContentMemberDTO; import com.subsidy.dto.member.ContentMemberDTO;
import com.subsidy.dto.member.GetAllDTO; import com.subsidy.dto.member.GetAllDTO;
import com.subsidy.dto.member.MyCoursesDTO; import com.subsidy.dto.member.MyCoursesDTO;
...@@ -40,7 +41,7 @@ public class MemberController { ...@@ -40,7 +41,7 @@ public class MemberController {
private MemberService memberService; private MemberService memberService;
@PostMapping("getAll") @PostMapping("getAll")
@ApiOperation("查询某部门成员 pageNum pageSize departmentId userName status") @ApiOperation("查询某部门成员 pageNum pageSize departmentId userName status startDate endDate")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAll(@RequestBody GetAllDTO getAllDTO){ public ResponseVO getAll(@RequestBody GetAllDTO getAllDTO){
return ResponseData.generateCreatedResponse(0,memberService.getAll(getAllDTO)); return ResponseData.generateCreatedResponse(0,memberService.getAll(getAllDTO));
...@@ -54,7 +55,7 @@ public class MemberController { ...@@ -54,7 +55,7 @@ public class MemberController {
} }
@PostMapping("addMember") @PostMapping("addMember")
@ApiOperation("新增成员 companyId userName accountName accountNameEn telephone gender image idCard departmentIds jobIds") @ApiOperation("新增成员 companyId userName accountName accountNameEn telephone gender image idCard departmentIds jobIds workNo inductionDate email")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addMember(@RequestBody AddMemberDTO addMemberDTO){ public ResponseVO addMember(@RequestBody AddMemberDTO addMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.addMember(addMemberDTO)); return ResponseData.generateCreatedResponse(0,memberService.addMember(addMemberDTO));
...@@ -145,5 +146,10 @@ public class MemberController { ...@@ -145,5 +146,10 @@ public class MemberController {
memberService.importRedis(); memberService.importRedis();
} }
@PostMapping("changeDepartments")
@ApiOperation("修改部门 desDepId[] 目的部门 memberIds[] 成员id")
public ResponseVO changeDepartments(@RequestBody ChangeDepartmentsDTO changeDepartmentsDTO){
return ResponseData.generateCreatedResponse(0,memberService.changeDepartments(changeDepartmentsDTO));
}
} }
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
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;
/**
* <p>
* 轮播图 前端控制器
* </p>
*
* @author DengMin
* @since 2022-02-23
*/
@RestController
@Api(tags = "轮播图")
@RequestMapping("/rotationImgDict")
public class RotationImgDictController {
@Autowired
private RotationImgDictService rotationImgDictService;
@PostMapping("addRotation")
@ApiOperation("添加轮播图 {companyId 公司id rotationImg 轮播图地址}")
public ResponseVO addRotation(@RequestBody RotationImgDictDO rotationImgDictDO){
return ResponseData.generateCreatedResponse(0,rotationImgDictService.addRotation(rotationImgDictDO));
}
@PostMapping("deleteRotation")
@ApiOperation("删除轮播图 {id}")
public ResponseVO deleteRotation(@RequestBody RotationImgDictDO rotationImgDictDO){
return ResponseData.generateCreatedResponse(0,rotationImgDictService.deleteRotation(rotationImgDictDO));
}
@PostMapping("updateRotation")
@ApiOperation("编辑轮播图 id")
public ResponseVO updateRotation(@RequestBody RotationImgDictDO rotationImgDictDO){
return ResponseData.generateCreatedResponse(0,rotationImgDictService.updateRotation(rotationImgDictDO));
}
@PostMapping("getAllRotations")
@ApiOperation("获取某企业的轮播图 companyId")
public ResponseVO getAllRotations(@RequestBody RotationImgDictDO rotationImgDictDO){
return ResponseData.generateCreatedResponse(0,rotationImgDictService.getAllRotations(rotationImgDictDO));
}
}
package com.subsidy.dto.classDict;
import lombok.Data;
@Data
public class GetClassBaseInfoDTO {
private Long userId;
private Long id;
}
package com.subsidy.dto.course; package com.subsidy.dto.course;
import com.subsidy.model.CategoryDO;
import com.subsidy.model.FieldDictDO;
import com.subsidy.model.JobDictDO;
import com.subsidy.model.RankDictDO;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
...@@ -37,6 +33,11 @@ public class AddCourseDTO { ...@@ -37,6 +33,11 @@ public class AddCourseDTO {
private String coverPage; private String coverPage;
/** /**
* 备注
*/
private String remark;
/**
* 开放状态 * 开放状态
*/ */
private Integer openStatus; private Integer openStatus;
......
...@@ -30,6 +30,11 @@ public class UpdateCoursesDTO { ...@@ -30,6 +30,11 @@ public class UpdateCoursesDTO {
private String courseType; private String courseType;
/** /**
* 备注
*/
private String remark;
/**
* 行业范围 * 行业范围
*/ */
private List<Long> fieldDictDOS; private List<Long> fieldDictDOS;
......
...@@ -14,4 +14,8 @@ public class GetDepartmentMembersDTO { ...@@ -14,4 +14,8 @@ public class GetDepartmentMembersDTO {
private Long companyId; private Long companyId;
private String userName; private String userName;
private String startDate;
private String endDate;
} }
package com.subsidy.dto.member;
import lombok.Data;
import java.util.List;
@Data
public class ChangeDepartmentsDTO {
private List<Long> desDepId;
private List<Long> memberIds;
}
...@@ -11,6 +11,10 @@ public class GetAllDTO{ ...@@ -11,6 +11,10 @@ public class GetAllDTO{
private Long departmentId; private Long departmentId;
private String startDate;
private String endDate;
private Integer pageNum; private Integer pageNum;
private Integer pageSize; private Integer pageSize;
......
package com.subsidy.dto.member; package com.subsidy.dto.member;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.subsidy.util.excel.ExcelColumn; import com.subsidy.util.excel.ExcelColumn;
import com.subsidy.util.excel.ExcelColumnUtil; import com.subsidy.util.excel.ExcelColumnUtil;
import lombok.Data; import lombok.Data;
import java.util.Date;
@Data @Data
public class ImportMemberDTO { public class ImportMemberDTO {
...@@ -26,5 +29,15 @@ public class ImportMemberDTO { ...@@ -26,5 +29,15 @@ public class ImportMemberDTO {
@ExcelColumnUtil(value = "英文名", col = 6) @ExcelColumnUtil(value = "英文名", col = 6)
private String accountNameEn; private String accountNameEn;
@ExcelColumnUtil(value = "邮箱", col = 7)
private String email;
@ExcelColumnUtil(value = "工号", col = 8)
private String workNo;
@ExcelColumnUtil(value = "入职时间", col = 9)
private String inductionDate;
} }
...@@ -2,11 +2,13 @@ package com.subsidy.jobs; ...@@ -2,11 +2,13 @@ package com.subsidy.jobs;
import com.subsidy.common.constant.CourseNotification; import com.subsidy.common.constant.CourseNotification;
import com.subsidy.common.constant.SmsCode; import com.subsidy.common.constant.SmsCode;
import com.subsidy.mapper.ClassDictMapper;
import com.subsidy.mapper.ClassNoticeMapper; import com.subsidy.mapper.ClassNoticeMapper;
import com.subsidy.mapper.MemberMapper; import com.subsidy.mapper.MemberMapper;
import com.subsidy.model.ClassNoticeDO; import com.subsidy.model.ClassNoticeDO;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import com.subsidy.util.SMSUtils; import com.subsidy.util.SMSUtils;
import com.subsidy.vo.classdict.ClassAndCompanyInfoVO;
import org.quartz.Job; import org.quartz.Job;
import org.quartz.JobExecutionContext; import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException; import org.quartz.JobExecutionException;
...@@ -36,7 +38,7 @@ public class CourseNotificationJob implements Job { ...@@ -36,7 +38,7 @@ public class CourseNotificationJob implements Job {
private ClassNoticeMapper classNoticeMapper; private ClassNoticeMapper classNoticeMapper;
@Autowired @Autowired
private SMSUtils smsUtils; private ClassDictMapper classDictMapper;
@Override @Override
public void execute(JobExecutionContext jobExecutionContext) { public void execute(JobExecutionContext jobExecutionContext) {
...@@ -45,20 +47,27 @@ public class CourseNotificationJob implements Job { ...@@ -45,20 +47,27 @@ public class CourseNotificationJob implements Job {
if(params != null) { if(params != null) {
ClassNoticeDO classNoticeDO = classNoticeMapper.selectById((Long) params.get("id")); ClassNoticeDO classNoticeDO = classNoticeMapper.selectById((Long) params.get("id"));
if(classNoticeDO != null) { if(classNoticeDO != null) {
ClassAndCompanyInfoVO cmInfo = classDictMapper.getClassAndCompanyInfoVO((Long) params.get("classId"));
List<MemberDO> list = memberMapper.getMemberList((Long) params.get("classId")); List<MemberDO> list = memberMapper.getMemberList((Long) params.get("classId"));
if(list != null && list.size() > 0) { if(list != null && list.size() > 0) {
for (MemberDO memberDO : list) { for (MemberDO memberDO : list) {
if(memberDO != null) { if(memberDO != null) {
Map<String, String> data = Arrays.stream(SmsCode.values()).collect(Collectors.toMap(SmsCode::getType, SmsCode::getCode)); Map<String, String> data = Arrays.stream(SmsCode.values()).collect(Collectors.toMap(SmsCode::getType, SmsCode::getCode));
smsUtils.send(memberDO.getTelephone(), data.get(classNoticeDO.getNoticeType())); 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()) ||
classNoticeDO.getNoticeType().equals(SmsCode.TEST.getType())) {
sms = "{\"name\": \""+ cmInfo.getName() +"\", \"course\": \""+ cmInfo.getCourseName()+"\"}";
}
SMSUtils.sendNoticeSMS(data.get(classNoticeDO.getNoticeType()), memberDO.getTelephone(), sms);
} }
} }
ClassNoticeDO classNotice = new ClassNoticeDO();
classNotice.setId(classNoticeDO.getId());
classNotice.setStatus(CourseNotification.SENT);
classNoticeMapper.updateById(classNotice);
} }
ClassNoticeDO classNotice = new ClassNoticeDO();
classNotice.setId(classNoticeDO.getId());
classNotice.setStatus(CourseNotification.SENT);
classNoticeMapper.updateById(classNotice);
} }
} }
} }
......
...@@ -9,7 +9,7 @@ import com.subsidy.mapper.VodPlayHistoryMapper; ...@@ -9,7 +9,7 @@ import com.subsidy.mapper.VodPlayHistoryMapper;
import com.subsidy.model.OprAdmDictDO; import com.subsidy.model.OprAdmDictDO;
import com.subsidy.model.SignInRecordDO; import com.subsidy.model.SignInRecordDO;
import com.subsidy.util.DateFormatUtil; import com.subsidy.util.DateFormatUtil;
import com.subsidy.util.RedisUtil; //import com.subsidy.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -41,8 +41,8 @@ public class SchedulerJob { ...@@ -41,8 +41,8 @@ public class SchedulerJob {
@Autowired @Autowired
private SignInRecordMapper signInRecordMapper; private SignInRecordMapper signInRecordMapper;
@Autowired //@Autowired
private RedisUtil redisUtil; //private RedisUtil redisUtil;
/** /**
删除十天前登录记录(管理端) 删除十天前登录记录(管理端)
...@@ -115,34 +115,34 @@ public class SchedulerJob { ...@@ -115,34 +115,34 @@ public class SchedulerJob {
* 1天前的 * 1天前的
* 增量版 * 增量版
*/ */
@Transactional(rollbackFor = Exception.class) //@Transactional(rollbackFor = Exception.class)
public void synchronizeSignInRecord() { //public void synchronizeSignInRecord() {
List<SignInRecordDO> list = signInRecordMapper.getSignInRecord(); // List<SignInRecordDO> list = signInRecordMapper.getSignInRecord();
if(list != null && list.size() > 0) { // if(list != null && list.size() > 0) {
for (SignInRecordDO signInRecordDO : list) { // for (SignInRecordDO signInRecordDO : list) {
Set<String> set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + signInRecordDO.getClassId() + ":" + DateFormatUtil.format(signInRecordDO.getSignInDate(), "yyyy-MM-dd")+":*"); // Set<String> 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) { // if(set != null && set.size() > 0) {
redisUtil.del(set); // 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); // 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签到数据 * 全部同步Redis签到数据
*/ */
@Transactional(rollbackFor = Exception.class) //@Transactional(rollbackFor = Exception.class)
public void synchronizeSignInRecordAll() { //public void synchronizeSignInRecordAll() {
Set<String> set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX+"*"); // Set<String> set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX+"*");
if(set != null && set.size() > 0) { // if(set != null && set.size() > 0) {
redisUtil.del(set); // redisUtil.del(set);
} // }
//
List<SignInRecordDO> list = signInRecordMapper.selectList(new QueryWrapper<>()); // List<SignInRecordDO> list = signInRecordMapper.selectList(new QueryWrapper<>());
for (SignInRecordDO signInRecordDO : list) { // 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); // redisUtil.set(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + signInRecordDO.getClassId() + ":" + DateFormatUtil.format(signInRecordDO.getSignInDate(), "yyyy-MM-dd") + ":" + DateFormatUtil.LocalDateTimeToSecond(signInRecordDO.getSignInDate()), null);
} // }
//
} //}
} }
...@@ -5,6 +5,7 @@ import com.subsidy.dto.classDict.GetSpareMembersDTO; ...@@ -5,6 +5,7 @@ import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassDictDO;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import com.subsidy.model.VodDictDO; import com.subsidy.model.VodDictDO;
import com.subsidy.vo.classdict.ClassAndCompanyInfoVO;
import com.subsidy.vo.classdict.GetAllClassesVO; import com.subsidy.vo.classdict.GetAllClassesVO;
import com.subsidy.vo.classdict.GetClassBaseInfoVO; import com.subsidy.vo.classdict.GetClassBaseInfoVO;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -48,4 +49,8 @@ public interface ClassDictMapper extends BaseMapper<ClassDictDO> { ...@@ -48,4 +49,8 @@ public interface ClassDictMapper extends BaseMapper<ClassDictDO> {
*/ */
GetClassBaseInfoVO getClassBaseInfo(Long classId); GetClassBaseInfoVO getClassBaseInfo(Long classId);
/**
* 班级信息 -- 获取课程信息 + 公司信息
* */
ClassAndCompanyInfoVO getClassAndCompanyInfoVO(Long classId);
} }
...@@ -21,10 +21,10 @@ import java.util.List; ...@@ -21,10 +21,10 @@ import java.util.List;
public interface CompanyDictMapper extends BaseMapper<CompanyDictDO> { public interface CompanyDictMapper extends BaseMapper<CompanyDictDO> {
/** /**
* 企业管理--查找所有主账号 * 企业管理--查找所有主账号 、运营者
* @return * @return
*/ */
IPage<OperatorsVO> operators(IPage page, String companyName,Long fieldId,Long id); IPage<OperatorsVO> operators(IPage page, String companyName,Long fieldId,Long id,Integer role);
/** /**
* 查找所有的公司名称 * 查找所有的公司名称
......
...@@ -29,7 +29,7 @@ public interface CourseContentMapper extends BaseMapper<CourseContentDO> { ...@@ -29,7 +29,7 @@ public interface CourseContentMapper extends BaseMapper<CourseContentDO> {
/** /**
* 查看某个目录下 某个成员看视频的进度 * 查看某个目录下 某个成员看视频的进度
*/ */
List<MemberVodVO> contentVodProcess(Long contentId, Long memberId); List<MemberVodVO> contentVodProcess(Long contentId, Long memberId,Long classId);
/** /**
* 查看某个课程下的文件/课件 * 查看某个课程下的文件/课件
......
...@@ -46,7 +46,7 @@ public interface ExerciseDoneResultMapper extends BaseMapper<ExerciseDoneResultD ...@@ -46,7 +46,7 @@ public interface ExerciseDoneResultMapper extends BaseMapper<ExerciseDoneResultD
/** /**
* 查看某个人某个卷子完成的最好成绩 * 查看某个人某个卷子完成的最好成绩
*/ */
List<ExerciseDoneResultDO> getMaxScorePaper(Long paperId,Long memberId); List<ExerciseDoneResultDO> getMaxScorePaper(Long paperId,Long memberId,Long classId);
/** /**
* 测试成绩 最高成绩 测试测试 总评价 * 测试成绩 最高成绩 测试测试 总评价
......
...@@ -46,14 +46,24 @@ public interface MemberMapper extends BaseMapper<MemberDO> { ...@@ -46,14 +46,24 @@ public interface MemberMapper extends BaseMapper<MemberDO> {
List<DepartmentDictDO> getDepartments(Long memberId); List<DepartmentDictDO> getDepartments(Long memberId);
/** /**
* 查询部门所有的学生 * 查询部门所有的学生 分页
*/ */
IPage<GetAllVO> getMembers(IPage iPage,Long departmentId,String userName,String status); IPage<GetAllVO> getMembers(IPage iPage,Long departmentId,String userName,String status,String startDate,String endDate);
/**
* 查询某个部门的员工 不分页
*/
List<MemberDO> getMemberWithoutPage(Long departmentId,String userName,String status,String startDate,String endDate);
/**
* 查询某公司的学生
*/
IPage<GetAllVO> getCompanyMember(IPage iPage,Long companyId,String userName,String status,String startDate,String endDate);
/** /**
* 查询某公司所有的学生 公司不传就是查平台所有学生 * 查询某公司所有的学生 公司不传就是查平台所有学生
*/ */
IPage<ManageMemberVO> manageMember(IPage iPage,Long companyId,String userName); IPage<ManageMemberVO> manageMember(IPage iPage,Long companyId,String userName,String startDate,String endDate);
List<MemberDO> getMemberList(Long classId); List<MemberDO> getMemberList(Long classId);
......
...@@ -27,7 +27,7 @@ public interface PaperDictMapper extends BaseMapper<PaperDictDO> { ...@@ -27,7 +27,7 @@ public interface PaperDictMapper extends BaseMapper<PaperDictDO> {
/** /**
* 查看某个卷子有多少人完成 卷子id * 查看某个卷子有多少人完成 卷子id
*/ */
Integer completeCount(Long paperId); Integer completeCount(Long paperId,Long classId);
/** /**
* 查看某个课程下有多少卷子 * 查看某个课程下有多少卷子
......
package com.subsidy.mapper; package com.subsidy.mapper;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.RoleAdministerMappingDO; import com.subsidy.model.RoleAdministerMappingDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -15,4 +16,11 @@ import org.springframework.stereotype.Repository; ...@@ -15,4 +16,11 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface RoleAdministerMappingMapper extends BaseMapper<RoleAdministerMappingDO> { public interface RoleAdministerMappingMapper extends BaseMapper<RoleAdministerMappingDO> {
/**
* 查看企业的管理者
* @param companyId
* @return
*/
AdministerDO getAdminister(Long companyId);
} }
package com.subsidy.mapper;
import com.subsidy.model.RotationImgDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 轮播图 Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-02-23
*/
@Repository
public interface RotationImgDictMapper extends BaseMapper<RotationImgDictDO> {
}
...@@ -80,7 +80,7 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> { ...@@ -80,7 +80,7 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> {
/** /**
* 查看某个人某个视频的累计时长 * 查看某个人某个视频的累计时长
*/ */
Integer memberVodTotalLength(Long memberId,Long vodId); Integer memberVodTotalLength(Long classId,Long memberId,Long vodId);
/** /**
* 跑脚本 前一天的学习情况 * 跑脚本 前一天的学习情况
......
...@@ -79,4 +79,6 @@ public class ClassDictDO extends BaseModel { ...@@ -79,4 +79,6 @@ public class ClassDictDO extends BaseModel {
private Integer testRule; private Integer testRule;
} }
...@@ -54,4 +54,8 @@ public class CourseDictDO extends BaseModel { ...@@ -54,4 +54,8 @@ public class CourseDictDO extends BaseModel {
*/ */
private Integer openStatus; private Integer openStatus;
/**
* 备注
*/
private String remark;
} }
...@@ -52,6 +52,11 @@ public class DepartmentDictDO extends BaseModel { ...@@ -52,6 +52,11 @@ public class DepartmentDictDO extends BaseModel {
private Long parentId; private Long parentId;
/** /**
* 部门全路径
*/
private String fullName;
/**
* 为写程序方便,数据库里为null * 为写程序方便,数据库里为null
*/ */
private List<GetDepartmentsVO> children; private List<GetDepartmentsVO> children;
......
package com.subsidy.model; package com.subsidy.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.subsidy.util.BaseModel; import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
...@@ -7,6 +8,8 @@ import com.baomidou.mybatisplus.annotation.TableId; ...@@ -7,6 +8,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date;
/** /**
* <p> * <p>
* 学生表 * 学生表
...@@ -56,6 +59,22 @@ public class MemberDO extends BaseModel { ...@@ -56,6 +59,22 @@ public class MemberDO extends BaseModel {
private String password; private String password;
/** /**
* 工号
*/
private String workNo;
/**
* 入职时间
*/
@JsonFormat
private String inductionDate;
/**
* 邮箱
*/
private String email;
/**
* 性别 * 性别
*/ */
private String gender; private String gender;
......
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;
/**
* <p>
* 轮播图
* </p>
*
* @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;
}
...@@ -3,6 +3,7 @@ package com.subsidy.service; ...@@ -3,6 +3,7 @@ package com.subsidy.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.dto.classDict.AddClassDTO; import com.subsidy.dto.classDict.AddClassDTO;
import com.subsidy.dto.classDict.AddMemberToClassDTO; import com.subsidy.dto.classDict.AddMemberToClassDTO;
import com.subsidy.dto.classDict.GetClassBaseInfoDTO;
import com.subsidy.dto.classDict.GetSpareMembersDTO; import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassMemberMappingDO; import com.subsidy.model.ClassMemberMappingDO;
...@@ -40,6 +41,6 @@ public interface ClassDictService extends IService<ClassDictDO> { ...@@ -40,6 +41,6 @@ public interface ClassDictService extends IService<ClassDictDO> {
String batchSms(ClassDictDO classDictDO); String batchSms(ClassDictDO classDictDO);
GetClassBaseInfoVO getClassBaseInfo(ClassDictDO classDictDO); GetClassBaseInfoVO getClassBaseInfo(GetClassBaseInfoDTO getClassBaseInfoDTO);
} }
...@@ -3,6 +3,7 @@ package com.subsidy.service; ...@@ -3,6 +3,7 @@ package com.subsidy.service;
import com.subsidy.model.ClassHourDictDO; import com.subsidy.model.ClassHourDictDO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.model.VodPlayHistoryDO; import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.vo.classdict.GetSettingVO;
import com.subsidy.vo.hour.PollingGetVO; import com.subsidy.vo.hour.PollingGetVO;
/** /**
...@@ -15,9 +16,9 @@ import com.subsidy.vo.hour.PollingGetVO; ...@@ -15,9 +16,9 @@ import com.subsidy.vo.hour.PollingGetVO;
*/ */
public interface ClassHourDictService extends IService<ClassHourDictDO> { public interface ClassHourDictService extends IService<ClassHourDictDO> {
ClassHourDictDO getSetting(ClassHourDictDO classHourDictDO); GetSettingVO getSetting(ClassHourDictDO classHourDictDO);
String updateSetting(ClassHourDictDO classHourDictDO); String updateSetting(GetSettingVO getSettingVO);
PollingGetVO pollingGet(VodPlayHistoryDO vodPlayHistoryDO); PollingGetVO pollingGet(VodPlayHistoryDO vodPlayHistoryDO);
} }
...@@ -5,6 +5,7 @@ import com.subsidy.dto.department.GetDepartmentMembersDTO; ...@@ -5,6 +5,7 @@ import com.subsidy.dto.department.GetDepartmentMembersDTO;
import com.subsidy.dto.department.GetDepartmentsVO; import com.subsidy.dto.department.GetDepartmentsVO;
import com.subsidy.model.DepartmentDictDO; import com.subsidy.model.DepartmentDictDO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.department.GetMembersVO;
import java.util.List; import java.util.List;
...@@ -27,4 +28,6 @@ public interface DepartmentDictService extends IService<DepartmentDictDO> { ...@@ -27,4 +28,6 @@ public interface DepartmentDictService extends IService<DepartmentDictDO> {
String updateDepartment(DepartmentDictDO departmentDictDO); String updateDepartment(DepartmentDictDO departmentDictDO);
IPage getDepartmentMembers(GetDepartmentMembersDTO getDepartmentMembersDTO); IPage getDepartmentMembers(GetDepartmentMembersDTO getDepartmentMembersDTO);
List<GetMembersVO> getMembers(GetDepartmentMembersDTO getDepartmentMembersDTO);
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.dto.administer.VerifyCodeDTO; import com.subsidy.dto.administer.VerifyCodeDTO;
import com.subsidy.dto.member.AddMemberDTO; import com.subsidy.dto.member.AddMemberDTO;
import com.subsidy.dto.member.ChangeDepartmentsDTO;
import com.subsidy.dto.member.ContentMemberDTO; import com.subsidy.dto.member.ContentMemberDTO;
import com.subsidy.dto.member.GetAllDTO; import com.subsidy.dto.member.GetAllDTO;
import com.subsidy.dto.member.MyCoursesDTO; import com.subsidy.dto.member.MyCoursesDTO;
...@@ -68,4 +69,6 @@ public interface MemberService extends IService<MemberDO> { ...@@ -68,4 +69,6 @@ public interface MemberService extends IService<MemberDO> {
void importRedis(); void importRedis();
String changeDepartments(ChangeDepartmentsDTO changeDepartmentsDTO);
} }
package com.subsidy.service;
import com.subsidy.model.RotationImgDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 轮播图 服务类
* </p>
*
* @author DengMin
* @since 2022-02-23
*/
public interface RotationImgDictService extends IService<RotationImgDictDO> {
String addRotation(RotationImgDictDO rotationImgDictDO);
String deleteRotation(RotationImgDictDO rotationImgDictDO);
String updateRotation(RotationImgDictDO rotationImgDictDO);
List<RotationImgDictDO> getAllRotations(RotationImgDictDO rotationImgDictDO);
}
...@@ -6,6 +6,7 @@ import com.subsidy.common.constant.CourseNotification; ...@@ -6,6 +6,7 @@ import com.subsidy.common.constant.CourseNotification;
import com.subsidy.common.exception.HttpException; import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.classDict.AddClassDTO; import com.subsidy.dto.classDict.AddClassDTO;
import com.subsidy.dto.classDict.AddMemberToClassDTO; import com.subsidy.dto.classDict.AddMemberToClassDTO;
import com.subsidy.dto.classDict.GetClassBaseInfoDTO;
import com.subsidy.dto.classDict.GetSpareMembersDTO; import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.jobs.CourseNotificationJob; import com.subsidy.jobs.CourseNotificationJob;
import com.subsidy.mapper.AnsweringQuestionMapper; import com.subsidy.mapper.AnsweringQuestionMapper;
...@@ -15,14 +16,18 @@ import com.subsidy.mapper.ClassNoticeMapper; ...@@ -15,14 +16,18 @@ import com.subsidy.mapper.ClassNoticeMapper;
import com.subsidy.mapper.CompanyDictMapper; import com.subsidy.mapper.CompanyDictMapper;
import com.subsidy.mapper.CourseDictMapper; import com.subsidy.mapper.CourseDictMapper;
import com.subsidy.mapper.RoleAdministerMappingMapper; import com.subsidy.mapper.RoleAdministerMappingMapper;
import com.subsidy.mapper.VodDictMapper;
import com.subsidy.mapper.VodPlayHistoryMapper;
import com.subsidy.model.AnsweringQuestionDO; import com.subsidy.model.AnsweringQuestionDO;
import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassMemberMappingDO; import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.model.ClassNoticeDO; import com.subsidy.model.ClassNoticeDO;
import com.subsidy.model.CompanyDictDO; import com.subsidy.model.CompanyDictDO;
import com.subsidy.model.CourseDictDO; import com.subsidy.model.CourseDictDO;
import com.subsidy.model.FieldDictDO;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import com.subsidy.model.RoleAdministerMappingDO; import com.subsidy.model.RoleAdministerMappingDO;
import com.subsidy.model.VodDictDO;
import com.subsidy.service.ClassDictService; import com.subsidy.service.ClassDictService;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.util.DateFormatUtil; import com.subsidy.util.DateFormatUtil;
...@@ -72,6 +77,12 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict ...@@ -72,6 +77,12 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
@Autowired @Autowired
private QuartzUtil quartzUtil; private QuartzUtil quartzUtil;
@Autowired
private VodDictMapper vodDictMapper;
@Autowired
private VodPlayHistoryMapper vodPlayHistoryMapper;
public List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO) throws Exception { public List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO) throws Exception {
DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
...@@ -203,8 +214,24 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict ...@@ -203,8 +214,24 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
return ConstantUtils.SUCCESS_SEND_OUT; return ConstantUtils.SUCCESS_SEND_OUT;
} }
public GetClassBaseInfoVO getClassBaseInfo(ClassDictDO classDictDO) { public GetClassBaseInfoVO getClassBaseInfo(GetClassBaseInfoDTO getClassBaseInfoDTO) {
return this.baseMapper.getClassBaseInfo(classDictDO.getId());
GetClassBaseInfoVO getClassBaseInfoVO = this.baseMapper.getClassBaseInfo(getClassBaseInfoDTO.getId());
//查看课程完成状态
//查看某个课程都有哪些视频
List<VodDictDO> vodDictDOS = vodDictMapper.getCourseVods(getClassBaseInfoVO.getCourseId(),null);
int completeNum = 0 ;
//查看每个视频的状态
for (VodDictDO vodDictDO : vodDictDOS){
int i = vodPlayHistoryMapper.completeVodOrNot(getClassBaseInfoDTO.getUserId(),vodDictDO.getId());
completeNum += i;
}
if (completeNum == vodDictDOS.size()){
getClassBaseInfoVO.setTestFlag(true);
}else {
getClassBaseInfoVO.setTestFlag(false);
}
return getClassBaseInfoVO;
} }
} }
package com.subsidy.service.impl; package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.RedisPrefixConstant;
import com.subsidy.mapper.ClassHourDictMapper; import com.subsidy.mapper.ClassHourDictMapper;
import com.subsidy.mapper.CompanyDictMapper;
import com.subsidy.mapper.MemberMapper; import com.subsidy.mapper.MemberMapper;
import com.subsidy.mapper.RotationImgDictMapper;
import com.subsidy.mapper.VodPlayHistoryMapper; import com.subsidy.mapper.VodPlayHistoryMapper;
import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassHourDictDO; import com.subsidy.model.ClassHourDictDO;
import com.subsidy.model.CompanyDictDO;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import com.subsidy.model.RotationImgDictDO;
import com.subsidy.model.VodPlayHistoryDO; import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.service.ClassHourDictService; import com.subsidy.service.ClassHourDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.util.MyBeanUtils; import com.subsidy.util.MyBeanUtils;
import com.subsidy.util.RedisUtil; import com.subsidy.vo.classdict.GetSettingVO;
import com.subsidy.vo.hour.PollingGetVO; import com.subsidy.vo.hour.PollingGetVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
/** /**
* <p> * <p>
...@@ -44,20 +43,66 @@ public class ClassHourDictServiceImpl extends ServiceImpl<ClassHourDictMapper, C ...@@ -44,20 +43,66 @@ public class ClassHourDictServiceImpl extends ServiceImpl<ClassHourDictMapper, C
@Autowired @Autowired
private MemberMapper memberMapper; private MemberMapper memberMapper;
//@Autowired
//private RedisUtil redisUtil;
@Autowired
private RotationImgDictMapper rotationImgDictMapper;
@Autowired @Autowired
private RedisUtil redisUtil; 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<ClassHourDictDO>()
.lambda()
.eq(ClassHourDictDO::getCompanyId,classHourDictDO.getCompanyId()));
//redisUtil.set(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX+classHourDictDO.getCompanyId(),classDictDO);
//}
public ClassHourDictDO getSetting(ClassHourDictDO classHourDictDO) { BeanUtils.copyProperties(classDictDO,getSettingVO);
return (ClassHourDictDO) redisUtil.get(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX+classHourDictDO.getCompanyId());
List<RotationImgDictDO> rotationImgDictDOS = rotationImgDictMapper.selectList(new QueryWrapper<RotationImgDictDO>()
.lambda()
.eq(RotationImgDictDO::getCompanyId,classHourDictDO.getCompanyId()));
getSettingVO.setRotationImgDictDOS(rotationImgDictDOS);
CompanyDictDO companyDictDO = companyDictMapper.selectById(classHourDictDO.getCompanyId());
getSettingVO.setLogo(companyDictDO.getLogo());
return getSettingVO;
} }
public String updateSetting(ClassHourDictDO classHourDictDO) { public String updateSetting(GetSettingVO getSettingVO) {
ClassHourDictDO classHourDictDO1 = (ClassHourDictDO) redisUtil.get(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX + classHourDictDO.getCompanyId()); if (!StringUtils.isEmpty(getSettingVO.getLogo())){
classHourDictDO.setId(classHourDictDO1.getId()); CompanyDictDO companyDictDO = companyDictMapper.selectById(getSettingVO.getCompanyId());
String[] nullParams = MyBeanUtils.getNullPropertyNames(classHourDictDO); companyDictDO.setLogo(getSettingVO.getLogo());
BeanUtils.copyProperties(classHourDictDO, classHourDictDO1,nullParams); companyDictMapper.updateById(companyDictDO);
redisUtil.set(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX+classHourDictDO.getCompanyId(), classHourDictDO1); }
//ClassHourDictDO classHourDictDO1 = (ClassHourDictDO) redisUtil.get(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX + getSettingVO.getCompanyId());
//getSettingVO.setId(classHourDictDO1.getId());
//String[] nullParams = MyBeanUtils.getNullPropertyNames(getSettingVO);
//BeanUtils.copyProperties(getSettingVO, classHourDictDO1,nullParams);
//redisUtil.set(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX+getSettingVO.getCompanyId(), classHourDictDO1);
//this.baseMapper.updateById(classHourDictDO1);
if (getSettingVO.getRotationImgDictDOS().size()>0){
List<RotationImgDictDO> rotationImgDictDOS = getSettingVO.getRotationImgDictDOS();
rotationImgDictMapper.delete(new QueryWrapper<RotationImgDictDO>()
.lambda()
.eq(RotationImgDictDO::getCompanyId,getSettingVO.getCompanyId()));
for (RotationImgDictDO rotationImgDictDO : rotationImgDictDOS){
rotationImgDictDO.setCompanyId(getSettingVO.getCompanyId());
rotationImgDictMapper.insert(rotationImgDictDO);
}
}
return ConstantUtils.SET_SUCCESS; return ConstantUtils.SET_SUCCESS;
} }
...@@ -68,7 +113,9 @@ public class ClassHourDictServiceImpl extends ServiceImpl<ClassHourDictMapper, C ...@@ -68,7 +113,9 @@ public class ClassHourDictServiceImpl extends ServiceImpl<ClassHourDictMapper, C
MemberDO memberDO = memberMapper.selectById(vodPlayHistoryDO.getMemberId()); MemberDO memberDO = memberMapper.selectById(vodPlayHistoryDO.getMemberId());
//查看系统设定的时长 //查看系统设定的时长
ClassHourDictDO classHourDictDO = (ClassHourDictDO) redisUtil.get(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX + memberDO.getCompanyId()); ClassHourDictDO classHourDictDO = this.baseMapper.selectOne (new QueryWrapper<ClassHourDictDO>()
.lambda()
.eq(ClassHourDictDO::getCompanyId,memberDO.getCompanyId()));
if (classHourDictDO.getStatus() == 0) { if (classHourDictDO.getStatus() == 0) {
pollingGetVO.setBool(false); pollingGetVO.setBool(false);
......
...@@ -6,18 +6,19 @@ import com.subsidy.common.constant.SmsCode; ...@@ -6,18 +6,19 @@ import com.subsidy.common.constant.SmsCode;
import com.subsidy.common.exception.HttpException; import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.classNotice.SendNotificationDTO; import com.subsidy.dto.classNotice.SendNotificationDTO;
import com.subsidy.jobs.CourseNotificationJob; import com.subsidy.jobs.CourseNotificationJob;
import com.subsidy.mapper.ClassDictMapper;
import com.subsidy.mapper.MemberMapper; import com.subsidy.mapper.MemberMapper;
import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassNoticeDO; import com.subsidy.model.ClassNoticeDO;
import com.subsidy.mapper.ClassNoticeMapper; import com.subsidy.mapper.ClassNoticeMapper;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import com.subsidy.service.ClassDictService;
import com.subsidy.service.ClassNoticeService; import com.subsidy.service.ClassNoticeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.util.DateFormatUtil; import com.subsidy.util.DateFormatUtil;
import com.subsidy.util.QuartzUtil; import com.subsidy.util.QuartzUtil;
import com.subsidy.util.SMSUtils; import com.subsidy.util.SMSUtils;
import com.subsidy.vo.classdict.ClassAndCompanyInfoVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -41,14 +42,11 @@ public class ClassNoticeServiceImpl extends ServiceImpl<ClassNoticeMapper, Class ...@@ -41,14 +42,11 @@ public class ClassNoticeServiceImpl extends ServiceImpl<ClassNoticeMapper, Class
private QuartzUtil quartzUtil; private QuartzUtil quartzUtil;
@Autowired @Autowired
private ClassDictService classDictService; private ClassDictMapper classDictMapper;
@Autowired @Autowired
private MemberMapper memberMapper; private MemberMapper memberMapper;
@Autowired
private SMSUtils smsUtils;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public String addNotice(ClassNoticeDO classNoticeDO) { public String addNotice(ClassNoticeDO classNoticeDO) {
...@@ -59,12 +57,12 @@ public class ClassNoticeServiceImpl extends ServiceImpl<ClassNoticeMapper, Class ...@@ -59,12 +57,12 @@ public class ClassNoticeServiceImpl extends ServiceImpl<ClassNoticeMapper, Class
classNoticeDO.setStatus(CourseNotification.UNSENT); classNoticeDO.setStatus(CourseNotification.UNSENT);
this.baseMapper.insert(classNoticeDO); this.baseMapper.insert(classNoticeDO);
ClassDictDO classDictDO = classDictService.getById(classNoticeDO.getClassId()); ClassDictDO classDictDO = classDictMapper.selectById(classNoticeDO.getClassId());
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("classId", classNoticeDO.getClassId()); params.put("classId", classNoticeDO.getClassId());
params.put("id", classNoticeDO.getId()); params.put("id", classNoticeDO.getId());
String name = classDictDO.getClassName()+"-"+classNoticeDO.getNoticeType()+"-"+classNoticeDO.getNoticeTime(); String name = classDictDO.getClassName()+"-"+classNoticeDO.getNoticeType()+"-"+classNoticeDO.getNoticeTime();
quartzUtil.addSimpleJob(CourseNotificationJob.class,DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd") , params, name, "CourseNotificationJob"); quartzUtil.addSimpleJob(CourseNotificationJob.class,DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd HH:mm:ss") , params, name, "CourseNotificationJob");
return ConstantUtils.ADD_SUCCESS; return ConstantUtils.ADD_SUCCESS;
} }
...@@ -79,7 +77,7 @@ public class ClassNoticeServiceImpl extends ServiceImpl<ClassNoticeMapper, Class ...@@ -79,7 +77,7 @@ public class ClassNoticeServiceImpl extends ServiceImpl<ClassNoticeMapper, Class
this.baseMapper.deleteById(classNoticeDO.getId()); this.baseMapper.deleteById(classNoticeDO.getId());
ClassDictDO classDictDO = classDictService.getById(noticeDO.getClassId()); ClassDictDO classDictDO = classDictMapper.selectById(noticeDO.getClassId());
String name = classDictDO.getClassName()+"-"+noticeDO.getNoticeType()+"-"+noticeDO.getNoticeTime(); String name = classDictDO.getClassName()+"-"+noticeDO.getNoticeType()+"-"+noticeDO.getNoticeTime();
quartzUtil.deleteJob(name, "CourseNotificationJob"); quartzUtil.deleteJob(name, "CourseNotificationJob");
return ConstantUtils.DELETE_SUCCESS; return ConstantUtils.DELETE_SUCCESS;
...@@ -94,25 +92,29 @@ public class ClassNoticeServiceImpl extends ServiceImpl<ClassNoticeMapper, Class ...@@ -94,25 +92,29 @@ public class ClassNoticeServiceImpl extends ServiceImpl<ClassNoticeMapper, Class
@Override @Override
public void sendNotification(SendNotificationDTO sendNotificationDTO) { public void sendNotification(SendNotificationDTO sendNotificationDTO) {
ClassAndCompanyInfoVO cmInfo = classDictMapper.getClassAndCompanyInfoVO(sendNotificationDTO.getClassId());
if(sendNotificationDTO.getSendType().equals(SmsCode.ALL.getType())) { if(sendNotificationDTO.getSendType().equals(SmsCode.ALL.getType())) {
String params = "{\"company\":\""+ cmInfo.getCompany() +"\", \"course\":\""+ cmInfo.getCourseName() +"\", \"startDate\": \""+ cmInfo.getStartDate()+"\", \"endDate\": \""+ cmInfo.getEndDate()+"\"}";
List<MemberDO> list = memberMapper.getMemberList(sendNotificationDTO.getClassId()); List<MemberDO> list = memberMapper.getMemberList(sendNotificationDTO.getClassId());
if(list != null) { if(list != null) {
for (MemberDO memberDO : list) { for (MemberDO memberDO : list) {
smsUtils.send(memberDO.getTelephone(), SmsCode.ALL.getCode()); SMSUtils.sendNoticeSMS(SmsCode.ALL.getCode(), memberDO.getTelephone(), params);
} }
} }
} else if(sendNotificationDTO.getSendType().equals(SmsCode.NOT_SIGNED_IN.getType())) { } else if(sendNotificationDTO.getSendType().equals(SmsCode.NOT_SIGNED_IN.getType())) {
String params = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}";
List<MemberDO> list = memberMapper.getMemberListBySignInRecord(sendNotificationDTO.getClassId()); List<MemberDO> list = memberMapper.getMemberListBySignInRecord(sendNotificationDTO.getClassId());
if(list != null) { if(list != null) {
for (MemberDO memberDO : list) { for (MemberDO memberDO : list) {
smsUtils.send(memberDO.getTelephone(), SmsCode.NOT_SIGNED_IN.getCode()); SMSUtils.sendNoticeSMS(SmsCode.NOT_SIGNED_IN.getCode(), memberDO.getTelephone(), params);
} }
} }
} else if(sendNotificationDTO.getSendType().equals(SmsCode.UNFINISHED.getType())) { } else if(sendNotificationDTO.getSendType().equals(SmsCode.UNFINISHED.getType())) {
String params = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}";
List<MemberDO> list = memberMapper.getUnfinishedMemberList(sendNotificationDTO.getClassId()); List<MemberDO> list = memberMapper.getUnfinishedMemberList(sendNotificationDTO.getClassId());
if(list != null) { if(list != null) {
for (MemberDO memberDO : list) { for (MemberDO memberDO : list) {
smsUtils.send(memberDO.getTelephone(), SmsCode.UNFINISHED.getCode()); SMSUtils.sendNoticeSMS(SmsCode.UNFINISHED.getCode(), memberDO.getTelephone(), params);
} }
} }
} }
......
...@@ -50,7 +50,7 @@ public class ClassTypeDictServiceImpl extends ServiceImpl<ClassTypeDictMapper, C ...@@ -50,7 +50,7 @@ public class ClassTypeDictServiceImpl extends ServiceImpl<ClassTypeDictMapper, C
List<ClassTypeDictDO> classTypeDictDOS = new ArrayList<>(); List<ClassTypeDictDO> classTypeDictDOS = new ArrayList<>();
//查看当前登录人的角色 //查看当前登录人的角色 角色映射表
int count = roleAdministerMappingMapper.selectCount(new QueryWrapper<RoleAdministerMappingDO>() int count = roleAdministerMappingMapper.selectCount(new QueryWrapper<RoleAdministerMappingDO>()
.lambda() .lambda()
.eq(RoleAdministerMappingDO::getAdministerId,classTypeDTO.getUserId()) .eq(RoleAdministerMappingDO::getAdministerId,classTypeDTO.getUserId())
...@@ -67,9 +67,8 @@ public class ClassTypeDictServiceImpl extends ServiceImpl<ClassTypeDictMapper, C ...@@ -67,9 +67,8 @@ public class ClassTypeDictServiceImpl extends ServiceImpl<ClassTypeDictMapper, C
.lambda() .lambda()
.eq(ClassTypeDictDO::getCompanyId,classTypeDTO.getCompanyId())); .eq(ClassTypeDictDO::getCompanyId,classTypeDTO.getCompanyId()));
classTypeDictDOS.addAll(classTypeDictDOList); classTypeDictDOS.addAll(classTypeDictDOList);
return classTypeDictDOS;
return classTypeDictDOList;
} }
} }
...@@ -18,6 +18,7 @@ import com.subsidy.mapper.FieldDictMapper; ...@@ -18,6 +18,7 @@ import com.subsidy.mapper.FieldDictMapper;
import com.subsidy.mapper.JobDictMapper; import com.subsidy.mapper.JobDictMapper;
import com.subsidy.mapper.RankDictMapper; import com.subsidy.mapper.RankDictMapper;
import com.subsidy.mapper.RoleAdministerMappingMapper; import com.subsidy.mapper.RoleAdministerMappingMapper;
import com.subsidy.mapper.RotationImgDictMapper;
import com.subsidy.model.AdministerDO; import com.subsidy.model.AdministerDO;
import com.subsidy.model.ClassHourDictDO; import com.subsidy.model.ClassHourDictDO;
import com.subsidy.model.ClassTypeDictDO; import com.subsidy.model.ClassTypeDictDO;
...@@ -28,10 +29,10 @@ import com.subsidy.model.FieldDictDO; ...@@ -28,10 +29,10 @@ import com.subsidy.model.FieldDictDO;
import com.subsidy.model.JobDictDO; import com.subsidy.model.JobDictDO;
import com.subsidy.model.RankDictDO; import com.subsidy.model.RankDictDO;
import com.subsidy.model.RoleAdministerMappingDO; import com.subsidy.model.RoleAdministerMappingDO;
import com.subsidy.model.RotationImgDictDO;
import com.subsidy.service.CompanyDictService; import com.subsidy.service.CompanyDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.util.RedisUtil;
import com.subsidy.vo.administer.OperatorsVO; import com.subsidy.vo.administer.OperatorsVO;
import com.subsidy.vo.company.GetAllCompanyVO; import com.subsidy.vo.company.GetAllCompanyVO;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -63,8 +64,8 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa ...@@ -63,8 +64,8 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
@Autowired @Autowired
private DepartmentDictMapper departmentDictMapper; private DepartmentDictMapper departmentDictMapper;
@Autowired //@Autowired
private RedisUtil redisUtil; //private RedisUtil redisUtil;
@Autowired @Autowired
private FieldDictMapper fieldDictMapper; private FieldDictMapper fieldDictMapper;
...@@ -84,11 +85,12 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa ...@@ -84,11 +85,12 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
@Autowired @Autowired
private RankDictMapper rankDictMapper; private RankDictMapper rankDictMapper;
@Autowired
private RotationImgDictMapper rotationImgDictMapper;
public IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO) { public IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO) {
Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize());
AdministerDO administerDO = administerMapper.selectById(operatorsDTO.getId()); AdministerDO administerDO = administerMapper.selectById(operatorsDTO.getId());
//判断该用户的角色 //判断该用户的角色
...@@ -100,7 +102,7 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa ...@@ -100,7 +102,7 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
if (count > 0){ if (count > 0){
administerDO.setCompanyId(null); administerDO.setCompanyId(null);
} }
IPage page = this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(),administerDO.getCompanyId()); IPage page = this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(),administerDO.getCompanyId(),null);
List<OperatorsVO> operatorsVOS = page.getRecords(); List<OperatorsVO> operatorsVOS = page.getRecords();
for (OperatorsVO operatorsVO : operatorsVOS) { for (OperatorsVO operatorsVO : operatorsVOS) {
//查看公司所在行业 //查看公司所在行业
...@@ -138,7 +140,7 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa ...@@ -138,7 +140,7 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
administerDO.setCompanyId(companyDictDO.getId()); administerDO.setCompanyId(companyDictDO.getId());
administerDO.setPassword("admin123"); administerDO.setPassword("admin123");
administerDO.setStatus("1"); administerDO.setStatus("1");
administerDO.setRole(1); //administerDO.setRole(1);
administerMapper.insert(administerDO); administerMapper.insert(administerDO);
RoleAdministerMappingDO roleAdministerMappingDO = new RoleAdministerMappingDO(); RoleAdministerMappingDO roleAdministerMappingDO = new RoleAdministerMappingDO();
...@@ -164,7 +166,7 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa ...@@ -164,7 +166,7 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
classHourDictDO2.setRepeatStatus(0); classHourDictDO2.setRepeatStatus(0);
classHourDictDO2.setRepeatTime(3); classHourDictDO2.setRepeatTime(3);
redisUtil.set(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX + companyDictDO.getId(), classHourDictDO2); //redisUtil.set(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX + companyDictDO.getId(), classHourDictDO2);
classHourDictMapper.insert(classHourDictDO2); classHourDictMapper.insert(classHourDictDO2);
//行业 //行业
...@@ -194,6 +196,15 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa ...@@ -194,6 +196,15 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
rankDictMapper.insert(rankDictDO); rankDictMapper.insert(rankDictDO);
} }
//初始化轮播图
List<RotationImgDictDO> rotationImgDictDOS = rotationImgDictMapper.selectList(new QueryWrapper<RotationImgDictDO>()
.lambda()
.isNull(RotationImgDictDO::getCompanyId));
for (RotationImgDictDO rotationImgDictDO : rotationImgDictDOS){
rotationImgDictDO.setCompanyId(companyDictDO.getId());
rotationImgDictMapper.insert(rotationImgDictDO);
}
//班级类型 //班级类型
ClassTypeDictDO classTypeDictDO = new ClassTypeDictDO(); ClassTypeDictDO classTypeDictDO = new ClassTypeDictDO();
classTypeDictDO.setClassType("企业内训"); classTypeDictDO.setClassType("企业内训");
...@@ -210,7 +221,7 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa ...@@ -210,7 +221,7 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
.lambda() .lambda()
.eq(AdministerDO::getCompanyId, companyDictDO.getId())); .eq(AdministerDO::getCompanyId, companyDictDO.getId()));
redisUtil.del(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX + companyDictDO.getId()); //redisUtil.del(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX + companyDictDO.getId());
return ConstantUtils.DELETE_SUCCESS; return ConstantUtils.DELETE_SUCCESS;
} }
...@@ -235,10 +246,8 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa ...@@ -235,10 +246,8 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
} }
//查找企业管理员 //查找企业管理员
AdministerDO administerDO = administerMapper.selectOne(new QueryWrapper<AdministerDO>() AdministerDO administerDO = roleAdministerMappingMapper.getAdminister(addCompanyDTO.getId());
.lambda()
.eq(AdministerDO::getCompanyId, addCompanyDTO.getId())
.eq(AdministerDO::getRole, 1));
if (StringUtils.isNotBlank(addCompanyDTO.getAccountName())) { if (StringUtils.isNotBlank(addCompanyDTO.getAccountName())) {
administerDO.setAccountName(addCompanyDTO.getAccountName()); administerDO.setAccountName(addCompanyDTO.getAccountName());
} }
......
...@@ -110,6 +110,7 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD ...@@ -110,6 +110,7 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
CourseDictDO courseDictDO = new CourseDictDO(); CourseDictDO courseDictDO = new CourseDictDO();
BeanUtils.copyProperties(addCourseDTO, courseDictDO); BeanUtils.copyProperties(addCourseDTO, courseDictDO);
courseDictDO.setOpenStatus(0);
this.baseMapper.insert(courseDictDO); this.baseMapper.insert(courseDictDO);
if (null != addCourseDTO.getCategoryDOS()) { if (null != addCourseDTO.getCategoryDOS()) {
......
...@@ -8,12 +8,17 @@ import com.subsidy.dto.department.GetDepartmentMembersDTO; ...@@ -8,12 +8,17 @@ import com.subsidy.dto.department.GetDepartmentMembersDTO;
import com.subsidy.dto.department.GetDepartmentsVO; import com.subsidy.dto.department.GetDepartmentsVO;
import com.subsidy.mapper.MemberDepartmentMappingMapper; import com.subsidy.mapper.MemberDepartmentMappingMapper;
import com.subsidy.mapper.MemberMapper; import com.subsidy.mapper.MemberMapper;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.DepartmentDictDO; import com.subsidy.model.DepartmentDictDO;
import com.subsidy.mapper.DepartmentDictMapper; import com.subsidy.mapper.DepartmentDictMapper;
import com.subsidy.model.MemberDO;
import com.subsidy.model.MemberDepartmentMappingDO; import com.subsidy.model.MemberDepartmentMappingDO;
import com.subsidy.service.DepartmentDictService; import com.subsidy.service.DepartmentDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils; 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.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
...@@ -53,10 +58,10 @@ public class DepartmentDictServiceImpl extends ServiceImpl<DepartmentDictMapper, ...@@ -53,10 +58,10 @@ public class DepartmentDictServiceImpl extends ServiceImpl<DepartmentDictMapper,
GetDepartmentsVO getDepartmentsVO = new GetDepartmentsVO(); GetDepartmentsVO getDepartmentsVO = new GetDepartmentsVO();
BeanUtils.copyProperties(dd, getDepartmentsVO); BeanUtils.copyProperties(dd, getDepartmentsVO);
Integer count = memberDepartmentMappingMapper.selectCount(new QueryWrapper<MemberDepartmentMappingDO>() //Integer count = memberDepartmentMappingMapper.selectCount(new QueryWrapper<MemberDepartmentMappingDO>()
.lambda() // .lambda()
.eq(MemberDepartmentMappingDO::getDepartmentId, dd.getId())); // .eq(MemberDepartmentMappingDO::getDepartmentId, dd.getId()));
getDepartmentsVO.setCnt(count); //getDepartmentsVO.setCnt(count);
getDepartmentsVO.setChildren(getChildNodes(getDepartmentsVO)); getDepartmentsVO.setChildren(getChildNodes(getDepartmentsVO));
DepartmentDictDO departmentDictDO1 = this.baseMapper.selectById(dd.getParentId()); DepartmentDictDO departmentDictDO1 = this.baseMapper.selectById(dd.getParentId());
if (null != departmentDictDO1) { if (null != departmentDictDO1) {
...@@ -107,16 +112,32 @@ public class DepartmentDictServiceImpl extends ServiceImpl<DepartmentDictMapper, ...@@ -107,16 +112,32 @@ public class DepartmentDictServiceImpl extends ServiceImpl<DepartmentDictMapper,
public String addDepartment(DepartmentDictDO departmentDictDO) { public String addDepartment(DepartmentDictDO departmentDictDO) {
DepartmentDictDO departmentDictDO1 = departmentDictDO;
Integer counter = this.baseMapper.selectCount(new QueryWrapper<DepartmentDictDO>() Integer counter = this.baseMapper.selectCount(new QueryWrapper<DepartmentDictDO>()
.lambda() .lambda()
.eq(DepartmentDictDO::getCompanyId, departmentDictDO.getCompanyId()) .eq(DepartmentDictDO::getCompanyId, departmentDictDO.getCompanyId())
.eq(DepartmentDictDO::getDepartmentName, departmentDictDO.getDepartmentName())); .eq(DepartmentDictDO::getFullName, departmentDictDO.getFullName()));
if (counter > 0) { if (counter > 0) {
throw new HttpException(30001); throw new HttpException(30001);
} }
this.baseMapper.insert(departmentDictDO); List<String> 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; return ConstantUtils.ADD_SUCCESS;
} }
...@@ -170,13 +191,93 @@ public class DepartmentDictServiceImpl extends ServiceImpl<DepartmentDictMapper, ...@@ -170,13 +191,93 @@ public class DepartmentDictServiceImpl extends ServiceImpl<DepartmentDictMapper,
if (null != getDepartmentMembersDTO.getDepartmentId()){ if (null != getDepartmentMembersDTO.getDepartmentId()){
//查询某个部门 //查询某个部门
IPage iPage = memberMapper.getMembers(pager,getDepartmentMembersDTO.getDepartmentId(),getDepartmentMembersDTO.getUserName(),null); IPage iPage = memberMapper.getMembers(pager,getDepartmentMembersDTO.getDepartmentId(),getDepartmentMembersDTO.getUserName(),null,getDepartmentMembersDTO.getStartDate(),getDepartmentMembersDTO.getEndDate());
return iPage; return iPage;
}else { }else {
//查询整个公司 //查询整个公司
IPage iPage = memberMapper.manageMember(pager,getDepartmentMembersDTO.getCompanyId(),getDepartmentMembersDTO.getUserName()); IPage iPage = memberMapper.manageMember(pager,getDepartmentMembersDTO.getCompanyId(),getDepartmentMembersDTO.getUserName(),getDepartmentMembersDTO.getStartDate(),getDepartmentMembersDTO.getEndDate());
return iPage; return iPage;
} }
} }
public List<GetMembersVO> getMembers(GetDepartmentMembersDTO getDepartmentMembersDTO){
List<GetMembersVO> getMembersVOS = new ArrayList<>();
GetMembersVO getMembersVO = new GetMembersVO();
//找到父节点
DepartmentDictDO departmentDictDO = this.baseMapper.selectOne(new QueryWrapper<DepartmentDictDO>()
.lambda()
.eq(DepartmentDictDO::getCompanyId,getDepartmentMembersDTO.getCompanyId())
.isNull(DepartmentDictDO::getParentId));
BeanUtils.copyProperties(departmentDictDO,getMembersVO);
List<DepartmentDictDO> 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<MemberDO> memberDOS1 = memberMapper.getMemberWithoutPage(dpt.getId(),getMembersVO.getUserName(),null,null,null);
gmv.setMemberDOS(memberDOS1);
getMembersVOS.add(gmv);
}else {
//公司人员
List<MemberDO> memberDOS = memberMapper.selectList(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getCompanyId,getDepartmentMembersDTO.getCompanyId()));
gmv.setMemberDOS(memberDOS);
getMembersVOS.add(gmv);
}
}
return getMembersVOS;
}
/**
* 递归 带上部门总数,部门负责人等参数
*
* @param getMembersVO 父节点查找该节点的children
* @return 子节点
*/
public List<GetMembersVO> getChildNodes(GetMembersVO getMembersVO) {
List<GetMembersVO> getAllDepartmentVOS = new ArrayList<>();
//查询该节点的子节点
List<DepartmentDictDO> departmentDictDOS = this.baseMapper.selectList(new QueryWrapper<DepartmentDictDO>()
.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<MemberDO> memberDOS = memberMapper.getMemberWithoutPage(dd.getId(),getMembersVO.getUserName(),null,null,null);
gmv.setMemberDOS(memberDOS);
getAllDepartmentVOS.add(gmv);
}
if (departmentDictDOS.size() == 0) {
return null;
}
return getAllDepartmentVOS;
}
} }
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;
/**
* <p>
* 轮播图 服务实现类
* </p>
*
* @author DengMin
* @since 2022-02-23
*/
@Service
public class RotationImgDictServiceImpl extends ServiceImpl<RotationImgDictMapper, RotationImgDictDO> 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<RotationImgDictDO> getAllRotations(RotationImgDictDO rotationImgDictDO){
return this.baseMapper.selectList(new QueryWrapper<RotationImgDictDO>()
.lambda()
.eq(RotationImgDictDO::getCompanyId,rotationImgDictDO.getCompanyId()));
}
}
...@@ -4,15 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -4,15 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.common.RedisPrefixConstant;
import com.subsidy.dto.member.GetMemberSignInfoDTO; import com.subsidy.dto.member.GetMemberSignInfoDTO;
import com.subsidy.dto.sign.DataViewDTO; import com.subsidy.dto.sign.DataViewDTO;
import com.subsidy.mapper.AnsweringQuestionMapper; import com.subsidy.mapper.AnsweringQuestionMapper;
import com.subsidy.mapper.ClassDictMapper; import com.subsidy.mapper.ClassDictMapper;
import com.subsidy.mapper.ClassHourDictMapper;
import com.subsidy.mapper.ClassMemberMappingMapper; import com.subsidy.mapper.ClassMemberMappingMapper;
import com.subsidy.mapper.ExerciseDoneResultMapper; import com.subsidy.mapper.ExerciseDoneResultMapper;
import com.subsidy.mapper.MemberMapper;
import com.subsidy.mapper.SignInRecordMapper; import com.subsidy.mapper.SignInRecordMapper;
import com.subsidy.mapper.VodPlayHistoryMapper; import com.subsidy.mapper.VodPlayHistoryMapper;
import com.subsidy.model.AnsweringQuestionDO; import com.subsidy.model.AnsweringQuestionDO;
...@@ -24,22 +21,19 @@ import com.subsidy.model.VodDictDO; ...@@ -24,22 +21,19 @@ import com.subsidy.model.VodDictDO;
import com.subsidy.service.SignInRecordService; import com.subsidy.service.SignInRecordService;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.util.DateFormatUtil; import com.subsidy.util.DateFormatUtil;
import com.subsidy.util.MathUtil;
import com.subsidy.util.MyBeanUtils;
import com.subsidy.util.RedisUtil;
import com.subsidy.vo.member.GetMemberSignInfoVO; import com.subsidy.vo.member.GetMemberSignInfoVO;
import com.subsidy.vo.sign.DataViewVO; import com.subsidy.vo.sign.DataViewVO;
import com.subsidy.vo.sign.SignInStatusVO; import com.subsidy.vo.sign.SignInStatusVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set;
//import com.subsidy.util.RedisUtil;
/** /**
* <p> * <p>
...@@ -58,8 +52,8 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -58,8 +52,8 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
@Autowired @Autowired
private VodPlayHistoryMapper vodPlayHistoryMapper; private VodPlayHistoryMapper vodPlayHistoryMapper;
@Autowired //@Autowired
private RedisUtil redisUtil; //private RedisUtil redisUtil;
@Autowired @Autowired
private SignInRecordMapper signInRecordMapper; private SignInRecordMapper signInRecordMapper;
...@@ -89,11 +83,16 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -89,11 +83,16 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
List<ClassDictDO> classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId()); List<ClassDictDO> classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId());
for (ClassDictDO classDictDO : classDictDOS) { for (ClassDictDO classDictDO : classDictDOS) {
Set<String> set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + signInRecordDO.getClassId() + ":" + DateFormatUtil.format(signInRecordDO.getSignInDate(), "yyyy-MM-dd")+":*"); //Set<String> 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) { //if(set != null && set.size() > 0) {
redisUtil.del(set); // 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); //redisUtil.set(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + classDictDO.getId() + ":" + DateFormatUtil.format(new Date(), "yyyy-MM-dd") + ":" + System.currentTimeMillis(), null);
signInRecordMapper.delete(new QueryWrapper<SignInRecordDO>()
.lambda()
.eq(SignInRecordDO::getMemberId,signInRecordDO.getMemberId())
.eq(SignInRecordDO::getClassId,classDictDO.getId()));
// 存储到缓存到同时保存到数据库 // 存储到缓存到同时保存到数据库
SignInRecordDO sign = this.baseMapper.selectOne(new QueryWrapper<SignInRecordDO>() SignInRecordDO sign = this.baseMapper.selectOne(new QueryWrapper<SignInRecordDO>()
...@@ -159,7 +158,7 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -159,7 +158,7 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
//视频 //视频
int i = 0; int i = 0;
for (VodDictDO vodDictDO : vodDictDOS) { for (VodDictDO vodDictDO : vodDictDOS) {
int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classMemberMappingDO.getMemberId(), vodDictDO.getId()); int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classMemberMappingDO.getMemberId(), vodDictDO.getId(),classMemberMappingDO.getClassId());
if (totalPlayLength >= vodDictDO.getVodLength()) { if (totalPlayLength >= vodDictDO.getVodLength()) {
i++; i++;
} }
...@@ -196,13 +195,34 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -196,13 +195,34 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
Boolean flag = true; // 已经签过到了 Boolean flag = true; // 已经签过到了
signInStatusVO.setStatus(flag); signInStatusVO.setStatus(flag);
//获取有效课程 //获取有效课程
long count = classMemberMappingMapper.getMemberClassCount(signInRecordDO.getMemberId()); //long count = classMemberMappingMapper.getMemberClassCount(signInRecordDO.getMemberId());
long size = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + "*:" + DateFormatUtil.format(new Date(), "yyyy-MM-dd")+"*").stream().count(); //long size = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + "*:" + DateFormatUtil.format(new Date(), "yyyy-MM-dd")+"*").stream().count();
//List<SignInRecordDO> signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper<SignInRecordDO>()
//.lambda()
//.eq(SignInRecordDO::getMemberId,signInRecordDO.getMemberId())
//.eq(SignInRecordDO::getClassId))
//if (size <= count) {
// signInStatusVO.setStatus(false);
//}
//获取有效课程
List<ClassDictDO> classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId());
if (size < count) {
signInStatusVO.setStatus(false);
}
for (ClassDictDO classDictDO : classDictDOS) {
Integer count = this.baseMapper.selectCount(new QueryWrapper<SignInRecordDO>()
.lambda()
.eq(SignInRecordDO::getClassId, classDictDO.getId())
.eq(SignInRecordDO::getMemberId, signInRecordDO.getMemberId())
.gt(SignInRecordDO::getSignInDate, LocalDate.now()));
//String count = redisUtil.get("signInStatus:"+signInRecordDO.getMemberId()+":"+classDictDO.getId()).toString();
if (count == 0) {
flag = false; //没有签到
}
}
signInStatusVO.setStatus(flag);
return signInStatusVO; return signInStatusVO;
} }
...@@ -227,11 +247,11 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -227,11 +247,11 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
//} //}
//签到数据 //签到数据
List<SignInRecordDO> signInRecordDOS = signInRecordMapper.selectList(null); //List<SignInRecordDO> signInRecordDOS = signInRecordMapper.selectList(null);
for (SignInRecordDO signInRecordDO : signInRecordDOS){ //for (SignInRecordDO signInRecordDO : signInRecordDOS){
redisUtil.set(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX+signInRecordDO.getMemberId()+":classId:"+ // 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); // signInRecordDO.getClassId()+":"+signInRecordDO.getSignInDate().toString().split("T")[0]+":"+signInRecordDO.getSignInDate().toInstant(ZoneOffset.of("+8")).toEpochMilli(),signInRecordDO);
} //}
// redisUtil.scan("*20220126*"); // redisUtil.scan("*20220126*");
// redisUtil.("*20220126*"); // redisUtil.("*20220126*");
......
...@@ -11,7 +11,6 @@ import com.subsidy.model.MemberDO; ...@@ -11,7 +11,6 @@ import com.subsidy.model.MemberDO;
import com.subsidy.model.SmsVerifyCodeDO; import com.subsidy.model.SmsVerifyCodeDO;
import com.subsidy.service.SmsVerifyCodeService; import com.subsidy.service.SmsVerifyCodeService;
import com.subsidy.util.RandomUtil; import com.subsidy.util.RandomUtil;
import com.subsidy.util.RedisUtil;
import com.subsidy.util.SMSUtils; import com.subsidy.util.SMSUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
...@@ -34,8 +33,8 @@ public class SmsVerifyCodeServiceImpl extends ServiceImpl<SmsVerifyCodeMapper, S ...@@ -34,8 +33,8 @@ public class SmsVerifyCodeServiceImpl extends ServiceImpl<SmsVerifyCodeMapper, S
@Autowired @Autowired
private MemberMapper memberMapper; private MemberMapper memberMapper;
@Autowired //@Autowired
private RedisUtil redisUtil; //private RedisUtil redisUtil;
public void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO) { public void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO) {
MemberDO memberDO = memberMapper.selectOne(new QueryWrapper<MemberDO>() MemberDO memberDO = memberMapper.selectOne(new QueryWrapper<MemberDO>()
...@@ -47,10 +46,15 @@ public class SmsVerifyCodeServiceImpl extends ServiceImpl<SmsVerifyCodeMapper, S ...@@ -47,10 +46,15 @@ public class SmsVerifyCodeServiceImpl extends ServiceImpl<SmsVerifyCodeMapper, S
String code = RandomUtil.getRandomCode(6); String code = RandomUtil.getRandomCode(6);
smsUtils.send(sendVerifyCodeDTO.getTelephone(), code); smsUtils.send(sendVerifyCodeDTO.getTelephone(), code);
/** /**
* 验证码存在redis * 验证码存在redis
*/ */
redisUtil.set(RedisPrefixConstant.SUBSIDY_TELEPHONE_PREFIX + sendVerifyCodeDTO.getTelephone(), code, 30 * 60); //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);
} }
} }
package com.subsidy.service.impl; package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -100,6 +101,22 @@ public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> im ...@@ -100,6 +101,22 @@ public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> im
} }
public String addVod(VodDictDO vodDictDO) { public String addVod(VodDictDO vodDictDO) {
//排序
int orderNo = 1;
List<VodDictDO> vodDictDOS = this.baseMapper.selectList(new QueryWrapper<VodDictDO>()
.lambda()
.eq(VodDictDO::getContentId,vodDictDO.getContentId())
.orderByDesc(VodDictDO::getOrderNo));
if (vodDictDOS.size()>0){
VodDictDO vodDictDO1 = vodDictDOS.get(0);
if (null!=vodDictDO1){
orderNo = vodDictDOS.get(0).getOrderNo()+1;
}
}
vodDictDO.setOrderNo(orderNo);
this.baseMapper.insert(vodDictDO); this.baseMapper.insert(vodDictDO);
//测试环境就不转码了 //测试环境就不转码了
......
...@@ -2,6 +2,7 @@ package com.subsidy.service.impl; ...@@ -2,6 +2,7 @@ package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.FixDataTwoDTO;
import com.subsidy.dto.vod.RemainSecondsDTO; import com.subsidy.dto.vod.RemainSecondsDTO;
import com.subsidy.dto.vod.SignDatePlaysDTO; import com.subsidy.dto.vod.SignDatePlaysDTO;
...@@ -51,13 +52,49 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper, ...@@ -51,13 +52,49 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
@Autowired @Autowired
private MemberStudyLengthMapper memberStudyLengthMapper; private MemberStudyLengthMapper memberStudyLengthMapper;
@Autowired
private ClassHourDictMapper classHourDictMapper;
@Autowired
private MemberMapper memberMapper;
public String insertHistory(VodPlayHistoryDO vodPlayHistoryDO) { public String insertHistory(VodPlayHistoryDO vodPlayHistoryDO) {
MemberDO memberDO = memberMapper.selectById(vodPlayHistoryDO.getMemberId());
//查看系统设定的时长
ClassHourDictDO classHourDictDO = classHourDictMapper.selectOne (new QueryWrapper<ClassHourDictDO>()
.lambda()
.eq(ClassHourDictDO::getCompanyId,memberDO.getCompanyId()));
if (classHourDictDO.getStatus() == 1) {
//查看当天这个人看了多少时间
Integer total = vodPlayHistoryMapper.memberDailyStudyLength(memberDO.getId());
//是否超过时长 没超过 false 超过 true
if (total + vodPlayHistoryDO.getPlayLength() >= classHourDictDO.getClassHour() * 3600) {
throw new HttpException(13001);
}
}
vodPlayHistoryDO.setPlayCount(1); vodPlayHistoryDO.setPlayCount(1);
this.baseMapper.insert(vodPlayHistoryDO); this.baseMapper.insert(vodPlayHistoryDO);
return ConstantUtils.ADD_SUCCESS; return ConstantUtils.ADD_SUCCESS;
} }
public String insertHistoryNew(VodPlayHistoryDO vodPlayHistoryDO) { public String insertHistoryNew(VodPlayHistoryDO vodPlayHistoryDO) {
MemberDO memberDO = memberMapper.selectById(vodPlayHistoryDO.getMemberId());
//查看系统设定的时长
ClassHourDictDO classHourDictDO = classHourDictMapper.selectOne (new QueryWrapper<ClassHourDictDO>()
.lambda()
.eq(ClassHourDictDO::getCompanyId,memberDO.getCompanyId()));
if (classHourDictDO.getStatus() == 1) {
//查看当天这个人看了多少时间
Integer total = vodPlayHistoryMapper.memberDailyStudyLength(memberDO.getId());
//是否超过时长 没超过 false 超过 true
if (total + vodPlayHistoryDO.getPlayLength() >= classHourDictDO.getClassHour() * 3600) {
throw new HttpException(13001);
}
}
vodPlayHistoryDO.setPlayCount(1); vodPlayHistoryDO.setPlayCount(1);
this.baseMapper.insert(vodPlayHistoryDO); this.baseMapper.insert(vodPlayHistoryDO);
return ConstantUtils.ADD_SUCCESS; return ConstantUtils.ADD_SUCCESS;
......
package com.subsidy.vo.administer; package com.subsidy.vo.administer;
import com.subsidy.model.RotationImgDictDO;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class UserRoleVO { public class UserRoleVO {
...@@ -21,4 +24,10 @@ public class UserRoleVO { ...@@ -21,4 +24,10 @@ public class UserRoleVO {
private String companyName; private String companyName;
private Long companyId;
private String logo;
private List<RotationImgDictDO> rotationImgDictDOS;
} }
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;
}
...@@ -34,7 +34,7 @@ public class ClassDetailVO{ ...@@ -34,7 +34,7 @@ public class ClassDetailVO{
* 签到次数 * 签到次数
*/ */
@ExcelColumn(col = 6,value = "签到次数") @ExcelColumn(col = 6,value = "签到次数")
private Long signCounts; private Integer signCounts;
/** /**
* 已看视频 * 已看视频
......
...@@ -21,4 +21,12 @@ public class GetClassBaseInfoVO { ...@@ -21,4 +21,12 @@ public class GetClassBaseInfoVO {
private Long classTypeId; private Long classTypeId;
private Integer isOrder;
private Integer isFastPlay;
private Integer testRule;
private Boolean testFlag;
} }
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<RotationImgDictDO> rotationImgDictDOS;
private String logo;
}
...@@ -46,6 +46,11 @@ public class QueryCoursesVO { ...@@ -46,6 +46,11 @@ public class QueryCoursesVO {
private Integer vodCounts; private Integer vodCounts;
/** /**
* 备注
*/
private String remark;
/**
* 测试数量 * 测试数量
*/ */
private Integer paperCount; private Integer paperCount;
......
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<MemberDO> memberDOS;
//private List<AdministerDepartmentMappingDO> administerDepartmentMappingDOS;
private List<GetMembersVO> children;
}
...@@ -2,11 +2,13 @@ package com.subsidy.vo.member; ...@@ -2,11 +2,13 @@ package com.subsidy.vo.member;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.subsidy.model.DepartmentDictDO; import com.subsidy.model.DepartmentDictDO;
import com.subsidy.model.JobDictDO; import com.subsidy.model.JobDictDO;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import lombok.Data; import lombok.Data;
import java.util.Date;
import java.util.List; import java.util.List;
@Data @Data
...@@ -28,6 +30,13 @@ public class GetAllVO { ...@@ -28,6 +30,13 @@ public class GetAllVO {
private String status; private String status;
private String email;
private String workNo;
//@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private String inductionDate;
private List<DepartmentDictDO> departmentDictDOS; private List<DepartmentDictDO> departmentDictDOS;
private List<JobDictDO> jobDictDOS; private List<JobDictDO> jobDictDOS;
......
package com.subsidy.vo.member; package com.subsidy.vo.member;
import com.subsidy.model.RotationImgDictDO;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class MemberVO { public class MemberVO {
...@@ -18,4 +21,10 @@ public class MemberVO { ...@@ -18,4 +21,10 @@ public class MemberVO {
private Integer firstLogin; private Integer firstLogin;
private String companyName; private String companyName;
private Long companyId;
private String logo;
private List<RotationImgDictDO> rotationImgDictDOS;
} }
...@@ -26,5 +26,9 @@ public class MyCoursesVO { ...@@ -26,5 +26,9 @@ public class MyCoursesVO {
private Integer ttlMember; private Integer ttlMember;
private Integer isOrder;
private Integer isFastPlay;
private List<FieldDictDO> fieldDictDOS; private List<FieldDictDO> fieldDictDOS;
} }
...@@ -50,3 +50,7 @@ meishu.code-message[70002]=定时任务创建失败 ...@@ -50,3 +50,7 @@ meishu.code-message[70002]=定时任务创建失败
meishu.code-message[70003]=定时任务删除失败 meishu.code-message[70003]=定时任务删除失败
meishu.code-message[12001]=该职级已存在 meishu.code-message[12001]=该职级已存在
meishu.code-message[13001]=已达到当日最大时长
...@@ -133,7 +133,10 @@ ...@@ -133,7 +133,10 @@
t.end_date, t.end_date,
ifnull( t4.cnt, 0 ) AS count, ifnull( t4.cnt, 0 ) AS count,
t2.id as courseId, t2.id as courseId,
t3.id as classTypeId t3.id as classTypeId,
t.is_order,
t.is_fast_play,
t.test_rule
FROM FROM
class_dict t class_dict t
LEFT JOIN course_dict t2 ON t.course_id = t2.id LEFT JOIN course_dict t2 ON t.course_id = t2.id
...@@ -145,4 +148,22 @@ ...@@ -145,4 +148,22 @@
AND t3.delete_date IS NULL AND t3.delete_date IS NULL
AND t.id = #{classId} AND t.id = #{classId}
</select> </select>
<select id="getClassAndCompanyInfoVO" resultType="com.subsidy.vo.classdict.ClassAndCompanyInfoVO">
SELECT
cd.company_name AS company,
cd.short_name AS NAME,
d.course_name,
c.start_date,
c.end_date
FROM
class_dict c
LEFT JOIN company_dict cd ON cd.id = c.company_id
LEFT JOIN course_dict d ON d.id = c.course_id
WHERE
c.id = #{classId}
AND c.delete_date IS NULL
AND cd.delete_date IS NULL
AND d.delete_date IS NULL
</select>
</mapper> </mapper>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<select id="operators" resultType="com.subsidy.vo.administer.OperatorsVO"> <select id="operators" resultType="com.subsidy.vo.administer.OperatorsVO">
SELECT SELECT
t.id, distinct t.id,
t2.id as companyId, t2.id as companyId,
t.telephone, t.telephone,
t.user_name, t.user_name,
...@@ -40,6 +40,9 @@ ...@@ -40,6 +40,9 @@
t.delete_date IS NULL t.delete_date IS NULL
and t2.delete_date is null and t2.delete_date is null
and t3.delete_date is null and t3.delete_date is null
<if test="role != null">
and t.role = #{role}
</if>
<if test="id != null and id != ''"> <if test="id != null and id != ''">
and t2.id = #{id} and t2.id = #{id}
</if> </if>
......
...@@ -75,10 +75,13 @@ ...@@ -75,10 +75,13 @@
FROM FROM
vod_play_history t vod_play_history t
WHERE WHERE
t.member_id = #{memberId} t.delete_date is null
and t.member_id = #{memberId}
and t.class_id = #{classId}
GROUP BY GROUP BY
t.vod_id, t.vod_id,
t.member_id t.member_id,
t.class_id
) t2 ON t.id = t2.vod_id ) t2 ON t.id = t2.vod_id
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
...@@ -96,9 +99,11 @@ ...@@ -96,9 +99,11 @@
WHERE WHERE
t.delete_date IS NULL t.delete_date IS NULL
AND t.member_id = #{memberId} AND t.member_id = #{memberId}
and t.class_id = #{classId}
GROUP BY GROUP BY
t.member_id, t.member_id,
t.vod_id t.vod_id,
t.class_id
) t ) t
LEFT JOIN vod_play_history t2 ON t.vod_id = t2.vod_id LEFT JOIN vod_play_history t2 ON t.vod_id = t2.vod_id
AND t.member_id = t2.member_id AND t.member_id = t2.member_id
......
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
t.course_name, t.course_name,
t.course_type, t.course_type,
t.open_status, t.open_status,
t.cover_page t.cover_page,
t.remark
FROM FROM
course_dict t course_dict t
LEFT JOIN course_field_mapping t2 ON t.id = t2.course_id LEFT JOIN course_field_mapping t2 ON t.id = t2.course_id
......
...@@ -109,6 +109,7 @@ ...@@ -109,6 +109,7 @@
t.delete_date IS NULL t.delete_date IS NULL
AND t.paper_id = #{paperId} AND t.paper_id = #{paperId}
AND t.member_id = #{memberId} AND t.member_id = #{memberId}
and t.class_id = #{classId}
) t1 ) t1
LEFT JOIN exercise_done_result t2 ON t1.score = t2.score LEFT JOIN exercise_done_result t2 ON t1.score = t2.score
WHERE WHERE
......
...@@ -70,6 +70,8 @@ ...@@ -70,6 +70,8 @@
t4.cnt AS totalCnt, t4.cnt AS totalCnt,
t5.result AS studyCnt, t5.result AS studyCnt,
t6.ttlMember, t6.ttlMember,
t2.is_order,
t2.is_fast_play,
if( if(
TIMESTAMPDIFF( TIMESTAMPDIFF(
DAY, DAY,
...@@ -134,16 +136,16 @@ ...@@ -134,16 +136,16 @@
AND t3.delete_date IS NULL AND t3.delete_date IS NULL
AND t.member_id = #{memberId} AND t.member_id = #{memberId}
<if test="status ==1"> <if test="status ==1">
AND now()>= start_date AND DATE_FORMAT(now(), '%Y-%m-%d') >= DATE_FORMAT(start_date, '%Y-%m-%d')
AND now() &lt; end_date AND DATE_FORMAT(now(), '%Y-%m-%d') &lt; DATE_FORMAT(end_date, '%Y-%m-%d')
</if> </if>
<if test="status ==2"> <if test="status ==2">
AND now() &lt; start_date AND DATE_FORMAT(now(), '%Y-%m-%d') &lt; DATE_FORMAT(start_date, '%Y-%m-%d')
</if> </if>
<if test="status ==3"> <if test="status ==3">
AND now() > end_date AND DATE_FORMAT(now(), '%Y-%m-%d') > DATE_FORMAT(end_date, '%Y-%m-%d')
</if> </if>
order by t2.end_date desc order by t2.create_date desc
</select> </select>
...@@ -170,7 +172,10 @@ ...@@ -170,7 +172,10 @@
t2.telephone, t2.telephone,
t2.gender, t2.gender,
t2.id_card, t2.id_card,
t2.status t2.status,
t2.email,
t2.work_no,
t2.induction_date
FROM FROM
member_department_mapping t member_department_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id LEFT JOIN member t2 ON t.member_id = t2.id
...@@ -184,8 +189,79 @@ ...@@ -184,8 +189,79 @@
<if test="status != null and status !=''"> <if test="status != null and status !=''">
and t2.status = #{status} and t2.status = #{status}
</if> </if>
<if test="startDate != null and startEndDate !=''">
and DATE_FORMAT(t2.induction_date ,'%Y-%m-%d')>=DATE_FORMAT(#{startDate}, '%Y-%m-%d')
</if>
<if test="endDate != null and endDate !=''">
and DATE_FORMAT(t2.induction_date ,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
</if>
</select> </select>
<select id="getMemberWithoutPage" resultType="com.subsidy.model.MemberDO">
SELECT
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
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
and t.department_id = #{departmentId}
<if test="userName != null and userName !=''">
and t2.user_name like concat('%',#{userName} ,'%')
</if>
<if test="status != null and status !=''">
and t2.status = #{status}
</if>
<if test="startDate != null and startEndDate !=''">
and DATE_FORMAT(t2.induction_date ,'%Y-%m-%d')>=DATE_FORMAT(#{startDate}, '%Y-%m-%d')
</if>
<if test="endDate != null and endDate !=''">
and DATE_FORMAT(t2.induction_date ,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
</if>
</select>
<select id="getCompanyMember" resultType="com.subsidy.vo.member.GetAllVO">
SELECT
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 t2
WHERE
t2.delete_date IS NULL
and t2.company_id = #{companyId}
<if test="userName != null and userName !=''">
and t2.user_name like concat('%',#{userName} ,'%')
</if>
<if test="status != null and status !=''">
and t2.status = #{status}
</if>
<if test="startDate != null and startEndDate !=''">
and DATE_FORMAT(t2.induction_date ,'%Y-%m-%d')>=DATE_FORMAT(#{startDate}, '%Y-%m-%d')
</if>
<if test="endDate != null and endDate !=''">
and DATE_FORMAT(t2.induction_date ,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
</if>
</select>
<select id="manageMember" parameterType="string" resultType="com.subsidy.vo.administer.ManageMemberVO"> <select id="manageMember" parameterType="string" resultType="com.subsidy.vo.administer.ManageMemberVO">
SELECT SELECT
t.id, t.id,
...@@ -229,7 +305,7 @@ ...@@ -229,7 +305,7 @@
cmm.class_id = #{classId} cmm.class_id = #{classId}
AND m.delete_date IS NULL AND m.delete_date IS NULL
AND cmm.delete_date IS NULL AND cmm.delete_date IS NULL
AND s.signInCount > 0 AND s.signInCount = 0
GROUP BY GROUP BY
m.id m.id
</select> </select>
...@@ -239,29 +315,11 @@ ...@@ -239,29 +315,11 @@
m.* m.*
FROM FROM
member m member m
LEFT JOIN class_member_mapping cmm ON cmm.member_id = m.id LEFT JOIN class_member_mapping cm ON cm.member_id = m.id
LEFT JOIN ( LEFT JOIN ( SELECT member_id, count( 1 ) AS ts FROM exercise_done_result WHERE score >= 60 GROUP BY class_id ) AS r ON r.member_id = m.id
SELECT
vph.member_id,
vph.class_id,
vd.vod_length,
IF
( sum( vph.play_length ) >= vd.vod_length, 1, 0 ) AS ps
FROM
vod_play_history vph
LEFT JOIN vod_dict vd ON vd.id = vph.vod_id
WHERE
vph.delete_date IS NULL
AND vd.delete_date IS NULL
GROUP BY
vod_id,
member_id
) h ON h.member_id = m.id
AND h.class_id = cmm.class_id
WHERE WHERE
cmm.class_id = #{classId} cm.class_id = #{classId}
AND h.ps = 0 AND r.ts is NULL
GROUP BY and m.delete_date is null
m.id
</select> </select>
</mapper> </mapper>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</if> </if>
</select> </select>
<select id="completeCount" parameterType="long" resultType="integer"> <select id="completeCount" resultType="integer">
SELECT SELECT
count( DISTINCT t.member_id ) AS cnt count( DISTINCT t.member_id ) AS cnt
FROM FROM
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
WHERE WHERE
t.delete_date IS NULL t.delete_date IS NULL
AND t.paper_id = #{paperId} AND t.paper_id = #{paperId}
and t.class_id = #{classId}
</select> </select>
<select id="queryCoursePapersCnt" parameterType="long" resultType="integer"> <select id="queryCoursePapersCnt" parameterType="long" resultType="integer">
......
...@@ -20,4 +20,17 @@ ...@@ -20,4 +20,17 @@
id, administer_id, role_id id, administer_id, role_id
</sql> </sql>
<select id="getAdminister" parameterType="long" resultType="com.subsidy.model.AdministerDO">
SELECT
t.*
FROM
administer t
LEFT JOIN role_administer_mapping t2 ON t.id = t2.administer_id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.company_id = #{companyId}
AND t2.role_id = 2
</select>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.RotationImgDictMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.RotationImgDictDO">
<id column="id" property="id" />
<result column="create_date" property="createDate" />
<result column="update_date" property="updateDate" />
<result column="delete_date" property="deleteDate" />
<result column="company_id" property="companyId" />
<result column="rotation_img" property="rotationImg" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, company_id, rotation_img
</sql>
</mapper>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<if test="vodName != null and vodName !=''"> <if test="vodName != null and vodName !=''">
and vod_name like concat('%',#{vodName} ,'%') and vod_name like concat('%',#{vodName} ,'%')
</if> </if>
order by t.order_no order by t2.order_no,t.order_no
</select> </select>
<select id="getCourseVods" parameterType="long" resultType="com.subsidy.model.VodDictDO"> <select id="getCourseVods" parameterType="long" resultType="com.subsidy.model.VodDictDO">
......
...@@ -118,8 +118,6 @@ ...@@ -118,8 +118,6 @@
<select id="completeVodOrNot" resultType="integer"> <select id="completeVodOrNot" resultType="integer">
SELECT SELECT
t.vod_id,
t.member_id,
IF IF
( sum( t.play_length )>= t2.vod_length, 1, 0 ) AS count ( sum( t.play_length )>= t2.vod_length, 1, 0 ) AS count
FROM FROM
...@@ -236,8 +234,9 @@ ...@@ -236,8 +234,9 @@
<select id="memberRecentPlay" resultType="com.subsidy.vo.member.ContentVodNewVO"> <select id="memberRecentPlay" resultType="com.subsidy.vo.member.ContentVodNewVO">
SELECT SELECT
t2.play_record, t2.play_record,
t2.vod_id t2.vod_id as id
FROM FROM
( SELECT max( t.create_date ) AS create_date FROM vod_play_history t WHERE t.delete_date is null and t.member_id = #{memberId} AND t.class_id = #{classId} ) t ( SELECT max( t.create_date ) AS create_date FROM vod_play_history t WHERE t.delete_date is null and t.member_id = #{memberId} AND t.class_id = #{classId} ) t
LEFT JOIN vod_play_history t2 ON t.create_date = t2.create_date LEFT JOIN vod_play_history t2 ON t.create_date = t2.create_date
...@@ -330,7 +329,7 @@ ...@@ -330,7 +329,7 @@
<select id="memberTotalLength" parameterType="long" resultType="integer"> <select id="memberTotalLength" parameterType="long" resultType="integer">
SELECT SELECT
sum( play_length ) ifnull(sum( play_length ),0)
FROM FROM
vod_play_history t vod_play_history t
WHERE WHERE
...@@ -347,6 +346,7 @@ ...@@ -347,6 +346,7 @@
t.delete_date IS NULL t.delete_date IS NULL
AND t.vod_id = #{vodId} AND t.vod_id = #{vodId}
AND t.member_id = #{memberId} AND t.member_id = #{memberId}
and t.class_id = #{classId}
</select> </select>
<select id="exPlayInfo" resultType="com.subsidy.model.VodPlayHistoryDO"> <select id="exPlayInfo" resultType="com.subsidy.model.VodPlayHistoryDO">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!