Merge branch 'yuecheng-project' of http://hzya.ufyct.com:9015/root/kangarooDataCenterV3 into yuecheng-project
This commit is contained in:
commit
f99ea46e16
|
@ -105,7 +105,7 @@ public class PayApplyPluginInitializer extends PluginBaseEntity {
|
||||||
if (null == paymentEntity)
|
if (null == paymentEntity)
|
||||||
paymentEntity = new PaymentEntity();
|
paymentEntity = new PaymentEntity();
|
||||||
//支付申请
|
//支付申请
|
||||||
paymentEntity.setOaId("8475071606892874568");
|
//paymentEntity.setOaId("8475071606892874568");
|
||||||
cbsPluginService.applyPay(paymentEntity);
|
cbsPluginService.applyPay(paymentEntity);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import com.hzya.frame.seeyon.entity.CtpAttachmentEntity;
|
||||||
import com.hzya.frame.seeyon.entity.CtpFileEntity;
|
import com.hzya.frame.seeyon.entity.CtpFileEntity;
|
||||||
import com.hzya.frame.seeyon.service.ICtpAttachmentService;
|
import com.hzya.frame.seeyon.service.ICtpAttachmentService;
|
||||||
import com.hzya.frame.seeyon.util.RestUtil;
|
import com.hzya.frame.seeyon.util.RestUtil;
|
||||||
|
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||||
import com.hzya.frame.uuid.UUIDLong;
|
import com.hzya.frame.uuid.UUIDLong;
|
||||||
import com.hzya.frame.web.exception.BaseSystemException;
|
import com.hzya.frame.web.exception.BaseSystemException;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
@ -35,10 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,21 +81,6 @@ public class CbsPluginServiceImpl implements ICbsPluginService {
|
||||||
}
|
}
|
||||||
paymentEntity.setDataSourceCode(oa_data_source_code);
|
paymentEntity.setDataSourceCode(oa_data_source_code);
|
||||||
List<PaymentEntity> paymentList = paymentService.queryUnpaid(paymentEntity);
|
List<PaymentEntity> paymentList = paymentService.queryUnpaid(paymentEntity);
|
||||||
/* List<PaymentEntity> paymentList = new ArrayList<>();
|
|
||||||
paymentEntity.setReferenceNum("CL202406140001");
|
|
||||||
paymentEntity.setPayAccount("655905707410000");
|
|
||||||
paymentEntity.setPayBankName("");
|
|
||||||
paymentEntity.setAmount("99");
|
|
||||||
paymentEntity.setRevAccount("123456778");
|
|
||||||
paymentEntity.setRevBankName("中国工商银行总行清算中心");
|
|
||||||
paymentEntity.setRevBankType("ICB");
|
|
||||||
paymentEntity.setRevAccountName("测试账户");
|
|
||||||
paymentEntity.setCnapsCode("102100099996");
|
|
||||||
paymentEntity.setPurpose("测试用途");
|
|
||||||
paymentEntity.setBusType("202");
|
|
||||||
paymentEntity.setCurrency("10");
|
|
||||||
paymentEntity.setPurpose("测试用途");
|
|
||||||
paymentList.add(paymentEntity);*/
|
|
||||||
if (CollectionUtils.isNotEmpty(paymentList)){
|
if (CollectionUtils.isNotEmpty(paymentList)){
|
||||||
for (PaymentEntity pay : paymentList) {
|
for (PaymentEntity pay : paymentList) {
|
||||||
//调用支付申请接口
|
//调用支付申请接口
|
||||||
|
@ -112,7 +95,7 @@ public class CbsPluginServiceImpl implements ICbsPluginService {
|
||||||
pay.setDataSourceCode(oa_data_source_code);
|
pay.setDataSourceCode(oa_data_source_code);
|
||||||
pay.setApplyCode(payResponseDTO.getBusNum());
|
pay.setApplyCode(payResponseDTO.getBusNum());
|
||||||
paymentService.updatePayState(pay);
|
paymentService.updatePayState(pay);
|
||||||
//5、记录操作日志
|
//5、记录操作日志到OA底表
|
||||||
savePayLog(pay,payResponseDTO);
|
savePayLog(pay,payResponseDTO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
package com.hzya.frame.cbs8.dto.res;
|
package com.hzya.frame.cbs8.dto.res;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description 经办支付接口返回参数中的data节点
|
* @Description 经办支付接口返回参数中的data节点
|
||||||
* @Author xiangerlin
|
* @Author xiangerlin
|
||||||
|
@ -70,4 +77,22 @@ public class PayResponseDTO {
|
||||||
public void setSuccessed(Boolean successed) {
|
public void setSuccessed(Boolean successed) {
|
||||||
this.successed = successed;
|
this.successed = successed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从银行响应报文解析
|
||||||
|
* @param result
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static PayResponseDTO payResValueOf(String result){
|
||||||
|
if (StrUtil.isNotEmpty(result)){
|
||||||
|
CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class);
|
||||||
|
List<JSONObject> dataList = cbsResponseDTO.getData();
|
||||||
|
if (CollectionUtils.isNotEmpty(dataList)){
|
||||||
|
JSONObject o = dataList.get(0);
|
||||||
|
PayResponseDTO payResponseDTO = JSON.toJavaObject(o, PayResponseDTO.class);
|
||||||
|
return payResponseDTO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new PayResponseDTO();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.hzya.frame.cbs8.service;
|
package com.hzya.frame.cbs8.service;
|
||||||
|
|
||||||
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
||||||
|
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description
|
* @Description
|
||||||
|
@ -16,6 +17,11 @@ public interface ICbs8ExtService {
|
||||||
*/
|
*/
|
||||||
SysExtensionApiEntity payApply(SysExtensionApiEntity entity);
|
SysExtensionApiEntity payApply(SysExtensionApiEntity entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付申请回调
|
||||||
|
* @param logEntity
|
||||||
|
*/
|
||||||
|
void payApplyCallBack(SysMessageManageLogEntity logEntity);
|
||||||
/**
|
/**
|
||||||
* 代发代扣 支付申请
|
* 代发代扣 支付申请
|
||||||
* @param entity
|
* @param entity
|
||||||
|
|
|
@ -4,17 +4,22 @@ import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hzya.frame.cbs8.dto.req.*;
|
import com.hzya.frame.cbs8.dto.req.*;
|
||||||
|
import com.hzya.frame.cbs8.dto.res.PayResponseDTO;
|
||||||
import com.hzya.frame.cbs8.service.ICbs8ExtService;
|
import com.hzya.frame.cbs8.service.ICbs8ExtService;
|
||||||
import com.hzya.frame.cbs8.util.CBSUtil;
|
import com.hzya.frame.cbs8.util.CBSUtil;
|
||||||
import com.hzya.frame.cbs8.util.CbsAccessToken;
|
import com.hzya.frame.cbs8.util.CbsAccessToken;
|
||||||
import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity;
|
import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity;
|
||||||
import com.hzya.frame.stringutil.StringUtil;
|
import com.hzya.frame.stringutil.StringUtil;
|
||||||
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
||||||
|
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||||
|
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
|
||||||
|
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity;
|
||||||
import com.hzya.frame.web.exception.BaseSystemException;
|
import com.hzya.frame.web.exception.BaseSystemException;
|
||||||
import org.apache.http.protocol.HTTP;
|
import org.apache.http.protocol.HTTP;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,6 +32,8 @@ import java.util.*;
|
||||||
public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
|
|
||||||
Logger logger = LoggerFactory.getLogger(getClass());
|
Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付经办
|
* 支付经办
|
||||||
*
|
*
|
||||||
|
@ -36,11 +43,11 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
@Override
|
@Override
|
||||||
public SysExtensionApiEntity payApply(SysExtensionApiEntity entity) {
|
public SysExtensionApiEntity payApply(SysExtensionApiEntity entity) {
|
||||||
String bodys = entity.getBodys();
|
String bodys = entity.getBodys();
|
||||||
if (StrUtil.isNotEmpty(bodys)){
|
if (StrUtil.isNotEmpty(bodys)) {
|
||||||
PaymentEntity paymentEntity = JSONObject.parseObject(bodys,PaymentEntity.class);
|
PaymentEntity paymentEntity = JSONObject.parseObject(bodys, PaymentEntity.class);
|
||||||
if (null != paymentEntity){
|
if (null != paymentEntity) {
|
||||||
PayRequestDTO payRequestDTO = new PayRequestDTO();
|
PayRequestDTO payRequestDTO = new PayRequestDTO();
|
||||||
String ferenceNum = Convert.toStr(paymentEntity.getReferenceNumNew(),paymentEntity.getReferenceNum());
|
String ferenceNum = Convert.toStr(paymentEntity.getReferenceNumNew(), paymentEntity.getReferenceNum());
|
||||||
payRequestDTO.setReferenceNum(ferenceNum);
|
payRequestDTO.setReferenceNum(ferenceNum);
|
||||||
payRequestDTO.setBusType(paymentEntity.getBusType());
|
payRequestDTO.setBusType(paymentEntity.getBusType());
|
||||||
payRequestDTO.setAmount(paymentEntity.getAmount());
|
payRequestDTO.setAmount(paymentEntity.getAmount());
|
||||||
|
@ -54,7 +61,7 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
payRequestDTO.setPurpose(paymentEntity.getPurpose());
|
payRequestDTO.setPurpose(paymentEntity.getPurpose());
|
||||||
payRequestDTO.setErpExtend1(paymentEntity.getPayType());
|
payRequestDTO.setErpExtend1(paymentEntity.getPayType());
|
||||||
//集中支付模式
|
//集中支付模式
|
||||||
if (CBSUtil.CENTRALIZED_PAYMENT_TYPE.equals(payRequestDTO.getBusType())){
|
if (CBSUtil.CENTRALIZED_PAYMENT_TYPE.equals(payRequestDTO.getBusType())) {
|
||||||
payRequestDTO.setBusiStep("1");
|
payRequestDTO.setBusiStep("1");
|
||||||
payRequestDTO.setApplyUnitCode(paymentEntity.getPayCompanyCode());
|
payRequestDTO.setApplyUnitCode(paymentEntity.getPayCompanyCode());
|
||||||
payRequestDTO.setPayAccount(null);
|
payRequestDTO.setPayAccount(null);
|
||||||
|
@ -62,12 +69,55 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
List<PayRequestDTO> list = Arrays.asList(payRequestDTO);
|
List<PayRequestDTO> list = Arrays.asList(payRequestDTO);
|
||||||
String requestData = JSONObject.toJSONString(list);
|
String requestData = JSONObject.toJSONString(list);
|
||||||
//加密 签名
|
//加密 签名
|
||||||
encrypAndsign(entity,requestData);
|
encrypAndsign(entity, requestData);
|
||||||
|
entity.setBodys(requestData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付申请回调
|
||||||
|
*
|
||||||
|
* @param logEntity
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void payApplyCallBack(SysMessageManageLogEntity logEntity) {
|
||||||
|
try {
|
||||||
|
logger.info("回调方法里的参数:{}", JSONObject.toJSONString(logEntity));
|
||||||
|
JSONObject targetData = JSONObject.parseObject(logEntity.getTargetData());//目标数据
|
||||||
|
JSONObject sourceData = JSONObject.parseObject(logEntity.getSourceData());//源数据
|
||||||
|
JSONObject sourceHeaders = sourceData.getJSONObject("header");//源header
|
||||||
|
JSONObject targetHeaders = targetData.getJSONObject("header");//目标header
|
||||||
|
JSONObject sourceBody = sourceData.getJSONObject("body");//源数据body
|
||||||
|
//自定义参数,存放的是请求报文明文
|
||||||
|
String hzyaExtData = targetHeaders.getString("hzyaExtData");
|
||||||
|
String returnDataBase64 = logEntity.getReturnData();
|
||||||
|
byte[] secretResByte = Base64.getDecoder().decode(returnDataBase64);
|
||||||
|
//解密报文
|
||||||
|
String decryptRes = CBSUtil.decrypt(secretResByte);
|
||||||
|
//6、记录系统日志
|
||||||
|
IntegrationTaskLivingDetailsEntity logTask = new IntegrationTaskLivingDetailsEntity();
|
||||||
|
logTask.setRootAppPk(sourceBody.getString("formsonId"));
|
||||||
|
logTask.setRootAppBill(sourceBody.getString("referenceNum"));
|
||||||
|
logTask.setPluginId("CBS8PayApplyPlugin");
|
||||||
|
//对方接口返回信息
|
||||||
|
logTask.setNewTransmitInfo(decryptRes);
|
||||||
|
logTask.setNewPushDate(new Date());
|
||||||
|
//调用接口请求参数
|
||||||
|
logTask.setRootAppNewData(hzyaExtData);
|
||||||
|
PayResponseDTO payResponseDTO = PayResponseDTO.payResValueOf(decryptRes);
|
||||||
|
//为true是成功
|
||||||
|
if (payResponseDTO.getSuccessed()) {
|
||||||
|
taskLivingDetailsService.saveLogToSuccess(logTask);
|
||||||
|
}else {
|
||||||
|
taskLivingDetailsService.saveLogToFail(logTask);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.info("payApplyCallBack方法执行出错:{}",e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代发代扣 支付申请
|
* 代发代扣 支付申请
|
||||||
*
|
*
|
||||||
|
@ -77,8 +127,8 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
@Override
|
@Override
|
||||||
public SysExtensionApiEntity agentPayApply(SysExtensionApiEntity entity) {
|
public SysExtensionApiEntity agentPayApply(SysExtensionApiEntity entity) {
|
||||||
String boyds = entity.getBodys();
|
String boyds = entity.getBodys();
|
||||||
if (StrUtil.isNotEmpty(boyds)){
|
if (StrUtil.isNotEmpty(boyds)) {
|
||||||
AgentPayRequestDTO agentPayRequest = JSONObject.parseObject(boyds,AgentPayRequestDTO.class);
|
AgentPayRequestDTO agentPayRequest = JSONObject.parseObject(boyds, AgentPayRequestDTO.class);
|
||||||
String requestData = JSONObject.toJSONString(agentPayRequest);
|
String requestData = JSONObject.toJSONString(agentPayRequest);
|
||||||
//加密签名
|
//加密签名
|
||||||
encrypAndsign(entity, requestData);
|
encrypAndsign(entity, requestData);
|
||||||
|
@ -95,13 +145,13 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
@Override
|
@Override
|
||||||
public SysExtensionApiEntity payResult(SysExtensionApiEntity entity) {
|
public SysExtensionApiEntity payResult(SysExtensionApiEntity entity) {
|
||||||
String bodys = entity.getBodys();
|
String bodys = entity.getBodys();
|
||||||
if (StrUtil.isNotEmpty(bodys)){
|
if (StrUtil.isNotEmpty(bodys)) {
|
||||||
PayResultRequestDTO payResultRequest = JSONObject.parseObject(bodys,PayResultRequestDTO.class);
|
PayResultRequestDTO payResultRequest = JSONObject.parseObject(bodys, PayResultRequestDTO.class);
|
||||||
if (null != payResultRequest && StrUtil.isNotEmpty(payResultRequest.getReferenceNum())){
|
if (null != payResultRequest && StrUtil.isNotEmpty(payResultRequest.getReferenceNum())) {
|
||||||
String requestData = JSONObject.toJSONString(payResultRequest);
|
String requestData = JSONObject.toJSONString(payResultRequest);
|
||||||
//加密 签名
|
//加密 签名
|
||||||
encrypAndsign(entity,requestData);
|
encrypAndsign(entity, requestData);
|
||||||
}else {
|
} else {
|
||||||
throw new BaseSystemException("业务参考号不能为空!!!!");
|
throw new BaseSystemException("业务参考号不能为空!!!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,8 +167,8 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
@Override
|
@Override
|
||||||
public SysExtensionApiEntity transactionDetailQuery(SysExtensionApiEntity entity) {
|
public SysExtensionApiEntity transactionDetailQuery(SysExtensionApiEntity entity) {
|
||||||
String bodys = entity.getBodys();
|
String bodys = entity.getBodys();
|
||||||
if (StrUtil.isNotEmpty(bodys)){
|
if (StrUtil.isNotEmpty(bodys)) {
|
||||||
TransactionDetailReqDTO transactionDetailReqDTO = JSONObject.parseObject(bodys,TransactionDetailReqDTO.class);
|
TransactionDetailReqDTO transactionDetailReqDTO = JSONObject.parseObject(bodys, TransactionDetailReqDTO.class);
|
||||||
String requestData = JSONObject.toJSONString(transactionDetailReqDTO);
|
String requestData = JSONObject.toJSONString(transactionDetailReqDTO);
|
||||||
////加密签名
|
////加密签名
|
||||||
encrypAndsign(entity, requestData);
|
encrypAndsign(entity, requestData);
|
||||||
|
@ -135,8 +185,8 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
@Override
|
@Override
|
||||||
public SysExtensionApiEntity payApplyAgent(SysExtensionApiEntity entity) {
|
public SysExtensionApiEntity payApplyAgent(SysExtensionApiEntity entity) {
|
||||||
String bodys = entity.getBodys();
|
String bodys = entity.getBodys();
|
||||||
if (StrUtil.isNotEmpty(bodys)){
|
if (StrUtil.isNotEmpty(bodys)) {
|
||||||
AgentPayRequestDTO agentPayRequest = JSONObject.parseObject(bodys,AgentPayRequestDTO.class);
|
AgentPayRequestDTO agentPayRequest = JSONObject.parseObject(bodys, AgentPayRequestDTO.class);
|
||||||
String requestData = JSONObject.toJSONString(agentPayRequest);
|
String requestData = JSONObject.toJSONString(agentPayRequest);
|
||||||
////加密签名
|
////加密签名
|
||||||
encrypAndsign(entity, requestData);
|
encrypAndsign(entity, requestData);
|
||||||
|
@ -145,7 +195,6 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代发代扣结果查询
|
* 代发代扣结果查询
|
||||||
*
|
*
|
||||||
|
@ -155,10 +204,10 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
@Override
|
@Override
|
||||||
public SysExtensionApiEntity payApplyAgentResult(SysExtensionApiEntity entity) {
|
public SysExtensionApiEntity payApplyAgentResult(SysExtensionApiEntity entity) {
|
||||||
String bodys = entity.getBodys();
|
String bodys = entity.getBodys();
|
||||||
if (StrUtil.isNotEmpty(bodys)){
|
if (StrUtil.isNotEmpty(bodys)) {
|
||||||
AgentPayResultRequestDTO agentPayResultRequestDTO = JSONObject.parseObject(bodys,AgentPayResultRequestDTO.class);
|
AgentPayResultRequestDTO agentPayResultRequestDTO = JSONObject.parseObject(bodys, AgentPayResultRequestDTO.class);
|
||||||
String requestData = JSONObject.toJSONString(agentPayResultRequestDTO);
|
String requestData = JSONObject.toJSONString(agentPayResultRequestDTO);
|
||||||
encrypAndsign(entity,requestData);
|
encrypAndsign(entity, requestData);
|
||||||
}
|
}
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
@ -172,11 +221,11 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
@Override
|
@Override
|
||||||
public SysExtensionApiEntity elecQuery(SysExtensionApiEntity entity) {
|
public SysExtensionApiEntity elecQuery(SysExtensionApiEntity entity) {
|
||||||
String bodys = entity.getBodys();
|
String bodys = entity.getBodys();
|
||||||
if (StrUtil.isNotEmpty(bodys)){
|
if (StrUtil.isNotEmpty(bodys)) {
|
||||||
ElecRequestDTO elecRequestDTO = JSONObject.parseObject(bodys,ElecRequestDTO.class);
|
ElecRequestDTO elecRequestDTO = JSONObject.parseObject(bodys, ElecRequestDTO.class);
|
||||||
String requestData = JSONObject.toJSONString(elecRequestDTO);
|
String requestData = JSONObject.toJSONString(elecRequestDTO);
|
||||||
//加密 签名
|
//加密 签名
|
||||||
encrypAndsign(entity,requestData);
|
encrypAndsign(entity, requestData);
|
||||||
}
|
}
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
@ -184,32 +233,35 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求头
|
* 请求头
|
||||||
|
*
|
||||||
* @param sign
|
* @param sign
|
||||||
* @param timestamp
|
* @param timestamp
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,String> headersValueOf(String sign, long timestamp){
|
private Map<String, String> headersValueOf(String sign, long timestamp) {
|
||||||
Map<String,String> header = new HashMap();
|
Map<String, String> header = new HashMap();
|
||||||
header.put(CBSUtil.SIGN_HEADER_NAME,sign);
|
header.put(CBSUtil.SIGN_HEADER_NAME, sign);
|
||||||
header.put(CBSUtil.TIMESTAMP_HEADER,Long.toString(timestamp));
|
header.put(CBSUtil.TIMESTAMP_HEADER, Long.toString(timestamp));
|
||||||
header.put(HTTP.CONTENT_TYPE,CBSUtil.TARGET_CONTENT_TYPE);
|
header.put(HTTP.CONTENT_TYPE, CBSUtil.TARGET_CONTENT_TYPE);
|
||||||
header.put(CBSUtil.AUTHORIZATION,CBSUtil.BEARER+ CbsAccessToken.getToken());
|
header.put(CBSUtil.AUTHORIZATION, CBSUtil.BEARER + CbsAccessToken.getToken());
|
||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加密 签名
|
* 加密 签名
|
||||||
* @param entity 接口转发参数对象
|
*
|
||||||
|
* @param entity 接口转发参数对象
|
||||||
* @param requestData 请求参数json字符串
|
* @param requestData 请求参数json字符串
|
||||||
*/
|
*/
|
||||||
private void encrypAndsign(SysExtensionApiEntity entity, String requestData) {
|
private void encrypAndsign(SysExtensionApiEntity entity, String requestData) {
|
||||||
//签名
|
//签名
|
||||||
long timestamp = System.currentTimeMillis();
|
long timestamp = System.currentTimeMillis();
|
||||||
logger.info("CBS请求参数明文:{}",requestData);
|
logger.info("CBS请求参数明文:{}", requestData);
|
||||||
String sign = CBSUtil.sign(requestData,timestamp);
|
String sign = CBSUtil.sign(requestData, timestamp);
|
||||||
//加密
|
//加密
|
||||||
byte[] encryptedData = CBSUtil.encrypt(requestData);
|
byte[] encryptedData = CBSUtil.encrypt(requestData);
|
||||||
Map<String,String> header = headersValueOf(sign,timestamp);
|
Map<String, String> header = headersValueOf(sign, timestamp);
|
||||||
|
header.put("hzyaExtData", requestData);
|
||||||
entity.setByteBodys(encryptedData);
|
entity.setByteBodys(encryptedData);
|
||||||
entity.setHeaders(header);
|
entity.setHeaders(header);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,16 +47,17 @@ public class Cbs8ServiceImpl implements ICbs8Service {
|
||||||
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(JSONObject.toJSONString(paymentEntity)).timeout(60000).execute().body();
|
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(JSONObject.toJSONString(paymentEntity)).timeout(60000).execute().body();
|
||||||
//解密响应报文
|
//解密响应报文
|
||||||
String result = decryptResBody(body);
|
String result = decryptResBody(body);
|
||||||
if (StrUtil.isNotEmpty(result)){
|
PayResponseDTO payResponseDTO = PayResponseDTO.payResValueOf(result);
|
||||||
CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class);
|
// if (StrUtil.isNotEmpty(result)){
|
||||||
List<JSONObject> dataList = cbsResponseDTO.getData();
|
// CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class);
|
||||||
if (CollectionUtils.isNotEmpty(dataList)){
|
// List<JSONObject> dataList = cbsResponseDTO.getData();
|
||||||
JSONObject o = dataList.get(0);
|
// if (CollectionUtils.isNotEmpty(dataList)){
|
||||||
PayResponseDTO payResponseDTO = JSON.toJavaObject(o, PayResponseDTO.class);
|
// JSONObject o = dataList.get(0);
|
||||||
return payResponseDTO;
|
// PayResponseDTO payResponseDTO = JSON.toJavaObject(o, PayResponseDTO.class);
|
||||||
}
|
// return payResponseDTO;
|
||||||
}
|
// }
|
||||||
return new PayResponseDTO();
|
// }
|
||||||
|
return payResponseDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -205,16 +206,17 @@ public class Cbs8ServiceImpl implements ICbs8Service {
|
||||||
.build();
|
.build();
|
||||||
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(params).timeout(60000).execute().body();
|
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(params).timeout(60000).execute().body();
|
||||||
String result = decryptResBody(body);
|
String result = decryptResBody(body);
|
||||||
if (StrUtil.isNotEmpty(result)){
|
PayResponseDTO payResponseDTO = PayResponseDTO.payResValueOf(result);
|
||||||
CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class);
|
// if (StrUtil.isNotEmpty(result)){
|
||||||
List<JSONObject> dataList = cbsResponseDTO.getData();
|
// CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class);
|
||||||
if (CollectionUtils.isNotEmpty(dataList)){
|
// List<JSONObject> dataList = cbsResponseDTO.getData();
|
||||||
JSONObject o = dataList.get(0);
|
// if (CollectionUtils.isNotEmpty(dataList)){
|
||||||
PayResponseDTO payResponseDTO = JSON.toJavaObject(o, PayResponseDTO.class);
|
// JSONObject o = dataList.get(0);
|
||||||
return payResponseDTO;
|
// PayResponseDTO payResponseDTO = JSON.toJavaObject(o, PayResponseDTO.class);
|
||||||
}
|
// return payResponseDTO;
|
||||||
}
|
// }
|
||||||
return new PayResponseDTO();
|
// }
|
||||||
|
return payResponseDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -76,6 +76,7 @@
|
||||||
SELECT
|
SELECT
|
||||||
formmain_0209.id as oaId, -- 主表id
|
formmain_0209.id as oaId, -- 主表id
|
||||||
formson_0210.formsonId,
|
formson_0210.formsonId,
|
||||||
|
formson_0210.sort,
|
||||||
'formson_0210' as tableName, -- 表名
|
'formson_0210' as tableName, -- 表名
|
||||||
COL_SUMMARY.SUBJECT as title, -- 单据标题
|
COL_SUMMARY.SUBJECT as title, -- 单据标题
|
||||||
unit.name as payCompany, -- 付款公司
|
unit.name as payCompany, -- 付款公司
|
||||||
|
@ -136,11 +137,148 @@
|
||||||
field0072,
|
field0072,
|
||||||
field0073,
|
field0073,
|
||||||
field0080
|
field0080
|
||||||
|
ORDER BY formmain_id,sort
|
||||||
)formson_0210
|
)formson_0210
|
||||||
LEFT JOIN formmain_0209 ON formson_0210.FORMMAIN_ID = formmain_0209.id
|
LEFT JOIN formmain_0209 ON formson_0210.FORMMAIN_ID = formmain_0209.id
|
||||||
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0209.id
|
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0209.id
|
||||||
left join CTP_ENUM_ITEM item on item.id =formson_0210.field0070
|
left join CTP_ENUM_ITEM item on item.id =formson_0210.field0070
|
||||||
left join ORG_UNIT unit on unit.id =formmain_0209.field0002
|
left join ORG_UNIT unit on unit.id =formmain_0209.field0002
|
||||||
|
union all
|
||||||
|
SELECT
|
||||||
|
formmain_0094.id as oaId, -- 主表id
|
||||||
|
formson_0223.formsonId AS formsonId,-- 明细表id
|
||||||
|
formson_0223.sort,
|
||||||
|
'formson_0223' as tableName, -- 表名
|
||||||
|
COL_SUMMARY.SUBJECT as title, -- 单据标题
|
||||||
|
formmain_0094.field0006 as payCompany, -- 付款公司
|
||||||
|
'财务报销审批表(集团外)' as billName,
|
||||||
|
'field0052' as payResultField, -- 支付结果字段
|
||||||
|
'field0053' as payDateField, -- 打款日期字段
|
||||||
|
'field0060' AS applyCodeField,-- CBS支付申请单号
|
||||||
|
'' as receiptFiled,-- 电子回单字段
|
||||||
|
COL_SUMMARY.id as summaryId,
|
||||||
|
formmain_0094.field0001||'-'||formson_0223.sort as referenceNum, -- 单据编号
|
||||||
|
formmain_0094.START_DATE as startDate, -- 单据日期
|
||||||
|
formmain_0094.FINISHEDFLAG as finishedflag, -- 流程状态
|
||||||
|
formson_0223.field0053 as payDate, -- 打款日期
|
||||||
|
formson_0223.field0052 as payResult, -- 支付结果
|
||||||
|
formson_0223.field0060 AS applyCode,-- 支付申请单号
|
||||||
|
REGEXP_REPLACE(formmain_0094.field0024, '[[:space:]]', '') as payAccount, -- 付款账户
|
||||||
|
REGEXP_REPLACE(formmain_0094.field0025, '[[:space:]]', '') as payBankName, -- 付款开户行
|
||||||
|
formmain_0094.field0054 as amount, -- 金额
|
||||||
|
formmain_0094.field0007 as purpose, -- 用途
|
||||||
|
formmain_0094.field0007 as cbsAbstract, -- 摘要
|
||||||
|
REGEXP_REPLACE(formson_0223.field0050, '[[:space:]]', '') as revAccount, -- 收款账户
|
||||||
|
formson_0223.field0049 as revBankName, -- 收款开户行
|
||||||
|
formson_0223.field0056 as revAccountName, -- 收款人
|
||||||
|
REGEXP_REPLACE(formson_0223.field0051, '[[:space:]]', '') as cnapsCode, -- 收款联行号
|
||||||
|
item.ENUMVALUE as personalFlag,-- 公私标记
|
||||||
|
formson_0223.field0059 as revBankType,
|
||||||
|
'10' as currency,
|
||||||
|
'202' as busType,
|
||||||
|
'' as receipt -- 电子回单
|
||||||
|
from
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
wm_concat(id) AS formsonId,
|
||||||
|
formmain_id,
|
||||||
|
sum(field0041) AS field0041,-- 金额
|
||||||
|
min(sort) AS sort,
|
||||||
|
field0049,-- 收方开户行
|
||||||
|
field0050,-- 收方账户
|
||||||
|
field0051,-- 收方联行号
|
||||||
|
field0059,-- 收方银行类型
|
||||||
|
field0056,-- 收方名称
|
||||||
|
field0048,-- 公私标记
|
||||||
|
field0052,-- 支付结果
|
||||||
|
field0053,-- 支付时间
|
||||||
|
field0060-- 支付申请单号
|
||||||
|
FROM
|
||||||
|
formson_0223
|
||||||
|
WHERE field0047 = '-5486592002512828355'-- 是否本次支付
|
||||||
|
GROUP BY
|
||||||
|
formmain_id,
|
||||||
|
field0049,
|
||||||
|
field0050,
|
||||||
|
field0051,
|
||||||
|
field0059,
|
||||||
|
field0056,
|
||||||
|
field0048,
|
||||||
|
field0052,
|
||||||
|
field0053,
|
||||||
|
field0060
|
||||||
|
ORDER BY formmain_id,sort
|
||||||
|
)formson_0223
|
||||||
|
LEFT JOIN formmain_0094 ON formson_0223.FORMMAIN_ID = formmain_0094.id
|
||||||
|
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0094.id
|
||||||
|
left join CTP_ENUM_ITEM item on item.id =formson_0223.field0048
|
||||||
|
UNION ALL
|
||||||
|
SELECT
|
||||||
|
formmain_0093.id as oaId, -- 主表id
|
||||||
|
formson_0222.formsonId,
|
||||||
|
formson_0222.sort,
|
||||||
|
'formson_0222' as tableName, -- 表名
|
||||||
|
COL_SUMMARY.SUBJECT as title, -- 单据标题
|
||||||
|
formmain_0093.field0006 as payCompany, -- 付款公司
|
||||||
|
formmain_0093.field0087 as billName,
|
||||||
|
'field0069' as payResultField, -- 支付结果字段
|
||||||
|
'field0070' as payDateField, -- 打款日期字段
|
||||||
|
'field0086' AS applyCodeField,-- cbs支付申请单号
|
||||||
|
'' as receiptFiled,-- 电子回单字段
|
||||||
|
COL_SUMMARY.id as summaryId,
|
||||||
|
formmain_0093.field0001||'-'||formson_0222.sort as referenceNum, -- 单据编号
|
||||||
|
formmain_0093.START_DATE as startDate, -- 单据日期
|
||||||
|
formmain_0093.FINISHEDFLAG as finishedflag, -- 流程状态
|
||||||
|
formson_0222.field0070 as payDate, -- 打款日期
|
||||||
|
formson_0222.field0069 as payResult, -- 支付结果
|
||||||
|
formson_0222.field0086 AS applyCode,-- 支付申请单号
|
||||||
|
REGEXP_REPLACE(formmain_0093.field0019, '[[:space:]]', '') as payAccount, -- 付款账户
|
||||||
|
REGEXP_REPLACE(formmain_0093.field0018, '[[:space:]]', '') as payBankName, -- 付款开户行
|
||||||
|
formmain_0093.field0071 as amount, -- 金额
|
||||||
|
formmain_0093.field0022 as purpose, -- 用途
|
||||||
|
formmain_0093.field0022 as cbsAbstract, -- 摘要
|
||||||
|
REGEXP_REPLACE(formson_0222.field0067, '[[:space:]]', '') as revAccount, -- 收款账户
|
||||||
|
formson_0222.field0066 as revBankName, -- 收款开户行
|
||||||
|
formson_0222.field0082 as revAccountName, -- 收款人
|
||||||
|
REGEXP_REPLACE(formson_0222.field0068, '[[:space:]]', '') as cnapsCode, -- 收款联行号
|
||||||
|
item.enumvalue as personalFlag,-- 公私标记
|
||||||
|
formson_0222.field0085 as revBankType,
|
||||||
|
'10' as currency,
|
||||||
|
'202' as busType,
|
||||||
|
'' as receipt -- 电子回单
|
||||||
|
from
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
wm_concat(id) AS formsonId,
|
||||||
|
formmain_id,
|
||||||
|
sum(field0057) AS field0041,-- 金额
|
||||||
|
min(sort) AS sort,
|
||||||
|
field0066,-- 收方开户行
|
||||||
|
field0067,-- 收方账户
|
||||||
|
field0068,-- 收方联行号
|
||||||
|
field0085,-- 收方银行类型
|
||||||
|
field0082,-- 收方名称
|
||||||
|
field0065,-- 公私标记
|
||||||
|
field0069,-- 支付结果
|
||||||
|
field0070,-- 支付时间
|
||||||
|
field0086-- 支付申请单号
|
||||||
|
FROM formson_0222
|
||||||
|
GROUP BY
|
||||||
|
formmain_id,
|
||||||
|
field0066,
|
||||||
|
field0067,
|
||||||
|
field0068,
|
||||||
|
field0085,
|
||||||
|
field0082,
|
||||||
|
field0065,
|
||||||
|
field0069,
|
||||||
|
field0070,
|
||||||
|
field0086
|
||||||
|
ORDER BY formmain_id,sort
|
||||||
|
)formson_0222
|
||||||
|
LEFT JOIN formmain_0093 ON formson_0222.FORMMAIN_ID = formmain_0093.id
|
||||||
|
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0093.id
|
||||||
|
left join CTP_ENUM_ITEM item on item.id =formson_0222.field0065
|
||||||
</sql>
|
</sql>
|
||||||
<!-- 采用==查询 -->
|
<!-- 采用==查询 -->
|
||||||
<select id="entity_list_base" resultMap="get-PaymentEntity-result" parameterType="com.hzya.frame.seeyon.cbs8.entity.PaymentEntity">
|
<select id="entity_list_base" resultMap="get-PaymentEntity-result" parameterType="com.hzya.frame.seeyon.cbs8.entity.PaymentEntity">
|
||||||
|
@ -171,8 +309,8 @@
|
||||||
<if test="payBankName != null and payBankName !='' ">and v.payBankName = #{payBankName} </if>
|
<if test="payBankName != null and payBankName !='' ">and v.payBankName = #{payBankName} </if>
|
||||||
<if test="payType != null and payType !='' "> and v.payType = #{payType} </if>
|
<if test="payType != null and payType !='' "> and v.payType = #{payType} </if>
|
||||||
<if test="finishedflag != null and finishedflag !='' "> and v.finishedflag = #{finishedflag} </if>
|
<if test="finishedflag != null and finishedflag !='' "> and v.finishedflag = #{finishedflag} </if>
|
||||||
|
|
||||||
</trim>
|
</trim>
|
||||||
|
order by v.oaId,v.sort
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询交易成功,且电子回单为空的,上传电子回单用 -->
|
<!-- 查询交易成功,且电子回单为空的,上传电子回单用 -->
|
||||||
|
@ -276,6 +414,7 @@
|
||||||
<if test="finishedflag != null and finishedflag !='' "> and v.finishedflag = #{finishedflag} </if>
|
<if test="finishedflag != null and finishedflag !='' "> and v.finishedflag = #{finishedflag} </if>
|
||||||
and v.amount > 0
|
and v.amount > 0
|
||||||
and v.payResult is null
|
and v.payResult is null
|
||||||
|
and v.finishedflag = 1
|
||||||
</trim>
|
</trim>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class CbsLogServiceImpl extends BaseService<CbsLogEntity,String> implemen
|
||||||
logEntity.setBill_code(cbsLogEntity.getBill_code());
|
logEntity.setBill_code(cbsLogEntity.getBill_code());
|
||||||
logEntity.setDataSourceCode(oa_data_source_code);
|
logEntity.setDataSourceCode(oa_data_source_code);
|
||||||
try {
|
try {
|
||||||
update(logEntity);
|
updateLog(logEntity);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("更新");
|
logger.error("更新");
|
||||||
|
|
Loading…
Reference in New Issue