Merge branches 'dev' and 'dongj' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dongj

 Conflicts:
	service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java
This commit is contained in:
yuqh 2024-07-31 14:49:38 +08:00
commit 2f32b3c0d8
7 changed files with 140 additions and 26 deletions

View File

@ -15,13 +15,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

@ -13,6 +13,8 @@ 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;
import org.springframework.stereotype.Service;
@ -84,6 +86,69 @@ 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;
}
}
/**
* 分页方式 全量查询境内账户交易明细
* accTransactionReq.custId 客户号 必填

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

@ -232,9 +232,8 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
jsonObjectUser.put("mdmCode", mdmCode);
jsonStr.put("jsonStr", jsonObjectUser);
//先查询编码和名称查询是否存在
JsonResultEntity jsonResultEntity = comparisonServiceimpl.queryEntityPage(jsonStr);
Object attribute = jsonResultEntity.getAttribute();
logger.info("得到的attribute值为{}", attribute);
Object attribute = comparisonServiceimpl.queryEntityPage(jsonStr);
logger.info("得到的attribute值为{}", jsonStr.toJSONString(attribute));
JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute);
JSONArray jsonArrayList = jsonObjectAttribute.getJSONArray("list");
//如果jsonArrayList为null说明没有值在表中不存在
@ -250,20 +249,22 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
hashMap.put("mdmCode", mdmCode);
hashMap.put("optionName", "数智中台");
jsonStr.put("jsonStr", hashMap);
JsonResultEntity result = comparisonServiceimpl.saveEntity(jsonStr);
if(!result.isFlag()){
throw new BaseSystemException("主数据保存失败"+ result.getMsg());
}
Object result = comparisonServiceimpl.saveEntity(jsonStr);
logger.info("新增结果为:{}", JSON.toJSONString(result));
// if(!result.isFlag()){
// throw new BaseSystemException("主数据保存失败"+ result.getMsg());
// }
} else {
hashMap.put("appName","数智中台");
hashMap.put("appCode","800004");
hashMap.put("mdmCode", mdmCode);
hashMap.put("optionName", "数智中台");
jsonStr.put("jsonStr", hashMap);
JsonResultEntity result = comparisonServiceimpl.updateEntity(jsonStr);
if(!result.isFlag()){
//throw new BaseSystemException("主数据更新失败"+ result.getMsg());
}
Object result = comparisonServiceimpl.updateEntity(jsonStr);
logger.info("更新结果为:{}", JSON.toJSONString(result));
// if(!result.isFlag()){
// //throw new BaseSystemException("主数据更新失败"+ result.getMsg());
// }
}
}
return null;

View File

@ -2,6 +2,7 @@ package com.hzya.frame.sysnew.comparison.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
@ -17,7 +18,7 @@ public interface IComparisonService extends IBaseService<ComparisonEntity, Strin
* @Author hecan
* @Date 2024/5/7 15:55
* **/
JsonResultEntity queryEntityPage(JSONObject jsonObject);
Object queryEntityPage(JSONObject jsonObject);
/**
*
@ -27,7 +28,7 @@ public interface IComparisonService extends IBaseService<ComparisonEntity, Strin
* @Author hecan
* @Date 2024/5/7 16:52
* **/
JsonResultEntity saveEntity(JSONObject jsonObject);
Object saveEntity(JSONObject jsonObject);
/**
*
@ -37,7 +38,7 @@ public interface IComparisonService extends IBaseService<ComparisonEntity, Strin
* @Author hecan
* @Date 2024/5/9 10:19
* **/
JsonResultEntity updateEntity(JSONObject jsonObject);
Object updateEntity(JSONObject jsonObject);
/**
*
@ -47,7 +48,7 @@ public interface IComparisonService extends IBaseService<ComparisonEntity, Strin
* @Author hecan
* @Date 2024/5/9 13:59
* **/
JsonResultEntity deleteEntity(JSONObject jsonObject);
Object deleteEntity(JSONObject jsonObject);
/**
*

View File

@ -57,8 +57,9 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
//分页查询通用数据数据
@Override
public JsonResultEntity queryEntityPage(JSONObject json) {
public Object queryEntityPage(JSONObject json) {
JSONObject jsonObject = json.getJSONObject("jsonStr");
JSONObject json1 = new JSONObject();
if (jsonObject == null) {
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
}
@ -122,7 +123,10 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
}
}
PageInfo pageInfo = new PageInfo(list);
return BaseResult.getSuccessMessageEntity("查询成功", pageInfo);
json1.put("status","200");
json1.put("pageInfo",pageInfo);
return json1;
} catch (Exception e) {
logger.info("查询通用数据错误:{}", e.getMessage());
return BaseResult.getFailureMessageEntity("查询失败");
@ -133,7 +137,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
//新增通用数据数据
@Override
public JsonResultEntity saveEntity(JSONObject json) {
public Object saveEntity(JSONObject json) {
JSONObject jsonObject = json.getJSONObject("jsonStr");
if (jsonObject == null) {
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
@ -330,7 +334,10 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
list.add(jsonObjectList);
//保存操作日志
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","1");
return BaseResult.getSuccessMessageEntity("保存成功", list);
JSONObject json1 = new JSONObject();
json1.put("status","200");
json1.put("list",list);
return json1;
} catch (Exception e) {
logger.info("保存通用数据时候错误:{}", e.getMessage());
//保存操作日志
@ -345,7 +352,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
//更新通用数据数据
@Override
public JsonResultEntity updateEntity(JSONObject json) {
public Object updateEntity(JSONObject json) {
JSONObject jsonObject = json.getJSONObject("jsonStr");
if (jsonObject == null) {
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
@ -465,7 +472,10 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
jsonObjects.add(jsonObjectList);
//保存操作日志
controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log","1");
return BaseResult.getSuccessMessageEntity("更新成功", jsonObjects);
JSONObject json1 = new JSONObject();
json1.put("status","200");
json1.put("list",jsonObjects);
return json1;
}else{
return BaseResult.getFailureMessageEntity("更新失败");
}
@ -487,7 +497,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
//删除通用数据
@Override
public JsonResultEntity deleteEntity(JSONObject json) {
public Object deleteEntity(JSONObject json) {
JSONObject jsonObject = json.getJSONObject("jsonStr");
if (jsonObject == null) {
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
@ -575,7 +585,10 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
// controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log");
}
controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log","1");
return BaseResult.getSuccessMessageEntity("删除成功",integer);
JSONObject json1 = new JSONObject();
json1.put("status","200");
json1.put("integer",integer);
return json1;
}else{
return BaseResult.getFailureMessageEntity("删除失败","请查看data_id是否在表中存在");
}

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>