From 5632c515271943200f4b189204947632bf77ccc9 Mon Sep 17 00:00:00 2001 From: DevDengChao <2325690622@qq.com> Date: Wed, 15 May 2024 13:44:18 +0800 Subject: [PATCH 01/28] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=20DeliveryExpressDO=20=E6=97=B6=E6=8F=90=E7=A4=BA=20i?= =?UTF-8?q?d=20=E8=BF=87=E5=A4=A7=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trade/dal/dataobject/delivery/DeliveryExpressDO.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/delivery/DeliveryExpressDO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/delivery/DeliveryExpressDO.java index 265066d83b..c6b7fbf33c 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/delivery/DeliveryExpressDO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/delivery/DeliveryExpressDO.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.dal.dataobject.delivery; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -20,7 +21,7 @@ public class DeliveryExpressDO extends BaseDO { /** * 编号,自增 */ - @TableId + @TableId(type = IdType.AUTO) private Long id; /** From c68f32cefeecd3afef706f9db677c38ba7c704d6 Mon Sep 17 00:00:00 2001 From: DevDengChao <2325690622@qq.com> Date: Wed, 15 May 2024 13:44:39 +0800 Subject: [PATCH 02/28] =?UTF-8?q?chore:=20=E5=A4=87=E6=B3=A8=E5=9B=A2?= =?UTF-8?q?=E9=95=BF=E7=BF=BB=E8=AF=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/trade/dal/dataobject/order/TradeOrderDO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java index b127004aaa..ba7e689f8f 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java @@ -322,7 +322,7 @@ public class TradeOrderDO extends BaseDO { * * 关联 CombinationRecordDO 的 headId 字段 */ - private Long combinationHeadId; + private Long combinationHeadId; // FIXME 2024/5/15: "团长" 应该译作 leader / starter 而不是 head /** * 拼团记录编号 * From 9c111acfbe8a1e81542e345d2bef59327bc9cc1c Mon Sep 17 00:00:00 2001 From: DevDengChao <2325690622@qq.com> Date: Wed, 15 May 2024 13:44:57 +0800 Subject: [PATCH 03/28] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20TradeOrderUpd?= =?UTF-8?q?ateServiceTest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/TradeOrderUpdateServiceTest.java | 50 +++- .../src/test/resources/sql/create_tables.sql | 275 ++++++++++-------- 2 files changed, 203 insertions(+), 122 deletions(-) diff --git a/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java b/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java index 3f05f55591..2f78dbe08b 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java @@ -1,33 +1,49 @@ package cn.iocoder.yudao.module.trade.service.order; +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.member.api.address.MemberAddressApi; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.pay.api.order.PayOrderApi; import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderRespDTO; import cn.iocoder.yudao.module.pay.enums.order.PayOrderStatusEnum; +import cn.iocoder.yudao.module.product.api.comment.ProductCommentApi; import cn.iocoder.yudao.module.product.api.sku.ProductSkuApi; import cn.iocoder.yudao.module.product.api.spu.ProductSpuApi; import cn.iocoder.yudao.module.promotion.api.coupon.CouponApi; +import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi; +import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.express.DeliveryExpressCreateReqVO; import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderDeliveryReqVO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO; import cn.iocoder.yudao.module.trade.dal.mysql.order.TradeOrderItemMapper; import cn.iocoder.yudao.module.trade.dal.mysql.order.TradeOrderMapper; +import cn.iocoder.yudao.module.trade.dal.redis.no.TradeNoRedisDAO; +import cn.iocoder.yudao.module.trade.enums.delivery.DeliveryTypeEnum; +import cn.iocoder.yudao.module.trade.enums.order.TradeOrderRefundStatusEnum; import cn.iocoder.yudao.module.trade.enums.order.TradeOrderStatusEnum; import cn.iocoder.yudao.module.trade.framework.order.config.TradeOrderConfig; import cn.iocoder.yudao.module.trade.framework.order.config.TradeOrderProperties; +import cn.iocoder.yudao.module.trade.service.cart.CartServiceImpl; +import cn.iocoder.yudao.module.trade.service.delivery.DeliveryExpressService; +import cn.iocoder.yudao.module.trade.service.delivery.DeliveryExpressServiceImpl; +import cn.iocoder.yudao.module.trade.service.message.TradeMessageServiceImpl; +import cn.iocoder.yudao.module.trade.service.order.handler.TradeOrderHandler; +import cn.iocoder.yudao.module.trade.service.price.TradePriceServiceImpl; +import cn.iocoder.yudao.module.trade.service.price.calculator.TradePriceCalculator; +import jakarta.annotation.Resource; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; -import jakarta.annotation.Resource; import java.time.Duration; +import java.util.UUID; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; @@ -37,8 +53,10 @@ import static org.mockito.Mockito.when; * @author LeeYan9 * @since 2022-09-07 */ -@Disabled // TODO 芋艿:后续 fix 补充的单测 -@Import({TradeOrderUpdateServiceImpl.class, TradeOrderConfig.class}) +@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") +@Import({TradeOrderUpdateServiceImpl.class, TradeOrderConfig.class, CartServiceImpl.class, TradePriceServiceImpl.class, + DeliveryExpressServiceImpl.class, TradeMessageServiceImpl.class +}) public class TradeOrderUpdateServiceTest extends BaseDbUnitTest { @Resource @@ -55,7 +73,9 @@ public class TradeOrderUpdateServiceTest extends BaseDbUnitTest { private ProductSpuApi productSpuApi; @MockBean private ProductSkuApi productSkuApi; -// @MockBean + @MockBean + private ProductCommentApi productCommentApi; + // @MockBean // private PriceApi priceApi; @MockBean private PayOrderApi payOrderApi; @@ -66,11 +86,22 @@ public class TradeOrderUpdateServiceTest extends BaseDbUnitTest { @MockBean private TradeOrderProperties tradeOrderProperties; + @MockBean + private TradeNoRedisDAO tradeNoRedisDAO; + @MockBean + private TradeOrderHandler tradeOrderHandler; + @MockBean + private TradePriceCalculator tradePriceCalculator; + @MockBean + private NotifyMessageSendApi notifyMessageSendApi; + @Autowired + private DeliveryExpressService deliveryExpressService; @BeforeEach public void setUp() { when(tradeOrderProperties.getAppId()).thenReturn(888L); when(tradeOrderProperties.getPayExpireTime()).thenReturn(Duration.ofDays(1)); + when(tradeNoRedisDAO.generate(anyString())).thenReturn(UUID.randomUUID().toString()); } // @Test @@ -259,11 +290,18 @@ public class TradeOrderUpdateServiceTest extends BaseDbUnitTest { TradeOrderDO order = randomPojo(TradeOrderDO.class, o -> { o.setId(1L).setStatus(TradeOrderStatusEnum.UNDELIVERED.getStatus()); o.setLogisticsId(null).setLogisticsNo(null).setDeliveryTime(null); + o.setRefundStatus(TradeOrderRefundStatusEnum.NONE.getStatus()); + o.setDeliveryType(DeliveryTypeEnum.EXPRESS.getType()); }); tradeOrderMapper.insert(order); + + DeliveryExpressCreateReqVO expressCreateReqVO = new DeliveryExpressCreateReqVO(); + expressCreateReqVO.setCode("code").setName("Name").setLogo("logo").setSort(0).setStatus(CommonStatusEnum.ENABLE.getStatus()); + Long deliveryExpressId = deliveryExpressService.createDeliveryExpress(expressCreateReqVO); // 准备参数 TradeOrderDeliveryReqVO deliveryReqVO = new TradeOrderDeliveryReqVO().setId(1L) - .setLogisticsId(10L).setLogisticsNo("100"); + .setLogisticsId(deliveryExpressId).setLogisticsNo("100"); + // mock 方法(支付单) // 调用 diff --git a/yudao-module-mall/yudao-module-trade-biz/src/test/resources/sql/create_tables.sql b/yudao-module-mall/yudao-module-trade-biz/src/test/resources/sql/create_tables.sql index d263fdfb92..f619c01de2 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-mall/yudao-module-trade-biz/src/test/resources/sql/create_tables.sql @@ -1,128 +1,155 @@ -CREATE TABLE IF NOT EXISTS "trade_order" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "no" varchar NOT NULL, - "type" int NOT NULL, - "terminal" int NOT NULL, - "user_id" bigint NOT NULL, - "user_ip" varchar NOT NULL, - "user_remark" varchar, - "status" int NOT NULL, - "product_count" int NOT NULL, - "cancel_type" int, - "remark" varchar, - "pay_status" bit NOT NULL, - "pay_time" datetime, - "finish_time" datetime, - "cancel_time" datetime, - "original_price" int NOT NULL, - "order_price" int NOT NULL, - "discount_price" int NOT NULL, - "delivery_price" int NOT NULL, - "adjust_price" int NOT NULL, - "pay_price" int NOT NULL, - "pay_order_id" bigint, - "pay_channel_code" varchar, - "delivery_template_id" bigint, - "logistics_id" bigint, - "logistics_no" varchar, - "delivery_time" datetime, - "receive_time" datetime, - "receiver_name" varchar NOT NULL, - "receiver_mobile" varchar NOT NULL, - "receiver_area_id" int NOT NULL, - "receiver_post_code" int, - "receiver_detail_address" varchar NOT NULL, - "after_sale_status" int NOT NULL, - "refund_price" int NOT NULL, - "coupon_id" bigint NOT NULL, - "coupon_price" int NOT NULL, - "point_price" int NOT NULL, - "creator" varchar DEFAULT '', - "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar DEFAULT '', - "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") +CREATE TABLE IF NOT EXISTS "trade_order" +( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "no" varchar NOT NULL, + "type" int NOT NULL, + "terminal" int NOT NULL, + "user_id" bigint NOT NULL, + "user_ip" varchar NOT NULL, + "user_remark" varchar, + "status" int NOT NULL, + "product_count" int NOT NULL, + "cancel_type" int, + "remark" varchar, + "comment_status" boolean, + "brokerage_user_id" bigint, + "pay_status" bit NOT NULL, + "pay_time" datetime, + "finish_time" datetime, + "cancel_time" datetime, + "total_price" int NULL, + "order_price" int NULL, + "discount_price" int NOT NULL, + "delivery_price" int NOT NULL, + "adjust_price" int NOT NULL, + "pay_price" int NOT NULL, + "delivery_type" int NOT NULL, + "pay_order_id" bigint, + "pay_channel_code" varchar, + "delivery_template_id" bigint, + "logistics_id" bigint, + "logistics_no" varchar, + "delivery_time" datetime, + "receive_time" datetime, + "receiver_name" varchar NOT NULL, + "receiver_mobile" varchar NOT NULL, + "receiver_area_id" int NOT NULL, + "receiver_post_code" int, + "receiver_detail_address" varchar NOT NULL, + "pick_up_store_id" long NULL, + "pick_up_verify_code" varchar NULL, + "refund_status" int NULL, + "refund_price" int NULL, + "after_sale_status" int NULL, + "coupon_id" bigint NOT NULL, + "coupon_price" int NOT NULL, + "use_point" int NULL, + "point_price" int NOT NULL, + "give_point" int NULL, + "refund_point" int NULL, + "vip_price" int NULL, + "seckill_activity_id" long NULL, + "bargain_activity_id" long NULL, + "bargain_record_id" long NULL, + "combination_activity_id" long NULL, + "combination_head_id" long NULL, + "combination_record_id" long NULL, + "creator" varchar DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") ) COMMENT '交易订单表'; -CREATE TABLE IF NOT EXISTS "trade_order_item" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "user_id" bigint NOT NULL, - "order_id" bigint NOT NULL, - "spu_id" bigint NOT NULL, - "spu_name" varchar NOT NULL, - "sku_id" bigint NOT NULL, - "properties" varchar, - "pic_url" varchar, - "count" int NOT NULL, - "original_price" int NOT NULL, - "original_unit_price" int NOT NULL, - "discount_price" int NOT NULL, - "pay_price" int NOT NULL, - "order_part_price" int NOT NULL, - "order_divide_price" int NOT NULL, - "after_sale_status" int NOT NULL, - "creator" varchar DEFAULT '', - "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar DEFAULT '', - "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") +CREATE TABLE IF NOT EXISTS "trade_order_item" +( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "user_id" bigint NOT NULL, + "order_id" bigint NOT NULL, + "cart_id" int NULL, + "spu_id" bigint NOT NULL, + "spu_name" varchar NOT NULL, + "sku_id" bigint NOT NULL, + "properties" varchar, + "pic_url" varchar, + "count" int NOT NULL, + "comment_status" boolean NULL, + "price" int NOT NULL, + "discount_price" int NOT NULL, + "delivery_price" int NULL, + "adjust_price" int NULL, + "pay_price" int NOT NULL, + "coupon_price" int NULL, + "point_price" int NULL, + "use_point" int NULL, + "give_point" int NULL, + "vip_price" int NULL, + "after_sale_id" long NULL, + "after_sale_status" int NOT NULL, + "creator" varchar DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") ) COMMENT '交易订单明细表'; -CREATE TABLE IF NOT EXISTS "trade_after_sale" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "no" varchar NOT NULL, - "status" int NOT NULL, - "type" int NOT NULL, - "way" int NOT NULL, - "user_id" bigint NOT NULL, - "apply_reason" varchar NOT NULL, +CREATE TABLE IF NOT EXISTS "trade_after_sale" +( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "no" varchar NOT NULL, + "status" int NOT NULL, + "type" int NOT NULL, + "way" int NOT NULL, + "user_id" bigint NOT NULL, + "apply_reason" varchar NOT NULL, "apply_description" varchar, "apply_pic_urls" varchar, - "order_id" bigint NOT NULL, - "order_no" varchar NOT NULL, - "order_item_id" bigint NOT NULL, - "spu_id" bigint NOT NULL, - "spu_name" varchar NOT NULL, - "sku_id" bigint NOT NULL, - "properties" varchar, - "pic_url" varchar, - "count" int NOT NULL, - "audit_time" varchar, - "audit_user_id" bigint, - "audit_reason" varchar, - "refund_price" int NOT NULL, - "pay_refund_id" bigint, - "refund_time" varchar, - "logistics_id" bigint, - "logistics_no" varchar, - "delivery_time" varchar, - "receive_time" varchar, + "order_id" bigint NOT NULL, + "order_no" varchar NOT NULL, + "order_item_id" bigint NOT NULL, + "spu_id" bigint NOT NULL, + "spu_name" varchar NOT NULL, + "sku_id" bigint NOT NULL, + "properties" varchar, + "pic_url" varchar, + "count" int NOT NULL, + "audit_time" varchar, + "audit_user_id" bigint, + "audit_reason" varchar, + "refund_price" int NOT NULL, + "pay_refund_id" bigint, + "refund_time" varchar, + "logistics_id" bigint, + "logistics_no" varchar, + "delivery_time" varchar, + "receive_time" varchar, "receive_reason" varchar, - "creator" varchar DEFAULT '', - "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar DEFAULT '', - "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, + "creator" varchar DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, PRIMARY KEY ("id") ) COMMENT '交易售后表'; -CREATE TABLE IF NOT EXISTS "trade_after_sale_log" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "user_id" bigint NOT NULL, - "user_type" int NOT NULL, - "after_sale_id" bigint NOT NULL, - "order_id" bigint NOT NULL, - "order_item_id" bigint NOT NULL, +CREATE TABLE IF NOT EXISTS "trade_after_sale_log" +( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "user_id" bigint NOT NULL, + "user_type" int NOT NULL, + "after_sale_id" bigint NOT NULL, + "order_id" bigint NOT NULL, + "order_item_id" bigint NOT NULL, "before_status" int, - "after_status" int NOT NULL, - "content" varchar NOT NULL, - "creator" varchar DEFAULT '', - "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar DEFAULT '', - "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, + "after_status" int NOT NULL, + "content" varchar NOT NULL, + "creator" varchar DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, PRIMARY KEY ("id") ) COMMENT '交易售后日志'; @@ -161,7 +188,7 @@ CREATE TABLE IF NOT EXISTS "trade_brokerage_record" "updater" varchar DEFAULT '', "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, "deleted" bit NOT NULL DEFAULT FALSE, - "tenant_id" bigint not null default '0', + "tenant_id" bigint not null default '0', PRIMARY KEY ("id") ) COMMENT '佣金记录'; CREATE TABLE IF NOT EXISTS "trade_brokerage_withdraw" @@ -186,6 +213,22 @@ CREATE TABLE IF NOT EXISTS "trade_brokerage_withdraw" "updater" varchar DEFAULT '', "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, "deleted" bit NOT NULL DEFAULT FALSE, - "tenant_id" bigint not null default '0', + "tenant_id" bigint not null default '0', + PRIMARY KEY ("id") +) COMMENT '佣金提现'; + +CREATE TABLE IF NOT EXISTS "trade_delivery_express" +( + "id" int NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "code" varchar NULL, + "name" varchar, + "logo" varchar NULL, + "sort" int NOT NULL, + "status" int NOT NULL, + "creator" varchar DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, PRIMARY KEY ("id") ) COMMENT '佣金提现'; \ No newline at end of file From 5e0a8b44c42fc47a843e054b0486e1ed0b34f27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E9=AB=98?= <171376172@qq.com> Date: Thu, 6 Jun 2024 10:01:47 +0000 Subject: [PATCH 04/28] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=8C=87=E5=AE=9A=E6=9F=90?= =?UTF-8?q?=E4=B8=80=E5=B9=B4=E6=89=A7=E8=A1=8C=E6=97=B6=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E4=BC=9A=E6=89=A7=E8=A1=8C=E4=B8=80=E6=AC=A1=EF=BC=8C=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E6=9F=A5=E7=9C=8B=E4=BB=BB=E5=8A=A1=E8=AF=A6=E7=BB=86?= =?UTF-8?q?=E4=BC=9A=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 高高 <171376172@qq.com> --- .../iocoder/yudao/framework/quartz/core/util/CronUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java index 9b5a2bff78..a97a8e1eb5 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java @@ -46,6 +46,10 @@ public class CronUtils { List nextTimes = new ArrayList<>(n); for (int i = 0; i < n; i++) { Date nextTime = cron.getNextValidTimeAfter(now); + if (nextTime == null) { + // 如果 nextTime 为 null,说明没有更多的有效时间,退出循环 + break; + } nextTimes.add(LocalDateTimeUtil.of(nextTime)); // 切换现在,为下一个触发时间; now = nextTime; From d1c6d741c3f771e1b1198ea8e731c40882f9f2cc Mon Sep 17 00:00:00 2001 From: DevDengChao <2325690622@qq.com> Date: Fri, 7 Jun 2024 10:47:28 +0800 Subject: [PATCH 05/28] =?UTF-8?q?Revert=20"fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=20DeliveryExpressDO=20=E6=97=B6=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=20id=20=E8=BF=87=E5=A4=A7=E7=9A=84=E9=97=AE=E9=A2=98"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5632c515271943200f4b189204947632bf77ccc9. --- .../trade/dal/dataobject/delivery/DeliveryExpressDO.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/delivery/DeliveryExpressDO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/delivery/DeliveryExpressDO.java index c6b7fbf33c..265066d83b 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/delivery/DeliveryExpressDO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/delivery/DeliveryExpressDO.java @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.trade.dal.dataobject.delivery; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -21,7 +20,7 @@ public class DeliveryExpressDO extends BaseDO { /** * 编号,自增 */ - @TableId(type = IdType.AUTO) + @TableId private Long id; /** From 919066dbf0c8df937a7062c11e20c1655a1af221 Mon Sep 17 00:00:00 2001 From: DevDengChao <2325690622@qq.com> Date: Fri, 7 Jun 2024 10:49:11 +0800 Subject: [PATCH 06/28] =?UTF-8?q?refactor:=20=E4=BD=BF=E7=94=A8=20IdUtil.r?= =?UTF-8?q?andomUUID=20=E4=BB=A3=E6=9B=BF=20UUID.randomUUID()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trade/service/order/TradeOrderUpdateServiceTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java b/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java index 2f78dbe08b..108c68a2c5 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.trade.service.order; +import cn.hutool.core.util.IdUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.member.api.address.MemberAddressApi; @@ -38,7 +39,6 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import java.time.Duration; -import java.util.UUID; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; @@ -101,7 +101,7 @@ public class TradeOrderUpdateServiceTest extends BaseDbUnitTest { public void setUp() { when(tradeOrderProperties.getAppId()).thenReturn(888L); when(tradeOrderProperties.getPayExpireTime()).thenReturn(Duration.ofDays(1)); - when(tradeNoRedisDAO.generate(anyString())).thenReturn(UUID.randomUUID().toString()); + when(tradeNoRedisDAO.generate(anyString())).thenReturn(IdUtil.randomUUID()); } // @Test From 30d0b10c99fcc3c20b956fa0ebb3d49f71d7fadf Mon Sep 17 00:00:00 2001 From: DevDengChao <2325690622@qq.com> Date: Wed, 12 Jun 2024 15:20:51 +0800 Subject: [PATCH 07/28] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A2=AB?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E7=9A=84=E8=B4=A6=E6=88=B7=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E7=9F=AD=E4=BF=A1=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E5=86=8D=E6=AC=A1=E7=99=BB=E5=BD=95=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit fcfd68ac1c979374d0916ed87995030c465e9428) --- .../module/member/service/auth/MemberAuthServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java index 7fb1926ce1..6ec7287c11 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java @@ -88,6 +88,12 @@ public class MemberAuthServiceImpl implements MemberAuthService { MemberUserDO user = userService.createUserIfAbsent(reqVO.getMobile(), userIp, getTerminal()); Assert.notNull(user, "获取用户失败,结果为空"); + // 校验是否禁用 + if (ObjectUtil.notEqual(user.getStatus(), CommonStatusEnum.ENABLE.getStatus())) { + createLoginLog(user.getId(), reqVO.getMobile(), LoginLogTypeEnum.LOGIN_SMS, LoginResultEnum.USER_DISABLED); + throw exception(AUTH_LOGIN_USER_DISABLED); + } + // 如果 socialType 非空,说明需要绑定社交用户 String openid = null; if (reqVO.getSocialType() != null) { From f2b7ad5092b07db95e4b7271c0d1cf0593e06b1b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 15 Jun 2024 17:33:54 +0800 Subject: [PATCH 08/28] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91MALL?= =?UTF-8?q?=EF=BC=9ATradeOrderUpdateService=20=E7=9A=84=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/trade/dal/dataobject/order/TradeOrderDO.java | 2 +- .../trade/service/order/TradeOrderUpdateServiceTest.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java index ba7e689f8f..b127004aaa 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java @@ -322,7 +322,7 @@ public class TradeOrderDO extends BaseDO { * * 关联 CombinationRecordDO 的 headId 字段 */ - private Long combinationHeadId; // FIXME 2024/5/15: "团长" 应该译作 leader / starter 而不是 head + private Long combinationHeadId; /** * 拼团记录编号 * diff --git a/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java b/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java index 108c68a2c5..e9677e665c 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java @@ -33,8 +33,8 @@ import cn.iocoder.yudao.module.trade.service.price.TradePriceServiceImpl; import cn.iocoder.yudao.module.trade.service.price.calculator.TradePriceCalculator; import jakarta.annotation.Resource; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; @@ -53,7 +53,7 @@ import static org.mockito.Mockito.when; * @author LeeYan9 * @since 2022-09-07 */ -@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") +@Disabled // TODO 芋艿:后续 fix 补充的单测 @Import({TradeOrderUpdateServiceImpl.class, TradeOrderConfig.class, CartServiceImpl.class, TradePriceServiceImpl.class, DeliveryExpressServiceImpl.class, TradeMessageServiceImpl.class }) @@ -94,7 +94,7 @@ public class TradeOrderUpdateServiceTest extends BaseDbUnitTest { private TradePriceCalculator tradePriceCalculator; @MockBean private NotifyMessageSendApi notifyMessageSendApi; - @Autowired + @MockBean private DeliveryExpressService deliveryExpressService; @BeforeEach From 7eaddd16f9cec7a4eab5bf036fb56e9efd2b20f0 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 15 Jun 2024 17:57:13 +0800 Subject: [PATCH 09/28] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=8C=87=E5=AE=9A=E6=9F=90?= =?UTF-8?q?=E4=B8=80=E5=B9=B4=E6=89=A7=E8=A1=8C=E6=97=B6=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E4=BC=9A=E6=89=A7=E8=A1=8C=E4=B8=80=E6=AC=A1=EF=BC=8C=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E6=9F=A5=E7=9C=8B=E4=BB=BB=E5=8A=A1=E8=AF=A6=E7=BB=86?= =?UTF-8?q?=E4=BC=9A=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/framework/quartz/core/util/CronUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java index a97a8e1eb5..5658fa302a 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java @@ -34,24 +34,24 @@ public class CronUtils { * @return 满足条件的执行时间 */ public static List getNextTimes(String cronExpression, int n) { - // 获得 CronExpression 对象 + // 1. 获得 CronExpression 对象 CronExpression cron; try { cron = new CronExpression(cronExpression); } catch (ParseException e) { throw new IllegalArgumentException(e.getMessage()); } - // 从当前开始计算,n 个满足条件的 + // 2. 从当前开始计算,n 个满足条件的 Date now = new Date(); List nextTimes = new ArrayList<>(n); for (int i = 0; i < n; i++) { Date nextTime = cron.getNextValidTimeAfter(now); + // 2.1 如果 nextTime 为 null,说明没有更多的有效时间,退出循环 if (nextTime == null) { - // 如果 nextTime 为 null,说明没有更多的有效时间,退出循环 break; } nextTimes.add(LocalDateTimeUtil.of(nextTime)); - // 切换现在,为下一个触发时间; + // 2.2 切换现在,为下一个触发时间; now = nextTime; } return nextTimes; From 088871d083cd03f25682e02cc2aedebefa0998d1 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 15 Jun 2024 18:00:46 +0800 Subject: [PATCH 10/28] =?UTF-8?q?bugfix:=20=E5=AF=BC=E5=85=A5=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E5=9C=B0=E5=9D=80=E7=9A=84=E6=97=B6=E5=80=99=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=8E=B7=E5=8F=96areaId=EF=BC=88=E5=8F=AA=E9=92=88?= =?UTF-8?q?=E5=AF=B9=E5=9B=9B=E4=B8=AA=E7=9B=B4=E8=BE=96=E5=B8=82=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/area.csv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/resources/area.csv b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/resources/area.csv index 06954ba6ca..0dd830e22f 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/resources/area.csv +++ b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/resources/area.csv @@ -247,15 +247,15 @@ id,name,type,parentId 246,英属印度洋领地,1,0 247,东萨摩亚,1,0 248,诺福克岛,1,0 -110000,北京,2,1 -120000,天津,2,1 +110000,北京市,2,1 +120000,天津市,2,1 130000,河北省,2,1 140000,山西省,2,1 150000,内蒙古自治区,2,1 210000,辽宁省,2,1 220000,吉林省,2,1 230000,黑龙江省,2,1 -310000,上海,2,1 +310000,上海市,2,1 320000,江苏省,2,1 330000,浙江省,2,1 340000,安徽省,2,1 @@ -268,7 +268,7 @@ id,name,type,parentId 440000,广东省,2,1 450000,广西壮族自治区,2,1 460000,海南省,2,1 -500000,重庆,2,1 +500000,重庆市,2,1 510000,四川省,2,1 520000,贵州省,2,1 530000,云南省,2,1 From 9a9d95f04527bbd51b294bf641dcb4ce6e3bfd06 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 15 Jun 2024 18:04:02 +0800 Subject: [PATCH 11/28] =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=92=8C=E8=A1=A8=E5=90=8D=E7=A7=B0=E4=B8=80=E6=A0=B7=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E5=A6=82=E2=80=9Cshop=E2=80=9D?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=9A=84=E2=80=9Cshop=E2=80=9D=E8=A1=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BB=A3=E7=A0=81=E6=97=B6shop=E9=83=BD?= =?UTF-8?q?=E8=A2=AB=E7=A7=BB=E9=99=A4=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/infra/service/codegen/inner/CodegenEngine.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java index e4b7e18c84..4e742539d5 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java @@ -342,7 +342,8 @@ public class CodegenEngine { // className 相关 // 去掉指定前缀,将 TestDictType 转换成 DictType. 因为在 create 等方法后,不需要带上 Test 前缀 - String simpleClassName = removePrefix(table.getClassName(), upperFirst(table.getModuleName())); + String simpleClassName = equalsAnyIgnoreCase(table.getClassName(), table.getModuleName()) ? table.getClassName() + : removePrefix(table.getClassName(), upperFirst(table.getModuleName())); bindingMap.put("simpleClassName", simpleClassName); bindingMap.put("simpleClassName_underlineCase", toUnderlineCase(simpleClassName)); // 将 DictType 转换成 dict_type bindingMap.put("classNameVar", lowerFirst(simpleClassName)); // 将 DictType 转换成 dictType,用于变量 From 312f7e4890a1d3b5102e54b199234c621f8e6887 Mon Sep 17 00:00:00 2001 From: "dongdong.xiang" Date: Sat, 15 Jun 2024 22:19:07 +0800 Subject: [PATCH 12/28] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=8F=9C=E5=8D=95=E7=B2=BE=E7=AE=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=8E=92=E9=99=A4=E7=88=B6=20ID=20=E9=9D=9E=200=20=E7=9A=84?= =?UTF-8?q?=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/auth/AuthController.java | 1 - .../admin/permission/MenuController.java | 2 +- .../service/permission/MenuServiceImpl.java | 58 +++++++++++++++++-- 3 files changed, 55 insertions(+), 6 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java index cb002d3a2b..8e2871e483 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java @@ -109,7 +109,6 @@ public class AuthController { // 1.3 获得菜单列表 Set menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId)); List menuList = menuService.getMenuList(menuIds); - menuList.removeIf(menu -> !CommonStatusEnum.ENABLE.getStatus().equals(menu.getStatus())); // 移除禁用的菜单 // 2. 拼接结果返回 return success(AuthConvert.INSTANCE.convert(user, roles, menuList)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java index 1041417513..1804096a1a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java @@ -71,7 +71,7 @@ public class MenuController { "在多租户的场景下,会只返回租户所在套餐有的菜单") public CommonResult> getSimpleMenuList() { List list = menuService.getMenuListByTenant( - new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus())); + new MenuListReqVO()); list.sort(Comparator.comparing(MenuDO::getSort)); return success(BeanUtils.toBean(list, MenuSimpleRespVO.class)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java index beee296d11..88aed2a920 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.system.service.permission; import cn.hutool.core.collection.CollUtil; +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuListReqVO; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuSaveVO; @@ -13,14 +14,15 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Collection; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; @@ -106,12 +108,60 @@ public class MenuServiceImpl implements MenuService { @Override public List getMenuListByTenant(MenuListReqVO reqVO) { - List menus = getMenuList(reqVO); + // 查询所有菜单,并过滤掉关闭的节点 + List menus = filterClosedNodes(getMenuList(reqVO)); // 开启多租户的情况下,需要过滤掉未开通的菜单 tenantService.handleTenantMenu(menuIds -> menus.removeIf(menu -> !CollUtil.contains(menuIds, menu.getId()))); return menus; } + /** + * 过滤关闭的菜单节点及其子节点 + * + * @param menuList 所有菜单列表 + * @return 过滤后的菜单列表 + */ + public List filterClosedNodes(List menuList) { + // 根据parentId快速查找子节点 + Map> childrenMap = menuList.stream() + .collect(Collectors.groupingBy(MenuDO::getParentId)); + + // 所有关闭的节点ID + Set closedNodeIds = new HashSet<>(); + + // 标记所有关闭的节点 + for (MenuDO menu : menuList) { + if (Objects.equals(menu.getStatus(), CommonStatusEnum.DISABLE.getStatus())) { + markClosedNodes(menu.getId(), childrenMap, closedNodeIds); + } + } + + // 过滤掉关闭的节点及其子节点 + return menuList.stream() + .filter(menu -> !closedNodeIds.contains(menu.getId())) + .collect(Collectors.toList()); + } + + /** + * 递归标记关闭的节点及其子节点 + * + * @param nodeId 节点ID + * @param childrenMap 子节点Map + * @param closedNodeIds 关闭节点ID集合 + */ + private void markClosedNodes(Long nodeId, Map> childrenMap, + Set closedNodeIds) { + closedNodeIds.add(nodeId); + List children = childrenMap.get(nodeId); + if (CollectionUtils.isNotEmpty(children)) { + for (MenuDO child : children) { + markClosedNodes(child.getId(), childrenMap, closedNodeIds); + } + } + } + + @Override public List getMenuList(MenuListReqVO reqVO) { return menuMapper.selectList(reqVO); @@ -135,7 +185,7 @@ public class MenuServiceImpl implements MenuService { if (CollUtil.isEmpty(ids)) { return Lists.newArrayList(); } - return menuMapper.selectBatchIds(ids); + return filterClosedNodes(menuMapper.selectBatchIds(ids)); } /** From 6419aef36c7a8496407e538bfbfae102c8e49c16 Mon Sep 17 00:00:00 2001 From: "dongdong.xiang" Date: Sun, 16 Jun 2024 21:21:55 +0800 Subject: [PATCH 13/28] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=8F=9C=E5=8D=95=E7=B2=BE=E7=AE=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=8E=92=E9=99=A4=E7=88=B6=20ID=20=E9=9D=9E=200=20=E7=9A=84?= =?UTF-8?q?=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/auth/AuthController.java | 2 ++ .../admin/permission/MenuController.java | 4 ++- .../service/permission/MenuService.java | 8 ++++++ .../service/permission/MenuServiceImpl.java | 28 +++++++++++-------- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java index 8e2871e483..20e9e9d6b9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java @@ -109,6 +109,8 @@ public class AuthController { // 1.3 获得菜单列表 Set menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId)); List menuList = menuService.getMenuList(menuIds); + // 过滤掉关闭的菜单及其子菜单 + menuList = menuService.filterClosedMenus(menuList); // 2. 拼接结果返回 return success(AuthConvert.INSTANCE.convert(user, roles, menuList)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java index 1804096a1a..0ec9ac8049 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java @@ -71,7 +71,9 @@ public class MenuController { "在多租户的场景下,会只返回租户所在套餐有的菜单") public CommonResult> getSimpleMenuList() { List list = menuService.getMenuListByTenant( - new MenuListReqVO()); + new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus())); + // 过滤掉关闭的菜单及其子菜单 + list = menuService.filterClosedMenus(list); list.sort(Comparator.comparing(MenuDO::getSort)); return success(BeanUtils.toBean(list, MenuSimpleRespVO.class)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java index adc2b31518..ed21ce378b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java @@ -52,6 +52,14 @@ public interface MenuService { */ List getMenuListByTenant(MenuListReqVO reqVO); + /** + * 过滤掉关闭的菜单及其子菜单 + * + * @param menuList + * @return + */ + List filterClosedMenus(List menuList); + /** * 筛选菜单列表 * diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java index 88aed2a920..bba798f84d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java @@ -109,7 +109,7 @@ public class MenuServiceImpl implements MenuService { @Override public List getMenuListByTenant(MenuListReqVO reqVO) { // 查询所有菜单,并过滤掉关闭的节点 - List menus = filterClosedNodes(getMenuList(reqVO)); + List menus = getMenuList(reqVO); // 开启多租户的情况下,需要过滤掉未开通的菜单 tenantService.handleTenantMenu(menuIds -> menus.removeIf(menu -> !CollUtil.contains(menuIds, menu.getId()))); return menus; @@ -119,9 +119,13 @@ public class MenuServiceImpl implements MenuService { * 过滤关闭的菜单节点及其子节点 * * @param menuList 所有菜单列表 - * @return 过滤后的菜单列表 + * @return */ - public List filterClosedNodes(List menuList) { + @Override + public List filterClosedMenus(List menuList) { + if(CollectionUtils.isEmpty(menuList)){ + return Collections.emptyList(); + } // 根据parentId快速查找子节点 Map> childrenMap = menuList.stream() .collect(Collectors.groupingBy(MenuDO::getParentId)); @@ -135,8 +139,7 @@ public class MenuServiceImpl implements MenuService { markClosedNodes(menu.getId(), childrenMap, closedNodeIds); } } - - // 过滤掉关闭的节点及其子节点 + // 移除掉关闭的节点及其子节点 return menuList.stream() .filter(menu -> !closedNodeIds.contains(menu.getId())) .collect(Collectors.toList()); @@ -152,12 +155,13 @@ public class MenuServiceImpl implements MenuService { private void markClosedNodes(Long nodeId, Map> childrenMap, Set closedNodeIds) { - closedNodeIds.add(nodeId); - List children = childrenMap.get(nodeId); - if (CollectionUtils.isNotEmpty(children)) { - for (MenuDO child : children) { - markClosedNodes(child.getId(), childrenMap, closedNodeIds); - } + // 如果已经标记过,则直接返回 + if (!closedNodeIds.add(nodeId)) { + return; + } + List children = childrenMap.getOrDefault(nodeId,Collections.emptyList()); + for (MenuDO child : children) { + markClosedNodes(child.getId(), childrenMap, closedNodeIds); } } @@ -185,7 +189,7 @@ public class MenuServiceImpl implements MenuService { if (CollUtil.isEmpty(ids)) { return Lists.newArrayList(); } - return filterClosedNodes(menuMapper.selectBatchIds(ids)); + return menuMapper.selectBatchIds(ids); } /** From 1c7ba5c0d6f2dbb95e916aa45eec32a94103a96f Mon Sep 17 00:00:00 2001 From: "dongdong.xiang" Date: Sun, 16 Jun 2024 22:41:32 +0800 Subject: [PATCH 14/28] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=8F=9C=E5=8D=95=E7=B2=BE=E7=AE=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=8E=92=E9=99=A4=E7=88=B6=20ID=20=E9=9D=9E=200=20=E7=9A=84?= =?UTF-8?q?=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/admin/auth/AuthController.java | 3 ++- .../module/system/service/permission/MenuServiceImpl.java | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java index 20e9e9d6b9..6ebaba2123 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java @@ -109,9 +109,10 @@ public class AuthController { // 1.3 获得菜单列表 Set menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId)); List menuList = menuService.getMenuList(menuIds); - // 过滤掉关闭的菜单及其子菜单 + // 过滤掉关闭的菜单 menuList = menuService.filterClosedMenus(menuList); + menuList.removeIf(menu -> !CommonStatusEnum.ENABLE.getStatus().equals(menu.getStatus())); // 移除禁用的菜单 // 2. 拼接结果返回 return success(AuthConvert.INSTANCE.convert(user, roles, menuList)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java index bba798f84d..104da073d0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java @@ -126,16 +126,18 @@ public class MenuServiceImpl implements MenuService { if(CollectionUtils.isEmpty(menuList)){ return Collections.emptyList(); } + List allMenuList = getMenuList(); + // 根据parentId快速查找子节点 - Map> childrenMap = menuList.stream() + Map> childrenMap = allMenuList.stream() .collect(Collectors.groupingBy(MenuDO::getParentId)); // 所有关闭的节点ID Set closedNodeIds = new HashSet<>(); // 标记所有关闭的节点 - for (MenuDO menu : menuList) { - if (Objects.equals(menu.getStatus(), CommonStatusEnum.DISABLE.getStatus())) { + for (MenuDO menu : allMenuList) { + if (!Objects.equals(menu.getStatus(), CommonStatusEnum.ENABLE.getStatus())) { markClosedNodes(menu.getId(), childrenMap, closedNodeIds); } } From 7deaf1cdbf3f59151c2a466a5d227ab627a959a4 Mon Sep 17 00:00:00 2001 From: "dongdong.xiang" Date: Sun, 16 Jun 2024 22:45:02 +0800 Subject: [PATCH 15/28] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=8F=9C=E5=8D=95=E7=B2=BE=E7=AE=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=8E=92=E9=99=A4=E7=88=B6=20ID=20=E9=9D=9E=200=20=E7=9A=84?= =?UTF-8?q?=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/system/controller/admin/auth/AuthController.java | 1 - 1 file changed, 1 deletion(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java index 6ebaba2123..1192d15b0e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java @@ -112,7 +112,6 @@ public class AuthController { // 过滤掉关闭的菜单 menuList = menuService.filterClosedMenus(menuList); - menuList.removeIf(menu -> !CommonStatusEnum.ENABLE.getStatus().equals(menu.getStatus())); // 移除禁用的菜单 // 2. 拼接结果返回 return success(AuthConvert.INSTANCE.convert(user, roles, menuList)); } From fbfa1050d2d587784ae33cf229bf9fbc79c39bf5 Mon Sep 17 00:00:00 2001 From: "dongdong.xiang" Date: Mon, 17 Jun 2024 22:19:47 +0800 Subject: [PATCH 16/28] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/auth/AuthController.java | 3 +- .../admin/permission/MenuController.java | 3 +- .../service/permission/MenuService.java | 6 +- .../service/permission/MenuServiceImpl.java | 69 ++++++++++--------- 4 files changed, 40 insertions(+), 41 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java index 1192d15b0e..afdf824816 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java @@ -109,8 +109,7 @@ public class AuthController { // 1.3 获得菜单列表 Set menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId)); List menuList = menuService.getMenuList(menuIds); - // 过滤掉关闭的菜单 - menuList = menuService.filterClosedMenus(menuList); + menuList = menuService.filterDisableMenus(menuList); // 2. 拼接结果返回 return success(AuthConvert.INSTANCE.convert(user, roles, menuList)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java index 0ec9ac8049..b6d067f1fb 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java @@ -72,8 +72,7 @@ public class MenuController { public CommonResult> getSimpleMenuList() { List list = menuService.getMenuListByTenant( new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus())); - // 过滤掉关闭的菜单及其子菜单 - list = menuService.filterClosedMenus(list); + list = menuService.filterDisableMenus(list); list.sort(Comparator.comparing(MenuDO::getSort)); return success(BeanUtils.toBean(list, MenuSimpleRespVO.class)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java index ed21ce378b..5c3700db9c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java @@ -55,10 +55,10 @@ public interface MenuService { /** * 过滤掉关闭的菜单及其子菜单 * - * @param menuList - * @return + * @param list 菜单列表 + * @return List 过滤后的菜单列表 */ - List filterClosedMenus(List menuList); + List filterDisableMenus(List list); /** * 筛选菜单列表 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java index 104da073d0..7cc293258a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java @@ -22,6 +22,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; @@ -119,54 +120,54 @@ public class MenuServiceImpl implements MenuService { * 过滤关闭的菜单节点及其子节点 * * @param menuList 所有菜单列表 - * @return + * @return List 过滤后的菜单列表 */ @Override - public List filterClosedMenus(List menuList) { + public List filterDisableMenus(List menuList) { if(CollectionUtils.isEmpty(menuList)){ return Collections.emptyList(); } - List allMenuList = getMenuList(); - // 根据parentId快速查找子节点 - Map> childrenMap = allMenuList.stream() - .collect(Collectors.groupingBy(MenuDO::getParentId)); + Map menuMap = new HashMap<>(); - // 所有关闭的节点ID - Set closedNodeIds = new HashSet<>(); + for (MenuDO menuDO : menuList) { + menuMap.put(menuDO.getId(),menuDO); + } - // 标记所有关闭的节点 - for (MenuDO menu : allMenuList) { - if (!Objects.equals(menu.getStatus(), CommonStatusEnum.ENABLE.getStatus())) { - markClosedNodes(menu.getId(), childrenMap, closedNodeIds); + // 存下递归搜索过被禁用的菜单,防止重复的搜索 + Set disabledMenuIds = new HashSet<>(); + + List enabledMenus = new ArrayList<>(); + for (MenuDO menu : menuList) { + if (!isMenuDisabled(menu, menuMap, disabledMenuIds)) { + enabledMenus.add(menu); } } - // 移除掉关闭的节点及其子节点 - return menuList.stream() - .filter(menu -> !closedNodeIds.contains(menu.getId())) - .collect(Collectors.toList()); + return enabledMenus; } - /** - * 递归标记关闭的节点及其子节点 - * - * @param nodeId 节点ID - * @param childrenMap 子节点Map - * @param closedNodeIds 关闭节点ID集合 - */ - private void markClosedNodes(Long nodeId, Map> childrenMap, - Set closedNodeIds) { - // 如果已经标记过,则直接返回 - if (!closedNodeIds.add(nodeId)) { - return; + private boolean isMenuDisabled(MenuDO node, Map menuMap, Set disabledMenuIds) { + if (disabledMenuIds.contains(node.getId())) { + return true; } - List children = childrenMap.getOrDefault(nodeId,Collections.emptyList()); - for (MenuDO child : children) { - markClosedNodes(child.getId(), childrenMap, closedNodeIds); - } - } + Long parentId = node.getParentId(); + if (parentId == 0) { + if (!node.getStatus().equals(CommonStatusEnum.ENABLE.getStatus())) { + disabledMenuIds.add(node.getId()); + return true; + } + return false; + } + + MenuDO parent = menuMap.get(parentId); + if (parent == null || isMenuDisabled(parent, menuMap, disabledMenuIds)) { + disabledMenuIds.add(node.getId()); + return true; + } + + return false; + } @Override public List getMenuList(MenuListReqVO reqVO) { From 3da2449a151143333985f739545b762459e5aafe Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 18 Jun 2024 09:20:49 +0800 Subject: [PATCH 17/28] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91SYSTE?= =?UTF-8?q?M=EF=BC=9A=E8=8E=B7=E5=8F=96=E8=8F=9C=E5=8D=95=E7=B2=BE?= =?UTF-8?q?=E7=AE=80=E4=BF=A1=E6=81=AF=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=8E=92=E9=99=A4=E7=88=B6=20ID=20=E9=9D=9E?= =?UTF-8?q?=200=20=E7=9A=84=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/permission/MenuService.java | 2 +- .../service/permission/MenuServiceImpl.java | 48 ++++++++----------- 2 files changed, 20 insertions(+), 30 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java index 5c3700db9c..d74dc61340 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java @@ -56,7 +56,7 @@ public interface MenuService { * 过滤掉关闭的菜单及其子菜单 * * @param list 菜单列表 - * @return List 过滤后的菜单列表 + * @return 过滤后的菜单列表 */ List filterDisableMenus(List list); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java index 7cc293258a..730958f82e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.system.service.permission; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuListReqVO; @@ -14,7 +15,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections4.CollectionUtils; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.context.annotation.Lazy; @@ -22,11 +22,10 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; import static cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO.ID_ROOT; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; @@ -116,56 +115,47 @@ public class MenuServiceImpl implements MenuService { return menus; } - /** - * 过滤关闭的菜单节点及其子节点 - * - * @param menuList 所有菜单列表 - * @return List 过滤后的菜单列表 - */ @Override public List filterDisableMenus(List menuList) { - if(CollectionUtils.isEmpty(menuList)){ + if (CollUtil.isEmpty(menuList)){ return Collections.emptyList(); } + Map menuMap = convertMap(menuList, MenuDO::getId); - Map menuMap = new HashMap<>(); - - for (MenuDO menuDO : menuList) { - menuMap.put(menuDO.getId(),menuDO); - } - - // 存下递归搜索过被禁用的菜单,防止重复的搜索 - Set disabledMenuIds = new HashSet<>(); - + // 遍历 menu 菜单,查找不是禁用的菜单,添加到 enabledMenus 结果 List enabledMenus = new ArrayList<>(); + Set disabledMenuCache = new HashSet<>(); // 存下递归搜索过被禁用的菜单,防止重复的搜索 for (MenuDO menu : menuList) { - if (!isMenuDisabled(menu, menuMap, disabledMenuIds)) { - enabledMenus.add(menu); + if (isMenuDisabled(menu, menuMap, disabledMenuCache)) { + continue; } + enabledMenus.add(menu); } return enabledMenus; } - private boolean isMenuDisabled(MenuDO node, Map menuMap, Set disabledMenuIds) { - if (disabledMenuIds.contains(node.getId())) { + private boolean isMenuDisabled(MenuDO node, Map menuMap, Set disabledMenuCache) { + // 如果已经判定是禁用的节点,直接结束 + if (disabledMenuCache.contains(node.getId())) { return true; } + // 1. 遍历到 parentId 为根节点,则无需判断 Long parentId = node.getParentId(); - if (parentId == 0) { - if (!node.getStatus().equals(CommonStatusEnum.ENABLE.getStatus())) { - disabledMenuIds.add(node.getId()); + if (ObjUtil.equal(parentId, ID_ROOT)) { + if (CommonStatusEnum.isDisable(node.getStatus())) { + disabledMenuCache.add(node.getId()); return true; } return false; } + // 2. 继续遍历 parent 节点 MenuDO parent = menuMap.get(parentId); - if (parent == null || isMenuDisabled(parent, menuMap, disabledMenuIds)) { - disabledMenuIds.add(node.getId()); + if (parent == null || isMenuDisabled(parent, menuMap, disabledMenuCache)) { + disabledMenuCache.add(node.getId()); return true; } - return false; } From 144bfb85a4faec1089dd7b32b52c6148d1406f81 Mon Sep 17 00:00:00 2001 From: "dongdong.xiang" Date: Tue, 18 Jun 2024 22:07:58 +0800 Subject: [PATCH 18/28] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=95=86=E5=93=81=20SPU=20=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=E6=97=B6=EF=BC=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=BC=9A=E5=87=BA=E7=8E=B0=E9=94=99=E4=B9=B1=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/product/dal/mysql/spu/ProductSpuMapper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/ProductSpuMapper.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/ProductSpuMapper.java index 68f2d210f4..cf8ae64837 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/ProductSpuMapper.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/ProductSpuMapper.java @@ -30,7 +30,8 @@ public interface ProductSpuMapper extends BaseMapperX { .likeIfPresent(ProductSpuDO::getName, reqVO.getName()) .eqIfPresent(ProductSpuDO::getCategoryId, reqVO.getCategoryId()) .betweenIfPresent(ProductSpuDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(ProductSpuDO::getSort); + .orderByDesc(ProductSpuDO::getSort) + .orderByDesc(ProductSpuDO::getId); appendTabQuery(tabType, queryWrapper); return selectPage(reqVO, queryWrapper); } From e1f98c977787ead93089ea5dd654d8265dae3252 Mon Sep 17 00:00:00 2001 From: DevDengChao <2325690622@qq.com> Date: Thu, 20 Jun 2024 09:32:51 +0800 Subject: [PATCH 19/28] =?UTF-8?q?chore:=20=E4=BD=BF=E7=94=A8=20CommonStatu?= =?UTF-8?q?sEnum.isDisable()=20=E5=88=A4=E6=96=AD=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E8=B4=A6=E6=88=B7=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/member/service/auth/MemberAuthServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java index 6ec7287c11..69d9252b89 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java @@ -89,7 +89,7 @@ public class MemberAuthServiceImpl implements MemberAuthService { Assert.notNull(user, "获取用户失败,结果为空"); // 校验是否禁用 - if (ObjectUtil.notEqual(user.getStatus(), CommonStatusEnum.ENABLE.getStatus())) { + if (CommonStatusEnum.isDisable(user.getStatus())) { createLoginLog(user.getId(), reqVO.getMobile(), LoginLogTypeEnum.LOGIN_SMS, LoginResultEnum.USER_DISABLED); throw exception(AUTH_LOGIN_USER_DISABLED); } @@ -183,7 +183,7 @@ public class MemberAuthServiceImpl implements MemberAuthService { throw exception(AUTH_LOGIN_BAD_CREDENTIALS); } // 校验是否禁用 - if (ObjectUtil.notEqual(user.getStatus(), CommonStatusEnum.ENABLE.getStatus())) { + if (CommonStatusEnum.isDisable(user.getStatus())) { createLoginLog(user.getId(), mobile, logTypeEnum, LoginResultEnum.USER_DISABLED); throw exception(AUTH_LOGIN_USER_DISABLED); } From 01b0866aa4b94483a8152be1392b263606c42d47 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 22 Jun 2024 08:37:06 +0800 Subject: [PATCH 20/28] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E4=BA=86?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=90=8D=E6=8B=BC=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/system/enums/oauth2/OAuth2GrantTypeEnum.java | 2 +- .../system/controller/admin/oauth2/OAuth2OpenController.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2GrantTypeEnum.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2GrantTypeEnum.java index 80ce4610bc..0b09fe5b02 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2GrantTypeEnum.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2GrantTypeEnum.java @@ -22,7 +22,7 @@ public enum OAuth2GrantTypeEnum { private final String grantType; - public static OAuth2GrantTypeEnum getByGranType(String grantType) { + public static OAuth2GrantTypeEnum getByGrantType(String grantType) { return ArrayUtil.firstMatch(o -> o.getGrantType().equals(grantType), values()); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java index 114a156ab8..fd37be87cf 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java @@ -105,7 +105,7 @@ public class OAuth2OpenController { @RequestParam(value = "refresh_token", required = false) String refreshToken) { // 刷新模式 List scopes = OAuth2Utils.buildScopes(scope); // 1.1 校验授权类型 - OAuth2GrantTypeEnum grantTypeEnum = OAuth2GrantTypeEnum.getByGranType(grantType); + OAuth2GrantTypeEnum grantTypeEnum = OAuth2GrantTypeEnum.getByGrantType(grantType); if (grantTypeEnum == null) { throw exception0(BAD_REQUEST.getCode(), StrUtil.format("未知授权类型({})", grantType)); } From 90ea7b951cb0468e283401c92e9de1ac428e08d7 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 22 Jun 2024 08:48:25 +0800 Subject: [PATCH 21/28] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=EF=BC=8CRemove=20duplicate?= =?UTF-8?q?=20package=20imports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/codegen/java/controller/vo/respVO.vm | 1 - 1 file changed, 1 deletion(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm index 54c16671d6..24c3519451 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm @@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; ## 处理 BigDecimal 字段的引入 -import java.util.*; #foreach ($column in $columns) #if (${column.javaType} == "BigDecimal") import java.math.BigDecimal; From a5fbad31d1054501f99d14badbe323c7d921d8cb Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 22 Jun 2024 08:50:12 +0800 Subject: [PATCH 22/28] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91ERP?= =?UTF-8?q?=EF=BC=9A=E9=87=87=E8=B4=AD=E9=87=91=E9=A2=9D=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/erp/service/purchase/ErpPurchaseInServiceImpl.java | 2 +- .../erp/service/purchase/ErpPurchaseReturnServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseInServiceImpl.java b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseInServiceImpl.java index 8a521d5acc..3f08f6c037 100644 --- a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseInServiceImpl.java +++ b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseInServiceImpl.java @@ -140,7 +140,7 @@ public class ErpPurchaseInServiceImpl implements ErpPurchaseInService { purchaseIn.setDiscountPercent(BigDecimal.ZERO); } purchaseIn.setDiscountPrice(MoneyUtils.priceMultiplyPercent(purchaseIn.getTotalPrice(), purchaseIn.getDiscountPercent())); - purchaseIn.setTotalPrice(purchaseIn.getTotalPrice().subtract(purchaseIn.getDiscountPrice().add(purchaseIn.getOtherPrice()))); + purchaseIn.setTotalPrice(purchaseIn.getTotalPrice().subtract(purchaseIn.getDiscountPrice()).add(purchaseIn.getOtherPrice())); } private void updatePurchaseOrderInCount(Long orderId) { diff --git a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseReturnServiceImpl.java b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseReturnServiceImpl.java index 9403c0b141..e02066f5c5 100644 --- a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseReturnServiceImpl.java +++ b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseReturnServiceImpl.java @@ -136,7 +136,7 @@ public class ErpPurchaseReturnServiceImpl implements ErpPurchaseReturnService { purchaseReturn.setDiscountPercent(BigDecimal.ZERO); } purchaseReturn.setDiscountPrice(MoneyUtils.priceMultiplyPercent(purchaseReturn.getTotalPrice(), purchaseReturn.getDiscountPercent())); - purchaseReturn.setTotalPrice(purchaseReturn.getTotalPrice().subtract(purchaseReturn.getDiscountPrice().add(purchaseReturn.getOtherPrice()))); + purchaseReturn.setTotalPrice(purchaseReturn.getTotalPrice().subtract(purchaseReturn.getDiscountPrice()).add(purchaseReturn.getOtherPrice())); } private void updatePurchaseOrderReturnCount(Long orderId) { From e216849921166a1555a612eb94e86d5793455117 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 22 Jun 2024 10:38:59 +0800 Subject: [PATCH 23/28] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91MEMBE?= =?UTF-8?q?R=EF=BC=9A=E4=BC=9A=E5=91=98=E7=AD=BE=E5=88=B0=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=20Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/signin/MemberSignInRecordServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java index cdf32105ab..d7c3b8e9fb 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java @@ -75,11 +75,12 @@ public class MemberSignInRecordServiceImpl implements MemberSignInRecordService } summary.setTodaySignIn(DateUtils.isToday(lastRecord.getCreateTime())); - // 4.1 校验今天是否签到,没有签到则直接返回 - if (!summary.getTodaySignIn()) { + // 4.1 检查今天是否未签到且记录不是昨天创建的,如果是则直接返回 + if (!summary.getTodaySignIn() && !DateUtils.isYesterday(lastRecord.getCreateTime())) { return summary; } - // 4.2 连续签到天数 + + // 4.2 要么是今天签到了,要么是昨天的记录,设置连续签到天数 summary.setContinuousDay(lastRecord.getDay()); return summary; } From 7786233ae82e3fdb32ec78342ca061bc0cd36ad2 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 22 Jun 2024 14:26:50 +0800 Subject: [PATCH 24/28] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91BPM?= =?UTF-8?q?=EF=BC=9A=E5=A4=9A=E7=A7=9F=E6=88=B7=E4=BD=BF=E7=94=A8=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=B5=81=E7=A8=8B=E6=A0=87=E8=AF=86=20key=20?= =?UTF-8?q?=E6=97=B6=E6=9F=A5=E8=AF=A2=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/bpm/service/definition/BpmModelServiceImpl.java | 4 +++- .../service/definition/BpmProcessDefinitionServiceImpl.java | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelServiceImpl.java index abfa0d568d..7c4dae618e 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelServiceImpl.java @@ -262,7 +262,9 @@ public class BpmModelServiceImpl implements BpmModelService { } private Model getModelByKey(String key) { - return repositoryService.createModelQuery().modelKey(key).singleResult(); + return repositoryService.createModelQuery() + .modelTenantId(FlowableUtils.getTenantId()) + .modelKey(key).singleResult(); } @Override diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmProcessDefinitionServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmProcessDefinitionServiceImpl.java index a11fdbac88..99470f6a52 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmProcessDefinitionServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmProcessDefinitionServiceImpl.java @@ -79,7 +79,9 @@ public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionServ @Override public ProcessDefinition getActiveProcessDefinition(String key) { - return repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).active().singleResult(); + return repositoryService.createProcessDefinitionQuery() + .processDefinitionTenantId(FlowableUtils.getTenantId()) + .processDefinitionKey(key).active().singleResult(); } @Override @@ -172,6 +174,7 @@ public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionServ @Override public PageResult getProcessDefinitionPage(BpmProcessDefinitionPageReqVO pageVO) { ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery(); + query.processDefinitionTenantId(FlowableUtils.getTenantId()); if (StrUtil.isNotBlank(pageVO.getKey())) { query.processDefinitionKey(pageVO.getKey()); } From 19407f6dcef2eed560d423a2dc3085603a538c70 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 6 Jul 2024 20:06:56 +0800 Subject: [PATCH 25/28] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E3=80=91AI=EF=BC=9A=E5=A4=A7=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=9A=84=E4=BB=8B=E7=BB=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .image/common/ai-feature.jpg | Bin 0 -> 21239 bytes README.md | 9 ++++++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .image/common/ai-feature.jpg diff --git a/.image/common/ai-feature.jpg b/.image/common/ai-feature.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b4a55f547c85650d1b34e0bf0852a40634ecc99f GIT binary patch literal 21239 zcmce;1za3Sw>LbvyK8WF4Z+>r26wlhfdIjRySux)1`qCTAwX~l5Zn^r9g^LB^4z<7 z?|tR_iurY)u2WUV{&l*hx`(HwrwstAjD)lV01ONO00aF2o<0FY0q`&|a4^vDaIkO) z2=Is~c&I4I$SB0vIOup3Bvh2-B;;f?j65tfbX@dg_^K{>A@)NI}SQ=KcF{5FXA< zLjPU`x`O}S{aYO-DgaE>cDX+1x4K^>m_gBBb>OT(y1``qyMVMLjS<%p0Q7R*p4MO7 zzXnFj#i6PNB+lE2u05>W3_{v-k5^rhxP&sTQoOs+A1 zRsTtVcgg)p0>H55>PeojxW4Yve}X|7n*zKOR!k zJ%$5o-~U!0jt~Usxo0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SHu_n?Yb5Rjkx8L`CqC%@NQIGqjs@3A20K28{%~p* mKhyoTgm1@ZDcM_`%s-~;|KNU 友情提示:本项目基于 RuoYi-Vue 修改,**重构优化**后端的代码,**美化**前端的界面。 > @@ -248,6 +248,12 @@ 演示地址: +### AI 大模型 + +![功能图](/.image/common/ai-feature.png) + +演示地址: + ## 🐨 技术栈 ### 模块 @@ -265,6 +271,7 @@ | `yudao-module-mall` | 商城系统的 Module 模块 | | `yudao-module-erp` | ERP 系统的 Module 模块 | | `yudao-module-crm` | CRM 系统的 Module 模块 | +| `yudao-module-ai` | AI 大模型的 Module 模块 | | `yudao-module-mp` | 微信公众号的 Module 模块 | | `yudao-module-report` | 大屏报表 Module 模块 | From 826a7e0ac0cf06cf4b259b532890aa49cf86ef43 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 6 Jul 2024 20:08:12 +0800 Subject: [PATCH 26/28] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E3=80=91AI=EF=BC=9A=E5=A4=A7=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=9A=84=E4=BB=8B=E7=BB=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .image/common/{ai-feature.jpg => ai-feature.png} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename .image/common/{ai-feature.jpg => ai-feature.png} (100%) diff --git a/.image/common/ai-feature.jpg b/.image/common/ai-feature.png similarity index 100% rename from .image/common/ai-feature.jpg rename to .image/common/ai-feature.png From 6a24025afadd7550640dfc94b672f9f531c9a191 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 7 Jul 2024 09:08:33 +0800 Subject: [PATCH 27/28] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E5=B7=A5=E5=85=B7=E7=B1=BB=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=20#585?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/iocoder/yudao/framework/ip/core/utils/AreaUtilsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/test/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtilsTest.java b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/test/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtilsTest.java index 8f5646b337..cc23819c49 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/test/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtilsTest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/test/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtilsTest.java @@ -28,7 +28,7 @@ public class AreaUtilsTest { @Test public void testFormat() { - assertEquals(AreaUtils.format(110105), "北京 北京市 朝阳区"); + assertEquals(AreaUtils.format(110105), "北京市 北京市 朝阳区"); assertEquals(AreaUtils.format(1), "中国"); assertEquals(AreaUtils.format(2), "蒙古"); } From a0020f033980ab047e0fb37004d03327dcebbbf9 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 7 Jul 2024 09:13:42 +0800 Subject: [PATCH 28/28] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=BB=E5=AD=90?= =?UTF-8?q?=E8=A1=A8ERP=E6=A8=A1=E5=BC=8F=E4=B8=8B=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E4=B8=8D=E5=85=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20#583?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/codegen/java/dal/mapper_sub.vm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm index e5589e99df..6ccaea79ea 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm @@ -29,6 +29,12 @@ public interface ${subTable.className}Mapper extends BaseMapperX<${subTable.clas .orderByDesc(${subTable.className}DO::getId));## 大多数情况下,id 倒序 } +## 主表与子表是一对一时 + #if (!$subTable.subJoinMany) + default ${subTable.className}DO selectBy${SubJoinColumnName}(${subJoinColumn.javaType} ${subJoinColumn.javaField}) { + return selectOne(${subTable.className}DO::get${SubJoinColumnName}, ${subJoinColumn.javaField}); + } + #end ## 情况二:非 MASTER_ERP 时,需要列表查询子表 #else @@ -48,4 +54,4 @@ public interface ${subTable.className}Mapper extends BaseMapperX<${subTable.clas return delete(${subTable.className}DO::get${SubJoinColumnName}, ${subJoinColumn.javaField}); } -} \ No newline at end of file +}