Commit 7ed1995d authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

Feature zhaji

See merge request fangxinjiang/yifu!134
parents f157cd4d 77d21f57
package com.yifu.cloud.plus.v1.yifu.insurances.util;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.*;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.io.File;
/**
* @author zhaji
* @description EKP交互工具类
*
* @date 2022-08-05 09:42:33
*/
public class EKPUtil {
/**
* 多层级的VO对象,且包含上传功能的样例
* 注意key的书写格式,类似EL表达式的方式,属性关系用'.', 列表和数组关系用[],Map关系用["xxx"]
*/
public static void testAddNewsInRestTemplate() throws Exception{
RestTemplate yourRestTemplate = new RestTemplate();
//指向EKP的接口url
String url = "http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel";
//把ModelingAppModelParameterAddForm转换成MultiValueMap
MultiValueMap<String,Object> wholeForm = new LinkedMultiValueMap<>();
wholeForm.add("docSubject", new String("接口发起流程".getBytes("UTF-8"),"ISO-8859-1") );
wholeForm.add("docCreator", "{\"PersonNo\":\"00013\"}");
wholeForm.add("docStatus", 20);
wholeForm.add("fdModelId", "169b437e7e1cd1bd7b6367c4563b24ef");
wholeForm.add("fdFlowId", "178255fbdeda940cbd17bdd476398084");
wholeForm.add("formValues", new String("{\"fd_37310fdc84a55e\":\"王五\", \"fd_37310fe0aa2334\":\"2019-03-26\", \"fd_37310fde1759a4\":\"这里内容\"}".getBytes("UTF-8"),"ISO-8859-1") );
LinkedMultiValueMap<String,Object> innerMap = new LinkedMultiValueMap<>();
//注意附件列表的key是一样的
//第一个附件
wholeForm.add("attachmentForms[0].fdKey", "fd_3731bf4852e8fe");
wholeForm.add("attachmentForms[0].fdFileName", new String("测试文档.txt".getBytes("UTF-8"),"ISO-8859-1"));
wholeForm.add("attachmentForms[0].fdAttachment", new FileSystemResource(new File("E:/测试文档.txt")));
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);
//有返回值的情况 VO可以替换成具体的JavaBean
ResponseEntity<String> obj = yourRestTemplate.exchange(url, HttpMethod.POST, entity, String.class);
String body = obj.getBody();
System.out.println(body);
}
}
......@@ -340,7 +340,7 @@
<if test="param.createEndTime != null and param.createEndTime.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.createEndTime}, ' 23:59:59')
</if>
ORDER BY detail.CREATE_TIME ,detail.ID DESC
ORDER BY detail.CREATE_TIME DESC ,detail.ID ASC
</select>
<!-- 已投保列表不分页查询-->
<select id="getInsuredList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
......@@ -473,7 +473,7 @@
(detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59'))
)
</if>
ORDER BY refund.CREATE_TIME,detail.ID DESC
ORDER BY refund.CREATE_TIME DESC,detail.ID ASC
</select>
<!-- 已减员列表不分页查询-->
<select id="getInsuranceRefundList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundListVo">
......
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