@@ -1,16 +1,12 @@ | |||
package com.tuoheng.admin.controller; | |||
import com.tuoheng.admin.entity.request.CallbackRequest; | |||
import com.tuoheng.admin.entity.request.QuestionStatusRequest; | |||
import com.tuoheng.admin.entity.request.WorkOrderRequest; | |||
import com.tuoheng.admin.service.IWorkOrderService; | |||
import com.tuoheng.common.utils.JsonResult; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.*; | |||
import javax.validation.Valid; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.Pattern; | |||
import java.util.List; | |||
/** | |||
* 工单表 前端控制器 | |||
@@ -45,4 +41,14 @@ public class WorkOrderController { | |||
public JsonResult generate(@PathVariable("ids") Integer[] ids) { | |||
return workOrderService.generate(ids); | |||
} | |||
/** | |||
* 分配处理人员 | |||
* | |||
* @return | |||
*/ | |||
@PostMapping("/assign") | |||
public JsonResult assign(@RequestBody WorkOrderRequest request) { | |||
return workOrderService.assign(request); | |||
} | |||
} |
@@ -4,12 +4,18 @@ import com.tuoheng.common.common.BaseQuery; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
import java.util.List; | |||
@Data | |||
public class WorkOrderRequest extends BaseQuery implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
/** | |||
* 工单ID | |||
*/ | |||
private Integer id; | |||
/** | |||
* 问题工单号 | |||
*/ | |||
@@ -30,4 +36,9 @@ public class WorkOrderRequest extends BaseQuery implements Serializable { | |||
*/ | |||
private String createEndTime; | |||
/** | |||
* 处理人员 | |||
*/ | |||
private List<Integer> handleUserList; | |||
} |
@@ -10,4 +10,6 @@ public interface IWorkOrderService extends IBaseService<WorkOrder> { | |||
JsonResult queryPage(WorkOrderRequest request); | |||
JsonResult generate(Integer[] ids); | |||
JsonResult assign(WorkOrderRequest request); | |||
} |
@@ -120,4 +120,15 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO | |||
} | |||
return JsonResult.success(); | |||
} | |||
@Override | |||
public JsonResult assign(WorkOrderRequest request) { | |||
WorkOrder workOrder = new WorkOrder(); | |||
workOrder.setId(request.getId()); | |||
workOrder.setStatus(10); | |||
workOrder.setAssignUser(StringUtils.join(request.getHandleUserList(), ",")); | |||
workOrder.setAssignTime(new Date()); | |||
workOrderMapper.updateById(workOrder); | |||
return JsonResult.success(); | |||
} | |||
} |