修复已知问

dev-discount
胡锐 3 years ago
parent b4e31c13cc
commit 2bed433655
  1. 2
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  2. 22
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  3. 2
      hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java
  4. 5
      hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java
  5. 10
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -144,7 +144,7 @@ public class HighOrderController {
if (coupon.getCouponSource() != 4) { if (coupon.getCouponSource() != 4) {
if (highCouponCodeService.getStockCountByCoupon(coupon.getId()) <= 0) { if (highCouponCodeService.getStockCountByCoupon(coupon.getId()) <= 0) {
log.error("HighOrderController --> addOrder() error!", "卡卷库存数量不足"); log.error("HighOrderController --> addOrder() error!", "卡卷库存数量不足");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_STOCK_INSUFFICIENT, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "系统维护中");
} }
} }
childOrder.setGoodsActualPrice(childOrder.getGoodsPrice()); childOrder.setGoodsActualPrice(childOrder.getGoodsPrice());

@ -9,10 +9,7 @@ import com.hai.common.exception.SysCode;
import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.XmlUtil;
import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.*; import com.hai.common.utils.*;
import com.hai.config.CommonSysConst; import com.hai.config.*;
import com.hai.config.HuiLianTongConfig;
import com.hai.config.QianZhuConfig;
import com.hai.config.TuanYouConfig;
import com.hai.dao.HighGasOrderPushMapper; import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantModel;
@ -296,7 +293,22 @@ public class HighTestController {
// 计算分账金额 手续费后的价格 * 0.01 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。 // 计算分账金额 手续费后的价格 * 0.01 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。
BigDecimal profitSharingAmount = price.multiply(rake).setScale(2,BigDecimal.ROUND_DOWN); BigDecimal profitSharingAmount = price.multiply(rake).setScale(2,BigDecimal.ROUND_DOWN);
this.wxProfitsharing(order.getPaySerialNo(),order.getOrderNo(),profitSharingAmount);*/ this.wxProfitsharing(order.getPaySerialNo(),order.getOrderNo(),profitSharingAmount);*/
return ResponseMsgUtil.success("分账成功");
// 获取token
JSONObject tokenObject = HuiLianTongConfig.getToken();
if (!tokenObject.getString("result").equals("success")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取token失败");
}
Map<String, Object> push = new HashMap<>();
push.put("token", tokenObject.getString("data"));
push.put("couTypeCode", "20JY000575");
push.put("distCouCount", 1);
push.put("userPhone", "13985049936");
push.put("thirdUserId", "oArhO6VXHf4hUENO2Mkwm6BAiy0A");
// 推送给高速
JSONObject returnParam = HuiLianTongConfig.couJointDist(tokenObject.getString("data"), "HF2021092316292686806","20JY000575", 1, "13985049936", "oArhO6VXHf4hUENO2Mkwm6BAiy0A");
return ResponseMsgUtil.success(returnParam);
} catch (Exception e) { } catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e); log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);

@ -104,7 +104,7 @@ public class HighCouponSchedule {
// 查询订单中的汇联通卡券全部已处理 // 查询订单中的汇联通卡券全部已处理
HighCouponCodeOtherExample otherExample = new HighCouponCodeOtherExample(); HighCouponCodeOtherExample otherExample = new HighCouponCodeOtherExample();
otherExample.createCriteria().andChildOrderIdEqualTo(couponCodeOther.getChildOrderId()).andStatusEqualTo(20).andTypeEqualTo(1); otherExample.createCriteria().andChildOrderIdEqualTo(couponCodeOther.getChildOrderId()).andStatusEqualTo(20).andTypeEqualTo(1);
if (highCouponCodeOtherMapper.selectByExample(example).size() == 0) { if (highCouponCodeOtherMapper.selectByExample(otherExample).size() == 0) {
highOrderService.childOrderComplete(couponCodeOther.getChildOrderId()); highOrderService.childOrderComplete(couponCodeOther.getChildOrderId());
} }
} }

