fix:seckillTime => seckillConfig

This commit is contained in:
puhui999 2023-06-17 21:17:02 +08:00
parent 217a31a123
commit 32cca12cd2
28 changed files with 1056 additions and 661 deletions

View File

@ -1797,27 +1797,112 @@ INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT"
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2046,'满减送活动关闭','promotion:reward-activity:close',3,5,2041,'','','',null,0,1,1,1,'1','2022-11-05 10:42:53','1','2022-11-05 10:42:53',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2047,'限时折扣活动','',2,7,2030,'discount-activity','time','mall/promotion/discountActivity/index','PromotionDiscountActivity',0,1,1,1,'','2022-11-05 17:12:15','1','2023-04-08 11:45:44',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2048,'限时折扣活动查询','promotion:discount-activity:query',3,1,2047,'','','',null,0,1,1,1,'','2022-11-05 17:12:15','','2022-11-05 17:12:15',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2049,'限时折扣活动创建','promotion:discount-activity:create',3,2,2047,'','','',null,0,1,1,1,'','2022-11-05 17:12:15','','2022-11-05 17:12:15',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2050,'限时折扣活动更新','promotion:discount-activity:update',3,3,2047,'','','',null,0,1,1,1,'','2022-11-05 17:12:16','','2022-11-05 17:12:16',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2051,'限时折扣活动删除','promotion:discount-activity:delete',3,4,2047,'','','',null,0,1,1,1,'','2022-11-05 17:12:16','','2022-11-05 17:12:16',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2052,'限时折扣活动关闭','promotion:discount-activity:close',3,5,2047,'','','',null,0,1,1,1,'','2022-11-05 17:12:16','','2022-11-05 17:12:16',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2059,'秒杀活动管理','',2,0,2030,'seckill-activity','time-range','mall/promotion/seckill/seckillActivity/index','PromotionSeckillActivity',0,1,1,1,'','2022-11-06 22:24:49','1','2023-04-08 11:46:02',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2060,'秒杀活动查询','promotion:seckill-activity:query',3,1,2059,'','','',null,0,1,1,1,'','2022-11-06 22:24:49','','2022-11-06 22:24:49',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2061,'秒杀活动创建','promotion:seckill-activity:create',3,2,2059,'','','',null,0,1,1,1,'','2022-11-06 22:24:49','','2022-11-06 22:24:49',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2062,'秒杀活动更新','promotion:seckill-activity:update',3,3,2059,'','','',null,0,1,1,1,'','2022-11-06 22:24:49','','2022-11-06 22:24:49',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2063,'秒杀活动删除','promotion:seckill-activity:delete',3,4,2059,'','','',null,0,1,1,1,'','2022-11-06 22:24:49','','2022-11-06 22:24:49',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2064,'秒杀活动导出','promotion:seckill-activity:export',3,5,2059,'','','',null,0,1,1,1,'','2022-11-06 22:24:49','','2022-11-06 22:24:49',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2066,'秒杀时段管理','',2,0,2030,'seckill-time','','mall/promotion/seckill/seckillTime/index','PromotionSeckillTime',0,0,1,1,'','2022-11-15 19:46:50','1','2023-04-08 11:46:17',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2067,'秒杀时段查询','promotion:seckill-time:query',3,1,2066,'','','',null,0,1,1,1,'','2022-11-15 19:46:51','','2022-11-15 19:46:51',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2068,'秒杀时段创建','promotion:seckill-time:create',3,2,2066,'','','',null,0,1,1,1,'','2022-11-15 19:46:51','','2022-11-15 19:46:51',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2069,'秒杀时段更新','promotion:seckill-time:update',3,3,2066,'','','',null,0,1,1,1,'','2022-11-15 19:46:51','','2022-11-15 19:46:51',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2070,'秒杀时段删除','promotion:seckill-time:delete',3,4,2066,'','','',null,0,1,1,1,'','2022-11-15 19:46:51','','2022-11-15 19:46:51',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2071,'秒杀时段导出','promotion:seckill-time:export',3,5,2066,'','','',null,0,1,1,1,'','2022-11-15 19:46:51','','2022-11-15 19:46:51',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2072,'订单中心','',1,65,0,'/trade','order',null,null,0,1,1,1,'1','2022-11-19 18:57:19','1','2022-12-10 16:32:57',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2073,'售后退款','',2,1,2072,'trade/after-sale','education','mall/trade/afterSale/index','TradeAfterSale',0,1,1,1,'','2022-11-19 20:15:32','1','2023-04-08 11:43:19',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2074,'售后查询','trade:after-sale:query',3,1,2073,'','','',null,0,1,1,1,'','2022-11-19 20:15:33','1','2022-12-10 21:04:29',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2075,'秒杀活动关闭','promotion:sekill-activity:close',3,6,2059,'','','',null,0,1,1,1,'1','2022-11-28 20:20:15','1','2022-11-28 20:20:15',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2076,'订单列表','',2,0,2072,'trade/order','list','mall/trade/order/index','TradeOrder',0,1,1,1,'1','2022-12-10 21:05:44','1','2023-04-08 11:42:23',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2049, '限时折扣活动创建', 'promotion:discount-activity:create', 3, 2, 2047, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-05 17:12:15', '', '2022-11-05 17:12:15', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2050, '限时折扣活动更新', 'promotion:discount-activity:update', 3, 3, 2047, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-05 17:12:16', '', '2022-11-05 17:12:16', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2051, '限时折扣活动删除', 'promotion:discount-activity:delete', 3, 4, 2047, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-05 17:12:16', '', '2022-11-05 17:12:16', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2052, '限时折扣活动关闭', 'promotion:discount-activity:close', 3, 5, 2047, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-05 17:12:16', '', '2022-11-05 17:12:16', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2059, '秒杀活动管理', '', 2, 0, 2030, 'seckill-activity', 'time-range',
'mall/promotion/seckill/seckillActivity/index', 'PromotionSeckillActivity', 0, 1, 1, 1, '',
'2022-11-06 22:24:49', '1', '2023-04-08 11:46:02', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2060, '秒杀活动查询', 'promotion:seckill-activity:query', 3, 1, 2059, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-06 22:24:49', '', '2022-11-06 22:24:49', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2061, '秒杀活动创建', 'promotion:seckill-activity:create', 3, 2, 2059, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-06 22:24:49', '', '2022-11-06 22:24:49', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2062, '秒杀活动更新', 'promotion:seckill-activity:update', 3, 3, 2059, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-06 22:24:49', '', '2022-11-06 22:24:49', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2063, '秒杀活动删除', 'promotion:seckill-activity:delete', 3, 4, 2059, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-06 22:24:49', '', '2022-11-06 22:24:49', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2064, '秒杀活动导出', 'promotion:seckill-activity:export', 3, 5, 2059, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-06 22:24:49', '', '2022-11-06 22:24:49', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2066, '秒杀时段管理', '', 2, 0, 2030, 'seckill-time', '', 'mall/promotion/seckill/SeckillConfig/index',
'PromotionSeckillConfig', 0, 0, 1, 1, '', '2022-11-15 19:46:50', '1', '2023-04-08 11:46:17', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2067, '秒杀时段查询', 'promotion:seckill-time:query', 3, 1, 2066, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-15 19:46:51', '', '2022-11-15 19:46:51', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2068, '秒杀时段创建', 'promotion:seckill-time:create', 3, 2, 2066, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-15 19:46:51', '', '2022-11-15 19:46:51', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2069, '秒杀时段更新', 'promotion:seckill-time:update', 3, 3, 2066, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-15 19:46:51', '', '2022-11-15 19:46:51', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2070, '秒杀时段删除', 'promotion:seckill-time:delete', 3, 4, 2066, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-15 19:46:51', '', '2022-11-15 19:46:51', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2071, '秒杀时段导出', 'promotion:seckill-time:export', 3, 5, 2066, '', '', '', null, 0, 1, 1, 1, '',
'2022-11-15 19:46:51', '', '2022-11-15 19:46:51', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2072, '订单中心', '', 1, 65, 0, '/trade', 'order', null, null, 0, 1, 1, 1, '1', '2022-11-19 18:57:19', '1',
'2022-12-10 16:32:57', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2073, '售后退款', '', 2, 1, 2072, 'trade/after-sale', 'education', 'mall/trade/afterSale/index',
'TradeAfterSale', 0, 1, 1, 1, '', '2022-11-19 20:15:32', '1', '2023-04-08 11:43:19', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2074, '售后查询', 'trade:after-sale:query', 3, 1, 2073, '', '', '', null, 0, 1, 1, 1, '', '2022-11-19 20:15:33',
'1', '2022-12-10 21:04:29', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2075, '秒杀活动关闭', 'promotion:sekill-activity:close', 3, 6, 2059, '', '', '', null, 0, 1, 1, 1, '1',
'2022-11-28 20:20:15', '1', '2022-11-28 20:20:15', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID", "NAME", "PERMISSION", "TYPE", "SORT", "PARENT_ID", "PATH", "ICON",
"COMPONENT", "COMPONENT_NAME", "STATUS", "VISIBLE", "KEEP_ALIVE",
"ALWAYS_SHOW", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED")
VALUES (2076, '订单列表', '', 2, 0, 2072, 'trade/order', 'list', 'mall/trade/order/index', 'TradeOrder', 0, 1, 1, 1,
'1', '2022-12-10 21:05:44', '1', '2023-04-08 11:42:23', 0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2077,'物流公司管理管理','',2,0,2072,'express-company','','mall/trade/expressCompany/index',null,0,1,1,1,'','2022-12-20 23:27:55','1','2022-12-20 23:36:20',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2078,'物流公司管理查询','trade:express-company:query',3,1,2077,'','','',null,0,1,1,1,'','2022-12-20 23:27:55','','2022-12-20 23:27:55',0);
INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_MENU"("ID","NAME","PERMISSION","TYPE","SORT","PARENT_ID","PATH","ICON","COMPONENT","COMPONENT_NAME","STATUS","VISIBLE","KEEP_ALIVE","ALWAYS_SHOW","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(2079,'物流公司管理创建','trade:express-company:create',3,2,2077,'','','',null,0,1,1,1,'','2022-12-20 23:27:55','','2022-12-20 23:27:55',0);

