Commit d20c9b22 authored by 5359's avatar 5359

获取支付二维码接口代码调整

parent 8d393bdc
......@@ -82,6 +82,26 @@ public class HlsEbankCcbTransaction extends BaseDTO {
private Date successDate;
private String sttVchCardNo;
private String sttAcDate;
private String sttVchSeqNo;
private Double sttAmtRmb;
private Double sttVchBal;
private String sttVchRcvAcNo;
private String sttVchRcvAcName;
private String sttVchRcvBkName;
private String sttVchRcvBkNo;
private String sttVchRemark;
public Long getTransactionId() {
return transactionId;
}
......@@ -289,4 +309,84 @@ public class HlsEbankCcbTransaction extends BaseDTO {
public void setSuccessDate(Date successDate) {
this.successDate = successDate;
}
public String getSttVchCardNo() {
return sttVchCardNo;
}
public void setSttVchCardNo(String sttVchCardNo) {
this.sttVchCardNo = sttVchCardNo;
}
public String getSttAcDate() {
return sttAcDate;
}
public void setSttAcDate(String sttAcDate) {
this.sttAcDate = sttAcDate;
}
public String getSttVchSeqNo() {
return sttVchSeqNo;
}
public void setSttVchSeqNo(String sttVchSeqNo) {
this.sttVchSeqNo = sttVchSeqNo;
}
public Double getSttAmtRmb() {
return sttAmtRmb;
}
public void setSttAmtRmb(Double sttAmtRmb) {
this.sttAmtRmb = sttAmtRmb;
}
public Double getSttVchBal() {
return sttVchBal;
}
public void setSttVchBal(Double sttVchBal) {
this.sttVchBal = sttVchBal;
}
public String getSttVchRcvAcNo() {
return sttVchRcvAcNo;
}
public void setSttVchRcvAcNo(String sttVchRcvAcNo) {
this.sttVchRcvAcNo = sttVchRcvAcNo;
}
public String getSttVchRcvAcName() {
return sttVchRcvAcName;
}
public void setSttVchRcvAcName(String sttVchRcvAcName) {
this.sttVchRcvAcName = sttVchRcvAcName;
}
public String getSttVchRcvBkName() {
return sttVchRcvBkName;
}
public void setSttVchRcvBkName(String sttVchRcvBkName) {
this.sttVchRcvBkName = sttVchRcvBkName;
}
public String getSttVchRcvBkNo() {
return sttVchRcvBkNo;
}
public void setSttVchRcvBkNo(String sttVchRcvBkNo) {
this.sttVchRcvBkNo = sttVchRcvBkNo;
}
public String getSttVchRemark() {
return sttVchRemark;
}
public void setSttVchRemark(String sttVchRemark) {
this.sttVchRemark = sttVchRemark;
}
}
\ No newline at end of file
......@@ -242,7 +242,8 @@ public class HclcCmbPolyServiceImpl implements HclcCmbPolyService {
result.put(Constants.RESP_CODE, response.get("returnCode"));
result.put(Constants.RESP_MSG, "请求成功");
//测试环境处理,生产需要还原
result.put("qrCode", bizContent.getString("qrCode").replace("https://qr.95516.com/", "http://payment-uat.cs.cmburl.cn/"));
// result.put("qrCode", bizContent.getString("qrCode").replace("https://qr.95516.com/", "http://payment-uat.cs.cmburl.cn/"));
result.put("qrCode", bizContent.getString("qrCode"));
result.put("cmbOrderId", bizContent.getString("cmbOrderId"));
result.put("txnTime", bizContent.getString("txnTime"));
}
......@@ -471,7 +472,7 @@ public class HclcCmbPolyServiceImpl implements HclcCmbPolyService {
//发送http请求
responseMap = Utils.postForEntity(pro.getProperty("cmb.orderQueryUrl"), signResult, apiHeader);
//处理接口日志
logger.info("收款码申请返回结果:" + mapper.writeValueAsString(responseMap));
logger.info("收款结果查询返回结果:" + mapper.writeValueAsString(responseMap));
hlsWsRequests.setResponseClob(mapper.writeValueAsString(responseMap));
hlsWsRequests.setReturnStatus("S");
......@@ -810,6 +811,7 @@ public class HclcCmbPolyServiceImpl implements HclcCmbPolyService {
public JSONObject orderNotify(IRequest iRequest, String requestBodyString) {
JSONObject respData = new JSONObject();
// requestBodyString="sign=MEYCIQC6lS5KOUo70ZAmgaOnlTc7qyP%2BfnfcsRGum0c%2BrFr3twIhAPnBs8kpj5I3pLDcjOGk0Clxb9I6mcDmbKSThmksdaGJ&biz_content=%7B%22merId%22%3A%223089991739900AI%22%2C%22orderId%22%3A%222022081500001047%22%2C%22cmbOrderId%22%3A%22100422081517075620554651%22%2C%22userId%22%3A%22N095031094%22%2C%22txnAmt%22%3A%221323383%22%2C%22currencyCode%22%3A%22156%22%2C%22payType%22%3A%22WX%22%2C%22txnTime%22%3A%2220220815170756%22%2C%22endDate%22%3A%2220220815%22%2C%22endTime%22%3A%22171209%22%2C%22mchReserved%22%3A%22%7B%5C%22recamt_id%5C%22%3A5850109%7D%22%2C%22dscAmt%22%3A%220%22%2C%22thirdOrderId%22%3A%224200001546202208158784824486%22%2C%22payBank%22%3A%22OTHERS%22%7D&encoding=UTF-8&version=0.0.1&signMethod=02";
logger.info("支付结果通知,通知信息requestBodyString:" + requestBodyString);
//设置响应数据
respData.put("version", pro.getProperty("cmb.version"));//版本号,固定为0.0.1(必传)
......@@ -822,8 +824,8 @@ public class HclcCmbPolyServiceImpl implements HclcCmbPolyService {
respData.put("returnCode", "FAIL");
return respData;
}
Map<String, String> requestBodyMap = Utils.str2Map(SignatureUtil.decode(requestBodyString));
Map<String, String> resultMap = requestBodyMap.entrySet().stream().collect(Collectors.toMap(e -> SignatureUtil.decode(e.getKey()), e -> SignatureUtil.decode(e.getValue())));
Map<String, String> resultMap = Utils.str2Map(SignatureUtil.decode(requestBodyString));
// Map<String, String> resultMap = requestBodyMap.entrySet().stream().collect(Collectors.toMap(e -> SignatureUtil.decode(e.getKey()), e -> SignatureUtil.decode(e.getValue())));
if (resultMap == null) {
respData.put("returnCode", "FAIL");
return respData;
......@@ -848,32 +850,34 @@ public class HclcCmbPolyServiceImpl implements HclcCmbPolyService {
/*对请求结果进行保存*/
HlsEbankCcbTransaction hlsEbankCcbTransaction = hlsEbankCcbTransactionMapper.selectByPrimaryKey(ld037.getTransactionId());
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
// 事务隔离级别:开启新事务
def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
//对于每次请求都开启一个事物
TransactionStatus transactionStatus = transactionManager.getTransaction(def);
if(orderPass.equalsIgnoreCase(hlsEbankCcbTransaction.getOrderStatus())){
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
// 事务隔离级别:开启新事务
def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
//对于每次请求都开启一个事物
TransactionStatus transactionStatus = transactionManager.getTransaction(def);
//创建订单查询记录
HlsEbankCmbTransqry hlsEbankCmbTransqry = createTransqry(iRequest, hlsEbankCcbTransaction.getTransactionId(), "POST");
//创建订单查询记录
HlsEbankCmbTransqry hlsEbankCmbTransqry = createTransqry(iRequest, hlsEbankCcbTransaction.getTransactionId(), "POST");
JSONObject biz_content=JSONObject.parseObject(resultMap.get("biz_content"));
biz_content.put("tradeState",orderSuccess);
resultMap.put("biz_content",biz_content.toJSONString());
JSONObject biz_content=JSONObject.parseObject(resultMap.get("biz_content"));
biz_content.put("tradeState",orderSuccess);
resultMap.put("biz_content",biz_content.toJSONString());
hlsEbankCmbTransqry = finishTransaction(iRequest, resultMap, hlsEbankCcbTransaction, hlsEbankCmbTransqry);
hlsEbankCmbTransqry = finishTransaction(iRequest, resultMap, hlsEbankCcbTransaction, hlsEbankCmbTransqry);
//设置结果信息
hlsEbankCmbTransqryService.updateByPrimaryKeySelective(iRequest, hlsEbankCmbTransqry);
//设置结果信息
hlsEbankCmbTransqryService.updateByPrimaryKeySelective(iRequest, hlsEbankCmbTransqry);
//状态刷新
transactionStatus.flush();
//事务提交
transactionManager.commit(transactionStatus);
//状态刷新
transactionStatus.flush();
//事务提交
transactionManager.commit(transactionStatus);
JSONObject ld037Param = new JSONObject();
ld037Param.put("transaction_id", hlsEbankCcbTransaction.getTransactionId());
postWriteLd037(ld037Param);
JSONObject ld037Param = new JSONObject();
ld037Param.put("transaction_id", hlsEbankCcbTransaction.getTransactionId());
postWriteLd037(ld037Param);
}
respData.put("respCode", "SUCCESS");//业务错误码,成功为SUCCESS,失败为FAIL
/*如果处理自身业务逻辑发生错误,返回
......@@ -914,7 +918,7 @@ public class HclcCmbPolyServiceImpl implements HclcCmbPolyService {
/**
* 非交易在进行的订单不允许关单,需要修改返回代码
*/
if (orderPass.equalsIgnoreCase(hlsEbankCcbTransaction.getOrderStatus())) {
if (!orderPass.equalsIgnoreCase(hlsEbankCcbTransaction.getOrderStatus())) {
result.put(Constants.RESP_CODE, transFail);
result.put("respMsg", "订单状态异常,无法关闭!");
return result;
......@@ -1044,6 +1048,7 @@ public class HclcCmbPolyServiceImpl implements HclcCmbPolyService {
Map<String, String> requestTransactionParams = new HashMap<>();
requestTransactionParams.put("merId", hlsEbankCcbTransaction.getMerId()); //商户号(必传)
requestTransactionParams.put("origOrderId", hlsEbankCcbTransaction.getTransactionNumber()); //原交易商户订单号(必传)
requestTransactionParams.put("origCmbOrderId", hlsEbankCcbTransaction.getCmbOrderId()); //原交易商户订单号(必传)
requestTransactionParams.put("userId", hlsEbankCcbTransaction.getUserId()); //收银员
ObjectMapper mapper = new ObjectMapper();
......
......@@ -750,11 +750,10 @@ public class SignInfoHclcServiceImpl extends BaseServiceImpl<SignUserInfoHclc> i
if (!ArrayUtils.isEmpty(bytes)) {
//身份证ocr认证
SignHclcUtils signHclcUtils = new SignHclcUtils();
String img;
if ("app_file_id_card".equalsIgnoreCase(attachmentInfo.getSourceType())) {
json = signHclcUtils.idcard(bytes);
// img = Base64.encodeBase64String(bytes);
// json = this.idcard(iRequest, img);
//json = signHclcUtils.idcard(bytes);
String img = Base64.encodeBase64String(bytes);
json = this.idcard(iRequest, img);
} else if ("app_file_id_bank".equalsIgnoreCase(attachmentInfo.getSourceType())) {
json = signHclcUtils.bankcard(bytes);
// img = Base64.encodeBase64String(bytes);
......@@ -763,7 +762,7 @@ public class SignInfoHclcServiceImpl extends BaseServiceImpl<SignUserInfoHclc> i
//营业执照
// json = signHclcUtils.businessLicense(bytes);
String idNOBlob = Base64.encodeBase64String(bytes);
json = ocrLicense(iRequest, idNOBlob);
json = this.ocrLicense(iRequest, idNOBlob);
}
json.put("code", "0");
......@@ -1487,7 +1486,7 @@ public class SignInfoHclcServiceImpl extends BaseServiceImpl<SignUserInfoHclc> i
//微信电子签约通知模板
JSONObject wxParams = new JSONObject();
wxParams.put("templateId", "lyMDp1r6Jp5r7eSiho0otSby4tY0pXjZg1gbcA1poNI");
wxParams.put("templateId", "C348r2Cdd6E_ltX5fr79eGFRlQCJ84KIg4u3t2Gsibk");
wxParams.put("first", "您好,您申请的融资租赁合同已经通过审核,可以进行签约流程!");
wxParams.put("keyword1", "承租人:" + params.getString("customername"));
wxParams.put("keyword2", "合同号:" + params.getString("contractno"));
......
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