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(已满)
+
点击快捷加群
##### 交流 qq 2群 875294241
+
点击快捷加群
##### 体验 公众号/小程序/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
+
+ ${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