|
@@ -3,6 +3,7 @@ package com.caimei365.order.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.caimei365.order.components.HeliPayUtil;
|
|
|
+import com.caimei365.order.components.OnlinePostFormUtil;
|
|
|
import com.caimei365.order.components.WeChatService;
|
|
|
import com.caimei365.order.constant.Constant;
|
|
|
import com.caimei365.order.mapper.BaseMapper;
|
|
@@ -19,6 +20,7 @@ import com.caimei365.order.model.po.*;
|
|
|
import com.caimei365.order.model.vo.*;
|
|
|
import com.caimei365.order.service.HeliPayService;
|
|
|
import com.caimei365.order.service.RemoteCallService;
|
|
|
+import com.caimei365.order.utils.ImageUtil;
|
|
|
import com.caimei365.order.utils.MathUtil;
|
|
|
import com.caimei365.order.utils.PayUtil;
|
|
|
import com.caimei365.order.utils.helipay.Disguiser;
|
|
@@ -30,6 +32,7 @@ import org.apache.commons.lang.ArrayUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.http.HttpStatus;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
@@ -78,6 +81,8 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
private RemoteCallService remoteCallService;
|
|
|
@Resource
|
|
|
private WeChatService weChatService;
|
|
|
+ @Value("${caimei.wwwDomain}")
|
|
|
+ private String domain;
|
|
|
|
|
|
/**
|
|
|
* 微信/支付宝扫码接口
|
|
@@ -100,108 +105,98 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
* 签名 sign 是 String(40) d3382b9a9b08cefc1a79d276ec03d83a MD5 签名结果,详见“第 5 章 数字签名”
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResponseJson<JSONObject> payByWeChat(HeliDto heliDto, HttpHeaders headers) {
|
|
|
+ public ResponseJson<JSONObject> payByWeChat(HeliDto heliDto, HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
|
|
|
log.info("--------进入支付二维码创建接口----------");
|
|
|
- try {
|
|
|
- AppCreateOrderVo pay = new AppCreateOrderVo();
|
|
|
- String splitCode = payOrderMapper.findShopOrderSplitCode(heliDto.getShopOrderId());
|
|
|
- if (StringUtils.isBlank(splitCode)) {
|
|
|
- return ResponseJson.error("子订单无商户号!", null);
|
|
|
- }
|
|
|
- pay.setP3_customerNumber(splitCode);
|
|
|
- //合利宝主扫接口参数赋值
|
|
|
- heliPayUtil.setValue(pay, heliDto, "order", headers);
|
|
|
- if (!(StringUtils.equals(AppPayType.ALIPAY.name(), pay.getP8_appType())
|
|
|
- && StringUtils.equals(PayType.SWIPE.name(), pay.getP4_payType()))) {
|
|
|
- pay.setOpenId(null);
|
|
|
- pay.setAuthConfirmMode(null);
|
|
|
- }
|
|
|
- Map<String, String> map = MyBeanUtils.convertBean(pay, new LinkedHashMap());
|
|
|
- String oriMessage = MyBeanUtils.getSignedByPresetParameter(map, AppCreateOrderVo.NEED_SIGN_PARAMS);
|
|
|
- //密钥拼接
|
|
|
- oriMessage += SPLIT + Constant.SAOMA;
|
|
|
- log.info("签名原文串:" + oriMessage);
|
|
|
- String sign = Disguiser.disguiseMD5(oriMessage.trim());
|
|
|
- log.info("签名串:" + sign);
|
|
|
- map.put("sign", sign);
|
|
|
- log.info("发送参数:" + map);
|
|
|
- Map<String, Object> resultMap = HttpClientService.getHttpResp(map, Constant.REQUEST_URL);
|
|
|
- log.info("响应结果:" + resultMap);
|
|
|
- if ((Integer) resultMap.get("statusCode") == HttpStatus.SC_OK) {
|
|
|
- String resultMsg = (String) resultMap.get("response");
|
|
|
- AppCreateOrderResponseVo orderResponseVo = JSONObject.parseObject(resultMsg, AppCreateOrderResponseVo.class);
|
|
|
- String assemblyRespOriSign = MyBeanUtils.getSignedByPresetParameter(orderResponseVo, AppCreateOrderResponseVo.NEED_SIGN_PARAMS);
|
|
|
- assemblyRespOriSign += Constant.SPLIT + Constant.SAOMA;
|
|
|
- log.info("组装返回结果签名串:" + assemblyRespOriSign);
|
|
|
- String responseSign = orderResponseVo.getSign();
|
|
|
- log.info("响应签名:" + responseSign);
|
|
|
- String checkSign = Disguiser.disguiseMD5(assemblyRespOriSign.trim());
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(resultMsg);
|
|
|
- if (checkSign.equals(responseSign) && "0000".equals(orderResponseVo.getRt2_retCode())) {
|
|
|
- return ResponseJson.success("二维码创建成功", jsonObject);
|
|
|
- } else {
|
|
|
- return ResponseJson.error("二维码创建失败", jsonObject);
|
|
|
- }
|
|
|
+ AppCreateOrderVo pay = new AppCreateOrderVo();
|
|
|
+ String splitCode = payOrderMapper.findShopOrderSplitCode(heliDto.getShopOrderId());
|
|
|
+ if (StringUtils.isBlank(splitCode)) {
|
|
|
+ return ResponseJson.error("子订单无商户号!", null);
|
|
|
+ }
|
|
|
+ pay.setP3_customerNumber(splitCode);
|
|
|
+ //合利宝主扫接口参数赋值
|
|
|
+ heliPayUtil.setValue(pay, heliDto, "order", headers);
|
|
|
+ if (!(StringUtils.equals(AppPayType.ALIPAY.name(), pay.getP8_appType())
|
|
|
+ && StringUtils.equals(PayType.SWIPE.name(), pay.getP4_payType()))) {
|
|
|
+ pay.setOpenId(null);
|
|
|
+ pay.setAuthConfirmMode(null);
|
|
|
+ }
|
|
|
+ Map<String, String> map = MyBeanUtils.convertBean(pay, new LinkedHashMap());
|
|
|
+ String oriMessage = MyBeanUtils.getSignedByPresetParameter(map, AppCreateOrderVo.NEED_SIGN_PARAMS);
|
|
|
+ //密钥拼接
|
|
|
+ oriMessage += SPLIT + Constant.SAOMA;
|
|
|
+ log.info("签名原文串:" + oriMessage);
|
|
|
+ String sign = Disguiser.disguiseMD5(oriMessage.trim());
|
|
|
+ log.info("签名串:" + sign);
|
|
|
+ map.put("sign", sign);
|
|
|
+ log.info("发送参数:" + map);
|
|
|
+ Map<String, Object> resultMap = HttpClientService.getHttpResp(map, Constant.REQUEST_URL);
|
|
|
+ log.info("响应结果:" + resultMap);
|
|
|
+ if ((Integer) resultMap.get("statusCode") == HttpStatus.SC_OK) {
|
|
|
+ String resultMsg = (String) resultMap.get("response");
|
|
|
+ AppCreateOrderResponseVo orderResponseVo = JSONObject.parseObject(resultMsg, AppCreateOrderResponseVo.class);
|
|
|
+ String assemblyRespOriSign = MyBeanUtils.getSignedByPresetParameter(orderResponseVo, AppCreateOrderResponseVo.NEED_SIGN_PARAMS);
|
|
|
+ assemblyRespOriSign += Constant.SPLIT + Constant.SAOMA;
|
|
|
+ log.info("组装返回结果签名串:" + assemblyRespOriSign);
|
|
|
+ String responseSign = orderResponseVo.getSign();
|
|
|
+ log.info("响应签名:" + responseSign);
|
|
|
+ String checkSign = Disguiser.disguiseMD5(assemblyRespOriSign.trim());
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(resultMsg);
|
|
|
+ if (checkSign.equals(responseSign) && "0000".equals(orderResponseVo.getRt2_retCode())) {
|
|
|
+ return ResponseJson.success("二维码创建成功", jsonObject);
|
|
|
} else {
|
|
|
- return ResponseJson.error("二维码创建失败", null);
|
|
|
+ return ResponseJson.error("二维码创建失败", jsonObject);
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("二维码创建失败" + e);
|
|
|
+ } else {
|
|
|
return ResponseJson.error("二维码创建失败", null);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResponseJson<JSONObject> payOnline(HeliDto heliDto, HttpHeaders headers) {
|
|
|
+ public ResponseJson<JSONObject> payOnline(HeliDto heliDto, HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
|
|
|
log.info("--------进入公众号/小程序预创建订单接口----------");
|
|
|
- try {
|
|
|
- AppPayPublicCreateOrderVo pay = new AppPayPublicCreateOrderVo();
|
|
|
- String splitCode = payOrderMapper.findShopOrderSplitCode(heliDto.getShopOrderId());
|
|
|
- if (StringUtils.isBlank(splitCode)) {
|
|
|
- return ResponseJson.error("子订单无商户号!", null);
|
|
|
- }
|
|
|
- pay.setP3_customerNumber(splitCode);
|
|
|
- //合利宝主扫接口参数赋值
|
|
|
- heliPayUtil.setOnlineValue(pay, heliDto, "order", headers);
|
|
|
- if ("GZH".equals(heliDto.getPayType()) || "XCX".equals(heliDto.getPayType())) {
|
|
|
- //公众号/小程序
|
|
|
- String openId = getOpenId(heliDto, headers);
|
|
|
- if (StringUtils.isEmpty(openId)) {
|
|
|
- return ResponseJson.error("微信openId获取失败", null);
|
|
|
- }
|
|
|
- pay.setP8_openid(openId);
|
|
|
+ AppPayPublicCreateOrderVo pay = new AppPayPublicCreateOrderVo();
|
|
|
+ String splitCode = payOrderMapper.findShopOrderSplitCode(heliDto.getShopOrderId());
|
|
|
+ if (StringUtils.isBlank(splitCode)) {
|
|
|
+ return ResponseJson.error("子订单无商户号!", null);
|
|
|
+ }
|
|
|
+ pay.setP3_customerNumber(splitCode);
|
|
|
+ //合利宝主扫接口参数赋值
|
|
|
+ heliPayUtil.setOnlineValue(pay, heliDto, "order", headers);
|
|
|
+ if ("GZH".equals(heliDto.getPayType()) || "XCX".equals(heliDto.getPayType())) {
|
|
|
+ //公众号/小程序
|
|
|
+ String openId = getOpenId(heliDto, headers);
|
|
|
+ if (StringUtils.isEmpty(openId)) {
|
|
|
+ return ResponseJson.error("微信openId获取失败", null);
|
|
|
}
|
|
|
- Map<String, String> map = MyBeanUtils.convertBean(pay, new LinkedHashMap());
|
|
|
- String oriMessage = MyBeanUtils.getSignedByPresetParameter(map, AppPayPublicCreateOrderVo.NEED_SIGN_PARAMS);
|
|
|
- oriMessage += SPLIT + Constant.SAOMA;
|
|
|
- log.info("签名原文串:" + oriMessage);
|
|
|
- String sign = Disguiser.disguiseMD5(oriMessage.trim());
|
|
|
- log.info("签名串:" + sign);
|
|
|
- map.put("sign", sign);
|
|
|
- log.info("发送参数:" + map);
|
|
|
- Map<String, Object> resultMap = HttpClientService.getHttpResp(map, Constant.REQUEST_URL);
|
|
|
- log.info("响应结果:" + resultMap);
|
|
|
- if ((Integer) resultMap.get("statusCode") == HttpStatus.SC_OK) {
|
|
|
- String resultMsg = (String) resultMap.get("response");
|
|
|
- AppPayPublicOrderResponseVo orderResponseVo = JSONObject.parseObject(resultMsg, AppPayPublicOrderResponseVo.class);
|
|
|
- String assemblyRespOriSign = MyBeanUtils.getSignedByPresetParameter(orderResponseVo, AppPayPublicOrderResponseVo.NEED_SIGN_PARAMS);
|
|
|
- assemblyRespOriSign += Constant.SPLIT + Constant.SAOMA;
|
|
|
- log.info("组装返回结果签名串:" + assemblyRespOriSign);
|
|
|
- String responseSign = orderResponseVo.getSign();
|
|
|
- log.info("响应签名:" + responseSign);
|
|
|
- String checkSign = Disguiser.disguiseMD5(assemblyRespOriSign.trim());
|
|
|
- if (checkSign.equals(responseSign) && "0000".equals(orderResponseVo.getRt2_retCode())) {
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(resultMsg);
|
|
|
- return ResponseJson.success("请求成功", jsonObject);
|
|
|
- } else {
|
|
|
- return ResponseJson.error("请求参数有误", JSONObject.parseObject(resultMsg));
|
|
|
- }
|
|
|
+ pay.setP8_openid(openId);
|
|
|
+ }
|
|
|
+ Map<String, String> map = MyBeanUtils.convertBean(pay, new LinkedHashMap());
|
|
|
+ String oriMessage = MyBeanUtils.getSignedByPresetParameter(map, AppPayPublicCreateOrderVo.NEED_SIGN_PARAMS);
|
|
|
+ oriMessage += SPLIT + Constant.SAOMA;
|
|
|
+ log.info("签名原文串:" + oriMessage);
|
|
|
+ String sign = Disguiser.disguiseMD5(oriMessage.trim());
|
|
|
+ log.info("签名串:" + sign);
|
|
|
+ map.put("sign", sign);
|
|
|
+ log.info("发送参数:" + map);
|
|
|
+ Map<String, Object> resultMap = HttpClientService.getHttpResp(map, Constant.REQUEST_URL);
|
|
|
+ log.info("响应结果:" + resultMap);
|
|
|
+ if ((Integer) resultMap.get("statusCode") == HttpStatus.SC_OK) {
|
|
|
+ String resultMsg = (String) resultMap.get("response");
|
|
|
+ AppPayPublicOrderResponseVo orderResponseVo = JSONObject.parseObject(resultMsg, AppPayPublicOrderResponseVo.class);
|
|
|
+ String assemblyRespOriSign = MyBeanUtils.getSignedByPresetParameter(orderResponseVo, AppPayPublicOrderResponseVo.NEED_SIGN_PARAMS);
|
|
|
+ assemblyRespOriSign += Constant.SPLIT + Constant.SAOMA;
|
|
|
+ log.info("组装返回结果签名串:" + assemblyRespOriSign);
|
|
|
+ String responseSign = orderResponseVo.getSign();
|
|
|
+ log.info("响应签名:" + responseSign);
|
|
|
+ String checkSign = Disguiser.disguiseMD5(assemblyRespOriSign.trim());
|
|
|
+ if (checkSign.equals(responseSign) && "0000".equals(orderResponseVo.getRt2_retCode())) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(resultMsg);
|
|
|
+ return ResponseJson.success("请求成功", jsonObject);
|
|
|
} else {
|
|
|
- return ResponseJson.error("请求失败", null);
|
|
|
+ return ResponseJson.error("请求参数有误", JSONObject.parseObject(resultMsg));
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("交易失败" + e);
|
|
|
- return ResponseJson.error("交易失败", null);
|
|
|
+ } else {
|
|
|
+ return ResponseJson.error("请求失败", null);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -213,14 +208,8 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
log.info("回调签名" + sign);
|
|
|
String oriMessage = MyBeanUtils.getSigned(res, null);
|
|
|
String oriMessage1 = oriMessage + SPLIT + Constant.SAOMA;
|
|
|
- String oriMessage2 = oriMessage + SPLIT + Constant.FENZHANG;
|
|
|
- String oriMessage3 = oriMessage + SPLIT + Constant.XUNI;
|
|
|
- String oriMessage4 = oriMessage + SPLIT + Constant.WANGYIN;
|
|
|
String checkSign1 = Disguiser.disguiseMD5(oriMessage1.trim());
|
|
|
- String checkSign2 = Disguiser.disguiseMD5(oriMessage2.trim());
|
|
|
- String checkSign3 = Disguiser.disguiseMD5(oriMessage3.trim());
|
|
|
- String checkSign4 = Disguiser.disguiseMD5(oriMessage4.trim());
|
|
|
- boolean b = sign.equals(checkSign1) || sign.equals(checkSign2) || sign.equals(checkSign3) || sign.equals(checkSign4);
|
|
|
+ boolean b = sign.equals(checkSign1);
|
|
|
if (!b) {
|
|
|
return "验签名失败!";
|
|
|
}
|
|
@@ -297,12 +286,14 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
}
|
|
|
// 更新付款次数
|
|
|
Integer paySuccessCounter = (null == order.getPaySuccessCounter()) ? 1 : order.getPaySuccessCounter() + 1;
|
|
|
+ Integer paySuccess = (null == shopOrder.getPaySuccessCounter()) ? 1 : shopOrder.getPaySuccessCounter() + 1;
|
|
|
+ shopOrder.setPaySuccessCounter(paySuccess);
|
|
|
order.setPaySuccessCounter(paySuccessCounter);
|
|
|
order.setUpdateDate(curDateStr);
|
|
|
// 更新订单支付状态
|
|
|
payOrderMapper.updateOrderStatus(order);
|
|
|
// 支付记录
|
|
|
- // todo子订单返佣????
|
|
|
+ //todo sql的or条件子订单返佣????
|
|
|
List<DiscernReceiptVo> shopOrderDiscernReceiptList = orderCommonMapper.getShopOrderDiscernReceipt(shopOrderId);
|
|
|
double shopOrderReceiptAmount = 0d;
|
|
|
if (null != shopOrderDiscernReceiptList && shopOrderDiscernReceiptList.size() > 0) {
|
|
@@ -317,13 +308,7 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
} else {
|
|
|
shopOrder.setReceiptStatus(2);
|
|
|
}
|
|
|
-
|
|
|
- //todo 修改子订单支付链接状态
|
|
|
- OrderPayLinkVo orderPayLink = payOrderMapper.getOrderPayLink(orderId, amount);
|
|
|
- if (null != orderPayLink && ("12".equals(payType) || "17".equals(payType))) {
|
|
|
- orderPayLink.setPayStatus(1);
|
|
|
- payOrderMapper.updateOrderPayLinkStatus(orderPayLink);
|
|
|
- }
|
|
|
+ payOrderMapper.updateShopOrder(shopOrder);
|
|
|
// 保存收款记录
|
|
|
DiscernReceiptPo discernReceipt = new DiscernReceiptPo();
|
|
|
discernReceipt.setPayWay(1);
|
|
@@ -357,52 +342,52 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
baseMapper.insertOrderReceiptRelation(relation);
|
|
|
log.info("【支付异步回调】>>>>>>>>>>>收款项和订单关系(insert[cm_receipt_order_relation])id:" + relation.getId() + ",orderId:" + orderId);
|
|
|
|
|
|
+ //当前版本无法线上走充值/订金订单
|
|
|
// 商品数据
|
|
|
- List<OrderProductVo> orderProductList = orderCommonMapper.getOrderProductByOrderId(orderId);
|
|
|
- // todo 当前版本无法线上走订金订单
|
|
|
+// List<OrderProductVo> orderProductList = orderCommonMapper.getOrderProductByOrderId(orderId);
|
|
|
// 判断是否是充值商品
|
|
|
- int rechargeFlag = 0;
|
|
|
- // 缴纳订金订单
|
|
|
- int[] productId1 = {6060, 6061, 6062, 6063, 6064};
|
|
|
- // 充值余额订单
|
|
|
- int[] productId2 = {6065, 6066, 6067, 6068, 6069};
|
|
|
- for (OrderProductVo product : orderProductList) {
|
|
|
- if (ArrayUtils.contains(productId1, product.getProductId())) {
|
|
|
- rechargeFlag = 1;
|
|
|
- break;
|
|
|
- }
|
|
|
- if (ArrayUtils.contains(productId2, product.getProductId())) {
|
|
|
- rechargeFlag = 2;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (rechargeFlag > 0) {
|
|
|
- // 账户余额
|
|
|
- double oldUserMoney = baseMapper.getUserMoney(order.getUserId());
|
|
|
- double userMoney = MathUtil.add(oldUserMoney, amount).doubleValue();
|
|
|
- // 可用余额
|
|
|
- Double oldAvailableMoney = baseMapper.getAbleUserMoney(order.getUserId());
|
|
|
- double availableMoney = MathUtil.add(oldAvailableMoney, amount).doubleValue();
|
|
|
- payOrderMapper.updateMoneyByUserId(userMoney, availableMoney, order.getUserId());
|
|
|
- log.info("【支付异步回调】>>>>>>>>>>>更新用户余额(update[user])userId:" + order.getUserId() + ",orderId:" + orderId);
|
|
|
- //保存余额到余额收支记录
|
|
|
- BalanceRecordPo balanceRecord = new BalanceRecordPo();
|
|
|
- balanceRecord.setUserId(order.getUserId());
|
|
|
- balanceRecord.setType(1);
|
|
|
- if (rechargeFlag == 1) {
|
|
|
- balanceRecord.setBalanceType(6);
|
|
|
- } else {
|
|
|
- balanceRecord.setBalanceType(7);
|
|
|
- }
|
|
|
- balanceRecord.setAddDate(new Date());
|
|
|
- balanceRecord.setAmount(amount);
|
|
|
- balanceRecord.setOrderId(orderId);
|
|
|
- balanceRecord.setRemark("订单商品充值余额");
|
|
|
- balanceRecord.setDelFlag(0);
|
|
|
- // 保存 余额收支记录
|
|
|
- baseMapper.insertBalanceRecord(balanceRecord);
|
|
|
- log.info("【支付异步回调】>>>>>>>>>>>>>>>>>>>>>>>>>>订单商品充值余额(insert[cm_user_balance_record])orderId:" + orderId);
|
|
|
- }
|
|
|
+// int rechargeFlag = 0;
|
|
|
+// // 缴纳订金订单
|
|
|
+// int[] productId1 = {6060, 6061, 6062, 6063, 6064};
|
|
|
+// // 充值余额订单
|
|
|
+// int[] productId2 = {6065, 6066, 6067, 6068, 6069};
|
|
|
+// for (OrderProductVo product : orderProductList) {
|
|
|
+// if (ArrayUtils.contains(productId1, product.getProductId())) {
|
|
|
+// rechargeFlag = 1;
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// if (ArrayUtils.contains(productId2, product.getProductId())) {
|
|
|
+// rechargeFlag = 2;
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if (rechargeFlag > 0) {
|
|
|
+// // 账户余额
|
|
|
+// double oldUserMoney = baseMapper.getUserMoney(order.getUserId());
|
|
|
+// double userMoney = MathUtil.add(oldUserMoney, amount).doubleValue();
|
|
|
+// // 可用余额
|
|
|
+// Double oldAvailableMoney = baseMapper.getAbleUserMoney(order.getUserId());
|
|
|
+// double availableMoney = MathUtil.add(oldAvailableMoney, amount).doubleValue();
|
|
|
+// payOrderMapper.updateMoneyByUserId(userMoney, availableMoney, order.getUserId());
|
|
|
+// log.info("【支付异步回调】>>>>>>>>>>>更新用户余额(update[user])userId:" + order.getUserId() + ",orderId:" + orderId);
|
|
|
+// //保存余额到余额收支记录
|
|
|
+// BalanceRecordPo balanceRecord = new BalanceRecordPo();
|
|
|
+// balanceRecord.setUserId(order.getUserId());
|
|
|
+// balanceRecord.setType(1);
|
|
|
+// if (rechargeFlag == 1) {
|
|
|
+// balanceRecord.setBalanceType(6);
|
|
|
+// } else {
|
|
|
+// balanceRecord.setBalanceType(7);
|
|
|
+// }
|
|
|
+// balanceRecord.setAddDate(new Date());
|
|
|
+// balanceRecord.setAmount(amount);
|
|
|
+// balanceRecord.setOrderId(orderId);
|
|
|
+// balanceRecord.setRemark("订单商品充值余额");
|
|
|
+// balanceRecord.setDelFlag(0);
|
|
|
+// // 保存 余额收支记录
|
|
|
+// baseMapper.insertBalanceRecord(balanceRecord);
|
|
|
+// log.info("【支付异步回调】>>>>>>>>>>>>>>>>>>>>>>>>>>订单商品充值余额(insert[cm_user_balance_record])orderId:" + orderId);
|
|
|
+// }
|
|
|
|
|
|
// 线上支付与自主下单送豆(已全部收款),最后一笔线上支付成功后,赠送200采美豆
|
|
|
if (3 == order.getReceiptStatus() && 0 == order.getSecondHandOrderFlag()) {
|
|
@@ -482,7 +467,7 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
public ResponseJson<String> link(HeliDto heliDto, HttpHeaders headers) {
|
|
|
log.info("--------进入线上支付接口----------");
|
|
|
// 订单信息
|
|
|
- OrderVo order = orderCommonMapper.getOrderByOrderId(heliDto.getOrderId());
|
|
|
+ OrderVo order = orderCommonMapper.getOrderByShopOrderId(heliDto.getShopOrderId());
|
|
|
if (null == order) {
|
|
|
log.error("订单不存在");
|
|
|
return ResponseJson.error("订单不存在");
|
|
@@ -521,6 +506,7 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
if (StringUtils.isBlank(splitCode)) {
|
|
|
return ResponseJson.error("子订单无商户号!", null);
|
|
|
}
|
|
|
+ heliOnlineVo.setP3_customerNumber(splitCode);
|
|
|
heliPayUtil.setLinkValue(heliOnlineVo, heliDto, "order", headers);
|
|
|
Map<String, String> map = MyBeanUtils.convertBean(heliOnlineVo, new LinkedHashMap());
|
|
|
String oriMessage = MyBeanUtils.getSignedByPresetParameter(map, HeliOnlineVo.NEED_SIGN_PARAMS);
|
|
@@ -851,69 +837,71 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
|
|
|
//银行通道码获取
|
|
|
@Override
|
|
|
- public ResponseJson<JSONObject> bankCode() {
|
|
|
- List<BankCodeVo> banks = payOrderMapper.findBankCode();
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("list", banks);
|
|
|
- return ResponseJson.success("获取成功", jsonObject);
|
|
|
+ public ResponseJson<Map<String, Object>> bankCode() {
|
|
|
+ List<BankCodeVo> B2B = payOrderMapper.findB2BBankCode();
|
|
|
+ List<BankCodeVo> B2C = payOrderMapper.findB2CBankCode();
|
|
|
+ Map<String, Object> banks = new HashMap<>(2);
|
|
|
+ banks.put("B2B", B2B);
|
|
|
+ banks.put("B2C", B2C);
|
|
|
+ return ResponseJson.success("获取成功", banks);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResponseJson<JSONObject> getPayOrderResult(String mbOrderId) {
|
|
|
+ public ResponseJson<JSONObject> getPayOrderResult(String mbOrderId, Integer orderFlag, Integer shopOrderId) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
|
|
|
log.info("--------进入交易订单查询接口----------");
|
|
|
+ //区分网银和其他产品
|
|
|
QueryOrderVo queryOrderVo = new QueryOrderVo();
|
|
|
queryOrderVo.setP1_bizType("AppPayQuery");
|
|
|
queryOrderVo.setP2_orderId(mbOrderId);
|
|
|
- //todo 换收款账户
|
|
|
- queryOrderVo.setP3_customerNumber(Constant.CUSTOMERNUM2);
|
|
|
- try {
|
|
|
- Map<String, String> map = MyBeanUtils.convertBean(queryOrderVo, new LinkedHashMap());
|
|
|
- String oriMessage = MyBeanUtils.getSignedByPresetParameter(map, QueryOrderVo.NEED_SIGN_PARAMS);
|
|
|
- //区分网银和其他产品
|
|
|
- String payType = baseMapper.findType(mbOrderId);
|
|
|
- if ("12".equals(payType) || "17".equals(payType)) {
|
|
|
- oriMessage += Constant.SPLIT + Constant.WANGYIN;
|
|
|
- } else {
|
|
|
- oriMessage += Constant.SPLIT + Constant.SAOMA;
|
|
|
+ if (0 == orderFlag) {
|
|
|
+ queryOrderVo.setP3_customerNumber(Constant.CUSTOMERNUM);
|
|
|
+ } else {
|
|
|
+ if (null == shopOrderId) {
|
|
|
+ return ResponseJson.error("子订单Id不能为空!", null);
|
|
|
}
|
|
|
- log.info("签名原文串:" + oriMessage);
|
|
|
- String sign = Disguiser.disguiseMD5(oriMessage.trim());
|
|
|
- log.info("签名串:" + sign);
|
|
|
- map.put("sign", sign);
|
|
|
- log.info("发送参数:" + map);
|
|
|
- Map<String, Object> resultMap = HttpClientService.getHttpResp(map, Constant.REQUEST_URL);
|
|
|
- log.info("响应结果:" + resultMap);
|
|
|
- if ((Integer) resultMap.get("statusCode") == HttpStatus.SC_OK) {
|
|
|
- String resultMsg = (String) resultMap.get("response");
|
|
|
- QueryOrderResponseVo queryOrderResponseVo = JSONObject.parseObject(resultMsg, QueryOrderResponseVo.class);
|
|
|
- String assemblyRespOriSign = MyBeanUtils.getSignedByPresetParameter(queryOrderResponseVo, QueryOrderResponseVo.NEED_SIGN_PARAMS);
|
|
|
- log.info("组装返回结果签名串:" + assemblyRespOriSign);
|
|
|
- if ("12".equals(payType) || "17".equals(payType)) {
|
|
|
- assemblyRespOriSign += Constant.SPLIT + Constant.WANGYIN;
|
|
|
- } else {
|
|
|
- assemblyRespOriSign += Constant.SPLIT + Constant.SAOMA;
|
|
|
- }
|
|
|
- String responseSign = queryOrderResponseVo.getSign();
|
|
|
- log.info("响应签名:" + responseSign);
|
|
|
- String checkSign = Disguiser.disguiseMD5(assemblyRespOriSign.trim());
|
|
|
- if (checkSign.equals(responseSign)) {
|
|
|
- if ("0000".equals(queryOrderResponseVo.getRt2_retCode())) {
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(resultMsg, JSONObject.class);
|
|
|
- return ResponseJson.success("查询成功", jsonObject);
|
|
|
- } else {
|
|
|
- return ResponseJson.error("验签失败", null);
|
|
|
- }
|
|
|
+ String splitCode = payOrderMapper.getSplitCodeByShopOrderId(shopOrderId);
|
|
|
+ if (null == splitCode) {
|
|
|
+ return ResponseJson.error("订单信息不正确!", null);
|
|
|
+ }
|
|
|
+ queryOrderVo.setP3_customerNumber(splitCode);
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, String> map = MyBeanUtils.convertBean(queryOrderVo, new LinkedHashMap());
|
|
|
+ String oriMessage = MyBeanUtils.getSignedByPresetParameter(map, QueryOrderVo.NEED_SIGN_PARAMS);
|
|
|
+ oriMessage += Constant.SPLIT + Constant.SAOMA;
|
|
|
+ log.info("签名原文串:" + oriMessage);
|
|
|
+ String sign = Disguiser.disguiseMD5(oriMessage.trim());
|
|
|
+ log.info("md5加密签名串:" + sign);
|
|
|
+ map.put("sign", sign);
|
|
|
+ log.info("发送参数:" + map);
|
|
|
+ Map<String, Object> resultMap = HttpClientService.getHttpResp(map, Constant.REQUEST_URL);
|
|
|
+ log.info("响应结果:" + resultMap);
|
|
|
+ if ((Integer) resultMap.get("statusCode") == HttpStatus.SC_OK) {
|
|
|
+ String resultMsg = (String) resultMap.get("response");
|
|
|
+ QueryOrderResponseVo queryOrderResponseVo = JSONObject.parseObject(resultMsg, QueryOrderResponseVo.class);
|
|
|
+ String assemblyRespOriSign = MyBeanUtils.getSignedByPresetParameter(queryOrderResponseVo, QueryOrderResponseVo.NEED_SIGN_PARAMS);
|
|
|
+ log.info("组装返回结果签名串:" + assemblyRespOriSign);
|
|
|
+ assemblyRespOriSign += Constant.SPLIT + Constant.SAOMA;
|
|
|
+ String responseSign = queryOrderResponseVo.getSign();
|
|
|
+ log.info("响应签名:" + responseSign);
|
|
|
+ String checkSign = Disguiser.disguiseMD5(assemblyRespOriSign.trim());
|
|
|
+ if (checkSign.equals(responseSign)) {
|
|
|
+ if ("0000".equals(queryOrderResponseVo.getRt2_retCode())) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(resultMsg, JSONObject.class);
|
|
|
+ return ResponseJson.success("查询成功", jsonObject);
|
|
|
} else {
|
|
|
return ResponseJson.error("验签失败", null);
|
|
|
}
|
|
|
} else {
|
|
|
- return ResponseJson.error("查询失败", null);
|
|
|
+ return ResponseJson.error("验签失败", null);
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
+ } else {
|
|
|
return ResponseJson.error("查询失败", null);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public String unionCallback(UnionResVo res) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
|
|
|
log.info("******************** 网银支付异步回调 start *******************");
|
|
@@ -946,11 +934,17 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
Integer orderId = Integer.valueOf(split[0]);
|
|
|
//1位置支付类型
|
|
|
String payType = split[1];
|
|
|
+ //2位置子订单id
|
|
|
+ Integer shopOrderId = Integer.valueOf(split[2]);
|
|
|
// 订单信息
|
|
|
OrderVo order = orderCommonMapper.getOrderByOrderId(orderId);
|
|
|
+ ShopOrderVo shopOrder = orderCommonMapper.getShopOrderByOrderId(shopOrderId);
|
|
|
if (null == order) {
|
|
|
return "订单不存在";
|
|
|
}
|
|
|
+ if (null == shopOrder) {
|
|
|
+ return "子订单不存在";
|
|
|
+ }
|
|
|
// 支付记录
|
|
|
List<DiscernReceiptVo> discernReceiptList = orderCommonMapper.getDiscernReceipt(order.getOrderId(), order.getShopOrderIds());
|
|
|
double receiptAmount = 0d;
|
|
@@ -1007,6 +1001,23 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
orderPayLink.setPayStatus(1);
|
|
|
payOrderMapper.updateOrderPayLinkStatus(orderPayLink);
|
|
|
}
|
|
|
+ // 支付记录
|
|
|
+ //todo 子订单返佣????
|
|
|
+ List<DiscernReceiptVo> shopOrderDiscernReceiptList = orderCommonMapper.getShopOrderDiscernReceipt(shopOrderId);
|
|
|
+ double shopOrderReceiptAmount = 0d;
|
|
|
+ if (null != shopOrderDiscernReceiptList && shopOrderDiscernReceiptList.size() > 0) {
|
|
|
+ for (DiscernReceiptVo discernReceipt : shopOrderDiscernReceiptList) {
|
|
|
+ shopOrderReceiptAmount = MathUtil.add(shopOrderReceiptAmount, discernReceipt.getAssociateAmount()).doubleValue();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ shopOrder.setReceiptAmount(MathUtil.add(shopOrderReceiptAmount, amount).doubleValue());
|
|
|
+ //均摊后needpay:已支付
|
|
|
+ if (MathUtil.compare(shopOrder.getRealPay(), shopOrder.getReceiptAmount()) == 0) {
|
|
|
+ shopOrder.setReceiptStatus(3);
|
|
|
+ } else {
|
|
|
+ shopOrder.setReceiptStatus(2);
|
|
|
+ }
|
|
|
+ payOrderMapper.updateShopOrder(shopOrder);
|
|
|
// 保存收款记录
|
|
|
DiscernReceiptPo discernReceipt = new DiscernReceiptPo();
|
|
|
discernReceipt.setPayWay(1);
|
|
@@ -1035,55 +1046,11 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
relation.setSplitStatus(0);
|
|
|
relation.setRelationType(2);
|
|
|
relation.setDelFlag(0);
|
|
|
+ relation.setShopOrderId(shopOrderId);
|
|
|
// 保存 收款项和订单关系
|
|
|
baseMapper.insertOrderReceiptRelation(relation);
|
|
|
log.info("【支付异步回调】>>>>>>>>>>>收款项和订单关系(insert[cm_receipt_order_relation])id:" + relation.getId() + ",orderId:" + orderId);
|
|
|
|
|
|
- // 商品数据
|
|
|
- List<OrderProductVo> orderProductList = orderCommonMapper.getOrderProductByOrderId(orderId);
|
|
|
- // 判断是否是充值商品
|
|
|
- int rechargeFlag = 0;
|
|
|
- // 缴纳订金订单
|
|
|
- int[] productId1 = {6060, 6061, 6062, 6063, 6064};
|
|
|
- // 充值余额订单
|
|
|
- int[] productId2 = {6065, 6066, 6067, 6068, 6069};
|
|
|
- for (OrderProductVo product : orderProductList) {
|
|
|
- if (ArrayUtils.contains(productId1, product.getProductId())) {
|
|
|
- rechargeFlag = 1;
|
|
|
- break;
|
|
|
- }
|
|
|
- if (ArrayUtils.contains(productId2, product.getProductId())) {
|
|
|
- rechargeFlag = 2;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (rechargeFlag > 0) {
|
|
|
- // 账户余额
|
|
|
- double oldUserMoney = baseMapper.getUserMoney(order.getUserId());
|
|
|
- double userMoney = MathUtil.add(oldUserMoney, amount).doubleValue();
|
|
|
- // 可用余额
|
|
|
- Double oldAvailableMoney = baseMapper.getAbleUserMoney(order.getUserId());
|
|
|
- double availableMoney = MathUtil.add(oldAvailableMoney, amount).doubleValue();
|
|
|
- payOrderMapper.updateMoneyByUserId(userMoney, availableMoney, order.getUserId());
|
|
|
- log.info("【支付异步回调】>>>>>>>>>>>更新用户余额(update[user])userId:" + order.getUserId() + ",orderId:" + orderId);
|
|
|
- //保存余额到余额收支记录
|
|
|
- BalanceRecordPo balanceRecord = new BalanceRecordPo();
|
|
|
- balanceRecord.setUserId(order.getUserId());
|
|
|
- balanceRecord.setType(1);
|
|
|
- if (rechargeFlag == 1) {
|
|
|
- balanceRecord.setBalanceType(6);
|
|
|
- } else {
|
|
|
- balanceRecord.setBalanceType(7);
|
|
|
- }
|
|
|
- balanceRecord.setAddDate(new Date());
|
|
|
- balanceRecord.setAmount(amount);
|
|
|
- balanceRecord.setOrderId(orderId);
|
|
|
- balanceRecord.setRemark("订单商品充值余额");
|
|
|
- balanceRecord.setDelFlag(0);
|
|
|
- // 保存 余额收支记录
|
|
|
- baseMapper.insertBalanceRecord(balanceRecord);
|
|
|
- log.info("【支付异步回调】>>>>>>>>>>>>>>>>>>>>>>>>>>订单商品充值余额(insert[cm_user_balance_record])orderId:" + orderId);
|
|
|
- }
|
|
|
// 线上支付与自主下单送豆(已全部收款),最后一笔线上支付成功后,赠送200采美豆
|
|
|
if (3 == order.getReceiptStatus() && 0 == order.getSecondHandOrderFlag()) {
|
|
|
UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
|
|
@@ -1158,6 +1125,110 @@ public class HeliPayServiceImpl implements HeliPayService {
|
|
|
return "SUCCESS";
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ResponseJson<List<ShopOrderVo>> getShopOrders(Integer orderId) {
|
|
|
+ String shopOrderId = baseMapper.findShopOrderIds(orderId);
|
|
|
+ // 子订单
|
|
|
+ if (StringUtils.isBlank(shopOrderId)) {
|
|
|
+ return ResponseJson.error("子订单为空!", null);
|
|
|
+ }
|
|
|
+ String[] shopOrderIdArr = shopOrderId.split(",");
|
|
|
+ List<String> shopOrderIds = Arrays.asList(shopOrderIdArr);
|
|
|
+ List<ShopOrderVo> shopOrderList = orderCommonMapper.getShopOrderList(shopOrderIds);
|
|
|
+ shopOrderList.forEach(shopOrder -> {
|
|
|
+ // 店铺促销活动
|
|
|
+ PromotionsVo shopPromotion = null;
|
|
|
+ if (null != shopOrder.getOrderPromotionsId() && shopOrder.getOrderPromotionsId() > 0) {
|
|
|
+ shopPromotion = orderCommonMapper.getOrderPromotionsById(shopOrder.getOrderPromotionsId());
|
|
|
+ shopOrder.setShopPromotion(shopPromotion);
|
|
|
+ }
|
|
|
+ List<OrderProductVo> orderProductList = orderCommonMapper.getShopOrderProduct(shopOrder.getShopOrderId());
|
|
|
+ orderProductList.removeIf(Objects::isNull);
|
|
|
+ orderProductList.forEach(orderProduct -> {
|
|
|
+ // 不含税可开票商品,单价/折后单价在原基础上加上税费
|
|
|
+ boolean taxFlag = (Integer.valueOf(0).equals(orderProduct.getIncludedTax()) && (Integer.valueOf(1).equals(orderProduct.getInvoiceType()) || Integer.valueOf(2).equals(orderProduct.getInvoiceType())));
|
|
|
+ if (taxFlag) {
|
|
|
+ Double valueTax = MathUtil.div(MathUtil.mul(orderProduct.getPrice(), orderProduct.getTaxRate()), 100).doubleValue();
|
|
|
+ orderProduct.setPrice(MathUtil.add(orderProduct.getPrice(), valueTax).doubleValue());
|
|
|
+ orderProduct.setDiscountPrice(MathUtil.add(orderProduct.getDiscountPrice(), orderProduct.getAddedValueTax()).doubleValue());
|
|
|
+ }
|
|
|
+ orderProduct.setImage(ImageUtil.getImageUrl("product", orderProduct.getImage(), domain));
|
|
|
+ // 查询订单下商品的促销活动
|
|
|
+ if (null != orderProduct.getOrderPromotionsId() && orderProduct.getOrderPromotionsId() > 0) {
|
|
|
+ PromotionsVo promotions = orderCommonMapper.getOrderPromotionsById(orderProduct.getOrderPromotionsId());
|
|
|
+ if (null != promotions) {
|
|
|
+ if (taxFlag && Integer.valueOf(1).equals(promotions.getType()) && Integer.valueOf(1).equals(promotions.getMode())) {
|
|
|
+ promotions.setTouchPrice(MathUtil.add(promotions.getTouchPrice(), MathUtil.div(MathUtil.mul(promotions.getTouchPrice(), orderProduct.getTaxRate()), 100)).doubleValue());
|
|
|
+ }
|
|
|
+ orderProduct.setProductPromotion(promotions);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 超级会员优惠商品设置优惠标签
|
|
|
+ if (null != orderProduct.getSvipPriceFlag() && 1 == orderProduct.getSvipPriceFlag()) {
|
|
|
+ if (1 == orderProduct.getSvipPriceType()) {
|
|
|
+ orderProduct.setSvipPriceTag(MathUtil.div(orderProduct.getSvipDiscount(), 10, 1) + "折");
|
|
|
+ } else if (2 == orderProduct.getSvipPriceType()) {
|
|
|
+ orderProduct.setSvipPriceTag("¥" + orderProduct.getDiscountPrice());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ shopOrder.setObligation(MathUtil.sub(shopOrder.getRealPay(), shopOrder.getReceiptAmount()).doubleValue());
|
|
|
+ if(998==shopOrder.getShopId()){
|
|
|
+ shopOrder.setObligation(shopOrder.getTotalAmount());
|
|
|
+ }
|
|
|
+ shopOrder.setOrderProductList(orderProductList);
|
|
|
+ shopOrder.setShopLogo(ImageUtil.getImageUrl("shopLogo", shopOrder.getShopLogo(), domain));
|
|
|
+ });
|
|
|
+ return ResponseJson.success(shopOrderList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResponseJson<JSONObject> getUnionResult(String mbOrderId, Integer orderFlag, Integer shopOrderId) {
|
|
|
+ String customerNumber = "";
|
|
|
+ if (0 == orderFlag) {
|
|
|
+ customerNumber = Constant.CUSTOMERNUM;
|
|
|
+ } else {
|
|
|
+ if (null == shopOrderId) {
|
|
|
+ return ResponseJson.error("子订单Id不能为空!", null);
|
|
|
+ }
|
|
|
+ String splitCode = payOrderMapper.getSplitCodeByShopOrderId(shopOrderId);
|
|
|
+ if (null == splitCode) {
|
|
|
+ return ResponseJson.error("订单信息不正确!", null);
|
|
|
+ }
|
|
|
+ customerNumber = splitCode;
|
|
|
+ }
|
|
|
+ Map<String, String> sPara = new HashMap<String, String>();
|
|
|
+ sPara.put("P1_bizType", "OnlineQuery");
|
|
|
+ sPara.put("P2_orderId", mbOrderId);
|
|
|
+ sPara.put("P3_customerNumber", customerNumber);
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ sb.append("&").append("OnlineQuery").append("&").append(mbOrderId).append("&")
|
|
|
+ .append(customerNumber).append("&").append(WANGYIN);
|
|
|
+ String sign = Disguiser.disguiseMD5(sb.toString());
|
|
|
+ sPara.put("sign", sign);
|
|
|
+ try {
|
|
|
+ OnlineCheckVo on = OnlinePostFormUtil.postForm(sPara, YL, sign, OnlineCheckVo.class);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(on), JSONObject.class);
|
|
|
+ if (!"0000".equals(on.getRt2_retCode())) {
|
|
|
+ log.info("查询失败:" + on.toString());
|
|
|
+ return ResponseJson.error("查询失败", jsonObject);
|
|
|
+ } else {
|
|
|
+ String assemblyRespOriSign = MyBeanUtils.getSignedByPresetParameter(on, OnlineCheckVo.NEED_SIGN_PARAMS);
|
|
|
+ log.info("组装返回结果签名串:" + assemblyRespOriSign);
|
|
|
+ assemblyRespOriSign += Constant.SPLIT + WANGYIN;
|
|
|
+ String checkSign = Disguiser.disguiseMD5(assemblyRespOriSign.trim());
|
|
|
+ if (!checkSign.equals(on.getSign())) {
|
|
|
+ return ResponseJson.error("验签失败", jsonObject);
|
|
|
+ } else {
|
|
|
+ return ResponseJson.success("查询成功", jsonObject);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
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()) {
|