Commit cd42008d authored by fangxinjiang's avatar fangxinjiang

项目订单附件上传优化-fxj

parent 2f9b1c11
......@@ -20,6 +20,10 @@ public class EkpOrderProperties {
* 接口url
*/
String url;
/**
* 接口url
*/
String url2;
/**
* 订单modelId
......
......@@ -160,7 +160,7 @@ public class EkpOrderUtil {
try{
//指向EKP的接口url
//把ModelingAppModelParameterAddForm转换成MultiValueMap
MultiValueMap<String,Object> wholeForm = new LinkedMultiValueMap<>();
/*MultiValueMap<String,Object> wholeForm = new LinkedMultiValueMap<>();
wholeForm.add("orderNo", orderNo);
wholeForm.add("attIds", attIds);
wholeForm.add("fileFlag", CommonConstants.ZERO_STRING);
......@@ -170,16 +170,16 @@ public class EkpOrderUtil {
wholeForm.add("docStatus", ekpProperties.getDocStatus());
wholeForm.add("fdModelId", ekpProperties.getReplyFdModelId());
wholeForm.add("fdFlowId", ekpProperties.getReplyFdFlowId());
wholeForm.add("formValues", formValues);
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<MultiValueMap<String,Object>> entity = new HttpEntity<MultiValueMap<String,Object>>(wholeForm,headers);
HttpEntity<MultiValueMap<String,Object>> entity = new HttpEntity<MultiValueMap<String,Object>>(null,headers);
//有返回值的情况 VO可以替换成具体的JavaBean
log.error("附件同步结果"+ekpProperties.getUrl());
ResponseEntity<String> obj = yourRestTemplate.exchange(ekpProperties.getUrl(), HttpMethod.POST, entity, String.class);
ResponseEntity<String> obj = yourRestTemplate.exchange(ekpProperties.getUrl2()+"?addIds="+attIds+"&orderNo="+orderNo, HttpMethod.POST, entity, String.class);
log.error("附件同步结果:"+ JSONObject.toJSONString(obj));
String body = obj.getBody();
if (StringUtils.isBlank(body)){
......
#ekporder.url=http://192.168.0.228:8080/api/sys-modeling/appModelRestService/addModel
ekporder.url=http://36.7.147.29:27007/api/sys-modeling/appModelRestService/addModel
ekporder.url2=http://36.7.147.29:27007/api/hro/modelingWebservice/updateOrderFileInfo
ekporder.orderFdModelId=182f1b7ffe2e96f975564e44e559847d
ekporder.orderFdFlowId=182f1c098ce991ca96bc927408792beb
ekporder.replyFdModelId=182f1bb35bb2156fb9a02904bc88dd8a
......@@ -9,6 +10,5 @@ ekporder.docStatus=20
ekporder.LoginName=admin
ekporder.orderDocSubject=\u7528\u4E8E\u9879\u76EE\u8BA2\u5355\u66F4\u65B0\u63A5\u53E3
ekporder.replyDocSubject=\u7528\u4E8E\u8BA2\u5355\u56DE\u590D\u63A5\u53E3
ekporder.updateOrderFile=\u540C\u6B65\u9644\u4EF6\u4FE1\u606F
......@@ -548,11 +548,6 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
order.setDeptId(settleDomain.getId());
}
boolean save = this.save(order);
//异步处理附件信息同步 fxj 2024-11-22 17:46
log.error("I AM HERE 1");
if (Common.isNotNull(vo.getAttIds())){
this.syncFileFromEkp(order.getOrderNo(),vo.getAttIds());
}
//处理指派人
if (save && CollectionUtils.isNotEmpty(vo.getHandleUserList())){
List<TOrderHandler> list = new ArrayList<>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment