Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.zt.plat.module.qms.resource.record.controller.admin.recordrecord;
|
||||
|
||||
import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore;
|
||||
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.clientManage.controller.vo.VersionManagementRespVO;
|
||||
import com.zt.plat.module.qms.resource.record.constant.RecordConstants;
|
||||
@@ -14,6 +16,9 @@ import com.zt.plat.module.qms.resource.record.controller.admin.recordrecord.vo.R
|
||||
import com.zt.plat.module.qms.resource.record.dal.dataobject.recordpermission.RecordPermissionDO;
|
||||
import com.zt.plat.module.qms.resource.record.service.recordcategory.RecordCategoryService;
|
||||
import com.zt.plat.module.qms.resource.record.service.recordpermission.RecordPermissionService;
|
||||
import com.zt.plat.module.system.api.dept.DeptApi;
|
||||
import com.zt.plat.module.system.api.dept.dto.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -42,10 +47,12 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.RECORD_PERMISSION_NOT_ALLOW;
|
||||
|
||||
import com.zt.plat.module.qms.resource.record.dal.dataobject.recordrecord.RecordRecordDO;
|
||||
import com.zt.plat.module.qms.resource.record.service.recordrecord.RecordRecordService;
|
||||
|
||||
@Slf4j
|
||||
@Tag(name = "管理后台 - 文件、模板、记录")
|
||||
@RestController
|
||||
@RequestMapping("/qms/resource/record-record")
|
||||
@@ -69,6 +76,43 @@ 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(deptId);
|
||||
// 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 = "创建文件、模板、记录->分类明细")
|
||||
@@ -151,5 +195,25 @@ public class RecordRecordController extends AbstractFileUploadController impleme
|
||||
return success(BeanUtils.toBean(result, RecordRecordRespVO.class));
|
||||
}
|
||||
|
||||
// 已由 XXL-Job 定时任务(updateRecordStatusJob)驱动,此接口保留用于手动触发/测试
|
||||
@GetMapping("/timing-updateRecordStatus")
|
||||
@Operation(summary = "定时更新文件、模板、记录状态")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:record-record:update')")
|
||||
public CommonResult<Boolean> timingUpdateRecordStatus() {
|
||||
recordRecordService.updateRecordStatus();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过定时任务,判断文件是否到期(到期自动作废)
|
||||
* @return
|
||||
*/
|
||||
// 已由 XXL-Job 定时任务(XXX)驱动,此接口保留用于手动触发/测试
|
||||
// @GetMapping("/timing-updateRecordStatus")
|
||||
// @Operation(summary = "定时更新文件、模板、记录状态")
|
||||
// //@PreAuthorize("@ss.hasPermission('qms:record-record:update')")
|
||||
// public CommonResult<Boolean> timingUpdateRecordStatus() {
|
||||
// recordRecordService.updateRecordStatus();
|
||||
// return success(true);
|
||||
// }
|
||||
}
|
||||
@@ -109,6 +109,6 @@ public class RecordRecordPageReqVO extends PageParam {
|
||||
@Schema(description = "是否查询历史数据")
|
||||
private Integer isQueryHistory; // 1-查询,0-不查询
|
||||
|
||||
private String ew;
|
||||
private String appraisalFlag;
|
||||
|
||||
}
|
||||
@@ -176,6 +176,7 @@ public class RecordRecordRespVO {
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "文件提交业务状态")
|
||||
@Dict(dicCode = "flow_status")
|
||||
private String applyBusinessStatus;
|
||||
|
||||
}
|
||||
@@ -91,6 +91,14 @@ public interface RecordRecordMapper extends BaseMapperX<RecordRecordDO> {
|
||||
@Param("userId") Long userId,
|
||||
@Param("userDepts") List<Long> userDepts);
|
||||
|
||||
/**
|
||||
* 通过 idPath 模糊查询 关联的文件记录
|
||||
* @param pathList
|
||||
* @return
|
||||
*/
|
||||
List<RecordRecordDO> selectRecordByIdPathLike(@Param("reqVO") RecordRecordPageReqVO reqVO,
|
||||
@Param("pathList") List<String> pathList);
|
||||
|
||||
// TODO
|
||||
// List<RecordRecordDO> selectViewApplyRecordList(@Param("pageReqVO") RecordRecordPageReqVO pageReqVO);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.zt.plat.module.qms.resource.record.job;
|
||||
|
||||
import com.xxl.job.core.context.XxlJobHelper;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import com.zt.plat.module.qms.resource.record.service.recordrecord.RecordRecordService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 文件记录相关定时任务
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class RecordRecordJob {
|
||||
|
||||
@Autowired
|
||||
private RecordRecordService recordRecordService;
|
||||
|
||||
/**
|
||||
* 定时更新文件记录生效状态
|
||||
* 检测 effectiveDate <= 当前时间 且 recordStatus != 1 的记录,将其更新为已生效(recordStatus = 1)
|
||||
*
|
||||
* JobHandler 名称: updateRecordStatusJob
|
||||
* 推荐 Cron: 0 0 0 * * ?(每天零点执行)
|
||||
*/
|
||||
@XxlJob("updateRecordStatusJob")
|
||||
public void updateRecordStatusJob() {
|
||||
log.info("[updateRecordStatusJob] 开始执行文件记录生效状态更新任务");
|
||||
try {
|
||||
Integer updateCount = recordRecordService.updateRecordStatus();
|
||||
log.info("[updateRecordStatusJob] 任务执行成功,共更新 {} 条记录", updateCount);
|
||||
XxlJobHelper.handleSuccess(String.format("任务执行成功,共更新 %d 条记录", updateCount));
|
||||
} catch (Exception e) {
|
||||
log.error("[updateRecordStatusJob] 任务执行失败:{}", e.getMessage(), e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -73,4 +73,5 @@ public interface RecordCategoryService {
|
||||
|
||||
List<RecordCategoryRespVO> getReviewRecordList();
|
||||
|
||||
List<RecordCategoryDO> selectCategoryAppraisalList(String appraisalFlag);
|
||||
}
|
||||
@@ -186,6 +186,13 @@ public class RecordCategoryServiceImpl implements RecordCategoryService {
|
||||
return BeanUtils.toBean(recordCategories, RecordCategoryRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RecordCategoryDO> selectCategoryAppraisalList(String appraisalFlag) {
|
||||
LambdaQueryWrapper<RecordCategoryDO> queryWrapper = Wrappers.lambdaQuery();
|
||||
queryWrapper.like(RecordCategoryDO::getCustomConfig,"%" + appraisalFlag + "%");
|
||||
return recordCategoryMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void updateRecordCategory(RecordCategorySaveReqVO updateReqVO) {
|
||||
|
||||
@@ -90,6 +90,13 @@ public interface RecordRecordService {
|
||||
|
||||
List<RecordRecordRespVO> getRecordList(RecordRecordPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 定时任务:将生效日期已到的记录状态更新为已生效(recordStatus = 1)
|
||||
*
|
||||
* @return 更新条数
|
||||
*/
|
||||
Integer updateRecordStatus();
|
||||
|
||||
/**
|
||||
* 文件更改申请流程-- 查询文件记录数据
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user