|
@@ -8,18 +8,25 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.ims.common.utils.StringUtils;
|
|
|
import com.ims.eval.config.CustomException;
|
|
|
+import com.ims.eval.config.ImaConfig;
|
|
|
import com.ims.eval.entity.EvaluationNotice;
|
|
|
import com.ims.eval.entity.OrganizationStructure;
|
|
|
import com.ims.eval.entity.custom.Path;
|
|
|
import com.ims.eval.entity.dto.result.R;
|
|
|
import com.ims.eval.service.IEvaluationNoticeService;
|
|
|
import com.ims.eval.service.IOrganizationStructureService;
|
|
|
-import com.ims.eval.util.FileUploadUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.HttpEntity;
|
|
|
+import org.springframework.http.HttpMethod;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
+import org.springframework.util.LinkedMultiValueMap;
|
|
|
+import org.springframework.util.MultiValueMap;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.client.RestTemplate;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.net.InetAddress;
|
|
@@ -47,6 +54,15 @@ public class NoticeManagementController {
|
|
|
@Autowired
|
|
|
private IOrganizationStructureService organizationStructureService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ HttpServletRequest request;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RestTemplate restTemplate;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ImaConfig imaConfig;
|
|
|
+
|
|
|
/**
|
|
|
* 通告管理列表信息(分页)
|
|
|
*
|
|
@@ -195,20 +211,27 @@ public class NoticeManagementController {
|
|
|
StringBuilder fileNames = new StringBuilder();
|
|
|
if (files.length > 0) {
|
|
|
for (MultipartFile file : files) {
|
|
|
+ MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
|
|
|
+ headers.add("Blade-Auth", "bearer " + request.getHeader("Blade-Auth"));
|
|
|
+ headers.add("Content-Type", "multipart/form-data");
|
|
|
+ HttpEntity<LinkedMultiValueMap<String, Object>> param = new HttpEntity<>(null, headers);
|
|
|
+ ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getGatewayUrl() + "f-center/dm/dmDoc/save?folder={1}&objType={2}&objKey={3}&file={4}&bucketName={5}",
|
|
|
+ HttpMethod.POST, param, String.class, "AsApplication", "xxxt/image", "", file, "yysd");
|
|
|
+ log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
|
|
|
// 上传文件路径
|
|
|
- String filePath = Path.getNoticePath();
|
|
|
+ //String filePath = Path.getNoticePath();
|
|
|
// 上传并返回新文件名称
|
|
|
- String fileName = FileUploadUtil.upload(filePath, file);
|
|
|
- fileNames.append(fileName).append(",");
|
|
|
+ //String fileName = FileUploadUtil.upload(filePath, file);
|
|
|
+ //fileNames.append(fileName).append(",");
|
|
|
}
|
|
|
- String newNoticeAnnex = fileNames.toString().substring(0, fileNames.toString().length() - 1);
|
|
|
+ /*String newNoticeAnnex = fileNames.toString().substring(0, fileNames.toString().length() - 1);
|
|
|
if (StringUtils.isNotEmpty(evaluationNotice.getNoticeAnnex())) {//true:非空串
|
|
|
String noticeAnnex = evaluationNotice.getNoticeAnnex() + "," + newNoticeAnnex;
|
|
|
evaluationNotice.setNoticeAnnex(noticeAnnex);
|
|
|
} else {
|
|
|
evaluationNotice.setNoticeAnnex(newNoticeAnnex);
|
|
|
}
|
|
|
- b = evaluationNoticeService.updateById(evaluationNotice);
|
|
|
+ b = evaluationNoticeService.updateById(evaluationNotice);*/
|
|
|
}
|
|
|
}
|
|
|
if (b) {
|