|
@@ -8,17 +8,19 @@ 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.core.io.InputStreamResource;
|
|
|
+import org.springframework.http.*;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.client.RestTemplate;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -27,10 +29,7 @@ import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
import java.net.InetAddress;
|
|
|
import java.net.UnknownHostException;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 通告管理
|
|
@@ -53,6 +52,12 @@ public class NoticeManagementController {
|
|
|
@Autowired
|
|
|
HttpServletRequest request;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RestTemplate restTemplate;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ImaConfig imaConfig;
|
|
|
+
|
|
|
/**
|
|
|
* 通告管理列表信息(分页)
|
|
|
*
|
|
@@ -198,7 +203,18 @@ public class NoticeManagementController {
|
|
|
boolean b = false;
|
|
|
EvaluationNotice evaluationNotice = evaluationNoticeService.getById(id);
|
|
|
if (null != evaluationNotice) {
|
|
|
- StringBuilder fileNames = new StringBuilder();
|
|
|
+ for (MultipartFile file : files) {
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ headers.setContentType(MediaType.MULTIPART_FORM_DATA);
|
|
|
+ headers.add("Blade-Auth", "bearer " + request.getHeader("Blade-Auth"));
|
|
|
+ HttpEntity<Map> 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", "AsApplication", "", file, "dbkp");
|
|
|
+ log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
|
|
|
+ if (200 == responseEntity2.getStatusCodeValue()) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /*StringBuilder fileNames = new StringBuilder();
|
|
|
if (files.length > 0) {
|
|
|
for (MultipartFile file : files) {
|
|
|
// 上传文件路径
|
|
@@ -215,7 +231,7 @@ public class NoticeManagementController {
|
|
|
evaluationNotice.setNoticeAnnex(newNoticeAnnex);
|
|
|
}
|
|
|
b = evaluationNoticeService.updateById(evaluationNotice);
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
if (b) {
|
|
|
return R.ok().data(b);
|