Commit e8c38e0e authored by wdy's avatar wdy

编辑车企文件&查询车企文件

parent 856952d1
......@@ -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;
......@@ -22,6 +23,12 @@ public interface ReviewEnterpriseArchiveMapper extends BaseMapper<ReviewEnterpri
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<String> findFileNameList(@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;
......@@ -16,4 +20,20 @@ public interface ReviewEnterpriseArchiveService extends IService<ReviewEnterpris
List<ReviewEnterpriseArchiveViewVO> view(Long taskId);
void addEnterpriseArchive(ReviewEnterpriseArchive reviewEnterpriseArchive);
/**
* 分页查询
* @param request
* @return
*/
List<ReviewEnterpriseArchive> findEnterpriseArchive(ReviewEnterpriseArchiveFindRequest request);
/**
* 查看详情
* @param request
* @return
*/
ReviewEnterpriseArchive getInfo(ReviewEnterpriseArchiveGetInfoRequest request);
List<String> findFileNameList(ReviewEnterpriseArchiveFindFileNameListRequest request);
}
......@@ -12,6 +12,9 @@ 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;
......@@ -67,6 +70,21 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
}
@Override
public List<ReviewEnterpriseArchive> findEnterpriseArchive(ReviewEnterpriseArchiveFindRequest request) {
return reviewEnterpriseArchiveMapper.findEnterpriseArchive(request);
}
@Override
public ReviewEnterpriseArchive getInfo(ReviewEnterpriseArchiveGetInfoRequest request) {
return reviewEnterpriseArchiveMapper.findByFileName(request.getFileName());
}
@Override
public List<String> findFileNameList(ReviewEnterpriseArchiveFindFileNameListRequest request) {
return reviewEnterpriseArchiveMapper.findFileNameList(request.getTaskId());
}
private List<ReviewEnterpriseArchiveViewVO> buildReviewEnterpriseArchiveViewVO(List<ReviewEnterpriseArchive> archives, List<ReviewEnterpriseArchiveViewItemVO> viewItems) {
List<ReviewEnterpriseArchiveViewVO> viewList = new ArrayList();
......
......@@ -3,10 +3,13 @@ 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.TaskCreateRequest;
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;
......@@ -27,6 +30,32 @@ 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("根据名称查询")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getInfo")
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 = "/findFileNameList")
public TableDataInfo<String> findFileNameList(@Validated @RequestBody ReviewEnterpriseArchiveFindFileNameListRequest request) {
return getDataTable(reviewEnterpriseArchiveService.findFileNameList(request));
}
@ApiOperation("新增车企文件")
@Trace
......@@ -37,4 +66,14 @@ public class ReviewEnterpriseArchiveController extends BaseController {
reviewEnterpriseArchiveService.addEnterpriseArchive(reviewEnterpriseArchive);
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 = "/edit")
public R<String> editEnterpriseArchive(@Validated @RequestBody ReviewEnterpriseArchive reviewEnterpriseArchive) {
reviewEnterpriseArchiveService.updateById(reviewEnterpriseArchive);
return R.ok();
}
}
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("文件名称")
private String fileName;
}
......@@ -40,4 +40,28 @@
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="findFileNameList" resultType="java.lang.String">
select file_name from t_review_enterprise_archive
where task_id = #{taskId}
</select>
</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