Browse Source

工单问题详情 接口

tags/v1.1.0^2
wanghaoran 1 year ago
parent
commit
8fc46d24fc
5 changed files with 61 additions and 2 deletions
  1. +12
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/WorkOrderController.java
  2. +6
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/QuestionHandle.java
  3. +13
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/vo/QuestionDetailVO.java
  4. +2
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/IWorkOrderService.java
  5. +28
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/WorkOrderServiceImpl.java

+ 12
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/WorkOrderController.java View File

@@ -75,4 +75,16 @@ public class WorkOrderController {
return workOrderService.questionPage(request);
}


/**
* 工单问题详情
*
* @param
* @return
*/
@GetMapping("/question/detail")
public JsonResult questionDetail(@RequestParam("questionId") Integer questionId) {
return workOrderService.questionDetail(questionId);
}

}

+ 6
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/QuestionHandle.java View File

@@ -1,5 +1,6 @@
package com.tuoheng.admin.entity.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tuoheng.common.common.BaseEntity;
@@ -52,4 +53,9 @@ public class QuestionHandle extends BaseEntity implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date handlerTime;

/**
* 处理状态:0待处理 1已处理
*/
@TableField(exist = false)
private Integer status;
}

+ 13
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/vo/QuestionDetailVO.java View File

@@ -0,0 +1,13 @@
package com.tuoheng.admin.entity.vo;

import com.tuoheng.admin.entity.domain.Question;
import com.tuoheng.admin.entity.domain.QuestionHandle;
import lombok.Data;

@Data
public class QuestionDetailVO {

private Question question;

private QuestionHandle questionHandle;
}

+ 2
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/IWorkOrderService.java View File

@@ -18,4 +18,6 @@ public interface IWorkOrderService extends IBaseService<WorkOrder> {
JsonResult handle(WorkOrderHandleRequest request);

JsonResult questionPage(WorkOrderQuestionRequest request);

JsonResult questionDetail(Integer questionId);
}

+ 28
- 2
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/WorkOrderServiceImpl.java View File

@@ -5,18 +5,19 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.admin.common.ServiceExceptionEnum;
import com.tuoheng.admin.entity.domain.Question;
import com.tuoheng.admin.entity.domain.QuestionHandle;
import com.tuoheng.admin.entity.domain.ThInspection;
import com.tuoheng.admin.entity.domain.WorkOrder;
import com.tuoheng.admin.entity.domain.WorkOrderQuestion;
import com.tuoheng.admin.entity.request.WorkOrderHandleRequest;
import com.tuoheng.admin.entity.request.WorkOrderQuestionRequest;
import com.tuoheng.admin.entity.request.WorkOrderRequest;
import com.tuoheng.admin.entity.vo.WorkOrderInfoVO;
import com.tuoheng.admin.entity.vo.QuestionDetailVO;
import com.tuoheng.admin.entity.vo.WorkOrderQuestionVO;
import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.WorkOrderStatusEnum;
import com.tuoheng.admin.mapper.QuestionHandleMapper;
import com.tuoheng.admin.mapper.QuestionMapper;
import com.tuoheng.admin.mapper.WorkOrderMapper;
import com.tuoheng.admin.mapper.WorkOrderQuestionMapper;
import com.tuoheng.admin.service.IWorkOrderService;
@@ -52,6 +53,9 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
@Autowired
private QuestionHandleMapper questionHandleMapper;

@Autowired
private QuestionMapper questionMapper;

@Autowired
private UserMapper userMapper;

@@ -186,5 +190,27 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
return JsonResult.success(pageInfo);
}

@Override
public JsonResult questionDetail(Integer questionId) {
QuestionDetailVO questionDetailVO = new QuestionDetailVO();
//查询问题详情
Question question = questionMapper.selectById(questionId);
questionDetailVO.setQuestion(question);

//查询问题处理详情
QuestionHandle questionHandle = questionHandleMapper.selectOne(new LambdaQueryWrapper<QuestionHandle>()
.eq(QuestionHandle::getQuestionId, questionId)
.eq(QuestionHandle::getMark, MarkTypeEnum.VALID.getCode()));

//查询问题处理状态
WorkOrderQuestion workOrderQuestion = workOrderQuestionMapper.selectOne(new LambdaQueryWrapper<WorkOrderQuestion>()
.eq(WorkOrderQuestion::getQuestionId, questionId));
questionDetailVO.setQuestionHandle(questionHandle);
questionHandle.setStatus(workOrderQuestion.getStatus());

questionDetailVO.setQuestionHandle(questionHandle);
return JsonResult.success(questionDetailVO);
}


}

Loading…
Cancel
Save