瀏覽代碼

修改导出问题清单代码

tags/V1.3.3^2
wanjing 11 月之前
父節點
當前提交
b9f4587ddf
共有 5 個文件被更改,包括 51 次插入17 次删除
  1. +4
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionFileController.java
  2. +30
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspectionfile/ExportInspectionFileRequest.java
  3. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/IInspectionFileService.java
  4. +3
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/InspectionFileServiceImpl.java
  5. +12
    -8
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/export/ExportInspectionFileByIdListService.java

+ 4
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionFileController.java 查看文件

@@ -150,11 +150,11 @@ public class InspectionFileController {
*
* 导出问题清单
*
* @param idList
* @param request
* @return
*/
@GetMapping("/export/{idList}")
public void exportExcleByIdList(HttpServletRequest request, HttpServletResponse response, @PathVariable("idList") List<String> idList) {
iInspectionFileService.exportExcleByIdList(response, idList);
@GetMapping("/export")
public void exportExcleByIdList(HttpServletResponse response, ExportInspectionFileRequest request) {
iInspectionFileService.exportExcle(response, request);
}
}

+ 30
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspectionfile/ExportInspectionFileRequest.java 查看文件

@@ -0,0 +1,30 @@
package com.tuoheng.admin.request.inspectionfile;

import com.tuoheng.common.core.common.BaseQuery;
import lombok.Data;

/**
* 导出问题清单请求实体
*
* @author wanjing
* @team tuoheng
* @date 2023-12-01
*/
@Data
public class ExportInspectionFileRequest extends BaseQuery {

/**
* 任务ID
*/
private String inspectionId;

/**
* 问题编号
*/
private String questionId;

/**
* 问题状态:5待确认 10已忽略 15已确认 20已生成工单 25问题已处理
*/
private Integer status;
}

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/IInspectionFileService.java 查看文件

@@ -121,9 +121,9 @@ public interface IInspectionFileService {
*
* 导出问题清单
*
* @param idList
* @param request
*
* @return
*/
JsonResult exportExcleByIdList(HttpServletResponse response, List<String> idList);
JsonResult exportExcle(HttpServletResponse response, ExportInspectionFileRequest request);
}

+ 3
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/InspectionFileServiceImpl.java 查看文件

@@ -332,12 +332,12 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
/**
* 导出问题清单
*
* @param idList
* @param request
* @return
*/
@Override
public JsonResult exportExcleByIdList(HttpServletResponse response, List<String> idList) {
return exportInspectionFileByIdListService.exportExcleByIdList(response, idList);
public JsonResult exportExcle(HttpServletResponse response, ExportInspectionFileRequest request) {
return exportInspectionFileByIdListService.exportExcle(response, request);
}

}

+ 12
- 8
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/export/ExportInspectionFileByIdListService.java 查看文件

@@ -13,6 +13,7 @@ import com.tuoheng.admin.enums.InspectionFileStatusEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.InspectionFileMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.request.inspectionfile.ExportInspectionFileRequest;
import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.admin.utils.DownloadUtil;
import com.tuoheng.admin.utils.excel.CustomCellWriteWidthHandler;
@@ -24,6 +25,7 @@ import com.tuoheng.common.core.exception.ServiceException;
import com.tuoheng.common.core.utils.DateUtils;
import com.tuoheng.common.core.utils.FileUtils;
import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.common.core.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -59,20 +61,22 @@ public class ExportInspectionFileByIdListService {
*
* @return
*/
public JsonResult exportExcleByIdList(HttpServletResponse response, List<String> idList) {
log.info("进入导出任务问题清单接口");
public JsonResult exportExcle(HttpServletResponse response, ExportInspectionFileRequest request) {
log.info("进入导出任务问题清单接口, request={}", request);
User user = CurrentUserUtil.getUserInfo();
JsonResult result = this.check(idList);
JsonResult result = this.check(request);
if (0 != result.getCode()) {
log.info("导出任务问题清单:校验失败:{}", result.getMsg());
return result;
}
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(Wrappers.<InspectionFile>lambdaQuery()
.eq(InspectionFile::getTenantId, user.getTenantId())
.in(InspectionFile::getId, idList)
.eq(InspectionFile::getInspectionId, request.getInspectionId())
.eq(StringUtils.isNotEmpty(request.getQuestionId()), InspectionFile::getQuestionId, request.getQuestionId())
.eq(ObjectUtil.isNotEmpty(request.getStatus()), InspectionFile::getStatus, request.getStatus())
.eq(InspectionFile::getMark, MarkEnum.VALID.getCode()));
if (CollectionUtil.isEmpty(inspectionFileList)) {
log.info("问题列表不存在, idList={}", idList);
log.info("问题列表不存在, request={}", request);
return JsonResult.success();
}
InspectionFile inspectionFile = inspectionFileList.get(0);
@@ -103,11 +107,11 @@ public class ExportInspectionFileByIdListService {
/**
* 检查参数
*
* @param idList
* @param request
* @return
*/
private JsonResult check(List<String> idList) {
if (CollectionUtil.isEmpty(idList)) {
private JsonResult check(ExportInspectionFileRequest request) {
if (StringUtils.isEmpty(request.getInspectionId())) {
throw new ServiceException("问题ID为空");
}
return JsonResult.success();

Loading…
取消
儲存