| | |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import java.util.*; |
| | | |
| | | import com.bstek.dorado.uploader.UploadFile; |
| | | import com.bstek.dorado.uploader.annotation.FileResolver; |
| | |
| | | * @return |
| | | */ |
| | | @Expose |
| | | public String delArchives(OAArchives data) { |
| | | public String delArchives(OAArchives data) throws Exception { |
| | | List<FileInfo> list = data.getFileData(); |
| | | if (!list.isEmpty()) { |
| | | String fileId = list.get(0).getFileId(); |
| | | Date createTime = list.get(0).getCreateTime(); |
| | | if (null == createTime) { |
| | | createTime = new Date(); |
| | | } |
| | | |
| | | File file = new File(fileService.getCommonFilePath(createTime), fileId); |
| | | |
| | | if (!file.exists()) { |
| | | return "删除失败,系统未找到当前附件"; |
| | | } |
| | | |
| | | file.delete(); |
| | | fileService.delFile(fileId); |
| | | } |
| | | return service.delArchives(data); |
| | | } |
| | | |