Commit b96de2b8 authored by 王飞's avatar 王飞

Merge branch 'wangdingyi' into 'dev'

根据任务id分页查询车企留档文件

See merge request !117
parents e5ccadd0 5de4250c
...@@ -3,6 +3,7 @@ package com.ruoyi.mapper; ...@@ -3,6 +3,7 @@ package com.ruoyi.mapper;
import com.ruoyi.domain.ReviewEnterpriseArchive; import com.ruoyi.domain.ReviewEnterpriseArchive;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewItemVO; import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewItemVO;
import com.ruoyi.web.request.ReviewEnterpriseArchiveFindByTaskIdRequest;
import com.ruoyi.web.request.ReviewEnterpriseArchiveFindRequest; import com.ruoyi.web.request.ReviewEnterpriseArchiveFindRequest;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -29,6 +30,8 @@ public interface ReviewEnterpriseArchiveMapper extends BaseMapper<ReviewEnterpri ...@@ -29,6 +30,8 @@ public interface ReviewEnterpriseArchiveMapper extends BaseMapper<ReviewEnterpri
ReviewEnterpriseArchive findByFileName(@Param("fileName") String fileName); ReviewEnterpriseArchive findByFileName(@Param("fileName") String fileName);
List<ReviewEnterpriseArchive> findList(@Param("taskId") Long taskId); List<ReviewEnterpriseArchive> findList(@Param("taskId") Long taskId);
List<ReviewEnterpriseArchive> findEnterpriseArchiveByTaskId(ReviewEnterpriseArchiveFindByTaskIdRequest request);
} }
......
...@@ -33,4 +33,6 @@ public interface TaskMapper extends BaseMapper<Task> { ...@@ -33,4 +33,6 @@ public interface TaskMapper extends BaseMapper<Task> {
Long findBySystemReviewTaskId(@Param("systemReviewId") Long systemReviewId); Long findBySystemReviewTaskId(@Param("systemReviewId") Long systemReviewId);
Task getByUserIdTemporary(@Param("userId") Long userId); Task getByUserIdTemporary(@Param("userId") Long userId);
Task getBySubtaskId(@Param("subId") Long subId);
} }
...@@ -3,6 +3,7 @@ package com.ruoyi.service; ...@@ -3,6 +3,7 @@ package com.ruoyi.service;
import com.ruoyi.domain.ReviewEnterpriseArchive; import com.ruoyi.domain.ReviewEnterpriseArchive;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewVO; import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewVO;
import com.ruoyi.web.request.ReviewEnterpriseArchiveFindByTaskIdRequest;
import com.ruoyi.web.request.ReviewEnterpriseArchiveFindFileNameListRequest; import com.ruoyi.web.request.ReviewEnterpriseArchiveFindFileNameListRequest;
import com.ruoyi.web.request.ReviewEnterpriseArchiveFindRequest; import com.ruoyi.web.request.ReviewEnterpriseArchiveFindRequest;
import com.ruoyi.web.request.ReviewEnterpriseArchiveGetInfoRequest; import com.ruoyi.web.request.ReviewEnterpriseArchiveGetInfoRequest;
...@@ -36,4 +37,6 @@ public interface ReviewEnterpriseArchiveService extends IService<ReviewEnterpris ...@@ -36,4 +37,6 @@ public interface ReviewEnterpriseArchiveService extends IService<ReviewEnterpris
ReviewEnterpriseArchive getInfo(ReviewEnterpriseArchiveGetInfoRequest request); ReviewEnterpriseArchive getInfo(ReviewEnterpriseArchiveGetInfoRequest request);
List<ReviewEnterpriseArchive> findList(ReviewEnterpriseArchiveFindFileNameListRequest request); List<ReviewEnterpriseArchive> findList(ReviewEnterpriseArchiveFindFileNameListRequest request);
List<ReviewEnterpriseArchive> findEnterpriseArchiveByTaskId(ReviewEnterpriseArchiveFindByTaskIdRequest request);
} }
...@@ -58,4 +58,6 @@ public interface TaskService extends IService<Task> { ...@@ -58,4 +58,6 @@ public interface TaskService extends IService<Task> {
void temporaryStorageTask(TaskCreateRequest request); void temporaryStorageTask(TaskCreateRequest request);
TaskGetInfoResponse getByUserId(Long userId); TaskGetInfoResponse getByUserId(Long userId);
TaskGetInfoResponse getBySubtaskId(TaskSubGetInfoRequest request);
} }
...@@ -12,6 +12,7 @@ import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewVO; ...@@ -12,6 +12,7 @@ import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewVO;
import com.ruoyi.service.ReviewEnterpriseArchiveService; import com.ruoyi.service.ReviewEnterpriseArchiveService;
import com.ruoyi.mapper.ReviewEnterpriseArchiveMapper; import com.ruoyi.mapper.ReviewEnterpriseArchiveMapper;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.request.ReviewEnterpriseArchiveFindByTaskIdRequest;
import com.ruoyi.web.request.ReviewEnterpriseArchiveFindFileNameListRequest; import com.ruoyi.web.request.ReviewEnterpriseArchiveFindFileNameListRequest;
import com.ruoyi.web.request.ReviewEnterpriseArchiveFindRequest; import com.ruoyi.web.request.ReviewEnterpriseArchiveFindRequest;
import com.ruoyi.web.request.ReviewEnterpriseArchiveGetInfoRequest; import com.ruoyi.web.request.ReviewEnterpriseArchiveGetInfoRequest;
...@@ -88,6 +89,11 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp ...@@ -88,6 +89,11 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
return reviewEnterpriseArchiveMapper.findList(request.getTaskId()); return reviewEnterpriseArchiveMapper.findList(request.getTaskId());
} }
@Override
public List<ReviewEnterpriseArchive> findEnterpriseArchiveByTaskId(ReviewEnterpriseArchiveFindByTaskIdRequest request) {
return reviewEnterpriseArchiveMapper.findEnterpriseArchiveByTaskId(request);
}
private List<ReviewEnterpriseArchiveViewVO> buildReviewEnterpriseArchiveViewVO(List<ReviewEnterpriseArchive> archives, List<ReviewEnterpriseArchiveViewItemVO> viewItems) { private List<ReviewEnterpriseArchiveViewVO> buildReviewEnterpriseArchiveViewVO(List<ReviewEnterpriseArchive> archives, List<ReviewEnterpriseArchiveViewItemVO> viewItems) {
List<ReviewEnterpriseArchiveViewVO> viewList = new ArrayList(); List<ReviewEnterpriseArchiveViewVO> viewList = new ArrayList();
......
...@@ -302,25 +302,24 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -302,25 +302,24 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
TaskGetInfoResponse response = new TaskGetInfoResponse(); TaskGetInfoResponse response = new TaskGetInfoResponse();
Task task = taskService.getById(request.getId()); Task task = taskService.getById(request.getId());
if (task != null) {
BeanUtils.copyBeanProp(response, task); BeanUtils.copyBeanProp(response, task);
// 小组成员 // 小组成员
List<TaskUserRelation> relation = taskUserRelationService.selectQTeamMembers(request.getId()); response.setAuditors(setAuditors(request.getId()));
response.setAuditors(relation);
// 整车样品信息 // 整车样品信息
List<TaskSampleRelation> relationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE); response.setCompleteVehicleSample(setSampleList(request.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE));
if (relationList.size() != 0 && relationList != null) {
List<Sample> completeVehicleSampleList = sampleManagementMapper.findByIdList(relationList);
response.setCompleteVehicleSample(completeVehicleSampleList);
}
// 零部件样品信息 // 零部件样品信息
List<TaskSampleRelation> partRelationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.PART_VEHICLE_SAMPLE); response.setPartVehicleSample(setSampleList(request.getId(),TaskSampleRelation.PART_VEHICLE_SAMPLE));
if (partRelationList.size() != 0 && partRelationList != null) {
List<Sample> partVehicleSampleList = sampleManagementMapper.findByIdList(partRelationList);
response.setPartVehicleSample(partVehicleSampleList);
}
return response; return response;
} else {
return null;
}
} }
@Override @Override
...@@ -408,27 +407,65 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -408,27 +407,65 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
if (task != null && task.getId() != null) { if (task != null && task.getId() != null) {
BeanUtils.copyBeanProp(response, task); BeanUtils.copyBeanProp(response, task);
// 小组成员 // 小组成员
List<TaskUserRelation> relation = taskUserRelationService.selectQTeamMembers(task.getId()); response.setAuditors(setAuditors(task.getId()));
response.setAuditors(relation);
// 整车样品信息 // 整车样品信息
List<TaskSampleRelation> relationList = taskSampleRelationService.selectByTaskId(task.getId(), TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE); response.setCompleteVehicleSample(setSampleList(task.getId(), TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE));
if (relationList.size() != 0 && relationList != null) {
List<Sample> completeVehicleSampleList = sampleManagementMapper.findByIdList(relationList);
response.setCompleteVehicleSample(completeVehicleSampleList);
}
// 零部件样品信息 // 零部件样品信息
List<TaskSampleRelation> partRelationList = taskSampleRelationService.selectByTaskId(task.getId(), TaskSampleRelation.PART_VEHICLE_SAMPLE); response.setPartVehicleSample(setSampleList(task.getId(), TaskSampleRelation.PART_VEHICLE_SAMPLE));
if (partRelationList.size() != 0 && partRelationList != null) {
List<Sample> partVehicleSampleList = sampleManagementMapper.findByIdList(partRelationList); return response;
response.setPartVehicleSample(partVehicleSampleList); } else {
return null;
}
} }
@Override
public TaskGetInfoResponse getBySubtaskId(TaskSubGetInfoRequest request) {
TaskGetInfoResponse response = new TaskGetInfoResponse();
Task task = taskMapper.getBySubtaskId(request.getId());
if (task != null) {
BeanUtils.copyBeanProp(response, task);
// 小组成员
response.setAuditors(setAuditors(task.getId()));
// 整车样品信息
response.setCompleteVehicleSample(setSampleList(task.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE));
// 零部件样品信息
response.setPartVehicleSample(setSampleList(task.getId(),TaskSampleRelation.PART_VEHICLE_SAMPLE));
return response; return response;
} else { } else {
return null; return null;
} }
}
public List<TaskUserRelation> setAuditors ( Long id) {
// 小组成员
List<TaskUserRelation> relation = taskUserRelationService.selectQTeamMembers(id);
return relation;
}
public List<Sample> setSampleList(Long id,String type) {
// 样品信息
List<TaskSampleRelation> relationList = taskSampleRelationService.selectByTaskId(id,type);
if (relationList.size() != 0 && relationList != null) {
List<Sample> SampleList = sampleManagementMapper.findByIdList(relationList);
return SampleList;
} else {
return null;
}
} }
......
...@@ -40,6 +40,15 @@ public class ReviewEnterpriseArchiveController extends BaseController { ...@@ -40,6 +40,15 @@ public class ReviewEnterpriseArchiveController extends BaseController {
return getDataTable(reviewEnterpriseArchiveService.findEnterpriseArchive(request)); return getDataTable(reviewEnterpriseArchiveService.findEnterpriseArchive(request));
} }
@ApiOperation("根据任务id分页查询车企文件")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findEnterpriseArchiveByTaskId")
public TableDataInfo<ReviewEnterpriseArchive> findEnterpriseArchiveByTaskId(@Validated @RequestBody ReviewEnterpriseArchiveFindByTaskIdRequest request) {
startPage(request);
return getDataTable(reviewEnterpriseArchiveService.findEnterpriseArchiveByTaskId(request));
}
@ApiOperation("根据id查询") @ApiOperation("根据id查询")
@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")})
......
...@@ -91,6 +91,16 @@ public class TaskController extends BaseController { ...@@ -91,6 +91,16 @@ public class TaskController extends BaseController {
return R.ok(response); return R.ok(response);
} }
@ApiOperation("根据子任务id查看任务详情")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getBySubtaskId")
public R<TaskGetInfoResponse> getBySubtaskId(@Validated @RequestBody TaskSubGetInfoRequest request) {
TaskGetInfoResponse response = taskService.getBySubtaskId(request);
return R.ok(response);
}
@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;
import com.ruoyi.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "ReviewEnterpriseArchiveFindByTaskIdRequest", description = "根据任务id查询车企文件")
@Data
public class ReviewEnterpriseArchiveFindByTaskIdRequest extends PageDomain {
@ApiModelProperty("文件名称")
private String fileName;
@ApiModelProperty("文件状态")
private String status;
@ApiModelProperty("文件识别号")
private String identifyNumber;
@ApiModelProperty("任务id")
private Long taskId;
}
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "TaskSubGetInfoRequest", description = "根据子任务id查看任务详情")
@Data
public class TaskSubGetInfoRequest {
@ApiModelProperty("id")
private Long id;
}
...@@ -65,4 +65,20 @@ ...@@ -65,4 +65,20 @@
FROM t_review_enterprise_archive FROM t_review_enterprise_archive
where task_id = #{taskId} where task_id = #{taskId}
</select> </select>
<select id="findEnterpriseArchiveByTaskId" resultType="com.ruoyi.domain.ReviewEnterpriseArchive">
SELECT id, enterprise_name, file_name, version, publish_date, status, identify_number, storage, photo, task_id, create_by, create_time
FROM t_review_enterprise_archive
<where>
task_id = #{taskId}
<if test="fileName != null and fileName != ''">
and file_name like concat('%',#{fileName},'%')
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="identifyNumber != null and identifyNumber != ''">
and identify_number = #{identifyNumber}
</if>
</where>
</select>
</mapper> </mapper>
...@@ -252,6 +252,19 @@ ...@@ -252,6 +252,19 @@
FROM t_task FROM t_task
WHERE task_initiator_id = #{userId} and task_status = 'TEMPORARILY' WHERE task_initiator_id = #{userId} and task_status = 'TEMPORARILY'
</select> </select>
<select id="getBySubtaskId" resultType="com.ruoyi.domain.Task">
SELECT id, system_review_task_id, car_review_task_id,
task_status,run_status,next_node,task_no,task_name,confidentiality_level,
product_name,product_model,
entrusted_unit,entrusted_unit_address,entrusted_unit_phone,
entrusted_unit_code,vehicle_sample_information,part_sample_information,
task_initiator_id,task_initiator,task_initiator_dept,
task_begin_time,task_end_time,create_time,
leader_id,leader,standard_id,name,
standard_no,file,task_list
FROM t_task
WHERE system_review_task_id = #{subId} OR car_review_task_id = #{subId}
</select>
</mapper> </mapper>
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