@ -102,7 +102,7 @@ public class HuiLianTongUnionCardConfig {
* @return * @return
* @throws Exception * @throws Exception
*/ */
public static JSONObject consumption(String orderNo, String cardNo, BigDecimal tranAmount, String businessType, String goodsDesc, String tranDesc) throws Exception { public static JSONObject consumption(String orderNo, String cardNo, BigDecimal tranAmount, String businessType, String instCode,String goodsDesc, String tranDesc) throws Exception {
Map<String,Object> dataMap = new HashMap<>(); Map<String,Object> dataMap = new HashMap<>();
dataMap.put("orderNo", orderNo); dataMap.put("orderNo", orderNo);
dataMap.put("cardType", "ghk"); dataMap.put("cardType", "ghk");
@ -111,9 +111,10 @@ public class HuiLianTongUnionCardConfig {
dataMap.put("tranAmount", tranAmount); dataMap.put("tranAmount", tranAmount);
dataMap.put("tranChannel", "HiSen"); dataMap.put("tranChannel", "HiSen");
dataMap.put("businessType", businessType); dataMap.put("businessType", businessType);
dataMap.put("instCode", "11098222"); dataMap.put("instCode", instCode);
dataMap.put("goodsDesc", goodsDesc); dataMap.put("goodsDesc", goodsDesc);
dataMap.put("tranDesc", tranDesc); dataMap.put("tranDesc", tranDesc);
System.out.println("工会卡支付请求参数" + JSON.toJSONString(dataMap));
return request("qtk/consumption", dataMap); return request("qtk/consumption", dataMap);
} }

@ -1,5 +1,6 @@
package com.hai.service.impl; package com.hai.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hai.common.QRCodeGenerator; import com.hai.common.QRCodeGenerator;
@ -283,12 +284,10 @@ public class HighOrderServiceImpl implements HighOrderService {
@Override @Override
@Transactional(propagation= Propagation.REQUIRES_NEW) @Transactional(propagation= Propagation.REQUIRES_NEW)
public void hltUnionCardPay(Long userCardId, Long orderId) throws Exception { public void hltUnionCardPay(Long userCardId, Long orderId) throws Exception {
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, "未找到用户绑定的卡号信息");
} }
// 查询订单信息 // 查询订单信息
HighOrder order = getOrderById(orderId); HighOrder order = getOrderById(orderId);
if (order == null) { if (order == null) {
@ -296,9 +295,11 @@ public class HighOrderServiceImpl implements HighOrderService {
} }
String goodsDesc = ""; String goodsDesc = "";
String tranDesc = ""; String tranDesc = "";
String instCode = "11101290";
String businessType = "hisen_consume"; String businessType = "hisen_consume";
if (order.getHighChildOrderList().get(0).getGoodsType() == 1) { if (order.getHighChildOrderList().get(0).getGoodsType() == 1) {
instCode = "11101291";
businessType = "sinopec_oil_code"; businessType = "sinopec_oil_code";
goodsDesc = "购买加油券"; goodsDesc = "购买加油券";
tranDesc = order.getHighChildOrderList().get(0).getGoodsName(); tranDesc = order.getHighChildOrderList().get(0).getGoodsName();
@ -310,14 +311,13 @@ public class HighOrderServiceImpl implements HighOrderService {
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 3) { } else if (order.getHighChildOrderList().get(0).getGoodsType() == 3) {
goodsDesc = "加油站加"+order.getPayPrice()+"元油"; goodsDesc = "加油站加"+order.getPayPrice()+"元油";
tranDesc = "【"+order.getHighChildOrderList().get(0).getGoodsName()+"】加油"+order.getPayPrice()+"元"; tranDesc = "【"+order.getHighChildOrderList().get(0).getGoodsName()+"】加油"+order.getPayPrice()+"元";
} else { } else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法支付,请使用其他支付方式"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法支付,请使用其他支付方式");
} }
// 工会卡支付 // 工会卡支付
JSONObject consumption = HuiLianTongUnionCardConfig.consumption(order.getOrderNo(), userCard.getCardNo(), order.getPayPrice(), businessType, goodsDesc, tranDesc); JSONObject consumption = HuiLianTongUnionCardConfig.consumption(order.getOrderNo(), userCard.getCardNo(), order.getPayPrice(), businessType, instCode, goodsDesc, tranDesc);
System.out.println(consumption); System.out.println("工会卡支付响应参数" + consumption.toJSONString());
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"));
} }

Loading…
Cancel
Save