Bläddra i källkod

修改问题类型,任务的校验

tags/v1.1.0
qiujinyang 2 år sedan
förälder
incheckning
a06f4c333d
9 ändrade filer med 25 tillägg och 15 borttagningar
  1. +5
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/MissionController.java
  2. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Question.java
  3. +3
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/CallbackRequest.java
  4. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/QuestionQuery.java
  5. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/QuestionStatusRequest.java
  6. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/QuestionTypeQuery.java
  7. +9
    -7
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java
  8. +3
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java
  9. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java

+ 5
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/MissionController.java Visa fil

@@ -74,8 +74,12 @@ public class MissionController {
throw new ServiceException(HttpStatus.SC_BAD_REQUEST,"同一个航线已存在相同的巡检时间!");
}

if(request.getExecutionStartTime().getTime() < new Date().getTime()){
throw new ServiceException(HttpStatus.SC_BAD_REQUEST,"无法输入该时间!");
}

if(request.getName().length()>100){
throw new ServiceException(HttpStatus.SC_BAD_REQUEST,"任务名称长度不能超过100");
throw new ServiceException(HttpStatus.SC_BAD_REQUEST,"任务名称长度不能超过100个字");
}

if(StringUtils.isNotEmpty(request.getNote()) && request.getNote().length()>200){

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Question.java Visa fil

@@ -51,7 +51,7 @@ public class Question extends BaseEntity implements Serializable {
/**
* 问题类型:病死树、林斑
*/
private Integer type;
private String type;

/**
* 问题类型名称

+ 3
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/CallbackRequest.java Visa fil

@@ -89,6 +89,9 @@ public class CallbackRequest implements Serializable {
@ApiModelProperty(value = "分析时间")
private Date analyseTime;

@ApiModelProperty(value = "问题类型")
private String code;

@ApiModelProperty(value = "问题名称")
private String questionName;
@ApiModelProperty(value = "问题描述")

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/QuestionQuery.java Visa fil

@@ -27,7 +27,7 @@ public class QuestionQuery extends BaseQuery implements Serializable {
private Integer status;

@ApiModelProperty(value = "项目类型:病虫树、林斑、人员活动、火灾隐患")
private Integer type;
private String type;

@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/QuestionStatusRequest.java Visa fil

@@ -23,7 +23,7 @@ public class QuestionStatusRequest implements Serializable {
private Integer[] id;

@ApiModelProperty(value = "问题类型")
private Integer type;
private String type;

@ApiModelProperty(value = "问题状态:1:确认,2:忽略,3:未确认")
@NotNull(message = "问题状态不能为空!")

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/QuestionTypeQuery.java Visa fil

@@ -23,7 +23,7 @@ public class QuestionTypeQuery extends BaseQuery implements Serializable {
/**
* 项目类型:病虫树、林斑、人员活动、火灾隐患
*/
private Integer type;
private String type;

/**
* 巡检内容

+ 9
- 7
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java Visa fil

@@ -275,17 +275,19 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi

private void queryParam(MissionQuery queryInspectionRequest, LambdaQueryWrapper<ThMission> queryInspection) {
//编号
queryInspection.like(!StringUtils.isEmpty(queryInspectionRequest.getCode()),ThMission::getCode, queryInspectionRequest.getCode());
queryInspection.like(StringUtils.isNotEmpty(queryInspectionRequest.getCode()),ThMission::getCode, queryInspectionRequest.getCode());
//任务名称
queryInspection.like(!StringUtils.isEmpty(queryInspectionRequest.getName()),ThMission::getName, queryInspectionRequest.getName());
queryInspection.like(StringUtils.isNotEmpty(queryInspectionRequest.getName()),ThMission::getName, queryInspectionRequest.getName());
//任务类型
queryInspection.like(ObjectUtil.isNotEmpty(queryInspectionRequest.getType()),ThMission::getType, queryInspectionRequest.getType());
//任务状态
queryInspection.eq(!ObjectUtil.isEmpty(queryInspectionRequest.getStatus()),ThMission::getStatus, queryInspectionRequest.getStatus());
queryInspection.eq(ObjectUtil.isNotEmpty(queryInspectionRequest.getStatus()),ThMission::getStatus, queryInspectionRequest.getStatus());
//巡检机场
queryInspection.eq(!ObjectUtil.isEmpty(queryInspectionRequest.getAirportId()),ThMission::getAirportId, queryInspectionRequest.getAirportId());
queryInspection.eq(ObjectUtil.isNotEmpty(queryInspectionRequest.getAirportId()),ThMission::getAirportId, queryInspectionRequest.getAirportId());
//巡检线路
queryInspection.eq(!ObjectUtil.isEmpty(queryInspectionRequest.getInspectionLine()),ThMission::getInspectionLine, queryInspectionRequest.getInspectionLine());
//任务类型
queryInspection.eq(!ObjectUtil.isEmpty(queryInspectionRequest.getInspectionType()),ThMission::getInspectionType, queryInspectionRequest.getInspectionType());
queryInspection.eq(ObjectUtil.isNotEmpty(queryInspectionRequest.getInspectionLine()),ThMission::getInspectionLine, queryInspectionRequest.getInspectionLine());
//巡检类型
//queryInspection.eq(ObjectUtil.isNotEmpty(queryInspectionRequest.getInspectionType()),ThMission::getInspectionType, queryInspectionRequest.getInspectionType());
}

@Override

+ 3
- 2
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java Visa fil

@@ -270,7 +270,8 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio
//待确认
question.setStatus(QuestionStatusEnum.NOTREVIEWED.getCode());
//问题类型
question.setType(QuestionTypeEnum.getByDesc(questionFile.getQuestionName()).getCode());
question.setType(questionFile.getCode());
question.setQuestionName(questionFile.getQuestionName());
BeanUtils.copyProperties(questionFile,question);
questionList.add(question);
}
@@ -281,7 +282,7 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio
LambdaQueryWrapper<ThMission> lambdaQueryWrapper=new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ThMission::getMark,MarkTypeEnum.VALID.getCode())
.eq(ThMission::getRequestId, requestId)
.eq(ThMission::getStatus,TaskStatusEnum.FLIGHT.getCode()).orderByDesc(ThMission::getCreateTime);
.eq(ThMission::getStatus,TaskStatusEnum.FLIGHT.getCode()).orderByDesc(ThMission::getExecutionStartTime);
List<ThMission> thMissions = missionMapper.selectList(lambdaQueryWrapper);
if(ObjectUtil.isEmpty(thMissions) || thMissions.size()==0){
throw new ServiceException(HttpStatus.BAD_REQUEST.value(),"正在执行的任务不存在!");

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java Visa fil

@@ -87,7 +87,7 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper,
List<ThMission> thMissions = missionMapper.selectList(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getInspectionLine, inspectionRequest.getInspectionId())
.eq(ThMission::getStatus, TaskStatusEnum.FLIGHT.getCode())
.eq(ThMission::getMark, MarkTypeEnum.VALID.getCode()).orderByDesc(ThMission::getExecutionStartTime));
.eq(ThMission::getMark, MarkTypeEnum.VALID.getCode()).orderByAsc(ThMission::getExecutionStartTime));
if(ObjectUtil.isEmpty(thMissions) || thMissions.size()==0){
throw new ServiceException(HttpStatus.BAD_REQUEST.value(),"没有正在飞行的任务!");
}

Laddar…
Avbryt
Spara