From 7c87d13ba2ae0bd69c3a3a28c51f8674082476ab Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Tue, 30 Nov 2021 15:28:12 +0800 Subject: [PATCH 01/39] =?UTF-8?q?'=E5=8E=BB=E9=99=A44.24=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=8A=9F=E8=83=BD'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DB/version4.2.3to4.2.4.sql | 3 +- .../order/order/entity/dos/OrderItem.java | 4 -- .../enums/IdentificationStatusEnum.java | 25 ---------- .../serviceimpl/AfterSaleServiceImpl.java | 46 +------------------ 4 files changed, 3 insertions(+), 75 deletions(-) delete mode 100644 framework/src/main/java/cn/lili/modules/order/order/entity/enums/IdentificationStatusEnum.java diff --git a/DB/version4.2.3to4.2.4.sql b/DB/version4.2.3to4.2.4.sql index d9a266fc..78764222 100644 --- a/DB/version4.2.3to4.2.4.sql +++ b/DB/version4.2.3to4.2.4.sql @@ -1,3 +1,2 @@ /** 新增已退货数量 **/ -ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 '; -ALTER TABLE li_order_item ADD identification_status varchar(255) COMMENT '标识是否被4.2.4版本处理过的订单'; \ No newline at end of file +ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 '; \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java index b711a8a7..ae8c270f 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java @@ -9,7 +9,6 @@ import cn.lili.modules.order.cart.entity.vo.CartSkuVO; import cn.lili.modules.order.cart.entity.vo.CartVO; import cn.lili.modules.order.order.entity.dto.PriceDetailDTO; import cn.lili.modules.order.order.entity.enums.CommentStatusEnum; -import cn.lili.modules.order.order.entity.enums.IdentificationStatusEnum; import cn.lili.modules.order.order.entity.enums.OrderComplaintStatusEnum; import cn.lili.modules.order.order.entity.enums.OrderItemAfterSaleStatusEnum; import cn.lili.modules.promotion.entity.vos.PromotionSkuVO; @@ -116,8 +115,6 @@ public class OrderItem extends BaseEntity { @ApiModelProperty(value = "退货商品数量") private Integer returnGoodsNumber; - @ApiModelProperty(value = "标识是否被4.2.4版本处理过的订单") - private String identificationStatus; public OrderItem(CartSkuVO cartSkuVO, CartVO cartVO, TradeDTO tradeDTO) { String oldId = this.getId(); @@ -132,7 +129,6 @@ public class OrderItem extends BaseEntity { this.setAfterSaleStatus(OrderItemAfterSaleStatusEnum.NEW.name()); this.setCommentStatus(CommentStatusEnum.NEW.name()); this.setComplainStatus(OrderComplaintStatusEnum.NEW.name()); - this.setIdentificationStatus(IdentificationStatusEnum.ALREADY_NOT_HANDLE.name()); this.setPriceDetailDTO(cartSkuVO.getPriceDetailDTO()); this.setOrderSn(cartVO.getSn()); this.setTradeSn(tradeDTO.getSn()); diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/enums/IdentificationStatusEnum.java b/framework/src/main/java/cn/lili/modules/order/order/entity/enums/IdentificationStatusEnum.java deleted file mode 100644 index 7993eeb1..00000000 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/enums/IdentificationStatusEnum.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.lili.modules.order.order.entity.enums; - -/** - * 标识是否被4.2.4版本处理过的订单 - * @author: ftyy - * @Date: 2021-11-19 18:29 - */ -public enum IdentificationStatusEnum { - /** - * 订单处理状态 - **/ - - NOT_HANDLE("未处理过的订单"), - ALREADY_NOT_HANDLE("已处理过的订单"); - - private final String description; - - IdentificationStatusEnum(String description) { - this.description = description; - } - - public String description() { - return this.description; - } -} diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java index 2dc37ff6..9acd0f63 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java @@ -54,12 +54,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.annotation.PostConstruct; import java.util.Date; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; -import java.util.stream.Stream; + /** * 售后业务层实现 @@ -598,46 +597,6 @@ public class AfterSaleServiceImpl extends ServiceImpl orderItemList = orderItemService.list(new LambdaQueryWrapper() - .isNull(OrderItem::getIdentificationStatus).or() - .eq(OrderItem::getIdentificationStatus, IdentificationStatusEnum.NOT_HANDLE.name())); - - //不为空时对订单数据进行部分售后逻辑处理 - if (!orderItemList.isEmpty()) { - - //遍历订单查询每一个订单下的售后记录 - orderItemList.forEach(orderItem -> { - - //订单状态不能为新订单,已失效订单或未申请订单才可以去修改订单信息 - if (!orderItem.getAfterSaleStatus().equals(OrderItemAfterSaleStatusEnum.NEW.name()) - && !orderItem.getAfterSaleStatus().equals(OrderItemAfterSaleStatusEnum.EXPIRED.name()) - && !orderItem.getAfterSaleStatus().equals(OrderItemAfterSaleStatusEnum.NOT_APPLIED.name())) { - - //查询订单下的售后记录 - List afterSaleList = this.list(new LambdaQueryWrapper() - .eq(AfterSale::getOrderSn, orderItem.getOrderSn()) - .eq(AfterSale::getGoodsId, orderItem.getGoodsId())); - - //获取售后商品数量及已完成售后商品数量修改orderItem订单 - this.updateOrderItemGoodsNumber(orderItem, afterSaleList); - } - - //修改orderItem订单 - this.updateOrderItem(orderItem); - }); - - } - - } /** * 功能描述: 获取售后商品数量及已完成售后商品数量修改orderItem订单 @@ -707,8 +666,7 @@ public class AfterSaleServiceImpl extends ServiceImpl() .eq(OrderItem::getSn, orderItem.getSn()) .set(OrderItem::getAfterSaleStatus, orderItem.getAfterSaleStatus()) - .set(OrderItem::getReturnGoodsNumber,orderItem.getReturnGoodsNumber()) - .set(OrderItem::getIdentificationStatus, IdentificationStatusEnum.ALREADY_NOT_HANDLE.name())); + .set(OrderItem::getReturnGoodsNumber,orderItem.getReturnGoodsNumber())); } } \ No newline at end of file From efc4b37782ed8289817bc33965d3aa66ce196f2b Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Wed, 15 Dec 2021 18:32:59 +0800 Subject: [PATCH 02/39] =?UTF-8?q?'RequestMapping=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E7=BB=9F=E4=B8=80=E5=A4=84=E7=90=86'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lili/controller/goods/CategoryBuyerController.java | 2 +- .../cn/lili/controller/goods/GoodsBuyerController.java | 2 +- .../cn/lili/controller/member/FootprintController.java | 2 +- .../controller/member/MemberAddressBuyerController.java | 2 +- .../member/MemberEvaluationBuyerController.java | 2 +- .../controller/member/MemberMessageBuyerController.java | 2 +- .../lili/controller/member/MemberReceiptController.java | 2 +- .../controller/member/MemberWalletBuyerController.java | 2 +- .../member/MemberWithdrawApplyBuyerController.java | 2 +- .../lili/controller/member/RechargeBuyerController.java | 2 +- .../lili/controller/other/AppVersionBuyerController.java | 2 +- .../cn/lili/controller/other/ArticleBuyerController.java | 2 +- .../lili/controller/other/FeedbackBuyerController.java | 2 +- .../lili/controller/other/LogisticsBuyerController.java | 2 +- .../cn/lili/controller/other/PageBuyerController.java | 2 +- .../controller/other/broadcast/StudioController.java | 2 +- .../other/distribution/DistributionBuyerController.java | 2 +- .../distribution/DistributionGoodsBuyerController.java | 2 +- .../other/purchase/PurchaseBuyerController.java | 2 +- .../other/purchase/PurchaseQuotedController.java | 2 +- .../lili/controller/passport/MemberBuyerController.java | 2 +- .../passport/connect/ConnectBuyerBindController.java | 2 +- .../passport/connect/ConnectBuyerWebController.java | 2 +- .../passport/connect/MiniProgramBuyerController.java | 2 +- .../cn/lili/controller/payment/CashierController.java | 2 +- .../lili/controller/payment/CashierRefundController.java | 2 +- .../cn/lili/controller/store/StoreBuyerController.java | 2 +- .../lili/controller/trade/AfterSaleBuyerController.java | 2 +- .../cn/lili/controller/trade/OrderBuyerController.java | 2 +- .../controller/trade/OrderComplaintBuyerController.java | 2 +- .../java/cn/lili/controller/common/FileController.java | 4 ++-- .../java/cn/lili/controller/common/IMController.java | 2 +- .../java/cn/lili/controller/common/LogoController.java | 4 ++-- .../java/cn/lili/controller/common/RegionController.java | 2 +- .../cn/lili/controller/common/SliderImageController.java | 2 +- .../java/cn/lili/controller/common/SmsController.java | 2 +- .../java/cn/lili/controller/common/UploadController.java | 2 +- .../cn/lili/controller/file/FileManagerController.java | 4 ++-- .../controller/goods/CategoryBrandManagerController.java | 2 +- .../goods/CategoryParameterGroupManagerController.java | 2 +- .../goods/CategorySpecificationManagerController.java | 2 +- .../cn/lili/controller/goods/GoodsManagerController.java | 2 +- .../{setting => hotwords}/HotWordsManagerController.java | 4 ++-- .../lili/controller/member/IpInfoManagerController.java | 9 ++++----- .../member/MemberEvaluationManagerController.java | 2 +- .../controller/member/MemberGradeManagerController.java | 2 +- .../member/MemberMessageManagerController.java | 2 +- .../member/MemberNoticeLogManagerController.java | 2 +- .../member/MemberNoticeSenterManagerController.java | 2 +- .../controller/member/MemberWalletManagerController.java | 2 +- .../member/MemberWithdrawApplyManagerController.java | 2 +- .../{setting => other}/AppVersionManagerController.java | 4 ++-- .../other/ArticleCategoryManagerController.java | 2 +- .../lili/controller/other/ArticleManagerController.java | 2 +- .../cn/lili/controller/other/CustomWordsController.java | 2 +- .../lili/controller/other/ElasticsearchController.java | 2 +- .../lili/controller/other/FeedbackManagerController.java | 2 +- .../{setting => other}/LogisticsManagerController.java | 4 ++-- .../lili/controller/other/MessageManagerController.java | 2 +- .../lili/controller/other/PageDataManagerController.java | 2 +- .../other/SensitiveWordsManagerController.java | 2 +- .../lili/controller/other/SpecialManagerController.java | 2 +- .../controller/other/VerificationSourceController.java | 2 +- .../other/broadcast/CommodityManagerController.java | 2 +- .../other/broadcast/StudioManagerController.java | 4 ++-- .../distribution/DistributionManagerController.java | 2 +- .../other/purchase/PurchaseManagerController.java | 2 +- .../controller/passport/AdminUserManagerController.java | 2 +- .../{member => passport}/MemberManagerController.java | 4 ++-- .../permission/DepartmentManagerController.java | 2 +- .../permission/DepartmentRoleManagerController.java | 2 +- .../controller/permission/MenuManagerController.java | 2 +- .../controller/permission/RoleManagerController.java | 2 +- .../controller/permission/RoleMenuManagerController.java | 2 +- .../controller/permission/UserRoleManagerController.java | 2 +- .../promotion/KanJiaActivityGoodsManagerController.java | 2 +- .../controller/promotion/PromotionManagerController.java | 2 +- .../cn/lili/controller/setting/LogManagerController.java | 2 +- .../setting/MemberNoticeManagerController.java | 2 +- .../setting/NoticeMessageManagerController.java | 2 +- .../lili/controller/setting/RegionManagerController.java | 2 +- .../setting/ServiceNoticeManagerController.java | 2 +- .../controller/setting/SettingManagerController.java | 2 +- .../controller/setting/SettingXManagerController.java | 2 +- .../cn/lili/controller/setting/SmsManagerController.java | 2 +- .../setting/WechatMPMessageManagerController.java | 2 +- .../setting/WechatMessageManageController.java | 2 +- .../RefundOrderStatisticsManagerController.java | 2 +- .../cn/lili/controller/store/StoreManagerController.java | 2 +- .../controller/store/StoreMessageManagerController.java | 4 ++-- .../controller/trade/AfterSaleManagerController.java | 2 +- .../trade/AfterSaleReasonManagerController.java | 2 +- .../trade/OrderComplaintManagerController.java | 2 +- .../lili/controller/trade/OrderLogManagerController.java | 2 +- .../cn/lili/controller/trade/OrderManagerController.java | 2 +- .../controller/trade/PaymentLogManagerController.java | 2 +- .../lili/controller/trade/ReceiptManagerController.java | 2 +- .../lili/controller/trade/RechargeManagerController.java | 2 +- .../controller/trade/RefundLogManagerController.java | 2 +- .../goods/CategoryParameterGroupStoreController.java | 2 +- .../goods/CategorySpecificationStoreController.java | 2 +- .../lili/controller/goods/DraftGoodsStoreController.java | 2 +- .../cn/lili/controller/goods/GoodsStoreController.java | 2 +- .../lili/controller/goods/GoodsUnitStoreController.java | 2 +- .../cn/lili/controller/member/StoreUserController.java | 2 +- .../other/{article => }/ArticleStoreController.java | 4 ++-- .../{settings => other}/LogisticsStoreController.java | 4 ++-- .../other/broadcast/CommodityStoreController.java | 2 +- .../other/broadcast/StudioStoreController.java | 2 +- .../distribution/DistributionGoodsStoreController.java | 2 +- .../distribution/DistributionOrderStoreController.java | 2 +- .../controller/passport/StorePassportController.java | 2 +- .../settings/FreightTemplateStoreController.java | 2 +- .../cn/lili/controller/settings/LogStoreController.java | 2 +- .../lili/controller/settings/StoreAddressController.java | 2 +- .../lili/controller/settings/StoreMessageController.java | 2 +- .../controller/settings/StorePageDataController.java | 2 +- .../controller/settings/StoreSettingsController.java | 2 +- .../statistics/RefundOrderStatisticsStoreController.java | 2 +- .../lili/controller/trade/AfterSaleStoreController.java | 2 +- .../cn/lili/controller/trade/BillStoreController.java | 2 +- .../trade/MemberEvaluationStoreController.java | 2 +- .../controller/trade/OrderComplaintStoreController.java | 2 +- .../lili/controller/trade/OrderLogStoreController.java | 2 +- .../cn/lili/controller/trade/OrderStoreController.java | 2 +- .../cn/lili/controller/trade/ReceiptStoreController.java | 2 +- 126 files changed, 140 insertions(+), 141 deletions(-) rename manager-api/src/main/java/cn/lili/controller/{setting => hotwords}/HotWordsManagerController.java (94%) mode change 100755 => 100644 rename manager-api/src/main/java/cn/lili/controller/{setting => other}/AppVersionManagerController.java (97%) mode change 100755 => 100644 rename manager-api/src/main/java/cn/lili/controller/{setting => other}/LogisticsManagerController.java (96%) rename manager-api/src/main/java/cn/lili/controller/{member => passport}/MemberManagerController.java (97%) rename seller-api/src/main/java/cn/lili/controller/other/{article => }/ArticleStoreController.java (95%) rename seller-api/src/main/java/cn/lili/controller/{settings => other}/LogisticsStoreController.java (97%) diff --git a/buyer-api/src/main/java/cn/lili/controller/goods/CategoryBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/goods/CategoryBuyerController.java index e5cb0157..37689867 100644 --- a/buyer-api/src/main/java/cn/lili/controller/goods/CategoryBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/goods/CategoryBuyerController.java @@ -25,7 +25,7 @@ import java.util.List; */ @RestController @Api(tags = "买家端,商品分类接口") -@RequestMapping("/buyer/category") +@RequestMapping("/buyer/goods/category") public class CategoryBuyerController { /** * 商品分类 diff --git a/buyer-api/src/main/java/cn/lili/controller/goods/GoodsBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/goods/GoodsBuyerController.java index cfc844dc..92f8838d 100644 --- a/buyer-api/src/main/java/cn/lili/controller/goods/GoodsBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/goods/GoodsBuyerController.java @@ -43,7 +43,7 @@ import java.util.Map; @Slf4j @Api(tags = "买家端,商品接口") @RestController -@RequestMapping("/buyer/goods") +@RequestMapping("/buyer/goods/goods") public class GoodsBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/member/FootprintController.java b/buyer-api/src/main/java/cn/lili/controller/member/FootprintController.java index b0ad9da4..256603f9 100644 --- a/buyer-api/src/main/java/cn/lili/controller/member/FootprintController.java +++ b/buyer-api/src/main/java/cn/lili/controller/member/FootprintController.java @@ -23,7 +23,7 @@ import java.util.List; */ @RestController @Api(tags = "买家端,浏览历史接口") -@RequestMapping("/buyer/footprint") +@RequestMapping("/buyer/member/footprint") public class FootprintController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/member/MemberAddressBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/member/MemberAddressBuyerController.java index fc2e7d3a..d1763e88 100644 --- a/buyer-api/src/main/java/cn/lili/controller/member/MemberAddressBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/member/MemberAddressBuyerController.java @@ -26,7 +26,7 @@ import java.util.Objects; */ @RestController @Api(tags = "买家端,会员地址接口") -@RequestMapping("/buyer/memberAddress") +@RequestMapping("/buyer/member/address") public class MemberAddressBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/member/MemberEvaluationBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/member/MemberEvaluationBuyerController.java index acf5b34d..42a28a14 100644 --- a/buyer-api/src/main/java/cn/lili/controller/member/MemberEvaluationBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/member/MemberEvaluationBuyerController.java @@ -28,7 +28,7 @@ import javax.validation.constraints.NotNull; */ @RestController @Api(tags = "买家端,会员商品评价接口") -@RequestMapping("/buyer/memberEvaluation") +@RequestMapping("/buyer/member/evaluation") public class MemberEvaluationBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/member/MemberMessageBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/member/MemberMessageBuyerController.java index 552e6aeb..f6a16d37 100644 --- a/buyer-api/src/main/java/cn/lili/controller/member/MemberMessageBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/member/MemberMessageBuyerController.java @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.*; */ @RestController @Api(tags = "买家端,会员站内消息接口") -@RequestMapping("/buyer/member/message") +@RequestMapping("/buyer/message/member") public class MemberMessageBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/member/MemberReceiptController.java b/buyer-api/src/main/java/cn/lili/controller/member/MemberReceiptController.java index 2d82d55c..dfbec8c3 100644 --- a/buyer-api/src/main/java/cn/lili/controller/member/MemberReceiptController.java +++ b/buyer-api/src/main/java/cn/lili/controller/member/MemberReceiptController.java @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.*; */ @RestController @Api(tags = "买家端,会员发票接口") -@RequestMapping("/buyer/member/receipt") +@RequestMapping("/buyer/wallet/receipt") public class MemberReceiptController { @Autowired diff --git a/buyer-api/src/main/java/cn/lili/controller/member/MemberWalletBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/member/MemberWalletBuyerController.java index ca2135c1..65fecc4a 100644 --- a/buyer-api/src/main/java/cn/lili/controller/member/MemberWalletBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/member/MemberWalletBuyerController.java @@ -34,7 +34,7 @@ import javax.validation.constraints.Pattern; */ @RestController @Api(tags = "买家端,会员余额接口") -@RequestMapping("/buyer/members/wallet") +@RequestMapping("/buyer/wallet/wallet") public class MemberWalletBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/member/MemberWithdrawApplyBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/member/MemberWithdrawApplyBuyerController.java index 5ac9e860..60498f5d 100644 --- a/buyer-api/src/main/java/cn/lili/controller/member/MemberWithdrawApplyBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/member/MemberWithdrawApplyBuyerController.java @@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "买家端,余额提现记录接口") -@RequestMapping("/buyer/member/withdrawApply") +@RequestMapping("/buyer/wallet/withdrawApply") @Transactional(rollbackFor = Exception.class) public class MemberWithdrawApplyBuyerController { @Autowired diff --git a/buyer-api/src/main/java/cn/lili/controller/member/RechargeBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/member/RechargeBuyerController.java index e75eea9b..a7ff4f46 100644 --- a/buyer-api/src/main/java/cn/lili/controller/member/RechargeBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/member/RechargeBuyerController.java @@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "买家端,预存款充值记录接口") -@RequestMapping("/buyer/member/recharge") +@RequestMapping("/buyer/wallet/recharge") @Transactional(rollbackFor = Exception.class) public class RechargeBuyerController { diff --git a/buyer-api/src/main/java/cn/lili/controller/other/AppVersionBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/other/AppVersionBuyerController.java index 581f3051..ccf080ad 100644 --- a/buyer-api/src/main/java/cn/lili/controller/other/AppVersionBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/other/AppVersionBuyerController.java @@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "买家端,APP版本") -@RequestMapping("/buyer/appVersion") +@RequestMapping("/buyer/other/appVersion") public class AppVersionBuyerController { @Autowired diff --git a/buyer-api/src/main/java/cn/lili/controller/other/ArticleBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/other/ArticleBuyerController.java index cef8b1ad..1142e47e 100644 --- a/buyer-api/src/main/java/cn/lili/controller/other/ArticleBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/other/ArticleBuyerController.java @@ -29,7 +29,7 @@ import java.util.List; */ @RestController @Api(tags = "买家端,文章接口") -@RequestMapping("/buyer/article") +@RequestMapping("/buyer/other/article") public class ArticleBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/other/FeedbackBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/other/FeedbackBuyerController.java index 83f0ac04..84c69306 100644 --- a/buyer-api/src/main/java/cn/lili/controller/other/FeedbackBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/other/FeedbackBuyerController.java @@ -22,7 +22,7 @@ import javax.validation.Valid; */ @RestController @Api(tags = "买家端,意见反馈接口") -@RequestMapping("/buyer/feedback") +@RequestMapping("/buyer/other/feedback") public class FeedbackBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/other/LogisticsBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/other/LogisticsBuyerController.java index 36c798cf..b44aabd5 100644 --- a/buyer-api/src/main/java/cn/lili/controller/other/LogisticsBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/other/LogisticsBuyerController.java @@ -21,7 +21,7 @@ import java.util.List; */ @RestController @Api(tags = "买家端,物流公司接口") -@RequestMapping("/buyer/logistics") +@RequestMapping("/buyer/other/logistics") public class LogisticsBuyerController { @Autowired diff --git a/buyer-api/src/main/java/cn/lili/controller/other/PageBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/other/PageBuyerController.java index 35b262a8..f7a60963 100644 --- a/buyer-api/src/main/java/cn/lili/controller/other/PageBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/other/PageBuyerController.java @@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "买家端,页面接口") -@RequestMapping("/buyer/pageData") +@RequestMapping("/buyer/other/pageData") public class PageBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/other/broadcast/StudioController.java b/buyer-api/src/main/java/cn/lili/controller/other/broadcast/StudioController.java index d161e5c1..23bdc760 100644 --- a/buyer-api/src/main/java/cn/lili/controller/other/broadcast/StudioController.java +++ b/buyer-api/src/main/java/cn/lili/controller/other/broadcast/StudioController.java @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "买家端,直播间接口") -@RequestMapping("/buyer/broadcast/studio") +@RequestMapping("/buyer/other/broadcast/studio") public class StudioController { @Autowired diff --git a/buyer-api/src/main/java/cn/lili/controller/other/distribution/DistributionBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/other/distribution/DistributionBuyerController.java index 68a87488..2fb64782 100644 --- a/buyer-api/src/main/java/cn/lili/controller/other/distribution/DistributionBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/other/distribution/DistributionBuyerController.java @@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*; */ @RestController @Api(tags = "买家端,分销员接口") -@RequestMapping("/buyer/distribution") +@RequestMapping("/buyer/distribution/distribution") public class DistributionBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/other/distribution/DistributionGoodsBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/other/distribution/DistributionGoodsBuyerController.java index b2e68fa1..e1b73bed 100644 --- a/buyer-api/src/main/java/cn/lili/controller/other/distribution/DistributionGoodsBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/other/distribution/DistributionGoodsBuyerController.java @@ -29,7 +29,7 @@ import javax.validation.constraints.NotNull; */ @RestController @Api(tags = "买家端,分销商品接口") -@RequestMapping("/buyer/distributionGoods") +@RequestMapping("/buyer/distribution/goods") public class DistributionGoodsBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/other/purchase/PurchaseBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/other/purchase/PurchaseBuyerController.java index 1f7db028..c72eb8af 100644 --- a/buyer-api/src/main/java/cn/lili/controller/other/purchase/PurchaseBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/other/purchase/PurchaseBuyerController.java @@ -29,7 +29,7 @@ import javax.validation.constraints.NotNull; */ @Api(tags = "买家端,采购接口") @RestController -@RequestMapping("/buyer/purchase") +@RequestMapping("/buyer/other/purchase/purchase") public class PurchaseBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/other/purchase/PurchaseQuotedController.java b/buyer-api/src/main/java/cn/lili/controller/other/purchase/PurchaseQuotedController.java index 258c5951..1bc03ae7 100644 --- a/buyer-api/src/main/java/cn/lili/controller/other/purchase/PurchaseQuotedController.java +++ b/buyer-api/src/main/java/cn/lili/controller/other/purchase/PurchaseQuotedController.java @@ -27,7 +27,7 @@ import java.util.List; */ @Api(tags = "买家端,采购报价接口") @RestController -@RequestMapping("/buyer/purchaseQuoted") +@RequestMapping("/buyer/other/purchase/purchaseQuoted") public class PurchaseQuotedController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java index a1e6bccb..189f83c8 100644 --- a/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java @@ -26,7 +26,7 @@ import javax.validation.constraints.NotNull; */ @RestController @Api(tags = "买家端,会员接口") -@RequestMapping("/buyer/members") +@RequestMapping("/buyer/passport/members") public class MemberBuyerController { @Autowired diff --git a/buyer-api/src/main/java/cn/lili/controller/passport/connect/ConnectBuyerBindController.java b/buyer-api/src/main/java/cn/lili/controller/passport/connect/ConnectBuyerBindController.java index 7557e952..9a2675ae 100644 --- a/buyer-api/src/main/java/cn/lili/controller/passport/connect/ConnectBuyerBindController.java +++ b/buyer-api/src/main/java/cn/lili/controller/passport/connect/ConnectBuyerBindController.java @@ -21,7 +21,7 @@ import java.util.List; */ @RestController @Api(tags = "买家端,app/小程序 联合登录") -@RequestMapping("/buyer/connect/bind") +@RequestMapping("/buyer/passport/connect/bind") public class ConnectBuyerBindController { @Autowired diff --git a/buyer-api/src/main/java/cn/lili/controller/passport/connect/ConnectBuyerWebController.java b/buyer-api/src/main/java/cn/lili/controller/passport/connect/ConnectBuyerWebController.java index 30ef2cf8..a6cbd775 100644 --- a/buyer-api/src/main/java/cn/lili/controller/passport/connect/ConnectBuyerWebController.java +++ b/buyer-api/src/main/java/cn/lili/controller/passport/connect/ConnectBuyerWebController.java @@ -33,7 +33,7 @@ import java.io.IOException; @Slf4j @RestController @Api(tags = "买家端,web联合登录") -@RequestMapping("/buyer/connect") +@RequestMapping("/buyer/passport/connect/connect") public class ConnectBuyerWebController { @Autowired diff --git a/buyer-api/src/main/java/cn/lili/controller/passport/connect/MiniProgramBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/passport/connect/MiniProgramBuyerController.java index f7c63f4a..bdc0bed5 100644 --- a/buyer-api/src/main/java/cn/lili/controller/passport/connect/MiniProgramBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/passport/connect/MiniProgramBuyerController.java @@ -26,7 +26,7 @@ import java.util.List; * @since 2021/2/19 09:28 */ @RestController -@RequestMapping("/buyer/mini-program") +@RequestMapping("/buyer/passport/connect/miniProgram") @Api(tags = "买家端,小程序登录接口") public class MiniProgramBuyerController { diff --git a/buyer-api/src/main/java/cn/lili/controller/payment/CashierController.java b/buyer-api/src/main/java/cn/lili/controller/payment/CashierController.java index 3389e3e4..217afeee 100644 --- a/buyer-api/src/main/java/cn/lili/controller/payment/CashierController.java +++ b/buyer-api/src/main/java/cn/lili/controller/payment/CashierController.java @@ -30,7 +30,7 @@ import javax.servlet.http.HttpServletResponse; @Slf4j @RestController @Api(tags = "买家端,收银台接口") -@RequestMapping("/buyer/cashier") +@RequestMapping("/buyer/payment/cashier") public class CashierController { @Autowired diff --git a/buyer-api/src/main/java/cn/lili/controller/payment/CashierRefundController.java b/buyer-api/src/main/java/cn/lili/controller/payment/CashierRefundController.java index d86173ca..f4b382e9 100644 --- a/buyer-api/src/main/java/cn/lili/controller/payment/CashierRefundController.java +++ b/buyer-api/src/main/java/cn/lili/controller/payment/CashierRefundController.java @@ -20,7 +20,7 @@ import javax.servlet.http.HttpServletRequest; */ @Api(tags = "买家端,退款回调") @RestController -@RequestMapping("/buyer/cashier/refund") +@RequestMapping("/buyer/payment/cashierRefund") public class CashierRefundController { @Autowired diff --git a/buyer-api/src/main/java/cn/lili/controller/store/StoreBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/store/StoreBuyerController.java index 2c9d9b0c..eda14066 100644 --- a/buyer-api/src/main/java/cn/lili/controller/store/StoreBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/store/StoreBuyerController.java @@ -31,7 +31,7 @@ import java.util.List; * @since 2020/11/17 2:32 下午 */ @RestController -@RequestMapping("/buyer/store") +@RequestMapping("/buyer/store/store") @Api(tags = "买家端,店铺接口") public class StoreBuyerController { diff --git a/buyer-api/src/main/java/cn/lili/controller/trade/AfterSaleBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/trade/AfterSaleBuyerController.java index 5bf9cdf1..d840b282 100644 --- a/buyer-api/src/main/java/cn/lili/controller/trade/AfterSaleBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/trade/AfterSaleBuyerController.java @@ -35,7 +35,7 @@ import java.util.List; */ @RestController @Api(tags = "买家端,售后管理接口") -@RequestMapping("/buyer/afterSale") +@RequestMapping("/buyer/order/afterSale") public class AfterSaleBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/trade/OrderBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/trade/OrderBuyerController.java index 4e945822..ce80967b 100644 --- a/buyer-api/src/main/java/cn/lili/controller/trade/OrderBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/trade/OrderBuyerController.java @@ -34,7 +34,7 @@ import java.util.Objects; */ @RestController @Api(tags = "买家端,订单接口") -@RequestMapping("/buyer/orders") +@RequestMapping("/buyer/order/order") public class OrderBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/trade/OrderComplaintBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/trade/OrderComplaintBuyerController.java index c05fd886..17d47fcd 100644 --- a/buyer-api/src/main/java/cn/lili/controller/trade/OrderComplaintBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/trade/OrderComplaintBuyerController.java @@ -33,7 +33,7 @@ import java.util.Objects; **/ @RestController @Api(tags = "买家端,交易投诉接口") -@RequestMapping("/buyer/complain") +@RequestMapping("/buyer/order/complain") public class OrderComplaintBuyerController { /** diff --git a/common-api/src/main/java/cn/lili/controller/common/FileController.java b/common-api/src/main/java/cn/lili/controller/common/FileController.java index 84df93ff..255499b7 100644 --- a/common-api/src/main/java/cn/lili/controller/common/FileController.java +++ b/common-api/src/main/java/cn/lili/controller/common/FileController.java @@ -30,8 +30,8 @@ import java.util.List; * @since 2020/11/26 15:41 */ @RestController -@Api(tags = "文件管理管理接口") -@RequestMapping("/common/file") +@Api(tags = "文件管理接口") +@RequestMapping("/common/common/file") public class FileController { @Autowired diff --git a/common-api/src/main/java/cn/lili/controller/common/IMController.java b/common-api/src/main/java/cn/lili/controller/common/IMController.java index 0cc2aedd..8111f9c4 100644 --- a/common-api/src/main/java/cn/lili/controller/common/IMController.java +++ b/common-api/src/main/java/cn/lili/controller/common/IMController.java @@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController; * 2021-09-16 15:32 */ @RestController -@RequestMapping("/common/IM") +@RequestMapping("/common/common/IM") @Api(tags = "IM 中心") public class IMController { diff --git a/common-api/src/main/java/cn/lili/controller/common/LogoController.java b/common-api/src/main/java/cn/lili/controller/common/LogoController.java index 63595430..bed5a16e 100644 --- a/common-api/src/main/java/cn/lili/controller/common/LogoController.java +++ b/common-api/src/main/java/cn/lili/controller/common/LogoController.java @@ -19,8 +19,8 @@ import org.springframework.web.bind.annotation.RestController; * @since 2020/11/26 15:41 */ @RestController -@Api(tags = "文件管理管理接口") -@RequestMapping("/common/logo") +@Api(tags = "文件管理接口") +@RequestMapping("/common/common/logo") public class LogoController { @Autowired diff --git a/common-api/src/main/java/cn/lili/controller/common/RegionController.java b/common-api/src/main/java/cn/lili/controller/common/RegionController.java index 0ddc11cc..f951f058 100644 --- a/common-api/src/main/java/cn/lili/controller/common/RegionController.java +++ b/common-api/src/main/java/cn/lili/controller/common/RegionController.java @@ -22,7 +22,7 @@ import java.util.List; */ @RestController @Api(tags = "地址信息接口") -@RequestMapping("/common/region") +@RequestMapping("/common/common/region") public class RegionController { @Autowired diff --git a/common-api/src/main/java/cn/lili/controller/common/SliderImageController.java b/common-api/src/main/java/cn/lili/controller/common/SliderImageController.java index cdb6ba5c..6b233507 100644 --- a/common-api/src/main/java/cn/lili/controller/common/SliderImageController.java +++ b/common-api/src/main/java/cn/lili/controller/common/SliderImageController.java @@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*; */ @Slf4j @RestController -@RequestMapping("/common/slider") +@RequestMapping("/common/common/slider") @Api(tags = "滑块验证码接口") public class SliderImageController { diff --git a/common-api/src/main/java/cn/lili/controller/common/SmsController.java b/common-api/src/main/java/cn/lili/controller/common/SmsController.java index d74b25dc..b690e022 100644 --- a/common-api/src/main/java/cn/lili/controller/common/SmsController.java +++ b/common-api/src/main/java/cn/lili/controller/common/SmsController.java @@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*; */ @RestController @Api(tags = "短信验证码接口") -@RequestMapping("/common/sms") +@RequestMapping("/common/common/sms") public class SmsController { @Autowired diff --git a/common-api/src/main/java/cn/lili/controller/common/UploadController.java b/common-api/src/main/java/cn/lili/controller/common/UploadController.java index 38d3cd0d..bee48ef8 100644 --- a/common-api/src/main/java/cn/lili/controller/common/UploadController.java +++ b/common-api/src/main/java/cn/lili/controller/common/UploadController.java @@ -40,7 +40,7 @@ import java.util.Objects; @Slf4j @RestController @Api(tags = "文件上传接口") -@RequestMapping("/common/upload") +@RequestMapping("/common/common/upload") public class UploadController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/file/FileManagerController.java b/manager-api/src/main/java/cn/lili/controller/file/FileManagerController.java index 8580607e..94142ad0 100644 --- a/manager-api/src/main/java/cn/lili/controller/file/FileManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/file/FileManagerController.java @@ -24,8 +24,8 @@ import java.util.List; * @since 2020/11/26 15:41 */ @RestController -@Api(tags = "管理端,文件管理管理接口") -@RequestMapping("/manager/file") +@Api(tags = "管理端,文件管理接口") +@RequestMapping("/manager/file/file") public class FileManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/goods/CategoryBrandManagerController.java b/manager-api/src/main/java/cn/lili/controller/goods/CategoryBrandManagerController.java index f7db55ee..364aff6f 100644 --- a/manager-api/src/main/java/cn/lili/controller/goods/CategoryBrandManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/goods/CategoryBrandManagerController.java @@ -24,7 +24,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,分类品牌接口") -@RequestMapping("/manager/category/brand") +@RequestMapping("/manager/goods/categoryBrand") public class CategoryBrandManagerController { /** diff --git a/manager-api/src/main/java/cn/lili/controller/goods/CategoryParameterGroupManagerController.java b/manager-api/src/main/java/cn/lili/controller/goods/CategoryParameterGroupManagerController.java index af99cdd5..db806e91 100644 --- a/manager-api/src/main/java/cn/lili/controller/goods/CategoryParameterGroupManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/goods/CategoryParameterGroupManagerController.java @@ -27,7 +27,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,分类绑定参数组接口") -@RequestMapping("/manager/goods/category/parameters") +@RequestMapping("/manager/goods/categoryParameters") public class CategoryParameterGroupManagerController { /** diff --git a/manager-api/src/main/java/cn/lili/controller/goods/CategorySpecificationManagerController.java b/manager-api/src/main/java/cn/lili/controller/goods/CategorySpecificationManagerController.java index bde97a6b..ab08d003 100644 --- a/manager-api/src/main/java/cn/lili/controller/goods/CategorySpecificationManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/goods/CategorySpecificationManagerController.java @@ -25,7 +25,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,商品分类规格接口") -@RequestMapping("/manager/goods/category/spec") +@RequestMapping("/manager/goods/categorySpec") public class CategorySpecificationManagerController { /** diff --git a/manager-api/src/main/java/cn/lili/controller/goods/GoodsManagerController.java b/manager-api/src/main/java/cn/lili/controller/goods/GoodsManagerController.java index 8004783c..a0791e42 100644 --- a/manager-api/src/main/java/cn/lili/controller/goods/GoodsManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/goods/GoodsManagerController.java @@ -32,7 +32,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,商品管理接口") -@RequestMapping("/manager/goods") +@RequestMapping("/manager/goods/goods") public class GoodsManagerController { /** * 商品 diff --git a/manager-api/src/main/java/cn/lili/controller/setting/HotWordsManagerController.java b/manager-api/src/main/java/cn/lili/controller/hotwords/HotWordsManagerController.java old mode 100755 new mode 100644 similarity index 94% rename from manager-api/src/main/java/cn/lili/controller/setting/HotWordsManagerController.java rename to manager-api/src/main/java/cn/lili/controller/hotwords/HotWordsManagerController.java index 80c97396..678c5f40 --- a/manager-api/src/main/java/cn/lili/controller/setting/HotWordsManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/hotwords/HotWordsManagerController.java @@ -1,4 +1,4 @@ -package cn.lili.controller.setting; +package cn.lili.controller.hotwords; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.ResultMessage; @@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,系统设置扩展接口") -@RequestMapping("/manager/hotwords") +@RequestMapping("/manager/hotwords/hotWords") public class HotWordsManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/member/IpInfoManagerController.java b/manager-api/src/main/java/cn/lili/controller/member/IpInfoManagerController.java index 77881b55..bf79872a 100644 --- a/manager-api/src/main/java/cn/lili/controller/member/IpInfoManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/member/IpInfoManagerController.java @@ -1,7 +1,7 @@ -package cn.lili.controller.member; +package cn.lili.controller.common; -import cn.lili.common.utils.IpHelper; import cn.lili.common.enums.ResultUtil; +import cn.lili.common.utils.IpHelper; import cn.lili.common.vo.ResultMessage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -19,8 +19,8 @@ import javax.servlet.http.HttpServletRequest; * @since 2020-02-25 14:10:16 */ @RestController -@Api(tags = "管理端,IP接口") -@RequestMapping("/manager/common/ip") +@Api(tags = "获取IP信息以及天气") +@RequestMapping("/common/common/ip") public class IpInfoManagerController { @Autowired private IpHelper ipHelper; @@ -28,7 +28,6 @@ public class IpInfoManagerController { @RequestMapping(value = "/info", method = RequestMethod.GET) @ApiOperation(value = "IP及天气相关信息") public ResultMessage upload(HttpServletRequest request) { - String result = ipHelper.getIpCity(request); return ResultUtil.data(result); } diff --git a/manager-api/src/main/java/cn/lili/controller/member/MemberEvaluationManagerController.java b/manager-api/src/main/java/cn/lili/controller/member/MemberEvaluationManagerController.java index e1d3d241..99dfdbaf 100644 --- a/manager-api/src/main/java/cn/lili/controller/member/MemberEvaluationManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/member/MemberEvaluationManagerController.java @@ -25,7 +25,7 @@ import javax.validation.constraints.NotNull; */ @RestController @Api(tags = "管理端,会员商品评价接口") -@RequestMapping("/manager/memberEvaluation") +@RequestMapping("/manager/member/evaluation") public class MemberEvaluationManagerController { @Autowired private MemberEvaluationService memberEvaluationService; diff --git a/manager-api/src/main/java/cn/lili/controller/member/MemberGradeManagerController.java b/manager-api/src/main/java/cn/lili/controller/member/MemberGradeManagerController.java index 907715b9..e2ca98ca 100644 --- a/manager-api/src/main/java/cn/lili/controller/member/MemberGradeManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/member/MemberGradeManagerController.java @@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.*; */ @RestController @Api(tags = "管理端,会员等级接口") -@RequestMapping("/manager/memberGrade") +@RequestMapping("/manager/member/memberGrade") public class MemberGradeManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/member/MemberMessageManagerController.java b/manager-api/src/main/java/cn/lili/controller/member/MemberMessageManagerController.java index 9ad3c74e..4f23d206 100644 --- a/manager-api/src/main/java/cn/lili/controller/member/MemberMessageManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/member/MemberMessageManagerController.java @@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Transactional(rollbackFor = Exception.class) -@Api(tags = "管理端,会员消息消息管理接口") +@Api(tags = "管理端,会员消息管理接口") @RequestMapping("/manager/message/member") public class MemberMessageManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/member/MemberNoticeLogManagerController.java b/manager-api/src/main/java/cn/lili/controller/member/MemberNoticeLogManagerController.java index 57f29a74..0b41722a 100644 --- a/manager-api/src/main/java/cn/lili/controller/member/MemberNoticeLogManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/member/MemberNoticeLogManagerController.java @@ -22,7 +22,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,会员消息接口") -@RequestMapping("/manager/memberNoticeLog") +@RequestMapping("/manager/message/memberNoticeLog") public class MemberNoticeLogManagerController { @Autowired private MemberNoticeLogService memberNoticeLogService; diff --git a/manager-api/src/main/java/cn/lili/controller/member/MemberNoticeSenterManagerController.java b/manager-api/src/main/java/cn/lili/controller/member/MemberNoticeSenterManagerController.java index 312852dd..72c9ccfe 100644 --- a/manager-api/src/main/java/cn/lili/controller/member/MemberNoticeSenterManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/member/MemberNoticeSenterManagerController.java @@ -23,7 +23,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,会员消息接口") -@RequestMapping("/manager/memberNoticeSenter") +@RequestMapping("/manager/message/memberNoticeSenter") public class MemberNoticeSenterManagerController { @Autowired private MemberNoticeSenterService memberNoticeSenterService; diff --git a/manager-api/src/main/java/cn/lili/controller/member/MemberWalletManagerController.java b/manager-api/src/main/java/cn/lili/controller/member/MemberWalletManagerController.java index 78a282ed..0265c2da 100644 --- a/manager-api/src/main/java/cn/lili/controller/member/MemberWalletManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/member/MemberWalletManagerController.java @@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,预存款接口") -@RequestMapping("/manager/members/wallet") +@RequestMapping("/manager/wallet/wallet") public class MemberWalletManagerController { @Autowired private MemberWalletService memberWalletService; diff --git a/manager-api/src/main/java/cn/lili/controller/member/MemberWithdrawApplyManagerController.java b/manager-api/src/main/java/cn/lili/controller/member/MemberWithdrawApplyManagerController.java index 3c21d1be..f17d9e5d 100644 --- a/manager-api/src/main/java/cn/lili/controller/member/MemberWithdrawApplyManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/member/MemberWithdrawApplyManagerController.java @@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,余额提现记录接口") -@RequestMapping("/manager/members/withdraw-apply") +@RequestMapping("/manager/wallet/withdrawApply") @Transactional(rollbackFor = Exception.class) public class MemberWithdrawApplyManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/setting/AppVersionManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/AppVersionManagerController.java old mode 100755 new mode 100644 similarity index 97% rename from manager-api/src/main/java/cn/lili/controller/setting/AppVersionManagerController.java rename to manager-api/src/main/java/cn/lili/controller/other/AppVersionManagerController.java index 0beb7cbc..49dea11c --- a/manager-api/src/main/java/cn/lili/controller/setting/AppVersionManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/AppVersionManagerController.java @@ -1,4 +1,4 @@ -package cn.lili.controller.setting; +package cn.lili.controller.other; import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; @@ -28,7 +28,7 @@ import javax.validation.Valid; */ @RestController @Api("管理端,app版本控制器") -@RequestMapping("/manager/systems/app/version") +@RequestMapping("/manager/other/appVersion") public class AppVersionManagerController { @Autowired private AppVersionService appVersionService; diff --git a/manager-api/src/main/java/cn/lili/controller/other/ArticleCategoryManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/ArticleCategoryManagerController.java index 323fa887..2fcb8264 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/ArticleCategoryManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/ArticleCategoryManagerController.java @@ -24,7 +24,7 @@ import java.util.List; @Slf4j @RestController @Api(tags = "管理端,文章分类管理接口") -@RequestMapping("/manager/article-category") +@RequestMapping("/manager/other/articleCategory") public class ArticleCategoryManagerController { /** diff --git a/manager-api/src/main/java/cn/lili/controller/other/ArticleManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/ArticleManagerController.java index ce0a0921..f9cf79ce 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/ArticleManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/ArticleManagerController.java @@ -25,7 +25,7 @@ import javax.validation.Valid; */ @RestController @Api(tags = "管理端,文章接口") -@RequestMapping("/manager/article") +@RequestMapping("/manager/other/article") public class ArticleManagerController { /** diff --git a/manager-api/src/main/java/cn/lili/controller/other/CustomWordsController.java b/manager-api/src/main/java/cn/lili/controller/other/CustomWordsController.java index c65ac807..fbd07e66 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/CustomWordsController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/CustomWordsController.java @@ -33,7 +33,7 @@ import java.nio.charset.StandardCharsets; @Slf4j @RestController @Api(tags = "管理端,自定义分词接口") -@RequestMapping("/manager/custom-words") +@RequestMapping("/manager/other/customWords") public class CustomWordsController { /** diff --git a/manager-api/src/main/java/cn/lili/controller/other/ElasticsearchController.java b/manager-api/src/main/java/cn/lili/controller/other/ElasticsearchController.java index 453d1efd..4451507c 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/ElasticsearchController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/ElasticsearchController.java @@ -21,7 +21,7 @@ import java.util.Map; */ @RestController @Api(tags = "ES初始化接口") -@RequestMapping("/manager/elasticsearch") +@RequestMapping("/manager/other/elasticsearch") public class ElasticsearchController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/other/FeedbackManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/FeedbackManagerController.java index 5e882def..77c5c011 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/FeedbackManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/FeedbackManagerController.java @@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,意见反馈接口") -@RequestMapping("/manager/feedback") +@RequestMapping("/manager/other/feedback") public class FeedbackManagerController { /** diff --git a/manager-api/src/main/java/cn/lili/controller/setting/LogisticsManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/LogisticsManagerController.java similarity index 96% rename from manager-api/src/main/java/cn/lili/controller/setting/LogisticsManagerController.java rename to manager-api/src/main/java/cn/lili/controller/other/LogisticsManagerController.java index 0ef03614..6ca05e0c 100644 --- a/manager-api/src/main/java/cn/lili/controller/setting/LogisticsManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/LogisticsManagerController.java @@ -1,4 +1,4 @@ -package cn.lili.controller.setting; +package cn.lili.controller.other; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.PageVO; @@ -24,7 +24,7 @@ import javax.validation.constraints.NotNull; */ @RestController @Api(tags = "管理端,物流公司接口") -@RequestMapping("/manager/logistics") +@RequestMapping("/manager/other/logistics") public class LogisticsManagerController { @Autowired private LogisticsService logisticsService; diff --git a/manager-api/src/main/java/cn/lili/controller/other/MessageManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/MessageManagerController.java index 261c736f..58905e79 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/MessageManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/MessageManagerController.java @@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*; */ @RestController @Api(tags = "管理端,消息发送管理接口") -@RequestMapping("/manager/message") +@RequestMapping("/manager/other/message") public class MessageManagerController { @Autowired private MessageService messageService; diff --git a/manager-api/src/main/java/cn/lili/controller/other/PageDataManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/PageDataManagerController.java index 0af0c47a..ae0b0233 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/PageDataManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/PageDataManagerController.java @@ -28,7 +28,7 @@ import javax.validation.constraints.NotNull; */ @RestController @Api(tags = "管理端,页面设置管理接口") -@RequestMapping("/manager/pageData") +@RequestMapping("/manager/other/pageData") public class PageDataManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/other/SensitiveWordsManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/SensitiveWordsManagerController.java index 5ca04bc2..457d3362 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/SensitiveWordsManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/SensitiveWordsManagerController.java @@ -25,7 +25,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,敏感词管理接口") -@RequestMapping("/manager/sensitiveWords") +@RequestMapping("/manager/other/sensitiveWords") public class SensitiveWordsManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/other/SpecialManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/SpecialManagerController.java index 6f6af7f3..af043eaa 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/SpecialManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/SpecialManagerController.java @@ -24,7 +24,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,专题活动接口") -@RequestMapping("/manager/special") +@RequestMapping("/manager/order/special") public class SpecialManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/other/VerificationSourceController.java b/manager-api/src/main/java/cn/lili/controller/other/VerificationSourceController.java index 15ea88f4..d650cfa1 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/VerificationSourceController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/VerificationSourceController.java @@ -26,7 +26,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,验证码资源维护接口") -@RequestMapping("/manager/verificationSource") +@RequestMapping("/manager/other/verificationSource") @Transactional(rollbackFor = Exception.class) public class VerificationSourceController { diff --git a/manager-api/src/main/java/cn/lili/controller/other/broadcast/CommodityManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/broadcast/CommodityManagerController.java index bd5b5c94..d166146e 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/broadcast/CommodityManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/broadcast/CommodityManagerController.java @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "店铺端,直播商品接口") -@RequestMapping("/manager/broadcast/commodity") +@RequestMapping("/manager/other/broadcast/commodity") public class CommodityManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/other/broadcast/StudioManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/broadcast/StudioManagerController.java index f663d433..64cf3bef 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/broadcast/StudioManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/broadcast/StudioManagerController.java @@ -26,8 +26,8 @@ import javax.validation.constraints.NotNull; * @since 2021/5/28 11:56 上午 */ @RestController -@Api(tags = "店铺端,直播间接口") -@RequestMapping("/manager/broadcast/studio") +@Api(tags = "管理端,直播间接口") +@RequestMapping("/manager/other/broadcast/studio") public class StudioManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/other/distribution/DistributionManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/distribution/DistributionManagerController.java index bbb98c1b..c31d07bc 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/distribution/DistributionManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/distribution/DistributionManagerController.java @@ -26,7 +26,7 @@ import javax.validation.constraints.NotNull; */ @RestController @Api(tags = "管理端,分销员管理接口") -@RequestMapping("/manager/distribution") +@RequestMapping("/manager/distribution/distribution") public class DistributionManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/other/purchase/PurchaseManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/purchase/PurchaseManagerController.java index 11185279..3b849d0d 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/purchase/PurchaseManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/purchase/PurchaseManagerController.java @@ -27,7 +27,7 @@ import java.util.List; */ @Api(tags = "管理端,采购接口") @RestController -@RequestMapping("/manager/purchase") +@RequestMapping("/manager/other/purchase/purchase") public class PurchaseManagerController { /** diff --git a/manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java b/manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java index 9bd1d547..e718a02e 100644 --- a/manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java @@ -45,7 +45,7 @@ import java.util.List; @Slf4j @RestController @Api(tags = "管理员") -@RequestMapping("/manager/user") +@RequestMapping("/manager/passport/user") @Transactional(rollbackFor = Exception.class) @Validated public class AdminUserManagerController { diff --git a/manager-api/src/main/java/cn/lili/controller/member/MemberManagerController.java b/manager-api/src/main/java/cn/lili/controller/passport/MemberManagerController.java similarity index 97% rename from manager-api/src/main/java/cn/lili/controller/member/MemberManagerController.java rename to manager-api/src/main/java/cn/lili/controller/passport/MemberManagerController.java index 6daf5c1d..c4f9714c 100644 --- a/manager-api/src/main/java/cn/lili/controller/member/MemberManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/passport/MemberManagerController.java @@ -1,4 +1,4 @@ -package cn.lili.controller.member; +package cn.lili.controller.passport; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.PageVO; @@ -29,7 +29,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,会员接口") -@RequestMapping("/manager/member") +@RequestMapping("/manager/passport/member") public class MemberManagerController { @Autowired private MemberService memberService; diff --git a/manager-api/src/main/java/cn/lili/controller/permission/DepartmentManagerController.java b/manager-api/src/main/java/cn/lili/controller/permission/DepartmentManagerController.java index 442a406f..724b6c97 100644 --- a/manager-api/src/main/java/cn/lili/controller/permission/DepartmentManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/permission/DepartmentManagerController.java @@ -23,7 +23,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,部门管理接口") -@RequestMapping("/manager/department") +@RequestMapping("/manager/permission/department") public class DepartmentManagerController { @Autowired private DepartmentService departmentService; diff --git a/manager-api/src/main/java/cn/lili/controller/permission/DepartmentRoleManagerController.java b/manager-api/src/main/java/cn/lili/controller/permission/DepartmentRoleManagerController.java index 20d8b068..8bf61daf 100644 --- a/manager-api/src/main/java/cn/lili/controller/permission/DepartmentRoleManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/permission/DepartmentRoleManagerController.java @@ -20,7 +20,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,部门角色接口") -@RequestMapping("/manager/departmentRole") +@RequestMapping("/manager/permission/departmentRole") public class DepartmentRoleManagerController { @Autowired private DepartmentRoleService departmentRoleService; diff --git a/manager-api/src/main/java/cn/lili/controller/permission/MenuManagerController.java b/manager-api/src/main/java/cn/lili/controller/permission/MenuManagerController.java index 5169eb44..33787d21 100644 --- a/manager-api/src/main/java/cn/lili/controller/permission/MenuManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/permission/MenuManagerController.java @@ -26,7 +26,7 @@ import java.util.List; @Slf4j @RestController @Api(tags = "管理端,菜单管理接口") -@RequestMapping("/manager/menu") +@RequestMapping("/manager/permission/menu") public class MenuManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/permission/RoleManagerController.java b/manager-api/src/main/java/cn/lili/controller/permission/RoleManagerController.java index 4e4abbe7..b6f3e9bf 100644 --- a/manager-api/src/main/java/cn/lili/controller/permission/RoleManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/permission/RoleManagerController.java @@ -23,7 +23,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,角色管理接口") -@RequestMapping("/manager/role") +@RequestMapping("/manager/permission/role") public class RoleManagerController { @Autowired private RoleService roleService; diff --git a/manager-api/src/main/java/cn/lili/controller/permission/RoleMenuManagerController.java b/manager-api/src/main/java/cn/lili/controller/permission/RoleMenuManagerController.java index 63b57355..b74f07ba 100644 --- a/manager-api/src/main/java/cn/lili/controller/permission/RoleMenuManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/permission/RoleMenuManagerController.java @@ -21,7 +21,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,角色菜单接口") -@RequestMapping("/manager/roleMenu") +@RequestMapping("/manager/permission/roleMenu") public class RoleMenuManagerController { @Autowired private RoleMenuService roleMenuService; diff --git a/manager-api/src/main/java/cn/lili/controller/permission/UserRoleManagerController.java b/manager-api/src/main/java/cn/lili/controller/permission/UserRoleManagerController.java index b04971cb..28197734 100644 --- a/manager-api/src/main/java/cn/lili/controller/permission/UserRoleManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/permission/UserRoleManagerController.java @@ -21,7 +21,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,管理员角色接口") -@RequestMapping("/manager/userRole") +@RequestMapping("/manager/permission/userRole") public class UserRoleManagerController { @Autowired private UserRoleService userRoleService; diff --git a/manager-api/src/main/java/cn/lili/controller/promotion/KanJiaActivityGoodsManagerController.java b/manager-api/src/main/java/cn/lili/controller/promotion/KanJiaActivityGoodsManagerController.java index 0b6f305f..c31cd919 100644 --- a/manager-api/src/main/java/cn/lili/controller/promotion/KanJiaActivityGoodsManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/promotion/KanJiaActivityGoodsManagerController.java @@ -27,7 +27,7 @@ import java.util.Arrays; **/ @RestController @Api(tags = "管理端,砍价促销接口") -@RequestMapping("/manager/promotion/kan-jia-goods") +@RequestMapping("/manager/promotion/kanJiaGoods") public class KanJiaActivityGoodsManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/promotion/PromotionManagerController.java b/manager-api/src/main/java/cn/lili/controller/promotion/PromotionManagerController.java index fea4cb30..72fea8ef 100644 --- a/manager-api/src/main/java/cn/lili/controller/promotion/PromotionManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/promotion/PromotionManagerController.java @@ -25,7 +25,7 @@ import java.util.Map; **/ @RestController @Api(tags = "管理端,促销接口") -@RequestMapping("/manager/promotion") +@RequestMapping("/manager/promotion/promotion") public class PromotionManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/setting/LogManagerController.java b/manager-api/src/main/java/cn/lili/controller/setting/LogManagerController.java index 6b61d0b9..ff7d3102 100644 --- a/manager-api/src/main/java/cn/lili/controller/setting/LogManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/setting/LogManagerController.java @@ -25,7 +25,7 @@ import java.util.List; @RestController @Transactional(rollbackFor = Exception.class) @Api(tags = "日志管理接口") -@RequestMapping("/manager/log") +@RequestMapping("/manager/setting/log") public class LogManagerController { @Autowired private SystemLogService systemLogService; diff --git a/manager-api/src/main/java/cn/lili/controller/setting/MemberNoticeManagerController.java b/manager-api/src/main/java/cn/lili/controller/setting/MemberNoticeManagerController.java index 54c7d520..11df7c8d 100644 --- a/manager-api/src/main/java/cn/lili/controller/setting/MemberNoticeManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/setting/MemberNoticeManagerController.java @@ -25,7 +25,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,会员站内信管理API") -@RequestMapping("/manager/member/notice") +@RequestMapping("/manager/message/memberNotice") public class MemberNoticeManagerController { @Autowired private MemberNoticeService memberNoticeService; diff --git a/manager-api/src/main/java/cn/lili/controller/setting/NoticeMessageManagerController.java b/manager-api/src/main/java/cn/lili/controller/setting/NoticeMessageManagerController.java index 33d50c50..4bbbf403 100644 --- a/manager-api/src/main/java/cn/lili/controller/setting/NoticeMessageManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/setting/NoticeMessageManagerController.java @@ -35,7 +35,7 @@ import java.util.List; @Slf4j @RestController @Api(tags = "管理端,会员站内信管理接口") -@RequestMapping("/manager/noticeMessage") +@RequestMapping("/manager/setting/noticeMessage") public class NoticeMessageManagerController { @Autowired private NoticeMessageService noticeMessageService; diff --git a/manager-api/src/main/java/cn/lili/controller/setting/RegionManagerController.java b/manager-api/src/main/java/cn/lili/controller/setting/RegionManagerController.java index 558b6e2c..223bf548 100644 --- a/manager-api/src/main/java/cn/lili/controller/setting/RegionManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/setting/RegionManagerController.java @@ -24,7 +24,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,行政地区管理接口") -@RequestMapping("/manager/region") +@RequestMapping("/manager/setting/region") @Transactional(rollbackFor = Exception.class) public class RegionManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/setting/ServiceNoticeManagerController.java b/manager-api/src/main/java/cn/lili/controller/setting/ServiceNoticeManagerController.java index 59e7aa15..c9205995 100644 --- a/manager-api/src/main/java/cn/lili/controller/setting/ServiceNoticeManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/setting/ServiceNoticeManagerController.java @@ -24,7 +24,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,服务订阅消息接口") -@RequestMapping("/manager/admin/notice") +@RequestMapping("/manager/message/serviceNotice") public class ServiceNoticeManagerController { @Autowired private ServiceNoticeService serviceNoticeService; diff --git a/manager-api/src/main/java/cn/lili/controller/setting/SettingManagerController.java b/manager-api/src/main/java/cn/lili/controller/setting/SettingManagerController.java index 5d3aa8e1..19146d11 100644 --- a/manager-api/src/main/java/cn/lili/controller/setting/SettingManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/setting/SettingManagerController.java @@ -32,7 +32,7 @@ import java.util.Collections; */ @RestController @Api(tags = "管理端,系统设置接口") -@RequestMapping("/manager/system/setting") +@RequestMapping("/manager/setting/setting") public class SettingManagerController { @Autowired private SettingService settingService; diff --git a/manager-api/src/main/java/cn/lili/controller/setting/SettingXManagerController.java b/manager-api/src/main/java/cn/lili/controller/setting/SettingXManagerController.java index a5caa8bb..ab5a1337 100644 --- a/manager-api/src/main/java/cn/lili/controller/setting/SettingXManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/setting/SettingXManagerController.java @@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,系统设置扩展接口") -@RequestMapping("/manager/system/settingx") +@RequestMapping("/manager/setting/settingx") public class SettingXManagerController { @ApiOperation(value = "支持支付方式表单") diff --git a/manager-api/src/main/java/cn/lili/controller/setting/SmsManagerController.java b/manager-api/src/main/java/cn/lili/controller/setting/SmsManagerController.java index e466affd..c07eef61 100644 --- a/manager-api/src/main/java/cn/lili/controller/setting/SmsManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/setting/SmsManagerController.java @@ -23,7 +23,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,短信接口") -@RequestMapping("/manager/sms") +@RequestMapping("/manager/sms/sms") public class SmsManagerController { @Autowired private SmsReachService smsReachService; diff --git a/manager-api/src/main/java/cn/lili/controller/setting/WechatMPMessageManagerController.java b/manager-api/src/main/java/cn/lili/controller/setting/WechatMPMessageManagerController.java index 366363ac..b26e3816 100644 --- a/manager-api/src/main/java/cn/lili/controller/setting/WechatMPMessageManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/setting/WechatMPMessageManagerController.java @@ -22,7 +22,7 @@ import java.util.List; */ @RestController @Api(tags = "微信小程序消息订阅接口") -@RequestMapping("/manager/message/wechatMPMessage") +@RequestMapping("/manager/wechat/wechatMPMessage") @Transactional(rollbackFor = Exception.class) public class WechatMPMessageManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/setting/WechatMessageManageController.java b/manager-api/src/main/java/cn/lili/controller/setting/WechatMessageManageController.java index f2f3634c..36a8d593 100644 --- a/manager-api/src/main/java/cn/lili/controller/setting/WechatMessageManageController.java +++ b/manager-api/src/main/java/cn/lili/controller/setting/WechatMessageManageController.java @@ -23,7 +23,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,微信消息接口") -@RequestMapping("/manager/message/wechat") +@RequestMapping("/manager/wechat/wechatMessage") public class WechatMessageManageController { @Autowired private WechatMessageService wechatMessageService; diff --git a/manager-api/src/main/java/cn/lili/controller/statistics/RefundOrderStatisticsManagerController.java b/manager-api/src/main/java/cn/lili/controller/statistics/RefundOrderStatisticsManagerController.java index 36dab0da..b5dadeb2 100644 --- a/manager-api/src/main/java/cn/lili/controller/statistics/RefundOrderStatisticsManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/statistics/RefundOrderStatisticsManagerController.java @@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController; */ @Api(tags = "管理端,退款统计接口") @RestController -@RequestMapping("/manager/statistics/refund/order") +@RequestMapping("/manager/statistics/refundOrder") public class RefundOrderStatisticsManagerController { @Autowired private RefundOrderStatisticsService refundOrderStatisticsService; diff --git a/manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java b/manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java index e73b4fd9..ac4321d5 100644 --- a/manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java @@ -33,7 +33,7 @@ import java.util.List; */ @Api(tags = "管理端,店铺管理接口") @RestController -@RequestMapping("/manager/store") +@RequestMapping("/manager/store/store") public class StoreManagerController { /** diff --git a/manager-api/src/main/java/cn/lili/controller/store/StoreMessageManagerController.java b/manager-api/src/main/java/cn/lili/controller/store/StoreMessageManagerController.java index 5bb23e45..f0d8586e 100644 --- a/manager-api/src/main/java/cn/lili/controller/store/StoreMessageManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/store/StoreMessageManagerController.java @@ -24,8 +24,8 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Transactional(rollbackFor = Exception.class) -@Api(tags = "管理端,店铺消息消息管理接口") -@RequestMapping("/manager/message/store") +@Api(tags = "管理端,店铺消息管理接口") +@RequestMapping("/manager/store/storeMessage") public class StoreMessageManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/trade/AfterSaleManagerController.java b/manager-api/src/main/java/cn/lili/controller/trade/AfterSaleManagerController.java index 7916995f..00fab268 100644 --- a/manager-api/src/main/java/cn/lili/controller/trade/AfterSaleManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/trade/AfterSaleManagerController.java @@ -26,7 +26,7 @@ import java.util.List; * @since 2021/1/6 14:11 */ @RestController -@RequestMapping("/manager/afterSale") +@RequestMapping("/manager/order/afterSale") @Api(tags = "管理端,售后接口") public class AfterSaleManagerController { diff --git a/manager-api/src/main/java/cn/lili/controller/trade/AfterSaleReasonManagerController.java b/manager-api/src/main/java/cn/lili/controller/trade/AfterSaleReasonManagerController.java index 6e416255..2f1e7c13 100644 --- a/manager-api/src/main/java/cn/lili/controller/trade/AfterSaleReasonManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/trade/AfterSaleReasonManagerController.java @@ -23,7 +23,7 @@ import javax.validation.Valid; * @since 2021/1/6 14:11 */ @RestController -@RequestMapping("/manager/afterSaleReason") +@RequestMapping("/manager/order/afterSaleReason") @Api(tags = "管理端,售后原因接口") public class AfterSaleReasonManagerController { diff --git a/manager-api/src/main/java/cn/lili/controller/trade/OrderComplaintManagerController.java b/manager-api/src/main/java/cn/lili/controller/trade/OrderComplaintManagerController.java index 68c7c69f..d8fc9cab 100644 --- a/manager-api/src/main/java/cn/lili/controller/trade/OrderComplaintManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/trade/OrderComplaintManagerController.java @@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.*; */ @RestController @Api(tags = "管理端,交易投诉接口") -@RequestMapping("/manager/complain") +@RequestMapping("/manager/order/complain") public class OrderComplaintManagerController { /** diff --git a/manager-api/src/main/java/cn/lili/controller/trade/OrderLogManagerController.java b/manager-api/src/main/java/cn/lili/controller/trade/OrderLogManagerController.java index 401461e2..c5bcd87f 100644 --- a/manager-api/src/main/java/cn/lili/controller/trade/OrderLogManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/trade/OrderLogManagerController.java @@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController @Transactional(rollbackFor = Exception.class) @Api(tags = "管理端,订单日志管理接口") -@RequestMapping("/manager/orderLog") +@RequestMapping("/manager/order/orderLog") public class OrderLogManagerController { @Autowired private OrderLogService orderLogService; diff --git a/manager-api/src/main/java/cn/lili/controller/trade/OrderManagerController.java b/manager-api/src/main/java/cn/lili/controller/trade/OrderManagerController.java index 27c7faa1..4d247f90 100644 --- a/manager-api/src/main/java/cn/lili/controller/trade/OrderManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/trade/OrderManagerController.java @@ -31,7 +31,7 @@ import java.util.List; * @since 2020/11/17 4:34 下午 */ @RestController -@RequestMapping("/manager/orders") +@RequestMapping("/manager/order/order") @Api(tags = "管理端,订单API") public class OrderManagerController { diff --git a/manager-api/src/main/java/cn/lili/controller/trade/PaymentLogManagerController.java b/manager-api/src/main/java/cn/lili/controller/trade/PaymentLogManagerController.java index 48a58eb4..aa61f83c 100644 --- a/manager-api/src/main/java/cn/lili/controller/trade/PaymentLogManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/trade/PaymentLogManagerController.java @@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,收款日志接口") -@RequestMapping("/manager/paymentLog") +@RequestMapping("/manager/order/paymentLog") @Transactional(rollbackFor = Exception.class) public class PaymentLogManagerController { diff --git a/manager-api/src/main/java/cn/lili/controller/trade/ReceiptManagerController.java b/manager-api/src/main/java/cn/lili/controller/trade/ReceiptManagerController.java index 984ad00c..f7429a34 100644 --- a/manager-api/src/main/java/cn/lili/controller/trade/ReceiptManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/trade/ReceiptManagerController.java @@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController; **/ @RestController @Api(tags = "管理端,发票记录接口") -@RequestMapping("/manager/receipt") +@RequestMapping("/manager/trade/receipt") public class ReceiptManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/trade/RechargeManagerController.java b/manager-api/src/main/java/cn/lili/controller/trade/RechargeManagerController.java index cac4e44e..152739d8 100644 --- a/manager-api/src/main/java/cn/lili/controller/trade/RechargeManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/trade/RechargeManagerController.java @@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,预存款充值记录接口") -@RequestMapping("/manager/recharge") +@RequestMapping("/manager/wallet/recharge") @Transactional(rollbackFor = Exception.class) public class RechargeManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/trade/RefundLogManagerController.java b/manager-api/src/main/java/cn/lili/controller/trade/RefundLogManagerController.java index 597e69d5..8ca6c8df 100644 --- a/manager-api/src/main/java/cn/lili/controller/trade/RefundLogManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/trade/RefundLogManagerController.java @@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,退款日志接口") -@RequestMapping("/manager/refundLog") +@RequestMapping("/manager/order/refundLog") @Transactional(rollbackFor = Exception.class) public class RefundLogManagerController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/goods/CategoryParameterGroupStoreController.java b/seller-api/src/main/java/cn/lili/controller/goods/CategoryParameterGroupStoreController.java index 273e7bab..2c377dbf 100644 --- a/seller-api/src/main/java/cn/lili/controller/goods/CategoryParameterGroupStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/goods/CategoryParameterGroupStoreController.java @@ -23,7 +23,7 @@ import java.util.List; */ @RestController @Api(tags = "店铺端,分类绑定参数组管理接口") -@RequestMapping("/store/goods/category/parameters") +@RequestMapping("/store/goods/categoryParameters") @Transactional(rollbackFor = Exception.class) public class CategoryParameterGroupStoreController { diff --git a/seller-api/src/main/java/cn/lili/controller/goods/CategorySpecificationStoreController.java b/seller-api/src/main/java/cn/lili/controller/goods/CategorySpecificationStoreController.java index 656efb43..63acdd85 100644 --- a/seller-api/src/main/java/cn/lili/controller/goods/CategorySpecificationStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/goods/CategorySpecificationStoreController.java @@ -22,7 +22,7 @@ import java.util.List; */ @RestController @Api(tags = "店铺端,商品分类规格接口") -@RequestMapping("/store/goods/category/spec") +@RequestMapping("/store/goods/categorySpec") @Transactional(rollbackFor = Exception.class) public class CategorySpecificationStoreController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/goods/DraftGoodsStoreController.java b/seller-api/src/main/java/cn/lili/controller/goods/DraftGoodsStoreController.java index 490526fd..556f6dac 100644 --- a/seller-api/src/main/java/cn/lili/controller/goods/DraftGoodsStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/goods/DraftGoodsStoreController.java @@ -27,7 +27,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,草稿商品接口") -@RequestMapping("/store/draft/goods") +@RequestMapping("/store/goods/draftGoods") public class DraftGoodsStoreController { @Autowired private DraftGoodsService draftGoodsService; diff --git a/seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java b/seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java index 5d9d8f35..4615dcba 100644 --- a/seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java @@ -39,7 +39,7 @@ import java.util.stream.Collectors; */ @RestController @Api(tags = "店铺端,商品接口") -@RequestMapping("/store/goods") +@RequestMapping("/store/goods/goods") public class GoodsStoreController { /** diff --git a/seller-api/src/main/java/cn/lili/controller/goods/GoodsUnitStoreController.java b/seller-api/src/main/java/cn/lili/controller/goods/GoodsUnitStoreController.java index 4a1ff764..9a247c67 100644 --- a/seller-api/src/main/java/cn/lili/controller/goods/GoodsUnitStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/goods/GoodsUnitStoreController.java @@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "店铺端,商品计量单位接口") -@RequestMapping("/store/goods/unit") +@RequestMapping("/store/goods/goodsUnit") @Transactional(rollbackFor = Exception.class) public class GoodsUnitStoreController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/member/StoreUserController.java b/seller-api/src/main/java/cn/lili/controller/member/StoreUserController.java index 8a6778f8..3c0c51b5 100644 --- a/seller-api/src/main/java/cn/lili/controller/member/StoreUserController.java +++ b/seller-api/src/main/java/cn/lili/controller/member/StoreUserController.java @@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "店铺端,管理员接口") -@RequestMapping("/store/user") +@RequestMapping("/store/member/user") public class StoreUserController { @Autowired private MemberService memberService; diff --git a/seller-api/src/main/java/cn/lili/controller/other/article/ArticleStoreController.java b/seller-api/src/main/java/cn/lili/controller/other/ArticleStoreController.java similarity index 95% rename from seller-api/src/main/java/cn/lili/controller/other/article/ArticleStoreController.java rename to seller-api/src/main/java/cn/lili/controller/other/ArticleStoreController.java index 73bd5b38..47375497 100644 --- a/seller-api/src/main/java/cn/lili/controller/other/article/ArticleStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/other/ArticleStoreController.java @@ -1,4 +1,4 @@ -package cn.lili.controller.other.article; +package cn.lili.controller.other; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.ResultMessage; @@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "店铺端,文章接口") -@RequestMapping("/store/article") +@RequestMapping("/store/other/article") public class ArticleStoreController { /** diff --git a/seller-api/src/main/java/cn/lili/controller/settings/LogisticsStoreController.java b/seller-api/src/main/java/cn/lili/controller/other/LogisticsStoreController.java similarity index 97% rename from seller-api/src/main/java/cn/lili/controller/settings/LogisticsStoreController.java rename to seller-api/src/main/java/cn/lili/controller/other/LogisticsStoreController.java index 188db0ce..04a5cf8c 100644 --- a/seller-api/src/main/java/cn/lili/controller/settings/LogisticsStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/other/LogisticsStoreController.java @@ -1,4 +1,4 @@ -package cn.lili.controller.settings; +package cn.lili.controller.other; import cn.lili.common.enums.ResultUtil; @@ -25,7 +25,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,物流公司接口") -@RequestMapping("/store/logistics") +@RequestMapping("/store/other/logistics") public class LogisticsStoreController { /** diff --git a/seller-api/src/main/java/cn/lili/controller/other/broadcast/CommodityStoreController.java b/seller-api/src/main/java/cn/lili/controller/other/broadcast/CommodityStoreController.java index 6a863e73..9fa92ae4 100644 --- a/seller-api/src/main/java/cn/lili/controller/other/broadcast/CommodityStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/other/broadcast/CommodityStoreController.java @@ -26,7 +26,7 @@ import java.util.List; */ @RestController @Api(tags = "店铺端,直播商品接口") -@RequestMapping("/store/broadcast/commodity") +@RequestMapping("/store/other/broadcast/commodity") public class CommodityStoreController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/other/broadcast/StudioStoreController.java b/seller-api/src/main/java/cn/lili/controller/other/broadcast/StudioStoreController.java index d64ab9b8..067c7fbd 100644 --- a/seller-api/src/main/java/cn/lili/controller/other/broadcast/StudioStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/other/broadcast/StudioStoreController.java @@ -29,7 +29,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,直播间接口") -@RequestMapping("/store/broadcast/studio") +@RequestMapping("/store/other/broadcast/studio") public class StudioStoreController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/other/distribution/DistributionGoodsStoreController.java b/seller-api/src/main/java/cn/lili/controller/other/distribution/DistributionGoodsStoreController.java index 2dfb6d5d..92e90709 100644 --- a/seller-api/src/main/java/cn/lili/controller/other/distribution/DistributionGoodsStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/other/distribution/DistributionGoodsStoreController.java @@ -29,7 +29,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,分销商品接口") -@RequestMapping("/store/distributionGoods") +@RequestMapping("/store/distribution/goods") public class DistributionGoodsStoreController { /** diff --git a/seller-api/src/main/java/cn/lili/controller/other/distribution/DistributionOrderStoreController.java b/seller-api/src/main/java/cn/lili/controller/other/distribution/DistributionOrderStoreController.java index ab18fba4..e3d97183 100644 --- a/seller-api/src/main/java/cn/lili/controller/other/distribution/DistributionOrderStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/other/distribution/DistributionOrderStoreController.java @@ -24,7 +24,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,分销订单接口") -@RequestMapping("/store/distributionOrder") +@RequestMapping("/store/distribution/order") public class DistributionOrderStoreController { /** diff --git a/seller-api/src/main/java/cn/lili/controller/passport/StorePassportController.java b/seller-api/src/main/java/cn/lili/controller/passport/StorePassportController.java index 531857da..4513b137 100644 --- a/seller-api/src/main/java/cn/lili/controller/passport/StorePassportController.java +++ b/seller-api/src/main/java/cn/lili/controller/passport/StorePassportController.java @@ -28,7 +28,7 @@ import javax.validation.constraints.NotNull; @RestController @Api(tags = "店铺端,商家登录接口 ") -@RequestMapping("/store/login") +@RequestMapping("/store/passport/login") public class StorePassportController { /** diff --git a/seller-api/src/main/java/cn/lili/controller/settings/FreightTemplateStoreController.java b/seller-api/src/main/java/cn/lili/controller/settings/FreightTemplateStoreController.java index 0d3c9c1e..0232f21f 100644 --- a/seller-api/src/main/java/cn/lili/controller/settings/FreightTemplateStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/settings/FreightTemplateStoreController.java @@ -24,7 +24,7 @@ import java.util.Objects; **/ @RestController @Api(tags = "店铺端,运费模板接口") -@RequestMapping("/store/freightTemplate") +@RequestMapping("/store/settings/freightTemplate") public class FreightTemplateStoreController { @Autowired private FreightTemplateService freightTemplateService; diff --git a/seller-api/src/main/java/cn/lili/controller/settings/LogStoreController.java b/seller-api/src/main/java/cn/lili/controller/settings/LogStoreController.java index e319db0a..6c17527c 100644 --- a/seller-api/src/main/java/cn/lili/controller/settings/LogStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/settings/LogStoreController.java @@ -27,7 +27,7 @@ import java.util.Objects; @RestController @Transactional(rollbackFor = Exception.class) @Api(tags = "店铺端,日志管理接口") -@RequestMapping("/store/log") +@RequestMapping("/store/settings/log") public class LogStoreController { @Autowired private SystemLogService systemLogService; diff --git a/seller-api/src/main/java/cn/lili/controller/settings/StoreAddressController.java b/seller-api/src/main/java/cn/lili/controller/settings/StoreAddressController.java index 48930caa..85d5d5d2 100644 --- a/seller-api/src/main/java/cn/lili/controller/settings/StoreAddressController.java +++ b/seller-api/src/main/java/cn/lili/controller/settings/StoreAddressController.java @@ -26,7 +26,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,商家地址(自提点)接口") -@RequestMapping("/store/storeAddress") +@RequestMapping("/store/settings/storeAddress") public class StoreAddressController { /** diff --git a/seller-api/src/main/java/cn/lili/controller/settings/StoreMessageController.java b/seller-api/src/main/java/cn/lili/controller/settings/StoreMessageController.java index 679b7636..5f2fffab 100644 --- a/seller-api/src/main/java/cn/lili/controller/settings/StoreMessageController.java +++ b/seller-api/src/main/java/cn/lili/controller/settings/StoreMessageController.java @@ -29,7 +29,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,消息接口") -@RequestMapping("/store/message") +@RequestMapping("/store/message/storeMessage") public class StoreMessageController { /** diff --git a/seller-api/src/main/java/cn/lili/controller/settings/StorePageDataController.java b/seller-api/src/main/java/cn/lili/controller/settings/StorePageDataController.java index bb269bef..2efc9655 100644 --- a/seller-api/src/main/java/cn/lili/controller/settings/StorePageDataController.java +++ b/seller-api/src/main/java/cn/lili/controller/settings/StorePageDataController.java @@ -31,7 +31,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,页面接口") -@RequestMapping("/store/pageData") +@RequestMapping("/store/settings/pageData") public class StorePageDataController { @Autowired private PageDataService pageDataService; diff --git a/seller-api/src/main/java/cn/lili/controller/settings/StoreSettingsController.java b/seller-api/src/main/java/cn/lili/controller/settings/StoreSettingsController.java index 9f3e1267..15f1fc07 100644 --- a/seller-api/src/main/java/cn/lili/controller/settings/StoreSettingsController.java +++ b/seller-api/src/main/java/cn/lili/controller/settings/StoreSettingsController.java @@ -27,7 +27,7 @@ import javax.validation.Valid; */ @RestController @Api(tags = "店铺端,店铺设置接口") -@RequestMapping("/store/settings") +@RequestMapping("/store/settings/storeSettings") public class StoreSettingsController { /** diff --git a/seller-api/src/main/java/cn/lili/controller/statistics/RefundOrderStatisticsStoreController.java b/seller-api/src/main/java/cn/lili/controller/statistics/RefundOrderStatisticsStoreController.java index 0619e9bd..6b13166e 100644 --- a/seller-api/src/main/java/cn/lili/controller/statistics/RefundOrderStatisticsStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/statistics/RefundOrderStatisticsStoreController.java @@ -25,7 +25,7 @@ import java.util.Objects; */ @Api(tags = "店铺端,退款统计接口") @RestController -@RequestMapping("/store/statistics/refund/order") +@RequestMapping("/store/statistics/refundOrder") public class RefundOrderStatisticsStoreController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/trade/AfterSaleStoreController.java b/seller-api/src/main/java/cn/lili/controller/trade/AfterSaleStoreController.java index ffff571f..8ab2c6df 100644 --- a/seller-api/src/main/java/cn/lili/controller/trade/AfterSaleStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/trade/AfterSaleStoreController.java @@ -30,7 +30,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,售后管理接口") -@RequestMapping("/store/afterSale") +@RequestMapping("/store/order/afterSale") public class AfterSaleStoreController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/trade/BillStoreController.java b/seller-api/src/main/java/cn/lili/controller/trade/BillStoreController.java index 7b6101f0..88add03f 100644 --- a/seller-api/src/main/java/cn/lili/controller/trade/BillStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/trade/BillStoreController.java @@ -30,7 +30,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,结算单接口") -@RequestMapping("/store/bill") +@RequestMapping("/store/member/bill") public class BillStoreController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/trade/MemberEvaluationStoreController.java b/seller-api/src/main/java/cn/lili/controller/trade/MemberEvaluationStoreController.java index 3c320774..db07c545 100644 --- a/seller-api/src/main/java/cn/lili/controller/trade/MemberEvaluationStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/trade/MemberEvaluationStoreController.java @@ -26,7 +26,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,商品评价管理接口") -@RequestMapping("/store/memberEvaluation") +@RequestMapping("/store/member/evaluation") public class MemberEvaluationStoreController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/trade/OrderComplaintStoreController.java b/seller-api/src/main/java/cn/lili/controller/trade/OrderComplaintStoreController.java index 2be516ae..b2ed9a92 100644 --- a/seller-api/src/main/java/cn/lili/controller/trade/OrderComplaintStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/trade/OrderComplaintStoreController.java @@ -29,7 +29,7 @@ import java.util.Objects; **/ @RestController @Api(tags = "店铺端,交易投诉接口") -@RequestMapping("/store/complain") +@RequestMapping("/store/order/complain") public class OrderComplaintStoreController { /** diff --git a/seller-api/src/main/java/cn/lili/controller/trade/OrderLogStoreController.java b/seller-api/src/main/java/cn/lili/controller/trade/OrderLogStoreController.java index eb10a898..a3e1aa41 100644 --- a/seller-api/src/main/java/cn/lili/controller/trade/OrderLogStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/trade/OrderLogStoreController.java @@ -25,7 +25,7 @@ import java.util.List; **/ @RestController @Api(tags = "店铺端,订单日志接口") -@RequestMapping("/store/orderLog") +@RequestMapping("/store/order/orderLog") public class OrderLogStoreController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/trade/OrderStoreController.java b/seller-api/src/main/java/cn/lili/controller/trade/OrderStoreController.java index fe6cfec6..5fd12d49 100644 --- a/seller-api/src/main/java/cn/lili/controller/trade/OrderStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/trade/OrderStoreController.java @@ -40,7 +40,7 @@ import java.util.Objects; **/ @Slf4j @RestController -@RequestMapping("/store/orders") +@RequestMapping("/store/order/order") @Api(tags = "店铺端,订单接口") public class OrderStoreController { diff --git a/seller-api/src/main/java/cn/lili/controller/trade/ReceiptStoreController.java b/seller-api/src/main/java/cn/lili/controller/trade/ReceiptStoreController.java index 25af43dc..59c51be6 100644 --- a/seller-api/src/main/java/cn/lili/controller/trade/ReceiptStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/trade/ReceiptStoreController.java @@ -27,7 +27,7 @@ import java.util.Objects; **/ @RestController @Api(tags = "店铺端,发票接口") -@RequestMapping("/store/receipt") +@RequestMapping("/store/trade/receipt") public class ReceiptStoreController { @Autowired From bda7a12c2aaf5a6f2986e4d2fc874cc0edbeca70 Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Mon, 20 Dec 2021 14:38:41 +0800 Subject: [PATCH 03/39] =?UTF-8?q?'=E5=95=86=E5=93=81es=E7=B4=A2=E5=BC=95?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=97=AE=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/search/serviceimpl/EsGoodsIndexServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java index 6143e19a..e52a272f 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java @@ -294,6 +294,9 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements @Override public void initIndex(List goodsIndexList) { if (goodsIndexList == null || goodsIndexList.isEmpty()) { + //初始化标识 + cache.put(CachePrefix.INIT_INDEX_PROCESS.getPrefix(), null); + cache.put(CachePrefix.INIT_INDEX_FLAG.getPrefix(), false); return; } //索引名称拼接 From 521a6174feb43453d7a35c6257b252e76398df8b Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Sat, 25 Dec 2021 15:38:02 +0800 Subject: [PATCH 04/39] =?UTF-8?q?'=E4=BF=AE=E6=94=B9=E8=B7=AF=E5=BE=84'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/controller/file/FileManagerController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager-api/src/main/java/cn/lili/controller/file/FileManagerController.java b/manager-api/src/main/java/cn/lili/controller/file/FileManagerController.java index 94142ad0..e481230d 100644 --- a/manager-api/src/main/java/cn/lili/controller/file/FileManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/file/FileManagerController.java @@ -25,7 +25,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,文件管理接口") -@RequestMapping("/manager/file/file") +@RequestMapping("/manager/common/file") public class FileManagerController { @Autowired From 60b4ab5c5bffc71d97a038d84f065afaefb0eb8a Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Tue, 11 Jan 2022 14:32:01 +0800 Subject: [PATCH 05/39] =?UTF-8?q?'=E8=B7=AF=E5=BE=84=E9=97=AE=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/controller/member/IpInfoManagerController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager-api/src/main/java/cn/lili/controller/member/IpInfoManagerController.java b/manager-api/src/main/java/cn/lili/controller/member/IpInfoManagerController.java index bf79872a..fe31af25 100644 --- a/manager-api/src/main/java/cn/lili/controller/member/IpInfoManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/member/IpInfoManagerController.java @@ -1,4 +1,4 @@ -package cn.lili.controller.common; +package cn.lili.controller.member; import cn.lili.common.enums.ResultUtil; import cn.lili.common.utils.IpHelper; From 6409d0dc2d9d2dadfcc224d9b42fef4ad969eadf Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Fri, 14 Jan 2022 11:47:56 +0800 Subject: [PATCH 06/39] =?UTF-8?q?'=E6=9B=B4=E6=96=B0'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/lili/controller/common/IpInfoManagerController.java | 2 +- .../java/cn/lili/controller/file/FileManagerController.java | 1 - .../lili/controller/goods/CategoryBrandManagerController.java | 3 --- .../{goods => hotwords}/HotWordsManagerController.java | 2 +- 4 files changed, 2 insertions(+), 6 deletions(-) rename manager-api/src/main/java/cn/lili/controller/{goods => hotwords}/HotWordsManagerController.java (97%) mode change 100755 => 100644 diff --git a/common-api/src/main/java/cn/lili/controller/common/IpInfoManagerController.java b/common-api/src/main/java/cn/lili/controller/common/IpInfoManagerController.java index f7da86a7..d8b872d0 100644 --- a/common-api/src/main/java/cn/lili/controller/common/IpInfoManagerController.java +++ b/common-api/src/main/java/cn/lili/controller/common/IpInfoManagerController.java @@ -1,4 +1,4 @@ -package cn.lili.controller.member; +package cn.lili.controller.common; import cn.lili.common.utils.IpHelper; import cn.lili.common.enums.ResultUtil; diff --git a/manager-api/src/main/java/cn/lili/controller/file/FileManagerController.java b/manager-api/src/main/java/cn/lili/controller/file/FileManagerController.java index e481230d..9667dc7d 100644 --- a/manager-api/src/main/java/cn/lili/controller/file/FileManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/file/FileManagerController.java @@ -1,6 +1,5 @@ package cn.lili.controller.file; -import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.PageVO; import cn.lili.common.vo.ResultMessage; diff --git a/manager-api/src/main/java/cn/lili/controller/goods/CategoryBrandManagerController.java b/manager-api/src/main/java/cn/lili/controller/goods/CategoryBrandManagerController.java index 364aff6f..05aaf8bc 100644 --- a/manager-api/src/main/java/cn/lili/controller/goods/CategoryBrandManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/goods/CategoryBrandManagerController.java @@ -1,12 +1,9 @@ package cn.lili.controller.goods; -import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.ResultMessage; -import cn.lili.modules.goods.entity.dos.CategoryBrand; import cn.lili.modules.goods.entity.vos.CategoryBrandVO; import cn.lili.modules.goods.service.CategoryBrandService; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; diff --git a/manager-api/src/main/java/cn/lili/controller/goods/HotWordsManagerController.java b/manager-api/src/main/java/cn/lili/controller/hotwords/HotWordsManagerController.java old mode 100755 new mode 100644 similarity index 97% rename from manager-api/src/main/java/cn/lili/controller/goods/HotWordsManagerController.java rename to manager-api/src/main/java/cn/lili/controller/hotwords/HotWordsManagerController.java index ee042cf9..93a37f07 --- a/manager-api/src/main/java/cn/lili/controller/goods/HotWordsManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/hotwords/HotWordsManagerController.java @@ -1,4 +1,4 @@ -package cn.lili.controller.goods; +package cn.lili.controller.hotwords; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.ResultMessage; From acb88a6b2a5ca56e0de457ab141053eab865f9c2 Mon Sep 17 00:00:00 2001 From: paulGao Date: Fri, 11 Feb 2022 14:54:56 +0800 Subject: [PATCH 07/39] =?UTF-8?q?=E4=BC=98=E5=8C=96redisson=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer-api/src/main/resources/redisson.yaml | 21 -------- common-api/src/main/resources/redisson.yaml | 21 -------- consumer/src/main/resources/redisson.yaml | 21 -------- .../lili/cache/config/redis/RedisConfig.java | 50 +++++++++++++++++-- manager-api/src/main/resources/redisson.yaml | 21 -------- seller-api/src/main/resources/redisson.yaml | 21 -------- 6 files changed, 45 insertions(+), 110 deletions(-) delete mode 100644 buyer-api/src/main/resources/redisson.yaml delete mode 100644 common-api/src/main/resources/redisson.yaml delete mode 100644 consumer/src/main/resources/redisson.yaml delete mode 100644 manager-api/src/main/resources/redisson.yaml delete mode 100644 seller-api/src/main/resources/redisson.yaml diff --git a/buyer-api/src/main/resources/redisson.yaml b/buyer-api/src/main/resources/redisson.yaml deleted file mode 100644 index ac8dfc66..00000000 --- a/buyer-api/src/main/resources/redisson.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -singleServerConfig: - idleConnectionTimeout: 10000 - connectTimeout: 10000 - timeout: 3000 - retryAttempts: 3 - retryInterval: 1500 - password: lilishop - subscriptionsPerConnection: 5 - clientName: null - address: "redis://127.0.0.1:6379" - subscriptionConnectionMinimumIdleSize: 1 - subscriptionConnectionPoolSize: 50 - connectionMinimumIdleSize: 24 - connectionPoolSize: 64 - database: 0 - dnsMonitoringInterval: 5000 -threads: 16 -nettyThreads: 32 -codec: ! {} -transportMode: "NIO" \ No newline at end of file diff --git a/common-api/src/main/resources/redisson.yaml b/common-api/src/main/resources/redisson.yaml deleted file mode 100644 index ac8dfc66..00000000 --- a/common-api/src/main/resources/redisson.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -singleServerConfig: - idleConnectionTimeout: 10000 - connectTimeout: 10000 - timeout: 3000 - retryAttempts: 3 - retryInterval: 1500 - password: lilishop - subscriptionsPerConnection: 5 - clientName: null - address: "redis://127.0.0.1:6379" - subscriptionConnectionMinimumIdleSize: 1 - subscriptionConnectionPoolSize: 50 - connectionMinimumIdleSize: 24 - connectionPoolSize: 64 - database: 0 - dnsMonitoringInterval: 5000 -threads: 16 -nettyThreads: 32 -codec: ! {} -transportMode: "NIO" \ No newline at end of file diff --git a/consumer/src/main/resources/redisson.yaml b/consumer/src/main/resources/redisson.yaml deleted file mode 100644 index ac8dfc66..00000000 --- a/consumer/src/main/resources/redisson.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -singleServerConfig: - idleConnectionTimeout: 10000 - connectTimeout: 10000 - timeout: 3000 - retryAttempts: 3 - retryInterval: 1500 - password: lilishop - subscriptionsPerConnection: 5 - clientName: null - address: "redis://127.0.0.1:6379" - subscriptionConnectionMinimumIdleSize: 1 - subscriptionConnectionPoolSize: 50 - connectionMinimumIdleSize: 24 - connectionPoolSize: 64 - database: 0 - dnsMonitoringInterval: 5000 -threads: 16 -nettyThreads: 32 -codec: ! {} -transportMode: "NIO" \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/cache/config/redis/RedisConfig.java b/framework/src/main/java/cn/lili/cache/config/redis/RedisConfig.java index dbb8ad39..659c1ece 100644 --- a/framework/src/main/java/cn/lili/cache/config/redis/RedisConfig.java +++ b/framework/src/main/java/cn/lili/cache/config/redis/RedisConfig.java @@ -1,12 +1,17 @@ package cn.lili.cache.config.redis; +import cn.hutool.core.text.CharSequenceUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.parser.ParserConfig; import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.digest.DigestUtils; import org.redisson.Redisson; import org.redisson.api.RedissonClient; +import org.redisson.config.ClusterServersConfig; import org.redisson.config.Config; +import org.redisson.config.SentinelServersConfig; +import org.redisson.config.SingleServerConfig; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -20,7 +25,6 @@ import org.springframework.cache.interceptor.KeyGenerator; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; -import org.springframework.core.io.ClassPathResource; import org.springframework.data.redis.cache.RedisCacheConfiguration; import org.springframework.data.redis.cache.RedisCacheManager; import org.springframework.data.redis.cache.RedisCacheWriter; @@ -31,9 +35,10 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.RedisSerializationContext; import org.springframework.data.redis.serializer.StringRedisSerializer; -import java.io.IOException; import java.time.Duration; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -54,6 +59,9 @@ public class RedisConfig extends CachingConfigurerSupport { @Value("${lili.cache.timeout:7200}") private Integer timeout; + @Autowired + private RedisProperties redisProperties; + /** * 当有多个管理器的时候,必须使用该注解在一个管理器上注释:表示该管理器为默认的管理器 @@ -105,9 +113,41 @@ public class RedisConfig extends CachingConfigurerSupport { } @Bean(destroyMethod = "shutdown") - public RedissonClient redisson() throws IOException { - return Redisson.create( - Config.fromYAML(new ClassPathResource("redisson.yaml").getInputStream())); + public RedissonClient redisson() { + Config config = new Config(); + + if (redisProperties.getSentinel() != null && !redisProperties.getSentinel().getNodes().isEmpty()) { + // 哨兵模式 + SentinelServersConfig sentinelServersConfig = config.useSentinelServers(); + sentinelServersConfig.setMasterName(redisProperties.getSentinel().getMaster()); + List sentinelAddress = new ArrayList<>(); + for (String node : redisProperties.getCluster().getNodes()) { + sentinelAddress.add("redis://" + node); + } + sentinelServersConfig.setSentinelAddresses(sentinelAddress); + if (CharSequenceUtil.isNotEmpty(redisProperties.getSentinel().getPassword())) { + sentinelServersConfig.setSentinelPassword(redisProperties.getSentinel().getPassword()); + } + } else if (redisProperties.getCluster() != null && !redisProperties.getCluster().getNodes().isEmpty()) { + // 集群模式 + ClusterServersConfig clusterServersConfig = config.useClusterServers(); + List clusterNodes = new ArrayList<>(); + for (String node : redisProperties.getCluster().getNodes()) { + clusterNodes.add("redis://" + node); + } + clusterServersConfig.setNodeAddresses(clusterNodes); + if (CharSequenceUtil.isNotEmpty(redisProperties.getPassword())) { + clusterServersConfig.setPassword(redisProperties.getPassword()); + } + } else { + SingleServerConfig singleServerConfig = config.useSingleServer(); + singleServerConfig.setAddress("redis://" + redisProperties.getHost() + ":" + redisProperties.getPort()); + if (CharSequenceUtil.isNotEmpty(redisProperties.getPassword())) { + singleServerConfig.setPassword(redisProperties.getPassword()); + } + } + + return Redisson.create(config); } /** diff --git a/manager-api/src/main/resources/redisson.yaml b/manager-api/src/main/resources/redisson.yaml deleted file mode 100644 index ac8dfc66..00000000 --- a/manager-api/src/main/resources/redisson.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -singleServerConfig: - idleConnectionTimeout: 10000 - connectTimeout: 10000 - timeout: 3000 - retryAttempts: 3 - retryInterval: 1500 - password: lilishop - subscriptionsPerConnection: 5 - clientName: null - address: "redis://127.0.0.1:6379" - subscriptionConnectionMinimumIdleSize: 1 - subscriptionConnectionPoolSize: 50 - connectionMinimumIdleSize: 24 - connectionPoolSize: 64 - database: 0 - dnsMonitoringInterval: 5000 -threads: 16 -nettyThreads: 32 -codec: ! {} -transportMode: "NIO" \ No newline at end of file diff --git a/seller-api/src/main/resources/redisson.yaml b/seller-api/src/main/resources/redisson.yaml deleted file mode 100644 index ac8dfc66..00000000 --- a/seller-api/src/main/resources/redisson.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -singleServerConfig: - idleConnectionTimeout: 10000 - connectTimeout: 10000 - timeout: 3000 - retryAttempts: 3 - retryInterval: 1500 - password: lilishop - subscriptionsPerConnection: 5 - clientName: null - address: "redis://127.0.0.1:6379" - subscriptionConnectionMinimumIdleSize: 1 - subscriptionConnectionPoolSize: 50 - connectionMinimumIdleSize: 24 - connectionPoolSize: 64 - database: 0 - dnsMonitoringInterval: 5000 -threads: 16 -nettyThreads: 32 -codec: ! {} -transportMode: "NIO" \ No newline at end of file From da6a17cd614ffaf3603b58bd9f72042f769008d1 Mon Sep 17 00:00:00 2001 From: paulGao Date: Fri, 11 Feb 2022 14:56:25 +0800 Subject: [PATCH 08/39] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../limit/interceptor/LimitInterceptor.java | 3 +-- .../annotation/PreventDuplicateSubmissions.java | 1 - .../common/aop/interceptor/DemoInterceptor.java | 2 +- .../cn/lili/common/utils/SnowflakeInitiator.java | 6 +----- .../serviceimpl/MemberEvaluationServiceImpl.java | 3 ++- .../serviceimpl/MemberSignServiceImpl.java | 16 ++++++---------- .../serviceimpl/MemberCouponServiceImpl.java | 5 +++++ .../system/entity/dto/PointSettingItem.java | 6 ++++-- 8 files changed, 20 insertions(+), 22 deletions(-) diff --git a/framework/src/main/java/cn/lili/cache/limit/interceptor/LimitInterceptor.java b/framework/src/main/java/cn/lili/cache/limit/interceptor/LimitInterceptor.java index d3c01b1f..402f165d 100644 --- a/framework/src/main/java/cn/lili/cache/limit/interceptor/LimitInterceptor.java +++ b/framework/src/main/java/cn/lili/cache/limit/interceptor/LimitInterceptor.java @@ -1,7 +1,7 @@ package cn.lili.cache.limit.interceptor; -import cn.lili.cache.limit.enums.LimitTypeEnums; import cn.lili.cache.limit.annotation.LimitPoint; +import cn.lili.cache.limit.enums.LimitTypeEnums; import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; import cn.lili.common.utils.IpUtils; @@ -17,7 +17,6 @@ import org.springframework.data.redis.core.script.DefaultRedisScript; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; -import javax.servlet.http.HttpServletRequest; import java.io.Serializable; /** diff --git a/framework/src/main/java/cn/lili/common/aop/annotation/PreventDuplicateSubmissions.java b/framework/src/main/java/cn/lili/common/aop/annotation/PreventDuplicateSubmissions.java index 910906b4..ba884dfe 100644 --- a/framework/src/main/java/cn/lili/common/aop/annotation/PreventDuplicateSubmissions.java +++ b/framework/src/main/java/cn/lili/common/aop/annotation/PreventDuplicateSubmissions.java @@ -1,7 +1,6 @@ package cn.lili.common.aop.annotation; import java.lang.annotation.*; -import java.util.concurrent.TimeUnit; /** * 防止重复提交注解 diff --git a/framework/src/main/java/cn/lili/common/aop/interceptor/DemoInterceptor.java b/framework/src/main/java/cn/lili/common/aop/interceptor/DemoInterceptor.java index d021b474..ed5a365a 100644 --- a/framework/src/main/java/cn/lili/common/aop/interceptor/DemoInterceptor.java +++ b/framework/src/main/java/cn/lili/common/aop/interceptor/DemoInterceptor.java @@ -26,7 +26,7 @@ public class DemoInterceptor { @Before("@annotation(demoSite)") public void doAfter(DemoSite demoSite) { - if (systemSettingProperties.getIsDemoSite()) { + if (Boolean.TRUE.equals(systemSettingProperties.getIsDemoSite())) { throw new ServiceException(ResultCode.DEMO_SITE_EXCEPTION); } } diff --git a/framework/src/main/java/cn/lili/common/utils/SnowflakeInitiator.java b/framework/src/main/java/cn/lili/common/utils/SnowflakeInitiator.java index 4a36af5c..8ffbba1f 100644 --- a/framework/src/main/java/cn/lili/common/utils/SnowflakeInitiator.java +++ b/framework/src/main/java/cn/lili/common/utils/SnowflakeInitiator.java @@ -1,15 +1,11 @@ package cn.lili.common.utils; import cn.lili.cache.Cache; -import com.alibaba.fastjson.JSON; -import lombok.AllArgsConstructor; -import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; -import java.util.concurrent.TimeUnit; /** * SnowflakeInitiator @@ -25,7 +21,7 @@ public class SnowflakeInitiator { /** * 缓存前缀 */ - private static String KEY = "{Snowflake}"; + private static final String KEY = "{Snowflake}"; @Autowired private Cache cache; diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java index bce3490f..868a9abd 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java @@ -106,13 +106,14 @@ public class MemberEvaluationServiceImpl extends ServiceImpl 0) { + if (!signs.isEmpty()) { //截止目前为止 签到总天数 不带今天 Integer signDay = signs.get(0).getSignDay(); memberSign.setSignDay(CurrencyUtil.add(signDay, 1).intValue()); diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/MemberCouponServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/MemberCouponServiceImpl.java index 2514e68f..d46f606f 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/MemberCouponServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/MemberCouponServiceImpl.java @@ -82,6 +82,7 @@ public class MemberCouponServiceImpl extends ServiceImpl ids) { if (ids != null && !ids.isEmpty()) { List memberCoupons = this.listByIds(ids); @@ -247,6 +250,7 @@ public class MemberCouponServiceImpl extends ServiceImpl updateWrapper = new LambdaUpdateWrapper<>(); updateWrapper.eq(MemberCoupon::getId, id); @@ -260,6 +264,7 @@ public class MemberCouponServiceImpl extends ServiceImpl couponIds) { LambdaUpdateWrapper memberCouponLambdaUpdateWrapper = new LambdaUpdateWrapper() .in(MemberCoupon::getCouponId, couponIds) diff --git a/framework/src/main/java/cn/lili/modules/system/entity/dto/PointSettingItem.java b/framework/src/main/java/cn/lili/modules/system/entity/dto/PointSettingItem.java index 11d061d8..885b4b19 100644 --- a/framework/src/main/java/cn/lili/modules/system/entity/dto/PointSettingItem.java +++ b/framework/src/main/java/cn/lili/modules/system/entity/dto/PointSettingItem.java @@ -3,6 +3,8 @@ package cn.lili.modules.system.entity.dto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.io.Serializable; + /** * 积分签到设置 * @@ -10,7 +12,7 @@ import lombok.Data; * @since 2021-02-26 11:48 */ @Data -public class PointSettingItem implements Comparable { +public class PointSettingItem implements Comparable, Serializable { @ApiModelProperty(value = "签到天数") @@ -21,7 +23,7 @@ public class PointSettingItem implements Comparable { private Integer point; public Integer getPoint() { - if (point != null || point < 0) { + if (point == null || point < 0) { return 0; } return point; From 1f1b534b13a4508b37bdfbb722ad9f61f239e695 Mon Sep 17 00:00:00 2001 From: paulGao Date: Sat, 12 Feb 2022 15:05:42 +0800 Subject: [PATCH 09/39] =?UTF-8?q?=E9=80=82=E9=85=8D=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=9A=84api=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../other/broadcast/StudioController.java | 2 +- .../passport/MemberBuyerController.java | 2 +- buyer-api/src/main/resources/application.yml | 20 ++++++++--------- common-api/src/main/resources/application.yml | 22 +++---------------- consumer/src/main/resources/application.yml | 2 +- .../serviceimpl/GoodsSkuServiceImpl.java | 2 ++ .../hotwords/HotWordsManagerController.java | 2 +- .../MemberMessageManagerController.java | 2 +- .../broadcast/CommodityManagerController.java | 2 +- .../broadcast/StudioManagerController.java | 2 +- .../passport/AdminUserManagerController.java | 2 -- .../store/BillManagerController.java | 2 +- .../store/StoreMessageManagerController.java | 2 +- .../src/main/resources/application.yml | 8 +++---- ...CategoryParameterGroupStoreController.java | 2 +- .../CategorySpecificationStoreController.java | 2 +- .../goods/GoodsUnitStoreController.java | 2 +- .../member/BillStoreController.java | 2 +- .../broadcast/CommodityStoreController.java | 2 +- .../broadcast/StudioStoreController.java | 2 +- .../FreightTemplateStoreController.java | 2 +- .../settings/StoreAddressController.java | 2 +- seller-api/src/main/resources/application.yml | 2 +- 23 files changed, 37 insertions(+), 53 deletions(-) diff --git a/buyer-api/src/main/java/cn/lili/controller/other/broadcast/StudioController.java b/buyer-api/src/main/java/cn/lili/controller/other/broadcast/StudioController.java index 23bdc760..d161e5c1 100644 --- a/buyer-api/src/main/java/cn/lili/controller/other/broadcast/StudioController.java +++ b/buyer-api/src/main/java/cn/lili/controller/other/broadcast/StudioController.java @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "买家端,直播间接口") -@RequestMapping("/buyer/other/broadcast/studio") +@RequestMapping("/buyer/broadcast/studio") public class StudioController { @Autowired diff --git a/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java index e8e438bc..d3b9929e 100644 --- a/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java @@ -28,7 +28,7 @@ import javax.validation.constraints.NotNull; */ @RestController @Api(tags = "买家端,会员接口") -@RequestMapping("/buyer/passport/members") +@RequestMapping("/buyer/passport/member") public class MemberBuyerController { @Autowired diff --git a/buyer-api/src/main/resources/application.yml b/buyer-api/src/main/resources/application.yml index 2f99a882..bf86659d 100644 --- a/buyer-api/src/main/resources/application.yml +++ b/buyer-api/src/main/resources/application.yml @@ -128,21 +128,21 @@ ignored: - /MP_verify_qSyvBPhDsPdxvOhC.txt - /weixin/** - /source/** - - /buyer/mini-program/** - - /buyer/cashier/** - - /buyer/pageData/** - - /buyer/article/** + - /buyer/payment/cashier/** + - /buyer/other/pageData/** + - /buyer/other/article/** - /buyer/goods/** - - /buyer/category/** - /buyer/store/** - - /buyer/connect/** + - /buyer/passport/connect/** - /buyer/members/** + - /buyer/passport/member/** - /buyer/promotion/pintuan/** - /buyer/promotion/seckill/** - /buyer/promotion/pointsGoods/** - - /buyer/memberEvaluation/**/goodsEvaluation - - /buyer/memberEvaluation/**/evaluationNumber - - /buyer/appVersion/** + - /buyer/promotion/coupon + - /buyer/member/evaluation/**/goodsEvaluation + - /buyer/member/evaluation/**/evaluationNumber + - /buyer/other/appVersion/** - /buyer/broadcast/studio/** - /druid/** - /swagger-ui.html @@ -183,7 +183,7 @@ logging: config: classpath:logback-spring.xml # 输出级别 level: - root: error + root: info # org.springframework: debug file: # 指定路径 diff --git a/common-api/src/main/resources/application.yml b/common-api/src/main/resources/application.yml index 03760caf..a914b499 100644 --- a/common-api/src/main/resources/application.yml +++ b/common-api/src/main/resources/application.yml @@ -119,24 +119,8 @@ ignored: - /MP_verify_qSyvBPhDsPdxvOhC.txt - /weixin/** - /source/** - - /buyer/mini-program/** - - /buyer/cashier/** - - /buyer/pageData/** - - /buyer/article/** - - /buyer/goods/** - - /buyer/category/** - - /buyer/shop/** - - /buyer/connect/** - - /buyer/members/smsLogin - - /buyer/members/refresh/* - - /buyer/members/refresh** - - /buyer/promotion/pintuan - - /buyer/promotion/seckill - - /buyer/memberEvaluation/**/goodsEvaluation - - /buyer/memberEvaluation/**/evaluationNumber - - /store/login/** - - /manager/user/login - - /manager/user/refresh/** + - /common/common/slider/** + - /common/common/sms/** - /druid/** - /swagger-ui.html - /doc.html @@ -176,7 +160,7 @@ logging: config: classpath:logback-spring.xml # 输出级别 level: - root: error + root: info # org.hibernate: debug # org.springframework: debug file: diff --git a/consumer/src/main/resources/application.yml b/consumer/src/main/resources/application.yml index a1125b89..8304cf32 100644 --- a/consumer/src/main/resources/application.yml +++ b/consumer/src/main/resources/application.yml @@ -179,7 +179,7 @@ logging: config: classpath:logback-spring.xml # 输出级别 level: - root: error + root: info # org.hibernate: debug # org.springframework: debug file: diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java index 40cc4192..1182df09 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java @@ -113,6 +113,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl i private ApplicationEventPublisher applicationEventPublisher; @Override + @Transactional(rollbackFor = Exception.class) public void add(List> skuList, Goods goods) { // 检查是否需要生成索引 List newSkuList; @@ -319,6 +320,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl i * @param goods 商品信息(Id,MarketEnable/AuthFlag) */ @Override + @Transactional(rollbackFor = Exception.class) public void updateGoodsSkuStatus(Goods goods) { LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); updateWrapper.eq(GoodsSku::getGoodsId, goods.getId()); diff --git a/manager-api/src/main/java/cn/lili/controller/hotwords/HotWordsManagerController.java b/manager-api/src/main/java/cn/lili/controller/hotwords/HotWordsManagerController.java index 93a37f07..ce4eb8d3 100644 --- a/manager-api/src/main/java/cn/lili/controller/hotwords/HotWordsManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/hotwords/HotWordsManagerController.java @@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*; */ @RestController @Api(tags = "管理端,系统设置扩展接口") -@RequestMapping("/manager/hotwords") +@RequestMapping("/manager/hotwords/hotwords") public class HotWordsManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/message/MemberMessageManagerController.java b/manager-api/src/main/java/cn/lili/controller/message/MemberMessageManagerController.java index c028e1f4..38a90456 100644 --- a/manager-api/src/main/java/cn/lili/controller/message/MemberMessageManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/message/MemberMessageManagerController.java @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,会员消息消息管理接口") -@RequestMapping("/manager/message/member") +@RequestMapping("/manager/other/memberMessage") public class MemberMessageManagerController { @Autowired private MemberMessageService memberMessageService; diff --git a/manager-api/src/main/java/cn/lili/controller/other/broadcast/CommodityManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/broadcast/CommodityManagerController.java index d166146e..bd5b5c94 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/broadcast/CommodityManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/broadcast/CommodityManagerController.java @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "店铺端,直播商品接口") -@RequestMapping("/manager/other/broadcast/commodity") +@RequestMapping("/manager/broadcast/commodity") public class CommodityManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/other/broadcast/StudioManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/broadcast/StudioManagerController.java index 64cf3bef..fb514b84 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/broadcast/StudioManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/broadcast/StudioManagerController.java @@ -27,7 +27,7 @@ import javax.validation.constraints.NotNull; */ @RestController @Api(tags = "管理端,直播间接口") -@RequestMapping("/manager/other/broadcast/studio") +@RequestMapping("/manager/broadcast/studio") public class StudioManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java b/manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java index f8f6a20b..1be65f27 100644 --- a/manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java @@ -27,7 +27,6 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -46,7 +45,6 @@ import java.util.List; @RestController @Api(tags = "管理员") @RequestMapping("/manager/passport/user") -@Transactional(rollbackFor = Exception.class) @Validated public class AdminUserManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/store/BillManagerController.java b/manager-api/src/main/java/cn/lili/controller/store/BillManagerController.java index 128cbe18..4fbe985a 100644 --- a/manager-api/src/main/java/cn/lili/controller/store/BillManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/store/BillManagerController.java @@ -27,7 +27,7 @@ import javax.validation.constraints.NotNull; */ @RestController @Api(tags = "管理端,商家结算单接口") -@RequestMapping("/manager/store/bill") +@RequestMapping("/manager/order/bill") public class BillManagerController { @Autowired private BillService billService; diff --git a/manager-api/src/main/java/cn/lili/controller/store/StoreMessageManagerController.java b/manager-api/src/main/java/cn/lili/controller/store/StoreMessageManagerController.java index 94cf8679..c1241e7e 100644 --- a/manager-api/src/main/java/cn/lili/controller/store/StoreMessageManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/store/StoreMessageManagerController.java @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,店铺消息消息管理接口") -@RequestMapping("/manager/message/store") +@RequestMapping("/manager/other/storeMessage") public class StoreMessageManagerController { @Autowired diff --git a/manager-api/src/main/resources/application.yml b/manager-api/src/main/resources/application.yml index e0d1fafa..d7a1c56a 100644 --- a/manager-api/src/main/resources/application.yml +++ b/manager-api/src/main/resources/application.yml @@ -119,10 +119,10 @@ ignored: - /MP_verify_qSyvBPhDsPdxvOhC.txt - /weixin/** - /source/** - - /manager/user/login - - /manager/user/refresh/** - - /manager/elasticsearch - - /manager/custom-words + - /manager/passport/user/login + - /manager/passport/user/refresh/** + - /manager/other/elasticsearch + - /manager/other/customWords - /druid/** - /swagger-ui.html - /doc.html diff --git a/seller-api/src/main/java/cn/lili/controller/goods/CategoryParameterGroupStoreController.java b/seller-api/src/main/java/cn/lili/controller/goods/CategoryParameterGroupStoreController.java index 3113ceb3..261a0037 100644 --- a/seller-api/src/main/java/cn/lili/controller/goods/CategoryParameterGroupStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/goods/CategoryParameterGroupStoreController.java @@ -21,7 +21,7 @@ import java.util.List; */ @RestController @Api(tags = "店铺端,分类绑定参数组管理接口") -@RequestMapping("/store/goods/category/parameters") +@RequestMapping("/store/goods/categoryParameters") public class CategoryParameterGroupStoreController { diff --git a/seller-api/src/main/java/cn/lili/controller/goods/CategorySpecificationStoreController.java b/seller-api/src/main/java/cn/lili/controller/goods/CategorySpecificationStoreController.java index b5f19535..e8c52780 100644 --- a/seller-api/src/main/java/cn/lili/controller/goods/CategorySpecificationStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/goods/CategorySpecificationStoreController.java @@ -21,7 +21,7 @@ import java.util.List; */ @RestController @Api(tags = "店铺端,商品分类规格接口") -@RequestMapping("/store/goods/category/spec") +@RequestMapping("/store/goods/categorySpec") public class CategorySpecificationStoreController { @Autowired private CategorySpecificationService categorySpecificationService; diff --git a/seller-api/src/main/java/cn/lili/controller/goods/GoodsUnitStoreController.java b/seller-api/src/main/java/cn/lili/controller/goods/GoodsUnitStoreController.java index 4a2dff03..4b9907cc 100644 --- a/seller-api/src/main/java/cn/lili/controller/goods/GoodsUnitStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/goods/GoodsUnitStoreController.java @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "店铺端,商品计量单位接口") -@RequestMapping("/store/goods/unit") +@RequestMapping("/store/goods/goodsUnit") public class GoodsUnitStoreController { @Autowired private GoodsUnitService goodsUnitService; diff --git a/seller-api/src/main/java/cn/lili/controller/member/BillStoreController.java b/seller-api/src/main/java/cn/lili/controller/member/BillStoreController.java index 630882e7..addf91fc 100644 --- a/seller-api/src/main/java/cn/lili/controller/member/BillStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/member/BillStoreController.java @@ -31,7 +31,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,结算单接口") -@RequestMapping("/store/member/bill") +@RequestMapping("/store/order/bill") public class BillStoreController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/other/broadcast/CommodityStoreController.java b/seller-api/src/main/java/cn/lili/controller/other/broadcast/CommodityStoreController.java index 9fa92ae4..6a863e73 100644 --- a/seller-api/src/main/java/cn/lili/controller/other/broadcast/CommodityStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/other/broadcast/CommodityStoreController.java @@ -26,7 +26,7 @@ import java.util.List; */ @RestController @Api(tags = "店铺端,直播商品接口") -@RequestMapping("/store/other/broadcast/commodity") +@RequestMapping("/store/broadcast/commodity") public class CommodityStoreController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/other/broadcast/StudioStoreController.java b/seller-api/src/main/java/cn/lili/controller/other/broadcast/StudioStoreController.java index 7fcba96b..09999f03 100644 --- a/seller-api/src/main/java/cn/lili/controller/other/broadcast/StudioStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/other/broadcast/StudioStoreController.java @@ -29,7 +29,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,直播间接口") -@RequestMapping("/store/other/broadcast/studio") +@RequestMapping("/store/broadcast/studio") public class StudioStoreController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/settings/FreightTemplateStoreController.java b/seller-api/src/main/java/cn/lili/controller/settings/FreightTemplateStoreController.java index f84c4ecf..21caae1f 100644 --- a/seller-api/src/main/java/cn/lili/controller/settings/FreightTemplateStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/settings/FreightTemplateStoreController.java @@ -24,7 +24,7 @@ import java.util.Objects; **/ @RestController @Api(tags = "店铺端,运费模板接口") -@RequestMapping("/store/settings/freightTemplate") +@RequestMapping("/store/setting/freightTemplate") public class FreightTemplateStoreController { @Autowired private FreightTemplateService freightTemplateService; diff --git a/seller-api/src/main/java/cn/lili/controller/settings/StoreAddressController.java b/seller-api/src/main/java/cn/lili/controller/settings/StoreAddressController.java index 684d055b..072a73e1 100644 --- a/seller-api/src/main/java/cn/lili/controller/settings/StoreAddressController.java +++ b/seller-api/src/main/java/cn/lili/controller/settings/StoreAddressController.java @@ -26,7 +26,7 @@ import java.util.Objects; */ @RestController @Api(tags = "店铺端,商家地址(自提点)接口") -@RequestMapping("/store/settings/storeAddress") +@RequestMapping("/store/member/storeAddress") public class StoreAddressController { /** diff --git a/seller-api/src/main/resources/application.yml b/seller-api/src/main/resources/application.yml index a2cc6037..7cdbb89d 100644 --- a/seller-api/src/main/resources/application.yml +++ b/seller-api/src/main/resources/application.yml @@ -119,7 +119,7 @@ ignored: - /MP_verify_qSyvBPhDsPdxvOhC.txt - /weixin/** - /source/** - - /store/login/** + - /store/passport/login/** - /druid/** - /swagger-ui.html - /doc.html From 1d5a2008e1b6a52d69ab26c1078361b34575750c Mon Sep 17 00:00:00 2001 From: paulGao Date: Sat, 12 Feb 2022 17:17:52 +0800 Subject: [PATCH 10/39] =?UTF-8?q?=E9=80=82=E9=85=8D=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=9A=84api=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java | 6 +++++- .../cn/lili/modules/store/entity/dto/BillSearchParams.java | 4 ++++ pom.xml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java index 1182df09..8bc803b4 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java @@ -7,6 +7,7 @@ import cn.hutool.core.util.NumberUtil; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import cn.lili.cache.Cache; +import cn.lili.cache.CachePrefix; import cn.lili.common.enums.PromotionTypeEnum; import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; @@ -447,7 +448,10 @@ public class GoodsSkuServiceImpl extends ServiceImpl i goodsIndexService.deleteIndexById(goodsSku.getId()); } goodsSku.setQuantity(quantity); - this.update(new LambdaUpdateWrapper().eq(GoodsSku::getId, skuId).set(GoodsSku::getQuantity, quantity)); + boolean update = this.update(new LambdaUpdateWrapper().eq(GoodsSku::getId, skuId).set(GoodsSku::getQuantity, quantity)); + if (update) { + cache.remove(CachePrefix.GOODS.getPrefix() + goodsSku.getGoodsId()); + } cache.put(GoodsSkuService.getCacheKeys(skuId), goodsSku); cache.put(GoodsSkuService.getStockCacheKey(skuId), quantity); diff --git a/framework/src/main/java/cn/lili/modules/store/entity/dto/BillSearchParams.java b/framework/src/main/java/cn/lili/modules/store/entity/dto/BillSearchParams.java index da1e91ea..5e0b190e 100644 --- a/framework/src/main/java/cn/lili/modules/store/entity/dto/BillSearchParams.java +++ b/framework/src/main/java/cn/lili/modules/store/entity/dto/BillSearchParams.java @@ -51,6 +51,10 @@ public class BillSearchParams extends PageVO { //创建时间 if (StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)) { wrapper.between("create_time", startDate, endDate); + } else if (StringUtils.isNotEmpty(startDate)) { + wrapper.ge("create_time", startDate); + } else if (StringUtils.isNotEmpty(endDate)) { + wrapper.le("create_time", endDate); } //账单号 wrapper.eq(StringUtils.isNotEmpty(sn), "sn", sn); diff --git a/pom.xml b/pom.xml index 4b74886c..55d26d0f 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ 1.8 - 4.2.3 + 4.3.0 UTF-8 UTF-8 true From 9aa253b56feb8dc89a34f98bc3720d3f0ae742bb Mon Sep 17 00:00:00 2001 From: paulGao Date: Mon, 14 Feb 2022 14:17:19 +0800 Subject: [PATCH 11/39] =?UTF-8?q?=E8=A1=A5=E5=85=85=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E7=9A=84=E4=BA=8B=E5=8A=A1=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lili/event/impl/StockUpdateExecute.java | 2 + .../serviceimpl/ConnectServiceImpl.java | 30 +++++++------- .../DistributionCashServiceImpl.java | 7 +++- .../DistributionOrderServiceImpl.java | 3 ++ .../serviceimpl/DistributionServiceImpl.java | 4 +- .../file/serviceimpl/FileServiceImpl.java | 30 +++++++------- .../goods/serviceimpl/BrandServiceImpl.java | 14 ++----- .../serviceimpl/CategoryBrandServiceImpl.java | 2 + .../CategoryParameterGroupServiceImpl.java | 10 +---- .../serviceimpl/CategoryServiceImpl.java | 41 ++++--------------- .../serviceimpl/CommodityServiceImpl.java | 7 +++- .../serviceimpl/GoodsGalleryServiceImpl.java | 2 + .../goods/serviceimpl/GoodsServiceImpl.java | 11 ++++- .../serviceimpl/GoodsSkuServiceImpl.java | 6 ++- .../serviceimpl/ParametersServiceImpl.java | 2 + .../serviceimpl/SpecificationServiceImpl.java | 11 ++--- .../StoreGoodsLabelServiceImpl.java | 3 ++ .../goods/serviceimpl/StudioServiceImpl.java | 5 +++ .../serviceimpl/FootprintServiceImpl.java | 5 ++- .../serviceimpl/MemberAddressServiceImpl.java | 3 ++ .../MemberEvaluationServiceImpl.java | 3 +- .../MemberNoticeSenterServiceImpl.java | 7 ++-- .../MemberPointsHistoryServiceImpl.java | 3 +- .../serviceimpl/MemberReceiptServiceImpl.java | 11 +++-- .../member/serviceimpl/MemberServiceImpl.java | 2 + .../StoreCollectionServiceImpl.java | 3 ++ .../serviceimpl/MessageServiceImpl.java | 2 + .../serviceimpl/NoticeMessageServiceImpl.java | 14 +++---- .../serviceimpl/StoreMessageServiceImpl.java | 8 ++-- .../serviceimpl/AfterSaleServiceImpl.java | 6 +++ .../order/cart/service/CartServiceImpl.java | 3 ++ .../OrderComplaintServiceImpl.java | 2 + .../order/serviceimpl/OrderServiceImpl.java | 17 ++++++-- .../serviceimpl/StoreFlowServiceImpl.java | 12 +++--- .../order/serviceimpl/TradeServiceImpl.java | 2 +- .../ArticleCategoryServiceImpl.java | 2 + .../page/serviceimpl/ArticleServiceImpl.java | 14 +++---- .../page/serviceimpl/PageDataServiceImpl.java | 6 +++ .../page/serviceimpl/SpecialServiceImpl.java | 3 ++ .../serviceimpl/AdminUserServiceImpl.java | 19 +++++---- .../DepartmentRoleServiceImpl.java | 2 + .../serviceimpl/DepartmentServiceImpl.java | 2 + .../serviceimpl/RoleMenuServiceImpl.java | 2 + .../serviceimpl/RoleServiceImpl.java | 2 + .../serviceimpl/UserRoleServiceImpl.java | 2 + .../CouponActivityItemServiceImpl.java | 2 - .../CouponActivityServiceImpl.java | 4 +- .../serviceimpl/CouponServiceImpl.java | 2 - .../KanjiaActivityGoodsServiceImpl.java | 3 ++ .../KanjiaActivityServiceImpl.java | 2 + .../serviceimpl/PointsGoodsServiceImpl.java | 5 +++ .../serviceimpl/SeckillServiceImpl.java | 2 + .../PurchaseOrderItemServiceImpl.java | 3 +- .../serviceimpl/PurchaseOrderServiceImpl.java | 3 ++ .../PurchaseQuotedItemServiceImpl.java | 2 + .../PurchaseQuotedServiceImpl.java | 2 + .../serviceimpl/CustomWordsServiceImpl.java | 3 ++ .../sms/serviceimpl/SmsReachServiceImpl.java | 2 + .../sms/serviceimpl/SmsSignServiceImpl.java | 5 +++ .../serviceimpl/SmsTemplateServiceImpl.java | 3 +- .../store/serviceimpl/StoreServiceImpl.java | 4 ++ .../serviceimpl/LogisticsServiceImpl.java | 12 +++--- .../system/serviceimpl/RegionServiceImpl.java | 41 ++++++++----------- .../service/impl/VerificationServiceImpl.java | 2 +- .../serviceimpl/MemberWalletServiceImpl.java | 11 ++++- .../MemberWithdrawApplyServiceImpl.java | 6 ++- .../serviceimpl/RechargeServiceImpl.java | 10 ++--- .../serviceimpl/WalletLogServiceImpl.java | 8 ++-- 68 files changed, 285 insertions(+), 199 deletions(-) diff --git a/consumer/src/main/java/cn/lili/event/impl/StockUpdateExecute.java b/consumer/src/main/java/cn/lili/event/impl/StockUpdateExecute.java index eb8ed3d7..ab9f5d63 100644 --- a/consumer/src/main/java/cn/lili/event/impl/StockUpdateExecute.java +++ b/consumer/src/main/java/cn/lili/event/impl/StockUpdateExecute.java @@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.script.DefaultRedisScript; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -79,6 +80,7 @@ public class StockUpdateExecute implements OrderStatusChangeEvent { private PointsGoodsService pointsGoodsService; @Override + @Transactional(rollbackFor = Exception.class) public void orderChange(OrderMessage orderMessage) { switch (orderMessage.getNewStatus()) { diff --git a/framework/src/main/java/cn/lili/modules/connect/serviceimpl/ConnectServiceImpl.java b/framework/src/main/java/cn/lili/modules/connect/serviceimpl/ConnectServiceImpl.java index a71f8f79..f7a98a6b 100644 --- a/framework/src/main/java/cn/lili/modules/connect/serviceimpl/ConnectServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/connect/serviceimpl/ConnectServiceImpl.java @@ -1,5 +1,6 @@ package cn.lili.modules.connect.serviceimpl; +import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import cn.lili.cache.Cache; @@ -13,7 +14,6 @@ import cn.lili.common.security.context.UserContext; import cn.lili.common.security.token.Token; import cn.lili.common.utils.CookieUtil; import cn.lili.common.utils.HttpUtils; -import cn.lili.common.utils.StringUtils; import cn.lili.modules.connect.entity.Connect; import cn.lili.modules.connect.entity.dto.ConnectAuthUser; import cn.lili.modules.connect.entity.dto.WechatMPLoginParams; @@ -35,6 +35,7 @@ import lombok.extern.slf4j.Slf4j; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; @@ -55,6 +56,7 @@ import java.util.concurrent.TimeUnit; @Service public class ConnectServiceImpl extends ServiceImpl implements ConnectService { + static final boolean AUTO_REGION = true; @Autowired private SettingService settingService; @@ -65,10 +67,8 @@ public class ConnectServiceImpl extends ServiceImpl impl @Autowired private Cache cache; - static boolean AUTO_REGION = true; - - @Override + @Transactional(rollbackFor = Exception.class) public Token unionLoginCallback(String type, String unionid, String uuid, boolean longTerm) throws NoPermissionException { try { @@ -94,6 +94,7 @@ public class ConnectServiceImpl extends ServiceImpl impl } @Override + @Transactional(rollbackFor = Exception.class) public Token unionLoginCallback(String type, ConnectAuthUser authUser, String uuid) { Token token; @@ -126,6 +127,7 @@ public class ConnectServiceImpl extends ServiceImpl impl } @Override + @Transactional(rollbackFor = Exception.class) public void unbind(String type) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); @@ -142,13 +144,12 @@ public class ConnectServiceImpl extends ServiceImpl impl queryWrapper.eq(Connect::getUserId, UserContext.getCurrentUser().getId()); List connects = this.list(queryWrapper); List keys = new ArrayList<>(); - connects.forEach(item -> { - keys.add(item.getUnionType()); - }); + connects.forEach(item -> keys.add(item.getUnionType())); return keys; } @Override + @Transactional(rollbackFor = Exception.class) public Token appLoginCallback(ConnectAuthUser authUser, String uuid) { try { return this.unionLoginCallback(authUser.getSource(), authUser.getUuid(), uuid, true); @@ -209,6 +210,7 @@ public class ConnectServiceImpl extends ServiceImpl impl * @param unionId 微信unionid * @return */ + @Transactional(rollbackFor = Exception.class) public Token phoneMpBindAndLogin(String sessionKey, WechatMPLoginParams params, String openId, String unionId) { String encryptedData = params.getEncryptedData(), iv = params.getIv(); JSONObject userInfo = this.getUserInfo(encryptedData, sessionKey, iv); @@ -237,9 +239,9 @@ public class ConnectServiceImpl extends ServiceImpl impl public Connect queryConnect(ConnectQueryDTO connectQueryDTO) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(StringUtils.isNotEmpty(connectQueryDTO.getUserId()), Connect::getUserId, connectQueryDTO.getUserId()) - .eq(StringUtils.isNotEmpty(connectQueryDTO.getUnionType()), Connect::getUnionType, connectQueryDTO.getUnionType()) - .eq(StringUtils.isNotEmpty(connectQueryDTO.getUnionId()), Connect::getUnionId, connectQueryDTO.getUnionId()); + queryWrapper.eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUserId()), Connect::getUserId, connectQueryDTO.getUserId()) + .eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUnionType()), Connect::getUnionType, connectQueryDTO.getUnionType()) + .eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUnionId()), Connect::getUnionId, connectQueryDTO.getUnionId()); return this.getOne(queryWrapper); } @@ -258,7 +260,7 @@ public class ConnectServiceImpl extends ServiceImpl impl //如果unionid 不为空 则为账号绑定unionid - if (StringUtils.isNotEmpty(unionId)) { + if (CharSequenceUtil.isNotEmpty(unionId)) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper(); lambdaQueryWrapper.eq(Connect::getUnionId, unionId); lambdaQueryWrapper.eq(Connect::getUnionType, ConnectEnum.WECHAT.name()); @@ -271,12 +273,12 @@ public class ConnectServiceImpl extends ServiceImpl impl this.save(connect); } }//如果openid 不为空 则为账号绑定openid - if (StringUtils.isNotEmpty(openId)) { + if (CharSequenceUtil.isNotEmpty(openId)) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper(); lambdaQueryWrapper.eq(Connect::getUnionId, openId); lambdaQueryWrapper.eq(Connect::getUnionType, ConnectEnum.WECHAT_MP_OPEN_ID.name()); List connects = this.list(lambdaQueryWrapper); - if (connects.size() == 0) { + if (connects.isEmpty()) { Connect connect = new Connect(); connect.setUnionId(openId); connect.setUserId(member.getId()); @@ -290,7 +292,7 @@ public class ConnectServiceImpl extends ServiceImpl impl /** * 获取微信小程序配置 * - * @return + * @return 微信小程序配置 */ private WechatConnectSettingItem getWechatMPSetting() { Setting setting = settingService.get(SettingEnum.WECHAT_CONNECT.name()); diff --git a/framework/src/main/java/cn/lili/modules/distribution/serviceimpl/DistributionCashServiceImpl.java b/framework/src/main/java/cn/lili/modules/distribution/serviceimpl/DistributionCashServiceImpl.java index 3e789ba1..805fc9db 100644 --- a/framework/src/main/java/cn/lili/modules/distribution/serviceimpl/DistributionCashServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/distribution/serviceimpl/DistributionCashServiceImpl.java @@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.Date; @@ -56,6 +57,7 @@ public class DistributionCashServiceImpl extends ServiceImpl implements Fi @Override public void batchDelete(List ids) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.in(File::getId, ids); List files = this.list(queryWrapper); @@ -48,7 +48,7 @@ public class FileServiceImpl extends ServiceImpl implements Fi @Override public void batchDelete(List ids, AuthUser authUser) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.in(File::getId, ids); queryWrapper.eq(File::getUserEnums, authUser.getRole().name()); @@ -75,26 +75,24 @@ public class FileServiceImpl extends ServiceImpl implements Fi @Override public IPage customerPage(File file, SearchVO searchVO, PageVO pageVo) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.like(StringUtils.isNotEmpty(file.getName()), File::getName, file.getName()) - .like(StringUtils.isNotEmpty(file.getFileKey()), File::getFileKey, file.getFileKey()) - .like(StringUtils.isNotEmpty(file.getFileType()), File::getFileType, file.getFileType()) - .between(StringUtils.isNotEmpty(searchVO.getStartDate()) && StringUtils.isNotEmpty(searchVO.getEndDate()), + queryWrapper.like(CharSequenceUtil.isNotEmpty(file.getName()), File::getName, file.getName()) + .like(CharSequenceUtil.isNotEmpty(file.getFileKey()), File::getFileKey, file.getFileKey()) + .like(CharSequenceUtil.isNotEmpty(file.getFileType()), File::getFileType, file.getFileType()) + .between(CharSequenceUtil.isNotEmpty(searchVO.getStartDate()) && CharSequenceUtil.isNotEmpty(searchVO.getEndDate()), File::getCreateTime, searchVO.getStartDate(), searchVO.getEndDate()); - IPage page = this.page(PageUtil.initPage(pageVo), queryWrapper); - return page; + return this.page(PageUtil.initPage(pageVo), queryWrapper); } @Override public IPage customerPageOwner(FileOwnerDTO ownerDTO, File file, SearchVO searchVO, PageVO pageVo) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(StringUtils.isNotEmpty(ownerDTO.getOwnerId()), File::getOwnerId, ownerDTO.getOwnerId()) + queryWrapper.eq(CharSequenceUtil.isNotEmpty(ownerDTO.getOwnerId()), File::getOwnerId, ownerDTO.getOwnerId()) .eq(File::getUserEnums, ownerDTO.getUserEnums()) - .like(StringUtils.isNotEmpty(file.getName()), File::getName, file.getName()) - .like(StringUtils.isNotEmpty(file.getFileKey()), File::getFileKey, file.getFileKey()) - .like(StringUtils.isNotEmpty(file.getFileType()), File::getFileType, file.getFileType()) - .between(StringUtils.isNotEmpty(searchVO.getStartDate()) && StringUtils.isNotEmpty(searchVO.getEndDate()), + .like(CharSequenceUtil.isNotEmpty(file.getName()), File::getName, file.getName()) + .like(CharSequenceUtil.isNotEmpty(file.getFileKey()), File::getFileKey, file.getFileKey()) + .like(CharSequenceUtil.isNotEmpty(file.getFileType()), File::getFileType, file.getFileType()) + .between(CharSequenceUtil.isNotEmpty(searchVO.getStartDate()) && CharSequenceUtil.isNotEmpty(searchVO.getEndDate()), File::getCreateTime, searchVO.getStartDate(), searchVO.getEndDate()); - IPage page = this.page(PageUtil.initPage(pageVo), queryWrapper); - return page; + return this.page(PageUtil.initPage(pageVo), queryWrapper); } } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/BrandServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/BrandServiceImpl.java index c802c817..c9b945e3 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/BrandServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/BrandServiceImpl.java @@ -109,7 +109,7 @@ public class BrandServiceImpl extends ServiceImpl implements /** * 校验绑定关系 * - * @param brandIds + * @param brandIds 品牌Ids */ private void checkBind(List brandIds) { //分了绑定关系查询 @@ -129,19 +129,11 @@ public class BrandServiceImpl extends ServiceImpl implements } } - /** - * 校验绑定关系 - * - * @param brandIds - */ - private void checkoutGoods(List brandIds) { - } - /** * 校验是否存在 * - * @param brandId - * @return + * @param brandId 品牌ID + * @return 品牌 */ private Brand checkExist(String brandId) { Brand brand = getById(brandId); diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryBrandServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryBrandServiceImpl.java index afdfec52..7374868f 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryBrandServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryBrandServiceImpl.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -37,6 +38,7 @@ public class CategoryBrandServiceImpl extends ServiceImpl brandIds) { //删除分类品牌绑定信息 this.deleteByCategoryId(categoryId); diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryParameterGroupServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryParameterGroupServiceImpl.java index d6c195c5..9d5ab172 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryParameterGroupServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryParameterGroupServiceImpl.java @@ -3,7 +3,6 @@ package cn.lili.modules.goods.serviceimpl; import cn.hutool.json.JSONUtil; import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; -import cn.lili.common.properties.RocketmqCustomProperties; import cn.lili.modules.goods.entity.dos.CategoryParameterGroup; import cn.lili.modules.goods.entity.dos.Goods; import cn.lili.modules.goods.entity.dos.Parameters; @@ -17,9 +16,9 @@ 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.extension.service.impl.ServiceImpl; -import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.HashMap; @@ -46,12 +45,6 @@ public class CategoryParameterGroupServiceImpl extends ServiceImpl getCategoryParams(String categoryId) { //根据id查询参数组 @@ -74,6 +67,7 @@ public class CategoryParameterGroupServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public boolean saveCategory(Category category) { //判断分类佣金是否正确 if (category.getCommissionRate() < 0) { @@ -214,6 +216,7 @@ public class CategoryServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public void updateCategory(Category category) { //判断分类佣金是否正确 if (category.getCommissionRate() < 0) { @@ -239,6 +242,7 @@ public class CategoryServiceImpl extends ServiceImpl i @Override + @Transactional(rollbackFor = Exception.class) public void delete(String id) { this.removeById(id); removeCache(); @@ -249,6 +253,7 @@ public class CategoryServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public void updateCategoryStatus(String categoryId, Boolean enableOperations) { //禁用子分类 CategoryVO categoryVO = new CategoryVO(this.getById(categoryId)); @@ -302,34 +307,6 @@ public class CategoryServiceImpl extends ServiceImpl i } } - /** - * 拼装返回值 - * - * @param paramList 参数列表 - * @return 拼装后的返回值 - */ - private List convertParamList(List groupList, List paramList) { - Map> map = new HashMap<>(16); - for (GoodsParamsVO param : paramList) { - if (map.get(param.getGroupId()) != null) { - map.get(param.getGroupId()).add(param); - } else { - List list = new ArrayList<>(); - list.add(param); - map.put(param.getGroupId(), list); - } - } - List resList = new ArrayList<>(); - for (CategoryParameterGroup group : groupList) { - GoodsParamsGroupVO list = new GoodsParamsGroupVO(); - list.setGroupName(group.getGroupName()); - list.setGroupId(group.getId()); - list.setParams(map.get(group.getId())); - resList.add(list); - } - return resList; - } - /** * 获取所有的子分类ID * diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CommodityServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CommodityServiceImpl.java index 983c56b5..0beff15b 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CommodityServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CommodityServiceImpl.java @@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Objects; @@ -46,6 +47,7 @@ public class CommodityServiceImpl extends ServiceImpl commodityList) { String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); for (Commodity commodity : commodityList) { @@ -54,7 +56,7 @@ public class CommodityServiceImpl extends ServiceImpl goodsIdList = this.baseMapper.getAuditCommodity(); - if (goodsIdList.size() > 0) { + if (!goodsIdList.isEmpty()) { //同步状态 JSONObject json = wechatLivePlayerUtil.getGoodsWareHouse(goodsIdList); //修改状态 diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsGalleryServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsGalleryServiceImpl.java index 365e2a4d..5e4577d7 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsGalleryServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsGalleryServiceImpl.java @@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -35,6 +36,7 @@ public class GoodsGalleryServiceImpl extends ServiceImpl goodsGalleryList, String goodsId) { //删除原来商品相册信息 this.baseMapper.delete(new UpdateWrapper().eq("goods_id", goodsId)); diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java index 6a68590a..ee8fe200 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java @@ -121,6 +121,7 @@ public class GoodsServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public void underStoreGoods(String storeId) { //获取商品ID列表 List list = this.baseMapper.getGoodsIdByStoreId(storeId); @@ -135,6 +136,7 @@ public class GoodsServiceImpl extends ServiceImpl implements * @param params 商品参数 */ @Override + @Transactional(rollbackFor = Exception.class) public void updateGoodsParams(String goodsId, String params) { LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); updateWrapper.eq(Goods::getId, goodsId); @@ -151,6 +153,7 @@ public class GoodsServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public void addGoods(GoodsOperationDTO goodsOperationDTO) { Goods goods = new Goods(goodsOperationDTO); //检查商品 @@ -174,6 +177,7 @@ public class GoodsServiceImpl extends ServiceImpl implements @Override + @Transactional(rollbackFor = Exception.class) public void editGoods(GoodsOperationDTO goodsOperationDTO, String goodsId) { Goods goods = new Goods(goodsOperationDTO); goods.setId(goodsId); @@ -264,6 +268,7 @@ public class GoodsServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public boolean auditGoods(List goodsIds, GoodsAuthEnum goodsAuthEnum) { boolean result = false; for (String goodsId : goodsIds) { @@ -282,6 +287,7 @@ public class GoodsServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public Boolean updateGoodsMarketAble(List goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason) { boolean result; @@ -311,6 +317,7 @@ public class GoodsServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public Boolean managerUpdateGoodsMarketAble(List goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason) { boolean result; @@ -342,6 +349,7 @@ public class GoodsServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public Boolean deleteGoods(List goodsIds) { LambdaUpdateWrapper updateWrapper = this.getUpdateWrapperByStoreAuthority(); @@ -365,6 +373,7 @@ public class GoodsServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public Boolean freight(List goodsIds, String templateId) { AuthUser authUser = this.checkStoreAuthority(); @@ -383,7 +392,6 @@ public class GoodsServiceImpl extends ServiceImpl implements } @Override - @Transactional(rollbackFor = Exception.class) public void updateStock(String goodsId, Integer quantity) { LambdaUpdateWrapper lambdaUpdateWrapper = Wrappers.lambdaUpdate(); lambdaUpdateWrapper.set(Goods::getQuantity, quantity); @@ -425,6 +433,7 @@ public class GoodsServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public void updateStoreDetail(Store store) { UpdateWrapper updateWrapper = new UpdateWrapper<>() .eq("store_id", store.getId()) diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java index 8bc803b4..f7a5932f 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java @@ -188,6 +188,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl i * @param goodsSku sku信息 */ @Override + @Transactional(rollbackFor = Exception.class) public void update(GoodsSku goodsSku) { this.updateById(goodsSku); cache.remove(GoodsSkuService.getCacheKeys(goodsSku.getId())); @@ -434,6 +435,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public void updateStocks(List goodsSkuStockDTOS) { for (GoodsSkuStockDTO goodsSkuStockDTO : goodsSkuStockDTOS) { this.updateStock(goodsSkuStockDTO.getSkuId(), goodsSkuStockDTO.getQuantity()); @@ -441,6 +443,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public void updateStock(String skuId, Integer quantity) { GoodsSku goodsSku = getGoodsSkuByIdFromCache(skuId); if (goodsSku != null) { @@ -476,6 +479,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public void updateGoodsStuck(List goodsSkus) { //商品id集合 hashset 去重复 Set goodsIds = new HashSet<>(); @@ -504,6 +508,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public void updateGoodsSkuCommentNum(String skuId) { //获取商品信息 GoodsSku goodsSku = this.getGoodsSkuByIdFromCache(skuId); @@ -584,7 +589,6 @@ public class GoodsSkuServiceImpl extends ServiceImpl i * @param skuList sku列表 * @param goods 商品信息 */ - @Transactional(rollbackFor = Exception.class) List addGoodsSku(List> skuList, Goods goods) { List skus = new ArrayList<>(); for (Map skuVO : skuList) { diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/ParametersServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/ParametersServiceImpl.java index 4aaa0ea6..13fa9704 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/ParametersServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/ParametersServiceImpl.java @@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -51,6 +52,7 @@ public class ParametersServiceImpl extends ServiceImpl ids) { + boolean result = false; for (String id : ids) { //如果此规格绑定分类则不允许删除 List list = categorySpecificationService.list(new QueryWrapper().eq("specification_id", id)); if (!list.isEmpty()) { List categoryIds = new ArrayList<>(); - list.forEach(item -> { - categoryIds.add(item.getCategoryId()); - }); + list.forEach(item -> categoryIds.add(item.getCategoryId())); throw new ServiceException(ResultCode.SPEC_DELETE_ERROR, JSONUtil.toJsonStr(categoryService.getCategoryNameByIds(categoryIds))); } //删除规格 - this.removeById(id); + result = this.removeById(id); } - return true; + return result; } } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/StoreGoodsLabelServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/StoreGoodsLabelServiceImpl.java index 4ae5dfac..99801a9d 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/StoreGoodsLabelServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/StoreGoodsLabelServiceImpl.java @@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Comparator; @@ -82,6 +83,7 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl impleme private GoodsService goodsService; @Override + @Transactional(rollbackFor = Exception.class) public Boolean create(Studio studio) { studio.setStoreId(Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId()); //创建小程序直播 @@ -97,6 +99,7 @@ public class StudioServiceImpl extends ServiceImpl impleme } @Override + @Transactional(rollbackFor = Exception.class) public Boolean edit(Studio studio) { Studio oldStudio = this.getById(studio.getId()); wechatLivePlayerUtil.editRoom(studio); @@ -153,6 +156,7 @@ public class StudioServiceImpl extends ServiceImpl impleme } @Override + @Transactional(rollbackFor = Exception.class) public Boolean push(Integer roomId, Integer goodsId, String storeId) { //判断直播间是否已添加商品 @@ -183,6 +187,7 @@ public class StudioServiceImpl extends ServiceImpl impleme } @Override + @Transactional(rollbackFor = Exception.class) public Boolean goodsDeleteInRoom(Integer roomId, Integer goodsId, String storeId) { Goods goods = goodsService.getOne(new LambdaQueryWrapper().eq(Goods::getId, goodsId).eq(Goods::getStoreId, storeId)); if (goods == null) { diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/FootprintServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/FootprintServiceImpl.java index 8c1181fa..0fea8a25 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/FootprintServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/FootprintServiceImpl.java @@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.Collections; import java.util.Date; @@ -35,6 +36,7 @@ public class FootprintServiceImpl extends ServiceImpl queryWrapper = Wrappers.lambdaQuery(); queryWrapper.eq(FootPrint::getMemberId, footPrint.getMemberId()); @@ -68,8 +70,7 @@ public class FootprintServiceImpl extends ServiceImpl lambdaQueryWrapper = Wrappers.lambdaQuery(); lambdaQueryWrapper.eq(FootPrint::getMemberId, UserContext.getCurrentUser().getId()); lambdaQueryWrapper.in(FootPrint::getGoodsId, ids); - this.remove(lambdaQueryWrapper); - return true; + return this.remove(lambdaQueryWrapper); } @Override diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberAddressServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberAddressServiceImpl.java index d46d1118..a05ff296 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberAddressServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberAddressServiceImpl.java @@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.Objects; @@ -54,6 +55,7 @@ public class MemberAddressServiceImpl extends ServiceImpl updateWrapper = Wrappers.update(); updateWrapper.set("reply_status", true); updateWrapper.set("reply", reply); - if (StringUtils.isNotEmpty(replyImage)) { + if (CharSequenceUtil.isNotEmpty(replyImage)) { updateWrapper.set("have_reply_image", true); updateWrapper.set("reply_image", replyImage); } diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberNoticeSenterServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberNoticeSenterServiceImpl.java index 934a5495..1bccca56 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberNoticeSenterServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberNoticeSenterServiceImpl.java @@ -1,8 +1,8 @@ package cn.lili.modules.member.serviceimpl; +import cn.hutool.core.text.CharSequenceUtil; import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; -import cn.lili.common.utils.StringUtils; import cn.lili.modules.member.entity.dos.Member; import cn.lili.modules.member.entity.dos.MemberNotice; import cn.lili.modules.member.entity.dos.MemberNoticeSenter; @@ -42,6 +42,7 @@ public class MemberNoticeSenterServiceImpl extends ServiceImpl 0) { + if (!memberNotices.isEmpty()) { //批量保存 if (memberNoticeService.saveBatch(memberNotices)) { return true; diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberPointsHistoryServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberPointsHistoryServiceImpl.java index f1557ca6..70c40c38 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberPointsHistoryServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberPointsHistoryServiceImpl.java @@ -2,7 +2,6 @@ package cn.lili.modules.member.serviceimpl; import cn.hutool.core.text.CharSequenceUtil; -import cn.lili.common.utils.StringUtils; import cn.lili.common.vo.PageVO; import cn.lili.modules.member.entity.dos.Member; import cn.lili.modules.member.entity.dos.MemberPointsHistory; @@ -49,7 +48,7 @@ public class MemberPointsHistoryServiceImpl extends ServiceImpl receipts = this.baseMapper.selectList(new QueryWrapper() .eq("member_id", memberId) .eq("receipt_title", memberReceiptAddVO.getReceiptTitle()) ); - if (receipts.size() > 0) { + if (!receipts.isEmpty()) { throw new ServiceException(ResultCode.USER_RECEIPT_REPEAT_ERROR); } //参数封装 @@ -60,7 +62,7 @@ public class MemberReceiptServiceImpl extends ServiceImpl list = this.baseMapper.selectList(new QueryWrapper().eq("member_id", memberId)); //如果当前会员只有一个发票则默认为默认发票,反之需要校验参数默认值,做一些处理 - if (list.size() <= 0) { + if (list.isEmpty()) { memberReceipt.setIsDefault(1); } else { if (memberReceiptAddVO.getIsDefault().equals(1)) { @@ -78,6 +80,7 @@ public class MemberReceiptServiceImpl extends ServiceImpl 0) { + if (!receipts.isEmpty()) { throw new ServiceException(ResultCode.USER_RECEIPT_REPEAT_ERROR); } BeanUtil.copyProperties(memberReceiptAddVO, memberReceiptDb); diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java index 52bd1052..e0fef231 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java @@ -50,6 +50,7 @@ import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.List; @@ -380,6 +381,7 @@ public class MemberServiceImpl extends ServiceImpl impleme @Override @PointLogPoint + @Transactional(rollbackFor = Exception.class) public Boolean updateMemberPoint(Long point, String type, String memberId, String content) { //获取当前会员信息 Member member = this.getById(memberId); diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/StoreCollectionServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/StoreCollectionServiceImpl.java index bfd798f2..6772fb93 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/StoreCollectionServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/StoreCollectionServiceImpl.java @@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.Optional; @@ -50,6 +51,7 @@ public class StoreCollectionServiceImpl extends ServiceImpl() .eq(StoreCollection::getMemberId, UserContext.getCurrentUser().getId()) @@ -63,6 +65,7 @@ public class StoreCollectionServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper(); queryWrapper.eq("member_id", UserContext.getCurrentUser().getId()); diff --git a/framework/src/main/java/cn/lili/modules/message/serviceimpl/MessageServiceImpl.java b/framework/src/main/java/cn/lili/modules/message/serviceimpl/MessageServiceImpl.java index 6344f564..0f057d1a 100644 --- a/framework/src/main/java/cn/lili/modules/message/serviceimpl/MessageServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/message/serviceimpl/MessageServiceImpl.java @@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; /** * 管理端发送消息内容业务层实现 @@ -37,6 +38,7 @@ public class MessageServiceImpl extends ServiceImpl impl @Override + @Transactional(rollbackFor = Exception.class) public Boolean sendMessage(Message message) { //保存站内信信息 this.save(message); diff --git a/framework/src/main/java/cn/lili/modules/message/serviceimpl/NoticeMessageServiceImpl.java b/framework/src/main/java/cn/lili/modules/message/serviceimpl/NoticeMessageServiceImpl.java index 8bc64782..e177cb6a 100644 --- a/framework/src/main/java/cn/lili/modules/message/serviceimpl/NoticeMessageServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/message/serviceimpl/NoticeMessageServiceImpl.java @@ -1,8 +1,7 @@ package cn.lili.modules.message.serviceimpl; +import cn.hutool.core.text.CharSequenceUtil; import cn.lili.common.enums.SwitchEnum; -import cn.lili.mybatis.util.PageUtil; -import cn.lili.common.utils.StringUtils; import cn.lili.common.vo.PageVO; import cn.lili.modules.message.entity.dos.MemberMessage; import cn.lili.modules.message.entity.dos.NoticeMessage; @@ -12,6 +11,7 @@ import cn.lili.modules.message.entity.enums.NoticeMessageParameterEnum; import cn.lili.modules.message.mapper.NoticeMessageTemplateMapper; import cn.lili.modules.message.service.MemberMessageService; import cn.lili.modules.message.service.NoticeMessageService; +import cn.lili.mybatis.util.PageUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -38,7 +38,7 @@ public class NoticeMessageServiceImpl extends ServiceImpl messageTemplateQueryWrapper = new QueryWrapper<>(); //消息模板类型 - messageTemplateQueryWrapper.eq(!StringUtils.isEmpty(type), "type", type); + messageTemplateQueryWrapper.eq(!CharSequenceUtil.isEmpty(type), "type", type); messageTemplateQueryWrapper.orderByDesc("create_time"); //查询数据返回 return this.page(PageUtil.initPage(pageVO), messageTemplateQueryWrapper); @@ -85,10 +85,10 @@ public class NoticeMessageServiceImpl extends ServiceImpl parameter) { - for (String key : parameter.keySet()) { - String description = NoticeMessageParameterEnum.getValueByType(key); - if (description != null && parameter.get(key) != null) { - noticeContent = noticeContent.replace("#{" + description + "}".trim(), parameter.get(key)); + for (Map.Entry entry : parameter.entrySet()) { + String description = NoticeMessageParameterEnum.getValueByType(entry.getKey()); + if (description != null && entry.getValue() != null) { + noticeContent = noticeContent.replace("#{" + description + "}".trim(), entry.getValue()); } } return noticeContent; diff --git a/framework/src/main/java/cn/lili/modules/message/serviceimpl/StoreMessageServiceImpl.java b/framework/src/main/java/cn/lili/modules/message/serviceimpl/StoreMessageServiceImpl.java index 1202b4d2..104685e7 100644 --- a/framework/src/main/java/cn/lili/modules/message/serviceimpl/StoreMessageServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/message/serviceimpl/StoreMessageServiceImpl.java @@ -1,15 +1,15 @@ package cn.lili.modules.message.serviceimpl; +import cn.hutool.core.text.CharSequenceUtil; import cn.lili.common.enums.ResultCode; import cn.lili.common.security.context.UserContext; -import cn.lili.mybatis.util.PageUtil; -import cn.lili.common.utils.StringUtils; import cn.lili.common.vo.PageVO; import cn.lili.modules.message.entity.dos.StoreMessage; import cn.lili.modules.message.entity.vos.StoreMessageQueryVO; import cn.lili.modules.message.mapper.StoreMessageMapper; import cn.lili.modules.message.service.StoreMessageService; +import cn.lili.mybatis.util.PageUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -42,11 +42,11 @@ public class StoreMessageServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); //消息id查询 - if (StringUtils.isNotEmpty(storeMessageQueryVO.getMessageId())) { + if (CharSequenceUtil.isNotEmpty(storeMessageQueryVO.getMessageId())) { queryWrapper.eq("message_id", storeMessageQueryVO.getMessageId()); } //商家id - if (StringUtils.isNotEmpty(storeMessageQueryVO.getStoreId())) { + if (CharSequenceUtil.isNotEmpty(storeMessageQueryVO.getStoreId())) { queryWrapper.eq("store_id", storeMessageQueryVO.getStoreId()); } //状态查询 diff --git a/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java index 8772c14c..d86fee45 100644 --- a/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java @@ -51,6 +51,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.List; @@ -167,6 +168,7 @@ public class AfterSaleServiceImpl extends ServiceImpl cartSkuVOS = tradeDTO.getSkuList(); @@ -496,6 +498,7 @@ public class CartServiceImpl implements CartService { } @Override + @Transactional(rollbackFor = Exception.class) public void selectCoupon(String couponId, String way, boolean use) { AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser()); //获取购物车,然后重新写入优惠券 diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderComplaintServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderComplaintServiceImpl.java index 405c712a..bc5ebcaf 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderComplaintServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderComplaintServiceImpl.java @@ -32,6 +32,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.List; @@ -118,6 +119,7 @@ public class OrderComplaintServiceImpl extends ServiceImpl implements @Override @OrderLogPoint(description = "'订单['+#orderSn+']取消,原因为:'+#reason", orderSn = "#orderSn") + @Transactional(rollbackFor = Exception.class) public Order cancel(String orderSn, String reason) { Order order = OperationalJudgment.judgment(this.getBySn(orderSn)); //如果订单促销类型不为空&&订单是拼团订单,并且订单未成团,则抛出异常 @@ -307,6 +307,7 @@ public class OrderServiceImpl extends ServiceImpl implements @Override @OrderLogPoint(description = "'订单['+#orderSn+']系统取消,原因为:'+#reason", orderSn = "#orderSn") + @Transactional(rollbackFor = Exception.class) public void systemCancel(String orderSn, String reason) { Order order = this.getBySn(orderSn); order.setOrderStatus(OrderStatusEnum.CANCELLED.name()); @@ -327,6 +328,7 @@ public class OrderServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public void payOrder(String orderSn, String paymentMethod, String receivableNo) { Order order = this.getBySn(orderSn); @@ -362,6 +364,7 @@ public class OrderServiceImpl extends ServiceImpl implements @Override @OrderLogPoint(description = "'库存确认'", orderSn = "#orderSn") + @Transactional(rollbackFor = Exception.class) public void afterOrderConfirm(String orderSn) { Order order = this.getBySn(orderSn); //判断是否为拼团订单,进行特殊处理 @@ -382,6 +385,7 @@ public class OrderServiceImpl extends ServiceImpl implements @Override @SystemLogPoint(description = "修改订单", customerLog = "'订单[' + #orderSn + ']收货信息修改,修改为'+#memberAddressDTO.consigneeDetail+'") + @Transactional(rollbackFor = Exception.class) public Order updateConsignee(String orderSn, MemberAddressDTO memberAddressDTO) { Order order = OperationalJudgment.judgment(this.getBySn(orderSn)); @@ -399,6 +403,7 @@ public class OrderServiceImpl extends ServiceImpl implements @Override @OrderLogPoint(description = "'订单['+#orderSn+']发货,发货单号['+#logisticsNo+']'", orderSn = "#orderSn") + @Transactional(rollbackFor = Exception.class) public Order delivery(String orderSn, String logisticsNo, String logisticsId) { Order order = OperationalJudgment.judgment(this.getBySn(orderSn)); //如果订单未发货,并且订单状态值等于待发货 @@ -465,6 +470,7 @@ public class OrderServiceImpl extends ServiceImpl implements @Override @OrderLogPoint(description = "'订单['+#orderSn+']完成'", orderSn = "#orderSn") + @Transactional(rollbackFor = Exception.class) public void complete(String orderSn) { //是否可以查询到订单 Order order = OperationalJudgment.judgment(this.getBySn(orderSn)); @@ -473,6 +479,7 @@ public class OrderServiceImpl extends ServiceImpl implements @Override @OrderLogPoint(description = "'订单['+#orderSn+']完成'", orderSn = "#orderSn") + @Transactional(rollbackFor = Exception.class) public void systemComplete(String orderSn) { Order order = this.getBySn(orderSn); complete(order, orderSn); @@ -530,6 +537,7 @@ public class OrderServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public void deleteOrder(String sn) { Order order = this.getBySn(sn); if (order == null) { @@ -563,6 +571,7 @@ public class OrderServiceImpl extends ServiceImpl implements * @param parentOrderSn 拼团订单sn */ @Override + @Transactional(rollbackFor = Exception.class) public void agglomeratePintuanOrder(String pintuanId, String parentOrderSn) { //获取拼团配置 Pintuan pintuan = pintuanService.getById(pintuanId); @@ -610,7 +619,7 @@ public class OrderServiceImpl extends ServiceImpl implements @Override public void batchDeliver(MultipartFile files) { - InputStream inputStream = null; + InputStream inputStream; List orderBatchDeliverDTOList = new ArrayList<>(); try { inputStream = files.getInputStream(); @@ -643,7 +652,7 @@ public class OrderServiceImpl extends ServiceImpl implements Order order = this.getBySn(orderSn); Trade trade = tradeService.getBySn(order.getTradeSn()); //如果交易不为空,则返回交易的金额,否则返回订单金额 - if (StringUtils.isNotEmpty(trade.getPayStatus()) + if (CharSequenceUtil.isNotEmpty(trade.getPayStatus()) && trade.getPayStatus().equals(PayStatusEnum.PAID.name())) { return trade.getFlowPrice(); } @@ -679,7 +688,7 @@ public class OrderServiceImpl extends ServiceImpl implements orderBatchDeliverDTO.setLogisticsId(item.getId()); } }); - if (StringUtils.isEmpty(orderBatchDeliverDTO.getLogisticsId())) { + if (CharSequenceUtil.isEmpty(orderBatchDeliverDTO.getLogisticsId())) { throw new ServiceException("物流公司:'" + orderBatchDeliverDTO.getLogisticsName() + " '不存在"); } } diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/StoreFlowServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/StoreFlowServiceImpl.java index 844af67b..6df5053f 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/StoreFlowServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/StoreFlowServiceImpl.java @@ -1,9 +1,9 @@ package cn.lili.modules.order.order.serviceimpl; +import cn.hutool.core.text.CharSequenceUtil; import cn.lili.common.utils.BeanUtil; import cn.lili.common.utils.CurrencyUtil; import cn.lili.common.utils.SnowFlake; -import cn.lili.common.utils.StringUtils; import cn.lili.common.vo.PageVO; import cn.lili.modules.order.aftersale.entity.dos.AfterSale; import cn.lili.modules.order.order.entity.dos.Order; @@ -103,7 +103,7 @@ public class StoreFlowServiceImpl extends ServiceImpl implements TradeService { /** * 缓存 */ @Autowired private Cache cache; /** * 订单 */ @Autowired private OrderService orderService; /** * 会员 */ @Autowired private MemberService memberService; /** * 优惠券 */ @Autowired private CouponService couponService; /** * 会员优惠券 */ @Autowired private MemberCouponService memberCouponService; /** * 砍价 */ @Autowired private KanjiaActivityService kanjiaActivityService; /** * RocketMQ */ @Autowired private RocketMQTemplate rocketMQTemplate; /** * RocketMQ 配置 */ @Autowired private RocketmqCustomProperties rocketmqCustomProperties; @Override @Transactional(rollbackFor = Exception.class) public Trade createTrade(TradeDTO tradeDTO) { //创建订单预校验 createTradeCheck(tradeDTO); Trade trade = new Trade(tradeDTO); String key = CachePrefix.TRADE.getPrefix() + trade.getSn(); //优惠券预处理 couponPretreatment(tradeDTO); //积分预处理 pointPretreatment(tradeDTO); //添加交易 this.save(trade); //添加订单 orderService.intoDB(tradeDTO); //砍价订单处理 kanjiaPretreatment(tradeDTO); //写入缓存,给消费者调用 cache.put(key, JSONUtil.toJsonStr(tradeDTO)); //构建订单创建消息 String destination = rocketmqCustomProperties.getOrderTopic() + ":" + OrderTagsEnum.ORDER_CREATE.name(); //发送订单创建消息 rocketMQTemplate.asyncSend(destination, key, RocketmqSendCallbackBuilder.commonCallback()); return trade; } /** * 创建订单最后一步校验 * * @param tradeDTO 购物车视图 */ private void createTradeCheck(TradeDTO tradeDTO) { //创建订单如果没有收获地址, MemberAddress memberAddress = tradeDTO.getMemberAddress(); if (memberAddress == null) { throw new ServiceException(ResultCode.MEMBER_ADDRESS_NOT_EXIST); } //订单配送区域校验 if (tradeDTO.getNotSupportFreight() != null && !tradeDTO.getNotSupportFreight().isEmpty()) { StringBuilder stringBuilder = new StringBuilder("包含商品有-"); tradeDTO.getNotSupportFreight().forEach(sku -> stringBuilder.append(sku.getGoodsSku().getGoodsName())); throw new ServiceException(ResultCode.ORDER_NOT_SUPPORT_DISTRIBUTION, stringBuilder.toString()); } } @Override public Trade getBySn(String sn) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(Trade::getSn, sn); return this.getOne(queryWrapper); } @Override public void payTrade(String tradeSn, String paymentName, String receivableNo) { LambdaQueryWrapper orderQueryWrapper = new LambdaQueryWrapper<>(); orderQueryWrapper.eq(Order::getTradeSn, tradeSn); List orders = orderService.list(orderQueryWrapper); for (Order order : orders) { orderService.payOrder(order.getSn(), paymentName, receivableNo); } Trade trade = this.getBySn(tradeSn); trade.setPayStatus(PayStatusEnum.PAID.name()); this.saveOrUpdate(trade); } /** * 优惠券预处理 * 下单同时,扣除优惠券 * * @param tradeDTO 购物车视图 */ private void couponPretreatment(TradeDTO tradeDTO) { List memberCouponDTOList = new ArrayList<>(); if (null != tradeDTO.getPlatformCoupon()) { memberCouponDTOList.add(tradeDTO.getPlatformCoupon()); } Collection storeCoupons = tradeDTO.getStoreCoupons().values(); if (!storeCoupons.isEmpty()) { memberCouponDTOList.addAll(storeCoupons); } List ids = memberCouponDTOList.stream().map(e -> e.getMemberCoupon().getId()).collect(Collectors.toList()); memberCouponService.used(tradeDTO.getMemberId(), ids); memberCouponDTOList.forEach(e -> couponService.usedCoupon(e.getMemberCoupon().getCouponId(), 1)); } /** * 创建交易,积分处理 * * @param tradeDTO 购物车视图 */ private void pointPretreatment(TradeDTO tradeDTO) { //需要支付积分 if (tradeDTO.getPriceDetailDTO() != null && tradeDTO.getPriceDetailDTO().getPayPoint() != null && tradeDTO.getPriceDetailDTO().getPayPoint() > 0) { StringBuilder orderSns = new StringBuilder(); for (CartVO item : tradeDTO.getCartList()) { orderSns.append(item.getSn()); } boolean result = memberService.updateMemberPoint(tradeDTO.getPriceDetailDTO().getPayPoint(), PointTypeEnum.REDUCE.name(), tradeDTO.getMemberId(), "订单【" + orderSns + "】创建,积分扣减"); if (!result) { throw new ServiceException(ResultCode.PAY_POINT_ENOUGH); } } } /** * 创建交易、砍价处理 * * @param tradeDTO 购物车视图 */ private void kanjiaPretreatment(TradeDTO tradeDTO) { if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.KANJIA)) { String kanjiaId = tradeDTO.getSkuList().get(0).getKanjiaId(); kanjiaActivityService.endKanjiaActivity(kanjiaId); } } } \ No newline at end of file +package cn.lili.modules.order.order.serviceimpl; import cn.hutool.json.JSONUtil; import cn.lili.cache.Cache; import cn.lili.cache.CachePrefix; import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; import cn.lili.common.properties.RocketmqCustomProperties; import cn.lili.modules.member.entity.dos.MemberAddress; import cn.lili.modules.member.entity.enums.PointTypeEnum; import cn.lili.modules.member.service.MemberService; import cn.lili.modules.order.cart.entity.dto.MemberCouponDTO; import cn.lili.modules.order.cart.entity.dto.TradeDTO; import cn.lili.modules.order.cart.entity.enums.CartTypeEnum; import cn.lili.modules.order.cart.entity.vo.CartVO; import cn.lili.modules.order.order.entity.dos.Order; import cn.lili.modules.order.order.entity.dos.Trade; import cn.lili.modules.order.order.entity.enums.PayStatusEnum; import cn.lili.modules.order.order.mapper.TradeMapper; import cn.lili.modules.order.order.service.OrderService; import cn.lili.modules.order.order.service.TradeService; import cn.lili.modules.promotion.service.CouponService; import cn.lili.modules.promotion.service.KanjiaActivityService; import cn.lili.modules.promotion.service.MemberCouponService; import cn.lili.rocketmq.RocketmqSendCallbackBuilder; import cn.lili.rocketmq.tags.OrderTagsEnum; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; /** * 交易业务层实现 * * @author Chopper * @since 2020/11/17 7:39 下午 */ @Service public class TradeServiceImpl extends ServiceImpl implements TradeService { /** * 缓存 */ @Autowired private Cache cache; /** * 订单 */ @Autowired private OrderService orderService; /** * 会员 */ @Autowired private MemberService memberService; /** * 优惠券 */ @Autowired private CouponService couponService; /** * 会员优惠券 */ @Autowired private MemberCouponService memberCouponService; /** * 砍价 */ @Autowired private KanjiaActivityService kanjiaActivityService; /** * RocketMQ */ @Autowired private RocketMQTemplate rocketMQTemplate; /** * RocketMQ 配置 */ @Autowired private RocketmqCustomProperties rocketmqCustomProperties; @Override @Transactional(rollbackFor = Exception.class) public Trade createTrade(TradeDTO tradeDTO) { //创建订单预校验 createTradeCheck(tradeDTO); Trade trade = new Trade(tradeDTO); String key = CachePrefix.TRADE.getPrefix() + trade.getSn(); //优惠券预处理 couponPretreatment(tradeDTO); //积分预处理 pointPretreatment(tradeDTO); //添加交易 this.save(trade); //添加订单 orderService.intoDB(tradeDTO); //砍价订单处理 kanjiaPretreatment(tradeDTO); //写入缓存,给消费者调用 cache.put(key, JSONUtil.toJsonStr(tradeDTO)); //构建订单创建消息 String destination = rocketmqCustomProperties.getOrderTopic() + ":" + OrderTagsEnum.ORDER_CREATE.name(); //发送订单创建消息 rocketMQTemplate.asyncSend(destination, key, RocketmqSendCallbackBuilder.commonCallback()); return trade; } /** * 创建订单最后一步校验 * * @param tradeDTO 购物车视图 */ private void createTradeCheck(TradeDTO tradeDTO) { //创建订单如果没有收获地址, MemberAddress memberAddress = tradeDTO.getMemberAddress(); if (memberAddress == null) { throw new ServiceException(ResultCode.MEMBER_ADDRESS_NOT_EXIST); } //订单配送区域校验 if (tradeDTO.getNotSupportFreight() != null && !tradeDTO.getNotSupportFreight().isEmpty()) { StringBuilder stringBuilder = new StringBuilder("包含商品有-"); tradeDTO.getNotSupportFreight().forEach(sku -> stringBuilder.append(sku.getGoodsSku().getGoodsName())); throw new ServiceException(ResultCode.ORDER_NOT_SUPPORT_DISTRIBUTION, stringBuilder.toString()); } } @Override public Trade getBySn(String sn) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(Trade::getSn, sn); return this.getOne(queryWrapper); } @Override @Transactional(rollbackFor = Exception.class) public void payTrade(String tradeSn, String paymentName, String receivableNo) { LambdaQueryWrapper orderQueryWrapper = new LambdaQueryWrapper<>(); orderQueryWrapper.eq(Order::getTradeSn, tradeSn); List orders = orderService.list(orderQueryWrapper); for (Order order : orders) { orderService.payOrder(order.getSn(), paymentName, receivableNo); } Trade trade = this.getBySn(tradeSn); trade.setPayStatus(PayStatusEnum.PAID.name()); this.saveOrUpdate(trade); } /** * 优惠券预处理 * 下单同时,扣除优惠券 * * @param tradeDTO 购物车视图 */ private void couponPretreatment(TradeDTO tradeDTO) { List memberCouponDTOList = new ArrayList<>(); if (null != tradeDTO.getPlatformCoupon()) { memberCouponDTOList.add(tradeDTO.getPlatformCoupon()); } Collection storeCoupons = tradeDTO.getStoreCoupons().values(); if (!storeCoupons.isEmpty()) { memberCouponDTOList.addAll(storeCoupons); } List ids = memberCouponDTOList.stream().map(e -> e.getMemberCoupon().getId()).collect(Collectors.toList()); memberCouponService.used(tradeDTO.getMemberId(), ids); memberCouponDTOList.forEach(e -> couponService.usedCoupon(e.getMemberCoupon().getCouponId(), 1)); } /** * 创建交易,积分处理 * * @param tradeDTO 购物车视图 */ private void pointPretreatment(TradeDTO tradeDTO) { //需要支付积分 if (tradeDTO.getPriceDetailDTO() != null && tradeDTO.getPriceDetailDTO().getPayPoint() != null && tradeDTO.getPriceDetailDTO().getPayPoint() > 0) { StringBuilder orderSns = new StringBuilder(); for (CartVO item : tradeDTO.getCartList()) { orderSns.append(item.getSn()); } boolean result = memberService.updateMemberPoint(tradeDTO.getPriceDetailDTO().getPayPoint(), PointTypeEnum.REDUCE.name(), tradeDTO.getMemberId(), "订单【" + orderSns + "】创建,积分扣减"); if (!result) { throw new ServiceException(ResultCode.PAY_POINT_ENOUGH); } } } /** * 创建交易、砍价处理 * * @param tradeDTO 购物车视图 */ private void kanjiaPretreatment(TradeDTO tradeDTO) { if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.KANJIA)) { String kanjiaId = tradeDTO.getSkuList().get(0).getKanjiaId(); kanjiaActivityService.endKanjiaActivity(kanjiaId); } } } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/page/serviceimpl/ArticleCategoryServiceImpl.java b/framework/src/main/java/cn/lili/modules/page/serviceimpl/ArticleCategoryServiceImpl.java index 0aecef3c..199f73b5 100644 --- a/framework/src/main/java/cn/lili/modules/page/serviceimpl/ArticleCategoryServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/page/serviceimpl/ArticleCategoryServiceImpl.java @@ -16,6 +16,7 @@ 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.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Comparator; @@ -50,6 +51,7 @@ public class ArticleCategoryServiceImpl extends ServiceImpl impl public IPage articlePage(ArticleSearchParams articleSearchParams) { articleSearchParams.setSort("a.sort"); QueryWrapper queryWrapper = articleSearchParams.queryWrapper(); - queryWrapper.eq("open_status",true); + queryWrapper.eq("open_status", true); return this.baseMapper.getArticleList(PageUtil.initPage(articleSearchParams), queryWrapper); } @@ -65,9 +65,9 @@ public class ArticleServiceImpl extends ServiceImpl impl @Override public void customRemove(String id) { //判断是否为默认文章 - if(this.getById(id).getType().equals(ArticleEnum.OTHER.name())){ + if (this.getById(id).getType().equals(ArticleEnum.OTHER.name())) { this.removeById(id); - }else{ + } else { throw new ServiceException(ResultCode.ARTICLE_NO_DELETION); } } @@ -79,15 +79,15 @@ public class ArticleServiceImpl extends ServiceImpl impl @Override public Article customGetByType(String type) { - if(!StrUtil.equals(type, ArticleEnum.OTHER.name())){ - return this.getOne(new LambdaUpdateWrapper
().eq(Article::getType,type)); + if (!CharSequenceUtil.equals(type, ArticleEnum.OTHER.name())) { + return this.getOne(new LambdaUpdateWrapper
().eq(Article::getType, type)); } return null; } @Override public Boolean updateArticleStatus(String id, boolean status) { - Article article=this.getById(id); + Article article = this.getById(id); article.setOpenStatus(status); return this.updateById(article); } diff --git a/framework/src/main/java/cn/lili/modules/page/serviceimpl/PageDataServiceImpl.java b/framework/src/main/java/cn/lili/modules/page/serviceimpl/PageDataServiceImpl.java index 7b9b442f..905c1789 100644 --- a/framework/src/main/java/cn/lili/modules/page/serviceimpl/PageDataServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/page/serviceimpl/PageDataServiceImpl.java @@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; /** * 楼层装修管理业务层实现 @@ -36,6 +37,7 @@ public class PageDataServiceImpl extends ServiceImpl i private SystemSettingProperties systemSettingProperties; @Override + @Transactional(rollbackFor = Exception.class) public void addStorePageData(String storeId) { //设置店铺的PC页面 PageData pageData = new PageData(); @@ -55,6 +57,7 @@ public class PageDataServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public PageData addPageData(PageData pageData) { //如果页面为发布,则关闭其他页面,开启此页面 //演示站点不可以开启楼层 @@ -72,6 +75,7 @@ public class PageDataServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public PageData updatePageData(PageData pageData) { //如果页面为发布,则关闭其他页面,开启此页面 if (pageData.getPageShow() != null && pageData.getPageShow().equals(SwitchEnum.OPEN.name())) { @@ -91,6 +95,7 @@ public class PageDataServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public PageData releasePageData(String id) { PageData pageData = this.getById(id); @@ -120,6 +125,7 @@ public class PageDataServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public boolean removePageData(String id) { PageData pageData = this.getById(id); //专题则直接进行删除 diff --git a/framework/src/main/java/cn/lili/modules/page/serviceimpl/SpecialServiceImpl.java b/framework/src/main/java/cn/lili/modules/page/serviceimpl/SpecialServiceImpl.java index 6e6b4fee..70639808 100644 --- a/framework/src/main/java/cn/lili/modules/page/serviceimpl/SpecialServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/page/serviceimpl/SpecialServiceImpl.java @@ -8,6 +8,7 @@ import cn.lili.modules.page.service.SpecialService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; /** * 专题活动业务层实现 @@ -25,6 +26,7 @@ public class SpecialServiceImpl extends ServiceImpl impl private PageDataService pageDataService; @Override + @Transactional(rollbackFor = Exception.class) public Special addSpecial(Special special) { //新建页面 PageData pageData = new PageData(); @@ -37,6 +39,7 @@ public class SpecialServiceImpl extends ServiceImpl impl } @Override + @Transactional(rollbackFor = Exception.class) public boolean removeSpecial(String id) { //删除页面内容 diff --git a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/AdminUserServiceImpl.java b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/AdminUserServiceImpl.java index d73fb93f..a7411f44 100644 --- a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/AdminUserServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/AdminUserServiceImpl.java @@ -27,6 +27,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Arrays; @@ -55,7 +56,7 @@ public class AdminUserServiceImpl extends ServiceImpl adminUserPage(Page initPage, QueryWrapper initWrapper) { @@ -71,7 +72,7 @@ public class AdminUserServiceImpl extends ServiceImpl department.getId().equals(adminUser.getDepartmentId())) + (department -> department.getId().equals(adminUser.getDepartmentId())) .collect(Collectors.toList()) .get(0) .getTitle() @@ -80,12 +81,12 @@ public class AdminUserServiceImpl extends ServiceImpl memberRoles = Arrays.asList(adminUser.getRoleIds().split(",")); adminUserVO.setRoles( roles.stream().filter - (role -> memberRoles.contains(role.getId())) + (role -> memberRoles.contains(role.getId())) .collect(Collectors.toList()) ); } catch (Exception e) { @@ -155,14 +156,15 @@ public class AdminUserServiceImpl extends ServiceImpl roles) { - if (roles != null && roles.size() > 0) { + if (roles != null && !roles.isEmpty()) { if (roles.size() > rolesMaxSize) { throw new ServiceException(ResultCode.PERMISSION_BEYOND_TEN); } - adminUser.setRoleIds(StringUtils.join(",", roles)); + adminUser.setRoleIds(CharSequenceUtil.join(",", roles)); } else { adminUser.setRoleIds(""); @@ -193,13 +195,14 @@ public class AdminUserServiceImpl extends ServiceImpl adminUsers = this.list(lambdaQueryWrapper); String password = StringUtils.md5("123456"); String newEncryptPass = new BCryptPasswordEncoder().encode(password); - if (null != adminUsers && adminUsers.size() > 0) { + if (null != adminUsers && !adminUsers.isEmpty()) { adminUsers.forEach(item -> item.setPassword(newEncryptPass)); this.updateBatchById(adminUsers); } } @Override + @Transactional(rollbackFor = Exception.class) public void saveAdminUser(AdminUserDTO adminUser, List roles) { AdminUser dbUser = new AdminUser(); BeanUtil.copyProperties(adminUser, dbUser); @@ -239,7 +242,7 @@ public class AdminUserServiceImpl extends ServiceImpl userRoles = new ArrayList<>(roles.size()); diff --git a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/DepartmentRoleServiceImpl.java b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/DepartmentRoleServiceImpl.java index d7e35b9d..10e484de 100644 --- a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/DepartmentRoleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/DepartmentRoleServiceImpl.java @@ -6,6 +6,7 @@ import cn.lili.modules.permission.service.DepartmentRoleService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -27,6 +28,7 @@ public class DepartmentRoleServiceImpl extends ServiceImpl departmentRoles) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("department_id", departmentId); diff --git a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/DepartmentServiceImpl.java b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/DepartmentServiceImpl.java index 2ed31e47..076eaaf5 100644 --- a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/DepartmentServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/DepartmentServiceImpl.java @@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -40,6 +41,7 @@ public class DepartmentServiceImpl extends ServiceImpl ids) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.in("department_id", ids); diff --git a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/RoleMenuServiceImpl.java b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/RoleMenuServiceImpl.java index db9c3be2..8966c190 100644 --- a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/RoleMenuServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/RoleMenuServiceImpl.java @@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import groovy.util.logging.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.List; @@ -57,6 +58,7 @@ public class RoleMenuServiceImpl extends ServiceImpl i @Override + @Transactional(rollbackFor = Exception.class) public void updateRoleMenu(String roleId, List roleMenus) { try { //删除角色已经绑定的菜单 diff --git a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/RoleServiceImpl.java b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/RoleServiceImpl.java index 2ca61b57..510e7041 100644 --- a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/RoleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/RoleServiceImpl.java @@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -46,6 +47,7 @@ public class RoleServiceImpl extends ServiceImpl implements Ro } @Override + @Transactional(rollbackFor = Exception.class) public void deleteRoles(List roleIds) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.in("role_id", roleIds); diff --git a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/UserRoleServiceImpl.java b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/UserRoleServiceImpl.java index 19ad367e..e3e84d4e 100644 --- a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/UserRoleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/UserRoleServiceImpl.java @@ -6,6 +6,7 @@ import cn.lili.modules.permission.service.UserRoleService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -35,6 +36,7 @@ public class UserRoleServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public void updateUserRole(String userId, List userRoles) { //删除 diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponActivityItemServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponActivityItemServiceImpl.java index b7fcde45..03eedfa4 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponActivityItemServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponActivityItemServiceImpl.java @@ -7,7 +7,6 @@ import cn.lili.modules.promotion.service.CouponActivityItemService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -38,7 +37,6 @@ public class CouponActivityItemServiceImpl extends ServiceImpl couponIds) { this.remove(new LambdaQueryWrapper() .in(CouponActivityItem::getCouponId, couponIds)); diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponActivityServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponActivityServiceImpl.java index ee56fcdc..ef8e5a43 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponActivityServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponActivityServiceImpl.java @@ -54,6 +54,7 @@ public class CouponActivityServiceImpl extends AbstractPromotionsServiceImpl couponActivityList, Member member) { for (CouponActivity couponActivity : couponActivityList) { //获取会员信息 @@ -164,6 +166,7 @@ public class CouponActivityServiceImpl extends AbstractPromotionsServiceImpl> memberList, List couponActivityItems) { for (CouponActivityItem couponActivityItem : couponActivityItems) { diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponServiceImpl.java index 076d45ea..4f08616f 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponServiceImpl.java @@ -77,7 +77,6 @@ public class CouponServiceImpl extends AbstractPromotionsServiceImpl kanjiaActivityGoodsList = new ArrayList<>(); List promotionGoodsList = new ArrayList<>(); @@ -242,6 +244,7 @@ public class KanjiaActivityGoodsServiceImpl extends AbstractPromotionsServiceImp } @Override + @Transactional(rollbackFor = Exception.class) public boolean updateKanjiaActivityGoods(KanjiaActivityGoodsDTO kanJiaActivityGoodsDTO) { //校验砍价商品是否存在 KanjiaActivityGoods dbKanJiaActivityGoods = this.getKanjiaGoodsDetail(kanJiaActivityGoodsDTO.getId()); diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/KanjiaActivityServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/KanjiaActivityServiceImpl.java index 24d0382b..b48a3096 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/KanjiaActivityServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/KanjiaActivityServiceImpl.java @@ -35,6 +35,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.math.RoundingMode; @@ -93,6 +94,7 @@ public class KanjiaActivityServiceImpl extends ServiceImpl promotionsList) { List promotionGoodsList = new ArrayList<>(); for (PointsGoods pointsGoods : promotionsList) { @@ -106,6 +108,7 @@ public class PointsGoodsServiceImpl extends AbstractPromotionsServiceImpl ids) { for (String id : ids) { PointsGoods pointsGoods = this.getById(id); @@ -205,6 +209,7 @@ public class PointsGoodsServiceImpl extends AbstractPromotionsServiceImpl implements PurchaseOrderItemService { @Override + @Transactional(rollbackFor = Exception.class) public boolean addPurchaseOrderItem(String purchaseOrderId, List purchaseOrderItemList) { //添加采购单子内容 for (PurchaseOrderItem purchaseOrderItem : purchaseOrderItemList) { diff --git a/framework/src/main/java/cn/lili/modules/purchase/serviceimpl/PurchaseOrderServiceImpl.java b/framework/src/main/java/cn/lili/modules/purchase/serviceimpl/PurchaseOrderServiceImpl.java index 72e1e28e..bfb29b6b 100644 --- a/framework/src/main/java/cn/lili/modules/purchase/serviceimpl/PurchaseOrderServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/purchase/serviceimpl/PurchaseOrderServiceImpl.java @@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; /** @@ -31,6 +32,7 @@ public class PurchaseOrderServiceImpl extends ServiceImpl implements PurchaseQuotedItemService { @Override + @Transactional(rollbackFor = Exception.class) public boolean addPurchaseQuotedItem(String purchaseQuotedId, List purchaseQuotedItemList) { for (PurchaseQuotedItem purchaseQuotedItem : purchaseQuotedItemList) { purchaseQuotedItem.setPurchaseQuotedId(purchaseQuotedId); diff --git a/framework/src/main/java/cn/lili/modules/purchase/serviceimpl/PurchaseQuotedServiceImpl.java b/framework/src/main/java/cn/lili/modules/purchase/serviceimpl/PurchaseQuotedServiceImpl.java index 703d1749..a963215d 100644 --- a/framework/src/main/java/cn/lili/modules/purchase/serviceimpl/PurchaseQuotedServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/purchase/serviceimpl/PurchaseQuotedServiceImpl.java @@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -26,6 +27,7 @@ public class PurchaseQuotedServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper().eq(CustomWords::getName, customWordsVO.getName()); CustomWords one = this.getOne(queryWrapper, false); @@ -81,6 +83,7 @@ public class CustomWordsServiceImpl extends ServiceImpl i @Override + @Transactional(rollbackFor = Exception.class) public void addSmsReach(SmsReach smsReach,List mobile) { String destination = rocketmqCustomProperties.getNoticeSendTopic() + ":" + OtherTagsEnum.SMS.name(); SmsReachDTO smsReachDTO = new SmsReachDTO(); diff --git a/framework/src/main/java/cn/lili/modules/sms/serviceimpl/SmsSignServiceImpl.java b/framework/src/main/java/cn/lili/modules/sms/serviceimpl/SmsSignServiceImpl.java index 49b8faab..d55c8b98 100644 --- a/framework/src/main/java/cn/lili/modules/sms/serviceimpl/SmsSignServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/sms/serviceimpl/SmsSignServiceImpl.java @@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.HashMap; import java.util.List; @@ -32,6 +33,7 @@ public class SmsSignServiceImpl extends ServiceImpl impl private AliSmsUtil aliSmsUtil; @Override + @Transactional(rollbackFor = Exception.class) public void addSmsSign(SmsSign smsSign) { try { //如果短信签名已存在,不能重复申请 @@ -47,6 +49,7 @@ public class SmsSignServiceImpl extends ServiceImpl impl } @Override + @Transactional(rollbackFor = Exception.class) public void deleteSmsSign(String id) { try { SmsSign smsSign = this.getById(id); @@ -61,6 +64,7 @@ public class SmsSignServiceImpl extends ServiceImpl impl } @Override + @Transactional(rollbackFor = Exception.class) public void querySmsSign() { try { Map map = new HashMap<>(16); @@ -79,6 +83,7 @@ public class SmsSignServiceImpl extends ServiceImpl impl } @Override + @Transactional(rollbackFor = Exception.class) public void modifySmsSign(SmsSign smsSign) { try { aliSmsUtil.modifySmsSign(smsSign); diff --git a/framework/src/main/java/cn/lili/modules/sms/serviceimpl/SmsTemplateServiceImpl.java b/framework/src/main/java/cn/lili/modules/sms/serviceimpl/SmsTemplateServiceImpl.java index c5d8dddf..b23a4990 100644 --- a/framework/src/main/java/cn/lili/modules/sms/serviceimpl/SmsTemplateServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/sms/serviceimpl/SmsTemplateServiceImpl.java @@ -14,7 +14,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -59,7 +58,7 @@ public class SmsTemplateServiceImpl extends ServiceImpl map = new HashMap<>(16); + Map map; //获取未审核通过的签名列表 List list = list(new LambdaQueryWrapper().eq(SmsTemplate::getTemplateStatus, 0)); //查询签名状态 diff --git a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java index 40b4e3dc..2f60c9e9 100644 --- a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java @@ -30,6 +30,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.Objects; import java.util.Optional; @@ -73,6 +74,7 @@ public class StoreServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public Store add(AdminStoreApplyDTO adminStoreApplyDTO) { //判断店铺名称是否存在 @@ -111,6 +113,7 @@ public class StoreServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public Store edit(StoreEditDTO storeEditDTO) { if (storeEditDTO != null) { //判断店铺名是否唯一 @@ -157,6 +160,7 @@ public class StoreServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public boolean audit(String id, Integer passed) { Store store = this.getById(id); if (store == null) { diff --git a/framework/src/main/java/cn/lili/modules/system/serviceimpl/LogisticsServiceImpl.java b/framework/src/main/java/cn/lili/modules/system/serviceimpl/LogisticsServiceImpl.java index 26722cf9..e7b40f61 100644 --- a/framework/src/main/java/cn/lili/modules/system/serviceimpl/LogisticsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/system/serviceimpl/LogisticsServiceImpl.java @@ -1,6 +1,6 @@ package cn.lili.modules.system.serviceimpl; -import cn.hutool.core.util.StrUtil; +import cn.hutool.core.text.CharSequenceUtil; import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.SwitchEnum; import cn.lili.common.exception.ServiceException; @@ -70,7 +70,7 @@ public class LogisticsServiceImpl extends ServiceImpl params = new HashMap(8); + Map params = new HashMap<>(8); params.put("RequestData", urlEncoder(requestData, "UTF-8")); params.put("EBusinessID", EBusinessID); params.put("RequestType", "1002"); @@ -134,14 +134,12 @@ public class LogisticsServiceImpl extends ServiceImpl impleme /** * 同步请求地址 */ - private String syncUrl = "https://restapi.amap.com/v3/config/district?subdistrict=4&key=e456d77800e2084a326f7b777278f89d"; + private final String syncUrl = "https://restapi.amap.com/v3/config/district?subdistrict=4&key=e456d77800e2084a326f7b777278f89d"; @Autowired private Cache cache; @@ -41,12 +41,12 @@ public class RegionServiceImpl extends ServiceImpl impleme try { //清空数据 - QueryWrapper queryWrapper = new QueryWrapper(); + QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.ne("id", "-1"); this.remove(queryWrapper); //读取数据 - String jsonString = HttpClientUtils.doGet(StringUtils.isEmpty(url) ? syncUrl : url, null); + String jsonString = HttpClientUtils.doGet(CharSequenceUtil.isEmpty(url) ? syncUrl : url, null); //构造存储数据库的对象集合 List regions = this.initData(jsonString); @@ -66,12 +66,7 @@ public class RegionServiceImpl extends ServiceImpl impleme LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(Region::getParentId, id); List regions = this.list(lambdaQueryWrapper); - regions.sort(new Comparator() { - @Override - public int compare(Region o1, Region o2) { - return o1.getOrderNum().compareTo(o2.getOrderNum()); - } - }); + regions.sort(Comparator.comparing(Region::getOrderNum)); return regions; } @@ -89,26 +84,26 @@ public class RegionServiceImpl extends ServiceImpl impleme result = ArrayUtils.remove(result, 0); result = ArrayUtils.remove(result, 0); //地址id - String regionIds = ""; + StringBuilder regionIds = new StringBuilder(); //地址名称 - String regionNames = ""; + StringBuilder regionNames = new StringBuilder(); //循环构建新的数据 for (String regionId : result) { Region reg = this.baseMapper.selectById(regionId); if (reg != null) { - regionIds += regionId + ","; - regionNames += reg.getName() + ","; + regionIds.append(regionId).append(","); + regionNames.append(reg.getName()).append(","); } } - regionIds += region.getId(); - regionNames += region.getName(); + regionIds.append(region.getId()); + regionNames.append(region.getName()); //构建返回数据 Map obj = new HashMap<>(2); - obj.put("id", regionIds); - obj.put("name", regionNames); + obj.put("id", regionIds.toString()); + obj.put("name", regionNames.toString()); return obj; } - return null; + return Collections.emptyMap(); } @Override @@ -121,9 +116,7 @@ public class RegionServiceImpl extends ServiceImpl impleme private List regionTree(List regions) { List regionVOS = new ArrayList<>(); - regions.stream().filter(region -> ("province").equals(region.getLevel())).forEach(item -> { - regionVOS.add(new RegionVO(item)); - }); + regions.stream().filter(region -> ("province").equals(region.getLevel())).forEach(item -> regionVOS.add(new RegionVO(item))); regions.stream().filter(region -> ("city").equals(region.getLevel())).forEach(item -> { for (RegionVO region : regionVOS) { if (region.getId().equals(item.getParentId())) { @@ -238,9 +231,9 @@ public class RegionServiceImpl extends ServiceImpl impleme record.setParentId(parentId); record.setOrderNum(order); record.setId(String.valueOf(SnowFlake.getId())); - StringBuffer megName = new StringBuffer(","); + StringBuilder megName = new StringBuilder(","); for (int i = 0; i < ids.length; i++) { - megName = megName.append(ids[i]) ; + megName.append(ids[i]); if (i < ids.length - 1) { megName.append(","); } diff --git a/framework/src/main/java/cn/lili/modules/verification/service/impl/VerificationServiceImpl.java b/framework/src/main/java/cn/lili/modules/verification/service/impl/VerificationServiceImpl.java index 35f8b481..dd4b5894 100644 --- a/framework/src/main/java/cn/lili/modules/verification/service/impl/VerificationServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/verification/service/impl/VerificationServiceImpl.java @@ -156,7 +156,7 @@ public class VerificationServiceImpl implements VerificationService { @Override public boolean check(String uuid, VerificationEnums verificationEnums) { //如果有校验标记,则返回校验结果 - if (cache.remove(cacheResult(verificationEnums, uuid))) { + if (Boolean.TRUE.equals(cache.remove(cacheResult(verificationEnums, uuid)))) { return true; } throw new ServiceException(ResultCode.VERIFICATION_CODE_INVALID); diff --git a/framework/src/main/java/cn/lili/modules/wallet/serviceimpl/MemberWalletServiceImpl.java b/framework/src/main/java/cn/lili/modules/wallet/serviceimpl/MemberWalletServiceImpl.java index a9aea270..87766492 100644 --- a/framework/src/main/java/cn/lili/modules/wallet/serviceimpl/MemberWalletServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/wallet/serviceimpl/MemberWalletServiceImpl.java @@ -37,6 +37,7 @@ import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.Date; @@ -93,6 +94,7 @@ public class MemberWalletServiceImpl extends ServiceImpl i //构建查询条件 QueryWrapper queryWrapper = new QueryWrapper<>(); //会员名称 - queryWrapper.like(!StringUtils.isEmpty(rechargeQueryVO.getMemberName()), "member_name", rechargeQueryVO.getMemberName()); + queryWrapper.like(!CharSequenceUtil.isEmpty(rechargeQueryVO.getMemberName()), "member_name", rechargeQueryVO.getMemberName()); //充值订单号 - queryWrapper.eq(!StringUtils.isEmpty(rechargeQueryVO.getRechargeSn()), "recharge_sn", rechargeQueryVO.getRechargeSn()); + queryWrapper.eq(!CharSequenceUtil.isEmpty(rechargeQueryVO.getRechargeSn()), "recharge_sn", rechargeQueryVO.getRechargeSn()); //会员id - queryWrapper.eq(!StringUtils.isEmpty(rechargeQueryVO.getMemberId()), "member_id", rechargeQueryVO.getMemberId()); + queryWrapper.eq(!CharSequenceUtil.isEmpty(rechargeQueryVO.getMemberId()), "member_id", rechargeQueryVO.getMemberId()); //支付时间 开始时间和结束时间 - if (!StringUtils.isEmpty(rechargeQueryVO.getStartDate()) && !StringUtils.isEmpty(rechargeQueryVO.getEndDate())) { + if (!CharSequenceUtil.isEmpty(rechargeQueryVO.getStartDate()) && !CharSequenceUtil.isEmpty(rechargeQueryVO.getEndDate())) { Date start = cn.hutool.core.date.DateUtil.parse(rechargeQueryVO.getStartDate()); Date end = cn.hutool.core.date.DateUtil.parse(rechargeQueryVO.getEndDate()); queryWrapper.between("pay_time", start, end); diff --git a/framework/src/main/java/cn/lili/modules/wallet/serviceimpl/WalletLogServiceImpl.java b/framework/src/main/java/cn/lili/modules/wallet/serviceimpl/WalletLogServiceImpl.java index b1957e80..f3a53b17 100644 --- a/framework/src/main/java/cn/lili/modules/wallet/serviceimpl/WalletLogServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/wallet/serviceimpl/WalletLogServiceImpl.java @@ -1,6 +1,6 @@ package cn.lili.modules.wallet.serviceimpl; -import cn.lili.common.utils.StringUtils; +import cn.hutool.core.text.CharSequenceUtil; import cn.lili.common.vo.PageVO; import cn.lili.modules.order.trade.entity.vo.DepositQueryVO; import cn.lili.modules.wallet.entity.dos.WalletLog; @@ -28,11 +28,11 @@ public class WalletLogServiceImpl extends ServiceImpl depositLogQueryWrapper = new QueryWrapper<>(); //会员名称 - depositLogQueryWrapper.like(!StringUtils.isEmpty(depositQueryVO.getMemberName()), "member_name", depositQueryVO.getMemberName()); + depositLogQueryWrapper.like(!CharSequenceUtil.isEmpty(depositQueryVO.getMemberName()), "member_name", depositQueryVO.getMemberName()); //会员id - depositLogQueryWrapper.eq(!StringUtils.isEmpty(depositQueryVO.getMemberId()), "member_id", depositQueryVO.getMemberId()); + depositLogQueryWrapper.eq(!CharSequenceUtil.isEmpty(depositQueryVO.getMemberId()), "member_id", depositQueryVO.getMemberId()); //开始时间和技术时间 - if (!StringUtils.isEmpty(depositQueryVO.getStartDate()) && !StringUtils.isEmpty(depositQueryVO.getEndDate())) { + if (!CharSequenceUtil.isEmpty(depositQueryVO.getStartDate()) && !CharSequenceUtil.isEmpty(depositQueryVO.getEndDate())) { Date start = cn.hutool.core.date.DateUtil.parse(depositQueryVO.getStartDate()); Date end = cn.hutool.core.date.DateUtil.parse(depositQueryVO.getEndDate()); depositLogQueryWrapper.between("create_time", start, end); From 9cd591efe3dcecf1f3f785b4452ffb7b96d4d46f Mon Sep 17 00:00:00 2001 From: chopper711 <1814994716@qq.com> Date: Mon, 14 Feb 2022 10:09:37 +0000 Subject: [PATCH 12/39] update README.md. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f57e702b..b4ebe4b7 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,13 @@ #### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,进群先看文档后提问) + ##### 交流 qq 1群 961316482(已满) +Lilishop交流群点击快捷加群 ##### 交流 qq 2群 875294241 +Lilishop交流群2群点击快捷加群 ##### 体验 公众号/小程序/APP 体验,扫描二维码 From f8d2ab5e17f3c4bfe1888e6413e0b4638e6ef4d3 Mon Sep 17 00:00:00 2001 From: paulGao Date: Mon, 14 Feb 2022 18:32:28 +0800 Subject: [PATCH 13/39] =?UTF-8?q?=E9=80=82=E9=85=8D=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer-api/src/main/resources/application.yml | 1 + .../java/cn/lili/modules/connect/util/ConnectUtil.java | 10 +++++----- .../main/java/cn/lili/modules/payment/kit/Payment.java | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/buyer-api/src/main/resources/application.yml b/buyer-api/src/main/resources/application.yml index bf86659d..4192a8ab 100644 --- a/buyer-api/src/main/resources/application.yml +++ b/buyer-api/src/main/resources/application.yml @@ -129,6 +129,7 @@ ignored: - /weixin/** - /source/** - /buyer/payment/cashier/** + - /buyer/payment/cashierRefund/** - /buyer/other/pageData/** - /buyer/other/article/** - /buyer/goods/** diff --git a/framework/src/main/java/cn/lili/modules/connect/util/ConnectUtil.java b/framework/src/main/java/cn/lili/modules/connect/util/ConnectUtil.java index 6a627b4b..272ad84e 100644 --- a/framework/src/main/java/cn/lili/modules/connect/util/ConnectUtil.java +++ b/framework/src/main/java/cn/lili/modules/connect/util/ConnectUtil.java @@ -3,22 +3,22 @@ package cn.lili.modules.connect.util; import cn.hutool.json.JSONUtil; import cn.lili.cache.Cache; import cn.lili.cache.CachePrefix; +import cn.lili.common.enums.ClientTypeEnum; import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.ResultUtil; import cn.lili.common.exception.ServiceException; -import cn.lili.common.security.token.Token; -import cn.lili.common.vo.ResultMessage; import cn.lili.common.properties.ApiProperties; import cn.lili.common.properties.DomainProperties; -import cn.lili.common.enums.ClientTypeEnum; +import cn.lili.common.security.token.Token; +import cn.lili.common.vo.ResultMessage; import cn.lili.modules.connect.config.AuthConfig; import cn.lili.modules.connect.config.ConnectAuthEnum; import cn.lili.modules.connect.entity.dto.AuthCallback; import cn.lili.modules.connect.entity.dto.AuthResponse; import cn.lili.modules.connect.entity.dto.ConnectAuthUser; import cn.lili.modules.connect.exception.AuthException; -import cn.lili.modules.connect.request.BaseAuthQQRequest; import cn.lili.modules.connect.request.AuthRequest; +import cn.lili.modules.connect.request.BaseAuthQQRequest; import cn.lili.modules.connect.request.BaseAuthWeChatPCRequest; import cn.lili.modules.connect.request.BaseAuthWeChatRequest; import cn.lili.modules.connect.service.ConnectService; @@ -62,7 +62,7 @@ public class ConnectUtil { private DomainProperties domainProperties; - static String prefix = "/buyer/connect/callback/"; + static String prefix = "/buyer/passport/connect/connect/callback/"; /** * 回调地址获取 diff --git a/framework/src/main/java/cn/lili/modules/payment/kit/Payment.java b/framework/src/main/java/cn/lili/modules/payment/kit/Payment.java index 9ad4b921..4046dc1a 100644 --- a/framework/src/main/java/cn/lili/modules/payment/kit/Payment.java +++ b/framework/src/main/java/cn/lili/modules/payment/kit/Payment.java @@ -4,8 +4,8 @@ import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; import cn.lili.common.vo.ResultMessage; import cn.lili.modules.payment.entity.RefundLog; -import cn.lili.modules.payment.kit.dto.PayParam; import cn.lili.modules.payment.entity.enums.PaymentMethodEnum; +import cn.lili.modules.payment.kit.dto.PayParam; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -129,7 +129,7 @@ public interface Payment { * @return 回调地址 */ default String callbackUrl(String api, PaymentMethodEnum paymentMethodEnum) { - return api + "/buyer/cashier/callback/" + paymentMethodEnum.name(); + return api + "/buyer/payment/cashier/callback/" + paymentMethodEnum.name(); } /** * 支付异步通知地址 @@ -139,7 +139,7 @@ public interface Payment { * @return 异步通知地址 */ default String notifyUrl(String api, PaymentMethodEnum paymentMethodEnum) { - return api + "/buyer/cashier/notify/" + paymentMethodEnum.name(); + return api + "/buyer/payment/cashier/notify/" + paymentMethodEnum.name(); } /** @@ -150,7 +150,7 @@ public interface Payment { * @return 异步通知地址 */ default String refundNotifyUrl(String api, PaymentMethodEnum paymentMethodEnum) { - return api + "/buyer/cashier/refund/notify/" + paymentMethodEnum.name(); + return api + "/buyer/payment/cashierRefund/notify/" + paymentMethodEnum.name(); } } From a0139b84e17b30938d47e3d45077f09fa0fd9d5f Mon Sep 17 00:00:00 2001 From: paulGao Date: Tue, 15 Feb 2022 10:39:38 +0800 Subject: [PATCH 14/39] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 55d26d0f..9e83ebb2 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ 1.8 - 4.3.0 + 4.2.4 UTF-8 UTF-8 true From f6eb72332b5a7b6eef759f1eae7067f3e8d5c8d7 Mon Sep 17 00:00:00 2001 From: paulGao Date: Tue, 15 Feb 2022 11:00:15 +0800 Subject: [PATCH 15/39] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/application.yml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/config/application.yml b/config/application.yml index f18e5ee9..d37dfac7 100644 --- a/config/application.yml +++ b/config/application.yml @@ -124,26 +124,29 @@ ignored: - /MP_verify_qSyvBPhDsPdxvOhC.txt - /weixin/** - /source/** - - /buyer/mini-program/** - - /buyer/cashier/** - - /buyer/pageData/** - - /buyer/article/** + - /store/passport/login/** + - /common/common/slider/** + - /common/common/sms/** + - /buyer/payment/cashier/** + - /buyer/other/pageData/** + - /buyer/other/article/** - /buyer/goods/** - - /buyer/category/** - /buyer/store/** - - /buyer/connect/** + - /buyer/passport/connect/** - /buyer/members/** + - /buyer/passport/member/** - /buyer/promotion/pintuan/** - /buyer/promotion/seckill/** - /buyer/promotion/pointsGoods/** - /buyer/promotion/coupon - - /buyer/memberEvaluation/**/goodsEvaluation - - /buyer/memberEvaluation/**/evaluationNumber - - /buyer/appVersion/** + - /buyer/member/evaluation/**/goodsEvaluation + - /buyer/member/evaluation/**/evaluationNumber + - /buyer/other/appVersion/** - /buyer/broadcast/studio/** - - /store/login/** - - /manager/user/login - - /manager/user/refresh/** + - /manager/passport/user/login + - /manager/passport/user/refresh/** + - /manager/other/elasticsearch + - /manager/other/customWords - /druid/** - /swagger-ui.html - /doc.html @@ -183,7 +186,7 @@ mybatis-plus: logging: # 输出级别 level: - root: info + cn.lili: info # org.hibernate: debug # org.springframework: debug # org.springframework.data.mongodb.core: debug @@ -304,7 +307,6 @@ lili: notice-send-group: lili_send_notice_group rocketmq: name-server: 192.168.0.116:9876 - namesrvAddr: 192.168.0.116:9876 isVIPChannel: false producer: group: lili_group From fda3b5b1ccaed51ba8f0ad2a10583e895f31b811 Mon Sep 17 00:00:00 2001 From: Chopper Date: Tue, 15 Feb 2022 11:24:52 +0800 Subject: [PATCH 16/39] =?UTF-8?q?=E4=BC=9A=E5=91=98=E8=84=B1=E6=95=8F?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E4=B9=8B=E5=89=8D=E6=9C=89=E4=BA=BA?= =?UTF-8?q?=E6=81=B6=E6=84=8F=E8=81=94=E7=B3=BB=E6=B3=A8=E5=86=8C=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E3=80=82=20=E7=AE=A1=E7=90=86=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=BF=94=E5=9B=9EVO=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/application.yml | 2 +- .../java/cn/lili/modules/member/entity/vo/MemberVO.java | 8 ++++++++ .../cn/lili/modules/member/service/MemberService.java | 8 ++++++++ .../modules/member/serviceimpl/MemberServiceImpl.java | 5 +++++ .../lili/controller/passport/MemberManagerController.java | 4 ++-- manager-api/src/main/resources/application.yml | 5 +++++ 6 files changed, 29 insertions(+), 3 deletions(-) diff --git a/config/application.yml b/config/application.yml index d37dfac7..bdfc11d5 100644 --- a/config/application.yml +++ b/config/application.yml @@ -235,7 +235,7 @@ lili: # 0:不做脱敏处理 # 1:管理端用户手机号等信息脱敏 # 2:商家端信息脱敏(为2时,表示管理端,商家端同时脱敏) - # sensitiveLevel: 2 + sensitiveLevel: 1 statistics: # 在线人数统计 X 小时。这里设置48,即统计过去48小时每小时在线人数 diff --git a/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberVO.java b/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberVO.java index cf157d89..da37ff99 100644 --- a/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberVO.java +++ b/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberVO.java @@ -3,9 +3,12 @@ package cn.lili.modules.member.entity.vo; import cn.lili.common.enums.ClientTypeEnum; import cn.lili.common.security.sensitive.Sensitive; import cn.lili.common.security.sensitive.enums.SensitiveStrategy; +import cn.lili.common.utils.BeanUtil; +import cn.lili.modules.member.entity.dos.Member; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.NoArgsConstructor; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; @@ -16,6 +19,7 @@ import java.util.Date; * @since 2021/11/8 **/ @Data +@NoArgsConstructor public class MemberVO implements Serializable { private static final long serialVersionUID = 1810890757303309436L; @@ -27,6 +31,7 @@ public class MemberVO implements Serializable { private String username; @ApiModelProperty(value = "昵称") + @Sensitive(strategy = SensitiveStrategy.PHONE) private String nickName; @ApiModelProperty(value = "会员性别,1为男,0为女") @@ -89,4 +94,7 @@ public class MemberVO implements Serializable { @ApiModelProperty(value = "创建时间", hidden = true) private Date createTime; + public MemberVO(Member member) { + BeanUtil.copyProperties(member, this); + } } diff --git a/framework/src/main/java/cn/lili/modules/member/service/MemberService.java b/framework/src/main/java/cn/lili/modules/member/service/MemberService.java index e83b670f..f79a123f 100644 --- a/framework/src/main/java/cn/lili/modules/member/service/MemberService.java +++ b/framework/src/main/java/cn/lili/modules/member/service/MemberService.java @@ -145,6 +145,7 @@ public interface MemberService extends IService { */ IPage getMemberPage(MemberSearchVO memberSearchVO, PageVO page); + /** * 一键注册会员 * @@ -235,4 +236,11 @@ public interface MemberService extends IService { * @return 是否更新成功 */ boolean updateMemberLoginTime(String memberId); + + /** + * 获取用户VO + * @param id + * @return + */ + MemberVO getMember(String id); } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java index e0fef231..6bc75846 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java @@ -611,6 +611,11 @@ public class MemberServiceImpl extends ServiceImpl impleme return this.update(updateWrapper); } + @Override + public MemberVO getMember(String id) { + return new MemberVO(this.getById(id)); + } + /** * 检测会员 * diff --git a/manager-api/src/main/java/cn/lili/controller/passport/MemberManagerController.java b/manager-api/src/main/java/cn/lili/controller/passport/MemberManagerController.java index 6568257c..b64308d7 100644 --- a/manager-api/src/main/java/cn/lili/controller/passport/MemberManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/passport/MemberManagerController.java @@ -45,9 +45,9 @@ public class MemberManagerController { @ApiOperation(value = "通过ID获取会员信息") @ApiImplicitParam(name = "id", value = "会员ID", required = true, dataType = "String", paramType = "path") @GetMapping(value = "/{id}") - public ResultMessage get(@PathVariable String id) { + public ResultMessage get(@PathVariable String id) { - return ResultUtil.data(memberService.getById(id)); + return ResultUtil.data(memberService.getMember(id)); } @ApiOperation(value = "添加会员") diff --git a/manager-api/src/main/resources/application.yml b/manager-api/src/main/resources/application.yml index d7a1c56a..397323ae 100644 --- a/manager-api/src/main/resources/application.yml +++ b/manager-api/src/main/resources/application.yml @@ -182,6 +182,11 @@ jasypt: lili: system: isDemoSite: true + # 脱敏级别: + # 0:不做脱敏处理 + # 1:管理端用户手机号等信息脱敏 + # 2:商家端信息脱敏(为2时,表示管理端,商家端同时脱敏) + sensitiveLevel: 1 statistics: # 在线人数统计 X 小时。这里设置48,即统计过去48小时每小时在线人数 onlineMember: 48 From a5f924841a230f9883b23183dad8b04118138544 Mon Sep 17 00:00:00 2001 From: Chopper Date: Tue, 15 Feb 2022 11:38:41 +0800 Subject: [PATCH 17/39] =?UTF-8?q?=E4=BC=9A=E5=91=98=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=90=8D=E8=84=B1=E6=95=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/lili/modules/member/entity/vo/MemberVO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberVO.java b/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberVO.java index da37ff99..86945766 100644 --- a/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberVO.java +++ b/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberVO.java @@ -28,10 +28,10 @@ public class MemberVO implements Serializable { private String id; @ApiModelProperty(value = "会员用户名") + @Sensitive(strategy = SensitiveStrategy.USERNAME) private String username; @ApiModelProperty(value = "昵称") - @Sensitive(strategy = SensitiveStrategy.PHONE) private String nickName; @ApiModelProperty(value = "会员性别,1为男,0为女") From c5da640432a1dd6a649af05e9b9cb73770ccf0e0 Mon Sep 17 00:00:00 2001 From: Chopper Date: Tue, 15 Feb 2022 14:51:15 +0800 Subject: [PATCH 18/39] =?UTF-8?q?=E6=98=B5=E7=A7=B0=E5=92=8C=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=90=8D=E5=A6=82=E6=9E=9C=E7=94=A8=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=8F=B7=EF=BC=8C=E4=B9=9F=E8=BF=9B=E8=A1=8C=E8=84=B1=E6=95=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/lili/modules/member/entity/vo/MemberVO.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberVO.java b/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberVO.java index 86945766..395961de 100644 --- a/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberVO.java +++ b/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberVO.java @@ -28,10 +28,11 @@ public class MemberVO implements Serializable { private String id; @ApiModelProperty(value = "会员用户名") - @Sensitive(strategy = SensitiveStrategy.USERNAME) + @Sensitive(strategy = SensitiveStrategy.PHONE) private String username; @ApiModelProperty(value = "昵称") + @Sensitive(strategy = SensitiveStrategy.PHONE) private String nickName; @ApiModelProperty(value = "会员性别,1为男,0为女") From 0940d9aec8370deed85181c96ca97df359a98c45 Mon Sep 17 00:00:00 2001 From: paulGao Date: Tue, 15 Feb 2022 15:29:32 +0800 Subject: [PATCH 19/39] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=B7=E6=96=B0token?= =?UTF-8?q?=E7=99=BD=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer-api/src/main/resources/application.yml | 1 + config/application.yml | 2 ++ seller-api/src/main/resources/application.yml | 1 + 3 files changed, 4 insertions(+) diff --git a/buyer-api/src/main/resources/application.yml b/buyer-api/src/main/resources/application.yml index 4192a8ab..f3a7a5a6 100644 --- a/buyer-api/src/main/resources/application.yml +++ b/buyer-api/src/main/resources/application.yml @@ -137,6 +137,7 @@ ignored: - /buyer/passport/connect/** - /buyer/members/** - /buyer/passport/member/** + - /buyer/passport/member/refresh/** - /buyer/promotion/pintuan/** - /buyer/promotion/seckill/** - /buyer/promotion/pointsGoods/** diff --git a/config/application.yml b/config/application.yml index bdfc11d5..c4bb5b36 100644 --- a/config/application.yml +++ b/config/application.yml @@ -125,6 +125,7 @@ ignored: - /weixin/** - /source/** - /store/passport/login/** + - /store/passport/login/refresh/** - /common/common/slider/** - /common/common/sms/** - /buyer/payment/cashier/** @@ -135,6 +136,7 @@ ignored: - /buyer/passport/connect/** - /buyer/members/** - /buyer/passport/member/** + - /buyer/passport/member/refresh/** - /buyer/promotion/pintuan/** - /buyer/promotion/seckill/** - /buyer/promotion/pointsGoods/** diff --git a/seller-api/src/main/resources/application.yml b/seller-api/src/main/resources/application.yml index 7cdbb89d..7ba48b0d 100644 --- a/seller-api/src/main/resources/application.yml +++ b/seller-api/src/main/resources/application.yml @@ -120,6 +120,7 @@ ignored: - /weixin/** - /source/** - /store/passport/login/** + - /store/passport/login/refresh/** - /druid/** - /swagger-ui.html - /doc.html From e4e073b6f09673c8de9db0ff1a6dbe67a9fc6b33 Mon Sep 17 00:00:00 2001 From: paulGao Date: Tue, 15 Feb 2022 16:51:40 +0800 Subject: [PATCH 20/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=BB=A1=E4=BC=98?= =?UTF-8?q?=E6=83=A0=E6=B4=BB=E5=8A=A8=E6=90=9C=E7=B4=A2=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../promotion/entity/dto/search/FullDiscountSearchParams.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/promotion/entity/dto/search/FullDiscountSearchParams.java b/framework/src/main/java/cn/lili/modules/promotion/entity/dto/search/FullDiscountSearchParams.java index c49c8e24..3c8d2d5d 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/entity/dto/search/FullDiscountSearchParams.java +++ b/framework/src/main/java/cn/lili/modules/promotion/entity/dto/search/FullDiscountSearchParams.java @@ -34,7 +34,7 @@ public class FullDiscountSearchParams extends BasePromotionsSearchParams impleme public QueryWrapper queryWrapper() { QueryWrapper queryWrapper = super.queryWrapper(); if (CharSequenceUtil.isNotEmpty(promotionName)) { - queryWrapper.like("title", promotionName); + queryWrapper.like("promotion_name", promotionName); } if (couponFlag != null) { queryWrapper.eq("coupon_flag", couponFlag); From b32bf41443c73504c384921eccf57d72a7c44939 Mon Sep 17 00:00:00 2001 From: Chopper Date: Wed, 16 Feb 2022 17:42:12 +0800 Subject: [PATCH 21/39] =?UTF-8?q?=E6=B6=88=E8=B4=B9=E8=80=85=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= =?UTF-8?q?=EF=BC=9A=E5=8C=85=E5=90=AB=E7=B3=BB=E7=BB=9F=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=AF=84=E4=BB=B7=E9=97=AE=E9=A2=98=EF=BC=8C=E5=92=8C=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=96=B0=E5=A2=9E=E7=A7=92=E6=9D=80=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/promotion/PromotionEverydayExecute.java | 16 ++++++++++++---- .../serviceimpl/MemberEvaluationServiceImpl.java | 8 ++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java b/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java index d7a3db4c..3d9dc61a 100644 --- a/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java +++ b/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java @@ -44,10 +44,18 @@ public class PromotionEverydayExecute implements EveryDayExecute { */ @Override public void execute() { - //清除所以商品索引的无效促销活动 - this.esGoodsIndexService.cleanInvalidPromotion(); - //定时创建活动 - addSeckill(); + try { + //清除所有商品索引的无效促销活动 + this.esGoodsIndexService.cleanInvalidPromotion(); + } catch (Exception e) { + log.error("清楚商品索引中无效促销异常", e); + } + try { + //定时创建活动 + addSeckill(); + } catch (Exception e) { + log.error("秒杀活动添加异常", e); + } } diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java index 90f7c823..393a2339 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java @@ -112,11 +112,15 @@ public class MemberEvaluationServiceImpl extends ServiceImpl Date: Wed, 16 Feb 2022 17:48:29 +0800 Subject: [PATCH 22/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=92=E6=9D=80?= =?UTF-8?q?=E6=AF=8F=E6=97=A5=E6=B8=85=E9=99=A4=E6=97=A0=E6=95=88=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/modules/member/service/MemberService.java | 4 ++-- .../modules/search/serviceimpl/EsGoodsIndexServiceImpl.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/member/service/MemberService.java b/framework/src/main/java/cn/lili/modules/member/service/MemberService.java index f79a123f..d7115916 100644 --- a/framework/src/main/java/cn/lili/modules/member/service/MemberService.java +++ b/framework/src/main/java/cn/lili/modules/member/service/MemberService.java @@ -239,8 +239,8 @@ public interface MemberService extends IService { /** * 获取用户VO - * @param id - * @return + * @param id 会员id + * @return 用户VO */ MemberVO getMember(String id); } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java index 70f497f8..bc502171 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java @@ -535,7 +535,8 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements if (promotionMap != null && !promotionMap.isEmpty()) { //促销不为空则进行清洗 promotionMap.entrySet().removeIf(i -> { - BasePromotions promotion = (BasePromotions) i.getValue(); + JSONObject promotionJson = (JSONObject) i.getValue(); + BasePromotions promotion = promotionJson.toBean(BasePromotions.class); return promotion.getEndTime() != null && promotion.getEndTime().getTime() < DateUtil.date().getTime(); }); } From 0b5f830d7c244d702ec226c7d77520d8527bde45 Mon Sep 17 00:00:00 2001 From: Chopper Date: Wed, 16 Feb 2022 17:54:40 +0800 Subject: [PATCH 23/39] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=B3=A8=E8=A7=A3=E9=97=AE=E9=A2=98=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/lili/modules/store/service/FreightTemplateService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/store/service/FreightTemplateService.java b/framework/src/main/java/cn/lili/modules/store/service/FreightTemplateService.java index 7cebb983..c5d60b89 100644 --- a/framework/src/main/java/cn/lili/modules/store/service/FreightTemplateService.java +++ b/framework/src/main/java/cn/lili/modules/store/service/FreightTemplateService.java @@ -70,7 +70,7 @@ public interface FreightTemplateService extends IService { * @param id 运费模板ID * @return 操作状态 */ - @CacheEvict(key = "#freightTemplateVO.id") + @CacheEvict(key = "#id") boolean removeFreightTemplate(String id); } \ No newline at end of file From cd374f2d984d8b83d7105c80c34d0af53f2bc218 Mon Sep 17 00:00:00 2001 From: paulGao Date: Fri, 18 Feb 2022 15:38:58 +0800 Subject: [PATCH 24/39] =?UTF-8?q?=E5=85=B3=E9=97=ADconsumer=20spring=20sec?= =?UTF-8?q?urity=E8=BA=AB=E4=BB=BD=E9=AA=8C=E8=AF=81=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lili/sucurity/ConsumerSecurityConfig.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 consumer/src/main/java/cn/lili/sucurity/ConsumerSecurityConfig.java diff --git a/consumer/src/main/java/cn/lili/sucurity/ConsumerSecurityConfig.java b/consumer/src/main/java/cn/lili/sucurity/ConsumerSecurityConfig.java new file mode 100644 index 00000000..761290bd --- /dev/null +++ b/consumer/src/main/java/cn/lili/sucurity/ConsumerSecurityConfig.java @@ -0,0 +1,18 @@ +package cn.lili.sucurity; + +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.stereotype.Component; + +/** + * @author paulG + * @since 2022/2/18 + **/ +@Component +public class ConsumerSecurityConfig extends WebSecurityConfigurerAdapter { + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.formLogin().disable(); + } +} From f555f6423a18e2892a618cb6327cbcc9f126bda5 Mon Sep 17 00:00:00 2001 From: paulGao Date: Fri, 18 Feb 2022 20:26:35 +0800 Subject: [PATCH 25/39] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=A7=92=E6=9D=80=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handler/impl/promotion/PromotionEverydayExecute.java | 6 ++++-- .../java/cn/lili/modules/promotion/entity/dos/Seckill.java | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java b/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java index 3d9dc61a..970ff34d 100644 --- a/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java +++ b/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java @@ -62,14 +62,16 @@ public class PromotionEverydayExecute implements EveryDayExecute { /** * 添加秒杀活动 * 从系统设置中获取秒杀活动的配置 - * 添加30天后的秒杀活动 + * 添加明天后的秒杀活动 */ private void addSeckill() { Setting setting = settingService.get(SettingEnum.SECKILL_SETTING.name()); SeckillSetting seckillSetting = new Gson().fromJson(setting.getSettingValue(), SeckillSetting.class); + log.info("生成秒杀活动设置:{}", seckillSetting); for (int i = 1; i <= SeckillService.PRE_CREATION; i++) { Seckill seckill = new Seckill(i, seckillSetting.getHours(), seckillSetting.getSeckillRule()); - seckillService.savePromotions(seckill); + boolean result = seckillService.savePromotions(seckill); + log.info("生成秒杀活动参数:{},结果:{}", seckill, result); } } } diff --git a/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java b/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java index fbe4232d..c15d19e2 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java +++ b/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java @@ -1,6 +1,5 @@ package cn.lili.modules.promotion.entity.dos; -import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.lili.modules.promotion.entity.vos.SeckillVO; @@ -59,8 +58,8 @@ public class Seckill extends BasePromotions { public Seckill(int day, String hours, String seckillRule) { //默认创建*天后的秒杀活动 - DateTime dateTime = DateUtil.beginOfDay(DateUtil.offset(new DateTime(), DateField.DAY_OF_YEAR, day)); - this.applyEndTime = dateTime; + DateTime dateTime = DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), day)); + this.applyEndTime = DateUtil.offsetHour(new Date(), Integer.parseInt(hours) - 1); this.hours = hours; this.seckillRule = seckillRule; this.goodsNum = 0; From d95fce2efbb1231b5fcfe4512baa815bc9e61c37 Mon Sep 17 00:00:00 2001 From: Chopper Date: Mon, 21 Feb 2022 10:57:57 +0800 Subject: [PATCH 26/39] =?UTF-8?q?=E6=B3=A8=E8=A7=A3=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/aftersale/serviceimpl/AfterSaleServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java index d86fee45..fa73ff32 100644 --- a/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java @@ -273,9 +273,9 @@ public class AfterSaleServiceImpl extends ServiceImpl Date: Mon, 21 Feb 2022 12:03:07 +0800 Subject: [PATCH 27/39] =?UTF-8?q?=E4=BC=98=E5=8C=96rocketmq=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=88=B0logback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/lili/BuyerApiApplication.java | 1 + buyer-api/src/main/resources/logback-spring.xml | 17 +++++++++++++++++ .../main/java/cn/lili/CommonApiApplication.java | 1 + .../src/main/resources/logback-spring.xml | 16 ++++++++++++++++ .../main/java/cn/lili/ConsumerApplication.java | 1 + consumer/src/main/resources/logback-spring.xml | 16 ++++++++++++++++ .../java/cn/lili/ManagerApiApplication.java | 1 + .../src/main/resources/logback-spring.xml | 16 ++++++++++++++++ .../main/java/cn/lili/StoreApiApplication.java | 2 +- .../src/main/resources/logback-spring.xml | 16 ++++++++++++++++ 10 files changed, 86 insertions(+), 1 deletion(-) diff --git a/buyer-api/src/main/java/cn/lili/BuyerApiApplication.java b/buyer-api/src/main/java/cn/lili/BuyerApiApplication.java index fd8fe5d7..c10d84f6 100644 --- a/buyer-api/src/main/java/cn/lili/BuyerApiApplication.java +++ b/buyer-api/src/main/java/cn/lili/BuyerApiApplication.java @@ -29,6 +29,7 @@ public class BuyerApiApplication { public static void main(String[] args) { System.setProperty("es.set.netty.runtime.available.processors", "false"); + System.setProperty("rocketmq.client.logUseSlf4j","true"); SpringApplication.run(BuyerApiApplication.class, args); } } diff --git a/buyer-api/src/main/resources/logback-spring.xml b/buyer-api/src/main/resources/logback-spring.xml index a8d0eba6..f2904dd8 100644 --- a/buyer-api/src/main/resources/logback-spring.xml +++ b/buyer-api/src/main/resources/logback-spring.xml @@ -20,6 +20,23 @@ + + ${LOG_FILE_PATH}/rocketmq.log + + ${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log + 30 + 30MB + + + %d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n + + + + + + + + diff --git a/common-api/src/main/java/cn/lili/CommonApiApplication.java b/common-api/src/main/java/cn/lili/CommonApiApplication.java index ceeefb59..b338c74e 100644 --- a/common-api/src/main/java/cn/lili/CommonApiApplication.java +++ b/common-api/src/main/java/cn/lili/CommonApiApplication.java @@ -15,6 +15,7 @@ import org.springframework.cache.annotation.EnableCaching; public class CommonApiApplication { public static void main(String[] args) { + System.setProperty("rocketmq.client.logUseSlf4j","true"); SpringApplication.run(CommonApiApplication.class, args); } diff --git a/common-api/src/main/resources/logback-spring.xml b/common-api/src/main/resources/logback-spring.xml index a8d0eba6..b7c9425a 100644 --- a/common-api/src/main/resources/logback-spring.xml +++ b/common-api/src/main/resources/logback-spring.xml @@ -20,6 +20,22 @@ + + ${LOG_FILE_PATH}/rocketmq.log + + ${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log + 30 + 30MB + + + %d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n + + + + + + + diff --git a/consumer/src/main/java/cn/lili/ConsumerApplication.java b/consumer/src/main/java/cn/lili/ConsumerApplication.java index 5b0ef78c..7b695512 100644 --- a/consumer/src/main/java/cn/lili/ConsumerApplication.java +++ b/consumer/src/main/java/cn/lili/ConsumerApplication.java @@ -14,6 +14,7 @@ public class ConsumerApplication { public static void main(String[] args) { System.setProperty("es.set.netty.runtime.available.processors", "false"); + System.setProperty("rocketmq.client.logUseSlf4j","true"); SpringApplication.run(ConsumerApplication.class, args); } diff --git a/consumer/src/main/resources/logback-spring.xml b/consumer/src/main/resources/logback-spring.xml index a8d0eba6..b7c9425a 100644 --- a/consumer/src/main/resources/logback-spring.xml +++ b/consumer/src/main/resources/logback-spring.xml @@ -20,6 +20,22 @@ + + ${LOG_FILE_PATH}/rocketmq.log + + ${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log + 30 + 30MB + + + %d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n + + + + + + + diff --git a/manager-api/src/main/java/cn/lili/ManagerApiApplication.java b/manager-api/src/main/java/cn/lili/ManagerApiApplication.java index 838bda79..f5e557ab 100644 --- a/manager-api/src/main/java/cn/lili/ManagerApiApplication.java +++ b/manager-api/src/main/java/cn/lili/ManagerApiApplication.java @@ -28,6 +28,7 @@ public class ManagerApiApplication { public static void main(String[] args) { System.setProperty("es.set.netty.runtime.available.processors", "false"); + System.setProperty("rocketmq.client.logUseSlf4j","true"); SpringApplication.run(ManagerApiApplication.class, args); } diff --git a/manager-api/src/main/resources/logback-spring.xml b/manager-api/src/main/resources/logback-spring.xml index a8d0eba6..b7c9425a 100644 --- a/manager-api/src/main/resources/logback-spring.xml +++ b/manager-api/src/main/resources/logback-spring.xml @@ -20,6 +20,22 @@ + + ${LOG_FILE_PATH}/rocketmq.log + + ${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log + 30 + 30MB + + + %d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n + + + + + + + diff --git a/seller-api/src/main/java/cn/lili/StoreApiApplication.java b/seller-api/src/main/java/cn/lili/StoreApiApplication.java index b2f3f73c..284df1b6 100644 --- a/seller-api/src/main/java/cn/lili/StoreApiApplication.java +++ b/seller-api/src/main/java/cn/lili/StoreApiApplication.java @@ -28,7 +28,7 @@ public class StoreApiApplication { } public static void main(String[] args) { - + System.setProperty("rocketmq.client.logUseSlf4j","true"); System.setProperty("es.set.netty.runtime.available.processors", "false"); SpringApplication.run(StoreApiApplication.class, args); } diff --git a/seller-api/src/main/resources/logback-spring.xml b/seller-api/src/main/resources/logback-spring.xml index a8d0eba6..b7c9425a 100644 --- a/seller-api/src/main/resources/logback-spring.xml +++ b/seller-api/src/main/resources/logback-spring.xml @@ -20,6 +20,22 @@ + + ${LOG_FILE_PATH}/rocketmq.log + + ${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log + 30 + 30MB + + + %d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n + + + + + + + From 961ac2021365ec7bab4ea7c6c438b7d6295c52d9 Mon Sep 17 00:00:00 2001 From: Chopper Date: Mon, 21 Feb 2022 22:59:55 +0800 Subject: [PATCH 28/39] =?UTF-8?q?=E6=9B=B4=E6=96=B0IM=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/lili/controller/common/IMController.java | 2 +- .../java/cn/lili/modules/system/entity/dto/ImSetting.java | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/common-api/src/main/java/cn/lili/controller/common/IMController.java b/common-api/src/main/java/cn/lili/controller/common/IMController.java index 8111f9c4..7b17801e 100644 --- a/common-api/src/main/java/cn/lili/controller/common/IMController.java +++ b/common-api/src/main/java/cn/lili/controller/common/IMController.java @@ -39,7 +39,7 @@ public class IMController { try { Setting imSettingVal = settingService.get(SettingEnum.IM_SETTING.name()); ImSetting imSetting = JSONUtil.toBean(imSettingVal.getSettingValue(), ImSetting.class); - imUrl = imSetting.getHttpUrl() + "?tenant_id=" + imSetting.getTenantId()+"&merchant_euid="; + imUrl = imSetting.getHttpUrl(); } catch (Exception e) { throw new ServiceException(ResultCode.PLATFORM_NOT_SUPPORTED_IM); } diff --git a/framework/src/main/java/cn/lili/modules/system/entity/dto/ImSetting.java b/framework/src/main/java/cn/lili/modules/system/entity/dto/ImSetting.java index 4ba51a1e..b3c644ae 100644 --- a/framework/src/main/java/cn/lili/modules/system/entity/dto/ImSetting.java +++ b/framework/src/main/java/cn/lili/modules/system/entity/dto/ImSetting.java @@ -19,8 +19,4 @@ public class ImSetting implements Serializable { private String httpUrl; - @ApiModelProperty(value = "平台ID") - private String tenantId; - - } From 7d67e6a007c1cd4a68aafbebfdc581d594604211 Mon Sep 17 00:00:00 2001 From: paulGao Date: Tue, 22 Feb 2022 22:37:51 +0800 Subject: [PATCH 29/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=92=E6=9D=80?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/lili/modules/promotion/entity/dos/Seckill.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java b/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java index c15d19e2..f80c4b77 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java +++ b/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java @@ -59,7 +59,7 @@ public class Seckill extends BasePromotions { public Seckill(int day, String hours, String seckillRule) { //默认创建*天后的秒杀活动 DateTime dateTime = DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), day)); - this.applyEndTime = DateUtil.offsetHour(new Date(), Integer.parseInt(hours) - 1); + this.applyEndTime = dateTime; this.hours = hours; this.seckillRule = seckillRule; this.goodsNum = 0; From 6115ecf6734642d5c0470d344a99f0a1338220ec Mon Sep 17 00:00:00 2001 From: Chopper Date: Wed, 23 Feb 2022 14:38:23 +0800 Subject: [PATCH 30/39] =?UTF-8?q?=E7=A7=92=E6=9D=80=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=96=B0=E5=A2=9Ebug=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/promotion/PromotionEverydayExecute.java | 11 +++++++++-- .../cn/lili/modules/promotion/entity/dos/Seckill.java | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java b/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java index 970ff34d..c67ef4fe 100644 --- a/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java +++ b/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java @@ -8,6 +8,7 @@ import cn.lili.modules.system.entity.dto.SeckillSetting; import cn.lili.modules.system.entity.enums.SettingEnum; import cn.lili.modules.system.service.SettingService; import cn.lili.timetask.handler.EveryDayExecute; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.google.gson.Gson; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -70,8 +71,14 @@ public class PromotionEverydayExecute implements EveryDayExecute { log.info("生成秒杀活动设置:{}", seckillSetting); for (int i = 1; i <= SeckillService.PRE_CREATION; i++) { Seckill seckill = new Seckill(i, seckillSetting.getHours(), seckillSetting.getSeckillRule()); - boolean result = seckillService.savePromotions(seckill); - log.info("生成秒杀活动参数:{},结果:{}", seckill, result); + + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(Seckill::getStartTime, seckill.getStartTime()); + //如果已经存在促销,则不再次保存 + if (seckillService.list(lambdaQueryWrapper).size() == 0) { + boolean result = seckillService.savePromotions(seckill); + log.info("生成秒杀活动参数:{},结果:{}", seckill, result); + } } } } diff --git a/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java b/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java index c15d19e2..f80c4b77 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java +++ b/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java @@ -59,7 +59,7 @@ public class Seckill extends BasePromotions { public Seckill(int day, String hours, String seckillRule) { //默认创建*天后的秒杀活动 DateTime dateTime = DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), day)); - this.applyEndTime = DateUtil.offsetHour(new Date(), Integer.parseInt(hours) - 1); + this.applyEndTime = dateTime; this.hours = hours; this.seckillRule = seckillRule; this.goodsNum = 0; From 63b84ee69d6693fdeade17ead67da9835f0b0613 Mon Sep 17 00:00:00 2001 From: Chopper Date: Wed, 23 Feb 2022 16:23:00 +0800 Subject: [PATCH 31/39] =?UTF-8?q?=E6=95=8F=E6=84=9F=E8=AF=8D=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=9E=81=E7=AB=AF=E6=83=85=E5=86=B5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/common/sensitive/SensitiveWordsFilter.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framework/src/main/java/cn/lili/common/sensitive/SensitiveWordsFilter.java b/framework/src/main/java/cn/lili/common/sensitive/SensitiveWordsFilter.java index 14f70b0c..99acf87e 100644 --- a/framework/src/main/java/cn/lili/common/sensitive/SensitiveWordsFilter.java +++ b/framework/src/main/java/cn/lili/common/sensitive/SensitiveWordsFilter.java @@ -77,6 +77,11 @@ public class SensitiveWordsFilter implements Serializable { int step = 1; //计算此位置开始2个字符的hash int hash = sp.nextTwoCharHash(i); + + //如果没有敏感词,则直接返回内容 + if (nodes.length == 0) { + return sentence; + } /* * 根据hash获取第一个节点, * 真正匹配的节点可能不是第一个, From 627a1d7d5ad2f351c93588875080b1cb5dd37412 Mon Sep 17 00:00:00 2001 From: paulGao Date: Thu, 24 Feb 2022 09:33:36 +0800 Subject: [PATCH 32/39] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/application.yml | 2 ++ .../handler/impl/promotion/PromotionEverydayExecute.java | 2 +- .../modules/search/serviceimpl/EsGoodsIndexServiceImpl.java | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/application.yml b/config/application.yml index c4bb5b36..327cf008 100644 --- a/config/application.yml +++ b/config/application.yml @@ -307,6 +307,8 @@ lili: notice-group: lili_notice_group notice-send-topic: lili_send_notice_topic notice-send-group: lili_send_notice_group + after-sale-topic: lili_after_sale_topic + after-sale-group: lili_after_sale_group rocketmq: name-server: 192.168.0.116:9876 isVIPChannel: false diff --git a/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java b/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java index c67ef4fe..98cdea1c 100644 --- a/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java +++ b/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java @@ -75,7 +75,7 @@ public class PromotionEverydayExecute implements EveryDayExecute { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(Seckill::getStartTime, seckill.getStartTime()); //如果已经存在促销,则不再次保存 - if (seckillService.list(lambdaQueryWrapper).size() == 0) { + if (seckillService.list(lambdaQueryWrapper).isEmpty()) { boolean result = seckillService.savePromotions(seckill); log.info("生成秒杀活动参数:{},结果:{}", seckill, result); } diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java index bc502171..9eacac60 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java @@ -535,7 +535,7 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements if (promotionMap != null && !promotionMap.isEmpty()) { //促销不为空则进行清洗 promotionMap.entrySet().removeIf(i -> { - JSONObject promotionJson = (JSONObject) i.getValue(); + JSONObject promotionJson = JSONUtil.parseObj(i.getValue()); BasePromotions promotion = promotionJson.toBean(BasePromotions.class); return promotion.getEndTime() != null && promotion.getEndTime().getTime() < DateUtil.date().getTime(); }); From 7358fd0c23d0db092366385bcdb4fb49e6d8a337 Mon Sep 17 00:00:00 2001 From: paulGao Date: Fri, 25 Feb 2022 16:23:35 +0800 Subject: [PATCH 33/39] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=95=86=E5=93=81=E6=97=B6=EF=BC=8C=E6=97=A0=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=E6=97=B6=E5=88=9D=E5=A7=8B=E5=8C=96=E7=B4=A2?= =?UTF-8?q?=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/serviceimpl/EsGoodsSearchServiceImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java index 29e58226..afbab567 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java @@ -14,6 +14,7 @@ import cn.lili.modules.search.entity.dto.EsGoodsSearchDTO; import cn.lili.modules.search.entity.dto.HotWordsDTO; import cn.lili.modules.search.entity.dto.ParamOptions; import cn.lili.modules.search.entity.dto.SelectorOptions; +import cn.lili.modules.search.service.EsGoodsIndexService; import cn.lili.modules.search.service.EsGoodsSearchService; import com.alibaba.druid.util.StringUtils; import lombok.extern.slf4j.Slf4j; @@ -74,6 +75,9 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService { @Autowired @Qualifier("elasticsearchRestTemplate") private ElasticsearchRestTemplate restTemplate; + + @Autowired + private EsGoodsIndexService esGoodsIndexService; /** * 缓存 */ @@ -82,6 +86,10 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService { @Override public SearchPage searchGoods(EsGoodsSearchDTO searchDTO, PageVO pageVo) { + boolean exists = restTemplate.indexOps(EsGoodsIndex.class).exists(); + if (!exists) { + esGoodsIndexService.init(); + } if (CharSequenceUtil.isNotEmpty(searchDTO.getKeyword())) { cache.incrementScore(CachePrefix.HOT_WORD.getPrefix(), searchDTO.getKeyword()); } From e27185d424ee14e0390b67d975e54dba68bc76dd Mon Sep 17 00:00:00 2001 From: paulGao Date: Tue, 1 Mar 2022 11:49:35 +0800 Subject: [PATCH 34/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=AA=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E7=9A=84=E7=A7=92=E6=9D=80=E6=B4=BB=E5=8A=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=97=B6=EF=BC=8C=E5=85=88=E6=B7=BB=E5=8A=A0=E7=A7=92?= =?UTF-8?q?=E6=9D=80=E5=95=86=E5=93=81=E5=90=8E=E4=BF=AE=E6=94=B9=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=97=B6=EF=BC=8C=E7=A7=92=E6=9D=80=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E5=95=86=E5=93=81=E6=97=B6=E9=97=B4=E6=B2=A1=E6=9C=89=E6=94=B9?= =?UTF-8?q?=E5=8F=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/SeckillApplyService.java | 9 +++++ .../serviceimpl/SeckillApplyServiceImpl.java | 37 +++++++++++++++++++ .../serviceimpl/SeckillServiceImpl.java | 19 ++++++++++ 3 files changed, 65 insertions(+) diff --git a/framework/src/main/java/cn/lili/modules/promotion/service/SeckillApplyService.java b/framework/src/main/java/cn/lili/modules/promotion/service/SeckillApplyService.java index 99b60133..8d67dd74 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/service/SeckillApplyService.java +++ b/framework/src/main/java/cn/lili/modules/promotion/service/SeckillApplyService.java @@ -1,6 +1,7 @@ package cn.lili.modules.promotion.service; import cn.lili.common.vo.PageVO; +import cn.lili.modules.promotion.entity.dos.Seckill; import cn.lili.modules.promotion.entity.dos.SeckillApply; import cn.lili.modules.promotion.entity.dto.search.SeckillSearchParams; import cn.lili.modules.promotion.entity.vos.SeckillApplyVO; @@ -97,4 +98,12 @@ public interface SeckillApplyService extends IService { */ void updateSeckillApplyQuantity(String seckillId, String skuId, Integer quantity); + /** + * 更新秒杀活动时间 + * + * @param seckill 秒杀活动 + * @return 是否更新成功 + */ + boolean updateSeckillApplyTime(Seckill seckill); + } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java index a421e9e6..66071234 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java @@ -185,6 +185,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl promotionGoodsList = new ArrayList<>(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(SeckillApply::getSeckillId, seckill.getId()); + List list = this.list(queryWrapper); + for (SeckillApply seckillApply : list) { + //获取参与活动的商品信息 + GoodsSku goodsSku = goodsSkuService.getGoodsSkuByIdFromCache(seckillApply.getSkuId()); + //获取促销商品 + PromotionGoods promotionGoods = this.setSeckillGoods(goodsSku, seckillApply, seckill); + promotionGoodsList.add(promotionGoods); + } + //保存促销活动商品信息 + if (!promotionGoodsList.isEmpty()) { + PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams(); + searchParams.setPromotionType(PromotionTypeEnum.SECKILL.name()); + searchParams.setSkuIds(promotionGoodsList.stream().map(PromotionGoods::getSkuId).collect(Collectors.toList())); + promotionGoodsService.deletePromotionGoods(searchParams); + //初始化促销商品 + PromotionTools.promotionGoodsInit(promotionGoodsList, seckill, PromotionTypeEnum.SECKILL); + result = promotionGoodsService.saveBatch(promotionGoodsList); + this.seckillService.updateEsGoodsSeckill(seckill, list); + } + return result; + } + /** * 检查秒杀活动申请列表参数信息 * diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java index 7d9619db..8b092527 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java @@ -131,12 +131,31 @@ public class SeckillServiceImpl extends AbstractPromotionsServiceImpl seckillApplies) { if (seckillApplies != null && !seckillApplies.isEmpty()) { // 更新促销范围 From c4307aa82197f37febf1be03e6f546d1742106d9 Mon Sep 17 00:00:00 2001 From: paulGao Date: Wed, 2 Mar 2022 11:49:41 +0800 Subject: [PATCH 35/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=92=E6=9D=80?= =?UTF-8?q?=E5=95=86=E5=93=81=E4=B8=8B=E5=8D=95=E6=97=B6=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E6=9B=B4=E6=96=B0=E7=A7=92=E6=9D=80=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=9A=84=E5=87=BA=E5=94=AE=E6=95=B0=E9=87=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lili/event/impl/StockUpdateExecute.java | 2 +- .../order/cart/entity/dto/TradeDTO.java | 1 - .../cart/render/impl/CheckDataRender.java | 2 +- .../order/order/entity/vo/ReceiptVO.java | 6 ++- .../service/PromotionGoodsService.java | 7 +--- .../service/SeckillApplyService.java | 6 +-- .../PromotionGoodsServiceImpl.java | 40 +++++++++---------- .../serviceimpl/SeckillApplyServiceImpl.java | 8 ++-- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/consumer/src/main/java/cn/lili/event/impl/StockUpdateExecute.java b/consumer/src/main/java/cn/lili/event/impl/StockUpdateExecute.java index ab9f5d63..77806014 100644 --- a/consumer/src/main/java/cn/lili/event/impl/StockUpdateExecute.java +++ b/consumer/src/main/java/cn/lili/event/impl/StockUpdateExecute.java @@ -332,7 +332,7 @@ public class StockUpdateExecute implements OrderStatusChangeEvent { Integer num = promotionGoods.get(i).getNum(); promotionGoods.get(i).setNum((num != null ? num : 0) + order.getOrder().getGoodsNum()); } - promotionGoodsService.updateBatchById(promotionGoods); + promotionGoodsService.updatePromotionGoodsStock(promotionGoods); } //商品库存,包含sku库存集合,批量更新商品库存相关 goodsSkuService.updateGoodsStuck(goodsSkus); diff --git a/framework/src/main/java/cn/lili/modules/order/cart/entity/dto/TradeDTO.java b/framework/src/main/java/cn/lili/modules/order/cart/entity/dto/TradeDTO.java index 36f84b7f..e05113b1 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/entity/dto/TradeDTO.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/entity/dto/TradeDTO.java @@ -139,7 +139,6 @@ public class TradeDTO implements Serializable { this.cartList = new ArrayList<>(); this.skuPromotionDetail = new HashMap<>(); this.storeCoupons = new HashMap<>(); - this.storeCoupons = new HashMap<>(); this.priceDetailDTO = new PriceDetailDTO(); this.cantUseCoupons = new ArrayList<>(); this.canUseCoupons = new ArrayList<>(); diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CheckDataRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CheckDataRender.java index 8012158f..58ca809d 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CheckDataRender.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CheckDataRender.java @@ -193,7 +193,7 @@ public class CheckDataRender implements CartRenderStep { } } //积分商品,判断用户积分是否满足 - } else if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.POINTS) && tradeDTO.getSkuList().get(0).getPromotionMap() != null && !tradeDTO.getSkuList().get(0).getPromotionMap().isEmpty()) { + } else if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.POINTS) && tradeDTO.getSkuList().get(0).getPromotionMap() != null && !tradeDTO.getSkuList().get(0).getPromotionMap().isEmpty()) { //获取积分商品VO Optional> pointsPromotions = tradeDTO.getSkuList().get(0).getPromotionMap().entrySet().stream().filter(i -> i.getKey().contains(PromotionTypeEnum.POINTS_GOODS.name())).findFirst(); if (pointsPromotions.isPresent()) { diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/vo/ReceiptVO.java b/framework/src/main/java/cn/lili/modules/order/order/entity/vo/ReceiptVO.java index ad7b73ce..6047ea88 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/vo/ReceiptVO.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/vo/ReceiptVO.java @@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.io.Serializable; + /** * 发票 * @@ -12,8 +14,10 @@ import lombok.Data; */ @Data @ApiModel(value = "发票") -public class ReceiptVO { +public class ReceiptVO implements Serializable { + private static final long serialVersionUID = -8402457457074092957L; + @ApiModelProperty(value = "发票抬头") private String receiptTitle; diff --git a/framework/src/main/java/cn/lili/modules/promotion/service/PromotionGoodsService.java b/framework/src/main/java/cn/lili/modules/promotion/service/PromotionGoodsService.java index f019298b..58a80e00 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/service/PromotionGoodsService.java +++ b/framework/src/main/java/cn/lili/modules/promotion/service/PromotionGoodsService.java @@ -121,12 +121,9 @@ public interface PromotionGoodsService extends IService { /** * 更新促销活动商品库存 * - * @param typeEnum 促销商品类型 - * @param promotionId 促销活动id - * @param skuId 商品skuId - * @param quantity 更新后的库存数量 + * @param promotionGoodsList 更新促销活动商品信息 */ - void updatePromotionGoodsStock(PromotionTypeEnum typeEnum, String promotionId, String skuId, Integer quantity); + void updatePromotionGoodsStock(List promotionGoodsList); /** * 更新促销活动商品索引 diff --git a/framework/src/main/java/cn/lili/modules/promotion/service/SeckillApplyService.java b/framework/src/main/java/cn/lili/modules/promotion/service/SeckillApplyService.java index 8d67dd74..f674b489 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/service/SeckillApplyService.java +++ b/framework/src/main/java/cn/lili/modules/promotion/service/SeckillApplyService.java @@ -90,13 +90,13 @@ public interface SeckillApplyService extends IService { void removeSeckillApply(String seckillId, String id); /** - * 更新秒杀商品库存 + * 更新秒杀商品出售数量 * * @param seckillId 秒杀活动id * @param skuId 商品skuId - * @param quantity 库存 + * @param saleNum 出售数量 */ - void updateSeckillApplyQuantity(String seckillId, String skuId, Integer quantity); + void updateSeckillApplySaleNum(String seckillId, String skuId, Integer saleNum); /** * 更新秒杀活动时间 diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionGoodsServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionGoodsServiceImpl.java index e3846103..21917405 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionGoodsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionGoodsServiceImpl.java @@ -3,8 +3,6 @@ package cn.lili.modules.promotion.serviceimpl; import cn.hutool.core.convert.Convert; import cn.hutool.core.text.CharSequenceUtil; import cn.lili.common.enums.PromotionTypeEnum; -import cn.lili.common.enums.ResultCode; -import cn.lili.common.exception.ServiceException; import cn.lili.common.vo.PageVO; import cn.lili.modules.goods.entity.dos.GoodsSku; import cn.lili.modules.goods.service.GoodsSkuService; @@ -27,6 +25,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Arrays; @@ -209,31 +208,32 @@ public class PromotionGoodsServiceImpl extends ServiceImpl promotionGoodsList) { + for (PromotionGoods promotionGoods : promotionGoodsList) { + String promotionStockKey = PromotionGoodsService.getPromotionGoodsStockCacheKey(PromotionTypeEnum.valueOf(promotionGoods.getPromotionType()), promotionGoods.getPromotionId(), promotionGoods.getSkuId()); + if (promotionGoods.getPromotionType().equals(PromotionTypeEnum.SECKILL.name())) { + SeckillSearchParams searchParams = new SeckillSearchParams(); + searchParams.setSeckillId(promotionGoods.getPromotionId()); + searchParams.setSkuId(promotionGoods.getSkuId()); + SeckillApply seckillApply = this.seckillApplyService.getSeckillApply(searchParams); + if (seckillApply != null) { + seckillApplyService.updateSeckillApplySaleNum(promotionGoods.getPromotionId(), promotionGoods.getSkuId(), promotionGoods.getNum()); + } } - seckillApplyService.updateSeckillApplyQuantity(promotionId, skuId, quantity); - } else { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); - updateWrapper.eq(PromotionGoods::getPromotionType, typeEnum.name()).eq(PromotionGoods::getPromotionId, promotionId).eq(PromotionGoods::getSkuId, skuId); - updateWrapper.set(PromotionGoods::getQuantity, quantity); + updateWrapper.eq(PromotionGoods::getPromotionType, promotionGoods.getPromotionType()).eq(PromotionGoods::getPromotionId, promotionGoods.getPromotionId()).eq(PromotionGoods::getSkuId, promotionGoods.getSkuId()); + updateWrapper.set(PromotionGoods::getQuantity, promotionGoods.getQuantity()).set(PromotionGoods::getNum, promotionGoods.getNum()); + this.update(updateWrapper); + stringRedisTemplate.opsForValue().set(promotionStockKey, promotionGoods.getQuantity().toString()); } - stringRedisTemplate.opsForValue().set(promotionStockKey, quantity.toString()); + } /** diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java index 66071234..633e453f 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java @@ -231,17 +231,17 @@ public class SeckillApplyServiceImpl extends ServiceImpl updateWrapper = new LambdaUpdateWrapper<>(); updateWrapper.eq(SeckillApply::getSeckillId, seckillId).eq(SeckillApply::getSkuId, skuId); - updateWrapper.set(SeckillApply::getQuantity, quantity); + updateWrapper.set(SeckillApply::getSalesNum, saleNum); this.update(updateWrapper); } From 3506e1c73822b5b31a5057e37d73e73536fdbbf8 Mon Sep 17 00:00:00 2001 From: paulGao Date: Wed, 2 Mar 2022 20:26:50 +0800 Subject: [PATCH 36/39] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E4=BF=83=E9=94=80=E5=95=86=E5=93=81=E5=BA=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/common/enums/ResultCode.java | 1 + .../cart/render/impl/SkuPromotionRender.java | 69 +++++++++++++++++++ .../order/cart/service/CartServiceImpl.java | 1 + .../modules/promotion/entity/dos/Seckill.java | 2 + .../serviceimpl/PromotionServiceImpl.java | 15 ++-- .../serviceimpl/SeckillApplyServiceImpl.java | 6 +- 6 files changed, 82 insertions(+), 12 deletions(-) diff --git a/framework/src/main/java/cn/lili/common/enums/ResultCode.java b/framework/src/main/java/cn/lili/common/enums/ResultCode.java index b335862d..7b61c34f 100644 --- a/framework/src/main/java/cn/lili/common/enums/ResultCode.java +++ b/framework/src/main/java/cn/lili/common/enums/ResultCode.java @@ -246,6 +246,7 @@ public enum ResultCode { * 活动 */ PROMOTION_GOODS_NOT_EXIT(40000, "当前促销商品不存在!"), + PROMOTION_GOODS_QUANTITY_NOT_EXIT(40020, "当前促销商品库存不足!"), PROMOTION_SAME_ACTIVE_EXIST(40001, "活动时间内已存在同类活动,请选择关闭、删除当前时段的活动"), PROMOTION_START_TIME_ERROR(40002, "活动起始时间不能小于当前时间"), PROMOTION_END_TIME_ERROR(40003, "活动结束时间不能小于当前时间"), diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java index cfcfe37b..3350fda6 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java @@ -2,6 +2,7 @@ package cn.lili.modules.order.cart.render.impl; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; +import cn.lili.cache.Cache; import cn.lili.common.enums.PromotionTypeEnum; import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; @@ -19,10 +20,14 @@ import cn.lili.modules.promotion.entity.dto.search.KanjiaActivitySearchParams; import cn.lili.modules.promotion.entity.enums.KanJiaStatusEnum; import cn.lili.modules.promotion.entity.vos.PromotionSkuVO; import cn.lili.modules.promotion.entity.vos.kanjia.KanjiaActivityVO; +import cn.lili.modules.promotion.service.KanjiaActivityGoodsService; import cn.lili.modules.promotion.service.KanjiaActivityService; +import cn.lili.modules.promotion.service.PointsGoodsService; +import cn.lili.modules.promotion.service.PromotionGoodsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; import java.util.Map; import java.util.Objects; @@ -39,9 +44,24 @@ public class SkuPromotionRender implements CartRenderStep { @Autowired private KanjiaActivityService kanjiaActivityService; + @Autowired + private KanjiaActivityGoodsService kanjiaActivityGoodsService; + + @Autowired + private PointsGoodsService pointsGoodsService; + + /** + * 促销商品 + */ + @Autowired + private PromotionGoodsService promotionGoodsService; + @Autowired private MemberService memberService; + @Autowired + private Cache cache; + @Override public RenderStepEnums step() { return RenderStepEnums.SKU_PROMOTION; @@ -54,6 +74,10 @@ public class SkuPromotionRender implements CartRenderStep { renderBasePrice(tradeDTO); //渲染单品促销 renderSkuPromotion(tradeDTO); + + checkPromotionQuantity(tradeDTO); + + } /** @@ -155,6 +179,51 @@ public class SkuPromotionRender implements CartRenderStep { } } + /** + * 检查促销库存 + * + * @param tradeDTO 购物车视图 + */ + private void checkPromotionQuantity(TradeDTO tradeDTO) { + for (CartSkuVO cartSkuVO : tradeDTO.getCheckedSkuList()) { + cartSkuVO.getPromotionMap(); + List joinPromotion = cartSkuVO.getPriceDetailDTO().getJoinPromotion(); + if (!joinPromotion.isEmpty()) { + for (PromotionSkuVO promotionSkuVO : joinPromotion) { + + String promotionGoodsStockCacheKey = PromotionGoodsService.getPromotionGoodsStockCacheKey(PromotionTypeEnum.valueOf(promotionSkuVO.getPromotionType()), promotionSkuVO.getActivityId(), cartSkuVO.getGoodsSku().getId()); + Object quantity = cache.get(promotionGoodsStockCacheKey); + + if (quantity == null) { + //如果促销有库存信息 + PromotionTypeEnum promotionTypeEnum = PromotionTypeEnum.valueOf(promotionSkuVO.getPromotionType()); + switch (promotionTypeEnum) { + case KANJIA: + quantity = kanjiaActivityGoodsService.getKanjiaGoodsBySkuId(cartSkuVO.getGoodsSku().getId()).getStock(); + break; + case POINTS_GOODS: + quantity = pointsGoodsService.getPointsGoodsDetailBySkuId(cartSkuVO.getGoodsSku().getId()).getActiveStock(); + break; + case SECKILL: + case PINTUAN: + quantity = promotionGoodsService.getPromotionGoodsStock(PromotionTypeEnum.valueOf(promotionSkuVO.getPromotionType()), promotionSkuVO.getActivityId(), cartSkuVO.getGoodsSku().getId()); + break; + default: + break; + } + } + + + if (cartSkuVO.getNum() > (Integer) quantity) {//设置购物车未选中 + cartSkuVO.setChecked(false); + //设置失效消息 + cartSkuVO.setErrorMessage("促销商品库存不足,现有库存数量[" + quantity + "]"); + } + } + } + } + } + /** * 购物车促销类型 */ diff --git a/framework/src/main/java/cn/lili/modules/order/cart/service/CartServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/cart/service/CartServiceImpl.java index ccf3e7d8..1e8367ce 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/service/CartServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/service/CartServiceImpl.java @@ -185,6 +185,7 @@ public class CartServiceImpl implements CartService { //购物车中不存在此商品,则新建立一个 CartSkuVO cartSkuVO = new CartSkuVO(dataSku, promotionMap); + this.checkSetGoodsQuantity(cartSkuVO, skuId, num); cartSkuVO.setCartType(cartTypeEnum); //检测购物车数据 checkCart(cartTypeEnum, cartSkuVO, skuId, num); diff --git a/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java b/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java index f80c4b77..e5d22caf 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java +++ b/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java @@ -11,6 +11,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import lombok.ToString; import org.springframework.beans.BeanUtils; import org.springframework.data.elasticsearch.annotations.DateFormat; import org.springframework.data.elasticsearch.annotations.Field; @@ -30,6 +31,7 @@ import java.util.Date; @TableName("li_seckill") @ApiModel(value = "秒杀活动活动") @NoArgsConstructor +@ToString(callSuper = true) public class Seckill extends BasePromotions { private static final long serialVersionUID = -9116425737163730836L; diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionServiceImpl.java index 2d8bda06..cd0df5e8 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionServiceImpl.java @@ -105,7 +105,7 @@ public class PromotionServiceImpl implements PromotionService { /** * 根据商品索引获取当前商品索引的所有促销活动信息 * - * @param storeId 店铺id + * @param storeId 店铺id * @param goodsSkuId 商品skuId * @return 当前促销活动集合 */ @@ -129,7 +129,7 @@ public class PromotionServiceImpl implements PromotionService { promotionMap.put(esPromotionKey, fullDiscount); break; case SECKILL: - this.getGoodsCurrentSeckill(promotionGoods, promotionMap); + this.getGoodsCurrentSeckill(esPromotionKey, promotionGoods, promotionMap); break; case POINTS_GOODS: PointsGoods pointsGoods = pointsGoodsService.getById(promotionGoods.getPromotionId()); @@ -143,7 +143,7 @@ public class PromotionServiceImpl implements PromotionService { } - private void getGoodsCurrentSeckill(PromotionGoods promotionGoods, Map promotionMap) { + private void getGoodsCurrentSeckill(String esPromotionKey, PromotionGoods promotionGoods, Map promotionMap) { Seckill seckill = seckillService.getById(promotionGoods.getPromotionId()); SeckillSearchParams searchParams = new SeckillSearchParams(); searchParams.setSeckillId(promotionGoods.getPromotionId()); @@ -151,19 +151,12 @@ public class PromotionServiceImpl implements PromotionService { List seckillApplyList = seckillApplyService.getSeckillApplyList(searchParams); if (seckillApplyList != null && !seckillApplyList.isEmpty()) { SeckillApply seckillApply = seckillApplyList.get(0); - int nextHour = 23; String[] split = seckill.getHours().split(","); int[] hoursSored = Arrays.stream(split).mapToInt(Integer::parseInt).toArray(); Arrays.sort(hoursSored); - for (int i : hoursSored) { - if (seckillApply.getTimeLine() < i) { - nextHour = i; - } - } - String seckillKey = promotionGoods.getPromotionType() + "-" + nextHour; seckill.setStartTime(promotionGoods.getStartTime()); seckill.setEndTime(promotionGoods.getEndTime()); - promotionMap.put(seckillKey, seckill); + promotionMap.put(esPromotionKey, seckill); } } diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java index 633e453f..32163415 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java @@ -424,7 +424,11 @@ public class SeckillApplyServiceImpl extends ServiceImpl Date: Wed, 2 Mar 2022 20:33:45 +0800 Subject: [PATCH 37/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=92=E6=9D=80?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/order/cart/render/impl/SkuPromotionRender.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java index 3350fda6..cdb2acfe 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java @@ -209,12 +209,12 @@ public class SkuPromotionRender implements CartRenderStep { quantity = promotionGoodsService.getPromotionGoodsStock(PromotionTypeEnum.valueOf(promotionSkuVO.getPromotionType()), promotionSkuVO.getActivityId(), cartSkuVO.getGoodsSku().getId()); break; default: - break; + return; } } - if (cartSkuVO.getNum() > (Integer) quantity) {//设置购物车未选中 + if (quantity != null && cartSkuVO.getNum() > (Integer) quantity) {//设置购物车未选中 cartSkuVO.setChecked(false); //设置失效消息 cartSkuVO.setErrorMessage("促销商品库存不足,现有库存数量[" + quantity + "]"); From 0d5f871da712ef5ff3007732c26c931ec1921d11 Mon Sep 17 00:00:00 2001 From: paulGao Date: Wed, 2 Mar 2022 20:39:17 +0800 Subject: [PATCH 38/39] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E4=BF=83=E9=94=80=E5=95=86=E5=93=81=E5=BA=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cart/render/impl/SkuPromotionRender.java | 61 ++++++++++--------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java index cdb2acfe..82f3cde9 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java @@ -190,40 +190,43 @@ public class SkuPromotionRender implements CartRenderStep { List joinPromotion = cartSkuVO.getPriceDetailDTO().getJoinPromotion(); if (!joinPromotion.isEmpty()) { for (PromotionSkuVO promotionSkuVO : joinPromotion) { - - String promotionGoodsStockCacheKey = PromotionGoodsService.getPromotionGoodsStockCacheKey(PromotionTypeEnum.valueOf(promotionSkuVO.getPromotionType()), promotionSkuVO.getActivityId(), cartSkuVO.getGoodsSku().getId()); - Object quantity = cache.get(promotionGoodsStockCacheKey); - - if (quantity == null) { - //如果促销有库存信息 - PromotionTypeEnum promotionTypeEnum = PromotionTypeEnum.valueOf(promotionSkuVO.getPromotionType()); - switch (promotionTypeEnum) { - case KANJIA: - quantity = kanjiaActivityGoodsService.getKanjiaGoodsBySkuId(cartSkuVO.getGoodsSku().getId()).getStock(); - break; - case POINTS_GOODS: - quantity = pointsGoodsService.getPointsGoodsDetailBySkuId(cartSkuVO.getGoodsSku().getId()).getActiveStock(); - break; - case SECKILL: - case PINTUAN: - quantity = promotionGoodsService.getPromotionGoodsStock(PromotionTypeEnum.valueOf(promotionSkuVO.getPromotionType()), promotionSkuVO.getActivityId(), cartSkuVO.getGoodsSku().getId()); - break; - default: - return; - } - } - - - if (quantity != null && cartSkuVO.getNum() > (Integer) quantity) {//设置购物车未选中 - cartSkuVO.setChecked(false); - //设置失效消息 - cartSkuVO.setErrorMessage("促销商品库存不足,现有库存数量[" + quantity + "]"); - } + this.checkPromotionGoodsQuantity(cartSkuVO, promotionSkuVO); } } } } + private void checkPromotionGoodsQuantity(CartSkuVO cartSkuVO, PromotionSkuVO promotionSkuVO) { + String promotionGoodsStockCacheKey = PromotionGoodsService.getPromotionGoodsStockCacheKey(PromotionTypeEnum.valueOf(promotionSkuVO.getPromotionType()), promotionSkuVO.getActivityId(), cartSkuVO.getGoodsSku().getId()); + Object quantity = cache.get(promotionGoodsStockCacheKey); + + if (quantity == null) { + //如果促销有库存信息 + PromotionTypeEnum promotionTypeEnum = PromotionTypeEnum.valueOf(promotionSkuVO.getPromotionType()); + switch (promotionTypeEnum) { + case KANJIA: + quantity = kanjiaActivityGoodsService.getKanjiaGoodsBySkuId(cartSkuVO.getGoodsSku().getId()).getStock(); + break; + case POINTS_GOODS: + quantity = pointsGoodsService.getPointsGoodsDetailBySkuId(cartSkuVO.getGoodsSku().getId()).getActiveStock(); + break; + case SECKILL: + case PINTUAN: + quantity = promotionGoodsService.getPromotionGoodsStock(PromotionTypeEnum.valueOf(promotionSkuVO.getPromotionType()), promotionSkuVO.getActivityId(), cartSkuVO.getGoodsSku().getId()); + break; + default: + return; + } + } + + + if (quantity != null && cartSkuVO.getNum() > (Integer) quantity) {//设置购物车未选中 + cartSkuVO.setChecked(false); + //设置失效消息 + cartSkuVO.setErrorMessage("促销商品库存不足,现有库存数量[" + quantity + "]"); + } + } + /** * 购物车促销类型 */ From 66b2f1f55d87b24524c33f2d54f355e674acf306 Mon Sep 17 00:00:00 2001 From: paulGao Date: Thu, 3 Mar 2022 11:22:20 +0800 Subject: [PATCH 39/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=A7=92=E6=9D=80=E6=B4=BB=E5=8A=A8=E6=97=B6=E9=97=B4=EF=BC=8C?= =?UTF-8?q?=E7=A7=92=E6=9D=80=E6=B4=BB=E5=8A=A8=E5=95=86=E5=93=81=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/SeckillApplyServiceImpl.java | 17 ++++++++++++----- .../serviceimpl/SeckillServiceImpl.java | 3 ++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java index 32163415..9e757376 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java @@ -235,7 +235,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl promotionGoodsList = new ArrayList<>(); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(SeckillApply::getSeckillId, seckill.getId()); - List list = this.list(queryWrapper); + List list = this.list(queryWrapper).stream().filter(i -> i.getTimeLine() != null && seckill.getHours().contains(i.getTimeLine().toString())).collect(Collectors.toList()); for (SeckillApply seckillApply : list) { //获取参与活动的商品信息 GoodsSku goodsSku = goodsSkuService.getGoodsSkuByIdFromCache(seckillApply.getSkuId()); @@ -270,13 +270,20 @@ public class SeckillApplyServiceImpl extends ServiceImpl promotionGoods = PromotionTools.promotionGoodsInit(promotionGoodsList, seckill, PromotionTypeEnum.SECKILL); + result = promotionGoodsService.saveBatch(promotionGoods); this.seckillService.updateEsGoodsSeckill(seckill, list); } + + LambdaQueryWrapper deleteWrapper = new LambdaQueryWrapper<>(); + deleteWrapper.eq(SeckillApply::getSeckillId, seckill.getId()); + deleteWrapper.notIn(SeckillApply::getSkuId, promotionGoodsList.stream().map(PromotionGoods::getSkuId).collect(Collectors.toList())); + this.remove(deleteWrapper); + seckillService.updateSeckillGoodsNum(seckill.getId()); + return result; } diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java index 8b092527..4341caaf 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java @@ -144,9 +144,10 @@ public class SeckillServiceImpl extends AbstractPromotionsServiceImpl