Commit 32023026 authored by 盖献康's avatar 盖献康

Merge branch 'dev' of...

Merge branch 'dev' of ssh://gitlab.91isoft.com:10022/wangfei/vehicle-quality-review into gaixiankang
parents 0ed84579 e8d94514
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 java.io.Serializable;
......@@ -78,4 +79,16 @@ public class ReviewDetailsResult implements Serializable {
@ApiModelProperty("最后修改时间")
private Date lastModifyTime;
@ApiModelProperty("文件目录")
private String catalogue;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@ApiModelProperty("关联到车企留档文件")
private Long reviewEnterpriseArchiveId;
@TableField(exist = false)
@ApiModelProperty("企业名称")
private String enterpriseName;
}
......@@ -27,46 +27,62 @@ public class ReviewEnterpriseArchive implements Serializable {
/**
* 企业名称
*/
@ApiModelProperty("企业名称")
private String enterpriseName;
/**
* 文件名称
*/
@ApiModelProperty("文件名称")
private String fileName;
/**
* 文件版本
*/
@ApiModelProperty("文件版本")
private String version;
/**
* 发布日期
*/
@ApiModelProperty("发布日期")
private Date publishDate;
/**
* 文件状态
*/
@ApiModelProperty("文件状态")
private String status;
/**
* 文件识别号
*/
@ApiModelProperty("文件识别号")
private String identifyNumber;
/**
* 存储位置
*/
@ApiModelProperty("存储位置")
private String storage;
/**
* 图片地址
*/
@ApiModelProperty("图片地址")
private String photo;
/**
* 关联到任务id
*/
@ApiModelProperty("关联到任务id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long taskId;
@ApiModelProperty("创建人")
private String createBy;
@ApiModelProperty("创建时间")
private Date createTime;
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.ruoyi.mapper;
import com.ruoyi.domain.ReviewEnterpriseArchive;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewItemVO;
import com.ruoyi.web.request.ReviewEnterpriseArchiveFindRequest;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -20,6 +21,14 @@ public interface ReviewEnterpriseArchiveMapper extends BaseMapper<ReviewEnterpri
List<ReviewEnterpriseArchive> findByTaskId(@Param("taskId") Long taskId);
List<ReviewEnterpriseArchiveViewItemVO> findViewItemVOByTaskId(@Param("taskId") Long taskId);
Long findFileName(@Param("taskId") Long taskId,@Param("fileName") String fileName);
List<ReviewEnterpriseArchive> findEnterpriseArchive(ReviewEnterpriseArchiveFindRequest request);
ReviewEnterpriseArchive findByFileName(@Param("fileName") String fileName);
List<ReviewEnterpriseArchive> findList(@Param("taskId") Long taskId);
}
......
......@@ -3,6 +3,10 @@ package com.ruoyi.service;
import com.ruoyi.domain.ReviewEnterpriseArchive;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewVO;
import com.ruoyi.web.request.ReviewEnterpriseArchiveFindFileNameListRequest;
import com.ruoyi.web.request.ReviewEnterpriseArchiveFindRequest;
import com.ruoyi.web.request.ReviewEnterpriseArchiveGetInfoRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -15,4 +19,21 @@ public interface ReviewEnterpriseArchiveService extends IService<ReviewEnterpris
List<ReviewEnterpriseArchiveViewVO> view(Long taskId);
Long addEnterpriseArchive(ReviewEnterpriseArchive reviewEnterpriseArchive);
/**
* 分页查询
* @param request
* @return
*/
List<ReviewEnterpriseArchive> findEnterpriseArchive(ReviewEnterpriseArchiveFindRequest request);
/**
* 查看详情
* @param request
* @return
*/
ReviewEnterpriseArchive getInfo(ReviewEnterpriseArchiveGetInfoRequest request);
List<ReviewEnterpriseArchive> findList(ReviewEnterpriseArchiveFindFileNameListRequest request);
}
......@@ -3,6 +3,7 @@ package com.ruoyi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.Standard;
import com.ruoyi.web.request.StandardEditRequest;
import com.ruoyi.web.request.StandardGetInfoRequest;
import com.ruoyi.web.request.StandardListRequest;
import java.util.List;
......@@ -19,4 +20,6 @@ public interface StandardService extends IService<Standard> {
Standard findListById(Long id);
void editStandard(StandardEditRequest request);
Standard getInfo(StandardGetInfoRequest request);
}
......@@ -48,6 +48,8 @@ public class ReviewDetailsResultServiceImpl extends ServiceImpl<ReviewDetailsRes
result.setUserId(loginUser.getUserId());
result.setUserName(loginUser.getNickName());
result.setLastModifyTime(new Date());
result.setCatalogue(request.getCatalogue());
result.setReviewEnterpriseArchiveId(request.getReviewEnterpriseArchiveId());
this.baseMapper.updateById(result);
} else {
......@@ -55,6 +57,8 @@ public class ReviewDetailsResultServiceImpl extends ServiceImpl<ReviewDetailsRes
ReviewDetailsResult reviewDetailsResult = new ReviewDetailsResult();
reviewDetailsResult.setTaskId(request.getTaskId());
reviewDetailsResult.setReviewDetailsId(request.getReviewDetailsId());
reviewDetailsResult.setReviewEnterpriseArchiveId(request.getReviewEnterpriseArchiveId());
reviewDetailsResult.setCatalogue(request.getCatalogue());
reviewDetailsResult.setPassed(request.getPassed());
reviewDetailsResult.setUserId(loginUser.getUserId());
reviewDetailsResult.setUserName(loginUser.getNickName());
......
package com.ruoyi.service.impl;
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.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.domain.ReviewEnterpriseArchive;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewItemVO;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewVO;
import com.ruoyi.service.ReviewEnterpriseArchiveService;
import com.ruoyi.mapper.ReviewEnterpriseArchiveMapper;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.request.ReviewEnterpriseArchiveFindFileNameListRequest;
import com.ruoyi.web.request.ReviewEnterpriseArchiveFindRequest;
import com.ruoyi.web.request.ReviewEnterpriseArchiveGetInfoRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
......@@ -24,6 +34,12 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
@Autowired
private ReviewEnterpriseArchiveMapper reviewEnterpriseArchiveMapper;
@Autowired
private ISysUserService sysUserService;
@Autowired
private ReviewEnterpriseArchiveService reviewEnterpriseArchiveService;
@Override
public List<ReviewEnterpriseArchiveViewVO> view(Long taskId) {
......@@ -34,6 +50,44 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
return buildReviewEnterpriseArchiveViewVO(archives, viewItems);
}
@Override
public Long addEnterpriseArchive(ReviewEnterpriseArchive reviewEnterpriseArchive) {
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = sysUserService.selectUserById(loginUser.getUserId());
reviewEnterpriseArchive.setCreateBy(user.getNickName());
reviewEnterpriseArchive.setCreateTime(new Date());
Long sum = reviewEnterpriseArchiveMapper.findFileName(reviewEnterpriseArchive.getTaskId(),reviewEnterpriseArchive.getFileName());
if (sum >0 ) {
throw new ServiceException("新增文件名称重复,请检查", HttpStatus.ERROR);
} else {
reviewEnterpriseArchiveService.save(reviewEnterpriseArchive);
}
return reviewEnterpriseArchive.getId();
}
@Override
public List<ReviewEnterpriseArchive> findEnterpriseArchive(ReviewEnterpriseArchiveFindRequest request) {
return reviewEnterpriseArchiveMapper.findEnterpriseArchive(request);
}
@Override
public ReviewEnterpriseArchive getInfo(ReviewEnterpriseArchiveGetInfoRequest request) {
return reviewEnterpriseArchiveMapper.selectById(request.getId());
}
@Override
public List<ReviewEnterpriseArchive> findList(ReviewEnterpriseArchiveFindFileNameListRequest request) {
return reviewEnterpriseArchiveMapper.findList(request.getTaskId());
}
private List<ReviewEnterpriseArchiveViewVO> buildReviewEnterpriseArchiveViewVO(List<ReviewEnterpriseArchive> archives, List<ReviewEnterpriseArchiveViewItemVO> viewItems) {
List<ReviewEnterpriseArchiveViewVO> viewList = new ArrayList();
......
......@@ -71,10 +71,12 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
public int insertSampleManagement(Sample sampleManagement)
{
// 判断车辆识别码是否重复
if(Sample.SAMPLE_FLAG_CAR.equals(sampleManagement.getFlag())){
int dentificationCode = sampleManagementMapper.selectIdentificationCodeCount(sampleManagement);
if(dentificationCode>0){
throw new ServiceException("车辆识别码已存在");
}
}
// 判断样品编号是否存在
int sampleNumber = sampleManagementMapper.selectSampleNumberCount(sampleManagement);
if(sampleNumber>0){
......@@ -95,10 +97,12 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
public int updateSampleManagement(Sample sampleManagement)
{
// 判断车辆识别码是否重复
if(Sample.SAMPLE_FLAG_CAR.equals(sampleManagement.getFlag())){
int dentificationCode = sampleManagementMapper.selectIdentificationCodeCount(sampleManagement);
if(dentificationCode>0){
throw new ServiceException("车辆识别码已存在");
}
}
// 判断样品编号是否存在
int sampleNumber = sampleManagementMapper.selectSampleNumberCount(sampleManagement);
if(sampleNumber>0){
......
......@@ -6,6 +6,7 @@ import com.ruoyi.domain.Standard;
import com.ruoyi.mapper.StandardMapper;
import com.ruoyi.service.StandardService;
import com.ruoyi.web.request.StandardEditRequest;
import com.ruoyi.web.request.StandardGetInfoRequest;
import com.ruoyi.web.request.StandardListRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -48,4 +49,9 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
BeanUtils.copyBeanProp(standard, request);
standardService.updateById(standard);
}
@Override
public Standard getInfo(StandardGetInfoRequest request) {
return standardMapper.selectById(request.getId());
}
}
......@@ -53,6 +53,15 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
@Autowired
private ReviewTaskInboxMapper reviewTaskInboxMapper;
@Autowired
private TaskMapper taskMapper;
@Autowired
private TaskSampleRelationMapper taskSampleRelationMapper;
@Autowired
private SampleManagementMapper sampleManagementMapper;
// PENDING状态下
// 1.standard字段查询当前最新问卷
// 2.查询场景变更任务
......@@ -65,6 +74,19 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
// 获取当前问卷答案
List<ReviewDetailsResult> results = reviewDetailsResultService.findByTaskId(carReviewTask.getId());
// 任务样品关系
List<TaskSampleRelation> relations = taskSampleRelationMapper.selectByTaskId(taskMapper.findByCarReviewTaskId(carReviewTask.getId()),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE);
if (results.size() != 0 && results != null) {
for (ReviewDetailsResult reviewDetailsResult : results) {
if (reviewDetailsResult != null && reviewDetailsResult.getReviewEnterpriseArchiveId() == null && relations.size() != 0 && relations != null) {
TaskSampleRelation taskSampleRelation = relations.get(0);
Sample sample = sampleManagementMapper.selectSampleManagementById(taskSampleRelation.getSampleId());
reviewDetailsResult.setEnterpriseName(sample.getManufacturingEnterprise());
}
}
}
// 绑定问卷与答案
setDetailsResult(standardTree, results);
......
......@@ -5,10 +5,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.domain.*;
import com.ruoyi.mapper.ReviewDetailsMapper;
import com.ruoyi.mapper.ReviewDetailsResultMapper;
import com.ruoyi.mapper.ReviewTaskInboxMapper;
import com.ruoyi.mapper.SystemReviewTaskMapper;
import com.ruoyi.mapper.*;
import com.ruoyi.service.*;
import com.ruoyi.web.response.SystemReviewTaskViewResponse;
import org.springframework.beans.factory.InitializingBean;
......@@ -53,6 +50,15 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
@Autowired
private ReviewTaskInboxMapper reviewTaskInboxMapper;
@Autowired
private TaskMapper taskMapper;
@Autowired
private TaskSampleRelationMapper taskSampleRelationMapper;
@Autowired
private SampleManagementMapper sampleManagementMapper;
@Override
public void doStart(SystemReviewTask systemReviewTask) {
throw new ServiceException("不能开始一个已经开始的任务", HttpStatus.ERROR);
......@@ -116,6 +122,19 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
// 获取当前问卷答案
List<ReviewDetailsResult> results = reviewDetailsResultService.findByTaskId(systemReviewTask.getId());
// 任务样品关系
List<TaskSampleRelation> relations = taskSampleRelationMapper.selectByTaskId(taskMapper.findBySystemReviewTaskId(systemReviewTask.getId()),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE);
if (results.size() != 0 && results != null) {
for (ReviewDetailsResult reviewDetailsResult : results) {
if (reviewDetailsResult != null && reviewDetailsResult.getReviewEnterpriseArchiveId() == null && relations.size() != 0 && relations != null) {
TaskSampleRelation taskSampleRelation = relations.get(0);
Sample sample = sampleManagementMapper.selectSampleManagementById(taskSampleRelation.getSampleId());
reviewDetailsResult.setEnterpriseName(sample.getManufacturingEnterprise());
}
}
}
// 绑定问卷与答案
setDetailsResult(standardTree, results);
......
......@@ -66,6 +66,15 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
@Autowired
private SampleManagementMapper sampleManagementMapper;
@Autowired
private TaskSampleRelationMapper taskSampleRelationMapper;
@Autowired
private ReviewEnterpriseArchiveMapper reviewEnterpriseArchiveMapper;
@Autowired
private ReviewEnterpriseArchiveService reviewEnterpriseArchiveService;
@Override
public List<Task> findList(TaskListRequest request) {
......@@ -198,27 +207,55 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
taskUserRelationService.saveBatch(auditors);
// 保存关联的整车样品信息
List<TaskSampleRelation> relationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE);
taskSampleRelationService.removeBatchByIds(relationList);
List<TaskSampleRelation> relations = request.getSample();
if (relations.size() != 0 && relations != null) {
for (TaskSampleRelation sampleRelation : relations) {
sampleRelation.setTaskId(task.getId());
}
taskSampleRelationService.saveBatch(relations);
taskSampleRelationService.updateBatchById(relations);
}
// 任务样品关系
List<TaskSampleRelation> sampleRelations = taskSampleRelationMapper.selectByTaskId(request.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE);
// 获取之前的第一个企业名称
TaskSampleRelation taskSampleRelation = sampleRelations.get(0);
Sample sample = sampleManagementMapper.selectSampleManagementById(taskSampleRelation.getSampleId());
// 获取编辑任务后的第一个企业名称
TaskSampleRelation taskSampleRelation1 = relations.get(0);
Sample sample1 = sampleManagementMapper.selectSampleManagementById(taskSampleRelation1.getSampleId());
// 第一个企业名称不相同则修改
if (!Objects.equals(sample.getManufacturingEnterprise(), sample1.getManufacturingEnterprise())){
Task task1 = taskMapper.selectById(request.getId());
// 体系审查对应的留档文件
List<ReviewEnterpriseArchive> reviewEnterpriseArchiveList = reviewEnterpriseArchiveMapper.findList(task1.getSystemReviewTaskId());
for (ReviewEnterpriseArchive reviewEnterpriseArchive : reviewEnterpriseArchiveList) {
reviewEnterpriseArchive.setEnterpriseName(sample1.getManufacturingEnterprise());
}
reviewEnterpriseArchiveService.updateBatchById(reviewEnterpriseArchiveList);
// 车辆对应的留档文件
List<ReviewEnterpriseArchive> reviewEnterpriseArchiveList1 = reviewEnterpriseArchiveMapper.findList(task1.getCarReviewTaskId());
for (ReviewEnterpriseArchive reviewEnterpriseArchive1 : reviewEnterpriseArchiveList1) {
reviewEnterpriseArchive1.setEnterpriseName(sample1.getManufacturingEnterprise());
}
reviewEnterpriseArchiveService.updateBatchById(reviewEnterpriseArchiveList1);
}
// 保存关联的零部件样品信息
List<TaskSampleRelation> partRelationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.PART_VEHICLE_SAMPLE);
taskSampleRelationService.removeBatchByIds(partRelationList);
List<TaskSampleRelation> partRelations = request.getPartSample();
if (partRelations.size() != 0 && partRelations != null) {
for (TaskSampleRelation partSampleRelation : partRelations) {
partSampleRelation.setTaskId(task.getId());
}
taskSampleRelationService.saveBatch(partRelations);
taskSampleRelationService.updateBatchById(partRelations);
}
}
......
......@@ -26,6 +26,7 @@ public class TaskStatePending implements TaskState, InitializingBean {
@Autowired
private TaskStateContext taskStateContext;
@Autowired
private ReviewDetailsMapper reviewDetailsMapper;
@Autowired
......
......@@ -34,7 +34,7 @@ public class CarReviewTaskController extends BaseController {
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "车辆审查任务", businessType = BusinessType.INSERT)
@RequestMapping(method = RequestMethod.POST, value = "/create")
@RequestMapping(method = RequestMethod.POST, value = "/add")
public R<String> create(@Validated @RequestBody CarReviewTaskCreateRequest request) {
carReviewTaskService.createTask(request);
return R.ok();
......@@ -43,7 +43,7 @@ public class CarReviewTaskController extends BaseController {
@ApiOperation("查看车辆问卷审查任务详情")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/view")
@RequestMapping(method = RequestMethod.POST, value = "/getById")
public R<CarReviewTaskViewResponse> view(@Validated @RequestBody CarReviewTaskViewRequest request) {
CarReviewTaskViewResponse carReviewTaskViewResponse = carReviewTaskService.viewReviewTask(request.getTaskId());
return R.ok(carReviewTaskViewResponse);
......
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.ReviewEnterpriseArchive;
import com.ruoyi.service.ReviewEnterpriseArchiveService;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.TaskFindResponse;
import com.ruoyi.web.response.TaskGetInfoResponse;
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("/review/enterprise/archive")
public class ReviewEnterpriseArchiveController extends BaseController {
@Autowired
private ReviewEnterpriseArchiveService reviewEnterpriseArchiveService;
@ApiOperation("分页查询车企文件")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findEnterpriseArchive")
public TableDataInfo<ReviewEnterpriseArchive> findEnterpriseArchive(@Validated @RequestBody ReviewEnterpriseArchiveFindRequest request) {
startPage(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 = "/getById")
public R<ReviewEnterpriseArchive> getInfo(@Validated @RequestBody ReviewEnterpriseArchiveGetInfoRequest request) {
ReviewEnterpriseArchive reviewEnterpriseArchive = reviewEnterpriseArchiveService.getInfo(request);
return R.ok(reviewEnterpriseArchive);
}
@ApiOperation("查询车企文件列表")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findList")
public TableDataInfo<ReviewEnterpriseArchive> findList(@Validated @RequestBody ReviewEnterpriseArchiveFindFileNameListRequest request) {
return getDataTable(reviewEnterpriseArchiveService.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 = "/add")
public R<Long> addEnterpriseArchive(@Validated @RequestBody ReviewEnterpriseArchive reviewEnterpriseArchive) {
reviewEnterpriseArchiveService.addEnterpriseArchive(reviewEnterpriseArchive);
return R.ok(reviewEnterpriseArchive.getId());
}
@ApiOperation("编辑车企文件")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "编辑车企文件", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/edit")
public R<String> editEnterpriseArchive(@Validated @RequestBody ReviewEnterpriseArchive reviewEnterpriseArchive) {
reviewEnterpriseArchiveService.updateById(reviewEnterpriseArchive);
return R.ok();
}
}
......@@ -34,7 +34,7 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "场景变更任务", businessType = BusinessType.INSERT)
@RequestMapping(method = RequestMethod.POST, value = "/create")
@RequestMapping(method = RequestMethod.POST, value = "/add")
public R<String> create(@Validated @RequestBody ReviewSceneChangeTaskCreateRequest request) {
ReviewSceneChangeTask reviewSceneChangeTask = new ReviewSceneChangeTask();
......
......@@ -8,11 +8,9 @@ import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.domain.Standard;
import com.ruoyi.service.StandardService;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindPendingRequest;
import com.ruoyi.web.request.StandardEditRequest;
import com.ruoyi.web.request.StandardListRequest;
import com.ruoyi.web.request.TaskEditRequest;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import com.ruoyi.web.response.TaskGetInfoResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.skywalking.apm.toolkit.trace.Tag;
......@@ -50,9 +48,19 @@ public class StandardController extends BaseController {
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "编辑任务", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/editStandard")
@RequestMapping(method = RequestMethod.POST, value = "/edit")
public R<String> editTask(@Validated @RequestBody StandardEditRequest request) {
standardService.editStandard(request);
return R.ok();
}
@ApiOperation("查看标准详情")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getById")
public R<Standard> getInfo(@Validated @RequestBody StandardGetInfoRequest request) {
Standard standard = standardService.getInfo(request);
return R.ok(standard);
}
}
......@@ -37,7 +37,7 @@ public class SystemReviewTaskController extends BaseController {
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "体系审查任务", businessType = BusinessType.INSERT)
@RequestMapping(method = RequestMethod.POST, value = "/create")
@RequestMapping(method = RequestMethod.POST, value = "/add")
public R<String> create(@Validated @RequestBody SystemReviewTaskCreateRequest request) {
systemReviewTaskService.createTaskTest(request);
return R.ok();
......@@ -46,7 +46,7 @@ public class SystemReviewTaskController extends BaseController {
@ApiOperation("查看体系审查任务详情")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/view")
@RequestMapping(method = RequestMethod.POST, value = "/getById")
public R<SystemReviewTaskViewResponse> view(@Validated @RequestBody SystemReviewTaskViewRequest request) {
SystemReviewTaskViewResponse systemReviewTaskViewResponse = systemReviewTaskService.view(request.getTaskId());
return R.ok(systemReviewTaskViewResponse);
......
......@@ -55,7 +55,7 @@ public class TaskController extends BaseController {
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "总任务", businessType = BusinessType.INSERT)
@RequestMapping(method = RequestMethod.POST, value = "/createTask")
@RequestMapping(method = RequestMethod.POST, value = "/add")
public R<String> createTask(@Validated @RequestBody TaskCreateRequest request) {
taskService.createTask(request);
return R.ok();
......@@ -64,7 +64,7 @@ public class TaskController extends BaseController {
@ApiOperation("查看任务详情")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getInfo")
@RequestMapping(method = RequestMethod.POST, value = "/getById")
public R<TaskGetInfoResponse> getInfo(@Validated @RequestBody TaskGetInfoRequest request) {
TaskGetInfoResponse response = taskService.getInfo(request);
......@@ -112,7 +112,7 @@ public class TaskController extends BaseController {
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "编辑任务", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/editTask")
@RequestMapping(method = RequestMethod.POST, value = "/edit")
public R<String> editTask(@Validated @RequestBody TaskEditRequest request) {
taskService.editTask(request);
return R.ok();
......@@ -122,7 +122,7 @@ public class TaskController extends BaseController {
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "删除任务", businessType = BusinessType.DELETE)
@RequestMapping(method = RequestMethod.POST, value = "/deleteTask")
@RequestMapping(method = RequestMethod.POST, value = "/remove")
public R<String> deleteTask(@Validated @RequestBody TaskDeleteRequest request) {
taskService.deleteTask(request);
return R.ok();
......
......@@ -25,4 +25,10 @@ public class ReviewDetailsResultSaveRequest {
*/
@ApiModelProperty("审核是否通过(0未通过、1通过)")
private Integer passed;
@ApiModelProperty("关联到车企留档文件")
private Long reviewEnterpriseArchiveId;
@ApiModelProperty("章节条目或范围")
private String catalogue;
}
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 = "ReviewEnterpriseArchiveFindFileNameListRequest", description = "查询文件名称列表")
@Data
public class ReviewEnterpriseArchiveFindFileNameListRequest {
@ApiModelProperty("任务id")
private Long taskId;
}
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 = "ReviewEnterpriseArchiveFindRequest", description = "查询车企文件")
@Data
public class ReviewEnterpriseArchiveFindRequest extends PageDomain {
@ApiModelProperty("文件名称")
private String fileName;
@ApiModelProperty("文件状态")
private String status;
@ApiModelProperty("文件识别号")
private String identifyNumber;
}
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "ReviewEnterpriseArchiveGetInfoRequest", description = "根据名称查询")
@Data
public class ReviewEnterpriseArchiveGetInfoRequest {
@ApiModelProperty("id")
private Long id;
}
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "StandardGetInfoRequest", description = "查询标准详情")
@Data
public class StandardGetInfoRequest {
@ApiModelProperty("ID")
private Long id;
}
......@@ -14,6 +14,9 @@
<result property="userId" column="user_id" jdbcType="BIGINT"/>
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
<result property="lastModifyTime" column="last_modify_time" jdbcType="TIMESTAMP"/>
<result property="catalogue" column="catalogue" jdbcType="VARCHAR"/>
<result property="reviewEnterpriseArchiveId" column="review_enterprise_archive_id" jdbcType="BIGINT"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -22,11 +25,11 @@
task_id from t_review_details_result
</sql>
<select id="findByTaskId" resultType="com.ruoyi.domain.ReviewDetailsResult">
SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time FROM t_review_details_result WHERE task_id = #{taskId}
SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time, catalogue, review_enterprise_archive_id FROM t_review_details_result WHERE task_id = #{taskId}
</select>
<select id="findByTaskIdAndDetailsId" resultType="com.ruoyi.domain.ReviewDetailsResult">
SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time
SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time, catalogue, review_enterprise_archive_id
FROM t_review_details_result
WHERE task_id = #{taskId} and review_details_id = #{reviewDetailsId}
</select>
......
......@@ -6,7 +6,7 @@
<resultMap id="BaseResultMap" type="com.ruoyi.domain.ReviewEnterpriseArchive">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="enterpriseName" column="enterprice_name" jdbcType="VARCHAR"/>
<result property="enterpriseName" column="enterprise_name" jdbcType="VARCHAR"/>
<result property="fileName" column="file_name" jdbcType="VARCHAR"/>
<result property="version" column="version" jdbcType="VARCHAR"/>
<result property="publishDate" column="publish_date" jdbcType="DATE"/>
......@@ -15,10 +15,12 @@
<result property="storage" column="storage" jdbcType="VARCHAR"/>
<result property="photo" column="photo" jdbcType="VARCHAR"/>
<result property="taskId" column="task_id" jdbcType="BIGINT"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
</resultMap>
<select id="findByTaskId" resultType="com.ruoyi.domain.ReviewEnterpriseArchive">
SELECT id, enterprise_name, file_name, version, publish_date, status, identify_number, storage, photo, task_id FROM t_review_enterprise_archive WHERE task_id = #{taskId}
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}
</select>
<select id="findViewItemVOByTaskId" resultType="com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewItemVO">
SELECT
......@@ -34,4 +36,33 @@
LEFT JOIN t_review_enterprise_archive archive ON result.review_enterprise_archive_id = archive.id
WHERE result.task_id = #{taskId};
</select>
<select id="findFileName" resultType="java.lang.Long">
select COUNT(*) sum from t_review_enterprise_archive
where task_id = #{taskId} and file_name = #{fileName}
</select>
<select id="findEnterpriseArchive" 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>
<if test="fileName != null and fileName != ''">
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>
<select id="findByFileName" 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 file_name = #{fileName}
</select>
<select id="findList" 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}
</select>
</mapper>
......@@ -153,12 +153,12 @@
<select id="findByCarReviewTaskId" resultType="java.lang.Long">
SELECT id
FROM t_task
WHERE system_review_task_id = #{systemReviewId}
WHERE car_review_task_id = #{carReviewId}
</select>
<select id="findBySystemReviewTaskId" resultType="java.lang.Long">
SELECT id
FROM t_task
WHERE car_review_task_id = #{carReviewId}
WHERE system_review_task_id = #{systemReviewId}
</select>
<select id="findByUserId" resultMap="ResponseMap">
SELECT t.id, t.system_review_task_id, t.car_review_task_id,
......
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