Commit 41eb2865 authored by 张俊's avatar 张俊

市监局前端转发开发

parent ffd08ffa
...@@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Logger;
import static net.cdkj.gjj.adapter.domain.GzipUtil.unzipString; import static net.cdkj.gjj.adapter.domain.GzipUtil.unzipString;
import static net.cdkj.gjj.adapter.domain.GzipUtil.zipString; import static net.cdkj.gjj.adapter.domain.GzipUtil.zipString;
...@@ -25,8 +26,12 @@ import static net.cdkj.gjj.adapter.domain.GzipUtil.zipString; ...@@ -25,8 +26,12 @@ import static net.cdkj.gjj.adapter.domain.GzipUtil.zipString;
@RequestMapping(value = "FrontEndProcessor") @RequestMapping(value = "FrontEndProcessor")
public class ProvidentFundServicesController { public class ProvidentFundServicesController {
// log4j 日志实现
private static final Logger logger = Logger.getLogger(ProvidentFundServicesController.class.toString());
/** /**
* 公积金系统服务接口 * 拉取单位开户数据接口
*/ */
@ResponseBody @ResponseBody
@PostMapping("ProvidentFundServices") @PostMapping("ProvidentFundServices")
...@@ -38,10 +43,97 @@ public class ProvidentFundServicesController { ...@@ -38,10 +43,97 @@ public class ProvidentFundServicesController {
String token = huoqutoken(); String token = huoqutoken();
String provifunserviurl = PropertyUtil.getPropValue(prop, "provifunserviurl") + token; String provifunserviurl = PropertyUtil.getPropValue(prop, "provifunserviurl") + token;
System.out.println(provifunserviurl); System.out.println(provifunserviurl);
logger.info("单位开户拉取url:" + provifunserviurl);
// 发起 post 请求,并对出参进行解压缩
return HttpUtil.sendPost(provifunserviurl, data);
}
/**
* 推送单位开户数据接口
*/
@ResponseBody
@PostMapping("BusinessProcessing")
public static String BusinessProcessing(HttpServletRequest request) {
Properties prop = PropertyUtil.getConfig("application.properties");
// 获取请求入参
String str = HttpUtil.getReqData(request);
// 调用获取token的方法
String token = huoqutoken();
String bussiniprourl = PropertyUtil.getPropValue(prop, "bussiniprourl") + token;
logger.info("单位开户推送url:" + bussiniprourl);
// 发起 post 请求,并对出参进行解压缩
return HttpUtil.sendPost(bussiniprourl, str);
}
/**
* 拉取单位变更数据接口
*/
@ResponseBody
@PostMapping("/dwxxbgPull")
public static String dwxxbgPull(HttpServletRequest request) {
Properties prop = PropertyUtil.getConfig("application.properties");
// 获取请求入参
String data = HttpUtil.getReqData(request);
// 调用获取token的方法
String token = huoqutoken();
String provifunserviurl = PropertyUtil.getPropValue(prop, "dwxxbgPullUrl") + token;
logger.info("单位信息变跟拉取url:" + provifunserviurl);
// 发起 post 请求,并对出参进行解压缩
return HttpUtil.sendPost(provifunserviurl, data);
}
/**
* 推送单位变更数据接口
*/
@ResponseBody
@PostMapping("/dwxxbgPush")
public static String dwxxbgPush(HttpServletRequest request) {
Properties prop = PropertyUtil.getConfig("application.properties");
// 获取请求入参
String str = HttpUtil.getReqData(request);
// 调用获取token的方法
String token = huoqutoken();
String bussiniprourl = PropertyUtil.getPropValue(prop, "dwxxbgPushUrl") + token;
logger.info("单位信息变跟推送url:" + bussiniprourl);
// 发起 post 请求,并对出参进行解压缩
return HttpUtil.sendPost(bussiniprourl, str);
}
/**
* 拉取单位销户数据接口
*/
@ResponseBody
@PostMapping("/dwxhPull")
public static String dwxhPull(HttpServletRequest request) {
Properties prop = PropertyUtil.getConfig("application.properties");
// 获取请求入参
String data = HttpUtil.getReqData(request);
// 调用获取token的方法
String token = huoqutoken();
String provifunserviurl = PropertyUtil.getPropValue(prop, "dwxhPullUrl") + token;
logger.info("单位销户拉取url:" + provifunserviurl);
// 发起 post 请求,并对出参进行解压缩 // 发起 post 请求,并对出参进行解压缩
return HttpUtil.sendPost(provifunserviurl, data); return HttpUtil.sendPost(provifunserviurl, data);
} }
/**
* 推送单位销户数据接口
*/
@ResponseBody
@PostMapping("/dwxhPush")
public static String dwxhPush(HttpServletRequest request) {
Properties prop = PropertyUtil.getConfig("application.properties");
// 获取请求入参
String str = HttpUtil.getReqData(request);
// 调用获取token的方法
String token = huoqutoken();
String bussiniprourl = PropertyUtil.getPropValue(prop, "dwxhPushUrl") + token;
logger.info("单位销户推送url:" + bussiniprourl);
// 发起 post 请求,并对出参进行解压缩
return HttpUtil.sendPost(bussiniprourl, str);
}
/** /**
* 模拟公积金系统服务接口请求第三方,获取第三方返回的单位开户信息测试接口 * 模拟公积金系统服务接口请求第三方,获取第三方返回的单位开户信息测试接口
...@@ -83,23 +175,6 @@ public class ProvidentFundServicesController { ...@@ -83,23 +175,6 @@ public class ProvidentFundServicesController {
return token; return token;
} }
/**
* 住建部门返回公积金办理进度数据接口方法
*/
@ResponseBody
@PostMapping("BusinessProcessing")
public static String BusinessProcessing(HttpServletRequest request) {
Properties prop = PropertyUtil.getConfig("application.properties");
System.out.println("继续调前置机的进度第二个接口");
// 获取请求入参
String str = HttpUtil.getReqData(request);
// 调用获取token的方法
String token = huoqutoken();
String bussiniprourl = PropertyUtil.getPropValue(prop, "bussiniprourl") + token;
System.out.println(bussiniprourl);
// 发起 post 请求,并对出参进行解压缩
return HttpUtil.sendPost(bussiniprourl, str);
}
/** /**
* 模拟住建部门返回公积金办理进度数据接口请求第三方,获取第三方返回的数据 * 模拟住建部门返回公积金办理进度数据接口请求第三方,获取第三方返回的数据
......
# ???? # ????
spring.application.name=adapter spring.application.name=adapter
# ???? WEB ???? # ???? WEB ????
server.port=8080 server.port=8081
#server.servlet.context-path=/FrontEndProcessor #server.servlet.context-path=/FrontEndProcessor
#获取认证
#?????????????????
tokenurl:http://59.208.149.225:18080/sjzt/api/oauth2/token tokenurl:http://59.208.149.225:18080/sjzt/api/oauth2/token
#???????????????????? #单位开户拉取url
provifunserviurl:http://59.208.149.225:18080/sjzt/api/dx/e39a08e0a52b413897f9d23359540b27/GJJ?access_token= provifunserviurl:http://59.208.149.225:18080/sjzt/api/dx/e39a08e0a52b413897f9d23359540b27/GJJ?access_token=
#单位开户推送url
#?????????????????
bussiniprourl:http://59.208.149.225:18080/sjzt/api/retGjjProgData?access_token= bussiniprourl:http://59.208.149.225:18080/sjzt/api/retGjjProgData?access_token=
#单位信息变跟拉取url
dwxxbgPullUrl:http://59.208.149.225:18080/sjzt/api/dx/e39a08e0a52b413897f9d23359540b27/GJJ?access_token=
#单位信息变跟推送url
dwxxbgPushUrl:http://59.208.149.225:18080/sjzt/api/retGjjProgData?access_token=
#????????????????? #单位销户拉取url
#tokenurl:https://scjg.hubei.gov.cn/sjzt/api/oauth2/token dwxhPullUrl:http://59.208.149.225:18080/sjzt/api/dx/e39a08e0a52b413897f9d23359540b27/GJJ?access_token=
#单位销户推送url
#???????????????????? dwxhPushUrl:http://59.208.149.225:18080/sjzt/api/retGjjProgData?access_token=
#provifunserviurl:http://59.208.149.225:18080/sjzt/api/dx/e39a08e0a52b413897f9d23359540b27/GJJ?access_token=
#?????????????????
#bussiniprourl:http://59.208.149.225:18080/sjzt/api/testretGjjProgData?access_token=
#?????????????????
#tokenurl:http://127.0.0.1:8080/FrontEndProcessor/FrontEndProcessor/token2
#????????????????????
#provifunserviurl:http://127.0.0.1:8080/FrontEndProcessor/FrontEndProcessor/ProvidentFundServices2?access_token=
#?????????????????
#bussiniprourl:http://127.0.0.1:8080/FrontEndProcessor/FrontEndProcessor/BusinessProcessing2?access_token=
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