Browse Source

Merge remote-tracking branch 'origin/develop' into develop

tags/v1.1.0^2
chenjiandong 1 year ago
parent
commit
11310149f3
7 changed files with 69 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. +5
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/WorkOrderQuestionRequest.java
  4. +13
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/vo/QuestionDetailVO.java
  5. +2
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/IWorkOrderService.java
  6. +28
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/WorkOrderServiceImpl.java
  7. +3
    -0
      tuoheng-admin/src/main/resources/mapper/WorkOrderMapper.xml

+ 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;
}

+ 5
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/WorkOrderQuestionRequest.java View File

@@ -6,6 +6,11 @@ import lombok.Data;
@Data
public class WorkOrderQuestionRequest extends BaseQuery {

/**
* 工单ID
*/
private Integer workOrderId;

/**
* 问题编码
*/

+ 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);
}


}

+ 3
- 0
tuoheng-admin/src/main/resources/mapper/WorkOrderMapper.xml View File

@@ -18,6 +18,9 @@
LEFT JOIN th_question q on woq.question_id = q.id
LEFT JOIN th_question_handle qh on q.id = qh.question_id
LEFT JOIN sys_user u on qh.handler_user = u.id
WHERE
wo.mark = 1
AND wo.id = #{request.workOrderId}
<if test="request.questionType != '' and request.questionType != null">
AND q.type = #{request.questionType}
</if>

Loading…
Cancel
Save