|
|
@@ -190,29 +190,12 @@ public class RequestSTKServiceImpl implements RequestSTKService {
|
|
|
|
|
|
@Override
|
|
|
public HttpResultResponse buildPostParam(Integer page,Integer size,QueryCashFlowItemsDto dtoParam) throws Exception {
|
|
|
- /*String appid = "bf00be8b_0387_44f4_b073_50c3c2d6";
|
|
|
-
|
|
|
- //应用key
|
|
|
- String appkey = "eb1b6053bdda437c98a93d93013d9fae";
|
|
|
-
|
|
|
- //接口代码 每个接口的接口代码都不同
|
|
|
- String apiCode = "89edb885a8cf4412b870233fc89fb381";*/
|
|
|
|
|
|
//时间戳
|
|
|
String timestamp = Long.toString(System.currentTimeMillis());
|
|
|
|
|
|
- //分页内容 自行调整
|
|
|
- /* String page = "1";
|
|
|
- String pageSize = "500";
|
|
|
-*/
|
|
|
- //支持 时间字段_start 时间字段_end 的传值 例:UPDATE_TIME
|
|
|
- DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- LocalDateTime begin = LocalDateTime.of(LocalDate.now(), LocalTime.MIN).with(TemporalAdjusters.firstDayOfYear());
|
|
|
- LocalDateTime end = LocalDateTime.now();
|
|
|
-
|
|
|
//加签方法的重要参数
|
|
|
JSONObject request=new JSONObject(4);
|
|
|
- //request.put("code","MJ3ahZ9f");
|
|
|
request.put("page",page);
|
|
|
request.put("size",size);
|
|
|
|
|
|
@@ -224,7 +207,7 @@ public class RequestSTKServiceImpl implements RequestSTKService {
|
|
|
//param.put("TASKCODE","202409");
|
|
|
|
|
|
|
|
|
- request.put("param",param);
|
|
|
+ request.put("param",dtoParam);
|
|
|
|
|
|
String content = request.toString();
|
|
|
|
|
|
@@ -240,19 +223,6 @@ public class RequestSTKServiceImpl implements RequestSTKService {
|
|
|
log.info("STK,原始签名:"+signBuilder.toString());
|
|
|
log.info("STK,加密签名:"+sign);
|
|
|
|
|
|
-
|
|
|
- //请求数据 (接口地址根据测试环境与正式环境变更)
|
|
|
- /*String body = HttpRequest.post("https://192.168.2.179/api/oapigw/api/oapisvc/automicApi/"+apiCode)
|
|
|
- .header("appid",appid) //请求头
|
|
|
- .header("timestamp", timestamp)
|
|
|
- .header("sign", sign)
|
|
|
- .header("Content-Type", "application/json")
|
|
|
- .body(content) //请求参数
|
|
|
- .timeout(20000) //超时时间
|
|
|
- .execute().body();
|
|
|
- )
|
|
|
- */
|
|
|
-
|
|
|
Map<String,String> header = new HashMap<>();
|
|
|
header.put("appid",STK_APP_ID);
|
|
|
header.put("timestamp", timestamp);
|
|
|
@@ -303,25 +273,7 @@ public class RequestSTKServiceImpl implements RequestSTKService {
|
|
|
* */
|
|
|
public String getSign(Object dto,String timestamp) throws Exception {
|
|
|
|
|
|
- //String content = dto.toString();
|
|
|
-
|
|
|
- //加签方法的重要参数
|
|
|
- JSONObject request=new JSONObject(4);
|
|
|
- //request.put("code","MJ3ahZ9f");
|
|
|
- request.put("page",1);
|
|
|
- request.put("size",500);
|
|
|
-
|
|
|
- //传入参数 此处案例仅放置了时间,可自行添加
|
|
|
- JSONObject param=new JSONObject();
|
|
|
- //param.put("UPDATE_TIME_start","2024-05-09 14:24:06");
|
|
|
- //param.put("UPDATE_TIME_end","2024-05-09 15:01:28");
|
|
|
- //param.put("TASKNO","P2022032200000041");
|
|
|
- //param.put("TASKCODE","202409");
|
|
|
-
|
|
|
-
|
|
|
- request.put("param",param);
|
|
|
-
|
|
|
- String content = request.toString();
|
|
|
+ String content = dto.toString();
|
|
|
|
|
|
//加签方法第一个参数
|
|
|
StringBuilder signBuilder = new StringBuilder("appid").append("=").append(STK_APP_ID).append("&")
|