diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/record/dal/dataobject/recordapplydetail/RecordApplyDetailDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/record/dal/dataobject/recordapplydetail/RecordApplyDetailDO.java index 35bde126..6eeedcb5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/record/dal/dataobject/recordapplydetail/RecordApplyDetailDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/record/dal/dataobject/recordapplydetail/RecordApplyDetailDO.java @@ -58,8 +58,8 @@ public class RecordApplyDetailDO extends BusinessBaseDO { @TableField("TGT_ID") private Long targetId; - @TableField("TGT_NAME") - private String targetName; + @TableField("FORM_DAT") + private String formData; /** * 是否需要更改 */ @@ -101,9 +101,6 @@ public class RecordApplyDetailDO extends BusinessBaseDO { @TableField("RMK") private String remark; - @TableField("FORM_DAT") - private String formData; - // ============临时字段==============> @TableField(exist = false) private String recordName; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/record/service/recordapply/RecordApplyServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/record/service/recordapply/RecordApplyServiceImpl.java index cd130016..9260205b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/record/service/recordapply/RecordApplyServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/record/service/recordapply/RecordApplyServiceImpl.java @@ -27,10 +27,8 @@ import com.zt.plat.module.qms.resource.record.controller.admin.recordapply.vo.Re 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.recordapplydetail.vo.RecordApplyDetailPageReqVO; -import com.zt.plat.module.qms.resource.record.controller.admin.recordapplydetail.vo.RecordApplyDetailRespVO; import com.zt.plat.module.qms.resource.record.controller.admin.recordapplydetail.vo.RecordApplyDetailSaveReqVO; import com.zt.plat.module.qms.resource.record.controller.admin.recordrecord.vo.RecordRecordPageReqVO; -import com.zt.plat.module.qms.resource.record.controller.admin.recordrecord.vo.RecordRecordRespVO; import com.zt.plat.module.qms.resource.record.dal.dataobject.recordapply.RecordApplyDO; import com.zt.plat.module.qms.resource.record.dal.dataobject.recordapplydetail.RecordApplyDetailDO; import com.zt.plat.module.qms.resource.record.dal.dataobject.recordcategory.RecordCategoryDO; @@ -157,35 +155,11 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn return recordApplyMapper.selectPage(pageReqVO); } - //创建临时数据 - @Override - @Transactional(rollbackFor = Exception.class) - public CommonResult createApplyData(RecordApplySaveReqVO param) { - String businessType = param.getBusinessType(); - if (ObjectUtils.isEmpty(businessType)) - throw exception0(RECORD_APPLY_NOT_EXISTS.getCode(), "请选择业务类型"); - // TODO - - RecordApplyDO recordApply = createApply(param); - - switch (businessType){ - case RecordConstants.BusinessType.REVIEW: - addReviewDetail(param,recordApply); - break; - case RecordConstants.BusinessType.DISTRIBUTION: - addDistributionDetail(param,recordApply); - break; - } - -// addDetail(param,recordApply); - - return CommonResult.success(BeanUtils.toBean(recordApply, RecordApplyRespVO.class)); - } - // 创建申请数据 - public RecordApplyDO createApply(RecordApplySaveReqVO param){ + public RecordApplyDO createApply(RecordApplySaveReqVO param) { RecordApplyDO recordApply = BeanUtils.toBean(param, RecordApplyDO.class); recordApply.setBusinessStatus(QmsCommonConstant.NOT_START); // 未发起 + recordApply.setApplyStartDate(LocalDateTime.now()); // 申请开始时间 String businessType = param.getBusinessType(); //取当前用户 LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); @@ -196,19 +170,61 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn recordApply.setApplyDepartmentName(loginUser.getVisitDeptName()); //生成标题 - String title = nickName + "的"+ businessType +"_" + new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss").format(new Date()); + String title = nickName + "的" + businessType + "_" + new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss").format(new Date()); recordApply.setTitle(title); try { recordApplyMapper.insert(recordApply); } catch (Exception e) { throw new RuntimeException(e); } - return recordApply; + return recordApply; + } + + //创建临时数据 + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult createApplyData(RecordApplySaveReqVO param) { + String businessType = param.getBusinessType(); + if (ObjectUtils.isEmpty(businessType)) + throw exception0(RECORD_APPLY_NOT_EXISTS.getCode(), "请选择业务类型"); + List paramsList = param.getParamsList(); + if (ObjectUtils.isEmpty(paramsList)) + throw exception0(RECORD_APPLY_NOT_EXISTS.getCode(), "没有找到文件记录数据"); + // TODO + RecordApplyDO recordApply = createApply(param); + + List detailSaveReqVOList = new ArrayList<>(); + switch (businessType) { + case RecordConstants.BusinessType.REVIEW: // 评审 + detailSaveReqVOList = addReviewDetail(param, recordApply); + break; + case RecordConstants.BusinessType.DISTRIBUTION: // 分发 + detailSaveReqVOList = addDistributionDetail(param, recordApply); + break; + case RecordConstants.BusinessType.RECORD_UPDATE: // 更改申请 + detailSaveReqVOList = addUpdateDetail(param, recordApply); + break; + case RecordConstants.BusinessType.INVALID: // 作废 + detailSaveReqVOList = addInvalidDetail(param, recordApply); + break; + case RecordConstants.BusinessType.VIEW_APPLY: // 查看 + detailSaveReqVOList = addViewApplyDetail(param, recordApply); + break; + case RecordConstants.BusinessType.RECORD_SUBMIT: // 提交 + detailSaveReqVOList = addRecordSubmitDetail(param, recordApply); + break; + } + + if (ObjectUtils.isEmpty(detailSaveReqVOList)) + throw exception0(RECORD_APPLY_NOT_EXISTS.getCode(), "没有找到文件记录数据"); + boolean recordApplyDetailBatch = recordApplyDetailService.createRecordApplyDetailBatch(detailSaveReqVOList); + if (!recordApplyDetailBatch) + throw exception(RECORD_APPLY_NOT_EXISTS, "保存申请明细失败"); + return CommonResult.success(BeanUtils.toBean(recordApply, RecordApplyRespVO.class)); } // 保存评审明细 - public void addReviewDetail(RecordApplySaveReqVO param,RecordApplyDO recordApplyDO){ -// String businessType = param.getBusinessType(); + public List addReviewDetail(RecordApplySaveReqVO param, RecordApplyDO recordApplyDO) { List paramsList = param.getParamsList(); List detailSaveReqVOList = new ArrayList<>(); for (RecordApplyDetailSaveReqVO item : paramsList) { @@ -220,11 +236,12 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn recordApplyDetailDO.setFormData(item.getFormData()); detailSaveReqVOList.add(recordApplyDetailDO); } - recordApplyDetailService.createRecordApplyDetailBatch(detailSaveReqVOList); +// recordApplyDetailService.createRecordApplyDetailBatch(detailSaveReqVOList); + return detailSaveReqVOList; } // 添加分发明细 - public void addDistributionDetail(RecordApplySaveReqVO param,RecordApplyDO recordApplyDO){ + public List addDistributionDetail(RecordApplySaveReqVO param, RecordApplyDO recordApplyDO) { Long recordId = param.getParamsList().get(0).getDocumentId(); String assignTarget = param.getAssignTarget(); @@ -257,11 +274,80 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn detailSaveReqVOList.add(recordApplyDetailDO); } } +// recordApplyDetailService.createRecordApplyDetailBatch(detailSaveReqVOList); + return detailSaveReqVOList; + } + + // 添加更改申请明细 + public List addUpdateDetail(RecordApplySaveReqVO param, RecordApplyDO recordApplyDO) { + List paramsList = param.getParamsList(); + List detailSaveReqVOList = new ArrayList<>(); + for (RecordApplyDetailSaveReqVO item : paramsList) { + RecordApplyDetailDO recordApplyDetailDO = new RecordApplyDetailDO(); + recordApplyDetailDO.setApplyId(recordApplyDO.getId()); + recordApplyDetailDO.setDocumentId(item.getDocumentId()); + recordApplyDetailDO.setIsModify(item.getIsModify()); + recordApplyDetailDO.setModifyCause(item.getModifyCause()); + recordApplyDetailDO.setFormData(item.getFormData()); + detailSaveReqVOList.add(recordApplyDetailDO); + } +// recordApplyDetailService.createRecordApplyDetailBatch(detailSaveReqVOList); + return detailSaveReqVOList; + } + + // 添加作废明细 + public List addInvalidDetail(RecordApplySaveReqVO param, RecordApplyDO recordApplyDO) { + List paramsList = param.getParamsList(); + List detailSaveReqVOList = new ArrayList<>(); + for (RecordApplyDetailSaveReqVO item : paramsList) { + RecordApplyDetailDO recordApplyDetailDO = new RecordApplyDetailDO(); + recordApplyDetailDO.setApplyId(recordApplyDO.getId()); + recordApplyDetailDO.setDocumentId(item.getDocumentId()); + recordApplyDetailDO.setIsModify(item.getIsModify()); + recordApplyDetailDO.setModifyCause(item.getModifyCause()); + recordApplyDetailDO.setFormData(item.getFormData()); + detailSaveReqVOList.add(recordApplyDetailDO); + } +// recordApplyDetailService.createRecordApplyDetailBatch(detailSaveReqVOList); + return detailSaveReqVOList; + } + + // 添加查看申请 + public List addViewApplyDetail(RecordApplySaveReqVO param, RecordApplyDO recordApplyDO) { + List paramsList = param.getParamsList(); + List detailSaveReqVOList = new ArrayList<>(); + for (RecordApplyDetailSaveReqVO item : paramsList) { + RecordApplyDetailDO recordApplyDetailDO = new RecordApplyDetailDO(); + recordApplyDetailDO.setApplyId(recordApplyDO.getId()); + recordApplyDetailDO.setDocumentId(item.getDocumentId()); + Long userId = SecurityFrameworkUtils.getLoginUser().getId(); + recordApplyDetailDO.setTargetId(userId); + recordApplyDetailDO.setTargetType(RecordConstants.TargetType.USER); // 用户 + recordApplyDetailDO.setIsModify(item.getIsModify()); + recordApplyDetailDO.setModifyCause(item.getModifyCause()); + recordApplyDetailDO.setFormData(item.getFormData()); + detailSaveReqVOList.add(recordApplyDetailDO); + } +// recordApplyDetailService.createRecordApplyDetailBatch(detailSaveReqVOList); + return detailSaveReqVOList; + } + + // 添加文件提交明细 + public List addRecordSubmitDetail(RecordApplySaveReqVO param, RecordApplyDO recordApplyDO) { +// List paramsList = param.getParamsList(); + List detailSaveReqVOList = new ArrayList<>(); + RecordApplyDetailDO recordApplyDetailDO = new RecordApplyDetailDO(); + Long recordId = param.getParamsList().get(0).getDocumentId(); + recordApplyDetailDO.setApplyId(recordApplyDO.getId()); + recordApplyDetailDO.setDocumentId(recordId); // 文件Id + detailSaveReqVOList.add(recordApplyDetailDO); +// recordApplyDetailService.createRecordApplyDetailBatch(detailSaveReqVOList); + return detailSaveReqVOList; } //增加明细 @Transactional(rollbackFor = Exception.class) - public CommonResult addDetail(RecordApplySaveReqVO param,RecordApplyDO recordApplyDO) { + public CommonResult addDetail(RecordApplySaveReqVO param, RecordApplyDO recordApplyDO) { String businessType = param.getBusinessType(); List paramsList = param.getParamsList(); //申请通用明细记录 @@ -310,8 +396,7 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn detailSaveReqVOList.add(recordApplyDetailDO); } } - } - else { + } else { RecordApplyDetailDO recordApplyDetailDO = new RecordApplyDetailDO(); Long recordId = param.getRecordId(); recordApplyDetailDO.setApplyId(recordApplyDO.getId()); @@ -330,11 +415,11 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn RecordApplyDetailDO recordApplyDetailDO = new RecordApplyDetailDO(); recordApplyDetailDO.setApplyId(recordApplyDO.getId()); recordApplyDetailDO.setDocumentId(item.getDocumentId()); // 文件Id - if (RecordConstants.BusinessType.VIEW_APPLY.equals(businessType)){ + if (RecordConstants.BusinessType.VIEW_APPLY.equals(businessType)) { recordApplyDetailDO.setTargetType(RecordConstants.TargetType.USER); recordApplyDetailDO.setTargetId(loginUser.getId()); // 申请人,当前用户 } - if (RecordConstants.BusinessType.REVIEW.equals(businessType)){ // 评审 是否 修改文件 + if (RecordConstants.BusinessType.REVIEW.equals(businessType)) { // 评审 是否 修改文件 recordApplyDetailDO.setIsModify(item.getIsModify()); recordApplyDetailDO.setModifyCause(item.getModifyCause()); } @@ -404,7 +489,8 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn // 判断文件提交是否需要走流程 public boolean justifyRecordApply(RecordRecordDO recordDO) { Integer recordStatus = recordDO.getRecordStatus(); - if (recordStatus != null && recordStatus == 1) throw exception(RECORD_APPLY_NOT_EXISTS, "文件已提交,无法提交申请"); + if (recordStatus != null && recordStatus == 1) + throw exception(RECORD_APPLY_NOT_EXISTS, "文件已提交,无法提交申请"); RecordCategoryDO recordCategory = recordCategoryService.getRecordCategory(recordDO.getCategoryId()); // 获取分类的根分类Id String idPath = recordCategory.getIdPath(); @@ -450,26 +536,18 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn @Transactional(rollbackFor = Exception.class) public CommonResult submitRecordApply(RecordApplySaveReqVO param) { LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); - if (ObjectUtils.isEmpty(loginUser)) throw exception0(1_032_350_401,"请重新登录"); + if (ObjectUtils.isEmpty(loginUser)) throw exception0(RECORD_RECORD_NOT_EXISTS.getCode(), "请重新登录"); String nickName = SecurityFrameworkUtils.getLoginUserNickname(); - Long recordId = param.getRecordId();// 文件Id Long applyId = param.getId(); // 申请Id String paramBusinessType = param.getBusinessType(); RecordApplyDO recordApplyDO; if (!ObjectUtils.isEmpty(paramBusinessType) && paramBusinessType.equals(RecordConstants.BusinessType.RECORD_SUBMIT)) { // 创建申请记录 - recordApplyDO = createApply(param); - applyId = recordApplyDO.getId(); - // 创建申请明细 - RecordApplyDetailSaveReqVO saveReqVO = new RecordApplyDetailSaveReqVO(); - saveReqVO.setDocumentId(recordId); - List recordApplyDetailDOS = new ArrayList<>(); - recordApplyDetailDOS.add(saveReqVO); - param.setParamsList(recordApplyDetailDOS); - addDetail(param,recordApplyDO); + CommonResult applyData = createApplyData(param); + applyId = applyData.getData().getId(); } - if (ObjectUtils.isEmpty(applyId)) throw exception0(1_032_350_401,"申请记录不存在"); + if (ObjectUtils.isEmpty(applyId)) throw exception0(RECORD_RECORD_NOT_EXISTS.getCode(), "申请记录不存在"); recordApplyDO = recordApplyMapper.selectById(applyId); JSONObject formData = new JSONObject(); @@ -481,9 +559,13 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn switch (businessType) { case RecordConstants.BusinessType.RECORD_SUBMIT: // 判断根分类上是否配置自定义配置,允许提交,则需要走流程,否则直接提交 - if (ObjectUtils.isEmpty(recordId)) throw exception0(RECORD_RECORD_NOT_EXISTS.getCode(),"请选择文件记录"); + List paramsList = param.getParamsList(); + Long recordId = paramsList.get(0).getDocumentId(); + if (ObjectUtils.isEmpty(recordId)) + throw exception0(RECORD_RECORD_NOT_EXISTS.getCode(), "请选择文件记录"); RecordRecordDO entity = recordRecordService.getRecordById(recordId); - if (ObjectUtils.isEmpty(entity)) throw exception0(RECORD_RECORD_NOT_EXISTS.getCode(),"文件记录实体不存在"); + if (ObjectUtils.isEmpty(entity)) + throw exception0(RECORD_RECORD_NOT_EXISTS.getCode(), "文件记录实体不存在"); boolean b = justifyRecordApply(entity); if (b) { // 不需要走流程,直接返回成功 @@ -492,7 +574,6 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn reqDTO.setProcessDefinitionKey(RecordConstants.ProcessDefinitionKey.RECORD_SUBMIT_DEFINITION_KEY); break; case RecordConstants.BusinessType.DISTRIBUTION: // 分发 - if (ObjectUtils.isEmpty(recordId)) throw exception(RECORD_RECORD_NOT_EXISTS,"请选择文件记录"); reqDTO.setProcessDefinitionKey(RecordConstants.ProcessDefinitionKey.DISTRIBUTION__DEFINITION_KEY); // 文件分发需要关联权限表, break; @@ -550,7 +631,7 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn public CommonResult callback(QmsBpmDTO reqDTO) { log.error("文件下发流程回调:{}", JSONObject.toJSONString(reqDTO)); loginUser = SecurityFrameworkUtils.getLoginUser(); - if (ObjectUtils.isEmpty(loginUser)) throw exception0(1_032_350_401,"当前用户不存在,请重新登录"); + if (ObjectUtils.isEmpty(loginUser)) throw exception0(1_032_350_401, "当前用户不存在,请重新登录"); JSONObject variables = reqDTO.getVariables(); // TODO 目前审批意见在流程回调时保存,后续可以考虑在每个节点完成时保存审批意见,这样可以避免审批意见丢失的情况,同时也能更及时地记录审批意见 JSONObject taskVariables = variables.getJSONObject("taskVariables"); @@ -566,7 +647,6 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn RecordApplyDO recordApplyDO = recordApplyMapper.selectById(Long.valueOf(mainId)); // 申请记录 if (recordApplyDO == null) throw exception0(RECORD_APPLY_NOT_EXISTS.getCode(), "申请记录不存在"); - JSONObject ret = new JSONObject(); //同一个节点实例只触发一次 @@ -594,17 +674,17 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn log.info("firstActivityFlag:{}",firstActivityFlag); - if ("1".equals(firstActivityFlag)) { // 执行到申请人节点,修改状态 + if ("1".equals(firstActivityFlag)) { // 执行到申请人节点,待处理 if (PROCESS_STATUS.equals("1")) { - recordApplyDO.setBusinessStatus(QmsCommonConstant.RUNNING); - recordApplyMapper.updateById(recordApplyDO); +// recordApplyDO.setBusinessStatus(QmsCommonConstant.RUNNING); +// recordApplyMapper.updateById(recordApplyDO); return CommonResult.success(ret); } } // 拒绝,PROCESS_STATUS 状态是3,拒绝。回退上一步流程,修改状态 - if ("3".equals(PROCESS_STATUS)){ - if (businessType.equals(RecordConstants.BusinessType.RECORD_SUBMIT)){ + if ("3".equals(PROCESS_STATUS)) { + if (businessType.equals(RecordConstants.BusinessType.RECORD_SUBMIT)) { recordApplyDO.setBusinessStatus(QmsCommonConstant.VOID); recordApplyMapper.updateById(recordApplyDO); return CommonResult.success(ret); @@ -627,10 +707,11 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn // //作废 TODO //// entity.setBusinessStatus(QmsCommonConstant.VOID); // } else - if ("1".equals(PROCESS_STATUS)) { + if ("1".equals(PROCESS_STATUS)) { //通过 List recordApplyDetailDOS = recordApplyDetailService.selectList(new RecordApplyDetailPageReqVO().setApplyId(Long.valueOf(mainId))); - if (ObjectUtils.isEmpty(recordApplyDetailDOS)) throw exception0(RECORD_RECORD_NOT_EXISTS.getCode(),"未找到对应的申请明细记录"); + if (ObjectUtils.isEmpty(recordApplyDetailDOS)) + throw exception0(RECORD_RECORD_NOT_EXISTS.getCode(), "未找到对应的申请明细记录"); // TODO 业务代码,通过业务类型判断 List recordRecordDOS = new ArrayList<>(); switch (businessType) { @@ -643,21 +724,7 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn recordApplyFlowStatus(entity); break; case RecordConstants.BusinessType.REVIEW: // 评审 - List detailDOList = new ArrayList<>(); - // 1条申请----> 多条明细记录 ----> 多条文件记录 - for (RecordApplyDetailDO applyDetailDO : recordApplyDetailDOS) { - if (applyDetailDO.getIsModify() == 1){ - RecordApplyDetailSaveReqVO detailDO = new RecordApplyDetailSaveReqVO(); - detailDO.setDocumentId(applyDetailDO.getDocumentId()); - detailDOList.add(detailDO); - } - } - // 文件评审通过了,如果需要修改文件,直接申请流程 - if (ObjectUtils.isEmpty(detailDOList)) break; - RecordApplySaveReqVO recordApplyRespVO = new RecordApplySaveReqVO(); - recordApplyRespVO.setBusinessType(RecordConstants.BusinessType.RECORD_UPDATE); - recordApplyRespVO.setParamsList(detailDOList); - createApplyData(recordApplyRespVO); + reviewCallHandle(recordApplyDetailDOS); break; case RecordConstants.BusinessType.DISTRIBUTION: // 分发 recordPermissionAdd(recordApplyDetailDOS); @@ -697,6 +764,26 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn return CommonResult.success(ret); } + // 评审通过,处理修改修改的文件,走更改申请流程 + public void reviewCallHandle(List recordApplyDetailDOS){ + List detailDOList = new ArrayList<>(); + // 1条申请----> 多条明细记录 ----> 多条文件记录 + for (RecordApplyDetailDO applyDetailDO : recordApplyDetailDOS) { + if (applyDetailDO.getIsModify() == 1) { //是否修改,是:直接创建更改申请 + RecordApplyDetailSaveReqVO detailDO = new RecordApplyDetailSaveReqVO(); + detailDO.setDocumentId(applyDetailDO.getDocumentId()); + detailDOList.add(detailDO); + } + } + // 文件评审通过了,如果需要修改文件,直接申请流程 + if (!ObjectUtils.isEmpty(detailDOList)) { + RecordApplySaveReqVO recordApplyRespVO = new RecordApplySaveReqVO(); + recordApplyRespVO.setBusinessType(RecordConstants.BusinessType.RECORD_UPDATE); + recordApplyRespVO.setParamsList(detailDOList); + createApplyData(recordApplyRespVO); + } + } + // 文件提交-更改状态 public void recordApplyFlowStatus(RecordRecordDO recordDO) { // 修改文件状态为已生效 @@ -711,6 +798,8 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn // 文件分发/申请-添加权限 public void recordPermissionAdd(List recordApplyDetailDOS) { + String loginUserNickname = SecurityFrameworkUtils.getLoginUserNickname(); + String visitDeptName = loginUser.getVisitDeptName(); for (RecordApplyDetailDO applyDetailDO : recordApplyDetailDOS) { // 添加记录 String targetType = applyDetailDO.getTargetType(); @@ -719,6 +808,7 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn // 通过-----> 创建人员权限表记录 RecordPermissionDO permissionDO = new RecordPermissionDO(); permissionDO.setPermission(RecordConstants.PermissionType.VIEW); // 可查看 + permissionDO.setSourceType(RecordConstants.PermissionSourceType.RECORD); // 记录权限 permissionDO.setSourceId(applyDetailDO.getDocumentId()); // 文件Id permissionDO.setDeptId(loginUser.getVisitDeptId()); permissionDO.setDeptName(loginUser.getVisitDeptName()); @@ -726,10 +816,13 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn if (targetType.equals(RecordConstants.TargetType.USER)) { permissionDO.setTargetId(String.valueOf(applyDetailDO.getTargetId())); // 用户Id permissionDO.setTargetType(RecordConstants.TargetType.USER); + permissionDO.setTargetName(loginUserNickname); } else { // 部门 permissionDO.setTargetId(String.valueOf(applyDetailDO.getTargetId())); // 部门Id permissionDO.setTargetType(RecordConstants.TargetType.DEPT); + permissionDO.setTargetName(visitDeptName); } + permissionDOList.add(permissionDO); boolean b = recordPermissionService.insertRecordPermissionBatch(permissionDOList); if (!b) throw exception(RECORD_APPLY_NOT_EXISTS, "保存分发权限失败"); @@ -738,11 +831,11 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn /** - * 文件评审分页查询,我需要查询出 recordApply 和 recordApplyDetail 和recordRecord 关联的数据,其中: + * 文件评审分页查询,我需要查询出 recordApply 和 recordApplyDetail 和recordRecord 关联的数据,其中: * recordApply 对 recordApplyDetail 一对多的关系 * recordApplyDetail 对 和recordRecord 一对一的关系 * 查询条件:recordApply 的 businessType = '文件评审' - * */ + */ @Override public PageResult recordReviewPage(RecordRecordPageReqVO pageReqVO) { // 使用多表连接查询获取文件评审数据 @@ -771,7 +864,7 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn @Override public PageResult recordUpdatePage(RecordApplyPageReqVO pageReqVO) { Page page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); - recordApplyMapper.recordUpdatePage(page,pageReqVO); + recordApplyMapper.recordUpdatePage(page, pageReqVO); return null; } @@ -779,12 +872,12 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn @Override public PageResult recordInvalidPage(RecordApplyPageReqVO pageReqVO) { Page page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); - recordApplyMapper.recordUpdatePage(page,pageReqVO); + recordApplyMapper.recordUpdatePage(page, pageReqVO); return null; } //查询提交的流程是否存在没有处理或者通过的的数据 public List selectApplyByStatus(String businessType, java.util.List documentIds, java.util.List businessStatuses) { - return recordApplyMapper.selectApplyByStatus(businessType,documentIds,businessStatuses); + return recordApplyMapper.selectApplyByStatus(businessType, documentIds, businessStatuses); } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/record/dal/mapper/RecordRecordMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/record/dal/mapper/RecordRecordMapper.xml index 48ba6767..771df012 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/record/dal/mapper/RecordRecordMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/record/dal/mapper/RecordRecordMapper.xml @@ -64,9 +64,6 @@ AND trr.NAME LIKE CONCAT('%', #{reqVO.name}, '%') - - AND trr.FORM_KY = #{reqVO.formKey} - AND trr.VER = #{reqVO.version} @@ -76,45 +73,12 @@ AND trr.MKE_DT BETWEEN #{reqVO.makeDate[0]} AND #{reqVO.makeDate[1]} - - AND trr.CNF_FLG = #{reqVO.confidentialFlag} - - - AND trr.CNF_LVL = #{reqVO.confidentialLevel} - - - AND trr.CNF_WY = #{reqVO.confidentialWay} - - - AND trr.CNF_KY = #{reqVO.confidentialKey} - - - AND trr.PMNT = #{reqVO.permanently} - AND trr.EXPR_DT BETWEEN #{reqVO.expirationDate[0]} AND #{reqVO.expirationDate[1]} AND trr.EXPR_STS = #{reqVO.expirationStatus} - - AND trr.CNL_FLG = #{reqVO.cancelFlag} - - - AND trr.FORM_DAT = #{reqVO.formData} - - - AND trr.DAT_COLT_ID = #{reqVO.dataCollectionId} - - - AND trr.SRC_URL = #{reqVO.sourceUrl} - - - AND trr.SYS_DEPT_CD = #{reqVO.systemDepartmentCode} - - - AND trr.RMK = #{reqVO.remark} - AND trr.MAIN_ID = #{reqVO.mainId} @@ -128,7 +92,7 @@