* 'dev' of http://139.159.177.244:3000/hurui/hai-server:
  提交代码
  提交代码
dev-discount
袁野 3 years ago
commit 336b4fbfd5
  1. 2
      hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java
  2. 2
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java
  3. 2
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  4. 106
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java

@ -113,7 +113,7 @@ public interface OutRechargeOrderService {
* 汇联通支付 * 汇联通支付
* @param orderId * @param orderId
*/ */
void hltUnionCardPay(Long userCardId, Long orderId); void hltUnionCardPay(Long userCardId, Long orderId) throws Exception;
/** /**
* 积分支付 * 积分支付

@ -429,7 +429,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
} }
HighCouponCode couponCode = codeList.get(0); HighCouponCode couponCode = codeList.get(0);
couponCode.setIsAssignAgent(true); couponCode.setIsAssignAgent(true);
couponCode.setAgentId(couponCode.getAgentId()); couponCode.setAgentId(convertCode.getAgentId());
couponCode.setReceiveTime(new Date()); couponCode.setReceiveTime(new Date());
couponCode.setStatus(2); couponCode.setStatus(2);
highCouponCodeService.updateCouponCode(couponCode); highCouponCodeService.updateCouponCode(couponCode);

@ -450,7 +450,7 @@ public class HighOrderServiceImpl implements HighOrderService {
} }
JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data")); JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data"));
if (consumptionResult.getBoolean("success") != true) { if (consumptionResult.getBoolean("success") != true) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "交易失败!"+consumptionResult.getString("message")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message"));
} }
// 查询用户 // 查询用户

@ -264,62 +264,58 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
} }
@Override @Override
public void hltUnionCardPay(Long userCardId, Long orderId) { public void hltUnionCardPay(Long userCardId, Long orderId) throws Exception {
try { HighUserCard userCard = highUserCardService.getDetailById(userCardId);
HighUserCard userCard = highUserCardService.getDetailById(userCardId); if(userCard == null) {
if(userCard == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户绑定的卡号信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户绑定的卡号信息"); }
} OutRechargeOrder order = findByOrderId(orderId);
OutRechargeOrder order = findByOrderId(orderId); if (order == null) {
if (order == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单信息"); }
}
String goodsDesc = "充值话费";
String goodsDesc = "充值话费"; String tranDesc = order.getRechargeContent() + "充值" + order.getPayPrice() +"元话费";
String tranDesc = order.getRechargeContent() + "充值" + order.getPayPrice() +"元话费"; String instCode = "11101290";
String instCode = "11101290"; String businessType = "hisen_consume";
String businessType = "hisen_consume";
// 工会卡支付
// 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(order.getOrderNo(), userCard.getCardNo(), order.getPayPrice(), businessType, instCode, goodsDesc, tranDesc);
JSONObject consumption = HuiLianTongUnionCardConfig.consumption(order.getOrderNo(), userCard.getCardNo(), order.getPayPrice(), businessType, instCode, goodsDesc, tranDesc); System.out.println("工会卡支付响应参数" + consumption.toJSONString());
System.out.println("工会卡支付响应参数" + consumption.toJSONString());
Map<String,Object> dataMap = new HashMap<>();
Map<String,Object> dataMap = new HashMap<>(); dataMap.put("orderNo", order.getOrderNo());
dataMap.put("orderNo", order.getOrderNo()); dataMap.put("cardType", "ghk");
dataMap.put("cardType", "ghk"); dataMap.put("cardNo", userCard.getCardNo());
dataMap.put("cardNo", userCard.getCardNo()); dataMap.put("checkPassword", "N");
dataMap.put("checkPassword", "N"); dataMap.put("tranAmount", order.getPayPrice());
dataMap.put("tranAmount", order.getPayPrice()); dataMap.put("tranChannel", "HiSen");
dataMap.put("tranChannel", "HiSen"); dataMap.put("businessType", businessType);
dataMap.put("businessType", businessType); dataMap.put("instCode", instCode);
dataMap.put("instCode", instCode); dataMap.put("goodsDesc", goodsDesc);
dataMap.put("goodsDesc", goodsDesc); dataMap.put("tranDesc", tranDesc);
dataMap.put("tranDesc", tranDesc); HighGasOrderPush payPush = new HighGasOrderPush();
HighGasOrderPush payPush = new HighGasOrderPush(); payPush.setType(OrderPushType.type5.getType());
payPush.setType(OrderPushType.type5.getType()); payPush.setOrderNo(userCard.getCardNo());
payPush.setOrderNo(userCard.getCardNo()); payPush.setCreateTime(new Date());
payPush.setCreateTime(new Date()); payPush.setCode(consumption.getString("respCode"));
payPush.setCode(consumption.getString("respCode")); payPush.setRequestContent(JSON.toJSONString(dataMap));
payPush.setRequestContent(JSON.toJSONString(dataMap)); payPush.setReturnContent(consumption.toJSONString());
payPush.setReturnContent(consumption.toJSONString()); highGasOrderPushMapper.insert(payPush);
highGasOrderPushMapper.insert(payPush);
if(!consumption.getString("respCode").equals("0000")) {
if(!consumption.getString("respCode").equals("0000")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage"));
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage"));
}
JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data"));
if (consumptionResult.getBoolean("success") != true) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "交易失败!"+consumptionResult.getString("message"));
}
order.setPaySerialNo(consumptionResult.getString("orderId")); // 支付流水号
order.setPayRealPrice(order.getPayPrice()); // 实付金额
order.setStatus(2);
order.setPayType(2);
order.setPayTime(new Date()); // 支付时间
updateOrder(order);
} catch (Exception e) {
e.printStackTrace();
} }
JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data"));
if (consumptionResult.getBoolean("success") != true) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message"));
}
order.setPaySerialNo(consumptionResult.getString("orderId")); // 支付流水号
order.setPayRealPrice(order.getPayPrice()); // 实付金额
order.setStatus(2);
order.setPayType(2);
order.setPayTime(new Date()); // 支付时间
updateOrder(order);
} }
@Override @Override

Loading…
Cancel
Save