mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-12 04:16:51 +08:00
Merge branch 'master' of codeup.aliyun.com:6265f483e4166464dc2f9c14/boeu/baseservers
This commit is contained in:
@@ -12,6 +12,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.lucene.queryparser.classic.QueryParser;
|
||||||
import org.elasticsearch.action.DocWriteResponse;
|
import org.elasticsearch.action.DocWriteResponse;
|
||||||
import org.elasticsearch.action.delete.DeleteRequest;
|
import org.elasticsearch.action.delete.DeleteRequest;
|
||||||
import org.elasticsearch.action.delete.DeleteResponse;
|
import org.elasticsearch.action.delete.DeleteResponse;
|
||||||
@@ -338,11 +339,15 @@ public class CourseElasticsearchImpl implements ICourseFullTextSearch{
|
|||||||
|
|
||||||
if(StringUtils.isNotBlank(params.getKeywords())) {
|
if(StringUtils.isNotBlank(params.getKeywords())) {
|
||||||
|
|
||||||
//boolQuery.must(QueryBuilders.queryStringQuery(params.getKeywords()).field("name", 8f));
|
String words=QueryParser.escape(params.getKeywords());
|
||||||
|
|
||||||
|
// System.out.println(params.getKeywords());
|
||||||
|
// System.out.println(words);
|
||||||
|
|
||||||
BoolQueryBuilder keywordQuery = QueryBuilders.boolQuery();
|
BoolQueryBuilder keywordQuery = QueryBuilders.boolQuery();
|
||||||
keywordQuery.should(QueryBuilders.wildcardQuery("name", "*"+params.getKeywords()+"*").boost(9f));
|
keywordQuery.should(QueryBuilders.wildcardQuery("name", "*"+words+"*").boost(9f));
|
||||||
keywordQuery.should(QueryBuilders.queryStringQuery(params.getKeywords()).field("teacher", 8f));
|
//keywordQuery.should(QueryBuilders.queryStringQuery(words).field("name", 9f));//用此方法无法查询出有转义符的处理
|
||||||
|
keywordQuery.should(QueryBuilders.queryStringQuery(words).field("teacher", 8f));
|
||||||
keywordQuery.minimumShouldMatch(1);
|
keywordQuery.minimumShouldMatch(1);
|
||||||
boolQuery.must(keywordQuery);
|
boolQuery.must(keywordQuery);
|
||||||
//boolQuery.must(QueryBuilders.wildcardQuery("name", "*"+params.getKeywords()+"*").boost(9f));
|
//boolQuery.must(QueryBuilders.wildcardQuery("name", "*"+params.getKeywords()+"*").boost(9f));
|
||||||
@@ -438,7 +443,7 @@ public class CourseElasticsearchImpl implements ICourseFullTextSearch{
|
|||||||
HighlightBuilder highlightBuilder = new HighlightBuilder();
|
HighlightBuilder highlightBuilder = new HighlightBuilder();
|
||||||
|
|
||||||
highlightBuilder.requireFieldMatch(true);//是否多个字段都高亮
|
highlightBuilder.requireFieldMatch(true);//是否多个字段都高亮
|
||||||
highlightBuilder.preTags("<span style='color:red'>");//前缀后缀
|
highlightBuilder.preTags("<span style='color:#3e7fff'>");//前缀后缀
|
||||||
highlightBuilder.postTags("</span>");
|
highlightBuilder.postTags("</span>");
|
||||||
|
|
||||||
HighlightBuilder.Field nameHighlight=new HighlightBuilder.Field("name");
|
HighlightBuilder.Field nameHighlight=new HighlightBuilder.Field("name");
|
||||||
@@ -477,41 +482,42 @@ public class CourseElasticsearchImpl implements ICourseFullTextSearch{
|
|||||||
try {
|
try {
|
||||||
CourseFullText cft =mapper.readValue(sourceAsString, CourseFullText.class);
|
CourseFullText cft =mapper.readValue(sourceAsString, CourseFullText.class);
|
||||||
cft.setEsId(hit.getId());
|
cft.setEsId(hit.getId());
|
||||||
if(name!= null){
|
//以下不再加高亮显,高亮显在页面中去实现
|
||||||
Text[] fragments = name.fragments();
|
// if(name!= null){
|
||||||
StringBuffer fmtStr = new StringBuffer("");
|
// Text[] fragments = name.fragments();
|
||||||
for (Text fragment : fragments) {
|
// StringBuffer fmtStr = new StringBuffer("");
|
||||||
fmtStr.append(fragment);
|
// for (Text fragment : fragments) {
|
||||||
}
|
// fmtStr.append(fragment);
|
||||||
cft.setName(fmtStr.toString());
|
// }
|
||||||
}
|
// cft.setName(fmtStr.toString());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if(summary!= null){
|
||||||
|
// Text[] fragments = summary.fragments();
|
||||||
|
// StringBuffer fmtStr = new StringBuffer("");
|
||||||
|
// for (Text fragment : fragments) {
|
||||||
|
// fmtStr.append(fragment);
|
||||||
|
// }
|
||||||
|
// cft.setSummary(fmtStr.toString());
|
||||||
|
// }
|
||||||
|
//去掉老师的高亮显
|
||||||
|
// if(teacher!= null){
|
||||||
|
// Text[] fragments = teacher.fragments();
|
||||||
|
// StringBuffer fmtStr = new StringBuffer("");
|
||||||
|
// for (Text fragment : fragments) {
|
||||||
|
// fmtStr.append(fragment);
|
||||||
|
// }
|
||||||
|
// cft.setTeacher(fmtStr.toString());
|
||||||
|
// }
|
||||||
|
|
||||||
if(summary!= null){
|
// if(keywords!= null){
|
||||||
Text[] fragments = summary.fragments();
|
// Text[] fragments = keywords.fragments();
|
||||||
StringBuffer fmtStr = new StringBuffer("");
|
// StringBuffer fmtStr = new StringBuffer("");
|
||||||
for (Text fragment : fragments) {
|
// for (Text fragment : fragments) {
|
||||||
fmtStr.append(fragment);
|
// fmtStr.append(fragment);
|
||||||
}
|
// }
|
||||||
cft.setSummary(fmtStr.toString());
|
// cft.setKeywords(fmtStr.toString());
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(teacher!= null){
|
|
||||||
Text[] fragments = teacher.fragments();
|
|
||||||
StringBuffer fmtStr = new StringBuffer("");
|
|
||||||
for (Text fragment : fragments) {
|
|
||||||
fmtStr.append(fragment);
|
|
||||||
}
|
|
||||||
cft.setTeacher(fmtStr.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(keywords!= null){
|
|
||||||
Text[] fragments = keywords.fragments();
|
|
||||||
StringBuffer fmtStr = new StringBuffer("");
|
|
||||||
for (Text fragment : fragments) {
|
|
||||||
fmtStr.append(fragment);
|
|
||||||
}
|
|
||||||
cft.setKeywords(fmtStr.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
list.add(cft);
|
list.add(cft);
|
||||||
}catch(Exception ee) {
|
}catch(Exception ee) {
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class CourseContentDto {
|
public class CourseContentDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型,10无目录课程,20有目录课程
|
||||||
|
*/
|
||||||
|
private Integer type;//
|
||||||
|
|
||||||
private CourseContent content;
|
private CourseContent content;
|
||||||
|
|
||||||
private CourseHomeWork homework;
|
private CourseHomeWork homework;
|
||||||
|
|||||||
@@ -52,13 +52,19 @@ public class CourseContentServiceImpl implements ICourseContentService {
|
|||||||
CourseExam exam=dto.getExam();
|
CourseExam exam=dto.getExam();
|
||||||
CourseHomeWork homework=dto.getHomework();
|
CourseHomeWork homework=dto.getHomework();
|
||||||
|
|
||||||
|
|
||||||
if(StringUtils.isBlank(cc.getId())) {
|
if(StringUtils.isBlank(cc.getId())) {
|
||||||
//新增的情况
|
//新增的情况
|
||||||
cc.setDeleted(false);
|
cc.setDeleted(false);
|
||||||
if(cc.getDuration()==null) {
|
if(cc.getDuration()==null) {
|
||||||
cc.setDuration(0);
|
cc.setDuration(0);
|
||||||
}
|
}
|
||||||
|
//如果是没有目录的,并具是课程内容
|
||||||
|
if(dto.getType()!=null && dto.getType()==10) {
|
||||||
|
if(cc.getSortIndex()==1) {
|
||||||
|
//先删除之前其它的
|
||||||
|
ccDao.deleteByField("courseId",cc.getCourseId());
|
||||||
|
}
|
||||||
|
}
|
||||||
ccDao.save(cc);
|
ccDao.save(cc);
|
||||||
}else {
|
}else {
|
||||||
ccDao.update(cc);
|
ccDao.update(cc);
|
||||||
@@ -113,6 +119,7 @@ public class CourseContentServiceImpl implements ICourseContentService {
|
|||||||
List<CourseContent> list=ccDao.findList(OrderCondition.asc("sortIndex"),
|
List<CourseContent> list=ccDao.findList(OrderCondition.asc("sortIndex"),
|
||||||
FieldFilters.eq("courseId", courseId),
|
FieldFilters.eq("courseId", courseId),
|
||||||
FieldFilters.eq("deleted", false));
|
FieldFilters.eq("deleted", false));
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -695,8 +695,6 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
hrbpAudit.setForward(CourseHRBPAudit.FORWARD_NONE);
|
hrbpAudit.setForward(CourseHRBPAudit.FORWARD_NONE);
|
||||||
hrbpAudit.setStatus(CourseHRBPAudit.STATUS_NONE);
|
hrbpAudit.setStatus(CourseHRBPAudit.STATUS_NONE);
|
||||||
courseHRBPAuditDao.save(hrbpAudit);
|
courseHRBPAuditDao.save(hrbpAudit);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.xboe.module.exam.api;
|
||||||
|
|
||||||
|
import com.xboe.common.PageList;
|
||||||
|
import com.xboe.common.Pagination;
|
||||||
|
import com.xboe.common.utils.StringUtil;
|
||||||
|
import com.xboe.core.JsonResponse;
|
||||||
|
import com.xboe.core.api.ApiBaseController;
|
||||||
|
import com.xboe.module.exam.entity.AloneExam;
|
||||||
|
import com.xboe.module.exam.entity.AloneExamAnswer;
|
||||||
|
import com.xboe.module.exam.service.IAloneExamService;
|
||||||
|
import com.xboe.module.exam.vo.AloneExamQuery;
|
||||||
|
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 javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对于与第三方对接的扩展接口
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/xboe/m/exam/alone-extend")
|
||||||
|
public class AloneExamExtendApi extends ApiBaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
IAloneExamService aloneExamService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加考试任务,针对单个用户
|
||||||
|
* */
|
||||||
|
@PostMapping("/save")
|
||||||
|
public JsonResponse<AloneExam> save(@RequestBody AloneExam aloneExam){
|
||||||
|
if(StringUtil.isNotBlank(aloneExam.getAid())){
|
||||||
|
return badRequest("缺少用户参数");
|
||||||
|
}
|
||||||
|
if(StringUtil.isNotBlank(aloneExam.getTestId())){
|
||||||
|
return badRequest("缺少考试信息");
|
||||||
|
}
|
||||||
|
if(StringUtil.isNotBlank(aloneExam.getRefId())){
|
||||||
|
return badRequest("缺少关联信息");
|
||||||
|
}
|
||||||
|
if(StringUtil.isNotBlank(aloneExam.getRefType())){
|
||||||
|
return badRequest("缺少关联类型");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
aloneExamService.save(aloneExam);
|
||||||
|
return success(aloneExam);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return error("保存考试任务失败",e.getMessage());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据考试id,refType,refId查询考试任务
|
||||||
|
* */
|
||||||
|
@PostMapping("/pagelist")
|
||||||
|
public JsonResponse<PageList<AloneExam>> pagelist(Pagination pager, AloneExamQuery aloneExamQuery){
|
||||||
|
try {
|
||||||
|
PageList<AloneExam> page = aloneExamService.findPage(pager.getPageIndex(), pager.getPageSize(), aloneExamQuery);
|
||||||
|
return success(page);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return error("查询考试任务失败",e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据考试id,refType,refId 用户id 查询用户答卷信息
|
||||||
|
* */
|
||||||
|
@PostMapping("/anser-page")
|
||||||
|
public JsonResponse<PageList<AloneExamAnswer>> answerpage(Pagination pager,AloneExamQuery aloneExamQuery){
|
||||||
|
try {
|
||||||
|
PageList<AloneExamAnswer> pageList = aloneExamService.answerPage(pager.getPageIndex(), pager.getPageSize(), aloneExamQuery);
|
||||||
|
return success(pageList);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return error("查询用户答卷失败",e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -156,4 +156,21 @@ public class AloneExam extends IdBaseEntity {
|
|||||||
this.endTime=endTime;
|
this.endTime=endTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AloneExam(String id,String aid,String testId,String testName,Integer testDuration,Integer times,Float score,Integer status,LocalDateTime taskTime,LocalDateTime startTime,LocalDateTime endTime,String refId,String refType) {
|
||||||
|
this.setId(id);
|
||||||
|
this.setAid(aid);
|
||||||
|
this.testId=testId;
|
||||||
|
this.testName=testName;
|
||||||
|
this.testDuration=testDuration;
|
||||||
|
this.times=times;
|
||||||
|
this.score=score;
|
||||||
|
this.status=status;
|
||||||
|
this.taskTime=taskTime;
|
||||||
|
this.startTime=startTime;
|
||||||
|
this.endTime=endTime;
|
||||||
|
this.refId=refId;
|
||||||
|
this.refType=refType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.xboe.common.OrderCondition;
|
|||||||
import com.xboe.common.PageList;
|
import com.xboe.common.PageList;
|
||||||
import com.xboe.module.exam.entity.AloneExam;
|
import com.xboe.module.exam.entity.AloneExam;
|
||||||
import com.xboe.module.exam.entity.AloneExamAnswer;
|
import com.xboe.module.exam.entity.AloneExamAnswer;
|
||||||
|
import com.xboe.module.exam.vo.AloneExamQuery;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 独立考试的处理。此信息无删除操作,更新也只是更新answerJson字段
|
* 独立考试的处理。此信息无删除操作,更新也只是更新answerJson字段
|
||||||
@@ -22,6 +23,34 @@ public interface IAloneExamService {
|
|||||||
*/
|
*/
|
||||||
PageList<AloneExam> findPage(int pageIndex,int pageSize,AloneExam aea,OrderCondition oc);
|
PageList<AloneExam> findPage(int pageIndex,int pageSize,AloneExam aea,OrderCondition oc);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于第三方对接
|
||||||
|
* 查询个人的考试任务 根据考试id,refId,refType 查询
|
||||||
|
* @param pageIndex
|
||||||
|
* @param pageSize
|
||||||
|
* @param testId
|
||||||
|
* @param refId
|
||||||
|
* @param refType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageList<AloneExam> findPage(int pageIndex, int pageSize, AloneExamQuery examQuery);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于第三方对接
|
||||||
|
* 查询用户的答卷
|
||||||
|
* @param pageIndex
|
||||||
|
* @param pageSize
|
||||||
|
* @param testId
|
||||||
|
* @param refId
|
||||||
|
* @param refType
|
||||||
|
* @param aid
|
||||||
|
* */
|
||||||
|
PageList<AloneExamAnswer> answerPage(int pageIndex,int pageSize,AloneExamQuery aloneExamQuery);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取独立考试的信息,检查是否有独立考试
|
* 获取独立考试的信息,检查是否有独立考试
|
||||||
* @param aid
|
* @param aid
|
||||||
@@ -99,4 +128,9 @@ public interface IAloneExamService {
|
|||||||
|
|
||||||
List<AloneExamAnswer> findList(String testId);
|
List<AloneExamAnswer> findList(String testId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存考试任务
|
||||||
|
* */
|
||||||
|
void save(AloneExam aloneExam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import com.xboe.common.utils.StringUtil;
|
||||||
|
import com.xboe.module.exam.vo.AloneExamQuery;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -153,6 +155,11 @@ public class AloneExamServiceImpl implements IAloneExamService{
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void save(AloneExam aloneExam) {
|
||||||
|
aeDao.save(aloneExam);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AloneExamAnswer get(String id) {
|
public AloneExamAnswer get(String id) {
|
||||||
return dao.get(id);
|
return dao.get(id);
|
||||||
@@ -213,6 +220,78 @@ public class AloneExamServiceImpl implements IAloneExamService{
|
|||||||
return aeDao.findPage(query.builder());
|
return aeDao.findPage(query.builder());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageList<AloneExam> findPage(int pageIndex, int pageSize, AloneExamQuery examQuery) {
|
||||||
|
QueryBuilder builder = QueryBuilder.from(AloneExam.class.getSimpleName()+" a,"+ExamTest.class.getSimpleName()+" t");
|
||||||
|
builder.addField("new AloneExam(a.id,a.aid,a.testId,a.testName,a.testDuration,a.times,a.score,a.status,a.taskTime,t.entranceTime,t.deadlineTime,a.refId,a.refType)");
|
||||||
|
builder.setPageIndex(pageIndex);
|
||||||
|
builder.setPageSize(pageSize);
|
||||||
|
builder.addFilter(FieldFilters.eqField("a.testId","t.id"));
|
||||||
|
if(examQuery!=null){
|
||||||
|
OrderCondition order=null;
|
||||||
|
if(StringUtils.isNotBlank(examQuery.getOrderField())) {
|
||||||
|
if(examQuery.getOrderAsc()==null|| examQuery.getOrderAsc()) {
|
||||||
|
|
||||||
|
order=OrderCondition.asc(examQuery.getOrderField());
|
||||||
|
}else {
|
||||||
|
order=OrderCondition.desc(examQuery.getOrderField());
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
order=OrderCondition.desc("a.sysCreateTime");
|
||||||
|
}
|
||||||
|
if(StringUtil.isNotBlank(examQuery.getTestId())){
|
||||||
|
builder.addFilter(FieldFilters.eq("a.testId",examQuery.getTestId()));
|
||||||
|
}
|
||||||
|
if(StringUtil.isNotBlank(examQuery.getRefId())){
|
||||||
|
builder.addFilter(FieldFilters.eq("a.refId",examQuery.getRefId()));
|
||||||
|
}
|
||||||
|
if(StringUtil.isNotBlank(examQuery.getRefType())){
|
||||||
|
builder.addFilter(FieldFilters.eq("a.refType",examQuery.getRefType()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
PageList<AloneExam> page = aeDao.findPage(builder.builder());
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageList<AloneExamAnswer> answerPage(int pageIndex, int pageSize, AloneExamQuery aloneExamQuery) {
|
||||||
|
QueryBuilder builder=QueryBuilder.from(AloneExam.class.getSimpleName()+" a,"+AloneExamAnswer.class.getSimpleName()+" aa");
|
||||||
|
builder.addField("new AloneExamAnswer(aa.id,aa.aid,aa.name,aa.testId,aa.testName,aa.arrange,aa.passLine,aa.status,aa.startTime,aa.endTime,aa.lastTime,aa.clientIp,aa.ucode,aa.score,aa.totalScore,aa.realScore,aa.useSecond)");
|
||||||
|
builder.setPageIndex(pageIndex);
|
||||||
|
builder.setPageSize(pageSize);
|
||||||
|
builder.addFilter(FieldFilters.eqField("a.id","aa.aloneId"));
|
||||||
|
if(aloneExamQuery!=null){
|
||||||
|
OrderCondition order=null;
|
||||||
|
if(StringUtil.isNotBlank(aloneExamQuery.getOrderField())){
|
||||||
|
if(aloneExamQuery.getOrderAsc()==null || aloneExamQuery.getOrderAsc()){
|
||||||
|
order=OrderCondition.asc(aloneExamQuery.getOrderField());
|
||||||
|
}else{
|
||||||
|
order=OrderCondition.desc(aloneExamQuery.getOrderField());
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
order=OrderCondition.desc("aa.sysCreateTime");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtil.isNotBlank(aloneExamQuery.getTestId())){
|
||||||
|
builder.addFilter(FieldFilters.eq("a.testId",aloneExamQuery.getTestId()));
|
||||||
|
}
|
||||||
|
if(StringUtil.isNotBlank(aloneExamQuery.getRefId())){
|
||||||
|
builder.addFilter(FieldFilters.eq("a.refId",aloneExamQuery.getRefId()));
|
||||||
|
}
|
||||||
|
if(StringUtil.isNotBlank(aloneExamQuery.getRefType())){
|
||||||
|
builder.addFilter(FieldFilters.eq("a.refType",aloneExamQuery.getRefType()));
|
||||||
|
}
|
||||||
|
if(StringUtil.isNotBlank(aloneExamQuery.getAid())){
|
||||||
|
builder.addFilter(FieldFilters.eq("a.aid",aloneExamQuery.getAid()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PageList<AloneExamAnswer> page = dao.findPage(builder.builder());
|
||||||
|
|
||||||
|
return page;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AloneExam getAloneByAidAndTestId(String aid, String testId) {
|
public AloneExam getAloneByAidAndTestId(String aid, String testId) {
|
||||||
AloneExam ae=aeDao.findOne(FieldFilters.eq("aid", aid),FieldFilters.eq("testId", testId));
|
AloneExam ae=aeDao.findOne(FieldFilters.eq("aid", aid),FieldFilters.eq("testId", testId));
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.xboe.module.exam.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AloneExamQuery {
|
||||||
|
|
||||||
|
private String testId;
|
||||||
|
|
||||||
|
private String refId;
|
||||||
|
|
||||||
|
private String refType;
|
||||||
|
|
||||||
|
private String orderField;
|
||||||
|
|
||||||
|
private Boolean orderAsc;
|
||||||
|
|
||||||
|
private String aid;
|
||||||
|
}
|
||||||
@@ -117,6 +117,18 @@ public class Comments extends IdBaseEntity {
|
|||||||
@Column(name = "favorites")
|
@Column(name = "favorites")
|
||||||
private Integer favorites;
|
private Integer favorites;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面类型
|
||||||
|
* */
|
||||||
|
@Column(name = "page_type",length = 1)
|
||||||
|
private Integer pageType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*页面参数 默认是id
|
||||||
|
* */
|
||||||
|
@Column(name = "page_params",length = 50)
|
||||||
|
private String pageParams;
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 最后回答时间
|
// * 最后回答时间
|
||||||
// * */
|
// * */
|
||||||
|
|||||||
@@ -40,6 +40,18 @@ public class Favorites extends IdBaseEntity {
|
|||||||
@Column(name = "title", nullable = false,length=100)
|
@Column(name = "title", nullable = false,length=100)
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面类型
|
||||||
|
* */
|
||||||
|
@Column(name = "page_type",length = 1)
|
||||||
|
private Integer pageType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*页面参数 默认是id
|
||||||
|
* */
|
||||||
|
@Column(name = "page_params",length = 50)
|
||||||
|
private String pageParams;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于显示内容信息
|
* 用于显示内容信息
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -36,6 +36,19 @@ public class Shares extends IdBaseEntity {
|
|||||||
private String objId;
|
private String objId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面类型
|
||||||
|
* */
|
||||||
|
@Column(name = "page_type",length = 1)
|
||||||
|
private Integer pageType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*页面参数 默认是id
|
||||||
|
* */
|
||||||
|
@Column(name = "page_params",length = 50)
|
||||||
|
private String pageParams;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分享内容
|
* 分享内容
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ public class CommentsServiceImpl implements ICommentsService{
|
|||||||
public void reply(Comments c) {
|
public void reply(Comments c) {
|
||||||
c.setDeleted(false);
|
c.setDeleted(false);
|
||||||
c.setIsread(false);
|
c.setIsread(false);
|
||||||
|
c.setPraises(0);
|
||||||
|
c.setFavorites(0);
|
||||||
dao.save(c);
|
dao.save(c);
|
||||||
if(c.getParentRead()!=null && c.getParentRead()) {
|
if(c.getParentRead()!=null && c.getParentRead()) {
|
||||||
dao.updateMultiFieldById(c.getParentId(),
|
dao.updateMultiFieldById(c.getParentId(),
|
||||||
|
|||||||
@@ -44,6 +44,18 @@ public class Message extends IdEntity {
|
|||||||
@Column(name = "page_url",nullable = true,length=200)
|
@Column(name = "page_url",nullable = true,length=200)
|
||||||
private String pageUrl;
|
private String pageUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面类型
|
||||||
|
* */
|
||||||
|
@Column(name = "page_type",length = 1)
|
||||||
|
private Integer pageType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*页面参数 默认是id
|
||||||
|
* */
|
||||||
|
@Column(name = "page_params",length = 50)
|
||||||
|
private String pageParams;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据来源,1表新系统,2表外部系统
|
* 数据来源,1表新系统,2表外部系统
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -105,6 +105,9 @@ public class UserServiceImpl implements IUserService {
|
|||||||
if (user.getStudyTotal() == null) {
|
if (user.getStudyTotal() == null) {
|
||||||
user.setStudyTotal(0);//新用户学习时长为0
|
user.setStudyTotal(0);//新用户学习时长为0
|
||||||
}
|
}
|
||||||
|
if(user.getShowHome()==null) {
|
||||||
|
user.setShowHome(true);
|
||||||
|
}
|
||||||
dao.save(user);
|
dao.save(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user