Преглед изворни кода

fix 实物设备默认商户支付配置

zoujiajian пре 10 месеци
родитељ
комит
58197cbae3

+ 5 - 0
netflix-common/src/main/java/com/cyksj/common/constant/Constant.java

@@ -730,4 +730,9 @@ public interface Constant {
 	 * claude code补充额度
 	 * claude code补充额度
 	 */
 	 */
 	Integer CLAUDE_CODE_SUP_QUOTA = 10;
 	Integer CLAUDE_CODE_SUP_QUOTA = 10;
+
+	/**
+	 * 实物支付商户id
+	 */
+	String REAL_GOODS_PAY_SHOP_ID = "real_goods_pay_shop_id";
 }
 }

+ 5 - 4
netflix-service/src/main/java/com/cyksj/service/pay/impl/AliPayCommonServiceImpl.java

@@ -138,9 +138,11 @@ public class AliPayCommonServiceImpl implements AliPayCommonService {
 		if (ZfbProductCode.MOBILE_WEB.getProductCode().equals(productCode)) {
 		if (ZfbProductCode.MOBILE_WEB.getProductCode().equals(productCode)) {
 			orderDon.setIsWebPay(false);
 			orderDon.setIsWebPay(false);
 		}
 		}
-		//设备 默认使用益路同行
-		if (orderDon.getGoodsId() == 15) {
-			orderDon.setShopId(ShopConfig.ZFB_DEFAULT_APP_ID);
+		//实物设备
+		GoodsDon goodsDon = goodsDonMapper.selectById(orderDon.getGoodsId());
+		if (orderDon.getGoodsId() == 15 || goodsDon.getType() == 2) {
+			SysConfig realGoodsPayShopIdConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getSysKey, Constant.REAL_GOODS_PAY_SHOP_ID).last("limit 1"));
+			orderDon.setShopId(realGoodsPayShopIdConfig != null ? realGoodsPayShopIdConfig.getSysValue() : ShopConfig.ZFB_DEFAULT_APP_ID);
 		}
 		}
 		String appId = orderDon.getShopId();
 		String appId = orderDon.getShopId();
 		if (StrUtil.isEmpty(appId)) {
 		if (StrUtil.isEmpty(appId)) {
@@ -171,7 +173,6 @@ public class AliPayCommonServiceImpl implements AliPayCommonService {
 		if (isUserBenefits) {
 		if (isUserBenefits) {
 			subject = orderDon.getGoodsId() == 15 ? "套餐权益" : "续费减免";
 			subject = orderDon.getGoodsId() == 15 ? "套餐权益" : "续费减免";
 		} else {
 		} else {
-			GoodsDon goodsDon = goodsDonMapper.selectById(orderDon.getGoodsId());
 			subject = goodsDon.getTitle().contains("ChatGPT") ? "AI订阅" : goodsDon.getTitle();
 			subject = goodsDon.getTitle().contains("ChatGPT") ? "AI订阅" : goodsDon.getTitle();
 		}
 		}
 		//回调地址
 		//回调地址