|
|
@@ -351,56 +351,7 @@ public class RequestSTKServiceImpl implements RequestSTKService {
|
|
|
.body(content) //请求参数
|
|
|
.timeout(20000) //超时时间
|
|
|
.execute().body();
|
|
|
-
|
|
|
- //时间戳
|
|
|
- /* String timestamp = Long.toString(System.currentTimeMillis());
|
|
|
-
|
|
|
- //加签方法的重要参数
|
|
|
- JSONObject request=new JSONObject(4);
|
|
|
- //传入参数 此处案例仅放置了时间,可自行添加
|
|
|
- //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");
|
|
|
-
|
|
|
- JSONObject param = new JSONObject(4);
|
|
|
- Field[] fields = dto.getClass().getDeclaredFields();
|
|
|
- for(Field field : fields){
|
|
|
- String fieldName = field.getName();
|
|
|
- if(getValueByFieldName(fieldName,dto)!=null)
|
|
|
- param.put(fieldName, getValueByFieldName(fieldName,dto));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- request.put("param",param);
|
|
|
-
|
|
|
- String content = request.toString();
|
|
|
-
|
|
|
-
|
|
|
- log.info("修改客商信息入参content:{}",content);
|
|
|
-
|
|
|
- //加签方法第一个参数
|
|
|
- StringBuilder signBuilder = new StringBuilder("appid").append("=").append(STK_APP_ID).append("&")
|
|
|
- .append(content).append("&")
|
|
|
- .append("timestamp").append("=").append(timestamp).append("&")
|
|
|
- .append("key").append("=").append(STK_APP_KEY);
|
|
|
-
|
|
|
- //加签
|
|
|
- String sign = STKSignUtil.HMACSHA256(signBuilder.toString(),STK_APP_KEY);
|
|
|
-
|
|
|
- log.info("STK,原始签名:"+signBuilder.toString());
|
|
|
- log.info("STK,加密签名:"+sign);
|
|
|
-
|
|
|
- Map<String,String> header = new HashMap<>();
|
|
|
- header.put("appid",STK_APP_ID);
|
|
|
- header.put("timestamp", timestamp);
|
|
|
- header.put("sign", sign);
|
|
|
- header.put("Content-Type", "application/json");
|
|
|
- HttpResultResponse resultResponse = HuToolUtils.post(SAVE_OR_UPDATE_URL+SAVE_OR_UPDATE_REQUEST_CODE
|
|
|
- ,request, header);
|
|
|
-
|
|
|
- log.info("示例返回:{}",JSONObject.toJSONString(resultResponse));*/
|
|
|
+ log.info("修改客商返回信息:{}",body);
|
|
|
return JSONObject.parseObject(body,SaveOrChangeCustomerDataVo.class);
|
|
|
}
|
|
|
|