Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
fabf90f6
Commit
fabf90f6
authored
Nov 26, 2024
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目订单附件上传优化-fxj
parent
cd42008d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
16 deletions
+3
-16
EkpOrderUtil.java
...va/com/yifu/cloud/plus/v1/yifu/ekp/util/EkpOrderUtil.java
+3
-16
No files found.
yifu-common/yifu-common-ekp/src/main/java/com/yifu/cloud/plus/v1/yifu/ekp/util/EkpOrderUtil.java
View file @
fabf90f6
...
...
@@ -26,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author licancan
...
...
@@ -156,30 +157,16 @@ public class EkpOrderUtil {
public
String
syncFileFromEkp
(
String
orderNo
,
String
attIds
){
log
.
info
(
"同步项目订单附件信息"
);
RestTemplate
yourRestTemplate
=
new
RestTemplate
();
String
formValues
=
"{}"
;
try
{
//指向EKP的接口url
//把ModelingAppModelParameterAddForm转换成MultiValueMap
/*MultiValueMap<String,Object> wholeForm = new LinkedMultiValueMap<>();
wholeForm.add("orderNo", orderNo);
wholeForm.add("attIds", attIds);
wholeForm.add("fileFlag", CommonConstants.ZERO_STRING);
wholeForm.add("docSubject",ekpProperties.getReplyDocSubject());
wholeForm.add("docCreator", "{\"LoginName\":\"admin\"}");
wholeForm.add("docStatus", ekpProperties.getDocStatus());
wholeForm.add("fdModelId", ekpProperties.getReplyFdModelId());
wholeForm.add("fdFlowId", ekpProperties.getReplyFdFlowId());
wholeForm.add("formValues", formValues);*/
HttpHeaders
headers
=
new
HttpHeaders
();
//如果EKP对该接口启用了Basic认证,那么客户端需要加入
//addAuth(headers,"yourAccount"+":"+"yourPassword");是VO,则使用APPLICATION_JSON
headers
.
setContentType
(
MediaType
.
MULTIPART_FORM_DATA
);
//必须设置上传类型,如果入参是字符串,使用MediaType.TEXT_PLAIN;如果
HttpEntity
<
M
ultiValueMap
<
String
,
Object
>>
entity
=
new
HttpEntity
<
MultiValue
Map
<
String
,
Object
>>(
null
,
headers
);
HttpEntity
<
M
ap
<
String
,
Object
>>
entity
=
new
HttpEntity
<
Map
<
String
,
Object
>>(
null
,
headers
);
//有返回值的情况 VO可以替换成具体的JavaBean
log
.
error
(
"附件同步结果"
+
ekpProperties
.
getUrl
());
ResponseEntity
<
String
>
obj
=
yourRestTemplate
.
exchange
(
ekpProperties
.
getUrl2
()+
"?addIds="
+
attIds
+
"&orderNo="
+
orderNo
,
HttpMethod
.
POST
,
entity
,
String
.
class
);
ResponseEntity
<
String
>
obj
=
yourRestTemplate
.
exchange
(
ekpProperties
.
getUrl2
()+
"?addIds="
+
attIds
+
"&orderNo="
+
orderNo
,
HttpMethod
.
POST
,
null
,
String
.
class
);
log
.
error
(
"附件同步结果:"
+
JSONObject
.
toJSONString
(
obj
));
String
body
=
obj
.
getBody
();
if
(
StringUtils
.
isBlank
(
body
)){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment