/** * 上传新附件保存附件信息 * * @see * com.yunat.workflow.development.service.DevelopmentService#insertAttachment(com.yunat.workflow.development.domain.AttachmentDomain) * @author: 邱路平 - [email protected] * @date: Created on Jul 5, 2013 4:58:16 PM */ @Transactional public void insertAttachment(AttachmentDomain attachmentDomain) { Attachment ap = new Attachment(); ap.setFid(UUID.randomUUID().toString().replace("-", "")); ap.setTask_id(attachmentDomain.getTask_id()); ap.setFile_name(attachmentDomain.getFile_name()); ap.setDescription(attachmentDomain.getDescription()); attachmentDAO.insertAttachment(ap); }
/** * 根据任务id查询附件信息 * * @see * com.yunat.workflow.development.service.DevelopmentService#queryAttachmentByTaskId(java.lang.String) * @author: 邱路平 - [email protected] * @date: Created on Jul 4, 2013 4:29:57 PM */ @Transactional public List<AttachmentDomain> queryAttachmentByTaskId(String task_id) { List<Attachment> attachmentPojo = attachmentDAO.queryAttachmentByTaskId(task_id); List<AttachmentDomain> attachmentDomain = new ArrayList<AttachmentDomain>(); for (Attachment ap : attachmentPojo) { AttachmentDomain ad = new AttachmentDomain(); ad.setFid(ap.getFid()); ad.setTask_id(ap.getTask_id()); ad.setFile_name(ap.getFile_name()); ad.setDescription(ap.getDescription()); attachmentDomain.add(ad); } System.out.println(attachmentDomain.size()); return attachmentDomain; }
/** * 删除附件 * * @see * com.yunat.workflow.development.service.DevelopmentService#deleteAttachment(com.yunat.workflow.development.domain.AttachmentDomain) * @author: 邱路平 - [email protected] * @date: Created on Jul 9, 2013 6:13:05 PM */ @Transactional public void deleteAttachment(AttachmentDomain attachmentDomain) { Attachment ap = new Attachment(); ap.setFid(attachmentDomain.getFid()); attachmentDAO.deleteAttachment(ap); }