Commit 5c34a6b9 authored by W_Y's avatar W_Y

编辑任务

parent 36e05475
......@@ -2,10 +2,7 @@ package com.ruoyi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.Task;
import com.ruoyi.web.request.TaskCreateRequest;
import com.ruoyi.web.request.TaskFindFinishRequest;
import com.ruoyi.web.request.TaskFindPendingRequest;
import com.ruoyi.web.request.TaskListRequest;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.TaskFindPendingResponse;
import org.apache.ibatis.annotations.Param;
......@@ -29,5 +26,12 @@ public interface TaskService extends IService<Task> {
*/
List<TaskFindPendingResponse> findPending(TaskFindPendingRequest request);
/**
* 查询完成的任务
* @param request
* @return
*/
List<Task> findFinish(TaskFindFinishRequest request);
void editTask(TaskEditRequest request);
}
......@@ -11,10 +11,7 @@ import com.ruoyi.domain.*;
import com.ruoyi.mapper.TaskMapper;
import com.ruoyi.service.*;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.request.TaskCreateRequest;
import com.ruoyi.web.request.TaskFindFinishRequest;
import com.ruoyi.web.request.TaskFindPendingRequest;
import com.ruoyi.web.request.TaskListRequest;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.TaskFindPendingResponse;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -120,6 +117,35 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
return taskMapper.findFinish(request);
}
@Override
public void editTask(TaskEditRequest request) {
// 找到审查组长
TaskUserRelation leader = null;
List<TaskUserRelation> auditors = request.getAuditors();
for(TaskUserRelation auditor : auditors) {
if(auditor.getIsLeader() == 1) {
leader = auditor;
break;
}
}
// 构建并保存任务信息
// 总任务
Task task = new Task();
task.setLeaderId(leader.getUserId());
task.setLeader(leader.getName());
BeanUtils.copyBeanProp(task, request);
taskService.updateById(task);
// 构建并保存该任务所关联的审核组信息
for(TaskUserRelation auditor : auditors) {
auditor.setTaskId(task.getId());
}
taskUserRelationService.updateBatchById(auditors);
}
public Long saveSystemReview(TaskCreateRequest request,SysUser initiator,Standard standard,TaskUserRelation leader) {
// 构建并保存任务信息
......
......@@ -89,4 +89,14 @@ public class TaskController extends BaseController {
return getDataTable(taskService.findFinish(request));
}
@ApiOperation("编辑任务")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "编辑任务", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/editTask")
public R<String> editTask(@Validated @RequestBody TaskEditRequest request) {
taskService.editTask(request);
return R.ok();
}
}
package com.ruoyi.web.request;
import com.ruoyi.domain.TaskUserRelation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@ApiModel(value = "TaskEditRequest", description = "编辑总任务")
@Data
public class TaskEditRequest {
@ApiModelProperty("ID")
private Long id;
@ApiModelProperty("小组成员")
private List<TaskUserRelation> auditors;
@ApiModelProperty("任务编号")
private String taskNo;
@ApiModelProperty("任务名称")
private String taskName;
@ApiModelProperty("产品名称")
private String productName;
@ApiModelProperty("产品型号")
private String productModel;
@ApiModelProperty("委托单位")
private String entrustedUnit;
@ApiModelProperty("委托单位地址")
private String entrustedUnitAddress;
@ApiModelProperty("委托单位电话")
private String entrustedUnitPhone;
@ApiModelProperty("委托单位邮政编码")
private String entrustedUnitCode;
@ApiModelProperty("车辆类型")
private String carType;
@ApiModelProperty("车辆识别码")
private String carIdentificationCode;
@ApiModelProperty("保密等级")
private String confidentialityLevel;
@ApiModelProperty("样品名称")
private String sampleName;
@ApiModelProperty("生产企业")
private String productionEnterprise;
@ApiModelProperty("送样者")
private String sampleSender;
@ApiModelProperty("送样日期")
private Date sendDate;
@ApiModelProperty("样品数量")
private String sampleNumber;
@ApiModelProperty("生产日期")
private Date productionDate;
@ApiModelProperty("商标")
private String trademark;
@ApiModelProperty("检验依据")
private String inspectionBasis;
@ApiModelProperty("选择的任务")
List<String> taskList;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment