Commit 38a62aea authored by 5359's avatar 5359

中登网开发

parent 4af0a560
package com.hand.app.zhongDengWang.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hand.app.zhongDengWang.service.IZdwWsRequestsService;
import com.hand.app.zhongDengWang.dto.ZdwLoginTokenInterface;
......@@ -14,18 +13,18 @@ import com.hand.app.zhongDengWang.mapper.ZdwLoginTokenInterfaceMapper;
import com.hand.app.zhongDengWang.mapper.FndZhongDengLinesMapper;
import com.hand.app.zhongDengWang.mapper.FndZhongDengBatchMapper;
import com.hand.app.zhongDengWang.utils.ClientUtils;
import com.hand.app.zhongDengWang.ws.init.WSInitRegisterService;
import com.hand.app.zhongDengWang.ws.init.WSInitRegisterServiceService;
import com.hand.app.zhongDengWang.ws.terminate.WSTerminateRegisterService;
import com.hand.app.zhongDengWang.ws.terminate.WSTerminateRegisterServiceService;
import com.hand.app.zhongDengWang.ws.amend.WSAmendRegisterService;
import com.hand.app.zhongDengWang.ws.amend.WSAmendRegisterServiceService;
import com.hand.app.zhongDengWang.ws.extend.WSExtendRegisterService;
import com.hand.app.zhongDengWang.ws.extend.WSExtendRegisterServiceService;
import com.hand.app.zhongDengWang.ws.init.WSInitRegisterService;
import com.hand.app.zhongDengWang.ws.init.WSInitRegisterServiceService;
import com.hand.app.zhongDengWang.ws.login.WSLoginService;
import com.hand.app.zhongDengWang.ws.login.WSLoginServiceService;
import com.hand.app.zhongDengWang.dto.FndAtmAttachmentDto;
import com.hand.app.zhongDengWang.mapper.FndAtmAttachmentMapper;
import com.hand.app.zhongDengWang.ws.terminate.WSTerminateRegisterService;
import com.hand.app.zhongDengWang.ws.terminate.WSTerminateRegisterServiceService;
import com.hand.hap.core.IRequest;
import com.hand.hap.lock.components.DatabaseLockProvider;
import com.hand.hap.system.dto.DTOStatus;
......@@ -332,6 +331,7 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService {
/*根据传入ids循环上报中登网*/
synchronized (lock) {
for (FndZhongDengBatch batch : fndZhongDengBatches) {
/*根据批次id获取该批次下所有上报行id*/
FndZhongDengLines fndZhongDengLines = new FndZhongDengLines();
fndZhongDengLines.setLineId(batch.getLineId());
fndZhongDengLines = fndZhongDengLinesMapper.selectByPrimaryKey(fndZhongDengLines);
......@@ -342,6 +342,7 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService {
String xmlFileContent = "";
String attachmentZipPath = "";
/*获取xml报文文件所在路径*/
FndAtmAttachmentDto fndAtmAttachmentDto = new FndAtmAttachmentDto();
fndAtmAttachmentDto.setAttachmentId(fndZhongDengLines.getAttachmentXmlId());
fndAtmAttachmentDto = fndAtmAttachmentMapper.selectByPrimaryKey(fndAtmAttachmentDto);
......@@ -349,7 +350,7 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService {
/*解析xml文件内容*/
xmlFileContent = new String(Objects.requireNonNull(ClientUtils.getxmlFileContent(fndAtmAttachmentDto.getFilePath())));
/*插入接口日志表*/
/*初始登记*/
if ("INIT".equalsIgnoreCase(fndZhongDengLines.getUpStage())) {
resultJson = registerInit(fndZhongDengLines.getTypebz(), platformAuthCode, loginToken, fndAtmAttachmentDto.getFileName(), xmlFileContent, fndZhongDengLines.getLineId());
}
......@@ -395,8 +396,6 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService {
fndZhongDengLines.setReturnMsg(error);
}
fndZhongDengLines.setUpDate(new Date());
fndZhongDengLines.set__status(DTOStatus.UPDATE);
} catch (RuntimeException e) {
e.printStackTrace();
} catch (Exception e) {
......@@ -405,6 +404,8 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService {
fndZhongDengLines.setUpStatus("FAIL");
fndZhongDengLines.setReturnMsg(e.getMessage());
}
fndZhongDengLines.setUpDate(new Date());
fndZhongDengLines.set__status(DTOStatus.UPDATE);
fndZhongDengLinesList.add(fndZhongDengLines);
}
}
......@@ -462,7 +463,7 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService {
cachedThreadPool.execute(new Runnable() {
@Override
public void run() {
// d
// do
try {
registerThread(request, fndZhongDengBatchList, loginToken);
} catch (Exception e) {
......
......@@ -46,10 +46,10 @@ public class ClientInitReg {
//登记内容xml
String xmlFileContent="";
try {
loginToken = SM2Utils.encryptByKeyStr(loginToken, clientKey);
// loginToken = SM2Utils.encryptByKeyStr(loginToken, clientKey);
xmlFileContent = new String(getxmlFileContent());
xmlFileContent = SM2Utils.encryptByKeyStr(xmlFileContent,clientKey);
platformAuthCode=SM2Utils.encryptByKeyStr(platformAuthCode,clientKey);
// xmlFileContent = SM2Utils.encryptByKeyStr(xmlFileContent,clientKey);
// platformAuthCode=SM2Utils.encryptByKeyStr(platformAuthCode,clientKey);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
......@@ -65,11 +65,11 @@ public class ClientInitReg {
}
WSInitRegisterServiceService service=new WSInitRegisterServiceService();
WSInitRegisterService reg=service.getWSInitRegisterServicePort();
byte[] returns = reg.initRegister("AT".getBytes(),platformAuthCode.getBytes(), loginToken.getBytes(), "lr".getBytes(), xmlFileContent.getBytes(), getAttachmentZip());
System.out.println("dddd"+new String(returns));
// WSInitRegisterServiceService service=new WSInitRegisterServiceService();
// WSInitRegisterService reg=service.getWSInitRegisterServicePort();
//
// byte[] returns = reg.initRegister("AT".getBytes(),platformAuthCode.getBytes(), loginToken.getBytes(), "lr".getBytes(), xmlFileContent.getBytes(), getAttachmentZip());
// System.out.println("dddd"+new String(returns));
}
......
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