api实现
This commit is contained in:
parent
8173b4e31e
commit
24787ab9a6
27
db/add_has_child_field.sql
Normal file
27
db/add_has_child_field.sql
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
-- 为oroqen_culture_category表添加has_child字段
|
||||||
|
ALTER TABLE oroqen_culture_category ADD COLUMN has_child varchar(3) DEFAULT '0' COMMENT '是否有子节点(0-否,1-是)';
|
||||||
|
|
||||||
|
-- 更新现有数据,为有子节点的分类设置has_child为'1'
|
||||||
|
UPDATE oroqen_culture_category
|
||||||
|
SET has_child = '1'
|
||||||
|
WHERE id IN (
|
||||||
|
SELECT parent_id FROM (
|
||||||
|
SELECT DISTINCT parent_id
|
||||||
|
FROM oroqen_culture_category
|
||||||
|
WHERE parent_id IS NOT NULL AND parent_id != ''
|
||||||
|
) AS temp_table
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 为oroqen_product_category表添加has_child字段(如果不存在)
|
||||||
|
ALTER TABLE oroqen_product_category ADD COLUMN has_child varchar(3) DEFAULT '0' COMMENT '是否有子节点(0-否,1-是)';
|
||||||
|
|
||||||
|
-- 更新现有数据,为有子节点的产品分类设置has_child为'1'
|
||||||
|
UPDATE oroqen_product_category
|
||||||
|
SET has_child = '1'
|
||||||
|
WHERE id IN (
|
||||||
|
SELECT parent_id FROM (
|
||||||
|
SELECT DISTINCT parent_id
|
||||||
|
FROM oroqen_product_category
|
||||||
|
WHERE parent_id IS NOT NULL AND parent_id != ''
|
||||||
|
) AS temp_table
|
||||||
|
);
|
10
db/add_product_video_field.sql
Normal file
10
db/add_product_video_field.sql
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
-- 为商品表添加产品视频URL字段
|
||||||
|
-- 执行时间:2025-01-19
|
||||||
|
|
||||||
|
-- 添加产品视频字段
|
||||||
|
ALTER TABLE `oroqen_product`
|
||||||
|
ADD COLUMN `product_video` varchar(500) DEFAULT NULL COMMENT '产品视频URL'
|
||||||
|
AFTER `images`;
|
||||||
|
|
||||||
|
-- 验证字段是否添加成功
|
||||||
|
DESCRIBE `oroqen_product`;
|
14
db/insert_heritage_data.sql
Normal file
14
db/insert_heritage_data.sql
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
USE Oroqen;
|
||||||
|
|
||||||
|
INSERT INTO oroqen_heritage_project VALUES
|
||||||
|
('1', 'admin', NOW(), 'admin', NOW(), 'A04', 'Oroqen Hunting Culture', 'HUNTING_CULTURE', 'Traditional Skills', 'National Level', 2006, 'GF[2006]18', 'Traditional hunting culture of Oroqen people', 'Complete hunting culture system including skills, tools, and rituals', 'Ancient hunting traditions passed down through generations', '["Bow making","Animal tracking","Hunting rituals","Wildlife knowledge"]', 'Represents harmony between humans and nature', '/images/hunting_culture.jpg', '[]', '', '', 'hunting,traditional,oroqen', '', 'Oroqen Cultural Center', 'Heritage base, training programs, exhibitions', 'Well preserved', 1, 0, 0, 1),
|
||||||
|
|
||||||
|
('2', 'admin', NOW(), 'admin', NOW(), 'A04', 'Birch Bark Craft', 'BIRCH_BARK_CRAFT', 'Traditional Skills', 'National Level', 2008, 'GF[2008]12', 'Traditional birch bark crafting techniques', 'Complete process of birch bark collection, processing, and crafting', 'Centuries-old tradition of using birch bark for daily items', '["Bark collection","Processing techniques","Sewing skills","Pattern design"]', 'Represents Oroqen wisdom and artistic creativity', '/images/birch_bark.jpg', '[]', '', '', 'birch,craft,traditional', '', 'Oroqen Heritage Center', 'Skill inheritance, product development, market promotion', 'Well preserved', 1, 0, 0, 1),
|
||||||
|
|
||||||
|
('3', 'admin', NOW(), 'admin', NOW(), 'A04', 'Oroqen Folk Songs', 'FOLK_SONGS', 'Traditional Music', 'Provincial Level', 2009, 'HP[2009]8', 'Traditional folk songs of Oroqen people', 'Rich collection of songs reflecting life, emotions, and culture', 'Ancient musical traditions with diverse themes', '["Unique melodies","Rich content","Improvisation","Life integration"]', 'Important component of Oroqen musical heritage', '/images/folk_songs.jpg', '[]', '', '', 'folk songs,music,traditional', '', 'Heilongjiang Cultural Department', 'Recording, training, performances', 'Well preserved', 0, 0, 0, 1),
|
||||||
|
|
||||||
|
('4', 'admin', NOW(), 'admin', NOW(), 'A04', 'Shaman Dance', 'SHAMAN_DANCE', 'Traditional Dance', 'Provincial Level', 2010, 'HP[2010]15', 'Traditional Shaman dance of Oroqen people', 'Sacred dance form with religious significance and artistic expression', 'Ancient spiritual dance rooted in Shamanic beliefs', '["Religious significance","Unique movements","Rich symbolism","Musical integration"]', 'Reflects Oroqen spiritual world and beliefs', '/images/shaman_dance.jpg', '[]', '', '', 'shaman,dance,religious', '', 'Oroqen Cultural Center', 'Dance inheritance, ritual protection, cultural research', 'Well preserved', 0, 0, 0, 1),
|
||||||
|
|
||||||
|
('5', 'admin', NOW(), 'admin', NOW(), 'A04', 'Traditional Clothing Craft', 'TRADITIONAL_CLOTHING', 'Traditional Skills', 'Municipal Level', 2011, 'HB[2011]6', 'Traditional clothing making techniques', 'Complete system of design, material selection, and crafting', 'Distinctive ethnic clothing with exquisite craftsmanship', '["Unique design","Fine craftsmanship","Rich patterns","Practical beauty"]', 'Reflects Oroqen aesthetic concepts and cultural features', '/images/traditional_clothing.jpg', '[]', '', '', 'clothing,craft,ethnic', '', 'Hulunbuir Cultural Bureau', 'Skill inheritance, product development, exhibitions', 'Well preserved', 0, 0, 0, 1),
|
||||||
|
|
||||||
|
('6', 'admin', NOW(), 'admin', NOW(), 'A04', 'Mouth Harp Craft', 'MOUTH_HARP_CRAFT', 'Traditional Skills', 'Municipal Level', 2012, 'HB[2012]9', 'Traditional mouth harp making techniques', 'Complete process of material selection, crafting, and tuning', 'Ancient musical instrument with unique sound characteristics', '["Selected materials","Fine processing","Unique sound","Portable design"]', 'Reflects Oroqen musical culture and craftsmanship', '/images/mouth_harp.jpg', '[]', '', '', 'mouth harp,instrument,craft', '', 'Oroqen Cultural Center', 'Skill inheritance, instrument making, music promotion', 'Well preserved', 0, 0, 0, 1);
|
399
db/minimal_sample_data.sql
Normal file
399
db/minimal_sample_data.sql
Normal file
@ -0,0 +1,399 @@
|
|||||||
|
-- 鄂伦春族文化平台示例数据 - 每张表至少15条数据
|
||||||
|
|
||||||
|
-- 清空现有数据
|
||||||
|
DELETE FROM oroqen_user_favorite;
|
||||||
|
DELETE FROM oroqen_cart;
|
||||||
|
DELETE FROM oroqen_order_item;
|
||||||
|
DELETE FROM oroqen_order;
|
||||||
|
DELETE FROM oroqen_heritage_inheritor;
|
||||||
|
DELETE FROM oroqen_culture_content;
|
||||||
|
DELETE FROM oroqen_product;
|
||||||
|
DELETE FROM oroqen_culture_category;
|
||||||
|
DELETE FROM oroqen_product_category;
|
||||||
|
|
||||||
|
-- 产品分类(15个)
|
||||||
|
INSERT INTO oroqen_product_category (id, create_by, create_time, update_by, update_time, sys_org_code, category_name, category_code, parent_id, sort_order, description, icon, status) VALUES
|
||||||
|
('1', 'admin', NOW(), 'admin', NOW(), 'A04', '手工艺品', 'HANDICRAFT', NULL, 1, '传统手工艺制品', NULL, 1),
|
||||||
|
('2', 'admin', NOW(), 'admin', NOW(), 'A04', '桦皮制品', 'BIRCH_BARK', '1', 1, '桦皮盒篓等制品', NULL, 1),
|
||||||
|
('3', 'admin', NOW(), 'admin', NOW(), 'A04', '木雕制品', 'WOOD_CARVING', '1', 2, '传统木雕工艺品', NULL, 1),
|
||||||
|
('4', 'admin', NOW(), 'admin', NOW(), 'A04', '刺绣制品', 'EMBROIDERY', '1', 3, '民族刺绣艺术品', NULL, 1),
|
||||||
|
('5', 'admin', NOW(), 'admin', NOW(), 'A04', '皮革制品', 'LEATHER', '1', 4, '兽皮制作的用品', NULL, 1),
|
||||||
|
('6', 'admin', NOW(), 'admin', NOW(), 'A04', '服饰用品', 'CLOTHING', NULL, 2, '民族传统服饰', NULL, 1),
|
||||||
|
('7', 'admin', NOW(), 'admin', NOW(), 'A04', '传统帽饰', 'HAT', '6', 1, '各式传统帽子', NULL, 1),
|
||||||
|
('8', 'admin', NOW(), 'admin', NOW(), 'A04', '民族服装', 'COSTUME', '6', 2, '传统民族服装', NULL, 1),
|
||||||
|
('9', 'admin', NOW(), 'admin', NOW(), 'A04', '装饰配件', 'ACCESSORIES', '6', 3, '传统装饰配件', NULL, 1),
|
||||||
|
('10', 'admin', NOW(), 'admin', NOW(), 'A04', '生活用品', 'DAILY_USE', NULL, 3, '日常生活用品', NULL, 1),
|
||||||
|
('11', 'admin', NOW(), 'admin', NOW(), 'A04', '狩猎用具', 'HUNTING_TOOLS', '10', 1, '传统狩猎工具', NULL, 1),
|
||||||
|
('12', 'admin', NOW(), 'admin', NOW(), 'A04', '炊具餐具', 'KITCHENWARE', '10', 2, '传统炊具和餐具', NULL, 1),
|
||||||
|
('13', 'admin', NOW(), 'admin', NOW(), 'A04', '储物用具', 'STORAGE', '10', 3, '各种储物容器', NULL, 1),
|
||||||
|
('14', 'admin', NOW(), 'admin', NOW(), 'A04', '文化纪念品', 'SOUVENIR', NULL, 4, '文化旅游纪念品', NULL, 1),
|
||||||
|
('15', 'admin', NOW(), 'admin', NOW(), 'A04', '艺术收藏品', 'COLLECTIBLE', NULL, 5, '具有收藏价值的艺术品', NULL, 1);
|
||||||
|
|
||||||
|
-- 文化分类(15个)
|
||||||
|
INSERT INTO oroqen_culture_category (id, create_by, create_time, update_by, update_time, sys_org_code, category_name, category_code, parent_id, sort_order, description, icon, status) VALUES
|
||||||
|
('1', 'admin', NOW(), 'admin', NOW(), 'A04', '民族概况', 'ETHNIC_OVERVIEW', NULL, 1, '历史和人口概况', NULL, 1),
|
||||||
|
('2', 'admin', NOW(), 'admin', NOW(), 'A04', '传统文化', 'TRADITIONAL_CULTURE', NULL, 2, '传统习俗和文化', NULL, 1),
|
||||||
|
('3', 'admin', NOW(), 'admin', NOW(), 'A04', '狩猎文化', 'HUNTING_CULTURE', '2', 1, '狩猎传统和技艺', NULL, 1),
|
||||||
|
('4', 'admin', NOW(), 'admin', NOW(), 'A04', '饮食文化', 'FOOD_CULTURE', '2', 2, '传统饮食习俗', NULL, 1),
|
||||||
|
('5', 'admin', NOW(), 'admin', NOW(), 'A04', '服饰文化', 'CLOTHING_CULTURE', '2', 3, '传统服饰特色', NULL, 1),
|
||||||
|
('6', 'admin', NOW(), 'admin', NOW(), 'A04', '居住文化', 'HOUSING_CULTURE', '2', 4, '传统居住方式', NULL, 1),
|
||||||
|
('7', 'admin', NOW(), 'admin', NOW(), 'A04', '宗教信仰', 'RELIGION', NULL, 3, '宗教和信仰体系', NULL, 1),
|
||||||
|
('8', 'admin', NOW(), 'admin', NOW(), 'A04', '萨满文化', 'SHAMANISM', '7', 1, '萨满教传统', NULL, 1),
|
||||||
|
('9', 'admin', NOW(), 'admin', NOW(), 'A04', '祭祀仪式', 'RITUAL', '7', 2, '各种祭祀仪式', NULL, 1),
|
||||||
|
('10', 'admin', NOW(), 'admin', NOW(), 'A04', '民间艺术', 'FOLK_ART', NULL, 4, '民间艺术形式', NULL, 1),
|
||||||
|
('11', 'admin', NOW(), 'admin', NOW(), 'A04', '民间故事', 'FOLK_TALES', '10', 1, '传统民间故事', NULL, 1),
|
||||||
|
('12', 'admin', NOW(), 'admin', NOW(), 'A04', '民歌舞蹈', 'MUSIC_DANCE', '10', 2, '传统音乐舞蹈', NULL, 1),
|
||||||
|
('13', 'admin', NOW(), 'admin', NOW(), 'A04', '手工技艺', 'HANDICRAFT_SKILLS', '10', 3, '传统手工技艺', NULL, 1),
|
||||||
|
('14', 'admin', NOW(), 'admin', NOW(), 'A04', '语言文字', 'LANGUAGE', NULL, 5, '民族语言文字', NULL, 1),
|
||||||
|
('15', 'admin', NOW(), 'admin', NOW(), 'A04', '现代发展', 'MODERN_DEVELOPMENT', NULL, 6, '现代发展状况', NULL, 1);
|
||||||
|
|
||||||
|
-- 产品(15个)
|
||||||
|
INSERT INTO oroqen_product (id, create_by, create_time, update_by, update_time, sys_org_code, product_name, product_code, category_id, price, original_price, stock, sales_count, sort_order, main_image, images, description, cultural_story, craftsman_info, material, specifications, weight, dimensions, tags, is_featured, is_hot, status) VALUES
|
||||||
|
('prod-001', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春桦皮盒', 'BIRCH_BOX_001', '2', 168.00, 198.00, 50, 23, 1,
|
||||||
|
'https://example.com/images/birch_box.jpg',
|
||||||
|
'["https://example.com/images/birch_box_1.jpg"]',
|
||||||
|
'精美的鄂伦春传统桦皮盒,采用优质桦树皮制作,工艺精湛。',
|
||||||
|
'桦皮盒是鄂伦春族传统的储物容器,承载着深深的文化内涵。',
|
||||||
|
'关小云(国家级非遗传承人)',
|
||||||
|
'天然桦树皮', '20cm×15cm×10cm', 0.5, '20×15×10cm', '桦皮,手工,传统', 1, 1, 1),
|
||||||
|
|
||||||
|
('prod-002', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春刺绣挂饰', 'EMBROIDERY_001', '4', 88.00, 108.00, 30, 15, 2,
|
||||||
|
'https://example.com/images/embroidery.jpg',
|
||||||
|
'["https://example.com/images/embroidery_1.jpg"]',
|
||||||
|
'精美的鄂伦春传统刺绣挂饰,图案独特,色彩鲜艳。',
|
||||||
|
'鄂伦春族刺绣以其独特的图案和精湛的技艺闻名。',
|
||||||
|
'白淑贤(省级非遗传承人)',
|
||||||
|
'优质棉布、丝线', '直径15cm', 0.1, '15×15cm', '刺绣,挂饰,传统', 1, 0, 1),
|
||||||
|
|
||||||
|
('prod-003', 'admin', NOW(), 'admin', NOW(), 'A04', '传统木雕摆件', 'WOOD_CARVING_001', '3', 288.00, 328.00, 20, 8, 3,
|
||||||
|
'https://example.com/images/wood_carving.jpg',
|
||||||
|
'["https://example.com/images/wood_carving_1.jpg"]',
|
||||||
|
'手工雕刻的传统木雕摆件,造型生动,寓意吉祥。',
|
||||||
|
'木雕是鄂伦春族重要的手工艺术,体现了对自然的敬畏。',
|
||||||
|
'孟庆山(市级非遗传承人)',
|
||||||
|
'优质桦木', '高25cm', 0.8, '15×10×25cm', '木雕,摆件,艺术品', 1, 1, 1),
|
||||||
|
|
||||||
|
('prod-004', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春皮帽', 'LEATHER_HAT_001', '7', 158.00, 188.00, 25, 12, 4,
|
||||||
|
'https://example.com/images/leather_hat.jpg',
|
||||||
|
'["https://example.com/images/leather_hat_1.jpg"]',
|
||||||
|
'传统鄂伦春皮帽,保暖性好,具有浓郁的民族特色。',
|
||||||
|
'皮帽是鄂伦春族传统服饰的重要组成部分。',
|
||||||
|
'何秀英(县级非遗传承人)',
|
||||||
|
'优质鹿皮、狐狸毛', '均码', 0.3, '直径30cm', '皮帽,保暖,传统', 0, 1, 1),
|
||||||
|
|
||||||
|
('prod-005', 'admin', NOW(), 'admin', NOW(), 'A04', '民族服装套装', 'COSTUME_001', '8', 688.00, 788.00, 15, 5, 5,
|
||||||
|
'https://example.com/images/costume.jpg',
|
||||||
|
'["https://example.com/images/costume_1.jpg"]',
|
||||||
|
'精美的鄂伦春族传统服装,做工精细,色彩搭配和谐。',
|
||||||
|
'传统服装体现了鄂伦春族的审美观念和文化特色。',
|
||||||
|
'李桂花(省级非遗传承人)',
|
||||||
|
'优质布料、皮革', 'M码', 1.2, '上衣+裤子', '民族服装,传统,节庆', 1, 0, 1),
|
||||||
|
|
||||||
|
('prod-006', 'admin', NOW(), 'admin', NOW(), 'A04', '桦皮篓', 'BIRCH_BASKET_001', '2', 128.00, 148.00, 40, 18, 6,
|
||||||
|
'https://example.com/images/birch_basket.jpg',
|
||||||
|
'["https://example.com/images/birch_basket_1.jpg"]',
|
||||||
|
'实用的桦皮篓,可用于储物,具有很好的透气性。',
|
||||||
|
'桦皮篓是鄂伦春族传统的储物工具。',
|
||||||
|
'关小云(国家级非遗传承人)',
|
||||||
|
'天然桦树皮', '直径25cm,高20cm', 0.4, '25×25×20cm', '桦皮,篓子,储物', 0, 1, 1),
|
||||||
|
|
||||||
|
('prod-007', 'admin', NOW(), 'admin', NOW(), 'A04', '传统弓箭模型', 'BOW_ARROW_001', '11', 198.00, 228.00, 35, 10, 7,
|
||||||
|
'https://example.com/images/bow_arrow.jpg',
|
||||||
|
'["https://example.com/images/bow_arrow_1.jpg"]',
|
||||||
|
'精制的传统弓箭模型,展现鄂伦春族狩猎文化。',
|
||||||
|
'弓箭是鄂伦春族最重要的狩猎工具。',
|
||||||
|
'孟庆山(市级非遗传承人)',
|
||||||
|
'优质木材、牛筋', '弓长120cm', 0.6, '120×5×2cm', '弓箭,狩猎,模型', 1, 1, 1),
|
||||||
|
|
||||||
|
('prod-008', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春腰带', 'BELT_001', '9', 98.00, 118.00, 45, 22, 8,
|
||||||
|
'https://example.com/images/belt.jpg',
|
||||||
|
'["https://example.com/images/belt_1.jpg"]',
|
||||||
|
'传统鄂伦春腰带,装饰精美,实用性强。',
|
||||||
|
'腰带是鄂伦春族服饰的重要配件。',
|
||||||
|
'何秀英(县级非遗传承人)',
|
||||||
|
'优质皮革、金属饰品', '长120cm', 0.2, '120×5cm', '腰带,配饰,传统', 0, 0, 1),
|
||||||
|
|
||||||
|
('prod-009', 'admin', NOW(), 'admin', NOW(), 'A04', '桦皮茶叶罐', 'BIRCH_TEA_001', '13', 78.00, 98.00, 60, 28, 9,
|
||||||
|
'https://example.com/images/birch_tea.jpg',
|
||||||
|
'["https://example.com/images/birch_tea_1.jpg"]',
|
||||||
|
'精美的桦皮茶叶罐,密封性好,保持茶叶新鲜。',
|
||||||
|
'桦皮制品具有天然的防潮防虫功能。',
|
||||||
|
'关小云(国家级非遗传承人)',
|
||||||
|
'天然桦树皮', '高15cm,直径10cm', 0.2, '10×10×15cm', '桦皮,茶叶罐,储物', 0, 1, 1),
|
||||||
|
|
||||||
|
('prod-010', 'admin', NOW(), 'admin', NOW(), 'A04', '民族头饰', 'HEADDRESS_001', '9', 138.00, 168.00, 20, 7, 10,
|
||||||
|
'https://example.com/images/headdress.jpg',
|
||||||
|
'["https://example.com/images/headdress_1.jpg"]',
|
||||||
|
'华丽的民族头饰,适合节庆和表演使用。',
|
||||||
|
'头饰是鄂伦春族女性重要的装饰品。',
|
||||||
|
'李桂花(省级非遗传承人)',
|
||||||
|
'金属、羽毛、珠子', '均码', 0.3, '25×20×15cm', '头饰,装饰,节庆', 1, 0, 1),
|
||||||
|
|
||||||
|
('prod-011', 'admin', NOW(), 'admin', NOW(), 'A04', '手工皮靴', 'LEATHER_BOOTS_001', '5', 298.00, 348.00, 18, 6, 11,
|
||||||
|
'https://example.com/images/leather_boots.jpg',
|
||||||
|
'["https://example.com/images/leather_boots_1.jpg"]',
|
||||||
|
'传统手工皮靴,保暖防滑,适合户外活动。',
|
||||||
|
'皮靴是鄂伦春族重要的防护用品。',
|
||||||
|
'何秀英(县级非遗传承人)',
|
||||||
|
'优质鹿皮、牛皮', '40码', 0.8, '长筒靴', '皮靴,保暖,手工', 0, 1, 1),
|
||||||
|
|
||||||
|
('prod-012', 'admin', NOW(), 'admin', NOW(), 'A04', '木制餐具套装', 'WOODEN_TABLEWARE_001', '12', 118.00, 138.00, 32, 14, 12,
|
||||||
|
'https://example.com/images/wooden_tableware.jpg',
|
||||||
|
'["https://example.com/images/wooden_tableware_1.jpg"]',
|
||||||
|
'精美的木制餐具套装,环保健康,具有民族特色。',
|
||||||
|
'木制餐具体现了鄂伦春族与自然和谐相处的理念。',
|
||||||
|
'孟庆山(市级非遗传承人)',
|
||||||
|
'优质桦木', '套装5件', 0.5, '盒装25×20×8cm', '木制,餐具,环保', 0, 0, 1),
|
||||||
|
|
||||||
|
('prod-013', 'admin', NOW(), 'admin', NOW(), 'A04', '传统烟袋', 'TOBACCO_POUCH_001', '5', 88.00, 108.00, 28, 11, 13,
|
||||||
|
'https://example.com/images/tobacco_pouch.jpg',
|
||||||
|
'["https://example.com/images/tobacco_pouch_1.jpg"]',
|
||||||
|
'精制的传统烟袋,工艺精湛,具有收藏价值。',
|
||||||
|
'烟袋是鄂伦春族男性的重要随身用品。',
|
||||||
|
'何秀英(县级非遗传承人)',
|
||||||
|
'优质皮革、金属', '长20cm', 0.1, '20×8×3cm', '烟袋,皮革,传统', 1, 0, 1),
|
||||||
|
|
||||||
|
('prod-014', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春挂毯', 'TAPESTRY_001', '4', 388.00, 448.00, 12, 4, 14,
|
||||||
|
'https://example.com/images/tapestry.jpg',
|
||||||
|
'["https://example.com/images/tapestry_1.jpg"]',
|
||||||
|
'精美的鄂伦春挂毯,图案丰富,色彩绚丽。',
|
||||||
|
'挂毯展现了鄂伦春族的艺术审美和文化内涵。',
|
||||||
|
'白淑贤(省级非遗传承人)',
|
||||||
|
'优质毛线、丝线', '120cm×80cm', 1.5, '120×80cm', '挂毯,刺绣,装饰', 1, 1, 1),
|
||||||
|
|
||||||
|
('prod-015', 'admin', NOW(), 'admin', NOW(), 'A04', '文化纪念章', 'BADGE_001', '14', 38.00, 48.00, 100, 45, 15,
|
||||||
|
'https://example.com/images/badge.jpg',
|
||||||
|
'["https://example.com/images/badge_1.jpg"]',
|
||||||
|
'精美的文化纪念章,适合收藏和纪念。',
|
||||||
|
'纪念章承载着鄂伦春族的文化符号和精神内涵。',
|
||||||
|
'工艺师制作',
|
||||||
|
'合金、珐琅', '直径3cm', 0.02, '3×3×0.3cm', '纪念章,收藏,文化', 0, 1, 1);
|
||||||
|
|
||||||
|
-- 文化内容(15个)
|
||||||
|
INSERT INTO oroqen_culture_content (id, create_by, create_time, update_by, update_time, sys_org_code, title, category_id, summary, content, cover_image, images, video_url, audio_url, tags, author, source, is_recommended, view_count, like_count, favorite_count, sort_order, status) VALUES
|
||||||
|
('culture-001', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春族历史概述', '1',
|
||||||
|
'鄂伦春族是中国人口较少的民族之一,有着悠久的历史和独特的文化。',
|
||||||
|
'<p>鄂伦春族现有人口约8000余人,主要分布在内蒙古自治区和黑龙江省。鄂伦春族是典型的狩猎民族,以狩猎和采集为主要生产方式,创造了独特的森林文化。</p><p>鄂伦春族有自己的语言,属阿尔泰语系满-通古斯语族通古斯语支,没有文字,主要使用汉语文。</p>',
|
||||||
|
'https://example.com/images/history.jpg',
|
||||||
|
'["https://example.com/images/oroqen_map.jpg", "https://example.com/images/oroqen_people.jpg"]',
|
||||||
|
NULL, NULL, '鄂伦春族,历史,民族概况', '民族研究学者', '鄂伦春族文化研究中心', 1, 1256, 123, 89, 1, 1),
|
||||||
|
|
||||||
|
('culture-002', 'admin', NOW(), 'admin', NOW(), 'A04', '传统狩猎文化', '3',
|
||||||
|
'鄂伦春族的狩猎文化是其民族文化的核心,体现了人与自然和谐相处的智慧。',
|
||||||
|
'<p>鄂伦春族是典型的狩猎民族,狩猎是他们的主要生产方式。他们熟悉森林中各种动物的习性,掌握了丰富的狩猎技巧和经验。</p><p>传统的狩猎工具主要有弓箭、猎枪、陷阱等。鄂伦春族的弓箭制作工艺精湛,射程远,准确度高。</p><p>狩猎不仅是生产活动,也是文化传承的重要方式,体现了鄂伦春族对自然的敬畏和感恩。</p>',
|
||||||
|
'https://example.com/images/hunting.jpg',
|
||||||
|
'["https://example.com/images/hunting_tools.jpg", "https://example.com/images/bow_arrow.jpg"]',
|
||||||
|
NULL, NULL, '狩猎文化,传统技艺,弓箭', '关小云', '鄂伦春自治旗文化馆', 1, 2134, 245, 178, 2, 1),
|
||||||
|
|
||||||
|
('culture-003', 'admin', NOW(), 'admin', NOW(), 'A04', '传统饮食文化', '4',
|
||||||
|
'鄂伦春族的饮食文化具有鲜明的森林特色,以肉食为主,兼食野菜和浆果。',
|
||||||
|
'<p>鄂伦春族的传统饮食以狩猎获得的野生动物肉为主,如鹿肉、野猪肉、飞禽等。烹饪方法主要有烤、煮、炖等。</p><p>传统食品有手把肉、血肠、肉干等。手把肉是将整块肉煮熟后用手撕着吃,保持了肉的原汁原味。</p><p>野菜和浆果是重要的副食,如蕨菜、桔梗、都柿、稠李子等,既补充了维生素,又丰富了饮食结构。</p>',
|
||||||
|
'https://example.com/images/food.jpg',
|
||||||
|
'["https://example.com/images/traditional_food.jpg", "https://example.com/images/wild_vegetables.jpg"]',
|
||||||
|
NULL, NULL, '饮食文化,传统食品,野菜', '白淑贤', '鄂伦春族文化研究所', 1, 1876, 198, 134, 3, 1),
|
||||||
|
|
||||||
|
('culture-004', 'admin', NOW(), 'admin', NOW(), 'A04', '传统服饰文化', '5',
|
||||||
|
'鄂伦春族的传统服饰具有鲜明的民族特色,体现了森林狩猎民族的文化特点。',
|
||||||
|
'<p>鄂伦春族传统服饰以皮革为主要材料,具有保暖、耐用的特点。男女服饰既有共同点,也有明显区别。</p><p>男性服饰包括皮袍、皮裤、皮帽、皮靴等。皮袍多用鹿皮制作,宽大舒适,便于活动。</p><p>女性服饰更加注重装饰,在皮袍上绣有精美的花纹图案,色彩鲜艳,寓意吉祥。</p><p>头饰是服饰的重要组成部分,女性头饰尤为华丽,常用珠子、羽毛等装饰。</p>',
|
||||||
|
'https://example.com/images/clothing.jpg',
|
||||||
|
'["https://example.com/images/traditional_costume.jpg", "https://example.com/images/headdress.jpg"]',
|
||||||
|
NULL, NULL, '服饰文化,传统服装,民族特色', '李桂花', '内蒙古民族服饰研究中心', 1, 1654, 176, 112, 4, 1),
|
||||||
|
|
||||||
|
('culture-005', 'admin', NOW(), 'admin', NOW(), 'A04', '传统居住文化', '6',
|
||||||
|
'鄂伦春族的传统居住方式体现了游猎民族的生活特点和对自然环境的适应。',
|
||||||
|
'<p>鄂伦春族传统的住所叫"撮罗子",是一种圆锥形的帐篷式建筑。撮罗子用桦木杆搭建框架,外面覆盖桦树皮或兽皮。</p><p>撮罗子具有搭建简便、保暖性好、便于迁移的特点,非常适合游猎生活。内部布局简单实用,中央设火塘,周围铺兽皮作为起居场所。</p><p>随着定居生活的开始,鄂伦春族逐渐建造了木屋等固定住所,但撮罗子仍然是重要的文化符号。</p>',
|
||||||
|
'https://example.com/images/housing.jpg',
|
||||||
|
'["https://example.com/images/cuoluozi.jpg", "https://example.com/images/traditional_house.jpg"]',
|
||||||
|
NULL, NULL, '居住文化,撮罗子,传统建筑', '孟庆山', '鄂伦春族建筑文化研究会', 1, 1432, 145, 98, 5, 1),
|
||||||
|
|
||||||
|
('culture-006', 'admin', NOW(), 'admin', NOW(), 'A04', '萨满文化传统', '8',
|
||||||
|
'萨满文化是鄂伦春族重要的精神文化传统,体现了原始宗教的特点。',
|
||||||
|
'<p>萨满教是鄂伦春族的传统宗教,萨满是沟通人神之间的中介。萨满具有治病、占卜、祈福等功能。</p><p>萨满仪式是萨满文化的重要表现形式,包括跳神、念咒、击鼓等。萨满鼓是重要的法器,制作工艺独特。</p><p>萨满文化体现了鄂伦春族的世界观和价值观,对维护社会秩序、传承文化传统具有重要作用。</p>',
|
||||||
|
'https://example.com/images/shamanism.jpg',
|
||||||
|
'["https://example.com/images/shaman_drum.jpg", "https://example.com/images/shaman_ritual.jpg"]',
|
||||||
|
NULL, NULL, '萨满文化,宗教信仰,传统仪式', '何秀英', '萨满文化研究院', 1, 1789, 201, 156, 6, 1),
|
||||||
|
|
||||||
|
('culture-007', 'admin', NOW(), 'admin', NOW(), 'A04', '民间故事传说', '11',
|
||||||
|
'鄂伦春族拥有丰富的民间故事和传说,是口头文学的重要组成部分。',
|
||||||
|
'<p>鄂伦春族的民间故事内容丰富,包括神话传说、英雄故事、动物故事等。这些故事反映了鄂伦春族的历史、文化和价值观念。</p><p>著名的故事有《莫日根的故事》、《熊的传说》、《火的来历》等。这些故事通过口耳相传,世代流传。</p><p>民间故事不仅具有娱乐功能,还承担着教育和文化传承的重要作用,是了解鄂伦春族文化的重要窗口。</p>',
|
||||||
|
'https://example.com/images/folk_tales.jpg',
|
||||||
|
'["https://example.com/images/storytelling.jpg", "https://example.com/images/legend.jpg"]',
|
||||||
|
NULL, NULL, '民间故事,口头文学,文化传承', '关小云', '鄂伦春族文学研究会', 1, 1345, 134, 89, 7, 1),
|
||||||
|
|
||||||
|
('culture-008', 'admin', NOW(), 'admin', NOW(), 'A04', '传统音乐舞蹈', '12',
|
||||||
|
'鄂伦春族的传统音乐舞蹈具有浓郁的森林特色和民族风情。',
|
||||||
|
'<p>鄂伦春族的传统音乐以民歌为主,内容涉及狩猎、爱情、生活等各个方面。歌曲旋律优美,节奏明快,具有很强的感染力。</p><p>传统舞蹈有萨满舞、狩猎舞、丰收舞等。舞蹈动作模仿动物形态和狩猎场景,生动形象。</p><p>传统乐器有口弦琴、鼓等。口弦琴是鄂伦春族特有的乐器,音色独特,常用于表达情感。</p>',
|
||||||
|
'https://example.com/images/music_dance.jpg',
|
||||||
|
'["https://example.com/images/traditional_dance.jpg", "https://example.com/images/musical_instruments.jpg"]',
|
||||||
|
NULL, NULL, '音乐舞蹈,民歌,传统乐器', '白淑贤', '鄂伦春族艺术团', 1, 1567, 167, 123, 8, 1),
|
||||||
|
|
||||||
|
('culture-009', 'admin', NOW(), 'admin', NOW(), 'A04', '桦皮制作技艺', '13',
|
||||||
|
'桦皮制作技艺是鄂伦春族重要的传统手工艺,体现了高超的工艺水平。',
|
||||||
|
'<p>桦皮制作技艺是鄂伦春族的传统技艺,主要制作各种生活用品,如桦皮盒、桦皮篓、桦皮船等。</p><p>制作工艺包括选材、剥皮、晾晒、裁剪、缝制等多个步骤。每个步骤都有严格的要求和独特的技巧。</p><p>桦皮制品具有轻便、防水、防虫的特点,是理想的储物容器。这项技艺已被列入国家级非物质文化遗产名录。</p>',
|
||||||
|
'https://example.com/images/birch_craft.jpg',
|
||||||
|
'["https://example.com/images/birch_making.jpg", "https://example.com/images/birch_products.jpg"]',
|
||||||
|
NULL, NULL, '桦皮技艺,手工制作,非遗', '关小云', '国家级非遗传承人', 1, 2234, 278, 201, 9, 1),
|
||||||
|
|
||||||
|
('culture-010', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春语言特色', '14',
|
||||||
|
'鄂伦春语是鄂伦春族的母语,具有独特的语言特色和文化价值。',
|
||||||
|
'<p>鄂伦春语属阿尔泰语系满-通古斯语族通古斯语支,与满语、锡伯语等语言有亲缘关系。</p><p>鄂伦春语词汇丰富,特别是与狩猎、森林生活相关的词汇非常发达,体现了鄂伦春族的生活特点。</p><p>由于历史原因,鄂伦春族没有自己的文字,主要使用汉语文。目前,鄂伦春语的保护和传承面临挑战。</p>',
|
||||||
|
'https://example.com/images/language.jpg',
|
||||||
|
'["https://example.com/images/oral_tradition.jpg", "https://example.com/images/language_learning.jpg"]',
|
||||||
|
NULL, NULL, '鄂伦春语,语言特色,文化保护', '李桂花', '鄂伦春语言研究中心', 1, 1123, 98, 67, 10, 1),
|
||||||
|
|
||||||
|
('culture-011', 'admin', NOW(), 'admin', NOW(), 'A04', '祭祀仪式文化', '9',
|
||||||
|
'祭祀仪式是鄂伦春族重要的宗教文化活动,体现了对自然和祖先的敬畏。',
|
||||||
|
'<p>鄂伦春族的祭祀仪式包括祭山、祭火、祭祖等多种形式。这些仪式体现了鄂伦春族的宗教信仰和文化传统。</p><p>祭山仪式是最重要的祭祀活动,通常在春季举行,祈求山神保佑狩猎顺利。</p><p>祭火仪式体现了对火的崇拜,火被认为是神圣的,具有驱邪避灾的功能。</p>',
|
||||||
|
'https://example.com/images/ritual.jpg',
|
||||||
|
'["https://example.com/images/mountain_worship.jpg", "https://example.com/images/fire_ceremony.jpg"]',
|
||||||
|
NULL, NULL, '祭祀仪式,宗教文化,传统信仰', '何秀英', '鄂伦春族宗教文化研究所', 1, 1456, 156, 112, 11, 1),
|
||||||
|
|
||||||
|
('culture-012', 'admin', NOW(), 'admin', NOW(), 'A04', '现代发展历程', '15',
|
||||||
|
'鄂伦春族在新中国成立后经历了从游猎到定居的历史性转变。',
|
||||||
|
'<p>1951年,鄂伦春族实现了从原始社会向社会主义社会的直接过渡,这在中国民族发展史上具有重要意义。</p><p>1958年,鄂伦春族开始定居生活,告别了数千年的游猎生活方式。政府为鄂伦春族建设了新村,提供了现代化的生活设施。</p><p>改革开放以来,鄂伦春族在保持民族特色的同时,积极融入现代社会,在教育、文化、经济等方面取得了显著发展。</p>',
|
||||||
|
'https://example.com/images/modern_development.jpg',
|
||||||
|
'["https://example.com/images/settlement.jpg", "https://example.com/images/new_village.jpg"]',
|
||||||
|
NULL, NULL, '现代发展,定居生活,社会变迁', '孟庆山', '鄂伦春族发展史研究会', 1, 1789, 189, 145, 12, 1),
|
||||||
|
|
||||||
|
('culture-013', 'admin', NOW(), 'admin', NOW(), 'A04', '传统节庆活动', '2',
|
||||||
|
'鄂伦春族的传统节庆活动丰富多彩,体现了深厚的文化内涵。',
|
||||||
|
'<p>鄂伦春族的传统节日主要有春节、篝火节等。这些节日既保持了民族特色,又融入了现代元素。</p><p>篝火节是鄂伦春族最重要的传统节日,通常在6月18日举行。节日期间举行各种文化活动,如歌舞表演、体育竞赛、民俗展示等。</p><p>传统节庆活动是传承民族文化、增强民族认同的重要载体,对维护民族团结具有重要意义。</p>',
|
||||||
|
'https://example.com/images/festival.jpg',
|
||||||
|
'["https://example.com/images/bonfire_festival.jpg", "https://example.com/images/celebration.jpg"]',
|
||||||
|
NULL, NULL, '传统节庆,篝火节,文化活动', '白淑贤', '鄂伦春族文化节组委会', 1, 1678, 178, 134, 13, 1),
|
||||||
|
|
||||||
|
('culture-014', 'admin', NOW(), 'admin', NOW(), 'A04', '森林生态文化', '2',
|
||||||
|
'鄂伦春族的森林生态文化体现了人与自然和谐共生的理念。',
|
||||||
|
'<p>鄂伦春族世代生活在大兴安岭的原始森林中,形成了独特的森林生态文化。他们对森林有着深深的感情和丰富的知识。</p><p>鄂伦春族熟悉森林中各种动植物的习性和用途,掌握了丰富的生态知识。他们遵循"取之有度,用之有节"的原则,实现了可持续发展的理念。</p><p>这种生态文化理念对现代生态文明建设具有重要的启示意义。</p>',
|
||||||
|
'https://example.com/images/forest_culture.jpg',
|
||||||
|
'["https://example.com/images/forest_life.jpg", "https://example.com/images/ecological_wisdom.jpg"]',
|
||||||
|
NULL, NULL, '森林文化,生态智慧,可持续', '关小云', '生态文化研究院', 1, 1534, 167, 123, 14, 1),
|
||||||
|
|
||||||
|
('culture-015', 'admin', NOW(), 'admin', NOW(), 'A04', '文化保护与传承', '15',
|
||||||
|
'鄂伦春族文化的保护与传承是当前面临的重要课题。',
|
||||||
|
'<p>随着现代化进程的加快,鄂伦春族传统文化面临着传承危机。语言、技艺、习俗等都需要加强保护和传承。</p><p>目前,政府和社会各界aceepts开展文化保护工作,建立了文化传承基地,培养了一批非遗传承人。</p><p>文化保护与传承需要全社会的共同努力,既要保持传统文化的原真性,又要适应时代发展的需要,实现创新性发展。</p>',
|
||||||
|
'https://example.com/images/cultural_protection.jpg',
|
||||||
|
'["https://example.com/images/heritage_preservation.jpg", "https://example.com/images/cultural_education.jpg"]',
|
||||||
|
NULL, NULL, '文化保护,传承发展,非遗保护', '李桂花', '文化保护委员会', 1, 1876, 198, 167, 15, 1);
|
||||||
|
|
||||||
|
-- 传承人(15个)
|
||||||
|
INSERT INTO oroqen_heritage_inheritor (id, create_by, create_time, update_by, update_time, sys_org_code, name, gender, birth_year, hometown, avatar, biography, heritage_skills, heritage_level, achievements, representative_works, contact_info, status) VALUES
|
||||||
|
('inheritor-001', 'admin', NOW(), 'admin', NOW(), 'A04', '关小云', 0, 1952, '内蒙古鄂伦春自治旗',
|
||||||
|
'https://example.com/images/guan_xiaoyun.jpg',
|
||||||
|
'关小云,女,鄂伦春族,国家级非遗传承人,从事桦皮制作技艺40余年。',
|
||||||
|
'鄂伦春族桦皮制作技艺', '国家级',
|
||||||
|
'2008年被认定为国家级非遗传承人,多次参加国内外文化交流活动。',
|
||||||
|
'桦皮盒、桦皮篓、桦皮船等各类桦皮制品',
|
||||||
|
'通过鄂伦春自治旗文化馆联系', 1),
|
||||||
|
|
||||||
|
('inheritor-002', 'admin', NOW(), 'admin', NOW(), 'A04', '白淑贤', 0, 1958, '内蒙古鄂伦春自治旗',
|
||||||
|
'https://example.com/images/bai_shuxian.jpg',
|
||||||
|
'白淑贤,女,鄂伦春族,省级非遗传承人,精通鄂伦春族刺绣技艺。',
|
||||||
|
'鄂伦春族刺绣技艺', '省级',
|
||||||
|
'2012年被认定为省级非遗传承人,作品多次获得民族工艺品大赛奖项。',
|
||||||
|
'民族服饰刺绣、挂毯、装饰品等刺绣作品',
|
||||||
|
'通过内蒙古民族工艺美术协会联系', 1),
|
||||||
|
|
||||||
|
('inheritor-003', 'admin', NOW(), 'admin', NOW(), 'A04', '孟庆山', 1, 1945, '黑龙江省大兴安岭地区',
|
||||||
|
'https://example.com/images/meng_qingshan.jpg',
|
||||||
|
'孟庆山,男,鄂伦春族,市级非遗传承人,擅长传统木雕和弓箭制作。',
|
||||||
|
'鄂伦春族木雕技艺、弓箭制作技艺', '市级',
|
||||||
|
'2015年被认定为市级非遗传承人,制作的弓箭和木雕作品工艺精湛。',
|
||||||
|
'传统弓箭、木雕摆件、狩猎工具等',
|
||||||
|
'通过大兴安岭地区文化局联系', 1),
|
||||||
|
|
||||||
|
('inheritor-004', 'admin', NOW(), 'admin', NOW(), 'A04', '何秀英', 0, 1960, '内蒙古鄂伦春自治旗',
|
||||||
|
'https://example.com/images/he_xiuying.jpg',
|
||||||
|
'何秀英,女,鄂伦春族,县级非遗传承人,专门从事传统皮革制品制作。',
|
||||||
|
'鄂伦春族皮革制作技艺', '县级',
|
||||||
|
'2018年被认定为县级非遗传承人,制作的皮帽、皮靴等产品深受欢迎。',
|
||||||
|
'传统皮帽、皮靴、皮衣、烟袋等皮革制品',
|
||||||
|
'通过鄂伦春自治旗非遗保护中心联系', 1),
|
||||||
|
|
||||||
|
('inheritor-005', 'admin', NOW(), 'admin', NOW(), 'A04', '李桂花', 0, 1955, '内蒙古鄂伦春自治旗',
|
||||||
|
'https://example.com/images/li_guihua.jpg',
|
||||||
|
'李桂花,女,鄂伦春族,省级非遗传承人,精通传统服饰制作和头饰工艺。',
|
||||||
|
'鄂伦春族传统服饰制作技艺', '省级',
|
||||||
|
'2010年被认定为省级非遗传承人,多次参与民族服饰展演活动。',
|
||||||
|
'民族传统服装、头饰、腰带等服饰用品',
|
||||||
|
'通过内蒙古民族服饰研究中心联系', 1),
|
||||||
|
|
||||||
|
('inheritor-006', 'admin', NOW(), 'admin', NOW(), 'A04', '葛德胜', 1, 1948, '黑龙江省呼玛县',
|
||||||
|
'https://example.com/images/ge_desheng.jpg',
|
||||||
|
'葛德胜,男,鄂伦春族,国家级非遗传承人,是鄂伦春族民歌的杰出传承者。',
|
||||||
|
'鄂伦春族民歌', '国家级',
|
||||||
|
'2006年被认定为国家级非遗传承人,演唱的民歌被收录进国家音乐档案。',
|
||||||
|
'《狩猎歌》、《摇篮曲》、《赞美歌》等传统民歌',
|
||||||
|
'通过黑龙江省文化厅联系', 1),
|
||||||
|
|
||||||
|
('inheritor-007', 'admin', NOW(), 'admin', NOW(), 'A04', '吴桂凤', 0, 1962, '内蒙古鄂伦春自治旗',
|
||||||
|
'https://example.com/images/wu_guifeng.jpg',
|
||||||
|
'吴桂凤,女,鄂伦春族,市级非遗传承人,擅长传统舞蹈和萨满舞。',
|
||||||
|
'鄂伦春族传统舞蹈', '市级',
|
||||||
|
'2016年被认定为市级非遗传承人,多次在文化节上表演传统舞蹈。',
|
||||||
|
'萨满舞、狩猎舞、丰收舞等传统舞蹈',
|
||||||
|
'通过鄂伦春族艺术团联系', 1),
|
||||||
|
|
||||||
|
('inheritor-008', 'admin', NOW(), 'admin', NOW(), 'A04', '莫日根', 1, 1950, '内蒙古鄂伦春自治旗',
|
||||||
|
'https://example.com/images/morigen.jpg',
|
||||||
|
'莫日根,男,鄂伦春族,省级非遗传承人,是著名的民间故事讲述者。',
|
||||||
|
'鄂伦春族民间故事', '省级',
|
||||||
|
'2013年被认定为省级非遗传承人,收集整理了大量鄂伦春族民间故事。',
|
||||||
|
'《莫日根的传说》、《熊的故事》、《火神的传说》等民间故事',
|
||||||
|
'通过鄂伦春族文学研究会联系', 1),
|
||||||
|
|
||||||
|
('inheritor-009', 'admin', NOW(), 'admin', NOW(), 'A04', '苏莫', 1, 1965, '黑龙江省塔河县',
|
||||||
|
'https://example.com/images/sumo.jpg',
|
||||||
|
'苏莫,男,鄂伦春族,县级非遗传承人,精通传统狩猎技艺和森林知识。',
|
||||||
|
'鄂伦春族传统狩猎技艺', '县级',
|
||||||
|
'2019年被认定为县级非遗传承人,是最后一批掌握传统狩猎技艺的老猎人。',
|
||||||
|
'传统狩猎方法、动物追踪技术、森林生存技能',
|
||||||
|
'通过塔河县文化馆联系', 1),
|
||||||
|
|
||||||
|
('inheritor-010', 'admin', NOW(), 'admin', NOW(), 'A04', '娜仁花', 0, 1968, '内蒙古鄂伦春自治旗',
|
||||||
|
'https://example.com/images/narenhua.jpg',
|
||||||
|
'娜仁花,女,鄂伦春族,市级非遗传承人,专门从事传统饮食文化传承。',
|
||||||
|
'鄂伦春族传统饮食制作技艺', '市级',
|
||||||
|
'2017年被认定为市级非遗传承人,制作的传统食品保持了原汁原味。',
|
||||||
|
'手把肉、血肠、肉干、野菜料理等传统食品',
|
||||||
|
'通过鄂伦春族餐饮文化协会联系', 1),
|
||||||
|
|
||||||
|
('inheritor-011', 'admin', NOW(), 'admin', NOW(), 'A04', '额尔敦', 1, 1953, '内蒙古鄂伦春自治旗',
|
||||||
|
'https://example.com/images/erdun.jpg',
|
||||||
|
'额尔敦,男,鄂伦春族,省级非遗传承人,是鄂伦春语的重要传承者。',
|
||||||
|
'鄂伦春语言文化', '省级',
|
||||||
|
'2011年被认定为省级非遗传承人,致力于鄂伦春语的保护和传承工作。',
|
||||||
|
'鄂伦春语词典编纂、语言教学、口述历史记录',
|
||||||
|
'通过鄂伦春语言研究中心联系', 1),
|
||||||
|
|
||||||
|
('inheritor-012', 'admin', NOW(), 'admin', NOW(), 'A04', '乌云达来', 1, 1957, '内蒙古鄂伦春自治旗',
|
||||||
|
'https://example.com/images/wuyundalai.jpg',
|
||||||
|
'乌云达来,男,鄂伦春族,国家级非遗传承人,是萨满文化的重要传承者。',
|
||||||
|
'鄂伦春族萨满文化', '国家级',
|
||||||
|
'2009年被认定为国家级非遗传承人,深入研究和传承萨满文化传统。',
|
||||||
|
'萨满仪式、萨满鼓制作、萨满歌舞',
|
||||||
|
'通过萨满文化研究院联系', 1),
|
||||||
|
|
||||||
|
('inheritor-013', 'admin', NOW(), 'admin', NOW(), 'A04', '春花', 0, 1970, '黑龙江省漠河市',
|
||||||
|
'https://example.com/images/chunhua.jpg',
|
||||||
|
'春花,女,鄂伦春族,县级非遗传承人,擅长传统医药和草药知识。',
|
||||||
|
'鄂伦春族传统医药', '县级',
|
||||||
|
'2020年被认定为县级非遗传承人,掌握丰富的传统医药知识。',
|
||||||
|
'传统草药配方、民间医疗方法、保健养生知识',
|
||||||
|
'通过漠河市卫生健康委员会联系', 1),
|
||||||
|
|
||||||
|
('inheritor-014', 'admin', NOW(), 'admin', NOW(), 'A04', '巴图', 1, 1963, '内蒙古鄂伦春自治旗',
|
||||||
|
'https://example.com/images/batu.jpg',
|
||||||
|
'巴图,男,鄂伦春族,市级非遗传承人,专门从事传统乐器制作和演奏。',
|
||||||
|
'鄂伦春族传统乐器制作技艺', '市级',
|
||||||
|
'2018年被认定为市级非遗传承人,制作的口弦琴音色纯正。',
|
||||||
|
'口弦琴、萨满鼓、传统笛子等民族乐器',
|
||||||
|
'通过鄂伦春族音乐协会联系', 1),
|
||||||
|
|
||||||
|
('inheritor-015', 'admin', NOW(), 'admin', NOW(), 'A04', '萨仁高娃', 0, 1975, '内蒙古鄂伦春自治旗',
|
||||||
|
'https://example.com/images/sarengaowa.jpg',
|
||||||
|
'萨仁高娃,女,鄂伦春族,县级非遗传承人,致力于传统文化的现代传承。',
|
||||||
|
'鄂伦春族文化综合传承', '县级',
|
||||||
|
'2021年被认定为县级非遗传承人,是年轻一代传承人的代表。',
|
||||||
|
'文化教育、传统技艺培训、文化创新产品',
|
||||||
|
'通过鄂伦春族文化传承基地联系', 1);
|
61
db/oroqen_heritage_project.sql
Normal file
61
db/oroqen_heritage_project.sql
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
-- 设置字符集
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- 非遗项目表
|
||||||
|
DROP TABLE IF EXISTS `oroqen_heritage_project`;
|
||||||
|
CREATE TABLE `oroqen_heritage_project` (
|
||||||
|
`id` varchar(36) NOT NULL COMMENT '主键ID',
|
||||||
|
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||||
|
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
|
||||||
|
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
|
||||||
|
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
|
||||||
|
`project_name` varchar(200) NOT NULL COMMENT '项目名称',
|
||||||
|
`project_code` varchar(100) NOT NULL COMMENT '项目编码',
|
||||||
|
`category` varchar(100) DEFAULT NULL COMMENT '项目类别',
|
||||||
|
`heritage_level` varchar(50) NOT NULL COMMENT '非遗级别(国家级/省级/市级)',
|
||||||
|
`approval_year` int(11) DEFAULT NULL COMMENT '批准年份',
|
||||||
|
`approval_number` varchar(100) DEFAULT NULL COMMENT '批准文号',
|
||||||
|
`description` text COMMENT '项目描述',
|
||||||
|
`full_description` text COMMENT '详细描述',
|
||||||
|
`history` text COMMENT '历史渊源',
|
||||||
|
`features` text COMMENT '技艺特点(JSON数组)',
|
||||||
|
`value` text COMMENT '传承价值',
|
||||||
|
`cover_image` varchar(500) DEFAULT NULL COMMENT '封面图片',
|
||||||
|
`images` text COMMENT '图片集(JSON数组)',
|
||||||
|
`video_url` varchar(500) DEFAULT NULL COMMENT '视频链接',
|
||||||
|
`audio_url` varchar(500) DEFAULT NULL COMMENT '音频链接',
|
||||||
|
`tags` varchar(500) DEFAULT NULL COMMENT '标签(逗号分隔)',
|
||||||
|
`inheritor_ids` text COMMENT '关联传承人ID(逗号分隔)',
|
||||||
|
`protection_unit` varchar(200) DEFAULT NULL COMMENT '保护单位',
|
||||||
|
`protection_measures` text COMMENT '保护措施',
|
||||||
|
`current_status` varchar(100) DEFAULT NULL COMMENT '保护现状',
|
||||||
|
`is_recommended` tinyint(1) DEFAULT 0 COMMENT '是否推荐(0:否,1:是)',
|
||||||
|
`view_count` int(11) DEFAULT 0 COMMENT '浏览次数',
|
||||||
|
`like_count` int(11) DEFAULT 0 COMMENT '点赞次数',
|
||||||
|
`sort_order` int(11) DEFAULT 0 COMMENT '排序',
|
||||||
|
`status` tinyint(1) DEFAULT 1 COMMENT '状态(0:禁用,1:启用)',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_project_code` (`project_code`),
|
||||||
|
KEY `idx_heritage_level` (`heritage_level`),
|
||||||
|
KEY `idx_status` (`status`),
|
||||||
|
KEY `idx_is_recommended` (`is_recommended`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='非遗项目表';
|
||||||
|
|
||||||
|
-- 插入示例数据
|
||||||
|
INSERT INTO `oroqen_heritage_project` VALUES
|
||||||
|
('1', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春族狩猎文化', 'HUNTING_CULTURE', '传统技艺', '国家级', 2006, '国发〔2006〕18号', '鄂伦春族传统狩猎文化是中国北方游猎民族的典型代表', '鄂伦春族狩猎文化是以狩猎为生产方式的传统文化体系,包括狩猎技艺、狩猎工具制作、狩猎仪式等完整的文化内容。', '鄂伦春族世代以狩猎为生,形成了独特的狩猎文化传统,历史悠久,技艺精湛。', '["传统弓箭制作技艺","动物追踪技术","狩猎仪式传统","野生动物保护知识"]', '鄂伦春族狩猎文化体现了人与自然和谐共生的理念,具有重要的文化传承价值和生态保护意义。', '/images/hunting_culture.jpg', '[]', '', '', '狩猎,传统技艺,鄂伦春族', '', '鄂伦春自治旗文化馆', '建立传承基地,培养传承人,开展展示活动', '传承良好', 1, 0, 0, 1, 1),
|
||||||
|
|
||||||
|
('2', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春族桦皮制作技艺', 'BIRCH_BARK_CRAFT', '传统技艺', '国家级', 2008, '国发〔2008〕12号', '鄂伦春族传统桦皮制作技艺', '桦皮制作技艺是鄂伦春族传统手工艺的重要组成部分,包括桦皮采集、处理、制作各种生活用品的完整工艺流程。', '鄂伦春族利用桦树皮制作各种生活用品已有数百年历史,技艺世代相传。', '["桦皮采集技术","桦皮处理工艺","缝制技巧","装饰图案设计"]', '桦皮制作技艺体现了鄂伦春族的生活智慧和艺术创造力,是重要的民族文化遗产。', '/images/birch_bark.jpg', '[]', '', '', '桦皮,手工艺,传统技艺', '', '鄂伦春自治旗非遗保护中心', '技艺传承,产品开发,市场推广', '传承良好', 1, 0, 0, 2, 1),
|
||||||
|
|
||||||
|
('3', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春族民歌', 'FOLK_SONGS', '传统音乐', '省级', 2009, '黑政发〔2009〕8号', '鄂伦春族传统民歌', '鄂伦春族民歌是反映鄂伦春族生产生活、情感表达的重要载体,具有独特的音乐特色和文化内涵。', '鄂伦春族民歌历史悠久,内容丰富,涵盖狩猎、生活、爱情等各个方面。', '["独特的音调结构","丰富的表现内容","即兴创作特点","与生活紧密结合"]', '鄂伦春族民歌是民族音乐文化的重要组成部分,具有重要的艺术价值和文化传承意义。', '/images/folk_songs.jpg', '[]', '', '', '民歌,传统音乐,鄂伦春族', '', '黑龙江省文化厅', '录音保存,传承培训,演出展示', '传承良好', 0, 0, 0, 3, 1),
|
||||||
|
|
||||||
|
('4', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春族萨满舞', 'SHAMAN_DANCE', '传统舞蹈', '省级', 2010, '黑政发〔2010〕15号', '鄂伦春族传统萨满舞蹈', '萨满舞是鄂伦春族宗教仪式中的重要组成部分,具有神秘的宗教色彩和独特的艺术表现形式。', '萨满舞起源于鄂伦春族的萨满教信仰,是宗教仪式的重要表现形式。', '["神秘的宗教色彩","独特的舞蹈动作","丰富的象征意义","与音乐的完美结合"]', '萨满舞体现了鄂伦春族的宗教信仰和精神世界,具有重要的文化研究价值。', '/images/shaman_dance.jpg', '[]', '', '', '萨满舞,传统舞蹈,宗教文化', '', '鄂伦春自治旗文化馆', '舞蹈传承,仪式保护,文化研究', '传承良好', 0, 0, 0, 4, 1),
|
||||||
|
|
||||||
|
('5', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春族传统服饰制作技艺', 'TRADITIONAL_CLOTHING', '传统技艺', '市级', 2011, '呼政发〔2011〕6号', '鄂伦春族传统服饰制作技艺', '鄂伦春族传统服饰制作技艺包括服装设计、材料选择、缝制工艺、装饰技法等完整的制作体系。', '鄂伦春族传统服饰具有鲜明的民族特色,制作工艺精湛,装饰图案丰富。', '["独特的设计风格","精湛的缝制工艺","丰富的装饰图案","实用与美观并重"]', '传统服饰制作技艺体现了鄂伦春族的审美观念和文化特色,具有重要的文化传承价值。', '/images/traditional_clothing.jpg', '[]', '', '', '传统服饰,手工艺,民族文化', '', '呼伦贝尔市文化局', '技艺传承,产品开发,展示推广', '传承良好', 0, 0, 0, 5, 1),
|
||||||
|
|
||||||
|
('6', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春族口弦琴制作技艺', 'MOUTH_HARP_CRAFT', '传统技艺', '市级', 2012, '呼政发〔2012〕9号', '鄂伦春族传统口弦琴制作技艺', '口弦琴是鄂伦春族传统乐器,制作技艺包括材料选择、加工制作、调音等工艺流程。', '口弦琴是鄂伦春族古老的乐器,制作技艺世代相传,具有独特的音色特点。', '["精选竹材","精细加工","独特音色","便于携带"]', '口弦琴制作技艺体现了鄂伦春族的音乐文化和手工艺水平,具有重要的文化价值。', '/images/mouth_harp.jpg', '[]', '', '', '口弦琴,传统乐器,手工艺', '', '鄂伦春自治旗文化馆', '技艺传承,乐器制作,音乐推广', '传承良好', 0, 0, 0, 6, 1);
|
||||||
|
|
||||||
|
-- 恢复外键检查
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
113
db/oroqen_sample_data.sql
Normal file
113
db/oroqen_sample_data.sql
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
-- 鄂伦春族文化产品示例数据
|
||||||
|
|
||||||
|
-- 产品示例数据
|
||||||
|
INSERT INTO `oroqen_product` VALUES
|
||||||
|
('prod-001', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春桦皮盒', 'BIRCH_BOX_001', '2', 168.00, 198.00, 50, 23, 1,
|
||||||
|
'https://example.com/images/birch_box_main.jpg',
|
||||||
|
'["https://example.com/images/birch_box_1.jpg","https://example.com/images/birch_box_2.jpg","https://example.com/images/birch_box_3.jpg"]',
|
||||||
|
'精美的鄂伦春传统桦皮盒,采用优质桦树皮制作,工艺精湛,实用美观。',
|
||||||
|
'桦皮盒是鄂伦春族传统的储物容器,承载着深厚的文化内涵。在游猎生活中,桦皮盒轻便耐用,是不可缺少的生活用品。',
|
||||||
|
'制作工艺师:关小云(国家级非遗传承人)',
|
||||||
|
'天然桦树皮', '长20cm×宽15cm×高10cm', 0.5, '20×15×10cm', '桦皮,手工,传统工艺,收纳', 1, 1, 1),
|
||||||
|
|
||||||
|
('prod-002', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春刺绣挂饰', 'EMBROIDERY_001', '3', 88.00, 108.00, 30, 15, 2,
|
||||||
|
'https://example.com/images/embroidery_main.jpg',
|
||||||
|
'["https://example.com/images/embroidery_1.jpg","https://example.com/images/embroidery_2.jpg"]',
|
||||||
|
'精美的鄂伦春传统刺绣挂饰,图案寓意吉祥,色彩鲜艳。',
|
||||||
|
'鄂伦春族刺绣以其独特的图案和精湛的技艺闻名,每一针每一线都蕴含着民族文化的精髓。',
|
||||||
|
'制作工艺师:白淑贤(省级非遗传承人)',
|
||||||
|
'优质棉布、丝线', '直径15cm', 0.1, '15×15cm', '刺绣,挂饰,传统工艺,装饰', 1, 0, 1),
|
||||||
|
|
||||||
|
('prod-003', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春木雕摆件', 'WOOD_CARVING_001', '4', 288.00, 328.00, 20, 8, 3,
|
||||||
|
'https://example.com/images/wood_carving_main.jpg',
|
||||||
|
'["https://example.com/images/wood_carving_1.jpg","https://example.com/images/wood_carving_2.jpg","https://example.com/images/wood_carving_3.jpg"]',
|
||||||
|
'精美的鄂伦春传统木雕摆件,雕工精细,造型生动。',
|
||||||
|
'木雕是鄂伦春族传统手工艺之一,多以动物形象为主题,体现了民族对自然的敬畏和热爱。',
|
||||||
|
'制作工艺师:孟金山(市级非遗传承人)',
|
||||||
|
'优质椴木', '高25cm×宽18cm×深12cm', 1.2, '25×18×12cm', '木雕,摆件,传统工艺,装饰', 1, 1, 1),
|
||||||
|
|
||||||
|
('prod-004', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春风干肉', 'DRIED_MEAT_001', '6', 128.00, 148.00, 100, 45, 4,
|
||||||
|
'https://example.com/images/dried_meat_main.jpg',
|
||||||
|
'["https://example.com/images/dried_meat_1.jpg","https://example.com/images/dried_meat_2.jpg"]',
|
||||||
|
'传统工艺制作的鄂伦春风干肉,口感独特,营养丰富。',
|
||||||
|
'风干肉是鄂伦春族传统的肉类保存方法,在漫长的冬季为族人提供重要的蛋白质来源。',
|
||||||
|
'制作工艺师:传统工艺传承',
|
||||||
|
'优质牛肉', '500g装', 0.5, '包装规格500g', '风干肉,特色食品,传统工艺,营养', 0, 1, 1),
|
||||||
|
|
||||||
|
('prod-005', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春文创T恤', 'TSHIRT_001', '8', 98.00, 118.00, 80, 32, 5,
|
||||||
|
'https://example.com/images/tshirt_main.jpg',
|
||||||
|
'["https://example.com/images/tshirt_1.jpg","https://example.com/images/tshirt_2.jpg","https://example.com/images/tshirt_3.jpg"]',
|
||||||
|
'融合传统元素的现代文创T恤,舒适透气,时尚美观。',
|
||||||
|
'将鄂伦春族传统图案与现代设计相结合,展现民族文化的时尚魅力。',
|
||||||
|
'设计师:现代文创设计团队',
|
||||||
|
'100%纯棉', 'S/M/L/XL', 0.2, '标准服装尺码', '文创,T恤,时尚,传统图案', 1, 0, 1);
|
||||||
|
|
||||||
|
-- 文化内容示例数据(更新字段结构)
|
||||||
|
INSERT INTO `oroqen_culture_content` VALUES
|
||||||
|
('culture-001', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春族历史概述', '1',
|
||||||
|
'鄂伦春族是中国人口较少的民族之一,主要分布在内蒙古自治区和黑龙江省。',
|
||||||
|
'<p>鄂伦春族是中国56个民族中人口较少的民族之一,现有人口约8000余人,主要分布在内蒙古自治区呼伦贝尔市的鄂伦春自治旗、扎兰屯市、莫力达瓦达斡尔自治旗,以及黑龙江省的黑河市、大兴安岭地区等地。</p><p>"鄂伦春"一词有两种含义:一是"住在山岭上的人",二是"使用驯鹿的人"。鄂伦春族世代生活在大兴安岭的深山密林中,以狩猎和饲养驯鹿为主要生活方式,被誉为"兴安岭上的猎神"。</p><p>鄂伦春族有着悠久的历史和独特的文化传统,在长期的狩猎生活中形成了丰富多彩的民族文化,包括独特的语言、宗教信仰、生活习俗、手工艺等。</p>',
|
||||||
|
'https://example.com/images/oroqen_history_cover.jpg',
|
||||||
|
'["https://example.com/images/oroqen_map.jpg","https://example.com/images/oroqen_people.jpg"]',
|
||||||
|
NULL, NULL, '鄂伦春族,历史,民族概况,大兴安岭', '民族研究学者', '鄂伦春族文化研究中心', 1, 156, 23, 12, 1, 1),
|
||||||
|
|
||||||
|
('culture-002', 'admin', NOW(), 'admin', NOW(), 'A04', '传统狩猎文化', '3',
|
||||||
|
'鄂伦春族的狩猎文化是其民族文化的核心组成部分,体现了人与自然和谐共生的理念。',
|
||||||
|
'<p>鄂伦春族是典型的狩猎民族,狩猎不仅是他们的主要生产方式,更是其文化传统的重要载体。在漫长的历史发展过程中,鄂伦春族形成了独特而完整的狩猎文化体系。</p><p><strong>狩猎工具:</strong>鄂伦春族使用的传统狩猎工具主要有弓箭、猎枪、套索、陷阱等。其中,桦木弓和骨箭头是最具特色的传统武器。</p><p><strong>狩猎技巧:</strong>鄂伦春猎人具有丰富的狩猎经验和高超的技艺,能够根据动物的足迹、粪便、叫声等判断动物的种类、数量和行踪。</p><p><strong>狩猎禁忌:</strong>鄂伦春族在狩猎中有着严格的禁忌和规矩,如不能滥杀动物、要保护幼崽和怀孕的母兽等,体现了朴素的生态保护意识。</p>',
|
||||||
|
'https://example.com/images/hunting_culture_cover.jpg',
|
||||||
|
'["https://example.com/images/hunting_tools.jpg","https://example.com/images/hunting_scene.jpg","https://example.com/images/hunter_portrait.jpg"]',
|
||||||
|
'https://example.com/videos/hunting_documentary.mp4', NULL, '狩猎文化,传统技艺,生态保护,民族传统', '关小云', '鄂伦春自治旗文化馆', 1, 234, 45, 28, 2, 1),
|
||||||
|
|
||||||
|
('culture-003', 'admin', NOW(), 'admin', NOW(), 'A04', '撮罗子——传统居住文化', '5',
|
||||||
|
'撮罗子是鄂伦春族传统的移动式住所,体现了游猎民族的生活智慧。',
|
||||||
|
'<p>撮罗子(仙人柱)是鄂伦春族传统的圆锥形住所,是适应游猎生活的理想居住形式。</p><p><strong>结构特点:</strong>撮罗子由25-30根落叶松杆搭建而成,呈圆锥形,直径约4-6米,高约3-4米。顶部留有烟囱口,用于通风和排烟。</p><p><strong>覆盖材料:</strong>夏季用桦树皮覆盖,冬季用狍皮或鹿皮覆盖,具有良好的防风防雨性能。</p><p><strong>内部布局:</strong>撮罗子内部布局有严格的规矩,正对门口的位置是神位,左侧是男人的位置,右侧是女人的位置,中央是火塘。</p><p><strong>文化意义:</strong>撮罗子不仅是居住场所,更是鄂伦春族文化的重要载体,承载着丰富的民族文化内涵。</p>',
|
||||||
|
'https://example.com/images/cuoluozi_cover.jpg',
|
||||||
|
'["https://example.com/images/cuoluozi_exterior.jpg","https://example.com/images/cuoluozi_interior.jpg","https://example.com/images/cuoluozi_construction.jpg"]',
|
||||||
|
'https://example.com/videos/cuoluozi_building.mp4', NULL, '撮罗子,传统建筑,居住文化,游猎民族', '孟德力格尔', '内蒙古民族建筑研究所', 1, 189, 34, 19, 3, 1),
|
||||||
|
|
||||||
|
('culture-004', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春族传统服饰', '6',
|
||||||
|
'鄂伦春族传统服饰以实用性和装饰性并重,体现了民族的审美情趣和文化特色。',
|
||||||
|
'<p>鄂伦春族传统服饰具有鲜明的民族特色和地域特点,主要以兽皮为原料,适应寒冷的气候环境。</p><p><strong>男性服饰:</strong>男子穿狍皮制作的长袍,外套短上衣,下穿皮裤,脚穿皮靴。帽子多用狐狸皮或狍子头皮制作。</p><p><strong>女性服饰:</strong>女子穿长及脚面的皮袍,袍边、袖口、下摆等处装饰有彩色布条或丝线刺绣,图案多为花草、动物等。</p><p><strong>装饰特色:</strong>服饰上常装饰有各种图案,如云纹、花卉、动物等,色彩鲜艳,寓意吉祥。</p><p><strong>制作工艺:</strong>传统服饰制作工艺复杂,需要经过选皮、鞣制、裁剪、缝制、装饰等多道工序。</p>',
|
||||||
|
'https://example.com/images/traditional_clothing_cover.jpg',
|
||||||
|
'["https://example.com/images/male_clothing.jpg","https://example.com/images/female_clothing.jpg","https://example.com/images/clothing_details.jpg"]',
|
||||||
|
NULL, NULL, '传统服饰,民族服装,手工艺,文化传承', '白淑贤', '鄂伦春自治旗妇联', 1, 167, 28, 15, 4, 1),
|
||||||
|
|
||||||
|
('culture-005', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春族传统饮食文化', '4',
|
||||||
|
'鄂伦春族的饮食文化体现了游猎民族的生活特色,以肉食为主,制作工艺独特。',
|
||||||
|
'<p>鄂伦春族的饮食文化具有鲜明的游猎民族特色,主要以狩猎获得的野生动物肉类为主食,辅以采集的山野菜、浆果等。</p><p><strong>主要食材:</strong>鹿肉、狍子肉、野猪肉、飞龙、野鸡等野生动物肉类,以及蕨菜、桔梗、黄花菜等山野菜。</p><p><strong>制作方法:</strong>烤肉、炖肉、风干肉是主要的肉类制作方法。风干肉是鄂伦春族特有的肉类保存方式,可以长期储存。</p><p><strong>特色食品:</strong>手把肉、烤肉串、肉粥、野菜汤等都是鄂伦春族的传统美食。</p><p><strong>饮食习俗:</strong>鄂伦春族有着独特的饮食礼仪和习俗,体现了对自然的敬畏和感恩。</p>',
|
||||||
|
'https://example.com/images/traditional_food_cover.jpg',
|
||||||
|
'["https://example.com/images/dried_meat.jpg","https://example.com/images/roasted_meat.jpg","https://example.com/images/wild_vegetables.jpg"]',
|
||||||
|
NULL, 'https://example.com/audios/cooking_songs.mp3', '饮食文化,传统美食,游猎民族,风干肉', '乌热尔图', '鄂伦春族文化研究会', 1, 145, 32, 21, 5, 1),
|
||||||
|
|
||||||
|
('culture-006', 'admin', NOW(), 'admin', NOW(), 'A04', '鄂伦春族萨满文化', '7',
|
||||||
|
'萨满文化是鄂伦春族传统宗教信仰的核心,体现了民族的精神世界和文化内涵。',
|
||||||
|
'<p>萨满教是鄂伦春族的传统宗教信仰,萨满被认为是沟通人神之间的使者,在民族文化中占有重要地位。</p><p><strong>萨满职能:</strong>萨满主要负责祭祀、治病、占卜、驱邪等宗教活动,是民族精神生活的重要组织者。</p><p><strong>神灵信仰:</strong>鄂伦春族信仰多种神灵,包括天神、山神、水神、火神等,体现了万物有灵的原始宗教观念。</p><p><strong>祭祀仪式:</strong>春祭、秋祭、狩猎祭等是重要的祭祀活动,通过歌舞、祈祷等形式表达对神灵的敬畏。</p><p><strong>文化传承:</strong>萨满文化通过口传心授的方式传承,包含了丰富的神话传说、宗教仪式和民族智慧。</p>',
|
||||||
|
'https://example.com/images/shaman_culture_cover.jpg',
|
||||||
|
'["https://example.com/images/shaman_ritual.jpg","https://example.com/images/shaman_costume.jpg","https://example.com/images/sacred_objects.jpg"]',
|
||||||
|
'https://example.com/videos/shaman_ceremony.mp4', 'https://example.com/audios/shaman_chanting.mp3', '萨满文化,宗教信仰,传统仪式,精神文化', '莫日根', '鄂伦春族萨满文化研究中心', 1, 298, 67, 45, 6, 1);
|
||||||
|
|
||||||
|
-- 非遗传承人示例数据
|
||||||
|
INSERT INTO `oroqen_heritage_inheritor` VALUES
|
||||||
|
('inheritor-001', 'admin', NOW(), 'admin', NOW(), 'A04', '关小云', 0, 1952, '内蒙古鄂伦春自治旗',
|
||||||
|
'https://example.com/images/guan_xiaoyun_avatar.jpg',
|
||||||
|
'关小云,女,鄂伦春族,1952年生于内蒙古鄂伦春自治旗。国家级非物质文化遗产鄂伦春族桦皮制作技艺代表性传承人。从小跟随母亲学习桦皮制作技艺,技艺精湛,作品精美。',
|
||||||
|
'鄂伦春族桦皮制作技艺', '国家级',
|
||||||
|
'2008年被认定为国家级非物质文化遗产代表性传承人;多次参加国内外文化交流活动;作品被多家博物馆收藏。',
|
||||||
|
'桦皮盒、桦皮篓、桦皮船等各类桦皮制品',
|
||||||
|
'联系方式:通过鄂伦春自治旗文化馆', 1),
|
||||||
|
|
||||||
|
('inheritor-002', 'admin', NOW(), 'admin', NOW(), 'A04', '白淑贤', 0, 1958, '内蒙古鄂伦春自治旗',
|
||||||
|
'https://example.com/images/bai_shuxian_avatar.jpg',
|
||||||
|
'白淑贤,女,鄂伦春族,1958年生。自治区级非物质文化遗产鄂伦春族刺绣技艺代表性传承人。擅长传统刺绣技艺,作品图案精美,色彩搭配和谐。',
|
||||||
|
'鄂伦春族刺绣技艺', '自治区级',
|
||||||
|
'2012年被认定为自治区级非物质文化遗产代表性传承人;积极参与民族文化传承活动;培养了多名刺绣技艺传承人。',
|
||||||
|
'传统服饰刺绣、装饰品刺绣、现代刺绣工艺品',
|
||||||
|
'联系方式:通过鄂伦春自治旗妇联', 1),
|
||||||
|
|
||||||
|
('inheritor-003', 'admin', NOW(), 'admin', NOW(), 'A04', '孟金山', 1, 1965, '黑龙江省黑河市',
|
||||||
|
'https://example.com/images/meng_jinshan_avatar.jpg',
|
||||||
|
'孟金山,男,鄂伦春族,1965年生于黑龙江省黑河市。市级非遗传承鄂伦春族木雕技艺代表性传承人。从事木雕创作30余年,作品造型生动,技艺精湛。',
|
||||||
|
'鄂伦春族木雕技艺', '市级',
|
||||||
|
'2015年被认定为市级非遗传承人;作品多次在民族工艺品展览中获奖;开设木雕技艺培训班。',
|
||||||
|
'动物木雕、人物木雕、装饰木雕',
|
||||||
|
'联系方式:通过黑河市文化馆', 1);
|
161
db/oroqen_tables.sql
Normal file
161
db/oroqen_tables.sql
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
package org.jeecg.modules.oroqen.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 产品
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("oroqen_product")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "产品")
|
||||||
|
public class OroqenProduct implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**产品名称*/
|
||||||
|
@Excel(name = "产品名称", width = 15)
|
||||||
|
@Schema(description = "产品名称")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/**产品编码*/
|
||||||
|
@Excel(name = "产品编码", width = 15)
|
||||||
|
@Schema(description = "产品编码")
|
||||||
|
private String productCode;
|
||||||
|
|
||||||
|
/**分类ID*/
|
||||||
|
@Excel(name = "分类ID", width = 15)
|
||||||
|
@Schema(description = "分类ID")
|
||||||
|
private String categoryId;
|
||||||
|
|
||||||
|
/**价格*/
|
||||||
|
@Excel(name = "价格", width = 15)
|
||||||
|
@Schema(description = "价格")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
/**库存*/
|
||||||
|
@Excel(name = "库存", width = 15)
|
||||||
|
@Schema(description = "库存")
|
||||||
|
private Integer stock;
|
||||||
|
|
||||||
|
/**主图*/
|
||||||
|
@Excel(name = "主图", width = 15)
|
||||||
|
@Schema(description = "主图")
|
||||||
|
private String mainImage;
|
||||||
|
|
||||||
|
/**产品图片(多张,逗号分隔)*/
|
||||||
|
@Excel(name = "产品图片", width = 15)
|
||||||
|
@Schema(description = "产品图片(多张,逗号分隔)")
|
||||||
|
private String images;
|
||||||
|
|
||||||
|
/**产品视频URL*/
|
||||||
|
@Excel(name = "产品视频URL", width = 15)
|
||||||
|
@Schema(description = "产品视频URL")
|
||||||
|
private String productVideo;
|
||||||
|
|
||||||
|
/**产品描述*/
|
||||||
|
@Excel(name = "产品描述", width = 15)
|
||||||
|
@Schema(description = "产品描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**文化故事*/
|
||||||
|
@Excel(name = "文化故事", width = 15)
|
||||||
|
@Schema(description = "文化故事")
|
||||||
|
private String culturalStory;
|
||||||
|
|
||||||
|
/**工匠信息*/
|
||||||
|
@Excel(name = "工匠信息", width = 15)
|
||||||
|
@Schema(description = "工匠信息")
|
||||||
|
private String craftsmanInfo;
|
||||||
|
|
||||||
|
/**材质*/
|
||||||
|
@Excel(name = "材质", width = 15)
|
||||||
|
@Schema(description = "材质")
|
||||||
|
private String material;
|
||||||
|
|
||||||
|
/**规格*/
|
||||||
|
@Excel(name = "规格", width = 15)
|
||||||
|
@Schema(description = "规格")
|
||||||
|
private String specifications;
|
||||||
|
|
||||||
|
/**重量(克)*/
|
||||||
|
@Excel(name = "重量(克)", width = 15)
|
||||||
|
@Schema(description = "重量(克)")
|
||||||
|
private Integer weight;
|
||||||
|
|
||||||
|
/**尺寸*/
|
||||||
|
@Excel(name = "尺寸", width = 15)
|
||||||
|
@Schema(description = "尺寸")
|
||||||
|
private String dimensions;
|
||||||
|
|
||||||
|
/**标签(多个,逗号分隔)*/
|
||||||
|
@Excel(name = "标签", width = 15)
|
||||||
|
@Schema(description = "标签(多个,逗号分隔)")
|
||||||
|
private String tags;
|
||||||
|
|
||||||
|
/**是否推荐(0-否,1-是)*/
|
||||||
|
@Excel(name = "是否推荐", width = 15)
|
||||||
|
@Schema(description = "是否推荐(0-否,1-是)")
|
||||||
|
private Integer isFeatured;
|
||||||
|
|
||||||
|
/**是否热销(0-否,1-是)*/
|
||||||
|
@Excel(name = "是否热销", width = 15)
|
||||||
|
@Schema(description = "是否热销(0-否,1-是)")
|
||||||
|
private Integer isHot;
|
||||||
|
|
||||||
|
/**销量*/
|
||||||
|
@Excel(name = "销量", width = 15)
|
||||||
|
@Schema(description = "销量")
|
||||||
|
private Integer salesCount;
|
||||||
|
|
||||||
|
/**排序*/
|
||||||
|
@Excel(name = "排序", width = 15)
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
/**状态(0-下架,1-上架)*/
|
||||||
|
@Excel(name = "状态", width = 15)
|
||||||
|
@Schema(description = "状态(0-下架,1-上架)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
@ -182,6 +182,9 @@ public class ShiroConfig {
|
|||||||
|
|
||||||
filterChainDefinitionMap.put("/openapi/call/**", "anon");
|
filterChainDefinitionMap.put("/openapi/call/**", "anon");
|
||||||
|
|
||||||
|
// Oroqen项目API接口排除身份验证
|
||||||
|
filterChainDefinitionMap.put("/oroqen/**", "anon");
|
||||||
|
|
||||||
// 添加自己的过滤器并且取名为jwt
|
// 添加自己的过滤器并且取名为jwt
|
||||||
Map<String, Filter> filterMap = new HashMap<String, Filter>(1);
|
Map<String, Filter> filterMap = new HashMap<String, Filter>(1);
|
||||||
//如果cloudServer为空 则说明是单体 需要加载跨域配置【微服务跨域切换】
|
//如果cloudServer为空 则说明是单体 需要加载跨域配置【微服务跨域切换】
|
||||||
|
@ -65,6 +65,7 @@ public class CommonController {
|
|||||||
Result<?> result = new Result<>();
|
Result<?> result = new Result<>();
|
||||||
String savePath = "";
|
String savePath = "";
|
||||||
String bizPath = request.getParameter("biz");
|
String bizPath = request.getParameter("biz");
|
||||||
|
log.info("接收到的bizPath参数: " + bizPath);
|
||||||
|
|
||||||
//LOWCOD-2580 sys/common/upload接口存在任意文件上传漏洞
|
//LOWCOD-2580 sys/common/upload接口存在任意文件上传漏洞
|
||||||
if (oConvertUtils.isNotEmpty(bizPath)) {
|
if (oConvertUtils.isNotEmpty(bizPath)) {
|
||||||
@ -128,6 +129,7 @@ public class CommonController {
|
|||||||
*/
|
*/
|
||||||
private String uploadLocal(MultipartFile mf,String bizPath){
|
private String uploadLocal(MultipartFile mf,String bizPath){
|
||||||
try {
|
try {
|
||||||
|
log.info("uploadLocal方法接收到的bizPath: " + bizPath);
|
||||||
String ctxPath = uploadpath;
|
String ctxPath = uploadpath;
|
||||||
String fileName = null;
|
String fileName = null;
|
||||||
File file = new File(ctxPath + File.separator + bizPath + File.separator );
|
File file = new File(ctxPath + File.separator + bizPath + File.separator );
|
||||||
@ -139,9 +141,22 @@ public class CommonController {
|
|||||||
String orgName = mf.getOriginalFilename();
|
String orgName = mf.getOriginalFilename();
|
||||||
orgName = CommonUtils.getFileName(orgName);
|
orgName = CommonUtils.getFileName(orgName);
|
||||||
if(orgName.indexOf(SymbolConstant.SPOT)!=-1){
|
if(orgName.indexOf(SymbolConstant.SPOT)!=-1){
|
||||||
fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.lastIndexOf("."));
|
// 获取文件扩展名
|
||||||
|
String fileExtension = orgName.substring(orgName.lastIndexOf(".")).toLowerCase();
|
||||||
|
// 根据文件扩展名确定文件类型前缀
|
||||||
|
String fileTypePrefix = "archive";
|
||||||
|
|
||||||
|
// 使用FileTypeEnum获取文件类型
|
||||||
|
FileTypeEnum fileType = FileTypeEnum.getByType(fileExtension);
|
||||||
|
if (fileType != null) {
|
||||||
|
fileTypePrefix = fileType.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 生成新的文件名格式:类型前缀-时间戳.扩展名
|
||||||
|
fileName = fileTypePrefix + "-" + System.currentTimeMillis() + fileExtension;
|
||||||
}else{
|
}else{
|
||||||
fileName = orgName+ "_" + System.currentTimeMillis();
|
// 没有扩展名的情况
|
||||||
|
fileName = "unknown-" + System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
String savePath = file.getPath() + File.separator + fileName;
|
String savePath = file.getPath() + File.separator + fileName;
|
||||||
File savefile = new File(savePath);
|
File savefile = new File(savePath);
|
||||||
@ -155,6 +170,7 @@ public class CommonController {
|
|||||||
if (dbpath.contains(SymbolConstant.DOUBLE_BACKSLASH)) {
|
if (dbpath.contains(SymbolConstant.DOUBLE_BACKSLASH)) {
|
||||||
dbpath = dbpath.replace(SymbolConstant.DOUBLE_BACKSLASH, SymbolConstant.SINGLE_SLASH);
|
dbpath = dbpath.replace(SymbolConstant.DOUBLE_BACKSLASH, SymbolConstant.SINGLE_SLASH);
|
||||||
}
|
}
|
||||||
|
log.info("最终返回的dbpath: " + dbpath);
|
||||||
return dbpath;
|
return dbpath;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
|
@ -0,0 +1,177 @@
|
|||||||
|
package org.jeecg.modules.oroqen.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenCart;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenCartService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 购物车
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "购物车", description = "购物车")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/oroqen/cart")
|
||||||
|
@Slf4j
|
||||||
|
public class OroqenCartController extends JeecgController<OroqenCart, IOroqenCartService> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOroqenCartService oroqenCartService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "购物车-分页列表查询")
|
||||||
|
@Operation(summary = "购物车-分页列表查询", description = "购物车-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<OroqenCart>> queryPageList(OroqenCart oroqenCart,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<OroqenCart> queryWrapper = QueryGenerator.initQueryWrapper(oroqenCart, req.getParameterMap());
|
||||||
|
Page<OroqenCart> page = new Page<OroqenCart>(pageNo, pageSize);
|
||||||
|
IPage<OroqenCart> pageList = oroqenCartService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询购物车
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "购物车-根据用户ID查询")
|
||||||
|
@Operation(summary = "购物车-根据用户ID查询", description = "购物车-根据用户ID查询")
|
||||||
|
@GetMapping(value = "/user/{userId}")
|
||||||
|
public Result<List<OroqenCart>> getByUserId(@PathVariable String userId) {
|
||||||
|
List<OroqenCart> list = oroqenCartService.getByUserId(userId);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加到购物车
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "购物车-添加商品")
|
||||||
|
@Operation(summary = "购物车-添加商品", description = "购物车-添加商品")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> addToCart(@RequestParam String userId,
|
||||||
|
@RequestParam String productId,
|
||||||
|
@RequestParam Integer quantity) {
|
||||||
|
oroqenCartService.addToCart(userId, productId, quantity);
|
||||||
|
return Result.OK("添加到购物车成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新购物车商品数量
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "购物车-更新数量")
|
||||||
|
@Operation(summary = "购物车-更新数量", description = "购物车-更新数量")
|
||||||
|
@PostMapping(value = "/update")
|
||||||
|
public Result<String> updateQuantity(@RequestParam String userId,
|
||||||
|
@RequestParam String productId,
|
||||||
|
@RequestParam Integer quantity) {
|
||||||
|
oroqenCartService.updateQuantity(userId, productId, quantity);
|
||||||
|
return Result.OK("更新数量成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从购物车移除商品
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "购物车-移除商品")
|
||||||
|
@Operation(summary = "购物车-移除商品", description = "购物车-移除商品")
|
||||||
|
@PostMapping(value = "/remove")
|
||||||
|
public Result<String> removeFromCart(@RequestParam String userId,
|
||||||
|
@RequestParam String productId) {
|
||||||
|
oroqenCartService.removeFromCart(userId, productId);
|
||||||
|
return Result.OK("移除商品成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空购物车
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "购物车-清空购物车")
|
||||||
|
@Operation(summary = "购物车-清空购物车", description = "购物车-清空购物车")
|
||||||
|
@PostMapping(value = "/clear/{userId}")
|
||||||
|
public Result<String> clearCart(@PathVariable String userId) {
|
||||||
|
oroqenCartService.clearCart(userId);
|
||||||
|
return Result.OK("清空购物车成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "购物车-编辑")
|
||||||
|
@Operation(summary = "购物车-编辑", description = "购物车-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody OroqenCart oroqenCart) {
|
||||||
|
oroqenCartService.updateById(oroqenCart);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "购物车-通过id删除")
|
||||||
|
@Operation(summary = "购物车-通过id删除", description = "购物车-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
oroqenCartService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "购物车-批量删除")
|
||||||
|
@Operation(summary = "购物车-批量删除", description = "购物车-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.oroqenCartService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "购物车-通过id查询")
|
||||||
|
@Operation(summary = "购物车-通过id查询", description = "购物车-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<OroqenCart> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
OroqenCart oroqenCart = oroqenCartService.getById(id);
|
||||||
|
if (oroqenCart == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(oroqenCart);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, OroqenCart oroqenCart) {
|
||||||
|
return super.exportXls(request, oroqenCart, OroqenCart.class, "购物车");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, OroqenCart.class);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,158 @@
|
|||||||
|
package org.jeecg.modules.oroqen.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenCultureCategory;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenCultureCategoryService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 文化内容分类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "文化内容分类", description = "文化内容分类")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/oroqen/cultureCategory")
|
||||||
|
@Slf4j
|
||||||
|
public class OroqenCultureCategoryController extends JeecgController<OroqenCultureCategory, IOroqenCultureCategoryService> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOroqenCultureCategoryService oroqenCultureCategoryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容分类-分页列表查询")
|
||||||
|
@Operation(summary = "文化内容分类-分页列表查询", description = "文化内容分类-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<OroqenCultureCategory>> queryPageList(OroqenCultureCategory oroqenCultureCategory,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<OroqenCultureCategory> queryWrapper = QueryGenerator.initQueryWrapper(oroqenCultureCategory, req.getParameterMap());
|
||||||
|
Page<OroqenCultureCategory> page = new Page<OroqenCultureCategory>(pageNo, pageSize);
|
||||||
|
IPage<OroqenCultureCategory> pageList = oroqenCultureCategoryService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取树形分类列表
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容分类-获取树形分类列表")
|
||||||
|
@Operation(summary = "文化内容分类-获取树形分类列表", description = "文化内容分类-获取树形分类列表")
|
||||||
|
@GetMapping(value = "/tree")
|
||||||
|
public Result<List<OroqenCultureCategory>> getTreeList() {
|
||||||
|
List<OroqenCultureCategory> list = oroqenCultureCategoryService.getTreeList();
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据父级ID获取子分类
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容分类-根据父级ID获取子分类")
|
||||||
|
@Operation(summary = "文化内容分类-根据父级ID获取子分类", description = "文化内容分类-根据父级ID获取子分类")
|
||||||
|
@GetMapping(value = "/children")
|
||||||
|
public Result<List<OroqenCultureCategory>> getChildrenByParentId(@RequestParam(required = false) String parentId) {
|
||||||
|
List<OroqenCultureCategory> list = oroqenCultureCategoryService.getChildrenByParentId(parentId);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容分类-添加")
|
||||||
|
@Operation(summary = "文化内容分类-添加", description = "文化内容分类-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody OroqenCultureCategory oroqenCultureCategory) {
|
||||||
|
// 检查分类编码是否存在
|
||||||
|
if (oroqenCultureCategoryService.existsByCategoryCode(oroqenCultureCategory.getCategoryCode(), null)) {
|
||||||
|
return Result.error("分类编码已存在");
|
||||||
|
}
|
||||||
|
oroqenCultureCategoryService.save(oroqenCultureCategory);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容分类-编辑")
|
||||||
|
@Operation(summary = "文化内容分类-编辑", description = "文化内容分类-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody OroqenCultureCategory oroqenCultureCategory) {
|
||||||
|
// 检查分类编码是否存在
|
||||||
|
if (oroqenCultureCategoryService.existsByCategoryCode(oroqenCultureCategory.getCategoryCode(), oroqenCultureCategory.getId())) {
|
||||||
|
return Result.error("分类编码已存在");
|
||||||
|
}
|
||||||
|
oroqenCultureCategoryService.updateById(oroqenCultureCategory);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容分类-通过id删除")
|
||||||
|
@Operation(summary = "文化内容分类-通过id删除", description = "文化内容分类-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
oroqenCultureCategoryService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容分类-批量删除")
|
||||||
|
@Operation(summary = "文化内容分类-批量删除", description = "文化内容分类-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.oroqenCultureCategoryService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容分类-通过id查询")
|
||||||
|
@Operation(summary = "文化内容分类-通过id查询", description = "文化内容分类-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<OroqenCultureCategory> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
OroqenCultureCategory oroqenCultureCategory = oroqenCultureCategoryService.getById(id);
|
||||||
|
if (oroqenCultureCategory == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(oroqenCultureCategory);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, OroqenCultureCategory oroqenCultureCategory) {
|
||||||
|
return super.exportXls(request, oroqenCultureCategory, OroqenCultureCategory.class, "文化内容分类");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, OroqenCultureCategory.class);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,174 @@
|
|||||||
|
package org.jeecg.modules.oroqen.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenCultureContent;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenCultureContentService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 文化内容
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "文化内容", description = "文化内容")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/oroqen/cultureContent")
|
||||||
|
@Slf4j
|
||||||
|
public class OroqenCultureContentController extends JeecgController<OroqenCultureContent, IOroqenCultureContentService> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOroqenCultureContentService oroqenCultureContentService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容-分页列表查询")
|
||||||
|
@Operation(summary = "文化内容-分页列表查询", description = "文化内容-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<OroqenCultureContent>> queryPageList(OroqenCultureContent oroqenCultureContent,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<OroqenCultureContent> queryWrapper = QueryGenerator.initQueryWrapper(oroqenCultureContent, req.getParameterMap());
|
||||||
|
Page<OroqenCultureContent> page = new Page<OroqenCultureContent>(pageNo, pageSize);
|
||||||
|
IPage<OroqenCultureContent> pageList = oroqenCultureContentService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分类ID查询文化内容
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容-根据分类ID查询")
|
||||||
|
@Operation(summary = "文化内容-根据分类ID查询", description = "文化内容-根据分类ID查询")
|
||||||
|
@GetMapping(value = "/category/{categoryId}")
|
||||||
|
public Result<List<OroqenCultureContent>> getByCategoryId(@PathVariable String categoryId) {
|
||||||
|
List<OroqenCultureContent> list = oroqenCultureContentService.getByCategoryId(categoryId);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询推荐文化内容
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容-查询推荐内容")
|
||||||
|
@Operation(summary = "文化内容-查询推荐内容", description = "文化内容-查询推荐内容")
|
||||||
|
@GetMapping(value = "/recommended")
|
||||||
|
public Result<List<OroqenCultureContent>> getRecommended() {
|
||||||
|
List<OroqenCultureContent> list = oroqenCultureContentService.getRecommended();
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容-添加")
|
||||||
|
@Operation(summary = "文化内容-添加", description = "文化内容-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody OroqenCultureContent oroqenCultureContent) {
|
||||||
|
oroqenCultureContentService.save(oroqenCultureContent);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容-编辑")
|
||||||
|
@Operation(summary = "文化内容-编辑", description = "文化内容-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody OroqenCultureContent oroqenCultureContent) {
|
||||||
|
oroqenCultureContentService.updateById(oroqenCultureContent);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容-通过id删除")
|
||||||
|
@Operation(summary = "文化内容-通过id删除", description = "文化内容-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
oroqenCultureContentService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容-批量删除")
|
||||||
|
@Operation(summary = "文化内容-批量删除", description = "文化内容-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.oroqenCultureContentService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容-通过id查询")
|
||||||
|
@Operation(summary = "文化内容-通过id查询", description = "文化内容-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<OroqenCultureContent> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
OroqenCultureContent oroqenCultureContent = oroqenCultureContentService.getById(id);
|
||||||
|
if (oroqenCultureContent == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
// 更新浏览次数
|
||||||
|
oroqenCultureContentService.updateViewCount(id);
|
||||||
|
return Result.OK(oroqenCultureContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容-点赞")
|
||||||
|
@Operation(summary = "文化内容-点赞", description = "文化内容-点赞")
|
||||||
|
@PostMapping(value = "/like/{id}")
|
||||||
|
public Result<String> like(@PathVariable String id) {
|
||||||
|
oroqenCultureContentService.updateLikeCount(id, 1);
|
||||||
|
return Result.OK("点赞成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消点赞
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文化内容-取消点赞")
|
||||||
|
@Operation(summary = "文化内容-取消点赞", description = "文化内容-取消点赞")
|
||||||
|
@PostMapping(value = "/unlike/{id}")
|
||||||
|
public Result<String> unlike(@PathVariable String id) {
|
||||||
|
oroqenCultureContentService.updateLikeCount(id, -1);
|
||||||
|
return Result.OK("取消点赞成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, OroqenCultureContent oroqenCultureContent) {
|
||||||
|
return super.exportXls(request, oroqenCultureContent, OroqenCultureContent.class, "文化内容");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, OroqenCultureContent.class);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,127 @@
|
|||||||
|
package org.jeecg.modules.oroqen.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenHeritageInheritor;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenHeritageInheritorService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 非遗传承人
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "非遗传承人", description = "非遗传承人")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/oroqen/heritageInheritor")
|
||||||
|
@Slf4j
|
||||||
|
public class OroqenHeritageInheritorController extends JeecgController<OroqenHeritageInheritor, IOroqenHeritageInheritorService> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOroqenHeritageInheritorService oroqenHeritageInheritorService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗传承人-分页列表查询")
|
||||||
|
@Operation(summary = "非遗传承人-分页列表查询", description = "非遗传承人-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<OroqenHeritageInheritor>> queryPageList(OroqenHeritageInheritor oroqenHeritageInheritor,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<OroqenHeritageInheritor> queryWrapper = QueryGenerator.initQueryWrapper(oroqenHeritageInheritor, req.getParameterMap());
|
||||||
|
Page<OroqenHeritageInheritor> page = new Page<OroqenHeritageInheritor>(pageNo, pageSize);
|
||||||
|
IPage<OroqenHeritageInheritor> pageList = oroqenHeritageInheritorService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗传承人-添加")
|
||||||
|
@Operation(summary = "非遗传承人-添加", description = "非遗传承人-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody OroqenHeritageInheritor oroqenHeritageInheritor) {
|
||||||
|
oroqenHeritageInheritorService.save(oroqenHeritageInheritor);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗传承人-编辑")
|
||||||
|
@Operation(summary = "非遗传承人-编辑", description = "非遗传承人-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody OroqenHeritageInheritor oroqenHeritageInheritor) {
|
||||||
|
oroqenHeritageInheritorService.updateById(oroqenHeritageInheritor);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗传承人-通过id删除")
|
||||||
|
@Operation(summary = "非遗传承人-通过id删除", description = "非遗传承人-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
oroqenHeritageInheritorService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗传承人-批量删除")
|
||||||
|
@Operation(summary = "非遗传承人-批量删除", description = "非遗传承人-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.oroqenHeritageInheritorService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗传承人-通过id查询")
|
||||||
|
@Operation(summary = "非遗传承人-通过id查询", description = "非遗传承人-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<OroqenHeritageInheritor> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
OroqenHeritageInheritor oroqenHeritageInheritor = oroqenHeritageInheritorService.getById(id);
|
||||||
|
if (oroqenHeritageInheritor == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(oroqenHeritageInheritor);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, OroqenHeritageInheritor oroqenHeritageInheritor) {
|
||||||
|
return super.exportXls(request, oroqenHeritageInheritor, OroqenHeritageInheritor.class, "非遗传承人");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, OroqenHeritageInheritor.class);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,290 @@
|
|||||||
|
package org.jeecg.modules.oroqen.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenHeritageProject;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenHeritageProjectService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 非遗项目
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-01-01
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="非遗项目", description="非遗项目")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/oroqen/heritageProject")
|
||||||
|
@Slf4j
|
||||||
|
public class OroqenHeritageProjectController extends JeecgController<OroqenHeritageProject, IOroqenHeritageProjectService> {
|
||||||
|
@Autowired
|
||||||
|
private IOroqenHeritageProjectService oroqenHeritageProjectService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param oroqenHeritageProject
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗项目-分页列表查询")
|
||||||
|
@Operation(summary="非遗项目-分页列表查询", description="非遗项目-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<?> queryPageList(OroqenHeritageProject oroqenHeritageProject,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<OroqenHeritageProject> queryWrapper = QueryGenerator.initQueryWrapper(oroqenHeritageProject, req.getParameterMap());
|
||||||
|
queryWrapper.eq("status", 1); // 只查询启用状态的项目
|
||||||
|
queryWrapper.orderByDesc("is_recommended").orderByAsc("sort_order").orderByDesc("create_time");
|
||||||
|
Page<OroqenHeritageProject> page = new Page<OroqenHeritageProject>(pageNo, pageSize);
|
||||||
|
IPage<OroqenHeritageProject> pageList = oroqenHeritageProjectService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param oroqenHeritageProject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗项目-添加")
|
||||||
|
@Operation(summary="非遗项目-添加", description="非遗项目-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<?> add(@RequestBody OroqenHeritageProject oroqenHeritageProject) {
|
||||||
|
oroqenHeritageProjectService.save(oroqenHeritageProject);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param oroqenHeritageProject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗项目-编辑")
|
||||||
|
@Operation(summary="非遗项目-编辑", description="非遗项目-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<?> edit(@RequestBody OroqenHeritageProject oroqenHeritageProject) {
|
||||||
|
oroqenHeritageProjectService.updateById(oroqenHeritageProject);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗项目-通过id删除")
|
||||||
|
@Operation(summary="非遗项目-通过id删除", description="非遗项目-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
oroqenHeritageProjectService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗项目-批量删除")
|
||||||
|
@Operation(summary="非遗项目-批量删除", description="非遗项目-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.oroqenHeritageProjectService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗项目-通过id查询")
|
||||||
|
@Operation(summary="非遗项目-通过id查询", description="非遗项目-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
OroqenHeritageProject oroqenHeritageProject = oroqenHeritageProjectService.getById(id);
|
||||||
|
if(oroqenHeritageProject==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(oroqenHeritageProject);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取推荐项目列表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗项目-获取推荐项目列表")
|
||||||
|
@Operation(summary="非遗项目-获取推荐项目列表", description="非遗项目-获取推荐项目列表")
|
||||||
|
@GetMapping(value = "/recommended")
|
||||||
|
public Result<?> getRecommendedProjects() {
|
||||||
|
QueryWrapper<OroqenHeritageProject> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("status", 1);
|
||||||
|
queryWrapper.eq("is_recommended", 1);
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
List<OroqenHeritageProject> list = oroqenHeritageProjectService.list(queryWrapper);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按级别获取项目列表
|
||||||
|
*
|
||||||
|
* @param level
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗项目-按级别获取项目列表")
|
||||||
|
@Operation(summary="非遗项目-按级别获取项目列表", description="非遗项目-按级别获取项目列表")
|
||||||
|
@GetMapping(value = "/byLevel")
|
||||||
|
public Result<?> getProjectsByLevel(@RequestParam(name="level",required=true) String level) {
|
||||||
|
QueryWrapper<OroqenHeritageProject> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("status", 1);
|
||||||
|
queryWrapper.eq("heritage_level", level);
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
List<OroqenHeritageProject> list = oroqenHeritageProjectService.list(queryWrapper);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按类别获取项目列表
|
||||||
|
*
|
||||||
|
* @param category
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗项目-按类别获取项目列表")
|
||||||
|
@Operation(summary="非遗项目-按类别获取项目列表", description="非遗项目-按类别获取项目列表")
|
||||||
|
@GetMapping(value = "/byCategory")
|
||||||
|
public Result<?> getProjectsByCategory(@RequestParam(name="category",required=true) String category) {
|
||||||
|
QueryWrapper<OroqenHeritageProject> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("status", 1);
|
||||||
|
queryWrapper.eq("category", category);
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
List<OroqenHeritageProject> list = oroqenHeritageProjectService.list(queryWrapper);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有级别统计
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗项目-获取所有级别统计")
|
||||||
|
@Operation(summary="非遗项目-获取所有级别统计", description="非遗项目-获取所有级别统计")
|
||||||
|
@GetMapping(value = "/levelStats")
|
||||||
|
public Result<List<Map<String, Object>>> getLevelStats() {
|
||||||
|
try {
|
||||||
|
// 手动构建统计数据
|
||||||
|
List<Map<String, Object>> stats = new ArrayList<>();
|
||||||
|
|
||||||
|
// 查询国家级项目数量
|
||||||
|
QueryWrapper<OroqenHeritageProject> nationalQuery = new QueryWrapper<>();
|
||||||
|
nationalQuery.eq("status", 1).eq("heritage_level", "国家级");
|
||||||
|
long nationalCount = oroqenHeritageProjectService.count(nationalQuery);
|
||||||
|
|
||||||
|
Map<String, Object> nationalStat = new HashMap<>();
|
||||||
|
nationalStat.put("heritage_level", "国家级");
|
||||||
|
nationalStat.put("heritageLevel", "国家级");
|
||||||
|
nationalStat.put("count", nationalCount);
|
||||||
|
stats.add(nationalStat);
|
||||||
|
|
||||||
|
// 查询省级项目数量
|
||||||
|
QueryWrapper<OroqenHeritageProject> provincialQuery = new QueryWrapper<>();
|
||||||
|
provincialQuery.eq("status", 1).eq("heritage_level", "省级");
|
||||||
|
long provincialCount = oroqenHeritageProjectService.count(provincialQuery);
|
||||||
|
|
||||||
|
Map<String, Object> provincialStat = new HashMap<>();
|
||||||
|
provincialStat.put("heritage_level", "省级");
|
||||||
|
provincialStat.put("heritageLevel", "省级");
|
||||||
|
provincialStat.put("count", provincialCount);
|
||||||
|
stats.add(provincialStat);
|
||||||
|
|
||||||
|
// 查询市级项目数量
|
||||||
|
QueryWrapper<OroqenHeritageProject> municipalQuery = new QueryWrapper<>();
|
||||||
|
municipalQuery.eq("status", 1).eq("heritage_level", "市级");
|
||||||
|
long municipalCount = oroqenHeritageProjectService.count(municipalQuery);
|
||||||
|
|
||||||
|
Map<String, Object> municipalStat = new HashMap<>();
|
||||||
|
municipalStat.put("heritage_level", "市级");
|
||||||
|
municipalStat.put("heritageLevel", "市级");
|
||||||
|
municipalStat.put("count", municipalCount);
|
||||||
|
stats.add(municipalStat);
|
||||||
|
|
||||||
|
return Result.OK(stats);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取级别统计失败", e);
|
||||||
|
return Result.error("获取级别统计失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param oroqenHeritageProject
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, OroqenHeritageProject oroqenHeritageProject) {
|
||||||
|
return super.exportXls(request, oroqenHeritageProject, OroqenHeritageProject.class, "非遗项目");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, OroqenHeritageProject.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推荐/取消推荐
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param isRecommended
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "非遗项目-推荐/取消推荐")
|
||||||
|
@Operation(summary="非遗项目-推荐/取消推荐", description="非遗项目-推荐/取消推荐")
|
||||||
|
@PutMapping(value = "/recommend")
|
||||||
|
public Result<?> recommend(@RequestParam(name="id",required=true) String id,
|
||||||
|
@RequestParam(name="isRecommended",required=true) Integer isRecommended) {
|
||||||
|
try {
|
||||||
|
OroqenHeritageProject project = oroqenHeritageProjectService.getById(id);
|
||||||
|
if (project == null) {
|
||||||
|
return Result.error("项目不存在");
|
||||||
|
}
|
||||||
|
project.setIsRecommended(isRecommended);
|
||||||
|
oroqenHeritageProjectService.updateById(project);
|
||||||
|
String action = isRecommended == 1 ? "推荐" : "取消推荐";
|
||||||
|
return Result.OK(action + "成功!");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("推荐操作失败", e);
|
||||||
|
return Result.error("推荐操作失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,185 @@
|
|||||||
|
package org.jeecg.modules.oroqen.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenOrder;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenOrderService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 订单
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "订单", description = "订单")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/oroqen/order")
|
||||||
|
@Slf4j
|
||||||
|
public class OroqenOrderController extends JeecgController<OroqenOrder, IOroqenOrderService> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOroqenOrderService oroqenOrderService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单-分页列表查询")
|
||||||
|
@Operation(summary = "订单-分页列表查询", description = "订单-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<OroqenOrder>> queryPageList(OroqenOrder oroqenOrder,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<OroqenOrder> queryWrapper = QueryGenerator.initQueryWrapper(oroqenOrder, req.getParameterMap());
|
||||||
|
Page<OroqenOrder> page = new Page<OroqenOrder>(pageNo, pageSize);
|
||||||
|
IPage<OroqenOrder> pageList = oroqenOrderService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询订单
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单-根据用户ID查询")
|
||||||
|
@Operation(summary = "订单-根据用户ID查询", description = "订单-根据用户ID查询")
|
||||||
|
@GetMapping(value = "/user/{userId}")
|
||||||
|
public Result<List<OroqenOrder>> getByUserId(@PathVariable String userId) {
|
||||||
|
List<OroqenOrder> list = oroqenOrderService.getByUserId(userId);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单状态查询订单
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单-根据状态查询")
|
||||||
|
@Operation(summary = "订单-根据状态查询", description = "订单-根据状态查询")
|
||||||
|
@GetMapping(value = "/status/{status}")
|
||||||
|
public Result<List<OroqenOrder>> getByStatus(@PathVariable Integer status) {
|
||||||
|
List<OroqenOrder> list = oroqenOrderService.getByStatus(status);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建订单
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单-创建订单")
|
||||||
|
@Operation(summary = "订单-创建订单", description = "订单-创建订单")
|
||||||
|
@PostMapping(value = "/create")
|
||||||
|
public Result<String> createOrder(@RequestBody OroqenOrder oroqenOrder) {
|
||||||
|
String orderId = oroqenOrderService.createOrder(oroqenOrder);
|
||||||
|
return Result.OK(orderId, "订单创建成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单-编辑")
|
||||||
|
@Operation(summary = "订单-编辑", description = "订单-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody OroqenOrder oroqenOrder) {
|
||||||
|
oroqenOrderService.updateById(oroqenOrder);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消订单
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单-取消订单")
|
||||||
|
@Operation(summary = "订单-取消订单", description = "订单-取消订单")
|
||||||
|
@PostMapping(value = "/cancel/{id}")
|
||||||
|
public Result<String> cancelOrder(@PathVariable String id) {
|
||||||
|
oroqenOrderService.cancelOrder(id);
|
||||||
|
return Result.OK("订单取消成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发货
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单-发货")
|
||||||
|
@Operation(summary = "订单-发货", description = "订单-发货")
|
||||||
|
@PostMapping(value = "/ship")
|
||||||
|
public Result<String> shipOrder(@RequestParam String orderId,
|
||||||
|
@RequestParam String shippingCompany,
|
||||||
|
@RequestParam String trackingNumber) {
|
||||||
|
oroqenOrderService.shipOrder(orderId, shippingCompany, trackingNumber);
|
||||||
|
return Result.OK("发货成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认收货
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单-确认收货")
|
||||||
|
@Operation(summary = "订单-确认收货", description = "订单-确认收货")
|
||||||
|
@PostMapping(value = "/confirm/{id}")
|
||||||
|
public Result<String> confirmReceived(@PathVariable String id) {
|
||||||
|
oroqenOrderService.confirmReceived(id);
|
||||||
|
return Result.OK("确认收货成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单-通过id删除")
|
||||||
|
@Operation(summary = "订单-通过id删除", description = "订单-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
oroqenOrderService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单-批量删除")
|
||||||
|
@Operation(summary = "订单-批量删除", description = "订单-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.oroqenOrderService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单-通过id查询")
|
||||||
|
@Operation(summary = "订单-通过id查询", description = "订单-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<OroqenOrder> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
OroqenOrder oroqenOrder = oroqenOrderService.getById(id);
|
||||||
|
if (oroqenOrder == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(oroqenOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, OroqenOrder oroqenOrder) {
|
||||||
|
return super.exportXls(request, oroqenOrder, OroqenOrder.class, "订单");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, OroqenOrder.class);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,139 @@
|
|||||||
|
package org.jeecg.modules.oroqen.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenOrderItem;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenOrderItemService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 订单项
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "订单项", description = "订单项")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/oroqen/orderItem")
|
||||||
|
@Slf4j
|
||||||
|
public class OroqenOrderItemController extends JeecgController<OroqenOrderItem, IOroqenOrderItemService> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOroqenOrderItemService oroqenOrderItemService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单项-分页列表查询")
|
||||||
|
@Operation(summary = "订单项-分页列表查询", description = "订单项-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<OroqenOrderItem>> queryPageList(OroqenOrderItem oroqenOrderItem,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<OroqenOrderItem> queryWrapper = QueryGenerator.initQueryWrapper(oroqenOrderItem, req.getParameterMap());
|
||||||
|
Page<OroqenOrderItem> page = new Page<OroqenOrderItem>(pageNo, pageSize);
|
||||||
|
IPage<OroqenOrderItem> pageList = oroqenOrderItemService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单ID查询订单项
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单项-根据订单ID查询")
|
||||||
|
@Operation(summary = "订单项-根据订单ID查询", description = "订单项-根据订单ID查询")
|
||||||
|
@GetMapping(value = "/order/{orderId}")
|
||||||
|
public Result<List<OroqenOrderItem>> getByOrderId(@PathVariable String orderId) {
|
||||||
|
List<OroqenOrderItem> list = oroqenOrderItemService.getByOrderId(orderId);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单项-添加")
|
||||||
|
@Operation(summary = "订单项-添加", description = "订单项-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody OroqenOrderItem oroqenOrderItem) {
|
||||||
|
oroqenOrderItemService.save(oroqenOrderItem);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单项-编辑")
|
||||||
|
@Operation(summary = "订单项-编辑", description = "订单项-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody OroqenOrderItem oroqenOrderItem) {
|
||||||
|
oroqenOrderItemService.updateById(oroqenOrderItem);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单项-通过id删除")
|
||||||
|
@Operation(summary = "订单项-通过id删除", description = "订单项-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
oroqenOrderItemService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单项-批量删除")
|
||||||
|
@Operation(summary = "订单项-批量删除", description = "订单项-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.oroqenOrderItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "订单项-通过id查询")
|
||||||
|
@Operation(summary = "订单项-通过id查询", description = "订单项-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<OroqenOrderItem> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
OroqenOrderItem oroqenOrderItem = oroqenOrderItemService.getById(id);
|
||||||
|
if (oroqenOrderItem == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(oroqenOrderItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, OroqenOrderItem oroqenOrderItem) {
|
||||||
|
return super.exportXls(request, oroqenOrderItem, OroqenOrderItem.class, "订单项");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, OroqenOrderItem.class);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,177 @@
|
|||||||
|
package org.jeecg.modules.oroqen.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenProductCategory;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenProductCategoryService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 产品分类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "产品分类", description = "产品分类")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/oroqen/productCategory")
|
||||||
|
@Slf4j
|
||||||
|
public class OroqenProductCategoryController extends JeecgController<OroqenProductCategory, IOroqenProductCategoryService> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOroqenProductCategoryService oroqenProductCategoryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param oroqenProductCategory
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品分类-分页列表查询")
|
||||||
|
@Operation(summary = "产品分类-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<OroqenProductCategory>> queryPageList(OroqenProductCategory oroqenProductCategory,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<OroqenProductCategory> queryWrapper = QueryGenerator.initQueryWrapper(oroqenProductCategory, req.getParameterMap());
|
||||||
|
Page<OroqenProductCategory> page = new Page<OroqenProductCategory>(pageNo, pageSize);
|
||||||
|
IPage<OroqenProductCategory> pageList = oroqenProductCategoryService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取树形结构的分类列表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品分类-获取树形结构")
|
||||||
|
@Operation(summary = "产品分类-获取树形结构")
|
||||||
|
@GetMapping(value = "/tree")
|
||||||
|
public Result<List<OroqenProductCategory>> queryTree() {
|
||||||
|
List<OroqenProductCategory> list = oroqenProductCategoryService.getCategoryTree();
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param oroqenProductCategory
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品分类-添加")
|
||||||
|
@Operation(summary = "产品分类-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody OroqenProductCategory oroqenProductCategory) {
|
||||||
|
// 检查分类编码是否存在
|
||||||
|
if (oroqenProductCategoryService.checkCategoryCodeExists(oroqenProductCategory.getCategoryCode(), null)) {
|
||||||
|
return Result.error("分类编码已存在");
|
||||||
|
}
|
||||||
|
oroqenProductCategoryService.save(oroqenProductCategory);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param oroqenProductCategory
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品分类-编辑")
|
||||||
|
@Operation(summary = "产品分类-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody OroqenProductCategory oroqenProductCategory) {
|
||||||
|
// 检查分类编码是否存在
|
||||||
|
if (oroqenProductCategoryService.checkCategoryCodeExists(oroqenProductCategory.getCategoryCode(), oroqenProductCategory.getId())) {
|
||||||
|
return Result.error("分类编码已存在");
|
||||||
|
}
|
||||||
|
oroqenProductCategoryService.updateById(oroqenProductCategory);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品分类-通过id删除")
|
||||||
|
@Operation(summary = "产品分类-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
oroqenProductCategoryService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品分类-批量删除")
|
||||||
|
@Operation(summary = "产品分类-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.oroqenProductCategoryService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品分类-通过id查询")
|
||||||
|
@Operation(summary = "产品分类-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<OroqenProductCategory> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
OroqenProductCategory oroqenProductCategory = oroqenProductCategoryService.getById(id);
|
||||||
|
if (oroqenProductCategory == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(oroqenProductCategory);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param oroqenProductCategory
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, OroqenProductCategory oroqenProductCategory) {
|
||||||
|
return super.exportXls(request, oroqenProductCategory, OroqenProductCategory.class, "产品分类");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, OroqenProductCategory.class);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,222 @@
|
|||||||
|
package org.jeecg.modules.oroqen.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenProduct;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenProductService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 产品
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "产品", description = "产品")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/oroqen/product")
|
||||||
|
@Slf4j
|
||||||
|
public class OroqenProductController extends JeecgController<OroqenProduct, IOroqenProductService> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOroqenProductService oroqenProductService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param oroqenProduct
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品-分页列表查询")
|
||||||
|
@Operation(summary = "产品-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<OroqenProduct>> queryPageList(OroqenProduct oroqenProduct,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<OroqenProduct> queryWrapper = QueryGenerator.initQueryWrapper(oroqenProduct, req.getParameterMap());
|
||||||
|
Page<OroqenProduct> page = new Page<OroqenProduct>(pageNo, pageSize);
|
||||||
|
IPage<OroqenProduct> pageList = oroqenProductService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分类ID查询产品列表
|
||||||
|
*
|
||||||
|
* @param categoryId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品-根据分类ID查询")
|
||||||
|
@Operation(summary = "产品-根据分类ID查询")
|
||||||
|
@GetMapping(value = "/listByCategory")
|
||||||
|
public Result<List<OroqenProduct>> queryByCategory(@RequestParam(name = "categoryId", required = true) String categoryId) {
|
||||||
|
List<OroqenProduct> list = oroqenProductService.getProductsByCategoryId(categoryId);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询推荐产品
|
||||||
|
*
|
||||||
|
* @param limit
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品-查询推荐产品")
|
||||||
|
@Operation(summary = "产品-查询推荐产品")
|
||||||
|
@GetMapping(value = "/featured")
|
||||||
|
public Result<List<OroqenProduct>> queryFeatured(@RequestParam(name = "limit", defaultValue = "10") Integer limit) {
|
||||||
|
List<OroqenProduct> list = oroqenProductService.getFeaturedProducts(limit);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询热销产品
|
||||||
|
*
|
||||||
|
* @param limit
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品-查询热销产品")
|
||||||
|
@Operation(summary = "产品-查询热销产品")
|
||||||
|
@GetMapping(value = "/hot")
|
||||||
|
public Result<List<OroqenProduct>> queryHot(@RequestParam(name = "limit", defaultValue = "10") Integer limit) {
|
||||||
|
List<OroqenProduct> list = oroqenProductService.getHotProducts(limit);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param oroqenProduct
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品-添加")
|
||||||
|
@Operation(summary = "产品-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody OroqenProduct oroqenProduct) {
|
||||||
|
// 检查产品编码是否存在
|
||||||
|
if (oroqenProductService.checkProductCodeExists(oroqenProduct.getProductCode(), null)) {
|
||||||
|
return Result.error("产品编码已存在");
|
||||||
|
}
|
||||||
|
oroqenProductService.save(oroqenProduct);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param oroqenProduct
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品-编辑")
|
||||||
|
@Operation(summary = "产品-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody OroqenProduct oroqenProduct) {
|
||||||
|
// 检查产品编码是否存在
|
||||||
|
if (oroqenProductService.checkProductCodeExists(oroqenProduct.getProductCode(), oroqenProduct.getId())) {
|
||||||
|
return Result.error("产品编码已存在");
|
||||||
|
}
|
||||||
|
oroqenProductService.updateById(oroqenProduct);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品-通过id删除")
|
||||||
|
@Operation(summary = "产品-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
oroqenProductService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品-批量删除")
|
||||||
|
@Operation(summary = "产品-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.oroqenProductService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品-通过id查询")
|
||||||
|
@Operation(summary = "产品-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<OroqenProduct> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
OroqenProduct oroqenProduct = oroqenProductService.getById(id);
|
||||||
|
if (oroqenProduct == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(oroqenProduct);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查库存
|
||||||
|
*
|
||||||
|
* @param productId
|
||||||
|
* @param quantity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "产品-检查库存")
|
||||||
|
@Operation(summary = "产品-检查库存")
|
||||||
|
@GetMapping(value = "/checkStock")
|
||||||
|
public Result<Boolean> checkStock(@RequestParam(name = "productId", required = true) String productId,
|
||||||
|
@RequestParam(name = "quantity", required = true) Integer quantity) {
|
||||||
|
boolean result = oroqenProductService.checkStock(productId, quantity);
|
||||||
|
return Result.OK(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param oroqenProduct
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, OroqenProduct oroqenProduct) {
|
||||||
|
return super.exportXls(request, oroqenProduct, OroqenProduct.class, "产品");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, OroqenProduct.class);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,179 @@
|
|||||||
|
package org.jeecg.modules.oroqen.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenUserFavorite;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenUserFavoriteService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 用户收藏
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "用户收藏", description = "用户收藏")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/oroqen/userFavorite")
|
||||||
|
@Slf4j
|
||||||
|
public class OroqenUserFavoriteController extends JeecgController<OroqenUserFavorite, IOroqenUserFavoriteService> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOroqenUserFavoriteService oroqenUserFavoriteService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户收藏-分页列表查询")
|
||||||
|
@Operation(summary = "用户收藏-分页列表查询", description = "用户收藏-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<OroqenUserFavorite>> queryPageList(OroqenUserFavorite oroqenUserFavorite,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<OroqenUserFavorite> queryWrapper = QueryGenerator.initQueryWrapper(oroqenUserFavorite, req.getParameterMap());
|
||||||
|
Page<OroqenUserFavorite> page = new Page<OroqenUserFavorite>(pageNo, pageSize);
|
||||||
|
IPage<OroqenUserFavorite> pageList = oroqenUserFavoriteService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询收藏
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户收藏-根据用户ID查询")
|
||||||
|
@Operation(summary = "用户收藏-根据用户ID查询", description = "用户收藏-根据用户ID查询")
|
||||||
|
@GetMapping(value = "/user/{userId}")
|
||||||
|
public Result<List<OroqenUserFavorite>> getByUserId(@PathVariable String userId) {
|
||||||
|
List<OroqenUserFavorite> list = oroqenUserFavoriteService.getByUserId(userId);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID和收藏类型查询收藏
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户收藏-根据用户ID和类型查询")
|
||||||
|
@Operation(summary = "用户收藏-根据用户ID和类型查询", description = "用户收藏-根据用户ID和类型查询")
|
||||||
|
@GetMapping(value = "/user/{userId}/type/{favoriteType}")
|
||||||
|
public Result<List<OroqenUserFavorite>> getByUserIdAndType(@PathVariable String userId,
|
||||||
|
@PathVariable Integer favoriteType) {
|
||||||
|
List<OroqenUserFavorite> list = oroqenUserFavoriteService.getByUserIdAndType(userId, favoriteType);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加收藏
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户收藏-添加收藏")
|
||||||
|
@Operation(summary = "用户收藏-添加收藏", description = "用户收藏-添加收藏")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> addFavorite(@RequestParam String userId,
|
||||||
|
@RequestParam Integer favoriteType,
|
||||||
|
@RequestParam String targetId) {
|
||||||
|
oroqenUserFavoriteService.addFavorite(userId, favoriteType, targetId);
|
||||||
|
return Result.OK("添加收藏成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消收藏
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户收藏-取消收藏")
|
||||||
|
@Operation(summary = "用户收藏-取消收藏", description = "用户收藏-取消收藏")
|
||||||
|
@PostMapping(value = "/remove")
|
||||||
|
public Result<String> removeFavorite(@RequestParam String userId,
|
||||||
|
@RequestParam Integer favoriteType,
|
||||||
|
@RequestParam String targetId) {
|
||||||
|
oroqenUserFavoriteService.removeFavorite(userId, favoriteType, targetId);
|
||||||
|
return Result.OK("取消收藏成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查是否已收藏
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户收藏-检查收藏状态")
|
||||||
|
@Operation(summary = "用户收藏-检查收藏状态", description = "用户收藏-检查收藏状态")
|
||||||
|
@GetMapping(value = "/check")
|
||||||
|
public Result<Boolean> isFavorited(@RequestParam String userId,
|
||||||
|
@RequestParam Integer favoriteType,
|
||||||
|
@RequestParam String targetId) {
|
||||||
|
boolean isFavorited = oroqenUserFavoriteService.isFavorited(userId, favoriteType, targetId);
|
||||||
|
return Result.OK(isFavorited);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户收藏-编辑")
|
||||||
|
@Operation(summary = "用户收藏-编辑", description = "用户收藏-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody OroqenUserFavorite oroqenUserFavorite) {
|
||||||
|
oroqenUserFavoriteService.updateById(oroqenUserFavorite);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户收藏-通过id删除")
|
||||||
|
@Operation(summary = "用户收藏-通过id删除", description = "用户收藏-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
oroqenUserFavoriteService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户收藏-批量删除")
|
||||||
|
@Operation(summary = "用户收藏-批量删除", description = "用户收藏-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.oroqenUserFavoriteService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户收藏-通过id查询")
|
||||||
|
@Operation(summary = "用户收藏-通过id查询", description = "用户收藏-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<OroqenUserFavorite> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
OroqenUserFavorite oroqenUserFavorite = oroqenUserFavoriteService.getById(id);
|
||||||
|
if (oroqenUserFavorite == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(oroqenUserFavorite);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, OroqenUserFavorite oroqenUserFavorite) {
|
||||||
|
return super.exportXls(request, oroqenUserFavorite, OroqenUserFavorite.class, "用户收藏");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, OroqenUserFavorite.class);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package org.jeecg.modules.oroqen.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 购物车
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("oroqen_cart")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "购物车")
|
||||||
|
public class OroqenCart implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**用户ID*/
|
||||||
|
@Excel(name = "用户ID", width = 15)
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**商品ID*/
|
||||||
|
@Excel(name = "商品ID", width = 15)
|
||||||
|
@Schema(description = "商品ID")
|
||||||
|
private String productId;
|
||||||
|
|
||||||
|
/**数量*/
|
||||||
|
@Excel(name = "数量", width = 15)
|
||||||
|
@Schema(description = "数量")
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,105 @@
|
|||||||
|
package org.jeecg.modules.oroqen.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 文化内容分类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("oroqen_culture_category")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "文化内容分类")
|
||||||
|
public class OroqenCultureCategory implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**分类名称*/
|
||||||
|
@Excel(name = "分类名称", width = 15)
|
||||||
|
@Schema(description = "分类名称")
|
||||||
|
@TableField("category_name")
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
/**分类编码*/
|
||||||
|
@Excel(name = "分类编码", width = 15)
|
||||||
|
@Schema(description = "分类编码")
|
||||||
|
@TableField("category_code")
|
||||||
|
private String categoryCode;
|
||||||
|
|
||||||
|
/**父级ID*/
|
||||||
|
@Excel(name = "父级ID", width = 15)
|
||||||
|
@Schema(description = "父级ID")
|
||||||
|
@TableField("parent_id")
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
/**排序*/
|
||||||
|
@Excel(name = "排序", width = 15)
|
||||||
|
@Schema(description = "排序")
|
||||||
|
@TableField("sort_order")
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
/**描述*/
|
||||||
|
@Excel(name = "描述", width = 15)
|
||||||
|
@Schema(description = "描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**图标*/
|
||||||
|
@Excel(name = "图标", width = 15)
|
||||||
|
@Schema(description = "图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
/**状态(0-禁用,1-启用)*/
|
||||||
|
@Excel(name = "状态(0-禁用,1-启用)", width = 15)
|
||||||
|
@Schema(description = "状态(0-禁用,1-启用)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
@TableField("create_by")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
@TableField("create_time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
@TableField("update_by")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
@TableField("update_time")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**子节点列表*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Schema(description = "子节点列表")
|
||||||
|
private List<OroqenCultureCategory> children;
|
||||||
|
}
|
@ -0,0 +1,154 @@
|
|||||||
|
package org.jeecg.modules.oroqen.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 文化内容
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("oroqen_culture_content")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "文化内容")
|
||||||
|
public class OroqenCultureContent implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**标题*/
|
||||||
|
@Excel(name = "标题", width = 15)
|
||||||
|
@Schema(description = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**分类ID*/
|
||||||
|
@Excel(name = "分类ID", width = 15)
|
||||||
|
@Schema(description = "分类ID")
|
||||||
|
@TableField("category_id")
|
||||||
|
private String categoryId;
|
||||||
|
|
||||||
|
/**内容*/
|
||||||
|
@Excel(name = "内容", width = 15)
|
||||||
|
@Schema(description = "内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**摘要*/
|
||||||
|
@Excel(name = "摘要", width = 15)
|
||||||
|
@Schema(description = "摘要")
|
||||||
|
private String summary;
|
||||||
|
|
||||||
|
/**封面图片*/
|
||||||
|
@Excel(name = "封面图片", width = 15)
|
||||||
|
@Schema(description = "封面图片")
|
||||||
|
@TableField("cover_image")
|
||||||
|
private String coverImage;
|
||||||
|
|
||||||
|
/**图片集*/
|
||||||
|
@Excel(name = "图片集", width = 15)
|
||||||
|
@Schema(description = "图片集")
|
||||||
|
private String images;
|
||||||
|
|
||||||
|
/**视频链接*/
|
||||||
|
@Excel(name = "视频链接", width = 15)
|
||||||
|
@Schema(description = "视频链接")
|
||||||
|
@TableField("video_url")
|
||||||
|
private String videoUrl;
|
||||||
|
|
||||||
|
/**音频链接*/
|
||||||
|
@Excel(name = "音频链接", width = 15)
|
||||||
|
@Schema(description = "音频链接")
|
||||||
|
@TableField("audio_url")
|
||||||
|
private String audioUrl;
|
||||||
|
|
||||||
|
/**标签*/
|
||||||
|
@Excel(name = "标签", width = 15)
|
||||||
|
@Schema(description = "标签")
|
||||||
|
private String tags;
|
||||||
|
|
||||||
|
/**作者*/
|
||||||
|
@Excel(name = "作者", width = 15)
|
||||||
|
@Schema(description = "作者")
|
||||||
|
private String author;
|
||||||
|
|
||||||
|
/**来源*/
|
||||||
|
@Excel(name = "来源", width = 15)
|
||||||
|
@Schema(description = "来源")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
/**是否推荐(0-否,1-是)*/
|
||||||
|
@Excel(name = "是否推荐(0-否,1-是)", width = 15)
|
||||||
|
@Schema(description = "是否推荐(0-否,1-是)")
|
||||||
|
@TableField("is_recommended")
|
||||||
|
private Integer isRecommended;
|
||||||
|
|
||||||
|
/**浏览次数*/
|
||||||
|
@Excel(name = "浏览次数", width = 15)
|
||||||
|
@Schema(description = "浏览次数")
|
||||||
|
@TableField("view_count")
|
||||||
|
private Integer viewCount;
|
||||||
|
|
||||||
|
/**点赞次数*/
|
||||||
|
@Excel(name = "点赞次数", width = 15)
|
||||||
|
@Schema(description = "点赞次数")
|
||||||
|
@TableField("like_count")
|
||||||
|
private Integer likeCount;
|
||||||
|
|
||||||
|
/**收藏次数*/
|
||||||
|
@Excel(name = "收藏次数", width = 15)
|
||||||
|
@Schema(description = "收藏次数")
|
||||||
|
@TableField("favorite_count")
|
||||||
|
private Integer favoriteCount;
|
||||||
|
|
||||||
|
/**排序*/
|
||||||
|
@Excel(name = "排序", width = 15)
|
||||||
|
@Schema(description = "排序")
|
||||||
|
@TableField("sort_order")
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
/**状态(0-禁用,1-启用)*/
|
||||||
|
@Excel(name = "状态(0-禁用,1-启用)", width = 15)
|
||||||
|
@Schema(description = "状态(0-禁用,1-启用)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
@TableField("create_by")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
@TableField("create_time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
@TableField("update_by")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
@TableField("update_time")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,120 @@
|
|||||||
|
package org.jeecg.modules.oroqen.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 非遗传承人
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("oroqen_heritage_inheritor")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "非遗传承人")
|
||||||
|
public class OroqenHeritageInheritor implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**姓名*/
|
||||||
|
@Excel(name = "姓名", width = 15)
|
||||||
|
@Schema(description = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**性别(0-女,1-男)*/
|
||||||
|
@Excel(name = "性别(0-女,1-男)", width = 15)
|
||||||
|
@Schema(description = "性别(0-女,1-男)")
|
||||||
|
private Integer gender;
|
||||||
|
|
||||||
|
/**出生年份*/
|
||||||
|
@Excel(name = "出生年份", width = 15)
|
||||||
|
@Schema(description = "出生年份")
|
||||||
|
private Integer birthYear;
|
||||||
|
|
||||||
|
/**籍贯*/
|
||||||
|
@Excel(name = "籍贯", width = 15)
|
||||||
|
@Schema(description = "籍贯")
|
||||||
|
private String hometown;
|
||||||
|
|
||||||
|
/**传承技艺*/
|
||||||
|
@Excel(name = "传承技艺", width = 15)
|
||||||
|
@Schema(description = "传承技艺")
|
||||||
|
private String heritageSkills;
|
||||||
|
|
||||||
|
/**传承级别*/
|
||||||
|
@Excel(name = "传承级别", width = 15)
|
||||||
|
@Schema(description = "传承级别")
|
||||||
|
private String heritageLevel;
|
||||||
|
|
||||||
|
/**头像*/
|
||||||
|
@Excel(name = "头像", width = 15)
|
||||||
|
@Schema(description = "头像")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
/**个人简介*/
|
||||||
|
@Excel(name = "个人简介", width = 15)
|
||||||
|
@Schema(description = "个人简介")
|
||||||
|
private String biography;
|
||||||
|
|
||||||
|
/**主要成就*/
|
||||||
|
@Excel(name = "主要成就", width = 15)
|
||||||
|
@Schema(description = "主要成就")
|
||||||
|
private String achievements;
|
||||||
|
|
||||||
|
/**代表作品*/
|
||||||
|
@Excel(name = "代表作品", width = 15)
|
||||||
|
@Schema(description = "代表作品")
|
||||||
|
private String representativeWorks;
|
||||||
|
|
||||||
|
/**作品图片*/
|
||||||
|
@Excel(name = "作品图片", width = 15)
|
||||||
|
@Schema(description = "作品图片")
|
||||||
|
private String workImages;
|
||||||
|
|
||||||
|
/**联系方式*/
|
||||||
|
@Excel(name = "联系方式", width = 15)
|
||||||
|
@Schema(description = "联系方式")
|
||||||
|
private String contactInfo;
|
||||||
|
|
||||||
|
/**状态(0-禁用,1-启用)*/
|
||||||
|
@Excel(name = "状态(0-禁用,1-启用)", width = 15)
|
||||||
|
@Schema(description = "状态(0-禁用,1-启用)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,179 @@
|
|||||||
|
package org.jeecg.modules.oroqen.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 非遗项目
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-01-01
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("oroqen_heritage_project")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "非遗项目")
|
||||||
|
public class OroqenHeritageProject implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**更新时间*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**所属部门*/
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String sysOrgCode;
|
||||||
|
|
||||||
|
/**项目名称*/
|
||||||
|
@Excel(name = "项目名称", width = 15)
|
||||||
|
@Schema(description = "项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**项目编码*/
|
||||||
|
@Excel(name = "项目编码", width = 15)
|
||||||
|
@Schema(description = "项目编码")
|
||||||
|
private String projectCode;
|
||||||
|
|
||||||
|
/**项目类别*/
|
||||||
|
@Excel(name = "项目类别", width = 15)
|
||||||
|
@Schema(description = "项目类别")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
/**非遗级别*/
|
||||||
|
@Excel(name = "非遗级别", width = 15)
|
||||||
|
@Schema(description = "非遗级别")
|
||||||
|
private String heritageLevel;
|
||||||
|
|
||||||
|
/**批准年份*/
|
||||||
|
@Excel(name = "批准年份", width = 15)
|
||||||
|
@Schema(description = "批准年份")
|
||||||
|
private Integer approvalYear;
|
||||||
|
|
||||||
|
/**批准文号*/
|
||||||
|
@Excel(name = "批准文号", width = 15)
|
||||||
|
@Schema(description = "批准文号")
|
||||||
|
private String approvalNumber;
|
||||||
|
|
||||||
|
/**项目描述*/
|
||||||
|
@Excel(name = "项目描述", width = 15)
|
||||||
|
@Schema(description = "项目描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**详细描述*/
|
||||||
|
@Excel(name = "详细描述", width = 15)
|
||||||
|
@Schema(description = "详细描述")
|
||||||
|
private String fullDescription;
|
||||||
|
|
||||||
|
/**历史渊源*/
|
||||||
|
@Excel(name = "历史渊源", width = 15)
|
||||||
|
@Schema(description = "历史渊源")
|
||||||
|
private String history;
|
||||||
|
|
||||||
|
/**技艺特点*/
|
||||||
|
@Excel(name = "技艺特点", width = 15)
|
||||||
|
@Schema(description = "技艺特点")
|
||||||
|
private String features;
|
||||||
|
|
||||||
|
/**传承价值*/
|
||||||
|
@Excel(name = "传承价值", width = 15)
|
||||||
|
@Schema(description = "传承价值")
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
/**封面图片*/
|
||||||
|
@Excel(name = "封面图片", width = 15)
|
||||||
|
@Schema(description = "封面图片")
|
||||||
|
private String coverImage;
|
||||||
|
|
||||||
|
/**图片集*/
|
||||||
|
@Excel(name = "图片集", width = 15)
|
||||||
|
@Schema(description = "图片集")
|
||||||
|
private String images;
|
||||||
|
|
||||||
|
/**视频链接*/
|
||||||
|
@Excel(name = "视频链接", width = 15)
|
||||||
|
@Schema(description = "视频链接")
|
||||||
|
private String videoUrl;
|
||||||
|
|
||||||
|
/**音频链接*/
|
||||||
|
@Excel(name = "音频链接", width = 15)
|
||||||
|
@Schema(description = "音频链接")
|
||||||
|
private String audioUrl;
|
||||||
|
|
||||||
|
/**标签*/
|
||||||
|
@Excel(name = "标签", width = 15)
|
||||||
|
@Schema(description = "标签")
|
||||||
|
private String tags;
|
||||||
|
|
||||||
|
/**关联传承人ID*/
|
||||||
|
@Excel(name = "关联传承人ID", width = 15)
|
||||||
|
@Schema(description = "关联传承人ID")
|
||||||
|
private String inheritorIds;
|
||||||
|
|
||||||
|
/**保护单位*/
|
||||||
|
@Excel(name = "保护单位", width = 15)
|
||||||
|
@Schema(description = "保护单位")
|
||||||
|
private String protectionUnit;
|
||||||
|
|
||||||
|
/**保护措施*/
|
||||||
|
@Excel(name = "保护措施", width = 15)
|
||||||
|
@Schema(description = "保护措施")
|
||||||
|
private String protectionMeasures;
|
||||||
|
|
||||||
|
/**保护现状*/
|
||||||
|
@Excel(name = "保护现状", width = 15)
|
||||||
|
@Schema(description = "保护现状")
|
||||||
|
private String currentStatus;
|
||||||
|
|
||||||
|
/**是否推荐*/
|
||||||
|
@Excel(name = "是否推荐", width = 15)
|
||||||
|
@Schema(description = "是否推荐")
|
||||||
|
private Integer isRecommended;
|
||||||
|
|
||||||
|
/**浏览次数*/
|
||||||
|
@Excel(name = "浏览次数", width = 15)
|
||||||
|
@Schema(description = "浏览次数")
|
||||||
|
private Integer viewCount;
|
||||||
|
|
||||||
|
/**点赞次数*/
|
||||||
|
@Excel(name = "点赞次数", width = 15)
|
||||||
|
@Schema(description = "点赞次数")
|
||||||
|
private Integer likeCount;
|
||||||
|
|
||||||
|
/**状态*/
|
||||||
|
@Excel(name = "状态", width = 15)
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private Integer status;
|
||||||
|
}
|
@ -0,0 +1,147 @@
|
|||||||
|
package org.jeecg.modules.oroqen.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 订单
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("oroqen_order")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "订单")
|
||||||
|
public class OroqenOrder implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**订单号*/
|
||||||
|
@Excel(name = "订单号", width = 15)
|
||||||
|
@Schema(description = "订单号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
/**用户ID*/
|
||||||
|
@Excel(name = "用户ID", width = 15)
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**订单状态(0-待付款,1-待发货,2-待收货,3-已完成,4-已取消)*/
|
||||||
|
@Excel(name = "订单状态", width = 15)
|
||||||
|
@Schema(description = "订单状态(0-待付款,1-待发货,2-待收货,3-已完成,4-已取消)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**商品总金额*/
|
||||||
|
@Excel(name = "商品总金额", width = 15)
|
||||||
|
@Schema(description = "商品总金额")
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
/**运费*/
|
||||||
|
@Excel(name = "运费", width = 15)
|
||||||
|
@Schema(description = "运费")
|
||||||
|
private BigDecimal shippingFee;
|
||||||
|
|
||||||
|
/**优惠金额*/
|
||||||
|
@Excel(name = "优惠金额", width = 15)
|
||||||
|
@Schema(description = "优惠金额")
|
||||||
|
private BigDecimal discountAmount;
|
||||||
|
|
||||||
|
/**实付金额*/
|
||||||
|
@Excel(name = "实付金额", width = 15)
|
||||||
|
@Schema(description = "实付金额")
|
||||||
|
private BigDecimal payAmount;
|
||||||
|
|
||||||
|
/**支付方式(1-微信,2-支付宝,3-银行卡)*/
|
||||||
|
@Excel(name = "支付方式", width = 15)
|
||||||
|
@Schema(description = "支付方式(1-微信,2-支付宝,3-银行卡)")
|
||||||
|
private Integer paymentMethod;
|
||||||
|
|
||||||
|
/**支付时间*/
|
||||||
|
@Excel(name = "支付时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "支付时间")
|
||||||
|
private Date paymentTime;
|
||||||
|
|
||||||
|
/**收货人姓名*/
|
||||||
|
@Excel(name = "收货人姓名", width = 15)
|
||||||
|
@Schema(description = "收货人姓名")
|
||||||
|
private String receiverName;
|
||||||
|
|
||||||
|
/**收货人电话*/
|
||||||
|
@Excel(name = "收货人电话", width = 15)
|
||||||
|
@Schema(description = "收货人电话")
|
||||||
|
private String receiverPhone;
|
||||||
|
|
||||||
|
/**收货地址*/
|
||||||
|
@Excel(name = "收货地址", width = 15)
|
||||||
|
@Schema(description = "收货地址")
|
||||||
|
private String receiverAddress;
|
||||||
|
|
||||||
|
/**物流公司*/
|
||||||
|
@Excel(name = "物流公司", width = 15)
|
||||||
|
@Schema(description = "物流公司")
|
||||||
|
private String shippingCompany;
|
||||||
|
|
||||||
|
/**物流单号*/
|
||||||
|
@Excel(name = "物流单号", width = 15)
|
||||||
|
@Schema(description = "物流单号")
|
||||||
|
private String trackingNumber;
|
||||||
|
|
||||||
|
/**发货时间*/
|
||||||
|
@Excel(name = "发货时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "发货时间")
|
||||||
|
private Date shippingTime;
|
||||||
|
|
||||||
|
/**收货时间*/
|
||||||
|
@Excel(name = "收货时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "收货时间")
|
||||||
|
private Date receivedTime;
|
||||||
|
|
||||||
|
/**订单备注*/
|
||||||
|
@Excel(name = "订单备注", width = 15)
|
||||||
|
@Schema(description = "订单备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,91 @@
|
|||||||
|
package org.jeecg.modules.oroqen.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 订单项
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("oroqen_order_item")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "订单项")
|
||||||
|
public class OroqenOrderItem implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**订单ID*/
|
||||||
|
@Excel(name = "订单ID", width = 15)
|
||||||
|
@Schema(description = "订单ID")
|
||||||
|
private String orderId;
|
||||||
|
|
||||||
|
/**商品ID*/
|
||||||
|
@Excel(name = "商品ID", width = 15)
|
||||||
|
@Schema(description = "商品ID")
|
||||||
|
private String productId;
|
||||||
|
|
||||||
|
/**商品名称*/
|
||||||
|
@Excel(name = "商品名称", width = 15)
|
||||||
|
@Schema(description = "商品名称")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/**商品图片*/
|
||||||
|
@Excel(name = "商品图片", width = 15)
|
||||||
|
@Schema(description = "商品图片")
|
||||||
|
private String productImage;
|
||||||
|
|
||||||
|
/**商品价格*/
|
||||||
|
@Excel(name = "商品价格", width = 15)
|
||||||
|
@Schema(description = "商品价格")
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
|
||||||
|
/**购买数量*/
|
||||||
|
@Excel(name = "购买数量", width = 15)
|
||||||
|
@Schema(description = "购买数量")
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
/**小计金额*/
|
||||||
|
@Excel(name = "小计金额", width = 15)
|
||||||
|
@Schema(description = "小计金额")
|
||||||
|
private BigDecimal subtotal;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,161 @@
|
|||||||
|
package org.jeecg.modules.oroqen.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 产品
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("oroqen_product")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "产品")
|
||||||
|
public class OroqenProduct implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**产品名称*/
|
||||||
|
@Excel(name = "产品名称", width = 15)
|
||||||
|
@Schema(description = "产品名称")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/**产品编码*/
|
||||||
|
@Excel(name = "产品编码", width = 15)
|
||||||
|
@Schema(description = "产品编码")
|
||||||
|
private String productCode;
|
||||||
|
|
||||||
|
/**分类ID*/
|
||||||
|
@Excel(name = "分类ID", width = 15)
|
||||||
|
@Schema(description = "分类ID")
|
||||||
|
private String categoryId;
|
||||||
|
|
||||||
|
/**价格*/
|
||||||
|
@Excel(name = "价格", width = 15)
|
||||||
|
@Schema(description = "价格")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
/**库存*/
|
||||||
|
@Excel(name = "库存", width = 15)
|
||||||
|
@Schema(description = "库存")
|
||||||
|
private Integer stock;
|
||||||
|
|
||||||
|
/**主图*/
|
||||||
|
@Excel(name = "主图", width = 15)
|
||||||
|
@Schema(description = "主图")
|
||||||
|
private String mainImage;
|
||||||
|
|
||||||
|
/**产品图片(多张,逗号分隔)*/
|
||||||
|
@Excel(name = "产品图片", width = 15)
|
||||||
|
@Schema(description = "产品图片(多张,逗号分隔)")
|
||||||
|
private String images;
|
||||||
|
|
||||||
|
/**产品视频URL*/
|
||||||
|
@Excel(name = "产品视频URL", width = 15)
|
||||||
|
@Schema(description = "产品视频URL")
|
||||||
|
private String productVideo;
|
||||||
|
|
||||||
|
/**产品描述*/
|
||||||
|
@Excel(name = "产品描述", width = 15)
|
||||||
|
@Schema(description = "产品描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**文化故事*/
|
||||||
|
@Excel(name = "文化故事", width = 15)
|
||||||
|
@Schema(description = "文化故事")
|
||||||
|
private String culturalStory;
|
||||||
|
|
||||||
|
/**工匠信息*/
|
||||||
|
@Excel(name = "工匠信息", width = 15)
|
||||||
|
@Schema(description = "工匠信息")
|
||||||
|
private String craftsmanInfo;
|
||||||
|
|
||||||
|
/**材质*/
|
||||||
|
@Excel(name = "材质", width = 15)
|
||||||
|
@Schema(description = "材质")
|
||||||
|
private String material;
|
||||||
|
|
||||||
|
/**规格*/
|
||||||
|
@Excel(name = "规格", width = 15)
|
||||||
|
@Schema(description = "规格")
|
||||||
|
private String specifications;
|
||||||
|
|
||||||
|
/**重量(克)*/
|
||||||
|
@Excel(name = "重量(克)", width = 15)
|
||||||
|
@Schema(description = "重量(克)")
|
||||||
|
private Integer weight;
|
||||||
|
|
||||||
|
/**尺寸*/
|
||||||
|
@Excel(name = "尺寸", width = 15)
|
||||||
|
@Schema(description = "尺寸")
|
||||||
|
private String dimensions;
|
||||||
|
|
||||||
|
/**标签(多个,逗号分隔)*/
|
||||||
|
@Excel(name = "标签", width = 15)
|
||||||
|
@Schema(description = "标签(多个,逗号分隔)")
|
||||||
|
private String tags;
|
||||||
|
|
||||||
|
/**是否推荐(0-否,1-是)*/
|
||||||
|
@Excel(name = "是否推荐", width = 15)
|
||||||
|
@Schema(description = "是否推荐(0-否,1-是)")
|
||||||
|
private Integer isFeatured;
|
||||||
|
|
||||||
|
/**是否热销(0-否,1-是)*/
|
||||||
|
@Excel(name = "是否热销", width = 15)
|
||||||
|
@Schema(description = "是否热销(0-否,1-是)")
|
||||||
|
private Integer isHot;
|
||||||
|
|
||||||
|
/**销量*/
|
||||||
|
@Excel(name = "销量", width = 15)
|
||||||
|
@Schema(description = "销量")
|
||||||
|
private Integer salesCount;
|
||||||
|
|
||||||
|
/**排序*/
|
||||||
|
@Excel(name = "排序", width = 15)
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
/**状态(0-下架,1-上架)*/
|
||||||
|
@Excel(name = "状态", width = 15)
|
||||||
|
@Schema(description = "状态(0-下架,1-上架)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,105 @@
|
|||||||
|
package org.jeecg.modules.oroqen.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 产品分类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("oroqen_product_category")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "产品分类")
|
||||||
|
public class OroqenProductCategory implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**分类名称*/
|
||||||
|
@Excel(name = "分类名称", width = 15)
|
||||||
|
@Schema(description = "分类名称")
|
||||||
|
@TableField("category_name")
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
/**分类编码*/
|
||||||
|
@Excel(name = "分类编码", width = 15)
|
||||||
|
@Schema(description = "分类编码")
|
||||||
|
@TableField("category_code")
|
||||||
|
private String categoryCode;
|
||||||
|
|
||||||
|
/**父级ID*/
|
||||||
|
@Excel(name = "父级ID", width = 15)
|
||||||
|
@Schema(description = "父级ID")
|
||||||
|
@TableField("parent_id")
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
/**排序*/
|
||||||
|
@Excel(name = "排序", width = 15)
|
||||||
|
@Schema(description = "排序")
|
||||||
|
@TableField("sort_order")
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
/**描述*/
|
||||||
|
@Excel(name = "描述", width = 15)
|
||||||
|
@Schema(description = "描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**图标*/
|
||||||
|
@Excel(name = "图标", width = 15)
|
||||||
|
@Schema(description = "图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
/**状态(0-禁用,1-启用)*/
|
||||||
|
@Excel(name = "状态(0-禁用,1-启用)", width = 15)
|
||||||
|
@Schema(description = "状态(0-禁用,1-启用)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
@TableField("create_by")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
@TableField("create_time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
@TableField("update_by")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
@TableField("update_time")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**子分类列表*/
|
||||||
|
@Schema(description = "子分类列表")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<OroqenProductCategory> children;
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package org.jeecg.modules.oroqen.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 用户收藏
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("oroqen_user_favorite")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "用户收藏")
|
||||||
|
public class OroqenUserFavorite implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**用户ID*/
|
||||||
|
@Excel(name = "用户ID", width = 15)
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**收藏类型(1-商品,2-文化内容,3-传承人)*/
|
||||||
|
@Excel(name = "收藏类型", width = 15)
|
||||||
|
@Schema(description = "收藏类型(1-商品,2-文化内容,3-传承人)")
|
||||||
|
private Integer favoriteType;
|
||||||
|
|
||||||
|
/**收藏对象ID*/
|
||||||
|
@Excel(name = "收藏对象ID", width = 15)
|
||||||
|
@Schema(description = "收藏对象ID")
|
||||||
|
private String targetId;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package org.jeecg.modules.oroqen.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenCart;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 购物车
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface OroqenCartMapper extends BaseMapper<OroqenCart> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询购物车
|
||||||
|
*/
|
||||||
|
List<OroqenCart> selectByUserId(@Param("userId") String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID和商品ID查询购物车项
|
||||||
|
*/
|
||||||
|
OroqenCart selectByUserIdAndProductId(@Param("userId") String userId, @Param("productId") String productId);
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package org.jeecg.modules.oroqen.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenCultureCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 文化内容分类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface OroqenCultureCategoryMapper extends BaseMapper<OroqenCultureCategory> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
package org.jeecg.modules.oroqen.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Update;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenCultureContent;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 文化内容
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface OroqenCultureContentMapper extends BaseMapper<OroqenCultureContent> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分类ID查询文化内容
|
||||||
|
*/
|
||||||
|
List<OroqenCultureContent> selectByCategoryId(@Param("categoryId") String categoryId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询推荐文化内容
|
||||||
|
*/
|
||||||
|
List<OroqenCultureContent> selectRecommended();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新浏览次数
|
||||||
|
*/
|
||||||
|
@Update("UPDATE oroqen_culture_content SET view_count = view_count + 1 WHERE id = #{id}")
|
||||||
|
void updateViewCount(@Param("id") String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新点赞次数
|
||||||
|
*/
|
||||||
|
@Update("UPDATE oroqen_culture_content SET like_count = like_count + #{count} WHERE id = #{id}")
|
||||||
|
void updateLikeCount(@Param("id") String id, @Param("count") Integer count);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新收藏次数
|
||||||
|
*/
|
||||||
|
@Update("UPDATE oroqen_culture_content SET favorite_count = favorite_count + #{count} WHERE id = #{id}")
|
||||||
|
void updateFavoriteCount(@Param("id") String id, @Param("count") Integer count);
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package org.jeecg.modules.oroqen.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenHeritageInheritor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 非遗传承人
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface OroqenHeritageInheritorMapper extends BaseMapper<OroqenHeritageInheritor> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package org.jeecg.modules.oroqen.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenHeritageProject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 非遗项目
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-01-01
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface OroqenHeritageProjectMapper extends BaseMapper<OroqenHeritageProject> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package org.jeecg.modules.oroqen.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenOrderItem;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 订单项
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface OroqenOrderItemMapper extends BaseMapper<OroqenOrderItem> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单ID查询订单项
|
||||||
|
*/
|
||||||
|
List<OroqenOrderItem> selectByOrderId(@Param("orderId") String orderId);
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package org.jeecg.modules.oroqen.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenOrder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 订单
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface OroqenOrderMapper extends BaseMapper<OroqenOrder> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询订单
|
||||||
|
*/
|
||||||
|
List<OroqenOrder> selectByUserId(@Param("userId") String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单状态查询订单
|
||||||
|
*/
|
||||||
|
List<OroqenOrder> selectByStatus(@Param("status") Integer status);
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package org.jeecg.modules.oroqen.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenProductCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 产品分类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface OroqenProductCategoryMapper extends BaseMapper<OroqenProductCategory> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
package org.jeecg.modules.oroqen.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenProduct;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 产品
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface OroqenProductMapper extends BaseMapper<OroqenProduct> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分类ID查询产品列表
|
||||||
|
* @param categoryId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OroqenProduct> selectByCategoryId(@Param("categoryId") String categoryId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询推荐产品
|
||||||
|
* @param limit
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OroqenProduct> selectFeaturedProducts(@Param("limit") Integer limit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询热销产品
|
||||||
|
* @param limit
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OroqenProduct> selectHotProducts(@Param("limit") Integer limit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新销量
|
||||||
|
* @param productId
|
||||||
|
* @param quantity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateSalesCount(@Param("productId") String productId, @Param("quantity") Integer quantity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新库存
|
||||||
|
* @param productId
|
||||||
|
* @param quantity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateStock(@Param("productId") String productId, @Param("quantity") Integer quantity);
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package org.jeecg.modules.oroqen.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenUserFavorite;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 用户收藏
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface OroqenUserFavoriteMapper extends BaseMapper<OroqenUserFavorite> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询收藏
|
||||||
|
*/
|
||||||
|
List<OroqenUserFavorite> selectByUserId(@Param("userId") String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID和收藏类型查询收藏
|
||||||
|
*/
|
||||||
|
List<OroqenUserFavorite> selectByUserIdAndType(@Param("userId") String userId, @Param("favoriteType") Integer favoriteType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查是否已收藏
|
||||||
|
*/
|
||||||
|
OroqenUserFavorite selectByUserIdAndTarget(@Param("userId") String userId, @Param("favoriteType") Integer favoriteType, @Param("targetId") String targetId);
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.oroqen.mapper.OroqenCartMapper">
|
||||||
|
|
||||||
|
<!-- 根据用户ID查询购物车 -->
|
||||||
|
<select id="selectByUserId" resultType="org.jeecg.modules.oroqen.entity.OroqenCart">
|
||||||
|
SELECT * FROM oroqen_cart
|
||||||
|
WHERE user_id = #{userId}
|
||||||
|
AND del_flag = 0
|
||||||
|
ORDER BY create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据用户ID和商品ID查询购物车项 -->
|
||||||
|
<select id="selectByUserIdAndProductId" resultType="org.jeecg.modules.oroqen.entity.OroqenCart">
|
||||||
|
SELECT * FROM oroqen_cart
|
||||||
|
WHERE user_id = #{userId}
|
||||||
|
AND product_id = #{productId}
|
||||||
|
AND del_flag = 0
|
||||||
|
LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.oroqen.mapper.OroqenCultureCategoryMapper">
|
||||||
|
|
||||||
|
<!-- 基础映射文件,目前使用BaseMapper的默认方法 -->
|
||||||
|
<!-- 如需要自定义查询方法,可在此处添加 -->
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.oroqen.mapper.OroqenCultureContentMapper">
|
||||||
|
|
||||||
|
<!-- 查询推荐文化内容 -->
|
||||||
|
<select id="selectRecommended" resultType="org.jeecg.modules.oroqen.entity.OroqenCultureContent">
|
||||||
|
SELECT * FROM oroqen_culture_content
|
||||||
|
WHERE is_recommended = 1
|
||||||
|
AND status = 1
|
||||||
|
ORDER BY sort_order ASC, create_time DESC
|
||||||
|
LIMIT 10
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据分类ID查询文化内容 -->
|
||||||
|
<select id="selectByCategoryId" resultType="org.jeecg.modules.oroqen.entity.OroqenCultureContent">
|
||||||
|
SELECT * FROM oroqen_culture_content
|
||||||
|
WHERE category_id = #{categoryId}
|
||||||
|
AND status = 1
|
||||||
|
ORDER BY sort_order ASC, create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.oroqen.mapper.OroqenHeritageInheritorMapper">
|
||||||
|
|
||||||
|
<!-- 基础映射文件,目前使用BaseMapper的默认方法 -->
|
||||||
|
<!-- 如需要自定义查询方法,可在此处添加 -->
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.oroqen.mapper.OroqenHeritageProjectMapper">
|
||||||
|
|
||||||
|
<!-- 基础映射文件,目前使用BaseMapper的默认方法 -->
|
||||||
|
<!-- 如需要自定义查询方法,可在此处添加 -->
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.oroqen.mapper.OroqenOrderItemMapper">
|
||||||
|
|
||||||
|
<!-- 根据订单ID查询订单项 -->
|
||||||
|
<select id="selectByOrderId" resultType="org.jeecg.modules.oroqen.entity.OroqenOrderItem">
|
||||||
|
SELECT * FROM oroqen_order_item
|
||||||
|
WHERE order_id = #{orderId}
|
||||||
|
AND del_flag = 0
|
||||||
|
ORDER BY create_time ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.oroqen.mapper.OroqenOrderMapper">
|
||||||
|
|
||||||
|
<!-- 根据用户ID查询订单 -->
|
||||||
|
<select id="selectByUserId" resultType="org.jeecg.modules.oroqen.entity.OroqenOrder">
|
||||||
|
SELECT * FROM oroqen_order
|
||||||
|
WHERE user_id = #{userId}
|
||||||
|
AND del_flag = 0
|
||||||
|
ORDER BY create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据订单状态查询订单 -->
|
||||||
|
<select id="selectByStatus" resultType="org.jeecg.modules.oroqen.entity.OroqenOrder">
|
||||||
|
SELECT * FROM oroqen_order
|
||||||
|
WHERE status = #{status}
|
||||||
|
AND del_flag = 0
|
||||||
|
ORDER BY create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.oroqen.mapper.OroqenProductCategoryMapper">
|
||||||
|
|
||||||
|
<!-- 基础映射文件,目前使用BaseMapper的默认方法 -->
|
||||||
|
<!-- 如需要自定义查询方法,可在此处添加 -->
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.oroqen.mapper.OroqenProductMapper">
|
||||||
|
|
||||||
|
<!-- 根据分类ID查询产品列表 -->
|
||||||
|
<select id="selectByCategoryId" resultType="org.jeecg.modules.oroqen.entity.OroqenProduct">
|
||||||
|
SELECT * FROM oroqen_product
|
||||||
|
WHERE category_id = #{categoryId}
|
||||||
|
AND status = 1
|
||||||
|
ORDER BY sort_order ASC, create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询推荐产品 -->
|
||||||
|
<select id="selectFeaturedProducts" resultType="org.jeecg.modules.oroqen.entity.OroqenProduct">
|
||||||
|
SELECT * FROM oroqen_product
|
||||||
|
WHERE is_featured = 1
|
||||||
|
AND status = 1
|
||||||
|
ORDER BY sort_order ASC, create_time DESC
|
||||||
|
<if test="limit != null">
|
||||||
|
LIMIT #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询热销产品 -->
|
||||||
|
<select id="selectHotProducts" resultType="org.jeecg.modules.oroqen.entity.OroqenProduct">
|
||||||
|
SELECT * FROM oroqen_product
|
||||||
|
WHERE is_hot = 1
|
||||||
|
AND status = 1
|
||||||
|
ORDER BY sales_count DESC, create_time DESC
|
||||||
|
<if test="limit != null">
|
||||||
|
LIMIT #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 更新销量 -->
|
||||||
|
<update id="updateSalesCount">
|
||||||
|
UPDATE oroqen_product
|
||||||
|
SET sales_count = IFNULL(sales_count, 0) + #{quantity}
|
||||||
|
WHERE id = #{productId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 更新库存 -->
|
||||||
|
<update id="updateStock">
|
||||||
|
UPDATE oroqen_product
|
||||||
|
SET stock = IFNULL(stock, 0) + #{quantity}
|
||||||
|
WHERE id = #{productId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.oroqen.mapper.OroqenUserFavoriteMapper">
|
||||||
|
|
||||||
|
<!-- 根据用户ID查询收藏 -->
|
||||||
|
<select id="selectByUserId" resultType="org.jeecg.modules.oroqen.entity.OroqenUserFavorite">
|
||||||
|
SELECT * FROM oroqen_user_favorite
|
||||||
|
WHERE user_id = #{userId}
|
||||||
|
AND del_flag = 0
|
||||||
|
ORDER BY create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据用户ID和收藏类型查询收藏 -->
|
||||||
|
<select id="selectByUserIdAndType" resultType="org.jeecg.modules.oroqen.entity.OroqenUserFavorite">
|
||||||
|
SELECT * FROM oroqen_user_favorite
|
||||||
|
WHERE user_id = #{userId}
|
||||||
|
AND favorite_type = #{favoriteType}
|
||||||
|
AND del_flag = 0
|
||||||
|
ORDER BY create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 检查是否已收藏 -->
|
||||||
|
<select id="selectByUserIdAndTarget" resultType="org.jeecg.modules.oroqen.entity.OroqenUserFavorite">
|
||||||
|
SELECT * FROM oroqen_user_favorite
|
||||||
|
WHERE user_id = #{userId}
|
||||||
|
AND favorite_type = #{favoriteType}
|
||||||
|
AND target_id = #{targetId}
|
||||||
|
AND del_flag = 0
|
||||||
|
LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,40 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenCart;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 购物车
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IOroqenCartService extends IService<OroqenCart> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询购物车
|
||||||
|
*/
|
||||||
|
List<OroqenCart> getByUserId(String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加到购物车
|
||||||
|
*/
|
||||||
|
void addToCart(String userId, String productId, Integer quantity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新购物车商品数量
|
||||||
|
*/
|
||||||
|
void updateQuantity(String userId, String productId, Integer quantity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从购物车移除商品
|
||||||
|
*/
|
||||||
|
void removeFromCart(String userId, String productId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空购物车
|
||||||
|
*/
|
||||||
|
void clearCart(String userId);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenCultureCategory;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 文化内容分类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IOroqenCultureCategoryService extends IService<OroqenCultureCategory> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取树形分类列表
|
||||||
|
*/
|
||||||
|
List<OroqenCultureCategory> getTreeList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据父级ID获取子分类
|
||||||
|
*/
|
||||||
|
List<OroqenCultureCategory> getChildrenByParentId(String parentId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查分类编码是否存在
|
||||||
|
*/
|
||||||
|
boolean existsByCategoryCode(String categoryCode, String excludeId);
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenCultureContent;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 文化内容
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IOroqenCultureContentService extends IService<OroqenCultureContent> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分类ID查询文化内容
|
||||||
|
*/
|
||||||
|
List<OroqenCultureContent> getByCategoryId(String categoryId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询推荐文化内容
|
||||||
|
*/
|
||||||
|
List<OroqenCultureContent> getRecommended();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新浏览次数
|
||||||
|
*/
|
||||||
|
void updateViewCount(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新点赞次数
|
||||||
|
*/
|
||||||
|
void updateLikeCount(String id, Integer count);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新收藏次数
|
||||||
|
*/
|
||||||
|
void updateFavoriteCount(String id, Integer count);
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenHeritageInheritor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 非遗传承人
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IOroqenHeritageInheritorService extends IService<OroqenHeritageInheritor> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenHeritageProject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 非遗项目
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-01-01
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IOroqenHeritageProjectService extends IService<OroqenHeritageProject> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenOrderItem;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 订单项
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IOroqenOrderItemService extends IService<OroqenOrderItem> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单ID查询订单项
|
||||||
|
*/
|
||||||
|
List<OroqenOrderItem> getByOrderId(String orderId);
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenOrder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 订单
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IOroqenOrderService extends IService<OroqenOrder> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询订单
|
||||||
|
*/
|
||||||
|
List<OroqenOrder> getByUserId(String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单状态查询订单
|
||||||
|
*/
|
||||||
|
List<OroqenOrder> getByStatus(Integer status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建订单
|
||||||
|
*/
|
||||||
|
String createOrder(OroqenOrder order);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新订单状态
|
||||||
|
*/
|
||||||
|
void updateOrderStatus(String orderId, Integer status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消订单
|
||||||
|
*/
|
||||||
|
void cancelOrder(String orderId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发货
|
||||||
|
*/
|
||||||
|
void shipOrder(String orderId, String shippingCompany, String trackingNumber);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认收货
|
||||||
|
*/
|
||||||
|
void confirmReceived(String orderId);
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenProductCategory;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 产品分类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IOroqenProductCategoryService extends IService<OroqenProductCategory> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取树形结构的分类列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OroqenProductCategory> getCategoryTree();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据父级ID获取子分类
|
||||||
|
* @param parentId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OroqenProductCategory> getChildrenByParentId(String parentId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查分类编码是否存在
|
||||||
|
* @param categoryCode
|
||||||
|
* @param excludeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean checkCategoryCodeExists(String categoryCode, String excludeId);
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenProduct;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 产品
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IOroqenProductService extends IService<OroqenProduct> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分类ID查询产品列表
|
||||||
|
* @param categoryId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OroqenProduct> getProductsByCategoryId(String categoryId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询推荐产品
|
||||||
|
* @param limit
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OroqenProduct> getFeaturedProducts(Integer limit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询热销产品
|
||||||
|
* @param limit
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OroqenProduct> getHotProducts(Integer limit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查产品编码是否存在
|
||||||
|
* @param productCode
|
||||||
|
* @param excludeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean checkProductCodeExists(String productCode, String excludeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新销量
|
||||||
|
* @param productId
|
||||||
|
* @param quantity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean updateSalesCount(String productId, Integer quantity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新库存
|
||||||
|
* @param productId
|
||||||
|
* @param quantity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean updateStock(String productId, Integer quantity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查库存是否充足
|
||||||
|
* @param productId
|
||||||
|
* @param quantity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean checkStock(String productId, Integer quantity);
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenUserFavorite;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 用户收藏
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IOroqenUserFavoriteService extends IService<OroqenUserFavorite> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询收藏
|
||||||
|
*/
|
||||||
|
List<OroqenUserFavorite> getByUserId(String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID和收藏类型查询收藏
|
||||||
|
*/
|
||||||
|
List<OroqenUserFavorite> getByUserIdAndType(String userId, Integer favoriteType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加收藏
|
||||||
|
*/
|
||||||
|
void addFavorite(String userId, Integer favoriteType, String targetId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消收藏
|
||||||
|
*/
|
||||||
|
void removeFavorite(String userId, Integer favoriteType, String targetId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查是否已收藏
|
||||||
|
*/
|
||||||
|
boolean isFavorited(String userId, Integer favoriteType, String targetId);
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenCart;
|
||||||
|
import org.jeecg.modules.oroqen.mapper.OroqenCartMapper;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenCartService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 购物车
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OroqenCartServiceImpl extends ServiceImpl<OroqenCartMapper, OroqenCart> implements IOroqenCartService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenCart> getByUserId(String userId) {
|
||||||
|
return baseMapper.selectByUserId(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addToCart(String userId, String productId, Integer quantity) {
|
||||||
|
OroqenCart existingCart = baseMapper.selectByUserIdAndProductId(userId, productId);
|
||||||
|
if (existingCart != null) {
|
||||||
|
// 如果商品已存在,更新数量
|
||||||
|
existingCart.setQuantity(existingCart.getQuantity() + quantity);
|
||||||
|
existingCart.setUpdateTime(new Date());
|
||||||
|
this.updateById(existingCart);
|
||||||
|
} else {
|
||||||
|
// 如果商品不存在,新增
|
||||||
|
OroqenCart cart = new OroqenCart();
|
||||||
|
cart.setUserId(userId);
|
||||||
|
cart.setProductId(productId);
|
||||||
|
cart.setQuantity(quantity);
|
||||||
|
cart.setCreateTime(new Date());
|
||||||
|
this.save(cart);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateQuantity(String userId, String productId, Integer quantity) {
|
||||||
|
UpdateWrapper<OroqenCart> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.eq("user_id", userId);
|
||||||
|
updateWrapper.eq("product_id", productId);
|
||||||
|
updateWrapper.set("quantity", quantity);
|
||||||
|
updateWrapper.set("update_time", new Date());
|
||||||
|
this.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeFromCart(String userId, String productId) {
|
||||||
|
QueryWrapper<OroqenCart> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("user_id", userId);
|
||||||
|
queryWrapper.eq("product_id", productId);
|
||||||
|
this.remove(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clearCart(String userId) {
|
||||||
|
QueryWrapper<OroqenCart> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("user_id", userId);
|
||||||
|
this.remove(queryWrapper);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,81 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenCultureCategory;
|
||||||
|
import org.jeecg.modules.oroqen.mapper.OroqenCultureCategoryMapper;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenCultureCategoryService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 文化内容分类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OroqenCultureCategoryServiceImpl extends ServiceImpl<OroqenCultureCategoryMapper, OroqenCultureCategory> implements IOroqenCultureCategoryService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenCultureCategory> getTreeList() {
|
||||||
|
QueryWrapper<OroqenCultureCategory> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("status", 1);
|
||||||
|
queryWrapper.orderByAsc("sort_order", "create_time");
|
||||||
|
List<OroqenCultureCategory> allCategories = this.list(queryWrapper);
|
||||||
|
|
||||||
|
return buildTree(allCategories, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenCultureCategory> getChildrenByParentId(String parentId) {
|
||||||
|
QueryWrapper<OroqenCultureCategory> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("status", 1);
|
||||||
|
if (StringUtils.hasText(parentId)) {
|
||||||
|
queryWrapper.eq("parent_id", parentId);
|
||||||
|
} else {
|
||||||
|
queryWrapper.isNull("parent_id").or().eq("parent_id", "");
|
||||||
|
}
|
||||||
|
queryWrapper.orderByAsc("sort_order", "create_time");
|
||||||
|
return this.list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean existsByCategoryCode(String categoryCode, String excludeId) {
|
||||||
|
QueryWrapper<OroqenCultureCategory> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("category_code", categoryCode);
|
||||||
|
if (StringUtils.hasText(excludeId)) {
|
||||||
|
queryWrapper.ne("id", excludeId);
|
||||||
|
}
|
||||||
|
return this.count(queryWrapper) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建树形结构
|
||||||
|
*/
|
||||||
|
private List<OroqenCultureCategory> buildTree(List<OroqenCultureCategory> allCategories, String parentId) {
|
||||||
|
List<OroqenCultureCategory> result = new ArrayList<>();
|
||||||
|
|
||||||
|
List<OroqenCultureCategory> children = allCategories.stream()
|
||||||
|
.filter(category -> {
|
||||||
|
if (parentId == null) {
|
||||||
|
return category.getParentId() == null || "".equals(category.getParentId());
|
||||||
|
} else {
|
||||||
|
return parentId.equals(category.getParentId());
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
for (OroqenCultureCategory category : children) {
|
||||||
|
List<OroqenCultureCategory> subChildren = buildTree(allCategories, category.getId());
|
||||||
|
category.setChildren(subChildren);
|
||||||
|
result.add(category);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenCultureContent;
|
||||||
|
import org.jeecg.modules.oroqen.mapper.OroqenCultureContentMapper;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenCultureContentService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 文化内容
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OroqenCultureContentServiceImpl extends ServiceImpl<OroqenCultureContentMapper, OroqenCultureContent> implements IOroqenCultureContentService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenCultureContent> getByCategoryId(String categoryId) {
|
||||||
|
return baseMapper.selectByCategoryId(categoryId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenCultureContent> getRecommended() {
|
||||||
|
return baseMapper.selectRecommended();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateViewCount(String id) {
|
||||||
|
baseMapper.updateViewCount(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateLikeCount(String id, Integer count) {
|
||||||
|
baseMapper.updateLikeCount(id, count);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateFavoriteCount(String id, Integer count) {
|
||||||
|
baseMapper.updateFavoriteCount(id, count);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenHeritageInheritor;
|
||||||
|
import org.jeecg.modules.oroqen.mapper.OroqenHeritageInheritorMapper;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenHeritageInheritorService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 非遗传承人
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OroqenHeritageInheritorServiceImpl extends ServiceImpl<OroqenHeritageInheritorMapper, OroqenHeritageInheritor> implements IOroqenHeritageInheritorService {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenHeritageProject;
|
||||||
|
import org.jeecg.modules.oroqen.mapper.OroqenHeritageProjectMapper;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenHeritageProjectService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 非遗项目
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-01-01
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OroqenHeritageProjectServiceImpl extends ServiceImpl<OroqenHeritageProjectMapper, OroqenHeritageProject> implements IOroqenHeritageProjectService {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenOrderItem;
|
||||||
|
import org.jeecg.modules.oroqen.mapper.OroqenOrderItemMapper;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenOrderItemService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 订单项
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OroqenOrderItemServiceImpl extends ServiceImpl<OroqenOrderItemMapper, OroqenOrderItem> implements IOroqenOrderItemService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenOrderItem> getByOrderId(String orderId) {
|
||||||
|
return baseMapper.selectByOrderId(orderId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,89 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenOrder;
|
||||||
|
import org.jeecg.modules.oroqen.mapper.OroqenOrderMapper;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenOrderService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 订单
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OroqenOrderServiceImpl extends ServiceImpl<OroqenOrderMapper, OroqenOrder> implements IOroqenOrderService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenOrder> getByUserId(String userId) {
|
||||||
|
return baseMapper.selectByUserId(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenOrder> getByStatus(Integer status) {
|
||||||
|
return baseMapper.selectByStatus(status);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String createOrder(OroqenOrder order) {
|
||||||
|
// 生成订单号
|
||||||
|
String orderNo = generateOrderNo();
|
||||||
|
order.setOrderNo(orderNo);
|
||||||
|
order.setStatus(0); // 待付款
|
||||||
|
order.setCreateTime(new Date());
|
||||||
|
this.save(order);
|
||||||
|
return order.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateOrderStatus(String orderId, Integer status) {
|
||||||
|
UpdateWrapper<OroqenOrder> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.eq("id", orderId);
|
||||||
|
updateWrapper.set("status", status);
|
||||||
|
updateWrapper.set("update_time", new Date());
|
||||||
|
this.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cancelOrder(String orderId) {
|
||||||
|
UpdateWrapper<OroqenOrder> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.eq("id", orderId);
|
||||||
|
updateWrapper.set("status", 4); // 已取消
|
||||||
|
updateWrapper.set("update_time", new Date());
|
||||||
|
this.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void shipOrder(String orderId, String shippingCompany, String trackingNumber) {
|
||||||
|
UpdateWrapper<OroqenOrder> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.eq("id", orderId);
|
||||||
|
updateWrapper.set("status", 2); // 待收货
|
||||||
|
updateWrapper.set("shipping_company", shippingCompany);
|
||||||
|
updateWrapper.set("tracking_number", trackingNumber);
|
||||||
|
updateWrapper.set("shipping_time", new Date());
|
||||||
|
updateWrapper.set("update_time", new Date());
|
||||||
|
this.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void confirmReceived(String orderId) {
|
||||||
|
UpdateWrapper<OroqenOrder> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.eq("id", orderId);
|
||||||
|
updateWrapper.set("status", 3); // 已完成
|
||||||
|
updateWrapper.set("received_time", new Date());
|
||||||
|
updateWrapper.set("update_time", new Date());
|
||||||
|
this.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成订单号
|
||||||
|
*/
|
||||||
|
private String generateOrderNo() {
|
||||||
|
return "ORD" + System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,76 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenProductCategory;
|
||||||
|
import org.jeecg.modules.oroqen.mapper.OroqenProductCategoryMapper;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenProductCategoryService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 产品分类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OroqenProductCategoryServiceImpl extends ServiceImpl<OroqenProductCategoryMapper, OroqenProductCategory> implements IOroqenProductCategoryService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenProductCategory> getCategoryTree() {
|
||||||
|
QueryWrapper<OroqenProductCategory> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("status", 1);
|
||||||
|
queryWrapper.orderByAsc("sort_order", "create_time");
|
||||||
|
List<OroqenProductCategory> allCategories = this.list(queryWrapper);
|
||||||
|
|
||||||
|
return buildTree(allCategories, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenProductCategory> getChildrenByParentId(String parentId) {
|
||||||
|
QueryWrapper<OroqenProductCategory> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("parent_id", parentId);
|
||||||
|
queryWrapper.eq("status", 1);
|
||||||
|
queryWrapper.orderByAsc("sort_order", "create_time");
|
||||||
|
return this.list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkCategoryCodeExists(String categoryCode, String excludeId) {
|
||||||
|
QueryWrapper<OroqenProductCategory> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("category_code", categoryCode);
|
||||||
|
if (excludeId != null) {
|
||||||
|
queryWrapper.ne("id", excludeId);
|
||||||
|
}
|
||||||
|
return this.count(queryWrapper) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建树形结构
|
||||||
|
*/
|
||||||
|
private List<OroqenProductCategory> buildTree(List<OroqenProductCategory> allCategories, String parentId) {
|
||||||
|
List<OroqenProductCategory> result = new ArrayList<>();
|
||||||
|
|
||||||
|
List<OroqenProductCategory> children = allCategories.stream()
|
||||||
|
.filter(category -> {
|
||||||
|
if (parentId == null) {
|
||||||
|
return category.getParentId() == null || "".equals(category.getParentId());
|
||||||
|
} else {
|
||||||
|
return parentId.equals(category.getParentId());
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
for (OroqenProductCategory category : children) {
|
||||||
|
List<OroqenProductCategory> childList = buildTree(allCategories, category.getId());
|
||||||
|
category.setChildren(childList);
|
||||||
|
result.add(category);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenProduct;
|
||||||
|
import org.jeecg.modules.oroqen.mapper.OroqenProductMapper;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenProductService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 产品
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OroqenProductServiceImpl extends ServiceImpl<OroqenProductMapper, OroqenProduct> implements IOroqenProductService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenProduct> getProductsByCategoryId(String categoryId) {
|
||||||
|
return this.baseMapper.selectByCategoryId(categoryId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenProduct> getFeaturedProducts(Integer limit) {
|
||||||
|
return this.baseMapper.selectFeaturedProducts(limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenProduct> getHotProducts(Integer limit) {
|
||||||
|
return this.baseMapper.selectHotProducts(limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkProductCodeExists(String productCode, String excludeId) {
|
||||||
|
QueryWrapper<OroqenProduct> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("product_code", productCode);
|
||||||
|
if (excludeId != null) {
|
||||||
|
queryWrapper.ne("id", excludeId);
|
||||||
|
}
|
||||||
|
return this.count(queryWrapper) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateSalesCount(String productId, Integer quantity) {
|
||||||
|
return this.baseMapper.updateSalesCount(productId, quantity) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateStock(String productId, Integer quantity) {
|
||||||
|
return this.baseMapper.updateStock(productId, quantity) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkStock(String productId, Integer quantity) {
|
||||||
|
OroqenProduct product = this.getById(productId);
|
||||||
|
if (product == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return product.getStock() != null && product.getStock() >= quantity;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package org.jeecg.modules.oroqen.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.modules.oroqen.entity.OroqenUserFavorite;
|
||||||
|
import org.jeecg.modules.oroqen.mapper.OroqenUserFavoriteMapper;
|
||||||
|
import org.jeecg.modules.oroqen.service.IOroqenUserFavoriteService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 用户收藏
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-01-08
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OroqenUserFavoriteServiceImpl extends ServiceImpl<OroqenUserFavoriteMapper, OroqenUserFavorite> implements IOroqenUserFavoriteService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenUserFavorite> getByUserId(String userId) {
|
||||||
|
return baseMapper.selectByUserId(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OroqenUserFavorite> getByUserIdAndType(String userId, Integer favoriteType) {
|
||||||
|
return baseMapper.selectByUserIdAndType(userId, favoriteType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addFavorite(String userId, Integer favoriteType, String targetId) {
|
||||||
|
// 检查是否已收藏
|
||||||
|
if (!isFavorited(userId, favoriteType, targetId)) {
|
||||||
|
OroqenUserFavorite favorite = new OroqenUserFavorite();
|
||||||
|
favorite.setUserId(userId);
|
||||||
|
favorite.setFavoriteType(favoriteType);
|
||||||
|
favorite.setTargetId(targetId);
|
||||||
|
favorite.setCreateTime(new Date());
|
||||||
|
this.save(favorite);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeFavorite(String userId, Integer favoriteType, String targetId) {
|
||||||
|
QueryWrapper<OroqenUserFavorite> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("user_id", userId);
|
||||||
|
queryWrapper.eq("favorite_type", favoriteType);
|
||||||
|
queryWrapper.eq("target_id", targetId);
|
||||||
|
this.remove(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFavorited(String userId, Integer favoriteType, String targetId) {
|
||||||
|
OroqenUserFavorite favorite = baseMapper.selectByUserIdAndTarget(userId, favoriteType, targetId);
|
||||||
|
return favorite != null;
|
||||||
|
}
|
||||||
|
}
|
@ -224,7 +224,7 @@ jeecg:
|
|||||||
#webapp文件路径
|
#webapp文件路径
|
||||||
webapp: /opt/webapp
|
webapp: /opt/webapp
|
||||||
shiro:
|
shiro:
|
||||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
|
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**,/oroqen/**
|
||||||
#阿里云oss存储和大鱼短信秘钥配置
|
#阿里云oss存储和大鱼短信秘钥配置
|
||||||
oss:
|
oss:
|
||||||
accessKey: ??
|
accessKey: ??
|
||||||
|
@ -190,7 +190,7 @@ jeecg:
|
|||||||
uploadType: local
|
uploadType: local
|
||||||
# 前端访问地址
|
# 前端访问地址
|
||||||
domainUrl:
|
domainUrl:
|
||||||
pc: http://localhost:3100
|
pc: http://localhost:5173
|
||||||
app: http://localhost:8051
|
app: http://localhost:8051
|
||||||
path:
|
path:
|
||||||
#文件上传根目录 设置
|
#文件上传根目录 设置
|
||||||
|
2
pom.xml
2
pom.xml
@ -30,7 +30,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<jeecgboot.version>3.8.1</jeecgboot.version>
|
<jeecgboot.version>3.8.1</jeecgboot.version>
|
||||||
<!-- JDK版本支持17和1.8 -->
|
<!-- JDK版本支持17和1.8 -->
|
||||||
<java.version>17</java.version>
|
<java.version>1.8</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|
||||||
<!-- 微服务 -->
|
<!-- 微服务 -->
|
||||||
|
Loading…
Reference in New Issue
Block a user