Commit e67b3a65 authored by 胡建龙's avatar 胡建龙

20220428 支付结果监听中更新hlsEbankCmbTransqry

parent ae5c4915
......@@ -23,6 +23,7 @@ import com.hand.app.zhongDengWang.mapper.HlsWsRequestsMapper;
import com.hand.hap.core.IRequest;
import com.hand.hap.intergration.dto.HapInterfaceHeader;
import com.hand.hap.intergration.service.IHapInterfaceHeaderService;
import org.apache.poi.hssf.record.DVALRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -621,7 +622,7 @@ public class HclcCmbPolyServiceImpl implements HclcCmbPolyService {
//发送http请求
SignHclcUtils signHclcUtils1 = new SignHclcUtils();
String stringResult = signHclcUtils1.postString(url, requestData, headInfo, signHclcUtils1.APPLICATION_FORM_URLENCODED);
String stringResult = signHclcUtils1.postString(url, requestData, headInfo, SignHclcUtils.APPLICATION_FORM_URLENCODED);
//解析返回结果
JSONObject jsonResult = JSONObject.parseObject(stringResult);
......@@ -817,7 +818,6 @@ public class HclcCmbPolyServiceImpl implements HclcCmbPolyService {
respData.put("version", pro.getProperty("cmb.version"));//版本号,固定为0.0.1(必传)
respData.put("encoding", pro.getProperty("cmb.encoding"));//编码方式,固定为UTF-8(必传)
respData.put("signMethod", pro.getProperty("cmb.signMethod"));//签名方法,固定为02,国密
try {
respData.put("returnCode", "SUCCESS"); //SUCCESS表示商户接收通知成功并校验成功
//非空校验
......@@ -850,11 +850,17 @@ public class HclcCmbPolyServiceImpl implements HclcCmbPolyService {
ld037 = ld037Mapper.selectByPrimaryKey(ld037);
/*对请求结果进行保存*/
HlsEbankCcbTransaction hlsEbankCcbTransaction = hlsEbankCcbTransactionMapper.selectByPrimaryKey(ld037.getTransactionId());
hlsEbankCcbTransaction.setStatus(tranSuccess);
hlsEbankCcbTransaction.setOrderStatus(orderSuccess);
hlsEbankCcbTransactionMapper.updateByPrimaryKeySelective(hlsEbankCcbTransaction);
hlsWsRequestsMapper.updateByPrimaryKey(logInterfaceRequest(queryQrState, pro.getProperty("cmb.server"), new ObjectMapper().writeValueAsString(respData), hlsEbankCcbTransaction.getTransactionId()));
//创建订单查询记录
HlsEbankCmbTransqry hlsEbankCmbTransqry = createTransqry(hlsEbankCcbTransaction.getTransactionId(), "POST");
//生成单据编号 日期+id
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
String dateString = formatter.format(new Date());
hlsEbankCmbTransqry.setTransqryNumber(dateString + String.format("%08d", hlsEbankCcbTransaction.getTransactionId()));
hlsEbankCmbTransqry = finishTransaction(resultMap,hlsEbankCcbTransaction,hlsEbankCmbTransqry);
hlsEbankCmbTransqryMapper.updateByPrimaryKey(hlsEbankCmbTransqry);
hlsWsRequestsMapper.updateByPrimaryKey(logInterfaceRequest(queryQrState, pro.getProperty("cmb.server"), new ObjectMapper().writeValueAsString(respData), hlsEbankCcbTransaction.getTransactionId()));
respData.put("respCode", "SUCCESS");//业务错误码,成功为SUCCESS,失败为FAIL
/*如果处理自身业务逻辑发生错误,返回
respData.put("respCode","FAIL");
......@@ -864,7 +870,6 @@ public class HclcCmbPolyServiceImpl implements HclcCmbPolyService {
String signContent = SignatureUtil.getSignContent(respData);
//加签-使用商户私钥加签
respData.put("sign", SM2Util.sm2Sign(signContent, pro.getProperty("cmb.privateKey")));
System.out.println("加签成功");
return respData;
} catch (Exception e) {
e.printStackTrace();
......@@ -1004,11 +1009,9 @@ public class HclcCmbPolyServiceImpl implements HclcCmbPolyService {
//业务要素
Map<String, String> requestTransactionParams = new HashMap<>();
requestTransactionParams.put("merId", hlsEbankCcbTransaction.getMerId()); //商户号(必传)
requestTransactionParams.put("orderId", hlsEbankCcbTransaction.getTransactionNumber()); //商户订单号(必传)
requestTransactionParams.put("userId", hlsEbankCcbTransaction.getUserId()); //收银员
ObjectMapper mapper = new ObjectMapper();
requestPublicParams.put("biz_content", mapper.writeValueAsString(requestTransactionParams));
/*冗余列,因为关闭订单中的请求参数名称与其余请求的参数名称不同*/
requestTransactionParams.put("origOrderId", hlsEbankCcbTransaction.getTransactionNumber()); //商户订单号(必传)
System.out.println("加签前的报文内容:" + mapper.writeValueAsString(requestPublicParams));
......
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