From 481473c310d0c37a981b565a0634832f1c9d6537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B0=8F=E5=BC=A0?= <1085577365@qq.com> Date: Mon, 15 May 2023 10:15:43 +0800 Subject: [PATCH 1/4] =?UTF-8?q?App=E8=AE=A2=E5=8D=95=E3=80=81=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=AE=9E=E4=BD=93=E7=B1=BB--=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/product/ProductController.java | 16 ++--- ...tResponse.java => IndexProductRespVO.java} | 3 +- ...Response.java => ProductDetailRespVO.java} | 2 +- .../convert/product/StoreProductConvert.java | 4 +- .../shop/service/product/ProductService.java | 16 ++--- .../product/impl/ProductServiceImpl.java | 68 +++++++++---------- 6 files changed, 55 insertions(+), 54 deletions(-) rename yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/{IndexProductResponse.java => IndexProductRespVO.java} (96%) rename yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/{ProductDetailResponse.java => ProductDetailRespVO.java} (96%) diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/ProductController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/ProductController.java index 6d466b57a..af74a952b 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/ProductController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/ProductController.java @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.shop.controller.app.product; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailResponse; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailRespVO; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct; import cn.iocoder.yudao.module.shop.request.product.ProductListRequest; import cn.iocoder.yudao.module.shop.request.product.ProductRequest; @@ -49,7 +49,7 @@ public class ProductController { */ @Operation(summary = "热门商品推荐") @RequestMapping(value = "/product/hot", method = RequestMethod.GET) - public CommonResult> getHotProductList(@Validated PageParam pageParamRequest) { + public CommonResult> getHotProductList(@Validated PageParam pageParamRequest) { return CommonResult.success(productService.getHotProductList(pageParamRequest)); } @@ -58,7 +58,7 @@ public class ProductController { */ @Operation(summary = "优选商品推荐") @RequestMapping(value = "/product/good", method = RequestMethod.GET) - public CommonResult> getGoodProductList() { + public CommonResult> getGoodProductList() { return CommonResult.success(productService.getGoodProductList()); } @@ -76,7 +76,7 @@ public class ProductController { */ @Operation(summary = "商品列表") @RequestMapping(value = "/products", method = RequestMethod.GET) - public CommonResult> getList(@Validated ProductRequest request, @Validated PageParam pageParamRequest) { + public CommonResult> getList(@Validated ProductRequest request, @Validated PageParam pageParamRequest) { return CommonResult.success(productService.getList(request, pageParamRequest)); } @@ -86,7 +86,7 @@ public class ProductController { @Operation(summary = "商品详情") @RequestMapping(value = "/product/detail/{id}", method = RequestMethod.GET) @Parameter(name = "type", description = "normal-正常,video-视频") - public CommonResult getDetail(@PathVariable Integer id, @RequestParam(value = "type", defaultValue = "normal") String type) { + public CommonResult getDetail(@PathVariable Integer id, @RequestParam(value = "type", defaultValue = "normal") String type) { return CommonResult.success(productService.getDetail(id, type)); } @@ -124,7 +124,7 @@ public class ProductController { */ @Operation(summary = "商品列表(个别分类模型使用)") @RequestMapping(value = "/product/list", method = RequestMethod.GET) - public CommonResult> getProductList(@Validated ProductListRequest request, @Validated PageParam pageParamRequest) { + public CommonResult> getProductList(@Validated ProductListRequest request, @Validated PageParam pageParamRequest) { return CommonResult.success(productService.getCategoryProductList(request, pageParamRequest)); } @@ -133,7 +133,7 @@ public class ProductController { */ @Operation(summary = "商品规格详情") @RequestMapping(value = "/product/sku/detail/{id}", method = RequestMethod.GET) - public CommonResult getSkuDetail(@PathVariable Integer id) { + public CommonResult getSkuDetail(@PathVariable Integer id) { return CommonResult.success(productService.getSkuDetail(id)); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/IndexProductResponse.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/IndexProductRespVO.java similarity index 96% rename from yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/IndexProductResponse.java rename to yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/IndexProductRespVO.java index f0a791d41..5eb436968 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/IndexProductResponse.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/IndexProductRespVO.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import java.io.Serializable; import java.math.BigDecimal; /** @@ -24,7 +25,7 @@ import java.math.BigDecimal; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @Schema(description="首页商品对象") -public class IndexProductResponse { +public class IndexProductRespVO implements Serializable { @Schema(description = "商品id") diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/ProductDetailResponse.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/ProductDetailRespVO.java similarity index 96% rename from yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/ProductDetailResponse.java rename to yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/ProductDetailRespVO.java index c4f1a7b62..5a8126d1c 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/ProductDetailResponse.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/ProductDetailRespVO.java @@ -28,7 +28,7 @@ import java.util.List; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @Schema(description="商品详情H5") -public class ProductDetailResponse implements Serializable { +public class ProductDetailRespVO implements Serializable { private static final long serialVersionUID=1L; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/convert/product/StoreProductConvert.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/convert/product/StoreProductConvert.java index 843022150..613bcc23d 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/convert/product/StoreProductConvert.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/convert/product/StoreProductConvert.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.shop.convert.product; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct; import cn.iocoder.yudao.module.shop.vo.product.StoreProductVO; import org.mapstruct.Mapper; @@ -14,5 +14,5 @@ public interface StoreProductConvert { StoreProductVO convert(StoreProduct bean); - List convert1(List bean); + List convert1(List bean); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/ProductService.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/ProductService.java index e453245d4..8b42dad9e 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/ProductService.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/ProductService.java @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.shop.service.product; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailResponse; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailRespVO; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct; import cn.iocoder.yudao.module.shop.request.product.ProductListRequest; import cn.iocoder.yudao.module.shop.request.product.ProductRequest; @@ -41,7 +41,7 @@ public interface ProductService { * @param pageParamRequest 分页参数 * @return CommonPage */ - PageInfo getList(ProductRequest request, PageParam pageParamRequest); + PageInfo getList(ProductRequest request, PageParam pageParamRequest); /** * 获取商品详情 @@ -49,14 +49,14 @@ public interface ProductService { * @param type normal-正常,void-视频 * @return 商品详情信息 */ - ProductDetailResponse getDetail(Integer id, String type); + ProductDetailRespVO getDetail(Integer id, String type); /** * 获取商品SKU详情 * @param id 商品编号 * @return 商品详情信息 */ - ProductDetailResponse getSkuDetail(Integer id); + ProductDetailRespVO getSkuDetail(Integer id); /** * 商品评论列表 @@ -79,7 +79,7 @@ public interface ProductService { * @param pageRequest 分页参数 * @return CommonPage */ - PageInfo getHotProductList(PageParam pageRequest); + PageInfo getHotProductList(PageParam pageRequest); /** * 商品详情评论 @@ -92,7 +92,7 @@ public interface ProductService { * 优选商品推荐 * @return CommonPage */ - PageInfo getGoodProductList(); + PageInfo getGoodProductList(); /** * 商品列表(个别分类模型使用) @@ -100,7 +100,7 @@ public interface ProductService { * @param pageParamRequest 分页参数 * @return CommonPage */ - PageInfo getCategoryProductList(ProductListRequest request, PageParam pageParamRequest); + PageInfo getCategoryProductList(ProductListRequest request, PageParam pageParamRequest); /** * 获取商品排行榜 diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/impl/ProductServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/impl/ProductServiceImpl.java index 3f3eb2e2d..14b6df6b8 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/impl/ProductServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/impl/ProductServiceImpl.java @@ -9,8 +9,8 @@ import cn.iocoder.yudao.module.infra.api.config.ApiConfigApi; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.shop.constants.SysConfigConstants; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailResponse; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailRespVO; import cn.iocoder.yudao.module.shop.convert.product.StoreProductConvert; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProductAttr; @@ -107,18 +107,18 @@ public class ProductServiceImpl implements ProductService { * @return CommonPage */ @Override - public PageInfo getList(ProductRequest request, PageParam pageRequest) { + public PageInfo getList(ProductRequest request, PageParam pageRequest) { List storeProductList = storeProductService.findH5List(request, pageRequest); if (CollUtil.isEmpty(storeProductList)) { return new PageInfo<>(new ArrayList<>()); } - Page productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); + Page productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); PageInfo storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList); - List productResponseArrayList = new ArrayList<>(); + List productResponseArrayList = new ArrayList<>(); for (StoreProduct storeProduct : storeProductList) { - IndexProductResponse productResponse = new IndexProductResponse(); + IndexProductRespVO productResponse = new IndexProductRespVO(); List activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity()); // 活动类型默认:直接跳过 if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) { @@ -161,7 +161,7 @@ public class ProductServiceImpl implements ProductService { productResponseArrayList.add(productResponse); } - PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); + PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list"); return productResponseCommonPage; @@ -174,22 +174,22 @@ public class ProductServiceImpl implements ProductService { * @return 商品详情信息 */ @Override - public ProductDetailResponse getDetail(Integer id, String type) { + public ProductDetailRespVO getDetail(Integer id, String type) { // 获取用户 MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId()); - ProductDetailResponse productDetailResponse = new ProductDetailResponse(); + ProductDetailRespVO productDetailRespVO = new ProductDetailRespVO(); // 查询商品 StoreProduct storeProduct = storeProductService.getH5Detail(id); // 设置会员价 storeProduct.setVipPrice(storeProduct.getPrice()); - productDetailResponse.setProductInfo(storeProduct); + productDetailRespVO.setProductInfo(storeProduct); // 获取商品规格 List attrList = attrService.getListByProductIdAndType(storeProduct.getId(), Constants.PRODUCT_TYPE_NORMAL); // 根据制式设置attr属性 - productDetailResponse.setProductAttr(attrList); + productDetailRespVO.setProductAttr(attrList); // 根据制式设置sku属性 HashMap skuMap = new HashMap<>(); @@ -202,11 +202,11 @@ public class ProductServiceImpl implements ProductService { skuMap.put(atr.getSuk(), atr); } - productDetailResponse.setProductValue(skuMap); + productDetailRespVO.setProductValue(skuMap); // 商品活动 List activityAllH5 = productUtils.getProductAllActivity(storeProduct); - productDetailResponse.setActivityAllH5(activityAllH5); + productDetailRespVO.setActivityAllH5(activityAllH5); // 商品浏览量+1 StoreProduct updateProduct = new StoreProduct(); @@ -216,7 +216,7 @@ public class ProductServiceImpl implements ProductService { // TODO 保存用户访问记录 - return productDetailResponse; + return productDetailRespVO; } /** @@ -225,18 +225,18 @@ public class ProductServiceImpl implements ProductService { * @return 商品详情信息 */ @Override - public ProductDetailResponse getSkuDetail(Integer id) { + public ProductDetailRespVO getSkuDetail(Integer id) { // 获取用户 MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId()); - ProductDetailResponse productDetailResponse = new ProductDetailResponse(); + ProductDetailRespVO productDetailRespVO = new ProductDetailRespVO(); // 查询商品 StoreProduct storeProduct = storeProductService.getH5Detail(id); // 获取商品规格 List attrList = attrService.getListByProductIdAndType(storeProduct.getId(), Constants.PRODUCT_TYPE_NORMAL); // 根据制式设置attr属性 - productDetailResponse.setProductAttr(attrList); + productDetailRespVO.setProductAttr(attrList); // 根据制式设置sku属性 HashMap skuMap = new HashMap<>(); @@ -248,9 +248,9 @@ public class ProductServiceImpl implements ProductService { skuMap.put(atr.getSuk(), atr); } - productDetailResponse.setProductValue(skuMap); + productDetailRespVO.setProductValue(skuMap); - return productDetailResponse; + return productDetailRespVO; } /** @@ -326,18 +326,18 @@ public class ProductServiceImpl implements ProductService { * @return CommonPage */ @Override - public PageInfo getHotProductList(PageParam pageRequest) { + public PageInfo getHotProductList(PageParam pageRequest) { List storeProductList = storeProductService.getIndexProduct(Constants.INDEX_HOT_BANNER, pageRequest); if (CollUtil.isEmpty(storeProductList)) { return new PageInfo<>(new ArrayList<>()); } - Page productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); + Page productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); PageInfo storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList); - List productResponseArrayList = new ArrayList<>(); + List productResponseArrayList = new ArrayList<>(); for (StoreProduct storeProduct : storeProductList) { - IndexProductResponse productResponse = new IndexProductResponse(); + IndexProductRespVO productResponse = new IndexProductRespVO(); List activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity()); // 活动类型默认:直接跳过 if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) { @@ -380,7 +380,7 @@ public class ProductServiceImpl implements ProductService { productResponseArrayList.add(productResponse); } - PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); + PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list"); return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList)); @@ -404,7 +404,7 @@ public class ProductServiceImpl implements ProductService { * @return CommonPage */ @Override - public PageInfo getGoodProductList() { + public PageInfo getGoodProductList() { PageParam pageRequest = new PageParam(); pageRequest.setPageSize(9); List storeProductList = storeProductService.getIndexProduct(Constants.INDEX_RECOMMEND_BANNER, pageRequest); @@ -412,12 +412,12 @@ public class ProductServiceImpl implements ProductService { return new PageInfo<>(new ArrayList<>()); } - Page productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); + Page productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); PageInfo storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList); - List productResponseArrayList = new ArrayList<>(); + List productResponseArrayList = new ArrayList<>(); for (StoreProduct storeProduct : storeProductList) { - IndexProductResponse productResponse = new IndexProductResponse(); + IndexProductRespVO productResponse = new IndexProductRespVO(); List activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity()); // 活动类型默认:直接跳过 if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) { @@ -460,7 +460,7 @@ public class ProductServiceImpl implements ProductService { productResponseArrayList.add(productResponse); } - PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); + PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list"); return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList)); @@ -473,7 +473,7 @@ public class ProductServiceImpl implements ProductService { * @return CommonPage */ @Override - public PageInfo getCategoryProductList(ProductListRequest request, PageParam pageParamRequest) { + public PageInfo getCategoryProductList(ProductListRequest request, PageParam pageParamRequest) { ProductRequest searchRequest = new ProductRequest(); BeanUtils.copyProperties(searchRequest, request); List storeProductList = storeProductService.findH5List(searchRequest, pageParamRequest); @@ -481,13 +481,13 @@ public class ProductServiceImpl implements ProductService { return new PageInfo<>(new ArrayList<>()); } - Page productPage = PageHelper.startPage(pageParamRequest.getPageNo(), pageParamRequest.getPageSize()); + Page productPage = PageHelper.startPage(pageParamRequest.getPageNo(), pageParamRequest.getPageSize()); PageInfo storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList); MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId()); - List productResponseArrayList = new ArrayList<>(); + List productResponseArrayList = new ArrayList<>(); for (StoreProduct storeProduct : storeProductList) { - IndexProductResponse productResponse = new IndexProductResponse(); + IndexProductRespVO productResponse = new IndexProductRespVO(); // 获取商品购物车数量 if (ObjectUtil.isNotNull(user)) { productResponse.setCartNum(cartService.getProductNumByUidAndProductId(user.getId(), storeProduct.getId())); @@ -496,7 +496,7 @@ public class ProductServiceImpl implements ProductService { productResponseArrayList.add(productResponse); } - PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); + PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list"); return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList)); From 26a8631927c53420710b6640ff7ed340a47eef71 Mon Sep 17 00:00:00 2001 From: tangqian Date: Tue, 16 May 2023 18:19:33 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=E4=BC=9A=E5=91=98=E5=85=85?= =?UTF-8?q?=E5=80=BC,=E9=80=80=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/pay/config/AliPayConfig.java | 40 +++ .../pay/properties/AliPayProperties.java | 40 +++ ...ot.autoconfigure.AutoConfiguration.imports | 3 +- .../request/member/OrderContentRequest.java | 60 ++++ .../shop/request/member/OrderPayRequest.java | 33 +++ .../shop/request/member/RefundRequest.java | 30 ++ .../response/member/AliPayOrderResponse.java | 18 ++ .../member/ChangeOrderPayTypeResponse.java | 40 +++ .../response/member/InitOrderResponse.java | 30 ++ .../shop/response/member/PayResponse.java | 14 + .../response/member/WxPayOrderResponse.java | 22 ++ .../admin/notify/AliPayNotifyController.java | 40 +++ .../app/buy/TopUpOrderController.java | 52 ++++ .../shop/service/order/StoreOrderService.java | 28 ++ .../order/impl/StoreOrderServiceImpl.java | 275 +++++++++++++++--- .../module/shop/support/StrategySupport.java | 50 ++++ .../shop/support/pay/AliPayStrategy.java | 87 ++++++ .../module/shop/support/pay/IPayStrategy.java | 19 ++ .../shop/support/pay/PayConfigConstant.java | 33 +++ .../shop/support/pay/WxPayStrategy.java | 83 ++++++ .../module/member/api/user/MemberUserApi.java | 4 + .../member/api/user/MemberUserApiImpl.java | 5 + .../service/user/MemberUserService.java | 1 + .../service/user/MemberUserServiceImpl.java | 11 + .../src/main/resources/application-local.yaml | 9 +- 25 files changed, 980 insertions(+), 47 deletions(-) create mode 100644 yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/config/AliPayConfig.java create mode 100644 yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/properties/AliPayProperties.java create mode 100644 yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/OrderContentRequest.java create mode 100644 yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/OrderPayRequest.java create mode 100644 yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/RefundRequest.java create mode 100644 yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/AliPayOrderResponse.java create mode 100644 yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/ChangeOrderPayTypeResponse.java create mode 100644 yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/InitOrderResponse.java create mode 100644 yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/PayResponse.java create mode 100644 yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/WxPayOrderResponse.java create mode 100644 yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/notify/AliPayNotifyController.java create mode 100644 yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/buy/TopUpOrderController.java create mode 100644 yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/StrategySupport.java create mode 100644 yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/AliPayStrategy.java create mode 100644 yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/IPayStrategy.java create mode 100644 yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/PayConfigConstant.java create mode 100644 yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/WxPayStrategy.java diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/config/AliPayConfig.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/config/AliPayConfig.java new file mode 100644 index 000000000..ac2eeca24 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/config/AliPayConfig.java @@ -0,0 +1,40 @@ +package cn.iocoder.yudao.framework.pay.config; + +import cn.iocoder.yudao.framework.pay.properties.AliPayProperties; +import cn.iocoder.yudao.framework.pay.properties.WxPayProperties; +import com.alipay.api.AlipayClient; +import com.alipay.api.DefaultAlipayClient; +import com.github.binarywang.wxpay.service.WxPayService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @Title:AliPayConfig + * @Description: TODO + * @author: tangqian + * @date: 2023/5/16 13:29 + * @version: V1.0.0 + */ +@Configuration +@ConditionalOnClass(AlipayClient.class) +@EnableConfigurationProperties(AliPayProperties.class) +@ConditionalOnProperty(prefix = "ali.pay.one", value = "enabled", matchIfMissing = true) +public class AliPayConfig { + private AliPayProperties aliPayProperties; + + @Autowired + public AliPayConfig(AliPayProperties aliPayProperties) { + this.aliPayProperties = aliPayProperties; + } + @Bean + @ConditionalOnMissingBean(AlipayClient.class) + public AlipayClient alipayClient() { + return new DefaultAlipayClient(aliPayProperties.getGatewayUrl(), aliPayProperties.getAppId(), + aliPayProperties.getMerchantPrivateKey(), "json", "UTF-8", aliPayProperties.getAlipayPublicKey(), "RSA2"); + } +} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/properties/AliPayProperties.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/properties/AliPayProperties.java new file mode 100644 index 000000000..44d11e9f3 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/properties/AliPayProperties.java @@ -0,0 +1,40 @@ +package cn.iocoder.yudao.framework.pay.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * @Title:AliPayProperties + * @Description: TODO + * @author: tangqian + * @date: 2023/5/16 13:35 + * @version: V1.0.0 + */ +@Data +@Component +@ConfigurationProperties(prefix = AliPayProperties.PREFIX) +public class AliPayProperties { + public static final String PREFIX = "ali.pay.one"; + /** + * appId. + */ + private String appId; + /** + * 私钥. + */ + private String merchantPrivateKey; + /** + * 公钥. + */ + private String alipayPublicKey; + /** + * 支付宝网关. + */ + private String gatewayUrl; + /** + * 回调地址. + */ + private String notifyUrl; + +} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 3a42b1c47..84f15f29a 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,3 +1,4 @@ cn.iocoder.yudao.framework.pay.config.YudaoPayAutoConfiguration cn.iocoder.yudao.framework.pay.config.WxPayOneAutoConfiguration -cn.iocoder.yudao.framework.pay.config.WxPayTwoAutoConfiguration \ No newline at end of file +cn.iocoder.yudao.framework.pay.config.WxPayTwoAutoConfiguration +cn.iocoder.yudao.framework.pay.config.AliPayConfig \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/OrderContentRequest.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/OrderContentRequest.java new file mode 100644 index 000000000..94ab77d3b --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/OrderContentRequest.java @@ -0,0 +1,60 @@ +package cn.iocoder.yudao.module.shop.request.member; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @Title:OrderContentRequest + * @Description: 会员充值下单入参 + * @author: tangqian + * @date: 2023/5/15 20:45 + * @version: V1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Schema(description="会员充值下单请求入参") +public class OrderContentRequest implements Serializable { + private static final long serialVersionUID = -9170167938995005780L; + @Schema(description = "用户电话") + private String userPhone; + + @Schema(description = "确认手机号") + private String confirmPhone; + + @Schema(description = "openid(支付者微信支付)") + private String openid; + + @Schema(description = "支付类型 支付宝ALIPAY 微信WXPAY") + @NotEmpty(message = "支付类型不能为空") + private String payType; + + @Schema(description = "订单信息") + private List orderInfos; + @Data + public static class OrderInfo implements Serializable{ + private static final long serialVersionUID = -4967251473044468810L; + @Schema(description = "订单id") + @NotNull(message = "挡位id不能为空") + private Integer gearId; + + @Schema(description = "档位名称") + @NotEmpty(message = "挡位名称不能为空") + private String name; + + @Schema(description = "挡位备注不能为空") + @NotEmpty(message = "挡位备注不能为空") + private String gearRemarks; + + @Schema(description = "挡位金额不能为空") + @NotNull(message = "挡位金额不能为空") + private Integer gearAmount; + } +} diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/OrderPayRequest.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/OrderPayRequest.java new file mode 100644 index 000000000..cc02169c8 --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/OrderPayRequest.java @@ -0,0 +1,33 @@ +package cn.iocoder.yudao.module.shop.request.member; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; + +/** + * @Title:OrderPayRequest + * @Description: 订单选择支付方式发起支付入参 + * @author: tangqian + * @date: 2023/5/15 20:54 + * @version: V1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Schema(description="订单选择支付方式发起支付入参") +public class OrderPayRequest implements Serializable { + private static final long serialVersionUID = 6720933184418303650L; + + @Schema(description = "订单id") + @NotEmpty(message = "orderId不能为空") + private String orderId; + + @Schema(description = "支付类型 支付宝ALIPAY 微信WXPAY") + @NotEmpty(message = "支付类型不能为空") + private String payType; + +} diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/RefundRequest.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/RefundRequest.java new file mode 100644 index 000000000..afba30285 --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/RefundRequest.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.shop.request.member; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @Title:OrderContentRequest + * @Description: 退款入参 + * @author: tangqian + * @date: 2023/5/15 20:45 + * @version: V1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Schema(description="退款") +public class RefundRequest implements Serializable { + private static final long serialVersionUID = -9170167938995005780L; + @Schema(description = "数据id") + private String orderId; + + +} diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/AliPayOrderResponse.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/AliPayOrderResponse.java new file mode 100644 index 000000000..bbdae987b --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/AliPayOrderResponse.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.shop.response.member; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @Title:AliPayOrderResponse + * @Description: TODO + * @author: tangqian + * @date: 2023/5/15 21:09 + * @version: V1.0.0 + */ +@Data +@Accessors(chain = true) +public class AliPayOrderResponse extends PayResponse { + //支付宝统一下单返回参数 + private String body; +} diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/ChangeOrderPayTypeResponse.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/ChangeOrderPayTypeResponse.java new file mode 100644 index 000000000..596505058 --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/ChangeOrderPayTypeResponse.java @@ -0,0 +1,40 @@ +package cn.iocoder.yudao.module.shop.response.member; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * @Title:ChangeOrderPayTypeResponse + * @Description: 订单选择订单支付方式-返回参数 + * @author: tangqian + * @date: 2023/5/15 21:05 + * @version: V1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Schema(description="订单选择订单支付方式-返回参数") +public class ChangeOrderPayTypeResponse implements Serializable { + private static final long serialVersionUID = -4147278073881962962L; + @Schema(description = "订单id") + private String orderId; + + @Schema(description = "支付类型 支付宝ALIPAY 微信WXPAY") + private String payType; + + @Schema(description = "订单金额(分)") + private String orderPay; + + @Schema(description = "需要支付金额(分)") + private String needPay; + + @Schema(description = "商品名称") + private String goodsName; + + @Schema(description = "此参数根据支付类型的不同,返回的参数有所不同。") + private PayResponse orderInfo; +} diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/InitOrderResponse.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/InitOrderResponse.java new file mode 100644 index 000000000..d5cd2df2a --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/InitOrderResponse.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.shop.response.member; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.List; + +/** + * @Title:InitOrderResponse + * @Description: TODO + * @author: tangqian + * @date: 2023/5/15 21:20 + * @version: V1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Schema(description="预下单返回参数") +public class InitOrderResponse implements Serializable { + private static final long serialVersionUID = 6894715033655337607L; + + @Schema(description = "h5_url") + private String h5Url; + + @Schema(description ="二维码链接") + private String codeUrl; +} diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/PayResponse.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/PayResponse.java new file mode 100644 index 000000000..eda911eea --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/PayResponse.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.shop.response.member; + +import java.io.Serializable; + +/** + * @Title:PayResponse + * @Description: 根据支付返回父类 + * @author: tangqian + * @date: 2023/5/15 21:06 + * @version: V1.0.0 + */ +public class PayResponse implements Serializable { + private static final long serialVersionUID = 9219937300257494629L; +} diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/WxPayOrderResponse.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/WxPayOrderResponse.java new file mode 100644 index 000000000..e909dd55e --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/member/WxPayOrderResponse.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.shop.response.member; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @Title:WxPayOrderResponse + * @Description: TODO + * @author: tangqian + * @date: 2023/5/15 21:11 + * @version: V1.0.0 + */ +@Data +@Accessors(chain = true) +public class WxPayOrderResponse extends PayResponse{ + //交易类型 + private String tradeType; + //预支付ID + private String prepayId; + //支付跳转链接 + private String mwebUrl; +} diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/notify/AliPayNotifyController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/notify/AliPayNotifyController.java new file mode 100644 index 000000000..1f107cfaa --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/notify/AliPayNotifyController.java @@ -0,0 +1,40 @@ +package cn.iocoder.yudao.module.shop.controller.admin.notify; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.shop.service.order.StoreOrderService; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import java.util.Map; + +/** + * @Title:AliPayNotifyController + * @Description: TODO + * @author: tangqian + * @date: 2023/5/16 16:45 + * @version: V1.0.0 + */ +@Slf4j +@RequestMapping("notify/ali") +@RestController +@Tag(name = "支付宝支付回调 - 订单支付") +public class AliPayNotifyController { + @Autowired + private StoreOrderService storeOrderService; + + @PostMapping("pay_notify") + public CommonResult payNotify(HttpServletRequest request, @RequestBody Map params) { + return CommonResult.success(storeOrderService.aliNotify(request, params)); + } + + @PostMapping("refund_notify") + public CommonResult refundNotify(HttpServletRequest request, @RequestBody Map params) { + return CommonResult.success(storeOrderService.refundNotify(request, params)); + } +} diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/buy/TopUpOrderController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/buy/TopUpOrderController.java new file mode 100644 index 000000000..10ae23ee9 --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/buy/TopUpOrderController.java @@ -0,0 +1,52 @@ +package cn.iocoder.yudao.module.shop.controller.app.buy; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.shop.request.member.OrderContentRequest; +import cn.iocoder.yudao.module.shop.request.member.RefundRequest; +import cn.iocoder.yudao.module.shop.response.member.InitOrderResponse; +import cn.iocoder.yudao.module.shop.service.order.StoreOrderService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; + +/** + * @Title:TopUpOrderController + * @Description: 会员充值 + * @author: tangqian + * @date: 2023/5/15 20:12 + * @version: V1.0.0 + */ +@Slf4j +@RestController +@RequestMapping("api/order/member") +@Tag(name = "用户 APP - 会员充值订单管理") +public class TopUpOrderController { + + @Autowired + private StoreOrderService storeOrderService; + + @Operation(summary = "会员充值") + @RequestMapping(value = "/memberTopUp", method = RequestMethod.POST) + public CommonResult memberTopUp(@Valid @RequestBody OrderContentRequest request, HttpServletRequest servletRequest) throws Exception { + log.info("initOrder会员充值===>{}", request); + return CommonResult.success(storeOrderService.memberTopUp(request, servletRequest)); + } + + @Operation(summary = "退款") + @RequestMapping(value = "/memberRefund", method = RequestMethod.POST) + public CommonResult memberRefund(@Valid @RequestBody RefundRequest request, HttpServletRequest servletRequest) throws Exception { + log.info("memberRefund会员退款===>{}", request); + return CommonResult.success(storeOrderService.memberRefund(request, servletRequest)); + } + + + +} diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/StoreOrderService.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/StoreOrderService.java index ce078009b..980267c3f 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/StoreOrderService.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/StoreOrderService.java @@ -2,15 +2,24 @@ package cn.iocoder.yudao.module.shop.service.order; import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrder; +import cn.iocoder.yudao.module.shop.request.member.OrderContentRequest; +import cn.iocoder.yudao.module.shop.request.member.OrderPayRequest; +import cn.iocoder.yudao.module.shop.request.member.RefundRequest; import cn.iocoder.yudao.module.shop.request.order.StoreOrderRefundRequest; import cn.iocoder.yudao.module.shop.request.order.StoreOrderSearchRequest; import cn.iocoder.yudao.module.shop.request.order.StoreOrderSendRequest; import cn.iocoder.yudao.module.shop.request.order.StoreOrderUpdatePriceRequest; +import cn.iocoder.yudao.module.shop.response.member.ChangeOrderPayTypeResponse; +import cn.iocoder.yudao.module.shop.response.member.InitOrderResponse; import cn.iocoder.yudao.module.shop.response.order.*; import cn.iocoder.yudao.module.shop.vo.order.LogisticsResultVo; import com.baomidou.mybatisplus.extension.service.IService; +import com.github.binarywang.wxpay.exception.WxPayException; import com.github.pagehelper.PageInfo; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.math.BigDecimal; import java.util.List; import java.util.Map; @@ -370,4 +379,23 @@ public interface StoreOrderService extends IService { * @param spreadId 推广人uid */ OrderBrokerageData getBrokerageData(Integer uid, Integer spreadId); + + /** + * 会员充值 + * @param request + * @return + */ + InitOrderResponse memberTopUp(OrderContentRequest request, HttpServletRequest servletRequest) throws WxPayException; + + /** + * 第三方回调 + * @param request + * @param params + * @return + */ + Object aliNotify(HttpServletRequest request, Map params); + + Object memberRefund(RefundRequest request, HttpServletRequest servletRequest); + + Object refundNotify(HttpServletRequest request, Map params); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java index 29cba6ae6..b951b5294 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java @@ -9,28 +9,44 @@ import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.pojo.DateLimitUtilVo; import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.util.date.DateUtils; +import cn.iocoder.yudao.framework.pay.config.WxPayOneAutoConfiguration; +import cn.iocoder.yudao.framework.pay.properties.AliPayProperties; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrder; +import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO; +import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO; import cn.iocoder.yudao.module.shop.dal.mysql.order.StoreOrderMapper; +import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderInfoMapper; +import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderMapper; +import cn.iocoder.yudao.module.shop.request.member.OrderContentRequest; +import cn.iocoder.yudao.module.shop.request.member.RefundRequest; import cn.iocoder.yudao.module.shop.request.order.StoreOrderRefundRequest; import cn.iocoder.yudao.module.shop.request.order.StoreOrderSearchRequest; import cn.iocoder.yudao.module.shop.request.order.StoreOrderSendRequest; import cn.iocoder.yudao.module.shop.request.order.StoreOrderUpdatePriceRequest; +import cn.iocoder.yudao.module.shop.response.member.InitOrderResponse; import cn.iocoder.yudao.module.shop.response.order.*; import cn.iocoder.yudao.module.shop.service.order.StoreOrderInfoService; import cn.iocoder.yudao.module.shop.service.order.StoreOrderRefundService; import cn.iocoder.yudao.module.shop.service.order.StoreOrderService; import cn.iocoder.yudao.module.shop.service.order.StoreOrderStatusService; +import cn.iocoder.yudao.module.shop.support.StrategySupport; +import cn.iocoder.yudao.module.shop.support.pay.IPayStrategy; import cn.iocoder.yudao.module.shop.utils.CommonPage; import cn.iocoder.yudao.module.shop.utils.OrderUtil; import cn.iocoder.yudao.module.shop.utils.RedisUtil; import cn.iocoder.yudao.module.shop.vo.order.LogisticsResultVo; import cn.iocoder.yudao.module.shop.vo.order.StoreDateRangeSqlPram; import cn.iocoder.yudao.module.shop.vo.order.StoreOrderInfoOldVo; +import com.alipay.api.AlipayApiException; +import com.alipay.api.internal.util.AlipaySignature; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.Page; @@ -40,14 +56,16 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.support.TransactionTemplate; +import org.springframework.util.Assert; +import org.springframework.util.CollectionUtils; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.time.LocalDateTime; +import java.util.*; import java.util.stream.Collectors; /** @@ -90,7 +108,15 @@ public class StoreOrderServiceImpl extends ServiceImpl lqw = new LambdaQueryWrapper<>(); orderUtil.statusApiByWhere(lqw, status); - lqw.eq(StoreOrder::getUid,userId); + lqw.eq(StoreOrder::getUid, userId); return mapper.selectCount(lqw); } @Override public List getOrderGroupByDate(String dateLimit, int lefTime) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.select("sum(pay_price) as pay_price", "left(create_time, "+lefTime+") as orderId", "count(id) as id"); + queryWrapper.select("sum(pay_price) as pay_price", "left(create_time, " + lefTime + ") as orderId", "count(id) as id"); if (StringUtils.isNotBlank(dateLimit)) { DateLimitUtilVo dateLimitVo = DateUtils.getDateLimit(dateLimit); queryWrapper.between("create_time", dateLimitVo.getStartTime(), dateLimitVo.getEndTime()); @@ -421,20 +447,20 @@ public class StoreOrderServiceImpl extends ServiceImpl orderPerList = getOrderPayedByDateLimit(perDateStart,dateStart); + List orderPerList = getOrderPayedByDateLimit(perDateStart, dateStart); // 当前时间段 List orderCurrentList = getOrderPayedByDateLimit(dateStart, dateEnd); @@ -443,23 +469,23 @@ public class StoreOrderServiceImpl extends ServiceImpl e.getPayPrice().doubleValue()).sum(); double currentSumPrice = orderCurrentList.stream().mapToDouble(e -> e.getPayPrice().doubleValue()).sum(); - response.setChart(mapper.getOrderStatisticsPriceDetail(new StoreDateRangeSqlPram(dateStart,dateEnd))); - response.setTime(BigDecimal.valueOf(currentSumPrice).setScale(2,BigDecimal.ROUND_HALF_UP)); + response.setChart(mapper.getOrderStatisticsPriceDetail(new StoreDateRangeSqlPram(dateStart, dateEnd))); + response.setTime(BigDecimal.valueOf(currentSumPrice).setScale(2, BigDecimal.ROUND_HALF_UP)); // 当前营业额和上一个同比营业额增长区间 increasePrice = currentSumPrice - perSumPrice; if (increasePrice <= 0) response.setGrowthRate(0); else if (perSumPrice == 0) response.setGrowthRate((int) increasePrice * 100); - else response.setGrowthRate((int)((increasePrice * perSumPrice) * 100)); - }else if (type ==2) { - response.setChart(mapper.getOrderStatisticsOrderCountDetail(new StoreDateRangeSqlPram(dateStart,dateEnd))); + else response.setGrowthRate((int) ((increasePrice * perSumPrice) * 100)); + } else if (type == 2) { + response.setChart(mapper.getOrderStatisticsOrderCountDetail(new StoreDateRangeSqlPram(dateStart, dateEnd))); response.setTime(BigDecimal.valueOf(orderCurrentList.size())); increasePrice = orderCurrentList.size() - orderPerList.size(); if (increasePrice <= 0) response.setGrowthRate(0); else if (orderPerList.size() == 0) response.setGrowthRate((int) increasePrice); - else response.setGrowthRate((int)((increasePrice / orderPerList.size()) * 100)); + else response.setGrowthRate((int) ((increasePrice / orderPerList.size()) * 100)); } - response.setIncreaseTime(increasePrice+""); - response.setIncreaseTimeStatus(increasePrice >= 0 ? 1:2); + response.setIncreaseTime(increasePrice + ""); + response.setIncreaseTimeStatus(increasePrice >= 0 ? 1 : 2); return response; } @@ -532,7 +558,7 @@ public class StoreOrderServiceImpl extends ServiceImpl { // 修改订单价格 @@ -640,7 +666,7 @@ public class StoreOrderServiceImpl extends ServiceImpl params) { + boolean verifyResult = false; + try { + verifyResult = AlipaySignature.rsaCheckV1(params, aliPayProperties.getAlipayPublicKey(), "UTF-8", "RSA2"); + } catch (AlipayApiException e) { + e.printStackTrace(); + } + + if (verifyResult) { + String orderId = params.get("out_trade_no"); + RechargeOrderDO orderDO = rechargeOrderMapper.selectOne(Wrappers.lambdaQuery().eq(RechargeOrderDO::getOrderId, orderId)); + // 处理相关逻辑 + + } + return null; + } + + @Override + public Object memberRefund(RefundRequest request, HttpServletRequest servletRequest) { + RechargeOrderDO orderDO = rechargeOrderMapper.selectById(request.getOrderId()); + // 获取支付策略 + IPayStrategy payStrategy = strategySupport.getPayStrategy(orderDO.getPayType()); + payStrategy.refund(orderDO); + return null; + } + + @Override + public Object refundNotify(HttpServletRequest request, Map params1) { + // 解析支付宝回调参数 + Map params = new HashMap<>(); + Map requestParams = request.getParameterMap(); + for (Map.Entry entry : requestParams.entrySet()) { + String name = entry.getKey(); + String[] values = entry.getValue(); + StringBuilder sb = new StringBuilder(); + for (String value : values) { + sb.append(value); + } + params.put(name, sb.toString()); + } + // 验证签名 + boolean isSignatureValid = false; + try { + isSignatureValid = AlipaySignature.rsaCheckV1(params, aliPayProperties.getAlipayPublicKey(), "UTF-8", "RSA2"); + } catch (AlipayApiException e) { + e.printStackTrace(); + } + if (isSignatureValid) { + // 验证通过,处理退款结果 + String tradeStatus = params.get("trade_status"); + if ("TRADE_SUCCESS".equals(tradeStatus)) { + // 退款成功逻辑 + } else { + // 退款失败逻辑 + } + return "success"; // 返回给支付宝表示接收成功 + } else { + // 签名验证失败 + return "failure"; + } + } + + + private RechargeOrderDO initializeOrder(OrderContentRequest request, String code, MemberUserRespDTO user) { + RechargeOrderDO orderDO = new RechargeOrderDO(); + List orderInfos = request.getOrderInfos(); + orderDO.setOrderId(code); + orderDO.setUid(user.getId().intValue()); + orderDO.setRealName(user.getNickname()); + orderDO.setUserPhone(StringUtils.isEmpty(request.getUserPhone()) ? user.getMobile() : request.getUserPhone()); + orderDO.setConfirmPhone(StringUtils.isEmpty(request.getConfirmPhone()) ? user.getMobile() : request.getConfirmPhone()); + orderDO.setTotalNum(orderInfos.size()); + BigDecimal sum = new BigDecimal(orderInfos.stream().mapToDouble(OrderContentRequest.OrderInfo::getGearAmount).sum()); + orderDO.setTotalPrice(sum); + orderDO.setPayPrice(sum); + orderDO.setPayTime(LocalDateTime.now()); + orderDO.setPayType(request.getPayType()); + orderDO.setMark("会员充值"); + orderDO.setCost(sum); + orderDO.setProTotalPrice(sum); + orderDO.setBeforePayPrice(sum); + rechargeOrderMapper.insert(orderDO); + List infoDOS = new ArrayList<>(); + orderInfos.forEach(info -> { + RechargeOrderInfoDO infoDO = new RechargeOrderInfoDO(); + infoDO.setRechargeOrderId(orderDO.getId()); + infoDO.setGiveIntegral(info.getGearId()); + infoDO.setOrderNo(code); + infoDO.setProductName(info.getName()); + infoDO.setPrice(new BigDecimal(info.getGearAmount())); + infoDO.setPayNum(1); + infoDO.setGiveIntegral(info.getGearAmount()); + infoDOS.add(infoDO); + }); + rechargeOrderInfoMapper.insertBatch(infoDOS); + return orderDO; + } + + /** + * 订单号 + * + * @param prefix + * @return + */ + public static String generateBillNo(String prefix) { + String idStr = IdWorker.getIdStr(); + idStr = prefix + "_" + idStr; + return idStr; + } + + private void orderCheck(OrderContentRequest request) { + Assert.isTrue(!CollectionUtils.isEmpty(request.getOrderInfos()), "订单信息不能为空!"); + if (StringUtils.isNotBlank(request.getUserPhone()) && StringUtils.isNotBlank(request.getConfirmPhone())) { + Assert.isTrue(StringUtils.equals(request.getUserPhone(), request.getConfirmPhone()), "输入号码不一致!"); + MemberUserRespDTO userByMobile = userService.getUserByMobile(request.getUserPhone()); + // 初始化一个账号 + if (Objects.isNull(userByMobile)) { + userService.saveMemberUser(request.getUserPhone()); + } + } + } + + private StoreOrder getInfoException(String orderNo) { LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.eq(StoreOrder::getOrderId, orderNo); @@ -1111,8 +1278,9 @@ public class StoreOrderServiceImpl extends ServiceImpl getOrderPayedByDateLimit(String startTime, String endTime) { LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.eq(StoreOrder::getIsDel, false).eq(StoreOrder::getPaid, true).eq(StoreOrder::getRefundStatus,0) + lqw.eq(StoreOrder::getIsDel, false).eq(StoreOrder::getPaid, true).eq(StoreOrder::getRefundStatus, 0) .between(StoreOrder::getCreateTime, startTime, endTime); return mapper.selectList(lqw); } - /** 快递 - * @param request StoreOrderSendRequest 发货参数 + /** + * 快递 + * + * @param request StoreOrderSendRequest 发货参数 * @param storeOrder StoreOrder 订单信息 */ private void express(StoreOrderSendRequest request, StoreOrder storeOrder) { @@ -1259,19 +1433,22 @@ public class StoreOrderServiceImpl extends ServiceImpl 订单列表 * @return List */ private List formatOrder1(List orderList) { - List detailResponseList = new ArrayList<>(); + List detailResponseList = new ArrayList<>(); if (CollUtil.isEmpty(orderList)) { return detailResponseList; } @@ -1378,8 +1558,9 @@ public class StoreOrderServiceImpl extends ServiceImpl 表达式 - * @param request StoreOrderSearchRequest 请求参数 + * @param request StoreOrderSearchRequest 请求参数 */ private void getRequestTimeWhere(QueryWrapper queryWrapper, StoreOrderSearchRequest request) { if (StringUtils.isNotBlank(request.getDateLimit())) { @@ -1390,6 +1571,7 @@ public class StoreOrderServiceImpl extends ServiceImpl 表达式 - * @param status String 类型 + * @param status String 类型 */ private void getStatusWhereNew(QueryWrapper queryWrapper, String status) { if (StrUtil.isBlank(status)) { @@ -1554,7 +1737,7 @@ public class StoreOrderServiceImpl extends ServiceImpl 表达式 - * @param status String 类型 + * @param status String 类型 */ private void getStatusWhere(QueryWrapper queryWrapper, String status) { if (StrUtil.isBlank(status)) { @@ -1657,7 +1843,7 @@ public class StoreOrderServiceImpl extends ServiceImpl payMap = new HashMap<>(); + + + public StrategySupport(WxPayStrategy wxPayStrategy, + AliPayStrategy aliPayStrategy + + ) { + //支付策略 + payMap.put(PayConfigConstant.PAY_TYPE_ALIPAY,aliPayStrategy); + payMap.put(PayConfigConstant.PAY_TYPE_WXPAY,wxPayStrategy); + } + + /** + * 根据支付类型查找相对应的支付策略。 + * @param payType + * @return + */ + public IPayStrategy getPayStrategy(String payType){ + if (PayConfigConstant.PAY_TYPE_LIST.contains(payType)){ + return payMap.get(payType); + } + return null; + } + + + + + + +} diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/AliPayStrategy.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/AliPayStrategy.java new file mode 100644 index 000000000..528046449 --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/AliPayStrategy.java @@ -0,0 +1,87 @@ +package cn.iocoder.yudao.module.shop.support.pay; + +import cn.hutool.json.JSONUtil; +import cn.iocoder.yudao.framework.pay.config.AliPayConfig; +import cn.iocoder.yudao.framework.pay.properties.AliPayProperties; +import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO; +import cn.iocoder.yudao.module.shop.response.member.InitOrderResponse; +import com.alibaba.fastjson.JSONObject; +import com.alipay.api.AlipayApiException; +import com.alipay.api.AlipayClient; +import com.alipay.api.request.AlipayTradeRefundRequest; +import com.alipay.api.request.AlipayTradeWapPayRequest; +import com.alipay.api.response.AlipayTradeRefundResponse; +import com.alipay.api.response.AlipayTradeWapPayResponse; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.Assert; + +import javax.servlet.http.HttpServletRequest; + +/** + * @Title:AliPayStrategy + * @Description: 支付宝支付策略 + * @author: tangqian + * @date: 2023/5/15 21:52 + * @version: V1.0.0 + */ +@Component +@Slf4j +public class AliPayStrategy implements IPayStrategy { + @Autowired + private AliPayProperties aliPayProperties; + @Autowired + private AliPayConfig aliPayConfig; + + @Override + public InitOrderResponse pay(RechargeOrderDO orderDO, HttpServletRequest servletRequest, String openId) { + AlipayClient alipayClient = aliPayConfig.alipayClient(); + Assert.notNull(alipayClient, "获取支付宝支付配置失败!"); + AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest(); + //异步接收地址,仅支持http/https,公网可访问 + request.setNotifyUrl(aliPayProperties.getNotifyUrl()); + //同步跳转地址,仅支持http/https + request.setReturnUrl(""); + /******必传参数******/ + JSONObject bizContent = new JSONObject(); + //商户订单号,商家自定义,保持唯一性 + bizContent.put("out_trade_no", orderDO.getOrderId()); + //支付金额,最小值0.01元 + bizContent.put("total_amount", orderDO.getPayPrice()); + //订单标题,不可使用特殊符号 + bizContent.put("subject", "会员充值"); + bizContent.put("product_code", "FAST_INSTANT_TRADE_PAY"); + request.setBizContent(bizContent.toString()); + AlipayTradeWapPayResponse response = null; + try { + response = alipayClient.pageExecute(request); + } catch (AlipayApiException e) { + e.printStackTrace(); + } + if (response.isSuccess()) { + return new InitOrderResponse(); + } + return null; + } + + @Override + public void refund(RechargeOrderDO orderDO) { + AlipayClient alipayClient = aliPayConfig.alipayClient();; + AlipayTradeRefundRequest request = new AlipayTradeRefundRequest(); + JSONObject bizContent = new JSONObject(); + bizContent.put("trade_no", orderDO.getPaySerialNumber()); + bizContent.put("refund_amount", orderDO.getPayPrice()); + bizContent.put("out_request_no", orderDO.getOrderId()); + + request.setBizContent(bizContent.toString()); + AlipayTradeRefundResponse response = null; + try { + response = alipayClient.execute(request); + } catch (AlipayApiException e) { + e.printStackTrace(); + } + log.info("退款回调[{}]", JSONUtil.toJsonPrettyStr(response)); + } + +} diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/IPayStrategy.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/IPayStrategy.java new file mode 100644 index 000000000..c33ba649a --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/IPayStrategy.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.shop.support.pay; + +import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO; +import cn.iocoder.yudao.module.shop.response.member.InitOrderResponse; + +import javax.servlet.http.HttpServletRequest; + +/** + * @Title:IPayStrategy + * @Description: 支付策略接口 + * @author: tangqian + * @date: 2023/5/15 21:51 + * @version: V1.0.0 + */ +public interface IPayStrategy { + InitOrderResponse pay(RechargeOrderDO orderDO, HttpServletRequest servletRequest,String openId); + + void refund(RechargeOrderDO orderDO); +} diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/PayConfigConstant.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/PayConfigConstant.java new file mode 100644 index 000000000..12f5afef9 --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/PayConfigConstant.java @@ -0,0 +1,33 @@ +package cn.iocoder.yudao.module.shop.support.pay; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Title:PayConfigConstant + * @Description: TODO + * @author: tangqian + * @date: 2023/5/15 21:54 + * @version: V1.0.0 + */ +public interface PayConfigConstant { + List PAY_TYPE_LIST = Arrays.asList("ALIPAY", "WXPAY"); + String PAY_TYPE_ALIPAY = "ALIPAY"; + String PAY_TYPE_WXPAY = "WXPAY"; + Map PAY_NAMES_MAP = new HashMap() { + { + this.put("ALIPAY", "支付宝"); + this.put("WXPAY", "微信"); + } + }; + String PAY_TYPE_ALIPAY_FIRST = "ALIPAY"; + String PAY_TYPE_WXPAY_FIRST = "WXPAY"; + Map PAY_NAMES_MAP_FIRST = new HashMap() { + { + this.put("ALIPAY", "支付宝"); + this.put("WXPAY", "微信"); + } + }; +} diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/WxPayStrategy.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/WxPayStrategy.java new file mode 100644 index 000000000..4a00ba05a --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/WxPayStrategy.java @@ -0,0 +1,83 @@ +package cn.iocoder.yudao.module.shop.support.pay; + +import cn.hutool.json.JSONUtil; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; +import cn.iocoder.yudao.framework.pay.config.WxPayOneAutoConfiguration; +import cn.iocoder.yudao.framework.pay.properties.WxPayProperties; +import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO; +import cn.iocoder.yudao.module.shop.response.member.InitOrderResponse; +import com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request; +import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderV3Request; +import com.github.binarywang.wxpay.bean.result.WxPayRefundV3Result; +import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result; +import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum; +import com.github.binarywang.wxpay.service.WxPayService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.Assert; + +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; + +/** + * @Title:WxPayStrategy + * @Description: TODO + * @author: tangqian + * @date: 2023/5/15 21:53 + * @version: V1.0.0 + */ +@Component +@Slf4j +public class WxPayStrategy implements IPayStrategy{ + @Autowired + private WxPayOneAutoConfiguration wxPayOneAutoConfiguration; + @Autowired + private WxPayProperties payProperties; + @Override + public InitOrderResponse pay(RechargeOrderDO orderDO, HttpServletRequest servletRequest,String openid) { + InitOrderResponse response = new InitOrderResponse(); + WxPayService wxPayService = wxPayOneAutoConfiguration.wxPayOneService(); + Assert.notNull(wxPayService, "获取微信支付配置失败!"); + WxPayUnifiedOrderV3Request wxPayRequest = new WxPayUnifiedOrderV3Request(); + int sum = orderDO.getPayPrice().multiply(new BigDecimal("100")).intValue(); + wxPayRequest.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(sum)); + wxPayRequest.setDescription("会员充值"); + wxPayRequest.setOutTradeNo(orderDO.getOrderId()); + wxPayRequest.setNotifyUrl(payProperties.getNotifyUrl()); + wxPayRequest.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(openid)); + wxPayRequest.setSceneInfo(new WxPayUnifiedOrderV3Request.SceneInfo().setPayerClientIp(ServletUtils.getClientIP(servletRequest))); + wxPayRequest.setAppid(payProperties.getAppId()); + wxPayRequest.setMchid(payProperties.getMchId()); + try { + WxPayUnifiedOrderV3Result wxPayUnifiedOrderV3Result = wxPayService.unifiedOrderV3(TradeTypeEnum.JSAPI, wxPayRequest); + BeanUtils.copyProperties(wxPayUnifiedOrderV3Result, response); + } catch (Exception e) { + log.error(e.getMessage()); + } + return response; + } + + @Override + public void refund(RechargeOrderDO orderDO) { + WxPayRefundV3Request wxPayRefundV3Request = new WxPayRefundV3Request(); + wxPayRefundV3Request.setOutTradeNo(orderDO.getOrderId()); + wxPayRefundV3Request.setOutRefundNo(orderDO.getPaySerialNumber()); + wxPayRefundV3Request.setTransactionId(orderDO.getOrderId()); + wxPayRefundV3Request.setReason("商品已售完"); + wxPayRefundV3Request.setNotifyUrl(payProperties.getRefundNotifyUrl()); + int sum = orderDO.getPayPrice().multiply(new BigDecimal("100")).intValue(); + wxPayRefundV3Request.setAmount(new WxPayRefundV3Request.Amount().setTotal(sum).setRefund(sum).setCurrency("CNY")); + + try { + WxPayService wxPayService = wxPayOneAutoConfiguration.wxPayOneService(); + WxPayRefundV3Result wxPayRefundV3Result = wxPayService.refundV3(wxPayRefundV3Request); + log.info("退款回调[{}]", JSONUtil.toJsonPrettyStr(wxPayRefundV3Request)); + }catch (Exception e){ + log.error(e.getMessage(),e); + } + } + +} diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java index 043f1c8f3..5499cccf3 100644 --- a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.member.api.user; +import cn.iocoder.yudao.module.member.api.user.dto.MemberUserBillDTO; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import java.util.Collection; @@ -76,4 +77,7 @@ public interface MemberUserApi { Long getUserId(); MemberUserRespDTO getInfo(); + + + void saveMemberUser(String phone); } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java index 366766f36..e39100c9d 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java @@ -92,6 +92,11 @@ public class MemberUserApiImpl implements MemberUserApi { return UserConvert.INSTANCE.convert2(userService.getUser(getUserId())); } + @Override + public void saveMemberUser(String phone) { + userService.saveMemberUser(phone); + } + /** * 获取个人资料 * diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserService.java index 6a76ed71a..041e75940 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserService.java @@ -116,4 +116,5 @@ public interface MemberUserService { */ int updateById(MemberUserDO member); + void saveMemberUser(String phone); } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java index fb3c0fd23..4005d4ada 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java @@ -170,6 +170,17 @@ public class MemberUserServiceImpl implements MemberUserService { return memberUserMapper.updateById(member); } + @Override + public void saveMemberUser(String phone) { + MemberUserDO memberUserDO = new MemberUserDO(); + memberUserDO.setMobile(phone); + memberUserDO.setNickname("初始化人员"); + memberUserDO.setAvatar(""); + memberUserDO.setStatus(CommonStatusEnum.ENABLE.getStatus()); + memberUserDO.setPassword(passwordEncoder.encode(phone.substring(phone.length() - 6))); + memberUserMapper.insert(memberUserDO); + } + /** * 对密码进行加密 * diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 5e2e4f573..813f7d87f 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -202,7 +202,14 @@ wx: notify-url: http://yuxy.perrymake.com/app-api/pay/wxpay/pay_notify refund-notify-url: http://yuxy.perrymake.com/app-api/pay/wxpay/refund_notify --- #################### 芋道相关配置 #################### - +ali: + pay: + one: + appId: 2021003194654312 + merchantPrivateKey: MIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQC+m33MrrmGiSBCBTQMkBH9AN7ZKi/ECmgpjIbVIzAbUThqfiKvuWe8haVq0/F5nETZVYKb3kqqcdt5NkUbGkCrCNCOPvQ2FI8VWOalXGSQNA6ItA644m1dv84Khs5K3Tpu6RgcrL5uqmfNzid7YpLlGeSxMq8uqu/adZnEbm+coJAvEH423pnMjsdkI93FUibaDkDQ06V7Z0Su6l4ZoVzLavvPeP/u8NCvelyf5h+BY159rU8XjCaSYYF/2u4DzDV1LqQcSC+fQg/aVd+QcpnhEF715fbNmN3TLuh1ysnfUSFdVMsdWDrOsgriJ7g0D32uWwhR4Brz3dAFs0KdWTmFAgMBAAECggEBAKdX2JCVbijhx0JvUw0ch856ryw2T41sHZss10vVAu1Y15EXgNiKjLsFEv/BaCX+vquY2XyDI0aVg7zdmrp6x//hU0kvmDTKw/xX+td/UIMSURhQDQThNmeyd/Dh/cfYhu7NEvBJ8T8zuMMFlcBMAO/HVfMErqzoQoCn8wJ0euUkxU+0yWjddC5QHdhPwPgfpmPvL/DCPfSCudFy80ix7CP3YID7RwgCy5niZg3e7aDK6DgYTmk2DmoC7B8ES/7Crvf04fH4XzGrSCzL9aGKOWql6dZisbDioRdm67DEWUSjQGTggEZ+eCd9Tr0gnndVWegG5HYJhSpB/JoLsc5J/dkCgYEA8Tumn60cfJU440LWaJ+40gJWcNrOlvpPEX69DRXKG3PlTAk62sSvVBos2nstqNjhHPQDG7rFerQhmSPeGyezVcwPCbWLvLC61vpbfau+RyWvMvm33A1hgP+zXlt9C3etb9w6LUfuqh0Lzi61K3ZNKQGo4ERxgGoMlNZWO0X/mBMCgYEAykZ9PH1b3be9M55BsnCnnrzENV5Bbfj7BToRleiUWA0f0Juurxy9ZACr8rU1oa7+UF32TpXAOL1Peri5vhYF7hdSnlSk5f9lyEzQijbtRytBC9Mexagb4BZWMlars9jMhhsdWiXA2O6Pz9ykLacGOr0DHM8/6HaVJRlPydXHywcCgYEAzwIgT1/vVR18jtD5SxjdMiJdaUTrCXZNSbcXplXvdLV0rFYzUi58QlCf8vDHUuCh9QWUcURKWKyhNFgqLeVYqKSOtwc6nbaO7xIyVtp9U3KMMNNIKqa06E0E8FDUMnYFuDslFVxn+0Unr0w3nc9MEYdiEunI+KiImWSA5SaBWk8CgYEAlbwshRS/ZpfXZVinhXJDgwx1qpQFl2USXUIpNnGfLrc4b/JvE44Q3PBqWRavhurFs7R62p2cV+Q767rHNOGUrjVxoWdDUkcHj4jdbxNN/rsUQa6dPvA9AltGn6jtHgtFC5kS12LPKUcgCl1o46qav+yfWzpIMstliLr+B4lLhw0CgYEA7Bpm0s2uoyC1XtYCqeWzbjODciq/hgIpmBjnP4Xs0ELB0VE95m9CVQk47dSngRqbkrEO2G2zdMTYj5Mr5bm5AXQfUpwMv89fxCxSXq1Andqe1/UphigltW/PXOfvpD1JcHNfalEcTOTdzENVYH4lN3HAoPobj04gCsFZFcqWfps= + alipayPublicKey: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw21teFhHze8ltibg/mBE0Lo1gTvcRUszQpsiTLWLoYvLxfaEVD+5bkpTYrVFczLNqOw93MJxwF0Pj62T3BZU6IXPdXtkKhcflKiZxleSIaTxPFml8mQ8dfdcT25BPidRaeztxv/FCL+0MUTMVh29Ffm9/DHqkjozs4o/Vcf/BoDssw9L7JQffwo/h69B0O688E+s+SivqvXGbiRdARzPrvuQjUMPwUf9vQZ4/ZgGNlwsEhnF90ESCuBZDm8atOoZlqYSNw6g+TZQH5CVS0WCR41TQoW+R8OsX1cv3ERvJXvh/50dEhl8b4CN3nvdaSYcw93o/nkkTZkdZ7BdcNuW2wIDAQAB + gatewayUrl: https://openapi.alipay.com/gateway.do + notify-url: http://yuxy.perrymake.com/app-api/pay/ali/pay_notify # 芋道配置项,设置当前项目所有自定义的配置 yudao: captcha: From f378e6ecbb7b7a87732eb42682b121d597138df3 Mon Sep 17 00:00:00 2001 From: axzsd Date: Tue, 16 May 2023 18:39:44 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=9E=84=E5=BB=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-test.yaml | 224 ++++++++++++++++++ 1 file changed, 224 insertions(+) create mode 100644 yudao-server/src/main/resources/application-test.yaml diff --git a/yudao-server/src/main/resources/application-test.yaml b/yudao-server/src/main/resources/application-test.yaml new file mode 100644 index 000000000..cc95bc1ea --- /dev/null +++ b/yudao-server/src/main/resources/application-test.yaml @@ -0,0 +1,224 @@ +server: + port: 48080 + servlet: + context-path: /cyyywl-api + +--- #################### 数据库相关配置 #################### + +spring: + # 数据源配置项 + autoconfigure: + exclude: + - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源 + - org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration # 排除积木报表带来的 MongoDB 的自动配置 + datasource: + druid: # Druid 【监控】相关的全局配置 + web-stat-filter: + enabled: true + stat-view-servlet: + enabled: true + allow: # 设置白名单,不填则允许所有访问 + url-pattern: /druid/* + login-username: # 控制台管理用户名和密码 + login-password: + filter: + stat: + enabled: true + log-slow-sql: true # 慢 SQL 记录 + slow-sql-millis: 100 + merge-sql: true + wall: + config: + multi-statement-allow: true + dynamic: # 多数据源配置 + druid: # Druid 【连接池】相关的全局配置 + initial-size: 5 # 初始连接数 + min-idle: 10 # 最小连接池数量 + max-active: 20 # 最大连接池数量 + max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒 + time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒 + min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒 + max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒 + validation-query: SELECT 1 # 配置检测连接是否有效 + test-while-idle: true + test-on-borrow: false + test-on-return: false + primary: master + datasource: + master: + name: cyywl + url: jdbc:mysql://117.33.142.185:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true + driver-class-name: com.mysql.jdbc.Driver + username: root + password: axzsd110 +# slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 +# name: ruoyi-vue-pro +# url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true +# driver-class-name: com.mysql.jdbc.Driver +# username: root +# password: 3WLiVUBEwTbvAfsh + + # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 + redis: + host: 117.33.142.185 # 地址 + port: 6369 # 端口 + database: 6 # 数据库索引 + password: 20221122@dev # 密码,建议生产环境开启 + +--- #################### 定时任务相关配置 #################### + +# Quartz 配置项,对应 QuartzProperties 配置类 +spring: + quartz: + auto-startup: true # 测试环境,需要开启 Job + scheduler-name: schedulerName # Scheduler 名字。默认为 schedulerName + job-store-type: jdbc # Job 存储器类型。默认为 memory 表示内存,可选 jdbc 使用数据库。 + wait-for-jobs-to-complete-on-shutdown: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true + properties: # 添加 Quartz Scheduler 附加属性,更多可以看 http://www.quartz-scheduler.org/documentation/2.4.0-SNAPSHOT/configuration.html 文档 + org: + quartz: + # Scheduler 相关配置 + scheduler: + instanceName: schedulerName + instanceId: AUTO # 自动生成 instance ID + # JobStore 相关配置 + jobStore: + # JobStore 实现类。可见博客:https://blog.csdn.net/weixin_42458219/article/details/122247162 + class: org.springframework.scheduling.quartz.LocalDataSourceJobStore + isClustered: true # 是集群模式 + clusterCheckinInterval: 15000 # 集群检查频率,单位:毫秒。默认为 15000,即 15 秒 + misfireThreshold: 60000 # misfire 阀值,单位:毫秒。 + # 线程池相关配置 + threadPool: + threadCount: 25 # 线程池大小。默认为 10 。 + threadPriority: 5 # 线程优先级 + class: org.quartz.simpl.SimpleThreadPool # 线程池类型 + jdbc: # 使用 JDBC 的 JobStore 的时候,JDBC 的配置 + initialize-schema: NEVER # 是否自动使用 SQL 初始化 Quartz 表结构。这里设置成 never ,我们手动创建表结构。 + +--- #################### 服务保障相关配置 #################### + +# Lock4j 配置项 +lock4j: + acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒 + expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒 + +# Resilience4j 配置项 +resilience4j: + ratelimiter: + instances: + backendA: + limit-for-period: 1 # 每个周期内,允许的请求数。默认为 50 + limit-refresh-period: 60s # 每个周期的时长,单位:微秒。默认为 500 + timeout-duration: 1s # 被限流时,阻塞等待的时长,单位:微秒。默认为 5s + register-health-indicator: true # 是否注册到健康监测 + +--- #################### 监控相关配置 #################### + +# Actuator 监控端点的配置项 +management: + endpoints: + web: + base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator + exposure: + include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。 + +# Spring Boot Admin 配置项 +spring: + boot: + admin: + # Spring Boot Admin Client 客户端的相关配置 + client: + url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server 地址 + instance: + service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME] + # Spring Boot Admin Server 服务端的相关配置 + context-path: /admin # 配置 Spring + +# 日志文件配置 +logging: + file: + name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 + +--- #################### 微信公众号相关配置 #################### +wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档 + mp: + # 公众号配置(必填) + app-id: wx041349c6f39b268b + secret: 5abee519483bc9f8cb37ce280e814bd0 + # 存储配置,解决 AccessToken 的跨节点的共享 + config-storage: + type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取 + key-prefix: wx # Redis Key 的前缀 TODO 芋艿:解决下 Redis key 管理的配置 + http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台 + miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档 + appid: wx63c280fe3248a3e7 + secret: 6f270509224a7ae1296bbf1c8cb97aed + config-storage: + type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取 + key-prefix: wa # Redis Key 的前缀 TODO 芋艿:解决下 Redis key 管理的配置 + http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台 + pay: + one: + enabled: true + app-id: wxb1826c88da21d81e + mch-id: 1641993417 + mch-key: qdn2I7Cmx4JeiKOt2CDjiu6UHgLTsOsM + apiv3-key: cyywl666666cyywl888888cyywl66666 + private-cert-path: classpath:/1/apiclient_cert.pem + private-key-path: classpath:/1/apiclient_key.pem + key-path: classpath:/1/apiclient_cert.p12 + cert-serial-no: 58FDB503F92B6C0E258C9940BB726C2BF6022E56 + notify-url: http://yuxy.perrymake.com/app-api/pay/wxpay/pay_notify + refund-notify-url: http://yuxy.perrymake.com/app-api/pay/wxpay/refund_notify + two: + enabled: true + app-id: wxb1826c88da21d81e + mch-id: 1642042589 + mch-key: qdn2I7Cmx4JeiKOt2CDjiu6UHgLTsOsM + apiv3-key: cyywl666666cyywl888888cyywl66666 + private-cert-path: classpath:/2/apiclient_cert.pem + private-key-path: classpath:/2/apiclient_key.pem + key-path: classpath:/2/apiclient_cert.p12 + cert-serial-no: 47F04D51F958FFEF56A6DFC25BDE83CF89353E19 + notify-url: http://yuxy.perrymake.com/app-api/pay/wxpay/pay_notify + refund-notify-url: http://yuxy.perrymake.com/app-api/pay/wxpay/refund_notify +--- #################### 芋道相关配置 #################### + +# 芋道配置项,设置当前项目所有自定义的配置 +yudao: + xss: + enable: false + exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系 + - ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求 + - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求 + pay: + callback-url: http://yunai.natapp1.cc/admin-api/pay/notify/callback + return-url: http://yunai.natapp1.cc/admin-api/pay/notify/return + demo: false # 开启演示模式 + +justauth: + enabled: true + type: + DINGTALK: # 钉钉 + client-id: dingvrnreaje3yqvzhxg + client-secret: i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI + ignore-check-redirect-uri: true + WECHAT_ENTERPRISE: # 企业微信 + client-id: wwd411c69a39ad2e54 + client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw + agent-id: 1000004 + ignore-check-redirect-uri: true + cache: + type: REDIS + prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: + timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 +wx: + mp: + useRedis: false + defaultContent: \u60A8\u597D\uFF0C\u6709\u4EC0\u4E48\u95EE\u9898\uFF1F + redisConfig: + host: 117.33.142.185 # 地址 + port: 6369 # 端口 + database: 16 # 数据库索引 + password: 20221122@dev # 密码,建议生产环境开启 From 80e679a7511fadb323f41ea322285e7c385c6b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B0=8F=E5=BC=A0?= <1085577365@qq.com> Date: Tue, 16 May 2023 18:46:19 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=90=8E=E5=8F=B0--=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E7=89=A9=E6=B5=81=E3=80=81=E8=A7=84=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../express/ShippingTemplatesController.java | 7 ++++--- .../ShippingTemplatesNoDeliveryController.java | 2 +- .../express/vo/ShippingTemplatesFreeRespVO.java | 3 --- .../vo/ShippingTemplatesRegionRespVO.java | 4 ---- .../express/ShippingTemplatesFreeDO.java | 5 ----- .../express/ShippingTemplatesRegionDO.java | 10 ---------- .../ShippingTemplatesNoDeliveryService.java | 2 ++ .../express/ShippingTemplatesService.java | 5 +++-- .../impl/ShippingTemplatesFreeServiceImpl.java | 17 +++++++++++++---- .../ShippingTemplatesNoDeliveryServiceImpl.java | 14 ++++++++++++-- .../ShippingTemplatesRegionServiceImpl.java | 17 ++++++++++------- .../impl/ShippingTemplatesServiceImpl.java | 15 ++++++++++----- .../express/ShippingTemplatesFreeMapper.xml | 2 +- .../ShippingTemplatesNoDeliveryMapper.xml | 2 +- .../express/ShippingTemplatesRegionMapper.xml | 2 +- 15 files changed, 58 insertions(+), 49 deletions(-) diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesController.java index 537fc1e65..41d6eb02c 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesController.java @@ -2,11 +2,12 @@ package cn.iocoder.yudao.module.shop.controller.admin.express; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesReqVO; import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesSearchReqVO; import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesDO; import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesService; +import com.github.pagehelper.PageInfo; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -46,8 +47,8 @@ public class ShippingTemplatesController { @PreAuthorize("@ss.hasPermission('admin:shipping:templates:list')") @Operation(summary = "分页列表") @GetMapping(value = "/list") - public CommonResult> getList(@Validated ShippingTemplatesSearchReqVO request){ - PageResult shippingTemplatesCommonPage = shippingTemplatesService.getList(request); + public CommonResult> getList(@Validated ShippingTemplatesSearchReqVO request, @Validated PageParam pageParamRequest){ + PageInfo shippingTemplatesCommonPage = shippingTemplatesService.getList(request, pageParamRequest); return CommonResult.success(shippingTemplatesCommonPage); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesNoDeliveryController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesNoDeliveryController.java index 1f183c952..8af8816bc 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesNoDeliveryController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesNoDeliveryController.java @@ -30,7 +30,7 @@ import java.util.List; @Slf4j @RestController @RequestMapping("admin/express/shipping/no_delivery") -@Tag(name = "设置 -- 物流 -- 免费") +@Tag(name = "设置 -- 物流 -- 不送达") public class ShippingTemplatesNoDeliveryController { @Autowired diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesFreeRespVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesFreeRespVO.java index 3bb66a80d..5a037a619 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesFreeRespVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesFreeRespVO.java @@ -39,9 +39,6 @@ public class ShippingTemplatesFreeRespVO implements Serializable { @Schema(description = "省ID, 多个逗号分割。 全国 all", required = true, example = "1,2,3,4") private String provinceId; - @Schema(description = "城市名称描述") - private String title; - @Schema(description = "包邮件数", required = true, example = "1") // @Min(value = 1, message = "请填写包邮件数") @DecimalMin(value = "0.1", message = "包邮不能低于0.1") diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesRegionRespVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesRegionRespVO.java index b27b87223..d02fb3fd7 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesRegionRespVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesRegionRespVO.java @@ -38,8 +38,6 @@ public class ShippingTemplatesRegionRespVO implements Serializable { @Schema(description = "省ID, 多个逗号分割。 全国 all", required = true, example = "1,2,3,4") private String provinceId; - @Schema(description = "城市名称描述") - private String title; @Schema(description = "首件", required = true, example = "0.1") @DecimalMin(value = "0.1", message = "首件金额不能低于0.1") @@ -57,6 +55,4 @@ public class ShippingTemplatesRegionRespVO implements Serializable { @DecimalMin(value = "0.1", message = "续件运费金额不能低于0.1") private BigDecimal renewalPrice; - @Schema(description = "分组唯一值") - private String uniqid; } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesFreeDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesFreeDO.java index 3b7023c87..05590bedf 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesFreeDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesFreeDO.java @@ -45,11 +45,6 @@ public class ShippingTemplatesFreeDO implements Serializable { */ private Integer cityId; - /** - *描述 - */ - private String title; - /** *包邮件数 */ diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java index 7ea1a2c4b..91d6e49a7 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java @@ -46,11 +46,6 @@ public class ShippingTemplatesRegionDO implements Serializable { private Integer provinceId; - /** - *描述 - */ - private String title; - /** *首件 */ @@ -76,11 +71,6 @@ public class ShippingTemplatesRegionDO implements Serializable { */ private Integer type; - /** - *分组唯一值 - */ - private String uniqid; - /** *是否无效 */ diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ShippingTemplatesNoDeliveryService.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ShippingTemplatesNoDeliveryService.java index 065c63298..ba98b4d93 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ShippingTemplatesNoDeliveryService.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ShippingTemplatesNoDeliveryService.java @@ -36,4 +36,6 @@ public interface ShippingTemplatesNoDeliveryService extends IService { - PageResult getList(ShippingTemplatesSearchReqVO request); + PageInfo getList(ShippingTemplatesSearchReqVO request, PageParam pageParamRequest); /** * 新增运费模板 diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesFreeServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesFreeServiceImpl.java index 83d64db5d..42cd393dd 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesFreeServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesFreeServiceImpl.java @@ -18,7 +18,6 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; /** * ShippingTemplatesFreeServiceImpl 接口实现 @@ -68,7 +67,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId); + return dao.delete(lambdaQueryWrapper) > 0; + } + + /** + * 删除模板下的无效数据 + * @param tempId Integer 运费模板id + */ + public Boolean deleteStatusFalse(Integer tempId) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId); lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getStatus, false); diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesNoDeliveryServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesNoDeliveryServiceImpl.java index 9e36be37d..726d42337 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesNoDeliveryServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesNoDeliveryServiceImpl.java @@ -11,14 +11,12 @@ import cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesNoDeliver import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesNoDeliveryService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; @Service @Validated @@ -41,6 +39,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl shippingTemplatesNoDeliveryRespVOS, Integer tempId) { ArrayList shippingTemplatesNoDeliveryDOS = new ArrayList<>(); + delete(tempId); for (ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVO : shippingTemplatesNoDeliveryRespVOS) { if(shippingTemplatesNoDeliveryRespVO.getCityId().equals("all") || shippingTemplatesNoDeliveryRespVO.getCityId().equals("0")){ cityIdList = getCityIdList(); @@ -58,6 +57,17 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(ShippingTemplatesNoDeliveryDO::getTempId, tempId); + return shippingTemplatesNoDeliveryMapper.delete(lambdaQueryWrapper) > 0; + } + /** * 获取所有城市cityId * @author Mr.Zhang diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesRegionServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesRegionServiceImpl.java index 558d11a62..27bbcdd99 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesRegionServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesRegionServiceImpl.java @@ -20,7 +20,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import java.util.stream.Collectors; /** * ShippingTemplatesRegionServiceImpl 接口实现 @@ -79,8 +78,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId); lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getStatus, false); @@ -152,7 +149,6 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId); lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getCityId, cityId); - lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getStatus, true); lambdaQueryWrapper.orderByDesc(ShippingTemplatesRegionDO::getId); lambdaQueryWrapper.last(" limit 1"); return dao.selectOne(lambdaQueryWrapper); @@ -167,5 +163,12 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl getListGroup(Integer tempId) { return dao.getListGroup(tempId); } + + @Override + public Boolean delete(Integer tempId) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId); + return dao.delete(lambdaQueryWrapper) > 0; + } } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesServiceImpl.java index a68ebab56..b1c05e887 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesServiceImpl.java @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.shop.service.express.impl; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.exception.ServiceException; -import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.module.shop.controller.admin.express.vo.*; import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesDO; import cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesMapper; @@ -13,6 +13,8 @@ import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesRegionServi import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -59,15 +61,16 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl */ @Override - public PageResult getList(ShippingTemplatesSearchReqVO request) { + public PageInfo getList(ShippingTemplatesSearchReqVO request, PageParam pageParamRequest) { + PageHelper.startPage(pageParamRequest.getPageNo(), pageParamRequest.getPageSize()); LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); if(!StringUtils.isBlank(request.getKeywords())){ lambdaQueryWrapper.like(ShippingTemplatesDO::getName, request.getKeywords()); } - lambdaQueryWrapper.orderByDesc(ShippingTemplatesDO::getSort).orderByDesc(ShippingTemplatesDO::getId); - return dao.selectPage(request, lambdaQueryWrapper); + lambdaQueryWrapper.orderByDesc(ShippingTemplatesDO::getSort).orderByDesc(ShippingTemplatesDO::getId); + return new PageInfo<>(dao.selectList(lambdaQueryWrapper)); } /** @@ -92,6 +95,7 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl { shippingTemplatesRegionService.delete(id); shippingTemplatesFreeService.delete(id); - removeById(id); + shippingTemplatesNoDeliveryService.delete(id); + dao.deleteById(id); return Boolean.TRUE; }); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml index 518028905..d27a6d8f0 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml @@ -3,6 +3,6 @@ diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml index f403c4d62..06da0e77c 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml @@ -3,6 +3,6 @@ diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml index 3e174bafb..d31a41ad7 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml @@ -3,6 +3,6 @@