Commit e34160ab authored by 5359's avatar 5359

中登网开发

parent d9c0f852
...@@ -128,8 +128,44 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService { ...@@ -128,8 +128,44 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService {
return hlsWsRequests; return hlsWsRequests;
} }
public JSONObject registerInit(String registerTypeBz, String platformAuthCode, String loginToken, String xmlFileName, String xmlFileContent) {
JSONObject resultJson = new JSONObject();
String encryXmlFileContent = "";
String encryLoginToken = "";
String attachmentZipPath = "";
String encryPlatformAuthCode = "";
try {
/*SM2算法加密*/
encryLoginToken = SM2Utils.encryptByKeyStr(loginToken, clientKey);
encryXmlFileContent = SM2Utils.encryptByKeyStr(xmlFileContent, clientKey);
encryPlatformAuthCode = SM2Utils.encryptByKeyStr(platformAuthCode, clientKey);
WSInitRegisterServiceService service = new WSInitRegisterServiceService();
WSInitRegisterService reg = service.getWSInitRegisterServicePort();
/*插入接口日志表*/
byte[] returns = reg.initRegister(registerTypeBz.getBytes(), encryPlatformAuthCode.getBytes(), encryLoginToken.getBytes(), xmlFileName.getBytes(), encryXmlFileContent.getBytes(), ClientUtils.getAttachmentZip(attachmentZipPath));
// byte[] returns = "<feedback>\n<registertype>LR</registertype>\n<registerresult>001</registerresult>\n<registernumber>I0000001</registernumber>\n<authorizationcode>A0000001</authorizationcode>\n<errors>\n<error>RegInfoError:100_001</error>\n</errors>\n</feedback>\n".getBytes();
resultJson.put("code", "0");
resultJson.put("info", new String(returns));
System.out.println("dddd" + new String(returns));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
resultJson.put("code", "-1");
resultJson.put("info", e.getMessage());
}
return resultJson;
}
/*** /***
* 初始登记; * 融资租赁-登记入口方法;
* @param request * @param request
* @param batchId * @param batchId
***/ ***/
...@@ -194,21 +230,30 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService { ...@@ -194,21 +230,30 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService {
xmlFileContent = new String(ClientUtils.getxmlFileContent(fndAtmAttachmentDto.getFilePath())); xmlFileContent = new String(ClientUtils.getxmlFileContent(fndAtmAttachmentDto.getFilePath()));
/*SM2算法加密*/ /*SM2算法加密*/
loginToken = SM2Utils.encryptByKeyStr(loginToken, clientKey); // loginToken = SM2Utils.encryptByKeyStr(loginToken, clientKey);
encryXmlFileContent = SM2Utils.encryptByKeyStr(xmlFileContent, clientKey); // encryXmlFileContent = SM2Utils.encryptByKeyStr(xmlFileContent, clientKey);
platformAuthCode = SM2Utils.encryptByKeyStr(platformAuthCode, clientKey); // platformAuthCode = SM2Utils.encryptByKeyStr(platformAuthCode, clientKey);
// WSInitRegisterServiceService service = new WSInitRegisterServiceService(); // WSInitRegisterServiceService service = new WSInitRegisterServiceService();
// WSInitRegisterService reg = service.getWSInitRegisterServicePort(); // WSInitRegisterService reg = service.getWSInitRegisterServicePort();
/*插入接口日志表*/ /*插入接口日志表*/
HlsWsRequests hlsWsRequests = createRequestLog("https://ws.zhongdengwang.org.cn/mfrs_ws_test/services/InitRegisterService?wsdl", xmlFileContent, batch.getLineId()); HlsWsRequests hlsWsRequests = createRequestLog("https://ws.zhongdengwang.org.cn/mfrs_ws_test/services/InitRegisterService?wsdl", xmlFileContent, batch.getLineId());
// byte[] returns = reg.initRegister(fndZhongDengLines.getTypebz().getBytes(), platformAuthCode.getBytes(), loginToken.getBytes(), "lr".getBytes(), encryXmlFileContent.getBytes(), ClientUtils.getAttachmentZip(attachmentZipPath)); // byte[] returns = reg.initRegister(fndZhongDengLines.getTypebz().getBytes(), platformAuthCode.getBytes(), loginToken.getBytes(), fndAtmAttachmentDto.getFileName().getBytes(), encryXmlFileContent.getBytes(), ClientUtils.getAttachmentZip(attachmentZipPath));
byte[] returns = "<feedback>\n<registertype>LR</registertype>\n<registerresult>001</registerresult>\n<registernumber>I0000001</registernumber>\n<authorizationcode>A0000001</authorizationcode>\n<errors>\n<error>RegInfoError:100_001</error>\n</errors>\n</feedback>\n".getBytes(); // if ("INIT".equalsIgnoreCase(fndZhongDengLines.getUpStage())) {
hlsWsRequests.setResponseClob(new String(returns)); //resultJson = registerInit(fndZhongDengLines.getTypebz(), platformAuthCode, loginToken, fndAtmAttachmentDto.getFileName(), xmlFileContent);
// }
String returns = "";
// if ("0".equalsIgnoreCase(resultJson.getString("code"))) {
// returns = resultJson.getString("info");
// } else {
// returns = "<feedback>\n<registertype>LR</registertype>\n<registerresult>001</registerresult>\n<registernumber>I0000001</registernumber>\n<authorizationcode>A0000001</authorizationcode>\n<errors>\n<error>\n" + resultJson.getString("info") + "</error>\n</errors>\n</feedback>\n";
// }
returns = "<feedback>\n<registertype>LR</registertype>\n<registerresult>001</registerresult>\n<registernumber>I0000001</registernumber>\n<authorizationcode>A0000001</authorizationcode>\n<errors>\n<error>RegInfoError:100_001</error>\n</errors>\n</feedback>\n";
hlsWsRequests.setResponseClob(returns);
/*解析接口返回结果*/ /*解析接口返回结果*/
returnJson = XML.toJSONObject(new String(returns)); returnJson = XML.toJSONObject(returns);
registerResult = returnJson.getJSONObject("feedback").getString("registerresult"); registerResult = returnJson.getJSONObject("feedback").getString("registerresult");
registerNumber = returnJson.getJSONObject("feedback").getString("registernumber"); registerNumber = returnJson.getJSONObject("feedback").getString("registernumber");
authorizationCode = returnJson.getJSONObject("feedback").getString("authorizationcode"); authorizationCode = returnJson.getJSONObject("feedback").getString("authorizationcode");
...@@ -243,7 +288,6 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService { ...@@ -243,7 +288,6 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService {
fndZhongDengLinesList.add(fndZhongDengLines); fndZhongDengLinesList.add(fndZhongDengLines);
} }
} }
if (fndZhongDengLinesList.size() > 0) { if (fndZhongDengLinesList.size() > 0) {
......
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