文件记录-提交-流程控制-修改到通用接口
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.zt.plat.module.qms.resource.record.common;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class RecordCommonUtils {
|
||||
|
||||
// 返回第 n 个非空段(0-based),例如 n=1 会返回 "3"(对 "//0//3//...")
|
||||
public static Optional<String> getSegment(String idPath, int n) {
|
||||
if (idPath == null) return Optional.empty();
|
||||
List<String> segs = Arrays.stream(idPath.split("/"))
|
||||
.filter(s -> !s.isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
if (n < 0 || n >= segs.size()) return Optional.empty();
|
||||
return Optional.of(segs.get(n));
|
||||
}
|
||||
|
||||
// 简单演示
|
||||
// public static void main(String[] args) {
|
||||
// String idPath = "//0//11//2021848472377016322/";
|
||||
// Optional<String> seg1 = getSegment(idPath, 1); // 取第二个非空段,索引1
|
||||
// System.out.println(seg1.orElse("not found")); // 输出 "3"
|
||||
// }
|
||||
}
|
||||
@@ -60,7 +60,43 @@ public class RecordConstants {
|
||||
* 评审
|
||||
*/
|
||||
public static final String REVIEW = "评审";
|
||||
/** 文件提交 */
|
||||
/**
|
||||
* 文件提交
|
||||
* */
|
||||
public static final String RECORD_SUBMIT = "文件提交";
|
||||
/**
|
||||
* 文件提交
|
||||
* */
|
||||
public static final String RECORD_UPDATE = "文件修改";
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程定义key常量
|
||||
*/
|
||||
public static class ProcessDefinitionKey{
|
||||
/**
|
||||
* 分发
|
||||
*/
|
||||
public static final String DISTRIBUTION__DEFINITION_KEY = "分发";
|
||||
/**
|
||||
* 查看申请
|
||||
*/
|
||||
public static final String VIEW_APPLY_DEFINITION_KEY = "查看申请";
|
||||
/**
|
||||
* 作废
|
||||
*/
|
||||
public static final String INVALID_DEFINITION_KEY = "作废";
|
||||
/**
|
||||
* 评审
|
||||
*/
|
||||
public static final String REVIEW_DEFINITION_KEY = "评审";
|
||||
/**
|
||||
* 文件提交
|
||||
*/
|
||||
public static final String RECORD_SUBMIT_DEFINITION_KEY = "QMS_RECORD_REPAIR";
|
||||
/**
|
||||
* 文件提交
|
||||
* */
|
||||
public static final String RECORD_UPDATE_DEFINITION_KEY = "文件修改";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,11 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.qms.resource.record.controller.admin.recordapply.vo.RecordApplyPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.record.controller.admin.recordapply.vo.RecordApplyRespVO;
|
||||
import com.zt.plat.module.qms.resource.record.controller.admin.recordapply.vo.RecordApplySaveReqVO;
|
||||
import com.zt.plat.module.qms.resource.record.controller.admin.recordrecord.vo.RecordRecordRespVO;
|
||||
import com.zt.plat.module.qms.resource.record.controller.admin.recordrecord.vo.RecordRecordSaveReqVO;
|
||||
import com.zt.plat.module.qms.resource.record.dal.dataobject.recordapply.RecordApplyDO;
|
||||
import com.zt.plat.module.qms.resource.record.service.recordapply.RecordApplyService;
|
||||
import com.zt.plat.module.qms.resource.record.service.recordrecord.RecordRecordService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -49,13 +52,21 @@ public class RecordApplyController extends AbstractFileUploadController implemen
|
||||
@Resource
|
||||
private RecordApplyService recordApplyService;
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建文件记录通用申请")
|
||||
@Operation(summary = "创建文件记录创建申请")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:record-apply:create')")
|
||||
public CommonResult<RecordApplyRespVO> createRecordApply(@Valid @RequestBody RecordApplySaveReqVO createReqVO) {
|
||||
return success(recordApplyService.createRecordApply(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/submitApply")
|
||||
@Operation(summary = "创建文件记录通用申请")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:record-apply:create')")
|
||||
public CommonResult<RecordApplyRespVO> submitApply(@Valid @RequestBody RecordApplyRespVO respVO) {
|
||||
return recordApplyService.submitRecordApply(respVO);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新文件记录通用申请")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:record-apply:update')")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zt.plat.module.qms.resource.record.controller.admin.recordapply.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@@ -22,6 +23,7 @@ public class RecordApplyRespVO {
|
||||
|
||||
@Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("业务类型")
|
||||
@NotEmpty(message = "业务类型不能为空")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "申请人id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15000")
|
||||
@@ -84,8 +86,26 @@ public class RecordApplyRespVO {
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "流程实例ID")
|
||||
@ExcelProperty("流程实例ID")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "业务状态")
|
||||
@ExcelProperty("业务状态")
|
||||
private String businessStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
// ===============临时字段=================》
|
||||
|
||||
// needApply : 是否需要申请,true-需要,false-不需要
|
||||
@Schema(description = "是否需要申请")
|
||||
private Boolean needApply;
|
||||
|
||||
@Schema(description = "流程类型")
|
||||
private Long recordId;
|
||||
|
||||
}
|
||||
@@ -72,4 +72,10 @@ public class RecordApplySaveReqVO {
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "流程实例ID")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "业务状态")
|
||||
private String businessStatus;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zt.plat.module.qms.resource.record.controller.admin.recordapplydetail.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 文件记录申请与申请明细联合查询VO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RecordApplyDetailJoinVO {
|
||||
|
||||
// RecordApplyDO 字段
|
||||
private Long applyId;
|
||||
private String businessStatus;
|
||||
private String businessType;
|
||||
private String flowInstanceId;
|
||||
|
||||
// RecordApplyDetailDO 字段
|
||||
private Long detailId;
|
||||
private Long documentId;
|
||||
private String permanently;
|
||||
private LocalDateTime applyStartDate;
|
||||
private LocalDateTime applyEndDate;
|
||||
private String sortNo;
|
||||
private String systemDepartmentCode;
|
||||
private String remark;
|
||||
}
|
||||
@@ -105,11 +105,11 @@ public class RecordRecordController extends AbstractFileUploadController impleme
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/submitRecordApply")
|
||||
@Operation(summary = "提交流程申请")
|
||||
public CommonResult<RecordRecordRespVO> submitRecordApply(@RequestBody RecordRecordSaveReqVO param) {
|
||||
return recordRecordService.submitRecordApply(param);
|
||||
}
|
||||
// @PostMapping("/submitRecordApply")
|
||||
// @Operation(summary = "提交流程申请")
|
||||
// public CommonResult<RecordRecordRespVO> submitRecordApply(@RequestBody RecordRecordSaveReqVO param) {
|
||||
// return recordRecordService.submitRecordApply(param);
|
||||
// }
|
||||
|
||||
|
||||
@GetMapping("/get")
|
||||
|
||||
@@ -60,15 +60,12 @@ public class RecordRecordPageReqVO extends PageParam {
|
||||
@Schema(description = "是否长期有效")
|
||||
private Integer permanently;
|
||||
|
||||
@Schema(description = "业务状态")
|
||||
private String businessStatus;
|
||||
|
||||
@Schema(description = "流程实例Id")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "是否需要提交(用来判断文件是否需要走流程)")
|
||||
private String submitFlag;
|
||||
|
||||
@Schema(description = "文件记录状态,0: 无效,1: 有效")
|
||||
private Integer recordStatus;
|
||||
|
||||
@Schema(description = "过期日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] expirationDate;
|
||||
|
||||
@@ -89,18 +89,14 @@ public class RecordRecordRespVO {
|
||||
@Dict(dicCode = "yes_or_no")
|
||||
private Integer permanently;
|
||||
|
||||
@Schema(description = "业务状态")
|
||||
@ExcelProperty("业务状态")
|
||||
private String businessStatus;
|
||||
|
||||
@Schema(description = "流程实例Id")
|
||||
@ExcelProperty("流程实例Id")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "是否需要提交(用来判断文件是否需要走流程)")
|
||||
@ExcelProperty("是否需要提交(用来判断文件是否需要走流程)")
|
||||
private String submitFlag;
|
||||
|
||||
@Schema(description = "文件记录状态,0: 无效,1: 有效")
|
||||
@ExcelProperty("文件记录状态,0: 无效,1: 有效")
|
||||
private Integer recordStatus;
|
||||
|
||||
@Schema(description = "过期日期")
|
||||
@ExcelProperty("过期日期")
|
||||
private LocalDateTime expirationDate;
|
||||
|
||||
@@ -67,15 +67,12 @@ public class RecordRecordSaveReqVO {
|
||||
@Schema(description = "是否长期有效", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer permanently;
|
||||
|
||||
@Schema(description = "业务状态")
|
||||
private String businessStatus;
|
||||
|
||||
@Schema(description = "流程实例Id")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "是否需要提交(用来判断文件是否需要走流程)")
|
||||
private String submitFlag;
|
||||
|
||||
@Schema(description = "文件记录状态,0: 无效,1: 有效")
|
||||
private Integer recordStatus;
|
||||
|
||||
@Schema(description = "过期日期")
|
||||
private LocalDateTime expirationDate;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user