From 79ce191be43b98c9eaa52436d8ea0b56d5abf6f1 Mon Sep 17 00:00:00 2001 From: hly <2783385703@qq.com> Date: Wed, 20 Aug 2025 13:02:33 +0800 Subject: [PATCH] 1 --- .idea/compiler.xml | 2 + .idea/encodings.xml | 2 + .idea/misc.xml | 1 + .trae/rules/project_rules.md | 1 + .../jeecgboot-boot-applet/pom.xml | 5 + .../controller/AppletApiAddressController.java | 2 +- .../controller/AppletApiLoginController.java | 2 +- .../controller/AppletApiOrderController.java | 19 +- .../controller/AppletApiSubscribeController.java | 51 +++++ .../applet/service/AppletApiOrderService.java | 5 + .../applet/service/AppletApiSubscribeService.java | 12 ++ .../service/impl/AppletApiOrderServiceImpl.java | 219 ++++++++++++++++++++- .../impl/AppletApiSubscribeServiceImpl.java | 39 ++++ .../demo/appletOrder/entity/AppletOrder.java | 12 ++ .../appletOrder/entity/AppletOrderProduct.java | 5 + .../demo/appletProduct/entity/AppletProduct.java | 5 + .../AppletSubscribeDetectionController.java | 2 +- .../entity/AppletSubscribeDetection.java | 66 +++++-- .../mapper/AppletSubscribeDetectionMapper.java | 2 +- .../service/IAppletSubscribeDetectionService.java | 2 +- .../impl/AppletSubscribeDetectionServiceImpl.java | 2 +- .../uniapp/AppletSubscribeDetectionForm.vue | 46 +++-- .../uniapp3/AppletSubscribeDetectionData.ts | 34 +++- .../uniapp3/AppletSubscribeDetectionForm.vue | 81 +++++--- .../vue3/AppletSubscribeDetection.data.ts | 107 ++++++++-- jeecg-boot/jeecg-boot-module/module-pay/.gitignore | 1 + jeecg-boot/jeecg-boot-module/module-pay/pom.xml | 55 ++++++ .../main/java/org/jeecg/PayDemoApplication.java | 47 +++++ .../java/org/jeecg/modules/pay/AlipayService.java | 191 ++++++++++++++++++ .../org/jeecg/modules/pay/MpWxEntPayService.java | 43 ++++ .../java/org/jeecg/modules/pay/MpWxPayService.java | 201 +++++++++++++++++++ .../java/org/jeecg/modules/pay/config/AliPay.java | 23 +++ .../org/jeecg/modules/pay/config/WeixinConfig.java | 29 +++ .../java/org/jeecg/modules/pay/config/WxPay.java | 79 ++++++++ .../modules/pay/config/WxPayConfiguration.java | 53 +++++ .../src/main/resources/apiclient_cert.p12 | Bin 0 -> 2782 bytes .../src/main/resources/apiclient_cert.pem | 25 +++ .../src/main/resources/apiclient_key.pem | 28 +++ .../src/main/resources/apiclient_key1.pem | 28 +++ .../module-pay/src/main/resources/application.yml | 2 + .../src/main/resources/pay_alipay.properties | 4 + .../src/main/resources/pay_weixin.properties | 7 + jeecg-boot/jeecg-boot-module/pom.xml | 1 + .../src/main/resources/apiclient_cert.p12 | Bin 0 -> 2782 bytes .../src/main/resources/apiclient_cert.pem | 25 +++ .../src/main/resources/apiclient_key.pem | 28 +++ .../src/main/resources/application-dev.yml | 4 +- .../src/main/resources/pay_alipay.properties | 4 + .../src/main/resources/pay_weixin.properties | 8 + 49 files changed, 1508 insertions(+), 102 deletions(-) create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiSubscribeController.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiSubscribeService.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiSubscribeServiceImpl.java create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/.gitignore create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/pom.xml create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/PayDemoApplication.java create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/AlipayService.java create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/MpWxEntPayService.java create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/MpWxPayService.java create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/AliPay.java create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/WeixinConfig.java create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/WxPay.java create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/WxPayConfiguration.java create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/resources/apiclient_cert.p12 create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/resources/apiclient_cert.pem create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/resources/apiclient_key.pem create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/resources/apiclient_key1.pem create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/resources/application.yml create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/resources/pay_alipay.properties create mode 100644 jeecg-boot/jeecg-boot-module/module-pay/src/main/resources/pay_weixin.properties create mode 100644 jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/apiclient_cert.p12 create mode 100644 jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/apiclient_cert.pem create mode 100644 jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/apiclient_key.pem create mode 100644 jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/pay_alipay.properties create mode 100644 jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/pay_weixin.properties diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 03095d2..2a7acb8 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -9,6 +9,7 @@ + @@ -31,6 +32,7 @@ + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml index 7c77d59..9f6a6a4 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -9,6 +9,8 @@ + + diff --git a/.idea/misc.xml b/.idea/misc.xml index 00c8863..afa2be5 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,6 +5,7 @@ diff --git a/.trae/rules/project_rules.md b/.trae/rules/project_rules.md index ce3233a..5482860 100644 --- a/.trae/rules/project_rules.md +++ b/.trae/rules/project_rules.md @@ -4,3 +4,4 @@ 4. 项目使用的是shiro权限框架 5. 项目使用的是vue3+element-plus前端框架 +POST接口也不要使用@RequestBody接收参数,不使用参数注解 diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/pom.xml b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/pom.xml index b92c827..e037fca 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/pom.xml +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/pom.xml @@ -34,6 +34,11 @@ org.jeecgframework.boot jeecg-boot-base-core + + org.jeecgframework.boot + module-pay + 3.8.1 + diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiAddressController.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiAddressController.java index eee96d6..b921f12 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiAddressController.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiAddressController.java @@ -115,7 +115,7 @@ public class AppletApiAddressController { */ @Operation(summary="删除地址,多个用,分割") @PostMapping(value = "/delete") - public Result delete(@RequestParam String addressId) { + public Result delete(String addressId) { appletAddressService.delete(addressId); return Result.OK("删除地址成功!"); } diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiLoginController.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiLoginController.java index 61ec38e..15f8fb9 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiLoginController.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiLoginController.java @@ -120,4 +120,4 @@ public class AppletApiLoginController { log.info("收到更新用户信息请求"); return appletApiLoginService.updateUserInfo(userInfo); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiOrderController.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiOrderController.java index 3b76f6c..f1049b5 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiOrderController.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiOrderController.java @@ -58,6 +58,12 @@ public class AppletApiOrderController { } + //支付成功回调 + @PostMapping("/payNotify") + public Object payNotify(@RequestBody String requestBody){ + return appletApiOrderService.payNotify(requestBody); + } + /** * 订单详情 * @@ -79,20 +85,21 @@ public class AppletApiOrderController { */ @Operation(summary = "创建订单") @PostMapping(value = "/create") - public Result create(@RequestBody CreateOrderBo bo) { + public Result create(CreateOrderBo bo) { return Result.OK(appletApiOrderService.create(bo)); } /** * 再次支付 * - * @param + * @param id 订单ID * @return */ @Operation(summary = "再次支付") @PostMapping(value = "/pay") public Result pay(String id) { - return Result.OK(); + Object payResult = appletApiOrderService.pay(id); + return Result.OK(payResult); } /** @@ -103,7 +110,7 @@ public class AppletApiOrderController { */ @Operation(summary = "申请售后") @PostMapping(value = "/afterSale") - public Result afterSale(@RequestBody AppletOrderAfterSale afterSale) { + public Result afterSale(AppletOrderAfterSale afterSale) { appletApiOrderService.afterSale(afterSale); return Result.OK(); } @@ -116,7 +123,7 @@ public class AppletApiOrderController { */ @Operation(summary = "订单评价") @PostMapping(value = "/evaluate") - public Result evaluate(@RequestBody AppletOrderEvaluate evaluate) { + public Result evaluate(AppletOrderEvaluate evaluate) { appletApiOrderService.evaluate(evaluate); return Result.OK(); } @@ -129,7 +136,7 @@ public class AppletApiOrderController { */ @Operation(summary = "确认收货") @PostMapping(value = "/confirm") - public Result confirm(@RequestParam String id) { + public Result confirm(String id) { appletApiOrderService.confirm(id); return Result.OK(); } diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiSubscribeController.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiSubscribeController.java new file mode 100644 index 0000000..21e062f --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiSubscribeController.java @@ -0,0 +1,51 @@ +package org.jeecg.modules.applet.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.config.shiro.IgnoreAuth; +import org.jeecg.modules.applet.service.AppletApiSubscribeService; +import org.jeecg.modules.demo.appletProduct.entity.AppletProduct; +import org.jeecg.modules.demo.appletSubscribeDetection.entity.AppletSubscribeDetection; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name="预约检测", description="预约检测") +@RestController +@RequestMapping("/appletApi/subscribe") +@Slf4j +public class AppletApiSubscribeController { + + @Autowired + private AppletApiSubscribeService appletApiSubscribeService; + + /** + * 预约检测列表查询 + * @param type 预约检测类型(选填) + * @param pageNo 页码 + * @param pageSize 每页大小 + * @return 预约检测列表 + */ + @AutoLog(value = "预约检测列表查询") + @Operation(summary = "预约检测列表查询", description = "分页查询") + @GetMapping(value = "/list") + public Result> list( + @Parameter(description = "产品类型【选填】(0自采,1上门,2到店,3已取消)", required = false) String type, + @Parameter(description = "页码") @RequestParam(defaultValue = "1") Integer pageNo, + @Parameter(description = "每页大小") @RequestParam(defaultValue = "10") Integer pageSize) { + + log.info("产品列表查询 - type: {}, pageNo: {}, pageSize: {}", + type, pageNo, pageSize); + + return Result.OK(appletApiSubscribeService.getAppletSubscribeDetection(pageNo, pageSize, type)); + } + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiOrderService.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiOrderService.java index 80cc9af..ed8ce56 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiOrderService.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiOrderService.java @@ -31,9 +31,14 @@ public interface AppletApiOrderService { Object create(CreateOrderBo bo); + Object pay(String id); + + Object payNotify(String requestBody); + void afterSale(AppletOrderAfterSale afterSale); void evaluate(AppletOrderEvaluate evaluate); void confirm(String id); + } diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiSubscribeService.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiSubscribeService.java new file mode 100644 index 0000000..efa95c1 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiSubscribeService.java @@ -0,0 +1,12 @@ +package org.jeecg.modules.applet.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.jeecg.modules.demo.appletSubscribeDetection.entity.AppletSubscribeDetection; + +public interface AppletApiSubscribeService { + + + IPage getAppletSubscribeDetection(Integer pageNo, Integer pageSize, String type); + + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiOrderServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiOrderServiceImpl.java index 38cd15d..7fa323f 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiOrderServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiOrderServiceImpl.java @@ -3,7 +3,10 @@ package org.jeecg.modules.applet.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.jeecg.common.api.vo.Result; import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.util.AppletUserUtil; import org.jeecg.modules.applet.bo.CreateOrderBo; @@ -26,6 +29,9 @@ import org.jeecg.modules.demo.appletProductSpec.entity.AppletProductSpec; import org.jeecg.modules.demo.appletProductSpec.service.IAppletProductSpecService; import org.jeecg.modules.demo.appletShippingAddress.entity.AppletShippingAddress; import org.jeecg.modules.demo.appletShippingAddress.service.IAppletShippingAddressService; +import org.jeecg.modules.demo.appletSubscribeDetection.entity.AppletSubscribeDetection; +import org.jeecg.modules.demo.appletSubscribeDetection.service.IAppletSubscribeDetectionService; +import org.jeecg.modules.pay.MpWxPayService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -39,6 +45,7 @@ import java.util.stream.Collectors; @Service +@Slf4j public class AppletApiOrderServiceImpl implements AppletApiOrderService { @Autowired @@ -68,6 +75,12 @@ public class AppletApiOrderServiceImpl implements AppletApiOrderService { @Autowired private IAppletProductSpecService appletProductSpecService; + @Autowired + private MpWxPayService mpWxPayService; + + @Autowired + private IAppletSubscribeDetectionService appletSubscribeDetectionService; + /** * 订单列表查询 * @@ -77,8 +90,8 @@ public class AppletApiOrderServiceImpl implements AppletApiOrderService { */ @Override public IPage page(Page page, String status) { - String userId = AppletUserUtil.getCurrentAppletUserId(); + log.info("查询订单列表,用户ID: {}, 状态: {}, 页码: {}, 页大小: {}", userId, status, page.getCurrent(), page.getSize()); Page page1 = appletOrderService .lambdaQuery() @@ -95,6 +108,7 @@ public class AppletApiOrderServiceImpl implements AppletApiOrderService { record.setAfterSales(appletOrderAfterSaleService.getById(record.getId())); } + log.info("订单列表查询完成,返回 {} 条记录", page1.getRecords().size()); return page1; } @@ -106,8 +120,13 @@ public class AppletApiOrderServiceImpl implements AppletApiOrderService { */ @Override public AppletOrder detail(String id) { + log.info("查询订单详情,订单ID: {}", id); AppletOrder order = appletOrderService.getById(id); + if (order == null) { + log.warn("订单不存在,订单ID: {}", id); + throw new JeecgBootException("订单不存在"); + } order.setAppletOrderProductList(appletOrderProductService .lambdaQuery() @@ -122,14 +141,17 @@ public class AppletApiOrderServiceImpl implements AppletApiOrderService { order.setAfterSales(appletOrderAfterSaleService.getById(order.getId())); + log.info("订单详情查询完成,订单号: {}", order.getOrderNo()); return order; } @Override public Object create(CreateOrderBo bo) { String userId = AppletUserUtil.getCurrentAppletUserId(); + log.info("开始创建订单,用户ID: {}, 商品数量: {}", userId, bo != null && bo.getList() != null ? bo.getList().size() : 0); if (bo == null || bo.getList() == null || bo.getList().isEmpty()) { + log.error("创建订单失败,订单商品不能为空,用户ID: {}", userId); throw new JeecgBootException("订单商品不能为空"); } @@ -144,11 +166,12 @@ public class AppletApiOrderServiceImpl implements AppletApiOrderService { // 创建订单 AppletOrder order = new AppletOrder(); + order.setTitle(list.size() > 1 ? "聚合订单" : null); order.setUserId(userId); order.setOrderNo(generateOrderNo()); // 生成订单号 order.setOrderDate(new Date()); - order.setOrderStatus(0); // 0待支付,但这里不需要支付,直接设为1待发货 - + order.setPayId(generatePayId()); // 生成支付ID + if (address != null) { order.setCustomerName(address.getName()); order.setCustomerPhone(address.getPhone()); @@ -178,6 +201,10 @@ public class AppletApiOrderServiceImpl implements AppletApiOrderService { spec = appletProductSpecService.getById(item.getSpecId()); } + if (StringUtils.isEmpty(order.getTitle())){ + order.setTitle(product.getName()); + } + // 创建订单商品 AppletOrderProduct orderProduct = new AppletOrderProduct(); orderProduct.setUserId(userId); @@ -187,7 +214,8 @@ public class AppletApiOrderServiceImpl implements AppletApiOrderService { orderProduct.setQuantity(item.getNum()); orderProduct.setType(product.getType()); orderProduct.setUnit(product.getUnit()); - orderProduct.setStatus("1"); // 正常状态 + orderProduct.setStatus("0"); + orderProduct.setSubscribeType(product.getSubscribeType()); if (spec != null) { orderProduct.setSpecId(spec.getId()); @@ -201,19 +229,168 @@ public class AppletApiOrderServiceImpl implements AppletApiOrderService { } order.setOrderAmount(totalAmount); - order.setPaymentMethod("无需支付"); // 不需要支付 - order.setOrderStatus(1); // 直接设为待发货状态 + order.setPaymentMethod("微信支付"); + order.setOrderStatus(0); // 0待支付 // 保存订单 appletOrderService.save(order); + log.info("订单保存成功,订单ID: {}, 订单号: {}, 支付ID: {}", order.getId(), order.getOrderNo(), order.getPayId()); // 设置订单ID并保存订单商品 for (AppletOrderProduct orderProduct : orderProductList) { orderProduct.setOrderId(order.getId()); } appletOrderProductService.saveBatch(orderProductList); + log.info("订单商品保存成功,商品数量: {}", orderProductList.size()); + + // 调用微信支付创建订单 + String openId = AppletUserUtil.getCurrentAppletUserOpenid(); + String clientIp = "127.0.0.1"; // 可以从请求中获取真实IP + + log.info("开始调用微信支付,订单ID: {}, 支付ID: {}, 金额: {}", order.getId(), order.getPayId(), totalAmount); + Object payResult = mpWxPayService.createOrder( + "订单支付", // 商品名称 + clientIp, // 客户端IP + order.getId(), // 商品ID使用订单ID + 1, // 金额转换为分 +// totalAmount.multiply(new BigDecimal(100)).intValue(), // 金额转换为分 + order.getPayId(), // 订单号 + openId, // 用户openId + "订单支付" // 商品描述 + ); + + log.info("微信支付调用完成,订单ID: {}", order.getId()); + return payResult; + } + + @Override + public Object pay(String id) { + log.info("开始重新支付,订单ID: {}", id); + + if (StringUtils.isEmpty(id)) { + log.error("重新支付失败,订单ID不能为空"); + throw new JeecgBootException("订单ID不能为空"); + } + + AppletOrder order = appletOrderService.getById(id); + if (order == null) { + log.error("重新支付失败,订单不存在,订单ID: {}", id); + throw new JeecgBootException("订单不存在"); + } + + if (order.getOrderStatus() != 0) { + log.error("重新支付失败,订单状态不正确,当前状态: {}, 订单ID: {}", order.getOrderStatus(), id); + throw new JeecgBootException("订单状态不正确,无法支付"); + } + + // 重新生成支付ID,避免重复支付时订单号重复 + String oldPayId = order.getPayId(); + order.setPayId(generatePayId()); + appletOrderService.updateById(order); + log.info("重新生成支付ID,订单ID: {}, 旧支付ID: {}, 新支付ID: {}", id, oldPayId, order.getPayId()); + + // 调用微信支付创建订单 + String openId = AppletUserUtil.getCurrentAppletUserOpenid(); + String clientIp = "127.0.0.1"; // 可以从请求中获取真实IP + + log.info("开始调用微信支付重新支付,订单ID: {}, 支付ID: {}, 金额: {}", id, order.getPayId(), order.getOrderAmount()); + Object payResult = mpWxPayService.createOrder( + "订单支付", // 商品名称 + clientIp, // 客户端IP + order.getId(), // 商品ID使用订单ID +// order.getOrderAmount().multiply(new BigDecimal(100)).intValue(), // 金额转换为分 + 1, + order.getPayId(), // 支付ID作为订单号 + openId, // 用户openId + "订单支付" // 商品描述 + ); + + log.info("微信支付重新支付调用完成,订单ID: {}", id); + return payResult; + } + + + + //支付成功支付回调 + @Override + public Object payNotify(String requestBody) { + log.info("收到微信支付回调通知,requestBody: {}", requestBody); + + try { + WxPayOrderNotifyResult notify = mpWxPayService.notify(requestBody); + String outTradeNo = notify.getOutTradeNo(); + String totalFee = notify.getTotalFee().toString(); + String resultCode = notify.getResultCode(); + + log.info("微信支付回调解析成功,订单号: {}, 金额: {}, 结果: {}", outTradeNo, totalFee, resultCode); + + // 验证支付结果 + if ("SUCCESS".equals(resultCode)) { + // 根据payId查找订单 + AppletOrder order = appletOrderService.lambdaQuery() + .eq(AppletOrder::getPayId, outTradeNo) + .one(); + + if (order != null) { + // 检查订单状态,避免重复处理 + if (order.getOrderStatus() == 0) { + // 更新订单状态为已支付 + order.setOrderStatus(1); // 1表示已支付待发货 + order.setPaymentTime(LocalTime.now()); + appletOrderService.updateById(order); + + handleSpecialProducts(order.getId()); + + log.info("订单支付成功,订单ID: {}, payId: {}", order.getId(), outTradeNo); + } else { + log.warn("订单状态异常,当前状态: {}, 订单ID: {}", order.getOrderStatus(), order.getId()); + } + } else { + log.error("未找到对应的订单,payId: {}", outTradeNo); + } + } else { + log.error("支付失败,订单号: {}, 错误信息: {}", outTradeNo, notify.getReturnMsg()); + } + + } catch (Exception e) { + log.error("处理微信支付回调异常", e); + return "" + + " " + + " " + + " "; + } + + return "" + + " " + + " " + + " "; + } + + /** + * 处理特殊产品 + * @param id 订单id + */ + private void handleSpecialProducts(String id){ + List products = appletOrderProductService.selectByMainId(id); + + for (AppletOrderProduct orderProduct : products) { + if ("1".equals(orderProduct.getType())){//检测类型,添加检测数据 + + AppletSubscribeDetection detection = new AppletSubscribeDetection(); + + detection.setTitle(orderProduct.getProductName()); + detection.setOrderId(id); + detection.setProductId(orderProduct.getProductId()); + detection.setPrice(orderProduct.getPrice()); + detection.setSkuId(orderProduct.getSpecId()); + detection.setSubscribeType(orderProduct.getSpecId()); + detection.setUserId(orderProduct.getUserId()); + detection.setSubscribeType(orderProduct.getSubscribeType()); + + appletSubscribeDetectionService.save(detection); + } + } - return order.getId(); } /** @@ -228,11 +405,26 @@ public class AppletApiOrderServiceImpl implements AppletApiOrderService { return "ORD" + timestamp + random; } + /** + * 生成支付ID + * @return 支付ID + */ + private String generatePayId() { + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); + String timestamp = sdf.format(new Date()); + // 添加4位随机数确保唯一性 + int random = (int) (Math.random() * 9000) + 1000; + return "PAY" + timestamp + random; + } + @Override public void afterSale(AppletOrderAfterSale afterSale) { String userId = AppletUserUtil.getCurrentAppletUserId(); + log.info("开始申请售后,用户ID: {}, 订单ID: {}, 售后原因: {}", userId, afterSale.getOrderId(), afterSale.getReason()); + afterSale.setUserId(userId); appletOrderAfterSaleService.save(afterSale); + log.info("售后申请保存成功,售后ID: {}", afterSale.getId()); appletOrderAfterSaleProcessService.save(AppletOrderAfterSaleProcess.builder() .saleId(afterSale.getId()) @@ -247,18 +439,23 @@ public class AppletApiOrderServiceImpl implements AppletApiOrderService { .title("等待审核") .orderId(afterSale.getOrderId()) .build()); + + log.info("售后流程记录创建完成,订单ID: {}", afterSale.getOrderId()); } @Override public void evaluate(AppletOrderEvaluate evaluate) { String userId = AppletUserUtil.getCurrentAppletUserId(); + log.info("开始订单评价,用户ID: {}, 订单ID: {}", userId, evaluate.getOrderId()); if (StringUtils.isEmpty(evaluate.getOrderId())){ + log.error("订单评价失败,订单ID不能为空,用户ID: {}", userId); throw new JeecgBootException("订单ID不能为空"); } AppletOrder order = appletOrderService.getById(evaluate.getOrderId()); if (order == null){ + log.error("订单评价失败,订单不存在,订单ID: {}", evaluate.getOrderId()); throw new JeecgBootException("订单不存在"); } @@ -272,22 +469,30 @@ public class AppletApiOrderServiceImpl implements AppletApiOrderService { order.setOrderStatus(4); appletOrderService.updateById(order); + log.info("订单状态更新为已评价,订单ID: {}", evaluate.getOrderId()); appletOrderEvaluateService.save(evaluate); + log.info("订单评价保存成功,订单ID: {}, 评价ID: {}", evaluate.getOrderId(), evaluate.getId()); } @Override public void confirm(String id) { + log.info("开始确认收货,订单ID: {}", id); + if (StringUtils.isEmpty(id)){ + log.error("确认收货失败,订单ID不能为空"); throw new JeecgBootException("订单ID不能为空"); } + AppletOrder order = appletOrderService.getById(id); if (order == null){ + log.error("确认收货失败,订单不存在,订单ID: {}", id); throw new JeecgBootException("订单不存在"); } order.setOrderStatus(3); appletOrderService.updateById(order); + log.info("确认收货成功,订单状态更新为已完成,订单ID: {}", id); } } \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiSubscribeServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiSubscribeServiceImpl.java new file mode 100644 index 0000000..bdd2ff8 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiSubscribeServiceImpl.java @@ -0,0 +1,39 @@ +package org.jeecg.modules.applet.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.commons.lang3.StringUtils; +import org.jeecg.modules.applet.service.AppletApiSubscribeService; +import org.jeecg.modules.demo.appletSubscribeDetection.entity.AppletSubscribeDetection; +import org.jeecg.modules.demo.appletSubscribeDetection.service.IAppletSubscribeDetectionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class AppletApiSubscribeServiceImpl implements AppletApiSubscribeService { + + @Autowired + private IAppletSubscribeDetectionService appletSubscribeDetectionService; + + @Override + public IPage getAppletSubscribeDetection(Integer pageNo, Integer pageSize, String type) { + + Page page = appletSubscribeDetectionService.lambdaQuery() + .and(StringUtils.isNotBlank(type), q -> {//进行筛选 + + q.and("3".equals(type), w -> { + w.eq(AppletSubscribeDetection::getStatus, 3); + }); + + q.and(!"3".equals(type), w -> { + w.ne(AppletSubscribeDetection::getStatus, 3) + .eq(AppletSubscribeDetection::getType, type); + }); + + }).page(new Page<>(pageNo, pageSize)); + + return page; + } + + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletOrder/entity/AppletOrder.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletOrder/entity/AppletOrder.java index 46d2941..4eef6b4 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletOrder/entity/AppletOrder.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletOrder/entity/AppletOrder.java @@ -2,6 +2,7 @@ package org.jeecg.modules.demo.appletOrder.entity; import java.io.Serializable; import java.io.UnsupportedEncodingException; +import java.time.LocalTime; import java.util.Date; import java.util.List; @@ -51,10 +52,21 @@ public class AppletOrder implements Serializable { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @Schema(description = "更新日期") private java.util.Date updateTime; + + /**支付时间*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "支付时间") + private LocalTime paymentTime; + /**订单编号*/ @Excel(name = "订单编号", width = 15) @Schema(description = "订单编号") private java.lang.String orderNo; + /**标题*/ + @Excel(name = "标题", width = 15) + @Schema(description = "标题") + private java.lang.String title; /**客户姓名*/ @Excel(name = "客户姓名", width = 15) @Schema(description = "客户姓名") diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletOrder/entity/AppletOrderProduct.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletOrder/entity/AppletOrderProduct.java index 19368ba..bee2dad 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletOrder/entity/AppletOrderProduct.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletOrder/entity/AppletOrderProduct.java @@ -98,4 +98,9 @@ public class AppletOrderProduct implements Serializable { @Excel(name = "用户ID", width = 15) @Schema(description = "用户ID") private java.lang.String userId; + + /**服务*/ + @Excel(name = "检测类型", width = 15) + @Schema(description = "检测类型") + private String subscribeType; } diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProduct/entity/AppletProduct.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProduct/entity/AppletProduct.java index af1a1e5..6b45ba7 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProduct/entity/AppletProduct.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProduct/entity/AppletProduct.java @@ -120,6 +120,11 @@ public class AppletProduct implements Serializable { @Schema(description = "服务") private String service; + /**服务*/ + @Excel(name = "检测类型", width = 15) + @Schema(description = "检测类型") + private String subscribeType; + @TableField(exist = false) private List specs; diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/controller/AppletSubscribeDetectionController.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/controller/AppletSubscribeDetectionController.java index 77417c3..b798e1c 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/controller/AppletSubscribeDetectionController.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/controller/AppletSubscribeDetectionController.java @@ -41,7 +41,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; /** * @Description: 预约检测 * @Author: jeecg-boot - * @Date: 2025-07-22 + * @Date: 2025-08-20 * @Version: V1.0 */ @Tag(name="预约检测") diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/entity/AppletSubscribeDetection.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/entity/AppletSubscribeDetection.java index 59e5bf8..279ee57 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/entity/AppletSubscribeDetection.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/entity/AppletSubscribeDetection.java @@ -8,21 +8,20 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.*; import org.jeecg.common.constant.ProvinceCityArea; import org.jeecg.common.util.SpringContextUtils; -import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; import org.springframework.format.annotation.DateTimeFormat; import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecg.common.aspect.annotation.Dict; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * @Description: 预约检测 * @Author: jeecg-boot - * @Date: 2025-07-22 + * @Date: 2025-08-20 * @Version: V1.0 */ @Data @@ -30,6 +29,9 @@ import lombok.experimental.Accessors; @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) @Schema(description="预约检测") +@AllArgsConstructor +@NoArgsConstructor +@Builder public class AppletSubscribeDetection implements Serializable { private static final long serialVersionUID = 1L; @@ -75,30 +77,30 @@ public class AppletSubscribeDetection implements Serializable { /**价格*/ @Excel(name = "价格", width = 15) @Schema(description = "价格") - private java.lang.String price; - /**类型(自采、上门、到店)*/ - @Excel(name = "类型(自采、上门、到店)", width = 15) - @Schema(description = "类型(自采、上门、到店)") + private BigDecimal price; + /**类型*/ + @Excel(name = "类型", width = 15) + @Schema(description = "类型") private java.lang.String type; /**寄送地址id*/ @Excel(name = "寄送地址id", width = 15) @Schema(description = "寄送地址id") private java.lang.String sendAddressId; - /**寄送地址(省)*/ - @Excel(name = "寄送地址(省)", width = 15) - @Schema(description = "寄送地址(省)") + /**省*/ + @Excel(name = "省", width = 15) + @Schema(description = "省") private java.lang.String sendAddressProvince; /**详细地址*/ @Excel(name = "详细地址", width = 15) @Schema(description = "详细地址") private java.lang.String sendAddressDetail; - /**寄送地址(市)*/ - @Excel(name = "寄送地址(市)", width = 15) - @Schema(description = "寄送地址(市)") + /**市*/ + @Excel(name = "市", width = 15) + @Schema(description = "市") private java.lang.String sendAddressCity; - /**寄送地址(区)*/ - @Excel(name = "寄送地址(区)", width = 15) - @Schema(description = "寄送地址(区)") + /**区*/ + @Excel(name = "区", width = 15) + @Schema(description = "区") private java.lang.String sendAddressDistrict; /**预约日期*/ @Excel(name = "预约日期", width = 15, format = "yyyy-MM-dd") @@ -109,9 +111,33 @@ public class AppletSubscribeDetection implements Serializable { /**医院*/ @Excel(name = "医院", width = 15) @Schema(description = "医院") - private java.lang.String hospital; - /**医院id*/ - @Excel(name = "医院id", width = 15) - @Schema(description = "医院id") private java.lang.String hospitalId; + /**可选预约类型*/ + @Excel(name = "可选预约类型", width = 15, dicCode = "applett_subscribe_type") + @Dict(dicCode = "applett_subscribe_type") + @Schema(description = "可选预约类型") + private java.lang.String subscribeType; + /**状态*/ + @Excel(name = "状态", width = 15, dicCode = "applet_subscribe_status") + @Dict(dicCode = "applet_subscribe_status") + @Schema(description = "状态") + private java.lang.String status; + /**产品*/ + @Excel(name = "产品", width = 15) + @Schema(description = "产品") + private java.lang.String productId; + /**用户*/ + @Excel(name = "用户", width = 15) + @Schema(description = "用户") + private java.lang.String userId; + /**规格*/ + @Excel(name = "规格", width = 15, dictTable = "applet_product_spec", dicText = "spec_name", dicCode = "id") + @Dict(dictTable = "applet_product_spec", dicText = "spec_name", dicCode = "id") + @Schema(description = "规格") + private java.lang.String skuId; + /**订单*/ + @Excel(name = "订单", width = 15, dictTable = "applet_order", dicText = "order_no", dicCode = "id") + @Dict(dictTable = "applet_order", dicText = "order_no", dicCode = "id") + @Schema(description = "订单") + private java.lang.String orderId; } diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/mapper/AppletSubscribeDetectionMapper.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/mapper/AppletSubscribeDetectionMapper.java index 0cff9ca..9fbdde5 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/mapper/AppletSubscribeDetectionMapper.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/mapper/AppletSubscribeDetectionMapper.java @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * @Description: 预约检测 * @Author: jeecg-boot - * @Date: 2025-07-22 + * @Date: 2025-08-20 * @Version: V1.0 */ public interface AppletSubscribeDetectionMapper extends BaseMapper { diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/service/IAppletSubscribeDetectionService.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/service/IAppletSubscribeDetectionService.java index fef6b8c..bde9926 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/service/IAppletSubscribeDetectionService.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/service/IAppletSubscribeDetectionService.java @@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService; /** * @Description: 预约检测 * @Author: jeecg-boot - * @Date: 2025-07-22 + * @Date: 2025-08-20 * @Version: V1.0 */ public interface IAppletSubscribeDetectionService extends IService { diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/service/impl/AppletSubscribeDetectionServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/service/impl/AppletSubscribeDetectionServiceImpl.java index cba3b5f..8d95c2f 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/service/impl/AppletSubscribeDetectionServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/service/impl/AppletSubscribeDetectionServiceImpl.java @@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; /** * @Description: 预约检测 * @Author: jeecg-boot - * @Date: 2025-07-22 + * @Date: 2025-08-20 * @Version: V1.0 */ @Service diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp/AppletSubscribeDetectionForm.vue b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp/AppletSubscribeDetectionForm.vue index f4c316d..a930cf1 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp/AppletSubscribeDetectionForm.vue +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp/AppletSubscribeDetectionForm.vue @@ -40,8 +40,8 @@ - 类型(自采、上门、到店): - + 类型: + @@ -52,8 +52,8 @@ - 寄送地址(省): - + 省: + @@ -64,27 +64,51 @@ - 寄送地址(市): - + 市: + - 寄送地址(区): - + 区: + 医院: - + - 医院id: - + 可选预约类型: + + + + + + 状态: + + + + + + 产品: + + + + + + 规格: + + + + + + 订单: + diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionData.ts b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionData.ts index b9ac9fe..667caba 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionData.ts +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionData.ts @@ -27,7 +27,7 @@ export const columns = [ dataIndex: 'price' }, { - title: '类型(自采、上门、到店)', + title: '类型', align:"center", dataIndex: 'type' }, @@ -37,7 +37,7 @@ export const columns = [ dataIndex: 'sendAddressId' }, { - title: '寄送地址(省)', + title: '省', align:"center", dataIndex: 'sendAddressProvince' }, @@ -47,12 +47,12 @@ export const columns = [ dataIndex: 'sendAddressDetail' }, { - title: '寄送地址(市)', + title: '市', align:"center", dataIndex: 'sendAddressCity' }, { - title: '寄送地址(区)', + title: '区', align:"center", dataIndex: 'sendAddressDistrict' }, @@ -64,11 +64,31 @@ export const columns = [ { title: '医院', align:"center", - dataIndex: 'hospital' + dataIndex: 'hospitalId' }, { - title: '医院id', + title: '可选预约类型', align:"center", - dataIndex: 'hospitalId' + dataIndex: 'subscribeType_dictText' + }, + { + title: '状态', + align:"center", + dataIndex: 'status_dictText' + }, + { + title: '产品', + align:"center", + dataIndex: 'productId_dictText' + }, + { + title: '规格', + align:"center", + dataIndex: 'skuId_dictText' + }, + { + title: '订单', + align:"center", + dataIndex: 'orderId_dictText' }, ]; \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionForm.vue b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionForm.vue index 6f0344a..e8979d9 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionForm.vue +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionForm.vue @@ -82,10 +82,10 @@ navigationBarTitleText: '预约检测', - + + + + + + + + + + + + + diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/vue3/AppletSubscribeDetection.data.ts b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/vue3/AppletSubscribeDetection.data.ts index 00916d1..b010524 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/vue3/AppletSubscribeDetection.data.ts +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/vue3/AppletSubscribeDetection.data.ts @@ -31,7 +31,7 @@ export const columns: BasicColumn[] = [ dataIndex: 'price' }, { - title: '类型(自采、上门、到店)', + title: '类型', align:"center", dataIndex: 'type' }, @@ -41,7 +41,7 @@ export const columns: BasicColumn[] = [ dataIndex: 'sendAddressId' }, { - title: '寄送地址(省)', + title: '省', align:"center", dataIndex: 'sendAddressProvince' }, @@ -51,12 +51,12 @@ export const columns: BasicColumn[] = [ dataIndex: 'sendAddressDetail' }, { - title: '寄送地址(市)', + title: '市', align:"center", dataIndex: 'sendAddressCity' }, { - title: '寄送地址(区)', + title: '区', align:"center", dataIndex: 'sendAddressDistrict' }, @@ -72,16 +72,42 @@ export const columns: BasicColumn[] = [ { title: '医院', align:"center", - dataIndex: 'hospital' + dataIndex: 'hospitalId' }, { - title: '医院id', + title: '可选预约类型', align:"center", - dataIndex: 'hospitalId' + dataIndex: 'subscribeType_dictText' + }, + { + title: '状态', + align:"center", + dataIndex: 'status_dictText' + }, + { + title: '产品', + align:"center", + dataIndex: 'productId_dictText' + }, + { + title: '规格', + align:"center", + dataIndex: 'skuId_dictText' + }, + { + title: '订单', + align:"center", + dataIndex: 'orderId_dictText' }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ + { + label: "类型", + field: 'type', + component: 'Input', + //colProps: {span: 6}, + }, ]; //表单数据 export const formSchema: FormSchema[] = [ @@ -111,7 +137,7 @@ export const formSchema: FormSchema[] = [ component: 'Input', }, { - label: '类型(自采、上门、到店)', + label: '类型', field: 'type', component: 'Input', }, @@ -121,7 +147,7 @@ export const formSchema: FormSchema[] = [ component: 'Input', }, { - label: '寄送地址(省)', + label: '省', field: 'sendAddressProvince', component: 'Input', }, @@ -131,12 +157,12 @@ export const formSchema: FormSchema[] = [ component: 'Input', }, { - label: '寄送地址(市)', + label: '市', field: 'sendAddressCity', component: 'Input', }, { - label: '寄送地址(区)', + label: '区', field: 'sendAddressDistrict', component: 'Input', }, @@ -150,13 +176,48 @@ export const formSchema: FormSchema[] = [ }, { label: '医院', - field: 'hospital', + field: 'hospitalId', component: 'Input', }, { - label: '医院id', - field: 'hospitalId', - component: 'Input', + label: '可选预约类型', + field: 'subscribeType', + component: 'JSelectMultiple', + componentProps:{ + dictCode:"applett_subscribe_type" + }, + }, + { + label: '状态', + field: 'status', + component: 'JDictSelectTag', + componentProps:{ + dictCode:"applet_subscribe_status" + }, + }, + { + label: '产品', + field: 'productId', + component: 'JSearchSelect', + componentProps:{ + dict:"" + }, + }, + { + label: '规格', + field: 'skuId', + component: 'JSearchSelect', + componentProps:{ + dict:"applet_product_spec,spec_name,id" + }, + }, + { + label: '订单', + field: 'orderId', + component: 'JSearchSelect', + componentProps:{ + dict:"applet_order,order_no,id" + }, }, // TODO 主键隐藏字段,目前写死为ID { @@ -174,15 +235,19 @@ export const superQuerySchema = { subscribeTime: {title: '预约时间',order: 2,view: 'text', type: 'string',}, phone: {title: '客户电话',order: 3,view: 'text', type: 'string',}, price: {title: '价格',order: 4,view: 'text', type: 'string',}, - type: {title: '类型(自采、上门、到店)',order: 5,view: 'text', type: 'string',}, + type: {title: '类型',order: 5,view: 'text', type: 'string',}, sendAddressId: {title: '寄送地址id',order: 6,view: 'text', type: 'string',}, - sendAddressProvince: {title: '寄送地址(省)',order: 7,view: 'text', type: 'string',}, + sendAddressProvince: {title: '省',order: 7,view: 'text', type: 'string',}, sendAddressDetail: {title: '详细地址',order: 8,view: 'text', type: 'string',}, - sendAddressCity: {title: '寄送地址(市)',order: 9,view: 'text', type: 'string',}, - sendAddressDistrict: {title: '寄送地址(区)',order: 10,view: 'text', type: 'string',}, + sendAddressCity: {title: '市',order: 9,view: 'text', type: 'string',}, + sendAddressDistrict: {title: '区',order: 10,view: 'text', type: 'string',}, subscribeDate: {title: '预约日期',order: 11,view: 'date', type: 'string',}, - hospital: {title: '医院',order: 12,view: 'text', type: 'string',}, - hospitalId: {title: '医院id',order: 13,view: 'text', type: 'string',}, + hospitalId: {title: '医院',order: 12,view: 'text', type: 'string',}, + subscribeType: {title: '可选预约类型',order: 13,view: 'list_multi', type: 'string',dictCode: 'applett_subscribe_type',}, + status: {title: '状态',order: 14,view: 'list', type: 'string',dictCode: 'applet_subscribe_status',}, + productId: {title: '产品',order: 15,view: 'sel_search', type: 'string',dictCode: '',}, + skuId: {title: '规格',order: 16,view: 'sel_search', type: 'string',dictTable: "applet_product_spec", dictCode: 'id', dictText: 'spec_name',}, + orderId: {title: '订单',order: 17,view: 'sel_search', type: 'string',dictTable: "applet_order", dictCode: 'id', dictText: 'order_no',}, }; /** diff --git a/jeecg-boot/jeecg-boot-module/module-pay/.gitignore b/jeecg-boot/jeecg-boot-module/module-pay/.gitignore new file mode 100644 index 0000000..b83d222 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/module-pay/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/jeecg-boot/jeecg-boot-module/module-pay/pom.xml b/jeecg-boot/jeecg-boot-module/module-pay/pom.xml new file mode 100644 index 0000000..56c5594 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/module-pay/pom.xml @@ -0,0 +1,55 @@ + + + + + jeecg-boot-module + org.jeecgframework.boot + 3.8.1 + + + 4.0.0 + module-pay + + + 3.5.0 + + + + + org.springframework.boot + spring-boot-starter-web + + + + + com.alipay.sdk + alipay-sdk-java + 4.11.33.ALL + + + com.aliyun + aliyun-java-sdk-core + 4.5.3 + + + + + com.github.binarywang + weixin-java-pay + ${weixin.version} + + + com.github.binarywang + weixin-java-miniapp + ${weixin.version} + + + com.github.binarywang + weixin-java-mp + ${weixin.version} + + + + diff --git a/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/PayDemoApplication.java b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/PayDemoApplication.java new file mode 100644 index 0000000..cd25be6 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/PayDemoApplication.java @@ -0,0 +1,47 @@ +package org.jeecg; + +import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; +import org.jeecg.modules.pay.MpWxPayService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@SpringBootApplication +public class PayDemoApplication { + + public static void main(String[] args) { + ConfigurableApplicationContext app = SpringApplication.run(PayDemoApplication.class, args); + + // 用法说明 @Autowired MpWxPayService mpWxPayService + MpWxPayService bean = app.getBean(MpWxPayService.class); + //Object callback = bean.createAppOrder("产品名", "127.0.0.1", "89", 1, "20219092", "{}",""); + //System.err.println(callback.toString()); + Object webOrder = bean.createWebOrder("产品名", "117.61.97.157", "89", 1, "20219092", "{}", ""); + System.err.println(webOrder.toString()); + + //缓存该数据用于与异步通知对比处理 + //WxPayAppOrderResult(sign=6E404CB2E71FD391BB0FE2C2B12F5264, prepayId=wx17011430290850d50f73c68d61e80a0000, partnerId=1560997691, appId=wx7081b3f6277c100d, packageValue=Sign=WXPay, timeStamp=1637082870, nonceStr=1637082870392) + //取以上数据交由前端调起支付 + } + + //部署该地址至外网接受异步通知 + @RequestMapping("/notify") + public Object notify(@RequestBody String requestBody, @Autowired MpWxPayService mpWxPayService){ + WxPayOrderNotifyResult notify = mpWxPayService.notify(requestBody); + String outTradeNo = notify.getOutTradeNo(); + System.err.println(outTradeNo); + //对比outTradeNo进行业务处理 + if (notify == null){ + //会继续通知 + return "FAIL"; + } + //不再通知该结果 + return "SUCCESS"; + } + +} diff --git a/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/AlipayService.java b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/AlipayService.java new file mode 100644 index 0000000..4682df9 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/AlipayService.java @@ -0,0 +1,191 @@ +package org.jeecg.modules.pay; + +import com.alibaba.fastjson.JSONObject; +import com.alipay.api.AlipayApiException; +import com.alipay.api.AlipayClient; +import com.alipay.api.domain.AlipayTradeAppPayModel; +import com.alipay.api.domain.AlipayTradeWapPayModel; +import com.alipay.api.internal.util.AlipaySignature; +import com.alipay.api.request.AlipayTradeAppPayRequest; +import com.alipay.api.request.AlipayTradeQueryRequest; +import com.alipay.api.request.AlipayTradeWapPayRequest; +import com.alipay.api.response.AlipayTradeAppPayResponse; +import com.alipay.api.response.AlipayTradeQueryResponse; +import lombok.Data; +import lombok.ToString; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.modules.pay.config.AliPay; +import org.springframework.web.bind.annotation.RequestMapping; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + +@Slf4j +public class AlipayService { + + AlipayClient alipayClient; + + AliPay aliPay; + + final String web_notify_Url = ""; + final String web_retrun_Url = ""; + final String app_notify_Url = ""; + + @RequestMapping("/webpay") + public Object webpay() { + String subject = "小李飞刀"; + String amount = "0.01"; + String body = "uid:9090"; + String orderNo = String.valueOf(System.currentTimeMillis()); + AlipayTradeWapPayRequest alipay_request=new AlipayTradeWapPayRequest(); + AlipayTradeWapPayModel model=new AlipayTradeWapPayModel(); + model.setOutTradeNo(orderNo); + model.setSubject(subject); + model.setTotalAmount(amount); + model.setBody(body); + model.setTimeoutExpress("5m"); + model.setProductCode("QUICK_WAP_PAY"); + alipay_request.setBizModel(model); + alipay_request.setNotifyUrl(web_notify_Url); + alipay_request.setReturnUrl(web_retrun_Url); + + try { + return alipayClient.pageExecute(alipay_request).getBody(); + } catch (AlipayApiException e) { + e.printStackTrace(); + return e.getErrMsg(); + } + } + + @RequestMapping("/reback") + public String webpayNotify() { + return null; + } + + + + + + + + + + + @RequestMapping("apppay") + public Object apppay(String subject, String clientIp, String productId, Integer price, String orderNo, String body){ + System.err.printf("create Order: \n{} \n{} \n{} \n{} \n{} \n{}", subject, clientIp, productId, price, orderNo, body); + + String amount = BigDecimal.valueOf(price/100).toString(); + //String amount = "0.01"; + AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest(); + AlipayTradeAppPayModel model = new AlipayTradeAppPayModel(); + model.setOutTradeNo(orderNo); + model.setBody(body); + model.setSubject(subject); + model.setTimeoutExpress("15m"); + model.setTotalAmount(amount); + model.setProductCode("QUICK_MSECURITY_PAY"); + request.setBizModel(model); + request.setNotifyUrl(app_notify_Url); + try { + AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request); + return response.getBody(); + } catch (AlipayApiException alipayae) { + alipayae.printStackTrace(); + return alipayae.getErrMsg(); + } + } + + public AliPayNotifyResult appNotify(Map requestParams) throws AlipayApiException { + + Map params = new HashMap<>(); + for (String name : requestParams.keySet()) { + String[] values = requestParams.get(name); + String valueStr = ""; + for (int i = 0; i < values.length; i++) { + valueStr = (i == values.length - 1) ? valueStr + values[i] : valueStr + values[i] + ","; + } + if (name.equals("trade_status")) { + System.out.println("交易状态为:" + valueStr); + } + //乱码解决,这段代码在出现乱码时使用。如果mysign和sign不相等也可以使用这段代码转化 + //valueStr = new String(valueStr.getBytes("ISO-8859-1"), "gbk"); + params.put(name, valueStr); + } + + //return new AliPayNotifyResult(params, aliPay.getAliPubilcKey()); + return new AliPayNotifyResult(params, ""); + } + + + public JSONObject selectAlipayResult(String outTradeNo){ + + try { + //实例化客户端(参数:网关地址、商户appid、商户私钥、格式、编码、支付宝公钥、加密类型) + AlipayTradeQueryRequest alipayTradeQueryRequest = new AlipayTradeQueryRequest(); + alipayTradeQueryRequest.setBizContent("{" + "\"out_trade_no\":\""+outTradeNo+"\"" + "}"); + AlipayTradeQueryResponse alipayTradeQueryResponse = alipayClient.execute(alipayTradeQueryRequest); + if(alipayTradeQueryResponse.isSuccess()){ + + switch (alipayTradeQueryResponse.getTradeStatus()) // 判断交易结果 + { + case "TRADE_FINISHED": // 交易结束并不可退款 + break; + case "TRADE_SUCCESS": // 交易支付成功 + break; + case "TRADE_CLOSED": // 未付款交易超时关闭或支付完成后全额退款 + break; + case "WAIT_BUYER_PAY": // 交易创建并等待买家付款 + break; + default: + break; + } + return null; + + } else { + return null; + } + } catch (AlipayApiException e) { + e.printStackTrace(); + } + return null; + + } + + + + + + + + + + + @Data + @ToString + public static class AliPayNotifyResult { + + private String outTradeNo; + private String tradeNo; + private String authAppId; + private String buyerLogonId; + private String gmtPayment; + private String invoiceAmount; + private Boolean verifyResult = false; + + public AliPayNotifyResult(Map params, String pubilcKey){ + this.outTradeNo = new String(params.get("out_trade_no")); + this.tradeNo = new String(params.get("trade_no")); + this.authAppId = new String(params.get("auth_app_id")); + this.buyerLogonId = new String(params.get("buyer_logon_id")); + this.gmtPayment = new String(params.get("gmt_payment")); + this.invoiceAmount = new String(params.get("invoice_amount")); + try { + this.verifyResult = AlipaySignature.rsaCheckV1(params, pubilcKey, "UTF-8", "RSA2"); + } catch (AlipayApiException e) { + e.printStackTrace(); + } + } + } +} \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/MpWxEntPayService.java b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/MpWxEntPayService.java new file mode 100644 index 0000000..eeeae69 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/MpWxEntPayService.java @@ -0,0 +1,43 @@ +package org.jeecg.modules.pay; + +import com.alibaba.fastjson.JSON; +import com.github.binarywang.wxpay.bean.entpay.EntPayRequest; +import com.github.binarywang.wxpay.bean.entpay.EntPayResult; +import com.github.binarywang.wxpay.exception.WxPayException; +import com.github.binarywang.wxpay.service.WxPayService; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.modules.pay.config.WxPay; + +/** + * 微信付款到账户 + **/ +@Slf4j +public class MpWxEntPayService { + + WxPay wxPayConfig; + WxPayService wxPayService; + + public String entPay(Integer amount, String openId, String desc, String ip, String mchOrderNo) { + EntPayRequest entPayRequest = new EntPayRequest(); + entPayRequest.setAppid(wxPayConfig.appId); + entPayRequest.setMchId(wxPayConfig.mchId); + entPayRequest.setPartnerTradeNo(mchOrderNo); + entPayRequest.setOpenid(openId); + entPayRequest.setCheckName("NO_CHECK"); + entPayRequest.setAmount(amount); + entPayRequest.setDescription(desc); + entPayRequest.setSpbillCreateIp(ip); + EntPayResult entPayResult; + try { + entPayResult = wxPayService.getEntPayService().entPay(entPayRequest); + System.err.println("打款结果:" + entPayRequest); + } catch (WxPayException wpe) { + return wpe.getErrCodeDes(); + } catch (Exception e) { + return e.getLocalizedMessage(); + } + return JSON.toJSONString(entPayResult); + } + + +} \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/MpWxPayService.java b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/MpWxPayService.java new file mode 100644 index 0000000..79b2319 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/MpWxPayService.java @@ -0,0 +1,201 @@ +package org.jeecg.modules.pay; + +import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; +import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; +import com.github.binarywang.wxpay.bean.order.WxPayMwebOrderResult; +import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; +import com.github.binarywang.wxpay.constant.WxPayConstants; +import com.github.binarywang.wxpay.exception.WxPayException; +import com.github.binarywang.wxpay.service.WxPayService; +import org.jeecg.modules.pay.config.WxPay; + +import java.io.File; + +@SuppressWarnings("all") +public class MpWxPayService { + + public boolean dev = false; + public WxPay wxPay; + public WxPayService wxPayService; + + + /** + * 生成二维码 + * @param codeUrl + * @param logoFile + * @param sideLength + * @return + */ + public Object createScanPayQrcodeMode2(String codeUrl, File logoFile, Integer sideLength){ + try { + byte[] scanPayQrcodeMode2 = wxPayService.createScanPayQrcodeMode2(codeUrl, null, null); + return scanPayQrcodeMode2; + } catch (Exception e) { + e.printStackTrace(); + return e.getLocalizedMessage(); + } + } + + + /** + * 扫码支付 + * @param productName + * @param clientIp + * @param productId + * @param price + * @param orderNo + * @param openId + * @param body + * @return + */ + public Object createQrOrder(String productName, String clientIp, + String productId, Integer price, String orderNo, String body) { + WxPayUnifiedOrderRequest request = new WxPayUnifiedOrderRequest(); + request.setDeviceInfo("WEB"); //设备号 + request.setTradeType("NATIVE"); //交易类型 + request.setBody(productName); //商品描述 + request.setOutTradeNo(orderNo); //商户订单号 + request.setDetail(productName); //商品详情 + request.setTotalFee(price); //总金额|分计 + request.setSpbillCreateIp(clientIp); //终端IP + request.setNotifyUrl(wxPay.notifyUrl);//设置回调路径 + request.setProductId(productId); //商品id + if (dev) { + request.setTotalFee(price); + request.setNotifyUrl(wxPay.notifyUrlDev); + } + try { + Object order = wxPayService.unifiedOrder(request); + return order; + } catch (WxPayException e) { + e.printStackTrace(); + return e.getLocalizedMessage(); + } + } + + + /** + * 微信吊起支付 + * @param productName + * @param clientIp + * @param productId + * @param price + * @param orderNo + * @param openId + * @param body + * @return + */ + public Object createOrder(String productName, String clientIp, + String productId, Integer price, String orderNo, + String openId, String body){ + WxPayUnifiedOrderRequest request = new WxPayUnifiedOrderRequest(); + request.setDeviceInfo("WEB"); //设备号 + request.setTradeType("JSAPI"); //交易类型 + request.setBody(productName); //商品描述 + request.setOutTradeNo(orderNo); //商户订单号 + request.setDetail(productName); //商品详情 + request.setTotalFee(price); //总金额|分计 + request.setSpbillCreateIp(clientIp); //终端IP + request.setNotifyUrl(wxPay.notifyOneUrl);//设置回调路径 + request.setProductId(productId); //商品id + request.setOpenid(openId); //JSAPI OPENID + if (dev){ + request.setTotalFee(price); + request.setNotifyUrl(wxPay.notifyUrlOneDev); + } + try { + Object order = wxPayService.createOrder(request); + return order; + } catch (WxPayException e) { + e.printStackTrace(); + return e.getLocalizedMessage(); + } + } + + + public WxPayOrderNotifyResult notify(String requestBody){ + WxPayOrderNotifyResult notify = null; + try { + notify = wxPayService.parseOrderNotifyResult(requestBody); + } catch (WxPayException e) { + e.printStackTrace(); + } + return notify; + } + + + public Object createAppOrder(String productName, String clientIp, + String productId, Integer price, + String orderNo, String body, + String openid){ + WxPayUnifiedOrderRequest request = new WxPayUnifiedOrderRequest(); + request.setDeviceInfo("WEB"); + request.setBody(productName); + request.setOutTradeNo(orderNo); + request.setDetail(productName); + request.setTotalFee(price); + request.setSpbillCreateIp(clientIp); + request.setNotifyUrl(wxPay.notifyUrl); + request.setTradeType(WxPayConstants.TradeType.JSAPI); + request.setProductId(productId); + request.setAppid(wxPay.appId); + request.setOpenid(openid); + if (dev){ + request.setTotalFee(price); + request.setNotifyUrl(wxPay.notifyUrlDev); + request.setAppid(wxPay.appId); + request.setOpenid(openid); + } + try { + Object order = wxPayService.createOrder(request); + return order; + } catch (WxPayException e) { + e.printStackTrace(); + return e.getLocalizedMessage(); + } + } + + + public Object createWebOrder(String productName, String clientIp, + String productId, Integer price, + String orderNo, String body, + String openid){ + WxPayUnifiedOrderRequest request = new WxPayUnifiedOrderRequest(); + request.setDeviceInfo("WEB"); + request.setBody(productName); + request.setOutTradeNo(orderNo); + request.setDetail(productName); + request.setTotalFee(price); + request.setSpbillCreateIp(clientIp); + request.setNotifyUrl(wxPay.notifyUrl); + request.setTradeType(WxPayConstants.TradeType.MWEB); + request.setProductId(productId); + request.setAppid(wxPay.appId); + request.setOpenid(openid); + if (dev){ + request.setTotalFee(price); + request.setNotifyUrl(wxPay.notifyUrlDev); + request.setAppid(wxPay.appId); + request.setOpenid(openid); + } + try { + Object order = wxPayService.createOrder(request); + return order; + } catch (WxPayException e) { + e.printStackTrace(); + return e.getLocalizedMessage(); + } + } + + public WxPayOrderNotifyResult appNotify(String requestBody){ + WxPayOrderNotifyResult notify = null; + try { + notify = wxPayService.parseOrderNotifyResult(requestBody); + } catch (WxPayException e) { + e.printStackTrace(); + } + return notify; + } + + +} diff --git a/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/AliPay.java b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/AliPay.java new file mode 100644 index 0000000..b04c864 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/AliPay.java @@ -0,0 +1,23 @@ +package org.jeecg.modules.pay.config; + +import lombok.Data; +import lombok.ToString; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +@Data +@ToString +@Component +@PropertySource("classpath:pay_alipay.properties") +@ConfigurationProperties(prefix = "alipay") +public class AliPay { + + private String appId; + + private String aliPubilcKey; + + private String appPrivateKey; + + private String appPubilcKey; +} diff --git a/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/WeixinConfig.java b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/WeixinConfig.java new file mode 100644 index 0000000..5ef88a9 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/WeixinConfig.java @@ -0,0 +1,29 @@ +package org.jeecg.modules.pay.config; + +import com.github.binarywang.wxpay.service.WxPayService; +import lombok.extern.java.Log; +import org.jeecg.modules.pay.MpWxPayService; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.annotation.Resource; + +@Log +@Configuration +public class WeixinConfig { + + @Resource + WxPay wxPay; + @Resource + WxPayService wxPayService; + + @Bean + public MpWxPayService mpWxPayService(){ + MpWxPayService mpWxPayService = new MpWxPayService(); + mpWxPayService.wxPay = wxPay; + mpWxPayService.wxPayService = wxPayService; + mpWxPayService.dev = true; + log.info("MpWxPayService is regiterd (" + (mpWxPayService.dev?"dev":"prod") + ") as " + wxPay.mchId); + return mpWxPayService; + } +} diff --git a/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/WxPay.java b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/WxPay.java new file mode 100644 index 0000000..9f9891f --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/WxPay.java @@ -0,0 +1,79 @@ +package org.jeecg.modules.pay.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +@Data +@Component +@PropertySource("classpath:pay_weixin.properties") +@ConfigurationProperties(prefix = "pay") +public class WxPay { + + /** + * 微信支付mchId + */ + public String mchId; + + /** + * app支付appId JS支付openId + */ + public String appId; + + /** + * 微信支付mchKey + */ + public String mchKey; + + /** + * 回调地址 + */ + public String notifyUrl; + + /** + * 回调地址dev + */ + public String notifyUrlDev; + + + /** + * 回调地址 + */ + public String notifyOneUrl; + + /** + * 回调地址dev + */ + public String notifyUrlOneDev; + + /** + * 签名类型 + */ + public String signType; + + /** + * 支付证书路径 + */ + public String keyPath; + + /** + * 回调地址 + */ + public String notifyOrderUrl; + + /** + * 回调地址dev + */ + public String notifyOrderUrlDev; + + + + + + + + + + +} diff --git a/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/WxPayConfiguration.java b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/WxPayConfiguration.java new file mode 100644 index 0000000..07c2099 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/module-pay/src/main/java/org/jeecg/modules/pay/config/WxPayConfiguration.java @@ -0,0 +1,53 @@ +package org.jeecg.modules.pay.config; + +import com.github.binarywang.wxpay.config.WxPayConfig; +import com.github.binarywang.wxpay.constant.WxPayConstants; +import com.github.binarywang.wxpay.exception.WxPayException; +import com.github.binarywang.wxpay.service.WxPayService; +import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl; +import lombok.RequiredArgsConstructor; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.annotation.Resource; + +@Configuration +@RequiredArgsConstructor +@ConditionalOnClass(WxPayService.class) +public class WxPayConfiguration { + + @Resource + private WxPay wxPay; + + @Bean + public WxPayService wxMpPayService() { + WxPayConfig payConfig = new WxPayConfig(); + payConfig.setAppId(wxPay.appId); + payConfig.setMchId(wxPay.mchId); + payConfig.setMchKey(wxPay.mchKey); + payConfig.setKeyPath(wxPay.keyPath); + payConfig.setSignType(WxPayConstants.SignType.MD5); + WxPayService wxPayService = new WxPayServiceImpl(); + wxPayService.setConfig(payConfig); + return wxPayService; + } + +// @Bean("saboxWxPayService") +// public WxPayService saboxWxPayService(){ +// WxPayConfig payConfig = new WxPayConfig(); +// WxPayService wxPayService = new WxPayServiceImpl(); +// String sandboxSignKey = null; +// try { +// wxPayService.setConfig(payConfig); +// sandboxSignKey = wxPayService.getSandboxSignKey(); +// } catch (WxPayException e) { +// e.printStackTrace(); +// } +// payConfig.setUseSandboxEnv(true); +// payConfig.setMchKey(sandboxSignKey); +// wxPayService.setConfig(payConfig); +// return wxPayService; +// } + +} \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/module-pay/src/main/resources/apiclient_cert.p12 b/jeecg-boot/jeecg-boot-module/module-pay/src/main/resources/apiclient_cert.p12 new file mode 100644 index 0000000000000000000000000000000000000000..f41d60b478c48930efacdfaa833f8cda59076f7c GIT binary patch literal 2782 zcmY+^c{~(~76%Pq@ZCVs%qZ0y|{GBFs`jh<%pQ~{>o0a zUB%cXk<}dbTZs8ZQm)KQe&bK^-Wb*+C zcbsXrBXyQgx~KU5B3aB3OT8D$Ca=-u^vS2Fq+v{or&{aq4s~)&c!9Z;n1phhEJLEK z9vud3Ukv42&pUc5xNb>L~|&= zt2`M%mHYg8Td2MI`rQZ@?W{&cNNnoB;Q^}bk_M6?)j?X`eo)t_r?6X+$?$u+DB|V3 z>lE827yd*((XM)_@f!+oU}O44RmL4?@tHUXHF#ruH1J$v>f1H$fMJ=px)S@}f3kZX zHqdEbK-bmn&rTEs6|(sg{nTQ_3_7*P57DYD;iO3VYrq3MYuK zttY51bN7aj=l9U`{t!YxCgK8HIK3ir_^n8M5CFTXyp>2+`4*Wn7rP$V8p5He=_BXC zV!$P53zCs5o{lk_Z%b}B%BfvSY$-aorLY(O;sE{YK@%gphXS6lo2i|q?9v5nqb6RR zSZbPXz4%GjfeKjjw8B}{*zj|H^w_-?yN$Mbf7+&iS0YuT*o;?fe$Xj=>|tl;SUvD| zM&4jRdK#g=?R(UH|0#Vazusrru)TfJ8_nE3%wdp1M(s763U6neX0iU~Iz!C5Y5iXd zPp%t92dPvWbU%*sd+aVD1(4)~SL-S&m~m=ieXc(i{FYvt5)N775=h*nvQHm5p`$I% zsIPoWaOPtt$RVME5w0tL&Z|+K>VO5r+`w&O1=2BpfahU+@0I}-4FQ~^Mp%u7o+7g z{W?N}YCpLqIRAc3R#e2xex=!{SRVCDhn9sggp04>4Wwx@=^F2 z!`?Q7pkFBTI^bQ{OW0({mbc)j(s*BM?1re60N8Ah8T|f^RCkiQf`3%+{&;}TUfpzX z8tBvqf&+8X=HX0yN4*&7WUspt!i(fyxNYjZ(wd^>NbmwL;KxuwcDf}z&vzC7q^jwu zTL12In^QTFsh6_stop!RP&x%6i&cFfSrxLXTrn3Nt8+|Z$p651Od=YLhj<;wZpY;W zh5v^^7z;2T4_-Nja^e4U1pTcevu;a^vmfdDw~pXr9iz^*v_W4%ReQg(K1X`*yq$AQ zXQ{%)4AiamQuV~O^p+X>y+60BEt_IgbNMY|=Z7jEB`V$0%WyC8r%0Ty=zWIpwPLV_ zgZIG+@%|Vc%;-*?NI|KvP`!hlN=ekF;a59dA2-IyzV>Fe#Sv=FY+9T&r)n`{8f9AUwckv zvF@xBtu7^!YmJF<;lEcFvle)sZud&=?xdK!CF;we_XXN!6MTvNQ<)`1v77jmF9FGV zp+`_x$QKFMf@`X6P1_{NSCG8?P?n}w#yhk_YnP2*+j;y7H%Pjg|2=9T-Xas%&l2WN z4RB4fAM9jGka=_(Hd$00M=-8x6?J`T*M(x!F8wi)(9k##@LC(9>eN@3wVHizS5k*C zZ*(|Yuom5`GG^UllJ`g^Zx(mFs!5O7+b%mA^HNsa z{?Md3W23Wz((g)M-L-|2Z^V22AjIz3oF|pZL;kd}Zx;hdw{V z7SKJfswtvA$)-cwYIvpvon@H87CoQ=|6SG|%>0F8OYbaPqE zDGww(5wE80A)-PKt%q^kKJ`+A#K}voW<`~pd|AT`1*PSD2pvOrYZ<=T8%i(GNe`JC z~(SHmwnYiz&V)N8)L%h$QcT?sqTD2^wFY<%qBC(Ep1ftX3#Df`*R>NE@urN z5Tqe{N95p1r6U-f=%8OTOAB5ziA;(U-K6bR#c*Yusexy*AEn(NO<0lw0ZwIg{V4xb ze>1DZaRP~5SiM_lNhQxc9yda|>>z_@;!OBf&f6G6tbL?DS>YE)Z56hjlW6en?~4^n z$-$jnU}EJ^vxG)|Sk?>qGa22Ck%*UKY91U_Eg0gpWHn5SXk(C1;J<2-J(({9$Yy+A6*yOuUlnC!?Z$cWdZ#idSQ7*h}{!4b;6&Z;y2aW9t@L1z! z=dHm_4RX7}5$>XVZ~5*(!GpaOb!2e-(p>x1z>1$$63q$s8WH}<|GOriozjCRPDL0 zNoK~8vE12F6l2mOAfJAqvriE=oxsz$pVDKyI%S-Bxyeep`7JSn zD8ufqWS)Kd%cL=N`55^Xe3$fr=eNGsh#w)Cz-<;|=%?d|I~`mr12+S?e)CjUf8 zzO<;q^epXyBSQMWIjeecg-module-demo jeecg-boot-module-airag jeecgboot-boot-applet + module-pay diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/apiclient_cert.p12 b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/apiclient_cert.p12 new file mode 100644 index 0000000000000000000000000000000000000000..5f4692d524493eb34407f0ce96bba8f7acd70c90 GIT binary patch literal 2782 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 WiI@4+_TEf`z_yQBes~De_x}r(b}Xy_ literal 0 HcmV?d00001 diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/apiclient_cert.pem b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/apiclient_cert.pem new file mode 100644 index 0000000..566a146 --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/apiclient_cert.pem @@ -0,0 +1,25 @@ +-----BEGIN CERTIFICATE----- +MIIENDCCAxygAwIBAgIUS2ctG8sgsiCB/WxeyqfBJ3rxt3IwDQYJKoZIhvcNAQEL +BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT +FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg +Q0EwHhcNMjUwNjIwMDg1MTE2WhcNMzAwNjE5MDg1MTE2WjCBjTETMBEGA1UEAwwK +MTcxMTAzMDQ2OTEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMTkwNwYDVQQL +DDDlvJjlpKrohb7ooavvvIjkuIrmtbfvvInljLvnlpfnp5HmioDmnInpmZDlhazl +j7gxCzAJBgNVBAYTAkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBAN4LlVj/OWVE0T1W7ZpOqDDLYtbHOPWY8VbvJdsH +imHaYfLVB2ouaN8FDNHATHvInj2D0BwxnFuWcusJr8k5Pyu/eEkGmsvWSLefY6dd +qrF7F/eZCber2UTJ8Q69gUSSaXAhZ3bkppKP+JcNSRtaswqT/pLMjRrx4MLZbyTa +pTqsEGDRSpXG1694vgv8MOD3YdmTLwJ+4paS7QZ5wZypPWLnK7/5haTJWoeLy6G4 +ZOdBHqnksh3uQ7DQQEl0mx4i+bQdIDN2V4qAvQJM3CQlVJbYBqIPqRQJdH1Cqpvh +vtwTjD4UuZw9gX1vVKBnitE85r2qXmpTgIigPtHkIemKWXsCAwEAAaOBuTCBtjAJ +BgNVHRMEAjAAMAsGA1UdDwQEAwID+DCBmwYDVR0fBIGTMIGQMIGNoIGKoIGHhoGE +aHR0cDovL2V2Y2EuaXRydXMuY29tLmNuL3B1YmxpYy9pdHJ1c2NybD9DQT0xQkQ0 +MjIwRTUwREJDMDRCMDZBRDM5NzU0OTg0NkMwMUMzRThFQkQyJnNnPUhBQ0M0NzFC +NjU0MjJFMTJCMjdBOUQzM0E4N0FEMUNERjU5MjZFMTQwMzcxMA0GCSqGSIb3DQEB +CwUAA4IBAQCBwGs4zHnrTAuGMIxknKqU1Z1ZpYGRRomZBZrygMOBwPkPOHOYAgyu +8+JBPTtYp9Nq25nYpcM8GXHFwAGB28Z8jvRnAXVg/VMRTFmrTEI1mg1NZF1PNo0f +wFJT/71ZU6uT1vJBUVLbPvfIHmnue6Uk56JAqUZNaJPyup7LDC01x9MsCzsHFimZ +b4D9g3hhTVvfuChXQE4xpysUP2GgRRtY13w9bxwLYoR1NVGPC9un9Dpszs20ExNt +flSQiw4pIdJlKHaFclD03tlFctH9pl24b10WsNVzpsq1akIjLFscykq+ERzWVn/w +YtGglgy+OG1fPFna3xapR/k7MDcIQ2QO +-----END CERTIFICATE----- diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/apiclient_key.pem b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/apiclient_key.pem new file mode 100644 index 0000000..ebcf2c9 --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/apiclient_key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDeC5VY/zllRNE9 +Vu2aTqgwy2LWxzj1mPFW7yXbB4ph2mHy1QdqLmjfBQzRwEx7yJ49g9AcMZxblnLr +Ca/JOT8rv3hJBprL1ki3n2OnXaqxexf3mQm3q9lEyfEOvYFEkmlwIWd25KaSj/iX +DUkbWrMKk/6SzI0a8eDC2W8k2qU6rBBg0UqVxteveL4L/DDg92HZky8CfuKWku0G +ecGcqT1i5yu/+YWkyVqHi8uhuGTnQR6p5LId7kOw0EBJdJseIvm0HSAzdleKgL0C +TNwkJVSW2AaiD6kUCXR9Qqqb4b7cE4w+FLmcPYF9b1SgZ4rRPOa9ql5qU4CIoD7R +5CHpill7AgMBAAECggEBAJteHY1dYKrUgVhbV/wt54/k8G76jYeEEfLTeXiOCS05 +ImpI11xbxvOuU+78kEfY86h1cAwaRp7rYdPGPmMdlG8nFaJ7ZZsVgGJDu/YjG0n+ +qKGOSvdi3q88Ylj/DtGNZQuZxAy0Jz3MUZRYLnxedYMEVRAg4ucksjGE9TkjaJPo +/XEJBgPFAAS0p802cLD+P6rn08IQXOws8hvempRbwhtHbhmnKzytf54tQxqD0CJ6 +b9QZW0wourw7PTnIA1Ss7XmJ0YV0i5Fdc9aUP7nvBqdW44cvq21zOOjJ4o4SyaXO +l0qyfvwoTla6xqjW5gIVltlBD8Jp8ZEyTX9q7rdEtQkCgYEA/Xtg/zxOmE5i2xdV ++ZhYS+axTdPBRs31ZMifMNsgjRyblzgzdxA6qt7XS7fSdXJ2h2oZetU5jOHITt7z +Q/D7GTfe9yrFqYrRo8Ckj8zgAPuZwGA6Vjkr+SoLNwnWiFo6OrGUGrrGRT1dk7t0 +rsD+e0V66sAfiMXLrRV/OsWWsi0CgYEA4EBCSFG+TILW7Gheev4FmEXl48jf8m7u +nKQwgyEPn1CE/q1K6V+Rrq8R45HEPxtSZuPUwR1la3pLFnCFnE6fMT7sFcF77JuZ +eem29NJoL7yBvCezPoRXxBaXTWLL7MOCgOBTb+N5Ty46ECWMDUSxwCK45nZTaLIZ +oJ1ykujTC0cCgYEAnQURp+oesaBVAmzpOC0T/SiRiqly375zlZPlcOk8t80R4NHS +p52pCfHyohfjyhc2r1mdIQb2mHvAjoLzZJHhqdR/TNL1ELpKdMq/5cg+tr0kmBPD +72eJAtb1jYmNmHdz/KnGGey7J2cFEZ+cfyhUO95lbwfGQP5t1fEsGCcP250CgYB7 +iss5XldRfW98VE9gwNtCNZfd8sd1nymzgDz9sNQTd9+dEslHYpA2xVo8ngyYm6u8 +5V1Leq9qE7iURy9EmofXMIwNvEdSZbKa2Ggj3lrpmZd7mf+EvJJBhBSc3IXuDROz +fmJZLN+jAJuaU6Uhliu65yYoSR3QevXlZ3g8eSnzdwKBgBxoA1/79eW/vIlypk3G +ujEToMVY1e0JQTIe+ns0BgxG/iP1zHSJXUqzCUCirArgiQUxXMhV5oO5VApgxQ/e +Aeb/jw7Rr0V3+/tx6KzBqRej5rtNB7YBj5XDtIypHjEhgCJXgqUUeIY1pu01l7F8 +8H+Jh6L0yQ+oslN1Uf9BLRrq +-----END PRIVATE KEY----- diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml index 38875cc..5183aa6 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml @@ -331,8 +331,8 @@ wechat: mpAppId: wx8ff2ab9559aa6387 # 微信小程序appid mpAppSecret: 19427a20219ab25b187e4179aea3a5f4 # 微信小程序密钥 merchantId: 1711030469 # 商户号 - privateKeyPath: module-system/src/main/resources/apiclient_key.pem #本地私钥路径 - publicKeyPath: module-system/src/main/resources/pub_key.pem #本地公钥路径 + privateKeyPath: jeecg-system-start/src/main/resources/apiclient_key.pem #本地私钥路径 + publicKeyPath: jeecg-system-start/src/main/resources/pub_key.pem #本地公钥路径 # privateKeyPath: /data/app-test/hly/cerFile/apiclient_key.pem #线上私钥路径 # publicKeyPath: /data/app-test/hly/cerFile/pub_key.pem #线上公钥路径 publicKeyId: PUB_KEY_ID_0117018416542025022100395100001649 #公钥 diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/pay_alipay.properties b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/pay_alipay.properties new file mode 100644 index 0000000..e1704f9 --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/pay_alipay.properties @@ -0,0 +1,4 @@ +alipay.appId=111 +alipay.aliPubilcKey=111 +alipay.appPubilcKey=111 +alipay.appPrivateKey=111 \ No newline at end of file diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/pay_weixin.properties b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/pay_weixin.properties new file mode 100644 index 0000000..f28e13c --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/pay_weixin.properties @@ -0,0 +1,8 @@ +pay.mchId=1711030469 +pay.appId=wx8ff2ab9559aa6387 +pay.mchKey=0fdb77429ffdf206c151af76a663041c +pay.keyPath=classpath:apiclient_cert.pem +pay.notifyUrl=https://prod-api.budingxiaoshuo.com/health-admin/order/payNotify +pay.notifyUrlDev=https://prod-api.budingxiaoshuo.com/health-admin/order/payNotify +pay.notifyOneUrl=https://prod-api.budingxiaoshuo.com/health-admin/order/payNotify +pay.notifyUrlOneDev=https://prod-api.budingxiaoshuo.com/health-admin/order/payNotify