View File

@ -1980,27 +1980,112 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2046, '满减送活动关闭', 'promotion:reward-activity:close', 3, 5, 2041, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2022-11-05 10:42:53', '1', '2022-11-05 10:42:53', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2047, '限时折扣活动', '', 2, 7, 2030, 'discount-activity', 'time', 'mall/promotion/discountActivity/index', 'PromotionDiscountActivity', 0, b'1', b'1', b'1', '', '2022-11-05 17:12:15', '1', '2023-04-08 11:45:44', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2048, '限时折扣活动查询', 'promotion:discount-activity:query', 3, 1, 2047, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-05 17:12:15', '', '2022-11-05 17:12:15', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2049, '限时折扣活动创建', 'promotion:discount-activity:create', 3, 2, 2047, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-05 17:12:15', '', '2022-11-05 17:12:15', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2050, '限时折扣活动更新', 'promotion:discount-activity:update', 3, 3, 2047, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2051, '限时折扣活动删除', 'promotion:discount-activity:delete', 3, 4, 2047, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2052, '限时折扣活动关闭', 'promotion:discount-activity:close', 3, 5, 2047, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2059, '秒杀活动管理', '', 2, 0, 2030, 'seckill-activity', 'time-range', 'mall/promotion/seckill/seckillActivity/index', 'PromotionSeckillActivity', 0, b'1', b'1', b'1', '', '2022-11-06 22:24:49', '1', '2023-04-08 11:46:02', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2060, '秒杀活动查询', 'promotion:seckill-activity:query', 3, 1, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2061, '秒杀活动创建', 'promotion:seckill-activity:create', 3, 2, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2062, '秒杀活动更新', 'promotion:seckill-activity:update', 3, 3, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2063, '秒杀活动删除', 'promotion:seckill-activity:delete', 3, 4, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2064, '秒杀活动导出', 'promotion:seckill-activity:export', 3, 5, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2066, '秒杀时段管理', '', 2, 0, 2030, 'seckill-time', '', 'mall/promotion/seckill/seckillTime/index', 'PromotionSeckillTime', 0, b'0', b'1', b'1', '', '2022-11-15 19:46:50', '1', '2023-04-08 11:46:17', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2067, '秒杀时段查询', 'promotion:seckill-time:query', 3, 1, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2068, '秒杀时段创建', 'promotion:seckill-time:create', 3, 2, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2069, '秒杀时段更新', 'promotion:seckill-time:update', 3, 3, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2070, '秒杀时段删除', 'promotion:seckill-time:delete', 3, 4, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2071, '秒杀时段导出', 'promotion:seckill-time:export', 3, 5, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2072, '订单中心', '', 1, 65, 0, '/trade', 'order', NULL, NULL, 0, b'1', b'1', b'1', '1', '2022-11-19 18:57:19', '1', '2022-12-10 16:32:57', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2073, '售后退款', '', 2, 1, 2072, 'trade/after-sale', 'education', 'mall/trade/afterSale/index', 'TradeAfterSale', 0, b'1', b'1', b'1', '', '2022-11-19 20:15:32', '1', '2023-04-08 11:43:19', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2074, '售后查询', 'trade:after-sale:query', 3, 1, 2073, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-19 20:15:33', '1', '2022-12-10 21:04:29', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2075, '秒杀活动关闭', 'promotion:sekill-activity:close', 3, 6, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2022-11-28 20:20:15', '1', '2022-11-28 20:20:15', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2076, '订单列表', '', 2, 0, 2072, 'trade/order', 'list', 'mall/trade/order/index', 'TradeOrder', 0, b'1', b'1', b'1', '1', '2022-12-10 21:05:44', '1', '2023-04-08 11:42:23', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2049, '限时折扣活动创建', 'promotion:discount-activity:create', 3, 2, 2047, '', '', '', NULL, 0, b'1', b'1',
b'1', '', '2022-11-05 17:12:15', '', '2022-11-05 17:12:15', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2050, '限时折扣活动更新', 'promotion:discount-activity:update', 3, 3, 2047, '', '', '', NULL, 0, b'1', b'1',
b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2051, '限时折扣活动删除', 'promotion:discount-activity:delete', 3, 4, 2047, '', '', '', NULL, 0, b'1', b'1',
b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2052, '限时折扣活动关闭', 'promotion:discount-activity:close', 3, 5, 2047, '', '', '', NULL, 0, b'1', b'1',
b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2059, '秒杀活动管理', '', 2, 0, 2030, 'seckill-activity', 'time-range',
'mall/promotion/seckill/seckillActivity/index', 'PromotionSeckillActivity', 0, b'1', b'1', b'1', '',
'2022-11-06 22:24:49', '1', '2023-04-08 11:46:02', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2060, '秒杀活动查询', 'promotion:seckill-activity:query', 3, 1, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '',
'2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2061, '秒杀活动创建', 'promotion:seckill-activity:create', 3, 2, 2059, '', '', '', NULL, 0, b'1', b'1', b'1',
'', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2062, '秒杀活动更新', 'promotion:seckill-activity:update', 3, 3, 2059, '', '', '', NULL, 0, b'1', b'1', b'1',
'', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2063, '秒杀活动删除', 'promotion:seckill-activity:delete', 3, 4, 2059, '', '', '', NULL, 0, b'1', b'1', b'1',
'', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2064, '秒杀活动导出', 'promotion:seckill-activity:export', 3, 5, 2059, '', '', '', NULL, 0, b'1', b'1', b'1',
'', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2066, '秒杀时段管理', '', 2, 0, 2030, 'seckill-time', '', 'mall/promotion/seckill/SeckillConfig/index',
'PromotionSeckillConfig', 0, b'0', b'1', b'1', '', '2022-11-15 19:46:50', '1', '2023-04-08 11:46:17', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2067, '秒杀时段查询', 'promotion:seckill-time:query', 3, 1, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '',
'2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2068, '秒杀时段创建', 'promotion:seckill-time:create', 3, 2, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '',
'2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2069, '秒杀时段更新', 'promotion:seckill-time:update', 3, 3, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '',
'2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2070, '秒杀时段删除', 'promotion:seckill-time:delete', 3, 4, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '',
'2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2071, '秒杀时段导出', 'promotion:seckill-time:export', 3, 5, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '',
'2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2072, '订单中心', '', 1, 65, 0, '/trade', 'order', NULL, NULL, 0, b'1', b'1', b'1', '1', '2022-11-19 18:57:19',
'1', '2022-12-10 16:32:57', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2073, '售后退款', '', 2, 1, 2072, 'trade/after-sale', 'education', 'mall/trade/afterSale/index',
'TradeAfterSale', 0, b'1', b'1', b'1', '', '2022-11-19 20:15:32', '1', '2023-04-08 11:43:19', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2074, '售后查询', 'trade:after-sale:query', 3, 1, 2073, '', '', '', NULL, 0, b'1', b'1', b'1', '',
'2022-11-19 20:15:33', '1', '2022-12-10 21:04:29', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2075, '秒杀活动关闭', 'promotion:sekill-activity:close', 3, 6, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '1',
'2022-11-28 20:20:15', '1', '2022-11-28 20:20:15', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
`component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
`updater`, `update_time`, `deleted`)
VALUES (2076, '订单列表', '', 2, 0, 2072, 'trade/order', 'list', 'mall/trade/order/index', 'TradeOrder', 0, b'1', b'1',
b'1', '1', '2022-12-10 21:05:44', '1', '2023-04-08 11:42:23', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2077, '物流公司管理管理', '', 2, 0, 2072, 'express-company', '', 'mall/trade/expressCompany/index', NULL, 0, b'1', b'1', b'1', '', '2022-12-20 23:27:55', '1', '2022-12-20 23:36:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2078, '物流公司管理查询', 'trade:express-company:query', 3, 1, 2077, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2079, '物流公司管理创建', 'trade:express-company:create', 3, 2, 2077, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0');

View File

@ -0,0 +1,87 @@
package cn.iocoder.yudao.module.promotion.controller.admin.seckill;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigCreateReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigPageReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigRespVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigUpdateReqVO;
import cn.iocoder.yudao.module.promotion.convert.seckill.seckillconfig.SeckillConfigConvert;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckillconfig.SeckillConfigDO;
import cn.iocoder.yudao.module.promotion.service.seckill.seckillconfig.SeckillConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
* 管理后台 - 秒杀时段相关接口
*
* @author HUIHUI
*/
@Tag(name = "管理后台 - 秒杀时段")
@RestController
@RequestMapping("/promotion/seckill-config")
@Validated
public class SeckillConfigController {
@Resource
private SeckillConfigService seckillConfigService;
@PostMapping("/create")
@Operation(summary = "创建秒杀时段")
@PreAuthorize("@ss.hasPermission('promotion:seckill-config:create')")
public CommonResult<Long> createSeckillConfig(@Valid @RequestBody SeckillConfigCreateReqVO createReqVO) {
return success(seckillConfigService.createSeckillConfig(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新秒杀时段")
@PreAuthorize("@ss.hasPermission('promotion:seckill-config:update')")
public CommonResult<Boolean> updateSeckillConfig(@Valid @RequestBody SeckillConfigUpdateReqVO updateReqVO) {
seckillConfigService.updateSeckillConfig(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除秒杀时段")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('promotion:seckill-config:delete')")
public CommonResult<Boolean> deleteSeckillConfig(@RequestParam("id") Long id) {
seckillConfigService.deleteSeckillConfig(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得秒杀时段")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('promotion:seckill-config:query')")
public CommonResult<SeckillConfigRespVO> getSeckillConfig(@RequestParam("id") Long id) {
SeckillConfigDO seckillConfig = seckillConfigService.getSeckillConfig(id);
return success(SeckillConfigConvert.INSTANCE.convert(seckillConfig));
}
@GetMapping("/list")
@Operation(summary = "获得所有秒杀时段列表")
@PreAuthorize("@ss.hasPermission('promotion:seckill-config:query')")
public CommonResult<List<SeckillConfigRespVO>> getSeckillConfigList() {
List<SeckillConfigDO> list = seckillConfigService.getSeckillConfigList();
return success(SeckillConfigConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得秒杀活动分页")
@PreAuthorize("@ss.hasPermission('promotion:seckill-config:query')")
public CommonResult<PageResult<SeckillConfigRespVO>> getSeckillActivityPage(@Valid SeckillConfigPageReqVO pageVO) {
PageResult<SeckillConfigDO> pageResult = seckillConfigService.getSeckillConfigPage(pageVO);
return success(SeckillConfigConvert.INSTANCE.convertPage(pageResult));
}
}

View File

@ -1,72 +0,0 @@
package cn.iocoder.yudao.module.promotion.controller.admin.seckill;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time.SeckillTimeCreateReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time.SeckillTimeRespVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time.SeckillTimeUpdateReqVO;
import cn.iocoder.yudao.module.promotion.convert.seckill.seckilltime.SeckillTimeConvert;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckilltime.SeckillTimeDO;
import cn.iocoder.yudao.module.promotion.service.seckill.seckilltime.SeckillTimeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 秒杀时段")
@RestController
@RequestMapping("/promotion/seckill-time")
@Validated
public class SeckillTimeController {
@Resource
private SeckillTimeService seckillTimeService;
@PostMapping("/create")
@Operation(summary = "创建秒杀时段")
@PreAuthorize("@ss.hasPermission('promotion:seckill-time:create')")
public CommonResult<Long> createSeckillTime(@Valid @RequestBody SeckillTimeCreateReqVO createReqVO) {
return success(seckillTimeService.createSeckillTime(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新秒杀时段")
@PreAuthorize("@ss.hasPermission('promotion:seckill-time:update')")
public CommonResult<Boolean> updateSeckillTime(@Valid @RequestBody SeckillTimeUpdateReqVO updateReqVO) {
seckillTimeService.updateSeckillTime(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除秒杀时段")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('promotion:seckill-time:delete')")
public CommonResult<Boolean> deleteSeckillTime(@RequestParam("id") Long id) {
seckillTimeService.deleteSeckillTime(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得秒杀时段")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('promotion:seckill-time:query')")
public CommonResult<SeckillTimeRespVO> getSeckillTime(@RequestParam("id") Long id) {
SeckillTimeDO seckillTime = seckillTimeService.getSeckillTime(id);
return success(SeckillTimeConvert.INSTANCE.convert(seckillTime));
}
@GetMapping("/list")
@Operation(summary = "获得所有秒杀时段列表")
@PreAuthorize("@ss.hasPermission('promotion:seckill-time:query')")
public CommonResult<List<SeckillTimeRespVO>> getSeckillTimeList() {
List<SeckillTimeDO> list = seckillTimeService.getSeckillTimeList();
return success(SeckillTimeConvert.INSTANCE.convertList(list));
}
}

View File

@ -54,7 +54,7 @@ public class SeckillActivityBaseVO {
@Schema(description = "秒杀库存", example = "80")
@Min(value = 0, message = "秒杀库存需要大于等于 0")
private Integer stock;
private Integer quota;
@Schema(description = "每人限购", example = "10") // 如果为 0 则不限购
@Min(value = 0, message = "每人限购需要大于等于 0")

View File

@ -0,0 +1,43 @@
package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.time.LocalTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_HOUR_MINUTE_SECOND;
/**
* 秒杀时段 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*
* @author HUIHUI
*/
@Data
public class SeckillConfigBaseVO {
@Schema(description = "秒杀时段名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "早上场")
@NotNull(message = "秒杀时段名称不能为空")
private String name;
@Schema(description = "开始时间点", requiredMode = Schema.RequiredMode.REQUIRED, example = "09:00:00")
@NotNull(message = "开始时间点不能为空")
@DateTimeFormat(pattern = FORMAT_HOUR_MINUTE_SECOND)
private LocalTime startTime;
@Schema(description = "结束时间点", requiredMode = Schema.RequiredMode.REQUIRED, example = "16:00:00")
@NotNull(message = "结束时间点不能为空")
@DateTimeFormat(pattern = FORMAT_HOUR_MINUTE_SECOND)
private LocalTime endTime;
@Schema(description = "秒杀主图", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
@NotNull(message = "秒杀主图不能为空")
private String picUrl;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
@NotNull(message = "状态不能为空")
private Integer status;
}

View File

@ -1,14 +1,19 @@
package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time;
package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
* 管理后台 秒杀时段创建 Request VO
*
* @author HUIHUI
*/
@Schema(description = "管理后台 - 秒杀时段创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SeckillTimeCreateReqVO extends SeckillTimeBaseVO {
public class SeckillConfigCreateReqVO extends SeckillConfigBaseVO {
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time;
package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
@ -9,21 +9,29 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalTime;
/**
* 管理后台 - 秒杀时段分页 Request VO
*
* @author HUIHUI
*/
@Schema(description = "管理后台 - 秒杀时段分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SeckillTimePageReqVO extends PageParam {
public class SeckillConfigPageReqVO extends PageParam {
@Schema(description = "秒杀时段名称", example = "上午场")
private String name;
@Schema(description = "状态", example = "0")
private Integer status;
@Schema(description = "开始时间点", example = "16:30:40")
@DateTimeFormat(pattern = "HH:mm:ss")
private LocalTime startTime;
private LocalTime[] startTime;
@Schema(description = "结束时间点", example = "16:30:40")
@DateTimeFormat(pattern = "HH:mm:ss")
private LocalTime endTime;
private LocalTime[] endTime;
}

View File

@ -1,25 +1,34 @@
package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time;
package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 管理后台 - 秒杀时段 Response VO
*
* @author HUIHUI
*/
@Schema(description = "管理后台 - 秒杀时段 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SeckillTimeRespVO extends SeckillTimeBaseVO {
public class SeckillConfigRespVO extends SeckillConfigBaseVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long id;
@Schema(description = "秒杀活动数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@Schema(description = "秒杀活动数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private Integer seckillActivityCount;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime createTime;
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time;
package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@ -7,11 +7,16 @@ import lombok.ToString;
import javax.validation.constraints.NotNull;
/**
* 管理后台 - 秒杀时段更新 Request VO
*
* @author HUIHUI
*/
@Schema(description = "管理后台 - 秒杀时段更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SeckillTimeUpdateReqVO extends SeckillTimeBaseVO {
public class SeckillConfigUpdateReqVO extends SeckillConfigBaseVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "编号不能为空")

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.time.LocalTime;
/**
* 秒杀时段 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/
@Data
public class SeckillTimeBaseVO {
@Schema(description = "秒杀时段名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "上午场")
@NotNull(message = "秒杀时段名称不能为空")
private String name;
@Schema(description = "开始时间点", requiredMode = Schema.RequiredMode.REQUIRED, example = "16:30:40")
@NotNull(message = "开始时间点不能为空")
private LocalTime startTime;
@Schema(description = "结束时间点", requiredMode = Schema.RequiredMode.REQUIRED, example = "16:30:40")
@NotNull(message = "结束时间点不能为空")
private LocalTime endTime;
}

View File

@ -0,0 +1,35 @@
package cn.iocoder.yudao.module.promotion.convert.seckill.seckillconfig;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigCreateReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigRespVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigUpdateReqVO;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckillconfig.SeckillConfigDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* 秒杀时段 Convert
*
* @author 芋道源码
*/
@Mapper
public interface SeckillConfigConvert {
SeckillConfigConvert INSTANCE = Mappers.getMapper(SeckillConfigConvert.class);
SeckillConfigDO convert(SeckillConfigCreateReqVO bean);
SeckillConfigDO convert(SeckillConfigUpdateReqVO bean);
@Mapping(target = "s")
SeckillConfigRespVO convert(SeckillConfigDO bean);
List<SeckillConfigRespVO> convertList(List<SeckillConfigDO> list);
PageResult<SeckillConfigRespVO> convertPage(PageResult<SeckillConfigDO> page);
}

View File

@ -1,34 +0,0 @@
package cn.iocoder.yudao.module.promotion.convert.seckill.seckilltime;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time.SeckillTimeCreateReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time.SeckillTimeRespVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time.SeckillTimeUpdateReqVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckilltime.SeckillTimeDO;
/**
* 秒杀时段 Convert
*
* @author 芋道源码
*/
@Mapper
public interface SeckillTimeConvert {
SeckillTimeConvert INSTANCE = Mappers.getMapper(SeckillTimeConvert.class);
SeckillTimeDO convert(SeckillTimeCreateReqVO bean);
SeckillTimeDO convert(SeckillTimeUpdateReqVO bean);
SeckillTimeRespVO convert(SeckillTimeDO bean);
List<SeckillTimeRespVO> convertList(List<SeckillTimeDO> list);
PageResult<SeckillTimeRespVO> convertPage(PageResult<SeckillTimeDO> page);
}

View File

@ -57,7 +57,7 @@ public class SeckillProductDO extends BaseDO {
/**
* 秒杀库存
*/
private Integer stock;
private Integer quota;
/**
* 每人限购

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckilltime;
package cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckillconfig;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
@ -15,12 +16,12 @@ import java.time.LocalTime;
*
* @author 芋道源码
*/
@TableName("promotion_seckill_time")
@KeySequence("promotion_seckill_time_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@TableName("promotion_seckill_config")
@KeySequence("promotion_seckill_config_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SeckillTimeDO extends BaseDO {
public class SeckillConfigDO extends BaseDO {
/**
* 编号
@ -40,8 +41,14 @@ public class SeckillTimeDO extends BaseDO {
*/
private LocalTime endTime;
/**
* 秒杀活动数量
* 秒杀主图
*/
private Integer seckillActivityCount;
private String picUrl;
/**
* 状态 开启0 禁用1
* <p>
* 枚举 {@link CommonStatusEnum 对应的类}
*/
private Integer status;
}

View File

@ -0,0 +1,45 @@
package cn.iocoder.yudao.module.promotion.dal.mysql.seckill.seckillconfig;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigPageReqVO;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckillconfig.SeckillConfigDO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import org.apache.ibatis.annotations.Mapper;
import java.time.LocalTime;
import java.util.Collection;
import java.util.List;
@Mapper
public interface SeckillConfigMapper extends BaseMapperX<SeckillConfigDO> {
default List<SeckillConfigDO> selectListByTime(LocalTime time) {
return selectList(SeckillConfigDO::getStartTime, SeckillConfigDO::getEndTime, time);
}
default List<SeckillConfigDO> selectListByTime(LocalTime startTime, LocalTime endTime) {
return selectList(new LambdaQueryWrapper<SeckillConfigDO>()
.ge(SeckillConfigDO::getStartTime, startTime)
.le(SeckillConfigDO::getEndTime, endTime));
}
default void updateActivityCount(Collection<Long> ids, String type, Integer count) {
new LambdaUpdateChainWrapper<>(this)
.in(SeckillConfigDO::getId, ids)
.setSql("`seckill_activity_count` = `seckill_activity_count` " + type + count)
.update();
}
default PageResult<SeckillConfigDO> selectPage(SeckillConfigPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<SeckillConfigDO>()
.likeIfPresent(SeckillConfigDO::getName, reqVO.getName())
.betweenIfPresent(SeckillConfigDO::getStartTime, reqVO.getStartTime())
.betweenIfPresent(SeckillConfigDO::getEndTime, reqVO.getEndTime())
.eqIfPresent(SeckillConfigDO::getStatus, reqVO.getStatus())
.orderByDesc(SeckillConfigDO::getId));
}
}

View File

@ -1,32 +0,0 @@
package cn.iocoder.yudao.module.promotion.dal.mysql.seckill.seckilltime;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckilltime.SeckillTimeDO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import org.apache.ibatis.annotations.Mapper;
import java.time.LocalTime;
import java.util.Collection;
import java.util.List;
@Mapper
public interface SeckillTimeMapper extends BaseMapperX<SeckillTimeDO> {
default List<SeckillTimeDO> selectListByTime(LocalTime time) {
return selectList(SeckillTimeDO::getStartTime, SeckillTimeDO::getEndTime, time);
}
default List<SeckillTimeDO> selectListByTime(LocalTime startTime, LocalTime endTime) {
return selectList(new LambdaQueryWrapper<SeckillTimeDO>()
.ge(SeckillTimeDO::getStartTime, startTime)
.le(SeckillTimeDO::getEndTime, endTime));
}
default void updateActivityCount(Collection<Long> ids, String type, Integer count) {
new LambdaUpdateChainWrapper<>(this)
.in(SeckillTimeDO::getId, ids)
.setSql("`seckill_activity_count` = `seckill_activity_count` " + type + count)
.update();
}
}

View File

@ -1,15 +1,16 @@
package cn.iocoder.yudao.module.promotion.service.seckill.seckillactivity;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity.SeckillActivityCreateReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity.SeckillActivityPageReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity.SeckillActivityUpdateReqVO;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckillactivity.SeckillActivityDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckillactivity.SeckillProductDO;
import javax.validation.Valid;
import java.util.Collection;
import java.util.List;
/**
* 秒杀活动 Service 接口
*
@ -77,4 +78,5 @@ public interface SeckillActivityService {
* @return 活动商品列表
*/
List<SeckillProductDO> getSeckillProductListByActivityId(Long id);
}

View File

@ -13,7 +13,7 @@ import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckillactivity.
import cn.iocoder.yudao.module.promotion.dal.mysql.seckill.seckillactivity.SeckillActivityMapper;
import cn.iocoder.yudao.module.promotion.dal.mysql.seckill.seckillactivity.SeckillProductMapper;
import cn.iocoder.yudao.module.promotion.enums.common.PromotionActivityStatusEnum;
import cn.iocoder.yudao.module.promotion.service.seckill.seckilltime.SeckillTimeService;
import cn.iocoder.yudao.module.promotion.service.seckill.seckillconfig.SeckillConfigService;
import cn.iocoder.yudao.module.promotion.util.PromotionUtils;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@ -34,29 +34,30 @@ import static java.util.Arrays.asList;
@Service
@Validated
public class SeckillActivityServiceImpl implements SeckillActivityService {
@Resource
private SeckillActivityMapper seckillActivityMapper;
@Resource
private SeckillProductMapper seckillProductMapper;
@Resource
private SeckillTimeService seckillTimeService;
private SeckillConfigService seckillConfigService;
@Override
public Long createSeckillActivity(SeckillActivityCreateReqVO createReqVO) {
// 校验商品是否冲突
validateSeckillActivityProductConflicts(null, createReqVO.getProducts());
// 校验秒杀时段是否存在
seckillTimeService.validateSeckillTimeExists(createReqVO.getTimeIds());
seckillConfigService.validateSeckillConfigExists(createReqVO.getTimeIds());
// 插入秒杀活动
SeckillActivityDO seckillActivity = SeckillActivityConvert.INSTANCE.convert(createReqVO)
.setStatus(PromotionUtils.calculateActivityStatus(createReqVO.getStartTime(), createReqVO.getEndTime()));
seckillActivityMapper.insert(seckillActivity);
// 插入商品
List<SeckillProductDO> productDOS = SeckillActivityConvert.INSTANCE.convertList(createReqVO.getProducts(), seckillActivity);
seckillProductMapper.insertBatch(productDOS);
List<SeckillProductDO> productDOs = SeckillActivityConvert.INSTANCE.convertList(createReqVO.getProducts(), seckillActivity);
seckillProductMapper.insertBatch(productDOs);
// 更新秒杀时段的秒杀活动数量
seckillTimeService.sekillActivityCountIncr(createReqVO.getTimeIds());
seckillConfigService.seckillActivityCountIncr(createReqVO.getTimeIds());
return seckillActivity.getId();
}
@ -77,17 +78,16 @@ public class SeckillActivityServiceImpl implements SeckillActivityService {
// 更新商品
updateSeckillProduct(updateReqVO);
// 更新秒杀时段的秒杀活动数量
updateSeckillTimeActivityCount(seckillActivity, updateReqVO.getTimeIds());
updateSeckillConfigActivityCount(seckillActivity, updateReqVO.getTimeIds());
}
/**
* 更新秒杀时段的秒杀活动数量
*
* @param seckillActivity 查询出的秒杀活动
* @param updateTimeIds 更新后的秒杀时段id列表
*/
private void updateSeckillTimeActivityCount(SeckillActivityDO seckillActivity, List<Long> updateTimeIds) {
private void updateSeckillConfigActivityCount(SeckillActivityDO seckillActivity, List<Long> updateTimeIds) {
// 查询出 timeIds
List<Long> existsTimeIds = seckillActivity.getTimeIds();
// 需要减少的时间段
@ -96,10 +96,10 @@ public class SeckillActivityServiceImpl implements SeckillActivityService {
updateTimeIds.removeIf(existsTimeIds::contains);
// 更新减少时间段和增加时间段
if (CollUtil.isNotEmpty(updateTimeIds)) {
seckillTimeService.sekillActivityCountIncr(updateTimeIds);
seckillConfigService.seckillActivityCountIncr(updateTimeIds);
}
if (CollUtil.isNotEmpty(reduceIds)) {
seckillTimeService.sekillActivityCountDecr(reduceIds);
seckillConfigService.seckillActivityCountDecr(reduceIds);
}
}
@ -113,11 +113,11 @@ public class SeckillActivityServiceImpl implements SeckillActivityService {
* @param updateReqVO 更新的请求VO
*/
private void updateSeckillProduct(SeckillActivityUpdateReqVO updateReqVO) {
List<SeckillProductDO> seckillProductDOS = seckillProductMapper.selectListByActivityId(updateReqVO.getId());
List<SeckillProductDO> seckillProductDOs = seckillProductMapper.selectListByActivityId(updateReqVO.getId());
List<SeckillActivityBaseVO.Product> products = updateReqVO.getProducts();
// 计算需要删除的数据
List<Long> deleteIds = CollectionUtils.convertList(seckillProductDOS, SeckillProductDO::getId,
List<Long> deleteIds = CollectionUtils.convertList(seckillProductDOs, SeckillProductDO::getId,
seckillProductDO -> products.stream()
.noneMatch(product -> SeckillActivityConvert.INSTANCE.isEquals(seckillProductDO, product)));
if (CollUtil.isNotEmpty(deleteIds)) {
@ -127,7 +127,7 @@ public class SeckillActivityServiceImpl implements SeckillActivityService {
// 计算需要新增的数据
List<SeckillProductDO> newSeckillProductDOs = CollectionUtils.convertList(products,
product -> SeckillActivityConvert.INSTANCE.convert(product).setActivityId(updateReqVO.getId()));
newSeckillProductDOs.removeIf(product -> seckillProductDOS.stream()
newSeckillProductDOs.removeIf(product -> seckillProductDOs.stream()
.anyMatch(seckillProduct -> SeckillActivityConvert.INSTANCE.isEquals(seckillProduct, product)));
if (CollUtil.isNotEmpty(newSeckillProductDOs)) {
seckillProductMapper.insertBatch(newSeckillProductDOs);
@ -147,21 +147,21 @@ public class SeckillActivityServiceImpl implements SeckillActivityService {
if (CollUtil.isEmpty(products)) {
return;
}
List<SeckillProductDO> seckillProductDOS = seckillProductMapper
List<SeckillProductDO> seckillProductDOs = seckillProductMapper
.selectListBySkuIds(CollectionUtils.convertSet(products, SeckillActivityBaseVO.Product::getSkuId));
if (CollUtil.isEmpty(seckillProductDOS)) {
if (CollUtil.isEmpty(seckillProductDOs)) {
return;
}
List<SeckillActivityDO> seckillActivityDOS = seckillActivityMapper
.selectBatchIds(CollectionUtils.convertSet(seckillProductDOS, SeckillProductDO::getActivityId));
List<SeckillActivityDO> seckillActivityDOs = seckillActivityMapper
.selectBatchIds(CollectionUtils.convertSet(seckillProductDOs, SeckillProductDO::getActivityId));
if (id != null) { // 排除自己这个活动
seckillActivityDOS.removeIf(item -> id.equals(item.getId()));
seckillActivityDOs.removeIf(item -> id.equals(item.getId()));
}
// 排除不满足 status 的活动
List<Integer> statuses = asList(PromotionActivityStatusEnum.WAIT.getStatus(), PromotionActivityStatusEnum.RUN.getStatus());
seckillActivityDOS.removeIf(item -> !statuses.contains(item.getStatus()));
seckillActivityDOs.removeIf(item -> !statuses.contains(item.getStatus()));
// 如果非空则说明冲突
if (CollUtil.isNotEmpty(seckillActivityDOS)) {
if (CollUtil.isNotEmpty(seckillActivityDOs)) {
throw exception(SECKILL_ACTIVITY_SPU_CONFLICTS);
}
}
@ -190,7 +190,7 @@ public class SeckillActivityServiceImpl implements SeckillActivityService {
throw exception(SECKILL_ACTIVITY_DELETE_FAIL_STATUS_NOT_CLOSED_OR_END);
}
// 更新秒杀时段的秒杀活动数量
seckillTimeService.sekillActivityCountDecr(seckillActivity.getTimeIds());
seckillConfigService.seckillActivityCountDecr(seckillActivity.getTimeIds());
// 删除
seckillActivityMapper.deleteById(id);
}

View File

@ -1,8 +1,10 @@
package cn.iocoder.yudao.module.promotion.service.seckill.seckilltime;
package cn.iocoder.yudao.module.promotion.service.seckill.seckillconfig;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time.SeckillTimeCreateReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time.SeckillTimeUpdateReqVO;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckilltime.SeckillTimeDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigCreateReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigPageReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigUpdateReqVO;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckillconfig.SeckillConfigDO;
import javax.validation.Valid;
import java.util.Collection;
@ -13,7 +15,7 @@ import java.util.List;
*
* @author halfninety
*/
public interface SeckillTimeService {
public interface SeckillConfigService {
/**
* 创建秒杀时段
@ -21,21 +23,21 @@ public interface SeckillTimeService {
* @param createReqVO 创建信息
* @return 编号
*/
Long createSeckillTime(@Valid SeckillTimeCreateReqVO createReqVO);
Long createSeckillConfig(@Valid SeckillConfigCreateReqVO createReqVO);
/**
* 更新秒杀时段
*
* @param updateReqVO 更新信息
*/
void updateSeckillTime(@Valid SeckillTimeUpdateReqVO updateReqVO);
void updateSeckillConfig(@Valid SeckillConfigUpdateReqVO updateReqVO);
/**
* 删除秒杀时段
*
* @param id 编号
*/
void deleteSeckillTime(Long id);
void deleteSeckillConfig(Long id);
/**
* 获得秒杀时段
@ -43,28 +45,28 @@ public interface SeckillTimeService {
* @param id 编号
* @return 秒杀时段
*/
SeckillTimeDO getSeckillTime(Long id);
SeckillConfigDO getSeckillConfig(Long id);
/**
* 获得所有秒杀时段列表
*
* @return 所有秒杀时段列表
*/
List<SeckillTimeDO> getSeckillTimeList();
List<SeckillConfigDO> getSeckillConfigList();
/**
* 校验秒杀时段是否存在
*
* @param timeIds 秒杀时段id集合
*/
void validateSeckillTimeExists(Collection<Long> timeIds);
void validateSeckillConfigExists(Collection<Long> timeIds);
/**
* 秒杀时段列表的秒杀活动数量加 1
*
* @param ids 秒杀时段id列表
*/
void sekillActivityCountIncr(Collection<Long> ids);
void seckillActivityCountIncr(Collection<Long> ids);
/**
@ -72,5 +74,14 @@ public interface SeckillTimeService {
*
* @param ids 秒杀时段id列表
*/
void sekillActivityCountDecr(Collection<Long> ids);
void seckillActivityCountDecr(Collection<Long> ids);
/**
* 获得秒杀时间段配置分页数据
*
* @param pageVO 分页请求参数
* @return 秒杀时段分页列表
*/
PageResult<SeckillConfigDO> getSeckillConfigPage(SeckillConfigPageReqVO pageVO);
}

View File

@ -0,0 +1,131 @@
package cn.iocoder.yudao.module.promotion.service.seckill.seckillconfig;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigCreateReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigPageReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigUpdateReqVO;
import cn.iocoder.yudao.module.promotion.convert.seckill.seckillconfig.SeckillConfigConvert;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckillconfig.SeckillConfigDO;
import cn.iocoder.yudao.module.promotion.dal.mysql.seckill.seckillconfig.SeckillConfigMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.time.LocalTime;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.SECKILL_TIME_CONFLICTS;
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.SECKILL_TIME_NOT_EXISTS;
/**
* 秒杀时段 Service 实现类
*
* @author halfninety
*/
@Service
@Validated
public class SeckillConfigServiceImpl implements SeckillConfigService {
@Resource
private SeckillConfigMapper seckillConfigMapper;
@Override
public Long createSeckillConfig(SeckillConfigCreateReqVO createReqVO) {
// 校验时间段是否冲突
validateSeckillConfigConflict(null, createReqVO.getStartTime(), createReqVO.getEndTime());
// 插入
SeckillConfigDO seckillConfig = SeckillConfigConvert.INSTANCE.convert(createReqVO);
seckillConfigMapper.insert(seckillConfig);
// 返回
return seckillConfig.getId();
}
@Override
public void updateSeckillConfig(SeckillConfigUpdateReqVO updateReqVO) {
// 校验存在
this.validateSeckillConfigExists(updateReqVO.getId());
// 校验时间段是否冲突
validateSeckillConfigConflict(updateReqVO.getId(), updateReqVO.getStartTime(), updateReqVO.getEndTime());
// 更新
SeckillConfigDO updateObj = SeckillConfigConvert.INSTANCE.convert(updateReqVO);
seckillConfigMapper.updateById(updateObj);
}
@Override
public void deleteSeckillConfig(Long id) {
// 校验存在
this.validateSeckillConfigExists(id);
// 删除
seckillConfigMapper.deleteById(id);
}
private void validateSeckillConfigExists(Long id) {
if (seckillConfigMapper.selectById(id) == null) {
throw exception(SECKILL_TIME_NOT_EXISTS);
}
}
/**
* 校验时间是否存在冲突
*
* @param startTime 开始时间
* @param endTime 结束时间
*/
private void validateSeckillConfigConflict(Long id, LocalTime startTime, LocalTime endTime) {
//查询开始时间结束时间是否在别人的时间段内
List<SeckillConfigDO> startTimeList = seckillConfigMapper.selectListByTime(startTime);
List<SeckillConfigDO> endTimeList = seckillConfigMapper.selectListByTime(endTime);
//查询自己时间段内是否有时间段
List<SeckillConfigDO> startEndTimeList = seckillConfigMapper.selectListByTime(startTime, endTime);
if (id != null) {
//移除自己
startTimeList.removeIf(seckillConfig -> Objects.equals(seckillConfig.getId(), id));
endTimeList.removeIf(seckillConfig -> Objects.equals(seckillConfig.getId(), id));
startEndTimeList.removeIf(seckillConfig -> Objects.equals(seckillConfig.getId(), id));
}
if (CollUtil.isNotEmpty(startTimeList) || CollUtil.isNotEmpty(endTimeList)
|| CollUtil.isNotEmpty(startEndTimeList)) {
throw exception(SECKILL_TIME_CONFLICTS);
}
}
@Override
public SeckillConfigDO getSeckillConfig(Long id) {
return seckillConfigMapper.selectById(id);
}
@Override
public List<SeckillConfigDO> getSeckillConfigList() {
return seckillConfigMapper.selectList();
}
@Override
public void validateSeckillConfigExists(Collection<Long> timeIds) {
if (CollUtil.isEmpty(timeIds)) {
throw exception(SECKILL_TIME_NOT_EXISTS);
}
if (seckillConfigMapper.selectBatchIds(timeIds).size() != timeIds.size()) {
throw exception(SECKILL_TIME_NOT_EXISTS);
}
}
@Override
public void seckillActivityCountIncr(Collection<Long> ids) {
seckillConfigMapper.updateActivityCount(ids, "+", 1);
}
@Override
public void seckillActivityCountDecr(Collection<Long> ids) {
seckillConfigMapper.updateActivityCount(ids, "-", 1);
}
@Override
public PageResult<SeckillConfigDO> getSeckillConfigPage(SeckillConfigPageReqVO pageVO) {
return seckillConfigMapper.selectPage(pageVO);
}
}

View File

@ -1,124 +0,0 @@
package cn.iocoder.yudao.module.promotion.service.seckill.seckilltime;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time.SeckillTimeCreateReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time.SeckillTimeUpdateReqVO;
import cn.iocoder.yudao.module.promotion.convert.seckill.seckilltime.SeckillTimeConvert;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckilltime.SeckillTimeDO;
import cn.iocoder.yudao.module.promotion.dal.mysql.seckill.seckilltime.SeckillTimeMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.time.LocalTime;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.SECKILL_TIME_CONFLICTS;
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.SECKILL_TIME_NOT_EXISTS;
/**
* 秒杀时段 Service 实现类
*
* @author halfninety
*/
@Service
@Validated
public class SeckillTimeServiceImpl implements SeckillTimeService {
@Resource
private SeckillTimeMapper seckillTimeMapper;
@Override
public Long createSeckillTime(SeckillTimeCreateReqVO createReqVO) {
// 校验时间段是否冲突
validateSeckillTimeConflict(null, createReqVO.getStartTime(), createReqVO.getEndTime());
// 插入
SeckillTimeDO seckillTime = SeckillTimeConvert.INSTANCE.convert(createReqVO);
seckillTimeMapper.insert(seckillTime);
// 返回
return seckillTime.getId();
}
@Override
public void updateSeckillTime(SeckillTimeUpdateReqVO updateReqVO) {
// 校验存在
this.validateSeckillTimeExists(updateReqVO.getId());
// 校验时间段是否冲突
validateSeckillTimeConflict(updateReqVO.getId(), updateReqVO.getStartTime(), updateReqVO.getEndTime());
// 更新
SeckillTimeDO updateObj = SeckillTimeConvert.INSTANCE.convert(updateReqVO);
seckillTimeMapper.updateById(updateObj);
}
@Override
public void deleteSeckillTime(Long id) {
// 校验存在
this.validateSeckillTimeExists(id);
// 删除
seckillTimeMapper.deleteById(id);
}
private void validateSeckillTimeExists(Long id) {
if (seckillTimeMapper.selectById(id) == null) {
throw exception(SECKILL_TIME_NOT_EXISTS);
}
}
/**
* 校验时间是否存在冲突
*
* @param startTime 开始时间
* @param endTime 结束时间
*/
private void validateSeckillTimeConflict(Long id, LocalTime startTime, LocalTime endTime) {
//查询开始时间结束时间是否在别人的时间段内
List<SeckillTimeDO> startTimeList = seckillTimeMapper.selectListByTime(startTime);
List<SeckillTimeDO> endTimeList = seckillTimeMapper.selectListByTime(endTime);
//查询自己时间段内是否有时间段
List<SeckillTimeDO> startEndTimeList = seckillTimeMapper.selectListByTime(startTime, endTime);
if (id != null) {
//移除自己
startTimeList.removeIf(seckillTime -> Objects.equals(seckillTime.getId(), id));
endTimeList.removeIf(seckillTime -> Objects.equals(seckillTime.getId(), id));
startEndTimeList.removeIf(seckillTime -> Objects.equals(seckillTime.getId(), id));
}
if (CollUtil.isNotEmpty(startTimeList) || CollUtil.isNotEmpty(endTimeList)
|| CollUtil.isNotEmpty(startEndTimeList)) {
throw exception(SECKILL_TIME_CONFLICTS);
}
}
@Override
public SeckillTimeDO getSeckillTime(Long id) {
return seckillTimeMapper.selectById(id);
}
@Override
public List<SeckillTimeDO> getSeckillTimeList() {
return seckillTimeMapper.selectList();
}
@Override
public void validateSeckillTimeExists(Collection<Long> timeIds) {
if (CollUtil.isEmpty(timeIds)) {
throw exception(SECKILL_TIME_NOT_EXISTS);
}
if (seckillTimeMapper.selectBatchIds(timeIds).size() != timeIds.size()) {
throw exception(SECKILL_TIME_NOT_EXISTS);
}
}
@Override
public void sekillActivityCountIncr(Collection<Long> ids) {
seckillTimeMapper.updateActivityCount(ids, "+", 1);
}
@Override
public void sekillActivityCountDecr(Collection<Long> ids) {
seckillTimeMapper.updateActivityCount(ids, "-", 1);
}
}

View File

@ -0,0 +1,190 @@
package cn.iocoder.yudao.module.promotion.service.seckillconfig;
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigCreateReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.SeckillConfigUpdateReqVO;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckillconfig.SeckillConfigDO;
import cn.iocoder.yudao.module.promotion.dal.mysql.seckill.seckillconfig.SeckillConfigMapper;
import cn.iocoder.yudao.module.promotion.service.seckill.seckillconfig.SeckillConfigServiceImpl;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.Import;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId;
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException;
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId;
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.SECKILL_TIME_NOT_EXISTS;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
/**
* {@link SeckillConfigServiceImpl} 的单元测试类
*
* @author 芋道源码
*/
@Import(SeckillConfigServiceImpl.class)
@Disabled // TODO 芋艿未来开启
public class SeckillConfigServiceImplTest extends BaseDbUnitTest {
@Resource
private SeckillConfigServiceImpl SeckillConfigService;
@Resource
private SeckillConfigMapper seckillConfigMapper;
@Resource
private ObjectMapper objectMapper;
@Test
public void testJacksonSerializ() {
// 准备参数
SeckillConfigCreateReqVO reqVO = randomPojo(SeckillConfigCreateReqVO.class);
// ObjectMapper objectMapper = new ObjectMapper();
try {
String string = objectMapper.writeValueAsString(reqVO);
System.out.println(string);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
}
@Test
public void testCreateSeckillConfig_success() {
// 准备参数
SeckillConfigCreateReqVO reqVO = randomPojo(SeckillConfigCreateReqVO.class);
// 调用
Long SeckillConfigId = SeckillConfigService.createSeckillConfig(reqVO);
// 断言
assertNotNull(SeckillConfigId);
// 校验记录的属性是否正确
SeckillConfigDO SeckillConfig = seckillConfigMapper.selectById(SeckillConfigId);
assertPojoEquals(reqVO, SeckillConfig);
}
@Test
public void testUpdateSeckillConfig_success() {
// mock 数据
SeckillConfigDO dbSeckillConfig = randomPojo(SeckillConfigDO.class);
seckillConfigMapper.insert(dbSeckillConfig);// @Sql: 先插入出一条存在的数据
// 准备参数
SeckillConfigUpdateReqVO reqVO = randomPojo(SeckillConfigUpdateReqVO.class, o -> {
o.setId(dbSeckillConfig.getId()); // 设置更新的 ID
});
// 调用
SeckillConfigService.updateSeckillConfig(reqVO);
// 校验是否更新正确
SeckillConfigDO SeckillConfig = seckillConfigMapper.selectById(reqVO.getId()); // 获取最新的
assertPojoEquals(reqVO, SeckillConfig);
}
@Test
public void testUpdateSeckillConfig_notExists() {
// 准备参数
SeckillConfigUpdateReqVO reqVO = randomPojo(SeckillConfigUpdateReqVO.class);
// 调用, 并断言异常
assertServiceException(() -> SeckillConfigService.updateSeckillConfig(reqVO), SECKILL_TIME_NOT_EXISTS);
}
@Test
public void testDeleteSeckillConfig_success() {
// mock 数据
SeckillConfigDO dbSeckillConfig = randomPojo(SeckillConfigDO.class);
seckillConfigMapper.insert(dbSeckillConfig);// @Sql: 先插入出一条存在的数据
// 准备参数
Long id = dbSeckillConfig.getId();
// 调用
SeckillConfigService.deleteSeckillConfig(id);
// 校验数据不存在了
assertNull(seckillConfigMapper.selectById(id));
}
@Test
public void testDeleteSeckillConfig_notExists() {
// 准备参数
Long id = randomLongId();
// 调用, 并断言异常
assertServiceException(() -> SeckillConfigService.deleteSeckillConfig(id), SECKILL_TIME_NOT_EXISTS);
}
@Test
@Disabled // TODO 请修改 null 为需要的值然后删除 @Disabled 注解
public void testGetSeckillConfigPage() {
// mock 数据
// SeckillConfigDO dbSeckillConfig = randomPojo(SeckillConfigDO.class, o -> { // 等会查询到
// o.setName(null);
// o.setStartTime(null);
// o.setEndTime(null);
// o.setCreateTime(null);
// });
// seckillConfigMapper.insert(dbSeckillConfig);
// // 测试 name 不匹配
// seckillConfigMapper.insert(cloneIgnoreId(dbSeckillConfig, o -> o.setName(null)));
// // 测试 startTime 不匹配
// seckillConfigMapper.insert(cloneIgnoreId(dbSeckillConfig, o -> o.setStartTime(null)));
// // 测试 endTime 不匹配
// seckillConfigMapper.insert(cloneIgnoreId(dbSeckillConfig, o -> o.setEndTime(null)));
// // 测试 createTime 不匹配
// seckillConfigMapper.insert(cloneIgnoreId(dbSeckillConfig, o -> o.setCreateTime(null)));
// // 准备参数
// SeckillConfigPageReqVO reqVO = new SeckillConfigPageReqVO();
// reqVO.setName(null);
//// reqVO.setStartTime((new LocalTime()));
//// reqVO.setEndTime((new LocalTime[]{}));
//// reqVO.setCreateTime((new Date[]{}));
//
// // 调用
// PageResult<SeckillConfigDO> pageResult = SeckillConfigService.getSeckillConfigPage(reqVO);
// // 断言
// assertEquals(1, pageResult.getTotal());
// assertEquals(1, pageResult.getList().size());
// assertPojoEquals(dbSeckillConfig, pageResult.getList().get(0));
}
@Test
@Disabled // TODO 请修改 null 为需要的值然后删除 @Disabled 注解
public void testGetSeckillConfigList() {
// mock 数据
SeckillConfigDO dbSeckillConfig = randomPojo(SeckillConfigDO.class, o -> { // 等会查询到
o.setName(null);
o.setStartTime(null);
o.setEndTime(null);
o.setCreateTime(null);
});
seckillConfigMapper.insert(dbSeckillConfig);
// 测试 name 不匹配
seckillConfigMapper.insert(cloneIgnoreId(dbSeckillConfig, o -> o.setName(null)));
// 测试 startTime 不匹配
seckillConfigMapper.insert(cloneIgnoreId(dbSeckillConfig, o -> o.setStartTime(null)));
// 测试 endTime 不匹配
seckillConfigMapper.insert(cloneIgnoreId(dbSeckillConfig, o -> o.setEndTime(null)));
// 测试 createTime 不匹配
seckillConfigMapper.insert(cloneIgnoreId(dbSeckillConfig, o -> o.setCreateTime(null)));
// 准备参数
// SeckillConfigExportReqVO reqVO = new SeckillConfigExportReqVO();
// reqVO.setName(null);
// reqVO.setStartTime((new LocalTime[]{}));
// reqVO.setEndTime((new LocalTime[]{}));
// reqVO.setCreateTime((new Date[]{}));
//
// // 调用
// List<SeckillConfigDO> list = SeckillConfigService.getSeckillConfigList(reqVO);
// // 断言
// assertEquals(1, list.size());
// assertPojoEquals(dbSeckillConfig, list.get(0));
}
}

View File

@ -1,190 +0,0 @@
package cn.iocoder.yudao.module.promotion.service.seckilltime;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time.SeckillTimeCreateReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time.SeckillTimeUpdateReqVO;
import cn.iocoder.yudao.module.promotion.service.seckill.seckilltime.SeckillTimeServiceImpl;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import javax.annotation.Resource;
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckilltime.SeckillTimeDO;
import cn.iocoder.yudao.module.promotion.dal.mysql.seckill.seckilltime.SeckillTimeMapper;
import org.springframework.context.annotation.Import;
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.*;
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*;
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*;
import static org.junit.jupiter.api.Assertions.*;
/**
* {@link SeckillTimeServiceImpl} 的单元测试类
*
* @author 芋道源码
*/
@Import(SeckillTimeServiceImpl.class)
@Disabled // TODO 芋艿未来开启
public class SeckillTimeServiceImplTest extends BaseDbUnitTest {
@Resource
private SeckillTimeServiceImpl seckillTimeService;
@Resource
private SeckillTimeMapper seckillTimeMapper;
@Resource
private ObjectMapper objectMapper;
@Test
public void testJacksonSerializ(){
// 准备参数
SeckillTimeCreateReqVO reqVO = randomPojo(SeckillTimeCreateReqVO.class);
// ObjectMapper objectMapper = new ObjectMapper();
try {
String string = objectMapper.writeValueAsString(reqVO);
System.out.println(string);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
}
@Test
public void testCreateSeckillTime_success() {
// 准备参数
SeckillTimeCreateReqVO reqVO = randomPojo(SeckillTimeCreateReqVO.class);
// 调用
Long seckillTimeId = seckillTimeService.createSeckillTime(reqVO);
// 断言
assertNotNull(seckillTimeId);
// 校验记录的属性是否正确
SeckillTimeDO seckillTime = seckillTimeMapper.selectById(seckillTimeId);
assertPojoEquals(reqVO, seckillTime);
}
@Test
public void testUpdateSeckillTime_success() {
// mock 数据
SeckillTimeDO dbSeckillTime = randomPojo(SeckillTimeDO.class);
seckillTimeMapper.insert(dbSeckillTime);// @Sql: 先插入出一条存在的数据
// 准备参数
SeckillTimeUpdateReqVO reqVO = randomPojo(SeckillTimeUpdateReqVO.class, o -> {
o.setId(dbSeckillTime.getId()); // 设置更新的 ID
});
// 调用
seckillTimeService.updateSeckillTime(reqVO);
// 校验是否更新正确
SeckillTimeDO seckillTime = seckillTimeMapper.selectById(reqVO.getId()); // 获取最新的
assertPojoEquals(reqVO, seckillTime);
}
@Test
public void testUpdateSeckillTime_notExists() {
// 准备参数
SeckillTimeUpdateReqVO reqVO = randomPojo(SeckillTimeUpdateReqVO.class);
// 调用, 并断言异常
assertServiceException(() -> seckillTimeService.updateSeckillTime(reqVO), SECKILL_TIME_NOT_EXISTS);
}
@Test
public void testDeleteSeckillTime_success() {
// mock 数据
SeckillTimeDO dbSeckillTime = randomPojo(SeckillTimeDO.class);
seckillTimeMapper.insert(dbSeckillTime);// @Sql: 先插入出一条存在的数据
// 准备参数
Long id = dbSeckillTime.getId();
// 调用
seckillTimeService.deleteSeckillTime(id);
// 校验数据不存在了
assertNull(seckillTimeMapper.selectById(id));
}
@Test
public void testDeleteSeckillTime_notExists() {
// 准备参数
Long id = randomLongId();
// 调用, 并断言异常
assertServiceException(() -> seckillTimeService.deleteSeckillTime(id), SECKILL_TIME_NOT_EXISTS);
}
@Test
@Disabled // TODO 请修改 null 为需要的值然后删除 @Disabled 注解
public void testGetSeckillTimePage() {
// mock 数据
// SeckillTimeDO dbSeckillTime = randomPojo(SeckillTimeDO.class, o -> { // 等会查询到
// o.setName(null);
// o.setStartTime(null);
// o.setEndTime(null);
// o.setCreateTime(null);
// });
// seckillTimeMapper.insert(dbSeckillTime);
// // 测试 name 不匹配
// seckillTimeMapper.insert(cloneIgnoreId(dbSeckillTime, o -> o.setName(null)));
// // 测试 startTime 不匹配
// seckillTimeMapper.insert(cloneIgnoreId(dbSeckillTime, o -> o.setStartTime(null)));
// // 测试 endTime 不匹配
// seckillTimeMapper.insert(cloneIgnoreId(dbSeckillTime, o -> o.setEndTime(null)));
// // 测试 createTime 不匹配
// seckillTimeMapper.insert(cloneIgnoreId(dbSeckillTime, o -> o.setCreateTime(null)));
// // 准备参数
// SeckillTimePageReqVO reqVO = new SeckillTimePageReqVO();
// reqVO.setName(null);
//// reqVO.setStartTime((new LocalTime()));
//// reqVO.setEndTime((new LocalTime[]{}));
//// reqVO.setCreateTime((new Date[]{}));
//
// // 调用
// PageResult<SeckillTimeDO> pageResult = seckillTimeService.getSeckillTimePage(reqVO);
// // 断言
// assertEquals(1, pageResult.getTotal());
// assertEquals(1, pageResult.getList().size());
// assertPojoEquals(dbSeckillTime, pageResult.getList().get(0));
}
@Test
@Disabled // TODO 请修改 null 为需要的值然后删除 @Disabled 注解
public void testGetSeckillTimeList() {
// mock 数据
SeckillTimeDO dbSeckillTime = randomPojo(SeckillTimeDO.class, o -> { // 等会查询到
o.setName(null);
o.setStartTime(null);
o.setEndTime(null);
o.setCreateTime(null);
});
seckillTimeMapper.insert(dbSeckillTime);
// 测试 name 不匹配
seckillTimeMapper.insert(cloneIgnoreId(dbSeckillTime, o -> o.setName(null)));
// 测试 startTime 不匹配
seckillTimeMapper.insert(cloneIgnoreId(dbSeckillTime, o -> o.setStartTime(null)));
// 测试 endTime 不匹配
seckillTimeMapper.insert(cloneIgnoreId(dbSeckillTime, o -> o.setEndTime(null)));
// 测试 createTime 不匹配
seckillTimeMapper.insert(cloneIgnoreId(dbSeckillTime, o -> o.setCreateTime(null)));
// 准备参数
// SeckillTimeExportReqVO reqVO = new SeckillTimeExportReqVO();
// reqVO.setName(null);
// reqVO.setStartTime((new LocalTime[]{}));
// reqVO.setEndTime((new LocalTime[]{}));
// reqVO.setCreateTime((new Date[]{}));
//
// // 调用
// List<SeckillTimeDO> list = seckillTimeService.getSeckillTimeList(reqVO);
// // 断言
// assertEquals(1, list.size());
// assertPojoEquals(dbSeckillTime, list.get(0));
}
}

View File

@ -1,6 +1,14 @@
DELETE FROM "market_activity";
DELETE FROM "promotion_coupon_template";
DELETE FROM "promotion_coupon";
DELETE FROM "promotion_reward_activity";
DELETE FROM "promotion_discount_activity";
DELETE FROM "promotion_discount_product";
DELETE
FROM "market_activity";
DELETE
FROM "promotion_coupon_template";
DELETE
FROM "promotion_coupon";
DELETE
FROM "promotion_reward_activity";
DELETE
FROM "promotion_discount_activity";
DELETE
FROM "promotion_discount_product";
DELETE
FROM "promotion_seckill_config";

View File

@ -108,17 +108,122 @@ CREATE TABLE IF NOT EXISTS "promotion_discount_activity" (
) COMMENT '限时折扣活动';
CREATE TABLE IF NOT EXISTS "promotion_discount_product" (
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
"activity_id" bigint NOT NULL,
"spu_id" bigint NOT NULL,
"sku_id" bigint NOT NULL,
"discount_type" int NOT NULL,
"discount_percent" int,
"discount_price" int,
"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 '限时折扣活动';
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
"activity_id" bigint NOT NULL,
"spu_id" bigint NOT NULL,
"sku_id" bigint NOT NULL,
"discount_type" int NOT NULL,
"discount_percent"
int,
"discount_price"
int,
"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 "promotion_seckill_config"
(
"id"
bigint
NOT
NULL
GENERATED
BY
DEFAULT AS
IDENTITY,
"name"
varchar
NOT
NULL,
"start_time"
varchar
NOT
NULL,
"end_time"
varchar
NOT
NULL,
"seckill_activity_count"
int
NOT
NULL,
"pic_url"
varchar
NOT
NULL,
"status"
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,
"tenant_id"
bigint
NOT
NULL,
PRIMARY
KEY
(
"id"
)
) COMMENT '秒杀时段配置';

View File

@ -17,7 +17,7 @@
</el-form-item>
<el-form-item label="参与场次" prop="timeId">
<el-select v-model="queryParams.timeId" placeholder="请选择参与场次" clearable size="small">
<el-option v-for="item in seckillTimeList" :key="item.id" :label="item.name" :value="item.id" />
<el-option v-for="item in SeckillConfigList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
@ -38,8 +38,9 @@
v-hasPermi="['promotion:seckill-activity:create']">新增秒杀活动</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-menu" size="mini" @click="openSeckillTime"
v-hasPermi="['promotion:seckill-activity:create']">管理参与场次</el-button>
<el-button v-hasPermi="['promotion:seckill-activity:create']" icon="el-icon-menu" plain size="mini" type="primary"
@click="openSeckillConfig">管理参与场次
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -54,8 +55,8 @@
</el-table-column>
<el-table-column label="参与场次" prop="timeIds" width="250">
<template v-slot="scope">
<span v-for="item in seckillTimeList" :key="item.id"
v-if="scope.row.timeIds.includes(item.id)">
<span v-for="item in SeckillConfigList" v-if="scope.row.timeIds.includes(item.id)"
:key="item.id">
<el-tag style="margin:4px;" size="small">{{ item.name }}</el-tag>
</span>
</template>
@ -110,12 +111,13 @@
<el-form-item label="场次选择">
<el-select v-model="form.timeIds" placeholder="请选择参与场次" clearable size="small" multiple filterable
style="width: 880px">
<el-option v-for="item in seckillTimeList" :key="item.id" :label="item.name" :value="item.id">
<span style="float: left">{{ item.name + ': { ' }} {{ item.startTime }} -- {{ item.endTime +
' }'
}}</span>
<span style="float: right; color: #8492a6; font-size: 13px"></span>
</el-option>
<el-option v-for="item in SeckillConfigList" :key="item.id" :label="item.name" :value="item.id">
<span style="float: left">{{ item.name + ': { ' }} {{ item.startTime }} -- {{
item.endTime +
' }'
}}</span>
<span style="float: right; color: #8492a6; font-size: 13px"></span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="商品选择">
@ -186,10 +188,17 @@
</template>
<script>
import { getSkuOptionList } from "@/api/mall/product/sku";
import { createSeckillActivity, updateSeckillActivity, closeSeckillActivity, deleteSeckillActivity, getSeckillActivity, getSeckillActivityPage, exportSeckillActivityExcel } from "@/api/mall/promotion/seckillActivity";
import { getSeckillTimeList } from "@/api/mall/promotion/seckillTime";
import { deepClone } from "@/utils";
import {getSkuOptionList} from "@/api/mall/product/sku";
import {
closeSeckillActivity,
createSeckillActivity,
deleteSeckillActivity,
getSeckillActivity,
getSeckillActivityPage,
updateSeckillActivity
} from "@/api/mall/promotion/seckillActivity";
import {getSeckillConfigList} from "@/api/mall/promotion/SeckillConfig";
import {deepClone} from "@/utils";
export default {
name: "PromotionSeckillActivity",
@ -197,26 +206,26 @@ export default {
},
data() {
return {
//
loading: true,
//
showSearch: true,
//
total: 0,
//
list: [],
//
seckillTimeList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
name: null,
status: null,
//
loading: true,
//
showSearch: true,
//
total: 0,
//
list: [],
//
SeckillConfigList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
name: null,
status: null,
timeId: null,
createTime: [],
},
@ -261,18 +270,18 @@ export default {
this.total = response.data.total;
this.loading = false;
});
if (timeId) {
//
this.$route.params.timeId = undefined
}
// SKU
getSkuOptionList().then(response => {
this.productSkus = response.data;
});
//
getSeckillTimeList().then(response => {
this.seckillTimeList = response.data;
});
if (timeId) {
//
this.$route.params.timeId = undefined
}
// SKU
getSkuOptionList().then(response => {
this.productSkus = response.data;
});
//
getSeckillConfigList().then(response => {
this.SeckillConfigList = response.data;
});
},
/** 取消按钮 */
cancel() {
@ -306,10 +315,10 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
/**打开秒杀场次管理页面 */
openSeckillTime() {
this.$tab.openPage("秒杀场次管理", "/promotion/seckill-time");
},
/**打开秒杀场次管理页面 */
openSeckillConfig() {
this.$tab.openPage("秒杀场次管理", "/promotion/seckill-time");
},
/** 新增按钮操作 */
handleAdd() {
this.reset();

View File

@ -63,14 +63,19 @@
</template>
<script>
import { createSeckillTime, updateSeckillTime, deleteSeckillTime, getSeckillTime, getSeckillTimePage, exportSeckillTimeExcel, getSeckillTimeList } from "@/api/mall/promotion/seckillTime";
import {
createSeckillConfig,
deleteSeckillConfig,
getSeckillConfig,
getSeckillConfigList,
updateSeckillConfig
} from "@/api/mall/promotion/SeckillConfig";
import router from "@/router";
import { deepClone } from "@/utils";
import {deepClone} from "@/utils";
export default {
name: "PromotionSeckillTime",
components: {
},
name: "PromotionSeckillConfig",
components: {},
data() {
return {
//
@ -104,7 +109,7 @@ export default {
getList() {
this.loading = true;
//
getSeckillTimeList().then(response => {
getSeckillConfigList().then(response => {
this.list = response.data;
this.loading = false;
});
@ -148,7 +153,7 @@ export default {
handleUpdate(row) {
this.reset();
const id = row.id;
getSeckillTime(id).then(response => {
getSeckillConfig(id).then(response => {
response.data.startAndEndTime = [response.data.startTime, response.data.endTime]
this.form = response.data;
this.open = true;
@ -168,7 +173,7 @@ export default {
data.endTime = this.form.startAndEndTime[1];
//
if (this.form.id != null) {
updateSeckillTime(data).then(response => {
updateSeckillConfig(data).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
@ -176,7 +181,7 @@ export default {
return;
}
//
createSeckillTime(data).then(response => {
createSeckillConfig(data).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
@ -187,7 +192,7 @@ export default {
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除秒杀时段编号为"' + id + '"的数据项?').then(function () {
return deleteSeckillTime(id);
return deleteSeckillConfig(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");