Browse Source

问题分布的问题

tags/v1.1.0
qiujinyang 2 years ago
parent
commit
2e841f3c5a
2 changed files with 4 additions and 8 deletions
  1. +0
    -8
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/QuestionController.java
  2. +4
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java

+ 0
- 8
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/QuestionController.java View File

@@ -39,10 +39,6 @@ public class QuestionController {
*/
@GetMapping("/page")
public JsonResult<IPage<Question>> page(QuestionQuery questionQuery) {
if(ObjectUtil.isNotEmpty(questionQuery.getStartTime()) && ObjectUtil.isNotEmpty(questionQuery.getEndTime())){
questionQuery.setStartTime(questionQuery.getStartTime()+" 00:00:00");
questionQuery.setEndTime(questionQuery.getEndTime()+" 59:59:59");
}
return JsonResult.success(questionService.queryPage(questionQuery));
}

@@ -110,10 +106,6 @@ public class QuestionController {
*/
@GetMapping("/distributed")
public JsonResult distributed(QuestionQuery questionQuery) {
if(ObjectUtil.isNotEmpty(questionQuery.getStartTime()) && ObjectUtil.isNotEmpty(questionQuery.getEndTime())){
questionQuery.setStartTime(questionQuery.getStartTime()+" 00:00:00");
questionQuery.setEndTime(questionQuery.getEndTime()+" 23:59:59");
}
return JsonResult.success(questionService.distributed(questionQuery));
}


+ 4
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java View File

@@ -75,6 +75,8 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio
//.eq(Question::getTenantId, ShiroUtils.getTenantId())
.eq(Question::getMark, MarkTypeEnum.VALID.getCode()).orderByDesc(Question::getCreateTime);
if(ObjectUtil.isNotEmpty(query.getStartTime()) && ObjectUtil.isNotEmpty(query.getEndTime())){
query.setStartTime(query.getStartTime()+" 00:00:00");
query.setEndTime(query.getEndTime()+" 59:59:59");
questionLambdaQueryWrapper.between(Question::getCreateTime, dateformat.parse(query.getStartTime()), dateformat.parse(query.getEndTime()));
}
pageData = questionMapper.selectPage(page, questionLambdaQueryWrapper);
@@ -109,6 +111,8 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio
//.eq(Question::getTenantId, ShiroUtils.getTenantId())
.eq(Question::getMark, MarkTypeEnum.VALID.getCode()).orderByDesc(Question::getCreateTime);
if(ObjectUtil.isNotEmpty(query.getStartTime()) && ObjectUtil.isNotEmpty(query.getEndTime())){
query.setStartTime(query.getStartTime()+" 00:00:00");
query.setEndTime(query.getEndTime()+" 23:59:59");
questionLambdaQueryWrapper.between(Question::getCreateTime, dateformat.parse(query.getStartTime()), dateformat.parse(query.getEndTime()));
}
return questionMapper.selectList(questionLambdaQueryWrapper);

Loading…
Cancel
Save