|
@@ -8,6 +8,7 @@ import com.caimei365.order.components.WeChatService;
|
|
|
import com.caimei365.order.constant.Constant;
|
|
|
import com.caimei365.order.mapper.BaseMapper;
|
|
|
import com.caimei365.order.mapper.OrderCommonMapper;
|
|
|
+import com.caimei365.order.mapper.OrderRefundMapper;
|
|
|
import com.caimei365.order.mapper.PayOrderMapper;
|
|
|
import com.caimei365.order.model.ResponseJson;
|
|
|
import com.caimei365.order.model.bo.PayParamBo;
|
|
@@ -78,6 +79,8 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
private RemoteCallService remoteCallService;
|
|
|
@Resource
|
|
|
private WeChatService weChatService;
|
|
|
+ @Resource
|
|
|
+ private OrderRefundMapper refundMapper;
|
|
|
@Value("${caimei.wwwDomain}")
|
|
|
private String domain;
|
|
|
|
|
@@ -634,153 +637,153 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
return openId;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- public void delayedSplitting(String callUrl) {
|
|
|
- log.info("【延时分账】>>>>>>>>>>延时分账,每一小时执行一次");
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
- calendar.setTime(new Date());
|
|
|
- //todo 测试 不减时间,现在有就分账
|
|
|
- //测试查5分钟前的单
|
|
|
- calendar.add(Calendar.SECOND, -5);
|
|
|
-// calendar.add(Calendar.DAY_OF_MONTH, -1);
|
|
|
- SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- String currentTime = format.format(calendar.getTime());
|
|
|
- // 查询未分账已支付收款 排除线上订金/充值订单
|
|
|
- List<OrderReceiptRelationPo> orderRelations = payOrderMapper.getUndividedPaidReceipt(currentTime);
|
|
|
- if (null != orderRelations && orderRelations.size() > 0) {
|
|
|
- for (OrderReceiptRelationPo orderRelation : orderRelations) {
|
|
|
- log.info("【延时分账】>>>>>>>>>>订单id:" + orderRelation.getOrderId() + "进入延时分账");
|
|
|
- // 收款对应的订单信息
|
|
|
- OrderVo order = orderCommonMapper.getOrderByOrderId(orderRelation.getOrderId());
|
|
|
- PayParamBo payParam = new PayParamBo();
|
|
|
- //支付金额
|
|
|
- payParam.setPayAmount(MathUtil.mul(orderRelation.getAssociateAmount(), 100).intValue());
|
|
|
- if (12 == orderRelation.getPayType()) {
|
|
|
- // 网银支付
|
|
|
- payParam.setPayWay("UNIONPAY");
|
|
|
- }
|
|
|
- if (17 == orderRelation.getPayType()) {
|
|
|
- //b2c网银
|
|
|
- payParam.setPayWay("B2C");
|
|
|
- }
|
|
|
- //微信0.65%手续费
|
|
|
- if (8 == orderRelation.getPayType() || 13 == orderRelation.getPayType() || 15 == orderRelation.getPayType()) {
|
|
|
- payParam.setPayWay("WX");
|
|
|
- }
|
|
|
- List<SplitAccountPo> splitBillDetail = setSplitAccountDetail(order, payParam);
|
|
|
- List<Map<String, String>> maps = new ArrayList<>();
|
|
|
- List<ShopOrderVo> shopOrderList = orderCommonMapper.getShopOrderListByOrderId(order.getOrderId());
|
|
|
- for (ShopOrderVo shopOrder : shopOrderList) {
|
|
|
- double shopTotalAmount = 0.00;
|
|
|
- String subUserNo = "";
|
|
|
- for (SplitAccountPo account : splitBillDetail) {
|
|
|
- //供应商有支付平台账户type=4
|
|
|
- if (null != account.getType() && 4 == account.getType() && shopOrder.getShopId().equals(account.getShopId())) {
|
|
|
- shopTotalAmount = MathUtil.add(shopTotalAmount, account.getSplitAccount()).doubleValue();
|
|
|
- subUserNo = account.getSubUserNo();
|
|
|
- }
|
|
|
- }
|
|
|
-// addMaps(maps, shopTotalAmount, subUserNo);
|
|
|
- }
|
|
|
- if (null == splitBillDetail || splitBillDetail.size() == 0) {
|
|
|
- log.info("无满足条件分账单号");
|
|
|
- return;
|
|
|
- }
|
|
|
- //公账-专票总金额,私账-无票总金额,公账-普票总金额
|
|
|
- //Type2,3奥泰,1,5信息
|
|
|
- //todo 正式改
|
|
|
- String sp1 = "";
|
|
|
- BigDecimal totalAmount1 = BigDecimal.ZERO;
|
|
|
- String sp2 = "";
|
|
|
- BigDecimal totalAmount2 = BigDecimal.ZERO;
|
|
|
- for (SplitAccountPo account : splitBillDetail) {
|
|
|
- if (1 == account.getType() || 5 == account.getType()) {
|
|
|
- totalAmount1 = MathUtil.add(totalAmount1, account.getSplitAccount());
|
|
|
- sp1 = account.getSubUserNo();
|
|
|
- }
|
|
|
- if (2 == account.getType() || 3 == account.getType()) {
|
|
|
- totalAmount2 = MathUtil.add(totalAmount2, account.getSplitAccount());
|
|
|
- sp2 = account.getSubUserNo();
|
|
|
- }
|
|
|
- }
|
|
|
- ArrayList<AccountPayOrder.AccountPayOrderExt.SplitBillRule> splitBillRules = new ArrayList<>();
|
|
|
- if (MathUtil.compare(totalAmount1, 0.01) > 0) {
|
|
|
- AccountPayOrder.AccountPayOrderExt.SplitBillRule splitBillRule = new AccountPayOrder.AccountPayOrderExt.SplitBillRule();
|
|
|
- splitBillRule.setSplitBillAmount(totalAmount1);
|
|
|
- splitBillRule.setSplitBillMerchantNo(sp1);
|
|
|
- splitBillRules.add(splitBillRule);
|
|
|
- }
|
|
|
- if (MathUtil.compare(totalAmount2, 0.01) > 0) {
|
|
|
- AccountPayOrder.AccountPayOrderExt.SplitBillRule splitBillRule = new AccountPayOrder.AccountPayOrderExt.SplitBillRule();
|
|
|
- splitBillRule.setSplitBillAmount(totalAmount2);
|
|
|
- splitBillRule.setSplitBillMerchantNo(sp2);
|
|
|
- splitBillRules.add(splitBillRule);
|
|
|
- }
|
|
|
- //第三方分账接口
|
|
|
- try {
|
|
|
- AccountPayOrder accountPayOrder = new AccountPayOrder();
|
|
|
- accountPayOrder.setP1_bizType("AccountPaySub");
|
|
|
- accountPayOrder.setP2_signType("MD5");
|
|
|
- String format1 = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS").format(new Date());
|
|
|
- accountPayOrder.setP3_timestamp(format1);
|
|
|
- String substring = format1.substring(20);
|
|
|
- // fz+当前微秒时间+原唯一订单号
|
|
|
- accountPayOrder.setP4_orderId("FZ" + substring + orderRelation.getOrderRequestNo());
|
|
|
- //todo 付款账户商编暂用网络
|
|
|
- accountPayOrder.setP5_customerNumber(Constant.CUSTOMERNUM2);
|
|
|
- AccountPayOrder.AccountPayOrderExt accountPayOrderExt = new AccountPayOrder.AccountPayOrderExt();
|
|
|
- //收款账户商编 填写splitBillRules时候不填写MerchantNo,Amount并且即使填写这两个参数不生效!!
|
|
|
-// accountPayOrderExt.setInMerchantNo(splitMoneyVo.getName());
|
|
|
- accountPayOrderExt.setOrderType(AccountPayOrderType.TRANSFER);
|
|
|
-// accountPayOrderExt.setAmount(splitMoneyVo.getSplitMoney());
|
|
|
- accountPayOrderExt.setServerCallbackUrl(callUrl);
|
|
|
- accountPayOrderExt.setGoodsName("分账");
|
|
|
-
|
|
|
- if (null != splitBillRules && splitBillRules.size() > 0) {
|
|
|
- accountPayOrderExt.setSplitBillRules(splitBillRules);
|
|
|
- }
|
|
|
- String ext = JSON.toJSONString(accountPayOrderExt);
|
|
|
- log.info("分账规则串json串:" + ext);
|
|
|
- accountPayOrder.setP6_ext(ext);
|
|
|
- // 生成签名
|
|
|
- StringBuilder builder = new StringBuilder();
|
|
|
- builder.append(SPLIT)
|
|
|
- .append(accountPayOrder.getP1_bizType()).append(SPLIT)
|
|
|
- .append(accountPayOrder.getP2_signType()).append(SPLIT)
|
|
|
- .append(accountPayOrder.getP3_timestamp()).append(SPLIT)
|
|
|
- .append(accountPayOrder.getP4_orderId()).append(SPLIT)
|
|
|
- .append(accountPayOrder.getP5_customerNumber()).append(SPLIT)
|
|
|
- .append(accountPayOrder.getP6_ext()).append(SPLIT)
|
|
|
- .append(XUNI);
|
|
|
- String sign = Disguiser.disguiseMD5(builder.toString().trim());
|
|
|
- Map<String, String> bean = convertBean(accountPayOrder);
|
|
|
- log.info("--------------------> 发送分账参数: " + bean);
|
|
|
- Map<String, String> map = postForm(bean, Constant.FZ, sign, Map.class);
|
|
|
- log.info("----------------分账返回数据: " + map.toString());
|
|
|
- if (map != null) {
|
|
|
- String code = map.get("rt5_retCode");
|
|
|
- if (!"0000".equals(code)) {
|
|
|
- String msg = map.get("rt6_retMsg");
|
|
|
- log.info("【延时分账】>>>>>>>>>>第三方延迟分账失败>>>>>>>msg:" + msg);
|
|
|
- } else {
|
|
|
- for (SplitAccountPo splitAccount : splitBillDetail) {
|
|
|
- splitAccount.setMbOrderId(orderRelation.getMbOrderId());
|
|
|
- splitAccount.setOrderRequestNo(substring + orderRelation.getOrderRequestNo());
|
|
|
- splitAccount.setPayStatus(1);
|
|
|
- // 保存分账详情
|
|
|
- payOrderMapper.insertSplitAccount(splitAccount);
|
|
|
- }
|
|
|
- log.info("【延时分账】>>>>>>>>>>此订单分账结束");
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("【延时分账】>>>>>>>>>>错误信息", e);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// @Override
|
|
|
+// @Transactional(rollbackFor = Exception.class)
|
|
|
+// public void delayedSplitting(String callUrl) {
|
|
|
+// log.info("【延时分账】>>>>>>>>>>延时分账,每一小时执行一次");
|
|
|
+// Calendar calendar = Calendar.getInstance();
|
|
|
+// calendar.setTime(new Date());
|
|
|
+// //todo 测试 不减时间,现在有就分账
|
|
|
+// //测试查5分钟前的单
|
|
|
+// calendar.add(Calendar.SECOND, -5);
|
|
|
+//// calendar.add(Calendar.DAY_OF_MONTH, -1);
|
|
|
+// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+// String currentTime = format.format(calendar.getTime());
|
|
|
+// // 查询未分账已支付收款 排除线上订金/充值订单
|
|
|
+// List<OrderReceiptRelationPo> orderRelations = payOrderMapper.getUndividedPaidReceipt(currentTime);
|
|
|
+// if (null != orderRelations && orderRelations.size() > 0) {
|
|
|
+// for (OrderReceiptRelationPo orderRelation : orderRelations) {
|
|
|
+// log.info("【延时分账】>>>>>>>>>>订单id:" + orderRelation.getOrderId() + "进入延时分账");
|
|
|
+// // 收款对应的订单信息
|
|
|
+// OrderVo order = orderCommonMapper.getOrderByOrderId(orderRelation.getOrderId());
|
|
|
+// PayParamBo payParam = new PayParamBo();
|
|
|
+// //支付金额
|
|
|
+// payParam.setPayAmount(MathUtil.mul(orderRelation.getAssociateAmount(), 100).intValue());
|
|
|
+// if (12 == orderRelation.getPayType()) {
|
|
|
+// // 网银支付
|
|
|
+// payParam.setPayWay("UNIONPAY");
|
|
|
+// }
|
|
|
+// if (17 == orderRelation.getPayType()) {
|
|
|
+// //b2c网银
|
|
|
+// payParam.setPayWay("B2C");
|
|
|
+// }
|
|
|
+// //微信0.65%手续费
|
|
|
+// if (8 == orderRelation.getPayType() || 13 == orderRelation.getPayType() || 15 == orderRelation.getPayType()) {
|
|
|
+// payParam.setPayWay("WX");
|
|
|
+// }
|
|
|
+// List<SplitAccountPo> splitBillDetail = setSplitAccountDetail(order, payParam);
|
|
|
+// List<Map<String, String>> maps = new ArrayList<>();
|
|
|
+// List<ShopOrderVo> shopOrderList = orderCommonMapper.getShopOrderListByOrderId(order.getOrderId());
|
|
|
+// for (ShopOrderVo shopOrder : shopOrderList) {
|
|
|
+// double shopTotalAmount = 0.00;
|
|
|
+// String subUserNo = "";
|
|
|
+// for (SplitAccountPo account : splitBillDetail) {
|
|
|
+// //供应商有支付平台账户type=4
|
|
|
+// if (null != account.getType() && 4 == account.getType() && shopOrder.getShopId().equals(account.getShopId())) {
|
|
|
+// shopTotalAmount = MathUtil.add(shopTotalAmount, account.getSplitAccount()).doubleValue();
|
|
|
+// subUserNo = account.getSubUserNo();
|
|
|
+// }
|
|
|
+// }
|
|
|
+//// addMaps(maps, shopTotalAmount, subUserNo);
|
|
|
+// }
|
|
|
+// if (null == splitBillDetail || splitBillDetail.size() == 0) {
|
|
|
+// log.info("无满足条件分账单号");
|
|
|
+// return;
|
|
|
+// }
|
|
|
+// //公账-专票总金额,私账-无票总金额,公账-普票总金额
|
|
|
+// //Type2,3奥泰,1,5信息
|
|
|
+// //todo 正式改
|
|
|
+// String sp1 = "";
|
|
|
+// BigDecimal totalAmount1 = BigDecimal.ZERO;
|
|
|
+// String sp2 = "";
|
|
|
+// BigDecimal totalAmount2 = BigDecimal.ZERO;
|
|
|
+// for (SplitAccountPo account : splitBillDetail) {
|
|
|
+// if (1 == account.getType() || 5 == account.getType()) {
|
|
|
+// totalAmount1 = MathUtil.add(totalAmount1, account.getSplitAccount());
|
|
|
+// sp1 = account.getSubUserNo();
|
|
|
+// }
|
|
|
+// if (2 == account.getType() || 3 == account.getType()) {
|
|
|
+// totalAmount2 = MathUtil.add(totalAmount2, account.getSplitAccount());
|
|
|
+// sp2 = account.getSubUserNo();
|
|
|
+// }
|
|
|
+// }
|
|
|
+// ArrayList<AccountPayOrder.AccountPayOrderExt.SplitBillRule> splitBillRules = new ArrayList<>();
|
|
|
+// if (MathUtil.compare(totalAmount1, 0.01) > 0) {
|
|
|
+// AccountPayOrder.AccountPayOrderExt.SplitBillRule splitBillRule = new AccountPayOrder.AccountPayOrderExt.SplitBillRule();
|
|
|
+// splitBillRule.setSplitBillAmount(totalAmount1);
|
|
|
+// splitBillRule.setSplitBillMerchantNo(sp1);
|
|
|
+// splitBillRules.add(splitBillRule);
|
|
|
+// }
|
|
|
+// if (MathUtil.compare(totalAmount2, 0.01) > 0) {
|
|
|
+// AccountPayOrder.AccountPayOrderExt.SplitBillRule splitBillRule = new AccountPayOrder.AccountPayOrderExt.SplitBillRule();
|
|
|
+// splitBillRule.setSplitBillAmount(totalAmount2);
|
|
|
+// splitBillRule.setSplitBillMerchantNo(sp2);
|
|
|
+// splitBillRules.add(splitBillRule);
|
|
|
+// }
|
|
|
+// //第三方分账接口
|
|
|
+// try {
|
|
|
+// AccountPayOrder accountPayOrder = new AccountPayOrder();
|
|
|
+// accountPayOrder.setP1_bizType("AccountPaySub");
|
|
|
+// accountPayOrder.setP2_signType("MD5");
|
|
|
+// String format1 = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS").format(new Date());
|
|
|
+// accountPayOrder.setP3_timestamp(format1);
|
|
|
+// String substring = format1.substring(20);
|
|
|
+// // fz+当前微秒时间+原唯一订单号
|
|
|
+// accountPayOrder.setP4_orderId("FZ" + substring + orderRelation.getOrderRequestNo());
|
|
|
+// //todo 付款账户商编暂用网络
|
|
|
+// accountPayOrder.setP5_customerNumber(Constant.CUSTOMERNUM2);
|
|
|
+// AccountPayOrder.AccountPayOrderExt accountPayOrderExt = new AccountPayOrder.AccountPayOrderExt();
|
|
|
+// //收款账户商编 填写splitBillRules时候不填写MerchantNo,Amount并且即使填写这两个参数不生效!!
|
|
|
+//// accountPayOrderExt.setInMerchantNo(splitMoneyVo.getName());
|
|
|
+// accountPayOrderExt.setOrderType(AccountPayOrderType.TRANSFER);
|
|
|
+//// accountPayOrderExt.setAmount(splitMoneyVo.getSplitMoney());
|
|
|
+// accountPayOrderExt.setServerCallbackUrl(callUrl);
|
|
|
+// accountPayOrderExt.setGoodsName("分账");
|
|
|
+//
|
|
|
+// if (null != splitBillRules && splitBillRules.size() > 0) {
|
|
|
+// accountPayOrderExt.setSplitBillRules(splitBillRules);
|
|
|
+// }
|
|
|
+// String ext = JSON.toJSONString(accountPayOrderExt);
|
|
|
+// log.info("分账规则串json串:" + ext);
|
|
|
+// accountPayOrder.setP6_ext(ext);
|
|
|
+// // 生成签名
|
|
|
+// StringBuilder builder = new StringBuilder();
|
|
|
+// builder.append(SPLIT)
|
|
|
+// .append(accountPayOrder.getP1_bizType()).append(SPLIT)
|
|
|
+// .append(accountPayOrder.getP2_signType()).append(SPLIT)
|
|
|
+// .append(accountPayOrder.getP3_timestamp()).append(SPLIT)
|
|
|
+// .append(accountPayOrder.getP4_orderId()).append(SPLIT)
|
|
|
+// .append(accountPayOrder.getP5_customerNumber()).append(SPLIT)
|
|
|
+// .append(accountPayOrder.getP6_ext()).append(SPLIT)
|
|
|
+// .append(XUNI);
|
|
|
+// String sign = Disguiser.disguiseMD5(builder.toString().trim());
|
|
|
+// Map<String, String> bean = convertBean(accountPayOrder);
|
|
|
+// log.info("--------------------> 发送分账参数: " + bean);
|
|
|
+// Map<String, String> map = postForm(bean, Constant.FZ, sign, Map.class);
|
|
|
+// log.info("----------------分账返回数据: " + map.toString());
|
|
|
+// if (map != null) {
|
|
|
+// String code = map.get("rt5_retCode");
|
|
|
+// if (!"0000".equals(code)) {
|
|
|
+// String msg = map.get("rt6_retMsg");
|
|
|
+// log.info("【延时分账】>>>>>>>>>>第三方延迟分账失败>>>>>>>msg:" + msg);
|
|
|
+// } else {
|
|
|
+// for (SplitAccountPo splitAccount : splitBillDetail) {
|
|
|
+// splitAccount.setMbOrderId(orderRelation.getMbOrderId());
|
|
|
+// splitAccount.setOrderRequestNo(substring + orderRelation.getOrderRequestNo());
|
|
|
+// splitAccount.setPayStatus(1);
|
|
|
+// // 保存分账详情
|
|
|
+// payOrderMapper.insertSplitAccount(splitAccount);
|
|
|
+// }
|
|
|
+// log.info("【延时分账】>>>>>>>>>>此订单分账结束");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error("【延时分账】>>>>>>>>>>错误信息", e);
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
@Override
|
|
|
public String delayedSplittingCallback(AccountResVo data) {
|
|
@@ -1747,6 +1750,69 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
return ResponseJson.success(banks);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String refundSplittingCallback(AccountResVo data) {
|
|
|
+ log.info("网银退款分账异步回调参数-------------------》 " + data.toString());
|
|
|
+ try {
|
|
|
+ String oriMessage = MyBeanUtils.getSigned(data, null);
|
|
|
+ oriMessage = oriMessage + SPLIT + XUNI;
|
|
|
+ String checkSign = Disguiser.disguiseMD5(oriMessage.trim());
|
|
|
+ log.info("网银退款回调签名 :" + data.getSign());
|
|
|
+ log.info("checkSign : " + checkSign);
|
|
|
+ if (!checkSign.equals(data.getSign())) {
|
|
|
+ log.info("网银退款分账异步回调验签失败------------------");
|
|
|
+ return "验签失败";
|
|
|
+ }
|
|
|
+ // wytk+sss + orderRequestNo
|
|
|
+ String orderRequestNo = data.getRt7_orderId().substring(7);
|
|
|
+ String status = data.getRt10_orderStatus();
|
|
|
+ log.info("【网银退款分账回调】>>>>>>>>>>分账状态:" + status);
|
|
|
+ if (!"SUCCESS".equals(status)) {
|
|
|
+ return "分账失败";
|
|
|
+ }
|
|
|
+ OrderReceiptRelationPo po = refundMapper.findOrderRelationByNo(orderRequestNo);
|
|
|
+ // 网银退款
|
|
|
+ Map<String, String> sPara = new HashMap<String, String>();
|
|
|
+ sPara.put("P1_bizType", "OnlineRefund");
|
|
|
+ sPara.put("P2_orderId", orderRequestNo);
|
|
|
+ sPara.put("P3_customerNumber", po.getSplitCode());
|
|
|
+ sPara.put("P4_refundAmount", po.getAssociateAmount().toString());
|
|
|
+ sPara.put("P5_refundOrderId", "TK" + orderRequestNo);
|
|
|
+ sPara.put("P6_desc", "无");
|
|
|
+ sPara.put("P7_serverCallbackUrl", "");
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ sb.append("&").append("OnlineRefund").append("&").append(orderRequestNo).append("&").append(po.getSplitCode()).append("&").
|
|
|
+ append(po.getAssociateAmount().toString()).append("&").append("TK" + orderRequestNo).append("&").append("无").append("&").append("&").append(Constant.WANGYIN);
|
|
|
+ String sign = Disguiser.disguiseMD5(sb.toString());
|
|
|
+ sPara.put("sign", sign);
|
|
|
+ OnlineRefundData on = OnlinePostFormUtil.refundPostForm(sPara, Constant.YL, sign, OnlineRefundData.class);
|
|
|
+ if (!"0000".equals(on.getRt2_retCode())) {
|
|
|
+ log.info("网银退款失败:" + on.toString());
|
|
|
+ return "分账失败";
|
|
|
+ } else {
|
|
|
+ String assemblyRespOriSign = MyBeanUtils.getSignedByPresetParameter(on, OnlineRefundData.NEED_SIGN_PARAMS);
|
|
|
+ log.info("组装返回结果签名串:" + assemblyRespOriSign);
|
|
|
+ assemblyRespOriSign += Constant.SPLIT + Constant.WANGYIN;
|
|
|
+ String backSign = Disguiser.disguiseMD5(assemblyRespOriSign.trim());
|
|
|
+ if (!backSign.equals(on.getSign())) {
|
|
|
+ log.error("网银退款验签失败========================" + on.getRt3_retMsg());
|
|
|
+ return "分账失败";
|
|
|
+ } else {
|
|
|
+ CmRefundRecord cmRefundRecord = new CmRefundRecord();
|
|
|
+ cmRefundRecord.setRefundAmount(Double.parseDouble(po.getAssociateAmount().toString()));
|
|
|
+ cmRefundRecord.setOrderRequestNo(orderRequestNo);
|
|
|
+ cmRefundRecord.setShopOrderId(po.getShopOrderId());
|
|
|
+ refundMapper.insertCmRefundRecord(cmRefundRecord);
|
|
|
+ log.info("网银退款成功");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("【网银退款手续费转账失败】>>>>>>>>>>网银退款分账异常", e);
|
|
|
+ return "分账失败";
|
|
|
+ }
|
|
|
+ return "SUCCESS";
|
|
|
+ }
|
|
|
+
|
|
|
public static <T> T postForm(Map<String, String> params, String url, String sign, Class<T> clazz) {
|
|
|
FormBody.Builder builder = new FormBody.Builder();
|
|
|
for (Map.Entry<String, String> entry : params.entrySet()) {
|