文件记录-重构
This commit is contained in:
@@ -19,7 +19,7 @@ public class RecordCommonUtils {
|
||||
|
||||
// 简单演示
|
||||
// public static void main(String[] args) {
|
||||
// String idPath = "//0//11//2021848472377016322/";
|
||||
// String idPath = "/0/11/2021848472377016322/";
|
||||
// Optional<String> seg1 = getSegment(idPath, 1); // 取第二个非空段,索引1
|
||||
// System.out.println(seg1.orElse("not found")); // 输出 "3"
|
||||
// }
|
||||
|
||||
@@ -5,6 +5,8 @@ package com.zt.plat.module.qms.resource.record.constant;
|
||||
*/
|
||||
public class RecordConstants {
|
||||
|
||||
public static final String SUPER_ADMIN = "ytjyAdmin"; // 超级管理员 标识
|
||||
|
||||
/**
|
||||
* 权限目标类型
|
||||
*/
|
||||
|
||||
@@ -113,16 +113,6 @@ public class RecordCategoryController extends AbstractFileUploadController imple
|
||||
}
|
||||
|
||||
|
||||
// 文件评审,获取满足当前账户权限的记录列表
|
||||
// @GetMapping("/getReviewRecordList")
|
||||
// @Operation(summary = "获得文件记录分类")
|
||||
// //@PreAuthorize("@ss.hasPermission('qms:record-record:query')")
|
||||
// public CommonResult<List<RecordCategoryRespVO>> getReviewRecordList() {
|
||||
// List<RecordCategoryRespVO> recordRecords = recordCategoryService.getReviewRecordList();
|
||||
// return success(recordRecords);
|
||||
// }
|
||||
|
||||
|
||||
@GetMapping("/getRecordCategoryTree")
|
||||
@Operation(summary = "获得文件记录分类")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:record-category:query')")
|
||||
|
||||
@@ -103,12 +103,12 @@ public class RecordPermissionController extends AbstractFileUploadController imp
|
||||
//@PreAuthorize("@ss.hasPermission('qms:record-category:query')")
|
||||
public CommonResult<Boolean> isAdminByUserId(@RequestParam("categoryId") Long categoryId,@RequestParam("permission") String permission) {
|
||||
boolean b = false;
|
||||
boolean isAdmin = recordPermissionService.judgeIsAdmin();
|
||||
boolean isAdmin = recordPermissionService.judgeIsSuperAdmin();
|
||||
if (isAdmin) return success(isAdmin);
|
||||
if (permission.equals(RecordConstants.PermissionType.ADMIN)) {
|
||||
b = recordPermissionService.isAdminByUserId(categoryId);
|
||||
b = recordPermissionService.hasAdminPermissionByCategoryId(categoryId);
|
||||
} else if (permission.equals(RecordConstants.PermissionType.EDIT)) {
|
||||
b = recordPermissionService.isEditPermissionByUserId(categoryId);
|
||||
b = recordPermissionService.hasEditPermissionByUserId(categoryId);
|
||||
}
|
||||
return success(b);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.security.core.LoginUser;
|
||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.zt.plat.module.qms.common.service.BusinessFileService;
|
||||
import com.zt.plat.module.qms.resource.record.controller.admin.recordpermission.vo.RecordPermissionRespVO;
|
||||
import com.zt.plat.module.qms.resource.record.controller.admin.recordrecord.vo.RecordRecordPageReqVO;
|
||||
@@ -18,8 +16,6 @@ import com.zt.plat.module.qms.resource.record.dal.dataobject.recordpermission.Re
|
||||
import com.zt.plat.module.qms.resource.record.dal.dataobject.recordrecord.RecordRecordDO;
|
||||
import com.zt.plat.module.qms.resource.record.service.recordpermission.RecordPermissionService;
|
||||
import com.zt.plat.module.qms.resource.record.service.recordrecord.RecordRecordService;
|
||||
import com.zt.plat.module.system.api.dept.DeptApi;
|
||||
import com.zt.plat.module.system.api.dept.dto.*;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -29,12 +25,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.RECORD_PERMISSION_NOT_ALLOW;
|
||||
|
||||
@Slf4j
|
||||
@Tag(name = "管理后台 - 文件、模板、记录")
|
||||
@@ -60,43 +53,6 @@ public class RecordRecordController extends AbstractFileUploadController impleme
|
||||
@Resource
|
||||
private BusinessFileService businessFileService;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@GetMapping("/deptList")
|
||||
@Operation(summary = "获得文件记录关系")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:record-relation:query')")
|
||||
public CommonResult<List<DeptRespDTO>> getRecordRelation() {
|
||||
// 获取当前部门的所有子部门
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
Long visitCompanyId = loginUser.getVisitCompanyId();
|
||||
log.info("visitCompanyId:{}", visitCompanyId);
|
||||
Long deptId = loginUser.getVisitDeptId();
|
||||
DeptListReqDTO dto = new DeptListReqDTO();
|
||||
List<String> deptIds = new ArrayList<>();
|
||||
deptIds.add(deptId.toString());
|
||||
dto.setIds(deptIds);
|
||||
CommonResult<List<DeptDetailRespDTO>> deptList = deptApi.getDeptList(dto);
|
||||
log.info("deptList:{}", deptList);
|
||||
// 获取当前所属公司下面的所有的部门
|
||||
if (visitCompanyId != null) {
|
||||
// return deptApi.getChildDeptList(visitCompanyId);
|
||||
CommonResult<List<DeptSimpleRespDTO>> allCompanyList = deptApi.getAllCompanyList();
|
||||
log.info("allCompanyList:{}", allCompanyList);
|
||||
DeptSimpleRespDTO deptSimpleRespDTO = allCompanyList.getData().get(0);
|
||||
deptSimpleRespDTO.getIsCompany();
|
||||
log.info("deptSimpleRespDTO:{}", deptSimpleRespDTO);
|
||||
CommonResult<List<DeptRespDTO>> childDeptList = deptApi.getChildDeptList(visitCompanyId);
|
||||
log.info("childDeptList:{}", childDeptList);
|
||||
CommonResult<Set<CompanyDeptInfoRespDTO>> companyDeptInfoListByUserId = deptApi.getCompanyDeptInfoListByUserId(loginUser.getId());
|
||||
log.info("companyDeptInfoListByUserId:{}", companyDeptInfoListByUserId);
|
||||
return childDeptList;
|
||||
}
|
||||
Long visitDeptId = loginUser.getVisitDeptId();
|
||||
if (visitDeptId == null) return CommonResult.error(RECORD_PERMISSION_NOT_ALLOW.getCode(), "用户部门不存在");
|
||||
return deptApi.getChildDeptList(visitDeptId);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建文件、模板、记录->分类明细")
|
||||
|
||||
@@ -99,6 +99,12 @@ public class RecordRecordPageReqVO extends PageParam {
|
||||
@Schema(description = "是否回收权限")
|
||||
private Integer collectionFlag;
|
||||
|
||||
@Schema(description = "审批状态,需要走流程的审批状态")
|
||||
private Integer ApplyStatus;
|
||||
|
||||
@Schema(description = "流程实例Id")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "原始父级ID")
|
||||
private Long mainId;
|
||||
|
||||
|
||||
@@ -38,14 +38,6 @@ public class RecordRecordRespVO {
|
||||
@ExcelProperty("业务类型")
|
||||
private String businessType;
|
||||
|
||||
// @Schema(description = "部门IDS")
|
||||
// @ExcelProperty("部门IDS")
|
||||
// private String departmentIds;
|
||||
//
|
||||
// @Schema(description = "用户IDS")
|
||||
// @ExcelProperty("用户IDS")
|
||||
// private String userIds;
|
||||
|
||||
@Schema(description = "表单key")
|
||||
@ExcelProperty("表单key")
|
||||
private String formKey;
|
||||
@@ -117,6 +109,12 @@ public class RecordRecordRespVO {
|
||||
@Dict(dicCode = "yes_or_no")
|
||||
private Integer cancelFlag;
|
||||
|
||||
@Schema(description = "审批状态,需要走流程的审批状态")
|
||||
private Integer ApplyStatus;
|
||||
|
||||
@Schema(description = "流程实例Id")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
@ExcelProperty("表单数据")
|
||||
private String formData;
|
||||
@@ -172,8 +170,8 @@ public class RecordRecordRespVO {
|
||||
@Schema(description = "文件提交申请ID")
|
||||
private Long applyId;
|
||||
|
||||
@Schema(description = "文件提交流程实例ID")
|
||||
private String flowInstanceId;
|
||||
// @Schema(description = "文件提交流程实例ID")
|
||||
// private String flowInstanceId;
|
||||
|
||||
@Schema(description = "文件提交业务状态")
|
||||
@Dict(dicCode = "flow_status")
|
||||
|
||||
@@ -28,12 +28,6 @@ public class RecordRecordSaveReqVO {
|
||||
@Schema(description = "业务类型")
|
||||
private String businessType;
|
||||
|
||||
// @Schema(description = "部门IDS")
|
||||
// private String departmentIds;
|
||||
//
|
||||
// @Schema(description = "用户IDS")
|
||||
// private String userIds;
|
||||
|
||||
@Schema(description = "表单key")
|
||||
private String formKey;
|
||||
|
||||
@@ -85,6 +79,12 @@ public class RecordRecordSaveReqVO {
|
||||
@Schema(description = "作废标志,0-有效,1-作废")
|
||||
private Integer cancelFlag;
|
||||
|
||||
@Schema(description = "审批状态,需要走流程的审批状态")
|
||||
private Integer ApplyStatus;
|
||||
|
||||
@Schema(description = "流程实例Id")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
private String formData;
|
||||
|
||||
|
||||
@@ -100,6 +100,11 @@ public class RecordPermissionDO extends BusinessBaseDO {
|
||||
@TableField("CNL_FLG")
|
||||
private String cancelFlag;
|
||||
/**
|
||||
* 保留权限回收
|
||||
*/
|
||||
@TableField("SVE_FLG")
|
||||
private String saveFlag;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
|
||||
@@ -48,16 +48,6 @@ public class RecordRecordDO extends BusinessBaseDO {
|
||||
*/
|
||||
@TableField("BSN_TP")
|
||||
private String businessType;
|
||||
// /**
|
||||
// * 部门IDS
|
||||
// */
|
||||
// @TableField("DEPT_IDS")
|
||||
// private String departmentIds;
|
||||
// /**
|
||||
// * 用户IDS
|
||||
// */
|
||||
// @TableField("USER_IDS")
|
||||
// private String userIds;
|
||||
/**
|
||||
* 表单key
|
||||
*/
|
||||
@@ -138,6 +128,16 @@ public class RecordRecordDO extends BusinessBaseDO {
|
||||
*/
|
||||
@TableField("CNL_FLG")
|
||||
private Integer cancelFlag;
|
||||
/**
|
||||
* 审批状态,需要走流程的审批状态
|
||||
*/
|
||||
@TableField("APL_STS")
|
||||
private Integer ApplyStatus;
|
||||
/**
|
||||
* 流程实例Id
|
||||
*/
|
||||
@TableField("FLW_INSC_ID")
|
||||
private String flowInstanceId;
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
@@ -204,11 +204,11 @@ public class RecordRecordDO extends BusinessBaseDO {
|
||||
@TableField(exist = false)
|
||||
private Long applyId;
|
||||
|
||||
/**
|
||||
* 文件提交流程实例ID(RecordApply.flowInstanceId)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String flowInstanceId;
|
||||
// /**
|
||||
// * 文件提交流程实例ID(RecordApply.flowInstanceId)
|
||||
// */
|
||||
// @TableField(exist = false)
|
||||
// private String flowInstanceId;
|
||||
|
||||
/**
|
||||
* 文件提交业务状态(RecordApply.businessStatus)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user