Browse Source

修改问题分布接口

tags/v1.1.0
wanghaoran 2 years ago
parent
commit
c7c8d96478
3 changed files with 12 additions and 4 deletions
  1. +0
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/QuestionController.java
  2. +3
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/QuestionQuery.java
  3. +9
    -3
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java

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

@@ -46,7 +46,6 @@ public class QuestionController {
/**
* 被DSP调用,存问题
*
* @param entity 实体对象
* @return
*/
@PostMapping("/{requestId}/callback")

+ 3
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/QuestionQuery.java View File

@@ -42,4 +42,7 @@ public class QuestionQuery extends BaseQuery implements Serializable {
@ApiModelProperty(value = "任务名称")
private String name;

@ApiModelProperty(value = "任务名称")
private String missionName;

}

+ 9
- 3
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java View File

@@ -105,18 +105,24 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio
}
try {
LambdaQueryWrapper<Question> questionLambdaQueryWrapper = new LambdaQueryWrapper<Question>()
//只需要取最上面的那一条
.eq(Question::getMissionId, thMissions.get(0).getId())
.like(ObjectUtil.isNotEmpty(query.getName()), Question::getMissionName, query.getName())
.eq(ObjectUtil.isNotEmpty(query.getType()), Question::getType, query.getType())
.eq(Question::getStatus, QuestionStatusEnum.CONFIRM.getCode())
//.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()));
}

if((ObjectUtil.isNotEmpty(query.getStartTime()) && ObjectUtil.isNotEmpty(query.getEndTime()))
|| StringUtils.isNotEmpty(query.getMissionName())){
questionLambdaQueryWrapper.like(Question::getMissionName, query.getMissionName());
}else {
//只需要取最上面的那一条
questionLambdaQueryWrapper.eq(Question::getMissionId, thMissions.get(0).getId());
}
return questionMapper.selectList(questionLambdaQueryWrapper);
}catch (Exception e){
e.printStackTrace();

Loading…
Cancel
Save