From cf850c5d93b6b1dcfcd6da06faeb3ea7e093ad91 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 29 Aug 2023 17:55:47 +0800
Subject: [PATCH] jufu商城
---
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java | 117 ++++++++++++++++++++++++++++++----------------------------
1 files changed, 60 insertions(+), 57 deletions(-)
diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
index e3656fe..27e5bb1 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
@@ -296,49 +296,49 @@
orderInfo.setPayResult("2");
break;
case "2":
- LaKaLaCreateOrderReqDate laKaLaCreateOrderReqDate = new LaKaLaCreateOrderReqDate();
- //订单编号
- laKaLaCreateOrderReqDate.setOut_order_no(orderInfo.getOrderNo());
- //订单金额,分计
- laKaLaCreateOrderReqDate.setTotal_amount(orderInfo.getAmount().multiply(new BigDecimal(100)).longValue());
- List<MallOrderItem> itemsLKL = orderInfo.getItems();
- //商品名称
- if(CollUtil.isEmpty(itemsLKL)){
- laKaLaCreateOrderReqDate.setOrder_info("商品");
+// LaKaLaCreateOrderReqDate laKaLaCreateOrderReqDate = new LaKaLaCreateOrderReqDate();
+// //订单编号
+// laKaLaCreateOrderReqDate.setOut_order_no(orderInfo.getOrderNo());
+// //订单金额,分计
+// laKaLaCreateOrderReqDate.setTotal_amount(orderInfo.getAmount().multiply(new BigDecimal(100)).longValue());
+// List<MallOrderItem> itemsLKL = orderInfo.getItems();
+// //商品名称
+// if(CollUtil.isEmpty(itemsLKL)){
+// laKaLaCreateOrderReqDate.setOrder_info("商品");
+// }else{
+// laKaLaCreateOrderReqDate.setOrder_info(itemsLKL.get(0).getGoodsName());
+// }
+// payResultStr = laKaLaService.verifyCreateOrder(laKaLaCreateOrderReqDate);
+// JSONObject parseObj = JSONUtil.parseObj(payResultStr);
+// String code = parseObj.get("code").toString();
+// if (!"true".equals(code)) {
+// throw new FebsException("跳转收银台失败");
+// }
+//
+// orderInfo.setPayOrderNo(parseObj.get("payOrderNo").toString());
+// orderInfo.setPayMethod("拉卡拉支付");
+// orderInfo.setPayResult("2");
+ UnipayDto unipayDto = new UnipayDto();
+ unipayDto.setAmount(orderInfo.getAmount());
+ unipayDto.setFrpCode("ALIPAY_H5");
+ unipayDto.setTradeMerchantNo("777184100385821");
+ unipayDto.setOrderNo(orderInfo.getOrderNo());
+ List<MallOrderItem> items = orderInfo.getItems();
+ if(CollUtil.isEmpty(items)){
+ unipayDto.setProductName("商品");
}else{
- laKaLaCreateOrderReqDate.setOrder_info(itemsLKL.get(0).getGoodsName());
+ unipayDto.setProductName(items.get(0).getGoodsName());
}
- payResultStr = laKaLaService.verifyCreateOrder(laKaLaCreateOrderReqDate);
- JSONObject parseObj = JSONUtil.parseObj(payResultStr);
- String code = parseObj.get("code").toString();
- if (!"true".equals(code)) {
- throw new FebsException("跳转收银台失败");
+ String unipayStr = unipayService.unipay(unipayDto);
+ if("fail" == unipayStr){
+ throw new FebsException("支付失败");
+ }else{
+ JSONObject jsonObject = JSONUtil.parseObj(unipayStr);
+ payResultStr = (String) jsonObject.get("r7_TrxNo");
+ rcResult = (String) jsonObject.get("rc_Result");
}
-
- orderInfo.setPayOrderNo(parseObj.get("payOrderNo").toString());
- orderInfo.setPayMethod("拉卡拉支付");
- orderInfo.setPayResult("2");
-// UnipayDto unipayDto = new UnipayDto();
-// unipayDto.setAmount(orderInfo.getAmount());
-// unipayDto.setFrpCode("ALIPAY_H5");
-// unipayDto.setTradeMerchantNo("777184100385821");
-// unipayDto.setOrderNo(orderInfo.getOrderNo());
-// List<MallOrderItem> items = orderInfo.getItems();
-// if(CollUtil.isEmpty(items)){
-// unipayDto.setProductName("商品");
-// }else{
-// unipayDto.setProductName(items.get(0).getGoodsName());
-// }
-// String unipayStr = unipayService.unipay(unipayDto);
-// if("fail" == unipayStr){
-// throw new FebsException("支付失败");
-// }else{
-// JSONObject jsonObject = JSONUtil.parseObj(unipayStr);
-// payResultStr = (String) jsonObject.get("r7_TrxNo");
-// rcResult = (String) jsonObject.get("rc_Result");
-// }
-// orderInfo.setPayOrderNo(payResultStr);
-// orderInfo.setPayMethod("支付宝支付");
+ orderInfo.setPayOrderNo(payResultStr);
+ orderInfo.setPayMethod("支付宝支付");
break;
case "3":
payResultStr = balancePay(orderInfo, payOrderDto.getTradePwd(), "balance");
@@ -362,9 +362,9 @@
mallMqRecord.setCreateTime(orderInfo.getPayTime());
mallMqRecordMapper.insert(mallMqRecord);
//发送补贴消息
- agentProducer.sendPerkMoneyMsg(orderInfo.getId());
- //发送代理自动升级消息
- agentProducer.sendAutoLevelUpMsg(member.getId());
+// agentProducer.sendPerkMoneyMsg(orderInfo.getId());
+// //发送代理自动升级消息
+// agentProducer.sendAutoLevelUpMsg(member.getId());
break;
case "4":
if (orderInfo.getOrderType() != 2) {
@@ -749,20 +749,6 @@
if(prizeScore.compareTo(score) < 0){
throw new FebsException("积分不足");
}
- if(hasTc){
- //系统设置的个人贡献点最大值
- DataDictionaryCustom starGetDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
- DataDictionaryEnum.STAR_GET.getType(),
- DataDictionaryEnum.STAR_GET.getCode());
- if(ObjectUtil.isNotEmpty(starGetDic)){
- String starGetStr = StrUtil.isEmpty(starGetDic.getValue()) ? "0" : starGetDic.getValue();
- BigDecimal starGet = new BigDecimal(starGetStr);
- BigDecimal star = new BigDecimal(mallMemberWallet.getStar());
- if(starGet.compareTo(BigDecimal.ZERO) != 0 && starGet.compareTo(star) <= 0){
- throw new FebsException("无法购买套餐");
- }
- }
- }
/**
* 使用积分折扣现金
*/
@@ -781,6 +767,23 @@
if(scorePercentMaxAmount.compareTo(score) < 0){
throw new FebsException("最多可使用"+scorePercentMaxAmount+"积分");
}
+
+ if(hasTc){
+ //系统设置的个人贡献点最大值
+ DataDictionaryCustom starGetDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+ DataDictionaryEnum.STAR_GET.getType(),
+ DataDictionaryEnum.STAR_GET.getCode());
+ if(ObjectUtil.isNotEmpty(starGetDic)){
+ String starGetStr = StrUtil.isEmpty(starGetDic.getValue()) ? "0" : starGetDic.getValue();
+ BigDecimal starGet = new BigDecimal(starGetStr);
+ BigDecimal star = new BigDecimal(mallMemberWallet.getStar());
+ if(starGet.compareTo(BigDecimal.ZERO) != 0 && starGet.compareTo(star) <= 0){
+
+ return new FebsResponse().success().message("购买套餐不会获得贡献点");
+// throw new FebsException("无法购买套餐");
+ }
+ }
+ }
return new FebsResponse().success();
}
--
Gitblit v1.9.1