Commit 41bf6e19 authored by 高滢's avatar 高滢
parents 8de2cbc3 dcd148f0
...@@ -2,6 +2,8 @@ package com.ruoyi.mapper; ...@@ -2,6 +2,8 @@ package com.ruoyi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.Task; import com.ruoyi.domain.Task;
import com.ruoyi.domain.TaskSampleRelation;
import com.ruoyi.domain.TaskUserRelation;
import com.ruoyi.web.request.TaskFindFinishRequest; import com.ruoyi.web.request.TaskFindFinishRequest;
import com.ruoyi.web.request.TaskFindPendingRequest; import com.ruoyi.web.request.TaskFindPendingRequest;
import com.ruoyi.web.request.TaskFindRequest; import com.ruoyi.web.request.TaskFindRequest;
...@@ -21,6 +23,8 @@ public interface TaskMapper extends BaseMapper<Task> { ...@@ -21,6 +23,8 @@ public interface TaskMapper extends BaseMapper<Task> {
List<Task> findFinish(TaskFindFinishRequest request); List<Task> findFinish(TaskFindFinishRequest request);
List<Task> findUserFinish (@Param("request") TaskFindFinishRequest request,@Param("userId")Long userId);
List<TaskFindResponse> findByUserId(@Param("request") TaskFindRequest request,@Param("userId")Long userId); List<TaskFindResponse> findByUserId(@Param("request") TaskFindRequest request,@Param("userId")Long userId);
Long findByCarReviewTaskId(@Param("carReviewId") Long carReviewId); Long findByCarReviewTaskId(@Param("carReviewId") Long carReviewId);
......
...@@ -47,4 +47,11 @@ public interface TaskService extends IService<Task> { ...@@ -47,4 +47,11 @@ public interface TaskService extends IService<Task> {
List<TaskFindResponse> findCreate(TaskFindRequest request,Long userId); List<TaskFindResponse> findCreate(TaskFindRequest request,Long userId);
TaskGetInfoResponse getInfo(TaskGetInfoRequest request); TaskGetInfoResponse getInfo(TaskGetInfoRequest request);
/**
* 查询已办任务
* @param request
* @return
*/
List<Task> findUserFinish(TaskFindFinishRequest request,Long userId);
} }
...@@ -135,7 +135,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -135,7 +135,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
// 保存关联的零部件样品信息 // 保存关联的零部件样品信息
List<TaskSampleRelation> partRelations = request.getPartSample(); List<TaskSampleRelation> partRelations = request.getPartSample();
if (relations.size() != 0 && relations != null) { if (partRelations.size() != 0 && partRelations != null) {
for (TaskSampleRelation sampleRelation : partRelations) { for (TaskSampleRelation sampleRelation : partRelations) {
sampleRelation.setTaskId(task.getId()); sampleRelation.setTaskId(task.getId());
} }
...@@ -189,29 +189,35 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -189,29 +189,35 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
taskService.updateById(task); taskService.updateById(task);
// 构建并保存该任务所关联的审核组信息 // 构建并保存该任务所关联的审核组信息
List<TaskUserRelation> list = taskUserRelationService.selectQTeamMembers(request.getId());
taskUserRelationService.removeBatchByIds(list);
for(TaskUserRelation auditor : auditors) { for(TaskUserRelation auditor : auditors) {
auditor.setTaskId(task.getId()); auditor.setTaskId(task.getId());
} }
taskUserRelationService.updateBatchById(auditors); taskUserRelationService.saveBatch(auditors);
// 保存关联的整车样品信息 // 保存关联的整车样品信息
List<TaskSampleRelation> relationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE);
taskSampleRelationService.removeBatchByIds(relationList);
List<TaskSampleRelation> relations = request.getSample(); List<TaskSampleRelation> relations = request.getSample();
if (relations.size() != 0 && relations != null) { if (relations.size() != 0 && relations != null) {
for (TaskSampleRelation sampleRelation : relations) { for (TaskSampleRelation sampleRelation : relations) {
sampleRelation.setTaskId(task.getId()); sampleRelation.setTaskId(task.getId());
} }
taskSampleRelationService.updateBatchById(relations); taskSampleRelationService.saveBatch(relations);
} }
// 保存关联的零部件样品信息 // 保存关联的零部件样品信息
List<TaskSampleRelation> partRelationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.PART_VEHICLE_SAMPLE);
taskSampleRelationService.removeBatchByIds(partRelationList);
List<TaskSampleRelation> partRelations = request.getPartSample(); List<TaskSampleRelation> partRelations = request.getPartSample();
if (relations.size() != 0 && relations != null) { if (partRelations.size() != 0 && partRelations != null) {
for (TaskSampleRelation sampleRelation : partRelations) { for (TaskSampleRelation partSampleRelation : partRelations) {
sampleRelation.setTaskId(task.getId()); partSampleRelation.setTaskId(task.getId());
} }
taskSampleRelationService.updateBatchById(partRelations); taskSampleRelationService.saveBatch(partRelations);
} }
} }
...@@ -270,6 +276,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -270,6 +276,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
return response; return response;
} }
@Override
public List<Task> findUserFinish(TaskFindFinishRequest request,Long userId) {
return taskMapper.findUserFinish(request,userId);
}
public Long saveSystemReview(TaskCreateRequest request,SysUser initiator,Standard standard,TaskUserRelation leader) { public Long saveSystemReview(TaskCreateRequest request,SysUser initiator,Standard standard,TaskUserRelation leader) {
// 构建并保存任务信息 // 构建并保存任务信息
......
...@@ -90,7 +90,7 @@ public class TaskController extends BaseController { ...@@ -90,7 +90,7 @@ public class TaskController extends BaseController {
return getDataTable(taskService.findPending(request)); return getDataTable(taskService.findPending(request));
} }
@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")})
@RequestMapping(method = RequestMethod.POST, value = "/findFinish") @RequestMapping(method = RequestMethod.POST, value = "/findFinish")
...@@ -99,6 +99,15 @@ public class TaskController extends BaseController { ...@@ -99,6 +99,15 @@ public class TaskController extends BaseController {
return getDataTable(taskService.findFinish(request)); return getDataTable(taskService.findFinish(request));
} }
@ApiOperation("查询已办任务")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findUserFinish")
public TableDataInfo<Task> findUserFinish(@Validated @RequestBody TaskFindFinishRequest request) {
startPage(request);
return getDataTable(taskService.findUserFinish(request,getUserId()));
}
@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")})
......
package com.ruoyi.web.request; package com.ruoyi.web.request;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.domain.TaskSampleRelation; import com.ruoyi.domain.TaskSampleRelation;
import com.ruoyi.domain.TaskUserRelation; import com.ruoyi.domain.TaskUserRelation;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -13,6 +16,10 @@ import java.util.List; ...@@ -13,6 +16,10 @@ import java.util.List;
@Data @Data
public class TaskEditRequest { public class TaskEditRequest {
@ApiModelProperty("主键")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
@ApiModelProperty("小组成员") @ApiModelProperty("小组成员")
private List<TaskUserRelation> auditors; private List<TaskUserRelation> auditors;
......
...@@ -23,6 +23,10 @@ public class TaskFindResponse { ...@@ -23,6 +23,10 @@ public class TaskFindResponse {
@JsonFormat(shape = JsonFormat.Shape.STRING) @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long carReviewTaskId; private Long carReviewTaskId;
@ApiModelProperty("标准名称(检验依据)")
private String name;
@ApiModelProperty("任务编号") @ApiModelProperty("任务编号")
private String taskNo; private String taskNo;
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<id property="id" column="id" jdbcType="BIGINT"/> <id property="id" column="id" jdbcType="BIGINT"/>
<result property="systemReviewTaskId" column="system_review_task_id" jdbcType="BIGINT"/> <result property="systemReviewTaskId" column="system_review_task_id" jdbcType="BIGINT"/>
<result property="carReviewTaskId" column="car_review_task_id" jdbcType="BIGINT"/> <result property="carReviewTaskId" column="car_review_task_id" jdbcType="BIGINT"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="taskNo" column="task_no" jdbcType="VARCHAR"/> <result property="taskNo" column="task_no" jdbcType="VARCHAR"/>
<result property="taskName" column="task_name" jdbcType="VARCHAR"/> <result property="taskName" column="task_name" jdbcType="VARCHAR"/>
<result property="productModel" column="product_model" jdbcType="VARCHAR"/> <result property="productModel" column="product_model" jdbcType="VARCHAR"/>
...@@ -81,7 +82,7 @@ ...@@ -81,7 +82,7 @@
</select> </select>
<select id="findPending" parameterType="com.ruoyi.web.request.TaskFindPendingRequest" resultMap="ResponseMap"> <select id="findPending" parameterType="com.ruoyi.web.request.TaskFindPendingRequest" resultMap="ResponseMap">
SELECT t.id, t.system_review_task_id, t.car_review_task_id, SELECT t.id, t.system_review_task_id, t.car_review_task_id,
t.task_no,t.task_name,t.task_status, t.task_no,t.task_name,t.task_status,t.run_status,t.name,
t.leader_id,t.leader, t.leader_id,t.leader,
t.task_begin_time, t.task_begin_time,
t.product_model, t.product_model,
...@@ -110,10 +111,10 @@ ...@@ -110,10 +111,10 @@
and t.product_model = #{productModel} and t.product_model = #{productModel}
</if> </if>
<if test="inspectionItem != null and inspectionItem != ''"> <if test="inspectionItem != null and inspectionItem != ''">
AND ( AND(
(inspectionItem = 'sraif' AND t.system_review_task_id IS NOT NULL) (#{inspectionItem} = 'sraif' AND t.system_review_task_id IS NOT NULL)
OR OR
(inspectionItem = 'grfis' AND t.car_review_task_id IS NOT NULL) (#{inspectionItem} = 'grfis' AND t.car_review_task_id IS NOT NULL)
) )
</if> </if>
</where> </where>
...@@ -121,7 +122,7 @@ ...@@ -121,7 +122,7 @@
</select> </select>
<select id="findFinish" parameterType="com.ruoyi.web.request.TaskFindFinishRequest" resultType="com.ruoyi.domain.Task"> <select id="findFinish" parameterType="com.ruoyi.web.request.TaskFindFinishRequest" resultType="com.ruoyi.domain.Task">
SELECT t.id, t.system_review_task_id, t.car_review_task_id, SELECT t.id, t.system_review_task_id, t.car_review_task_id,
t.task_no,t.task_name,t.task_status, t.task_no,t.task_name,t.task_status,t.name,
t.product_model, t.product_model,
t.leader_id,t.leader, t.leader_id,t.leader,
t.task_begin_time,t.task_end_time t.task_begin_time,t.task_end_time
...@@ -142,9 +143,9 @@ ...@@ -142,9 +143,9 @@
</if> </if>
<if test="inspectionItem != null and inspectionItem != ''"> <if test="inspectionItem != null and inspectionItem != ''">
AND ( AND (
(inspectionItem = 'sraif' AND t.system_review_task_id IS NOT NULL) (#{inspectionItem} = 'sraif' AND t.system_review_task_id IS NOT NULL)
OR OR
(inspectionItem = 'grfis' AND t.car_review_task_id IS NOT NULL) (#{inspectionItem} = 'grfis' AND t.car_review_task_id IS NOT NULL)
) )
</if> </if>
</where> </where>
...@@ -161,7 +162,7 @@ ...@@ -161,7 +162,7 @@
</select> </select>
<select id="findByUserId" resultMap="ResponseMap"> <select id="findByUserId" resultMap="ResponseMap">
SELECT t.id, t.system_review_task_id, t.car_review_task_id, SELECT t.id, t.system_review_task_id, t.car_review_task_id,
t.task_no,t.task_name,t.task_status, t.task_no,t.task_name,t.task_status,t.name,
t.product_model, t.product_model,
t.leader_id,t.leader, t.leader_id,t.leader,
t.task_begin_time, t.task_begin_time,
...@@ -192,9 +193,9 @@ ...@@ -192,9 +193,9 @@
</if> </if>
<if test="request.inspectionItem != null and request.inspectionItem != ''"> <if test="request.inspectionItem != null and request.inspectionItem != ''">
AND ( AND (
(request.inspectionItem = 'sraif' AND t.system_review_task_id IS NOT NULL) (#{request.inspectionItem} = 'sraif' AND t.system_review_task_id IS NOT NULL)
OR OR
(request.inspectionItem = 'grfis' AND t.car_review_task_id IS NOT NULL) (#{request.inspectionItem} = 'grfis' AND t.car_review_task_id IS NOT NULL)
) )
</if> </if>
<if test="request.taskStatus != null and request.taskStatus != ''"> <if test="request.taskStatus != null and request.taskStatus != ''">
...@@ -203,6 +204,39 @@ ...@@ -203,6 +204,39 @@
</where> </where>
order by t.create_time desc order by t.create_time desc
</select> </select>
<select id="findUserFinish" parameterType="com.ruoyi.web.request.TaskFindFinishRequest" resultType="com.ruoyi.domain.Task">
SELECT t.id, t.system_review_task_id, t.car_review_task_id,
t.task_no,t.task_name,t.task_status,t.name,
t.product_model,
t.leader_id,t.leader,
t.task_begin_time,t.task_end_time
FROM t_task t
<where>
t.id IN (
SELECT task_id FROM t_task_user_relation WHERE user_id = #{userId}
)
and t.task_status = 'FINISH'
<if test="request.standardId != null and request.standardId != ''">
and t.standard_id = #{standardId}
</if>
<if test="request.taskNo != null and request.taskNo != ''">
and t.task_no = #{taskNo}
</if>
<if test="request.taskName != null and request.taskName != ''">
and t.task_name like concat('%',#{taskName},'%')
</if>
<if test="request.productModel != null and request.productModel != ''">
and t.product_model = #{productModel}
</if>
<if test="request.inspectionItem != null and request.inspectionItem != ''">
AND (
(#{request.inspectionItem} = 'sraif' AND t.system_review_task_id IS NOT NULL)
OR
(#{request.inspectionItem} = 'grfis' AND t.car_review_task_id IS NOT NULL)
)
</if>
</where>
</select>
</mapper> </mapper>
...@@ -9,10 +9,11 @@ ...@@ -9,10 +9,11 @@
<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">
select task_id,user_id,is_leader,name from t_task_user_relation select task_id,user_id,is_leader,name,dept_name from t_task_user_relation
</sql> </sql>
<select id="selectQTeamMembers" parameterType="Long" resultMap="BaseResultMap"> <select id="selectQTeamMembers" parameterType="Long" resultMap="BaseResultMap">
......
...@@ -6,9 +6,9 @@ spring: ...@@ -6,9 +6,9 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://10.12.48.76:22030/vehicle-quality-review?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://${MYSQL_IP}:${MYSQL_PORT}/vehicle-quality-review?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: ${MYSQL_USERNAME}
password: 1qaz@WSX password: ${MYSQL_PASSWORD}
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
...@@ -47,8 +47,8 @@ spring: ...@@ -47,8 +47,8 @@ spring:
allow: allow:
url-pattern: /druid/* url-pattern: /druid/*
# 控制台管理用户名和密码 # 控制台管理用户名和密码
login-username: ruoyi login-username: ${CONSOLE_LOGIN_USERNAME}
login-password: 1qaz@WSX login-password: ${CONSOLE_LOGIN_PASSWORD}
filter: filter:
stat: stat:
enabled: true enabled: true
......
...@@ -9,7 +9,7 @@ ruoyi: ...@@ -9,7 +9,7 @@ ruoyi:
# 实例演示开关 # 实例演示开关
demoEnabled: true demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
profile: /data/docker_volume/2024/secureTest/application/upload profile: /data//upload
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false
# 验证码类型 math 数字计算 char 字符验证 # 验证码类型 math 数字计算 char 字符验证
...@@ -68,13 +68,13 @@ spring: ...@@ -68,13 +68,13 @@ spring:
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: 10.12.48.77 host: ${REDIS_IP}
# 端口,默认为6379 # 端口,默认为6379
port: 22031 port: ${REDIS_PORT}
# 数据库索引 # 数据库索引
database: 0 database: 0
# 密码 # 密码
password: 1qaz@WSX password: ${REDIS_PWD}
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
...@@ -93,7 +93,7 @@ token: ...@@ -93,7 +93,7 @@ token:
# 令牌自定义标识 # 令牌自定义标识
header: Authorization header: Authorization
# 令牌密钥 # 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz secret: ${TOKEN_SECRET}
# 令牌有效期(默认30分钟) # 令牌有效期(默认30分钟)
expireTime: 30 expireTime: 30
...@@ -144,7 +144,7 @@ xss: ...@@ -144,7 +144,7 @@ xss:
urlPatterns: /system/*,/monitor/*,/tool/* urlPatterns: /system/*,/monitor/*,/tool/*
minio: minio:
url: http://10.12.48.79:22038 url: ${MINIO_URL}
accessKey: lB7WhZYiQwLzhHPutRGn accessKey: ${MINIO_ACCESSKEY}
secretKey: 7XMWpLm6p4d20OFe9uXKifEyhF3cp4sTCowI2fhJ secretKey: ${MINIO_SECRETKEY}
bucketName: vehicle-quality-review-oss bucketName: vehicle-quality-review-oss
\ No newline at end of file
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