feat:报告转pdf、发起iwork流程。 开发中
This commit is contained in:
@@ -140,6 +140,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode REPORT_DOCUMENT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告明细不存在");
|
||||
ErrorCode REPORT_DOCUMENT_TYPE_NOT_EXISTS = new ErrorCode(1_032_100_000, "报告类型配置不存在");
|
||||
ErrorCode REPORT_DOCUMENT_MAIN_CORRELATION_NOT_EXISTS = new ErrorCode(1_032_100_000, "报告主数据关系不存在");
|
||||
ErrorCode REPORT_DOCUMENT_FILE_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告附件不存在");
|
||||
|
||||
ErrorCode BUSINESS_SAMPLE_DISPATCH_NOT_EXISTS = new ErrorCode(1_032_100_000, "样品调拨不存在");
|
||||
ErrorCode BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS = new ErrorCode(1_032_100_000, "样品调拨明细不存在");
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.zt.plat.module.qms.business.reportdoc.async;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
@Configuration
|
||||
@EnableAsync
|
||||
public class AsyncConfig {
|
||||
@Bean("asyncTaskExecutor")
|
||||
public Executor asyncTaskExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(5);
|
||||
executor.setMaxPoolSize(10);
|
||||
executor.setQueueCapacity(100);
|
||||
executor.setThreadNamePrefix("Async-");
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTy
|
||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentDataService;
|
||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainService;
|
||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentTypeService;
|
||||
import com.zt.plat.module.qms.common.data.service.DataTemplateService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,26 +14,27 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO;
|
||||
import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService;
|
||||
import com.zt.plat.module.qms.business.reportdoc.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO;
|
||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO;
|
||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO;
|
||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentDataService;
|
||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainService;
|
||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentTypeService;
|
||||
import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO;
|
||||
import com.zt.plat.module.qms.common.data.service.DataTemplateService;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import com.zt.plat.module.system.api.iwork.dto.IWorkOperationRespDTO;
|
||||
import com.zt.plat.module.system.api.iwork.dto.IWorkWorkflowCreateReqDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
@@ -59,6 +60,19 @@ public class ReportDocumentMainController extends AbstractFileUploadController i
|
||||
@Resource private ReportDocumentDataService reportDocumentDataService;
|
||||
@Resource private ReportDocumentTypeService reportDocumentTypeService;
|
||||
@Resource private ConfigUserSignatureService configUserSignatureService;
|
||||
@Resource private DataTemplateService dataTemplateService;
|
||||
|
||||
@RequestMapping("/testAsyncTask")
|
||||
public CommonResult<String> testAsyncTask(@RequestParam Long id) {
|
||||
ReportDocumentMainSaveReqVO reqVO = new ReportDocumentMainSaveReqVO();
|
||||
reqVO.setId(id);
|
||||
reqVO.setFlowStatus("async");
|
||||
reportDocumentMainService.updateReportDocumentMain(reqVO);
|
||||
|
||||
reportDocumentMainService.testAsyncTask(id);
|
||||
return CommonResult.success("success");
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建检测报告")
|
||||
@@ -78,6 +92,11 @@ public class ReportDocumentMainController extends AbstractFileUploadController i
|
||||
if(typeDO == null){
|
||||
return error(REPORT_DOCUMENT_TYPE_NOT_EXISTS, "报告类型不存在,请刷新后重试");
|
||||
}
|
||||
String dataTemplateKey = typeDO.getReportKey();
|
||||
DataTemplateDO dataTemplateDO = dataTemplateService.getLatestDataByKey(dataTemplateKey);
|
||||
if(dataTemplateDO == null)
|
||||
return error(REPORT_DOCUMENT_TYPE_NOT_EXISTS, "表单编辑器模板不存在,请联系管理员处理");
|
||||
vo.setDataTemplateId(dataTemplateDO.getId());
|
||||
vo.setDocumentTitle(typeDO.getName());
|
||||
vo.setFlowKey(typeDO.getFlowKey());
|
||||
vo.setDocumentType(typeDO.getDocumentType());
|
||||
@@ -235,4 +254,23 @@ public class ReportDocumentMainController extends AbstractFileUploadController i
|
||||
ExcelUtils.write(response, "检测报告业务.xls", "数据", ReportDocumentMainRespVO.class, list);
|
||||
}
|
||||
|
||||
@GetMapping("/testCreateIworkWorkflow")
|
||||
@Operation(summary = "测试发起iwork流程")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:report-document-main:query')")
|
||||
public CommonResult<IWorkOperationRespDTO> createIworkWorkflow() {
|
||||
IWorkWorkflowCreateReqDTO req = new IWorkWorkflowCreateReqDTO();
|
||||
req.setJbr("1001");
|
||||
req.setYybm("2001");
|
||||
req.setFb("3001");
|
||||
req.setSqsj("2025-01-01");
|
||||
req.setYyqx("对外邮寄");
|
||||
// req.setYyfkUrl("https://files.example.com/evidence.pdf");
|
||||
req.setYysy("与客户合同用印");
|
||||
req.setXyywjUrl("http://172.16.46.63:30002/yudao/20251204/%E6%B5%8B%E8%AF%95pdf_1764818842846.pdf?response-cache-control=no-cache%2C%20no-store%2C%20must-revalidate&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20251209T093343Z&X-Amz-SignedHeaders=host&X-Amz-Credential=EKplIEnbNgfYBAZbEJNa%2F20251209%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Expires=86400&X-Amz-Signature=37d63249667ea855f9a51bdf47bbb044d5860c302721f52fff2ba644985bae4c");
|
||||
req.setYysx("检测报告用印");
|
||||
req.setYwxtdjbh("JY-20251209-0001");
|
||||
// CommonResult<IWorkOperationRespDTO> ret = reportDocumentMainService.createIWorkflow(req);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.zt.plat.module.qms.business.reportdoc.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 检测报告附件分页 Request VO")
|
||||
@Data
|
||||
public class ReportDocumentFilePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "报告id", example = "20899")
|
||||
private Long mainId;
|
||||
|
||||
@Schema(description = "文件表ID", example = "25498")
|
||||
private Long fileId;
|
||||
|
||||
@Schema(description = "文件名称", example = "李四")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "路径")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "文件地址", example = "https://www.iocoder.cn")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "文件类型", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "版本")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.zt.plat.module.qms.business.reportdoc.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 检测报告附件 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ReportDocumentFileRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29698")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "报告id", example = "20899")
|
||||
@ExcelProperty("报告id")
|
||||
private Long mainId;
|
||||
|
||||
@Schema(description = "文件表ID", example = "25498")
|
||||
@ExcelProperty("文件表ID")
|
||||
private Long fileId;
|
||||
|
||||
@Schema(description = "文件名称", example = "李四")
|
||||
@ExcelProperty("文件名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "路径")
|
||||
@ExcelProperty("路径")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "文件地址", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("文件地址")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "文件类型", example = "1")
|
||||
@ExcelProperty("文件类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "版本")
|
||||
@ExcelProperty("版本")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.zt.plat.module.qms.business.reportdoc.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@Schema(description = "管理后台 - 检测报告附件新增/修改 Request VO")
|
||||
@Data
|
||||
public class ReportDocumentFileSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29698")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "报告id", example = "20899")
|
||||
private Long mainId;
|
||||
|
||||
@Schema(description = "文件表ID", example = "25498")
|
||||
private Long fileId;
|
||||
|
||||
@Schema(description = "文件名称", example = "李四")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "路径")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "文件地址", example = "https://www.iocoder.cn")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "文件类型", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "版本")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -88,4 +88,10 @@ public class ReportDocumentMainPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "表单设计器模板id")
|
||||
private Long dataTemplateId;
|
||||
|
||||
@Schema(description = "附件版本")
|
||||
private Integer documentVersion;
|
||||
|
||||
@Schema(description = "异步执行状态")
|
||||
private String executionStatus;
|
||||
}
|
||||
@@ -115,6 +115,13 @@ public class ReportDocumentMainRespVO {
|
||||
@ExcelProperty("表单设计器模板id")
|
||||
private Long dataTemplateId;
|
||||
|
||||
@Schema(description = "附件版本")
|
||||
@ExcelProperty("附件版本")
|
||||
private Integer documentVersion;
|
||||
|
||||
@Schema(description = "异步执行状态")
|
||||
@ExcelProperty("异步执行状态")
|
||||
private String executionStatus;
|
||||
//==============================扩展字段=======================================
|
||||
@Schema(description = "记录数")
|
||||
@ExcelProperty("记录数")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user