diff --git a/DB/version4.2.3to4.2.4.sql b/DB/version4.2.3to4.2.4.sql new file mode 100644 index 00000000..78764222 --- /dev/null +++ b/DB/version4.2.3to4.2.4.sql @@ -0,0 +1,2 @@ +/** 新增已退货数量 **/ +ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 '; \ No newline at end of file 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 体验,扫描二维码 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/java/cn/lili/controller/distribution/DistributionBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/distribution/DistributionBuyerController.java index dc3567dc..c5332ed3 100644 --- a/buyer-api/src/main/java/cn/lili/controller/distribution/DistributionBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/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/distribution/DistributionGoodsBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/distribution/DistributionGoodsBuyerController.java index a8314cff..cbc01db4 100644 --- a/buyer-api/src/main/java/cn/lili/controller/distribution/DistributionGoodsBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/distribution/DistributionGoodsBuyerController.java @@ -30,7 +30,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/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 f0dad3e3..16caae69 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 d8e90076..e33524f8 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 @@ -29,7 +29,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/message/MemberMessageBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/message/MemberMessageBuyerController.java index 43c80b24..726b31f0 100644 --- a/buyer-api/src/main/java/cn/lili/controller/message/MemberMessageBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/message/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/order/AfterSaleBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/order/AfterSaleBuyerController.java index f5d68e9c..4f4b8026 100644 --- a/buyer-api/src/main/java/cn/lili/controller/order/AfterSaleBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/order/AfterSaleBuyerController.java @@ -36,7 +36,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/order/OrderBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/order/OrderBuyerController.java index f08e6c17..08251f15 100644 --- a/buyer-api/src/main/java/cn/lili/controller/order/OrderBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/order/OrderBuyerController.java @@ -35,7 +35,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/order/OrderComplaintBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/order/OrderComplaintBuyerController.java index 29987dd2..f348c882 100644 --- a/buyer-api/src/main/java/cn/lili/controller/order/OrderComplaintBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/order/OrderComplaintBuyerController.java @@ -34,7 +34,7 @@ import java.util.Objects; **/ @RestController @Api(tags = "买家端,交易投诉接口") -@RequestMapping("/buyer/complain") +@RequestMapping("/buyer/order/complain") public class OrderComplaintBuyerController { /** diff --git a/buyer-api/src/main/java/cn/lili/controller/order/RechargeTradeBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/order/RechargeTradeBuyerController.java index d8d04eeb..e85cddbf 100644 --- a/buyer-api/src/main/java/cn/lili/controller/order/RechargeTradeBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/order/RechargeTradeBuyerController.java @@ -10,7 +10,6 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; 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 263e54d9..cb79f43a 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 @@ -23,7 +23,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/purchase/PurchaseBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/other/purchase/PurchaseBuyerController.java index 6bf2105b..58e6b1b2 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 @@ -30,7 +30,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 96419280..ee5b5774 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 @@ -32,7 +32,7 @@ import javax.validation.constraints.NotNull; */ @RestController @Api(tags = "买家端,会员接口") -@RequestMapping("/buyer/members") +@RequestMapping("/buyer/passport/member") 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 f9071ab6..fa99b2fe 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 708ce057..a3c1a6a0 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 7dd1034e..6e6a7ca7 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/wallet/MemberReceiptController.java b/buyer-api/src/main/java/cn/lili/controller/wallet/MemberReceiptController.java index daee4a35..08cec9d4 100644 --- a/buyer-api/src/main/java/cn/lili/controller/wallet/MemberReceiptController.java +++ b/buyer-api/src/main/java/cn/lili/controller/wallet/MemberReceiptController.java @@ -24,7 +24,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/wallet/MemberWalletBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/wallet/MemberWalletBuyerController.java index 33ba19fd..52328e6f 100644 --- a/buyer-api/src/main/java/cn/lili/controller/wallet/MemberWalletBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/wallet/MemberWalletBuyerController.java @@ -35,7 +35,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/wallet/MemberWithdrawApplyBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/wallet/MemberWithdrawApplyBuyerController.java index 7771443c..a1418808 100644 --- a/buyer-api/src/main/java/cn/lili/controller/wallet/MemberWithdrawApplyBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/wallet/MemberWithdrawApplyBuyerController.java @@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/buyer-api/src/main/java/cn/lili/controller/wallet/RechargeBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/wallet/RechargeBuyerController.java index 1b4d896b..7a73cde7 100644 --- a/buyer-api/src/main/java/cn/lili/controller/wallet/RechargeBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/wallet/RechargeBuyerController.java @@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -24,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "买家端,预存款充值记录接口") -@RequestMapping("/buyer/member/recharge") +@RequestMapping("/buyer/wallet/recharge") public class RechargeBuyerController { @Autowired diff --git a/buyer-api/src/main/resources/application.yml b/buyer-api/src/main/resources/application.yml index 2f99a882..f3a7a5a6 100644 --- a/buyer-api/src/main/resources/application.yml +++ b/buyer-api/src/main/resources/application.yml @@ -128,21 +128,23 @@ ignored: - /MP_verify_qSyvBPhDsPdxvOhC.txt - /weixin/** - /source/** - - /buyer/mini-program/** - - /buyer/cashier/** - - /buyer/pageData/** - - /buyer/article/** + - /buyer/payment/cashier/** + - /buyer/payment/cashierRefund/** + - /buyer/other/pageData/** + - /buyer/other/article/** - /buyer/goods/** - - /buyer/category/** - /buyer/store/** - - /buyer/connect/** + - /buyer/passport/connect/** - /buyer/members/** + - /buyer/passport/member/** + - /buyer/passport/member/refresh/** - /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 +185,7 @@ logging: config: classpath:logback-spring.xml # 输出级别 level: - root: error + root: info # org.springframework: debug file: # 指定路径 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/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/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/java/cn/lili/controller/common/FileController.java b/common-api/src/main/java/cn/lili/controller/common/FileController.java index 04e65810..01aa0045 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..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 @@ -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 { @@ -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/common-api/src/main/java/cn/lili/controller/common/IpInfoManagerController.java b/common-api/src/main/java/cn/lili/controller/common/IpInfoManagerController.java index f0db1c2d..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,7 +1,7 @@ package cn.lili.controller.common; -import cn.lili.common.enums.ResultUtil; import cn.lili.common.utils.IpHelper; +import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.ResultMessage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -20,7 +20,7 @@ import javax.servlet.http.HttpServletRequest; */ @RestController @Api(tags = "获取IP信息以及天气") -@RequestMapping("/common/ip") +@RequestMapping("/common/common/ip") public class IpInfoManagerController { @Autowired private IpHelper ipHelper; @@ -28,6 +28,7 @@ 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/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 ce4f9e5a..5eb62d1b 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 @@ -1,7 +1,6 @@ package cn.lili.controller.common; import cn.lili.cache.limit.annotation.LimitPoint; -import cn.lili.common.aop.annotation.PreventDuplicateSubmissions; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.ResultMessage; import cn.lili.modules.verification.entity.enums.VerificationEnums; @@ -20,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 d6f9e506..3914d62c 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 b78b5032..25001d07 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 @@ -5,7 +5,6 @@ import cn.lili.cache.Cache; import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.ResultUtil; import cn.lili.common.exception.ServiceException; -import cn.lili.common.properties.SystemSettingProperties; import cn.lili.common.security.AuthUser; import cn.lili.common.security.context.UserContext; import cn.lili.common.security.enums.UserEnums; @@ -40,7 +39,7 @@ import java.util.Objects; @Slf4j @RestController @Api(tags = "文件上传接口") -@RequestMapping("/common/upload") +@RequestMapping("/common/common/upload") public class UploadController { @Autowired 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/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/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/config/application.yml b/config/application.yml index ed546696..9df109fb 100644 --- a/config/application.yml +++ b/config/application.yml @@ -124,26 +124,31 @@ ignored: - /MP_verify_qSyvBPhDsPdxvOhC.txt - /weixin/** - /source/** - - /buyer/mini-program/** - - /buyer/cashier/** - - /buyer/pageData/** - - /buyer/article/** + - /store/passport/login/** + - /store/passport/login/refresh/** + - /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/passport/member/refresh/** - /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 +188,7 @@ mybatis-plus: logging: # 输出级别 level: - root: info + cn.lili: info # org.hibernate: debug # org.springframework: debug # org.springframework.data.mongodb.core: debug @@ -232,7 +237,7 @@ lili: # 0:不做脱敏处理 # 1:管理端用户手机号等信息脱敏 # 2:商家端信息脱敏(为2时,表示管理端,商家端同时脱敏) - # sensitiveLevel: 2 + sensitiveLevel: 1 statistics: # 在线人数统计 X 小时。这里设置48,即统计过去48小时每小时在线人数 @@ -302,9 +307,10 @@ 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 - namesrvAddr: 192.168.0.116:9876 isVIPChannel: false producer: group: lili_group 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/java/cn/lili/event/impl/StockUpdateExecute.java b/consumer/src/main/java/cn/lili/event/impl/StockUpdateExecute.java index eb8ed3d7..77806014 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()) { @@ -330,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/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(); + } +} 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..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 @@ -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; @@ -44,24 +45,40 @@ 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); + } } /** * 添加秒杀活动 * 从系统设置中获取秒杀活动的配置 - * 添加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); + + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(Seckill::getStartTime, seckill.getStartTime()); + //如果已经存在促销,则不再次保存 + if (seckillService.list(lambdaQueryWrapper).isEmpty()) { + boolean result = seckillService.savePromotions(seckill); + log.info("生成秒杀活动参数:{},结果:{}", seckill, result); + } } } } 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/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/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/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/enums/ResultCode.java b/framework/src/main/java/cn/lili/common/enums/ResultCode.java index 323d4516..d60a61c6 100644 --- a/framework/src/main/java/cn/lili/common/enums/ResultCode.java +++ b/framework/src/main/java/cn/lili/common/enums/ResultCode.java @@ -257,6 +257,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/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获取第一个节点, * 真正匹配的节点可能不是第一个, 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/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/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/distribution/serviceimpl/DistributionCashServiceImpl.java b/framework/src/main/java/cn/lili/modules/distribution/serviceimpl/DistributionCashServiceImpl.java index d93247e2..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 @@ -57,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); @@ -49,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()); @@ -76,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/service/CategoryService.java b/framework/src/main/java/cn/lili/modules/goods/service/CategoryService.java index 519b0c96..86888589 100644 --- a/framework/src/main/java/cn/lili/modules/goods/service/CategoryService.java +++ b/framework/src/main/java/cn/lili/modules/goods/service/CategoryService.java @@ -8,7 +8,6 @@ import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; -import java.io.Serializable; import java.util.List; /** 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 0587303f..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 @@ -20,7 +20,6 @@ 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.ArrayList; import java.util.List; @@ -110,7 +109,7 @@ public class BrandServiceImpl extends ServiceImpl implements /** * 校验绑定关系 * - * @param brandIds + * @param brandIds 品牌Ids */ private void checkBind(List brandIds) { //分了绑定关系查询 @@ -130,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 9ddaf39e..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 @@ -38,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 557e7fd7..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,7 +16,6 @@ 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; @@ -47,12 +45,6 @@ public class CategoryParameterGroupServiceImpl extends ServiceImpl getCategoryParams(String categoryId) { //根据id查询参数组 @@ -75,6 +67,7 @@ public class CategoryParameterGroupServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public boolean saveCategory(Category category) { //判断分类佣金是否正确 if (category.getCommissionRate() < 0) { @@ -215,6 +216,7 @@ public class CategoryServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public void updateCategory(Category category) { //判断分类佣金是否正确 if (category.getCommissionRate() < 0) { @@ -240,6 +242,7 @@ public class CategoryServiceImpl extends ServiceImpl i @Override + @Transactional(rollbackFor = Exception.class) public void delete(String id) { this.removeById(id); removeCache(); @@ -250,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)); @@ -303,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/CategorySpecificationServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategorySpecificationServiceImpl.java index 7eab0561..2ff12b2a 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategorySpecificationServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategorySpecificationServiceImpl.java @@ -7,7 +7,6 @@ import cn.lili.modules.goods.service.CategorySpecificationService; 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; 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/DraftGoodsServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/DraftGoodsServiceImpl.java index fd795f36..1493121f 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/DraftGoodsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/DraftGoodsServiceImpl.java @@ -8,7 +8,6 @@ import cn.lili.modules.goods.entity.dos.Category; import cn.lili.modules.goods.entity.dos.DraftGoods; import cn.lili.modules.goods.entity.dos.GoodsGallery; import cn.lili.modules.goods.entity.dos.GoodsSku; -import cn.lili.mybatis.util.PageUtil; import cn.lili.modules.goods.entity.dto.DraftGoodsDTO; import cn.lili.modules.goods.entity.dto.DraftGoodsSearchParams; import cn.lili.modules.goods.entity.dto.GoodsParamsDTO; @@ -18,11 +17,11 @@ import cn.lili.modules.goods.service.CategoryService; import cn.lili.modules.goods.service.DraftGoodsService; import cn.lili.modules.goods.service.GoodsGalleryService; import cn.lili.modules.goods.service.GoodsSkuService; +import cn.lili.mybatis.util.PageUtil; 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.*; 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 f31a171f..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 @@ -36,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 40cc4192..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 @@ -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; @@ -113,6 +114,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl i private ApplicationEventPublisher applicationEventPublisher; @Override + @Transactional(rollbackFor = Exception.class) public void add(List> skuList, Goods goods) { // 检查是否需要生成索引 List newSkuList; @@ -186,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())); @@ -319,6 +322,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()); @@ -431,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()); @@ -438,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) { @@ -445,7 +451,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); @@ -470,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<>(); @@ -498,6 +508,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl i } @Override + @Transactional(rollbackFor = Exception.class) public void updateGoodsSkuCommentNum(String skuId) { //获取商品信息 GoodsSku goodsSku = this.getGoodsSkuByIdFromCache(skuId); @@ -578,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/GoodsWordsServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsWordsServiceImpl.java index 775b5800..888fded8 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsWordsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsWordsServiceImpl.java @@ -5,7 +5,6 @@ import cn.lili.modules.goods.mapper.GoodsWordsMapper; import cn.lili.modules.goods.service.GoodsWordsService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; /** * 商品关键字业务层实现 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 2d11c912..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 @@ -83,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/entity/vo/MemberVO.java b/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberVO.java index cf157d89..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 @@ -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; @@ -24,9 +28,11 @@ public class MemberVO implements Serializable { private String id; @ApiModelProperty(value = "会员用户名") + @Sensitive(strategy = SensitiveStrategy.PHONE) private String username; @ApiModelProperty(value = "昵称") + @Sensitive(strategy = SensitiveStrategy.PHONE) private String nickName; @ApiModelProperty(value = "会员性别,1为男,0为女") @@ -89,4 +95,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 ab747ecd..b42df2b6 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); + /** * 一键注册会员 * @@ -253,4 +254,11 @@ public interface MemberService extends IService { * @return 是否更新成功 */ boolean updateMemberLoginTime(String memberId); + + /** + * 获取用户VO + * @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/member/serviceimpl/FootprintServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/FootprintServiceImpl.java index eaafccf0..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 @@ -36,6 +36,7 @@ public class FootprintServiceImpl extends ServiceImpl queryWrapper = Wrappers.lambdaQuery(); queryWrapper.eq(FootPrint::getMemberId, footPrint.getMemberId()); @@ -69,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/GoodsCollectionServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/GoodsCollectionServiceImpl.java index 515cbc39..c7f915f7 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/GoodsCollectionServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/GoodsCollectionServiceImpl.java @@ -14,7 +14,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Optional; 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 e206908d..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 @@ -55,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 88ca81b2..6be96ee3 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 @@ -51,6 +51,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; @@ -372,6 +373,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); @@ -626,6 +628,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/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberSignServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberSignServiceImpl.java index f5821133..fbac26ba 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberSignServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberSignServiceImpl.java @@ -2,34 +2,30 @@ package cn.lili.modules.member.serviceimpl; import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; -import cn.lili.modules.member.entity.enums.PointTypeEnum; -import cn.lili.modules.system.entity.dto.PointSettingItem; -import cn.lili.rocketmq.RocketmqSendCallbackBuilder; -import cn.lili.rocketmq.tags.MemberTagsEnum; +import cn.lili.common.properties.RocketmqCustomProperties; import cn.lili.common.security.AuthUser; import cn.lili.common.security.context.UserContext; import cn.lili.common.utils.CurrencyUtil; import cn.lili.common.utils.DateUtil; -import cn.lili.common.utils.StringUtils; -import cn.lili.common.properties.RocketmqCustomProperties; import cn.lili.modules.member.entity.dos.MemberSign; +import cn.lili.modules.member.entity.enums.PointTypeEnum; import cn.lili.modules.member.mapper.MemberSignMapper; import cn.lili.modules.member.service.MemberService; import cn.lili.modules.member.service.MemberSignService; import cn.lili.modules.system.entity.dos.Setting; import cn.lili.modules.system.entity.dto.PointSetting; +import cn.lili.modules.system.entity.dto.PointSettingItem; import cn.lili.modules.system.entity.enums.SettingEnum; import cn.lili.modules.system.service.SettingService; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import cn.lili.rocketmq.RocketmqSendCallbackBuilder; +import cn.lili.rocketmq.tags.MemberTagsEnum; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.gson.Gson; import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.Date; import java.util.List; -import java.util.Map; /** * 会员签到业务层实现 @@ -74,7 +70,7 @@ public class MemberSignServiceImpl 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/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 31d31150..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 @@ -1,14 +1,14 @@ package cn.lili.modules.message.serviceimpl; -import cn.lili.rocketmq.RocketmqSendCallbackBuilder; -import cn.lili.rocketmq.tags.OtherTagsEnum; -import cn.lili.mybatis.util.PageUtil; -import cn.lili.common.vo.PageVO; import cn.lili.common.properties.RocketmqCustomProperties; +import cn.lili.common.vo.PageVO; import cn.lili.modules.message.entity.dos.Message; import cn.lili.modules.message.entity.vos.MessageVO; import cn.lili.modules.message.mapper.MessageMapper; import cn.lili.modules.message.service.MessageService; +import cn.lili.mybatis.util.PageUtil; +import cn.lili.rocketmq.RocketmqSendCallbackBuilder; +import cn.lili.rocketmq.tags.OtherTagsEnum; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.rocketmq.spring.core.RocketMQTemplate; @@ -38,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/ShortLinkServiceImpl.java b/framework/src/main/java/cn/lili/modules/message/serviceimpl/ShortLinkServiceImpl.java index cd74a386..6ab973e5 100644 --- a/framework/src/main/java/cn/lili/modules/message/serviceimpl/ShortLinkServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/message/serviceimpl/ShortLinkServiceImpl.java @@ -6,7 +6,6 @@ import cn.lili.modules.message.service.ShortLinkService; import cn.lili.mybatis.util.PageUtil; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import java.util.List; 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/AfterSaleLogServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleLogServiceImpl.java index fc178579..0f17546f 100644 --- a/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleLogServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleLogServiceImpl.java @@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.List; diff --git a/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleReasonServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleReasonServiceImpl.java index 1fcc1c7a..283872d0 100644 --- a/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleReasonServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleReasonServiceImpl.java @@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 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.List; 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 843996fa..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 @@ -168,6 +168,7 @@ public class AfterSaleServiceImpl extends ServiceImpl(); 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/TradeBuilder.java b/framework/src/main/java/cn/lili/modules/order/cart/render/TradeBuilder.java index 94655e3a..ba6b18f6 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/TradeBuilder.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/TradeBuilder.java @@ -11,7 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.Date; import java.util.List; /** 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/cart/render/impl/SkuPromotionRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java index cfcfe37b..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 @@ -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,54 @@ 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) { + 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 + "]"); + } + } + /** * 购物车促销类型 */ 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 b8c51b9c..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 @@ -50,6 +50,7 @@ import cn.lili.modules.search.service.EsGoodsSearchService; 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.*; import java.util.stream.Collectors; @@ -184,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); @@ -271,6 +273,7 @@ public class CartServiceImpl implements CartService { } @Override + @Transactional(rollbackFor = Exception.class) public void delete(String[] skuIds) { TradeDTO tradeDTO = this.readDTO(CartTypeEnum.CART); List cartSkuVOS = tradeDTO.getSkuList(); @@ -496,6 +499,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/entity/dos/Trade.java b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/Trade.java index b8a8aaa8..9edc785a 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/Trade.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/Trade.java @@ -1,10 +1,10 @@ package cn.lili.modules.order.order.entity.dos; +import cn.lili.common.utils.BeanUtil; +import cn.lili.modules.order.cart.entity.dto.TradeDTO; +import cn.lili.modules.order.cart.entity.enums.DeliveryMethodEnum; import cn.lili.modules.order.order.entity.enums.PayStatusEnum; import cn.lili.mybatis.BaseEntity; -import cn.lili.common.utils.BeanUtil; -import cn.lili.modules.order.cart.entity.enums.DeliveryMethodEnum; -import cn.lili.modules.order.cart.entity.dto.TradeDTO; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/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 15d45ab4..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; @@ -32,7 +32,6 @@ 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.List; @@ -104,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 43a0a0b9..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 @@ -51,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); } @@ -66,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); } } @@ -80,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/FeedbackServiceImpl.java b/framework/src/main/java/cn/lili/modules/page/serviceimpl/FeedbackServiceImpl.java index b97083bd..4d17d5ed 100644 --- a/framework/src/main/java/cn/lili/modules/page/serviceimpl/FeedbackServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/page/serviceimpl/FeedbackServiceImpl.java @@ -5,10 +5,7 @@ import cn.lili.modules.page.entity.dos.Feedback; import cn.lili.modules.page.mapper.FeedbackMapper; import cn.lili.modules.page.service.FeedbackService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; /** * 意见反馈业务层实现 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/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(); } } diff --git a/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java b/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java index 27102b26..b4a8a094 100644 --- a/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java +++ b/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java @@ -7,18 +7,18 @@ import cn.lili.common.context.ThreadContextHolder; import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.ResultUtil; import cn.lili.common.exception.ServiceException; +import cn.lili.common.properties.ApiProperties; import cn.lili.common.properties.DomainProperties; import cn.lili.common.utils.BeanUtil; import cn.lili.common.utils.SnowFlake; import cn.lili.common.utils.StringUtils; import cn.lili.common.vo.ResultMessage; -import cn.lili.common.properties.ApiProperties; import cn.lili.modules.payment.entity.RefundLog; +import cn.lili.modules.payment.entity.enums.PaymentMethodEnum; import cn.lili.modules.payment.kit.CashierSupport; import cn.lili.modules.payment.kit.Payment; import cn.lili.modules.payment.kit.dto.PayParam; import cn.lili.modules.payment.kit.dto.PaymentSuccessParams; -import cn.lili.modules.payment.entity.enums.PaymentMethodEnum; import cn.lili.modules.payment.kit.params.dto.CashierParam; import cn.lili.modules.payment.service.PaymentService; import cn.lili.modules.payment.service.RefundLogService; diff --git a/framework/src/main/java/cn/lili/modules/payment/serviceimpl/PaymentServiceImpl.java b/framework/src/main/java/cn/lili/modules/payment/serviceimpl/PaymentServiceImpl.java index 7713cbc7..06b6d70a 100644 --- a/framework/src/main/java/cn/lili/modules/payment/serviceimpl/PaymentServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/payment/serviceimpl/PaymentServiceImpl.java @@ -7,7 +7,6 @@ import cn.lili.modules.payment.service.PaymentService; 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.List; diff --git a/framework/src/main/java/cn/lili/modules/payment/serviceimpl/RefundLogServiceImpl.java b/framework/src/main/java/cn/lili/modules/payment/serviceimpl/RefundLogServiceImpl.java index 7c13dfe5..42e763eb 100644 --- a/framework/src/main/java/cn/lili/modules/payment/serviceimpl/RefundLogServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/payment/serviceimpl/RefundLogServiceImpl.java @@ -6,7 +6,6 @@ import cn.lili.modules.payment.service.RefundLogService; 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; /** * 退款日志 业务实现 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 70467de2..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 @@ -56,7 +56,7 @@ public class AdminUserServiceImpl extends ServiceImpl adminUserPage(Page initPage, QueryWrapper initWrapper) { @@ -72,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() @@ -81,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) { @@ -156,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(""); @@ -194,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); @@ -240,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 2a9e2e89..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 @@ -28,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 138a2a27..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 @@ -41,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 ebb2c2de..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 @@ -58,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 57fb4b6a..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 @@ -47,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 245710b7..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 @@ -5,8 +5,6 @@ import cn.lili.modules.permission.mapper.UserRoleMapper; import cn.lili.modules.permission.service.UserRoleService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -38,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/entity/dos/Seckill.java b/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java index fbe4232d..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 @@ -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; @@ -12,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; @@ -31,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; @@ -59,7 +60,7 @@ 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)); + DateTime dateTime = DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), day)); this.applyEndTime = dateTime; this.hours = hours; this.seckillRule = seckillRule; 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); 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 99b60133..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 @@ -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; @@ -89,12 +90,20 @@ 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); + + /** + * 更新秒杀活动时间 + * + * @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/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<>(); @@ -243,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/KanjiaActivityLogServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/KanjiaActivityLogServiceImpl.java index 1b01cb30..0c98ca07 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/KanjiaActivityLogServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/KanjiaActivityLogServiceImpl.java @@ -23,7 +23,6 @@ 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; /** 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 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/promotion/serviceimpl/PintuanServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PintuanServiceImpl.java index bb9a02d6..4edd344a 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PintuanServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PintuanServiceImpl.java @@ -34,7 +34,6 @@ import cn.lili.trigger.util.DelayQueueTools; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.Date; diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PointsGoodsCategoryServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PointsGoodsCategoryServiceImpl.java index 79b8c06a..9ea4b03f 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PointsGoodsCategoryServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PointsGoodsCategoryServiceImpl.java @@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; /** * 积分商品分类业务层实现 diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PointsGoodsServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PointsGoodsServiceImpl.java index 24ad9649..b25d7742 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PointsGoodsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PointsGoodsServiceImpl.java @@ -65,6 +65,7 @@ public class PointsGoodsServiceImpl extends AbstractPromotionsServiceImpl promotionsList) { List promotionGoodsList = new ArrayList<>(); for (PointsGoods pointsGoods : promotionsList) { @@ -107,6 +108,7 @@ public class PointsGoodsServiceImpl extends AbstractPromotionsServiceImpl ids) { for (String id : ids) { PointsGoods pointsGoods = this.getById(id); @@ -206,6 +209,7 @@ public class PointsGoodsServiceImpl extends AbstractPromotionsServiceImpl 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/PromotionServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionServiceImpl.java index 77cf4d68..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 @@ -11,7 +11,6 @@ import cn.lili.modules.promotion.tools.PromotionTools; 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.Arrays; import java.util.HashMap; @@ -106,7 +105,7 @@ public class PromotionServiceImpl implements PromotionService { /** * 根据商品索引获取当前商品索引的所有促销活动信息 * - * @param storeId 店铺id + * @param storeId 店铺id * @param goodsSkuId 商品skuId * @return 当前促销活动集合 */ @@ -130,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()); @@ -144,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()); @@ -152,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 a421e9e6..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 @@ -185,6 +185,7 @@ 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); } + /** + * 更新秒杀活动时间 + * + * @param seckill 秒杀活动 + * @return 是否更新成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateSeckillApplyTime(Seckill seckill) { + boolean result = false; + List promotionGoodsList = new ArrayList<>(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(SeckillApply::getSeckillId, seckill.getId()); + 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()); + //获取促销商品 + PromotionGoods promotionGoods = this.setSeckillGoods(goodsSku, seckillApply, seckill); + promotionGoodsList.add(promotionGoods); + } + //保存促销活动商品信息 + if (!promotionGoodsList.isEmpty()) { + PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams(); + searchParams.setPromotionType(PromotionTypeEnum.SECKILL.name()); + searchParams.setPromotionId(seckill.getId()); + promotionGoodsService.deletePromotionGoods(searchParams); + //初始化促销商品 + List 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; + } + /** * 检查秒杀活动申请列表参数信息 * @@ -387,7 +431,11 @@ public class SeckillApplyServiceImpl extends ServiceImpl seckillApplies) { if (seckillApplies != null && !seckillApplies.isEmpty()) { // 更新促销范围 diff --git a/framework/src/main/java/cn/lili/modules/purchase/serviceimpl/PurchaseOrderItemServiceImpl.java b/framework/src/main/java/cn/lili/modules/purchase/serviceimpl/PurchaseOrderItemServiceImpl.java index 50f75d78..b17b30c6 100644 --- a/framework/src/main/java/cn/lili/modules/purchase/serviceimpl/PurchaseOrderItemServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/purchase/serviceimpl/PurchaseOrderItemServiceImpl.java @@ -4,8 +4,6 @@ import cn.lili.modules.purchase.entity.dos.PurchaseOrderItem; import cn.lili.modules.purchase.mapper.PurchaseOrderItemMapper; import cn.lili.modules.purchase.service.PurchaseOrderItemService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -22,6 +20,7 @@ import java.util.List; public class PurchaseOrderItemServiceImpl extends ServiceImpl 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 { - BasePromotions promotion = (BasePromotions) i.getValue(); + JSONObject promotionJson = JSONUtil.parseObj(i.getValue()); + BasePromotions promotion = promotionJson.toBean(BasePromotions.class); return promotion.getEndTime() != null && promotion.getEndTime().getTime() < DateUtil.date().getTime(); }); } 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()); } diff --git a/framework/src/main/java/cn/lili/modules/sms/serviceimpl/SmsReachServiceImpl.java b/framework/src/main/java/cn/lili/modules/sms/serviceimpl/SmsReachServiceImpl.java index 8b8d26d5..89187cee 100644 --- a/framework/src/main/java/cn/lili/modules/sms/serviceimpl/SmsReachServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/sms/serviceimpl/SmsReachServiceImpl.java @@ -13,6 +13,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.List; @@ -31,6 +32,7 @@ public class SmsReachServiceImpl 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/statistics/aop/aspect/PageViewInterceptor.java b/framework/src/main/java/cn/lili/modules/statistics/aop/aspect/PageViewInterceptor.java index 7ee8d8e6..2c90a85e 100644 --- a/framework/src/main/java/cn/lili/modules/statistics/aop/aspect/PageViewInterceptor.java +++ b/framework/src/main/java/cn/lili/modules/statistics/aop/aspect/PageViewInterceptor.java @@ -18,7 +18,6 @@ import org.aspectj.lang.reflect.MethodSignature; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; -import javax.servlet.http.HttpServletRequest; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; diff --git a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/BillStatisticsServiceImpl.java b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/BillStatisticsServiceImpl.java index 217320ad..34ce48f7 100644 --- a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/BillStatisticsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/BillStatisticsServiceImpl.java @@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 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; diff --git a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/DistributionCashStatisticsServiceImpl.java b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/DistributionCashStatisticsServiceImpl.java index d459537b..25f5159f 100644 --- a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/DistributionCashStatisticsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/DistributionCashStatisticsServiceImpl.java @@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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; /** diff --git a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/MemberEvaluationStatisticsServiceImpl.java b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/MemberEvaluationStatisticsServiceImpl.java index 23a5bae3..8f4ae74c 100644 --- a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/MemberEvaluationStatisticsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/MemberEvaluationStatisticsServiceImpl.java @@ -13,7 +13,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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; diff --git a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/SeckillStatisticsServiceImpl.java b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/SeckillStatisticsServiceImpl.java index 35cd916b..c3ff5396 100644 --- a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/SeckillStatisticsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/SeckillStatisticsServiceImpl.java @@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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; /** * 秒杀活动统计 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/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 diff --git a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreAddressServiceImpl.java b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreAddressServiceImpl.java index 131f774b..3394c831 100644 --- a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreAddressServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreAddressServiceImpl.java @@ -10,7 +10,6 @@ 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; /** * 店铺地址(自提点)业务层实现 diff --git a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java index 72ad1e5f..50ff1703 100644 --- a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java @@ -32,7 +32,6 @@ 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.*; 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 b8055f85..ab00e3d6 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 @@ -82,6 +82,7 @@ public class StoreServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public Store add(AdminStoreApplyDTO adminStoreApplyDTO) { //判断店铺名称是否存在 @@ -120,6 +121,7 @@ public class StoreServiceImpl extends ServiceImpl implements } @Override + @Transactional(rollbackFor = Exception.class) public Store edit(StoreEditDTO storeEditDTO) { if (storeEditDTO != null) { //判断店铺名是否唯一 @@ -166,6 +168,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/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; - - } 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; diff --git a/framework/src/main/java/cn/lili/modules/system/serviceimpl/AppVersionServiceImpl.java b/framework/src/main/java/cn/lili/modules/system/serviceimpl/AppVersionServiceImpl.java index fcb46466..b4b67392 100644 --- a/framework/src/main/java/cn/lili/modules/system/serviceimpl/AppVersionServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/system/serviceimpl/AppVersionServiceImpl.java @@ -2,14 +2,12 @@ package cn.lili.modules.system.serviceimpl; import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; -import cn.lili.modules.goods.entity.dos.Brand; import cn.lili.modules.system.entity.dos.AppVersion; import cn.lili.modules.system.mapper.AppVersionMapper; import cn.lili.modules.system.service.AppVersionService; 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; /** 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; @@ -42,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); @@ -67,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; } @@ -90,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 @@ -122,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())) { @@ -239,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/system/token/ManagerTokenGenerate.java b/framework/src/main/java/cn/lili/modules/system/token/ManagerTokenGenerate.java index 4e22a7b1..7acb4d51 100644 --- a/framework/src/main/java/cn/lili/modules/system/token/ManagerTokenGenerate.java +++ b/framework/src/main/java/cn/lili/modules/system/token/ManagerTokenGenerate.java @@ -11,7 +11,6 @@ import cn.lili.common.security.token.TokenUtil; import cn.lili.common.security.token.base.AbstractTokenGenerate; import cn.lili.modules.permission.entity.dos.AdminUser; import cn.lili.modules.permission.entity.vo.UserMenuVO; -import cn.lili.modules.permission.service.AdminUserService; import cn.lili.modules.permission.service.RoleMenuService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; 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 58c0aa97..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 @@ -10,8 +10,6 @@ import cn.lili.common.vo.SerializableStream; import cn.lili.modules.verification.SliderImageUtil; import cn.lili.modules.verification.entity.dos.VerificationSource; import cn.lili.modules.verification.entity.dto.VerificationDTO; -import cn.lili.modules.verification.service.VerificationSourceService; -import cn.lili.modules.verification.SliderImageUtil; import cn.lili.modules.verification.entity.enums.VerificationEnums; import cn.lili.modules.verification.service.VerificationService; import cn.lili.modules.verification.service.VerificationSourceService; @@ -158,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/verification/service/impl/VerificationSourceServiceImpl.java b/framework/src/main/java/cn/lili/modules/verification/service/impl/VerificationSourceServiceImpl.java index 3ac96fa2..8f5900e4 100644 --- a/framework/src/main/java/cn/lili/modules/verification/service/impl/VerificationSourceServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/verification/service/impl/VerificationSourceServiceImpl.java @@ -1,15 +1,14 @@ package cn.lili.modules.verification.service.impl; import cn.lili.cache.Cache; -import cn.lili.modules.verification.entity.dos.VerificationSource; -import cn.lili.modules.verification.entity.enums.VerificationSourceEnum; -import cn.lili.modules.verification.entity.dto.VerificationDTO; import cn.lili.modules.system.mapper.VerificationSourceMapper; +import cn.lili.modules.verification.entity.dos.VerificationSource; +import cn.lili.modules.verification.entity.dto.VerificationDTO; +import cn.lili.modules.verification.entity.enums.VerificationSourceEnum; import cn.lili.modules.verification.service.VerificationSourceService; 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.List; 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 11c700c5..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 @@ -94,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 f849e402..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; @@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import java.util.Date; @@ -29,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); diff --git a/framework/src/main/java/cn/lili/modules/wechat/serviceimpl/WechatMPMessageServiceImpl.java b/framework/src/main/java/cn/lili/modules/wechat/serviceimpl/WechatMPMessageServiceImpl.java index ba948f5f..ce6a45cc 100644 --- a/framework/src/main/java/cn/lili/modules/wechat/serviceimpl/WechatMPMessageServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/wechat/serviceimpl/WechatMPMessageServiceImpl.java @@ -22,7 +22,6 @@ import lombok.NoArgsConstructor; 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.HashMap; diff --git a/framework/src/main/java/cn/lili/modules/wechat/serviceimpl/WechatMessageServiceImpl.java b/framework/src/main/java/cn/lili/modules/wechat/serviceimpl/WechatMessageServiceImpl.java index 58b92040..9c57334c 100644 --- a/framework/src/main/java/cn/lili/modules/wechat/serviceimpl/WechatMessageServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/wechat/serviceimpl/WechatMessageServiceImpl.java @@ -21,7 +21,6 @@ import lombok.NoArgsConstructor; 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.HashMap; diff --git a/framework/src/test/java/cn/lili/test/script/ScriptTest.java b/framework/src/test/java/cn/lili/test/script/ScriptTest.java index ca2bfead..654c2071 100644 --- a/framework/src/test/java/cn/lili/test/script/ScriptTest.java +++ b/framework/src/test/java/cn/lili/test/script/ScriptTest.java @@ -13,7 +13,6 @@ import org.springframework.scripting.support.ResourceScriptSource; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; -import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.ArrayList; 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/java/cn/lili/controller/distribution/DistributionManagerController.java b/manager-api/src/main/java/cn/lili/controller/distribution/DistributionManagerController.java index 22eed41c..8ef39b1d 100644 --- a/manager-api/src/main/java/cn/lili/controller/distribution/DistributionManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/distribution/DistributionManagerController.java @@ -27,7 +27,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/file/FileManagerController.java b/manager-api/src/main/java/cn/lili/controller/file/FileManagerController.java index 8580607e..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; @@ -24,8 +23,8 @@ import java.util.List; * @since 2020/11/26 15:41 */ @RestController -@Api(tags = "管理端,文件管理管理接口") -@RequestMapping("/manager/file") +@Api(tags = "管理端,文件管理接口") +@RequestMapping("/manager/common/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..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; @@ -24,7 +21,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 d8660c04..f58b9e6e 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 @@ -33,7 +33,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/goods/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/goods/HotWordsManagerController.java rename to manager-api/src/main/java/cn/lili/controller/hotwords/HotWordsManagerController.java index ee042cf9..ce4eb8d3 --- 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; @@ -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/member/MemberEvaluationManagerController.java b/manager-api/src/main/java/cn/lili/controller/member/MemberEvaluationManagerController.java index d880de06..213706a7 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 @@ -26,7 +26,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/message/MemberMessageManagerController.java b/manager-api/src/main/java/cn/lili/controller/message/MemberMessageManagerController.java index 0c1e1391..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 @@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -24,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/message/MemberNoticeLogManagerController.java b/manager-api/src/main/java/cn/lili/controller/message/MemberNoticeLogManagerController.java index 483e66a5..506bbc5a 100644 --- a/manager-api/src/main/java/cn/lili/controller/message/MemberNoticeLogManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/message/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/message/MemberNoticeManagerController.java b/manager-api/src/main/java/cn/lili/controller/message/MemberNoticeManagerController.java index 30e74871..be252cbb 100644 --- a/manager-api/src/main/java/cn/lili/controller/message/MemberNoticeManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/message/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/message/MemberNoticeSenterManagerController.java b/manager-api/src/main/java/cn/lili/controller/message/MemberNoticeSenterManagerController.java index 238ccffb..edd03c9a 100644 --- a/manager-api/src/main/java/cn/lili/controller/message/MemberNoticeSenterManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/message/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/message/ServiceNoticeManagerController.java b/manager-api/src/main/java/cn/lili/controller/message/ServiceNoticeManagerController.java index aca1ce21..8510d1e2 100644 --- a/manager-api/src/main/java/cn/lili/controller/message/ServiceNoticeManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/message/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/order/AfterSaleManagerController.java b/manager-api/src/main/java/cn/lili/controller/order/AfterSaleManagerController.java index bcf6999c..10748a0b 100644 --- a/manager-api/src/main/java/cn/lili/controller/order/AfterSaleManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/order/AfterSaleManagerController.java @@ -27,7 +27,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/order/AfterSaleReasonManagerController.java b/manager-api/src/main/java/cn/lili/controller/order/AfterSaleReasonManagerController.java index 75a3a54a..916c5bff 100644 --- a/manager-api/src/main/java/cn/lili/controller/order/AfterSaleReasonManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/order/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/order/OrderComplaintManagerController.java b/manager-api/src/main/java/cn/lili/controller/order/OrderComplaintManagerController.java index c95a7be5..e0cf6b43 100644 --- a/manager-api/src/main/java/cn/lili/controller/order/OrderComplaintManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/order/OrderComplaintManagerController.java @@ -31,7 +31,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/order/OrderLogManagerController.java b/manager-api/src/main/java/cn/lili/controller/order/OrderLogManagerController.java index 214fda21..076e5e8b 100644 --- a/manager-api/src/main/java/cn/lili/controller/order/OrderLogManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/order/OrderLogManagerController.java @@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -25,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @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/order/OrderManagerController.java b/manager-api/src/main/java/cn/lili/controller/order/OrderManagerController.java index 4c6b0c4b..00fc6bf8 100644 --- a/manager-api/src/main/java/cn/lili/controller/order/OrderManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/order/OrderManagerController.java @@ -32,7 +32,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/order/PaymentLogManagerController.java b/manager-api/src/main/java/cn/lili/controller/order/PaymentLogManagerController.java index 6e49b39f..daf587fb 100644 --- a/manager-api/src/main/java/cn/lili/controller/order/PaymentLogManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/order/PaymentLogManagerController.java @@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -26,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,收款日志接口") -@RequestMapping("/manager/paymentLog") +@RequestMapping("/manager/order/paymentLog") public class PaymentLogManagerController { @Autowired diff --git a/manager-api/src/main/java/cn/lili/controller/order/ReceiptManagerController.java b/manager-api/src/main/java/cn/lili/controller/order/ReceiptManagerController.java index 3d0026b1..b3c92744 100644 --- a/manager-api/src/main/java/cn/lili/controller/order/ReceiptManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/order/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/order/RefundLogManagerController.java b/manager-api/src/main/java/cn/lili/controller/order/RefundLogManagerController.java index 48d7c4f9..f860c391 100644 --- a/manager-api/src/main/java/cn/lili/controller/order/RefundLogManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/order/RefundLogManagerController.java @@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -25,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,退款日志接口") -@RequestMapping("/manager/refundLog") +@RequestMapping("/manager/order/refundLog") public class RefundLogManagerController { @Autowired private RefundLogService refundLogService; 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 8b069ccc..8556775c 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 @@ -35,7 +35,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 a3da87d4..2ecb8cdd 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 @@ -20,7 +20,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 42a51826..8c78a25d 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 @@ -27,7 +27,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 112b21ab..2e1fbc15 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 @@ -24,7 +24,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 a1ff86b3..c67a0962 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 @@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -26,7 +25,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,验证码资源维护接口") -@RequestMapping("/manager/verificationSource") +@RequestMapping("/manager/other/verificationSource") public class VerificationSourceController { @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..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 @@ -26,7 +26,7 @@ import javax.validation.constraints.NotNull; * @since 2021/5/28 11:56 上午 */ @RestController -@Api(tags = "店铺端,直播间接口") +@Api(tags = "管理端,直播间接口") @RequestMapping("/manager/broadcast/studio") public class StudioManagerController { 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 03bafe02..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.*; @@ -45,7 +44,7 @@ import java.util.List; @Slf4j @RestController @Api(tags = "管理员") -@RequestMapping("/manager/user") +@RequestMapping("/manager/passport/user") @Validated public class AdminUserManagerController { @Autowired 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 93% 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 d8a55e90..b64308d7 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.aop.annotation.DemoSite; import cn.lili.common.aop.annotation.PreventDuplicateSubmissions; @@ -30,7 +30,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,会员接口") -@RequestMapping("/manager/member") +@RequestMapping("/manager/passport/member") public class MemberManagerController { @Autowired private MemberService memberService; @@ -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/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 bf7bf540..6c7c478b 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 12e28cdb..d8897141 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 @@ -28,7 +28,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 bdb19b9c..9afbb2b4 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 @@ -27,7 +27,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 d540bb3f..ca2e3689 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 @@ -23,7 +23,7 @@ import java.util.List; @Slf4j @RestController @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/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 44ec6aac..051eb152 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 @@ -9,7 +9,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @@ -24,7 +23,7 @@ import java.util.List; */ @RestController @Api(tags = "管理端,行政地区管理接口") -@RequestMapping("/manager/region") +@RequestMapping("/manager/setting/region") public class RegionManagerController { @Autowired private RegionService regionService; 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 d68e3bcf..e0f9c48d 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/sms/SmsManagerController.java b/manager-api/src/main/java/cn/lili/controller/sms/SmsManagerController.java index c6bc158f..70026cf7 100644 --- a/manager-api/src/main/java/cn/lili/controller/sms/SmsManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/sms/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/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/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/StoreManagerController.java b/manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java index 329088a4..ae4b8c73 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 4f33f64a..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 @@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -24,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/java/cn/lili/controller/wallet/MemberWalletManagerController.java b/manager-api/src/main/java/cn/lili/controller/wallet/MemberWalletManagerController.java index 927c8816..9b232f4c 100644 --- a/manager-api/src/main/java/cn/lili/controller/wallet/MemberWalletManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/wallet/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/wallet/MemberWithdrawApplyManagerController.java b/manager-api/src/main/java/cn/lili/controller/wallet/MemberWithdrawApplyManagerController.java index c5c5acc1..c97ca7de 100644 --- a/manager-api/src/main/java/cn/lili/controller/wallet/MemberWithdrawApplyManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/wallet/MemberWithdrawApplyManagerController.java @@ -14,7 +14,6 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -29,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,余额提现记录接口") -@RequestMapping("/manager/members/withdraw-apply") +@RequestMapping("/manager/wallet/withdrawApply") public class MemberWithdrawApplyManagerController { @Autowired private MemberWithdrawApplyService memberWithdrawApplyService; diff --git a/manager-api/src/main/java/cn/lili/controller/wallet/RechargeManagerController.java b/manager-api/src/main/java/cn/lili/controller/wallet/RechargeManagerController.java index 2b30a28d..bd624193 100644 --- a/manager-api/src/main/java/cn/lili/controller/wallet/RechargeManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/wallet/RechargeManagerController.java @@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -24,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "管理端,预存款充值记录接口") -@RequestMapping("/manager/recharge") +@RequestMapping("/manager/wallet/recharge") public class RechargeManagerController { @Autowired private RechargeService rechargeService; diff --git a/manager-api/src/main/java/cn/lili/controller/wallet/WalletLogManagerController.java b/manager-api/src/main/java/cn/lili/controller/wallet/WalletLogManagerController.java index 2b95172c..ab3901fb 100644 --- a/manager-api/src/main/java/cn/lili/controller/wallet/WalletLogManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/wallet/WalletLogManagerController.java @@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/manager-api/src/main/java/cn/lili/controller/wechat/WechatMPMessageManagerController.java b/manager-api/src/main/java/cn/lili/controller/wechat/WechatMPMessageManagerController.java index 7e96cdf5..df40f95a 100644 --- a/manager-api/src/main/java/cn/lili/controller/wechat/WechatMPMessageManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/wechat/WechatMPMessageManagerController.java @@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -22,7 +21,7 @@ import java.util.List; */ @RestController @Api(tags = "微信小程序消息订阅接口") -@RequestMapping("/manager/message/wechatMPMessage") +@RequestMapping("/manager/wechat/wechatMPMessage") public class WechatMPMessageManagerController { @Autowired private WechatMPMessageService wechatMPMessageService; diff --git a/manager-api/src/main/java/cn/lili/controller/wechat/WechatMessageManageController.java b/manager-api/src/main/java/cn/lili/controller/wechat/WechatMessageManageController.java index c0a29854..16d45c78 100644 --- a/manager-api/src/main/java/cn/lili/controller/wechat/WechatMessageManageController.java +++ b/manager-api/src/main/java/cn/lili/controller/wechat/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/resources/application.yml b/manager-api/src/main/resources/application.yml index e0d1fafa..397323ae 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 @@ -182,6 +182,11 @@ jasypt: lili: system: isDemoSite: true + # 脱敏级别: + # 0:不做脱敏处理 + # 1:管理端用户手机号等信息脱敏 + # 2:商家端信息脱敏(为2时,表示管理端,商家端同时脱敏) + sensitiveLevel: 1 statistics: # 在线人数统计 X 小时。这里设置48,即统计过去48小时每小时在线人数 onlineMember: 48 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/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/pom.xml b/pom.xml index 4b74886c..9e83ebb2 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ 1.8 - 4.2.3 + 4.2.4 UTF-8 UTF-8 true 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/java/cn/lili/controller/distribution/DistributionGoodsStoreController.java b/seller-api/src/main/java/cn/lili/controller/distribution/DistributionGoodsStoreController.java index c2fb9830..9cbb89cb 100644 --- a/seller-api/src/main/java/cn/lili/controller/distribution/DistributionGoodsStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/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/distribution/DistributionOrderStoreController.java b/seller-api/src/main/java/cn/lili/controller/distribution/DistributionOrderStoreController.java index 21ac76b8..6b714ca8 100644 --- a/seller-api/src/main/java/cn/lili/controller/distribution/DistributionOrderStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/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/goods/CategoryParameterGroupStoreController.java b/seller-api/src/main/java/cn/lili/controller/goods/CategoryParameterGroupStoreController.java index b581f891..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 @@ -6,7 +6,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -22,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 a18c8d73..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 @@ -6,7 +6,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -22,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/CategoryStoreController.java b/seller-api/src/main/java/cn/lili/controller/goods/CategoryStoreController.java index 82732c62..362d46b0 100644 --- a/seller-api/src/main/java/cn/lili/controller/goods/CategoryStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/goods/CategoryStoreController.java @@ -14,7 +14,6 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.CacheConfig; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; 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 3aeabf62..2e3d1c86 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 55f1af36..5aadb600 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 52d8b510..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 @@ -1,17 +1,16 @@ package cn.lili.controller.goods; -import cn.lili.mybatis.util.PageUtil; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.PageVO; import cn.lili.common.vo.ResultMessage; import cn.lili.modules.goods.entity.dos.GoodsUnit; import cn.lili.modules.goods.service.GoodsUnitService; +import cn.lili.mybatis.util.PageUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -24,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 b532786b..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/bill") +@RequestMapping("/store/order/bill") public class BillStoreController { @Autowired diff --git a/seller-api/src/main/java/cn/lili/controller/member/MemberEvaluationStoreController.java b/seller-api/src/main/java/cn/lili/controller/member/MemberEvaluationStoreController.java index fac94dd4..007a348a 100644 --- a/seller-api/src/main/java/cn/lili/controller/member/MemberEvaluationStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/member/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/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/message/StoreMessageController.java b/seller-api/src/main/java/cn/lili/controller/message/StoreMessageController.java index c837d150..bac31ad2 100644 --- a/seller-api/src/main/java/cn/lili/controller/message/StoreMessageController.java +++ b/seller-api/src/main/java/cn/lili/controller/message/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/order/AfterSaleStoreController.java b/seller-api/src/main/java/cn/lili/controller/order/AfterSaleStoreController.java index e643fcdd..a8e99527 100644 --- a/seller-api/src/main/java/cn/lili/controller/order/AfterSaleStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/order/AfterSaleStoreController.java @@ -31,7 +31,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/order/OrderComplaintStoreController.java b/seller-api/src/main/java/cn/lili/controller/order/OrderComplaintStoreController.java index afe5321d..3913294f 100644 --- a/seller-api/src/main/java/cn/lili/controller/order/OrderComplaintStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/order/OrderComplaintStoreController.java @@ -30,7 +30,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/order/OrderLogStoreController.java b/seller-api/src/main/java/cn/lili/controller/order/OrderLogStoreController.java index 8f642521..36d9865e 100644 --- a/seller-api/src/main/java/cn/lili/controller/order/OrderLogStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/order/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/order/OrderStoreController.java b/seller-api/src/main/java/cn/lili/controller/order/OrderStoreController.java index 65330ba4..7ce83b76 100644 --- a/seller-api/src/main/java/cn/lili/controller/order/OrderStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/order/OrderStoreController.java @@ -41,7 +41,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/order/ReceiptStoreController.java b/seller-api/src/main/java/cn/lili/controller/order/ReceiptStoreController.java index 5203cf5c..25c0e45f 100644 --- a/seller-api/src/main/java/cn/lili/controller/order/ReceiptStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/order/ReceiptStoreController.java @@ -27,7 +27,7 @@ import java.util.Objects; **/ @RestController @Api(tags = "店铺端,发票接口") -@RequestMapping("/store/receipt") +@RequestMapping("/store/trade/receipt") public class ReceiptStoreController { @Autowired 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 1697a95b..50f72a53 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/passport/StorePassportController.java b/seller-api/src/main/java/cn/lili/controller/passport/StorePassportController.java index b496271b..8ca5f490 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 @@ -32,7 +32,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 405d5bd6..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/freightTemplate") +@RequestMapping("/store/setting/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 5ecead02..d3b96c59 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 @@ -25,7 +25,7 @@ import java.util.Objects; */ @RestController @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 98b9c040..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/storeAddress") +@RequestMapping("/store/member/storeAddress") public class StoreAddressController { /** 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 a8a2a1bb..3287d59d 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/resources/application.yml b/seller-api/src/main/resources/application.yml index a2cc6037..7ba48b0d 100644 --- a/seller-api/src/main/resources/application.yml +++ b/seller-api/src/main/resources/application.yml @@ -119,7 +119,8 @@ ignored: - /MP_verify_qSyvBPhDsPdxvOhC.txt - /weixin/** - /source/** - - /store/login/** + - /store/passport/login/** + - /store/passport/login/refresh/** - /druid/** - /swagger-ui.html - /doc.html 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 + + + + + + + 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