Commit a7491c75 by wangxin

首页滚动提示

parent cc3ee936
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
package com.yizhi.exam.application.feign; package com.yizhi.exam.application.feign;
import com.yizhi.exam.application.vo.MyExamParameterVO; import com.yizhi.exam.application.vo.MyExamParameterVO;
import com.yizhi.exam.application.vo.MyExamVO;
import com.yizhi.exam.application.vo.exam.MyExamPageVO; import com.yizhi.exam.application.vo.exam.MyExamPageVO;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -33,6 +34,16 @@ public interface MyExamClient { ...@@ -33,6 +34,16 @@ public interface MyExamClient {
@PostMapping("/api/exam/list") @PostMapping("/api/exam/list")
MyExamPageVO getMyExamList(@RequestBody MyExamParameterVO myExamParameterVO); MyExamPageVO getMyExamList(@RequestBody MyExamParameterVO myExamParameterVO);
@PostMapping("/api/exam/list1")
MyExamPageVO getMyExamListNew(@RequestBody MyExamParameterVO myExamParameterVO);
/**
* 获取4天内创建的所有考试信息(不用分页)
* @param myExamParameterVO
* @return
*/
@PostMapping("/api/exam/listFour")
List<MyExamVO> getMyExamListFour(@RequestBody MyExamParameterVO myExamParameterVO);
/** /**
* pc端我的考试列表 * pc端我的考试列表
......
...@@ -64,4 +64,10 @@ public class MyExamVO { ...@@ -64,4 +64,10 @@ public class MyExamVO {
@ApiModelProperty(value = "考试logo图片") @ApiModelProperty(value = "考试logo图片")
private String logoImg; private String logoImg;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "创建人ID")
private Long createById;
@ApiModelProperty(value = "创建人姓名")
private String createByName;
} }
...@@ -54,6 +54,47 @@ public class MyExamController { ...@@ -54,6 +54,47 @@ public class MyExamController {
} }
/** /**
* 我的考试
*
* @param myExamParameterVO
* @return
*/
@PostMapping("/list1")
public MyExamPageVO getMyExamList1(@RequestBody MyExamParameterVO myExamParameterVO) {
try {
MyExamPageVO myExamPageVO = new MyExamPageVO();
/*Map<String,Integer> page=new HashMap<String,Integer>();
page.put("pageSize",myExamParameterVO.getPageSize());
page.put("pageNo",myExamParameterVO.getPageNo());*/
List<MyExamVO> myExamVOS = iExamService.MyExam1(myExamParameterVO);
/* page.put("pageTotal",iExamService.selectTotal(myExamParameterVO));
map.put("list",myExamVOS);
map.put("page",page);*/
myExamPageVO.setExamVOS(myExamVOS);
myExamPageVO.setPageTotal(iExamService.selectTotal1(myExamParameterVO));
return myExamPageVO;
} catch (Exception e) {
LOG.error("", e);
e.printStackTrace();
return null;
}
}
/**
* 我的考试
*
* @param myExamParameterVO
* @return
*/
@PostMapping("/listFour")
public List<MyExamVO> getMyExamlistFour(@RequestBody MyExamParameterVO myExamParameterVO) {
return iExamService.MyExamFour(myExamParameterVO);
}
/**
* pc端我的考试列表 * pc端我的考试列表
* *
* @param myExamParameterVO * @param myExamParameterVO
......
...@@ -52,11 +52,26 @@ public interface ExamMapper extends BaseMapper<Exam> { ...@@ -52,11 +52,26 @@ public interface ExamMapper extends BaseMapper<Exam> {
List<MyExamVO> selectMyExamInfo(@Param("start") Integer start, @Param("end") Integer end, @Param("ids") List<Long> ids, List<MyExamVO> selectMyExamInfo(@Param("start") Integer start, @Param("end") Integer end, @Param("ids") List<Long> ids,
@Param("state") Integer state, @Param("accountId") Long accountId, @Param("siteId") Long siteId); @Param("state") Integer state, @Param("accountId") Long accountId, @Param("siteId") Long siteId);
List<MyExamVO> selectMyExamInfo1(@Param("start") Integer start, @Param("end") Integer end, @Param("ids") List<Long> ids,
@Param("state") Integer state, @Param("accountId") Long accountId, @Param("siteId") Long siteId);
/**
* 获取4天内创建的所有考试信息(不用分页)
* @param ids
* @param state
* @param accountId
* @param siteId
* @return
*/
List<MyExamVO> selectMyExamInfoFour(@Param("ids") List<Long> ids,
@Param("state") Integer state, @Param("accountId") Long accountId, @Param("siteId") Long siteId);
@Select("select count(*) from tr_exam_answer where exam_id= #{examId} and account_id = #{accountId}") @Select("select count(*) from tr_exam_answer where exam_id= #{examId} and account_id = #{accountId}")
Integer submitCount(@Param("examId") Long examId, @Param("accountId") Long accountId); Integer submitCount(@Param("examId") Long examId, @Param("accountId") Long accountId);
Integer selectTotalInfo(@Param("ids") List<Long> ids, @Param("state") Integer state, @Param("accountId") Long accountId, @Param("siteId") Long siteId); Integer selectTotalInfo(@Param("ids") List<Long> ids, @Param("state") Integer state, @Param("accountId") Long accountId, @Param("siteId") Long siteId);
Integer selectTotalInfo1(@Param("ids") List<Long> ids, @Param("state") Integer state, @Param("accountId") Long accountId, @Param("siteId") Long siteId);
List<MyExamVO> selectMyExamnation(@Param("start") Integer start, @Param("end") Integer end, @Param("accountId") Long accountId); List<MyExamVO> selectMyExamnation(@Param("start") Integer start, @Param("end") Integer end, @Param("accountId") Long accountId);
......
...@@ -146,6 +146,15 @@ public interface IExamService extends IService<Exam> { ...@@ -146,6 +146,15 @@ public interface IExamService extends IService<Exam> {
*/ */
List<MyExamVO> MyExam(MyExamParameterVO myExamParameterVO); List<MyExamVO> MyExam(MyExamParameterVO myExamParameterVO);
List<MyExamVO> MyExam1(MyExamParameterVO myExamParameterVO);
/**
* 获取4天内创建的所有考试信息(不用分页)
* @param myExamParameterVO
* @return
*/
List<MyExamVO> MyExamFour(MyExamParameterVO myExamParameterVO);
/** /**
* 得到exam * 得到exam
* @param examId * @param examId
...@@ -170,6 +179,7 @@ public interface IExamService extends IService<Exam> { ...@@ -170,6 +179,7 @@ public interface IExamService extends IService<Exam> {
ExamDetailsVO examDetail(Long examId,Long accountId); ExamDetailsVO examDetail(Long examId,Long accountId);
Integer selectTotal(MyExamParameterVO myExamParameterVO); Integer selectTotal(MyExamParameterVO myExamParameterVO);
Integer selectTotal1(MyExamParameterVO myExamParameterVO);
List<MyExamVO> selectMyExamnation(Integer pageNo, Integer pageSize,Long accountId); List<MyExamVO> selectMyExamnation(Integer pageNo, Integer pageSize,Long accountId);
......
...@@ -168,6 +168,60 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, com.yizhi.applicati ...@@ -168,6 +168,60 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, com.yizhi.applicati
return list; return list;
} }
@Override
public List<MyExamVO> MyExam1(MyExamParameterVO myExamParameterVO) {
Integer strat = (myExamParameterVO.getPageNo() - 1) * myExamParameterVO.getPageSize();
Integer end = myExamParameterVO.getPageSize();
List<Long> examIds = getMyVisableExam(myExamParameterVO.getIds(), myExamParameterVO.getSiteId());
if (!CollectionUtils.isEmpty(examIds)) {
myExamParameterVO.setIds(examIds);
}
//获取所有考试信息
//查询
Long siteId = myExamParameterVO.getSiteId();
Long accountId = myExamParameterVO.getAccountId();
List<MyExamVO> list = examMapper.selectMyExamInfo1(strat, end, examIds, myExamParameterVO.getState(), accountId, siteId);
if (myExamParameterVO.getState() != null && myExamParameterVO.getState() == 1) {
for (MyExamVO myExamVO : list) {
List<ExamOnlineReadOverVo> examOnlineReadOverVos = trExamOnlineReadOverMapper.selectStateList(myExamVO.getId(), myExamParameterVO.getAccountId());
if (examOnlineReadOverVos.size() > 0) {
for (ExamOnlineReadOverVo examOnlineReadOverVo : examOnlineReadOverVos) {
if (examOnlineReadOverVo.getState() == 1) {
myExamVO.setIsQualified(2 + "");
}
}
}
}
}
return list;
}
@Override
public List<MyExamVO> MyExamFour(MyExamParameterVO myExamParameterVO) {
List<Long> examIds = getMyVisableExam(myExamParameterVO.getIds(), myExamParameterVO.getSiteId());
if (!CollectionUtils.isEmpty(examIds)) {
myExamParameterVO.setIds(examIds);
}
//获取所有考试信息
//查询
Long siteId = myExamParameterVO.getSiteId();
Long accountId = myExamParameterVO.getAccountId();
List<MyExamVO> list = examMapper.selectMyExamInfoFour(examIds, myExamParameterVO.getState(), accountId, siteId);
if (myExamParameterVO.getState() != null && myExamParameterVO.getState() == 1) {
for (MyExamVO myExamVO : list) {
List<ExamOnlineReadOverVo> examOnlineReadOverVos = trExamOnlineReadOverMapper.selectStateList(myExamVO.getId(), myExamParameterVO.getAccountId());
if (examOnlineReadOverVos.size() > 0) {
for (ExamOnlineReadOverVo examOnlineReadOverVo : examOnlineReadOverVos) {
if (examOnlineReadOverVo.getState() == 1) {
myExamVO.setIsQualified(2 + "");
}
}
}
}
}
return list;
}
/** /**
* 考试策略 更新 保存, 预览 * 考试策略 更新 保存, 预览
*/ */
...@@ -1154,6 +1208,10 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, com.yizhi.applicati ...@@ -1154,6 +1208,10 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, com.yizhi.applicati
public Integer selectTotal(MyExamParameterVO myExamParameterVO) { public Integer selectTotal(MyExamParameterVO myExamParameterVO) {
return examMapper.selectTotalInfo(myExamParameterVO.getIds(), myExamParameterVO.getState(), myExamParameterVO.getAccountId(), myExamParameterVO.getSiteId()); return examMapper.selectTotalInfo(myExamParameterVO.getIds(), myExamParameterVO.getState(), myExamParameterVO.getAccountId(), myExamParameterVO.getSiteId());
} }
@Override
public Integer selectTotal1(MyExamParameterVO myExamParameterVO) {
return examMapper.selectTotalInfo1(myExamParameterVO.getIds(), myExamParameterVO.getState(), myExamParameterVO.getAccountId(), myExamParameterVO.getSiteId());
}
@Override @Override
public List<MyExamVO> selectMyExamnation(Integer pageNo, Integer pageSize, Long accountId) { public List<MyExamVO> selectMyExamnation(Integer pageNo, Integer pageSize, Long accountId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment