| | |
| | | import cn.iocoder.yudao.module.hrm.enums.HrmTransferTypeEnum; |
| | | import cn.iocoder.yudao.module.system.api.dept.DeptApi; |
| | | import cn.iocoder.yudao.module.system.api.dept.PostApi; |
| | | import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi; |
| | | import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; |
| | | import cn.iocoder.yudao.module.system.api.dept.dto.PostRespDTO; |
| | | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| | |
| | | @Resource |
| | | private BpmCategoryService bpmCategoryService; |
| | | @Resource |
| | | private StorageAttachmentApi storageAttachmentApi; |
| | | @Resource |
| | | private BpmProcessDefinitionService bpmProcessDefinitionService; |
| | | |
| | | @Override |
| | |
| | | application.setUserId(userId); |
| | | application.setStatus(HrmAuditStatusEnum.DRAFT.getStatus()); |
| | | transferApplicationMapper.insert(application); |
| | | storageAttachmentApi.bindAttachments("file", "hrm_transfer_application", |
| | | application.getId(), createReqVO.getBlobIds()); |
| | | return application.getId(); |
| | | } |
| | | |
| | |
| | | } |
| | | HrmTransferApplicationDO updateObj = BeanUtils.toBean(updateReqVO, HrmTransferApplicationDO.class); |
| | | transferApplicationMapper.updateById(updateObj); |
| | | if (updateReqVO.getBlobIds() != null) { |
| | | storageAttachmentApi.deleteAttachmentsByRecord("hrm_transfer_application", updateReqVO.getId()); |
| | | storageAttachmentApi.bindAttachments("file", "hrm_transfer_application", |
| | | updateReqVO.getId(), updateReqVO.getBlobIds()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (!Objects.equals(application.getStatus(), HrmAuditStatusEnum.DRAFT.getStatus())) { |
| | | throw exception(TRANSFER_APPLICATION_UPDATE_FAIL_NOT_DRAFT); |
| | | } |
| | | storageAttachmentApi.deleteAttachmentsByRecord("hrm_transfer_application", id); |
| | | transferApplicationMapper.deleteById(id); |
| | | } |
| | | |
| | |
| | | fillPostNames(respVO, application); |
| | | respVO.setTransferTypeName(HrmTransferTypeEnum.getNameByStatus(application.getTransferType())); |
| | | respVO.setStatusName(HrmAuditStatusEnum.getNameByStatus(application.getStatus())); |
| | | respVO.setAttachmentList(storageAttachmentApi.listAttachments("hrm_transfer_application", id)); |
| | | return respVO; |
| | | } |
| | | |