宁波银行文件下载接口修改,日志查询分表

This commit is contained in:
lvleigang 2024-07-30 10:27:16 +08:00
parent e1277beb60
commit 7aed1aca10
4 changed files with 100 additions and 3 deletions

View File

@ -10,13 +10,21 @@ public interface INingboBankTreasuryService {
/**
* @Author lvleigang
* @Description 单笔查证接口
* @Description 发送宁波银行
* @Date 4:45 下午 2024/7/9
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
Object sendNbBank(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 发送宁波银行下载文件
* @Date 4:45 下午 2024/7/9
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
Object sendNbBankFileDownload(JSONObject jsonObject);
/**
*
* @content 此方法获取初始化参数拼接请求参数

View File

@ -11,6 +11,7 @@ import com.hzya.frame.web.entity.JsonResultEntity;
import com.nbcb.sdk.OpenSDK;
import com.nbcb.sdk.aes.exception.SDKException;
import com.nbcb.sdk.aes.param.ConfigParam;
import com.nbcb.sdk.file.FileDownloadResponse;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -81,6 +82,68 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService
}
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 发送宁波银行下载文件
* @Date 4:45 下午 2024/7/9
**/
@Override
public Object sendNbBankFileDownload(JSONObject jsonObject) {
JSONObject returnJson = new JSONObject();
JSONObject entity = getstrObj("jsonStr", jsonObject);
String dataJson = entity.getString("Data");
JSONObject data = JSONObject.parseObject(dataJson);
JSONObject dataFileid = data.getJSONObject("Data");
String appKey = entity.getString("appKey");
String privateKey = entity.getString("privateKey");
String publicUrl = entity.getString("publicUrl");
String publicKey = entity.getString("publicKey");
String productID = entity.getString("productID");
String serviceID = entity.getString("serviceID");
//初始化宁波银行OpenSDK
try {
ConfigParam configParam = new ConfigParam(privateKey,publicUrl,appKey,publicKey,10000,20000);
OpenSDK.dynamicInit(configParam,true);
} catch (SDKException e) {
logger.error("初始化宁波银行OpenSDK错误:{}",e.getMessage());
returnJson.put("retCode","9999");
returnJson.put("retMsg","初始化宁波银行OpenSDK错误");
return returnJson;
}
//发送数据
try {
FileDownloadResponse returnData = OpenSDK.sendFileDownload(productID,"open-filegateway",dataFileid.getString("fileId"),null);
if(returnData == null || "".equals(returnData)){
returnJson.put("retCode","9999");
returnJson.put("retMsg","发送宁波银行OpenSDK返回错误");
return returnJson;
}
try {
//returnJson = JSONObject.parseObject(returnData);
//JSONObject retData = returnJson.getJSONObject("Data");
String retCode = returnData.getRetCode();
String retMsg = returnData.getRetMsg();
returnJson.put("data",returnData.getData());
returnJson.put("retCode",retCode);
returnJson.put("retMsg",retMsg);
return returnJson;
} catch (Exception e) {
returnJson.put("retCode","9999");
returnJson.put("retMsg","发送宁波银行OpenSDK返回转换Json错误");
return returnJson;
}
} catch (Exception e) {
returnJson.put("retCode","9999");
returnJson.put("retMsg","发送宁波银行OpenSDK错误");
return returnJson;
}
}
/**
* @param entity
* @content 此方法获取初始化参数拼接请求参数

View File

@ -2099,7 +2099,25 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
send.put("header", headers);
send.put("querys", querys);
sysMessageManageLogEntity.setTargetData(send.toString());//目标data
sysMessageManageLogEntity.setReturnData(body);//返回信息
if(receiveApp.getAppType() != null && "4".equals(receiveApp.getAppType())){//宁波银行
JSONObject jsonObject1 = JSONObject.parseObject(body);
String retCode = jsonObject1.getString("retCode");
if(retCode != null && "0000".equals(retCode)){
JSONObject jsonObject2 = JSONObject.parseObject(jsonObject1.getString("data"));
String fileBytes = jsonObject2.getString("fileBytes");
if(fileBytes != null && !"".equals(fileBytes)){
jsonObject2.put("fileBytes","");
jsonObject1.put("data",jsonObject2);
sysMessageManageLogEntity.setReturnData(jsonObject1.toJSONString());//返回信息
}else {
sysMessageManageLogEntity.setReturnData(body);//返回信息
}
}else {
sysMessageManageLogEntity.setReturnData(body);//返回信息
}
}else {
sysMessageManageLogEntity.setReturnData(body);//返回信息
}
//校验返回

View File

@ -59,7 +59,15 @@
parameterType="com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity">
select
<include refid="SysMessageManageLogEntity_Base_Column_List"/>
from sys_message_manage_log
from
<choose>
<when test=" status != null and status.trim() != '' and status == 3">
sys_message_manage_log_success
</when>
<otherwise>
sys_message_manage_log
</otherwise>
</choose>
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="messageManageId != null and messageManageId != ''">and message_manage_id = #{messageManageId}</if>