|
@@ -3,9 +3,11 @@ package com.factory.controller.web;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.factory.base.entity.aggregates.ResponseBean;
|
|
|
import com.factory.base.util.res.ResponseBeanBuilder;
|
|
|
+import com.factory.web.entity.fa.FirstArticleTitle;
|
|
|
import com.factory.web.entity.pm.OnsiteTitle;
|
|
|
import com.factory.web.entity.pm.OnsiteTitleBlob;
|
|
|
import com.factory.web.service.FileService;
|
|
|
+import com.factory.web.service.fa.FirstArticleService;
|
|
|
import com.factory.web.service.impl.DownLoadParam;
|
|
|
import com.factory.web.service.impl.FileEntry;
|
|
|
import com.factory.web.service.impl.FileResultInfo;
|
|
@@ -41,10 +43,14 @@ public class FileBlobController {
|
|
|
private FileService fileService;
|
|
|
@Autowired
|
|
|
private OnsiteTitleBlobService blobService;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private PreventMistakeService preventMistakeService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FirstArticleService firstArticleService;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@PostMapping("/addFile")
|
|
|
@ApiOperation(value = "上传附件-附件参数名称file")
|
|
@@ -71,18 +77,9 @@ public class FileBlobController {
|
|
|
if (param.getType() == 2) {
|
|
|
OnsiteTitle onsiteTitle = preventMistakeService.getTitle(param.getPlanId());
|
|
|
id = Long.parseLong(onsiteTitle.getUploadAttachmentId());
|
|
|
-
|
|
|
-// OnsiteTitleBlob blob = blobService.queryBlobForPlanId(param.getPlanId());
|
|
|
-// if (blob != null) {
|
|
|
-// blob.setTitleContentStr(new String(blob.getTitleContent(), StandardCharsets.UTF_8));
|
|
|
-// JSONObject jsonObject = JSONObject.parseObject(blob.getTitleContentStr());
|
|
|
-// String uploadAttachmentId = jsonObject.getString("uploadAttachmentId");
|
|
|
-// if (uploadAttachmentId != null) {
|
|
|
-// id = Long.parseLong(uploadAttachmentId);
|
|
|
-// }
|
|
|
-// }
|
|
|
} else {
|
|
|
-
|
|
|
+ FirstArticleTitle title=firstArticleService.getFaTitle(param.getPlanId());
|
|
|
+ id = Long.parseLong(title.getUploadAttachmentId());
|
|
|
}
|
|
|
|
|
|
download(id, response);
|