weaver-hrm-salary/test/FwjtDemo.java

71 lines
3.0 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import com.engine.salary.util.HttpUtil;
import com.engine.salary.util.JsonUtil;
import com.engine.salary.util.SingnatureData;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class FwjtDemo {
private static final String hostUrl = "https://uat-ddapi.bigfintax.com/";
private static final String appKey = "fwjt";
private static final String appSecret = "D22439F71F0D7BB17C46583837962E6F";
public static void main(String[] args) throws Exception {
//1.校验任务发起
//checkPassWord();
// 成功受理返回: {"head":{"msg":"成功","code":"00000000","description":"成功","time":"2024-06-21 11:42:31","status":"Y"},"body":{"requestId":"25d99665958148698e60b1de97e2d53d"}}
//2.校验任务查询结果
getCheckPassWord("25d99665958148698e60b1de97e2d53d");
// 失败场景如下: {"head":{"msg":"您输入的密码错误您还剩3次机会连续输错后密码将会锁定120分钟请谨慎使用","code":"010013","description":null,"time":"2024-06-21 11:35:15","status":"N"}}
// 成功场景如下: {"head":{"msg":"成功","code":"00000000","description":"成功","time":"2024-06-21 11:34:00","status":"Y"},"body":true}
}
/***
* 校验密码
* @return
* @throws Exception
*/
public static String checkPassWord() throws Exception {
String url = hostUrl + "gateway/iit/service/check/checkPassword";
Map<String, Object> requestParam = new HashMap<String, Object>();
requestParam.put("bizNo", UUID.randomUUID().toString().replace("-", ""));
requestParam.put("qymc", "测试0");
requestParam.put("mmlx", "0");
requestParam.put("djxhid", "10117110118941289705");
requestParam.put("nsrsbh", "91110118941289705K");
requestParam.put("sbmm", "Aa123456");
requestParam.put("mmlx", "0");
requestParam.put("areaid", "110105");
String reqJson = JsonUtil.toJsonString(requestParam);
Map<String, String> params = new HashMap<String, String>();
Map<String, String> header = SingnatureData.initHeader(params, appKey, appSecret);
String res = "";
try {
//res = HttpUtil.getRequest(url, header, params);
res = HttpUtil.doPost(url, header, reqJson, "application/json");
System.out.println(res);
} catch (Exception e) {
e.printStackTrace();
}
return res;
}
public static String getCheckPassWord(String requestId) throws Exception {
String url = hostUrl + "gateway/iit/service/check/getCheckPasswordFeedback";
Map<String, String> params = new HashMap<String, String>();
params.put("requestId", requestId);
Map<String, String> header = SingnatureData.initHeader(params, appKey, appSecret);
String res = "";
try {
res = HttpUtil.getRequest(url, header, params);
System.out.println(res);
} catch (Exception e) {
e.printStackTrace();
}
return res;
}
}