From 38195ce432df6d87668d1363a4cccdfdd132ee9c Mon Sep 17 00:00:00 2001 From: Administrator Date: Wed, 26 Jan 2022 17:44:53 +0800 Subject: [PATCH] 年前上线版本 --- src/main/java/com/subsidy/common/RedisPrefixConstant.java | 4 ++-- src/main/java/com/subsidy/controller/AdministerController.java | 12 ++++++------ src/main/java/com/subsidy/jobs/Scheduler.java | 9 +-------- src/main/java/com/subsidy/mapper/OprAdmDictMapper.java | 2 +- src/main/java/com/subsidy/model/OprAdmDictDO.java | 42 ++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/OprMemDictDO.java | 27 ++++----------------------- src/main/java/com/subsidy/mongodb/OprAdmDictDO.java | 59 ----------------------------------------------------------- src/main/java/com/subsidy/service/OprAdmDictService.java | 6 +++--- src/main/java/com/subsidy/service/OprMemDictService.java | 4 ++-- src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java | 184 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------- src/main/java/com/subsidy/service/impl/MemberServiceImpl.java | 82 ++++++++++++++++++++++++++++++++++++++++++++++------------------------------------ src/main/java/com/subsidy/service/impl/OprAdmDictServiceImpl.java | 84 ++++++++++++++++++++++++++++++++---------------------------------------------------- src/main/java/com/subsidy/service/impl/OprMemDictServiceImpl.java | 67 ++++++++++++++++++++++++++++++------------------------------------- src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java | 27 +++++++++++++++++++++------ src/main/java/com/subsidy/vo/administer/ClassVodDailyInfoItemVO.java | 2 +- src/main/resources/application-dev.properties | 25 ++++++++++++++++--------- src/main/resources/application-prod.properties | 11 +++++++++-- src/main/resources/application.properties | 10 ++-------- src/main/resources/mapper/OprAdmDictMapper.xml | 6 +++--- src/main/resources/mapper/VodPlayHistoryMapper.xml | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------- 20 files changed, 469 insertions(+), 396 deletions(-) create mode 100644 src/main/java/com/subsidy/model/OprAdmDictDO.java delete mode 100644 src/main/java/com/subsidy/mongodb/OprAdmDictDO.java diff --git a/src/main/java/com/subsidy/common/RedisPrefixConstant.java b/src/main/java/com/subsidy/common/RedisPrefixConstant.java index 103795b..88a9271 100644 --- a/src/main/java/com/subsidy/common/RedisPrefixConstant.java +++ b/src/main/java/com/subsidy/common/RedisPrefixConstant.java @@ -28,8 +28,8 @@ public class RedisPrefixConstant { public static final String SUBSIDY_SETTINGS_PREFIX = "subsidySettings:"; /** - * subsidySignInfo_memberId_1_classId_12_20211223_long,do 学生签到数据 + * subsidySignInfo:memberId:1:classId:12:20211223:long,do 学生签到数据 */ - public static final String SUBSIDY_SIGN_INFO_PREFIX = "subsidySignInfo:"; + public static final String SUBSIDY_SIGN_INFO_PREFIX = "subsidySignInfo:memberId:"; } diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java index a2f5857..d810b2f 100644 --- a/src/main/java/com/subsidy/controller/AdministerController.java +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -62,7 +62,7 @@ public class AdministerController { @PostMapping("/administers") @ApiOperation("查询所有运营者 { userName pageNum pageSize }") - //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){ return ResponseData.generateCreatedResponse(0,administerService.operators(operatorsDTO)); } @@ -94,7 +94,7 @@ public class AdministerController { @PostMapping("classDetail") @ApiOperation("班级管理--班级成员 id 班级id userName") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO classDetail(@RequestBody ClassDetailDTO classDetailDTO){ return ResponseData.generateCreatedResponse(0,administerService.classDetail(classDetailDTO)); } @@ -109,14 +109,14 @@ public class AdministerController { @PostMapping("signDetail") @ApiOperation("班级管理--注册签到 id 班级id userName") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO signDetail(@RequestBody ClassDetailDTO classDetailDTO){ return ResponseData.generateCreatedResponse(0,administerService.signDetail(classDetailDTO)); } @PostMapping("exportSignDetail") @ApiOperation("班级管理--注册签到 id 班级id userName") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public void exportSignDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ classDetailDTO.setFlag(true); administerService.exportSignDetail(classDetailDTO); @@ -131,7 +131,7 @@ public class AdministerController { @PostMapping("exportExerciseTest") @ApiOperation("班级管理--测评成绩 id 班级id userName paperId") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ classDetailDTO.setFlag(true); administerService.exportExerciseTest(classDetailDTO); @@ -189,7 +189,7 @@ public class AdministerController { } @PostMapping("exportClassVodDailyInfo") - @ApiOperation("学习记录---每日学习时长(视频维度)") + @ApiOperation("学习记录---每日学习时长(视频维度) pageSize pageNum userName classId") public void exportClassVodDailyInfo(@RequestBody ClassVodDailyInfoDTO classVodDailyInfoDTO ){ administerService.exportClassVodDailyInfo(classVodDailyInfoDTO); } diff --git a/src/main/java/com/subsidy/jobs/Scheduler.java b/src/main/java/com/subsidy/jobs/Scheduler.java index 587bd44..856370a 100644 --- a/src/main/java/com/subsidy/jobs/Scheduler.java +++ b/src/main/java/com/subsidy/jobs/Scheduler.java @@ -3,20 +3,13 @@ package com.subsidy.jobs; import com.subsidy.mapper.OprAdmDictMapper; import com.subsidy.mapper.OprMemDictMapper; import com.subsidy.mapper.VodPlayHistoryMapper; -import com.subsidy.mongodb.OprAdmDictDO; -import com.subsidy.model.OprMemDictDO; -import com.subsidy.model.VodPlayHistoryDO; -import com.subsidy.util.DateFormatUtil; +import com.subsidy.model.OprAdmDictDO; import com.subsidy.util.RedisUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; -import java.time.LocalDateTime; import java.util.List; -import java.util.Set; /** *

diff --git a/src/main/java/com/subsidy/mapper/OprAdmDictMapper.java b/src/main/java/com/subsidy/mapper/OprAdmDictMapper.java index 741930d..d52761c 100644 --- a/src/main/java/com/subsidy/mapper/OprAdmDictMapper.java +++ b/src/main/java/com/subsidy/mapper/OprAdmDictMapper.java @@ -1,7 +1,7 @@ package com.subsidy.mapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.subsidy.mongodb.OprAdmDictDO; +import com.subsidy.model.OprAdmDictDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.subsidy.vo.opr.GetHistoryVO; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/subsidy/model/OprAdmDictDO.java b/src/main/java/com/subsidy/model/OprAdmDictDO.java new file mode 100644 index 0000000..491f27d --- /dev/null +++ b/src/main/java/com/subsidy/model/OprAdmDictDO.java @@ -0,0 +1,42 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.omg.CosNaming.NamingContextExtPackage.StringNameHelper; + +/** + *

+ * 审计表 + *

+ * + * @author DengMin + * @since 2021-12-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("opr_adm_dict") +public class OprAdmDictDO extends BaseModel{ + + private Long id; + + /** + * 用户id + */ + private Long userId; + + /** + * 操作类型 + */ + private String oprType; + + /** + * 登录结果 + */ + private Integer result; + + +} diff --git a/src/main/java/com/subsidy/model/OprMemDictDO.java b/src/main/java/com/subsidy/model/OprMemDictDO.java index 1e05c47..d6c2492 100644 --- a/src/main/java/com/subsidy/model/OprMemDictDO.java +++ b/src/main/java/com/subsidy/model/OprMemDictDO.java @@ -16,9 +16,11 @@ import lombok.EqualsAndHashCode; * @since 2021-12-13 */ @Data -public class OprMemDictDO { +@EqualsAndHashCode(callSuper = true) +@TableName("opr_mem_dict") +public class OprMemDictDO extends BaseModel { - private String _id; + private Long id; /** * 用户id @@ -26,16 +28,6 @@ public class OprMemDictDO { private Long userId; /** - * 公司id - */ - private Long companyId; - - /** - * 公司名称 - */ - private String companyName; - - /** * 操作类型 */ private String oprType; @@ -45,15 +37,4 @@ public class OprMemDictDO { */ private Integer result; - /** - * 登录时间 - */ - private String loginDateFormat; - - /** - * 创建时间 - */ - private String createDate; - - private String userName; } diff --git a/src/main/java/com/subsidy/mongodb/OprAdmDictDO.java b/src/main/java/com/subsidy/mongodb/OprAdmDictDO.java deleted file mode 100644 index 443c8fc..0000000 --- a/src/main/java/com/subsidy/mongodb/OprAdmDictDO.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.subsidy.mongodb; - -import com.subsidy.util.BaseModel; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.omg.CosNaming.NamingContextExtPackage.StringNameHelper; - -/** - *

- * 审计表 - *

- * - * @author DengMin - * @since 2021-12-13 - */ -@Data -public class OprAdmDictDO { - - private String _id; - - /** - * 用户id - */ - private Long userId; - - /** - * 公司id - */ - private Long companyId; - - /** - * 名字 - */ - private String userName; - - /** - * 操作类型 - */ - private String oprType; - - /** - * 登录结果 - */ - private Integer result; - - /** - * 登录时间 - */ - private String loginDateFormat; - - /** - * 创建时间 - */ - private String createDate; - -} diff --git a/src/main/java/com/subsidy/service/OprAdmDictService.java b/src/main/java/com/subsidy/service/OprAdmDictService.java index ae63e22..80128d3 100644 --- a/src/main/java/com/subsidy/service/OprAdmDictService.java +++ b/src/main/java/com/subsidy/service/OprAdmDictService.java @@ -2,9 +2,8 @@ package com.subsidy.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.dto.opr.GetHistoryDTO; -import com.subsidy.mongodb.OprAdmDictDO; +import com.subsidy.model.OprAdmDictDO; import com.baomidou.mybatisplus.extension.service.IService; -import com.subsidy.mongodb.PageVO; import com.subsidy.vo.opr.GetHistoryVO; /** @@ -17,6 +16,7 @@ import com.subsidy.vo.opr.GetHistoryVO; */ public interface OprAdmDictService extends IService { - PageVO getHistory(GetHistoryDTO getHistoryDTO); + //PageVO getHistory(GetHistoryDTO getHistoryDTO); + IPage getHistory(GetHistoryDTO getHistoryDTO); } diff --git a/src/main/java/com/subsidy/service/OprMemDictService.java b/src/main/java/com/subsidy/service/OprMemDictService.java index bd433b9..7547fc8 100644 --- a/src/main/java/com/subsidy/service/OprMemDictService.java +++ b/src/main/java/com/subsidy/service/OprMemDictService.java @@ -17,6 +17,6 @@ import com.subsidy.vo.opr.GetHistoryVO; */ public interface OprMemDictService extends IService { - PageVO getHistory(GetHistoryDTO getHistoryDTO); - + //PageVO getHistory(GetHistoryDTO getHistoryDTO); + IPage getHistory(GetHistoryDTO getHistoryDTO); } diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index b924955..e5eff58 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -23,6 +23,7 @@ import com.subsidy.mapper.DepartmentDictMapper; import com.subsidy.mapper.ExerciseDoneResultMapper; import com.subsidy.mapper.MemberDepartmentMappingMapper; import com.subsidy.mapper.MemberMapper; +import com.subsidy.mapper.OprAdmDictMapper; import com.subsidy.mapper.RoleAdministerMappingMapper; import com.subsidy.mapper.VodDictMapper; import com.subsidy.mapper.VodPlayHistoryMapper; @@ -40,8 +41,7 @@ import com.subsidy.model.MemberDepartmentMappingDO; import com.subsidy.model.RoleAdministerMappingDO; import com.subsidy.model.SignInRecordDO; import com.subsidy.model.VodDictDO; -import com.subsidy.model.VodPlayHistoryDO; -import com.subsidy.mongodb.OprAdmDictDO; +import com.subsidy.model.OprAdmDictDO; import com.subsidy.service.AdministerService; import com.subsidy.util.ConstantUtils; import com.subsidy.util.DateFormatUtil; @@ -95,10 +95,6 @@ import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Sort; -import org.springframework.data.mongodb.core.MongoTemplate; -import org.springframework.data.mongodb.core.query.Criteria; -import org.springframework.data.mongodb.core.query.Query; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -121,10 +117,12 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; +import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Set; +import java.util.TreeSet; import java.util.concurrent.atomic.AtomicInteger; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; @@ -181,7 +179,10 @@ public class AdministerServiceImpl extends ServiceImpl oprAdmDictDOS = mongoTemplate.find(query, OprAdmDictDO.class); + List oprAdmDictDOS = oprAdmDictMapper.getLoginInfo(administerDO1.getId()); //查mysql逻辑 //List oprAdmDictDOS = oprAdmDictMapper.getLoginInfo(administerDO1.getId()); @@ -234,12 +233,12 @@ public class AdministerServiceImpl extends ServiceImpl sortSet = new TreeSet(new Comparator() { + @Override + public int compare(String o1, String o2) { + return -o2.compareTo(o1);//降序排列 + } + }); + //签到 - Set set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + "memberId:" + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*"); + Set set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*"); classSignVO.setSignCounts(set.size()); StringBuilder stringBuilder = new StringBuilder(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + sortSet.addAll(set); //签到时间 - for (SignInRecordDO signInRecordDO : set) { - stringBuilder.append(signInRecordDO.getSignInDate().toString().replace("T", " ")).append(";"); + for (String signInRecordDO : sortSet) { + String[] array = signInRecordDO.split(":"); + //时间戳转时间 + stringBuilder.append(sdf.format(new Date(Long.valueOf(array[array.length-1])))).append(";"); } if (StringUtils.isNotBlank(stringBuilder.toString())) { String signInDate = stringBuilder.toString().substring(0, stringBuilder.length() - 1); @@ -673,13 +683,25 @@ public class AdministerServiceImpl extends ServiceImpl set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + "memberId:" + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*"); + Set set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*"); classSignVO.setSignCounts(set.size()); + Set sortSet = new TreeSet(new Comparator() { + @Override + public int compare(String o1, String o2) { + return -o2.compareTo(o1);//降序排列 + } + }); + + sortSet.addAll(set); + StringBuilder stringBuilder = new StringBuilder(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //签到时间 - for (SignInRecordDO signInRecordDO : set) { - stringBuilder.append(signInRecordDO.getSignInDate().toString().replace("T", " ")).append(";"); + for (String signInRecordDO : sortSet) { + String[] array = signInRecordDO.split(":"); + //时间戳转时间 + stringBuilder.append(sdf.format(new Date(Long.valueOf(array[array.length-1])))).append(";"); } if (StringUtils.isNotBlank(stringBuilder.toString())) { String signInDate = stringBuilder.toString().substring(0, stringBuilder.length() - 1); @@ -880,6 +902,7 @@ public class AdministerServiceImpl extends ServiceImpl classVodDailyInfo(ClassVodDailyInfoDTO classVodDailyInfoDTO) { @@ -893,12 +916,12 @@ public class AdministerServiceImpl extends ServiceImpl classDailyInfoVOS = classDailyInfoVOIPage.getRecords(); //获取班级、每个学员维度的视频播放总时长 - List vodPlayHistoryDOS = vodPlayHistoryMapper.classMemberPlayLength(classVodDailyInfoDTO.getClassId()); + List vodPlayHistoryDOS = vodPlayHistoryMapper.classMemberPlayLength(classVodDailyInfoDTO.getClassId()); HashMap hashMap = new HashMap<>(); //存在一个map里 - for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { + for (ClassMemberPlayLengthVO vodPlayHistoryDO : vodPlayHistoryDOS) { hashMap.put(vodPlayHistoryDO.getMemberId() + "-" + vodPlayHistoryDO.getVodId(), vodPlayHistoryDO.getPlayLength()); } @@ -907,22 +930,30 @@ public class AdministerServiceImpl extends ServiceImpl vodDictDOS = vodDictMapper.getCourseVods(classDictDO.getCourseId(), null); for (ClassDailyInfoVO classDailyInfoVO : classDailyInfoVOS) { - //查看某个视频的完成情况 + //查看这个人某个视频的长度 int total = 0; List classVodDailyInfoItemVOS = new ArrayList<>(); for (VodDictDO vodDictDO : vodDictDOS) { - int playLength = hashMap.get(classDailyInfoVO.getId() + "-" + vodDictDO.getId()); + Integer playLength = hashMap.get(classDailyInfoVO.getId() + "-" + vodDictDO.getId()); ClassVodDailyInfoItemVO classVodDailyInfoItemVO = new ClassVodDailyInfoItemVO(); - classVodDailyInfoItemVO.setPlayLength(playLength); - classVodDailyInfoItemVOS.add(classVodDailyInfoItemVO); - if (playLength>vodDictDO.getVodLength()){ - total ++; + classVodDailyInfoItemVO.setVodId(vodDictDO.getId()); + classVodDailyInfoItemVO.setVodName(vodDictDO.getVodName()); + if (null != playLength) { + classVodDailyInfoItemVO.setPlayLength(playLength); + classVodDailyInfoItemVOS.add(classVodDailyInfoItemVO); + if (playLength >= vodDictDO.getVodLength()) { + total++; + } + } else { + classVodDailyInfoItemVO.setPlayLength(0); + classVodDailyInfoItemVOS.add(classVodDailyInfoItemVO); } } - classDailyInfoVO.setTotal(MathUtil.intDivFloorPercent(total,vodDictDOS.size())); + classDailyInfoVO.setTotal(MathUtil.intDivFloorPercent(total, vodDictDOS.size())); classDailyInfoVO.setClassVodDailyInfoItemVOS(classVodDailyInfoItemVOS); } return classDailyInfoVOIPage; + } public void exportClassVodDailyInfo(ClassVodDailyInfoDTO classVodDailyInfoDTO){ @@ -966,6 +997,76 @@ public class AdministerServiceImpl extends ServiceImpl void writeVodExcel(List classDailyInfoVOS, HashMap hashMap, List title, HashMap vodHashmap) { + + ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = servletRequestAttributes.getResponse(); + + Workbook wb = new XSSFWorkbook(); + Sheet sheet = wb.createSheet(); + AtomicInteger ai = new AtomicInteger(); + + Row row = sheet.createRow(ai.getAndIncrement()); + AtomicInteger at = new AtomicInteger(); + title.forEach(field -> { + Cell cell = row.createCell(at.getAndIncrement()); + CellStyle cellStyle = wb.createCellStyle(); + cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + Font font = wb.createFont(); + font.setBoldweight(Font.BOLDWEIGHT_BOLD); + cellStyle.setFont(font); + cell.setCellStyle(cellStyle); + cell.setCellValue(field); + }); + + if (hashMap != null) { + classDailyInfoVOS.forEach(data -> { + Row r = sheet.createRow(ai.getAndIncrement()); + AtomicInteger a = new AtomicInteger(); + Cell cell = r.createCell(at.getAndIncrement()); + CellStyle cellStyle = wb.createCellStyle(); + cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + cell.setCellStyle(cellStyle); + Cell namecell = r.createCell(a.getAndIncrement()); + namecell.setCellValue(data.getUserName()); + + Cell totalCell = r.createCell(a.getAndIncrement()); + + Integer total = 0; + for (String tt : title) { + if (!"姓名".equals(tt) && !"合计完成率".equals(tt)) { + Cell cell1 = r.createCell(a.getAndIncrement()); + if (null != hashMap) { + + Integer playLength = hashMap.get(data.getId() + "-" + tt); + if (null != playLength) { + cell1.setCellValue(MathUtil.secToTime(playLength)); + if (vodHashmap.get(tt) <= playLength) { + total++; + } + } else { + cell1.setCellValue("00:00:00"); + } + } + } + } + totalCell.setCellValue(MathUtil.intDivFloorPercent(total, vodHashmap.keySet().size()) + "%"); + }); + } + String fileName = String.valueOf(new Date().getTime()); + try { + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader("content-disposition", "attachment;filename=" + URLEncoder.encode(fileName + ".xlsx", "utf-8")); + response.flushBuffer(); + wb.write(response.getOutputStream()); + } catch (IOException e) { + log.error(String.format("downLoad excel exception"), e); + } + + } + + /** * 导出excel文件 */ @@ -1003,7 +1104,7 @@ public class AdministerServiceImpl extends ServiceImpl imple @Autowired private CompanyDictMapper companyDictMapper; + @Autowired + private OprMemDictMapper oprMemDictMapper; + public IPage getAll(GetAllDTO getAllDTO) { Page pager = new Page(getAllDTO.getPageNum(), getAllDTO.getPageSize()); IPage iPage = this.baseMapper.getMembers(pager, getAllDTO.getDepartmentId(), getAllDTO.getUserName(), getAllDTO.getStatus()); @@ -247,12 +251,13 @@ public class MemberServiceImpl extends ServiceImpl imple oprMemDictDO.setUserId(memberDO.getId()); oprMemDictDO.setOprType("登录"); oprMemDictDO.setResult(0); - oprMemDictDO.setUserName(memberDO.getUserName()); - oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); - oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); - oprMemDictDO.setCompanyId(companyDictDO.getId()); - oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); - mongoTemplate.insert(oprMemDictDO); + //oprMemDictDO.setUserName(memberDO.getUserName()); + //oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprMemDictDO.setCompanyId(companyDictDO.getId()); + //oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); + //mongoTemplate.insert(oprMemDictDO); + oprMemDictMapper.insert(oprMemDictDO); //redisUtil.set(RedisPrefixConstant.SUBSIDY_MEMBER_LOGIN_PREFIX + memberDO.getId() + ":" + memberDO.getUserName() + ":" + companyDictDO.getCompanyName() + ":" + LocalDateTime.now(), oprMemDictDO); throw new HttpException(10013); } @@ -272,25 +277,27 @@ public class MemberServiceImpl extends ServiceImpl imple oprMemDictDO.setUserId(memberDO.getId()); oprMemDictDO.setOprType("登录"); oprMemDictDO.setResult(0); - oprMemDictDO.setUserName(memberDO.getUserName()); - oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); - oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); - oprMemDictDO.setCompanyId(companyDictDO.getId()); - oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); - mongoTemplate.insert(oprMemDictDO); + //oprMemDictDO.setUserName(memberDO.getUserName()); + //oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprMemDictDO.setCompanyId(companyDictDO.getId()); + //oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); + //mongoTemplate.insert(oprMemDictDO); + oprMemDictMapper.insert(oprMemDictDO); throw new HttpException(70010); } //审计日志 OprMemDictDO oprMemDictDO = new OprMemDictDO(); oprMemDictDO.setUserId(memberDO.getId()); oprMemDictDO.setOprType("登录"); - oprMemDictDO.setUserName(memberDO.getUserName()); + //oprMemDictDO.setUserName(memberDO.getUserName()); oprMemDictDO.setResult(1); - oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); - oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); - oprMemDictDO.setCompanyId(companyDictDO.getId()); - oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); - mongoTemplate.insert(oprMemDictDO); + //oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprMemDictDO.setCompanyId(companyDictDO.getId()); + //oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); + oprMemDictMapper.insert(oprMemDictDO); + //mongoTemplate.insert(oprMemDictDO); return userRoleVO; } @@ -322,12 +329,13 @@ public class MemberServiceImpl extends ServiceImpl imple oprMemDictDO.setUserId(memberDO.getId()); oprMemDictDO.setOprType("登录"); oprMemDictDO.setResult(1); - oprMemDictDO.setUserName(memberDO.getUserName()); - oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); - oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); - oprMemDictDO.setCompanyId(companyDictDO.getId()); - oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); - mongoTemplate.insert(oprMemDictDO); + //oprMemDictDO.setUserName(memberDO.getUserName()); + //oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprMemDictDO.setCompanyId(companyDictDO.getId()); + //oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); + //mongoTemplate.insert(oprMemDictDO); + oprMemDictMapper.insert(oprMemDictDO); //redisUtil.set(RedisPrefixConstant.SUBSIDY_MEMBER_LOGIN_PREFIX + memberDO.getId() + ":" + System.currentTimeMillis(), 1); return memberVO; } else { @@ -336,12 +344,13 @@ public class MemberServiceImpl extends ServiceImpl imple oprMemDictDO.setUserId(memberDO.getId()); oprMemDictDO.setOprType("登录"); oprMemDictDO.setResult(0); - oprMemDictDO.setUserName(memberDO.getUserName()); - oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); - oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); - oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); - oprMemDictDO.setCompanyId(companyDictDO.getId()); - mongoTemplate.insert(oprMemDictDO); + //oprMemDictDO.setUserName(memberDO.getUserName()); + //oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); + //oprMemDictDO.setCompanyId(companyDictDO.getId()); + //mongoTemplate.insert(oprMemDictDO); + oprMemDictMapper.insert(oprMemDictDO); //redisUtil.set(RedisPrefixConstant.SUBSIDY_MEMBER_LOGIN_PREFIX + memberDO.getId() + ":" + System.currentTimeMillis(), oprMemDictDO); throw new HttpException(10016); } @@ -350,12 +359,13 @@ public class MemberServiceImpl extends ServiceImpl imple oprMemDictDO.setUserId(memberDO.getId()); oprMemDictDO.setOprType("登录"); oprMemDictDO.setResult(0); - oprMemDictDO.setUserName(memberDO.getUserName()); - oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); - oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); - oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); - oprMemDictDO.setCompanyId(companyDictDO.getId()); - mongoTemplate.insert(oprMemDictDO); + //oprMemDictDO.setUserName(memberDO.getUserName()); + //oprMemDictDO.setCreateDate(System.currentTimeMillis() + ""); + //oprMemDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd")); + //oprMemDictDO.setCompanyName(companyDictDO.getCompanyName()); + //oprMemDictDO.setCompanyId(companyDictDO.getId()); + //mongoTemplate.insert(oprMemDictDO); + oprMemDictMapper.insert(oprMemDictDO); //redisUtil.set(RedisPrefixConstant.SUBSIDY_MEMBER_LOGIN_PREFIX + memberDO.getId() + ":" + System.currentTimeMillis(), 0); throw new HttpException(10015); } diff --git a/src/main/java/com/subsidy/service/impl/OprAdmDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/OprAdmDictServiceImpl.java index 415515d..f390a04 100644 --- a/src/main/java/com/subsidy/service/impl/OprAdmDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/OprAdmDictServiceImpl.java @@ -3,27 +3,13 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.subsidy.dto.opr.GetHistoryDTO; -import com.subsidy.mapper.AdministerMapper; -import com.subsidy.mapper.CompanyDictMapper; -import com.subsidy.model.AdministerDO; -import com.subsidy.model.CompanyDictDO; -import com.subsidy.mongodb.OprAdmDictDO; +import com.subsidy.model.OprAdmDictDO; import com.subsidy.mapper.OprAdmDictMapper; -import com.subsidy.mongodb.PageVO; import com.subsidy.service.OprAdmDictService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.subsidy.util.MongoUtil; import com.subsidy.vo.opr.GetHistoryVO; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.mongodb.core.MongoTemplate; -import org.springframework.data.mongodb.core.query.Criteria; -import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.List; - /** *

* 审计表 服务实现类 @@ -35,44 +21,38 @@ import java.util.List; @Service public class OprAdmDictServiceImpl extends ServiceImpl implements OprAdmDictService { - @Autowired - private MongoTemplate mongoTemplate; - - @Autowired - private MongoUtil mongoUtil; - - @Autowired - private AdministerMapper administerMapper; - - @Autowired - private CompanyDictMapper companyDictMapper; - - public PageVO getHistory(GetHistoryDTO getHistoryDTO){ - - PageVO pageVO = new PageVO(); - - List getHistoryVOS = new ArrayList<>(); - - //可累加条件 - Query query = new Query(Criteria.where("userName").regex(getHistoryDTO.getUserName()) - .andOperator(Criteria.where("loginDateFormat").gte(getHistoryDTO.getStartDate()), - Criteria.where("loginDateFormat").lte(getHistoryDTO.getEndDate()))); - Long count = mongoTemplate.count(query,OprAdmDictDO.class); - mongoUtil.start(getHistoryDTO.getPageNum(),getHistoryDTO.getPageSize(),query); - List oprAdmDictDOS = mongoTemplate.find(query,OprAdmDictDO.class); - for (OprAdmDictDO oprAdmDictDO : oprAdmDictDOS){ - AdministerDO administerDO = administerMapper.selectById(oprAdmDictDO.getUserId()); - CompanyDictDO companyDictDO = companyDictMapper.selectById(administerDO.getCompanyId()); - GetHistoryVO getHistoryVO = new GetHistoryVO(); - BeanUtils.copyProperties(oprAdmDictDO,getHistoryVO); - getHistoryVO.setCompanyName(companyDictDO.getCompanyName()); - getHistoryVO.setUserName(administerDO.getUserName()); - getHistoryVOS.add(getHistoryVO); - } - pageVO.setRecords(getHistoryVOS); - pageVO.setTotal(count); - return pageVO; + //public PageVO getHistory(GetHistoryDTO getHistoryDTO){ + // + // PageVO pageVO = new PageVO(); + // + // List getHistoryVOS = new ArrayList<>(); + // + // //可累加条件 + // Query query = new Query(Criteria.where("userName").regex(getHistoryDTO.getUserName()) + // .andOperator(Criteria.where("loginDateFormat").gte(getHistoryDTO.getStartDate()), + // Criteria.where("loginDateFormat").lte(getHistoryDTO.getEndDate()))); + // Long count = mongoTemplate.count(query,OprAdmDictDO.class); + // mongoUtil.start(getHistoryDTO.getPageNum(),getHistoryDTO.getPageSize(),query); + // List oprAdmDictDOS = mongoTemplate.find(query,OprAdmDictDO.class); + // for (OprAdmDictDO oprAdmDictDO : oprAdmDictDOS){ + // AdministerDO administerDO = administerMapper.selectById(oprAdmDictDO.getUserId()); + // CompanyDictDO companyDictDO = companyDictMapper.selectById(administerDO.getCompanyId()); + // GetHistoryVO getHistoryVO = new GetHistoryVO(); + // BeanUtils.copyProperties(oprAdmDictDO,getHistoryVO); + // getHistoryVO.setCompanyName(companyDictDO.getCompanyName()); + // getHistoryVO.setUserName(administerDO.getUserName()); + // getHistoryVOS.add(getHistoryVO); + // } + // pageVO.setRecords(getHistoryVOS); + // pageVO.setTotal(count); + // + // return pageVO; + //} + + public IPage getHistory(GetHistoryDTO getHistoryDTO){ + Page pager = new Page(getHistoryDTO.getPageNum(), getHistoryDTO.getPageSize()); + return this.baseMapper.getHistory(pager,getHistoryDTO.getUserName(),getHistoryDTO.getStartDate(),getHistoryDTO.getEndDate()); } } diff --git a/src/main/java/com/subsidy/service/impl/OprMemDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/OprMemDictServiceImpl.java index 081f701..6984a8d 100644 --- a/src/main/java/com/subsidy/service/impl/OprMemDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/OprMemDictServiceImpl.java @@ -5,27 +5,16 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.subsidy.dto.opr.GetHistoryDTO; import com.subsidy.mapper.CompanyDictMapper; import com.subsidy.mapper.MemberMapper; -import com.subsidy.model.AdministerDO; -import com.subsidy.model.CompanyDictDO; -import com.subsidy.model.MemberDO; import com.subsidy.model.OprMemDictDO; import com.subsidy.mapper.OprMemDictMapper; -import com.subsidy.mongodb.OprAdmDictDO; -import com.subsidy.mongodb.PageVO; import com.subsidy.service.OprMemDictService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.MongoUtil; import com.subsidy.vo.opr.GetHistoryVO; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; -import org.springframework.data.mongodb.core.query.Criteria; -import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.List; - /** *

* 审计表 服务实现类 @@ -49,33 +38,37 @@ public class OprMemDictServiceImpl extends ServiceImpl getHistory(GetHistoryDTO getHistoryDTO) { - - PageVO pageVO = new PageVO(); - - List getHistoryVOS = new ArrayList<>(); + //public PageVO getHistory(GetHistoryDTO getHistoryDTO) { + // + // PageVO pageVO = new PageVO(); + // + // List getHistoryVOS = new ArrayList<>(); + // + // //可累加条件 + // Query query = new Query(Criteria.where("userName").regex(getHistoryDTO.getUserName()) + // .andOperator(Criteria.where("loginDateFormat").gte(getHistoryDTO.getStartDate()), + // Criteria.where("loginDateFormat").lte(getHistoryDTO.getEndDate()))); + // Long count = mongoTemplate.count(query, OprMemDictDO.class); + // mongoUtil.start(getHistoryDTO.getPageNum(), getHistoryDTO.getPageSize(), query); + // List oprMemDictDOS = mongoTemplate.find(query, OprMemDictDO.class); + // for (OprMemDictDO oprMemDictDO : oprMemDictDOS) { + // MemberDO memberDO = memberMapper.selectById(oprMemDictDO.getUserId()); + // CompanyDictDO companyDictDO = companyDictMapper.selectById(memberDO.getCompanyId()); + // GetHistoryVO getHistoryVO = new GetHistoryVO(); + // BeanUtils.copyProperties(oprMemDictDO, getHistoryVO); + // getHistoryVO.setCompanyName(companyDictDO.getCompanyName()); + // getHistoryVO.setUserName(memberDO.getUserName()); + // getHistoryVOS.add(getHistoryVO); + // } + // pageVO.setRecords(getHistoryVOS); + // pageVO.setTotal(count); + // + // return pageVO; + //} - //可累加条件 - Query query = new Query(Criteria.where("userName").regex(getHistoryDTO.getUserName()) - .andOperator(Criteria.where("loginDateFormat").gte(getHistoryDTO.getStartDate()), - Criteria.where("loginDateFormat").lte(getHistoryDTO.getEndDate()))); - Long count = mongoTemplate.count(query, OprMemDictDO.class); - mongoUtil.start(getHistoryDTO.getPageNum(), getHistoryDTO.getPageSize(), query); - List oprMemDictDOS = mongoTemplate.find(query, OprMemDictDO.class); - for (OprMemDictDO oprMemDictDO : oprMemDictDOS) { - MemberDO memberDO = memberMapper.selectById(oprMemDictDO.getUserId()); - CompanyDictDO companyDictDO = companyDictMapper.selectById(memberDO.getCompanyId()); - GetHistoryVO getHistoryVO = new GetHistoryVO(); - BeanUtils.copyProperties(oprMemDictDO, getHistoryVO); - getHistoryVO.setCompanyName(companyDictDO.getCompanyName()); - getHistoryVO.setUserName(memberDO.getUserName()); - getHistoryVOS.add(getHistoryVO); - } - pageVO.setRecords(getHistoryVOS); - pageVO.setTotal(count); - - return pageVO; + public IPage getHistory(GetHistoryDTO getHistoryDTO){ + Page pager = new Page(getHistoryDTO.getPageNum(), getHistoryDTO.getPageSize()); + return this.baseMapper.getHistory(pager,getHistoryDTO.getUserName(),getHistoryDTO.getStartDate(),getHistoryDTO.getEndDate()); } - } diff --git a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java index 3c6a1cb..6b67fba 100644 --- a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java @@ -29,6 +29,9 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.ZoneOffset; import java.util.Date; import java.util.List; import java.util.concurrent.ExecutorService; @@ -59,6 +62,9 @@ public class SignInRecordServiceImpl extends ServiceImpl getMemberSignInfo(GetMemberSignInfoDTO getMemberSignInfoDTO) { Page pager = new Page(getMemberSignInfoDTO.getPageNum(), getMemberSignInfoDTO.getPageSize()); @@ -75,7 +81,7 @@ public class SignInRecordServiceImpl extends ServiceImpl classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId()); for (ClassDictDO classDictDO : classDictDOS) { - redisUtil.set(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + "memberId:" + signInRecordDO.getMemberId() + ":classId:" + classDictDO.getId() + ":" + DateFormatUtil.format(new Date(), "yyyyMMdd") + ":" + System.currentTimeMillis(), null); + redisUtil.set(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + classDictDO.getId() + ":" + DateFormatUtil.format(new Date(), "yyyyMMdd") + ":" + System.currentTimeMillis(), null); } return ConstantUtils.ADD_SUCCESS; @@ -110,7 +116,7 @@ public class SignInRecordServiceImpl extends ServiceImpl classHourDictDOS = classHourDictMapper.selectList(null); - for (ClassHourDictDO classHourDictDO : classHourDictDOS) { - redisUtil.set("subsidySettings:"+ classHourDictDO.getCompanyId(), classHourDictDO); - } + //List classHourDictDOS = classHourDictMapper.selectList(null); + //for (ClassHourDictDO classHourDictDO : classHourDictDOS) { + // redisUtil.set("subsidySettings:"+ classHourDictDO.getCompanyId(), classHourDictDO); + //} //预写学生账号数据 //List memberDOS = memberMapper.selectList(null); //for (MemberDO memberDO : memberDOS){ // redisUtil.set(RedisPrefixConstant.SUBSIDY_COMPANY_MEMBER_PREFIX+memberDO.getCompanyId()+":"+memberDO.getAccountName(),memberDO); //} + + //签到数据 + List signInRecordDOS = signInRecordMapper.selectList(null); + for (SignInRecordDO signInRecordDO : signInRecordDOS){ + redisUtil.set(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX+signInRecordDO.getMemberId()+":classId:"+ + signInRecordDO.getClassId()+":"+signInRecordDO.getSignInDate().toString().split("T")[0]+":"+signInRecordDO.getSignInDate().toInstant(ZoneOffset.of("+8")).toEpochMilli(),signInRecordDO); + } + + } } diff --git a/src/main/java/com/subsidy/vo/administer/ClassVodDailyInfoItemVO.java b/src/main/java/com/subsidy/vo/administer/ClassVodDailyInfoItemVO.java index 80ae840..4458034 100644 --- a/src/main/java/com/subsidy/vo/administer/ClassVodDailyInfoItemVO.java +++ b/src/main/java/com/subsidy/vo/administer/ClassVodDailyInfoItemVO.java @@ -5,7 +5,7 @@ import lombok.Data; @Data public class ClassVodDailyInfoItemVO { - private Integer vodId; + private Long vodId; private String vodName; diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 0f8bf7b..74a1306 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -34,12 +34,19 @@ mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl #spring.redis.lettuce.pool.max-active=32 #spring.redis.lettuce.pool.min-idle=8 -spring.application.name=spring-boot-mongodb -# mongodb -#spring.data.mongodb.uri=mongodb://47.97.19.66:27017/subsidy -spring.data.mongodb.username=root -spring.data.mongodb.password=123456 -#spring.data.mongodb.authentication-database=subsidy -spring.data.mongodb.database=subsidy -spring.data.mongodb.host=47.97.19.66 -spring.data.mongodb.port=27017 +#spring.application.name=spring-boot-mongodb +## mongodb +##spring.data.mongodb.uri=mongodb://47.97.19.66:27017/subsidy +#spring.data.mongodb.username=root +#spring.data.mongodb.password=123456 +##spring.data.mongodb.authentication-database=subsidy +#spring.data.mongodb.database=subsidy +#spring.data.mongodb.host=47.97.19.66 +#spring.data.mongodb.port=27017 + +spring.redis.host=47.97.19.66 +spring.redis.password=Ykhl@208 +spring.redis.port=6389 +spring.redis.lettuce.pool.max-idle=16 +spring.redis.lettuce.pool.max-active=32 +spring.redis.lettuce.pool.min-idle=8 \ No newline at end of file diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index 0164ddc..cf81c7a 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -32,8 +32,15 @@ spring.servlet.multipart.max-request-size=4098KB #wechat.msgUrl= https://teachai.youkehulian.com/login #wechat.templateId= Z1HNPLOrKiHEjfR1KMP-cC-uH3BWqDJIHv365Ev20yQ -spring.redis.cluster.nodes=47.97.19.66:6377,47.97.19.66:6378,47.97.16.66:6379 -spring.redis.password=Ykhl@208 +#spring.redis.cluster.nodes=47.97.19.66:6377,47.97.19.66:6378,47.97.16.66:6379 +#spring.redis.password=Ykhl@208 +#spring.redis.lettuce.pool.max-idle=16 +#spring.redis.lettuce.pool.max-active=32 +#spring.redis.lettuce.pool.min-idle=8 + +spring.redis.host=r-uf6pdbuxqgy0ztfmn1pd.redis.rds.aliyuncs.com +spring.redis.password=r-uf6pdbuxqgy0ztfmn1:Ykhl@208 +spring.redis.port=6379 spring.redis.lettuce.pool.max-idle=16 spring.redis.lettuce.pool.max-active=32 spring.redis.lettuce.pool.min-idle=8 \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 33a6e52..dbc0753 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ # 环境配置 -spring.profiles.active=dev +spring.profiles.active=prod # 端口号 -spring.server.port=23457 +spring.server.port=23459 #嵌入tomcat配置 #和CPU数 spring.server.acceptorThreadCount=600 @@ -68,9 +68,3 @@ spring.quartz.overwrite-existing-jobs=false #spring.redis.port=6379 #spring.redis.password=r-uf6m4cpkjrgpzywjm3:Ykhl@208 -spring.redis.host=47.97.19.66 -spring.redis.password=Ykhl@208 -spring.redis.port=6389 -spring.redis.lettuce.pool.max-idle=16 -spring.redis.lettuce.pool.max-active=32 -spring.redis.lettuce.pool.min-idle=8 \ No newline at end of file diff --git a/src/main/resources/mapper/OprAdmDictMapper.xml b/src/main/resources/mapper/OprAdmDictMapper.xml index 649e177..aeccd0c 100644 --- a/src/main/resources/mapper/OprAdmDictMapper.xml +++ b/src/main/resources/mapper/OprAdmDictMapper.xml @@ -3,7 +3,7 @@ - + @@ -50,7 +50,7 @@ t.create_date DESC - SELECT * FROM @@ -68,7 +68,7 @@ LIMIT 5)t2 - SELECT * FROM diff --git a/src/main/resources/mapper/VodPlayHistoryMapper.xml b/src/main/resources/mapper/VodPlayHistoryMapper.xml index 99e489e..995026b 100644 --- a/src/main/resources/mapper/VodPlayHistoryMapper.xml +++ b/src/main/resources/mapper/VodPlayHistoryMapper.xml @@ -130,102 +130,105 @@ + -- libgit2 0.25.0