Compare commits
45 Commits
afca9b2998
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
| c9683a324a | |||
| ed17be846c | |||
|
|
8d4dfdc8be | ||
|
|
fa2bac7f31 | ||
|
|
eb6f106f4d | ||
| 0464ff6fe8 | |||
| 57e2771d5d | |||
| fe5dc8151e | |||
| 0129ee0c01 | |||
| f4b9559233 | |||
| 8a99c769b3 | |||
| 05993583ec | |||
| db8406a2d8 | |||
| 6af9ee01ea | |||
| efdad14a78 | |||
| 579d2d65f7 | |||
| 9548a00289 | |||
| eddfcefa1d | |||
| 49b6afc4e9 | |||
| 0aa61bc6c0 | |||
| 47da3a6f86 | |||
| 31fe71dd17 | |||
| 40d8d00038 | |||
| 88e3317b68 | |||
| 0470a27418 | |||
| dc83cbece7 | |||
| 233bb596a9 | |||
| c612d69699 | |||
| f99715ecfe | |||
| 1d396e92b7 | |||
|
|
f11d80f8f0 | ||
|
|
732b3c31be | ||
|
|
5713660aaf | ||
| 6b052f0c10 | |||
|
|
4f02e78db1 | ||
|
|
16fcb1c714 | ||
| a929e49db7 | |||
| 40e1a3070f | |||
|
|
bc6f3d47d8 | ||
|
|
b15c8e82d0 | ||
|
|
f3e626050b | ||
|
|
fbad45da65 | ||
|
|
ad0beed1c5 | ||
| c07e7ec5fd | |||
| 53ab15a5ca |
@@ -6,7 +6,10 @@ CREATE TABLE merchant_flagship_store
|
||||
id int8 NOT NULL PRIMARY KEY, -- [主键]
|
||||
store_name VARCHAR(255) NOT NULL, -- 商家全称
|
||||
contact_phone VARCHAR(20), -- 商家联系电话
|
||||
province_id int8 NOT NULL,
|
||||
city_id int8 NOT NULL,
|
||||
regions_id int8 NOT NULL,
|
||||
region_name text NOT NULL, -- 地区名
|
||||
full_address text NOT NULL, -- 详细地址
|
||||
location geometry(Point, 4326) NOT NULL, -- 门店经纬度坐标(用于地图打点和距离计算)
|
||||
thumbnail_url text, -- 缩略图
|
||||
@@ -28,7 +31,10 @@ COMMENT ON TABLE merchant_flagship_store IS '商家旗舰店信息表';
|
||||
COMMENT ON COLUMN merchant_flagship_store.id IS '主键 ID';
|
||||
COMMENT ON COLUMN merchant_flagship_store.store_name IS '店铺名字';
|
||||
COMMENT ON COLUMN merchant_flagship_store.contact_phone IS '商家联系电话';
|
||||
COMMENT ON COLUMN merchant_flagship_store.province_id IS '省份id';
|
||||
COMMENT ON COLUMN merchant_flagship_store.city_id IS '城市id';
|
||||
COMMENT ON COLUMN merchant_flagship_store.regions_id IS '地址id';
|
||||
COMMENT ON COLUMN merchant_flagship_store.region_name IS '地区名';
|
||||
COMMENT ON COLUMN merchant_flagship_store.full_address IS '完整详细地址';
|
||||
COMMENT ON COLUMN merchant_flagship_store.location IS '地理坐标 POINT(经度,纬度),用于地图定位和距离计算';
|
||||
COMMENT ON COLUMN merchant_flagship_store.main_image_url IS '商家主图';
|
||||
@@ -224,6 +230,8 @@ CREATE TABLE tour_product
|
||||
description text DEFAULT NULL, -- 产品详情描述
|
||||
visit_count int4 DEFAULT 0, -- 已成团次数/销量
|
||||
rating decimal(3, 2) DEFAULT 0.00, -- 用户评分
|
||||
province_id int8 NOT NULL,
|
||||
city_id int8 NOT NULL,
|
||||
create_user int8 NULL, -- 创建人ID
|
||||
create_dept int8 NULL, -- 创建部门ID
|
||||
create_time timestamp(6) NULL, -- 创建时间
|
||||
@@ -259,6 +267,8 @@ COMMENT ON COLUMN tour_product.require_hk_macau_pass IS '是否强制港澳通
|
||||
COMMENT ON COLUMN tour_product.description IS '产品详情描述';
|
||||
COMMENT ON COLUMN tour_product.visit_count IS '已成团次数/销量';
|
||||
COMMENT ON COLUMN tour_product.rating IS '用户评分';
|
||||
COMMENT ON COLUMN tour_product.province_id IS '省份id';
|
||||
COMMENT ON COLUMN tour_product.city_id IS '城市id';
|
||||
COMMENT ON COLUMN tour_product.create_user IS '创建人ID';
|
||||
COMMENT ON COLUMN tour_product.create_dept IS '创建部门ID';
|
||||
COMMENT ON COLUMN tour_product.create_time IS '创建时间';
|
||||
@@ -378,5 +388,51 @@ INSERT INTO mall_category (id, category_name, image_url, pid, level, sort, is_de
|
||||
--------------------------------------------- 系统参数 -app支付宝aesKey ---------------------------------------------
|
||||
INSERT INTO blade_param (id, param_name, param_key, param_value, remark, create_user, create_dept, create_time, update_user, update_time, status, is_deleted) VALUES (2037772595062923266, 'app支付宝aesKey', 'yichuyilu.app.ali.aes.key', 'VS14+f0md0HjJ1D0Wp3Lgw==', 'app支付宝aesKey', null, null, '2026-03-28 14:03:41.282000', null, '2026-03-28 14:03:41.282000', 1, 0);
|
||||
|
||||
--------------------------------------------- 后台菜单 ---------------------------------------------
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2033415593821937665, 1123598815738675201, 'ecosystemProduct', '生态产品', 'menu', '/mall/ecosystemProduct', 'iconfont iconicon_addressbook', 11, 1, -1, 1, '', '', 0);
|
||||
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2033749606692487170, 1123598815738675201, 'merchantFlagshipStore', '商家旗舰店信息', 'menu', '/common/merchantFlagshipStore', 'iconfont iconicon_message', 13, 1, 0, 1, '', '', 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120179162013698', '2033749606692487170', 'merchantFlagshipStore_add', '新增', 'add', '/common/merchantFlagshipStore/add', 'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120179162013699', '2033749606692487170', 'merchantFlagshipStore_edit', '修改', 'edit', '/common/merchantFlagshipStore/edit', 'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120179162013700', '2033749606692487170', 'merchantFlagshipStore_delete', '删除', 'delete', '/api/common/merchant-store/merchantFlagshipStore/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120179162013701', '2033749606692487170', 'merchantFlagshipStore_view', '查看', 'view', '/common/merchantFlagshipStore/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2033749607145472001, 1123598815738675201, 'culturalTourismSpot', '文旅景点信息', 'menu', '/common/culturalTourismSpot', 'iconfont iconicon_message', 14, 1, 0, 1, '', '', 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120179677913091', '2033749607145472001', 'culturalTourismSpot_add', '新增', 'add', '/common/culturalTourismSpot/add', 'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120179677913092', '2033749607145472001', 'culturalTourismSpot_edit', '修改', 'edit', '/common/culturalTourismSpot/edit', 'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120179677913093', '2033749607145472001', 'culturalTourismSpot_delete', '删除', 'delete', '/api/common/tourism-spot/culturalTourismSpot/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120179677913094', '2033749607145472001', 'culturalTourismSpot_view', '查看', 'view', '/common/culturalTourismSpot/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2033749607535542273, 1123598815738675201, 'newsCategory', '资讯分类', 'menu', '/common/newsCategory', 'iconfont iconicon_message', 15, 1, 0, 1, '', '', 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180067983362', '2033749607535542273', 'newsCategory_add', '新增', 'add', '/common/newsCategory/add', 'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180067983363', '2033749607535542273', 'newsCategory_edit', '修改', 'edit', '/common/newsCategory/edit', 'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180067983364', '2033749607535542273', 'newsCategory_delete', '删除', 'delete', '/api/common/news-category/newsCategory/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180067983365', '2033749607535542273', 'newsCategory_view', '查看', 'view', '/common/newsCategory/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2033749607929806849, 1123598815738675201, 'newsContent', '资讯内容', 'menu', '/common/newsContent', 'iconfont iconicon_message', 15, 1, 0, 1, '', '', 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180458053634', '2033749607929806849', 'newsContent_add', '新增', 'add', '/common/newsContent/add', 'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180458053635', '2033749607929806849', 'newsContent_edit', '修改', 'edit', '/common/newsContent/edit', 'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180458053636', '2033749607929806849', 'newsContent_delete', '删除', 'delete', '/api/common/news-content/newsContent/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180458053637', '2033749607929806849', 'newsContent_view', '查看', 'view', '/common/newsContent/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2034868678830284801, 1123598815738675201, 'tourProduct', '旅游团产品', 'menu', '/common/tourProduct', 'iconfont iconicon_addressbook', 16, 1, 0, 1, '', '', 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180839735298', '2034868678830284801', 'tourProduct_add', '新增', 'add', '/common/tourProduct/add', 'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180839735299', '2034868678830284801', 'tourProduct_edit', '修改', 'edit', '/common/tourProduct/edit', 'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180839735300', '2034868678830284801', 'tourProduct_delete', '删除', 'delete', '/api/common/tour-product/tourProduct/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180839735301', '2034868678830284801', 'tourProduct_view', '查看', 'view', '/common/tourProduct/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2034920957235105793, 1123598815738675201, 'commonTourProductOrder', '旅游团订单', 'menu', '/common/commonTourProductOrder', 'iconfont iconicon_addressbook', 17, 1, null, 1, null, '', 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2037361283308748801, 1123598815738675201, 'commonEcoOrder', '生态产品订单', 'menu', '/common/commonEcoOrder', 'iconfont iconicon_message', 12, 1, -1, 1, '', '', 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2037414831325212674, 0, 'upgrade', '动态升级', 'upgrade', '/upgrade', 'iconfont iconicon_message', 16, 1, null, 1, null, '', 0);
|
||||
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2037416131144216577, 2037414831325212674, 'marketUpgradeConfig', '用户升级配置', 'menu', '/market/marketUpgradeConfig', null, 1, 1, 0, 1, null, null, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120182441959427', '2037416131144216577', 'marketUpgradeConfig_add', '新增', 'add', '/market/marketUpgradeConfig/add', 'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120182441959428', '2037416131144216577', 'marketUpgradeConfig_edit', '修改', 'edit', '/market/marketUpgradeConfig/edit', 'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120182441959429', '2037416131144216577', 'marketUpgradeConfig_delete', '删除', 'delete', '/api/market/upgrade-config/marketUpgradeConfig/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120182441959430', '2037416131144216577', 'marketUpgradeConfig_view', '查看', 'view', '/market/marketUpgradeConfig/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2037416131601395714, 2037414831325212674, 'marketUpgradeCashLog', '用户现金升级日志', 'menu', '/market/marketUpgradeCashLog', null, 2, 1, 0, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2037416131991465985, 2037414831325212674, 'marketUpgradeWelfareLog', '用户福利包升级日志', 'menu', '/market/marketUpgradeWelfareLog', null, 3, 1, 0, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2037416132381536257, 2037414831325212674, 'marketCashPerformanceLog', '现金业绩日志', 'menu', '/market/marketCashPerformanceLog', null, 4, 1, 0, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2037416132771606529, 2037414831325212674, 'marketWelfarePerformanceLog', '福利包业绩日志', 'menu', '/market/marketWelfarePerformanceLog', null, 5, 1, 0, 1, null, null, 0);
|
||||
|
||||
129
doc/sql/executed/20260401_increase.sql
Normal file
129
doc/sql/executed/20260401_increase.sql
Normal file
@@ -0,0 +1,129 @@
|
||||
DROP TABLE IF EXISTS release_version CASCADE;
|
||||
CREATE TABLE release_version
|
||||
(
|
||||
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||
version_code int8 NULL, -- 内部版本号 (如: 10023)
|
||||
version_name varchar(50) NOT NULL, -- 版本显示名称 (如: 1.2.3)
|
||||
app_type int4 NOT NULL, -- 应用类型: 1-app, 2-market
|
||||
channel_code varchar(20) NOT NULL, -- 渠道标识: xiaomi, huawei, honor, oppo, vivo, apple, qihoo, yingyongbao, pgyer, official
|
||||
package_type int4 NOT NULL, -- 包类型: 1-应用市场包(含跳转链接), 2-OSS直连包(兜底)
|
||||
is_force_update int4 NOT NULL, -- 是否强制更新: 0-否, 1-是
|
||||
download_url varchar(255) NULL, -- 下载地址 (市场包通常为 schema 链接, OSS包为 http 链接)
|
||||
update_content text NOT NULL, -- 更新日志内容
|
||||
privacy_agreement_url varchar(255) NULL, -- 隐私协议地址
|
||||
user_agreement_url varchar(255) NULL, -- 用户协议地址
|
||||
create_user int8 NULL, -- 创建人ID
|
||||
create_dept int8 NULL, -- 创建部门ID
|
||||
create_time timestamp(6) NULL, -- 创建时间
|
||||
update_user int8 NULL, -- 更新人ID
|
||||
update_time timestamp(6) NULL, -- 更新时间
|
||||
status int4 NULL, -- 上架状态: 1-启用, 2-已上架, 3-已过期
|
||||
is_deleted int4 DEFAULT 0 -- 逻辑删除标识
|
||||
);
|
||||
|
||||
-- 索引顺序:app_type -> channel_code -> status -> version_code (降序)
|
||||
CREATE INDEX idx_app_channel_version ON release_version (app_type, channel_code, status, version_name DESC);
|
||||
|
||||
-- 后台管理系统页面索引
|
||||
CREATE INDEX CONCURRENTLY idx_release_version_active_semver
|
||||
ON release_version (
|
||||
(string_to_array(version_name, '.')::int[]) DESC,
|
||||
app_type,
|
||||
id DESC
|
||||
)
|
||||
WHERE is_deleted = 0
|
||||
AND version_name ~ '^\d+\.\d+\.\d+$';
|
||||
|
||||
-- 添加表注释
|
||||
COMMENT ON TABLE release_version IS 'APP版本发布管理表';
|
||||
|
||||
-- 添加字段注释 (双注释)
|
||||
COMMENT ON COLUMN release_version.id IS '主键ID';
|
||||
COMMENT ON COLUMN release_version.version_code IS '内部版本号 (如: 10023)';
|
||||
COMMENT ON COLUMN release_version.version_name IS '版本显示名称 (如: 1.2.3)';
|
||||
COMMENT ON COLUMN release_version.app_type IS '应用类型: 1-app, 2-market';
|
||||
COMMENT ON COLUMN release_version.channel_code IS '渠道标识: xiaomi, huawei, honor, oppo, vivo, apple, qihoo, yingyongbao, pgyer, official';
|
||||
COMMENT ON COLUMN release_version.package_type IS '包类型: 1-应用市场包(含跳转链接), 2-OSS直连包(兜底)';
|
||||
COMMENT ON COLUMN release_version.is_force_update IS '是否强制更新: 0-否, 1-是';
|
||||
COMMENT ON COLUMN release_version.download_url IS '下载地址 (市场包通常为 schema 链接, OSS包为 http 链接)';
|
||||
COMMENT ON COLUMN release_version.update_content IS '更新日志内容';
|
||||
COMMENT ON COLUMN release_version.privacy_agreement_url IS '隐私协议地址';
|
||||
COMMENT ON COLUMN release_version.user_agreement_url IS '用户协议地址';
|
||||
COMMENT ON COLUMN release_version.create_user IS '创建人ID';
|
||||
COMMENT ON COLUMN release_version.create_dept IS '创建部门ID';
|
||||
COMMENT ON COLUMN release_version.create_time IS '创建时间';
|
||||
COMMENT ON COLUMN release_version.update_user IS '更新人ID';
|
||||
COMMENT ON COLUMN release_version.update_time IS '更新时间';
|
||||
COMMENT ON COLUMN release_version.status IS '上架状态: 1-启用, 2-已上架, 3-已过期';
|
||||
COMMENT ON COLUMN release_version.is_deleted IS '逻辑删除标识';
|
||||
|
||||
|
||||
---------------------------------------------------- 后台菜单 ----------------------------------------------------
|
||||
INSERT INTO public.blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open,
|
||||
component, remark, is_deleted)
|
||||
VALUES (2039320381549809665, 1123598815738675201, 'commonReleaseversion', 'APP版本发布管理', 'menu',
|
||||
'/common/commonReleaseversion', null, 18, 1, 0, 1, null, null, 0);
|
||||
INSERT INTO public.blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open,
|
||||
component, remark, is_deleted)
|
||||
VALUES (2039320381549809666, 2039320381549809665, 'commonReleaseversion_add', '新增', 'add',
|
||||
'/common/commonReleaseversion/add', 'plus', 1, 2, 1, 1, null, null, 0);
|
||||
INSERT INTO public.blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open,
|
||||
component, remark, is_deleted)
|
||||
VALUES (2039320381549809667, 2039320381549809665, 'commonReleaseversion_edit', '修改', 'edit',
|
||||
'/common/commonReleaseversion/edit', 'form', 2, 2, 2, 1, null, null, 0);
|
||||
INSERT INTO public.blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open,
|
||||
component, remark, is_deleted)
|
||||
VALUES (2039320381549809668, 2039320381549809665, 'commonReleaseversion_delete', '删除', 'delete',
|
||||
'/api/common/release-version/remove', 'delete', 3, 2, 3, 1, null, null, 0);
|
||||
INSERT INTO public.blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open,
|
||||
component, remark, is_deleted)
|
||||
VALUES (2039320381549809669, 2039320381549809665, 'commonReleaseversion_view', '查看', 'view',
|
||||
'/common/commonReleaseversion/view', 'file-text', 4, 2, 2, 1, null, null, 0);
|
||||
|
||||
---------------------------------------------------- 后台配置字典 ----------------------------------------------------
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039323244292325377, 0, 'release_version_app_type', '-1', 'app版本控制应用类型', 36, '', 0, 1, 0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039323352345985025, 2039323244292325377, 'release_version_app_type', '1', 'app', 1, '', 0, 1, 0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039323392959430658, 2039323244292325377, 'release_version_app_type', '2', 'market', 2, '', 0, 1, 0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039323732928741377, 0, 'release_version_channel_code', '-1', 'app版本控制渠道标识', 37, '', 0, 1, 0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039323787798626306, 2039323732928741377, 'release_version_channel_code', 'xiaomi', '小米', 1, '', 0, 1, 0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039323843163439106, 2039323732928741377, 'release_version_channel_code', 'huawei', '华为', 2, '', 0, 1, 0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039323945001140225, 2039323732928741377, 'release_version_channel_code', 'honor', '荣耀', 3, '', 0, 1, 0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039323976445837313, 2039323732928741377, 'release_version_channel_code', 'oppo', 'oppo', 4, '', 0, 1, 0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039324008939110402, 2039323732928741377, 'release_version_channel_code', 'vivo', 'vivo', 5, '', 0, 1, 0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039324063599280129, 2039323732928741377, 'release_version_channel_code', 'apple', '苹果', 6, '', 0, 1, 0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039324159019696129, 2039323732928741377, 'release_version_channel_code', 'qihoo', '360手机助手', 7, '', 0, 1,
|
||||
0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039324367988310017, 2039323732928741377, 'release_version_channel_code', 'yingyongbao', '应用宝', 8, '', 0, 1,
|
||||
0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039324445138337793, 2039323732928741377, 'release_version_channel_code', 'pgyer', '蒲公英', 9, '', 0, 1, 0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039324932638097409, 2039323732928741377, 'release_version_channel_code', 'official', 'OSS/官网', 10, '', 0, 1,
|
||||
0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039325301409693698, 0, 'release_version_pack_type', '-1', 'app版本控制包类型', 38, '', 0, 1, 0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039325347425402882, 2039325301409693698, 'release_version_pack_type', '1', '应用市场包', 1, '', 0, 1, 0);
|
||||
INSERT INTO public.blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2039325387288068097, 2039325301409693698, 'release_version_pack_type', '2', 'OSS直连包', 2, '', 0, 1, 0);
|
||||
|
||||
INSERT INTO public.blade_dict ("id","parent_id","code","dict_key","dict_value","sort","remark","is_sealed","status","is_deleted")
|
||||
VALUES (2040296637950734337,2040296304709087233,'release_version_status','3','已过期',3,'',0,1,0);
|
||||
INSERT INTO public.blade_dict ("id","parent_id","code","dict_key","dict_value","sort","remark","is_sealed","status","is_deleted")
|
||||
VALUES (2040296582749499393,2040296304709087233,'release_version_status','2','已上架',2,'',0,1,0);
|
||||
INSERT INTO public.blade_dict ("id","parent_id","code","dict_key","dict_value","sort","remark","is_sealed","status","is_deleted")
|
||||
VALUES (2040296549660635138,2040296304709087233,'release_version_status','1','已启用',1,'',0,1,0);
|
||||
INSERT INTO public.blade_dict ("id","parent_id","code","dict_key","dict_value","sort","remark","is_sealed","status","is_deleted")
|
||||
VALUES (2040296304709087233,0,'release_version_status','-1','app版本控制上架状态',39,'',0,1,0);
|
||||
3
doc/sql/executed/user_order_update.sql
Normal file
3
doc/sql/executed/user_order_update.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
CREATE INDEX idx_user_order_search ON user_order (payment_status, order_status, payment_type, create_time);
|
||||
|
||||
update user_order set payment_status = 0 , order_status = 0 where payment_status = 2 and order_status = 5 and payment_type = 99;
|
||||
7
pom.xml
7
pom.xml
@@ -321,6 +321,13 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Source: https://mvnrepository.com/artifact/org.semver4j/semver4j -->
|
||||
<dependency>
|
||||
<groupId>org.semver4j</groupId>
|
||||
<artifactId>semver4j</artifactId>
|
||||
<version>6.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -77,8 +77,8 @@ public class JobInfoController extends BladeController {
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入jobInfo")
|
||||
public R<IPage<JobInfo>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> jobInfo, Query query) {
|
||||
IPage<JobInfo> pages = jobInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(jobInfo, JobInfo.class));
|
||||
public R<IPage<JobInfo>> list(JobInfo jobInfo, Query query) {
|
||||
IPage<JobInfo> pages = jobInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(jobInfo).orderByDesc("id"));
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,12 +65,14 @@ public class AccelUpgradeWelfareProcessor implements BasicProcessor {
|
||||
List<MarketBenefitPackageEntity> benefitPackageEntityList = benefitPackageService.list(
|
||||
Wrappers.lambdaQuery(MarketBenefitPackageEntity.class)
|
||||
.eq(MarketBenefitPackageEntity::getStatisticalDate, searchDate)
|
||||
.eq(MarketBenefitPackageEntity::getType, 1)
|
||||
.eq(MarketBenefitPackageEntity::getStatus, 2)
|
||||
.orderByAsc(MarketBenefitPackageEntity::getId)
|
||||
);
|
||||
|
||||
// 直接停止
|
||||
if (benefitPackageEntityList.isEmpty()){
|
||||
log.info("没有需要处理的用户福利包");
|
||||
log.info("searchDate : {} 没有昨日兑换的福利包" , searchDate);
|
||||
return new ProcessResult(true, "result is success");
|
||||
}
|
||||
|
||||
|
||||
@@ -48,16 +48,15 @@ public class AliUserOrderCloseProcessor implements BasicProcessor {
|
||||
Date expireTime = DateUtil.getMinutesLate(new Date(), 30);
|
||||
AliPayAccountConfig config = PaymentCache.getAliConfig();
|
||||
|
||||
int batchSize = 500; // 【优化点3】分批处理,防止内存溢出
|
||||
int currentCount = 0;
|
||||
int batchSize = 500;
|
||||
|
||||
while (true) {
|
||||
// 2. 分批查询数据库
|
||||
// 【优化点1】增加 orderByAsc 保证按时间顺序处理,增加 last("LIMIT") 限制数量
|
||||
|
||||
List<CommonUserOrderEntity> payOrderList = commonUserOrderService.list(
|
||||
Wrappers.lambdaQuery(CommonUserOrderEntity.class)
|
||||
.eq(CommonUserOrderEntity::getPaymentStatus, PaymentStatus.UNPAID.getCode()) // 确保传的是 code 值,如果是枚举对象需调整
|
||||
.eq(CommonUserOrderEntity::getPaymentStatus, PaymentStatus.UNPAID.getCode())
|
||||
.eq(CommonUserOrderEntity::getOrderStatus, OrderStatus.PENDING_PAYMENT.getCode())
|
||||
.ne(CommonUserOrderEntity::getPaymentType, PaymentType.OFFLINE.getCode()) // 只查询支付宝和微信
|
||||
.le(CommonUserOrderEntity::getCreateTime, expireTime)
|
||||
.orderByAsc(CommonUserOrderEntity::getCreateTime)
|
||||
.last("LIMIT " + batchSize)
|
||||
@@ -91,21 +90,14 @@ public class AliUserOrderCloseProcessor implements BasicProcessor {
|
||||
* 核心原则:先远程交互,成功后再开短事务更新本地
|
||||
*/
|
||||
private void processSingleOrder(CommonUserOrderEntity payOrder , AliPayAccountConfig config) {
|
||||
Long orderId = payOrder.getId();
|
||||
String orderNo = PaymentType.fromCodeOrNull(payOrder.getPaymentType()).getAbbr() + BusinessModule.fromCodeIgnoreCaseOrNull(payOrder.getOrderType()).getAbbr() + payOrder.getId();
|
||||
log.info("处理超时订单,订单号: {}", orderNo);
|
||||
if (payOrder == null) {
|
||||
log.error("关联用户订单不存在,orderId: {}", orderId);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
AlipayTradeQueryResponse response = paymentService.aliQuery(orderNo);
|
||||
log.info("查询结果: {}", response);
|
||||
|
||||
|
||||
if (response == null) {
|
||||
updateOrderToClosed(payOrder);
|
||||
commonUserOrderService.closeOrderById(payOrder.getId());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -119,26 +111,11 @@ public class AliUserOrderCloseProcessor implements BasicProcessor {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
updateOrderToClosed(payOrder);
|
||||
commonUserOrderService.closeOrderById(payOrder.getId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 事务方法:更新为关闭状态
|
||||
* 使用 update(entity, wrapper) 方式实现乐观锁检查
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateOrderToClosed( CommonUserOrderEntity userOrder) {
|
||||
// 支付单更新成功,再更新用户订单
|
||||
userOrder.setOrderStatus(OrderStatus.CLOSED_TIMEOUT.getCode());
|
||||
userOrder.setPaymentStatus(PaymentStatus.FAILED.getCode());
|
||||
// userOrder.setUpdateTime(new Date());
|
||||
commonUserOrderService.updateById(userOrder);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.core.cache.utils.CacheUtil;
|
||||
import org.springblade.modules.market.constant.BladeMarketConstant;
|
||||
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointEntity;
|
||||
@@ -14,6 +16,8 @@ import org.springblade.modules.market.service.IMarketBenefitPackageService;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPointLogService;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPointService;
|
||||
import org.springblade.modules.market.service.IMarketPackageDailySettlementService;
|
||||
import org.springblade.modules.system.pojo.entity.Param;
|
||||
import org.springblade.modules.system.service.IParamService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import tech.powerjob.worker.core.processor.ProcessResult;
|
||||
import tech.powerjob.worker.core.processor.TaskContext;
|
||||
@@ -27,6 +31,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.springblade.core.cache.constant.CacheConstant.PARAM_CACHE;
|
||||
|
||||
|
||||
/**
|
||||
* 福利包每日发放福利积分到用户
|
||||
@@ -40,6 +46,7 @@ public class BenefitPackageSendPointProcessor implements BasicProcessor {
|
||||
private final IMarketPackageDailySettlementService userPackageDailySettlementService;
|
||||
private final IMarketBenefitPointService benefitPointService;
|
||||
private final IMarketBenefitPointLogService benefitPointLogService;
|
||||
private final IParamService paramService;
|
||||
|
||||
@Override
|
||||
public ProcessResult process(TaskContext context) {
|
||||
@@ -56,6 +63,10 @@ public class BenefitPackageSendPointProcessor implements BasicProcessor {
|
||||
return new ProcessResult(false, "系统异常: " + e.getMessage());
|
||||
}
|
||||
|
||||
CacheUtil.clear(PARAM_CACHE);
|
||||
CacheUtil.clear(PARAM_CACHE, Boolean.FALSE);
|
||||
|
||||
paramService.update(Wrappers.<Param>lambdaUpdate().eq(Param::getParamKey, BladeMarketConstant.APP_BENEFIT_PACK_ALLOCATE_ENABLED).set(Param::getParamValue, Boolean.TRUE));
|
||||
// 返回结果,该结果会被持久化到数据库,在前端页面直接查看,极为方便
|
||||
return new ProcessResult(true, "result is success");
|
||||
}
|
||||
|
||||
@@ -4,10 +4,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.core.cache.utils.CacheUtil;
|
||||
import org.springblade.modules.market.constant.BladeMarketConstant;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MarketPackageDailySettlementEntity;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPackageService;
|
||||
import org.springblade.modules.market.service.IMarketPackageDailySettlementService;
|
||||
import org.springblade.modules.system.pojo.entity.Param;
|
||||
import org.springblade.modules.system.service.IParamService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import tech.powerjob.worker.core.processor.ProcessResult;
|
||||
import tech.powerjob.worker.core.processor.TaskContext;
|
||||
@@ -19,6 +23,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.springblade.core.cache.constant.CacheConstant.PARAM_CACHE;
|
||||
|
||||
/**
|
||||
* 福利包每日发放结算记录
|
||||
*/
|
||||
@@ -29,6 +35,7 @@ public class InitBenefitPackageSettlementProcessor implements BasicProcessor {
|
||||
|
||||
private final IMarketBenefitPackageService userBenefitPackageService;
|
||||
private final IMarketPackageDailySettlementService userPackageDailySettlementService;
|
||||
private final IParamService paramService;
|
||||
|
||||
@Override
|
||||
public ProcessResult process(TaskContext context) {
|
||||
@@ -36,6 +43,10 @@ public class InitBenefitPackageSettlementProcessor implements BasicProcessor {
|
||||
OmsLogger omsLogger = context.getOmsLogger(); // PowerJob 内置日志,控制台可查
|
||||
|
||||
try {
|
||||
CacheUtil.clear(PARAM_CACHE);
|
||||
CacheUtil.clear(PARAM_CACHE, Boolean.FALSE);
|
||||
|
||||
paramService.update(Wrappers.<Param>lambdaUpdate().eq(Param::getParamKey, BladeMarketConstant.APP_BENEFIT_PACK_ALLOCATE_ENABLED).set(Param::getParamValue, Boolean.TRUE));
|
||||
omsLogger.info("开始执行定时任务-初始化用户福利包每天结算记录...");
|
||||
initUserPackageDailySettlement();
|
||||
omsLogger.info("结束执行定时任务-初始化用户福利包每天结算记录");
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.springblade.job.processor;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.modules.market.pojo.entity.*;
|
||||
import org.springblade.modules.market.service.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -14,6 +16,7 @@ import java.util.List;
|
||||
/**
|
||||
* 初始化用户业绩 现金动态业绩 , 福利包动态业绩(执行一次)
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class InitUserPerformanceProcessor implements BasicProcessor {
|
||||
@@ -22,6 +25,7 @@ public class InitUserPerformanceProcessor implements BasicProcessor {
|
||||
private final IMarketInfoService marketInfoService;
|
||||
private final IMarketCashPerformanceService cashPerformanceService;
|
||||
private final IMarketWelfarePerformanceService welfarePerformanceService;
|
||||
private final IMarketWelfarePerformanceLogService welfarePerformanceLogService;
|
||||
|
||||
|
||||
|
||||
@@ -49,6 +53,21 @@ public class InitUserPerformanceProcessor implements BasicProcessor {
|
||||
welfarePerformanceService.save(welfarePerformance);
|
||||
}
|
||||
});
|
||||
log.info("初始化用户业绩成功 , 用户数量: {}" , marketInfoEntityList.size());
|
||||
welfarePerformanceService.update(
|
||||
Wrappers.lambdaUpdate(MarketWelfarePerformanceEntity.class)
|
||||
.set(MarketWelfarePerformanceEntity::getTotalAmount, BigDecimal.ZERO)
|
||||
.set(MarketWelfarePerformanceEntity::getOwenAmount, BigDecimal.ZERO)
|
||||
.set(MarketWelfarePerformanceEntity::getVersion, 1)
|
||||
.eq(MarketWelfarePerformanceEntity::getIsDeleted, 0)
|
||||
);
|
||||
|
||||
welfarePerformanceLogService.remove(
|
||||
Wrappers.lambdaUpdate(MarketWelfarePerformanceLogEntity.class)
|
||||
.eq(MarketWelfarePerformanceLogEntity::getIsDeleted, 0)
|
||||
);
|
||||
|
||||
|
||||
return new ProcessResult(true, "result is success");
|
||||
}
|
||||
|
||||
|
||||
@@ -55,11 +55,14 @@ public class StatsCalculatorWelfareProcessor implements BasicProcessor {
|
||||
List<MarketBenefitPackageEntity> benefitPackageEntityList = benefitPackageService.list(
|
||||
Wrappers.lambdaQuery(MarketBenefitPackageEntity.class)
|
||||
.eq(MarketBenefitPackageEntity::getStatisticalDate, searchDate)
|
||||
.eq(MarketBenefitPackageEntity::getType, 1)
|
||||
.eq(MarketBenefitPackageEntity::getStatus, 2)
|
||||
.orderByAsc(MarketBenefitPackageEntity::getId)
|
||||
);
|
||||
|
||||
// 直接停止
|
||||
if (benefitPackageEntityList.isEmpty()){
|
||||
log.info("searchDate : {} 没有昨日兑换的福利包" , searchDate);
|
||||
return new ProcessResult(true, "result is success");
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,10 @@ import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.redis.debounce.RedisDebounce;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.api.request.*;
|
||||
import org.springblade.modules.api.response.CheckVersionResponse;
|
||||
import org.springblade.modules.api.vo.*;
|
||||
import org.springblade.modules.common.eums.AppType;
|
||||
import org.springblade.modules.common.manager.AppCommonManager;
|
||||
import org.springblade.modules.common.pojo.vo.AppCommonRegionsInfoVO;
|
||||
import org.springblade.modules.common.service.*;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
@@ -21,22 +24,24 @@ import java.util.List;
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/app-common")
|
||||
@RequestMapping("/app/common")
|
||||
@Tag(name = "APP基础接口", description = "APP基础接口")
|
||||
public class APPCommonController {
|
||||
|
||||
private final IUserService userService;
|
||||
private final ICommonRegionsInfoService commonRegionsInfoService;
|
||||
private final ICommonTourInfoService commonTourInfoService;
|
||||
private final AppCommonManager appCommonManager;
|
||||
private final ICommonReleaseVersionService releaseVersionService;
|
||||
|
||||
/**
|
||||
* 最新版本
|
||||
*/
|
||||
@GetMapping("/latest-version")
|
||||
@GetMapping("/version")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "最新版本")
|
||||
public R<Boolean> hasChangedPassword() {
|
||||
return R.data(userService.hasChangedPassword());
|
||||
public R<CheckVersionResponse> checkVersion(String version, String brand) {
|
||||
return R.data(releaseVersionService.checkUpdate(AppType.APP.getCode(), version, brand));
|
||||
}
|
||||
|
||||
|
||||
@@ -91,5 +96,12 @@ public class APPCommonController {
|
||||
return R.data(commonTourInfoService.removeTourUserProfile(request.getIds()));
|
||||
}
|
||||
|
||||
@GetMapping("/pay-type")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "支付渠道")
|
||||
public R<List<CommonModulePayTypeApiVO>> getModulePayTypeList(@RequestParam String moduleCode) {
|
||||
return R.data(appCommonManager.getModulePayTypeList(moduleCode));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/app-eco")
|
||||
@RequestMapping("/app/eco")
|
||||
@Tag(name = "APP生态产品接口", description = "APP生态产品接口")
|
||||
public class APPEcoController {
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.springblade.modules.api.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -17,7 +16,6 @@ import org.springblade.modules.api.vo.MallProductApiVO;
|
||||
import org.springblade.modules.api.vo.MallProductDetailApiVO;
|
||||
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||
import org.springblade.modules.mall.convert.AppMallConvert;
|
||||
import org.springblade.modules.mall.pojo.entity.MallCategoryEntity;
|
||||
import org.springblade.modules.mall.service.IMallCategoryService;
|
||||
import org.springblade.modules.mall.service.IMallProductService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -27,7 +25,7 @@ import java.util.List;
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/app-mall")
|
||||
@RequestMapping("/app/mall")
|
||||
@Tag(name = "APP自营商城接口", description = "APP自营商城接口")
|
||||
public class APPMallController {
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.List;
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/app-news")
|
||||
@RequestMapping("/app/news")
|
||||
@Tag(name = "APP资讯接口", description = "APP资讯接口")
|
||||
public class APPNewsController {
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/app-store")
|
||||
@RequestMapping("/app/store")
|
||||
@Tag(name = "APP商家店铺接口", description = "APP商家店铺接口")
|
||||
public class APPStoreController {
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/app-tour")
|
||||
@RequestMapping("/app/tour")
|
||||
@Tag(name = "APP旅游团接口", description = "APP旅游团接口")
|
||||
public class APPTourController {
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/app-tourism-spot")
|
||||
@RequestMapping("/app/tourism-spot")
|
||||
@Tag(name = "APP文旅接口", description = "APP文旅接口")
|
||||
public class APPTourismSpotController {
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.List;
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/app-user")
|
||||
@RequestMapping("/app/user")
|
||||
@Tag(name = "APP用户接口", description = "APP用户接口")
|
||||
public class APPUserController {
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.springblade.modules.api.market;
|
||||
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.api.response.CheckVersionResponse;
|
||||
import org.springblade.modules.api.vo.*;
|
||||
import org.springblade.modules.common.eums.AppType;
|
||||
import org.springblade.modules.common.service.ICommonReleaseVersionService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market/common")
|
||||
@Tag(name = "APP福利包接口", description = "APP福利包接口")
|
||||
public class MarketCommonController {
|
||||
|
||||
private final ICommonReleaseVersionService releaseVersionService;
|
||||
|
||||
|
||||
/**
|
||||
* 最新版本
|
||||
*/
|
||||
@GetMapping("/version")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "最新版本")
|
||||
public R<CheckVersionResponse> checkVersion(String version, String brand) {
|
||||
return R.data(releaseVersionService.checkUpdate(AppType.MARKET.getCode(), version, brand));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,7 +24,7 @@ import java.util.List;
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market-user")
|
||||
@RequestMapping("/market/user")
|
||||
@Tag(name = "APP福利包接口", description = "APP福利包接口")
|
||||
public class MarketUserController {
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.springblade.modules.api.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class CheckVersionResponse implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Boolean needUpdate = Boolean.FALSE;
|
||||
|
||||
private Boolean isForceUpdate = Boolean.FALSE;
|
||||
|
||||
private String updateVersion;
|
||||
|
||||
private String updateContent;
|
||||
|
||||
private String url;
|
||||
|
||||
private String qihooUrl;
|
||||
|
||||
private String yingyongbaoUrl;
|
||||
|
||||
private String webDownloadUrl;
|
||||
|
||||
private String fallbackUrl;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package org.springblade.modules.common.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.common.pojo.dto.CommonReleaseVersionDTO;
|
||||
import org.springblade.modules.common.pojo.vo.CommonReleaseVersionDetailVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.common.pojo.entity.CommonReleaseVersionEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonReleaseVersionVO;
|
||||
import org.springblade.modules.common.wrapper.CommonReleaseVersionWrapper;
|
||||
import org.springblade.modules.common.service.ICommonReleaseVersionService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* APP版本发布管理 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-04-01
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("common/release-version")
|
||||
@Tag(name = "APP版本发布管理", description = "APP版本发布管理接口")
|
||||
public class CommonReleaseVersionController extends BladeController {
|
||||
|
||||
private final ICommonReleaseVersionService commonReleaseVersionService;
|
||||
|
||||
/**
|
||||
* APP版本发布管理 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commonReleaseversion")
|
||||
public R<CommonReleaseVersionVO> detail(CommonReleaseVersionEntity commonReleaseVersion) {
|
||||
CommonReleaseVersionEntity detail = commonReleaseVersionService.getOne(Condition.getQueryWrapper(commonReleaseVersion));
|
||||
return R.data(CommonReleaseVersionWrapper.build().entityVO(detail));
|
||||
}
|
||||
|
||||
/**
|
||||
* APP版本发布管理 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commonReleaseversion")
|
||||
public R<IPage<CommonReleaseVersionVO>> list(CommonReleaseVersionEntity commonReleaseVersion, Query query) {
|
||||
IPage<CommonReleaseVersionEntity> pages = commonReleaseVersionService.page(Condition.getPage(query), Condition.getQueryWrapper(commonReleaseVersion).orderByDesc("id"));
|
||||
return R.data(CommonReleaseVersionWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* APP版本发布管理 详情查询
|
||||
*/
|
||||
@GetMapping("/detail-list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "详情查询", description = "传入versionName、appType")
|
||||
public R<List<CommonReleaseVersionDetailVO>> detailList(String versionName, Integer appType) {
|
||||
return R.data(commonReleaseVersionService.selectDetaiList(versionName, appType));
|
||||
}
|
||||
|
||||
/**
|
||||
* APP版本发布管理 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commonReleaseversion")
|
||||
public R<IPage<CommonReleaseVersionVO>> page(CommonReleaseVersionVO commonReleaseVersion, Query query) {
|
||||
IPage<CommonReleaseVersionVO> pages = commonReleaseVersionService.selectCommonReleaseVersionPage(Condition.getPage(query), commonReleaseVersion);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* APP版本发布管理 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入vo")
|
||||
public R save(@Valid @RequestBody CommonReleaseVersionVO vo) {
|
||||
return R.status(commonReleaseVersionService.createVersion(vo));
|
||||
}
|
||||
|
||||
/**
|
||||
* APP版本发布管理 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commonReleaseversion")
|
||||
public R update(@Valid @RequestBody CommonReleaseVersionEntity commonReleaseVersion) {
|
||||
return R.status(commonReleaseVersionService.updateById(commonReleaseVersion));
|
||||
}
|
||||
|
||||
/**
|
||||
* APP版本发布管理 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commonReleaseversion")
|
||||
public R submit(@Valid @RequestBody CommonReleaseVersionEntity commonReleaseVersion) {
|
||||
return R.status(commonReleaseVersionService.saveOrUpdate(commonReleaseVersion));
|
||||
}
|
||||
|
||||
/**
|
||||
* APP版本发布管理 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(commonReleaseVersionService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/publish")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "上架版本")
|
||||
public R publish(@Valid @RequestBody CommonReleaseVersionDTO dto) {
|
||||
return R.status(commonReleaseVersionService.publish(dto.getId(), dto.getDownloadUrl()));
|
||||
}
|
||||
}
|
||||
@@ -114,6 +114,15 @@ public class CulturalTourismSpotController extends BladeController {
|
||||
return R.status(culturalTourismSpotService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
@PostMapping("/applyStatus")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "上下架文旅景点", description = "culturalTourismSpot.id")
|
||||
public R applyStatus(CulturalTourismSpotEntity culturalTourismSpot) {
|
||||
return R.status(culturalTourismSpotService.applyStatus(culturalTourismSpot.getId()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
private boolean isValidRating(BigDecimal rating) {
|
||||
if (rating == null) {
|
||||
return false;
|
||||
|
||||
@@ -45,7 +45,7 @@ public class MerchantFlagshipStoreController extends BladeController {
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入merchantFlagshipStore")
|
||||
public R<MerchantFlagshipStoreVO> detail(MerchantFlagshipStoreEntity merchantFlagshipStore) {
|
||||
MerchantFlagshipStoreEntity detail = merchantFlagshipStoreService.getById(merchantFlagshipStore.getId());
|
||||
MerchantFlagshipStoreEntity detail = merchantFlagshipStoreService.getByDetail(merchantFlagshipStore.getId());
|
||||
return R.data(MerchantFlagshipStoreWrapper.build().entityVO(detail));
|
||||
|
||||
}
|
||||
@@ -111,5 +111,12 @@ public class MerchantFlagshipStoreController extends BladeController {
|
||||
return R.status(merchantFlagshipStoreService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
@PostMapping("/applyStatus")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "上下架店铺", description = "merchantFlagshipStore.id")
|
||||
public R applyStatus(MerchantFlagshipStoreEntity merchantFlagshipStore) {
|
||||
return R.status(merchantFlagshipStoreService.applyStatus(merchantFlagshipStore.getId()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -108,6 +108,12 @@ public class NewsContentController extends BladeController {
|
||||
return R.status(newsContentService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
@PostMapping("/applyStatus")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "上下架资讯", description = "newsContent.id")
|
||||
public R applyStatus(NewsContentEntity newsContent) {
|
||||
return R.status(newsContentService.applyStatus(newsContent.getId()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@ import org.springblade.modules.common.pojo.vo.TourProductVO;
|
||||
import org.springblade.modules.common.wrapper.TourProductWrapper;
|
||||
import org.springblade.modules.common.service.ITourProductService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@@ -132,6 +131,12 @@ public class TourProductController extends BladeController {
|
||||
return R.status(tourProductService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
@PostMapping("/applyStatus")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "上下架旅游产品", description = "tourProduct.id")
|
||||
public R applyStatus(TourProductEntity tourProduct) {
|
||||
return R.status(tourProductService.applyStatus(tourProduct.getId()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.springblade.modules.common.convert;
|
||||
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.springblade.modules.common.eums.AppMarketChannelEnum;
|
||||
import org.springblade.modules.common.eums.VersionStatus;
|
||||
import org.springblade.modules.common.pojo.entity.CommonReleaseVersionEntity;
|
||||
|
||||
@Mapper
|
||||
public interface CommonReleaseVersionConvert {
|
||||
|
||||
CommonReleaseVersionConvert INSTANCE = Mappers.getMapper(CommonReleaseVersionConvert.class);
|
||||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
@Mapping(target = "createTime", ignore = true)
|
||||
@Mapping(target = "updateTime", ignore = true)
|
||||
@Mapping(target = "createUser", ignore = true)
|
||||
@Mapping(target = "updateUser", ignore = true)
|
||||
CommonReleaseVersionEntity copyForChannel(CommonReleaseVersionEntity source, @Context AppMarketChannelEnum channel);
|
||||
|
||||
@AfterMapping
|
||||
default void setChannelAndStatus(@MappingTarget CommonReleaseVersionEntity target,
|
||||
@Context AppMarketChannelEnum channel) {
|
||||
target.setChannelCode(channel.getCode());
|
||||
// 注意:OFFICIAL 渠道状态为 PUBLISHED,其他为 ENABLED
|
||||
if (channel == AppMarketChannelEnum.OFFICIAL) {
|
||||
target.setPackageType(2);
|
||||
target.setStatus(VersionStatus.PUBLISHED.getCode());
|
||||
} else {
|
||||
target.setPackageType(1);
|
||||
target.setDownloadUrl(null);
|
||||
target.setStatus(VersionStatus.ENABLED.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package org.springblade.modules.common.eums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum AppMarketChannelEnum {
|
||||
|
||||
XIAOMI("xiaomi", "小米应用商店"),
|
||||
HUAWEI("huawei", "华为应用市场"),
|
||||
HONOR("honor", "荣耀应用市场"),
|
||||
OPPO("oppo", "OPPO 软件商店"),
|
||||
VIVO("vivo", "vivo 应用商店"),
|
||||
APPLE("apple", "App Store"),
|
||||
QIHOO("qihoo", "360手机助手"),
|
||||
YINGYONGBAO("yingyongbao", "应用宝"),
|
||||
PGYER("pgyer", "蒲公英分发平台"),
|
||||
OFFICIAL("official", "官网/自有渠道");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
AppMarketChannelEnum(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 code 获取枚举项
|
||||
*/
|
||||
public static AppMarketChannelEnum fromCode(String code) {
|
||||
for (AppMarketChannelEnum channel : AppMarketChannelEnum.values()) {
|
||||
if (channel.code.equalsIgnoreCase(code)) {
|
||||
return channel;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown app market channel code: " + code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 code 是否有效
|
||||
*/
|
||||
public static boolean isValid(String code) {
|
||||
try {
|
||||
fromCode(code);
|
||||
return true;
|
||||
} catch (IllegalArgumentException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package org.springblade.modules.common.eums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum AppType {
|
||||
|
||||
/**
|
||||
* 亿茶一路 (App)
|
||||
*/
|
||||
APP(1, "亿茶一路"),
|
||||
|
||||
/**
|
||||
* 硒茶商汇 (Market)
|
||||
*/
|
||||
MARKET(2, "硒茶商汇");
|
||||
|
||||
/**
|
||||
* 应用类型的唯一代码值
|
||||
*/
|
||||
private final int code;
|
||||
|
||||
/**
|
||||
* 应用类型的中文描述
|
||||
*/
|
||||
private final String description;
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
*
|
||||
* @param code 类型代码
|
||||
* @param description 中文描述
|
||||
*/
|
||||
AppType(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据代码值查找对应的枚举
|
||||
*
|
||||
* @param code 应用类型代码 (1 或 2)
|
||||
* @return 对应的 AppType 枚举,如果未找到则返回 null
|
||||
*/
|
||||
public static AppType fromCode(int code) {
|
||||
for (AppType type : AppType.values()) {
|
||||
if (type.code == code) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package org.springblade.modules.common.eums;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.springblade.core.tool.utils.StringUtil;
|
||||
|
||||
@Getter
|
||||
public enum PhoneBrand {
|
||||
|
||||
/**
|
||||
* 苹果 (Apple)
|
||||
* 在 Android 设备上不会出现,但为接口统一性保留。
|
||||
* iOS 客户端可直接传 "APPLE"。
|
||||
*/
|
||||
APPLE("Apple", "苹果"),
|
||||
|
||||
/**
|
||||
* 华为 (Huawei)
|
||||
* Android Manufacturer: "HUAWEI"
|
||||
*/
|
||||
HUAWEI("HUAWEI", "华为"),
|
||||
|
||||
/**
|
||||
* 荣耀 (Honor)
|
||||
* Android Manufacturer: "HONOR"
|
||||
*/
|
||||
HONOR("HONOR", "荣耀"),
|
||||
|
||||
/**
|
||||
* 小米 (Xiaomi)
|
||||
* Android Manufacturer: "Xiaomi"
|
||||
*/
|
||||
XIAOMI("Xiaomi", "小米"),
|
||||
|
||||
/**
|
||||
* OPPO
|
||||
* Android Manufacturer: "OPPO"
|
||||
*/
|
||||
OPPO("OPPO", "OPPO"),
|
||||
|
||||
/**
|
||||
* VIVO
|
||||
* Android Manufacturer: "vivo"
|
||||
*/
|
||||
VIVO("vivo", "VIVO"),
|
||||
|
||||
/**
|
||||
* 其他品牌(兜底选项)
|
||||
*/
|
||||
OTHER("Other", "其他");
|
||||
|
||||
|
||||
/**
|
||||
* 品牌的标准英文标识(用于 API 通信、数据库存储等)
|
||||
*/
|
||||
private final String code;
|
||||
|
||||
/**
|
||||
* 品牌的中文名称
|
||||
*/
|
||||
private final String displayName;
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
*
|
||||
* @param code 品牌代码
|
||||
* @param displayName 中文显示名
|
||||
*/
|
||||
PhoneBrand(String code, String displayName) {
|
||||
this.code = code;
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据传入的品牌字符串(不区分大小写)查找对应的枚举。
|
||||
* 支持传入 {@code Build.MANUFACTURER} 的原始值或本枚举的 {@code code}。
|
||||
*
|
||||
* @param brandStr 品牌字符串,例如 "HUAWEI", "Xiaomi", "vivo" 等
|
||||
* @return 对应的 PhoneBrand 枚举,如果未找到则返回 null
|
||||
*/
|
||||
public static PhoneBrand fromString(String brandStr) {
|
||||
if (StringUtil.isBlank(brandStr)) {
|
||||
return OTHER;
|
||||
}
|
||||
String trimmed = brandStr.trim();
|
||||
String upperStr = trimmed.toUpperCase();
|
||||
for (PhoneBrand brand : PhoneBrand.values()) {
|
||||
// 跳过 OTHER 项,避免提前匹配
|
||||
if (brand == OTHER) {
|
||||
continue;
|
||||
}
|
||||
if (brand.code.equalsIgnoreCase(trimmed) ||
|
||||
brand.code.toUpperCase().equals(upperStr)) {
|
||||
return brand;
|
||||
}
|
||||
}
|
||||
return OTHER; // 未识别品牌统一归为 OTHER
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.springblade.modules.common.eums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum VersionStatus {
|
||||
ENABLED(1, "已启用"),
|
||||
PUBLISHED(2, "已上架"),
|
||||
EXPIRED(3, "已过期");
|
||||
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
VersionStatus(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public static VersionStatus fromCode(int code) {
|
||||
for (VersionStatus status : values()) {
|
||||
if (status.code == code) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package org.springblade.modules.common.mapper;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonReleaseVersionEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonReleaseVersionDetailVO;
|
||||
import org.springblade.modules.common.pojo.vo.CommonReleaseVersionVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* APP版本发布管理 Mapper 接口
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-04-01
|
||||
*/
|
||||
public interface CommonReleaseVersionMapper extends BaseMapper<CommonReleaseVersionEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param commonReleaseVersion 查询参数
|
||||
* @return List<CommonReleaseVersionVO>
|
||||
*/
|
||||
List<CommonReleaseVersionVO> selectCommonReleaseVersionPage(IPage page, CommonReleaseVersionVO commonReleaseVersion);
|
||||
|
||||
List<CommonReleaseVersionVO> selectCustomerCommonReleaseVersionPage(IPage page, CommonReleaseVersionVO commonReleaseVersion);
|
||||
|
||||
List<CommonReleaseVersionDetailVO> selectDetaiList(String versionName, Integer appType);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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.springblade.modules.common.mapper.CommonReleaseVersionMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="commonReleaseversionResultMap" type="org.springblade.modules.common.pojo.entity.CommonReleaseVersionEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="version_code" property="versionCode"/>
|
||||
<result column="version_name" property="versionName"/>
|
||||
<result column="app_type" property="appType"/>
|
||||
<result column="channel_code" property="channelCode"/>
|
||||
<result column="package_type" property="packageType"/>
|
||||
<result column="is_force_update" property="isForceUpdate"/>
|
||||
<result column="download_url" property="downloadUrl"/>
|
||||
<result column="update_content" property="updateContent"/>
|
||||
<result column="privacy_agreement_url" property="privacyAgreementUrl"/>
|
||||
<result column="user_agreement_url" property="userAgreementUrl"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectCommonReleaseVersionPage" resultMap="commonReleaseversionResultMap">
|
||||
select * from release_version where is_deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="selectCustomerCommonReleaseVersionPage" resultType="org.springblade.modules.common.pojo.vo.CommonReleaseVersionVO">
|
||||
SELECT DISTINCT ON (string_to_array(version_name, '.')::int[], app_type)
|
||||
app_type,
|
||||
version_name,
|
||||
is_force_update,
|
||||
download_url,
|
||||
privacy_agreement_url,
|
||||
user_agreement_url,
|
||||
update_content
|
||||
FROM release_version
|
||||
WHERE is_deleted = 0
|
||||
ORDER BY string_to_array(version_name, '.')::int[] DESC, app_type, id DESC
|
||||
</select>
|
||||
|
||||
<select id="selectDetaiList" resultType="org.springblade.modules.common.pojo.vo.CommonReleaseVersionDetailVO">
|
||||
select id, channel_code, download_url, status
|
||||
from release_version
|
||||
where is_deleted = 0
|
||||
and version_name = #{versionName}
|
||||
and app_type = #{appType}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -65,7 +65,7 @@
|
||||
merchant_flagship_store
|
||||
WHERE
|
||||
ST_DWithin(location, ST_SetSRID(ST_Point(#{request.longitude}, #{request.latitude}), 4326), 5000000)
|
||||
AND is_deleted = 0
|
||||
AND is_deleted = 0 and status = 1
|
||||
ORDER BY
|
||||
location <-> ST_SetSRID(ST_Point(#{request.longitude}, #{request.latitude}), 4326)
|
||||
LIMIT #{limit} OFFSET #{offset}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springblade.modules.common.pojo.entity.CommonReleaseVersionEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* APP版本发布管理 数据传输对象实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-04-01
|
||||
*/
|
||||
@Data
|
||||
public class CommonReleaseVersionDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull(message = "ID 不能为空")
|
||||
private Long id;
|
||||
|
||||
@NotBlank(message = "上架链接不能为空")
|
||||
private String downloadUrl;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package org.springblade.modules.common.pojo.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* APP版本发布管理 实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-04-01
|
||||
*/
|
||||
@Data
|
||||
@TableName("release_version")
|
||||
@Schema(description = "CommonReleaseVersion对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonReleaseVersionEntity extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 内部版本号 (如: 10023)
|
||||
*/
|
||||
@Schema(description = "内部版本号 (如: 10023)")
|
||||
private Integer versionCode;
|
||||
/**
|
||||
* 版本显示名称 (如: 1.2.3)
|
||||
*/
|
||||
@Schema(description = "版本显示名称 (如: 1.2.3)")
|
||||
private String versionName;
|
||||
/**
|
||||
* 应用类型: 1-app, 2-market
|
||||
*/
|
||||
@Schema(description = "应用类型: 1-app, 2-market")
|
||||
private Integer appType;
|
||||
/**
|
||||
* 渠道标识: xiaomi, huawei, honor, oppo, vivo, apple, qihoo, yingyongbao, pgyer, official
|
||||
*/
|
||||
@Schema(description = "渠道标识: xiaomi, huawei, honor, oppo, vivo, apple, qihoo, yingyongbao, pgyer, official")
|
||||
private String channelCode;
|
||||
/**
|
||||
* 包类型: 1-应用市场包(含跳转链接), 2-OSS直连包(兜底)
|
||||
*/
|
||||
@Schema(description = "包类型: 1-应用市场包(含跳转链接), 2-OSS直连包(兜底)")
|
||||
private Integer packageType;
|
||||
/**
|
||||
* 是否强制更新: 0-否, 1-是
|
||||
*/
|
||||
@Schema(description = "是否强制更新: 0-否, 1-是")
|
||||
private Integer isForceUpdate;
|
||||
/**
|
||||
* 下载地址 (市场包通常为 schema 链接, OSS包为 http 链接)
|
||||
*/
|
||||
@Schema(description = "下载地址 (市场包通常为 schema 链接, OSS包为 http 链接)")
|
||||
private String downloadUrl;
|
||||
/**
|
||||
* 更新日志内容
|
||||
*/
|
||||
@Schema(description = "更新日志内容")
|
||||
private String updateContent;
|
||||
/**
|
||||
* 隐私协议地址
|
||||
*/
|
||||
@Schema(description = "隐私协议地址")
|
||||
private String privacyAgreementUrl;
|
||||
/**
|
||||
* 用户协议地址
|
||||
*/
|
||||
@Schema(description = "用户协议地址")
|
||||
private String userAgreementUrl;
|
||||
|
||||
}
|
||||
@@ -43,10 +43,11 @@ public class MerchantFlagshipStoreEntity extends BaseEntity {
|
||||
*/
|
||||
@Schema(description = "地址id")
|
||||
private Long regionsId;
|
||||
private String regionName;
|
||||
/**
|
||||
* 完整详细地址文本
|
||||
* 详细地址
|
||||
*/
|
||||
@Schema(description = "完整详细地址文本")
|
||||
@Schema(description = "详细地址")
|
||||
private String fullAddress;
|
||||
/**
|
||||
* 地理坐标 POINT(经度,纬度),用于地图定位和距离计算
|
||||
@@ -87,6 +88,10 @@ public class MerchantFlagshipStoreEntity extends BaseEntity {
|
||||
@Schema(description = "商家详细介绍")
|
||||
private String storeDescription;
|
||||
|
||||
private Long provinceId;
|
||||
|
||||
private Long cityId;
|
||||
|
||||
|
||||
public void setLocation(double longitude, double latitude) {
|
||||
this.location = new org.locationtech.jts.geom.GeometryFactory()
|
||||
|
||||
@@ -131,5 +131,10 @@ public class TourProductEntity extends BaseEntity {
|
||||
@Schema(description = "评分,范围0.00~5.00")
|
||||
private BigDecimal rating;
|
||||
|
||||
private Long provinceId;
|
||||
|
||||
private Long cityId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.vo;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* APP版本发布管理 视图实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-04-01
|
||||
*/
|
||||
@Data
|
||||
public class CommonReleaseVersionDetailVO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private String channelCode;
|
||||
|
||||
private String downloadUrl;
|
||||
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.vo;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* APP版本发布管理 视图实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-04-01
|
||||
*/
|
||||
@Data
|
||||
public class CommonReleaseVersionVO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotEmpty
|
||||
private String versionName;
|
||||
|
||||
@NotNull
|
||||
private Integer appType;
|
||||
|
||||
@NotNull
|
||||
private Integer isForceUpdate;
|
||||
|
||||
@NotEmpty
|
||||
private String updateContent;
|
||||
|
||||
private String privacyAgreementUrl;
|
||||
|
||||
private String userAgreementUrl;
|
||||
|
||||
@NotEmpty
|
||||
private String downloadUrl;
|
||||
|
||||
private String dispatchUrl;
|
||||
|
||||
private String dispatchTargetVersion;
|
||||
|
||||
}
|
||||
@@ -17,7 +17,6 @@ import org.springblade.modules.common.pojo.entity.MerchantFlagshipStoreEntity;
|
||||
public class MerchantFlagshipStoreVO extends MerchantFlagshipStoreEntity {
|
||||
|
||||
|
||||
private Long area;
|
||||
private String addressDetail;
|
||||
|
||||
}
|
||||
|
||||
@@ -42,6 +42,4 @@ public class TourProductVO extends TourProductEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long city;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.springblade.modules.common.service;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springblade.modules.api.response.CheckVersionResponse;
|
||||
import org.springblade.modules.common.pojo.entity.CommonReleaseVersionEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonReleaseVersionDetailVO;
|
||||
import org.springblade.modules.common.pojo.vo.CommonReleaseVersionVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* APP版本发布管理 服务类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-04-01
|
||||
*/
|
||||
public interface ICommonReleaseVersionService extends BaseService<CommonReleaseVersionEntity> {
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param commonReleaseVersion 查询参数
|
||||
* @return IPage<CommonReleaseVersionVO>
|
||||
*/
|
||||
IPage<CommonReleaseVersionVO> selectCommonReleaseVersionPage(IPage<CommonReleaseVersionVO> page, CommonReleaseVersionVO commonReleaseVersion);
|
||||
|
||||
|
||||
boolean applyStatus(Long id);
|
||||
|
||||
CheckVersionResponse checkUpdate(Integer type, String version, String brand);
|
||||
|
||||
boolean createVersion(CommonReleaseVersionVO vo);
|
||||
|
||||
List<CommonReleaseVersionDetailVO> selectDetaiList(String versionName, Integer appType);
|
||||
|
||||
boolean publish(Long id, String downloadUrl);
|
||||
}
|
||||
@@ -103,4 +103,6 @@ public interface ICommonUserOrderService extends IService<CommonUserOrderEntity>
|
||||
|
||||
|
||||
boolean confirmItinerary(Long id);
|
||||
|
||||
boolean closeOrderById(Long id);
|
||||
}
|
||||
|
||||
@@ -32,4 +32,5 @@ public interface ICulturalTourismSpotService extends BaseService<CulturalTourism
|
||||
CommonTourismSpotDetailApiVO tourismSpotDetail(@NotNull(message = "无效景点") Long id);
|
||||
|
||||
|
||||
boolean applyStatus(Long id);
|
||||
}
|
||||
|
||||
@@ -37,4 +37,8 @@ public interface IMerchantFlagshipStoreService extends BaseService<MerchantFlags
|
||||
IPage<CommonMerchantStoreApiVO> merchantStoreList(MerchantStoreRequest request , IPage<CommonMerchantStoreApiVO> page);
|
||||
|
||||
CommonMerchantStoreDetailApiVO merchantStoreDetail(@NotNull(message = "无效店铺") Long id);
|
||||
|
||||
MerchantFlagshipStoreEntity getByDetail(Long id);
|
||||
|
||||
boolean applyStatus(Long id);
|
||||
}
|
||||
|
||||
@@ -29,4 +29,6 @@ public interface INewsContentService extends BaseService<NewsContentEntity> {
|
||||
IPage<CommonNewsContentApiVO> newsCategoryList(IPage<CommonNewsContentApiVO> page , Long categoryId);
|
||||
|
||||
CommonNewsContentDetailApiVO newsContentDetail(@NotNull(message = "无效资讯") Long id);
|
||||
|
||||
boolean applyStatus(Long id);
|
||||
}
|
||||
|
||||
@@ -38,4 +38,6 @@ public interface ITourProductService extends BaseService<TourProductEntity> {
|
||||
IPage<CommonTourProductApiVO> tourProductTopList(IPage<CommonTourProductApiVO> page, TourProductRequest request);
|
||||
|
||||
CommonTourProductDetailApiVO tourProductDetail(@NotNull(message = "无效旅游团") Long id);
|
||||
|
||||
boolean applyStatus(Long id);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
package org.springblade.modules.common.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import jakarta.validation.Valid;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
import org.semver4j.Semver;
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.core.tool.utils.StringUtil;
|
||||
import org.springblade.modules.api.response.CheckVersionResponse;
|
||||
import org.springblade.modules.common.convert.CommonReleaseVersionConvert;
|
||||
import org.springblade.modules.common.eums.AppMarketChannelEnum;
|
||||
import org.springblade.modules.common.eums.AppType;
|
||||
import org.springblade.modules.common.eums.PhoneBrand;
|
||||
import org.springblade.modules.common.eums.VersionStatus;
|
||||
import org.springblade.modules.common.pojo.entity.CommonReleaseVersionEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonReleaseVersionDetailVO;
|
||||
import org.springblade.modules.common.pojo.vo.CommonReleaseVersionVO;
|
||||
import org.springblade.modules.common.mapper.CommonReleaseVersionMapper;
|
||||
import org.springblade.modules.common.service.ICommonReleaseVersionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* APP版本发布管理 服务实现类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-04-01
|
||||
*/
|
||||
@Service
|
||||
public class CommonReleaseVersionServiceImpl extends BaseServiceImpl<CommonReleaseVersionMapper, CommonReleaseVersionEntity> implements ICommonReleaseVersionService {
|
||||
|
||||
@Override
|
||||
public IPage<CommonReleaseVersionVO> selectCommonReleaseVersionPage(IPage<CommonReleaseVersionVO> page, CommonReleaseVersionVO commonReleaseVersion) {
|
||||
return page.setRecords(baseMapper.selectCustomerCommonReleaseVersionPage(page, commonReleaseVersion));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applyStatus(Long id) {
|
||||
CommonReleaseVersionEntity releaseVersion = getById(id);
|
||||
if (releaseVersion == null) {
|
||||
throw new ServiceException("无效版本信息");
|
||||
}
|
||||
releaseVersion.setStatus(Math.abs(releaseVersion.getStatus() - 1));
|
||||
return updateById(releaseVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CheckVersionResponse checkUpdate(Integer type, String version, String brand) {
|
||||
CheckVersionResponse response = new CheckVersionResponse();
|
||||
List<CommonReleaseVersionEntity> list = list(Wrappers.lambdaQuery(CommonReleaseVersionEntity.class)
|
||||
.eq(CommonReleaseVersionEntity::getAppType, type)
|
||||
.gt(CommonReleaseVersionEntity::getVersionCode, convertVersionNameToVersionCode(version))
|
||||
.in(CommonReleaseVersionEntity::getChannelCode, List.of(PhoneBrand.fromString(brand).getCode(), AppMarketChannelEnum.PGYER.getCode(), AppMarketChannelEnum.QIHOO.getCode(), AppMarketChannelEnum.YINGYONGBAO.getCode(), AppMarketChannelEnum.OFFICIAL.getCode()))
|
||||
.eq(CommonReleaseVersionEntity::getStatus, VersionStatus.PUBLISHED.getCode())
|
||||
.eq(CommonReleaseVersionEntity::getIsDeleted, 0)
|
||||
.orderByDesc(CommonReleaseVersionEntity::getVersionCode)
|
||||
);
|
||||
if (!list.isEmpty()) {
|
||||
boolean f = false;
|
||||
CommonReleaseVersionEntity newest = list.get(0);
|
||||
response.setNeedUpdate(Boolean.TRUE);
|
||||
response.setUpdateVersion(newest.getVersionName());
|
||||
response.setUpdateContent(newest.getUpdateContent());
|
||||
int code = newest.getVersionCode();
|
||||
List<CommonReleaseVersionEntity> newestList = new ArrayList<>();
|
||||
for (CommonReleaseVersionEntity entity : list) {
|
||||
if (!f && Objects.equals(entity.getIsForceUpdate(), 1)) {
|
||||
f = true;
|
||||
}
|
||||
if (entity.getVersionCode() == code) {
|
||||
newestList.add(entity);
|
||||
}
|
||||
}
|
||||
for (CommonReleaseVersionEntity entity : newestList) {
|
||||
if (PhoneBrand.fromString(brand).getCode().equalsIgnoreCase(entity.getChannelCode())) {
|
||||
response.setUrl(entity.getDownloadUrl());
|
||||
}
|
||||
if (AppMarketChannelEnum.QIHOO.getCode().equalsIgnoreCase(entity.getChannelCode())) {
|
||||
response.setQihooUrl(entity.getDownloadUrl());
|
||||
}
|
||||
if (AppMarketChannelEnum.YINGYONGBAO.getCode().equalsIgnoreCase(entity.getChannelCode())) {
|
||||
response.setYingyongbaoUrl(entity.getDownloadUrl());
|
||||
}
|
||||
if (AppMarketChannelEnum.PGYER.getCode().equalsIgnoreCase(entity.getChannelCode())) {
|
||||
response.setWebDownloadUrl(entity.getDownloadUrl());
|
||||
}
|
||||
if (AppMarketChannelEnum.OFFICIAL.getCode().equalsIgnoreCase(entity.getChannelCode())) {
|
||||
response.setFallbackUrl(entity.getDownloadUrl());
|
||||
}
|
||||
}
|
||||
response.setIsForceUpdate(f);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean createVersion(CommonReleaseVersionVO vo) {
|
||||
AppType appType = AppType.fromCode(vo.getAppType());
|
||||
if (appType == null) {
|
||||
throw new ServiceException("无效类型");
|
||||
}
|
||||
Semver semver = new Semver(vo.getVersionName());
|
||||
CommonReleaseVersionEntity current = baseMapper.selectOne(
|
||||
Wrappers.lambdaQuery(CommonReleaseVersionEntity.class)
|
||||
.eq(CommonReleaseVersionEntity::getAppType, vo.getAppType())
|
||||
.ne(CommonReleaseVersionEntity::getStatus, VersionStatus.EXPIRED.getCode())
|
||||
.orderByDesc(CommonReleaseVersionEntity::getId)
|
||||
.last("LIMIT 1")
|
||||
);
|
||||
|
||||
if (current != null) {
|
||||
Semver currentSemver = new Semver(current.getVersionName());
|
||||
if (currentSemver.isGreaterThanOrEqualTo(semver)) {
|
||||
throw new ServiceException("当前版本号过小");
|
||||
}
|
||||
}
|
||||
List<CommonReleaseVersionEntity> versionList = new ArrayList<>();
|
||||
CommonReleaseVersionEntity officialVersion = getCommonReleaseVersionEntity(vo);
|
||||
versionList.add(officialVersion);
|
||||
versionList.add(getCopyByChannel(officialVersion, AppMarketChannelEnum.PGYER));
|
||||
|
||||
if (vo.getAppType().equals(AppType.APP.getCode())) {
|
||||
Arrays.stream(AppMarketChannelEnum.values()).filter(channel -> channel != AppMarketChannelEnum.PGYER && channel != AppMarketChannelEnum.OFFICIAL).forEach(channel -> {
|
||||
versionList.add(getCopyByChannel(officialVersion, channel));
|
||||
});
|
||||
}
|
||||
|
||||
return saveBatch(versionList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonReleaseVersionDetailVO> selectDetaiList(String versionName, Integer appType) {
|
||||
return baseMapper.selectDetaiList(versionName, appType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean publish(Long id, String downloadUrl) {
|
||||
if (id == null || StringUtil.isBlank(downloadUrl)) {
|
||||
throw new IllegalArgumentException("ID 和下载链接不能为空");
|
||||
}
|
||||
|
||||
CommonReleaseVersionEntity existing = getById(id);
|
||||
if (existing == null) {
|
||||
throw new ServiceException("版本不存在");
|
||||
}
|
||||
if (VersionStatus.PUBLISHED.getCode() == existing.getStatus()) {
|
||||
throw new ServiceException("版本已上架,不可重复操作");
|
||||
}
|
||||
|
||||
if (StringUtil.isBlank(downloadUrl)) {
|
||||
throw new ServiceException("下载链接不能为空");
|
||||
}
|
||||
existing.setDownloadUrl(downloadUrl);
|
||||
existing.setStatus(VersionStatus.PUBLISHED.getCode());
|
||||
return updateById(existing);
|
||||
}
|
||||
|
||||
private static CommonReleaseVersionEntity getCommonReleaseVersionEntity(CommonReleaseVersionVO vo) {
|
||||
CommonReleaseVersionEntity entity = new CommonReleaseVersionEntity();
|
||||
// 手动设 VO 特有字段(或也可用另一个 MapStruct VO->Entity)
|
||||
entity.setVersionCode(convertVersionNameToVersionCode(vo.getVersionName()));
|
||||
entity.setVersionName(vo.getVersionName());
|
||||
entity.setAppType(vo.getAppType());
|
||||
entity.setPrivacyAgreementUrl(vo.getPrivacyAgreementUrl());
|
||||
entity.setUserAgreementUrl(vo.getUserAgreementUrl());
|
||||
entity.setIsForceUpdate(vo.getIsForceUpdate());
|
||||
entity.setUpdateContent(vo.getUpdateContent());
|
||||
entity.setDownloadUrl(vo.getDownloadUrl());
|
||||
// 使用 MapStruct 设置渠道和状态
|
||||
return CommonReleaseVersionConvert.INSTANCE.copyForChannel(entity, AppMarketChannelEnum.OFFICIAL);
|
||||
}
|
||||
|
||||
private static CommonReleaseVersionEntity getCopyByChannel(CommonReleaseVersionEntity entity, AppMarketChannelEnum channel) {
|
||||
return CommonReleaseVersionConvert.INSTANCE.copyForChannel(entity, channel);
|
||||
}
|
||||
|
||||
private static Integer convertVersionNameToVersionCode(String versionName) {
|
||||
Semver semver = new Semver(versionName);
|
||||
return semver.getMajor() * 1000000 + semver.getMinor() * 1000 + semver.getPatch();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -185,9 +185,7 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
public CreateOrderResponse createMallOrder(CreateMallOrderRequest request) {
|
||||
BigDecimal discount = BigDecimal.ZERO;
|
||||
String orderType = request.getOrderType().toUpperCase();
|
||||
if (!request.getIsOfflinePayment()) {
|
||||
discount = BigDecimal.valueOf(new Random().nextInt(99) + 1, 2);
|
||||
}
|
||||
|
||||
if (!BusinessModule.fromCodeIgnoreCaseOrNull(orderType).equals(BusinessModule.SELF_OPERATED_MALL)) {
|
||||
throw new ServiceException("无效业务订单");
|
||||
}
|
||||
@@ -201,6 +199,12 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
|
||||
MallProductEntity product = productService.getById(Long.valueOf(request.getItemCode()));
|
||||
Assert.notNull(product, "无效商品");
|
||||
if (product.getStatus() != 1) {
|
||||
throw new ServiceException("商品已下架");
|
||||
}
|
||||
if (!request.getIsOfflinePayment() && product.getRetailPrice().compareTo(BigDecimal.ONE) > 0) {
|
||||
discount = BigDecimal.valueOf(new Random().nextInt(99) + 1, 2);
|
||||
}
|
||||
CommonUserOrderEntity order = AppCommonConvert.INSTANCE.convertMallProductToOrder(request, product);
|
||||
BigDecimal totalAmount = product.getRetailPrice().multiply(BigDecimal.valueOf(request.getQuantity())).setScale(2, RoundingMode.DOWN);
|
||||
BigDecimal actualAmount = totalAmount.subtract(discount);
|
||||
@@ -209,7 +213,7 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
order.setTotalAmount(totalAmount);
|
||||
order.setActualAmount(actualAmount);
|
||||
order.setOrderType(orderType);
|
||||
order.setPaymentType(request.getIsOfflinePayment() ? request.getPaymentType() : null);
|
||||
order.setPaymentType(request.getPaymentType());
|
||||
order.setCreateTime(new Date());
|
||||
this.save(order);
|
||||
return new CreateOrderResponse(String.valueOf(order.getId()), actualAmount, totalAmount, discount);
|
||||
@@ -259,8 +263,6 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int selectedCount = travelerIds.size();
|
||||
// 使用 Optional 处理数据库中可能为 NULL 的最大/最小人数限制
|
||||
int minPeople = Optional.ofNullable(tourProduct.getMinPeople()).orElse(1);
|
||||
@@ -309,7 +311,6 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
}
|
||||
|
||||
|
||||
|
||||
BigDecimal actualAmount = totalAmount.subtract(discount);
|
||||
if (actualAmount.compareTo(BigDecimal.ZERO) < 0) {
|
||||
actualAmount = BigDecimal.ZERO; // 防止实付金额为负
|
||||
@@ -351,8 +352,6 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<CommonUserOrderApiVO> selectOrderApiPage(IPage<CommonUserOrderApiVO> page, CommonUserOrderApiVO userOrder) {
|
||||
CommonUserOrderEntity entity = new CommonUserOrderEntity();
|
||||
@@ -511,6 +510,9 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
|
||||
MallProductEntity product = productService.getById(Long.valueOf(request.getItemCode()));
|
||||
Assert.notNull(product, "无效商品");
|
||||
if (product.getStatus() != 1){
|
||||
throw new ServiceException("商品已下架");
|
||||
}
|
||||
CommonUserOrderEntity order = AppCommonConvert.INSTANCE.convertMallProductToOrder(request, product);
|
||||
BigDecimal totalAmount = product.getRetailPrice().multiply(BigDecimal.valueOf(request.getQuantity())).setScale(2, RoundingMode.DOWN);
|
||||
BigDecimal actualAmount = totalAmount.subtract(discount);
|
||||
@@ -519,7 +521,7 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
order.setTotalAmount(totalAmount);
|
||||
order.setActualAmount(actualAmount);
|
||||
order.setOrderType(orderType);
|
||||
order.setPaymentType(request.getIsOfflinePayment() ? request.getPaymentType() : null);
|
||||
order.setPaymentType(request.getPaymentType());
|
||||
order.setCreateTime(new Date());
|
||||
this.save(order);
|
||||
return new CreateOrderResponse(String.valueOf(order.getId()), actualAmount, totalAmount, discount);
|
||||
@@ -589,6 +591,25 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
return true;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean closeOrderById(Long id) {
|
||||
CommonUserOrderEntity userOrder = getById(id);
|
||||
if (userOrder == null) {
|
||||
throw new ServiceException("无效订单");
|
||||
}
|
||||
if (userOrder.getOrderStatus().equals(OrderStatus.CLOSED_TIMEOUT.getCode())) {
|
||||
return true;
|
||||
}
|
||||
if (userOrder.getPaymentStatus().equals(PaymentStatus.FAILED.getCode())) {
|
||||
return true;
|
||||
}
|
||||
userOrder.setOrderStatus(OrderStatus.CLOSED_TIMEOUT.getCode());
|
||||
userOrder.setPaymentStatus(PaymentStatus.FAILED.getCode());
|
||||
return updateById(userOrder);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void validateCertificates(CommonTourInfoEntity traveler, TourProductEntity product) {
|
||||
String name = Optional.ofNullable(traveler.getUserName()).orElse("未知用户");
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.springblade.modules.common.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.modules.api.vo.CommonTourismSpotApiVO;
|
||||
import org.springblade.modules.api.vo.CommonTourismSpotDetailApiVO;
|
||||
import org.springblade.modules.common.convert.CommonTourismSpotConvert;
|
||||
@@ -39,6 +40,7 @@ public class CulturalTourismSpotServiceImpl extends BaseServiceImpl<CulturalTour
|
||||
CulturalTourismSpotEntity::getThumbnailUrl,
|
||||
CulturalTourismSpotEntity::getSummary)
|
||||
.eq(CulturalTourismSpotEntity::getIsRecommended, 0)
|
||||
.eq(CulturalTourismSpotEntity::getStatus, 1)
|
||||
.orderByDesc(CulturalTourismSpotEntity::getVisitCount)
|
||||
|
||||
);
|
||||
@@ -58,6 +60,7 @@ public class CulturalTourismSpotServiceImpl extends BaseServiceImpl<CulturalTour
|
||||
CulturalTourismSpotEntity::getThumbnailUrl,
|
||||
CulturalTourismSpotEntity::getSummary)
|
||||
.eq(CulturalTourismSpotEntity::getIsRecommended, 1)
|
||||
.eq(CulturalTourismSpotEntity::getStatus, 1)
|
||||
.orderByDesc(CulturalTourismSpotEntity::getVisitCount)
|
||||
|
||||
);
|
||||
@@ -71,7 +74,15 @@ public class CulturalTourismSpotServiceImpl extends BaseServiceImpl<CulturalTour
|
||||
return CommonTourismSpotConvert.INSTANCE.convertTourismSpotDetailApiVO(tourismSpot);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applyStatus(Long id) {
|
||||
CulturalTourismSpotEntity tourismSpot = getById(id);
|
||||
if (tourismSpot == null){
|
||||
throw new ServiceException("无效文旅景点");
|
||||
}
|
||||
tourismSpot.setStatus(Math.abs(tourismSpot.getStatus() - 1));
|
||||
return updateById(tourismSpot);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.springblade.modules.common.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -42,11 +44,11 @@ public class MerchantFlagshipStoreServiceImpl extends BaseServiceImpl<MerchantFl
|
||||
|
||||
@Override
|
||||
public boolean saveStore(MerchantFlagshipStoreVO storeVO) {
|
||||
if (storeVO.getArea() == null){
|
||||
if (storeVO.getRegionsId() == null){
|
||||
throw new ServiceException("请选择地址");
|
||||
}
|
||||
|
||||
CommonRegionsInfoEntity regionsInfo = commonRegionsInfoService.getById(storeVO.getArea());
|
||||
CommonRegionsInfoEntity regionsInfo = commonRegionsInfoService.getById(storeVO.getRegionsId());
|
||||
if (regionsInfo == null){
|
||||
throw new ServiceException("请选择正确的地址");
|
||||
}
|
||||
@@ -57,7 +59,10 @@ public class MerchantFlagshipStoreServiceImpl extends BaseServiceImpl<MerchantFl
|
||||
|
||||
store.setLocation(locationDTO.getLongitude() , locationDTO.getLatitude());
|
||||
store.setRegionsId(regionsInfo.getId());
|
||||
store.setFullAddress(regionsInfo.getFullName() + storeVO.getAddressDetail());
|
||||
store.setProvinceId(storeVO.getProvinceId());
|
||||
store.setCityId(storeVO.getCityId());
|
||||
store.setFullAddress( storeVO.getFullAddress());
|
||||
store.setRegionName( regionsInfo.getFullName());
|
||||
|
||||
store.setStoreName(storeVO.getStoreName());
|
||||
store.setContactPhone(storeVO.getContactPhone());
|
||||
@@ -74,11 +79,11 @@ public class MerchantFlagshipStoreServiceImpl extends BaseServiceImpl<MerchantFl
|
||||
|
||||
@Override
|
||||
public boolean updateStore(MerchantFlagshipStoreVO storeVO) {
|
||||
if (storeVO.getArea() == null) {
|
||||
if (storeVO.getRegionsId() == null) {
|
||||
throw new ServiceException("请选择地址");
|
||||
}
|
||||
|
||||
CommonRegionsInfoEntity regionsInfo = commonRegionsInfoService.getById(storeVO.getArea());
|
||||
CommonRegionsInfoEntity regionsInfo = commonRegionsInfoService.getById(storeVO.getRegionsId());
|
||||
if (regionsInfo == null) {
|
||||
throw new ServiceException("请选择正确的地址");
|
||||
}
|
||||
@@ -89,7 +94,10 @@ public class MerchantFlagshipStoreServiceImpl extends BaseServiceImpl<MerchantFl
|
||||
|
||||
store.setLocation(locationDTO.getLongitude(), locationDTO.getLatitude());
|
||||
store.setRegionsId(regionsInfo.getId());
|
||||
store.setFullAddress(regionsInfo.getFullName() + storeVO.getAddressDetail());
|
||||
store.setProvinceId(storeVO.getProvinceId());
|
||||
store.setCityId(storeVO.getCityId());
|
||||
store.setFullAddress( storeVO.getFullAddress());
|
||||
store.setRegionName( regionsInfo.getFullName());
|
||||
|
||||
store.setId(storeVO.getId());
|
||||
store.setStoreName(storeVO.getStoreName());
|
||||
@@ -129,5 +137,48 @@ public class MerchantFlagshipStoreServiceImpl extends BaseServiceImpl<MerchantFl
|
||||
return this.baseMapper.merchantStoreDetail(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MerchantFlagshipStoreEntity getByDetail(Long id) {
|
||||
return getOne(
|
||||
new LambdaQueryWrapper<MerchantFlagshipStoreEntity>()
|
||||
.select(MerchantFlagshipStoreEntity::getId,
|
||||
MerchantFlagshipStoreEntity::getStoreName,
|
||||
MerchantFlagshipStoreEntity::getContactPhone,
|
||||
MerchantFlagshipStoreEntity::getThumbnailUrl,
|
||||
MerchantFlagshipStoreEntity::getMainImageUrl,
|
||||
MerchantFlagshipStoreEntity::getDetailImages,
|
||||
MerchantFlagshipStoreEntity::getBusinessHours,
|
||||
MerchantFlagshipStoreEntity::getStoreDescription,
|
||||
MerchantFlagshipStoreEntity::getRegionsId,
|
||||
MerchantFlagshipStoreEntity::getProvinceId,
|
||||
MerchantFlagshipStoreEntity::getCityId,
|
||||
MerchantFlagshipStoreEntity::getFullAddress,
|
||||
MerchantFlagshipStoreEntity::getRegionName
|
||||
)
|
||||
.eq(MerchantFlagshipStoreEntity::getId, id)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applyStatus(Long id) {
|
||||
|
||||
MerchantFlagshipStoreEntity merchantFlagshipStore = getOne(
|
||||
Wrappers.lambdaQuery(MerchantFlagshipStoreEntity.class)
|
||||
.select(MerchantFlagshipStoreEntity::getId, MerchantFlagshipStoreEntity::getStatus)
|
||||
.eq(MerchantFlagshipStoreEntity::getId, id)
|
||||
);
|
||||
|
||||
if (merchantFlagshipStore == null) {
|
||||
throw new ServiceException("无效店铺");
|
||||
}
|
||||
int status = Math.abs(merchantFlagshipStore.getStatus() - 1);
|
||||
return update(
|
||||
Wrappers.lambdaUpdate(MerchantFlagshipStoreEntity.class)
|
||||
.eq(MerchantFlagshipStoreEntity::getId, id)
|
||||
.set(MerchantFlagshipStoreEntity::getStatus, status)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ public class NewsCategoryServiceImpl extends BaseServiceImpl<NewsCategoryMapper,
|
||||
|
||||
List<NewsCategoryEntity> categoryList = list(
|
||||
Wrappers.lambdaQuery(NewsCategoryEntity.class)
|
||||
.eq(NewsCategoryEntity::getStatus, 1)
|
||||
.orderByDesc(NewsCategoryEntity::getIsTop)
|
||||
.orderByDesc(NewsCategoryEntity::getSortOrder)
|
||||
.orderByDesc(NewsCategoryEntity::getCreateTime)
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.springblade.modules.common.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.modules.api.vo.CommonNewsCategoryApiVO;
|
||||
import org.springblade.modules.api.vo.CommonNewsContentApiVO;
|
||||
import org.springblade.modules.api.vo.CommonNewsContentDetailApiVO;
|
||||
@@ -48,6 +49,7 @@ public class NewsContentServiceImpl extends BaseServiceImpl<NewsContentMapper, N
|
||||
NewsContentEntity::getCreateTime
|
||||
)
|
||||
.eq(categoryId != null ,NewsContentEntity::getCategoryId, categoryId)
|
||||
.eq(NewsContentEntity::getStatus, 1)
|
||||
.orderByDesc(NewsContentEntity::getIsFeatured)
|
||||
.orderByDesc(NewsContentEntity::getSortOrder)
|
||||
.orderByDesc(NewsContentEntity::getCreateTime)
|
||||
@@ -61,5 +63,15 @@ public class NewsContentServiceImpl extends BaseServiceImpl<NewsContentMapper, N
|
||||
return CommonNewsContentConvert.INSTANCE.convertNewsContentDetailApiVO(newsContent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applyStatus(Long id) {
|
||||
NewsContentEntity newsContent = getById(id);
|
||||
if (newsContent == null){
|
||||
throw new ServiceException("无效资讯信息");
|
||||
}
|
||||
newsContent.setStatus(Math.abs(newsContent.getStatus() - 1));
|
||||
return updateById(newsContent);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -47,11 +47,11 @@ public class TourProductServiceImpl extends BaseServiceImpl<TourProductMapper, T
|
||||
throw new ServiceException("评分在0.1在5.0之间");
|
||||
}
|
||||
|
||||
if (tourProduct.getCity() == null){
|
||||
if (tourProduct.getCityId() == null){
|
||||
throw new ServiceException("请选择地址");
|
||||
}
|
||||
|
||||
CommonRegionsInfoEntity regionsInfo = commonRegionsInfoService.getById(tourProduct.getCity());
|
||||
CommonRegionsInfoEntity regionsInfo = commonRegionsInfoService.getById(tourProduct.getCityId());
|
||||
if (regionsInfo == null){
|
||||
throw new ServiceException("请选择正确的地址");
|
||||
}
|
||||
@@ -63,7 +63,9 @@ public class TourProductServiceImpl extends BaseServiceImpl<TourProductMapper, T
|
||||
tourProductEntity.setThumbnailUrl(tourProduct.getThumbnailUrl());
|
||||
tourProductEntity.setMainImageUrl(tourProduct.getMainImageUrl());
|
||||
tourProductEntity.setDetailImages(tourProduct.getDetailImages());
|
||||
tourProductEntity.setCityName(regionsInfo.getName());
|
||||
tourProductEntity.setCityName(regionsInfo.getFullName());
|
||||
tourProductEntity.setProvinceId(tourProduct.getProvinceId());
|
||||
tourProductEntity.setCityId(tourProduct.getCityId());
|
||||
tourProductEntity.setDurationDays(tourProduct.getDurationDays());
|
||||
tourProductEntity.setDurationNights(tourProduct.getDurationNights());
|
||||
tourProductEntity.setBasePrice(tourProduct.getBasePrice());
|
||||
@@ -95,10 +97,10 @@ public class TourProductServiceImpl extends BaseServiceImpl<TourProductMapper, T
|
||||
}
|
||||
|
||||
|
||||
if (tourProduct.getCity() == null){
|
||||
if (tourProduct.getCityId() == null){
|
||||
throw new ServiceException("请选择地址");
|
||||
}
|
||||
CommonRegionsInfoEntity regionsInfo = commonRegionsInfoService.getById(tourProduct.getCity());
|
||||
CommonRegionsInfoEntity regionsInfo = commonRegionsInfoService.getById(tourProduct.getCityId());
|
||||
if (regionsInfo == null){
|
||||
throw new ServiceException("请选择正确的地址");
|
||||
}
|
||||
@@ -110,7 +112,9 @@ public class TourProductServiceImpl extends BaseServiceImpl<TourProductMapper, T
|
||||
tourProductEntity.setThumbnailUrl(tourProduct.getThumbnailUrl());
|
||||
tourProductEntity.setMainImageUrl(tourProduct.getMainImageUrl());
|
||||
tourProductEntity.setDetailImages(tourProduct.getDetailImages());
|
||||
tourProductEntity.setCityName(regionsInfo.getName());
|
||||
tourProductEntity.setCityName(regionsInfo.getFullName());
|
||||
tourProductEntity.setProvinceId(tourProduct.getProvinceId());
|
||||
tourProductEntity.setCityId(tourProduct.getCityId());
|
||||
tourProductEntity.setDurationDays(tourProduct.getDurationDays());
|
||||
tourProductEntity.setDurationNights(tourProduct.getDurationNights());
|
||||
tourProductEntity.setBasePrice(tourProduct.getBasePrice());
|
||||
@@ -143,6 +147,7 @@ public class TourProductServiceImpl extends BaseServiceImpl<TourProductMapper, T
|
||||
TourProductEntity::getRating,
|
||||
TourProductEntity::getBasePrice)
|
||||
.eq(TourProductEntity::getIsRecommended, 0)
|
||||
.eq(TourProductEntity::getStatus, 1)
|
||||
.like( request.getCityName() != null, TourProductEntity::getCityName, request.getCityName())
|
||||
.orderByDesc(TourProductEntity::getId)
|
||||
.orderByDesc(TourProductEntity::getVisitCount)
|
||||
@@ -164,6 +169,7 @@ public class TourProductServiceImpl extends BaseServiceImpl<TourProductMapper, T
|
||||
TourProductEntity::getRating,
|
||||
TourProductEntity::getBasePrice)
|
||||
.eq(TourProductEntity::getIsRecommended, 1)
|
||||
.eq(TourProductEntity::getStatus, 1)
|
||||
.like( request.getCityName() != null, TourProductEntity::getCityName, request.getCityName())
|
||||
.orderByDesc(TourProductEntity::getId)
|
||||
.orderByDesc(TourProductEntity::getVisitCount)
|
||||
@@ -178,6 +184,16 @@ public class TourProductServiceImpl extends BaseServiceImpl<TourProductMapper, T
|
||||
return CommonTourProductConvert.INSTANCE.convertTourProductDetailApiVO(tourProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applyStatus(Long id) {
|
||||
TourProductEntity tourProduct = getById(id);
|
||||
if (tourProduct == null) {
|
||||
throw new ServiceException("无效商品");
|
||||
}
|
||||
tourProduct.setStatus(Math.abs(tourProduct.getStatus() - 1));
|
||||
return updateById(tourProduct);
|
||||
}
|
||||
|
||||
|
||||
private boolean isValidRating(BigDecimal rating) {
|
||||
if (rating == null) {
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.modules.common.pojo.entity.CommonReleaseVersionEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonReleaseVersionVO;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* APP版本发布管理 包装类,返回视图层所需的字段
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-04-01
|
||||
*/
|
||||
public class CommonReleaseVersionWrapper extends BaseEntityWrapper<CommonReleaseVersionEntity, CommonReleaseVersionVO> {
|
||||
|
||||
public static CommonReleaseVersionWrapper build() {
|
||||
return new CommonReleaseVersionWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonReleaseVersionVO entityVO(CommonReleaseVersionEntity commonReleaseversion) {
|
||||
CommonReleaseVersionVO commonReleaseversionVO = Objects.requireNonNull(BeanUtil.copyProperties(commonReleaseversion, CommonReleaseVersionVO.class));
|
||||
|
||||
//User createUser = UserCache.getUser(commonReleaseversion.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(commonReleaseversion.getUpdateUser());
|
||||
//commonReleaseversionVO.setCreateUserName(createUser.getName());
|
||||
//commonReleaseversionVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return commonReleaseversionVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -150,4 +150,11 @@ public class MallProductController extends BladeController {
|
||||
return R.status(mallProductService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
@PostMapping("/applyStatus")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "上下架商品", description = "mallProduct.id")
|
||||
public R applyStatus(MallProductEntity mallProduct) {
|
||||
return R.status(mallProductService.applyStatus(mallProduct.getId()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,11 +39,11 @@
|
||||
</select>
|
||||
|
||||
<select id="selectDirectMallPage" resultMap="mallProductResultMap">
|
||||
select * from mall_product where is_deleted = 0 and status = 1 and category_id = 2033413707249164290 order by create_time desc
|
||||
select * from mall_product where is_deleted = 0 and category_id = 2033413707249164290 order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectEcosystemProductPage" resultMap="mallProductResultMap">
|
||||
select * from mall_product where is_deleted = 0 and status = 1 and category_id = 2033413760969809921 order by create_time desc
|
||||
select * from mall_product where is_deleted = 0 and category_id = 2033413760969809921 order by create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -39,4 +39,5 @@ public interface IMallProductService extends BaseService<MallProductEntity> {
|
||||
MallProductDetailApiVO apiDetailVO(@NotNull(message = "无效商品") Long id);
|
||||
|
||||
|
||||
boolean applyStatus(Long id);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ package org.springblade.modules.mall.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.modules.api.vo.MallProductApiVO;
|
||||
import org.springblade.modules.api.vo.MallProductDetailApiVO;
|
||||
import org.springblade.modules.mall.convert.AppMallConvert;
|
||||
@@ -93,4 +94,17 @@ public class MallProductServiceImpl extends BaseServiceImpl<MallProductMapper, M
|
||||
return AppMallConvert.INSTANCE.convertMallProductDetailApiVO(product);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applyStatus(Long id) {
|
||||
|
||||
MallProductEntity product = getById(id);
|
||||
if (product == null) {
|
||||
throw new ServiceException("无效商品");
|
||||
}
|
||||
|
||||
product.setStatus(Math.abs(product.getStatus() - 1));
|
||||
|
||||
return updateById( product);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,5 +12,8 @@ public interface BladeMarketConstant {
|
||||
// 用户兑换福利包-上级福利积分奖励配置
|
||||
String BENEFIT_PACK_SUPERIOR_REWARD_CONFIG = "market.benefit.pack.superior.reward.config";
|
||||
|
||||
// 是否开启兑换福利包
|
||||
String APP_BENEFIT_PACK_ALLOCATE_ENABLED = "app.market.benefit.pack.allocate.enabled";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.springblade.modules.market.pojo.vo.UserMallSpendVO;
|
||||
import org.springblade.modules.market.pojo.vo.UserPerformanceVO;
|
||||
import org.springblade.modules.market.service.*;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IParamService;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -62,6 +63,8 @@ public class MarketUserManager {
|
||||
private final IMarketCashPerformanceService cashPerformanceService;
|
||||
private final IMarketWelfarePerformanceService welfarePerformanceService;
|
||||
|
||||
private final IParamService paramService;
|
||||
|
||||
public List<MarketDirectInfoApiVO> findUserPackList() {
|
||||
Long userId = AuthUtil.getUserId();
|
||||
MarketInfoEntity marketInfoEntity = marketInfoService.getById(userId);
|
||||
@@ -150,6 +153,11 @@ public class MarketUserManager {
|
||||
|
||||
@Transactional(rollbackFor = ServiceException.class)
|
||||
public boolean acquireBenefitPackage(AcquireBenefitPackageRequest request) {
|
||||
|
||||
if (!Boolean.parseBoolean(ParamCache.getValue(BladeMarketConstant.APP_BENEFIT_PACK_ALLOCATE_ENABLED))){
|
||||
throw new ServiceException("系统结算中,请于结算完成之后再兑换。");
|
||||
}
|
||||
|
||||
Long userId = AuthUtil.getUserId();
|
||||
User user = userService.getById(userId);
|
||||
if(user == null){
|
||||
|
||||
@@ -18,7 +18,7 @@ public interface MarketCashPerformanceLogMapper extends BaseMapper<MarketCashPer
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param marketCashPerformanceLog 查询参数
|
||||
* @param performanceLog 查询参数
|
||||
* @return List<MarketCashPerformanceLogVO>
|
||||
*/
|
||||
List<MarketCashPerformanceLogVO> selectMarketCashPerformanceLogPage(IPage page, MarketCashPerformanceLogVO performanceLog);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectMarketCashPerformanceLogPage" resultMap="marketCashPerformanceLogResultMap">
|
||||
<select id="selectMarketCashPerformanceLogPage" resultType="org.springblade.modules.market.pojo.vo.MarketCashPerformanceLogVO">
|
||||
select
|
||||
mcpl.*,
|
||||
bu.account
|
||||
|
||||
@@ -18,7 +18,7 @@ public interface MarketUpgradeWelfareLogMapper extends BaseMapper<MarketUpgradeW
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param marketUpgradeWelfareLog 查询参数
|
||||
* @param upgradeLog 查询参数
|
||||
* @return List<MarketUpgradeWelfareLogVO>
|
||||
*/
|
||||
List<MarketUpgradeWelfareLogVO> selectMarketUpgradeWelfareLogPage(IPage page, MarketUpgradeWelfareLogVO upgradeLog);
|
||||
|
||||
@@ -18,7 +18,7 @@ public interface MarketWelfarePerformanceLogMapper extends BaseMapper<MarketWelf
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param marketWelfarePerformanceLog 查询参数
|
||||
* @param performanceLog 查询参数
|
||||
* @return List<MarketWelfarePerformanceLogVO>
|
||||
*/
|
||||
List<MarketWelfarePerformanceLogVO> selectMarketWelfarePerformanceLogPage(IPage page, MarketWelfarePerformanceLogVO performanceLog);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectMarketWelfarePerformanceLogPage" resultMap="marketWelfarePerformanceLogResultMap">
|
||||
<select id="selectMarketWelfarePerformanceLogPage" resultType="org.springblade.modules.market.pojo.vo.MarketWelfarePerformanceLogVO">
|
||||
select
|
||||
mwpl.*,
|
||||
bu.account
|
||||
|
||||
@@ -704,7 +704,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
||||
String decryptPassword = SM2Util.decrypt(request.getPassword(), properties.getPublicKey(), properties.getPrivateKey());
|
||||
|
||||
if (!isPasswordValid(decryptPassword)) {
|
||||
throw new ServiceException("密码必须包含大小写字母、数字,长度8-12位");
|
||||
throw new ServiceException("密码必须包含字母、数字,长度至少8位");
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -723,7 +723,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
||||
|
||||
private boolean isPasswordValid(String password) {
|
||||
// 规则: 必须包含大小写字母和数字, 长度8-12位, 仅允许字母和数字
|
||||
return password.matches("^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{8,12}$");
|
||||
return password.matches("^[a-zA-Z0-9]{8,}$");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -242,21 +242,23 @@ blade:
|
||||
strict-header: true
|
||||
#接口放行
|
||||
skip-url:
|
||||
- /app-mall/categories
|
||||
- /app-mall/list
|
||||
- /app-mall/detail
|
||||
- /app-common/send-forget-pwd-sms
|
||||
- /app-common/retrieve-password
|
||||
- /app-eco/list
|
||||
- /app-eco/detail
|
||||
- /app-tourism-spot/list
|
||||
- /app-tourism-spot/top-list
|
||||
- /app-news/category-list
|
||||
- /app-news/list
|
||||
- /app-store/list
|
||||
- /app-tour/product-list
|
||||
- /app-tour/product-top-list
|
||||
- /app/mall/categories
|
||||
- /app/mall/list
|
||||
- /app/mall/detail
|
||||
- /app/common/send-forget-pwd-sms
|
||||
- /app/common/retrieve-password
|
||||
- /app/eco/list
|
||||
- /app/eco/detail
|
||||
- /app/tourism-spot/list
|
||||
- /app/tourism-spot/top-list
|
||||
- /app/news/category-list
|
||||
- /app/news/list
|
||||
- /app/store/list
|
||||
- /app/tour/product-list
|
||||
- /app/tour/product-top-list
|
||||
- /blade-pay/callback/**
|
||||
- /app/common/version
|
||||
- /market/common/version
|
||||
|
||||
#授权认证配置
|
||||
auth:
|
||||
@@ -294,14 +296,26 @@ blade:
|
||||
- client-id: saber3
|
||||
path-patterns:
|
||||
- /blade-saber/**
|
||||
|
||||
- client-id: app
|
||||
path-patterns:
|
||||
- /app-user/**
|
||||
|
||||
- /app/user/**
|
||||
- /app/common/region-list
|
||||
- /app/common/tour-info-list
|
||||
- /app/common/submit-tour-info
|
||||
- /app/common/delete-tour-info
|
||||
- /app/common/pay-type
|
||||
- /app/mall/create-order
|
||||
- /app/mall/confirm
|
||||
- /app/mall/order-detail
|
||||
- /app/eco/create-order
|
||||
- /app/eco/confirm
|
||||
- /app/eco/order-detail
|
||||
- /app/tour/create-order
|
||||
- /app/tour/confirm
|
||||
- /app/tour/order-detail
|
||||
- client-id: market
|
||||
path-patterns:
|
||||
- /market-user/**
|
||||
- /market/user/**
|
||||
|
||||
#多租户配置
|
||||
tenant:
|
||||
@@ -323,13 +337,4 @@ blade:
|
||||
enabled: false
|
||||
|
||||
|
||||
forest:
|
||||
max-connections: 1000 # 连接池最大连接数
|
||||
connect-timeout: 60000 # 连接超时时间,单位为毫秒
|
||||
read-timeout: 60000 # 数据读取超时时间,单位为毫秒
|
||||
max-retry-count: 3 # 最大请求重试次数,默认为 0 次
|
||||
max-retry-interval: 1000 # 为最大重试时间间隔, 单位为毫秒
|
||||
log-response-content: true
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,54 +10,46 @@ import org.springblade.core.tool.utils.*;
|
||||
public class CryptoKeyGenerator {
|
||||
|
||||
public static void main(String[] args) {
|
||||
String code = new StringBuilder(Long.toString(13370065231L, 36)).reverse().toString();
|
||||
System.out.println("=========== code 配置如下 ============");
|
||||
System.out.println("code: " + code.toUpperCase());
|
||||
// System.out.println("=========== uncode 配置如下 ============");
|
||||
// long l = Long.parseLong(code, 36);
|
||||
// System.out.println("number: " + l);
|
||||
|
||||
String cryptoKey = AesUtil.genAesKey();
|
||||
String aesKey = AesUtil.genAesKey();
|
||||
String desKey = DesUtil.genDesKey();
|
||||
|
||||
System.out.println("=========== blade.token.crypto-key 配置如下 ============");
|
||||
System.out.println("#blade配置\n" +
|
||||
"blade:\n" +
|
||||
" token:\n" +
|
||||
" crypto-key: " + cryptoKey);
|
||||
System.out.println("=======================================================");
|
||||
|
||||
// String cryptoKey = AesUtil.genAesKey();
|
||||
// String aesKey = AesUtil.genAesKey();
|
||||
// String desKey = DesUtil.genDesKey();
|
||||
//
|
||||
// System.out.println("=========== blade.token.crypto-key 配置如下 ============");
|
||||
// System.out.println("#blade配置\n" +
|
||||
// "blade:\n" +
|
||||
// " token:\n" +
|
||||
// " crypto-key: " + cryptoKey);
|
||||
// System.out.println("=======================================================");
|
||||
//
|
||||
// System.out.println(StringPool.EMPTY);
|
||||
// System.out.println("============ blade.key.crypto-key 配置如下 =============");
|
||||
// System.out.println("#blade配置\n" +
|
||||
// "blade:\n" +
|
||||
// " key:\n" +
|
||||
// " enabled: true\n" +
|
||||
// " crypto-key: " + cryptoKey);
|
||||
// System.out.println("=======================================================");
|
||||
//
|
||||
// System.out.println(StringPool.EMPTY);
|
||||
// System.out.println("============== blade.api.crypto 配置如下 ===============");
|
||||
// System.out.println("#blade配置\n" +
|
||||
// "blade:\n" +
|
||||
// " api:\n" +
|
||||
// " crypto:\n" +
|
||||
// " enabled: true\n" +
|
||||
// " aes-key: " + aesKey + "\n" +
|
||||
// " des-key: " + desKey);
|
||||
// System.out.println("=======================================================");
|
||||
//
|
||||
// System.out.println(StringPool.EMPTY);
|
||||
// System.out.println("============== saber crypto.js 配置如下 ===============");
|
||||
// System.out.println("export default class crypto {\n" +
|
||||
// " static cryptoKey = '" + cryptoKey + "';\n" +
|
||||
// " static aesKey = '" + aesKey + "';\n" +
|
||||
// " static desKey = '" + desKey + "';\n" +
|
||||
// "}");
|
||||
// System.out.println("=======================================================");
|
||||
System.out.println(StringPool.EMPTY);
|
||||
System.out.println("============ blade.key.crypto-key 配置如下 =============");
|
||||
System.out.println("#blade配置\n" +
|
||||
"blade:\n" +
|
||||
" key:\n" +
|
||||
" enabled: true\n" +
|
||||
" crypto-key: " + cryptoKey);
|
||||
System.out.println("=======================================================");
|
||||
|
||||
System.out.println(StringPool.EMPTY);
|
||||
System.out.println("============== blade.api.crypto 配置如下 ===============");
|
||||
System.out.println("#blade配置\n" +
|
||||
"blade:\n" +
|
||||
" api:\n" +
|
||||
" crypto:\n" +
|
||||
" enabled: true\n" +
|
||||
" aes-key: " + aesKey + "\n" +
|
||||
" des-key: " + desKey);
|
||||
System.out.println("=======================================================");
|
||||
|
||||
System.out.println(StringPool.EMPTY);
|
||||
System.out.println("============== saber crypto.js 配置如下 ===============");
|
||||
System.out.println("export default class crypto {\n" +
|
||||
" static cryptoKey = '" + cryptoKey + "';\n" +
|
||||
" static aesKey = '" + aesKey + "';\n" +
|
||||
" static desKey = '" + desKey + "';\n" +
|
||||
"}");
|
||||
System.out.println("=======================================================");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user