Commit fc0b7078 authored by 王飞's avatar 王飞

Merge branch 'wangdingyi' into 'dev'

根据id查询场景变更任务&审核任务

See merge request !43
parents 512bbc0e 318b4c9b
...@@ -23,6 +23,8 @@ import lombok.experimental.Accessors; ...@@ -23,6 +23,8 @@ import lombok.experimental.Accessors;
@Data @Data
public class CarReviewTask implements Serializable { public class CarReviewTask implements Serializable {
@TableField(exist = false)
public static final String TASK_STATUS_NEW = "NEW";
@TableField(exist = false) @TableField(exist = false)
public static final String TASK_STATUS_PENDING = "PENDING"; public static final String TASK_STATUS_PENDING = "PENDING";
@TableField(exist = false) @TableField(exist = false)
...@@ -106,12 +108,6 @@ public class CarReviewTask implements Serializable { ...@@ -106,12 +108,6 @@ public class CarReviewTask implements Serializable {
@TableField(value="standard", typeHandler = StandardJsonTypeHandler. class) @TableField(value="standard", typeHandler = StandardJsonTypeHandler. class)
private List<ReviewStandard> standard; private List<ReviewStandard> standard;
/**
* 占位(开发人员根据具体业务自行增加业务字段)
*/
@ApiModelProperty("占位(开发人员根据具体业务自行增加业务字段)")
private String bizInfo;
/** /**
* 创建时间 * 创建时间
*/ */
......
...@@ -91,12 +91,6 @@ public class SystemReviewTask { ...@@ -91,12 +91,6 @@ public class SystemReviewTask {
@TableField(value="standard", typeHandler = StandardJsonTypeHandler. class) @TableField(value="standard", typeHandler = StandardJsonTypeHandler. class)
private List<ReviewStandard> standard; private List<ReviewStandard> standard;
/**
* 占位(开发人员根据具体业务自行增加业务字段)
*/
@ApiModelProperty("占位(开发人员根据具体业务自行增加业务字段)")
private String bizInfo;
/** /**
* 审核组长id * 审核组长id
*/ */
......
package com.ruoyi.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.StandardJsonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
/**
* 任务表
*/
@ApiModel
@TableName(value ="t_task", autoResultMap = true)
@Accessors(chain = true)
@Data
public class Task {
@TableField(exist = false)
public static final String STATUS_NEW = "NEW";
@TableField(exist = false)
public static final String STATUS_PENDING = "PENDING";
@TableField(exist = false)
public static final String STATUS_FINISH = "FINISH";
@TableField(exist = false)
public static final String SUB_TASK_GRFIS = "grfis";
@TableField(exist = false)
public static final String SUB_TASK_TRFIS = "trfis";
@TableField(exist = false)
public static final String SUB_TASK_SRAIF = "sraif";
@ApiModelProperty("主键")
@TableId(type = IdType.ASSIGN_ID)
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
@ApiModelProperty("体系审查任务id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long systemReviewTaskId;
@ApiModelProperty("车辆检查任务id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long carReviewTaskId;
@ApiModelProperty("任务编号")
private String taskNo;
@ApiModelProperty("任务名称")
private String taskName;
@ApiModelProperty("任务状态(NEW、PENDING、FINISH)")
private String taskStatus;
@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("任务发起人姓名")
private String taskInitiator;
@ApiModelProperty("任务发起人部门")
private String taskInitiatorDept;
@ApiModelProperty("任务开始时间")
private Date taskBeginTime;
@ApiModelProperty("任务结束时间")
private Date taskEndTime;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@ApiModelProperty("审核组长id")
private Long leaderId;
@ApiModelProperty("审核组长姓名")
private String leader;
@ApiModelProperty("创建时间")
private Date createTime;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@ApiModelProperty("关联标准表id")
private Long standardId;
@ApiModelProperty("标准名称")
private String name;
@ApiModelProperty("标准号")
private String standardNo;
@ApiModelProperty("文件路径")
private String file;
}
...@@ -14,10 +14,10 @@ import lombok.experimental.Accessors; ...@@ -14,10 +14,10 @@ import lombok.experimental.Accessors;
* @TableName t_review_task_user_relation * @TableName t_review_task_user_relation
*/ */
@ApiModel @ApiModel
@TableName(value ="t_review_task_user_relation") @TableName(value ="t_task_user_relation")
@Accessors(chain = true) @Accessors(chain = true)
@Data @Data
public class ReviewTaskUserRelation { public class TaskUserRelation {
/** /**
* 任务id * 任务id
...@@ -46,4 +46,10 @@ public class ReviewTaskUserRelation { ...@@ -46,4 +46,10 @@ public class ReviewTaskUserRelation {
@ApiModelProperty("用户姓名") @ApiModelProperty("用户姓名")
private String name; private String name;
/**
* 部门名称
*/
@ApiModelProperty("部门名称")
private String deptName;
} }
package com.ruoyi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.Task;
import com.ruoyi.web.request.TaskListRequest;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface TaskMapper extends BaseMapper<Task> {
List<Task> findList(TaskListRequest request);
}
package com.ruoyi.mapper; package com.ruoyi.mapper;
import com.ruoyi.domain.ReviewTaskUserRelation; import com.ruoyi.domain.TaskUserRelation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -14,14 +14,14 @@ import java.util.List; ...@@ -14,14 +14,14 @@ import java.util.List;
* @Entity com.ruoyi.domain.SystemReviewTaskUserRelation * @Entity com.ruoyi.domain.SystemReviewTaskUserRelation
*/ */
@Repository @Repository
public interface ReviewTaskUserRelationMapper extends BaseMapper<ReviewTaskUserRelation> { public interface TaskUserRelationMapper extends BaseMapper<TaskUserRelation> {
/** /**
* 根据任务id查询小组成员 * 根据任务id查询小组成员
* @param taskId * @param taskId
* @return * @return
*/ */
List<ReviewTaskUserRelation> selectQTeamMembers(@Param("taskId") Long taskId); List<TaskUserRelation> selectQTeamMembers(@Param("taskId") Long taskId);
} }
......
...@@ -2,6 +2,7 @@ package com.ruoyi.service; ...@@ -2,6 +2,7 @@ package com.ruoyi.service;
import com.ruoyi.domain.ReviewSceneChangeTask; import com.ruoyi.domain.ReviewSceneChangeTask;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse; import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import java.util.Date; import java.util.Date;
...@@ -33,6 +34,12 @@ public interface ReviewSceneChangeTaskService extends IService<ReviewSceneChange ...@@ -33,6 +34,12 @@ public interface ReviewSceneChangeTaskService extends IService<ReviewSceneChange
*/ */
void reject(Long taskId, String comment); void reject(Long taskId, String comment);
/**
* 审核一个任务
* @param request
*/
void audit(ReviewSceneChangeTaskPassRequest request);
/** /**
* 关闭一个任务 * 关闭一个任务
* @param taskId * @param taskId
......
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.TaskListRequest;
import java.util.List;
public interface TaskService extends IService<Task> {
/**
* 查询任务表
* @param request
* @return
*/
List<Task> findList(TaskListRequest request);
void createTask(TaskCreateRequest request);
}
package com.ruoyi.service; package com.ruoyi.service;
import com.ruoyi.domain.ReviewTaskUserRelation; import com.ruoyi.domain.TaskUserRelation;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
/** /**
* @author wangfei * @author wangfei
* @description 针对表【t_system_review_task_user_relation(体系审查任务&用户映射关系)】的数据库操作Service * @description 针对表【t_task_user_relation(体系审查任务&用户映射关系)】的数据库操作Service
* @createDate 2023-12-15 10:41:16 * @createDate 2023-12-15 10:41:16
*/ */
public interface ReviewTaskUserRelationService extends IService<ReviewTaskUserRelation> { public interface TaskUserRelationService extends IService<TaskUserRelation> {
/** /**
* 根据任务id查询小组成员 * 根据任务id查询小组成员
* @param taskId * @param taskId
* @return * @return
*/ */
List<ReviewTaskUserRelation> selectQTeamMembers(Long taskId); List<TaskUserRelation> selectQTeamMembers(Long taskId);
} }
package com.ruoyi.service.impl; package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SnowflakeUtil; import com.ruoyi.common.utils.SnowflakeUtil;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
import com.ruoyi.mapper.ReviewDetailsMapper; import com.ruoyi.mapper.ReviewDetailsMapper;
import com.ruoyi.service.CarReviewTaskService; import com.ruoyi.service.CarReviewTaskService;
import com.ruoyi.mapper.CarReviewTaskMapper; import com.ruoyi.mapper.CarReviewTaskMapper;
import com.ruoyi.service.ReviewTaskUserRelationService; import com.ruoyi.service.TaskUserRelationService;
import com.ruoyi.service.StandardService; import com.ruoyi.service.StandardService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.request.CarReviewTaskCreateRequest; import com.ruoyi.web.request.CarReviewTaskCreateRequest;
import com.ruoyi.web.request.CarReviewTaskStartRequest; import com.ruoyi.web.request.CarReviewTaskStartRequest;
import com.ruoyi.web.request.CarReviewTaskSubmitRequest; import com.ruoyi.web.request.CarReviewTaskSubmitRequest;
import com.ruoyi.web.response.CarReviewTaskViewResponse; import com.ruoyi.web.response.CarReviewTaskViewResponse;
import com.ruoyi.web.response.SystemReviewTaskViewResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -49,7 +46,7 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C ...@@ -49,7 +46,7 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
private CarReviewTaskService carReviewTaskService; private CarReviewTaskService carReviewTaskService;
@Autowired @Autowired
private ReviewTaskUserRelationService relationService; private TaskUserRelationService relationService;
@Autowired @Autowired
private StrategyCarReviewTaskContext strategyCarReviewTaskContext; private StrategyCarReviewTaskContext strategyCarReviewTaskContext;
...@@ -71,9 +68,9 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C ...@@ -71,9 +68,9 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
Standard standard = standardService.findListById(request.getStandardId()); Standard standard = standardService.findListById(request.getStandardId());
// 找到审查组长 // 找到审查组长
ReviewTaskUserRelation leader = null; TaskUserRelation leader = null;
List<ReviewTaskUserRelation> auditors = request.getAuditors(); List<TaskUserRelation> auditors = request.getAuditors();
for(ReviewTaskUserRelation auditor : auditors) { for(TaskUserRelation auditor : auditors) {
if(auditor.getIsLeader() == 1) { if(auditor.getIsLeader() == 1) {
leader = auditor; leader = auditor;
break; break;
...@@ -85,8 +82,7 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C ...@@ -85,8 +82,7 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
.setTaskNo(SnowflakeUtil.generate().toString()) .setTaskNo(SnowflakeUtil.generate().toString())
.setTaskInitiator(initiator.getNickName()) .setTaskInitiator(initiator.getNickName())
.setTaskInitiatorDept(initiator.getDept().getDeptName()) .setTaskInitiatorDept(initiator.getDept().getDeptName())
.setTaskStatus(CarReviewTask.TASK_STATUS_PENDING) .setTaskStatus(CarReviewTask.TASK_STATUS_NEW)
.setBizInfo(request.getBizInfo())
.setLeaderId(leader.getUserId()) .setLeaderId(leader.getUserId())
.setLeader(leader.getName()) .setLeader(leader.getName())
.setCreateTime(new Date()) .setCreateTime(new Date())
...@@ -111,7 +107,7 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C ...@@ -111,7 +107,7 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
// 构建并保存该任务所关联的审核组信息 // 构建并保存该任务所关联的审核组信息
for(ReviewTaskUserRelation auditor : auditors) { for(TaskUserRelation auditor : auditors) {
auditor.setTaskId(task.getId()); auditor.setTaskId(task.getId());
} }
relationService.saveBatch(auditors); relationService.saveBatch(auditors);
......
...@@ -13,6 +13,7 @@ import com.ruoyi.service.ReviewSceneChangeTaskUserRelationService; ...@@ -13,6 +13,7 @@ import com.ruoyi.service.ReviewSceneChangeTaskUserRelationService;
import com.ruoyi.service.ReviewSceneService; import com.ruoyi.service.ReviewSceneService;
import com.ruoyi.service.ReviewTaskInboxService; import com.ruoyi.service.ReviewTaskInboxService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse; import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -87,11 +88,24 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha ...@@ -87,11 +88,24 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
doProcess(taskId, comment, ReviewSceneChangeTask.RESULT_PASS); doProcess(taskId, comment, ReviewSceneChangeTask.RESULT_PASS);
} }
@Override @Override
public void reject(Long taskId, String comment) { public void reject(Long taskId, String comment) {
doProcess(taskId, comment, ReviewSceneChangeTask.RESULT_REJECT); doProcess(taskId, comment, ReviewSceneChangeTask.RESULT_REJECT);
} }
@Override
public void audit(ReviewSceneChangeTaskPassRequest request) {
if (request.getPassed().equals("0")) {
doProcess(request.getTaskId(), request.getComment(), ReviewSceneChangeTask.RESULT_REJECT);
} else if(request.getPassed().equals("1")){
doProcess(request.getTaskId(), request.getComment(), ReviewSceneChangeTask.RESULT_PASS);
} else {
throw new ServiceException("审核状态不正确",HttpStatus.ERROR);
}
}
public void doProcess(Long taskId, String comment, String decision) { public void doProcess(Long taskId, String comment, String decision) {
ReviewSceneChangeTask task = getById(taskId); ReviewSceneChangeTask task = getById(taskId);
......
package com.ruoyi.service.impl; package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SnowflakeUtil; import com.ruoyi.common.utils.SnowflakeUtil;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
...@@ -32,7 +30,7 @@ import java.util.*; ...@@ -32,7 +30,7 @@ import java.util.*;
public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMapper, SystemReviewTask> implements SystemReviewTaskService { public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMapper, SystemReviewTask> implements SystemReviewTaskService {
@Autowired @Autowired
private ReviewTaskUserRelationService systemReviewTaskUserRelationService; private TaskUserRelationService systemReviewTaskUserRelationService;
@Autowired @Autowired
private SystemReviewTaskService systemReviewTaskService; private SystemReviewTaskService systemReviewTaskService;
...@@ -62,9 +60,9 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap ...@@ -62,9 +60,9 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
Standard standard = standardService.findListById(request.getStandardId()); Standard standard = standardService.findListById(request.getStandardId());
// 找到审查组长 // 找到审查组长
ReviewTaskUserRelation leader = null; TaskUserRelation leader = null;
List<ReviewTaskUserRelation> auditors = request.getAuditors(); List<TaskUserRelation> auditors = request.getAuditors();
for(ReviewTaskUserRelation auditor : auditors) { for(TaskUserRelation auditor : auditors) {
if(auditor.getIsLeader() == 1) { if(auditor.getIsLeader() == 1) {
leader = auditor; leader = auditor;
break; break;
...@@ -77,7 +75,6 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap ...@@ -77,7 +75,6 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
.setTaskInitiator(initiator.getNickName()) .setTaskInitiator(initiator.getNickName())
.setTaskInitiatorDept(initiator.getDept().getDeptName()) .setTaskInitiatorDept(initiator.getDept().getDeptName())
.setTaskStatus(SystemReviewTask.STATUS_NEW) .setTaskStatus(SystemReviewTask.STATUS_NEW)
.setBizInfo(request.getBizInfo())
.setLeaderId(leader.getUserId()) .setLeaderId(leader.getUserId())
.setLeader(leader.getName()) .setLeader(leader.getName())
.setCreateTime(new Date()) .setCreateTime(new Date())
...@@ -90,7 +87,7 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap ...@@ -90,7 +87,7 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
// 构建并保存该任务所关联的审核组信息 // 构建并保存该任务所关联的审核组信息
for(ReviewTaskUserRelation auditor : auditors) { for(TaskUserRelation auditor : auditors) {
auditor.setTaskId(task.getId()); auditor.setTaskId(task.getId());
} }
systemReviewTaskUserRelationService.saveBatch(auditors); systemReviewTaskUserRelationService.saveBatch(auditors);
......
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SnowflakeUtil;
import com.ruoyi.common.utils.bean.BeanUtils;
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.TaskListRequest;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
@Transactional
@Service
public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService {
@Autowired
private TaskMapper taskMapper;
@Autowired
private ISysUserService sysUserService;
@Autowired
private StandardService standardService;
@Autowired
private TaskUserRelationService taskUserRelationService;
@Autowired
private TaskService taskService;
@Autowired
private SystemReviewTaskService systemReviewTaskService;
@Autowired
private CarReviewTaskService carReviewTaskService;
@Override
public List<Task> findList(TaskListRequest request) {
return taskMapper.findList(request);
}
@Override
public void createTask(TaskCreateRequest request) {
// 构建任务创建者
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser initiator = sysUserService.selectUserById(loginUser.getUserId());
Standard standard = standardService.findListById(request.getStandardId());
// 找到审查组长
TaskUserRelation leader = null;
List<TaskUserRelation> auditors = request.getAuditors();
for(TaskUserRelation auditor : auditors) {
if(auditor.getIsLeader() == 1) {
leader = auditor;
break;
}
}
// 构建并保存任务信息
// 总任务
Task task = new Task();
task.setTaskInitiator(initiator.getNickName());
task.setTaskInitiatorDept(initiator.getDept().getDeptName());
task.setTaskStatus(Task.STATUS_NEW);
task.setLeaderId(leader.getUserId());
task.setLeader(leader.getName());
task.setCreateTime(new Date());
task.setName(standard.getName());
task.setStandardNo(standard.getStandardNo());
task.setFile(standard.getFile());
BeanUtils.copyBeanProp(task, request);
Long systemReviewTaskId = null;
Long carReviewTaskId = null;
if (request.getTaskList().contains(Task.SUB_TASK_SRAIF)) {
// 保存体系审查任务
systemReviewTaskId = saveSystemReview(request,initiator,standard,leader);
}
if (request.getTaskList().contains(Task.SUB_TASK_GRFIS) || request.getTaskList().contains(Task.SUB_TASK_TRFIS)) {
// 保存车型审查问卷任务
carReviewTaskId = saveCarReview(request,initiator,standard,leader);
}
task.setCarReviewTaskId(carReviewTaskId);
task.setSystemReviewTaskId(systemReviewTaskId);
taskService.save(task);
// 构建并保存该任务所关联的审核组信息
for(TaskUserRelation auditor : auditors) {
auditor.setTaskId(task.getId());
}
taskUserRelationService.saveBatch(auditors);
}
public Long saveSystemReview(TaskCreateRequest request,SysUser initiator,Standard standard,TaskUserRelation leader) {
// 构建并保存任务信息
SystemReviewTask task = new SystemReviewTask()
.setTaskNo(request.getTaskNo())
.setTaskInitiator(initiator.getNickName())
.setTaskInitiatorDept(initiator.getDept().getDeptName())
.setTaskStatus(SystemReviewTask.STATUS_NEW)
.setLeaderId(leader.getUserId())
.setLeader(leader.getName())
.setCreateTime(new Date())
.setStandardId(standard.getId())
.setName(standard.getName())
.setStandardNo(standard.getStandardNo())
.setFile(standard.getFile());
systemReviewTaskService.save(task);
return task.getId();
}
public Long saveCarReview(TaskCreateRequest request,SysUser initiator,Standard standard,TaskUserRelation leader) {
List<String> taskList = request.getTaskList();
// 构建并保存任务信息
CarReviewTask task = new CarReviewTask()
.setTaskNo(request.getTaskNo())
.setTaskInitiator(initiator.getNickName())
.setTaskInitiatorDept(initiator.getDept().getDeptName())
.setTaskStatus(CarReviewTask.TASK_STATUS_NEW)
.setLeaderId(leader.getUserId())
.setLeader(leader.getName())
.setCreateTime(new Date())
.setTaskBeginTime(new Date())
.setStandardId(standard.getId())
.setName(standard.getName())
.setStandardNo(standard.getStandardNo())
.setFile(standard.getFile())
.setReviewStatus(taskList.contains(Task.SUB_TASK_GRFIS) ? CarReviewTask.REVIEW_STATUS_NEW : CarReviewTask.REVIEW_STATUS_NONE)
.setTestStatus(taskList.contains(Task.SUB_TASK_TRFIS) ? CarReviewTask.TEST_STATUS_NEW : CarReviewTask.TEST_STATUS_NONE);
carReviewTaskService.save(task);
return task.getId();
}
}
package com.ruoyi.service.impl; package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.domain.ReviewTaskUserRelation; import com.ruoyi.domain.TaskUserRelation;
import com.ruoyi.service.ReviewTaskUserRelationService; import com.ruoyi.service.TaskUserRelationService;
import com.ruoyi.mapper.ReviewTaskUserRelationMapper; import com.ruoyi.mapper.TaskUserRelationMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -16,11 +15,11 @@ import java.util.List; ...@@ -16,11 +15,11 @@ import java.util.List;
* @createDate 2023-12-15 10:41:16 * @createDate 2023-12-15 10:41:16
*/ */
@Service @Service
public class ReviewTaskUserRelationServiceImpl extends ServiceImpl<ReviewTaskUserRelationMapper, ReviewTaskUserRelation> public class TaskUserRelationServiceImpl extends ServiceImpl<TaskUserRelationMapper, TaskUserRelation>
implements ReviewTaskUserRelationService { implements TaskUserRelationService {
@Autowired @Autowired
ReviewTaskUserRelationMapper reviewTaskUserRelationMapper; TaskUserRelationMapper reviewTaskUserRelationMapper;
/** /**
* 根据任务id查询小组成员 * 根据任务id查询小组成员
...@@ -28,7 +27,7 @@ public class ReviewTaskUserRelationServiceImpl extends ServiceImpl<ReviewTaskUse ...@@ -28,7 +27,7 @@ public class ReviewTaskUserRelationServiceImpl extends ServiceImpl<ReviewTaskUse
* @return * @return
*/ */
@Override @Override
public List<ReviewTaskUserRelation> selectQTeamMembers(Long taskId){ public List<TaskUserRelation> selectQTeamMembers(Long taskId){
return reviewTaskUserRelationMapper.selectQTeamMembers(taskId); return reviewTaskUserRelationMapper.selectQTeamMembers(taskId);
} }
......
...@@ -17,12 +17,10 @@ import io.swagger.annotations.ApiOperation; ...@@ -17,12 +17,10 @@ import io.swagger.annotations.ApiOperation;
import org.apache.skywalking.apm.toolkit.trace.Tag; import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags; import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace; import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "场景变更任务") @Api(tags = "场景变更任务")
@RestController @RestController
...@@ -46,27 +44,14 @@ public class ReviewSceneChangeTaskController extends BaseController { ...@@ -46,27 +44,14 @@ public class ReviewSceneChangeTaskController extends BaseController {
return R.ok(); return R.ok();
} }
@ApiOperation("审核通过任务") @ApiOperation("审核任务")
@Trace @Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")}) @Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "审核通过任务", businessType = BusinessType.UPDATE) @Log(title = "审核任务", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/pass") @RequestMapping(method = RequestMethod.POST, value = "/audit")
public R<String> pass(@Validated @RequestBody ReviewSceneChangeTaskPassRequest request) { public R<String> audit(@Validated @RequestBody ReviewSceneChangeTaskPassRequest request) {
reviewSceneChangeTaskService.pass(request.getTaskId(),request.getComment());
return R.ok();
}
@ApiOperation("审核驳回任务")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "审核驳回任务", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/reject")
public R<String> reject(@Validated @RequestBody ReviewSceneChangeTaskPassRequest request) {
reviewSceneChangeTaskService.reject(request.getTaskId(),request.getComment());
reviewSceneChangeTaskService.audit(request);
return R.ok(); return R.ok();
} }
...@@ -91,7 +76,7 @@ public class ReviewSceneChangeTaskController extends BaseController { ...@@ -91,7 +76,7 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Trace @Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")}) @Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findFinish") @RequestMapping(method = RequestMethod.POST, value = "/findFinish")
public TableDataInfo<ReviewSceneChangeTaskResponse> findFinish(ReviewSceneChangeTaskFindFinishRequest request) { public TableDataInfo<ReviewSceneChangeTaskResponse> findFinish(@Validated @RequestBody ReviewSceneChangeTaskFindFinishRequest request) {
startPage(request); startPage(request);
return getDataTable(reviewSceneChangeTaskService.findFinishListByUserId(getUserId())); return getDataTable(reviewSceneChangeTaskService.findFinishListByUserId(getUserId()));
} }
...@@ -104,9 +89,17 @@ public class ReviewSceneChangeTaskController extends BaseController { ...@@ -104,9 +89,17 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Trace @Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")}) @Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findCreate") @RequestMapping(method = RequestMethod.POST, value = "/findCreate")
public TableDataInfo<ReviewSceneChangeTask> findCreate(ReviewSceneChangeTaskFindCreateRequest request) { public TableDataInfo<ReviewSceneChangeTask> findCreate(@Validated @RequestBody ReviewSceneChangeTaskFindCreateRequest request) {
startPage(request); startPage(request);
return getDataTable(reviewSceneChangeTaskService.findCreateListByUserId(getUserId())); return getDataTable(reviewSceneChangeTaskService.findCreateListByUserId(getUserId()));
} }
@ApiOperation("查询任务详情")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getById")
public R<ReviewSceneChangeTask> getInfo(@Validated @RequestBody ReviewSceneChangeTaskGetInfoRequest request) {
return R.ok(reviewSceneChangeTaskService.getById(request.getId()));
}
} }
...@@ -3,9 +3,9 @@ package com.ruoyi.web; ...@@ -3,9 +3,9 @@ package com.ruoyi.web;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.R;
import com.ruoyi.domain.ReviewTaskUserRelation; import com.ruoyi.domain.TaskUserRelation;
import com.ruoyi.service.ReviewTaskUserRelationService; import com.ruoyi.service.TaskUserRelationService;
import com.ruoyi.web.request.ReviewTaskUserRelationMembersRequest; import com.ruoyi.web.request.TaskUserRelationMembersRequest;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.skywalking.apm.toolkit.trace.Tag; import org.apache.skywalking.apm.toolkit.trace.Tag;
...@@ -24,7 +24,7 @@ import java.util.List; ...@@ -24,7 +24,7 @@ import java.util.List;
public class ReviewTaskUserRelationController extends BaseController { public class ReviewTaskUserRelationController extends BaseController {
@Autowired @Autowired
ReviewTaskUserRelationService reviewTaskUserRelationService; TaskUserRelationService reviewTaskUserRelationService;
/** /**
...@@ -35,8 +35,8 @@ public class ReviewTaskUserRelationController extends BaseController { ...@@ -35,8 +35,8 @@ public class ReviewTaskUserRelationController extends BaseController {
@Trace @Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")}) @Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/members") @RequestMapping(method = RequestMethod.POST, value = "/members")
public R<List<ReviewTaskUserRelation>> selectQTeamMemberList(@Validated @RequestBody ReviewTaskUserRelationMembersRequest request){ public R<List<TaskUserRelation>> selectQTeamMemberList(@Validated @RequestBody TaskUserRelationMembersRequest request){
List<ReviewTaskUserRelation> list = reviewTaskUserRelationService.selectQTeamMembers(request.getTaskId()); List<TaskUserRelation> list = reviewTaskUserRelationService.selectQTeamMembers(request.getTaskId());
return R.ok(list); return R.ok(list);
} }
......
package com.ruoyi.web;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.domain.Task;
import com.ruoyi.service.TaskService;
import com.ruoyi.web.request.TaskCreateRequest;
import com.ruoyi.web.request.TaskListRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "总任务")
@RestController
@RequestMapping("/task")
public class TaskController extends BaseController {
@Autowired
private TaskService taskService;
@ApiOperation("查询任务列表")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findList")
public TableDataInfo<Task> findList(@Validated @RequestBody TaskListRequest request) {
startPage(request);
return getDataTable(taskService.findList(request));
}
@ApiOperation("创建任务")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "总任务", businessType = BusinessType.INSERT)
@RequestMapping(method = RequestMethod.POST, value = "/createTask")
public R<String> createTask(@Validated @RequestBody TaskCreateRequest request) {
taskService.createTask(request);
return R.ok();
}
}
package com.ruoyi.web.request; package com.ruoyi.web.request;
import com.ruoyi.domain.ReviewTaskUserRelation; import com.ruoyi.domain.TaskUserRelation;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -11,11 +11,8 @@ import java.util.List; ...@@ -11,11 +11,8 @@ import java.util.List;
@Data @Data
public class CarReviewTaskCreateRequest { public class CarReviewTaskCreateRequest {
@ApiModelProperty("占位")
private String bizInfo;
@ApiModelProperty("小组信息") @ApiModelProperty("小组信息")
private List<ReviewTaskUserRelation> auditors; private List<TaskUserRelation> auditors;
/** /**
* 是否创建车型问卷审查任务 * 是否创建车型问卷审查任务
......
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel
public class ReviewSceneChangeTaskGetInfoRequest {
@ApiModelProperty("ID")
private Long id;
}
...@@ -13,4 +13,7 @@ public class ReviewSceneChangeTaskPassRequest { ...@@ -13,4 +13,7 @@ public class ReviewSceneChangeTaskPassRequest {
@ApiModelProperty("评论") @ApiModelProperty("评论")
private String comment; private String comment;
@ApiModelProperty("是否通过(0:不通过 1:通过)")
private String passed;
} }
package com.ruoyi.web.request; package com.ruoyi.web.request;
import com.ruoyi.domain.ReviewTaskUserRelation; import com.ruoyi.domain.TaskUserRelation;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
...@@ -8,9 +8,7 @@ import java.util.List; ...@@ -8,9 +8,7 @@ import java.util.List;
@Data @Data
public class SystemReviewTaskCreateRequest { public class SystemReviewTaskCreateRequest {
private String bizInfo; private List<TaskUserRelation> auditors;
private List<ReviewTaskUserRelation> auditors;
/** /**
* 标准id * 标准id
......
package com.ruoyi.web.request;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.domain.TaskUserRelation;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@ApiModel(value = "TaskCreateRequest", description = "创建总任务")
@Data
public class TaskCreateRequest {
@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;
/**
* 标准id
* 根据哪个标准新建的审查任务
*/
@ApiModelProperty("标准id(根据哪个标准新建的任务)")
private Long standardId;
}
package com.ruoyi.web.request;
import com.ruoyi.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@ApiModel(value = "TaskListRequest", description = "查询总任务")
@Data
public class TaskListRequest extends PageDomain {
@ApiModelProperty("任务开始时间")
private Date taskBeginTime;
@ApiModelProperty("任务状态")
private String taskStatus;
}
...@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@Data @Data
public class ReviewTaskUserRelationMembersRequest { public class TaskUserRelationMembersRequest {
@ApiModelProperty("任务id") @ApiModelProperty("任务id")
private Long taskId; private Long taskId;
} }
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
<result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/> <result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/>
<result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/> <result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/>
<result property="standard" column="standard" typeHandler="com.ruoyi.common.StandardJsonTypeHandler"/> <result property="standard" column="standard" typeHandler="com.ruoyi.common.StandardJsonTypeHandler"/>
<result property="bizInfo" column="biz_info" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="leaderId" column="leader_id" jdbcType="BIGINT"/> <result property="leaderId" column="leader_id" jdbcType="BIGINT"/>
<result property="leader" column="leader" jdbcType="VARCHAR"/> <result property="leader" column="leader" jdbcType="VARCHAR"/>
...@@ -35,7 +34,7 @@ ...@@ -35,7 +34,7 @@
id,task_no,task_status, id,task_no,task_status,
task_initiator,task_initiator_dept,task_result, task_initiator,task_initiator_dept,task_result,
task_begin_time,task_end_time,standard, task_begin_time,task_end_time,standard,
biz_info,create_time,leader_id, create_time,leader_id,
leader,standard_id,name, leader,standard_id,name,
standard_no,file,review_status, standard_no,file,review_status,
test_status,review_start_time, test_status,review_start_time,
...@@ -45,11 +44,11 @@ ...@@ -45,11 +44,11 @@
review_result review_result
</sql> </sql>
<select id="findListByReviewStatus" resultType="com.ruoyi.domain.CarReviewTask"> <select id="findListByReviewStatus" resultType="com.ruoyi.domain.CarReviewTask">
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,biz_info,create_time,leader_id,leader,standard_id,name,standard_no,file,review_status,test_status,review_start_time,review_submit_time,review_submit_id,review_submit_name,review_result SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,create_time,leader_id,leader,standard_id,name,standard_no,file,review_status,test_status,review_start_time,review_submit_time,review_submit_id,review_submit_name,review_result
FROM t_car_review_task WHERE review_status = #{reviewStatus} AND task_status = 'PENDING' FROM t_car_review_task WHERE review_status = #{reviewStatus} AND task_status = 'PENDING'
</select> </select>
<select id="findListByTaskStatus" resultType="com.ruoyi.domain.CarReviewTask"> <select id="findListByTaskStatus" resultType="com.ruoyi.domain.CarReviewTask">
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,biz_info,create_time,leader_id,leader,standard_id,name,standard_no,file,review_status,test_status,review_start_time,review_submit_time,review_submit_id,review_submit_name,review_result SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,create_time,leader_id,leader,standard_id,name,standard_no,file,review_status,test_status,review_start_time,review_submit_time,review_submit_id,review_submit_name,review_result
FROM t_car_review_task WHERE task_status = #{taskStatus} FROM t_car_review_task WHERE task_status = #{taskStatus}
</select> </select>
</mapper> </mapper>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<result property="inconformity" column="inconformity" jdbcType="VARCHAR"/> <result property="inconformity" column="inconformity" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<select id="findList" parameterType="com.ruoyi.domain.Standard" resultMap="BaseResultMap"> <select id="findList" parameterType="com.ruoyi.web.request.StandardListRequest" resultMap="BaseResultMap">
SELECT id, name, standard_no, file, conformity, inconformity SELECT id, name, standard_no, file, conformity, inconformity
FROM t_standard FROM t_standard
<where> <where>
......
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
<result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/> <result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/>
<result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/> <result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/>
<result property="standard" column="standard" typeHandler="com.ruoyi.common.StandardJsonTypeHandler"/> <result property="standard" column="standard" typeHandler="com.ruoyi.common.StandardJsonTypeHandler"/>
<result property="bizInfo" column="biz_info" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="leaderId" column="leader_id" jdbcType="BIGINT"/>
<result property="leader" column="leader" jdbcType="VARCHAR"/>
<result property="standardId" column="standard_id" jdbcType="BIGINT"/> <result property="standardId" column="standard_id" jdbcType="BIGINT"/>
<result property="name" column="name" jdbcType="VARCHAR"/> <result property="name" column="name" jdbcType="VARCHAR"/>
<result property="standardNo" column="standard_no" jdbcType="VARCHAR"/> <result property="standardNo" column="standard_no" jdbcType="VARCHAR"/>
...@@ -25,13 +26,13 @@ ...@@ -25,13 +26,13 @@
</resultMap> </resultMap>
<select id="findListByStatus" resultMap="BaseResultMap"> <select id="findListByStatus" resultMap="BaseResultMap">
SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, biz_info, create_time, standard_id, name, standard_no, file, submit_by_id, submit_by_name SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, create_time,leader,leader_id, standard_id, name, standard_no, file, submit_by_id, submit_by_name
FROM t_system_review_task WHERE task_status = #{status} FROM t_system_review_task WHERE task_status = #{status}
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
<select id="findListInProcess" resultMap="BaseResultMap"> <select id="findListInProcess" resultMap="BaseResultMap">
SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, biz_info, create_time, standard_id, name, standard_no, file, submit_by_id, submit_by_name SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, create_time,leader,leader_id, standard_id, name, standard_no, file, submit_by_id, submit_by_name
FROM t_system_review_task WHERE task_status IN ('NEW','PENDING') FROM t_system_review_task WHERE task_status IN ('NEW','PENDING')
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.mapper.TaskMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.domain.Task">
<id property="id" column="id" jdbcType="BIGINT"/>
<id property="systemReviewTaskId" column="system_review_task_id" jdbcType="BIGINT"/>
<id property="carReviewTaskId" column="car_review_task_id" jdbcType="BIGINT"/>
<result property="taskNo" column="task_no" jdbcType="VARCHAR"/>
<result property="taskName" column="task_name" jdbcType="VARCHAR"/>
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
<result property="productName" column="product_name" jdbcType="VARCHAR"/>
<result property="productModel" column="product_model" jdbcType="VARCHAR"/>
<result property="entrustedUnit" column="entrusted_unit" jdbcType="VARCHAR"/>
<result property="entrustedUnitAddress" column="entrusted_unit_address" jdbcType="VARCHAR"/>
<result property="entrustedUnitPhone" column="entrusted_unit_phone" jdbcType="VARCHAR"/>
<result property="entrustedUnitCode" column="entrusted_unit_code" jdbcType="VARCHAR"/>
<result property="carType" column="car_type" jdbcType="VARCHAR"/>
<result property="carIdentificationCode" column="car_identification_code" jdbcType="VARCHAR"/>
<result property="confidentialityLevel" column="confidentiality_level" jdbcType="VARCHAR"/>
<result property="sampleName" column="sample_name" jdbcType="VARCHAR"/>
<result property="productionEnterprise" column="production_enterprise" jdbcType="VARCHAR"/>
<result property="sampleSender" column="sample_sender" jdbcType="VARCHAR"/>
<result property="sendDate" column="send_date" jdbcType="TIMESTAMP"/>
<result property="sampleNumber" column="sample_number" jdbcType="VARCHAR"/>
<result property="productionDate" column="production_date" jdbcType="TIMESTAMP"/>
<result property="trademark" column="trademark" jdbcType="VARCHAR"/>
<result property="inspectionBasis" column="inspection_basis" jdbcType="VARCHAR"/>
<result property="taskInitiator" column="task_initiator" jdbcType="VARCHAR"/>
<result property="taskInitiatorDept" column="task_initiator_dept" jdbcType="VARCHAR"/>
<result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/>
<result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/>
<result property="leaderId" column="leader_id" jdbcType="BIGINT"/>
<result property="leader" column="leader" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="standardId" column="standard_id" jdbcType="BIGINT"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="standardNo" column="standard_no" jdbcType="VARCHAR"/>
<result property="file" column="file" jdbcType="VARCHAR"/>
</resultMap>
<select id="findList" parameterType="com.ruoyi.web.request.TaskListRequest" resultMap="BaseResultMap">
SELECT id, system_review_task_id, car_review_task_id,
task_no,task_name,task_status,product_name,product_model,
entrusted_unit,entrusted_unit_address,entrusted_unit_phone,
entrusted_unit_code,car_type,car_identification_code,
confidentiality_level,sample_name,production_enterprise,
sample_sender,send_date,sample_number,production_date,
trademark,inspection_basis,task_initiator,task_initiator_dept,
task_begin_time,task_end_time,create_time,
leader_id,leader,standard_id,name,
standard_no,file
FROM t_task
<where>
<if test="taskBeginTime != null and taskBeginTime != ''">
task_begin_time = #{taskBeginTime}
</if>
<if test="taskStatus != null and taskStatus != ''">
task_status = #{taskStatus}
</if>
</where>
order by create_time desc
</select>
</mapper>
...@@ -2,17 +2,18 @@ ...@@ -2,17 +2,18 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.mapper.ReviewTaskUserRelationMapper"> <mapper namespace="com.ruoyi.mapper.TaskUserRelationMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.domain.ReviewTaskUserRelation"> <resultMap id="BaseResultMap" type="com.ruoyi.domain.TaskUserRelation">
<result property="taskId" column="task_id" jdbcType="BIGINT"/> <result property="taskId" column="task_id" jdbcType="BIGINT"/>
<result property="userId" column="user_id" jdbcType="BIGINT"/> <result property="userId" column="user_id" jdbcType="BIGINT"/>
<result property="isLeader" column="is_leader" jdbcType="TINYINT"/> <result property="isLeader" column="is_leader" jdbcType="TINYINT"/>
<result property="name" column="name" jdbcType="VARCHAR"/> <result property="name" column="name" jdbcType="VARCHAR"/>
<result property="deptName" column="dept_name" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
task_id,user_id,is_leader,name task_id,user_id,is_leader,name,dept_name
</sql> </sql>
<select id="selectQTeamMembers" parameterType="Long" resultMap="BaseResultMap"> <select id="selectQTeamMembers" parameterType="Long" resultMap="BaseResultMap">
......
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