Commit 4f1af516 by 涂亚平

中秋代码备份

1 parent f09aa192
...@@ -91,6 +91,14 @@ public class MemberController { ...@@ -91,6 +91,14 @@ public class MemberController {
return ResponseData.generateCreatedResponse(0,memberService.kunchiLogin(qingxuetangLoginDTO,request)); return ResponseData.generateCreatedResponse(0,memberService.kunchiLogin(qingxuetangLoginDTO,request));
} }
@PostMapping("kexinkuLogin")
@ApiOperation("可信库登录 idCard 身份证号 timestamp 时间戳 sign")
@TimeRequired
public ResponseVO kexinkuLogin(@RequestBody KexinkuLoginDTO kexinkuLoginDTO ){
return ResponseData.generateCreatedResponse(0,memberService.kexinkuLogin(kexinkuLoginDTO));
}
@PostMapping("checkStatus") @PostMapping("checkStatus")
@ApiOperation("实名制验证状态 id") @ApiOperation("实名制验证状态 id")
@TimeRequired @TimeRequired
......
...@@ -16,6 +16,8 @@ import io.swagger.annotations.ApiOperation; ...@@ -16,6 +16,8 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* <p> * <p>
* 视频播放历史记录表 前端控制器 * 视频播放历史记录表 前端控制器
...@@ -96,4 +98,13 @@ public class VodPlayHistoryController { ...@@ -96,4 +98,13 @@ public class VodPlayHistoryController {
vodPlayHistoryService.warning(); vodPlayHistoryService.warning();
} }
@PostMapping("criticalData")
@ApiOperation("找出临界那条数据 classId")
public List<Long> criticalData(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
return vodPlayHistoryService.criticalData(vodPlayHistoryDO);
}
} }
package com.subsidy.dto.member;
import lombok.Data;
@Data
public class KexinkuLoginDTO {
private String appId;
private String authCorpId;
private String openId;
private String idCard;
private Long timestamp;
private String sign;
}
...@@ -69,7 +69,7 @@ public class WarningJob { ...@@ -69,7 +69,7 @@ public class WarningJob {
// } // }
// //
// if (result.size()>0){ // if (result.size()>0){
// List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"}); // List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812"});
// for (String telephone : telephones){ // for (String telephone : telephones){
// smsUtils.sendWarning("SMS_460945631", telephone, result.toString()); // smsUtils.sendWarning("SMS_460945631", telephone, result.toString());
// } // }
......
package com.subsidy.mapper; package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.model.OprAdmDictDO;
import com.subsidy.model.OprMemDictDO; import com.subsidy.model.OprMemDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.opr.GetHistoryVO; import com.subsidy.vo.opr.GetHistoryVO;
...@@ -56,5 +57,13 @@ public interface OprMemDictMapper extends BaseMapper<OprMemDictDO> { ...@@ -56,5 +57,13 @@ public interface OprMemDictMapper extends BaseMapper<OprMemDictDO> {
*/ */
void insertOrUpdate(Long userId, String oprType, Integer result, String ipAddress, Date createDate); void insertOrUpdate(Long userId, String oprType, Integer result, String ipAddress, Date createDate);
/**
* 查看某为成员最近登录情况 五天超过次数
*/
List<OprMemDictDO> getLoginInfo(Long userId);
/**
* 清除今天登录失败的记录
*/
void clearTodayLoginData(Long userId);
} }
...@@ -2,6 +2,7 @@ package com.subsidy.mapper; ...@@ -2,6 +2,7 @@ package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.model.VodDictDO;
import com.subsidy.model.VodPlayHistoryDO; import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.vo.administer.MemberStudyLogVO; import com.subsidy.vo.administer.MemberStudyLogVO;
import com.subsidy.vo.member.ContentVodNewVO; import com.subsidy.vo.member.ContentVodNewVO;
...@@ -126,4 +127,9 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> { ...@@ -126,4 +127,9 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> {
*/ */
List<DailyClassMembersVO> dailyClassMembers(); List<DailyClassMembersVO> dailyClassMembers();
/**
* 找出这个课程学习的人
*/
List<Long> vodMembers(Long classId);
} }
...@@ -43,6 +43,8 @@ public interface MemberService extends IService<MemberDO> { ...@@ -43,6 +43,8 @@ public interface MemberService extends IService<MemberDO> {
UserRoleVO kunchiLogin(QingxuetangLoginDTO qingxuetangLoginDTO, HttpServletRequest request); UserRoleVO kunchiLogin(QingxuetangLoginDTO qingxuetangLoginDTO, HttpServletRequest request);
UserRoleVO kexinkuLogin(KexinkuLoginDTO kexinkuLoginDTO);
CheckStatusVO checkStatus(MemberDO memberDO); CheckStatusVO checkStatus(MemberDO memberDO);
String updatePassword(MemberDO memberDO); String updatePassword(MemberDO memberDO);
......
...@@ -40,4 +40,6 @@ public interface VodPlayHistoryService extends IService<VodPlayHistoryDO> { ...@@ -40,4 +40,6 @@ public interface VodPlayHistoryService extends IService<VodPlayHistoryDO> {
void warning(); void warning();
List<Long> criticalData(VodPlayHistoryDO vodPlayHistoryDO);
} }
...@@ -243,11 +243,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -243,11 +243,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
oprAdmDictDO.setOprType("登录"); oprAdmDictDO.setOprType("登录");
oprAdmDictDO.setResult(0); oprAdmDictDO.setResult(0);
oprAdmDictMapper.insert(oprAdmDictDO); oprAdmDictMapper.insert(oprAdmDictDO);
//oprAdmDictDO.setCreateDate(System.currentTimeMillis() + "");
//oprAdmDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd"));
//oprAdmDictDO.setUserName(administerDO1.getUserName());
//oprAdmDictDO.setCompanyId(administerDO1.getCompanyId());
//mongoTemplate.insert(oprAdmDictDO);
int i = 0; int i = 0;
...@@ -1402,7 +1398,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1402,7 +1398,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
memberDO1.setTelephone(s.getTelephone()); memberDO1.setTelephone(s.getTelephone());
memberDO1.setIdCard(s.getIdCard()); memberDO1.setIdCard(s.getIdCard());
memberDO1.setStatus("启用"); memberDO1.setStatus("启用");
memberDO1.setPassword("123456"); memberDO1.setPassword("Ykhl123456");
memberDO1.setAccountNameEn(s.getAccountNameEn()); memberDO1.setAccountNameEn(s.getAccountNameEn());
memberMapper.insert(memberDO1); memberMapper.insert(memberDO1);
...@@ -2095,22 +2091,29 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -2095,22 +2091,29 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
newCell.setCellValue(exerciseTestVO.getCount()); newCell.setCellValue(exerciseTestVO.getCount());
//次数 //开始时间
newCell = dataRow.createCell(6); newCell = dataRow.createCell(6);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
if (exerciseTestVO.getScore() != 0) { if (exerciseTestVO.getScore() != 0) {
newCell.setCellValue(exerciseTestVO.getStartDate()); newCell.setCellValue(exerciseTestVO.getStartDate());
} }
//次数 //结束时间
newCell = dataRow.createCell(7); newCell = dataRow.createCell(7);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
if (exerciseTestVO.getScore() != 0) { if (exerciseTestVO.getScore() != 0) {
newCell.setCellValue(exerciseTestVO.getEndDate()); newCell.setCellValue(exerciseTestVO.getEndDate());
} }
//次数
newCell = dataRow.createCell(8); newCell = dataRow.createCell(8);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
if (exerciseTestVO.getScore() != 0) {
newCell.setCellValue(exerciseTestVO.getPeriod());
}
newCell = dataRow.createCell(9);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(exerciseTestVO.getScore() >= 60 ? "合格" : "不合格"); newCell.setCellValue(exerciseTestVO.getScore() >= 60 ? "合格" : "不合格");
rowIndex++; rowIndex++;
......
...@@ -55,9 +55,19 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper, ...@@ -55,9 +55,19 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
@Autowired @Autowired
private SMSUtils smsUtils; private SMSUtils smsUtils;
@Autowired
private ExerciseDoneResultMapper exerciseDoneResultMapper;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String insertHistory(VodPlayHistoryDO vodPlayHistoryDO) { public String insertHistory(VodPlayHistoryDO vodPlayHistoryDO) {
// Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper<ExerciseDoneResultDO>()
// .lambda()
// .eq(ExerciseDoneResultDO::getClassId, vodPlayHistoryDO.getClassId())
// .eq(ExerciseDoneResultDO::getMemberId, vodPlayHistoryDO.getMemberId())
// .eq(ExerciseDoneResultDO::getResult, "合格"));
// if (count == 0){
Date date = new Date(); Date date = new Date();
if (vodPlayHistoryDO.getPlayLength() > 8 && vodPlayHistoryDO.getSuspendLength() <= 3000) { if (vodPlayHistoryDO.getPlayLength() > 8 && vodPlayHistoryDO.getSuspendLength() <= 3000) {
//查看系统设定的时长 //查看系统设定的时长
...@@ -94,11 +104,21 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper, ...@@ -94,11 +104,21 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
// this.baseMapper.insert(vodPlayHistoryDO); // this.baseMapper.insert(vodPlayHistoryDO);
} }
} }
// }
return ConstantUtils.ADD_SUCCESS; return ConstantUtils.ADD_SUCCESS;
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String insertHistoryNew(InsertHistoryNewDTO insertHistoryNewDTO) { public String insertHistoryNew(InsertHistoryNewDTO insertHistoryNewDTO) {
// Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper<ExerciseDoneResultDO>()
// .lambda()
// .eq(ExerciseDoneResultDO::getClassId, insertHistoryNewDTO.getClassId())
// .eq(ExerciseDoneResultDO::getMemberId, insertHistoryNewDTO.getMemberId())
// .eq(ExerciseDoneResultDO::getResult, "合格"));
//
// if (count == 0){
Date date = new Date(); Date date = new Date();
if (insertHistoryNewDTO.getPlayLength() > 8 && insertHistoryNewDTO.getSuspendLength() <= 3000) { if (insertHistoryNewDTO.getPlayLength() > 8 && insertHistoryNewDTO.getSuspendLength() <= 3000) {
VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO(); VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO();
...@@ -136,6 +156,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper, ...@@ -136,6 +156,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
// this.baseMapper.insert(vodPlayHistoryDO); // this.baseMapper.insert(vodPlayHistoryDO);
} }
} }
// }
return ConstantUtils.ADD_SUCCESS; return ConstantUtils.ADD_SUCCESS;
} }
...@@ -688,13 +709,41 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper, ...@@ -688,13 +709,41 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
System.out.println(result.toString()); System.out.println(result.toString());
if (result.size() > 0) { if (result.size() > 0) {
List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"}); List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812"});
for (String telephone : telephones) { for (String telephone : telephones) {
smsUtils.sendWarning("SMS_460945631", telephone, result.toString()); smsUtils.sendWarning("SMS_460945631", telephone, result.toString());
} }
} }
} }
public List<Long> criticalData(VodPlayHistoryDO vodPlayHistoryDO) {
List<Long> result = new ArrayList<>();
List<Long> vodMembers = vodPlayHistoryMapper.vodMembers(vodPlayHistoryDO.getClassId());
VodDictDO vodDictDO = vodDictMapper.selectById(vodPlayHistoryDO.getVodId());
for (Long memberId : vodMembers){
List<VodPlayHistoryDO> vodPlayHistoryDOS = this.baseMapper.selectList(new QueryWrapper<VodPlayHistoryDO>()
.lambda()
.eq(VodPlayHistoryDO::getClassId,vodPlayHistoryDO.getClassId())
.eq(VodPlayHistoryDO::getMemberId,memberId)
.eq(VodPlayHistoryDO::getVodId,vodPlayHistoryDO.getVodId())
.orderByAsc(VodPlayHistoryDO::getCreateDate));
int i = 0 ;
for (VodPlayHistoryDO vodPlayHistoryDO1 : vodPlayHistoryDOS){
i+=vodPlayHistoryDO1.getPlayLength();
if ( i >= vodDictDO.getVodLength()){
result.add(vodPlayHistoryDO1.getId());
break;
}
}
}
return result;
}
//19为基数的话,3次签到6.5到8,4次签到4.8-6, //19为基数的话,3次签到6.5到8,4次签到4.8-6,
// 5次4-6,6次3.2-6,7次及以上2.5-6吧 // 5次4-6,6次3.2-6,7次及以上2.5-6吧
//int randNumber =rand.nextInt(MAX - MIN + 1) + MIN; //int randNumber =rand.nextInt(MAX - MIN + 1) + MIN;
...@@ -738,13 +787,13 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper, ...@@ -738,13 +787,13 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
* 随机0-9秒 * 随机0-9秒
*/ */
public int random0to9() { public int random0to9() {
return (int) (Math.random() * 10+3); return (int) (Math.random() * 10 + 3);
} }
public static void main(String[] args) { public static void main(String[] args) {
for (int i = 0; i < 50; i++) { for (int i = 0; i < 50; i++) {
System.out.println((int) (Math.random() * 10)+3); System.out.println((int) (Math.random() * 10) + 3);
} }
// List<Long> list = new ArrayList<Long>(); // List<Long> list = new ArrayList<Long>();
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<if test="userName != null and userName !=''"> <if test="userName != null and userName !=''">
and t2.user_name like concat('%',#{userName} ,'%') and t2.user_name like concat('%',#{userName} ,'%')
</if> </if>
order by CONVERT(t2.user_name USING gbk) ASC order by t2.account_name ASC
</select> </select>
<select id="classSign" resultType="com.subsidy.vo.member.ClassSignVO"> <select id="classSign" resultType="com.subsidy.vo.member.ClassSignVO">
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<if test="userName != null and userName !=''"> <if test="userName != null and userName !=''">
and t2.user_name like concat('%',#{userName} ,'%') and t2.user_name like concat('%',#{userName} ,'%')
</if> </if>
order by CONVERT(t2.user_name USING gbk) ASC order by t2.account_name ASC
</select> </select>
<select id="exerciseTest" resultType="com.subsidy.vo.administer.ExerciseTestVO"> <select id="exerciseTest" resultType="com.subsidy.vo.administer.ExerciseTestVO">
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<if test="userName != null and userName !=''"> <if test="userName != null and userName !=''">
and t2.user_name like concat('%',#{userName} ,'%') and t2.user_name like concat('%',#{userName} ,'%')
</if> </if>
order by CONVERT(t2.user_name USING gbk) ASC order by t2.account_name ASC
</select> </select>
<select id="answerRecord" resultType="com.subsidy.vo.sign.AnswerRecordVO"> <select id="answerRecord" resultType="com.subsidy.vo.sign.AnswerRecordVO">
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<if test="userName !=null and userName !=''"> <if test="userName !=null and userName !=''">
AND t2.user_name LIKE concat('%',#{userName} ,'%') AND t2.user_name LIKE concat('%',#{userName} ,'%')
</if> </if>
order by CONVERT(t2.user_name USING gbk) ASC order by t2.account_name ASC
</select> </select>
<select id="classActivityDetection" resultType="com.subsidy.vo.administer.MemberDetectionRecordVO"> <select id="classActivityDetection" resultType="com.subsidy.vo.administer.MemberDetectionRecordVO">
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
</if> </if>
GROUP BY GROUP BY
t.member_id t.member_id
order by CONVERT(t2.user_name USING gbk) ASC order by t2.account_name ASC
</select> </select>
<select id="imageCheckDetail" resultType="com.subsidy.vo.administer.ImageCheckDetailVO"> <select id="imageCheckDetail" resultType="com.subsidy.vo.administer.ImageCheckDetailVO">
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
t2.member_id, t2.member_id,
t2.class_id t2.class_id
) t2 ON t1.id = t2.member_id ) t2 ON t1.id = t2.member_id
order by CONVERT(t1.user_name USING gbk) ASC order by t1.account_name ASC
</select> </select>
<select id="operators" parameterType="string" resultType="com.subsidy.vo.administer.OperatorsVO"> <select id="operators" parameterType="string" resultType="com.subsidy.vo.administer.OperatorsVO">
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<if test="userName !=null and userName !=''"> <if test="userName !=null and userName !=''">
and t2.user_name like concat('%',#{userName} ,'%') and t2.user_name like concat('%',#{userName} ,'%')
</if> </if>
order by CONVERT(t2.user_name USING gbk) ASC order by t2.account_name ASC
</select> </select>
<select id="getMemberClassCount" parameterType="long" resultType="long"> <select id="getMemberClassCount" parameterType="long" resultType="long">
......
...@@ -258,4 +258,32 @@ ...@@ -258,4 +258,32 @@
create_date=values(create_date) create_date=values(create_date)
</insert> </insert>
<select id="getLoginInfo" parameterType="long" resultType="com.subsidy.model.OprMemDictDO">
SELECT
*
FROM
(
SELECT
*
FROM
opr_mem_dict t
where t.delete_date is null
and t.user_id = #{userId}
and DATE_FORMAT(t.create_date,'%Y-%m-%d') =DATE_FORMAT(now(), '%Y-%m-%d')
and TIMESTAMPDIFF(SECOND,t.create_date,now()) &lt;= 300
ORDER BY
t.create_date DESC
LIMIT 5)t2
</select>
<select id="clearTodayLoginData" parameterType="long">
DELETE
FROM
opr_mem_dict
WHERE
delete_date IS NULL
AND user_id = #{userId}
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = CURRENT_DATE
</select>
</mapper> </mapper>
...@@ -467,7 +467,6 @@ ...@@ -467,7 +467,6 @@
AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.paper_id IS NULL AND t1.paper_id IS NULL
AND t1.result = 1 AND t1.result = 1
and t1.member_id
GROUP BY t1.class_id,t1.member_id GROUP BY t1.class_id,t1.member_id
ORDER BY t1.create_date desc ORDER BY t1.create_date desc
</select> </select>
...@@ -491,7 +490,6 @@ ...@@ -491,7 +490,6 @@
and class_id = #{classId} and class_id = #{classId}
AND t1.paper_id IS not NULL AND t1.paper_id IS not NULL
AND t1.result = 1 AND t1.result = 1
and t1.member_id
GROUP BY t1.class_id,t1.member_id GROUP BY t1.class_id,t1.member_id
ORDER BY t1.create_date desc ORDER BY t1.create_date desc
</select> </select>
......
...@@ -550,4 +550,14 @@ ...@@ -550,4 +550,14 @@
t.class_id t.class_id
</select> </select>
<select id="vodMembers" parameterType="long" resultType="long">
SELECT DISTINCT
t.member_id
FROM
vod_play_history t
WHERE
t.delete_date IS NULL
and t.class_id = #{classId}
</select>
</mapper> </mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!