boot代码
This commit is contained in:
15
doc/sql/bladex_user_update_postgres.sql
Normal file
15
doc/sql/bladex_user_update_postgres.sql
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
alter table blade_user
|
||||||
|
add register_date timestamp;
|
||||||
|
|
||||||
|
alter table blade_user
|
||||||
|
add invitation_code varchar(32);
|
||||||
|
|
||||||
|
alter table blade_user
|
||||||
|
add pid bigint;
|
||||||
|
|
||||||
|
create index blade_user_register_date_index
|
||||||
|
on blade_user (is_deleted, register_date);
|
||||||
|
|
||||||
|
|
||||||
|
create index bur_invitation_code_index
|
||||||
|
on blade_user (is_deleted, invitation_code);
|
||||||
4
doc/sql/insert_ads.sql
Normal file
4
doc/sql/insert_ads.sql
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
INSERT INTO "<table_name>" ("id", "name", "url", "sort", "type", "ads_time", "is_deleted", "create_time", "create_user", "update_time", "update_user", "create_dept", "status") VALUES (2017839712136810498, '广告1', '11111', 1, 1, 5, 0, '2026-02-01 13:57:31', 1123598821738675201, '2026-02-01 13:57:44.351', 1123598821738675201, 1123598813738675201, 1);
|
||||||
|
INSERT INTO "<table_name>" ("id", "name", "url", "sort", "type", "ads_time", "is_deleted", "create_time", "create_user", "update_time", "update_user", "create_dept", "status") VALUES (2017839810455490561, '广告2', '22222', 2, 1, 5, 0, '2026-02-01 13:57:55.123', 1123598821738675201, '2026-02-01 13:57:55.123', 1123598821738675201, 1123598813738675201, 1);
|
||||||
|
INSERT INTO "<table_name>" ("id", "name", "url", "sort", "type", "ads_time", "is_deleted", "create_time", "create_user", "update_time", "update_user", "create_dept", "status") VALUES (2017839854445350914, '广告3', '33333', 3, 1, 5, 0, '2026-02-01 13:58:05.608', 1123598821738675201, '2026-02-01 13:58:05.608', 1123598821738675201, 1123598813738675201, 1);
|
||||||
|
INSERT INTO "<table_name>" ("id", "name", "url", "sort", "type", "ads_time", "is_deleted", "create_time", "create_user", "update_time", "update_user", "create_dept", "status") VALUES (2017839920576942081, '广告4', '44444', 4, 1, 5, 0, '2026-02-01 13:58:21.378', 1123598821738675201, '2026-02-01 13:58:21.378', 1123598821738675201, 1123598813738675201, 1);
|
||||||
2
doc/sql/insert_blade_client.sql
Normal file
2
doc/sql/insert_blade_client.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
INSERT INTO "<table_name>" ("id", "client_id", "client_secret", "resource_ids", "scope", "authorized_grant_types", "web_server_redirect_uri", "authorities", "access_token_validity", "refresh_token_validity", "additional_information", "autoapprove", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2016023363404103681, 'appFormal', 'uP1mG5gT1sC6tG4mT7nU7fL9yP6yW1sY', '', 'all', 'refresh_token,password,sms_code,register', 'http://localhost:8081', '', 86400, 604800, NULL, 'true', 1123598821738675201, 1123598813738675201, '2026-01-27 13:40:00', 1123598821738675201, '2026-01-30 21:11:21.64', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "client_id", "client_secret", "resource_ids", "scope", "authorized_grant_types", "web_server_redirect_uri", "authorities", "access_token_validity", "refresh_token_validity", "additional_information", "autoapprove", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017525783019851778, 'appOffline', 'gL8nS4oV2cS8fC2zD9tB3xB9zY8vA3hE9xS2uR7gC2tO0sO8pE4gC4sF6kB7bN7q', '', 'all', 'refresh_token,password,sms_code', 'http://localhost:8081', '', 259200, 604800, NULL, 'true', 1123598821738675201, 1123598813738675201, '2026-01-31 17:10:05', 1123598821738675201, '2026-01-31 17:10:19.598', 1, 0);
|
||||||
231
doc/sql/insert_blade_menu.sql
Normal file
231
doc/sql/insert_blade_menu.sql
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511999274860547, 2016511999274860546, 'ads_add', '新增', 'add', '/userPackInfo/ads/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511999274860548, 2016511999274860546, 'ads_edit', '修改', 'edit', '/userPackInfo/ads/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511999274860549, 2016511999274860546, 'ads_delete', '删除', 'delete', '/api/blade-ads/ads/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511999274860550, 2016511999274860546, 'ads_view', '查看', 'view', '/userPackInfo/ads/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511986561925122, 2016511986561925121, 'level_info_add', '新增', 'add', '/customer/levelInfo/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016444412729917441, 0, 'customer', '用户信息', 'menu', '/customer', 'iconfont iconicon_subordinate', 9, 1, -1, 1, '', '', 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016445572647911425, 0, 'cashAccount', '资金账户', 'menu', '/cashAccount', 'iconfont icon-biaodanzujian-biaoge', 10, 1, -1, 1, '', '', 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016445919294554113, 0, 'mall', '商城', 'menu', '/mall', 'iconfont iconicon_message', 11, 1, NULL, 1, NULL, '', 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016446167375052801, 0, 'order', '订单管理', 'menu', '/order', 'iconfont iconicon_message', 12, 1, NULL, 1, NULL, '', 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016446332399943682, 0, 'userPackInfo', '积分包管理', 'menu', '/userPackInfo', 'iconfont iconicon_principal', 13, 1, NULL, 1, NULL, '', 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016446547672596482, 0, 'userPoint', '用户积分管理', 'menu', '/userPoint', 'iconfont iconicon_message', 14, 1, NULL, 1, NULL, '', 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511986561925123, 2016511986561925121, 'level_info_edit', '修改', 'edit', '/customer/levelInfo/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511986561925124, 2016511986561925121, 'level_info_delete', '删除', 'delete', '/api/blade-level-info/level_info/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511986561925125, 2016511986561925121, 'level_info_view', '查看', 'view', '/customer/levelInfo/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511987606306819, 2016511987606306818, 'cart_add', '新增', 'add', '/mall/mallCart/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511987606306820, 2016511987606306818, 'cart_edit', '修改', 'edit', '/mall/mallCart/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511987606306821, 2016511987606306818, 'cart_delete', '删除', 'delete', '/api/blade-mall-cart/cart/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511987606306822, 2016511987606306818, 'cart_view', '查看', 'view', '/mall/mallCart/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511989300805634, 2016511989300805633, 'detailOrder_add', '新增', 'add', '/order/mallDetailOrder/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511989300805635, 2016511989300805633, 'detailOrder_edit', '修改', 'edit', '/order/mallDetailOrder/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511989300805636, 2016511989300805633, 'detailOrder_delete', '删除', 'delete', '/api/blade-mall-detailorder/detailOrder/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511989300805637, 2016511989300805633, 'detailOrder_view', '查看', 'view', '/order/mallDetailOrder/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511988126400515, 2016511988126400514, 'spu_add', '新增', 'add', '/mall/mallSpu/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511988126400516, 2016511988126400514, 'spu_edit', '修改', 'edit', '/mall/mallSpu/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511988126400517, 2016511988126400514, 'spu_delete', '删除', 'delete', '/api/blade-mall-spu/spu/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511988126400518, 2016511988126400514, 'spu_view', '查看', 'view', '/mall/mallSpu/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511989883813891, 2016511989883813890, 'summaryOrder_add', '新增', 'add', '/order/mallSummaryOrder/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511989883813892, 2016511989883813890, 'summaryOrder_edit', '修改', 'edit', '/order/mallSummaryOrder/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511989883813893, 2016511989883813890, 'summaryOrder_delete', '删除', 'delete', '/api/blade-mall-summaryorder/summaryOrder/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511989883813894, 2016511989883813890, 'summaryOrder_view', '查看', 'view', '/order/mallSummaryOrder/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511990412296194, 2016511990412296193, 'summaryOrderAfter_add', '新增', 'add', '/order/mallSummaryOrderAfter/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511990412296195, 2016511990412296193, 'summaryOrderAfter_edit', '修改', 'edit', '/order/mallSummaryOrderAfter/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511990412296196, 2016511990412296193, 'summaryOrderAfter_delete', '删除', 'delete', '/api/blade-mall-summaryorderafter/summaryOrderAfter/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511990412296197, 2016511990412296193, 'summaryOrderAfter_view', '查看', 'view', '/order/mallSummaryOrderAfter/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511985072947202, 2016511985072947201, 'info_add', '新增', 'add', '/userPackInfo/appPackageInfo/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511985072947203, 2016511985072947201, 'info_edit', '修改', 'edit', '/userPackInfo/appPackageInfo/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511985072947204, 2016511985072947201, 'info_delete', '删除', 'delete', '/blade-app-package/info/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511985072947205, 2016511985072947201, 'info_view', '查看', 'view', '/userPackInfo/appPackageInfo/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511997844602884, 2016511997844602881, 'info_delete', '删除', 'delete', '/api/blade-app-regions/info/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511988646494210, 2016511988646494209, 'address_add', '新增', 'add', '/mall/userAddress/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511988646494211, 2016511988646494209, 'address_edit', '修改', 'edit', '/mall/userAddress/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511988646494212, 2016511988646494209, 'address_delete', '删除', 'delete', '/api/blade-user-address/address/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511988646494213, 2016511988646494209, 'address_view', '查看', 'view', '/mall/userAddress/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511979087675395, 2016511979087675394, 'benefit_add', '新增', 'add', '/userPoint/userBenefit/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511979087675396, 2016511979087675394, 'benefit_edit', '修改', 'edit', '/userPoint/userBenefit/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511979087675397, 2016511979087675394, 'benefit_delete', '删除', 'delete', '/api/blade-user-benefit/benefit/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511979087675398, 2016511979087675394, 'benefit_view', '查看', 'view', '/userPoint/userBenefit/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511998809292802, 2016511998809292801, 'benefitLog_add', '新增', 'add', '/userPoint/userBenefitLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511998809292803, 2016511998809292801, 'benefitLog_edit', '修改', 'edit', '/userPoint/userBenefitLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511998809292804, 2016511998809292801, 'benefitLog_delete', '删除', 'delete', '/api/blade-user-benefitlog/benefitLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511998809292805, 2016511998809292801, 'benefitLog_view', '查看', 'view', '/userPoint/userBenefitLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511985072947201, 2016446332399943682, 'info', '积分包信息', 'menu', '/userPackInfo/appPackageInfo', NULL, 2, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511989883813890, 2016446167375052801, 'summaryOrder', '商城总订单', 'menu', '/order/mallSummaryOrder', NULL, 2, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511989300805633, 2016446167375052801, 'detailOrder', '商城详情订单', 'menu', '/order/mallDetailOrder', NULL, 3, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511988126400514, 2016445919294554113, 'spu', '商城spu', 'menu', '/mall/mallSpu', NULL, 2, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511987606306818, 2016445919294554113, 'cart', '商城购物车', 'menu', '/mall/mallCart', NULL, 4, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511990412296193, 2016446167375052801, 'summaryOrderAfter', '商品售后订单', 'menu', '/order/mallSummaryOrderAfter', NULL, 4, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511979087675394, 2016446547672596482, 'benefit', '用户福利值', 'menu', '/userPoint/userBenefit', NULL, 3, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511988646494209, 2016445919294554113, 'address', '用户地址', 'menu', '/mall/userAddress', NULL, 3, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511979599380483, 2016511979599380482, 'cash_add', '新增', 'add', '/userPoint/userCash/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511979599380484, 2016511979599380482, 'cash_edit', '修改', 'edit', '/userPoint/userCash/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511979599380485, 2016511979599380482, 'cash_delete', '删除', 'delete', '/api/blade-user-cash/cash/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511979599380486, 2016511979599380482, 'cash_view', '查看', 'view', '/userPoint/userCash/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511998356307971, 2016511998356307970, 'cashLog_add', '新增', 'add', '/userPoint/userCashLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511998356307972, 2016511998356307970, 'cashLog_edit', '修改', 'edit', '/userPoint/userCashLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511998356307973, 2016511998356307970, 'cashLog_delete', '删除', 'delete', '/api/blade-user-cashlog/cashLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511998356307974, 2016511998356307970, 'cashLog_view', '查看', 'view', '/userPoint/userCashLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511980115279874, 2016511980115279873, 'commission_add', '新增', 'add', '/userPoint/userCommission/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511980115279875, 2016511980115279873, 'commission_edit', '修改', 'edit', '/userPoint/userCommission/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511980115279876, 2016511980115279873, 'commission_delete', '删除', 'delete', '/api/blade-user-commission/commission/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511980115279877, 2016511980115279873, 'commission_view', '查看', 'view', '/userPoint/userCommission/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511991586701314, 2016511991586701313, 'commissionAccount_add', '新增', 'add', '/cashAccount/userCommissionAccount/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511991586701315, 2016511991586701313, 'commissionAccount_edit', '修改', 'edit', '/cashAccount/userCommissionAccount/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511991586701316, 2016511991586701313, 'commissionAccount_delete', '删除', 'delete', '/api/blade-user-commissionaccount/commissionAccount/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511991586701317, 2016511991586701313, 'commissionAccount_view', '查看', 'view', '/cashAccount/userCommissionAccount/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511992102600706, 2016511992102600705, 'commissionAdvertisingLog_add', '新增', 'add', '/cashAccount/userCommissionAdvertisingLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511992102600707, 2016511992102600705, 'commissionAdvertisingLog_edit', '修改', 'edit', '/cashAccount/userCommissionAdvertisingLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511992102600708, 2016511992102600705, 'commissionAdvertisingLog_delete', '删除', 'delete', '/api/blade-user-commissionadvertisinglog/commissionAdvertisingLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511992102600709, 2016511992102600705, 'commissionAdvertisingLog_view', '查看', 'view', '/cashAccount/userCommissionAdvertisingLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511994174586883, 2016511994174586882, 'commissionAgencyLog_add', '新增', 'add', '/cashAccount/userCommissionAgencyLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511994174586884, 2016511994174586882, 'commissionAgencyLog_edit', '修改', 'edit', '/cashAccount/userCommissionAgencyLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511994174586885, 2016511994174586882, 'commissionAgencyLog_delete', '删除', 'delete', '/api/blade-user-commissionagencylog/commissionAgencyLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511994174586886, 2016511994174586882, 'commissionAgencyLog_view', '查看', 'view', '/cashAccount/userCommissionAgencyLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511994694680578, 2016511994694680577, 'commissionCoCreatorLog_add', '新增', 'add', '/cashAccount/userCommissionCoCreatorLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511994694680579, 2016511994694680577, 'commissionCoCreatorLog_edit', '修改', 'edit', '/cashAccount/userCommissionCoCreatorLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511994694680580, 2016511994694680577, 'commissionCoCreatorLog_delete', '删除', 'delete', '/api/blade-user-commissioncocreatorlog/commissionCoCreatorLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511994694680581, 2016511994694680577, 'commissionCoCreatorLog_view', '查看', 'view', '/cashAccount/userCommissionCoCreatorLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511995218968579, 2016511995218968578, 'commissionDirectPushLog_add', '新增', 'add', '/cashAccount/userCommissionDirectPushLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511995218968580, 2016511995218968578, 'commissionDirectPushLog_edit', '修改', 'edit', '/cashAccount/userCommissionDirectPushLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511995218968581, 2016511995218968578, 'commissionDirectPushLog_delete', '删除', 'delete', '/api/blade-user-commissiondirectpushlog/commissionDirectPushLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511995218968582, 2016511995218968578, 'commissionDirectPushLog_view', '查看', 'view', '/cashAccount/userCommissionDirectPushLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511995743256578, 2016511995743256577, 'commissionGoodsCostLog_add', '新增', 'add', '/cashAccount/userCommissionGoodsCostLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511995743256579, 2016511995743256577, 'commissionGoodsCostLog_edit', '修改', 'edit', '/cashAccount/userCommissionGoodsCostLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511995743256580, 2016511995743256577, 'commissionGoodsCostLog_delete', '删除', 'delete', '/api/blade-user-commissiongoodscostlog/commissionGoodsCostLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511995743256581, 2016511995743256577, 'commissionGoodsCostLog_view', '查看', 'view', '/cashAccount/userCommissionGoodsCostLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511980631179267, 2016511980631179266, 'commissionLog_add', '新增', 'add', '/userPoint/userCommissionLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511980631179268, 2016511980631179266, 'commissionLog_edit', '修改', 'edit', '/userPoint/userCommissionLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511980631179269, 2016511980631179266, 'commissionLog_delete', '删除', 'delete', '/api/blade-user-commissionlog/commissionLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511980631179270, 2016511980631179266, 'commissionLog_view', '查看', 'view', '/userPoint/userCommissionLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511996863135746, 2016511996863135745, 'commissionServiceProviderLog_add', '新增', 'add', '/cashAccount/userCommissionServiceProviderLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511996863135747, 2016511996863135745, 'commissionServiceProviderLog_edit', '修改', 'edit', '/cashAccount/userCommissionServiceProviderLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511996863135748, 2016511996863135745, 'commissionServiceProviderLog_delete', '删除', 'delete', '/api/blade-user-commissionserviceproviderlog/commissionServiceProviderLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511996863135749, 2016511996863135745, 'commissionServiceProviderLog_view', '查看', 'view', '/cashAccount/userCommissionServiceProviderLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511997387423747, 2016511997387423746, 'commissionUserPointLog_add', '新增', 'add', '/cashAccount/userCommissionUserPointLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511997387423748, 2016511997387423746, 'commissionUserPointLog_edit', '修改', 'edit', '/cashAccount/userCommissionUserPointLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511997387423749, 2016511997387423746, 'commissionUserPointLog_delete', '删除', 'delete', '/api/blade-user-commissionuserpointlog/commissionUserPointLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511997387423750, 2016511997387423746, 'commissionUserPointLog_view', '查看', 'view', '/cashAccount/userCommissionUserPointLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511981159661571, 2016511981159661570, 'gainsDay_add', '新增', 'add', '/userPoint/userGainsDay/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511981159661572, 2016511981159661570, 'gainsDay_edit', '修改', 'edit', '/userPoint/userGainsDay/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511981159661573, 2016511981159661570, 'gainsDay_delete', '删除', 'delete', '/api/blade-user-gainsday/gainsDay/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511981159661574, 2016511981159661570, 'gainsDay_view', '查看', 'view', '/userPoint/userGainsDay/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511981612646403, 2016511981612646402, 'gainsDayLog_add', '新增', 'add', '/userPoint/userGainsDayLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511981612646404, 2016511981612646402, 'gainsDayLog_edit', '修改', 'edit', '/userPoint/userGainsDayLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511981612646405, 2016511981612646402, 'gainsDayLog_delete', '删除', 'delete', '/api/blade-user-gainsdaylog/gainsDayLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511981612646406, 2016511981612646402, 'gainsDayLog_view', '查看', 'view', '/userPoint/userGainsDayLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511992614305794, 2016511992614305793, 'genealogy_add', '新增', 'add', '/customer/userGenealogy/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511992614305795, 2016511992614305793, 'genealogy_edit', '修改', 'edit', '/customer/userGenealogy/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511992614305796, 2016511992614305793, 'genealogy_delete', '删除', 'delete', '/api/blade-user-genealogy/genealogy/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511992614305797, 2016511992614305793, 'genealogy_view', '查看', 'view', '/customer/userGenealogy/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511993197314050, 2016511993197314049, 'increaseDay_add', '新增', 'add', '/customer/userIncreaseDay/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511993197314051, 2016511993197314049, 'increaseDay_edit', '修改', 'edit', '/customer/userIncreaseDay/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511993197314052, 2016511993197314049, 'increaseDay_delete', '删除', 'delete', '/api/blade-user-increaseday/increaseDay/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511993197314053, 2016511993197314049, 'increaseDay_view', '查看', 'view', '/customer/userIncreaseDay/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511978492084226, 2016511978492084225, 'levelLog_add', '新增', 'add', '/customer/userLevelLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511978492084227, 2016511978492084225, 'levelLog_edit', '修改', 'edit', '/customer/userLevelLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511978492084228, 2016511978492084225, 'levelLog_delete', '删除', 'delete', '/api/blade-userLevellog/levelLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511978492084229, 2016511978492084225, 'levelLog_view', '查看', 'view', '/customer/userLevelLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511982136934402, 2016511982136934401, 'mallIntegral_add', '新增', 'add', '/userPoint/userMallIntegral/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511982136934403, 2016511982136934401, 'mallIntegral_edit', '修改', 'edit', '/userPoint/userMallIntegral/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511982136934404, 2016511982136934401, 'mallIntegral_delete', '删除', 'delete', '/api/blade-user-mallintegral/mallIntegral/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511982136934405, 2016511982136934401, 'mallIntegral_view', '查看', 'view', '/userPoint/userMallIntegral/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511982589919235, 2016511982589919234, 'mallIntegralLog_add', '新增', 'add', '/userPoint/userMallIntegralLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511982589919236, 2016511982589919234, 'mallIntegralLog_edit', '修改', 'edit', '/userPoint/userMallIntegralLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511982589919237, 2016511982589919234, 'mallIntegralLog_delete', '删除', 'delete', '/api/blade-user-mallintegrallog/mallIntegralLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511982589919238, 2016511982589919234, 'mallIntegralLog_view', '查看', 'view', '/userPoint/userMallIntegralLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511991016275970, 2016446167375052801, 'order', '用户订单', 'menu', '/order/userOrder', NULL, 1, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511991016275971, 2016511991016275970, 'order_add', '新增', 'add', '/order/userOrder/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511991016275972, 2016511991016275970, 'order_edit', '修改', 'edit', '/order/userOrder/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511991016275973, 2016511991016275970, 'order_delete', '删除', 'delete', '/api/blade-user-order/order/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511991016275974, 2016511991016275970, 'order_view', '查看', 'view', '/order/userOrder/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511985525932035, 2016511985525932034, 'packageInfo_add', '新增', 'add', '/userPackInfo/userPackageInfo/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511985525932036, 2016511985525932034, 'packageInfo_edit', '修改', 'edit', '/userPackInfo/userPackageInfo/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511985525932037, 2016511985525932034, 'packageInfo_delete', '删除', 'delete', '/api/blade-user-packageinfo/packageInfo/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511985525932038, 2016511985525932034, 'packageInfo_view', '查看', 'view', '/userPackInfo/userPackageInfo/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511986113134594, 2016511986113134593, 'packageInfoCopy_add', '新增', 'add', '/userPackInfo/userPackageInfoCopy/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511986113134595, 2016511986113134593, 'packageInfoCopy_edit', '修改', 'edit', '/userPackInfo/userPackageInfoCopy/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511986113134596, 2016511986113134593, 'packageInfoCopy_delete', '删除', 'delete', '/api/blade-user-packageinfocopy/packageInfoCopy/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511986113134597, 2016511986113134593, 'packageInfoCopy_view', '查看', 'view', '/userPackInfo/userPackageInfoCopy/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511983047098372, 2016511983047098369, 'performance_delete', '删除', 'delete', '/api/blade-user-performance/performance/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511984091480068, 2016511984091480065, 'performanceBenefit_delete', '删除', 'delete', '/api/blade-user-performancebenefit/performanceBenefit/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511984548659205, 2016511984548659202, 'performanceBenefitLog_delete', '删除', 'delete', '/api/blade-user-performancebenefitlog/performanceBenefitLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511983634300933, 2016511983634300930, 'performanceLog_delete', '删除', 'delete', '/api/blade-user-performancelog/performanceLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511993717407747, 2016511993717407746, 'tree_add', '新增', 'add', '/customer/userTree/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511993717407748, 2016511993717407746, 'tree_edit', '修改', 'edit', '/customer/userTree/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511993717407750, 2016511993717407746, 'tree_view', '查看', 'view', '/customer/userTree/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511996271738882, 2016511996271738881, 'commissionOperationLog_add', '新增', 'add', '/cashAccount/userCommissionOperationLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511996271738883, 2016511996271738881, 'commissionOperationLog_edit', '修改', 'edit', '/cashAccount/userCommissionOperationLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511996271738884, 2016511996271738881, 'commissionOperationLog_delete', '删除', 'delete', '/api/blade-user-commissionoperationlog/commissionOperationLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511996271738885, 2016511996271738881, 'commissionOperationLog_view', '查看', 'view', '/cashAccount/userCommissionOperationLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511997844602885, 2016511997844602881, 'info_view', '查看', 'view', '/customer/appRegionsInfo/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511997844602882, 2016511997844602881, 'info_add', '新增', 'add', '/customer/appRegionsInfo/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511997844602883, 2016511997844602881, 'info_edit', '修改', 'edit', '/customer/appRegionsInfo/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511993717407749, 2016511993717407746, 'tree_delete', '删除', 'delete', '/api/blade-user-tree/tree/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511984091480069, 2016511984091480065, 'performanceBenefit_view', '查看', 'view', '/userPoint/userPerformanceBenefit/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511984091480065, 2016446547672596482, 'performanceBenefit', '用户福利值业绩', 'menu', '/userPoint/userPerformanceBenefit', NULL, 11, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511984091480067, 2016511984091480065, 'performanceBenefit_edit', '修改', 'edit', '/userPoint/userPerformanceBenefit/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511984548659202, 2016446547672596482, 'performanceBenefitLog', '用户福利值业绩日志', 'menu', '/userPoint/userPerformanceLog', NULL, 13, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511983047098371, 2016511983047098369, 'performance_edit', '修改', 'edit', '/userPoint/userPerformance/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511984548659206, 2016511984548659202, 'performanceBenefitLog_view', '查看', 'view', '/userPoint/userPerformanceLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511983634300934, 2016511983634300930, 'performanceLog_view', '查看', 'view', '/userPoint/userPerformanceLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511984548659203, 2016511984548659202, 'performanceBenefitLog_add', '新增', 'add', '/userPoint/userPerformanceLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511983634300931, 2016511983634300930, 'performanceLog_add', '新增', 'add', '/userPoint/userPerformanceLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511996271738881, 2016445572647911425, 'commissionOperationLog', '5%运营佣金流水', 'menu', '/cashAccount/userCommissionOperationLog', NULL, 5, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511984548659204, 2016511984548659202, 'performanceBenefitLog_edit', '修改', 'edit', '/userPoint/userPerformanceLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511984091480066, 2016511984091480065, 'performanceBenefit_add', '新增', 'add', '/userPoint/userPerformanceBenefit/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511983634300932, 2016511983634300930, 'performanceLog_edit', '修改', 'edit', '/userPoint/userPerformanceLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511983047098373, 2016511983047098369, 'performance_view', '查看', 'view', '/userPoint/userPerformance/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511993717407746, 2016444412729917441, 'tree', '用户树结构', 'menu', '/customer/userTree', NULL, 2, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511997844602881, 2016444412729917441, 'info', '地区详情', 'menu', '/customer/appRegionsInfo', NULL, 6, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511986113134593, 2016446332399943682, 'packageInfoCopy', '用户积分包详细信息', 'menu', '/userPackInfo/userPackageInfoCopy', NULL, 4, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511983634300930, 2016446547672596482, 'performanceLog', '用户现金业绩日志', 'menu', '/userPoint/userPerformanceLog', NULL, 10, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511983047098370, 2016511983047098369, 'performance_add', '新增', 'add', '/userPoint/userPerformance/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016894266199486466, 2016445919294554113, 'category', '商品分类', 'menu', '/mall/category', NULL, 1, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016894266199486467, 2016894266199486466, 'category_add', '新增', 'add', '/mall/category/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016894266199486468, 2016894266199486466, 'category_edit', '修改', 'edit', '/mall/category/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016894266199486469, 2016894266199486466, 'category_delete', '删除', 'delete', '/api/blade-category/category/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016894266199486470, 2016894266199486466, 'category_view', '查看', 'view', '/mall/category/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511999274860546, 2016446332399943682, 'ads', '广告', 'menu', '/userPackInfo/ads', NULL, 1, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511982136934401, 2016446547672596482, 'mallIntegral', '用户商城积分', 'menu', '/userPoint/userMallIntegral', NULL, 1, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511991586701313, 2016445572647911425, 'commissionAccount', '用户佣金账户', 'menu', '/cashAccount/userCommissionAccount', NULL, 1, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511992614305793, 2016444412729917441, 'genealogy', '用户族谱', 'menu', '/customer/userGenealogy', NULL, 1, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511978492084225, 2016444412729917441, 'levelLog', '用户等级日志', 'menu', '/customer/userLevelLog', NULL, 1, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511996863135745, 2016445572647911425, 'commissionServiceProviderLog', '5%服务商佣金流水', 'menu', '/cashAccount/userCommissionServiceProviderLog', NULL, 7, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511985525932034, 2016446332399943682, 'packageInfo', '用户积分包信息', 'menu', '/userPackInfo/userPackageInfo', NULL, 3, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511982589919234, 2016446547672596482, 'mallIntegralLog', '用户商城积分流水', 'menu', '/userPoint/userMallIntegralLog', NULL, 2, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511998809292801, 2016446547672596482, 'benefitLog', '用户福利值流水', 'menu', '/userPoint/userBenefitLog', NULL, 4, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511998356307970, 2016446547672596482, 'cashLog', '用户现金券流水', 'menu', '/userPoint/userCashLog', NULL, 6, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511979599380482, 2016446547672596482, 'cash', '用户现金券', 'menu', '/userPoint/userCash', NULL, 5, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511980115279873, 2016446547672596482, 'commission', '用户佣金', 'menu', '/userPoint/userCommission', NULL, 7, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511980631179266, 2016446547672596482, 'commissionLog', '用户佣金流水', 'menu', '/userPoint/userCommissionLog', NULL, 8, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511983047098369, 2016446547672596482, 'performance', '用户现金业绩', 'menu', '/userPoint/userPerformance', NULL, 9, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511981159661570, 2016446547672596482, 'gainsDay', '用户每日加速福利值汇总', 'menu', '/userPoint/userGainsDay', NULL, 12, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511981612646402, 2016446547672596482, 'gainsDayLog', '用户每日加速福利值流水', 'menu', '/userPoint/userGainsDayLog', NULL, 14, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511986561925121, 2016444412729917441, 'level_info', '等级信息', 'menu', '/customer/levelInfo', NULL, 4, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511995743256577, 2016445572647911425, 'commissionGoodsCostLog', '25%商品成本佣金流水', 'menu', '/cashAccount/userCommissionGoodsCostLog', NULL, 2, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511995218968578, 2016445572647911425, 'commissionDirectPushLog', '10%直推人佣金流水', 'menu', '/cashAccount/userCommissionDirectPushLog', NULL, 4, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511993197314049, 2016444412729917441, 'increaseDay', '用户附加信息', 'menu', '/customer/userIncreaseDay', NULL, 3, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511997387423746, 2016445572647911425, 'commissionUserPointLog', '30%购买人获取用户积分佣金流水', 'menu', '/cashAccount/userCommissionUserPointLog', NULL, 3, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511987023298561, 2016444412729917441, 'dailySign', '用户看广告记录', 'menu', '/customer/userDailySign', NULL, 5, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511992102600705, 2016445572647911425, 'commissionAdvertisingLog', '5%广告补贴佣金流水', 'menu', '/cashAccount/userCommissionAdvertisingLog', NULL, 6, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511994174586882, 2016445572647911425, 'commissionAgencyLog', '15%极差代理佣金流水', 'menu', '/cashAccount/userCommissionAgencyLog', NULL, 8, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511994694680577, 2016445572647911425, 'commissionCoCreatorLog', '5%联创佣金流水', 'menu', '/cashAccount/userCommissionCoCreatorLog', NULL, 9, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499535723909122, 2016446332399943682, 'givePackLog', '划拨积分记录', 'menu', '/userPackInfo/givePackLog', NULL, 1, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499535723909123, 2017499535723909122, 'givePackLog_add', '新增', 'add', '/userPackInfo/givePackLog/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499535723909124, 2017499535723909122, 'givePackLog_edit', '修改', 'edit', '/userPackInfo/givePackLog/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499535723909125, 2017499535723909122, 'givePackLog_delete', '删除', 'delete', '/api/blade-givepacklog/givePackLog/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499535723909126, 2017499535723909122, 'givePackLog_view', '查看', 'view', '/userPackInfo/givePackLog/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499534536921089, 2016445919294554113, 'prizeSpu', '奖池商品', 'menu', '/mall/prizeSpu', NULL, 1, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499534536921090, 2017499534536921089, 'prizeSpu_add', '新增', 'add', '/mall/prizeSpu/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499534536921091, 2017499534536921089, 'prizeSpu_edit', '修改', 'edit', '/mall/prizeSpu/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499534536921092, 2017499534536921089, 'prizeSpu_delete', '删除', 'delete', '/api/blade-prizespu/prizeSpu/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499534536921093, 2017499534536921089, 'prizeSpu_view', '查看', 'view', '/mall/prizeSpu/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499535132512257, 2016445919294554113, 'prizeSpuOrder', '奖池商品订单', 'menu', '/mall/prizeSpuOrder', NULL, 1, 1, 0, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499535132512258, 2017499535132512257, 'prizeSpuOrder_add', '新增', 'add', '/mall/prizeSpuOrder/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499535132512259, 2017499535132512257, 'prizeSpuOrder_edit', '修改', 'edit', '/mall/prizeSpuOrder/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499535132512260, 2017499535132512257, 'prizeSpuOrder_delete', '删除', 'delete', '/api/blade-prizespuorder/prizeSpuOrder/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2017499535132512261, 2017499535132512257, 'prizeSpuOrder_view', '查看', 'view', '/mall/prizeSpuOrder/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511987023298562, 2016511987023298561, 'dailySign_add', '新增', 'add', '/customer/userDailySign/add', 'plus', 1, 2, 1, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511987023298563, 2016511987023298561, 'dailySign_edit', '修改', 'edit', '/customer/userDailySign/edit', 'form', 2, 2, 2, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511987023298564, 2016511987023298561, 'dailySign_delete', '删除', 'delete', '/api/blade-dailysign/dailySign/remove', 'delete', 3, 2, 3, 1, NULL, NULL, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (2016511987023298565, 2016511987023298561, 'dailySign_view', '查看', 'view', '/customer/userDailySign/view', 'file-text', 4, 2, 2, 1, NULL, NULL, 0);
|
||||||
8
doc/sql/insert_blade_param.sql
Normal file
8
doc/sql/insert_blade_param.sql
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
INSERT INTO "<table_name>" ("id", "param_name", "param_key", "param_value", "remark", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2016775545220931585, 'app用户注册默认角色信息', 'yichayilu:app:register:role-info', '{"avatar":"https://tse1-mm.cn.bing.net/th/id/OIP-C.BM4bF8_qipHCQu014y_8UgAAAA?w=220&h=217&c=7&r=0&o=7&pid=1.7&rm=3","deptId":"1123598813738675201","postId":"1123598817738675208","roleId":"1123598816738675202"}', 'app用户注册默认角色信息-包含角色、部门、岗位、头像', NULL, NULL, '2026-01-29 15:28:54.508', NULL, '2026-01-29 15:28:54.508', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "param_name", "param_key", "param_value", "remark", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2016918730731626498, '商城app用户隐私政策', 'yichayilu:app:formal:user:privacy', '隐私政策', '商城app用户隐私政策', NULL, NULL, '2026-01-30 00:57:52.597', NULL, '2026-01-30 00:57:52.597', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "param_name", "param_key", "param_value", "remark", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017183573497827329, '商城app订单类型', 'yichayilu:app:formal:order:model_type', '[{"code":"MALL","id":1,"name":"商城"}]', '商城app订单类型', NULL, NULL, '2026-01-30 18:30:16.033', NULL, '2026-01-30 18:30:16.033', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "param_name", "param_key", "param_value", "remark", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017184619259478018, '商城app订单现金兑换积分比例', 'yichayilu:app:formal:mall.cash.to.point.Rate', '0.3', '商城app订单现金兑换积分比例', NULL, NULL, '2026-01-30 18:34:25.363', NULL, '2026-01-30 18:34:25.363', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "param_name", "param_key", "param_value", "remark", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017185330957312002, '商城app随机立减比例范围', 'yichayilu:app:formal:mall.cut.amount.rang', '{"max":0.001,"min":0.01}', '商城app随机立减比例范围', NULL, NULL, '2026-01-30 18:37:15.043', NULL, '2026-01-30 18:37:15.043', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "param_name", "param_key", "param_value", "remark", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017186990513410049, '商城app支付类型', 'yichayilu:app:formal:pay.type', '{1:[{"code":"ALI","id":1,"name":"支付宝"},{"code":"WEI","id":2,"name":"微信"},{"code":"OFFLINE_PAY","id":3,"name":"线下支付"}]}', '商城app支付类型', NULL, NULL, '2026-01-30 18:43:50.713', NULL, '2026-01-30 18:43:50.713', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "param_name", "param_key", "param_value", "remark", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017835848230760450, '积分app是否看广告', 'yichayilu:app:dailysign.is.look.ads', 'true', '积分app是否看广告', NULL, NULL, '2026-02-01 13:42:10.446', NULL, '2026-02-01 13:42:10.446', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "param_name", "param_key", "param_value", "remark", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017836205065338882, '积分app看广告的时间范围', 'yichayilu:app:dailysign:watch.video.time.rang', '{"endTime":"22:00","startTime":"08:00"}', '积分app看广告的时间范围', NULL, NULL, '2026-02-01 13:43:35.522', NULL, '2026-02-01 13:43:35.522', 1, 0);
|
||||||
5
doc/sql/insert_level_info.sql
Normal file
5
doc/sql/insert_level_info.sql
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
INSERT INTO "<table_name>" ("id", "name", "child_qty", "performance", "performance_benefit", "next_level_id", "is_lowest", "is_highest", "bonus_cash_day", "bonus_cash_all", "bonus_benefit", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (1, '社区经销商', 10, '10000.0000', '100000.0000', 2, 0, 0, '0.0500', '0.0000', '0.0800', 1, 1123598821738675201, 1123598813738675201, '2026-01-30 22:54:56.006', 1123598821738675201, '2026-01-30 22:54:56.006', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "name", "child_qty", "performance", "performance_benefit", "next_level_id", "is_lowest", "is_highest", "bonus_cash_day", "bonus_cash_all", "bonus_benefit", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (0, '普通用户', 0, '0.0000', '0.0000', 1, 1, 0, '0.0000', '0.0000', '0.0000', 1, 1123598821738675201, 1123598813738675201, '2026-01-30 22:54:56.006', 1123598821738675201, '2026-01-30 22:54:56.006', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "name", "child_qty", "performance", "performance_benefit", "next_level_id", "is_lowest", "is_highest", "bonus_cash_day", "bonus_cash_all", "bonus_benefit", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2, '社区经销商', 20, '1000000.0000', '1000000.0000', 3, 0, 0, '0.0500', '0.0000', '0.0600', 1, 1123598821738675201, 1123598813738675201, '2026-01-30 22:54:56.006', 1123598821738675201, '2026-01-30 22:54:56.006', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "name", "child_qty", "performance", "performance_benefit", "next_level_id", "is_lowest", "is_highest", "bonus_cash_day", "bonus_cash_all", "bonus_benefit", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (3, '社区经销商', 30, '5000000.0000', '5000000.0000', 4, 0, 0, '0.0500', '0.0000', '0.0400', 1, 1123598821738675201, 1123598813738675201, '2026-01-30 22:54:56.006', 1123598821738675201, '2026-01-30 22:54:56.006', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "name", "child_qty", "performance", "performance_benefit", "next_level_id", "is_lowest", "is_highest", "bonus_cash_day", "bonus_cash_all", "bonus_benefit", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (4, '社区经销商', 40, '20000000.0000', '20000000.0000', NULL, 0, 1, '0.0000', '0.0500', '0.0200', 1, 1123598821738675201, 1123598813738675201, '2026-01-30 22:54:56.006', 1123598821738675201, '2026-01-30 22:54:56.006', 1, 0);
|
||||||
4
doc/sql/insert_package_info.sql
Normal file
4
doc/sql/insert_package_info.sql
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
INSERT INTO "<table_name>" ("id", "name", "buy_qty", "day_total", "amount_total", "give_amount", "bonus", "user_benefit", "user_cash", "is_need_benefit", "is_need_cash", "max_exchange_qty", "exchanged_qty", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017484367073824770, '100积分包', 10, 360, '300.00', '100.00', '0.00', '100.0000', '20.0000', 1, 1, 2000000, 0, 1, 1123598821738675201, 1123598813738675201, '2026-01-31 14:25:30.812', 1123598821738675201, '2026-01-31 14:25:30.812', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "name", "buy_qty", "day_total", "amount_total", "give_amount", "bonus", "user_benefit", "user_cash", "is_need_benefit", "is_need_cash", "max_exchange_qty", "exchanged_qty", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017487266873004034, '5000积分包', 2, 360, '15000.00', '5000.00', '0.00', '5000.0000', '1500.0000', 1, 1, 50000, 0, 1, 1123598821738675201, 1123598813738675201, '2026-01-31 14:37:02.18', 1123598821738675201, '2026-01-31 14:37:02.18', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "name", "buy_qty", "day_total", "amount_total", "give_amount", "bonus", "user_benefit", "user_cash", "is_need_benefit", "is_need_cash", "max_exchange_qty", "exchanged_qty", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017487214255460354, '1000积分包', 4, 360, '3000.00', '1000.00', '0.00', '1000.0000', '300.0000', 1, 1, 1000000, 0, 1, 1123598821738675201, 1123598813738675201, '2026-01-31 14:36:49.643', 1123598821738675201, '2026-01-31 14:36:49.643', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "name", "buy_qty", "day_total", "amount_total", "give_amount", "bonus", "user_benefit", "user_cash", "is_need_benefit", "is_need_cash", "max_exchange_qty", "exchanged_qty", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017487362494746625, '10000积分包', 1, 360, '40000.00', '10000.00', '0.00', '10000.0000', '4000.0000', 1, 1, 20000, 0, 1, 1123598821738675201, 1123598813738675201, '2026-01-31 14:37:24.979', 1123598821738675201, '2026-01-31 14:37:24.979', 1, 0);
|
||||||
8
doc/sql/insert_user_commission_account.sql
Normal file
8
doc/sql/insert_user_commission_account.sql
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
INSERT INTO "<table_name>" ("id", "account_name", "account_number", "account_code", "amount", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017485441885196290, '商品成本账户', 'COMMISSION_GOODS_COST', '', '0.0000', 1, 1123598821738675201, 1123598813738675201, '2026-01-31 14:29:47', 1123598821738675201, '2026-01-31 14:30:16.04', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "account_name", "account_number", "account_code", "amount", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017485893100032002, '分发商城积分账户', 'COMMISSION_USER_POINT_LOG', NULL, '0.0000', 1, 1123598821738675201, 1123598813738675201, '2026-01-31 14:31:34.663', 1123598821738675201, '2026-01-31 14:31:34.663', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "account_name", "account_number", "account_code", "amount", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486037128237058, '分发直推人佣金账户', 'COMMISSION_DIRECT_PUSH', NULL, '0.0000', 1, 1123598821738675201, 1123598813738675201, '2026-01-31 14:32:08.998', 1123598821738675201, '2026-01-31 14:32:08.998', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "account_name", "account_number", "account_code", "amount", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486179294171138, '运营账户', 'COMMISSION_OPERATION', NULL, '0.0000', 1, 1123598821738675201, 1123598813738675201, '2026-01-31 14:32:42.889', 1123598821738675201, '2026-01-31 14:32:42.889', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "account_name", "account_number", "account_code", "amount", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486299502923778, '分发广告补贴账户', 'COMMISSION_ADVERTISING', NULL, '0.0000', 1, 1123598821738675201, 1123598813738675201, '2026-01-31 14:33:11.552', 1123598821738675201, '2026-01-31 14:33:11.552', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "account_name", "account_number", "account_code", "amount", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486437340336130, '分发服务商佣金账户', 'COMMISSION_SERVICE_PROVIDER', NULL, '0.0000', 1, 1123598821738675201, 1123598813738675201, '2026-01-31 14:33:44.407', 1123598821738675201, '2026-01-31 14:33:44.407', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "account_name", "account_number", "account_code", "amount", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486568441696258, '分发极差代理佣金账户', 'COMMISSION_AGENCY', NULL, '0.0000', 1, 1123598821738675201, 1123598813738675201, '2026-01-31 14:34:15.663', 1123598821738675201, '2026-01-31 14:34:15.663', 1, 0);
|
||||||
|
INSERT INTO "<table_name>" ("id", "account_name", "account_number", "account_code", "amount", "version", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486664117964802, '联创佣金账户', 'COMMISSION_CO_CREATOR', NULL, '0.0000', 1, 1123598821738675201, 1123598813738675201, '2026-01-31 14:34:38.479', 1123598821738675201, '2026-01-31 14:34:38.479', 1, 0);
|
||||||
@@ -53,18 +53,35 @@ COMMENT ON COLUMN mall_spu.is_deleted IS '是否已删除';
|
|||||||
|
|
||||||
CREATE TABLE ys_category
|
CREATE TABLE ys_category
|
||||||
(
|
(
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id INTEGER NOT NULL PRIMARY KEY,
|
||||||
cname VARCHAR(100) DEFAULT '' NOT NULL,
|
cname VARCHAR(100) DEFAULT '' NOT NULL,
|
||||||
pid BIGINT DEFAULT 0 NOT NULL,
|
pid BIGINT DEFAULT 0 NOT NULL,
|
||||||
level INTEGER DEFAULT 0 NOT NULL
|
level INTEGER DEFAULT 0 NOT NULL,
|
||||||
|
is_deleted INTEGER DEFAULT 0 NULL,
|
||||||
|
create_time TIMESTAMP(6) NULL,
|
||||||
|
create_user int8 NULL,
|
||||||
|
update_time TIMESTAMP(6) NULL,
|
||||||
|
update_user int8 NULL,
|
||||||
|
status INTEGER NULL,
|
||||||
|
create_dept BIGINT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE SEQUENCE ys_category_id_seq START 1;
|
||||||
|
ALTER TABLE ys_category ALTER COLUMN id SET DEFAULT nextval('ys_category_id_seq');
|
||||||
|
ALTER SEQUENCE ys_category_id_seq OWNED BY ys_category.id;
|
||||||
|
|
||||||
COMMENT ON TABLE ys_category IS '商品分类';
|
COMMENT ON TABLE ys_category IS '商品分类';
|
||||||
COMMENT ON COLUMN ys_category.id IS '主键';
|
COMMENT ON COLUMN ys_category.id IS '主键';
|
||||||
COMMENT ON COLUMN ys_category.cname IS '分类名称';
|
COMMENT ON COLUMN ys_category.cname IS '分类名称';
|
||||||
COMMENT ON COLUMN ys_category.pid IS 'pid';
|
COMMENT ON COLUMN ys_category.pid IS 'pid';
|
||||||
COMMENT ON COLUMN ys_category.level IS 'level';
|
COMMENT ON COLUMN ys_category.level IS 'level';
|
||||||
|
COMMENT ON COLUMN ys_category.is_deleted IS '是否已删除';
|
||||||
|
COMMENT ON COLUMN ys_category.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN ys_category.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN ys_category.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN ys_category.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN ys_category.status IS '状态';
|
||||||
|
COMMENT ON COLUMN ys_category.create_dept IS '创建部门';
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE mall_cart
|
CREATE TABLE mall_cart
|
||||||
@@ -72,8 +89,11 @@ CREATE TABLE mall_cart
|
|||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
user_id BIGINT DEFAULT 0 NOT NULL,
|
user_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
title VARCHAR(200) DEFAULT '' NOT NULL,
|
title VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
spu_id INTEGER DEFAULT 0 NOT NULL,
|
spu_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
quantity INTEGER DEFAULT 0 NOT NULL,
|
quantity INTEGER DEFAULT 0 NOT NULL,
|
||||||
|
original_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
|
main_img VARCHAR(255) DEFAULT '' NOT NULL,
|
||||||
|
retail_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
create_user int8 NULL,
|
create_user int8 NULL,
|
||||||
create_dept int8 NULL,
|
create_dept int8 NULL,
|
||||||
create_time TIMESTAMP NULL,
|
create_time TIMESTAMP NULL,
|
||||||
@@ -90,6 +110,9 @@ COMMENT ON COLUMN mall_cart.user_id IS '用户id';
|
|||||||
COMMENT ON COLUMN mall_cart.title IS '商品名称';
|
COMMENT ON COLUMN mall_cart.title IS '商品名称';
|
||||||
COMMENT ON COLUMN mall_cart.spu_id IS 'spuId';
|
COMMENT ON COLUMN mall_cart.spu_id IS 'spuId';
|
||||||
COMMENT ON COLUMN mall_cart.quantity IS '数量';
|
COMMENT ON COLUMN mall_cart.quantity IS '数量';
|
||||||
|
COMMENT ON COLUMN mall_cart.original_price IS '原价';
|
||||||
|
COMMENT ON COLUMN mall_cart.main_img IS '主图';
|
||||||
|
COMMENT ON COLUMN mall_cart.retail_price IS '销售价';
|
||||||
COMMENT ON COLUMN mall_cart.create_user IS '创建人';
|
COMMENT ON COLUMN mall_cart.create_user IS '创建人';
|
||||||
COMMENT ON COLUMN mall_cart.create_dept IS '创建部门';
|
COMMENT ON COLUMN mall_cart.create_dept IS '创建部门';
|
||||||
COMMENT ON COLUMN mall_cart.create_time IS '创建时间';
|
COMMENT ON COLUMN mall_cart.create_time IS '创建时间';
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ CREATE TABLE user_order
|
|||||||
(
|
(
|
||||||
id BIGINT DEFAULT 0 NOT NULL PRIMARY KEY,
|
id BIGINT DEFAULT 0 NOT NULL PRIMARY KEY,
|
||||||
user_id BIGINT DEFAULT 0 NOT NULL,
|
user_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
|
user_phone bigint,
|
||||||
|
user_name varchar(128),
|
||||||
order_type INTEGER DEFAULT 0 NOT NULL,
|
order_type INTEGER DEFAULT 0 NOT NULL,
|
||||||
order_id BIGINT DEFAULT 0 NOT NULL,
|
order_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
title VARCHAR(256) DEFAULT '' NOT NULL,
|
title VARCHAR(256) DEFAULT '' NOT NULL,
|
||||||
@@ -27,6 +29,8 @@ CREATE TABLE user_order
|
|||||||
COMMENT ON TABLE user_order IS '用户订单';
|
COMMENT ON TABLE user_order IS '用户订单';
|
||||||
COMMENT ON COLUMN user_order.id IS '主键';
|
COMMENT ON COLUMN user_order.id IS '主键';
|
||||||
COMMENT ON COLUMN user_order.user_id IS '用户id';
|
COMMENT ON COLUMN user_order.user_id IS '用户id';
|
||||||
|
COMMENT ON COLUMN user_order.user_phone IS '用户手机号';
|
||||||
|
COMMENT ON COLUMN user_order.user_name IS '用户名称';
|
||||||
COMMENT ON COLUMN user_order.order_type IS '订单类型';
|
COMMENT ON COLUMN user_order.order_type IS '订单类型';
|
||||||
COMMENT ON COLUMN user_order.order_id IS '订单id';
|
COMMENT ON COLUMN user_order.order_id IS '订单id';
|
||||||
COMMENT ON COLUMN user_order.title IS '订单名称';
|
COMMENT ON COLUMN user_order.title IS '订单名称';
|
||||||
@@ -74,6 +78,8 @@ CREATE TABLE mall_summary_order
|
|||||||
(
|
(
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
user_id BIGINT DEFAULT 0 NOT NULL,
|
user_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
|
user_phone bigint,
|
||||||
|
user_name varchar(128),
|
||||||
products_info text NULL,
|
products_info text NULL,
|
||||||
order_info text NULL,
|
order_info text NULL,
|
||||||
confirm_info text NULL,
|
confirm_info text NULL,
|
||||||
@@ -96,6 +102,8 @@ CREATE TABLE mall_summary_order
|
|||||||
give_token DECIMAL(10, 2) NULL,
|
give_token DECIMAL(10, 2) NULL,
|
||||||
actual_give_token DECIMAL(10, 2) NULL,
|
actual_give_token DECIMAL(10, 2) NULL,
|
||||||
is_royalty INTEGER DEFAULT 0 NULL,
|
is_royalty INTEGER DEFAULT 0 NULL,
|
||||||
|
is_recorded INTEGER DEFAULT 0 NULL,
|
||||||
|
is_statistics INTEGER DEFAULT 0 NULL,
|
||||||
remarks VARCHAR(200) DEFAULT '' NOT NULL,
|
remarks VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
version BIGINT DEFAULT 0 NULL,
|
version BIGINT DEFAULT 0 NULL,
|
||||||
create_user int8 NULL,
|
create_user int8 NULL,
|
||||||
@@ -111,6 +119,8 @@ CREATE TABLE mall_summary_order
|
|||||||
COMMENT ON TABLE mall_summary_order IS '商城汇总订单';
|
COMMENT ON TABLE mall_summary_order IS '商城汇总订单';
|
||||||
COMMENT ON COLUMN mall_summary_order.id IS '主键';
|
COMMENT ON COLUMN mall_summary_order.id IS '主键';
|
||||||
COMMENT ON COLUMN mall_summary_order.user_id IS '用户id';
|
COMMENT ON COLUMN mall_summary_order.user_id IS '用户id';
|
||||||
|
COMMENT ON COLUMN mall_summary_order.user_phone IS '用户手机号';
|
||||||
|
COMMENT ON COLUMN mall_summary_order.user_name IS '用户名称';
|
||||||
COMMENT ON COLUMN mall_summary_order.products_info IS '商品信息';
|
COMMENT ON COLUMN mall_summary_order.products_info IS '商品信息';
|
||||||
COMMENT ON COLUMN mall_summary_order.order_info IS '订单信息';
|
COMMENT ON COLUMN mall_summary_order.order_info IS '订单信息';
|
||||||
COMMENT ON COLUMN mall_summary_order.confirm_info IS '订单确认信息';
|
COMMENT ON COLUMN mall_summary_order.confirm_info IS '订单确认信息';
|
||||||
@@ -136,7 +146,9 @@ COMMENT ON COLUMN mall_summary_order.payment_track IS '支付凭证';
|
|||||||
COMMENT ON COLUMN mall_summary_order.expire_time IS '超时时间';
|
COMMENT ON COLUMN mall_summary_order.expire_time IS '超时时间';
|
||||||
COMMENT ON COLUMN mall_summary_order.give_token IS '赠送积分';
|
COMMENT ON COLUMN mall_summary_order.give_token IS '赠送积分';
|
||||||
COMMENT ON COLUMN mall_summary_order.actual_give_token IS '实际赠送扣分';
|
COMMENT ON COLUMN mall_summary_order.actual_give_token IS '实际赠送扣分';
|
||||||
COMMENT ON COLUMN mall_summary_order.is_royalty IS '是否已经给上级分红';
|
COMMENT ON COLUMN mall_summary_order.is_royalty IS '是否已经给上级分红 0=否,1=是';
|
||||||
|
COMMENT ON COLUMN mall_summary_order.is_recorded IS '是否记录资金账户里 0=否,1=是';
|
||||||
|
COMMENT ON COLUMN mall_summary_order.is_statistics IS '是否统计到用户现金业绩里 0=否,1=是';
|
||||||
COMMENT ON COLUMN mall_summary_order.remarks IS '备注';
|
COMMENT ON COLUMN mall_summary_order.remarks IS '备注';
|
||||||
COMMENT ON COLUMN mall_summary_order.status IS '状态';
|
COMMENT ON COLUMN mall_summary_order.status IS '状态';
|
||||||
COMMENT ON COLUMN mall_summary_order.is_deleted IS '是否已删除';
|
COMMENT ON COLUMN mall_summary_order.is_deleted IS '是否已删除';
|
||||||
@@ -144,6 +156,8 @@ COMMENT ON COLUMN mall_summary_order.is_deleted IS '是否已删除';
|
|||||||
|
|
||||||
CREATE INDEX mso_index ON mall_summary_order (user_id);
|
CREATE INDEX mso_index ON mall_summary_order (user_id);
|
||||||
CREATE INDEX mso_status_index ON mall_summary_order (payment_status, status);
|
CREATE INDEX mso_status_index ON mall_summary_order (payment_status, status);
|
||||||
|
CREATE INDEX mso_recorded_index ON mall_summary_order (payment_status, is_recorded);
|
||||||
|
CREATE INDEX mso_statistics_index ON mall_summary_order (payment_status, is_statistics);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -151,6 +165,8 @@ CREATE TABLE mall_detail_order
|
|||||||
(
|
(
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
user_id BIGINT DEFAULT 0 NOT NULL,
|
user_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
|
user_phone bigint,
|
||||||
|
user_name varchar(128),
|
||||||
summary_order_id BIGINT DEFAULT 0 NOT NULL,
|
summary_order_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
spu_id BIGINT DEFAULT 0 NOT NULL,
|
spu_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
quantity INTEGER DEFAULT 0 NOT NULL,
|
quantity INTEGER DEFAULT 0 NOT NULL,
|
||||||
@@ -162,6 +178,10 @@ CREATE TABLE mall_detail_order
|
|||||||
given_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
given_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
remarks VARCHAR(200) DEFAULT '' NOT NULL,
|
remarks VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
order_status INTEGER DEFAULT 0 NOT NULL,
|
order_status INTEGER DEFAULT 0 NOT NULL,
|
||||||
|
freight VARCHAR(200) DEFAULT 0.00 NOT NULL,
|
||||||
|
logistics VARCHAR(200) DEFAULT 0.00 NOT NULL,
|
||||||
|
delivery_time timestamp(6),
|
||||||
|
products_info text NULL,
|
||||||
version integer DEFAULT 0 NULL,
|
version integer DEFAULT 0 NULL,
|
||||||
create_user int8 NULL,
|
create_user int8 NULL,
|
||||||
create_dept int8 NULL,
|
create_dept int8 NULL,
|
||||||
@@ -175,10 +195,11 @@ CREATE TABLE mall_detail_order
|
|||||||
COMMENT ON TABLE mall_detail_order IS '商城详情订单';
|
COMMENT ON TABLE mall_detail_order IS '商城详情订单';
|
||||||
COMMENT ON COLUMN mall_detail_order.id IS '主键';
|
COMMENT ON COLUMN mall_detail_order.id IS '主键';
|
||||||
COMMENT ON COLUMN mall_detail_order.user_id IS '用户id';
|
COMMENT ON COLUMN mall_detail_order.user_id IS '用户id';
|
||||||
|
COMMENT ON COLUMN mall_detail_order.user_phone IS '用户手机号';
|
||||||
|
COMMENT ON COLUMN mall_detail_order.user_name IS '用户名称';
|
||||||
COMMENT ON COLUMN mall_detail_order.summary_order_id IS '主订单id';
|
COMMENT ON COLUMN mall_detail_order.summary_order_id IS '主订单id';
|
||||||
COMMENT ON COLUMN mall_detail_order.spu_id IS '商品id';
|
COMMENT ON COLUMN mall_detail_order.spu_id IS '商品id';
|
||||||
COMMENT ON COLUMN mall_detail_order.quantity IS '数量';
|
COMMENT ON COLUMN mall_detail_order.quantity IS '数量';
|
||||||
COMMENT ON COLUMN mall_detail_order.summary_order_id IS '主订单id';
|
|
||||||
COMMENT ON COLUMN mall_detail_order.spu_id IS '商品id';
|
COMMENT ON COLUMN mall_detail_order.spu_id IS '商品id';
|
||||||
COMMENT ON COLUMN mall_detail_order.quantity IS '数量';
|
COMMENT ON COLUMN mall_detail_order.quantity IS '数量';
|
||||||
COMMENT ON COLUMN mall_detail_order.sku_snapshot IS '商品快照';
|
COMMENT ON COLUMN mall_detail_order.sku_snapshot IS '商品快照';
|
||||||
@@ -189,9 +210,9 @@ COMMENT ON COLUMN mall_detail_order.cost_amount IS '订单成本';
|
|||||||
COMMENT ON COLUMN mall_detail_order.actual_amount IS '实际支付';
|
COMMENT ON COLUMN mall_detail_order.actual_amount IS '实际支付';
|
||||||
COMMENT ON COLUMN mall_detail_order.given_amount IS '赠送积分';
|
COMMENT ON COLUMN mall_detail_order.given_amount IS '赠送积分';
|
||||||
COMMENT ON COLUMN mall_detail_order.remarks IS '备注';
|
COMMENT ON COLUMN mall_detail_order.remarks IS '备注';
|
||||||
COMMENT ON COLUMN mall_detail_order.given_amount IS '赠送积分';
|
COMMENT ON COLUMN mall_detail_order.logistics IS '物流';
|
||||||
COMMENT ON COLUMN mall_detail_order.remarks IS '备注';
|
COMMENT ON COLUMN mall_detail_order.products_info IS '商品信息';
|
||||||
COMMENT ON COLUMN mall_detail_order.remarks IS '备注';
|
COMMENT ON COLUMN mall_detail_order.freight IS '运费';
|
||||||
COMMENT ON COLUMN mall_detail_order.order_status IS '订单状态 0=失败,1=待确认,2=待发货,3=待收货,4=已完成,5=已取消,6=售后中,7=已完结';
|
COMMENT ON COLUMN mall_detail_order.order_status IS '订单状态 0=失败,1=待确认,2=待发货,3=待收货,4=已完成,5=已取消,6=售后中,7=已完结';
|
||||||
COMMENT ON COLUMN mall_detail_order.status IS '状态';
|
COMMENT ON COLUMN mall_detail_order.status IS '状态';
|
||||||
COMMENT ON COLUMN mall_detail_order.is_deleted IS '是否已删除';
|
COMMENT ON COLUMN mall_detail_order.is_deleted IS '是否已删除';
|
||||||
@@ -206,6 +227,8 @@ CREATE TABLE mall_summary_order_after
|
|||||||
(
|
(
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
user_id BIGINT DEFAULT -1 NOT NULL,
|
user_id BIGINT DEFAULT -1 NOT NULL,
|
||||||
|
user_phone bigint,
|
||||||
|
user_name varchar(128),
|
||||||
summary_order_id BIGINT DEFAULT -1 NOT NULL,
|
summary_order_id BIGINT DEFAULT -1 NOT NULL,
|
||||||
goods_id BIGINT DEFAULT -1 NOT NULL,
|
goods_id BIGINT DEFAULT -1 NOT NULL,
|
||||||
sku_id BIGINT NOT NULL,
|
sku_id BIGINT NOT NULL,
|
||||||
@@ -238,6 +261,8 @@ CREATE TABLE mall_summary_order_after
|
|||||||
COMMENT ON TABLE mall_summary_order_after IS '商品售后订单表';
|
COMMENT ON TABLE mall_summary_order_after IS '商品售后订单表';
|
||||||
COMMENT ON COLUMN mall_summary_order_after.id IS '售后订单号';
|
COMMENT ON COLUMN mall_summary_order_after.id IS '售后订单号';
|
||||||
COMMENT ON COLUMN mall_summary_order_after.user_id IS '用户id';
|
COMMENT ON COLUMN mall_summary_order_after.user_id IS '用户id';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.user_phone IS '用户手机号';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.user_name IS '用户名称';
|
||||||
COMMENT ON COLUMN mall_summary_order_after.summary_order_id IS '总订单id';
|
COMMENT ON COLUMN mall_summary_order_after.summary_order_id IS '总订单id';
|
||||||
COMMENT ON COLUMN mall_summary_order_after.goods_id IS '商品ID';
|
COMMENT ON COLUMN mall_summary_order_after.goods_id IS '商品ID';
|
||||||
COMMENT ON COLUMN mall_summary_order_after.sku_id IS '商品订单号';
|
COMMENT ON COLUMN mall_summary_order_after.sku_id IS '商品订单号';
|
||||||
|
|||||||
@@ -13,7 +13,14 @@ CREATE TABLE regions_info
|
|||||||
hotel_city_code VARCHAR(128) NULL,
|
hotel_city_code VARCHAR(128) NULL,
|
||||||
hotel_city_pinyin VARCHAR(128) NULL,
|
hotel_city_pinyin VARCHAR(128) NULL,
|
||||||
hotel_city_initials VARCHAR(4) NULL,
|
hotel_city_initials VARCHAR(4) NULL,
|
||||||
sight_city_name VARCHAR(32) NULL
|
sight_city_name VARCHAR(32) NULL,
|
||||||
|
is_deleted INTEGER DEFAULT 0 NULL,
|
||||||
|
create_time TIMESTAMP(6) NULL,
|
||||||
|
create_user int8 NULL,
|
||||||
|
update_time TIMESTAMP(6) NULL,
|
||||||
|
update_user int8 NULL,
|
||||||
|
status INTEGER NULL,
|
||||||
|
create_dept BIGINT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE regions_info IS '地区详情表';
|
COMMENT ON TABLE regions_info IS '地区详情表';
|
||||||
@@ -31,4 +38,11 @@ COMMENT ON COLUMN regions_info.hotel_city_code IS '酒店地区编码';
|
|||||||
COMMENT ON COLUMN regions_info.hotel_city_pinyin IS '酒店地区拼音';
|
COMMENT ON COLUMN regions_info.hotel_city_pinyin IS '酒店地区拼音';
|
||||||
COMMENT ON COLUMN regions_info.hotel_city_initials IS '酒店地区拼音首字母';
|
COMMENT ON COLUMN regions_info.hotel_city_initials IS '酒店地区拼音首字母';
|
||||||
COMMENT ON COLUMN regions_info.sight_city_name IS '景点城市名';
|
COMMENT ON COLUMN regions_info.sight_city_name IS '景点城市名';
|
||||||
|
COMMENT ON COLUMN regions_info.is_deleted IS '是否删除';
|
||||||
|
COMMENT ON COLUMN regions_info.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN regions_info.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN regions_info.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN regions_info.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN regions_info.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN regions_info.status IS '状态';
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ CREATE TABLE user_daily_sign
|
|||||||
sign_count INTEGER NULL,
|
sign_count INTEGER NULL,
|
||||||
type INTEGER DEFAULT 1 NULL,
|
type INTEGER DEFAULT 1 NULL,
|
||||||
remarks TEXT NULL,
|
remarks TEXT NULL,
|
||||||
|
is_complete INTEGER DEFAULT 0 NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL,
|
is_deleted INTEGER DEFAULT 0 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
create_user int8 NULL,
|
create_user int8 NULL,
|
||||||
@@ -24,6 +25,7 @@ COMMENT ON COLUMN user_daily_sign.user_name IS '用户名称';
|
|||||||
COMMENT ON COLUMN user_daily_sign.statistics_date IS '统计日期';
|
COMMENT ON COLUMN user_daily_sign.statistics_date IS '统计日期';
|
||||||
COMMENT ON COLUMN user_daily_sign.sign_count IS '看广告统计';
|
COMMENT ON COLUMN user_daily_sign.sign_count IS '看广告统计';
|
||||||
COMMENT ON COLUMN user_daily_sign.type IS '广告类型 1-积分分产出';
|
COMMENT ON COLUMN user_daily_sign.type IS '广告类型 1-积分分产出';
|
||||||
|
COMMENT on column user_daily_sign.is_complete is '是否完成 0-未完成 1-完成';
|
||||||
COMMENT ON COLUMN user_daily_sign.remarks IS '备注';
|
COMMENT ON COLUMN user_daily_sign.remarks IS '备注';
|
||||||
comment on column user_daily_sign.create_user is '创建人';
|
comment on column user_daily_sign.create_user is '创建人';
|
||||||
comment on column user_daily_sign.create_dept is '创建部门';
|
comment on column user_daily_sign.create_dept is '创建部门';
|
||||||
@@ -36,6 +38,9 @@ comment on column user_daily_sign.is_deleted is '是否已删除';
|
|||||||
CREATE INDEX uds_date_index
|
CREATE INDEX uds_date_index
|
||||||
ON user_daily_sign (is_deleted, type, statistics_date);
|
ON user_daily_sign (is_deleted, type, statistics_date);
|
||||||
|
|
||||||
|
CREATE INDEX uds_complete_index
|
||||||
|
ON user_daily_sign (is_deleted, statistics_date ,type, is_complete);
|
||||||
|
|
||||||
CREATE INDEX uds_uid_index
|
CREATE INDEX uds_uid_index
|
||||||
ON user_daily_sign (is_deleted, type, user_id, statistics_date);
|
ON user_daily_sign (is_deleted, type, user_id, statistics_date);
|
||||||
|
|
||||||
|
|||||||
@@ -5,12 +5,17 @@ create table user_genealogy
|
|||||||
phone bigint,
|
phone bigint,
|
||||||
level integer default 1, --当前层数
|
level integer default 1, --当前层数
|
||||||
pid bigint,
|
pid bigint,
|
||||||
|
p_name varchar(128),
|
||||||
|
p_phone bigint,
|
||||||
root_id bigint, --遍历当前树
|
root_id bigint, --遍历当前树
|
||||||
group_id bigint, --树内最近团队长的id
|
group_id bigint, --树内最近团队长的id
|
||||||
genealogy_list bigint[], -- 往上所有父级
|
genealogy_list bigint[], -- 往上所有父级
|
||||||
user_child_number int, --用户下线总人数
|
user_child_number int, --用户下线总人数
|
||||||
user_direct_number int, --用户直推总人数
|
user_direct_number int, --用户直推总人数
|
||||||
user_direct_list bigint[], --直推列表
|
user_direct_list bigint[], --直推列表
|
||||||
|
is_revoked integer default 0, --是否注销 0-否 1-是
|
||||||
|
register_date date, -- 注册时间
|
||||||
|
remark text,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
@@ -26,13 +31,18 @@ CREATE INDEX user_direct_list_gin_idx
|
|||||||
ON user_genealogy USING gin (user_direct_list);
|
ON user_genealogy USING gin (user_direct_list);
|
||||||
|
|
||||||
create index user_genealogy_phone_index
|
create index user_genealogy_phone_index
|
||||||
on user_genealogy (is_deleted, phone);
|
on user_genealogy (is_deleted, phone , is_revoked);
|
||||||
|
|
||||||
|
create index user_genealogy_register_date_index
|
||||||
|
on user_genealogy (is_deleted, register_date);
|
||||||
|
|
||||||
comment on table user_genealogy is '用户族谱表';
|
comment on table user_genealogy is '用户族谱表';
|
||||||
comment on column user_genealogy.id is '主键';
|
comment on column user_genealogy.id is '主键';
|
||||||
comment on column user_genealogy.pid is '上级id';
|
comment on column user_genealogy.pid is '上级id';
|
||||||
comment on column user_genealogy.name is '用户名';
|
comment on column user_genealogy.name is '用户名';
|
||||||
comment on column user_genealogy.phone is '手机号';
|
comment on column user_genealogy.phone is '手机号';
|
||||||
|
comment on column user_genealogy.p_name is '上级用户名';
|
||||||
|
comment on column user_genealogy.p_phone is '上级用户手机号';
|
||||||
comment on column user_genealogy.level is '层级';
|
comment on column user_genealogy.level is '层级';
|
||||||
comment on column user_genealogy.root_id is '根节点id';
|
comment on column user_genealogy.root_id is '根节点id';
|
||||||
comment on column user_genealogy.group_id is '团队长id';
|
comment on column user_genealogy.group_id is '团队长id';
|
||||||
@@ -40,6 +50,8 @@ comment on column user_genealogy.genealogy_list is '族谱列表';
|
|||||||
comment on column user_genealogy.user_child_number is '用户下线总人数';
|
comment on column user_genealogy.user_child_number is '用户下线总人数';
|
||||||
comment on column user_genealogy.user_direct_number is '用户直推总人数';
|
comment on column user_genealogy.user_direct_number is '用户直推总人数';
|
||||||
comment on column user_genealogy.user_direct_list is '直推列表';
|
comment on column user_genealogy.user_direct_list is '直推列表';
|
||||||
|
comment on column user_genealogy.is_revoked is '是否注销 0-否 1-是';
|
||||||
|
comment on column user_genealogy.register_date is '注册时间';
|
||||||
comment on column user_genealogy.create_user is '创建人';
|
comment on column user_genealogy.create_user is '创建人';
|
||||||
comment on column user_genealogy.create_dept is '创建部门';
|
comment on column user_genealogy.create_dept is '创建部门';
|
||||||
comment on column user_genealogy.create_time is '创建时间';
|
comment on column user_genealogy.create_time is '创建时间';
|
||||||
@@ -62,6 +74,9 @@ create table user_tree
|
|||||||
p_name varchar(128),
|
p_name varchar(128),
|
||||||
p_phone bigint,
|
p_phone bigint,
|
||||||
p_level integer default 1,
|
p_level integer default 1,
|
||||||
|
is_revoked integer default 0, --是否撤销 0-否 1-是
|
||||||
|
is_sync_genealogy integer default 0, --是否同步族谱 0-否 1-是
|
||||||
|
register_date date, -- 注册时间
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
@@ -75,6 +90,13 @@ create table user_tree
|
|||||||
create index user_tree_phone_index
|
create index user_tree_phone_index
|
||||||
on user_tree (is_deleted, phone);
|
on user_tree (is_deleted, phone);
|
||||||
|
|
||||||
|
create index user_tree_sync_genealogy_index
|
||||||
|
on user_tree (is_deleted, is_sync_genealogy);
|
||||||
|
|
||||||
|
create index user_tree_register_date_index
|
||||||
|
on user_tree (is_deleted, register_date);
|
||||||
|
|
||||||
|
|
||||||
comment on table user_tree is '用户树结构表';
|
comment on table user_tree is '用户树结构表';
|
||||||
comment on column user_tree.id is '主键';
|
comment on column user_tree.id is '主键';
|
||||||
comment on column user_tree.pid is '上级id';
|
comment on column user_tree.pid is '上级id';
|
||||||
@@ -84,6 +106,9 @@ comment on column user_tree.level is '层级';
|
|||||||
comment on column user_tree.p_name is '上级用户名';
|
comment on column user_tree.p_name is '上级用户名';
|
||||||
comment on column user_tree.p_phone is '上级用户手机号';
|
comment on column user_tree.p_phone is '上级用户手机号';
|
||||||
comment on column user_tree.p_level is '上级用户层级';
|
comment on column user_tree.p_level is '上级用户层级';
|
||||||
|
comment on column user_tree.is_revoked is '是否注销 0-否 1-是';
|
||||||
|
comment on column user_tree.is_sync_genealogy is '是否同步族谱 0-否 1-是';
|
||||||
|
comment on column user_tree.register_date is '注册时间';
|
||||||
comment on column user_tree.create_user is '创建人';
|
comment on column user_tree.create_user is '创建人';
|
||||||
comment on column user_tree.create_dept is '创建部门';
|
comment on column user_tree.create_dept is '创建部门';
|
||||||
comment on column user_tree.create_time is '创建时间';
|
comment on column user_tree.create_time is '创建时间';
|
||||||
@@ -99,15 +124,18 @@ create table user_increase_day
|
|||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
name varchar(128),
|
name varchar(128),
|
||||||
phone bigint,
|
phone bigint,
|
||||||
number integer default 1, -- 新增人数
|
|
||||||
direct_number integer default 1, -- 新增人数
|
|
||||||
user_benefit decimal(14, 4) default 0, --福利值
|
|
||||||
order_amount decimal(14, 4) default 0, --订单金额(整个团队)
|
|
||||||
current_level_id int, --用户当前等级
|
current_level_id int, --用户当前等级
|
||||||
current_level_name varchar(12), --用户当前等级
|
current_level_name varchar(12), --用户当前等级
|
||||||
|
pid bigint,
|
||||||
p_name varchar(128),
|
p_name varchar(128),
|
||||||
p_phone bigint,
|
p_phone bigint,
|
||||||
p_level integer default 1,
|
p_level integer default 1,
|
||||||
|
is_real integer default 0, -- 是否实名用户 0-否 1-是
|
||||||
|
real_date timestamp(6), -- 实名时间
|
||||||
|
real_name varchar(128), -- 实名姓名
|
||||||
|
real_id_card varchar(128), -- 实名身份证
|
||||||
|
is_revoked integer default 0, --是否撤销 0-否 1-是
|
||||||
|
register_date date, -- 注册时间
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
@@ -118,16 +146,26 @@ create table user_increase_day
|
|||||||
);
|
);
|
||||||
create index user_increase_day_phone_index
|
create index user_increase_day_phone_index
|
||||||
on user_increase_day (is_deleted, phone);
|
on user_increase_day (is_deleted, phone);
|
||||||
|
|
||||||
|
create index uid_register_date_index
|
||||||
|
on user_increase_day (is_deleted, register_date);
|
||||||
|
|
||||||
comment on table user_increase_day is '用户增加天数表';
|
comment on table user_increase_day is '用户增加天数表';
|
||||||
|
|
||||||
comment on column user_increase_day.id is '主键';
|
comment on column user_increase_day.id is '主键';
|
||||||
comment on column user_increase_day.number is '新增人数';
|
|
||||||
comment on column user_increase_day.direct_number is '新增人数';
|
|
||||||
comment on column user_increase_day.current_level_id is '用户当前等级';
|
comment on column user_increase_day.current_level_id is '用户当前等级';
|
||||||
comment on column user_increase_day.current_level_name is '用户当前等级';
|
comment on column user_increase_day.current_level_name is '用户当前等级';
|
||||||
|
comment on column user_increase_day.name is '用户名';
|
||||||
comment on column user_increase_day.p_name is '上级用户名';
|
comment on column user_increase_day.p_name is '上级用户名';
|
||||||
comment on column user_increase_day.p_phone is '上级用户手机号';
|
comment on column user_increase_day.p_phone is '上级用户手机号';
|
||||||
comment on column user_increase_day.p_level is '上级用户层级';
|
comment on column user_increase_day.p_level is '上级用户层级';
|
||||||
|
comment on column user_increase_day.is_real is '是否实名用户 0-否 1-是';
|
||||||
|
comment on column user_increase_day.real_date is '实名时间';
|
||||||
|
comment on column user_increase_day.real_name is '实名姓名';
|
||||||
|
comment on column user_increase_day.real_id_card is '实名身份证';
|
||||||
|
comment on column user_increase_day.register_date is '注册时间';
|
||||||
|
comment on column user_increase_day.is_revoked is '是否注销 0-否 1-是';
|
||||||
|
comment on column user_increase_day.register_date is '注册时间';
|
||||||
comment on column user_increase_day.create_user is '创建人';
|
comment on column user_increase_day.create_user is '创建人';
|
||||||
comment on column user_increase_day.create_dept is '创建部门';
|
comment on column user_increase_day.create_dept is '创建部门';
|
||||||
comment on column user_increase_day.create_time is '创建时间';
|
comment on column user_increase_day.create_time is '创建时间';
|
||||||
@@ -247,12 +285,12 @@ CREATE TABLE package_info
|
|||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
name VARCHAR(128) NULL,
|
name VARCHAR(128) NULL,
|
||||||
buy_qty INTEGER default 0, -- 最大购买数量
|
buy_qty INTEGER default 0, -- 最大购买数量
|
||||||
day_total decimal(16, 4) default 0, -- 产出总天数
|
day_total integer default 0, -- 产出总天数
|
||||||
amount_total decimal(14, 4) default 0, -- 总产出福利积分
|
amount_total decimal(14, 2) default 0, -- 总产出福利积分
|
||||||
give_amount decimal(14, 4) default 0, -- 购买赠与福利值
|
give_amount decimal(14, 2) default 0, -- 购买赠与福利值
|
||||||
bonus decimal(16, 4) default 0, -- 激活比率
|
bonus decimal(16, 4) default 0, -- 激活比率
|
||||||
user_benefit decimal(14, 4) default 0, --兑换包需要的福利积分
|
user_benefit decimal(14, 2) default 0, --兑换包需要的福利积分
|
||||||
user_cash decimal(14, 4) default 0, --兑换包需要的现金券
|
user_cash decimal(14, 2) default 0, --兑换包需要的现金券
|
||||||
is_need_benefit int DEFAULT 0, --是否需要福利积分
|
is_need_benefit int DEFAULT 0, --是否需要福利积分
|
||||||
is_need_cash int DEFAULT 0, --是否需要现金券
|
is_need_cash int DEFAULT 0, --是否需要现金券
|
||||||
max_exchange_qty integer default 0, -- 全网最大兑换数量
|
max_exchange_qty integer default 0, -- 全网最大兑换数量
|
||||||
@@ -293,8 +331,54 @@ comment on column package_info.is_deleted is '是否已删除';
|
|||||||
alter table package_info
|
alter table package_info
|
||||||
owner to postgres;
|
owner to postgres;
|
||||||
|
|
||||||
|
create table give_pack_log
|
||||||
|
(
|
||||||
|
id bigint not null primary key,
|
||||||
|
statistical_date date,
|
||||||
|
user_id bigint,
|
||||||
|
phone bigint,
|
||||||
|
user_name varchar(128),
|
||||||
|
package_id bigint,
|
||||||
|
package_name varchar(128),
|
||||||
|
package_detail text,
|
||||||
|
give_number integer default 1,
|
||||||
|
remark text,
|
||||||
|
create_user int8,
|
||||||
|
create_dept int8,
|
||||||
|
create_time timestamp(6),
|
||||||
|
update_user int8,
|
||||||
|
update_time timestamp(6),
|
||||||
|
status integer default 1,
|
||||||
|
is_deleted integer default 0
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
create index gpl_date_index
|
||||||
|
on give_pack_log (is_deleted, statistical_date ,user_id);
|
||||||
|
|
||||||
|
|
||||||
|
COMMENT ON TABLE give_pack_log IS '划拨积分记录';
|
||||||
|
COMMENT ON COLUMN give_pack_log.id IS '主键';
|
||||||
|
COMMENT ON COLUMN give_pack_log.statistical_date IS '统计日期';
|
||||||
|
COMMENT ON COLUMN give_pack_log.user_id IS '用户id';
|
||||||
|
COMMENT ON COLUMN give_pack_log.phone IS '用户手机号';
|
||||||
|
COMMENT ON COLUMN give_pack_log.user_name IS '用户名';
|
||||||
|
COMMENT ON COLUMN give_pack_log.package_id IS '积分包id';
|
||||||
|
COMMENT ON COLUMN give_pack_log.package_name IS '积分包名称';
|
||||||
|
COMMENT ON COLUMN give_pack_log.package_detail IS '积分包信息快照';
|
||||||
|
COMMENT ON COLUMN give_pack_log.give_number IS '赠送数量';
|
||||||
|
COMMENT ON COLUMN give_pack_log.remark IS '备注';
|
||||||
|
comment on column give_pack_log.create_user is '创建人';
|
||||||
|
comment on column give_pack_log.create_dept is '创建部门';
|
||||||
|
comment on column give_pack_log.create_time is '创建时间';
|
||||||
|
comment on column give_pack_log.update_user is '修改人';
|
||||||
|
comment on column give_pack_log.update_time is '修改时间';
|
||||||
|
comment on column give_pack_log.status is '状态';
|
||||||
|
comment on column give_pack_log.is_deleted is '是否已删除';
|
||||||
|
|
||||||
|
alter table give_pack_log
|
||||||
|
owner to postgres;
|
||||||
|
|
||||||
create table user_package_info
|
create table user_package_info
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
@@ -304,14 +388,15 @@ create table user_package_info
|
|||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
package_id bigint,
|
package_id bigint,
|
||||||
package_name varchar(128),
|
package_name varchar(128),
|
||||||
user_benefit decimal(14, 4) default 0, --兑换包需要的福利积分
|
type integer default 1, -- 1-积分兑换 2-后台划拨
|
||||||
user_cash decimal(14, 4) default 0, --兑换包需要的现金券
|
user_benefit decimal(14, 2) default 0, --兑换包需要的福利积分
|
||||||
give_amount decimal(14, 4) default 0, -- 购买赠与福利值
|
user_cash decimal(14, 2) default 0, --兑换包需要的现金券
|
||||||
day_total decimal(16, 4) default 0, -- 产出总天数
|
give_amount decimal(14, 2) default 0, -- 购买赠与福利值
|
||||||
amount_total decimal(14, 4) default 0, -- 总产出福利积分
|
day_total integer default 0, -- 产出总天数
|
||||||
amount_day decimal(14, 4) default 0, -- 每日产出福利积分 = 总产出 / 总产出
|
amount_total decimal(14, 2) default 0, -- 总产出福利积分
|
||||||
|
amount_day decimal(14, 2) default 0, -- 每日产出福利积分 = 总产出 / 总产出
|
||||||
amount_out decimal(16, 4) default 0, -- 已产出福利积分
|
amount_out decimal(16, 4) default 0, -- 已产出福利积分
|
||||||
out_day decimal(16, 4) default 0, -- 已产出天数
|
out_day integer default 0, -- 已产出天数
|
||||||
is_complete integer default 0, -- 是否完成 0未完成 1完成
|
is_complete integer default 0, -- 是否完成 0未完成 1完成
|
||||||
expired_date timestamp(6),
|
expired_date timestamp(6),
|
||||||
is_expired integer default 0,
|
is_expired integer default 0,
|
||||||
@@ -325,6 +410,9 @@ create table user_package_info
|
|||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
create index upi_complete_index
|
create index upi_complete_index
|
||||||
on user_package_info (is_deleted, user_id , is_complete , is_expired);
|
on user_package_info (is_deleted, user_id , is_complete , is_expired);
|
||||||
|
|
||||||
@@ -341,6 +429,7 @@ COMMENT ON COLUMN user_package_info.phone IS '用户手机号';
|
|||||||
COMMENT ON COLUMN user_package_info.user_name IS '用户名';
|
COMMENT ON COLUMN user_package_info.user_name IS '用户名';
|
||||||
COMMENT ON COLUMN user_package_info.package_id IS '积分包id';
|
COMMENT ON COLUMN user_package_info.package_id IS '积分包id';
|
||||||
COMMENT ON COLUMN user_package_info.package_name IS '积分包名称';
|
COMMENT ON COLUMN user_package_info.package_name IS '积分包名称';
|
||||||
|
COMMENT ON COLUMN user_package_info.type IS '1-积分兑换 2-后台划拨';
|
||||||
COMMENT ON COLUMN user_package_info.user_benefit IS '兑换包需要的福利积分';
|
COMMENT ON COLUMN user_package_info.user_benefit IS '兑换包需要的福利积分';
|
||||||
COMMENT ON COLUMN user_package_info.user_cash IS '兑换包需要的现金券';
|
COMMENT ON COLUMN user_package_info.user_cash IS '兑换包需要的现金券';
|
||||||
COMMENT ON COLUMN user_package_info.give_amount IS '购买赠与福利值';
|
COMMENT ON COLUMN user_package_info.give_amount IS '购买赠与福利值';
|
||||||
@@ -364,6 +453,9 @@ comment on column user_package_info.is_deleted is '是否已删除';
|
|||||||
alter table user_package_info
|
alter table user_package_info
|
||||||
owner to postgres;
|
owner to postgres;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
create table user_package_info_copy
|
create table user_package_info_copy
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
@@ -371,24 +463,26 @@ create table user_package_info_copy
|
|||||||
user_id bigint,
|
user_id bigint,
|
||||||
phone bigint,
|
phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
user_package_info bigint, --user_package_info id
|
user_package_info_Id bigint, --user_package_info id
|
||||||
package_id bigint,
|
package_id bigint,
|
||||||
package_name varchar(128),
|
package_name varchar(128),
|
||||||
user_benefit decimal(14, 4) default 0, --兑换包需要的福利积分
|
type integer default 1, -- 1-积分兑换 2-后台划拨
|
||||||
user_cash decimal(14, 4) default 0, --兑换包需要的现金券
|
user_benefit decimal(14, 2) default 0, --兑换包需要的福利积分
|
||||||
give_amount decimal(14, 4) default 0, -- 购买赠与福利值
|
user_cash decimal(14, 2) default 0, --兑换包需要的现金券
|
||||||
day_total decimal(16, 4) default 0, -- 产出总天数
|
give_amount decimal(14, 2) default 0, -- 购买赠与福利值
|
||||||
amount_total decimal(14, 4) default 0, -- 总产出福利积分
|
day_total integer default 0, -- 产出总天数
|
||||||
amount_day decimal(14, 4) default 0, -- 每日产出福利积分 = 总产出 / 总产出
|
amount_total decimal(14, 2) default 0, -- 总产出福利积分
|
||||||
|
amount_day decimal(14, 2) default 0, -- 每日产出福利积分 = 总产出 / 总产出
|
||||||
amount_out decimal(16, 4) default 0, -- 已产出多少福利积分
|
amount_out decimal(16, 4) default 0, -- 已产出多少福利积分
|
||||||
remaining_amount decimal(16, 4) default 0, -- 剩余可产出福利积分 (总计 - 已经经历多少天 * 每天产出 - 加速积分)
|
remaining_amount decimal(16, 4) default 0, -- 剩余可产出福利积分 (总计 - 已经经历多少天 * 每天产出 - 加速积分)
|
||||||
accelerated_amount decimal(16, 4) default 0, -- 已加速多少福利积分
|
accelerated_amount decimal(16, 4) default 0, -- 已加速多少福利积分
|
||||||
parent_id bigint, -- 给到谁10%积分,到用户id
|
parent_id bigint, -- 给到谁10%积分,到用户id
|
||||||
parent_amount decimal(16, 4) default 0, -- 给到谁10%积分,到积分账户(福利积分)
|
parent_amount decimal(16, 4) default 0, -- 给到谁10%积分,到积分账户(福利积分)
|
||||||
out_day decimal(16, 4) default 0, -- 产出天数 当前包已经产出天数
|
out_day integer default 0, -- 产出天数 当前包已经产出天数
|
||||||
experience_day decimal(16, 4) default 0, -- 当前包已经经历的天数
|
experience_day integer default 0, -- 当前包已经经历的天数
|
||||||
not_sign_list bigint[], -- 未签到日期详情 (数组)
|
not_sign_list bigint[], -- 未签到日期详情 (数组)
|
||||||
is_complete integer default 0, -- 是否完成 0未完成 1完成
|
is_complete integer default 0, -- 是否完成 0未完成 1完成
|
||||||
|
active_time timestamp(6), -- 当前包激活时间
|
||||||
start_time timestamp(6), -- 当前包生效时间
|
start_time timestamp(6), -- 当前包生效时间
|
||||||
sign_bitmap bigint default 0, -- 位图将包的签到时间360天二进制转成十进制
|
sign_bitmap bigint default 0, -- 位图将包的签到时间360天二进制转成十进制
|
||||||
expired_date timestamp(6),
|
expired_date timestamp(6),
|
||||||
@@ -405,7 +499,7 @@ create table user_package_info_copy
|
|||||||
|
|
||||||
);
|
);
|
||||||
create index upi_copy_complete_index
|
create index upi_copy_complete_index
|
||||||
on user_package_info_copy (is_deleted, user_id , is_complete , is_expired);
|
on user_package_info_copy (is_deleted, is_complete , is_expired ,user_id );
|
||||||
create index upi_copy_date_index
|
create index upi_copy_date_index
|
||||||
on user_package_info_copy (is_deleted, statistical_date ,user_id);
|
on user_package_info_copy (is_deleted, statistical_date ,user_id);
|
||||||
create index upi_copy_expired_index
|
create index upi_copy_expired_index
|
||||||
@@ -419,6 +513,7 @@ COMMENT ON COLUMN user_package_info_copy.user_name IS '用户名';
|
|||||||
COMMENT ON COLUMN user_package_info_copy.user_package_info IS '用户积分包id';
|
COMMENT ON COLUMN user_package_info_copy.user_package_info IS '用户积分包id';
|
||||||
COMMENT ON COLUMN user_package_info_copy.package_id IS '积分包id';
|
COMMENT ON COLUMN user_package_info_copy.package_id IS '积分包id';
|
||||||
COMMENT ON COLUMN user_package_info_copy.package_name IS '积分包名称';
|
COMMENT ON COLUMN user_package_info_copy.package_name IS '积分包名称';
|
||||||
|
COMMENT ON COLUMN user_package_info_copy.type IS '1-积分兑换 2-后台划拨';
|
||||||
COMMENT ON COLUMN user_package_info_copy.user_benefit IS '兑换包需要的福利积分';
|
COMMENT ON COLUMN user_package_info_copy.user_benefit IS '兑换包需要的福利积分';
|
||||||
COMMENT ON COLUMN user_package_info_copy.user_cash IS '兑换包需要的现金券';
|
COMMENT ON COLUMN user_package_info_copy.user_cash IS '兑换包需要的现金券';
|
||||||
COMMENT ON COLUMN user_package_info_copy.give_amount IS '购买赠与福利值';
|
COMMENT ON COLUMN user_package_info_copy.give_amount IS '购买赠与福利值';
|
||||||
@@ -435,6 +530,7 @@ COMMENT ON COLUMN user_package_info_copy.experience_day IS '当前包已经经
|
|||||||
COMMENT ON COLUMN user_package_info_copy.not_sign_list IS '未签到日期详情 (数组)';
|
COMMENT ON COLUMN user_package_info_copy.not_sign_list IS '未签到日期详情 (数组)';
|
||||||
COMMENT ON COLUMN user_package_info_copy.is_complete IS '是否完成 0-未完成 1-完成';
|
COMMENT ON COLUMN user_package_info_copy.is_complete IS '是否完成 0-未完成 1-完成';
|
||||||
COMMENT ON COLUMN user_package_info_copy.start_time IS '当前包生效时间';
|
COMMENT ON COLUMN user_package_info_copy.start_time IS '当前包生效时间';
|
||||||
|
COMMENT ON COLUMN user_package_info_copy.active_time IS '当前包激活时间';
|
||||||
COMMENT ON COLUMN user_package_info_copy.sign_bitmap IS '位图将包的签到时间360天二进制转成十进制';
|
COMMENT ON COLUMN user_package_info_copy.sign_bitmap IS '位图将包的签到时间360天二进制转成十进制';
|
||||||
COMMENT ON COLUMN user_package_info_copy.expired_date IS '过期时间';
|
COMMENT ON COLUMN user_package_info_copy.expired_date IS '过期时间';
|
||||||
COMMENT ON COLUMN user_package_info_copy.is_expired IS '是否过期 0-未过期 1-已过期';
|
COMMENT ON COLUMN user_package_info_copy.is_expired IS '是否过期 0-未过期 1-已过期';
|
||||||
@@ -457,7 +553,7 @@ create table user_commission_account
|
|||||||
account_name varchar(128), -- 账户名称
|
account_name varchar(128), -- 账户名称
|
||||||
account_number varchar(64), -- 账户编号
|
account_number varchar(64), -- 账户编号
|
||||||
account_code varchar(64), -- 账户代码
|
account_code varchar(64), -- 账户代码
|
||||||
amount decimal(14, 4) default 0, -- 账户总余额
|
amount decimal(14, 2) default 0, -- 账户总余额
|
||||||
version int default 1,
|
version int default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
@@ -500,15 +596,13 @@ create table user_commission_goods_cost_log
|
|||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14, 4) default 0, -- 变动金额
|
amount decimal(14, 2) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
|
||||||
channel_detail text, -- 渠道详情
|
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
@@ -538,8 +632,6 @@ comment on column user_commission_goods_cost_log.order_id is '订单id';
|
|||||||
comment on column user_commission_goods_cost_log.order_detail is '订单详情';
|
comment on column user_commission_goods_cost_log.order_detail is '订单详情';
|
||||||
comment on column user_commission_goods_cost_log.type is '类型 1-收入 2-支出';
|
comment on column user_commission_goods_cost_log.type is '类型 1-收入 2-支出';
|
||||||
comment on column user_commission_goods_cost_log.statistical_date is '统计时间';
|
comment on column user_commission_goods_cost_log.statistical_date is '统计时间';
|
||||||
comment on column user_commission_goods_cost_log.channel is '渠道';
|
|
||||||
comment on column user_commission_goods_cost_log.channel_detail is '渠道详情';
|
|
||||||
comment on column user_commission_goods_cost_log.remark is '备注';
|
comment on column user_commission_goods_cost_log.remark is '备注';
|
||||||
comment on column user_commission_goods_cost_log.create_user is '创建人';
|
comment on column user_commission_goods_cost_log.create_user is '创建人';
|
||||||
comment on column user_commission_goods_cost_log.create_dept is '创建部门';
|
comment on column user_commission_goods_cost_log.create_dept is '创建部门';
|
||||||
@@ -563,15 +655,13 @@ create table user_commission_user_point_log
|
|||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14, 4) default 0, -- 变动金额
|
amount decimal(14, 2) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
|
||||||
channel_detail text, -- 渠道详情
|
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
@@ -601,8 +691,6 @@ comment on column user_commission_user_point_log.order_id is '订单id';
|
|||||||
comment on column user_commission_user_point_log.order_detail is '订单详情';
|
comment on column user_commission_user_point_log.order_detail is '订单详情';
|
||||||
comment on column user_commission_user_point_log.type is '类型 1-收入 2-支出';
|
comment on column user_commission_user_point_log.type is '类型 1-收入 2-支出';
|
||||||
comment on column user_commission_user_point_log.statistical_date is '统计时间';
|
comment on column user_commission_user_point_log.statistical_date is '统计时间';
|
||||||
comment on column user_commission_user_point_log.channel is '渠道';
|
|
||||||
comment on column user_commission_user_point_log.channel_detail is '渠道详情';
|
|
||||||
comment on column user_commission_user_point_log.remark is '备注';
|
comment on column user_commission_user_point_log.remark is '备注';
|
||||||
comment on column user_commission_user_point_log.create_user is '创建人';
|
comment on column user_commission_user_point_log.create_user is '创建人';
|
||||||
comment on column user_commission_user_point_log.create_dept is '创建部门';
|
comment on column user_commission_user_point_log.create_dept is '创建部门';
|
||||||
@@ -626,15 +714,13 @@ create table user_commission_direct_push_log
|
|||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14, 4) default 0, -- 变动金额
|
amount decimal(14, 2) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
|
||||||
channel_detail text, -- 渠道详情
|
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
@@ -664,8 +750,6 @@ comment on column user_commission_direct_push_log.order_id is '订单id';
|
|||||||
comment on column user_commission_direct_push_log.order_detail is '订单详情';
|
comment on column user_commission_direct_push_log.order_detail is '订单详情';
|
||||||
comment on column user_commission_direct_push_log.type is '类型 1-收入 2-支出';
|
comment on column user_commission_direct_push_log.type is '类型 1-收入 2-支出';
|
||||||
comment on column user_commission_direct_push_log.statistical_date is '统计时间';
|
comment on column user_commission_direct_push_log.statistical_date is '统计时间';
|
||||||
comment on column user_commission_direct_push_log.channel is '渠道';
|
|
||||||
comment on column user_commission_direct_push_log.channel_detail is '渠道详情';
|
|
||||||
comment on column user_commission_direct_push_log.remark is '备注';
|
comment on column user_commission_direct_push_log.remark is '备注';
|
||||||
comment on column user_commission_direct_push_log.create_user is '创建人';
|
comment on column user_commission_direct_push_log.create_user is '创建人';
|
||||||
comment on column user_commission_direct_push_log.create_dept is '创建部门';
|
comment on column user_commission_direct_push_log.create_dept is '创建部门';
|
||||||
@@ -689,17 +773,15 @@ create table user_commission_operation_log
|
|||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14, 4) default 0, -- 变动金额
|
amount decimal(14, 2) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
|
||||||
channel_detail text, -- 渠道详情
|
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
random_deduction decimal(14, 4) default 0, -- 随机立减金额
|
random_deduction decimal(14, 2) default 0, -- 随机立减金额
|
||||||
random_deduction_desc text, -- 随机立减说明
|
random_deduction_desc text, -- 随机立减说明
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
@@ -729,8 +811,6 @@ comment on column user_commission_operation_log.source_detail is '来源详情';
|
|||||||
comment on column user_commission_operation_log.order_id is '订单id';
|
comment on column user_commission_operation_log.order_id is '订单id';
|
||||||
comment on column user_commission_operation_log.type is '类型 1-收入 2-支出';
|
comment on column user_commission_operation_log.type is '类型 1-收入 2-支出';
|
||||||
comment on column user_commission_operation_log.statistical_date is '统计时间';
|
comment on column user_commission_operation_log.statistical_date is '统计时间';
|
||||||
comment on column user_commission_operation_log.channel is '渠道';
|
|
||||||
comment on column user_commission_operation_log.channel_detail is '渠道详情';
|
|
||||||
comment on column user_commission_operation_log.remark is '备注';
|
comment on column user_commission_operation_log.remark is '备注';
|
||||||
comment on column user_commission_operation_log.random_deduction is '随机立减金额';
|
comment on column user_commission_operation_log.random_deduction is '随机立减金额';
|
||||||
comment on column user_commission_operation_log.random_deduction_desc is '随机立减说明';
|
comment on column user_commission_operation_log.random_deduction_desc is '随机立减说明';
|
||||||
@@ -753,15 +833,13 @@ create table user_commission_advertising_log
|
|||||||
account_name varchar(128), -- 账户名称
|
account_name varchar(128), -- 账户名称
|
||||||
account_number varchar(64), -- 账户编号
|
account_number varchar(64), -- 账户编号
|
||||||
account_code varchar(64), -- 账户代码
|
account_code varchar(64), -- 账户代码
|
||||||
amount decimal(14, 4) default 0, -- 变动金额
|
amount decimal(14, 2) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
|
||||||
channel_detail text, -- 渠道详情
|
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
daily_statistics_date timestamp(6), -- 每日统计日期
|
daily_statistics_date timestamp(6), -- 每日统计日期
|
||||||
statistics_cycle varchar(32), -- 统计周期
|
statistics_cycle varchar(32), -- 统计周期
|
||||||
@@ -790,8 +868,6 @@ comment on column user_commission_advertising_log.order_id is '订单id';
|
|||||||
comment on column user_commission_advertising_log.order_detail is '订单详情';
|
comment on column user_commission_advertising_log.order_detail is '订单详情';
|
||||||
comment on column user_commission_advertising_log.type is '类型 1-收入 2-支出';
|
comment on column user_commission_advertising_log.type is '类型 1-收入 2-支出';
|
||||||
comment on column user_commission_advertising_log.statistical_date is '统计时间';
|
comment on column user_commission_advertising_log.statistical_date is '统计时间';
|
||||||
comment on column user_commission_advertising_log.channel is '渠道';
|
|
||||||
comment on column user_commission_advertising_log.channel_detail is '渠道详情';
|
|
||||||
comment on column user_commission_advertising_log.remark is '备注';
|
comment on column user_commission_advertising_log.remark is '备注';
|
||||||
comment on column user_commission_advertising_log.daily_statistics_date is '每日统计日期';
|
comment on column user_commission_advertising_log.daily_statistics_date is '每日统计日期';
|
||||||
comment on column user_commission_advertising_log.statistics_cycle is '统计周期';
|
comment on column user_commission_advertising_log.statistics_cycle is '统计周期';
|
||||||
@@ -817,18 +893,18 @@ create table user_commission_service_provider_log
|
|||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14, 4) default 0, -- 变动金额
|
amount decimal(14, 2) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
|
||||||
channel_detail text, -- 渠道详情
|
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
service_type varchar(64), -- 服务类型
|
service_type varchar(64), -- 服务类型
|
||||||
service_provider_id bigint, -- 服务商ID
|
service_provider_id bigint, -- 服务商ID
|
||||||
|
address_id bigint,
|
||||||
|
region_id bigint,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
@@ -854,11 +930,11 @@ comment on column user_commission_service_provider_log.source_detail is '来源
|
|||||||
comment on column user_commission_service_provider_log.order_id is '订单id';
|
comment on column user_commission_service_provider_log.order_id is '订单id';
|
||||||
comment on column user_commission_service_provider_log.type is '类型 1-收入 2-支出';
|
comment on column user_commission_service_provider_log.type is '类型 1-收入 2-支出';
|
||||||
comment on column user_commission_service_provider_log.statistical_date is '统计时间';
|
comment on column user_commission_service_provider_log.statistical_date is '统计时间';
|
||||||
comment on column user_commission_service_provider_log.channel is '渠道';
|
|
||||||
comment on column user_commission_service_provider_log.channel_detail is '渠道详情';
|
|
||||||
comment on column user_commission_service_provider_log.remark is '备注';
|
comment on column user_commission_service_provider_log.remark is '备注';
|
||||||
comment on column user_commission_service_provider_log.service_type is '服务类型';
|
comment on column user_commission_service_provider_log.service_type is '服务类型';
|
||||||
comment on column user_commission_service_provider_log.service_provider_id is '服务商ID';
|
comment on column user_commission_service_provider_log.service_provider_id is '服务商ID';
|
||||||
|
comment on column user_commission_service_provider_log.address_id is '收货地址id';
|
||||||
|
comment on column user_commission_service_provider_log.region_id is '省市区id';
|
||||||
comment on column user_commission_service_provider_log.create_user is '创建人';
|
comment on column user_commission_service_provider_log.create_user is '创建人';
|
||||||
comment on column user_commission_service_provider_log.create_dept is '创建部门';
|
comment on column user_commission_service_provider_log.create_dept is '创建部门';
|
||||||
comment on column user_commission_service_provider_log.create_time is '创建时间';
|
comment on column user_commission_service_provider_log.create_time is '创建时间';
|
||||||
@@ -881,15 +957,13 @@ create table user_commission_agency_log
|
|||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14, 4) default 0, -- 变动金额
|
amount decimal(14, 2) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
|
||||||
channel_detail text, -- 渠道详情
|
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
agency_level varchar(32), -- 代理级别
|
agency_level varchar(32), -- 代理级别
|
||||||
agency_parent_id bigint, -- 上级代理ID
|
agency_parent_id bigint, -- 上级代理ID
|
||||||
@@ -921,8 +995,6 @@ comment on column user_commission_agency_log.source_detail is '来源详情';
|
|||||||
comment on column user_commission_agency_log.order_id is '订单id';
|
comment on column user_commission_agency_log.order_id is '订单id';
|
||||||
comment on column user_commission_agency_log.type is '类型 1-收入 2-支出';
|
comment on column user_commission_agency_log.type is '类型 1-收入 2-支出';
|
||||||
comment on column user_commission_agency_log.statistical_date is '统计时间';
|
comment on column user_commission_agency_log.statistical_date is '统计时间';
|
||||||
comment on column user_commission_agency_log.channel is '渠道';
|
|
||||||
comment on column user_commission_agency_log.channel_detail is '渠道详情';
|
|
||||||
comment on column user_commission_agency_log.remark is '备注';
|
comment on column user_commission_agency_log.remark is '备注';
|
||||||
comment on column user_commission_agency_log.agency_level is '代理级别';
|
comment on column user_commission_agency_log.agency_level is '代理级别';
|
||||||
comment on column user_commission_agency_log.agency_parent_id is '上级代理ID';
|
comment on column user_commission_agency_log.agency_parent_id is '上级代理ID';
|
||||||
@@ -948,18 +1020,14 @@ create table user_commission_co_creator_log
|
|||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14, 4) default 0, -- 变动金额
|
amount decimal(14, 2) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
|
||||||
channel_detail text, -- 渠道详情
|
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
co_creator_type varchar(64), -- 联创类型
|
|
||||||
co_creator_rank varchar(32), -- 联创等级
|
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
@@ -985,11 +1053,7 @@ comment on column user_commission_co_creator_log.source_detail is '来源详情'
|
|||||||
comment on column user_commission_co_creator_log.order_id is '订单id';
|
comment on column user_commission_co_creator_log.order_id is '订单id';
|
||||||
comment on column user_commission_co_creator_log.type is '类型 1-收入 2-支出';
|
comment on column user_commission_co_creator_log.type is '类型 1-收入 2-支出';
|
||||||
comment on column user_commission_co_creator_log.statistical_date is '统计时间';
|
comment on column user_commission_co_creator_log.statistical_date is '统计时间';
|
||||||
comment on column user_commission_co_creator_log.channel is '渠道';
|
|
||||||
comment on column user_commission_co_creator_log.channel_detail is '渠道详情';
|
|
||||||
comment on column user_commission_co_creator_log.remark is '备注';
|
comment on column user_commission_co_creator_log.remark is '备注';
|
||||||
comment on column user_commission_co_creator_log.co_creator_type is '联创类型';
|
|
||||||
comment on column user_commission_co_creator_log.co_creator_rank is '联创等级';
|
|
||||||
comment on column user_commission_co_creator_log.create_user is '创建人';
|
comment on column user_commission_co_creator_log.create_user is '创建人';
|
||||||
comment on column user_commission_co_creator_log.create_dept is '创建部门';
|
comment on column user_commission_co_creator_log.create_dept is '创建部门';
|
||||||
comment on column user_commission_co_creator_log.create_time is '创建时间';
|
comment on column user_commission_co_creator_log.create_time is '创建时间';
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
create table user_benefit
|
create table user_benefit
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
amount decimal(14, 2) default 0,
|
||||||
amount decimal(14, 4) default 0,
|
|
||||||
version int default 1,
|
version int default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
@@ -13,12 +12,9 @@ create table user_benefit
|
|||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index user_benefit_index
|
|
||||||
on user_benefit (is_deleted, user_id);
|
|
||||||
|
|
||||||
comment on table user_benefit is '用户福利值表';
|
comment on table user_benefit is '用户福利值表';
|
||||||
comment on column user_benefit.id is '主键';
|
comment on column user_benefit.id is '主键';
|
||||||
comment on column user_benefit.user_id is '用户id';
|
|
||||||
comment on column user_benefit.amount is '金额';
|
comment on column user_benefit.amount is '金额';
|
||||||
comment on column user_benefit.version is '版本号';
|
comment on column user_benefit.version is '版本号';
|
||||||
comment on column user_benefit.create_user is '创建人';
|
comment on column user_benefit.create_user is '创建人';
|
||||||
@@ -38,7 +34,7 @@ create table user_benefit_log
|
|||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14, 4) default 0,
|
amount decimal(14, 2) default 0,
|
||||||
source_id bigint,
|
source_id bigint,
|
||||||
user_pack_id bigint,
|
user_pack_id bigint,
|
||||||
source_detail text,
|
source_detail text,
|
||||||
@@ -90,8 +86,7 @@ alter table user_benefit_log
|
|||||||
create table user_commission
|
create table user_commission
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
amount decimal(14, 2) default 0,
|
||||||
amount decimal(14, 4) default 0,
|
|
||||||
version int default 1,
|
version int default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
@@ -102,12 +97,9 @@ create table user_commission
|
|||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index user_commission_index
|
|
||||||
on user_commission (is_deleted, user_id);
|
|
||||||
|
|
||||||
comment on table user_commission is '用户佣金表';
|
comment on table user_commission is '用户佣金表';
|
||||||
comment on column user_commission.id is '主键';
|
comment on column user_commission.id is '主键';
|
||||||
comment on column user_commission.user_id is '用户id';
|
|
||||||
comment on column user_commission.amount is '佣金金额';
|
comment on column user_commission.amount is '佣金金额';
|
||||||
comment on column user_commission.version is '版本号';
|
comment on column user_commission.version is '版本号';
|
||||||
comment on column user_commission.create_user is '创建人';
|
comment on column user_commission.create_user is '创建人';
|
||||||
@@ -128,7 +120,7 @@ create table user_commission_log
|
|||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14, 4) default 0,
|
amount decimal(14, 2) default 0,
|
||||||
source_id bigint,
|
source_id bigint,
|
||||||
source_detail text,
|
source_detail text,
|
||||||
order_id bigint,
|
order_id bigint,
|
||||||
@@ -178,23 +170,20 @@ alter table user_commission_log
|
|||||||
create table user_cash
|
create table user_cash
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
amount decimal(14, 2) default 0,
|
||||||
amount decimal(14, 4) default 0,
|
|
||||||
version int default 1,
|
version int default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index user_cash_index
|
|
||||||
on user_cash (is_deleted, user_id);
|
|
||||||
|
|
||||||
comment on table user_cash is '用户现金券表';
|
comment on table user_cash is '用户现金券表';
|
||||||
comment on column user_cash.id is '主键';
|
comment on column user_cash.id is '主键';
|
||||||
comment on column user_cash.user_id is '用户id';
|
|
||||||
comment on column user_cash.amount is '面额';
|
comment on column user_cash.amount is '面额';
|
||||||
comment on column user_cash.version is '版本号';
|
comment on column user_cash.version is '版本号';
|
||||||
comment on column user_cash.create_user is '创建人';
|
comment on column user_cash.create_user is '创建人';
|
||||||
@@ -202,6 +191,7 @@ comment on column user_cash.create_dept is '创建部门';
|
|||||||
comment on column user_cash.create_time is '创建时间';
|
comment on column user_cash.create_time is '创建时间';
|
||||||
comment on column user_cash.update_user is '修改人';
|
comment on column user_cash.update_user is '修改人';
|
||||||
comment on column user_cash.update_time is '修改时间';
|
comment on column user_cash.update_time is '修改时间';
|
||||||
|
comment on column user_cash.status is '状态';
|
||||||
comment on column user_cash.is_deleted is '是否已删除';
|
comment on column user_cash.is_deleted is '是否已删除';
|
||||||
|
|
||||||
alter table user_cash
|
alter table user_cash
|
||||||
@@ -214,7 +204,7 @@ create table user_cash_log
|
|||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14, 4) default 0,
|
amount decimal(14, 2) default 0,
|
||||||
source_id bigint,
|
source_id bigint,
|
||||||
source_detail text,
|
source_detail text,
|
||||||
order_id bigint,
|
order_id bigint,
|
||||||
@@ -264,23 +254,19 @@ alter table user_cash_log
|
|||||||
create table user_mall_integral
|
create table user_mall_integral
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
amount decimal(14, 2) default 0,
|
||||||
amount decimal(14, 4) default 0,
|
|
||||||
version int default 1,
|
version int default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index user_mall_integral_index
|
|
||||||
on user_mall_integral (is_deleted, user_id);
|
|
||||||
|
|
||||||
comment on table user_mall_integral is '用户商城积分表';
|
comment on table user_mall_integral is '用户商城积分表';
|
||||||
comment on column user_mall_integral.id is '主键';
|
|
||||||
comment on column user_mall_integral.user_id is '用户id';
|
|
||||||
comment on column user_mall_integral.amount is '面额';
|
comment on column user_mall_integral.amount is '面额';
|
||||||
comment on column user_mall_integral.version is '版本号';
|
comment on column user_mall_integral.version is '版本号';
|
||||||
comment on column user_mall_integral.create_user is '创建人';
|
comment on column user_mall_integral.create_user is '创建人';
|
||||||
@@ -300,7 +286,7 @@ create table user_mall_integral_log
|
|||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14, 4) default 0,
|
amount decimal(14, 2) default 0,
|
||||||
source_id bigint,
|
source_id bigint,
|
||||||
source_detail text,
|
source_detail text,
|
||||||
order_id bigint,
|
order_id bigint,
|
||||||
@@ -353,7 +339,7 @@ create table user_gains_day
|
|||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
statistical_date timestamp(6),
|
statistical_date timestamp(6),
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
amount decimal(14, 4) default 0,
|
amount decimal(14, 2) default 0,
|
||||||
gains_details text,
|
gains_details text,
|
||||||
is_credited integer default 0,
|
is_credited integer default 0,
|
||||||
version int default 1,
|
version int default 1,
|
||||||
@@ -394,7 +380,7 @@ create table user_gains_day_log
|
|||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14, 4) default 0,
|
amount decimal(14, 2) default 0,
|
||||||
source_id bigint,
|
source_id bigint,
|
||||||
source_detail text,
|
source_detail text,
|
||||||
gains_details text,
|
gains_details text,
|
||||||
|
|||||||
45
pom.xml
45
pom.xml
@@ -24,6 +24,7 @@
|
|||||||
<docker.password>admin12345</docker.password>
|
<docker.password>admin12345</docker.password>
|
||||||
<docker.namespace>blade</docker.namespace>
|
<docker.namespace>blade</docker.namespace>
|
||||||
<docker.fabric.version>0.42.0</docker.fabric.version>
|
<docker.fabric.version>0.42.0</docker.fabric.version>
|
||||||
|
<mapstruct.version>1.6.3</mapstruct.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
@@ -250,6 +251,50 @@
|
|||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 短信认证服务sdk -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>dypnsapi20170525</artifactId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>alibabacloud-dypnsapi20170525</artifactId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-all</artifactId>
|
||||||
|
<version>5.8.40</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.xuxueli</groupId>
|
||||||
|
<artifactId>xxl-job-core</artifactId>
|
||||||
|
<version>3.3.2</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>io.netty</groupId>
|
||||||
|
<artifactId>netty-codec-http</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mapstruct</groupId>
|
||||||
|
<artifactId>mapstruct</artifactId>
|
||||||
|
<version>${mapstruct.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mapstruct</groupId>
|
||||||
|
<artifactId>mapstruct-processor</artifactId>
|
||||||
|
<version>${mapstruct.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -0,0 +1,121 @@
|
|||||||
|
package org.springblade.common.config;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.task.AsyncTaskExecutor;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@Slf4j
|
||||||
|
public class AsyncConfiguration {
|
||||||
|
|
||||||
|
private static final int CORE_POOL_SIZE = Runtime.getRuntime().availableProcessors();
|
||||||
|
private static final int MAX_POOL_SIZE = CORE_POOL_SIZE * 2;
|
||||||
|
private static final int QUEUE_CAPACITY = 500;
|
||||||
|
private static final int KEEP_ALIVE_SECONDS = 60;
|
||||||
|
private static final int AWAIT_TERMINATION_SECONDS = 60;
|
||||||
|
|
||||||
|
@Bean("common")
|
||||||
|
public AsyncTaskExecutor commonAsyncExecutor() {
|
||||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||||
|
executor.setCorePoolSize(CORE_POOL_SIZE);
|
||||||
|
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||||
|
executor.setMaxPoolSize(MAX_POOL_SIZE);
|
||||||
|
//缓冲队列500:用来缓冲执行任务的队列
|
||||||
|
executor.setQueueCapacity(QUEUE_CAPACITY);
|
||||||
|
//允许线程的空闲时间60秒:当超过了核心线程出之外的线程在空闲时间到达之后会被销毁
|
||||||
|
executor.setKeepAliveSeconds(KEEP_ALIVE_SECONDS);
|
||||||
|
// CallerRunsPolicy策略:如果添加到线程池失败,那么主线程会自己去执行该任务,不会等待线程池中的线程去执行。
|
||||||
|
//当提交的任务个数大于QueueCapacity,就需要设置该参数,但spring提供的都不太满足业务场景,可以自定义一个,也可以注意不要超过QueueCapacity即可
|
||||||
|
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||||
|
//调度器shutdown被调用时等待当前被调度的任务完成
|
||||||
|
executor.setWaitForTasksToCompleteOnShutdown(true);
|
||||||
|
//等待时长
|
||||||
|
executor.setAwaitTerminationSeconds(AWAIT_TERMINATION_SECONDS);
|
||||||
|
//线程池名的前缀:设置好了之后可以方便我们定位处理任务所在的线程池
|
||||||
|
executor.setThreadNamePrefix("common-Async-");
|
||||||
|
executor.initialize();
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Bean("appRegisterExecutor")
|
||||||
|
public AsyncTaskExecutor appRegisterExecutor() {
|
||||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||||
|
executor.setCorePoolSize(CORE_POOL_SIZE);
|
||||||
|
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||||
|
executor.setMaxPoolSize(MAX_POOL_SIZE);
|
||||||
|
//缓冲队列500:用来缓冲执行任务的队列
|
||||||
|
executor.setQueueCapacity(QUEUE_CAPACITY);
|
||||||
|
//允许线程的空闲时间60秒:当超过了核心线程出之外的线程在空闲时间到达之后会被销毁
|
||||||
|
executor.setKeepAliveSeconds(KEEP_ALIVE_SECONDS);
|
||||||
|
// CallerRunsPolicy策略:如果添加到线程池失败,那么主线程会自己去执行该任务,不会等待线程池中的线程去执行。
|
||||||
|
//当提交的任务个数大于QueueCapacity,就需要设置该参数,但spring提供的都不太满足业务场景,可以自定义一个,也可以注意不要超过QueueCapacity即可
|
||||||
|
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||||
|
//调度器shutdown被调用时等待当前被调度的任务完成
|
||||||
|
executor.setWaitForTasksToCompleteOnShutdown(true);
|
||||||
|
//等待时长
|
||||||
|
executor.setAwaitTerminationSeconds(AWAIT_TERMINATION_SECONDS);
|
||||||
|
//线程池名的前缀:设置好了之后可以方便我们定位处理任务所在的线程池
|
||||||
|
executor.setThreadNamePrefix("appRegister-Async-");
|
||||||
|
executor.initialize();
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean("appRevokedExecutor")
|
||||||
|
public AsyncTaskExecutor appRevokedExecutor() {
|
||||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||||
|
executor.setCorePoolSize(CORE_POOL_SIZE);
|
||||||
|
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||||
|
executor.setMaxPoolSize(MAX_POOL_SIZE);
|
||||||
|
//缓冲队列500:用来缓冲执行任务的队列
|
||||||
|
executor.setQueueCapacity(QUEUE_CAPACITY);
|
||||||
|
//允许线程的空闲时间60秒:当超过了核心线程出之外的线程在空闲时间到达之后会被销毁
|
||||||
|
executor.setKeepAliveSeconds(KEEP_ALIVE_SECONDS);
|
||||||
|
// CallerRunsPolicy策略:如果添加到线程池失败,那么主线程会自己去执行该任务,不会等待线程池中的线程去执行。
|
||||||
|
//当提交的任务个数大于QueueCapacity,就需要设置该参数,但spring提供的都不太满足业务场景,可以自定义一个,也可以注意不要超过QueueCapacity即可
|
||||||
|
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||||
|
//调度器shutdown被调用时等待当前被调度的任务完成
|
||||||
|
executor.setWaitForTasksToCompleteOnShutdown(true);
|
||||||
|
//等待时长
|
||||||
|
executor.setAwaitTerminationSeconds(AWAIT_TERMINATION_SECONDS);
|
||||||
|
//线程池名的前缀:设置好了之后可以方便我们定位处理任务所在的线程池
|
||||||
|
executor.setThreadNamePrefix("appRevoked-Async-");
|
||||||
|
executor.initialize();
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean("appUserOrderrExecutor")
|
||||||
|
public AsyncTaskExecutor appUserOrderrExecutor() {
|
||||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||||
|
executor.setCorePoolSize(CORE_POOL_SIZE);
|
||||||
|
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||||
|
executor.setMaxPoolSize(MAX_POOL_SIZE);
|
||||||
|
//缓冲队列500:用来缓冲执行任务的队列
|
||||||
|
executor.setQueueCapacity(QUEUE_CAPACITY);
|
||||||
|
//允许线程的空闲时间60秒:当超过了核心线程出之外的线程在空闲时间到达之后会被销毁
|
||||||
|
executor.setKeepAliveSeconds(KEEP_ALIVE_SECONDS);
|
||||||
|
// CallerRunsPolicy策略:如果添加到线程池失败,那么主线程会自己去执行该任务,不会等待线程池中的线程去执行。
|
||||||
|
//当提交的任务个数大于QueueCapacity,就需要设置该参数,但spring提供的都不太满足业务场景,可以自定义一个,也可以注意不要超过QueueCapacity即可
|
||||||
|
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||||
|
//调度器shutdown被调用时等待当前被调度的任务完成
|
||||||
|
executor.setWaitForTasksToCompleteOnShutdown(true);
|
||||||
|
//等待时长
|
||||||
|
executor.setAwaitTerminationSeconds(AWAIT_TERMINATION_SECONDS);
|
||||||
|
//线程池名的前缀:设置好了之后可以方便我们定位处理任务所在的线程池
|
||||||
|
executor.setThreadNamePrefix("appUserOrderr-Async-");
|
||||||
|
executor.initialize();
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -67,6 +67,7 @@ public class BladeConfiguration implements WebMvcConfigurer {
|
|||||||
"/blade-flow/process/resource-view",
|
"/blade-flow/process/resource-view",
|
||||||
"/blade-flow/process/diagram-view",
|
"/blade-flow/process/diagram-view",
|
||||||
"/blade-flow/manager/check-upload",
|
"/blade-flow/manager/check-upload",
|
||||||
|
"/blade-resource/sms/endpoint/send-validate",
|
||||||
"/doc.html",
|
"/doc.html",
|
||||||
"/swagger-ui.html",
|
"/swagger-ui.html",
|
||||||
"/static/**",
|
"/static/**",
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package org.springblade.common.config;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.DbType;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class MybatisPlusConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mybatis-plus.分页插件
|
||||||
|
* @return interceptor
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
|
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||||
|
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.POSTGRE_SQL));
|
||||||
|
interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
|
||||||
|
return interceptor;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package org.springblade.common.config;
|
||||||
|
|
||||||
|
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Configuration
|
||||||
|
public class XxlJobConfig {
|
||||||
|
|
||||||
|
@Value("${xxl.job.admin.addresses}")
|
||||||
|
private String adminAddresses;
|
||||||
|
|
||||||
|
@Value("${xxl.job.accessToken}")
|
||||||
|
private String accessToken;
|
||||||
|
|
||||||
|
@Value("${xxl.job.executor.appname}")
|
||||||
|
private String appname;
|
||||||
|
|
||||||
|
@Value("${xxl.job.executor.address}")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Value("${xxl.job.executor.ip}")
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
@Value("${xxl.job.executor.port}")
|
||||||
|
private int port;
|
||||||
|
|
||||||
|
@Value("${xxl.job.executor.logpath}")
|
||||||
|
private String logPath;
|
||||||
|
|
||||||
|
@Value("${xxl.job.executor.logretentiondays}")
|
||||||
|
private int logRetentionDays;
|
||||||
|
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public XxlJobSpringExecutor xxlJobExecutor() {
|
||||||
|
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
|
||||||
|
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
|
||||||
|
xxlJobSpringExecutor.setAppname(appname);
|
||||||
|
xxlJobSpringExecutor.setAddress(address);
|
||||||
|
xxlJobSpringExecutor.setIp(ip);
|
||||||
|
xxlJobSpringExecutor.setPort(port);
|
||||||
|
xxlJobSpringExecutor.setAccessToken(accessToken);
|
||||||
|
xxlJobSpringExecutor.setLogPath(logPath);
|
||||||
|
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
|
||||||
|
return xxlJobSpringExecutor;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package org.springblade.common.handler;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.ibatis.type.BaseTypeHandler;
|
||||||
|
import org.apache.ibatis.type.JdbcType;
|
||||||
|
|
||||||
|
import java.sql.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class PostgresLongArrayTypeHandler extends BaseTypeHandler<List<Long>> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setNonNullParameter(PreparedStatement ps, int i, List<Long> parameter, JdbcType jdbcType) throws SQLException {
|
||||||
|
java.sql.Array array = ps.getConnection().createArrayOf("bigint", parameter.toArray());
|
||||||
|
ps.setArray(i, array);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Long> getNullableResult(ResultSet rs, String columnName) throws SQLException {
|
||||||
|
Object obj = rs.getObject(columnName);
|
||||||
|
return convertObjectToList(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Long> getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
|
||||||
|
Object obj = rs.getObject(columnIndex);
|
||||||
|
return convertObjectToList(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Long> getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
|
||||||
|
Object obj = cs.getObject(columnIndex);
|
||||||
|
return convertObjectToList(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Long> convertObjectToList(Object obj) {
|
||||||
|
if (obj == null) {
|
||||||
|
return new ArrayList<>(); // 修改:返回空列表而不是null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理 List 类型
|
||||||
|
if (obj instanceof List<?> rawList) {
|
||||||
|
return rawList.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.map(this::convertToLong)
|
||||||
|
.collect(java.util.stream.Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理数组类型
|
||||||
|
if (obj.getClass().isArray()) {
|
||||||
|
Object[] array = (Object[]) obj;
|
||||||
|
return Arrays.stream(array)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.map(this::convertToLong)
|
||||||
|
.collect(java.util.stream.Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理 SQL Array 类型
|
||||||
|
if (obj instanceof Array sqlArray) {
|
||||||
|
try {
|
||||||
|
Object[] array = (Object[]) sqlArray.getArray();
|
||||||
|
return Arrays.stream(array)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.map(this::convertToLong)
|
||||||
|
.collect(java.util.stream.Collectors.toList());
|
||||||
|
} catch (SQLException e) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理 PostgreSQL 数组字符串格式
|
||||||
|
if (obj instanceof String) {
|
||||||
|
return parsePostgreSQLArrayString((String) obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Long> parsePostgreSQLArrayString(String arrayStr) {
|
||||||
|
if (arrayStr == null || !arrayStr.startsWith("{") || !arrayStr.endsWith("}")) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
String content = arrayStr.substring(1, arrayStr.length() - 1);
|
||||||
|
if (content.trim().isEmpty()) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] elements = content.split(",");
|
||||||
|
return Arrays.stream(elements)
|
||||||
|
.map(String::trim)
|
||||||
|
.filter(s -> !s.isEmpty() && !"null".equalsIgnoreCase(s))
|
||||||
|
.map(this::convertToLong)
|
||||||
|
.collect(java.util.stream.Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private Long convertToLong(Object obj) {
|
||||||
|
if (obj instanceof Long) {
|
||||||
|
return (Long) obj;
|
||||||
|
} else if (obj instanceof Number) {
|
||||||
|
return ((Number) obj).longValue();
|
||||||
|
} else if (obj instanceof String) {
|
||||||
|
try {
|
||||||
|
return Long.valueOf(((String) obj));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return 0L;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return Long.valueOf(obj.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package org.springblade.common.utils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class RandomAmountGenerator {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成指定范围内的随机金额
|
||||||
|
*
|
||||||
|
* @param min 最小值
|
||||||
|
* @param max 最大值
|
||||||
|
* @return 随机金额
|
||||||
|
*/
|
||||||
|
public static BigDecimal generateRandomAmount(BigDecimal min, BigDecimal max) {
|
||||||
|
Random random = new Random();
|
||||||
|
double range = max.subtract(min).doubleValue();
|
||||||
|
double randomValue = random.nextDouble() * range + min.doubleValue();
|
||||||
|
return BigDecimal.valueOf(randomValue).setScale(2, RoundingMode.HALF_UP);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
438
src/main/java/org/springblade/common/utils/date/DateUtil.java
Normal file
438
src/main/java/org/springblade/common/utils/date/DateUtil.java
Normal file
@@ -0,0 +1,438 @@
|
|||||||
|
package org.springblade.common.utils.date;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.*;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class DateUtil {
|
||||||
|
|
||||||
|
private static final ThreadLocal<SimpleDateFormat> SIMPLE_DAY = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyy-MM-dd"));
|
||||||
|
private static final ThreadLocal<SimpleDateFormat> SIMPLE_DATE_FORMAT = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
|
||||||
|
public static final ThreadLocal<DateTimeFormatter> THREAD_LOCAL_FORMAT = ThreadLocal.withInitial(() -> DateTimeFormatter.ofPattern("yyyy-MM-dd", Locale.CHINA));
|
||||||
|
|
||||||
|
public static final String yyyyMMddHHmmss = "yyyyMMddHHmmss";
|
||||||
|
public static final String yyyyMMdd = "yyyyMMdd";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算天数
|
||||||
|
*
|
||||||
|
* @param beginDate 开始时间
|
||||||
|
* @param endDate 结束时间
|
||||||
|
*/
|
||||||
|
public static Integer getDaySub(Date beginDate, Date endDate) {
|
||||||
|
try {
|
||||||
|
SimpleDateFormat sdf = SIMPLE_DAY.get();
|
||||||
|
Date start = sdf.parse(sdf.format(beginDate));
|
||||||
|
Date end = sdf.parse(sdf.format(endDate));
|
||||||
|
return Math.toIntExact((end.getTime() - start.getTime()) / (24 * 60 * 60 * 1000));
|
||||||
|
} catch (ParseException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Date geFirstDayOfThisMonth() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取本月最后一天
|
||||||
|
*/
|
||||||
|
public static Date geLastDayOfThisMonth() {
|
||||||
|
Calendar cal = Calendar.getInstance();
|
||||||
|
cal.setTime(new Date());
|
||||||
|
cal.roll(Calendar.DAY_OF_MONTH, -1);
|
||||||
|
return cal.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getThirtyMinuteLate() {
|
||||||
|
Calendar now = Calendar.getInstance();
|
||||||
|
now.add(Calendar.MINUTE, 30);
|
||||||
|
return now.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getSecondsLate(Date date, int seconds) {
|
||||||
|
Calendar result = Calendar.getInstance();
|
||||||
|
result.setTime(date);
|
||||||
|
result.add(Calendar.SECOND, seconds);
|
||||||
|
return result.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getMinutesLate(Date date, int minutes) {
|
||||||
|
Calendar result = Calendar.getInstance();
|
||||||
|
result.setTime(date);
|
||||||
|
result.add(Calendar.MINUTE, minutes);
|
||||||
|
return result.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getHoursLate(Date date, int hours) {
|
||||||
|
Calendar result = Calendar.getInstance();
|
||||||
|
result.setTime(date);
|
||||||
|
result.add(Calendar.HOUR, hours);
|
||||||
|
return result.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getDaysLate(Date date, int days) {
|
||||||
|
Calendar result = Calendar.getInstance();
|
||||||
|
result.setTime(date);
|
||||||
|
result.add(Calendar.DAY_OF_MONTH, days);
|
||||||
|
return result.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getMonthsLate(Date date, int months) {
|
||||||
|
Calendar result = Calendar.getInstance();
|
||||||
|
result.setTime(date);
|
||||||
|
result.add(Calendar.MONTH, months);
|
||||||
|
return result.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getZeroTime(Date date) {
|
||||||
|
Calendar result = Calendar.getInstance();
|
||||||
|
result.setTime(date);
|
||||||
|
result.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
result.set(Calendar.MINUTE, 0);
|
||||||
|
result.set(Calendar.SECOND, 0);
|
||||||
|
result.set(Calendar.MILLISECOND, 0);
|
||||||
|
return result.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isExpireDays(Date date, int i) {
|
||||||
|
Calendar createDate = Calendar.getInstance();
|
||||||
|
createDate.setTime(date);
|
||||||
|
createDate.add(Calendar.DATE, i);
|
||||||
|
return createDate.before(new Date());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Integer getPersonAgeFromIdCard(String pensonnelIdCard) {
|
||||||
|
|
||||||
|
//截取身份证中出行人出生日期中的年、月、日
|
||||||
|
Integer personYear = Integer.parseInt(pensonnelIdCard.substring(6, 10));
|
||||||
|
Integer personMonth = Integer.parseInt(pensonnelIdCard.substring(10, 12));
|
||||||
|
Integer personDay = Integer.parseInt(pensonnelIdCard.substring(12, 14));
|
||||||
|
|
||||||
|
Calendar cal = Calendar.getInstance();
|
||||||
|
// 得到当前时间的年、月、日
|
||||||
|
Integer yearNow = cal.get(Calendar.YEAR);
|
||||||
|
Integer monthNow = cal.get(Calendar.MONTH) + 1;
|
||||||
|
Integer dayNow = cal.get(Calendar.DATE);
|
||||||
|
|
||||||
|
// 用当前年月日减去生日年月日
|
||||||
|
Integer yearMinus = yearNow - personYear;
|
||||||
|
Integer monthMinus = monthNow - personMonth;
|
||||||
|
Integer dayMinus = dayNow - personDay;
|
||||||
|
|
||||||
|
Integer age = yearMinus; //先大致赋值
|
||||||
|
|
||||||
|
if (yearMinus == 0) { //出生年份为当前年份
|
||||||
|
age = 0;
|
||||||
|
} else { //出生年份大于当前年份
|
||||||
|
if (monthMinus < 0) {//出生月份小于当前月份时,还没满周岁
|
||||||
|
age = age - 1;
|
||||||
|
}
|
||||||
|
if (monthMinus == 0) {//当前月份为出生月份时,判断日期
|
||||||
|
if (dayMinus < 0) {//出生日期小于当前月份时,没满周岁
|
||||||
|
age = age - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return age;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getToday() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getYear() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
return calendar.get(Calendar.YEAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getMonth() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
return calendar.get(Calendar.MONTH) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getDay() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
return calendar.get(Calendar.DATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getYesterday() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.DATE, -1);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getBeForeYesterday() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.DATE, -2);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date setDayToNum(int day) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.DATE, day);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getLastWeek() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.DATE, -7);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getSixDaysAgo() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.DATE, -6);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getTomorrow() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.DATE, 1);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Integer getTimeHour() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
return calendar.get(Calendar.HOUR_OF_DAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getTodayHour(String end) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(end));
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getTimeStampSec() {
|
||||||
|
return Integer.valueOf(String.valueOf(Instant.now().getEpochSecond()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getDayOfMonth(Integer month) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.set(Calendar.DAY_OF_MONTH, month);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* "starttime": "11:00",
|
||||||
|
* "endtime": "20:00",
|
||||||
|
*
|
||||||
|
* @param startTime
|
||||||
|
* @param endTime
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int verificationPeriod(String startTime, String endTime) {
|
||||||
|
int status = 0;
|
||||||
|
SimpleDateFormat sdf = SIMPLE_DAY.get();
|
||||||
|
SimpleDateFormat sdtf = SIMPLE_DATE_FORMAT.get();
|
||||||
|
if (StringUtils.hasLength(startTime) && StringUtils.hasLength(endTime) && startTime.length() == 5 && endTime.length() == 5) {
|
||||||
|
String currentDay = sdf.format(new Date());
|
||||||
|
Long current = System.currentTimeMillis();
|
||||||
|
//日期补全
|
||||||
|
String startStr = new StringBuilder(currentDay).append(" ").append(startTime).append(":00").toString();
|
||||||
|
String endStr = new StringBuilder(currentDay).append(" ").append(endTime).append(":00").toString();
|
||||||
|
synchronized (DateUtil.class) {
|
||||||
|
try {
|
||||||
|
Long start = sdtf.parse(startStr).getTime();
|
||||||
|
Long end = sdtf.parse(endStr).getTime();
|
||||||
|
//判断是否跨天
|
||||||
|
if (start > end) {
|
||||||
|
status = current - end >= 0 && current - start <= 0 ? 1 : 0;
|
||||||
|
} else {
|
||||||
|
status = start.equals(end) ? 0 : current - start >= 0 && current - end <= 0 ? 0 : 1;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("错误的日期格式 开始时间 {} 结束时间{}", startTime, endTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date convertFromString(String dateString, String format) {
|
||||||
|
SimpleDateFormat ft = new SimpleDateFormat(format);
|
||||||
|
try {
|
||||||
|
return ft.parse(dateString);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String convertFromDate(Date date, String format) {
|
||||||
|
SimpleDateFormat ft = new SimpleDateFormat(format);
|
||||||
|
return ft.format(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date convertLocalDateTimeToDate(LocalDateTime localDateTime) {
|
||||||
|
ZoneId zoneId = ZoneId.systemDefault();
|
||||||
|
ZonedDateTime zdt = localDateTime.atZone(zoneId);
|
||||||
|
return Date.from(zdt.toInstant());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getDays(Integer number, Integer type) {
|
||||||
|
int days = 0;
|
||||||
|
//计算包对应时长
|
||||||
|
switch (type) {
|
||||||
|
case 1: // 天
|
||||||
|
days = number;
|
||||||
|
break;
|
||||||
|
case 2: // 月
|
||||||
|
days = number * 30;
|
||||||
|
break;
|
||||||
|
case 3: //年
|
||||||
|
days = number * 365;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Assert.isTrue(false, "时间类型错误");
|
||||||
|
}
|
||||||
|
return days;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定日期后x天的日期
|
||||||
|
*
|
||||||
|
* @param start 日期
|
||||||
|
* @param day 天数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Date getSpecifyDay(Date start, int day) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(start);
|
||||||
|
calendar.add(Calendar.DATE, day);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getBegin(Date date) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getEnd(Date date) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.set(Calendar.SECOND, 59);
|
||||||
|
calendar.set(Calendar.MINUTE, 59);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 23);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 999);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getMonthBegin(Date date) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.MONTH, 0);
|
||||||
|
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getMonthEnd(Date date) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||||
|
calendar.set(Calendar.SECOND, 59);
|
||||||
|
calendar.set(Calendar.MINUTE, 59);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 23);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 999);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Long getExpireSecondWithTimestamp(int seconds) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.SECOND, seconds);
|
||||||
|
return calendar.getTime().getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期是否为周六/周日
|
||||||
|
*
|
||||||
|
* @param day
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Boolean dayOfWeek(String day) {
|
||||||
|
DateTimeFormatter formatter = THREAD_LOCAL_FORMAT.get();
|
||||||
|
LocalDate date = LocalDate.parse(day, formatter);
|
||||||
|
switch (date.getDayOfWeek()) {
|
||||||
|
case SATURDAY:
|
||||||
|
case SUNDAY:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package org.springblade.common.utils.jsonSerialize;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonParser;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||||
|
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ArrayToStringDeserializer extends JsonDeserializer<String> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String deserialize(JsonParser p, DeserializationContext ctxt)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
JsonNode node = p.getCodec().readTree(p);
|
||||||
|
|
||||||
|
if (node.isArray()) {
|
||||||
|
List<String> values = new ArrayList<>();
|
||||||
|
for (JsonNode element : node) {
|
||||||
|
values.add(element.asText());
|
||||||
|
}
|
||||||
|
// 将数组元素用逗号连接成字符串
|
||||||
|
return String.join(",", values);
|
||||||
|
} else if (node.isTextual()) {
|
||||||
|
return node.asText();
|
||||||
|
} else {
|
||||||
|
return node.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package org.springblade.common.utils.string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 静态 String 池
|
||||||
|
*
|
||||||
|
* @author L.cm
|
||||||
|
*/
|
||||||
|
public interface StringPool {
|
||||||
|
|
||||||
|
String AMPERSAND = "&";
|
||||||
|
String AND = "and";
|
||||||
|
String AT = "@";
|
||||||
|
String ASTERISK = "*";
|
||||||
|
String STAR = ASTERISK;
|
||||||
|
String SLASH = "/";
|
||||||
|
String BACK_SLASH = "\\";
|
||||||
|
String DOUBLE_SLASH = "#//";
|
||||||
|
String COLON = ":";
|
||||||
|
String COMMA = ",";
|
||||||
|
String DASH = "-";
|
||||||
|
String DOLLAR = "$";
|
||||||
|
String DOT = ".";
|
||||||
|
String EMPTY = "";
|
||||||
|
String EMPTY_JSON = "{}";
|
||||||
|
String EQUALS = "=";
|
||||||
|
String FALSE = "false";
|
||||||
|
String HASH = "#";
|
||||||
|
String HAT = "^";
|
||||||
|
String LEFT_BRACE = "{";
|
||||||
|
String LEFT_BRACKET = "(";
|
||||||
|
String LEFT_CHEV = "<";
|
||||||
|
|
||||||
|
String NEWLINE = "\n";
|
||||||
|
String N = "n";
|
||||||
|
String NO = "no";
|
||||||
|
String NULL = "null";
|
||||||
|
String OFF = "off";
|
||||||
|
String ON = "on";
|
||||||
|
String PERCENT = "%";
|
||||||
|
String PIPE = "|";
|
||||||
|
String PLUS = "+";
|
||||||
|
String QUESTION_MARK = "?";
|
||||||
|
String EXCLAMATION_MARK = "!";
|
||||||
|
String QUOTE = "\"";
|
||||||
|
String RETURN = "\r";
|
||||||
|
String TAB = "\t";
|
||||||
|
String RIGHT_BRACE = "}";
|
||||||
|
String RIGHT_BRACKET = ")";
|
||||||
|
String RIGHT_CHEV = ">";
|
||||||
|
String SEMICOLON = ";";
|
||||||
|
String SINGLE_QUOTE = "'";
|
||||||
|
String BACKTICK = "`";
|
||||||
|
String SPACE = " ";
|
||||||
|
String TILDA = "~";
|
||||||
|
String LEFT_SQ_BRACKET = "[";
|
||||||
|
String RIGHT_SQ_BRACKET = "]";
|
||||||
|
String TRUE = "true";
|
||||||
|
String UNDERSCORE = "_";
|
||||||
|
String UTF_8 = "UTF-8";
|
||||||
|
String GBK = "GBK";
|
||||||
|
String ISO_8859_1 = "ISO-8859-1";
|
||||||
|
String Y = "y";
|
||||||
|
String YES = "yes";
|
||||||
|
String ONE = "1";
|
||||||
|
String ZERO = "0";
|
||||||
|
String MINUS_ONE = "-1";
|
||||||
|
String DOLLAR_LEFT_BRACE = "${";
|
||||||
|
String UNKNOWN = "unknown";
|
||||||
|
String GET = "GET";
|
||||||
|
String POST = "POST";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package org.springblade.modules.appFormal.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.core.mp.support.Condition;
|
||||||
|
import org.springblade.core.mp.support.Query;
|
||||||
|
import org.springblade.core.redis.ratelimiter.RateLimiter;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.modules.appFormal.dto.PayOrderDicDTO;
|
||||||
|
import org.springblade.modules.appFormal.manager.FormalAppBaseManager;
|
||||||
|
import org.springblade.modules.appFormal.manager.FormalAppCustomerManager;
|
||||||
|
import org.springblade.modules.appFormal.manager.FormalAppMallManager;
|
||||||
|
import org.springblade.modules.appFormal.request.CustomerSmsRequest;
|
||||||
|
import org.springblade.modules.appFormal.vo.AppFormalMallSpuVO;
|
||||||
|
import org.springblade.modules.appFormal.vo.MallCategoryVO;
|
||||||
|
import org.springblade.modules.mall.pojo.vo.MallSpuVO;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("formal-app/base")
|
||||||
|
@Tag(name = "基本信息", description = "基本信息接口")
|
||||||
|
public class FormalBaseController {
|
||||||
|
|
||||||
|
private final FormalAppBaseManager appBaseManager;
|
||||||
|
private final FormalAppCustomerManager formalAppCustomerManager;
|
||||||
|
private final FormalAppMallManager mallProductManager;
|
||||||
|
|
||||||
|
@Operation(summary = "隐私政策")
|
||||||
|
@GetMapping("/formal-app-privacy")
|
||||||
|
public R<String> formalAppPrivacy() {
|
||||||
|
return R.data(appBaseManager.formalAppPrivacy());
|
||||||
|
}
|
||||||
|
|
||||||
|
@RateLimiter(value = "yichayilu:sms:send", param = "#request.getPhone()", max = 10, ttl = 12, timeUnit = TimeUnit.HOURS)
|
||||||
|
@Operation(summary = "发送验证码")
|
||||||
|
@PostMapping("/send-sms-code")
|
||||||
|
public R<Boolean> sendSmsCode(@RequestBody CustomerSmsRequest request) {
|
||||||
|
return R.data(formalAppCustomerManager.sendSmsCode(request.getPhone()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分类
|
||||||
|
*/
|
||||||
|
@Operation(summary = "商品类别")
|
||||||
|
@GetMapping("/find-category")
|
||||||
|
public R<List<MallCategoryVO>> findCategories() {
|
||||||
|
return R.data(mallProductManager.findCategories());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品列表
|
||||||
|
*/
|
||||||
|
@Operation(summary = "商品分页")
|
||||||
|
@GetMapping("/spu-list")
|
||||||
|
public R<IPage<AppFormalMallSpuVO>> list(Query query , AppFormalMallSpuVO spuVO) {
|
||||||
|
return R.data(mallProductManager.getSpuPage(Condition.getPage(query), spuVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package org.springblade.modules.appFormal.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.core.mp.support.Condition;
|
||||||
|
import org.springblade.core.mp.support.Query;
|
||||||
|
import org.springblade.core.redis.ratelimiter.RateLimiter;
|
||||||
|
import org.springblade.core.secure.utils.AuthUtil;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.modules.appFormal.manager.FormalAppCustomerManager;
|
||||||
|
import org.springblade.modules.appFormal.request.CustomerSmsRequest;
|
||||||
|
import org.springblade.modules.appFormal.request.UpdatePasswordRequest;
|
||||||
|
import org.springblade.modules.appFormal.vo.MallIntegralLogVO;
|
||||||
|
import org.springblade.modules.appFormal.vo.MallIntegralVO;
|
||||||
|
import org.springblade.modules.appFormal.vo.UserInfoVO;
|
||||||
|
import org.springblade.modules.desk.pojo.vo.NoticeVO;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("formal-app/customer")
|
||||||
|
@Tag(name = "用户信息", description = "用户信息接口")
|
||||||
|
public class FormalCustomerController {
|
||||||
|
|
||||||
|
|
||||||
|
private final FormalAppCustomerManager formalAppCustomerManager;
|
||||||
|
|
||||||
|
|
||||||
|
//用户相关
|
||||||
|
|
||||||
|
@Operation(summary = "校验短信")
|
||||||
|
@PostMapping("/check-sms-code")
|
||||||
|
public R<Boolean> checkSmsCode(@RequestBody CustomerSmsRequest request) {
|
||||||
|
return R.data(formalAppCustomerManager.checkSmsCode(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询用户信息")
|
||||||
|
@GetMapping("/find-userInfo")
|
||||||
|
public R<UserInfoVO> findUserInfo() {
|
||||||
|
return R.data(formalAppCustomerManager.findUserInfo(AuthUtil.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改密码")
|
||||||
|
@PutMapping("/update-password")
|
||||||
|
public R<Boolean> updatePassword(@RequestBody UpdatePasswordRequest request) {
|
||||||
|
return R.data(formalAppCustomerManager.updatePassword(request.setId(AuthUtil.getUserId())));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户退出登录")
|
||||||
|
@PostMapping("/userLogout")
|
||||||
|
public R<Boolean> userLogout() {
|
||||||
|
return R.data(formalAppCustomerManager.userLogout());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "账号注销")
|
||||||
|
@DeleteMapping("/delete-account")
|
||||||
|
public R<Boolean> deleteAccount() {
|
||||||
|
return R.data(formalAppCustomerManager.deleteAccount(AuthUtil.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 商城积分相关
|
||||||
|
|
||||||
|
@Operation(summary = "查询商城积分")
|
||||||
|
@GetMapping("/find-mall-integral")
|
||||||
|
public R<MallIntegralVO> findMallIntegral() {
|
||||||
|
return R.data(formalAppCustomerManager.findMallIntegral(AuthUtil.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询商城积分流水")
|
||||||
|
@GetMapping("/mall-integral-log-page")
|
||||||
|
public R<IPage<MallIntegralLogVO>> findMallIntegralFlow(Query query , MallIntegralLogVO logVO) {
|
||||||
|
return R.data(formalAppCustomerManager.findMallIntegralFlow(Condition.getPage(query), logVO, AuthUtil.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package org.springblade.modules.appFormal.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.core.mp.support.Condition;
|
||||||
|
import org.springblade.core.mp.support.Query;
|
||||||
|
import org.springblade.core.secure.utils.AuthUtil;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.modules.appFormal.manager.FormalAppMallManager;
|
||||||
|
import org.springblade.modules.appFormal.request.AddressRemoveRequest;
|
||||||
|
import org.springblade.modules.appFormal.request.AddressSubmitRequest;
|
||||||
|
import org.springblade.modules.appFormal.request.MallCartRemoveRequest;
|
||||||
|
import org.springblade.modules.appFormal.request.MallCartRequest;
|
||||||
|
import org.springblade.modules.appFormal.vo.*;
|
||||||
|
import org.springblade.modules.mall.pojo.vo.MallSpuVO;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("formal-app/mall")
|
||||||
|
@Tag(name = "商城信息", description = "商城信息接口")
|
||||||
|
public class FormalMallController {
|
||||||
|
|
||||||
|
private final FormalAppMallManager mallProductManager;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//购物车相关
|
||||||
|
@Operation(summary = "购物车列表")
|
||||||
|
@GetMapping("/cart-list")
|
||||||
|
public R<IPage<AppFormalMallCartVO>> cartList(Query query, AppFormalMallCartVO cartVO) {
|
||||||
|
return R.data(mallProductManager.cartList(Condition.getPage( query), cartVO , AuthUtil.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加购物车")
|
||||||
|
@PostMapping("/add-cart")
|
||||||
|
public R<Long> addCart(@RequestBody MallCartRequest request) {
|
||||||
|
return R.data(mallProductManager.addCart(request.setUserId(AuthUtil.getUserId())));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "添加购物车(创建订单之前调用)")
|
||||||
|
@PostMapping("/add-cart-to-order")
|
||||||
|
public R<Long> addCartToOrder(@RequestBody MallCartRequest request) {
|
||||||
|
return R.data(mallProductManager.addCartToOrder(request.setUserId(AuthUtil.getUserId())));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除购物车")
|
||||||
|
@DeleteMapping("/delete-cart")
|
||||||
|
public R<Boolean> deleteCart(@RequestBody MallCartRemoveRequest request) {
|
||||||
|
return R.status(mallProductManager.deleteCart(request.getIds()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "购物车修改数量")
|
||||||
|
@PostMapping("/update-cart-quantity")
|
||||||
|
public R<Boolean> updateCartQuantity(@RequestBody MallCartRequest request) {
|
||||||
|
return R.status(mallProductManager.updateCartQuantity(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
//收货地址相关
|
||||||
|
@Operation(summary = "省市区列表")
|
||||||
|
@GetMapping("/region-list")
|
||||||
|
public R<List<AppFormalRegionInfoVO>> regionInfoList(@RequestParam Integer level, @RequestParam Long pid) {
|
||||||
|
return R.data(mallProductManager.regionInfoList(level , pid));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加收货地址")
|
||||||
|
@PostMapping("/add-address")
|
||||||
|
public R<Boolean> addAddressInfo(@RequestBody AddressSubmitRequest request){
|
||||||
|
return R.data(mallProductManager.submitAddressInfo(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改收货地址")
|
||||||
|
@PostMapping("/update-address")
|
||||||
|
public R<Boolean> updateAddressInfo(@RequestBody AddressSubmitRequest request){
|
||||||
|
return R.data(mallProductManager.submitAddressInfo(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除收货地址")
|
||||||
|
@DeleteMapping("/delete-address")
|
||||||
|
public R<Boolean> deleteAddressInfo( @RequestBody AddressRemoveRequest request){
|
||||||
|
return R.data(mallProductManager.deleteAddressInfo(request.getIds()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "收货地址列表")
|
||||||
|
@GetMapping("/address-list")
|
||||||
|
public R<List<AppFormalAddressVO>> addressInfoList(){
|
||||||
|
return R.data(mallProductManager.addressInfoList(AuthUtil.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package org.springblade.modules.appFormal.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.core.mp.support.Condition;
|
||||||
|
import org.springblade.core.mp.support.Query;
|
||||||
|
import org.springblade.core.secure.utils.AuthUtil;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.modules.appFormal.dto.PayOrderDicDTO;
|
||||||
|
import org.springblade.modules.appFormal.manager.FormalAppBaseManager;
|
||||||
|
import org.springblade.modules.appFormal.manager.FormalAppOrderManager;
|
||||||
|
import org.springblade.modules.appFormal.request.*;
|
||||||
|
import org.springblade.modules.appFormal.vo.*;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("formal-app/order")
|
||||||
|
@Tag(name = "订单信息", description = "订单信息接口")
|
||||||
|
public class FormalOrderController {
|
||||||
|
|
||||||
|
private final FormalAppOrderManager formalAppOrderManager;
|
||||||
|
private final FormalAppBaseManager appBaseManager;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单类型列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Operation(summary = "订单类型列表")
|
||||||
|
@GetMapping("/find-orderBizModel")
|
||||||
|
public R<List<PayOrderDicDTO>> orderBizModel(){
|
||||||
|
return R.data(formalAppOrderManager.orderBizModel());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单列表分页
|
||||||
|
*/
|
||||||
|
@Operation(summary = "订单列表分页")
|
||||||
|
@GetMapping("/order-list")
|
||||||
|
public R<IPage<AppFormalOrderVO>> orderList(Query query, AppFormalOrderVO orderVO) {
|
||||||
|
return R.data(formalAppOrderManager.getOrderList(Condition.getPage( query), orderVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "商城订单详情")
|
||||||
|
@GetMapping("/mall-order-detail")
|
||||||
|
public R<AppFormalMallOrderVO> mallOrderDetail(Long id) {
|
||||||
|
return R.data(formalAppOrderManager.mallOrderDetail(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交订单
|
||||||
|
*/
|
||||||
|
@PostMapping("/mall-make-order")
|
||||||
|
public R<AppFormalPreviewOrderVO> mallMakeOrder( @RequestBody AppFormalPreviewOrderRequest request) {
|
||||||
|
return R.data(formalAppOrderManager.mallMakeOrder(request, AuthUtil.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消订单
|
||||||
|
*/
|
||||||
|
@PostMapping("/mall-cancel-order")
|
||||||
|
public R<Boolean> mallCancelOrder( @RequestBody AppForOrderIdRequest request) {
|
||||||
|
|
||||||
|
return R.data(formalAppOrderManager.mallCancelOrder(request.getId(), AuthUtil.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认收货
|
||||||
|
*/
|
||||||
|
@PostMapping("/mall-confirm-receipt")
|
||||||
|
public R<Boolean> mallConfirmReceipt( @RequestBody AppForOrderIdRequest request) {
|
||||||
|
|
||||||
|
return R.data(formalAppOrderManager.mallConfirmReceipt(request.getId(), AuthUtil.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Operation(summary = "获取支付类型")
|
||||||
|
@GetMapping("/find-payType")
|
||||||
|
public R<List<PayOrderDicDTO>> payType(Integer payModel){
|
||||||
|
return R.data(appBaseManager.payType(payModel));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package org.springblade.modules.appFormal.convert;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
import org.springblade.modules.appFormal.request.AddressSubmitRequest;
|
||||||
|
import org.springblade.modules.appFormal.vo.*;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.MallCartEntity;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.MallSpuEntity;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.UserAddressEntity;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.YsCategoryEntity;
|
||||||
|
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralLogEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author jack
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AppFormalMallConvert {
|
||||||
|
|
||||||
|
AppFormalMallConvert INSTANCE = Mappers.getMapper(AppFormalMallConvert.class);
|
||||||
|
|
||||||
|
|
||||||
|
AppFormalMallSpuVO convertMallSpuToVO(MallSpuEntity entity);
|
||||||
|
|
||||||
|
List<AppFormalMallSpuVO> convertMallSpuListToVO(List<MallSpuEntity> list);
|
||||||
|
Page<AppFormalMallSpuVO> convertMallSpuPageToVO(Page<MallSpuEntity> page);
|
||||||
|
|
||||||
|
|
||||||
|
MallCategoryVO convertMallCategoryToVO(YsCategoryEntity entity);
|
||||||
|
List<MallCategoryVO> convertMallCategoryListToVO(List<YsCategoryEntity> list);
|
||||||
|
|
||||||
|
AppFormalMallCartVO convertMallCartToVO(MallCartEntity entity);
|
||||||
|
List<AppFormalMallCartVO> convertMallCartListToVO(List<MallCartEntity> list);
|
||||||
|
|
||||||
|
Page<AppFormalMallCartVO> convertMallCartPageToVO(Page<MallCartEntity> page);
|
||||||
|
|
||||||
|
|
||||||
|
UserAddressEntity convertRequestToPo(AddressSubmitRequest request);
|
||||||
|
|
||||||
|
AppFormalAddressVO convertPoToVO(UserAddressEntity address);
|
||||||
|
|
||||||
|
List<AppFormalAddressVO> convertPoListToVoList(List<UserAddressEntity> addressList);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.springblade.modules.appFormal.convert;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
import org.springblade.modules.appFormal.vo.MallIntegralLogVO;
|
||||||
|
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralLogEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author jack
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AppUserInfoConvert {
|
||||||
|
|
||||||
|
AppUserInfoConvert INSTANCE = Mappers.getMapper(AppUserInfoConvert.class);
|
||||||
|
|
||||||
|
|
||||||
|
MallIntegralLogVO convertIntegralToVO(UserMallIntegralLogEntity entity);
|
||||||
|
|
||||||
|
List<MallIntegralLogVO> convertIntegralListToVO(List<UserMallIntegralLogEntity> list);
|
||||||
|
Page<MallIntegralLogVO> convertIntegralPageToVO(Page<UserMallIntegralLogEntity> page);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package org.springblade.modules.appFormal.convert;
|
||||||
|
|
||||||
|
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Mapping;
|
||||||
|
import org.mapstruct.Named;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
import org.springblade.modules.appFormal.dto.PreviewDTO;
|
||||||
|
import org.springblade.modules.appFormal.enums.BizTypeEnum;
|
||||||
|
import org.springblade.modules.appFormal.event.OrderEvent;
|
||||||
|
import org.springblade.modules.appFormal.vo.AppFormalMallDetailOrderVO;
|
||||||
|
import org.springblade.modules.appFormal.vo.AppFormalMallOrderVO;
|
||||||
|
import org.springblade.modules.appFormal.vo.AppFormalOrderVO;
|
||||||
|
import org.springblade.modules.appFormal.vo.AppFormalPreviewOrderVO;
|
||||||
|
import org.springblade.modules.order.pojo.entity.MallDetailOrderEntity;
|
||||||
|
import org.springblade.modules.order.pojo.entity.MallSummaryOrderEntity;
|
||||||
|
import org.springblade.modules.order.pojo.entity.UserOrderEntity;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author jack
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AppUserOrderConvert {
|
||||||
|
|
||||||
|
AppUserOrderConvert INSTANCE = Mappers.getMapper(AppUserOrderConvert.class);
|
||||||
|
|
||||||
|
AppFormalOrderVO convertOrderToVO(UserOrderEntity order);
|
||||||
|
|
||||||
|
|
||||||
|
AppFormalMallOrderVO convertMallOrderToVO(MallSummaryOrderEntity order);
|
||||||
|
|
||||||
|
|
||||||
|
AppFormalMallDetailOrderVO convertEntityToVO(MallDetailOrderEntity order);
|
||||||
|
|
||||||
|
|
||||||
|
AppFormalPreviewOrderVO convertPreviewDTOToVO(PreviewDTO previewDTO);
|
||||||
|
|
||||||
|
|
||||||
|
MallSummaryOrderEntity convertPreviewDTOToOrder(PreviewDTO previewDTO);
|
||||||
|
|
||||||
|
MallDetailOrderEntity convertSkuDTOToDetailOrder(PreviewDTO.SkuDTO sku);
|
||||||
|
|
||||||
|
|
||||||
|
UserOrderEntity convertEventToOrder(OrderEvent event);
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.springblade.modules.appFormal.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CutAmountRangDTO {
|
||||||
|
|
||||||
|
private BigDecimal min;
|
||||||
|
private BigDecimal max;
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package org.springblade.modules.appFormal.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典
|
||||||
|
*
|
||||||
|
* @author ganwu
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class PayOrderDicDTO {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* 标识
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private BigDecimal des;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package org.springblade.modules.appFormal.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.UserAddressEntity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class PreviewDTO implements Serializable {
|
||||||
|
|
||||||
|
private List<SkuDTO> skuList = Collections.emptyList();
|
||||||
|
|
||||||
|
private BigDecimal freight = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
private Long vendorRegionsId;
|
||||||
|
|
||||||
|
private Long addressId;
|
||||||
|
|
||||||
|
private UserAddressEntity address;
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
private BigDecimal orderAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
private BigDecimal freightAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
private BigDecimal regularAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
private BigDecimal totalAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
private BigDecimal costAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class SkuDTO implements Serializable {
|
||||||
|
|
||||||
|
private Long spuId = -1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品编码
|
||||||
|
*/
|
||||||
|
private String spuSn;
|
||||||
|
/**
|
||||||
|
* 商品名称
|
||||||
|
*/
|
||||||
|
private String spuName;
|
||||||
|
/**
|
||||||
|
* 主图
|
||||||
|
*/
|
||||||
|
private String mainImg;
|
||||||
|
/**
|
||||||
|
* 详情图(多图,逗号分割)
|
||||||
|
*/
|
||||||
|
private String detailImg;
|
||||||
|
/**
|
||||||
|
* 顶图(多图,逗号分割)
|
||||||
|
*/
|
||||||
|
private String topImg;
|
||||||
|
/**
|
||||||
|
* cate_id分类
|
||||||
|
*/
|
||||||
|
private String cateId;
|
||||||
|
/**
|
||||||
|
* cate_id分类
|
||||||
|
*/
|
||||||
|
private String cateIds;
|
||||||
|
|
||||||
|
private BigDecimal costPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原价
|
||||||
|
*/
|
||||||
|
private BigDecimal originalPrice;
|
||||||
|
/**
|
||||||
|
* 销售价
|
||||||
|
*/
|
||||||
|
private BigDecimal retailPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 销量
|
||||||
|
*/
|
||||||
|
private Integer sales;
|
||||||
|
/**
|
||||||
|
* 库存
|
||||||
|
*/
|
||||||
|
private Integer spuQty;
|
||||||
|
/**
|
||||||
|
* 标签(多标签,逗号分割 )
|
||||||
|
*/
|
||||||
|
private String tags;
|
||||||
|
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package org.springblade.modules.appFormal.enums;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||||
|
public enum BizTypeEnum {
|
||||||
|
|
||||||
|
MALL(1, "商城");
|
||||||
|
|
||||||
|
|
||||||
|
final Integer code;
|
||||||
|
|
||||||
|
final String name;
|
||||||
|
|
||||||
|
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||||
|
public static BizTypeEnum of(Integer code) {
|
||||||
|
if (code == null) return null;
|
||||||
|
return Arrays.stream(BizTypeEnum.values()).filter(i -> i.getCode() == code.intValue()).findAny().orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取订单 状态
|
||||||
|
* @param orderType
|
||||||
|
* @param orderStatus
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getStatusName(Integer orderType, Integer orderStatus) {
|
||||||
|
BizTypeEnum bizTypeEnum = of(orderType);
|
||||||
|
if (bizTypeEnum == null) return "";
|
||||||
|
switch (bizTypeEnum) {
|
||||||
|
|
||||||
|
case MALL:
|
||||||
|
return MallOrderStatusEnum.getByCode(orderStatus).getDescription();
|
||||||
|
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package org.springblade.modules.appFormal.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum MallOrderStatusEnum {
|
||||||
|
|
||||||
|
FAIL(0, "已取消-商品无库存"),
|
||||||
|
WAIT_PAY(1, "待支付"),
|
||||||
|
WAIT_DELIVERY(2, "待发货"),
|
||||||
|
WAIT_RECEIVE(3, "待收货"),
|
||||||
|
COMPLETED(4, "已完成"),
|
||||||
|
CANCELED(5, "已取消"),
|
||||||
|
AFTER_SERVICE(6, "售后中"),
|
||||||
|
FINISHED(7, "已关闭"),
|
||||||
|
FINISHED_AFTER(11, "已售后完成"),
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private final int code;
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
MallOrderStatusEnum(int code, String description) {
|
||||||
|
this.code = code;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 通过code获取对应的枚举值
|
||||||
|
public static MallOrderStatusEnum getByCode(int code) {
|
||||||
|
for (MallOrderStatusEnum status : MallOrderStatusEnum.values()) {
|
||||||
|
if (status.getCode() == code) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Invalid PaymentStatus code: " + code);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package org.springblade.modules.appFormal.event;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springblade.modules.appFormal.enums.BizTypeEnum;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class OrderConfirmOfflineEvent {
|
||||||
|
|
||||||
|
private Long orderId;
|
||||||
|
private BizTypeEnum orderType;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package org.springblade.modules.appFormal.event;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springblade.modules.appFormal.enums.BizTypeEnum;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class OrderEvent {
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
private Long userPhone;
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
private Integer orderType;
|
||||||
|
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
private String images;
|
||||||
|
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private Integer orderStatus;
|
||||||
|
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
private BigDecimal actualAmount;
|
||||||
|
|
||||||
|
private BigDecimal pointAmount;
|
||||||
|
|
||||||
|
private BigDecimal dPointAmount;
|
||||||
|
|
||||||
|
private BigDecimal tokenAmount;
|
||||||
|
|
||||||
|
private Integer paymentType;
|
||||||
|
|
||||||
|
private Date paymentTime;
|
||||||
|
|
||||||
|
private String paymentTrack;
|
||||||
|
|
||||||
|
private Integer paymentStatus;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package org.springblade.modules.appFormal.job;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.modules.appFormal.enums.BizTypeEnum;
|
||||||
|
import org.springblade.modules.appFormal.enums.MallOrderStatusEnum;
|
||||||
|
import org.springblade.modules.order.pojo.entity.MallDetailOrderEntity;
|
||||||
|
import org.springblade.modules.order.pojo.entity.MallSummaryOrderEntity;
|
||||||
|
import org.springblade.modules.order.pojo.entity.UserOrderEntity;
|
||||||
|
import org.springblade.modules.order.service.IMallDetailOrderService;
|
||||||
|
import org.springblade.modules.order.service.IMallSummaryOrderService;
|
||||||
|
import org.springblade.modules.order.service.IUserOrderService;
|
||||||
|
import org.springblade.modules.payment.enums.PaymentStatusEnum;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class AppFormalMallUserOrderJob {
|
||||||
|
|
||||||
|
private final IMallDetailOrderService mallDetailOrderService;
|
||||||
|
private final IMallSummaryOrderService mallSummaryOrderService;
|
||||||
|
private final IUserOrderService userOrderService;
|
||||||
|
|
||||||
|
// 商城订单关闭 三天一次
|
||||||
|
@XxlJob("yichayilu-mall-order-close")
|
||||||
|
public void mallOrderClose(){
|
||||||
|
List<MallSummaryOrderEntity> mallSummaryOrderList = mallSummaryOrderService.list(
|
||||||
|
Wrappers.lambdaQuery(MallSummaryOrderEntity.class)
|
||||||
|
.eq(MallSummaryOrderEntity::getPaymentStatus, PaymentStatusEnum.AWAIT.getCode())
|
||||||
|
.eq(MallSummaryOrderEntity::getOrderStatus, MallOrderStatusEnum.WAIT_PAY.getCode())
|
||||||
|
);
|
||||||
|
|
||||||
|
List<MallSummaryOrderEntity> closeOrderList = mallSummaryOrderList.stream().filter(order -> order.getExpireTime().getTime() < System.currentTimeMillis()).toList();
|
||||||
|
|
||||||
|
closeOrderList.forEach(summaryOrder -> {
|
||||||
|
summaryOrder.setOrderStatus(MallOrderStatusEnum.FINISHED.getCode());
|
||||||
|
summaryOrder.setPaymentStatus(PaymentStatusEnum.CLOSE.getCode());
|
||||||
|
|
||||||
|
if (mallSummaryOrderService.updateById( summaryOrder)){
|
||||||
|
List<MallDetailOrderEntity> mallDetailOrderEntities = mallDetailOrderService.list(
|
||||||
|
Wrappers.lambdaQuery(MallDetailOrderEntity.class)
|
||||||
|
.eq(MallDetailOrderEntity::getSummaryOrderId, summaryOrder.getId())
|
||||||
|
.eq(MallDetailOrderEntity::getOrderStatus, MallOrderStatusEnum.WAIT_PAY.getCode())
|
||||||
|
);
|
||||||
|
mallDetailOrderEntities.forEach(detailOrder -> {
|
||||||
|
detailOrder.setOrderStatus(MallOrderStatusEnum.FINISHED.getCode());
|
||||||
|
});
|
||||||
|
mallDetailOrderService.updateBatchById(mallDetailOrderEntities);
|
||||||
|
|
||||||
|
|
||||||
|
UserOrderEntity userOrder = userOrderService.getOne(Wrappers.lambdaQuery(UserOrderEntity.class).eq(UserOrderEntity::getOrderId, summaryOrder.getId()).eq(UserOrderEntity::getOrderType, BizTypeEnum.MALL.getCode()));
|
||||||
|
if (userOrder != null) {
|
||||||
|
userOrder.setOrderStatus(MallOrderStatusEnum.FINISHED.getCode());
|
||||||
|
userOrder.setPaymentStatus(PaymentStatusEnum.CLOSE.getCode());
|
||||||
|
userOrderService.updateById(userOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 商城订单金额入资金账户
|
||||||
|
@XxlJob("yichayilu-mall-order-recorded")
|
||||||
|
public void mallOrderRecorded(){
|
||||||
|
|
||||||
|
List<MallSummaryOrderEntity> mallSummaryOrderList = mallSummaryOrderService.list(
|
||||||
|
Wrappers.lambdaQuery(MallSummaryOrderEntity.class)
|
||||||
|
.eq(MallSummaryOrderEntity::getPaymentStatus, PaymentStatusEnum.PAY.getCode())
|
||||||
|
.eq(MallSummaryOrderEntity::getIsRecorded, 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
//todo 待完善
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package org.springblade.modules.appFormal.listener;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.modules.appFormal.convert.AppUserOrderConvert;
|
||||||
|
import org.springblade.modules.appFormal.enums.MallOrderStatusEnum;
|
||||||
|
import org.springblade.modules.appFormal.event.OrderConfirmOfflineEvent;
|
||||||
|
import org.springblade.modules.appFormal.event.OrderEvent;
|
||||||
|
import org.springblade.modules.order.pojo.entity.UserOrderEntity;
|
||||||
|
import org.springblade.modules.order.service.IUserOrderService;
|
||||||
|
import org.springblade.modules.payment.enums.PaymentStatusEnum;
|
||||||
|
import org.springframework.context.event.EventListener;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AppOrderListener {
|
||||||
|
|
||||||
|
private final IUserOrderService userOrderService;
|
||||||
|
|
||||||
|
@Async("appUserOrderrExecutor")
|
||||||
|
@EventListener
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public void appUserOrderSaveListener(OrderEvent event) {
|
||||||
|
if (event.getTitle() != null && StringUtils.hasLength(event.getTitle()) && event.getTitle().length() > 50) {
|
||||||
|
// 裁剪
|
||||||
|
event.setTitle(event.getTitle().substring(0, 50));
|
||||||
|
}
|
||||||
|
UserOrderEntity order = userOrderService.getOne(Wrappers.lambdaQuery(UserOrderEntity.class).eq(UserOrderEntity::getOrderId, event.getOrderId()).eq(UserOrderEntity::getOrderType, event.getOrderType()));
|
||||||
|
// boolean hasOrder = true;
|
||||||
|
if (order != null) {
|
||||||
|
UserOrderEntity update = AppUserOrderConvert.INSTANCE.convertEventToOrder(event);
|
||||||
|
update.setId(order.getId());
|
||||||
|
userOrderService.updateById(update);
|
||||||
|
} else {
|
||||||
|
// hasOrder = false;
|
||||||
|
userOrderService.save(AppUserOrderConvert.INSTANCE.convertEventToOrder(event));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Async("appUserOrderrExecutor")
|
||||||
|
@EventListener
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public void appUserOrderUpdateListener(OrderConfirmOfflineEvent event) {
|
||||||
|
|
||||||
|
UserOrderEntity order = userOrderService.getOne(Wrappers.lambdaQuery(UserOrderEntity.class).eq(UserOrderEntity::getOrderId, event.getOrderId()).eq(UserOrderEntity::getOrderType, event.getOrderType().getCode()));
|
||||||
|
if (order != null) {
|
||||||
|
order.setOrderStatus(MallOrderStatusEnum.WAIT_DELIVERY.getCode());
|
||||||
|
order.setPaymentStatus(PaymentStatusEnum.PAY.getCode());
|
||||||
|
userOrderService.updateById(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package org.springblade.modules.appFormal.manager;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.PhoneUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.core.jwt.JwtUtil;
|
||||||
|
import org.springblade.core.jwt.props.JwtProperties;
|
||||||
|
import org.springblade.core.oauth2.provider.OAuth2Request;
|
||||||
|
import org.springblade.core.secure.BladeUser;
|
||||||
|
import org.springblade.core.secure.utils.AuthUtil;
|
||||||
|
import org.springblade.modules.appFormal.convert.AppUserInfoConvert;
|
||||||
|
import org.springblade.modules.appFormal.dto.PayOrderDicDTO;
|
||||||
|
import org.springblade.modules.appFormal.request.CustomerSmsRequest;
|
||||||
|
import org.springblade.modules.appFormal.request.UpdatePasswordRequest;
|
||||||
|
import org.springblade.modules.appFormal.vo.MallIntegralLogVO;
|
||||||
|
import org.springblade.modules.appFormal.vo.MallIntegralVO;
|
||||||
|
import org.springblade.modules.appFormal.vo.UserInfoVO;
|
||||||
|
import org.springblade.modules.appOffline.event.AppUserRevokedEvent;
|
||||||
|
import org.springblade.modules.sms.service.AliYunSmsService;
|
||||||
|
import org.springblade.modules.system.pojo.entity.User;
|
||||||
|
import org.springblade.modules.system.service.IParamService;
|
||||||
|
import org.springblade.modules.system.service.IUserService;
|
||||||
|
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralEntity;
|
||||||
|
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralLogEntity;
|
||||||
|
import org.springblade.modules.userPoint.service.IUserMallIntegralLogService;
|
||||||
|
import org.springblade.modules.userPoint.service.IUserMallIntegralService;
|
||||||
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class FormalAppBaseManager {
|
||||||
|
|
||||||
|
private final IParamService paramService;
|
||||||
|
|
||||||
|
|
||||||
|
public String formalAppPrivacy() {
|
||||||
|
|
||||||
|
return paramService.getFormalAppPrivacy();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PayOrderDicDTO> payType(Integer payModel) {
|
||||||
|
|
||||||
|
return paramService.findAppFormalPayType(payModel);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,176 @@
|
|||||||
|
package org.springblade.modules.appFormal.manager;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.PhoneUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.core.jwt.JwtUtil;
|
||||||
|
import org.springblade.core.jwt.props.JwtProperties;
|
||||||
|
import org.springblade.core.oauth2.props.OAuth2Properties;
|
||||||
|
import org.springblade.core.oauth2.provider.OAuth2Request;
|
||||||
|
import org.springblade.core.secure.BladeUser;
|
||||||
|
import org.springblade.core.secure.utils.AuthUtil;
|
||||||
|
import org.springblade.core.tool.utils.DigestUtil;
|
||||||
|
import org.springblade.core.tool.utils.SM2Util;
|
||||||
|
import org.springblade.core.tool.utils.StringUtil;
|
||||||
|
import org.springblade.modules.appFormal.convert.AppUserInfoConvert;
|
||||||
|
import org.springblade.modules.appFormal.request.CustomerSmsRequest;
|
||||||
|
import org.springblade.modules.appFormal.request.UpdatePasswordRequest;
|
||||||
|
import org.springblade.modules.appFormal.vo.MallIntegralLogVO;
|
||||||
|
import org.springblade.modules.appFormal.vo.MallIntegralVO;
|
||||||
|
import org.springblade.modules.appFormal.vo.UserInfoVO;
|
||||||
|
import org.springblade.modules.appOffline.event.AppUserRevokedEvent;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.YsCategoryEntity;
|
||||||
|
import org.springblade.modules.sms.service.AliYunSmsService;
|
||||||
|
import org.springblade.modules.system.pojo.entity.User;
|
||||||
|
import org.springblade.modules.system.service.IUserService;
|
||||||
|
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralEntity;
|
||||||
|
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralLogEntity;
|
||||||
|
import org.springblade.modules.userPoint.service.IUserMallIntegralLogService;
|
||||||
|
import org.springblade.modules.userPoint.service.IUserMallIntegralService;
|
||||||
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class FormalAppCustomerManager {
|
||||||
|
|
||||||
|
private final AliYunSmsService aliYunSmsService;
|
||||||
|
private final IUserService userService;
|
||||||
|
private final IUserMallIntegralService userMallIntegralService;
|
||||||
|
private final IUserMallIntegralLogService mallIntegralLogService;
|
||||||
|
private final JwtProperties jwtProperties;
|
||||||
|
private final ApplicationEventPublisher publisher;
|
||||||
|
private final OAuth2Properties properties;
|
||||||
|
|
||||||
|
|
||||||
|
public Boolean sendSmsCode(String phone) {
|
||||||
|
Assert.notNull(phone , "手机号不能为空");
|
||||||
|
Assert.isTrue(PhoneUtil.isMobile(phone), "手机号格式不正确");
|
||||||
|
return aliYunSmsService.sendSms(phone);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean checkSmsCode(CustomerSmsRequest request) {
|
||||||
|
Assert.notNull(request.getPhone() , "手机号不能为空");
|
||||||
|
Assert.notNull(request.getCode() , "验证码不能为空");
|
||||||
|
Assert.isTrue(PhoneUtil.isMobile(request.getPhone()), "手机号格式不正确");
|
||||||
|
return aliYunSmsService.verifySms(request.getPhone() , request.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public UserInfoVO findUserInfo(Long userId) {
|
||||||
|
User user = userService.getById(userId);
|
||||||
|
return new UserInfoVO()
|
||||||
|
.setUsername(user.getName())
|
||||||
|
.setPhone(user.getPhone())
|
||||||
|
.setAvatar(user.getAvatar())
|
||||||
|
.setInvitationCode(user.getInvitationCode());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean updatePassword(UpdatePasswordRequest request) {
|
||||||
|
|
||||||
|
Assert.notNull(request.getPhone() , "手机号不能为空");
|
||||||
|
Assert.notNull(request.getCode() , "验证码不能为空");
|
||||||
|
Assert.isTrue(PhoneUtil.isMobile(String.valueOf(request.getPhone())), "手机号格式不正确");
|
||||||
|
aliYunSmsService.verifySms(String.valueOf(request.getPhone()) , request.getCode());
|
||||||
|
Long phone = request.getPhone();
|
||||||
|
User user = userService.getOne(
|
||||||
|
Wrappers.lambdaQuery(User.class)
|
||||||
|
.eq(User::getPhone, String.valueOf(phone))
|
||||||
|
);
|
||||||
|
Assert.notNull(user, "用户不存在");
|
||||||
|
String decrypt = SM2Util.decrypt(request.getPassword(), properties.getPrivateKey());
|
||||||
|
|
||||||
|
return userService.update(
|
||||||
|
Wrappers.lambdaUpdate(User.class)
|
||||||
|
.eq(User::getId, user.getId())
|
||||||
|
.set(User::getPassword, DigestUtil.encrypt(decrypt))
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Boolean userLogout() {
|
||||||
|
BladeUser user = AuthUtil.getUser();
|
||||||
|
if (user != null && this.jwtProperties.getState()) {
|
||||||
|
OAuth2Request request = OAuth2Request.create().buildHeaderArgs();
|
||||||
|
String token = JwtUtil.getToken(request.getToken());
|
||||||
|
JwtUtil.removeAccessToken(user.getTenantId(), user.getClientId(), String.valueOf(user.getUserId()), token);
|
||||||
|
JwtUtil.removeRefreshToken(user.getTenantId(), user.getClientId(), String.valueOf(user.getUserId()), token);
|
||||||
|
}
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean deleteAccount(Long userId) {
|
||||||
|
BladeUser user = AuthUtil.getUser();
|
||||||
|
if (user != null && this.jwtProperties.getState()) {
|
||||||
|
OAuth2Request request = OAuth2Request.create().buildHeaderArgs();
|
||||||
|
String token = JwtUtil.getToken(request.getToken());
|
||||||
|
JwtUtil.removeAccessToken(user.getTenantId(), user.getClientId(), String.valueOf(user.getUserId()), token);
|
||||||
|
JwtUtil.removeRefreshToken(user.getTenantId(), user.getClientId(), String.valueOf(user.getUserId()), token);
|
||||||
|
}
|
||||||
|
if(userService.removeUser(String.valueOf(List.of(userId)))){
|
||||||
|
publisher.publishEvent(
|
||||||
|
new AppUserRevokedEvent()
|
||||||
|
.setUserId(userId)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MallIntegralVO findMallIntegral(Long userId) {
|
||||||
|
|
||||||
|
UserMallIntegralEntity mallIntegral = userMallIntegralService.getById(userId);
|
||||||
|
if (mallIntegral == null){
|
||||||
|
mallIntegral = new UserMallIntegralEntity();
|
||||||
|
mallIntegral.setId(userId);
|
||||||
|
mallIntegral.setAmount(BigDecimal.ZERO);
|
||||||
|
mallIntegral.setVersion(1);
|
||||||
|
if (userMallIntegralService.save(mallIntegral)){
|
||||||
|
return new MallIntegralVO()
|
||||||
|
.setAmount(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new MallIntegralVO()
|
||||||
|
.setAmount(mallIntegral.getAmount());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public IPage<MallIntegralLogVO> findMallIntegralFlow(IPage<MallIntegralLogVO> page, MallIntegralLogVO logVO, Long userId) {
|
||||||
|
|
||||||
|
|
||||||
|
Page<UserMallIntegralLogEntity> pageResult = mallIntegralLogService.page(
|
||||||
|
new Page<>(page.getCurrent(), page.getSize()),
|
||||||
|
Wrappers.lambdaQuery(UserMallIntegralLogEntity.class)
|
||||||
|
.eq(UserMallIntegralLogEntity::getUserId, userId)
|
||||||
|
//判断type是否为空
|
||||||
|
.eq(Objects.nonNull(logVO.getType()), UserMallIntegralLogEntity::getType, logVO.getType())
|
||||||
|
.eq(Objects.nonNull(logVO.getStatisticalDate()), UserMallIntegralLogEntity::getStatisticalDate, logVO.getStatisticalDate())
|
||||||
|
.orderByDesc(UserMallIntegralLogEntity::getId)
|
||||||
|
);
|
||||||
|
|
||||||
|
return AppUserInfoConvert.INSTANCE.convertIntegralPageToVO(pageResult);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,189 @@
|
|||||||
|
package org.springblade.modules.appFormal.manager;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.lang.Validator;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.core.secure.utils.AuthUtil;
|
||||||
|
import org.springblade.modules.appFormal.convert.AppFormalMallConvert;
|
||||||
|
import org.springblade.modules.appFormal.request.AddressSubmitRequest;
|
||||||
|
import org.springblade.modules.appFormal.request.MallCartRequest;
|
||||||
|
import org.springblade.modules.appFormal.vo.*;
|
||||||
|
import org.springblade.modules.customer.service.IRegionsInfoService;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.MallCartEntity;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.MallSpuEntity;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.UserAddressEntity;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.YsCategoryEntity;
|
||||||
|
import org.springblade.modules.mall.pojo.vo.MallSpuVO;
|
||||||
|
import org.springblade.modules.mall.service.IMallCartService;
|
||||||
|
import org.springblade.modules.mall.service.IMallSpuService;
|
||||||
|
import org.springblade.modules.mall.service.IUserAddressService;
|
||||||
|
import org.springblade.modules.mall.service.IYsCategoryService;
|
||||||
|
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralLogEntity;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class FormalAppMallManager {
|
||||||
|
|
||||||
|
private final IMallSpuService spuService;
|
||||||
|
private final IYsCategoryService categoryService;
|
||||||
|
private final IMallCartService mallCartService;
|
||||||
|
private final IRegionsInfoService regionInfoService;
|
||||||
|
private final IUserAddressService addressService;
|
||||||
|
|
||||||
|
|
||||||
|
public List<MallCategoryVO> findCategories() {
|
||||||
|
|
||||||
|
List<YsCategoryEntity> list = categoryService.list(
|
||||||
|
Wrappers.lambdaQuery(YsCategoryEntity.class)
|
||||||
|
.eq(YsCategoryEntity::getPid, 0)
|
||||||
|
.orderByDesc(YsCategoryEntity::getId)
|
||||||
|
);
|
||||||
|
|
||||||
|
return AppFormalMallConvert.INSTANCE.convertMallCategoryListToVO(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public IPage<AppFormalMallSpuVO> getSpuPage(IPage<MallSpuVO> page, AppFormalMallSpuVO spuVO) {
|
||||||
|
Page<MallSpuEntity> pageResult = spuService.page(
|
||||||
|
new Page<>(page.getCurrent(), page.getSize()),
|
||||||
|
Wrappers.lambdaQuery(MallSpuEntity.class)
|
||||||
|
.eq(StringUtils.hasText(spuVO.getCateId()), MallSpuEntity::getCateId, spuVO.getCateId())
|
||||||
|
.like(StringUtils.hasText(spuVO.getSpuName()), MallSpuEntity::getSpuName, spuVO.getSpuName())
|
||||||
|
.orderByDesc(MallSpuEntity::getId)
|
||||||
|
);
|
||||||
|
|
||||||
|
return AppFormalMallConvert.INSTANCE.convertMallSpuPageToVO(pageResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public IPage<AppFormalMallCartVO> cartList(IPage<AppFormalMallCartVO> page, AppFormalMallCartVO cartVO, Long userId) {
|
||||||
|
Page<MallCartEntity> pageResult = mallCartService.page(
|
||||||
|
new Page<>(page.getCurrent(), page.getSize()),
|
||||||
|
Wrappers.lambdaQuery(MallCartEntity.class)
|
||||||
|
.eq(MallCartEntity::getUserId, userId)
|
||||||
|
.like(StringUtils.hasText(cartVO.getTitle()), MallCartEntity::getTitle, cartVO.getTitle())
|
||||||
|
.orderByDesc(MallCartEntity::getId)
|
||||||
|
);
|
||||||
|
|
||||||
|
return AppFormalMallConvert.INSTANCE.convertMallCartPageToVO(pageResult);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long addCart(MallCartRequest request) {
|
||||||
|
|
||||||
|
MallSpuEntity mallSpu = spuService.getById(request.getSpuId());
|
||||||
|
Assert.notNull(mallSpu, "商品不存在");
|
||||||
|
|
||||||
|
|
||||||
|
MallCartEntity mallCart = mallCartService.getOne(
|
||||||
|
Wrappers.lambdaQuery(MallCartEntity.class)
|
||||||
|
.eq(MallCartEntity::getUserId, request.getUserId())
|
||||||
|
.eq(MallCartEntity::getSpuId, request.getSpuId())
|
||||||
|
);
|
||||||
|
|
||||||
|
if (mallCart != null){
|
||||||
|
mallCart.setQuantity(mallCart.getQuantity() + request.getQuantity());
|
||||||
|
return mallCartService.updateById(mallCart) ? mallCart.getId() : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
MallCartEntity cart = new MallCartEntity();
|
||||||
|
cart.setUserId(request.getUserId());
|
||||||
|
cart.setTitle(mallSpu.getSpuName());
|
||||||
|
cart.setQuantity(request.getQuantity());
|
||||||
|
cart.setSpuId(request.getSpuId());
|
||||||
|
cart.setMainImg(mallSpu.getMainImg());
|
||||||
|
cart.setOriginalPrice(mallSpu.getOriginalPrice());
|
||||||
|
cart.setRetailPrice(mallSpu.getRetailPrice());
|
||||||
|
if (mallCartService.save(cart)){
|
||||||
|
return cart.getId();
|
||||||
|
}
|
||||||
|
throw new RuntimeException("添加购物车失败");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long addCartToOrder(MallCartRequest request) {
|
||||||
|
|
||||||
|
MallSpuEntity mallSpu = spuService.getById(request.getSpuId());
|
||||||
|
Assert.notNull(mallSpu, "商品不存在");
|
||||||
|
|
||||||
|
MallCartEntity cart = new MallCartEntity();
|
||||||
|
cart.setUserId(request.getUserId());
|
||||||
|
cart.setTitle(mallSpu.getSpuName());
|
||||||
|
cart.setQuantity(request.getQuantity());
|
||||||
|
cart.setSpuId(request.getSpuId());
|
||||||
|
cart.setMainImg(mallSpu.getMainImg());
|
||||||
|
cart.setOriginalPrice(mallSpu.getOriginalPrice());
|
||||||
|
cart.setRetailPrice(mallSpu.getRetailPrice());
|
||||||
|
if (mallCartService.save(cart)){
|
||||||
|
return cart.getId();
|
||||||
|
}
|
||||||
|
throw new RuntimeException("添加购物车失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean deleteCart(List<Long> ids) {
|
||||||
|
return mallCartService.removeBatchByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean updateCartQuantity(MallCartRequest request) {
|
||||||
|
Assert.isTrue(request.getQuantity() > 0, "商品数量不能小于0");
|
||||||
|
MallCartEntity mallCartEntity = mallCartService.getById(request.getId());
|
||||||
|
Assert.notNull(mallCartEntity, "商品不存在");
|
||||||
|
if (request.getType() == 1){
|
||||||
|
mallCartEntity.setQuantity(mallCartEntity.getQuantity() + request.getQuantity());
|
||||||
|
return mallCartService.updateById(mallCartEntity);
|
||||||
|
}
|
||||||
|
if ((mallCartEntity.getQuantity() - request.getQuantity()) <= 0){
|
||||||
|
return mallCartService.removeById(request.getId());
|
||||||
|
}
|
||||||
|
mallCartEntity.setQuantity(mallCartEntity.getQuantity() - request.getQuantity());
|
||||||
|
return mallCartService.updateById(mallCartEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<AppFormalRegionInfoVO> regionInfoList(Integer level, Long pid) {
|
||||||
|
return regionInfoService.regionInfoList(level, pid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean submitAddressInfo(AddressSubmitRequest request) {
|
||||||
|
FullRegionInfoVO regionInfo = regionInfoService.queryFullInfo(request.getRegionsInfoId());
|
||||||
|
Assert.isTrue(regionInfo.getCurrentLevel() == 4, "请选择所属街道");
|
||||||
|
Assert.isTrue(Validator.isMobile(request.getPhone()), "手机号码格式不正确");
|
||||||
|
Assert.isTrue(request.getConsignee().length() < 100 , "名字不能超过100个字");
|
||||||
|
UserAddressEntity address = AppFormalMallConvert.INSTANCE.convertRequestToPo(request);
|
||||||
|
address
|
||||||
|
.setProvince(regionInfo.getProvince())
|
||||||
|
.setCity(regionInfo.getCity())
|
||||||
|
.setDistrict(regionInfo.getDistrict())
|
||||||
|
.setUserId(AuthUtil.getUserId())
|
||||||
|
.setStreet(regionInfo.getStreet());
|
||||||
|
if (request.getIsDefault() == 1) {
|
||||||
|
addressService.update(Wrappers.lambdaUpdate(UserAddressEntity.class).eq(UserAddressEntity::getUserId, AuthUtil.getUserId()).set(UserAddressEntity::getIsDefault, 0));
|
||||||
|
}
|
||||||
|
return addressService.saveOrUpdate(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public Boolean deleteAddressInfo(List<Long> ids) {
|
||||||
|
return addressService.removeBatchByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<AppFormalAddressVO> addressInfoList(Long userId) {
|
||||||
|
List<UserAddressEntity> addressList = addressService.list(Wrappers.lambdaQuery(UserAddressEntity.class)
|
||||||
|
.eq(UserAddressEntity::getUserId, userId)
|
||||||
|
.orderByDesc(UserAddressEntity::getIsDefault , UserAddressEntity::getId));
|
||||||
|
return AppFormalMallConvert.INSTANCE.convertPoListToVoList(addressList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,353 @@
|
|||||||
|
package org.springblade.modules.appFormal.manager;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.common.utils.RandomAmountGenerator;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.core.secure.utils.AuthUtil;
|
||||||
|
import org.springblade.modules.appFormal.convert.AppUserOrderConvert;
|
||||||
|
import org.springblade.modules.appFormal.dto.CutAmountRangDTO;
|
||||||
|
import org.springblade.modules.appFormal.dto.PayOrderDicDTO;
|
||||||
|
import org.springblade.modules.appFormal.dto.PreviewDTO;
|
||||||
|
import org.springblade.modules.appFormal.enums.BizTypeEnum;
|
||||||
|
import org.springblade.modules.appFormal.enums.MallOrderStatusEnum;
|
||||||
|
import org.springblade.modules.appFormal.event.OrderEvent;
|
||||||
|
import org.springblade.modules.appFormal.vo.*;
|
||||||
|
import org.springblade.modules.payment.api.PaymentFacade;
|
||||||
|
import org.springblade.modules.payment.enums.PaymentStatusEnum;
|
||||||
|
import org.springblade.modules.appFormal.request.AppFormalPreviewOrderRequest;
|
||||||
|
import org.springblade.modules.customer.pojo.entity.RegionsInfoEntity;
|
||||||
|
import org.springblade.modules.customer.service.IRegionsInfoService;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.MallCartEntity;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.MallSpuEntity;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.UserAddressEntity;
|
||||||
|
import org.springblade.modules.mall.service.IMallCartService;
|
||||||
|
import org.springblade.modules.mall.service.IMallSpuService;
|
||||||
|
import org.springblade.modules.mall.service.IUserAddressService;
|
||||||
|
import org.springblade.modules.order.pojo.entity.MallDetailOrderEntity;
|
||||||
|
import org.springblade.modules.order.pojo.entity.MallSummaryOrderEntity;
|
||||||
|
import org.springblade.modules.order.pojo.entity.UserOrderEntity;
|
||||||
|
import org.springblade.modules.order.service.IMallDetailOrderService;
|
||||||
|
import org.springblade.modules.order.service.IMallSummaryOrderService;
|
||||||
|
import org.springblade.modules.order.service.IUserOrderService;
|
||||||
|
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.context.ApplicationEventPublisher;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class FormalAppOrderManager {
|
||||||
|
|
||||||
|
private final IParamService paramService;
|
||||||
|
private final IUserOrderService orderService;
|
||||||
|
private final IMallSummaryOrderService mallSummaryOrderService;
|
||||||
|
private final IMallDetailOrderService mallDetailOrderService;
|
||||||
|
private final IUserService userService;
|
||||||
|
private final IUserAddressService userAddressService;
|
||||||
|
private final IRegionsInfoService regionsInfoService;
|
||||||
|
private final IMallSpuService mallSpuService;
|
||||||
|
private final IMallCartService mallCartService;
|
||||||
|
private final PaymentFacade paymentFacade;
|
||||||
|
private final ApplicationEventPublisher publisher;
|
||||||
|
|
||||||
|
|
||||||
|
public List<PayOrderDicDTO> orderBizModel() {
|
||||||
|
return paramService.getOrderBizModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public IPage<AppFormalOrderVO> getOrderList(IPage<AppFormalOrderVO> page, AppFormalOrderVO orderVO) {
|
||||||
|
|
||||||
|
Page<UserOrderEntity> orderPage = orderService.page(new Page<>(page.getCurrent(), page.getSize()), Wrappers.lambdaQuery(UserOrderEntity.class)
|
||||||
|
.eq(UserOrderEntity::getUserId, AuthUtil.getUserId())
|
||||||
|
.eq(orderVO.getOrderType() != null, UserOrderEntity::getOrderType, orderVO.getOrderType())
|
||||||
|
.eq(orderVO.getPaymentStatus() != null, UserOrderEntity::getPaymentStatus, orderVO.getPaymentStatus())
|
||||||
|
.eq(orderVO.getOrderStatus() != null, UserOrderEntity::getOrderStatus, orderVO.getOrderStatus())
|
||||||
|
.likeLeft(StrUtil.isNotBlank(orderVO.getTitle()), UserOrderEntity::getTitle, orderVO.getTitle())
|
||||||
|
.orderByDesc(UserOrderEntity::getId));
|
||||||
|
if (orderPage.getRecords().isEmpty()) {
|
||||||
|
return orderPage.convert(AppUserOrderConvert.INSTANCE::convertOrderToVO);
|
||||||
|
}
|
||||||
|
return orderPage.convert(order -> {
|
||||||
|
AppFormalOrderVO vo = AppUserOrderConvert.INSTANCE.convertOrderToVO(order);
|
||||||
|
vo.setContent(order.getDescription());
|
||||||
|
vo.setOrderStatusName(BizTypeEnum.getStatusName(order.getOrderType(), order.getOrderStatus()));
|
||||||
|
return vo;
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public AppFormalMallOrderVO mallOrderDetail(Long id) {
|
||||||
|
|
||||||
|
MallSummaryOrderEntity order = mallSummaryOrderService.getById(id);
|
||||||
|
Assert.notNull(order, "无效订单");
|
||||||
|
Assert.isTrue(order.getUserId().equals(AuthUtil.getUserId()), "错误订单");
|
||||||
|
AppFormalMallOrderVO orderVO = AppUserOrderConvert.INSTANCE.convertMallOrderToVO(order);
|
||||||
|
|
||||||
|
List<MallDetailOrderEntity> details = mallSummaryOrderService.getDetails(id);
|
||||||
|
List<AppFormalMallDetailOrderVO> skuVOS = details.stream().map(sku -> {
|
||||||
|
AppFormalMallDetailOrderVO skuVO = AppUserOrderConvert.INSTANCE.convertEntityToVO(sku);
|
||||||
|
return skuVO;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
PreviewDTO previewDTO = JSONObject.parseObject(order.getProductsInfo(), PreviewDTO.class);
|
||||||
|
|
||||||
|
|
||||||
|
orderVO.setAddress(previewDTO.getAddress());
|
||||||
|
orderVO.setDetailOrderList(skuVOS);
|
||||||
|
orderVO.setCashAmount(order.getTotalAmount());
|
||||||
|
orderVO.setOrderAmount(order.getActualAmount());
|
||||||
|
return orderVO;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public AppFormalPreviewOrderVO mallMakeOrder(AppFormalPreviewOrderRequest request, Long userId) {
|
||||||
|
// 现金转商城积分比例
|
||||||
|
BigDecimal mallCashToPointRate = paramService.getMallCashToPointRate();
|
||||||
|
//随机立减范围
|
||||||
|
CutAmountRangDTO randomReduceRange = paramService.getMallCutAmountRangDTO();
|
||||||
|
|
||||||
|
User user = userService.getById(userId);
|
||||||
|
Assert.notNull(user, "用户不存在");
|
||||||
|
|
||||||
|
PreviewDTO previewDTO = doPreview(request.getCartIds(), request.getAddressId());
|
||||||
|
|
||||||
|
AppFormalPreviewOrderVO result = AppUserOrderConvert.INSTANCE.convertPreviewDTOToVO(previewDTO);
|
||||||
|
MallSummaryOrderEntity order = AppUserOrderConvert.INSTANCE.convertPreviewDTOToOrder(previewDTO);
|
||||||
|
|
||||||
|
order.setUserName(user.getName());
|
||||||
|
order.setUserPhone(Long.valueOf(user.getPhone()));
|
||||||
|
|
||||||
|
order.setExpireTime(DateUtil.getMinutesLate(new Date(), 30));
|
||||||
|
order.setProductsInfo(JSONObject.toJSONString(previewDTO));
|
||||||
|
order.setUserId(userId);
|
||||||
|
order.setIsRoyalty(0); // 0:否 1:是
|
||||||
|
order.setFreightAmount(previewDTO.getFreightAmount());
|
||||||
|
order.setTotalAmount(previewDTO.getTotalAmount());
|
||||||
|
|
||||||
|
// 订单成本 含运费
|
||||||
|
List<PreviewDTO.SkuDTO> skuList = previewDTO.getSkuList();
|
||||||
|
|
||||||
|
|
||||||
|
List<AppFormalMallSkuVO> appFormalMallSkuVOList = new ArrayList<>();
|
||||||
|
|
||||||
|
List<MallDetailOrderEntity> detailOrderList = skuList.stream().map(sku -> {
|
||||||
|
MallDetailOrderEntity detailOrder = AppUserOrderConvert.INSTANCE.convertSkuDTOToDetailOrder(sku);
|
||||||
|
detailOrder.setId(null);
|
||||||
|
detailOrder.setUserName(user.getName());
|
||||||
|
detailOrder.setUserPhone(Long.valueOf(user.getPhone()));
|
||||||
|
detailOrder.setUserId(userId);
|
||||||
|
detailOrder.setSummaryOrderId(order.getId());
|
||||||
|
detailOrder.setSpuId(sku.getSpuId());
|
||||||
|
detailOrder.setQuantity(sku.getQuantity());
|
||||||
|
detailOrder.setSkuSnapshot(JSONObject.toJSONString(sku));
|
||||||
|
detailOrder.setActualCostAmount(sku.getCostPrice());
|
||||||
|
detailOrder.setOrderAmount(sku.getRetailPrice());
|
||||||
|
detailOrder.setCostAmount(sku.getCostPrice());
|
||||||
|
detailOrder.setActualAmount(sku.getRetailPrice());
|
||||||
|
detailOrder.setGivenAmount(sku.getRetailPrice().multiply(mallCashToPointRate).setScale(2, RoundingMode.HALF_UP));
|
||||||
|
detailOrder.setOrderStatus(MallOrderStatusEnum.WAIT_PAY.getCode());
|
||||||
|
|
||||||
|
appFormalMallSkuVOList.add(
|
||||||
|
new AppFormalMallSkuVO()
|
||||||
|
.setId(sku.getSpuId())
|
||||||
|
.setImage(sku.getMainImg())
|
||||||
|
.setSkuTitle(sku.getSpuName())
|
||||||
|
.setCurrentPrice(sku.getRetailPrice())
|
||||||
|
.setQuantity(sku.getQuantity())
|
||||||
|
.setTotalAmount(sku.getRetailPrice().multiply(BigDecimal.valueOf(sku.getQuantity())))
|
||||||
|
);
|
||||||
|
|
||||||
|
return detailOrder;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
// 总利润
|
||||||
|
|
||||||
|
order.setActualGiveToken(BigDecimal.ZERO);
|
||||||
|
|
||||||
|
|
||||||
|
BigDecimal cutAmount = BigDecimal.ZERO;
|
||||||
|
if (order.getTotalAmount().compareTo(BigDecimal.ONE) > 0){
|
||||||
|
cutAmount = RandomAmountGenerator.generateRandomAmount(randomReduceRange.getMin(), randomReduceRange.getMax().multiply(order.getTotalAmount()));
|
||||||
|
order.setCostAmount(cutAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
order.setActualAmount(previewDTO.getTotalAmount().subtract(cutAmount));
|
||||||
|
order.setGiveToken(order.getActualAmount().multiply(mallCashToPointRate).setScale(2, RoundingMode.HALF_UP));
|
||||||
|
|
||||||
|
order.setOrderStatus(MallOrderStatusEnum.WAIT_PAY.getCode());
|
||||||
|
order.setPaymentStatus(PaymentStatusEnum.AWAIT.getCode());
|
||||||
|
order.setPaymentType(request.getPayType());
|
||||||
|
mallSummaryOrderService.generateOrder(order, detailOrderList);
|
||||||
|
mallCartService.removeBatchByIds(request.getCartIds());
|
||||||
|
syncQffOrder(order);
|
||||||
|
|
||||||
|
result.setSkuList(appFormalMallSkuVOList);
|
||||||
|
result.setFreightAmount(order.getFreightAmount());
|
||||||
|
result.setOrderAmount(order.getOrderAmount());
|
||||||
|
result.setCutAmount(order.getCostAmount());
|
||||||
|
return result.setId(order.getId());
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean mallCancelOrder(Long id, Long userId) {
|
||||||
|
|
||||||
|
MallSummaryOrderEntity order = mallSummaryOrderService.getById(id);
|
||||||
|
Assert.notNull(order, "无效订单!");
|
||||||
|
if (userId != null) {
|
||||||
|
Assert.isTrue(order.getUserId().equals(userId), "订单用户异常");
|
||||||
|
}
|
||||||
|
Assert.isTrue(order.getPaymentStatus() == PaymentStatusEnum.AWAIT.getCode(), "订单支付状态异常");
|
||||||
|
Assert.isTrue(order.getStatus() == MallOrderStatusEnum.WAIT_PAY.getCode(), "订单状态异常");
|
||||||
|
order.setStatus(MallOrderStatusEnum.CANCELED.getCode());
|
||||||
|
order.setPaymentStatus(PaymentStatusEnum.CLOSE.getCode());
|
||||||
|
try {
|
||||||
|
paymentFacade.close(order.getId(), "商城订单取消" + order.getId());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return mallSummaryOrderService.updateById(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean mallConfirmReceipt(Long orderId, Long userId) {
|
||||||
|
MallSummaryOrderEntity summaryOrder = mallSummaryOrderService.getById(orderId);
|
||||||
|
Assert.notNull(summaryOrder, "订单不存在");
|
||||||
|
Assert.isTrue(Objects.equals(summaryOrder.getUserId(), userId), "订单不存在");
|
||||||
|
Assert.isTrue(Objects.equals(summaryOrder.getStatus(), MallOrderStatusEnum.WAIT_RECEIVE.getCode())
|
||||||
|
|| Objects.equals(summaryOrder.getStatus(), MallOrderStatusEnum.COMPLETED.getCode()), "订单状态异常");
|
||||||
|
summaryOrder.setStatus(MallOrderStatusEnum.COMPLETED.getCode());
|
||||||
|
mallSummaryOrderService.updateById(summaryOrder);
|
||||||
|
return mallDetailOrderService.update(Wrappers.lambdaUpdate(MallDetailOrderEntity.class)
|
||||||
|
.eq(MallDetailOrderEntity::getSummaryOrderId, summaryOrder.getId())
|
||||||
|
.in(MallDetailOrderEntity::getStatus, MallOrderStatusEnum.WAIT_PAY.getCode(),
|
||||||
|
MallOrderStatusEnum.WAIT_DELIVERY.getCode(),
|
||||||
|
MallOrderStatusEnum.WAIT_RECEIVE.getCode()
|
||||||
|
)
|
||||||
|
.set(MallDetailOrderEntity::getStatus, MallOrderStatusEnum.COMPLETED.getCode()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private PreviewDTO doPreview(List<Long> cartIds, Long addressId) {
|
||||||
|
User user = userService.getById(AuthUtil.getUserId());
|
||||||
|
|
||||||
|
Assert.notNull(user, "无效用户");
|
||||||
|
|
||||||
|
UserAddressEntity address = userAddressService.getById(addressId);
|
||||||
|
Assert.notNull(address, "无效地址");
|
||||||
|
RegionsInfoEntity regionInfo = regionsInfoService.getById(address.getRegionsInfoId());
|
||||||
|
Assert.notNull(regionInfo, "无效地区");
|
||||||
|
|
||||||
|
PreviewDTO result = new PreviewDTO().setAddressId(addressId).setAddress(address).setVendorRegionsId(regionInfo.getVendorRegionId());
|
||||||
|
|
||||||
|
List<MallCartEntity> cartList = mallCartService.getCartListByIds(cartIds);
|
||||||
|
List<PreviewDTO.SkuDTO> skuList = new LinkedList<>();
|
||||||
|
|
||||||
|
cartList.forEach(c -> {
|
||||||
|
|
||||||
|
MallSpuEntity mallSpu = mallSpuService.getById(c.getSpuId());
|
||||||
|
|
||||||
|
Assert.notNull(mallSpu, c.getTitle() + "不存在或已下架");
|
||||||
|
Assert.isTrue(mallSpu.getSpuQty() > mallSpu.getSales(), c.getTitle() + "商品库存不足");
|
||||||
|
|
||||||
|
skuList.add(
|
||||||
|
new PreviewDTO.SkuDTO()
|
||||||
|
.setSpuId(mallSpu.getId())
|
||||||
|
.setSpuSn(mallSpu.getSpuSn())
|
||||||
|
.setSpuName(mallSpu.getSpuName())
|
||||||
|
.setMainImg(mallSpu.getMainImg())
|
||||||
|
.setDetailImg(mallSpu.getDetailImg())
|
||||||
|
.setTopImg(mallSpu.getTopImg())
|
||||||
|
.setCateId(mallSpu.getCateId())
|
||||||
|
.setCateIds(mallSpu.getCateIds())
|
||||||
|
.setOriginalPrice(mallSpu.getOriginalPrice())
|
||||||
|
.setRetailPrice(mallSpu.getRetailPrice())
|
||||||
|
.setCostPrice(mallSpu.getCostPrice())
|
||||||
|
.setSales(mallSpu.getSales())
|
||||||
|
.setSpuQty(mallSpu.getSpuQty())
|
||||||
|
.setTags(mallSpu.getTags())
|
||||||
|
.setQuantity(c.getQuantity())
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
BigDecimal orderAmount = BigDecimal.ZERO;
|
||||||
|
BigDecimal regularAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
// 供应链成本
|
||||||
|
BigDecimal costAmountAll = BigDecimal.ZERO;
|
||||||
|
for (PreviewDTO.SkuDTO skuDTO : skuList) {
|
||||||
|
BigDecimal totalAmount = skuDTO.getOriginalPrice().multiply(BigDecimal.valueOf(skuDTO.getQuantity()).setScale(2, RoundingMode.UP));
|
||||||
|
BigDecimal regular = skuDTO.getOriginalPrice().multiply(BigDecimal.valueOf(skuDTO.getQuantity()).setScale(2, RoundingMode.UP));
|
||||||
|
BigDecimal costAmount = skuDTO.getCostPrice().multiply(BigDecimal.valueOf(skuDTO.getQuantity()).setScale(2, RoundingMode.UP));
|
||||||
|
orderAmount = orderAmount.add(totalAmount);
|
||||||
|
regularAmount = regularAmount.add(regular);
|
||||||
|
costAmountAll = costAmountAll.add(costAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
;
|
||||||
|
return result.setOrderAmount(orderAmount)
|
||||||
|
.setTotalAmount(orderAmount)
|
||||||
|
.setOrderAmount(orderAmount)
|
||||||
|
.setCostAmount(costAmountAll)
|
||||||
|
.setSkuList(skuList)
|
||||||
|
.setRegularAmount(regularAmount)
|
||||||
|
.setFreightAmount(BigDecimal.ZERO)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void syncQffOrder(MallSummaryOrderEntity order) {
|
||||||
|
// 保存总订单
|
||||||
|
OrderEvent orderEvent = new OrderEvent()
|
||||||
|
.setUserId(order.getUserId())
|
||||||
|
.setUserName(order.getUserName())
|
||||||
|
.setUserPhone(order.getUserPhone())
|
||||||
|
.setOrderType(BizTypeEnum.MALL.getCode())
|
||||||
|
.setOrderId(order.getId())
|
||||||
|
.setOrderStatus(order.getStatus())
|
||||||
|
.setTotalAmount(order.getTotalAmount())
|
||||||
|
.setActualAmount(order.getActualAmount())
|
||||||
|
.setPaymentStatus(order.getPaymentStatus())
|
||||||
|
.setPaymentTime(order.getPaymentCompletedTime())
|
||||||
|
.setPaymentType(order.getPaymentType())
|
||||||
|
|
||||||
|
;
|
||||||
|
PreviewDTO productsInfo = JSONObject.parseObject(order.getProductsInfo(), PreviewDTO.class);
|
||||||
|
if (productsInfo != null) {
|
||||||
|
String desc = productsInfo.getSkuList().stream().map(PreviewDTO.SkuDTO::getSpuName).collect(Collectors.joining(","));
|
||||||
|
PreviewDTO.SkuDTO skuDTO = productsInfo.getSkuList().get(0);
|
||||||
|
orderEvent
|
||||||
|
.setTitle(skuDTO.getSpuName())
|
||||||
|
.setImages(skuDTO.getMainImg())
|
||||||
|
.setQuantity(productsInfo.getSkuList().size())
|
||||||
|
.setDescription(desc);
|
||||||
|
}
|
||||||
|
publisher.publishEvent(orderEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package org.springblade.modules.appFormal.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AddressRemoveRequest implements Serializable {
|
||||||
|
|
||||||
|
private List<Long> ids;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package org.springblade.modules.appFormal.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AddressSubmitRequest implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Long regionsInfoId;
|
||||||
|
|
||||||
|
private String detail;
|
||||||
|
|
||||||
|
private String consignee;
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
private Integer isDefault;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package org.springblade.modules.appFormal.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AppForOrderIdRequest implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.appFormal.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AppFormalPreviewOrderRequest implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
private List<Long> cartIds;
|
||||||
|
|
||||||
|
private Long addressId;
|
||||||
|
|
||||||
|
private Integer payType;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package org.springblade.modules.appFormal.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CustomerSmsRequest implements Serializable {
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package org.springblade.modules.appFormal.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class MallCartRemoveRequest {
|
||||||
|
private List<Long> ids;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package org.springblade.modules.appFormal.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class MallCartRequest {
|
||||||
|
private Long id;
|
||||||
|
private Long userId;
|
||||||
|
private Long spuId;
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
//类型 1-增加 2-减少
|
||||||
|
private Integer type = 1;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package org.springblade.modules.appFormal.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class UpdatePasswordRequest implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String password;
|
||||||
|
private Long phone;
|
||||||
|
private String code;
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AppFormalAddressVO implements Serializable {
|
||||||
|
|
||||||
|
private Long id = -1L;
|
||||||
|
|
||||||
|
private Long regionsInfoId = -1L;
|
||||||
|
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
private String district;
|
||||||
|
|
||||||
|
private String street;
|
||||||
|
|
||||||
|
private String detail;
|
||||||
|
|
||||||
|
private String consignee;
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
private Integer isDefault = -1;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AppFormalMallCartVO {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品名称
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
|
||||||
|
private String mainImg;
|
||||||
|
|
||||||
|
private BigDecimal originalPrice;
|
||||||
|
private BigDecimal retailPrice;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springblade.modules.order.pojo.entity.MallDetailOrderEntity;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AppFormalMallDetailOrderVO extends MallDetailOrderEntity {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springblade.modules.mall.pojo.entity.UserAddressEntity;
|
||||||
|
import org.springblade.modules.order.pojo.entity.MallSummaryOrderEntity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AppFormalMallOrderVO extends MallSummaryOrderEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情订单
|
||||||
|
*/
|
||||||
|
List<AppFormalMallDetailOrderVO> detailOrderList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金金额
|
||||||
|
*/
|
||||||
|
private BigDecimal cashAmount= BigDecimal.ZERO;
|
||||||
|
|
||||||
|
boolean isCanAfter = false;
|
||||||
|
|
||||||
|
private UserAddressEntity address;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springblade.common.utils.string.StringPool;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AppFormalMallSkuVO implements Serializable {
|
||||||
|
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String title = StringPool.EMPTY;
|
||||||
|
|
||||||
|
private String skuTitle = StringPool.EMPTY;
|
||||||
|
|
||||||
|
private Integer quantity = -1;
|
||||||
|
|
||||||
|
private String image = StringPool.EMPTY;
|
||||||
|
|
||||||
|
private BigDecimal currentPrice = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
private BigDecimal totalAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AppFormalMallSpuVO implements Serializable {
|
||||||
|
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 商品编码
|
||||||
|
*/
|
||||||
|
private String spuSn;
|
||||||
|
/**
|
||||||
|
* 商品名称
|
||||||
|
*/
|
||||||
|
private String spuName;
|
||||||
|
/**
|
||||||
|
* 主图
|
||||||
|
*/
|
||||||
|
private String mainImg;
|
||||||
|
/**
|
||||||
|
* 详情图(多图,逗号分割)
|
||||||
|
*/
|
||||||
|
private String detailImg;
|
||||||
|
/**
|
||||||
|
* 顶图(多图,逗号分割)
|
||||||
|
*/
|
||||||
|
private String topImg;
|
||||||
|
/**
|
||||||
|
* cate_id分类
|
||||||
|
*/
|
||||||
|
private String cateId;
|
||||||
|
/**
|
||||||
|
* cate_id分类
|
||||||
|
*/
|
||||||
|
private String cateIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原价
|
||||||
|
*/
|
||||||
|
private BigDecimal originalPrice;
|
||||||
|
/**
|
||||||
|
* 销售价
|
||||||
|
*/
|
||||||
|
private BigDecimal retailPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 销量
|
||||||
|
*/
|
||||||
|
private Integer sales;
|
||||||
|
/**
|
||||||
|
* 库存
|
||||||
|
*/
|
||||||
|
private Integer spuQty;
|
||||||
|
/**
|
||||||
|
* 标签(多标签,逗号分割 )
|
||||||
|
*/
|
||||||
|
private String tags;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springblade.modules.appFormal.enums.BizTypeEnum;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AppFormalOrderVO implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
private String images;
|
||||||
|
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
private Integer orderType;
|
||||||
|
|
||||||
|
private Integer orderStatus;
|
||||||
|
|
||||||
|
private String orderStatusName;
|
||||||
|
|
||||||
|
private Integer paymentStatus;
|
||||||
|
|
||||||
|
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
|
||||||
|
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date paymentTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付方式
|
||||||
|
*/
|
||||||
|
private Integer paymentType;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AppFormalPreviewOrderVO implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private List<AppFormalMallSkuVO> skuList = Collections.emptyList();
|
||||||
|
|
||||||
|
private BigDecimal orderAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
private BigDecimal freightAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
private BigDecimal totalAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 随机立减
|
||||||
|
*/
|
||||||
|
private BigDecimal cutAmount;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
//
|
||||||
|
public class AppFormalRegionInfoVO implements Serializable {
|
||||||
|
|
||||||
|
//
|
||||||
|
@TableId(type = IdType.NONE)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
//
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
//
|
||||||
|
private Integer level;
|
||||||
|
|
||||||
|
//
|
||||||
|
private Long pid;
|
||||||
|
|
||||||
|
//
|
||||||
|
private BigDecimal lon;
|
||||||
|
|
||||||
|
//
|
||||||
|
private BigDecimal lat;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springblade.common.utils.string.StringPool;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class FullRegionInfoVO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Integer currentLevel = -1;
|
||||||
|
|
||||||
|
private String street = StringPool.EMPTY;
|
||||||
|
|
||||||
|
private String district = StringPool.EMPTY;
|
||||||
|
|
||||||
|
private String city = StringPool.EMPTY;
|
||||||
|
|
||||||
|
private String province = StringPool.EMPTY;
|
||||||
|
|
||||||
|
private Long streetId = -1L;
|
||||||
|
|
||||||
|
private Long districtId = -1L;
|
||||||
|
|
||||||
|
private Long cityId = -1L;
|
||||||
|
|
||||||
|
private Long provinceId = -1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class MallCategoryVO {
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分类名称
|
||||||
|
*/
|
||||||
|
private String cname;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class MallIntegralLogVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户手机号
|
||||||
|
*/
|
||||||
|
private Long userPhone;
|
||||||
|
/**
|
||||||
|
* 用户名称
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
/**
|
||||||
|
* 金额
|
||||||
|
*/
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
private String sourceDetail;
|
||||||
|
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date statisticalDate;
|
||||||
|
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class MallIntegralVO implements Serializable {
|
||||||
|
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package org.springblade.modules.appFormal.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class UserInfoVO implements Serializable {
|
||||||
|
|
||||||
|
private String username;
|
||||||
|
private String phone;
|
||||||
|
private String avatar;
|
||||||
|
private String invitationCode;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package org.springblade.modules.appOffline.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.core.secure.utils.AuthUtil;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.modules.appOffline.manager.OfflineAppDailySignManager;
|
||||||
|
import org.springblade.modules.appOffline.request.WatchVideoRequest;
|
||||||
|
import org.springblade.modules.appOffline.vo.AppOffLineAdsVO;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("offline-app/dailySign")
|
||||||
|
@Tag(name = "积分app签到信息", description = "积分app签到信息接口")
|
||||||
|
public class OffLineDailySignController {
|
||||||
|
|
||||||
|
private final OfflineAppDailySignManager dailySignManager;
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "查询签到广告列表")
|
||||||
|
@GetMapping("/find-sign-ads-list")
|
||||||
|
public R<List<AppOffLineAdsVO>> findSignAdsList() {
|
||||||
|
return R.data(dailySignManager.findSignAdsList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否看广告
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Operation(summary = "是否看广告")
|
||||||
|
@GetMapping("/is-look-Ads-output")
|
||||||
|
public R<Boolean> isLookAtAdsByOutput(){
|
||||||
|
return R.status(dailySignManager.isLookAtAdsByOutput());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始观看视频
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Operation(summary = "开始观看视频")
|
||||||
|
@PostMapping("/start-look-ads")
|
||||||
|
public R<Boolean> startLookAtAds(@RequestBody WatchVideoRequest request){
|
||||||
|
return R.status(dailySignManager.startLookAtAds(request.setUserId(AuthUtil.getUserId())));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束观看视频
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Operation(summary = "结束观看视频")
|
||||||
|
@PostMapping("/end-look-ads")
|
||||||
|
public R<Boolean> endLookAtAdsByOutput(@RequestBody WatchVideoRequest request){
|
||||||
|
return R.status(dailySignManager.endLookAtAds(request.setUserId(AuthUtil.getUserId())));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
package org.springblade.modules.appOffline.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.core.mp.support.Condition;
|
||||||
|
import org.springblade.core.mp.support.Query;
|
||||||
|
import org.springblade.core.secure.utils.AuthUtil;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.modules.appOffline.manager.OfflineAppCustomerManager;
|
||||||
|
import org.springblade.modules.appOffline.vo.*;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("offline-app/customer")
|
||||||
|
@Tag(name = "积分app用户信息", description = "积分app用户信息接口")
|
||||||
|
public class OfflineBaseController {
|
||||||
|
|
||||||
|
private final OfflineAppCustomerManager offlineAppCustomerManager;;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "查询用户信息")
|
||||||
|
@GetMapping("/find-user-info")
|
||||||
|
public R<AppOfflineUserInfoVO> findUserInfo() {
|
||||||
|
return R.data(offlineAppCustomerManager.findUserInfo(AuthUtil.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "查询积分")
|
||||||
|
@GetMapping("/find-user-integral")
|
||||||
|
public R<AppOfflineIntegralVO> findUserIntegral() {
|
||||||
|
return R.data(offlineAppCustomerManager.findUserIntegral(AuthUtil.getUserId()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "查询福利积分流水")
|
||||||
|
@GetMapping("/find-benefit-log")
|
||||||
|
public R<IPage<AppOffLineIntegralLogVO>> findBenefitLog(Query query ,AppOffLineIntegralLogVO log) {
|
||||||
|
return R.data(offlineAppCustomerManager.findBenefitLog(Condition.getPage(query) , log ,AuthUtil.getUserId()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询现金券流水")
|
||||||
|
@GetMapping("/find-cash-log")
|
||||||
|
public R<IPage<AppOffLineIntegralLogVO>> findCashLog(Query query ,AppOffLineIntegralLogVO log) {
|
||||||
|
return R.data(offlineAppCustomerManager.findCashLog(Condition.getPage(query) , log , AuthUtil.getUserId()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询佣金流水")
|
||||||
|
@GetMapping("/find-commission-log")
|
||||||
|
public R<IPage<AppOffLineIntegralLogVO>> findCommissionLog(Query query ,AppOffLineIntegralLogVO log) {
|
||||||
|
return R.data(offlineAppCustomerManager.findCommissionLog(Condition.getPage(query) , log ,AuthUtil.getUserId()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "查询福利包列表")
|
||||||
|
@GetMapping("/find-packagesInfo-list")
|
||||||
|
public R<List<AppOffLinePackageInfoVO>> findPackagesInfoList() {
|
||||||
|
return R.data(offlineAppCustomerManager.findPackagesInfoList());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "查询用户兑换福利包的列表")
|
||||||
|
@GetMapping("/find-user-pack-list")
|
||||||
|
public R<IPage<AppOffLineUserPackInfoVO>> findUserPackList(Query query , AppOffLineUserPackInfoVO packInfo) {
|
||||||
|
return R.data(offlineAppCustomerManager.findUserPackList(Condition.getPage(query) , packInfo ,AuthUtil.getUserId()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package org.springblade.modules.appOffline.convert;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
import org.springblade.modules.appOffline.vo.*;
|
||||||
|
import org.springblade.modules.customer.pojo.entity.UserIncreaseDayEntity;
|
||||||
|
import org.springblade.modules.userPackInfo.pojo.entity.AdsEntity;
|
||||||
|
import org.springblade.modules.userPackInfo.pojo.entity.PackageInfoEntity;
|
||||||
|
import org.springblade.modules.userPackInfo.pojo.entity.UserPackageInfoCopyEntity;
|
||||||
|
import org.springblade.modules.userPoint.pojo.entity.UserBenefitLogEntity;
|
||||||
|
import org.springblade.modules.userPoint.pojo.entity.UserCashLogEntity;
|
||||||
|
import org.springblade.modules.userPoint.pojo.entity.UserCommissionLogEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author jack
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AppOfflineUserInfoConvert {
|
||||||
|
|
||||||
|
AppOfflineUserInfoConvert INSTANCE = Mappers.getMapper(AppOfflineUserInfoConvert.class);
|
||||||
|
|
||||||
|
AppOfflineUserInfoVO convertEntityToVO(UserIncreaseDayEntity entity);
|
||||||
|
|
||||||
|
AppOffLineIntegralLogVO convertBenefitLogPageToVO(UserBenefitLogEntity entity);
|
||||||
|
|
||||||
|
AppOffLineIntegralLogVO convertCashLogPageToVO(UserCashLogEntity entity);
|
||||||
|
|
||||||
|
AppOffLineIntegralLogVO convertCommissionLogPageToVO(UserCommissionLogEntity entity);
|
||||||
|
|
||||||
|
List<AppOffLinePackageInfoVO> convertPackageInfoListToVO(List<PackageInfoEntity> packageInfoList);
|
||||||
|
|
||||||
|
AppOffLineUserPackInfoVO convertUserPackInfoPageToVO(UserPackageInfoCopyEntity entity);
|
||||||
|
|
||||||
|
List<AppOffLineAdsVO> convertAdsListToVO(List<AdsEntity> list);
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package org.springblade.modules.appOffline.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class WatchVideoTimeRangeDTO {
|
||||||
|
|
||||||
|
private String startTime;
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package org.springblade.modules.appOffline.event;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AppUserRegisterEvent {
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
private String username;
|
||||||
|
private String phone;
|
||||||
|
private Integer isRoot = 1;
|
||||||
|
private Long pid = 0L;
|
||||||
|
private String pName = "";
|
||||||
|
private String pPhone = "";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.springblade.modules.appOffline.event;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain=true)
|
||||||
|
public class AppUserRevokedEvent {
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
package org.springblade.modules.appOffline.job;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.modules.customer.pojo.entity.UserDailySignEntity;
|
||||||
|
import org.springblade.modules.customer.service.IUserDailySignService;
|
||||||
|
import org.springblade.modules.userPackInfo.pojo.entity.UserPackageInfoCopyEntity;
|
||||||
|
import org.springblade.modules.userPackInfo.service.IUserPackageInfoCopyService;
|
||||||
|
import org.springblade.modules.userPoint.pojo.entity.UserBenefitEntity;
|
||||||
|
import org.springblade.modules.userPoint.pojo.entity.UserBenefitLogEntity;
|
||||||
|
import org.springblade.modules.userPoint.service.IUserBenefitLogService;
|
||||||
|
import org.springblade.modules.userPoint.service.IUserBenefitService;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class UserDailySignJob {
|
||||||
|
|
||||||
|
private final IUserDailySignService userDailySignService;
|
||||||
|
private final IUserPackageInfoCopyService userPackageInfoCopyService;
|
||||||
|
private final IUserBenefitService userBenefitService;
|
||||||
|
private final IUserBenefitLogService userBenefitLogService;
|
||||||
|
|
||||||
|
@XxlJob("yichayilu-user-sign-sendpoint")
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public void userDailySignSendPoint(){
|
||||||
|
log.info("完成签到任务的用户发放积分");
|
||||||
|
List<UserDailySignEntity> dailySignList = userDailySignService.list(
|
||||||
|
Wrappers.lambdaQuery(UserDailySignEntity.class)
|
||||||
|
.select(UserDailySignEntity::getUserId)
|
||||||
|
.eq(UserDailySignEntity::getStatisticsDate, DateUtil.getYesterday())
|
||||||
|
.eq(UserDailySignEntity::getType, 1)
|
||||||
|
.eq(UserDailySignEntity::getIsComplete, 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
HashSet<Long> dailySignUserIdSet = dailySignList.stream()
|
||||||
|
.map(UserDailySignEntity::getUserId)
|
||||||
|
.collect(Collectors.toCollection(HashSet::new));
|
||||||
|
|
||||||
|
|
||||||
|
log.info("签到人数:[{}] , 提取userId数量: [{}]" , dailySignList.size() , dailySignUserIdSet.size());
|
||||||
|
|
||||||
|
List<UserPackageInfoCopyEntity> userPackageInfoList = userPackageInfoCopyService.list(
|
||||||
|
Wrappers.lambdaQuery(UserPackageInfoCopyEntity.class)
|
||||||
|
.eq(UserPackageInfoCopyEntity::getIsExpired, 0)
|
||||||
|
.eq(UserPackageInfoCopyEntity::getIsComplete, 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<Long, List<UserPackageInfoCopyEntity>> userPackageInfoMap = userPackageInfoList.stream()
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
UserPackageInfoCopyEntity::getUserId
|
||||||
|
));
|
||||||
|
// 已经签到的福利包
|
||||||
|
List<UserPackageInfoCopyEntity> signUserPackList = new LinkedList<>();
|
||||||
|
// 没有签到的福利包
|
||||||
|
List<UserPackageInfoCopyEntity> notSignUserPackList = new LinkedList<>();
|
||||||
|
// 用户福利积分流水
|
||||||
|
List<UserBenefitLogEntity> userBenefitLogList = new LinkedList<>();
|
||||||
|
// 用户福利积分总计
|
||||||
|
Map<Long , BigDecimal> userBenefitMap = new HashMap<>();
|
||||||
|
|
||||||
|
userPackageInfoMap.forEach((userId, packageInfoList) -> {
|
||||||
|
|
||||||
|
if(dailySignUserIdSet.contains(userId)){
|
||||||
|
signUserPackList.addAll(packageInfoList);
|
||||||
|
userBenefitMap.put(userId, BigDecimal.ZERO);
|
||||||
|
}else {
|
||||||
|
notSignUserPackList.addAll(packageInfoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
String yyyyMMdd = DateUtil.convertFromDate(DateUtil.getYesterday(), "yyyyMMdd");
|
||||||
|
Long notSignDay = Long.parseLong(yyyyMMdd);
|
||||||
|
|
||||||
|
notSignUserPackList.forEach(packageInfo -> {
|
||||||
|
List<Long> notSignList = packageInfo.getNotSignList();
|
||||||
|
notSignList.add(notSignDay);
|
||||||
|
packageInfo.setNotSignList(notSignList);
|
||||||
|
packageInfo.setExperienceDay(packageInfo.getExperienceDay() + 1);
|
||||||
|
log.info("用户:[{}]未签到,福利包:[{}],未签到日期:[{}]" , packageInfo.getUserId() ,packageInfo.getPackageName(), packageInfo.getNotSignList());
|
||||||
|
});
|
||||||
|
|
||||||
|
signUserPackList.forEach(packageInfo -> {
|
||||||
|
BigDecimal amountOut = packageInfo.getAmountDay();
|
||||||
|
if (packageInfo.getRemainingAmount().compareTo(amountOut) < 0 ||
|
||||||
|
packageInfo.getDayTotal() - packageInfo.getOutDay() <= 1
|
||||||
|
){
|
||||||
|
amountOut = packageInfo.getRemainingAmount();
|
||||||
|
packageInfo.setRemainingAmount(BigDecimal.ZERO);
|
||||||
|
packageInfo.setIsComplete(1);
|
||||||
|
}else {
|
||||||
|
packageInfo.setRemainingAmount(packageInfo.getRemainingAmount().subtract(amountOut));
|
||||||
|
}
|
||||||
|
|
||||||
|
packageInfo.setOutDay(packageInfo.getOutDay() + 1);
|
||||||
|
packageInfo.setExperienceDay(packageInfo.getExperienceDay() + 1);
|
||||||
|
|
||||||
|
BigDecimal bigDecimal = userBenefitMap.get(packageInfo.getUserId());
|
||||||
|
userBenefitMap.put(packageInfo.getUserId(), bigDecimal.add(amountOut));
|
||||||
|
|
||||||
|
userBenefitLogList.add(
|
||||||
|
new UserBenefitLogEntity()
|
||||||
|
.setUserId(packageInfo.getUserId())
|
||||||
|
.setUserPhone(packageInfo.getPhone())
|
||||||
|
.setUserName(packageInfo.getUserName())
|
||||||
|
.setAmount(amountOut)
|
||||||
|
.setSourceId(packageInfo.getUserId())
|
||||||
|
.setUserPackId(packageInfo.getId())
|
||||||
|
.setSourceDetail(packageInfo.getUserName())
|
||||||
|
.setOrderId(0L)
|
||||||
|
.setType(1)
|
||||||
|
.setStatisticalDate(DateUtil.getYesterday())
|
||||||
|
.setRemark(DateUtil.convertFromDate(DateUtil.getYesterday(), "yyyy-MM-dd") +"签到" + packageInfo.getPackageName() + "发放积分")
|
||||||
|
);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
userBenefitLogList.forEach(userBenefitLog -> {
|
||||||
|
log.info("用户签到福利包发放积分:[{}]" , userBenefitLog);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
userBenefitMap.forEach((userId, amount) -> {
|
||||||
|
log.info("用户:[{}]签到福利包发放积分:[{}]" , userId , amount);
|
||||||
|
UserBenefitEntity userBenefit = userBenefitService.getById(userId);
|
||||||
|
Integer version = 1;
|
||||||
|
if (userBenefit == null){
|
||||||
|
userBenefit = new UserBenefitEntity();
|
||||||
|
userBenefit.setId(userId);
|
||||||
|
userBenefit.setAmount(amount);
|
||||||
|
userBenefit.setVersion(version);
|
||||||
|
userBenefitService.save(userBenefit);
|
||||||
|
}else {
|
||||||
|
version = userBenefit.getVersion();
|
||||||
|
|
||||||
|
}
|
||||||
|
if (!userBenefitService.addAmountNotLog(userId , amount , version)){
|
||||||
|
log.error("用户:[{}]福利值更新失败 , 福利值: [{}]", userId , amount);
|
||||||
|
throw new RuntimeException("用户:[" + userId + "]福利值更新失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
log.info("用户签到福利包发放积分完成");
|
||||||
|
userBenefitLogService.saveBatch(userBenefitLogList);
|
||||||
|
|
||||||
|
userPackageInfoCopyService.updateBatchById(signUserPackList);
|
||||||
|
userPackageInfoCopyService.updateBatchById(notSignUserPackList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,288 @@
|
|||||||
|
package org.springblade.modules.appOffline.job;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.modules.customer.pojo.entity.UserGenealogyEntity;
|
||||||
|
import org.springblade.modules.customer.pojo.entity.UserIncreaseDayEntity;
|
||||||
|
import org.springblade.modules.customer.pojo.entity.UserTreeEntity;
|
||||||
|
import org.springblade.modules.customer.service.IUserGenealogyService;
|
||||||
|
import org.springblade.modules.customer.service.IUserIncreaseDayService;
|
||||||
|
import org.springblade.modules.customer.service.IUserTreeService;
|
||||||
|
import org.springblade.modules.system.pojo.entity.User;
|
||||||
|
import org.springblade.modules.system.service.IUserService;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class UserGenealogyJob {
|
||||||
|
|
||||||
|
private final IUserTreeService userTreeService;
|
||||||
|
private final IUserGenealogyService userGenealogyService;
|
||||||
|
private final IUserIncreaseDayService userIncreaseDayService;
|
||||||
|
private final IUserService userService;
|
||||||
|
|
||||||
|
//从user_tree 同步信息 到 user_genealogy 15分钟一次
|
||||||
|
@XxlJob("yichayilu-appsync-genealogy")
|
||||||
|
public void appSyncGenealogy(){
|
||||||
|
log.info("开始执行用户层级同步信息");
|
||||||
|
|
||||||
|
List<UserTreeEntity> userTreeList = userTreeService.list(
|
||||||
|
Wrappers.lambdaQuery(UserTreeEntity.class)
|
||||||
|
.eq(UserTreeEntity::getIsSyncGenealogy, 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
//使用stream 根据pid分组
|
||||||
|
Map<Long, List<UserTreeEntity>> userTreeMap = userTreeList.stream().collect(Collectors.groupingBy(UserTreeEntity::getPid));
|
||||||
|
|
||||||
|
//提取 userTreeMap key
|
||||||
|
List<Long> pidList = userTreeMap.keySet().stream().toList();
|
||||||
|
|
||||||
|
//父级用户信息 map
|
||||||
|
Map<Long, UserGenealogyEntity> userGenealogyMap = userGenealogyService.list(
|
||||||
|
Wrappers.lambdaQuery(UserGenealogyEntity.class)
|
||||||
|
.in(UserGenealogyEntity::getId, pidList)
|
||||||
|
).stream().collect(Collectors.toMap(UserGenealogyEntity::getId, item -> item));
|
||||||
|
|
||||||
|
|
||||||
|
userTreeMap.forEach((pid, children) -> {
|
||||||
|
|
||||||
|
//提取children id
|
||||||
|
List<Long> childrenIdList = children.stream().map(UserTreeEntity::getId).toList();
|
||||||
|
|
||||||
|
if(userGenealogyMap.containsKey(pid)){
|
||||||
|
UserGenealogyEntity userGenealogy = userGenealogyMap.get(pid);
|
||||||
|
|
||||||
|
List<Long> userDirectList = userGenealogy.getUserDirectList();
|
||||||
|
userDirectList.addAll(childrenIdList);
|
||||||
|
userGenealogy.setUserDirectList(userDirectList);
|
||||||
|
|
||||||
|
userGenealogy.setUserDirectNumber(userGenealogy.getUserDirectNumber() + childrenIdList.size());
|
||||||
|
userGenealogy.setUserChildNumber(userGenealogy.getUserChildNumber() + childrenIdList.size());
|
||||||
|
if(userGenealogyService.updateById(userGenealogy)){
|
||||||
|
genealogyIncrChildNumber(userGenealogy.getGenealogyList() , childrenIdList.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
userTreeList.forEach(item -> {
|
||||||
|
item.setIsSyncGenealogy(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
userTreeService.updateBatchById(userTreeList);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//每天凌晨1点执行 表达式 0 1 * * ?
|
||||||
|
@XxlJob("yichayilu-appsync-register-tree")
|
||||||
|
public void appSyncRegisterTree(){
|
||||||
|
log.info("同步注册后没结构的用户信息-树结构");
|
||||||
|
List<User> userList = userService.list(
|
||||||
|
Wrappers.lambdaQuery(User.class)
|
||||||
|
.eq(User::getRegisterDate, DateUtil.getYesterday())
|
||||||
|
);
|
||||||
|
|
||||||
|
long userTreeRegisterCount = userTreeService.count(
|
||||||
|
Wrappers.lambdaQuery(UserTreeEntity.class)
|
||||||
|
.eq(UserTreeEntity::getRegisterDate, DateUtil.getYesterday())
|
||||||
|
);
|
||||||
|
|
||||||
|
log.info("用户数量 : {} , 树结构数量:{}" ,userList.size() , userTreeRegisterCount);
|
||||||
|
|
||||||
|
if (userList.size() > userTreeRegisterCount) {
|
||||||
|
Set<Long> userTreeIdSet = userTreeService.list(
|
||||||
|
Wrappers.lambdaQuery(UserTreeEntity.class)
|
||||||
|
.eq(UserTreeEntity::getRegisterDate, DateUtil.getYesterday())
|
||||||
|
).stream().map(UserTreeEntity::getId).collect(Collectors.toSet());
|
||||||
|
|
||||||
|
for (User userInfo : userList) {
|
||||||
|
if (!userTreeIdSet.contains(userInfo.getId())) {
|
||||||
|
|
||||||
|
log.info("开始同步树结构信息");
|
||||||
|
|
||||||
|
UserTreeEntity savaUserTree = new UserTreeEntity();
|
||||||
|
savaUserTree.setId(userInfo.getId());
|
||||||
|
savaUserTree.setName(userInfo.getName());
|
||||||
|
savaUserTree.setPhone(Long.valueOf(userInfo.getPhone()));
|
||||||
|
savaUserTree.setLevel(1);
|
||||||
|
savaUserTree.setPid(0L);
|
||||||
|
savaUserTree.setPPhone(null);
|
||||||
|
savaUserTree.setPName("");
|
||||||
|
savaUserTree.setPLevel(0);
|
||||||
|
savaUserTree.setIsSyncGenealogy(0);
|
||||||
|
savaUserTree.setIsRevoked(0);
|
||||||
|
savaUserTree.setRegisterDate(DateUtil.getToday());
|
||||||
|
|
||||||
|
if (userInfo.getPid() > 0){
|
||||||
|
|
||||||
|
UserTreeEntity parentTree = userTreeService.getById(userInfo.getPid());
|
||||||
|
if (parentTree != null){
|
||||||
|
|
||||||
|
savaUserTree.setPid(parentTree.getId());
|
||||||
|
savaUserTree.setPPhone(parentTree.getPhone());
|
||||||
|
savaUserTree.setPName(parentTree.getName());
|
||||||
|
savaUserTree.setPLevel(parentTree.getLevel());
|
||||||
|
savaUserTree.setLevel(parentTree.getLevel() + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
userTreeService.save(savaUserTree);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@XxlJob("yichayilu-appsync-register-genealogy")
|
||||||
|
public void appSyncRegisterGenealogy(){
|
||||||
|
log.info("同步注册后没结构的用户信息-族谱");
|
||||||
|
|
||||||
|
List<User> userList = userService.list(
|
||||||
|
Wrappers.lambdaQuery(User.class)
|
||||||
|
.eq(User::getRegisterDate, DateUtil.getYesterday())
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
long userGenealogyRegisterCount = userGenealogyService.count(
|
||||||
|
Wrappers.lambdaQuery(UserGenealogyEntity.class)
|
||||||
|
.eq(UserGenealogyEntity::getRegisterDate, DateUtil.getYesterday())
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
log.info("用户数量 : {} , 族谱数量:{}" ,userList.size() , userGenealogyRegisterCount);
|
||||||
|
|
||||||
|
|
||||||
|
if (userList.size() > userGenealogyRegisterCount) {
|
||||||
|
Set<Long> userGenealogyIdSet = userGenealogyService.list(
|
||||||
|
Wrappers.lambdaQuery(UserGenealogyEntity.class)
|
||||||
|
.eq(UserGenealogyEntity::getRegisterDate, DateUtil.getYesterday())
|
||||||
|
).stream().map(UserGenealogyEntity::getId).collect(Collectors.toSet());
|
||||||
|
for (User userInfo : userList) {
|
||||||
|
if (!userGenealogyIdSet.contains(userInfo.getId())) {
|
||||||
|
log.info("开始同步族谱信息");
|
||||||
|
UserGenealogyEntity savaUserGenealogy = new UserGenealogyEntity();
|
||||||
|
savaUserGenealogy.setId(userInfo.getId());
|
||||||
|
savaUserGenealogy.setName(userInfo.getName());
|
||||||
|
savaUserGenealogy.setPhone(Long.valueOf(userInfo.getPhone()));
|
||||||
|
savaUserGenealogy.setUserDirectNumber(0);
|
||||||
|
savaUserGenealogy.setUserChildNumber(0);
|
||||||
|
savaUserGenealogy.setUserDirectList(new ArrayList<>());
|
||||||
|
savaUserGenealogy.setIsRevoked(0);
|
||||||
|
savaUserGenealogy.setRegisterDate(DateUtil.getToday());
|
||||||
|
|
||||||
|
savaUserGenealogy.setLevel(1);
|
||||||
|
savaUserGenealogy.setPid(0L);
|
||||||
|
savaUserGenealogy.setPPhone(null);
|
||||||
|
savaUserGenealogy.setPName("");
|
||||||
|
savaUserGenealogy.setRootId(userInfo.getId());
|
||||||
|
savaUserGenealogy.setGroupId(userInfo.getId());
|
||||||
|
savaUserGenealogy.setGenealogyList(new ArrayList<>());
|
||||||
|
|
||||||
|
if (userInfo.getPid() > 0){
|
||||||
|
UserGenealogyEntity parentGenealogy = userGenealogyService.getById(userInfo.getPid());
|
||||||
|
if (parentGenealogy != null){
|
||||||
|
savaUserGenealogy.setLevel(parentGenealogy.getLevel() + 1);
|
||||||
|
savaUserGenealogy.setPid(parentGenealogy.getId());
|
||||||
|
savaUserGenealogy.setPPhone(parentGenealogy.getPhone());
|
||||||
|
savaUserGenealogy.setPName(parentGenealogy.getName());
|
||||||
|
savaUserGenealogy.setRootId(parentGenealogy.getId());
|
||||||
|
savaUserGenealogy.setGroupId(parentGenealogy.getId());
|
||||||
|
|
||||||
|
List<Long> genealogyList = parentGenealogy.getGenealogyList();
|
||||||
|
genealogyList.add(parentGenealogy.getId());
|
||||||
|
savaUserGenealogy.setGenealogyList(genealogyList);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
userGenealogyService.save(savaUserGenealogy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@XxlJob("yichayilu-appsync-register-increaseDay")
|
||||||
|
public void appSyncRegisteIncreaseDayr(){
|
||||||
|
log.info("同步注册后没结构的用户信息-每日新增");
|
||||||
|
|
||||||
|
List<User> userList = userService.list(
|
||||||
|
Wrappers.lambdaQuery(User.class)
|
||||||
|
.eq(User::getRegisterDate, DateUtil.getYesterday())
|
||||||
|
);
|
||||||
|
|
||||||
|
long userIncreaseDayRegisterCount = userIncreaseDayService.count(
|
||||||
|
Wrappers.lambdaQuery(UserIncreaseDayEntity.class)
|
||||||
|
.eq(UserIncreaseDayEntity::getRegisterDate, DateUtil.getYesterday())
|
||||||
|
);
|
||||||
|
log.info("用户数量 : {} , 每日新增数量:{}" ,userList.size() , userIncreaseDayRegisterCount);
|
||||||
|
|
||||||
|
|
||||||
|
if (userList.size() > userIncreaseDayRegisterCount) {
|
||||||
|
Set<Long> userIncreaseDayIdSet = userIncreaseDayService.list(
|
||||||
|
Wrappers.lambdaQuery(UserIncreaseDayEntity.class)
|
||||||
|
.eq(UserIncreaseDayEntity::getRegisterDate, DateUtil.getYesterday())
|
||||||
|
).stream().map(UserIncreaseDayEntity::getId).collect(Collectors.toSet());
|
||||||
|
|
||||||
|
for (User userInfo : userList) {
|
||||||
|
if (!userIncreaseDayIdSet.contains(userInfo.getId())) {
|
||||||
|
UserIncreaseDayEntity savaUserIncreaseDay = new UserIncreaseDayEntity();
|
||||||
|
savaUserIncreaseDay.setId(userInfo.getId());
|
||||||
|
savaUserIncreaseDay.setName(userInfo.getName());
|
||||||
|
savaUserIncreaseDay.setPhone(Long.valueOf(userInfo.getPhone()));
|
||||||
|
savaUserIncreaseDay.setCurrentLevelId(0);
|
||||||
|
savaUserIncreaseDay.setCurrentLevelName("普通用户");
|
||||||
|
savaUserIncreaseDay.setIsReal(0);
|
||||||
|
savaUserIncreaseDay.setRegisterDate(DateUtil.getToday());
|
||||||
|
savaUserIncreaseDay.setIsRevoked(0);
|
||||||
|
savaUserIncreaseDay.setRegisterDate(DateUtil.getToday());
|
||||||
|
|
||||||
|
savaUserIncreaseDay.setPid(0L);
|
||||||
|
savaUserIncreaseDay.setPName("");
|
||||||
|
savaUserIncreaseDay.setPPhone(null);
|
||||||
|
savaUserIncreaseDay.setPLevel(0);
|
||||||
|
|
||||||
|
if (userInfo.getPid() > 0){
|
||||||
|
UserIncreaseDayEntity parentIncreaseDay = userIncreaseDayService.getById(userInfo.getPid());
|
||||||
|
if (parentIncreaseDay != null){
|
||||||
|
savaUserIncreaseDay.setPid(parentIncreaseDay.getId());
|
||||||
|
savaUserIncreaseDay.setPName(parentIncreaseDay.getName());
|
||||||
|
savaUserIncreaseDay.setPPhone(parentIncreaseDay.getPhone());
|
||||||
|
savaUserIncreaseDay.setPLevel(parentIncreaseDay.getCurrentLevelId());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
userIncreaseDayService.save(savaUserIncreaseDay);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void genealogyIncrChildNumber(List<Long> parentIdList , Integer number) {
|
||||||
|
parentIdList.forEach(parentId -> {
|
||||||
|
userGenealogyService.incrChildNumber(parentId , number);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,180 @@
|
|||||||
|
package org.springblade.modules.appOffline.listener;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.modules.appOffline.event.AppUserRegisterEvent;
|
||||||
|
import org.springblade.modules.appOffline.event.AppUserRevokedEvent;
|
||||||
|
import org.springblade.modules.customer.pojo.entity.UserGenealogyEntity;
|
||||||
|
import org.springblade.modules.customer.pojo.entity.UserIncreaseDayEntity;
|
||||||
|
import org.springblade.modules.customer.pojo.entity.UserTreeEntity;
|
||||||
|
|
||||||
|
import org.springblade.modules.customer.service.IUserGenealogyService;
|
||||||
|
import org.springblade.modules.customer.service.IUserIncreaseDayService;
|
||||||
|
import org.springblade.modules.customer.service.IUserTreeService;
|
||||||
|
import org.springframework.context.event.EventListener;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AppUserInfoListener {
|
||||||
|
|
||||||
|
private final IUserTreeService userTreeService;
|
||||||
|
private final IUserGenealogyService userGenealogyService;
|
||||||
|
private final IUserIncreaseDayService userIncreaseDayService;
|
||||||
|
|
||||||
|
@Async("appRegisterExecutor")
|
||||||
|
@EventListener
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public void incrUerRegisterInfo(AppUserRegisterEvent event) {
|
||||||
|
log.info("用户层级同步信息[{}]", event);
|
||||||
|
|
||||||
|
log.info("开始同步树结构信息");
|
||||||
|
UserTreeEntity userTree = userTreeService.getById(event.getUserId());
|
||||||
|
if (userTree == null) {
|
||||||
|
UserTreeEntity savaUserTree = new UserTreeEntity();
|
||||||
|
savaUserTree.setId(event.getUserId());
|
||||||
|
savaUserTree.setName(event.getUsername());
|
||||||
|
savaUserTree.setPhone(Long.valueOf(event.getPhone()));
|
||||||
|
savaUserTree.setLevel(1);
|
||||||
|
savaUserTree.setPid(0L);
|
||||||
|
savaUserTree.setPPhone(null);
|
||||||
|
savaUserTree.setPName("");
|
||||||
|
savaUserTree.setPLevel(0);
|
||||||
|
savaUserTree.setIsSyncGenealogy(0);
|
||||||
|
savaUserTree.setIsRevoked(0);
|
||||||
|
savaUserTree.setRegisterDate(DateUtil.getToday());
|
||||||
|
|
||||||
|
if (event.getIsRoot() == 0){
|
||||||
|
UserTreeEntity parentTree = userTreeService.getById(event.getPid());
|
||||||
|
if (parentTree != null){
|
||||||
|
|
||||||
|
savaUserTree.setPid(parentTree.getId());
|
||||||
|
savaUserTree.setPPhone(parentTree.getPhone());
|
||||||
|
savaUserTree.setPName(parentTree.getName());
|
||||||
|
savaUserTree.setPLevel(parentTree.getLevel());
|
||||||
|
savaUserTree.setLevel(parentTree.getLevel() + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
userTreeService.save(savaUserTree);
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("开始同步族谱信息");
|
||||||
|
UserGenealogyEntity userGenealogy = userGenealogyService.getById(event.getUserId());
|
||||||
|
if (userGenealogy == null) {
|
||||||
|
UserGenealogyEntity savaUserGenealogy = new UserGenealogyEntity();
|
||||||
|
savaUserGenealogy.setId(event.getUserId());
|
||||||
|
savaUserGenealogy.setName(event.getUsername());
|
||||||
|
savaUserGenealogy.setPhone(Long.valueOf(event.getPhone()));
|
||||||
|
savaUserGenealogy.setUserDirectNumber(0);
|
||||||
|
savaUserGenealogy.setUserChildNumber(0);
|
||||||
|
savaUserGenealogy.setUserDirectList(new ArrayList<>());
|
||||||
|
savaUserGenealogy.setIsRevoked(0);
|
||||||
|
savaUserGenealogy.setRegisterDate(DateUtil.getToday());
|
||||||
|
|
||||||
|
savaUserGenealogy.setLevel(1);
|
||||||
|
savaUserGenealogy.setPid(0L);
|
||||||
|
savaUserGenealogy.setPPhone(null);
|
||||||
|
savaUserGenealogy.setPName("");
|
||||||
|
savaUserGenealogy.setRootId(event.getUserId());
|
||||||
|
savaUserGenealogy.setGroupId(event.getUserId());
|
||||||
|
savaUserGenealogy.setGenealogyList(new ArrayList<>());
|
||||||
|
|
||||||
|
if (event.getIsRoot() == 0){
|
||||||
|
UserGenealogyEntity parentGenealogy = userGenealogyService.getById(event.getPid());
|
||||||
|
if (parentGenealogy != null){
|
||||||
|
log.info("打印: [{}]",parentGenealogy);
|
||||||
|
savaUserGenealogy.setLevel(parentGenealogy.getLevel() + 1);
|
||||||
|
savaUserGenealogy.setPid(parentGenealogy.getId());
|
||||||
|
savaUserGenealogy.setPPhone(parentGenealogy.getPhone());
|
||||||
|
savaUserGenealogy.setPName(parentGenealogy.getName());
|
||||||
|
savaUserGenealogy.setRootId(parentGenealogy.getId());
|
||||||
|
savaUserGenealogy.setGroupId(parentGenealogy.getId());
|
||||||
|
|
||||||
|
List<Long> genealogyList = parentGenealogy.getGenealogyList();
|
||||||
|
genealogyList.add(parentGenealogy.getId());
|
||||||
|
savaUserGenealogy.setGenealogyList(genealogyList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
userGenealogyService.save(savaUserGenealogy);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
log.info("开始用户统计信息");
|
||||||
|
UserIncreaseDayEntity userIncreaseDay = userIncreaseDayService.getById(event.getUserId());
|
||||||
|
if (userIncreaseDay == null) {
|
||||||
|
UserIncreaseDayEntity savaUserIncreaseDay = new UserIncreaseDayEntity();
|
||||||
|
savaUserIncreaseDay.setId(event.getUserId());
|
||||||
|
savaUserIncreaseDay.setName(event.getUsername());
|
||||||
|
savaUserIncreaseDay.setPhone(Long.valueOf(event.getPhone()));
|
||||||
|
savaUserIncreaseDay.setCurrentLevelId(0);
|
||||||
|
savaUserIncreaseDay.setCurrentLevelName("普通用户");
|
||||||
|
savaUserIncreaseDay.setIsReal(0);
|
||||||
|
savaUserIncreaseDay.setRegisterDate(DateUtil.getToday());
|
||||||
|
savaUserIncreaseDay.setIsRevoked(0);
|
||||||
|
savaUserIncreaseDay.setRegisterDate(DateUtil.getToday());
|
||||||
|
|
||||||
|
savaUserIncreaseDay.setPid(0L);
|
||||||
|
savaUserIncreaseDay.setPName("");
|
||||||
|
savaUserIncreaseDay.setPPhone(null);
|
||||||
|
savaUserIncreaseDay.setPLevel(0);
|
||||||
|
|
||||||
|
if (event.getIsRoot() == 0){
|
||||||
|
UserIncreaseDayEntity parentIncreaseDay = userIncreaseDayService.getById(event.getPid());
|
||||||
|
if (parentIncreaseDay != null){
|
||||||
|
savaUserIncreaseDay.setPid(parentIncreaseDay.getId());
|
||||||
|
savaUserIncreaseDay.setPName(parentIncreaseDay.getName());
|
||||||
|
savaUserIncreaseDay.setPPhone(parentIncreaseDay.getPhone());
|
||||||
|
savaUserIncreaseDay.setPLevel(parentIncreaseDay.getCurrentLevelId());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
userIncreaseDayService.save(savaUserIncreaseDay);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Async("appRevokedExecutor")
|
||||||
|
@EventListener
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public void appUserRevokedExecutor(AppUserRevokedEvent event) {
|
||||||
|
log.info("用户注销id : [{}]", event);
|
||||||
|
UserTreeEntity userTree = userTreeService.getById(event.getUserId());
|
||||||
|
if (userTree != null) {
|
||||||
|
userTree.setIsRevoked(1);
|
||||||
|
userTreeService.updateById(userTree);
|
||||||
|
}
|
||||||
|
|
||||||
|
UserGenealogyEntity userGenealogy = userGenealogyService.getById(event.getUserId());
|
||||||
|
if (userGenealogy != null) {
|
||||||
|
userGenealogy.setIsRevoked(1);
|
||||||
|
userGenealogy.setRemark(userGenealogy.getRemark() + "|" + DateUtil.convertFromDate(DateUtil.getToday() , "yyyy-MM-dd HH:mm:ss") + "注销");
|
||||||
|
userGenealogyService.updateById(userGenealogy);
|
||||||
|
}
|
||||||
|
UserIncreaseDayEntity userIncreaseDay = userIncreaseDayService.getById(event.getUserId());
|
||||||
|
if (userIncreaseDay != null) {
|
||||||
|
userIncreaseDay.setIsRevoked(1);
|
||||||
|
userIncreaseDayService.updateById(userIncreaseDay);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
package org.springblade.modules.appOffline.manager;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.modules.appOffline.convert.AppOfflineUserInfoConvert;
|
||||||
|
import org.springblade.modules.appOffline.vo.*;
|
||||||
|
import org.springblade.modules.customer.pojo.entity.UserIncreaseDayEntity;
|
||||||
|
import org.springblade.modules.customer.service.IUserIncreaseDayService;
|
||||||
|
import org.springblade.modules.system.pojo.entity.User;
|
||||||
|
import org.springblade.modules.system.service.IUserService;
|
||||||
|
import org.springblade.modules.userPackInfo.pojo.entity.PackageInfoEntity;
|
||||||
|
import org.springblade.modules.userPackInfo.pojo.entity.UserPackageInfoCopyEntity;
|
||||||
|
import org.springblade.modules.userPackInfo.service.IPackageInfoService;
|
||||||
|
import org.springblade.modules.userPackInfo.service.IUserPackageInfoCopyService;
|
||||||
|
import org.springblade.modules.userPoint.pojo.entity.*;
|
||||||
|
import org.springblade.modules.userPoint.service.*;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class OfflineAppCustomerManager {
|
||||||
|
|
||||||
|
|
||||||
|
private final IUserService userService;
|
||||||
|
private final IUserIncreaseDayService userIncreaseDayService;
|
||||||
|
private final IUserBenefitService userBenefitService;
|
||||||
|
private final IUserCashService userCashService;
|
||||||
|
private final IUserCommissionService userCommissionService;
|
||||||
|
|
||||||
|
private final IUserBenefitLogService userBenefitLogService;
|
||||||
|
private final IUserCashLogService userCashLogService;
|
||||||
|
private final IUserCommissionLogService userCommissionLogService;
|
||||||
|
|
||||||
|
private final IPackageInfoService packageInfoService;
|
||||||
|
private final IUserPackageInfoCopyService userPackageInfoCopyService;
|
||||||
|
|
||||||
|
|
||||||
|
private List<AppOffLinePackageInfoVO> packageInfoVOList;
|
||||||
|
|
||||||
|
@XxlJob("yichayilu-refresh-packageInfoList")
|
||||||
|
@PostConstruct
|
||||||
|
public void initPackageInfoList() {
|
||||||
|
|
||||||
|
List<PackageInfoEntity> packageInfoList = packageInfoService.list(
|
||||||
|
Wrappers.lambdaQuery(PackageInfoEntity.class)
|
||||||
|
.orderByAsc(PackageInfoEntity::getId)
|
||||||
|
);
|
||||||
|
packageInfoVOList = AppOfflineUserInfoConvert.INSTANCE.convertPackageInfoListToVO(packageInfoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public AppOfflineUserInfoVO findUserInfo(Long userId) {
|
||||||
|
User user = userService.getById(userId);
|
||||||
|
Assert.notNull(user, "用户不存在");
|
||||||
|
|
||||||
|
UserIncreaseDayEntity userIncreaseDayEntity = userIncreaseDayService.getById(userId);
|
||||||
|
return AppOfflineUserInfoConvert.INSTANCE.convertEntityToVO(userIncreaseDayEntity);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public AppOfflineIntegralVO findUserIntegral(Long userId) {
|
||||||
|
|
||||||
|
UserBenefitEntity userBenefit = userBenefitService.getById(userId);
|
||||||
|
if (userBenefit == null){
|
||||||
|
userBenefit = new UserBenefitEntity();
|
||||||
|
userBenefit.setId(userId);
|
||||||
|
userBenefit.setAmount(BigDecimal.ZERO);
|
||||||
|
userBenefitService.save(userBenefit);
|
||||||
|
}
|
||||||
|
|
||||||
|
UserCashEntity userCash = userCashService.getById(userId);
|
||||||
|
if (userCash == null){
|
||||||
|
userCash = new UserCashEntity();
|
||||||
|
userCash.setId(userId);
|
||||||
|
userCash.setAmount(BigDecimal.ZERO);
|
||||||
|
userCashService.save(userCash);
|
||||||
|
}
|
||||||
|
|
||||||
|
UserCommissionEntity userCommission = userCommissionService.getById(userId);
|
||||||
|
if (userCommission == null){
|
||||||
|
userCommission = new UserCommissionEntity();
|
||||||
|
userCommission.setId(userId);
|
||||||
|
userCommission.setAmount(BigDecimal.ZERO);
|
||||||
|
userCommissionService.save(userCommission);
|
||||||
|
}
|
||||||
|
return new AppOfflineIntegralVO().setBenefit(userBenefit.getAmount()).setCash(userCash.getAmount()).setCommission(userCommission.getAmount());
|
||||||
|
}
|
||||||
|
|
||||||
|
public IPage<AppOffLineIntegralLogVO> findBenefitLog(IPage<Object> page, AppOffLineIntegralLogVO log, Long userId) {
|
||||||
|
|
||||||
|
|
||||||
|
Page<UserBenefitLogEntity> pageResult = userBenefitLogService.page(
|
||||||
|
new Page<>(page.getCurrent(), page.getSize()),
|
||||||
|
Wrappers.lambdaQuery(UserBenefitLogEntity.class)
|
||||||
|
.eq(UserBenefitLogEntity::getUserId, userId)
|
||||||
|
.eq(Objects.nonNull(log.getType()), UserBenefitLogEntity::getType, log.getType())
|
||||||
|
.eq(Objects.nonNull(log.getStatisticalDate()), UserBenefitLogEntity::getStatisticalDate, log.getStatisticalDate())
|
||||||
|
.orderByDesc(UserBenefitLogEntity::getId)
|
||||||
|
);
|
||||||
|
|
||||||
|
return pageResult.convert(AppOfflineUserInfoConvert.INSTANCE::convertBenefitLogPageToVO);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public IPage<AppOffLineIntegralLogVO> findCashLog(IPage<Object> page, AppOffLineIntegralLogVO log, Long userId) {
|
||||||
|
Page<UserCashLogEntity> pageResult = userCashLogService.page(
|
||||||
|
new Page<>(page.getCurrent(), page.getSize()),
|
||||||
|
Wrappers.lambdaQuery(UserCashLogEntity.class)
|
||||||
|
.eq(UserCashLogEntity::getUserId, userId)
|
||||||
|
.eq(Objects.nonNull(log.getType()), UserCashLogEntity::getType, log.getType())
|
||||||
|
.eq(Objects.nonNull(log.getStatisticalDate()), UserCashLogEntity::getStatisticalDate, log.getStatisticalDate())
|
||||||
|
.orderByDesc(UserCashLogEntity::getId)
|
||||||
|
);
|
||||||
|
|
||||||
|
return pageResult.convert(AppOfflineUserInfoConvert.INSTANCE::convertCashLogPageToVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IPage<AppOffLineIntegralLogVO> findCommissionLog(IPage<Object> page, AppOffLineIntegralLogVO log, Long userId) {
|
||||||
|
Page<UserCommissionLogEntity> pageResult = userCommissionLogService.page(
|
||||||
|
new Page<>(page.getCurrent(), page.getSize()),
|
||||||
|
Wrappers.lambdaQuery(UserCommissionLogEntity.class)
|
||||||
|
.eq(UserCommissionLogEntity::getUserId, userId)
|
||||||
|
.eq(Objects.nonNull(log.getType()), UserCommissionLogEntity::getType, log.getType())
|
||||||
|
.eq(Objects.nonNull(log.getStatisticalDate()), UserCommissionLogEntity::getStatisticalDate, log.getStatisticalDate())
|
||||||
|
.orderByDesc(UserCommissionLogEntity::getId)
|
||||||
|
);
|
||||||
|
|
||||||
|
return pageResult.convert(AppOfflineUserInfoConvert.INSTANCE::convertCommissionLogPageToVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<AppOffLinePackageInfoVO> findPackagesInfoList() {
|
||||||
|
return packageInfoVOList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IPage<AppOffLineUserPackInfoVO> findUserPackList(IPage<Object> page, AppOffLineUserPackInfoVO packInfo, Long userId) {
|
||||||
|
|
||||||
|
Page<UserPackageInfoCopyEntity> pageResult = userPackageInfoCopyService.page(
|
||||||
|
new Page<>(page.getCurrent(), page.getSize()),
|
||||||
|
Wrappers.lambdaQuery(UserPackageInfoCopyEntity.class)
|
||||||
|
.eq(UserPackageInfoCopyEntity::getUserId, userId)
|
||||||
|
.eq(Objects.nonNull(packInfo.getType()), UserPackageInfoCopyEntity::getType, packInfo.getType())
|
||||||
|
.eq(Objects.nonNull(packInfo.getStatisticalDate()), UserPackageInfoCopyEntity::getStatisticalDate, packInfo.getStatisticalDate())
|
||||||
|
.eq(Objects.nonNull(packInfo.getIsComplete()), UserPackageInfoCopyEntity::getIsComplete, packInfo.getIsComplete())
|
||||||
|
.eq(Objects.nonNull(packInfo.getIsExpired()), UserPackageInfoCopyEntity::getIsExpired, packInfo.getIsExpired())
|
||||||
|
.orderByDesc(UserPackageInfoCopyEntity::getId)
|
||||||
|
);
|
||||||
|
|
||||||
|
return pageResult.convert(AppOfflineUserInfoConvert.INSTANCE::convertUserPackInfoPageToVO);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,271 @@
|
|||||||
|
package org.springblade.modules.appOffline.manager;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.core.redis.cache.BladeRedis;
|
||||||
|
import org.springblade.modules.appOffline.convert.AppOfflineUserInfoConvert;
|
||||||
|
import org.springblade.modules.appOffline.dto.WatchVideoTimeRangeDTO;
|
||||||
|
import org.springblade.modules.appOffline.request.WatchVideoRequest;
|
||||||
|
import org.springblade.modules.appOffline.vo.AppOffLineAdsVO;
|
||||||
|
import org.springblade.modules.customer.pojo.entity.UserDailySignEntity;
|
||||||
|
import org.springblade.modules.customer.service.IUserDailySignService;
|
||||||
|
import org.springblade.modules.system.pojo.entity.User;
|
||||||
|
import org.springblade.modules.system.service.IParamService;
|
||||||
|
import org.springblade.modules.system.service.IUserService;
|
||||||
|
import org.springblade.modules.userPackInfo.pojo.entity.AdsEntity;
|
||||||
|
import org.springblade.modules.userPackInfo.service.IAdsService;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class OfflineAppDailySignManager {
|
||||||
|
|
||||||
|
private final IAdsService adsService;
|
||||||
|
private final IParamService paramService;
|
||||||
|
private final IUserService userBaseService;
|
||||||
|
private final BladeRedis bladeRedis;
|
||||||
|
private final IUserDailySignService userDailySignService;
|
||||||
|
|
||||||
|
private List<AppOffLineAdsVO> signAdsList;
|
||||||
|
|
||||||
|
|
||||||
|
private final static String OUTPUT_LOG_KEY = "yichayilu:app:sign:red_watch_video:output_log:";
|
||||||
|
private final static String OUTPUT_TIME_KEY = "yichayilu:app:sign:red_watch_video:output_time:";
|
||||||
|
|
||||||
|
private final static String PAYOUTS_LOG_KEY = "yichayilu:app:sign:red_watch_video:payouts_log:";
|
||||||
|
private final static String PAYOUTS_TIME_KEY = "yichayilu:app:sign:red_watch_video:payouts_time:";
|
||||||
|
|
||||||
|
|
||||||
|
@XxlJob("yichayilu-refresh-signAdsList")
|
||||||
|
@PostConstruct
|
||||||
|
public void initSignAdsList() {
|
||||||
|
|
||||||
|
List<AdsEntity> list = adsService.list(
|
||||||
|
Wrappers.lambdaQuery(AdsEntity.class)
|
||||||
|
.eq(AdsEntity::getType, 1)
|
||||||
|
.orderByAsc(AdsEntity::getId)
|
||||||
|
);
|
||||||
|
|
||||||
|
signAdsList = AppOfflineUserInfoConvert.INSTANCE.convertAdsListToVO(list);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<AppOffLineAdsVO> findSignAdsList() {
|
||||||
|
return signAdsList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isLookAtAdsByOutput() {
|
||||||
|
|
||||||
|
return paramService.isLookAtAdsByOutput();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public boolean startLookAtAds(WatchVideoRequest request) {
|
||||||
|
Assert.isTrue(paramService.isLookAtAdsByOutput(), "观看广告功能暂不开放");
|
||||||
|
Assert.isTrue(isWatchVideoTime(), "未到开放观看视频时间");
|
||||||
|
User userBase = userBaseService.getById(request.getUserId());
|
||||||
|
Assert.notNull(userBase , "无效用户");
|
||||||
|
|
||||||
|
|
||||||
|
List<AppOffLineAdsVO> adsList = findSignAdsList();
|
||||||
|
// 使用stream将 signAdsList list转成 map
|
||||||
|
Map<Long, AppOffLineAdsVO> adsMap = adsList.stream()
|
||||||
|
.collect(Collectors.toMap(
|
||||||
|
AppOffLineAdsVO::getId, // 使用 ID 作为 key
|
||||||
|
Function.identity() // VO 对象本身作为 value
|
||||||
|
));
|
||||||
|
|
||||||
|
Assert.isTrue(adsMap.containsKey(request.getAdsId()) , "无效广告参数");
|
||||||
|
AppOffLineAdsVO adsInfo = adsMap.get(request.getAdsId());
|
||||||
|
Integer adsIndex = adsInfo.getSort();
|
||||||
|
|
||||||
|
|
||||||
|
String key = OUTPUT_LOG_KEY + userBase.getId() + ":" + DateUtil.convertFromDate(DateUtil.getToday() , "yyyy-MM-dd");
|
||||||
|
|
||||||
|
String outputTimeKey = OUTPUT_TIME_KEY + userBase.getId() + ":" + DateUtil.convertFromDate(DateUtil.getToday() , "yyyy-MM-dd") + ":" + adsIndex;
|
||||||
|
|
||||||
|
Object objectLookAtAds = bladeRedis.get(key);
|
||||||
|
if (objectLookAtAds == null) {
|
||||||
|
bladeRedis.setEx(outputTimeKey, System.currentTimeMillis(), Duration.ofSeconds(60 * 60 * 24));
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
//二进制视频
|
||||||
|
String binaryLookAtAds = (String) objectLookAtAds;
|
||||||
|
if (isLook(binaryLookAtAds , adsIndex)){
|
||||||
|
throw new RuntimeException("此广告今日已经观看");
|
||||||
|
}
|
||||||
|
bladeRedis.setEx(outputTimeKey, System.currentTimeMillis(), Duration.ofSeconds(60 * 60 * 24));
|
||||||
|
return Boolean.TRUE;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean endLookAtAds(WatchVideoRequest request) {
|
||||||
|
|
||||||
|
Assert.isTrue(paramService.isLookAtAdsByOutput(), "观看广告功能暂不开放");
|
||||||
|
Assert.isTrue(isWatchVideoTime(), "未到开放观看视频时间");
|
||||||
|
User userBase = userBaseService.getById(request.getUserId());
|
||||||
|
Assert.notNull(userBase , "无效用户");
|
||||||
|
|
||||||
|
// 查询广告
|
||||||
|
int adsType = 1;
|
||||||
|
List<AppOffLineAdsVO> adsList = findSignAdsList();
|
||||||
|
// 使用stream将 signAdsList list转成 map
|
||||||
|
Map<Long, AppOffLineAdsVO> adsMap = adsList.stream()
|
||||||
|
.collect(Collectors.toMap(
|
||||||
|
AppOffLineAdsVO::getId, // 使用 ID 作为 key
|
||||||
|
Function.identity() // VO 对象本身作为 value
|
||||||
|
));
|
||||||
|
Assert.isTrue(adsMap.containsKey(request.getAdsId()) , "无效广告参数");
|
||||||
|
AppOffLineAdsVO adsInfo = adsMap.get(request.getAdsId());
|
||||||
|
Integer adsIndex = adsInfo.getSort();
|
||||||
|
|
||||||
|
String adsBinary = createBinary(adsList.size(), "1");
|
||||||
|
int adsAnInt = Integer.parseInt(adsBinary, 2);
|
||||||
|
|
||||||
|
String outputTimeKey = OUTPUT_TIME_KEY + userBase.getId() + ":" + DateUtil.convertFromDate(DateUtil.getToday() , "yyyy-MM-dd") + ":" + adsIndex;
|
||||||
|
Object objectOutputTime = bladeRedis.get(outputTimeKey);
|
||||||
|
if (objectOutputTime == null) {
|
||||||
|
throw new RuntimeException("请观看广告");
|
||||||
|
}
|
||||||
|
long outputTime = Long.parseLong(String.valueOf(objectOutputTime));
|
||||||
|
if((System.currentTimeMillis() - outputTime) < (adsInfo.getAdsTime() * 1000)){
|
||||||
|
throw new RuntimeException("检测到观看广告存在作弊行为");
|
||||||
|
}
|
||||||
|
|
||||||
|
String key = OUTPUT_LOG_KEY + userBase.getId() + ":" + DateUtil.convertFromDate(DateUtil.getToday() , "yyyy-MM-dd");
|
||||||
|
Object objectLookAtAds = bladeRedis.get(key);
|
||||||
|
String lookToBinary = createBinary(adsList.size(), "0");;
|
||||||
|
if (objectLookAtAds == null) {
|
||||||
|
lookToBinary = setLookToBinary(lookToBinary, adsIndex);
|
||||||
|
}else {
|
||||||
|
if (isLook(String.valueOf(objectLookAtAds) , adsIndex)){
|
||||||
|
throw new RuntimeException("此广告今日已经观看");
|
||||||
|
}
|
||||||
|
lookToBinary = setLookToBinary(String.valueOf(objectLookAtAds), adsIndex);
|
||||||
|
}
|
||||||
|
bladeRedis.setEx(key, lookToBinary, Duration.ofSeconds(60 * 60 * 24));
|
||||||
|
UserDailySignEntity userDailySign = userDailySignService.getOne(
|
||||||
|
Wrappers.lambdaQuery(UserDailySignEntity.class)
|
||||||
|
.eq(UserDailySignEntity::getType, adsType)
|
||||||
|
.eq(UserDailySignEntity::getUserId, userBase.getId())
|
||||||
|
.eq(UserDailySignEntity::getStatisticsDate, DateUtil.getToday())
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
String remarks = "广告" + adsIndex + "观看时间:" + DateUtil.convertFromDate(new Date(outputTime) , "yyyy-MM-dd HH:mm:ss") + ",结束时间:" + DateUtil.convertFromDate(new Date(System.currentTimeMillis()) , "yyyy-MM-dd HH:mm:ss");
|
||||||
|
if (userDailySign == null) {
|
||||||
|
userDailySign = new UserDailySignEntity();
|
||||||
|
userDailySign.setType(adsType);
|
||||||
|
userDailySign.setUserId(userBase.getId());
|
||||||
|
userDailySign.setUserName(userBase.getName());
|
||||||
|
userDailySign.setUserPhone(Long.valueOf(userBase.getPhone()));
|
||||||
|
userDailySign.setStatisticsDate(DateUtil.getToday());
|
||||||
|
userDailySign.setSignCount(Integer.parseInt(lookToBinary,2));
|
||||||
|
userDailySign.setIsComplete(0);
|
||||||
|
userDailySign.setRemarks(remarks);
|
||||||
|
if(!userDailySignService.save(userDailySign)){
|
||||||
|
throw new RuntimeException("记录广告异常");
|
||||||
|
}
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userDailySign.getSignCount() >= adsAnInt){
|
||||||
|
throw new RuntimeException("今日已经观看完全部广告");
|
||||||
|
}
|
||||||
|
|
||||||
|
int signCount = Integer.parseInt(lookToBinary, 2);
|
||||||
|
userDailySign.setSignCount(signCount);
|
||||||
|
userDailySign.setRemarks(userDailySign.getRemarks() + "|" +remarks);
|
||||||
|
if(!userDailySignService.updateById(userDailySign)){
|
||||||
|
throw new RuntimeException("记录广告异常");
|
||||||
|
}
|
||||||
|
if (signCount >= adsAnInt){
|
||||||
|
userDailySign.setIsComplete(1);
|
||||||
|
userDailySignService.updateById(userDailySign);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Boolean.TRUE;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String setLookToBinary(String binaryString,Integer adsIndex ) {
|
||||||
|
|
||||||
|
if (binaryString == null || binaryString.isEmpty()) {
|
||||||
|
throw new RuntimeException("广告记录未初始化");
|
||||||
|
}
|
||||||
|
if (adsIndex > binaryString.length()) {
|
||||||
|
throw new RuntimeException("无效广告参数");
|
||||||
|
}
|
||||||
|
StringBuilder stringBuilder = new StringBuilder(binaryString);
|
||||||
|
stringBuilder.setCharAt(adsIndex - 1,'1');
|
||||||
|
return stringBuilder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String createBinary(Integer size, String value) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
sb.append(value);
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Boolean isLook(String signCount , Integer adsIndex ) {
|
||||||
|
if (signCount == null || signCount.isEmpty()) {
|
||||||
|
throw new RuntimeException("无效广告参数");
|
||||||
|
}
|
||||||
|
if (adsIndex > signCount.length()) {
|
||||||
|
throw new RuntimeException("无效广告参数");
|
||||||
|
}
|
||||||
|
int anInt = Integer.parseInt(String.valueOf(signCount.charAt(adsIndex - 1)));
|
||||||
|
return anInt == 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private boolean isWatchVideoTime(){
|
||||||
|
WatchVideoTimeRangeDTO dto = paramService.watchVideoTimeRange();
|
||||||
|
|
||||||
|
// 获取开始 时间 的小时和分钟
|
||||||
|
String[] startSplit = dto.getStartTime().split(":");
|
||||||
|
String[] endSplit = dto.getEndTime().split(":");
|
||||||
|
|
||||||
|
int startHour = Integer.parseInt(startSplit[0]);
|
||||||
|
int startMinute = Integer.parseInt(startSplit[1]);
|
||||||
|
int endHour = Integer.parseInt(endSplit[0]);
|
||||||
|
int endMinute = Integer.parseInt(endSplit[1]);
|
||||||
|
|
||||||
|
// 获取当前时间
|
||||||
|
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT+8"));
|
||||||
|
int currentHour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||||
|
int currentMinute = calendar.get(Calendar.MINUTE);
|
||||||
|
|
||||||
|
// 计算总的分钟数进行比较
|
||||||
|
int startTotalMinutes = startHour * 60 + startMinute;
|
||||||
|
int endTotalMinutes = endHour * 60 + endMinute;
|
||||||
|
int currentTotalMinutes = currentHour * 60 + currentMinute;
|
||||||
|
|
||||||
|
if (startTotalMinutes <= endTotalMinutes) {
|
||||||
|
// 同一天内的时间范围(如 09:00-18:00)
|
||||||
|
return currentTotalMinutes >= startTotalMinutes && currentTotalMinutes <= endTotalMinutes;
|
||||||
|
} else {
|
||||||
|
// 跨天的时间范围(如 22:00-06:00)
|
||||||
|
return currentTotalMinutes >= startTotalMinutes || currentTotalMinutes <= endTotalMinutes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package org.springblade.modules.appOffline.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lzq
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class WatchVideoRequest implements Serializable {
|
||||||
|
|
||||||
|
private Long userId ;
|
||||||
|
private Long adsId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
/**
|
||||||
|
* 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.appOffline.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告表 实体类
|
||||||
|
*
|
||||||
|
* @author lzq
|
||||||
|
* @since 2026-01-28
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("ads")
|
||||||
|
public class AppOffLineAdsVO {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 视频链接
|
||||||
|
*/
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频观看时长
|
||||||
|
*/
|
||||||
|
private Integer adsTime;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package org.springblade.modules.appOffline.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AppOffLineIntegralLogVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户手机号
|
||||||
|
*/
|
||||||
|
private Long userPhone;
|
||||||
|
/**
|
||||||
|
* 用户名称
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
/**
|
||||||
|
* 金额
|
||||||
|
*/
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
private String sourceDetail;
|
||||||
|
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date statisticalDate;
|
||||||
|
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package org.springblade.modules.appOffline.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AppOffLinePackageInfoVO implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分包名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 最大购买数量
|
||||||
|
*/
|
||||||
|
private Integer buyQty;
|
||||||
|
/**
|
||||||
|
* 产出总天数
|
||||||
|
*/
|
||||||
|
private Integer dayTotal;
|
||||||
|
/**
|
||||||
|
* 总产出福利积分
|
||||||
|
*/
|
||||||
|
private BigDecimal amountTotal;
|
||||||
|
/**
|
||||||
|
* 购买赠与福利值
|
||||||
|
*/
|
||||||
|
private BigDecimal giveAmount;
|
||||||
|
/**
|
||||||
|
* 激活比率
|
||||||
|
*/
|
||||||
|
private BigDecimal bonus;
|
||||||
|
/**
|
||||||
|
* 兑换包需要的福利积分
|
||||||
|
*/
|
||||||
|
private BigDecimal userBenefit;
|
||||||
|
/**
|
||||||
|
* 兑换包需要的现金券
|
||||||
|
*/
|
||||||
|
private BigDecimal userCash;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全网最大兑换数量
|
||||||
|
*/
|
||||||
|
private Integer maxExchangeQty;
|
||||||
|
/**
|
||||||
|
* 已兑换数量
|
||||||
|
*/
|
||||||
|
private Integer exchangedQty;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package org.springblade.modules.appOffline.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AppOffLineUserPackInfoVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*统计时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date statisticalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分包名称
|
||||||
|
*/
|
||||||
|
private String packageName;
|
||||||
|
/**
|
||||||
|
* 兑换包需要的福利积分
|
||||||
|
*/
|
||||||
|
private BigDecimal userBenefit;
|
||||||
|
/**
|
||||||
|
* 兑换包需要的现金券
|
||||||
|
*/
|
||||||
|
private BigDecimal userCash;
|
||||||
|
/**
|
||||||
|
* 购买赠与福利值
|
||||||
|
*/
|
||||||
|
private BigDecimal giveAmount;
|
||||||
|
/**
|
||||||
|
* 产出总天数
|
||||||
|
*/
|
||||||
|
private Integer dayTotal;
|
||||||
|
/**
|
||||||
|
* 总产出福利积分
|
||||||
|
*/
|
||||||
|
private BigDecimal amountTotal;
|
||||||
|
/**
|
||||||
|
* 每日产出福利积分
|
||||||
|
*/
|
||||||
|
private BigDecimal amountDay;
|
||||||
|
/**
|
||||||
|
* 已产出福利积分
|
||||||
|
*/
|
||||||
|
private BigDecimal amountOut;
|
||||||
|
/**
|
||||||
|
* 剩余可产出福利积分
|
||||||
|
*/
|
||||||
|
private BigDecimal remainingAmount;
|
||||||
|
/**
|
||||||
|
* 已加速多少福利积分
|
||||||
|
*/
|
||||||
|
private BigDecimal acceleratedAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产出天数 当前包已经产出天数
|
||||||
|
*/
|
||||||
|
private Integer outDay;
|
||||||
|
/**
|
||||||
|
* 当前包已经经历的天数
|
||||||
|
*/
|
||||||
|
private Integer experienceDay;
|
||||||
|
/**
|
||||||
|
* 未签到日期详情 (数组)
|
||||||
|
*/
|
||||||
|
private List<Long> notSignList;
|
||||||
|
/**
|
||||||
|
* 是否完成 0-未完成 1-完成
|
||||||
|
*/
|
||||||
|
private Integer isComplete;
|
||||||
|
/**
|
||||||
|
* 当前包生效时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date startTime;
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date activeTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过期时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date expiredDate;
|
||||||
|
/**
|
||||||
|
* 是否过期 0-未过期 1-已过期
|
||||||
|
*/
|
||||||
|
private Integer isExpired;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1-积分购买 2-后台划拨
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.springblade.modules.appOffline.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AppOfflineIntegralVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利积分
|
||||||
|
*/
|
||||||
|
private BigDecimal benefit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金券
|
||||||
|
*/
|
||||||
|
private BigDecimal cash;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 佣金
|
||||||
|
*/
|
||||||
|
private BigDecimal commission;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package org.springblade.modules.appOffline.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AppOfflineUserInfoVO implements Serializable {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private Long phone;
|
||||||
|
|
||||||
|
private Integer currentLevelId;
|
||||||
|
|
||||||
|
private String currentLevelName;
|
||||||
|
|
||||||
|
private Long pid;
|
||||||
|
|
||||||
|
private String pName;
|
||||||
|
|
||||||
|
private Long pPhone;
|
||||||
|
|
||||||
|
private Integer pLevel;
|
||||||
|
|
||||||
|
private Integer isReal;
|
||||||
|
|
||||||
|
private Date realDate;
|
||||||
|
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
private String realIdCard;
|
||||||
|
|
||||||
|
private Date registerDate;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -19,4 +19,11 @@ public interface BladeAuthConstant {
|
|||||||
* 账号锁定默认错误次数
|
* 账号锁定默认错误次数
|
||||||
*/
|
*/
|
||||||
Integer FAIL_COUNT = 5;
|
Integer FAIL_COUNT = 5;
|
||||||
|
|
||||||
|
String DEFAULT_PASSWORD = "123456";
|
||||||
|
|
||||||
|
String INVITATION_CODE = "invitation_code";
|
||||||
|
|
||||||
|
String BINARY_TEMPLATE = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package org.springblade.modules.auth.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class UserRegisterRoleDTO {
|
||||||
|
|
||||||
|
private String roleId;
|
||||||
|
/**
|
||||||
|
* 部门id
|
||||||
|
*/
|
||||||
|
private String deptId;
|
||||||
|
/**
|
||||||
|
* 岗位id
|
||||||
|
*/
|
||||||
|
private String postId;
|
||||||
|
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
package org.springblade.modules.auth.granter;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.core.launch.constant.TokenConstant;
|
||||||
|
import org.springblade.core.log.exception.ServiceException;
|
||||||
|
import org.springblade.core.oauth2.constant.OAuth2TokenConstant;
|
||||||
|
import org.springblade.core.oauth2.exception.UserInvalidException;
|
||||||
|
import org.springblade.core.oauth2.granter.AbstractTokenGranter;
|
||||||
|
import org.springblade.core.oauth2.granter.PasswordTokenGranter;
|
||||||
|
import org.springblade.core.oauth2.handler.PasswordHandler;
|
||||||
|
import org.springblade.core.oauth2.props.OAuth2Properties;
|
||||||
|
import org.springblade.core.oauth2.provider.OAuth2Request;
|
||||||
|
import org.springblade.core.oauth2.provider.OAuth2Token;
|
||||||
|
import org.springblade.core.oauth2.service.OAuth2ClientService;
|
||||||
|
import org.springblade.core.oauth2.service.OAuth2User;
|
||||||
|
import org.springblade.core.oauth2.service.OAuth2UserService;
|
||||||
|
import org.springblade.core.oauth2.utils.OAuth2Util;
|
||||||
|
import org.springblade.core.secure.TokenInfo;
|
||||||
|
import org.springblade.core.tool.utils.DigestUtil;
|
||||||
|
import org.springblade.core.tool.utils.Func;
|
||||||
|
import org.springblade.core.tool.utils.SM2Util;
|
||||||
|
import org.springblade.modules.sms.service.AliYunSmsService;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class AppPasswordTokenGranter extends AbstractTokenGranter {
|
||||||
|
|
||||||
|
|
||||||
|
private final OAuth2UserService userService;
|
||||||
|
private final OAuth2Properties properties;
|
||||||
|
|
||||||
|
public AppPasswordTokenGranter(OAuth2ClientService clientService,
|
||||||
|
OAuth2UserService userService,
|
||||||
|
PasswordHandler passwordHandler,
|
||||||
|
OAuth2Properties properties ) {
|
||||||
|
super(clientService, userService, passwordHandler);
|
||||||
|
this.userService = userService;
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String type() {
|
||||||
|
return PASSWORD;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OAuth2User user(OAuth2Request request) {
|
||||||
|
|
||||||
|
// 获取用户信息
|
||||||
|
OAuth2User user = userService.loadByUsername(request.getUsername(), request);
|
||||||
|
Assert.notNull(user, "用户不存在");
|
||||||
|
|
||||||
|
String decrypt = SM2Util.decrypt(request.getPassword(), properties.getPrivateKey());
|
||||||
|
log.info("密码:[{}]", decrypt);
|
||||||
|
String encrypt = DigestUtil.encrypt(decrypt);
|
||||||
|
log.info("密码:[{}]", encrypt);
|
||||||
|
|
||||||
|
if (!user.getPassword().equals(DigestUtil.encrypt(decrypt))) {
|
||||||
|
throw new ServiceException("密码不正确!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!userService.validateUser(user)) {
|
||||||
|
throw new UserInvalidException(OAuth2TokenConstant.TOKEN_NOT_CORRECT);
|
||||||
|
}
|
||||||
|
// 设置客户端信息
|
||||||
|
user.setClient(client(request));
|
||||||
|
log.info("用户信息:[{}]", user);
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OAuth2Token token(OAuth2User user, OAuth2Request request) {
|
||||||
|
TokenInfo accessToken = OAuth2Util.createAccessToken(user);
|
||||||
|
TokenInfo refreshToken = OAuth2Util.createRefreshToken(user);
|
||||||
|
OAuth2Token token = OAuth2Token.create();
|
||||||
|
token.getArgs().set("tenant_id", user.getTenantId()).set("user_id", user.getUserId()).set("dept_id", user.getDeptId()).set("post_id", user.getPostId()).set("role_id", user.getRoleId()).set("oauth_id", user.getOauthId()).set("account", user.getAccount()).set("user_name", user.getAccount()).set("nick_name", user.getName()).set("real_name", user.getRealName()).set("role_name", Func.join(user.getAuthorities())).set("avatar", Func.toStr(user.getAvatar(), "https://bladex.cn/images/logo-small.png")).set("access_token", accessToken.getToken()).set("refresh_token", refreshToken.getToken()).set("token_type", "bearer").set("expires_in", accessToken.getExpire()).set("detail", user.getDetail()).set("license", "powered by bladex");
|
||||||
|
return token.setAccessToken(accessToken.getToken()).setAccessTokenExpire(accessToken.getExpire()).setRefreshToken(refreshToken.getToken()).setRefreshTokenExpire(refreshToken.getExpire());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -25,8 +25,17 @@
|
|||||||
*/
|
*/
|
||||||
package org.springblade.modules.auth.granter;
|
package org.springblade.modules.auth.granter;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.PhoneUtil;
|
||||||
|
import cn.hutool.core.util.RadixUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import lombok.val;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springblade.common.cache.ParamCache;
|
import org.springblade.common.cache.ParamCache;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
import org.springblade.core.launch.constant.TokenConstant;
|
import org.springblade.core.launch.constant.TokenConstant;
|
||||||
import org.springblade.core.oauth2.exception.ExceptionCode;
|
import org.springblade.core.oauth2.exception.ExceptionCode;
|
||||||
import org.springblade.core.oauth2.exception.UserInvalidException;
|
import org.springblade.core.oauth2.exception.UserInvalidException;
|
||||||
@@ -40,12 +49,20 @@ import org.springblade.core.oauth2.service.OAuth2ClientService;
|
|||||||
import org.springblade.core.oauth2.service.OAuth2User;
|
import org.springblade.core.oauth2.service.OAuth2User;
|
||||||
import org.springblade.core.oauth2.service.OAuth2UserService;
|
import org.springblade.core.oauth2.service.OAuth2UserService;
|
||||||
import org.springblade.core.oauth2.service.impl.OAuth2UserDetail;
|
import org.springblade.core.oauth2.service.impl.OAuth2UserDetail;
|
||||||
|
import org.springblade.core.social.props.SocialProperties;
|
||||||
|
import org.springblade.core.tool.support.Kv;
|
||||||
import org.springblade.core.tool.utils.Func;
|
import org.springblade.core.tool.utils.Func;
|
||||||
import org.springblade.core.tool.utils.SM2Util;
|
import org.springblade.core.tool.utils.SM2Util;
|
||||||
|
import org.springblade.modules.appOffline.event.AppUserRegisterEvent;
|
||||||
|
import org.springblade.modules.auth.constant.BladeAuthConstant;
|
||||||
import org.springblade.modules.auth.provider.UserType;
|
import org.springblade.modules.auth.provider.UserType;
|
||||||
|
import org.springblade.modules.auth.ymlConfigFile.AppFormalClientConfig;
|
||||||
|
import org.springblade.modules.sms.service.AliYunSmsService;
|
||||||
import org.springblade.modules.system.pojo.entity.User;
|
import org.springblade.modules.system.pojo.entity.User;
|
||||||
import org.springblade.modules.system.service.IUserService;
|
import org.springblade.modules.system.service.IUserService;
|
||||||
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
@@ -57,16 +74,33 @@ import static org.springblade.modules.auth.constant.BladeAuthConstant.REGISTER_U
|
|||||||
*
|
*
|
||||||
* @author BladeX
|
* @author BladeX
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class RegisterTokenGranter extends AbstractTokenGranter {
|
public class RegisterTokenGranter extends AbstractTokenGranter {
|
||||||
|
|
||||||
private final IUserService service;
|
private final IUserService service;
|
||||||
private final OAuth2Properties properties;
|
private final OAuth2Properties properties;
|
||||||
|
private final AppFormalClientConfig appFormalClientConfig;
|
||||||
|
private final SocialProperties socialProperties;
|
||||||
|
private final ApplicationEventPublisher publisher;
|
||||||
|
private final AliYunSmsService aliYunSmsService;
|
||||||
|
|
||||||
public RegisterTokenGranter(OAuth2ClientService clientService, OAuth2UserService userService, PasswordHandler passwordHandler, IUserService service, OAuth2Properties properties) {
|
public RegisterTokenGranter(OAuth2ClientService clientService,
|
||||||
|
OAuth2UserService userService,
|
||||||
|
PasswordHandler passwordHandler,
|
||||||
|
IUserService service,
|
||||||
|
OAuth2Properties properties,
|
||||||
|
SocialProperties socialProperties,
|
||||||
|
AppFormalClientConfig appFormalClientConfig,
|
||||||
|
ApplicationEventPublisher publisher,
|
||||||
|
AliYunSmsService aliYunSmsService) {
|
||||||
super(clientService, userService, passwordHandler);
|
super(clientService, userService, passwordHandler);
|
||||||
this.service = service;
|
this.service = service;
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
|
this.appFormalClientConfig = appFormalClientConfig;
|
||||||
|
this.socialProperties = socialProperties;
|
||||||
|
this.publisher = publisher;
|
||||||
|
this.aliYunSmsService = aliYunSmsService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -76,29 +110,94 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OAuth2User user(OAuth2Request request) {
|
public OAuth2User user(OAuth2Request request) {
|
||||||
|
|
||||||
|
log.info("参数parameter:[{}]", request);
|
||||||
|
|
||||||
// 校验注册功能是否开启
|
// 校验注册功能是否开启
|
||||||
Boolean registerOpen = Func.toBoolean(ParamCache.getValue(REGISTER_USER_VALUE), false);
|
Boolean registerOpen = Func.toBoolean(ParamCache.getValue(REGISTER_USER_VALUE), false);
|
||||||
if (!registerOpen) {
|
|
||||||
|
String clientId = request.getClientId();
|
||||||
|
|
||||||
|
if (!registerOpen || !clientId.equals(appFormalClientConfig.getName())) {
|
||||||
throw new UserInvalidException("注册功能暂未开启,请联系管理员");
|
throw new UserInvalidException("注册功能暂未开启,请联系管理员");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Kv parameterArgs = request.getParameterArgs();
|
||||||
|
log.info("参数parameterArgs:[{}]", parameterArgs);
|
||||||
|
|
||||||
|
|
||||||
|
// 验证码
|
||||||
|
String code = request.getCode();
|
||||||
|
String password = request.getPassword();
|
||||||
|
log.info("password:[{}]", password);
|
||||||
|
if (code != null){
|
||||||
|
aliYunSmsService.verifySms(request.getPhone(), code);
|
||||||
|
password = BladeAuthConstant.DEFAULT_PASSWORD;
|
||||||
|
}else {
|
||||||
|
Assert.notNull(password, "密码不能为空");
|
||||||
|
//校验密码长度是6到12位, 可以包含字母、数字
|
||||||
|
Predicate<String> isPasswordValid = passwd -> passwd.matches("^(?=.*[0-9])(?=.*[a-z]){6,12}$");
|
||||||
|
//去掉上面特殊字符校验
|
||||||
|
Assert.isTrue(!isPasswordValid.test(password), "密码长度必须在6到12位之间,且需要包含英文与数字");
|
||||||
|
}
|
||||||
|
|
||||||
|
String sourceParameter = request.getSource();
|
||||||
|
String source = socialProperties.getAlias().getOrDefault(sourceParameter, sourceParameter);
|
||||||
|
log.info("参数source:[{}]", source);
|
||||||
|
|
||||||
// 用户注册信息
|
// 用户注册信息
|
||||||
User user = new User();
|
User user = new User();
|
||||||
user.setUserType(UserType.of(request.getUserType()).getCategory());
|
user.setUserType(UserType.of(request.getUserType()).getCategory());
|
||||||
user.setTenantId(request.getTenantId());
|
user.setTenantId(request.getTenantId());
|
||||||
user.setAccount(request.getUsername());
|
user.setAccount(request.getPhone());
|
||||||
user.setPassword(SM2Util.decrypt(request.getPassword(), properties.getPublicKey(), properties.getPrivateKey()));
|
user.setPassword(SM2Util.decrypt(request.getPassword(), properties.getPrivateKey()));
|
||||||
user.setName(request.getName());
|
user.setName(request.getName());
|
||||||
user.setRealName(request.getName());
|
user.setRealName(request.getName());
|
||||||
user.setPhone(request.getPhone());
|
user.setPhone(request.getPhone());
|
||||||
user.setEmail(request.getEmail());
|
user.setEmail(request.getEmail());
|
||||||
|
user.setRegisterDate(DateUtil.getToday());
|
||||||
// 校验用户格式
|
// 校验用户格式
|
||||||
validateUser(user);
|
validateUser(user);
|
||||||
|
|
||||||
|
Long pid = 0L;
|
||||||
|
String pPhone = "";
|
||||||
|
String pName = "";
|
||||||
|
Integer isRoot = 1;
|
||||||
|
|
||||||
|
if (source != null){
|
||||||
|
JSONObject jsonParameter = JSONObject.parseObject(source);
|
||||||
|
Assert.isTrue(jsonParameter.containsKey(BladeAuthConstant.INVITATION_CODE) , "无效邀请码格式");
|
||||||
|
Assert.notNull(jsonParameter.get(BladeAuthConstant.INVITATION_CODE), "邀请码不能为空");
|
||||||
|
Long parentPhone = HexToPhone(jsonParameter.getString(BladeAuthConstant.INVITATION_CODE));
|
||||||
|
Assert.isTrue(PhoneUtil.isPhone(String.valueOf(parentPhone)), "邀请码格式不正确");
|
||||||
|
log.info("父级手机号:{}" ,parentPhone);
|
||||||
|
User parentInfo = service.getOne(
|
||||||
|
Wrappers.lambdaQuery(User.class)
|
||||||
|
.eq(User::getPhone, String.valueOf(parentPhone))
|
||||||
|
);
|
||||||
|
Assert.notNull(parentInfo, "邀请码人不存在");
|
||||||
|
pid = parentInfo.getId();
|
||||||
|
pPhone = parentInfo.getPhone();
|
||||||
|
pName = parentInfo.getName();
|
||||||
|
isRoot = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
user.setInvitationCode(phoneTo32Hex(request.getPhone()));
|
||||||
|
user.setPid(pid);
|
||||||
// 执行用户注册
|
// 执行用户注册
|
||||||
if (service.registerUser(user)) {
|
if (service.registerUser(user)) {
|
||||||
// 构建oauth2所需用户信息
|
// 构建oauth2所需用户信息
|
||||||
|
publisher.publishEvent(
|
||||||
|
new AppUserRegisterEvent()
|
||||||
|
.setUserId(user.getId())
|
||||||
|
.setUsername(user.getName())
|
||||||
|
.setPhone(user.getPhone())
|
||||||
|
.setPid(pid)
|
||||||
|
.setPName(pName)
|
||||||
|
.setPPhone(pPhone)
|
||||||
|
.setIsRoot(isRoot)
|
||||||
|
);
|
||||||
return convertOAuth2UserDetail(user, client(request));
|
return convertOAuth2UserDetail(user, client(request));
|
||||||
}
|
}
|
||||||
throw new UserInvalidException(ExceptionCode.INVALID_USER.getMessage());
|
throw new UserInvalidException(ExceptionCode.INVALID_USER.getMessage());
|
||||||
@@ -118,25 +217,25 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
|
|||||||
|
|
||||||
private void validateUser(User user) {
|
private void validateUser(User user) {
|
||||||
Predicate<String> isNameValid = name -> name.matches("^([\\u4e00-\\u9fa5]{2,20}|[a-zA-Z]{2,10})$");
|
Predicate<String> isNameValid = name -> name.matches("^([\\u4e00-\\u9fa5]{2,20}|[a-zA-Z]{2,10})$");
|
||||||
Predicate<String> isUsernameValid = username -> username.matches("^(?=.*[a-zA-Z])[a-zA-Z0-9_\\-@]{3,20}$");
|
// Predicate<String> isUsernameValid = username -> username.matches("^(?=.*[a-zA-Z])[a-zA-Z0-9_\\-@]{3,20}$");
|
||||||
Predicate<String> isPasswordValid = password -> password.matches("^(?=.*[0-9])(?=.*[a-zA-Z])[\\w@-]{6,20}$");
|
Predicate<String> isPasswordValid = password -> password.matches("^(?=.*[0-9])(?=.*[a-zA-Z])[\\w@-]{6,20}$");
|
||||||
Predicate<String> isPhoneValid = phone -> phone.matches("^1[3-9]\\d{9}$");
|
Predicate<String> isPhoneValid = phone -> phone.matches("^1[3-9]\\d{9}$");
|
||||||
Predicate<String> isEmailValid = email -> email.matches("^[A-Za-z0-9+_.-]+@(.+)$");
|
// Predicate<String> isEmailValid = email -> email.matches("^[A-Za-z0-9+_.-]+@(.+)$");
|
||||||
if (!isNameValid.test(user.getName())) {
|
if (!isNameValid.test(user.getName())) {
|
||||||
throw new UserInvalidException("用户姓名长度必须在2-10之间,且仅能设置纯中文或纯英文");
|
throw new UserInvalidException("用户姓名长度必须在2-10之间,且仅能设置纯中文或纯英文");
|
||||||
}
|
}
|
||||||
if (!isUsernameValid.test(user.getAccount())) {
|
// if (!isUsernameValid.test(user.getAccount())) {
|
||||||
throw new UserInvalidException("用户账号长度必须在3-20之间,且需要包含英文,可额外携带数字、下划线、横杠、@");
|
// throw new UserInvalidException("用户账号长度必须在3-20之间,且需要包含英文,可额外携带数字、下划线、横杠、@");
|
||||||
}
|
// }
|
||||||
if (!isPasswordValid.test(user.getPassword())) {
|
// if (!isPasswordValid.test(user.getPassword())) {
|
||||||
throw new UserInvalidException("用户密码长度必须在6-20之间,且需要包含英文与数字,可额外携带下划线、横杠、@");
|
// throw new UserInvalidException("用户密码长度必须在6-20之间,且需要包含英文与数字,可额外携带下划线、横杠、@");
|
||||||
}
|
// }
|
||||||
if (!isPhoneValid.test(user.getPhone())) {
|
if (!isPhoneValid.test(user.getPhone())) {
|
||||||
throw new UserInvalidException("手机号格式不正确");
|
throw new UserInvalidException("手机号格式不正确");
|
||||||
}
|
}
|
||||||
if (!isEmailValid.test(user.getEmail())) {
|
// if (!isEmailValid.test(user.getEmail())) {
|
||||||
throw new UserInvalidException("邮箱格式不正确");
|
// throw new UserInvalidException("邮箱格式不正确");
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -154,4 +253,12 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
|
|||||||
userDetail.setClient(client);
|
userDetail.setClient(client);
|
||||||
return userDetail;
|
return userDetail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String phoneTo32Hex(String phone) {
|
||||||
|
return RadixUtil.encode(BladeAuthConstant.BINARY_TEMPLATE, Long.parseLong(phone));
|
||||||
|
}
|
||||||
|
private Long HexToPhone(String invitation_code) {
|
||||||
|
return RadixUtil.decode(BladeAuthConstant.BINARY_TEMPLATE, invitation_code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,40 +26,48 @@
|
|||||||
package org.springblade.modules.auth.granter;
|
package org.springblade.modules.auth.granter;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springblade.core.oauth2.constant.OAuth2TokenConstant;
|
import org.springblade.core.oauth2.constant.OAuth2TokenConstant;
|
||||||
import org.springblade.core.oauth2.exception.UserInvalidException;
|
import org.springblade.core.oauth2.exception.UserInvalidException;
|
||||||
import org.springblade.core.oauth2.granter.AbstractTokenGranter;
|
import org.springblade.core.oauth2.granter.AbstractTokenGranter;
|
||||||
import org.springblade.core.oauth2.handler.PasswordHandler;
|
import org.springblade.core.oauth2.handler.PasswordHandler;
|
||||||
import org.springblade.core.oauth2.props.OAuth2Properties;
|
import org.springblade.core.oauth2.props.OAuth2Properties;
|
||||||
import org.springblade.core.oauth2.provider.OAuth2Request;
|
import org.springblade.core.oauth2.provider.OAuth2Request;
|
||||||
|
import org.springblade.core.oauth2.provider.OAuth2Token;
|
||||||
import org.springblade.core.oauth2.service.OAuth2ClientService;
|
import org.springblade.core.oauth2.service.OAuth2ClientService;
|
||||||
import org.springblade.core.oauth2.service.OAuth2User;
|
import org.springblade.core.oauth2.service.OAuth2User;
|
||||||
import org.springblade.core.oauth2.service.OAuth2UserService;
|
import org.springblade.core.oauth2.service.OAuth2UserService;
|
||||||
|
import org.springblade.core.oauth2.utils.OAuth2Util;
|
||||||
|
import org.springblade.core.secure.TokenInfo;
|
||||||
import org.springblade.core.sms.model.SmsCode;
|
import org.springblade.core.sms.model.SmsCode;
|
||||||
import org.springblade.core.tool.utils.SM2Util;
|
import org.springblade.core.tool.utils.*;
|
||||||
import org.springblade.core.tool.utils.StringPool;
|
|
||||||
import org.springblade.core.tool.utils.StringUtil;
|
|
||||||
import org.springblade.core.tool.utils.WebUtil;
|
|
||||||
import org.springblade.modules.resource.builder.SmsBuilder;
|
import org.springblade.modules.resource.builder.SmsBuilder;
|
||||||
|
import org.springblade.modules.sms.service.AliYunSmsService;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SmsTokenGranter
|
* SmsTokenGranter
|
||||||
*
|
*
|
||||||
* @author BladeX
|
* @author BladeX
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class SmsTokenGranter extends AbstractTokenGranter {
|
public class SmsTokenGranter extends AbstractTokenGranter {
|
||||||
|
|
||||||
private final OAuth2UserService userService;
|
private final OAuth2UserService userService;
|
||||||
private final SmsBuilder smsBuilder;
|
|
||||||
private final OAuth2Properties properties;
|
private final OAuth2Properties properties;
|
||||||
|
private final AliYunSmsService aliYunSmsService;
|
||||||
|
|
||||||
public SmsTokenGranter(OAuth2ClientService clientService, OAuth2UserService userService, PasswordHandler passwordHandler, SmsBuilder smsBuilder, OAuth2Properties properties) {
|
public SmsTokenGranter(OAuth2ClientService clientService,
|
||||||
|
OAuth2UserService userService,
|
||||||
|
PasswordHandler passwordHandler,
|
||||||
|
OAuth2Properties properties ,
|
||||||
|
AliYunSmsService aliYunSmsService) {
|
||||||
super(clientService, userService, passwordHandler);
|
super(clientService, userService, passwordHandler);
|
||||||
this.userService = userService;
|
this.userService = userService;
|
||||||
this.smsBuilder = smsBuilder;
|
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
|
this.aliYunSmsService = aliYunSmsService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -69,34 +77,29 @@ public class SmsTokenGranter extends AbstractTokenGranter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OAuth2User user(OAuth2Request request) {
|
public OAuth2User user(OAuth2Request request) {
|
||||||
// 获取基础信息
|
|
||||||
String tenantId = request.getTenantId();
|
log.info("短信登录:[{}]", request);
|
||||||
SmsCode smsCode = buildSmsCode();
|
Assert.isTrue(StringUtil.isNotBlank(request.getCode()), "验证码不能为空");
|
||||||
// 校验手机加密认证
|
// aliYunSmsService.verifySms(request.getPhone(), request.getCode());
|
||||||
String decryptedPhone = SM2Util.decrypt(smsCode.getPhone(), properties.getPublicKey(), properties.getPrivateKey());
|
|
||||||
if (StringUtil.isBlank(decryptedPhone)) {
|
OAuth2User user = userService.loadByPhone(request.getPhone(), request);
|
||||||
throw new UserInvalidException(OAuth2TokenConstant.USER_PHONE_NOT_FOUND);
|
Assert.notNull(user, "用户不存在");
|
||||||
}
|
|
||||||
// 获取短信验证信息
|
|
||||||
boolean temp = smsBuilder.template(tenantId, StringPool.EMPTY).validateMessage(smsCode.setPhone(decryptedPhone));
|
|
||||||
if (!temp) {
|
|
||||||
throw new UserInvalidException(OAuth2TokenConstant.CAPTCHA_NOT_CORRECT);
|
|
||||||
}
|
|
||||||
// 获取用户信息
|
|
||||||
OAuth2User user = userService.loadByPhone(decryptedPhone, request);
|
|
||||||
// 校验用户信息
|
// 校验用户信息
|
||||||
if (!userService.validateUser(user)) {
|
if (!userService.validateUser(user)) {
|
||||||
throw new UserInvalidException(OAuth2TokenConstant.TOKEN_NOT_CORRECT);
|
throw new UserInvalidException(OAuth2TokenConstant.TOKEN_NOT_CORRECT);
|
||||||
}
|
}
|
||||||
// 设置客户端信息
|
// 设置客户端信息
|
||||||
user.setClient(client(request));
|
user.setClient(client(request));
|
||||||
|
log.info("用户信息:[{}]", user);
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SmsCode buildSmsCode() {
|
public OAuth2Token token(OAuth2User user, OAuth2Request request) {
|
||||||
HttpServletRequest request = WebUtil.getRequest();
|
TokenInfo accessToken = OAuth2Util.createAccessToken(user);
|
||||||
return new SmsCode().setId(request.getParameter("id"))
|
TokenInfo refreshToken = OAuth2Util.createRefreshToken(user);
|
||||||
.setPhone(request.getParameter("phone"))
|
OAuth2Token token = OAuth2Token.create();
|
||||||
.setValue(request.getParameter("value"));
|
token.getArgs().set("tenant_id", user.getTenantId()).set("user_id", user.getUserId()).set("dept_id", user.getDeptId()).set("post_id", user.getPostId()).set("role_id", user.getRoleId()).set("oauth_id", user.getOauthId()).set("account", user.getAccount()).set("user_name", user.getAccount()).set("nick_name", user.getName()).set("real_name", user.getRealName()).set("role_name", Func.join(user.getAuthorities())).set("avatar", Func.toStr(user.getAvatar(), "https://bladex.cn/images/logo-small.png")).set("access_token", accessToken.getToken()).set("refresh_token", refreshToken.getToken()).set("token_type", "bearer").set("expires_in", accessToken.getExpire()).set("detail", user.getDetail()).set("license", "powered by bladex");
|
||||||
|
return token.setAccessToken(accessToken.getToken()).setAccessTokenExpire(accessToken.getExpire()).setRefreshToken(refreshToken.getToken()).setRefreshTokenExpire(refreshToken.getExpire());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package org.springblade.modules.auth.ymlConfigFile;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "appclient.formal")
|
||||||
|
@Data
|
||||||
|
public class AppFormalClientConfig {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package org.springblade.modules.cashAccount.constant;
|
||||||
|
|
||||||
|
public interface CashAccountNameKey {
|
||||||
|
|
||||||
|
//5%广告补贴佣金
|
||||||
|
String COMMISSION_ADVERTISING = "COMMISSION_ADVERTISING";
|
||||||
|
|
||||||
|
//15%极差代理佣金
|
||||||
|
String COMMISSION_AGENCY = "COMMISSION_AGENCY";
|
||||||
|
|
||||||
|
//5%联创佣金
|
||||||
|
String COMMISSION_CO_CREATOR = "COMMISSION_CO_CREATOR";
|
||||||
|
|
||||||
|
//直推人佣金
|
||||||
|
String COMMISSION_DIRECT_PUSH = "COMMISSION_DIRECT_PUSH";
|
||||||
|
|
||||||
|
//商品成本佣金
|
||||||
|
String COMMISSION_GOODS_COST = "COMMISSION_GOODS_COST";
|
||||||
|
|
||||||
|
//5%运营佣金
|
||||||
|
String COMMISSION_OPERATION = "COMMISSION_OPERATION";
|
||||||
|
|
||||||
|
//5%服务商佣金
|
||||||
|
String COMMISSION_SERVICE_PROVIDER = "COMMISSION_SERVICE_PROVIDER";
|
||||||
|
|
||||||
|
//30%购买人获取用户积分佣金
|
||||||
|
String COMMISSION_USER_POINT_LOG = "COMMISSION_USER_POINT_LOG";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
/**
|
||||||
|
* 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.cashAccount.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.secure.BladeUser;
|
||||||
|
import org.springblade.core.secure.annotation.IsAdmin;
|
||||||
|
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.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionAccountEntity;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionAccountVO;
|
||||||
|
import org.springblade.modules.cashAccount.excel.UserCommissionAccountExcel;
|
||||||
|
import org.springblade.modules.cashAccount.wrapper.UserCommissionAccountWrapper;
|
||||||
|
import org.springblade.modules.cashAccount.service.IUserCommissionAccountService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import org.springblade.core.tool.utils.DateUtil;
|
||||||
|
import org.springblade.core.excel.util.ExcelUtil;
|
||||||
|
import org.springblade.core.tool.constant.BladeConstant;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户佣金账户表 控制器
|
||||||
|
*
|
||||||
|
* @author lzq
|
||||||
|
* @since 2026-01-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("blade-user-commissionaccount/commissionAccount")
|
||||||
|
@Tag(name = "用户佣金账户表", description = "用户佣金账户表接口")
|
||||||
|
public class UserCommissionAccountController extends BladeController {
|
||||||
|
|
||||||
|
private final IUserCommissionAccountService commissionAccountService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户佣金账户表 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入commissionAccount")
|
||||||
|
public R<UserCommissionAccountVO> detail(UserCommissionAccountEntity commissionAccount) {
|
||||||
|
UserCommissionAccountEntity detail = commissionAccountService.getOne(Condition.getQueryWrapper(commissionAccount));
|
||||||
|
return R.data(UserCommissionAccountWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 用户佣金账户表 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionAccount")
|
||||||
|
public R<IPage<UserCommissionAccountVO>> list(UserCommissionAccountEntity commissionAccount, Query query) {
|
||||||
|
IPage<UserCommissionAccountEntity> pages = commissionAccountService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionAccount));
|
||||||
|
return R.data(UserCommissionAccountWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户佣金账户表 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionAccount")
|
||||||
|
public R<IPage<UserCommissionAccountVO>> page(UserCommissionAccountVO commissionAccount, Query query) {
|
||||||
|
IPage<UserCommissionAccountVO> pages = commissionAccountService.selectUserCommissionAccountPage(Condition.getPage(query), commissionAccount);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户佣金账户表 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入commissionAccount")
|
||||||
|
public R save(@Valid @RequestBody UserCommissionAccountEntity commissionAccount) {
|
||||||
|
return R.status(commissionAccountService.save(commissionAccount));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户佣金账户表 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入commissionAccount")
|
||||||
|
public R update(@Valid @RequestBody UserCommissionAccountEntity commissionAccount) {
|
||||||
|
return R.status(commissionAccountService.updateById(commissionAccount));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户佣金账户表 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入commissionAccount")
|
||||||
|
public R submit(@Valid @RequestBody UserCommissionAccountEntity commissionAccount) {
|
||||||
|
return R.status(commissionAccountService.saveOrUpdate(commissionAccount));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户佣金账户表 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(commissionAccountService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
*/
|
||||||
|
@IsAdmin
|
||||||
|
@GetMapping("/export-commissionAccount")
|
||||||
|
@ApiOperationSupport(order = 9)
|
||||||
|
@Operation(summary = "导出数据", description = "传入commissionAccount")
|
||||||
|
public void exportUserCommissionAccount(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionAccount, BladeUser bladeUser, HttpServletResponse response) {
|
||||||
|
QueryWrapper<UserCommissionAccountEntity> queryWrapper = Condition.getQueryWrapper(commissionAccount, UserCommissionAccountEntity.class);
|
||||||
|
//if (!AuthUtil.isAdministrator()) {
|
||||||
|
// queryWrapper.lambda().eq(UserCommissionAccount::getTenantId, bladeUser.getTenantId());
|
||||||
|
//}
|
||||||
|
//queryWrapper.lambda().eq(UserCommissionAccountEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||||
|
List<UserCommissionAccountExcel> list = commissionAccountService.exportUserCommissionAccount(queryWrapper);
|
||||||
|
ExcelUtil.export(response, "用户佣金账户表数据" + DateUtil.time(), "用户佣金账户表数据表", list, UserCommissionAccountExcel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
/**
|
||||||
|
* 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.cashAccount.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.secure.BladeUser;
|
||||||
|
import org.springblade.core.secure.annotation.IsAdmin;
|
||||||
|
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.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionAdvertisingLogEntity;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionAdvertisingLogVO;
|
||||||
|
import org.springblade.modules.cashAccount.excel.UserCommissionAdvertisingLogExcel;
|
||||||
|
import org.springblade.modules.cashAccount.wrapper.UserCommissionAdvertisingLogWrapper;
|
||||||
|
import org.springblade.modules.cashAccount.service.IUserCommissionAdvertisingLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import org.springblade.core.tool.utils.DateUtil;
|
||||||
|
import org.springblade.core.excel.util.ExcelUtil;
|
||||||
|
import org.springblade.core.tool.constant.BladeConstant;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%广告补贴佣金流水表 控制器
|
||||||
|
*
|
||||||
|
* @author lzq
|
||||||
|
* @since 2026-01-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("blade-user-commissionadvertisinglog/commissionAdvertisingLog")
|
||||||
|
@Tag(name = "5%广告补贴佣金流水表", description = "5%广告补贴佣金流水表接口")
|
||||||
|
public class UserCommissionAdvertisingLogController extends BladeController {
|
||||||
|
|
||||||
|
private final IUserCommissionAdvertisingLogService commissionAdvertisingLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%广告补贴佣金流水表 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入commissionAdvertisingLog")
|
||||||
|
public R<UserCommissionAdvertisingLogVO> detail(UserCommissionAdvertisingLogEntity commissionAdvertisingLog) {
|
||||||
|
UserCommissionAdvertisingLogEntity detail = commissionAdvertisingLogService.getOne(Condition.getQueryWrapper(commissionAdvertisingLog));
|
||||||
|
return R.data(UserCommissionAdvertisingLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 5%广告补贴佣金流水表 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionAdvertisingLog")
|
||||||
|
public R<IPage<UserCommissionAdvertisingLogVO>> list(UserCommissionAdvertisingLogEntity commissionAdvertisingLog, Query query) {
|
||||||
|
IPage<UserCommissionAdvertisingLogEntity> pages = commissionAdvertisingLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionAdvertisingLog));
|
||||||
|
return R.data(UserCommissionAdvertisingLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%广告补贴佣金流水表 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionAdvertisingLog")
|
||||||
|
public R<IPage<UserCommissionAdvertisingLogVO>> page(UserCommissionAdvertisingLogVO commissionAdvertisingLog, Query query) {
|
||||||
|
IPage<UserCommissionAdvertisingLogVO> pages = commissionAdvertisingLogService.selectUserCommissionAdvertisingLogPage(Condition.getPage(query), commissionAdvertisingLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%广告补贴佣金流水表 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入commissionAdvertisingLog")
|
||||||
|
public R save(@Valid @RequestBody UserCommissionAdvertisingLogEntity commissionAdvertisingLog) {
|
||||||
|
return R.status(commissionAdvertisingLogService.save(commissionAdvertisingLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%广告补贴佣金流水表 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入commissionAdvertisingLog")
|
||||||
|
public R update(@Valid @RequestBody UserCommissionAdvertisingLogEntity commissionAdvertisingLog) {
|
||||||
|
return R.status(commissionAdvertisingLogService.updateById(commissionAdvertisingLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%广告补贴佣金流水表 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入commissionAdvertisingLog")
|
||||||
|
public R submit(@Valid @RequestBody UserCommissionAdvertisingLogEntity commissionAdvertisingLog) {
|
||||||
|
return R.status(commissionAdvertisingLogService.saveOrUpdate(commissionAdvertisingLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%广告补贴佣金流水表 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(commissionAdvertisingLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
*/
|
||||||
|
@IsAdmin
|
||||||
|
@GetMapping("/export-commissionAdvertisingLog")
|
||||||
|
@ApiOperationSupport(order = 9)
|
||||||
|
@Operation(summary = "导出数据", description = "传入commissionAdvertisingLog")
|
||||||
|
public void exportUserCommissionAdvertisingLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionAdvertisingLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||||
|
QueryWrapper<UserCommissionAdvertisingLogEntity> queryWrapper = Condition.getQueryWrapper(commissionAdvertisingLog, UserCommissionAdvertisingLogEntity.class);
|
||||||
|
//if (!AuthUtil.isAdministrator()) {
|
||||||
|
// queryWrapper.lambda().eq(UserCommissionAdvertisingLog::getTenantId, bladeUser.getTenantId());
|
||||||
|
//}
|
||||||
|
//queryWrapper.lambda().eq(UserCommissionAdvertisingLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||||
|
List<UserCommissionAdvertisingLogExcel> list = commissionAdvertisingLogService.exportUserCommissionAdvertisingLog(queryWrapper);
|
||||||
|
ExcelUtil.export(response, "5%广告补贴佣金流水表数据" + DateUtil.time(), "5%广告补贴佣金流水表数据表", list, UserCommissionAdvertisingLogExcel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
/**
|
||||||
|
* 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.cashAccount.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.secure.BladeUser;
|
||||||
|
import org.springblade.core.secure.annotation.IsAdmin;
|
||||||
|
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.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionAgencyLogEntity;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionAgencyLogVO;
|
||||||
|
import org.springblade.modules.cashAccount.excel.UserCommissionAgencyLogExcel;
|
||||||
|
import org.springblade.modules.cashAccount.wrapper.UserCommissionAgencyLogWrapper;
|
||||||
|
import org.springblade.modules.cashAccount.service.IUserCommissionAgencyLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import org.springblade.core.tool.utils.DateUtil;
|
||||||
|
import org.springblade.core.excel.util.ExcelUtil;
|
||||||
|
import org.springblade.core.tool.constant.BladeConstant;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15%极差代理佣金流水表 控制器
|
||||||
|
*
|
||||||
|
* @author lzq
|
||||||
|
* @since 2026-01-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("blade-user-commissionagencylog/commissionAgencyLog")
|
||||||
|
@Tag(name = "15%极差代理佣金流水表", description = "15%极差代理佣金流水表接口")
|
||||||
|
public class UserCommissionAgencyLogController extends BladeController {
|
||||||
|
|
||||||
|
private final IUserCommissionAgencyLogService commissionAgencyLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15%极差代理佣金流水表 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入commissionAgencyLog")
|
||||||
|
public R<UserCommissionAgencyLogVO> detail(UserCommissionAgencyLogEntity commissionAgencyLog) {
|
||||||
|
UserCommissionAgencyLogEntity detail = commissionAgencyLogService.getOne(Condition.getQueryWrapper(commissionAgencyLog));
|
||||||
|
return R.data(UserCommissionAgencyLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 15%极差代理佣金流水表 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionAgencyLog")
|
||||||
|
public R<IPage<UserCommissionAgencyLogVO>> list(UserCommissionAgencyLogEntity commissionAgencyLog, Query query) {
|
||||||
|
IPage<UserCommissionAgencyLogEntity> pages = commissionAgencyLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionAgencyLog));
|
||||||
|
return R.data(UserCommissionAgencyLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15%极差代理佣金流水表 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionAgencyLog")
|
||||||
|
public R<IPage<UserCommissionAgencyLogVO>> page(UserCommissionAgencyLogVO commissionAgencyLog, Query query) {
|
||||||
|
IPage<UserCommissionAgencyLogVO> pages = commissionAgencyLogService.selectUserCommissionAgencyLogPage(Condition.getPage(query), commissionAgencyLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15%极差代理佣金流水表 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入commissionAgencyLog")
|
||||||
|
public R save(@Valid @RequestBody UserCommissionAgencyLogEntity commissionAgencyLog) {
|
||||||
|
return R.status(commissionAgencyLogService.save(commissionAgencyLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15%极差代理佣金流水表 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入commissionAgencyLog")
|
||||||
|
public R update(@Valid @RequestBody UserCommissionAgencyLogEntity commissionAgencyLog) {
|
||||||
|
return R.status(commissionAgencyLogService.updateById(commissionAgencyLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15%极差代理佣金流水表 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入commissionAgencyLog")
|
||||||
|
public R submit(@Valid @RequestBody UserCommissionAgencyLogEntity commissionAgencyLog) {
|
||||||
|
return R.status(commissionAgencyLogService.saveOrUpdate(commissionAgencyLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15%极差代理佣金流水表 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(commissionAgencyLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
*/
|
||||||
|
@IsAdmin
|
||||||
|
@GetMapping("/export-commissionAgencyLog")
|
||||||
|
@ApiOperationSupport(order = 9)
|
||||||
|
@Operation(summary = "导出数据", description = "传入commissionAgencyLog")
|
||||||
|
public void exportUserCommissionAgencyLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionAgencyLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||||
|
QueryWrapper<UserCommissionAgencyLogEntity> queryWrapper = Condition.getQueryWrapper(commissionAgencyLog, UserCommissionAgencyLogEntity.class);
|
||||||
|
//if (!AuthUtil.isAdministrator()) {
|
||||||
|
// queryWrapper.lambda().eq(UserCommissionAgencyLog::getTenantId, bladeUser.getTenantId());
|
||||||
|
//}
|
||||||
|
//queryWrapper.lambda().eq(UserCommissionAgencyLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||||
|
List<UserCommissionAgencyLogExcel> list = commissionAgencyLogService.exportUserCommissionAgencyLog(queryWrapper);
|
||||||
|
ExcelUtil.export(response, "15%极差代理佣金流水表数据" + DateUtil.time(), "15%极差代理佣金流水表数据表", list, UserCommissionAgencyLogExcel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
/**
|
||||||
|
* 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.cashAccount.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.secure.BladeUser;
|
||||||
|
import org.springblade.core.secure.annotation.IsAdmin;
|
||||||
|
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.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionCoCreatorLogEntity;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionCoCreatorLogVO;
|
||||||
|
import org.springblade.modules.cashAccount.excel.UserCommissionCoCreatorLogExcel;
|
||||||
|
import org.springblade.modules.cashAccount.wrapper.UserCommissionCoCreatorLogWrapper;
|
||||||
|
import org.springblade.modules.cashAccount.service.IUserCommissionCoCreatorLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import org.springblade.core.tool.utils.DateUtil;
|
||||||
|
import org.springblade.core.excel.util.ExcelUtil;
|
||||||
|
import org.springblade.core.tool.constant.BladeConstant;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%联创佣金流水表 控制器
|
||||||
|
*
|
||||||
|
* @author lzq
|
||||||
|
* @since 2026-01-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("blade-user-commissioncocreatorlog/commissionCoCreatorLog")
|
||||||
|
@Tag(name = "5%联创佣金流水表", description = "5%联创佣金流水表接口")
|
||||||
|
public class UserCommissionCoCreatorLogController extends BladeController {
|
||||||
|
|
||||||
|
private final IUserCommissionCoCreatorLogService commissionCoCreatorLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%联创佣金流水表 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入commissionCoCreatorLog")
|
||||||
|
public R<UserCommissionCoCreatorLogVO> detail(UserCommissionCoCreatorLogEntity commissionCoCreatorLog) {
|
||||||
|
UserCommissionCoCreatorLogEntity detail = commissionCoCreatorLogService.getOne(Condition.getQueryWrapper(commissionCoCreatorLog));
|
||||||
|
return R.data(UserCommissionCoCreatorLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 5%联创佣金流水表 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionCoCreatorLog")
|
||||||
|
public R<IPage<UserCommissionCoCreatorLogVO>> list(UserCommissionCoCreatorLogEntity commissionCoCreatorLog, Query query) {
|
||||||
|
IPage<UserCommissionCoCreatorLogEntity> pages = commissionCoCreatorLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionCoCreatorLog));
|
||||||
|
return R.data(UserCommissionCoCreatorLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%联创佣金流水表 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionCoCreatorLog")
|
||||||
|
public R<IPage<UserCommissionCoCreatorLogVO>> page(UserCommissionCoCreatorLogVO commissionCoCreatorLog, Query query) {
|
||||||
|
IPage<UserCommissionCoCreatorLogVO> pages = commissionCoCreatorLogService.selectUserCommissionCoCreatorLogPage(Condition.getPage(query), commissionCoCreatorLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%联创佣金流水表 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入commissionCoCreatorLog")
|
||||||
|
public R save(@Valid @RequestBody UserCommissionCoCreatorLogEntity commissionCoCreatorLog) {
|
||||||
|
return R.status(commissionCoCreatorLogService.save(commissionCoCreatorLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%联创佣金流水表 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入commissionCoCreatorLog")
|
||||||
|
public R update(@Valid @RequestBody UserCommissionCoCreatorLogEntity commissionCoCreatorLog) {
|
||||||
|
return R.status(commissionCoCreatorLogService.updateById(commissionCoCreatorLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%联创佣金流水表 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入commissionCoCreatorLog")
|
||||||
|
public R submit(@Valid @RequestBody UserCommissionCoCreatorLogEntity commissionCoCreatorLog) {
|
||||||
|
return R.status(commissionCoCreatorLogService.saveOrUpdate(commissionCoCreatorLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%联创佣金流水表 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(commissionCoCreatorLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
*/
|
||||||
|
@IsAdmin
|
||||||
|
@GetMapping("/export-commissionCoCreatorLog")
|
||||||
|
@ApiOperationSupport(order = 9)
|
||||||
|
@Operation(summary = "导出数据", description = "传入commissionCoCreatorLog")
|
||||||
|
public void exportUserCommissionCoCreatorLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionCoCreatorLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||||
|
QueryWrapper<UserCommissionCoCreatorLogEntity> queryWrapper = Condition.getQueryWrapper(commissionCoCreatorLog, UserCommissionCoCreatorLogEntity.class);
|
||||||
|
//if (!AuthUtil.isAdministrator()) {
|
||||||
|
// queryWrapper.lambda().eq(UserCommissionCoCreatorLog::getTenantId, bladeUser.getTenantId());
|
||||||
|
//}
|
||||||
|
//queryWrapper.lambda().eq(UserCommissionCoCreatorLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||||
|
List<UserCommissionCoCreatorLogExcel> list = commissionCoCreatorLogService.exportUserCommissionCoCreatorLog(queryWrapper);
|
||||||
|
ExcelUtil.export(response, "5%联创佣金流水表数据" + DateUtil.time(), "5%联创佣金流水表数据表", list, UserCommissionCoCreatorLogExcel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
/**
|
||||||
|
* 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.cashAccount.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.secure.BladeUser;
|
||||||
|
import org.springblade.core.secure.annotation.IsAdmin;
|
||||||
|
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.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionDirectPushLogEntity;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionDirectPushLogVO;
|
||||||
|
import org.springblade.modules.cashAccount.excel.UserCommissionDirectPushLogExcel;
|
||||||
|
import org.springblade.modules.cashAccount.wrapper.UserCommissionDirectPushLogWrapper;
|
||||||
|
import org.springblade.modules.cashAccount.service.IUserCommissionDirectPushLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import org.springblade.core.tool.utils.DateUtil;
|
||||||
|
import org.springblade.core.excel.util.ExcelUtil;
|
||||||
|
import org.springblade.core.tool.constant.BladeConstant;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10%直推人佣金流水表 控制器
|
||||||
|
*
|
||||||
|
* @author lzq
|
||||||
|
* @since 2026-01-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("blade-user-commissiondirectpushlog/commissionDirectPushLog")
|
||||||
|
@Tag(name = "10%直推人佣金流水表", description = "10%直推人佣金流水表接口")
|
||||||
|
public class UserCommissionDirectPushLogController extends BladeController {
|
||||||
|
|
||||||
|
private final IUserCommissionDirectPushLogService commissionDirectPushLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10%直推人佣金流水表 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入commissionDirectPushLog")
|
||||||
|
public R<UserCommissionDirectPushLogVO> detail(UserCommissionDirectPushLogEntity commissionDirectPushLog) {
|
||||||
|
UserCommissionDirectPushLogEntity detail = commissionDirectPushLogService.getOne(Condition.getQueryWrapper(commissionDirectPushLog));
|
||||||
|
return R.data(UserCommissionDirectPushLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 10%直推人佣金流水表 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionDirectPushLog")
|
||||||
|
public R<IPage<UserCommissionDirectPushLogVO>> list(UserCommissionDirectPushLogEntity commissionDirectPushLog, Query query) {
|
||||||
|
IPage<UserCommissionDirectPushLogEntity> pages = commissionDirectPushLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionDirectPushLog));
|
||||||
|
return R.data(UserCommissionDirectPushLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10%直推人佣金流水表 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionDirectPushLog")
|
||||||
|
public R<IPage<UserCommissionDirectPushLogVO>> page(UserCommissionDirectPushLogVO commissionDirectPushLog, Query query) {
|
||||||
|
IPage<UserCommissionDirectPushLogVO> pages = commissionDirectPushLogService.selectUserCommissionDirectPushLogPage(Condition.getPage(query), commissionDirectPushLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10%直推人佣金流水表 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入commissionDirectPushLog")
|
||||||
|
public R save(@Valid @RequestBody UserCommissionDirectPushLogEntity commissionDirectPushLog) {
|
||||||
|
return R.status(commissionDirectPushLogService.save(commissionDirectPushLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10%直推人佣金流水表 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入commissionDirectPushLog")
|
||||||
|
public R update(@Valid @RequestBody UserCommissionDirectPushLogEntity commissionDirectPushLog) {
|
||||||
|
return R.status(commissionDirectPushLogService.updateById(commissionDirectPushLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10%直推人佣金流水表 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入commissionDirectPushLog")
|
||||||
|
public R submit(@Valid @RequestBody UserCommissionDirectPushLogEntity commissionDirectPushLog) {
|
||||||
|
return R.status(commissionDirectPushLogService.saveOrUpdate(commissionDirectPushLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10%直推人佣金流水表 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(commissionDirectPushLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
*/
|
||||||
|
@IsAdmin
|
||||||
|
@GetMapping("/export-commissionDirectPushLog")
|
||||||
|
@ApiOperationSupport(order = 9)
|
||||||
|
@Operation(summary = "导出数据", description = "传入commissionDirectPushLog")
|
||||||
|
public void exportUserCommissionDirectPushLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionDirectPushLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||||
|
QueryWrapper<UserCommissionDirectPushLogEntity> queryWrapper = Condition.getQueryWrapper(commissionDirectPushLog, UserCommissionDirectPushLogEntity.class);
|
||||||
|
//if (!AuthUtil.isAdministrator()) {
|
||||||
|
// queryWrapper.lambda().eq(UserCommissionDirectPushLog::getTenantId, bladeUser.getTenantId());
|
||||||
|
//}
|
||||||
|
//queryWrapper.lambda().eq(UserCommissionDirectPushLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||||
|
List<UserCommissionDirectPushLogExcel> list = commissionDirectPushLogService.exportUserCommissionDirectPushLog(queryWrapper);
|
||||||
|
ExcelUtil.export(response, "10%直推人佣金流水表数据" + DateUtil.time(), "10%直推人佣金流水表数据表", list, UserCommissionDirectPushLogExcel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
/**
|
||||||
|
* 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.cashAccount.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.secure.BladeUser;
|
||||||
|
import org.springblade.core.secure.annotation.IsAdmin;
|
||||||
|
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.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionGoodsCostLogEntity;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionGoodsCostLogVO;
|
||||||
|
import org.springblade.modules.cashAccount.excel.UserCommissionGoodsCostLogExcel;
|
||||||
|
import org.springblade.modules.cashAccount.wrapper.UserCommissionGoodsCostLogWrapper;
|
||||||
|
import org.springblade.modules.cashAccount.service.IUserCommissionGoodsCostLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import org.springblade.core.tool.utils.DateUtil;
|
||||||
|
import org.springblade.core.excel.util.ExcelUtil;
|
||||||
|
import org.springblade.core.tool.constant.BladeConstant;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25%商品成本佣金流水表 控制器
|
||||||
|
*
|
||||||
|
* @author lzq
|
||||||
|
* @since 2026-01-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("blade-user-commissiongoodscostlog/commissionGoodsCostLog")
|
||||||
|
@Tag(name = "25%商品成本佣金流水表", description = "25%商品成本佣金流水表接口")
|
||||||
|
public class UserCommissionGoodsCostLogController extends BladeController {
|
||||||
|
|
||||||
|
private final IUserCommissionGoodsCostLogService commissionGoodsCostLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25%商品成本佣金流水表 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入commissionGoodsCostLog")
|
||||||
|
public R<UserCommissionGoodsCostLogVO> detail(UserCommissionGoodsCostLogEntity commissionGoodsCostLog) {
|
||||||
|
UserCommissionGoodsCostLogEntity detail = commissionGoodsCostLogService.getOne(Condition.getQueryWrapper(commissionGoodsCostLog));
|
||||||
|
return R.data(UserCommissionGoodsCostLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 25%商品成本佣金流水表 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionGoodsCostLog")
|
||||||
|
public R<IPage<UserCommissionGoodsCostLogVO>> list(UserCommissionGoodsCostLogEntity commissionGoodsCostLog, Query query) {
|
||||||
|
IPage<UserCommissionGoodsCostLogEntity> pages = commissionGoodsCostLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionGoodsCostLog));
|
||||||
|
return R.data(UserCommissionGoodsCostLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25%商品成本佣金流水表 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionGoodsCostLog")
|
||||||
|
public R<IPage<UserCommissionGoodsCostLogVO>> page(UserCommissionGoodsCostLogVO commissionGoodsCostLog, Query query) {
|
||||||
|
IPage<UserCommissionGoodsCostLogVO> pages = commissionGoodsCostLogService.selectUserCommissionGoodsCostLogPage(Condition.getPage(query), commissionGoodsCostLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25%商品成本佣金流水表 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入commissionGoodsCostLog")
|
||||||
|
public R save(@Valid @RequestBody UserCommissionGoodsCostLogEntity commissionGoodsCostLog) {
|
||||||
|
return R.status(commissionGoodsCostLogService.save(commissionGoodsCostLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25%商品成本佣金流水表 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入commissionGoodsCostLog")
|
||||||
|
public R update(@Valid @RequestBody UserCommissionGoodsCostLogEntity commissionGoodsCostLog) {
|
||||||
|
return R.status(commissionGoodsCostLogService.updateById(commissionGoodsCostLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25%商品成本佣金流水表 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入commissionGoodsCostLog")
|
||||||
|
public R submit(@Valid @RequestBody UserCommissionGoodsCostLogEntity commissionGoodsCostLog) {
|
||||||
|
return R.status(commissionGoodsCostLogService.saveOrUpdate(commissionGoodsCostLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25%商品成本佣金流水表 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(commissionGoodsCostLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
*/
|
||||||
|
@IsAdmin
|
||||||
|
@GetMapping("/export-commissionGoodsCostLog")
|
||||||
|
@ApiOperationSupport(order = 9)
|
||||||
|
@Operation(summary = "导出数据", description = "传入commissionGoodsCostLog")
|
||||||
|
public void exportUserCommissionGoodsCostLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionGoodsCostLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||||
|
QueryWrapper<UserCommissionGoodsCostLogEntity> queryWrapper = Condition.getQueryWrapper(commissionGoodsCostLog, UserCommissionGoodsCostLogEntity.class);
|
||||||
|
//if (!AuthUtil.isAdministrator()) {
|
||||||
|
// queryWrapper.lambda().eq(UserCommissionGoodsCostLog::getTenantId, bladeUser.getTenantId());
|
||||||
|
//}
|
||||||
|
//queryWrapper.lambda().eq(UserCommissionGoodsCostLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||||
|
List<UserCommissionGoodsCostLogExcel> list = commissionGoodsCostLogService.exportUserCommissionGoodsCostLog(queryWrapper);
|
||||||
|
ExcelUtil.export(response, "25%商品成本佣金流水表数据" + DateUtil.time(), "25%商品成本佣金流水表数据表", list, UserCommissionGoodsCostLogExcel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
/**
|
||||||
|
* 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.cashAccount.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.secure.BladeUser;
|
||||||
|
import org.springblade.core.secure.annotation.IsAdmin;
|
||||||
|
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.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionOperationLogEntity;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.vo.UserUserCommissionOperationLogVO;
|
||||||
|
import org.springblade.modules.cashAccount.excel.UserUserCommissionOperationLogExcel;
|
||||||
|
import org.springblade.modules.cashAccount.wrapper.UserUserCommissionOperationLogWrapper;
|
||||||
|
import org.springblade.modules.cashAccount.service.IUserCommissionOperationLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import org.springblade.core.tool.utils.DateUtil;
|
||||||
|
import org.springblade.core.excel.util.ExcelUtil;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%运营佣金流水表 控制器
|
||||||
|
*
|
||||||
|
* @author lzq
|
||||||
|
* @since 2026-01-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("blade-user-commissionoperationlog/commissionOperationLog")
|
||||||
|
@Tag(name = "5%运营佣金流水表", description = "5%运营佣金流水表接口")
|
||||||
|
public class UserCommissionOperationLogController extends BladeController {
|
||||||
|
|
||||||
|
private final IUserCommissionOperationLogService commissionOperationLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%运营佣金流水表 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入commissionOperationLog")
|
||||||
|
public R<UserUserCommissionOperationLogVO> detail(UserCommissionOperationLogEntity commissionOperationLog) {
|
||||||
|
UserCommissionOperationLogEntity detail = commissionOperationLogService.getOne(Condition.getQueryWrapper(commissionOperationLog));
|
||||||
|
return R.data(UserUserCommissionOperationLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 5%运营佣金流水表 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionOperationLog")
|
||||||
|
public R<IPage<UserUserCommissionOperationLogVO>> list(UserCommissionOperationLogEntity commissionOperationLog, Query query) {
|
||||||
|
IPage<UserCommissionOperationLogEntity> pages = commissionOperationLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionOperationLog));
|
||||||
|
return R.data(UserUserCommissionOperationLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%运营佣金流水表 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionOperationLog")
|
||||||
|
public R<IPage<UserUserCommissionOperationLogVO>> page(UserUserCommissionOperationLogVO commissionOperationLog, Query query) {
|
||||||
|
IPage<UserUserCommissionOperationLogVO> pages = commissionOperationLogService.selectUserUserCommissionOperationLogPage(Condition.getPage(query), commissionOperationLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%运营佣金流水表 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入commissionOperationLog")
|
||||||
|
public R save(@Valid @RequestBody UserCommissionOperationLogEntity commissionOperationLog) {
|
||||||
|
return R.status(commissionOperationLogService.save(commissionOperationLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%运营佣金流水表 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入commissionOperationLog")
|
||||||
|
public R update(@Valid @RequestBody UserCommissionOperationLogEntity commissionOperationLog) {
|
||||||
|
return R.status(commissionOperationLogService.updateById(commissionOperationLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%运营佣金流水表 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入commissionOperationLog")
|
||||||
|
public R submit(@Valid @RequestBody UserCommissionOperationLogEntity commissionOperationLog) {
|
||||||
|
return R.status(commissionOperationLogService.saveOrUpdate(commissionOperationLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%运营佣金流水表 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(commissionOperationLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
*/
|
||||||
|
@IsAdmin
|
||||||
|
@GetMapping("/export-commissionOperationLog")
|
||||||
|
@ApiOperationSupport(order = 9)
|
||||||
|
@Operation(summary = "导出数据", description = "传入commissionOperationLog")
|
||||||
|
public void exportUserUserCommissionOperationLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionOperationLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||||
|
QueryWrapper<UserCommissionOperationLogEntity> queryWrapper = Condition.getQueryWrapper(commissionOperationLog, UserCommissionOperationLogEntity.class);
|
||||||
|
//if (!AuthUtil.isAdministrator()) {
|
||||||
|
// queryWrapper.lambda().eq(UserUserCommissionOperationLog::getTenantId, bladeUser.getTenantId());
|
||||||
|
//}
|
||||||
|
//queryWrapper.lambda().eq(UserUserCommissionOperationLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||||
|
List<UserUserCommissionOperationLogExcel> list = commissionOperationLogService.exportUserUserCommissionOperationLog(queryWrapper);
|
||||||
|
ExcelUtil.export(response, "5%运营佣金流水表数据" + DateUtil.time(), "5%运营佣金流水表数据表", list, UserUserCommissionOperationLogExcel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
/**
|
||||||
|
* 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.cashAccount.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.secure.BladeUser;
|
||||||
|
import org.springblade.core.secure.annotation.IsAdmin;
|
||||||
|
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.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionServiceProviderLogEntity;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionServiceProviderLogVO;
|
||||||
|
import org.springblade.modules.cashAccount.excel.UserCommissionServiceProviderLogExcel;
|
||||||
|
import org.springblade.modules.cashAccount.wrapper.UserCommissionServiceProviderLogWrapper;
|
||||||
|
import org.springblade.modules.cashAccount.service.IUserCommissionServiceProviderLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import org.springblade.core.tool.utils.DateUtil;
|
||||||
|
import org.springblade.core.excel.util.ExcelUtil;
|
||||||
|
import org.springblade.core.tool.constant.BladeConstant;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%服务商佣金流水表 控制器
|
||||||
|
*
|
||||||
|
* @author lzq
|
||||||
|
* @since 2026-01-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("blade-user-commissionserviceproviderlog/commissionServiceProviderLog")
|
||||||
|
@Tag(name = "5%服务商佣金流水表", description = "5%服务商佣金流水表接口")
|
||||||
|
public class UserCommissionServiceProviderLogController extends BladeController {
|
||||||
|
|
||||||
|
private final IUserCommissionServiceProviderLogService commissionServiceProviderLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%服务商佣金流水表 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入commissionServiceProviderLog")
|
||||||
|
public R<UserCommissionServiceProviderLogVO> detail(UserCommissionServiceProviderLogEntity commissionServiceProviderLog) {
|
||||||
|
UserCommissionServiceProviderLogEntity detail = commissionServiceProviderLogService.getOne(Condition.getQueryWrapper(commissionServiceProviderLog));
|
||||||
|
return R.data(UserCommissionServiceProviderLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 5%服务商佣金流水表 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionServiceProviderLog")
|
||||||
|
public R<IPage<UserCommissionServiceProviderLogVO>> list(UserCommissionServiceProviderLogEntity commissionServiceProviderLog, Query query) {
|
||||||
|
IPage<UserCommissionServiceProviderLogEntity> pages = commissionServiceProviderLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionServiceProviderLog));
|
||||||
|
return R.data(UserCommissionServiceProviderLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%服务商佣金流水表 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionServiceProviderLog")
|
||||||
|
public R<IPage<UserCommissionServiceProviderLogVO>> page(UserCommissionServiceProviderLogVO commissionServiceProviderLog, Query query) {
|
||||||
|
IPage<UserCommissionServiceProviderLogVO> pages = commissionServiceProviderLogService.selectUserCommissionServiceProviderLogPage(Condition.getPage(query), commissionServiceProviderLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%服务商佣金流水表 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入commissionServiceProviderLog")
|
||||||
|
public R save(@Valid @RequestBody UserCommissionServiceProviderLogEntity commissionServiceProviderLog) {
|
||||||
|
return R.status(commissionServiceProviderLogService.save(commissionServiceProviderLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%服务商佣金流水表 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入commissionServiceProviderLog")
|
||||||
|
public R update(@Valid @RequestBody UserCommissionServiceProviderLogEntity commissionServiceProviderLog) {
|
||||||
|
return R.status(commissionServiceProviderLogService.updateById(commissionServiceProviderLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%服务商佣金流水表 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入commissionServiceProviderLog")
|
||||||
|
public R submit(@Valid @RequestBody UserCommissionServiceProviderLogEntity commissionServiceProviderLog) {
|
||||||
|
return R.status(commissionServiceProviderLogService.saveOrUpdate(commissionServiceProviderLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5%服务商佣金流水表 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(commissionServiceProviderLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
*/
|
||||||
|
@IsAdmin
|
||||||
|
@GetMapping("/export-commissionServiceProviderLog")
|
||||||
|
@ApiOperationSupport(order = 9)
|
||||||
|
@Operation(summary = "导出数据", description = "传入commissionServiceProviderLog")
|
||||||
|
public void exportUserCommissionServiceProviderLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionServiceProviderLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||||
|
QueryWrapper<UserCommissionServiceProviderLogEntity> queryWrapper = Condition.getQueryWrapper(commissionServiceProviderLog, UserCommissionServiceProviderLogEntity.class);
|
||||||
|
//if (!AuthUtil.isAdministrator()) {
|
||||||
|
// queryWrapper.lambda().eq(UserCommissionServiceProviderLog::getTenantId, bladeUser.getTenantId());
|
||||||
|
//}
|
||||||
|
//queryWrapper.lambda().eq(UserCommissionServiceProviderLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||||
|
List<UserCommissionServiceProviderLogExcel> list = commissionServiceProviderLogService.exportUserCommissionServiceProviderLog(queryWrapper);
|
||||||
|
ExcelUtil.export(response, "5%服务商佣金流水表数据" + DateUtil.time(), "5%服务商佣金流水表数据表", list, UserCommissionServiceProviderLogExcel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
/**
|
||||||
|
* 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.cashAccount.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.secure.BladeUser;
|
||||||
|
import org.springblade.core.secure.annotation.IsAdmin;
|
||||||
|
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.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionUserPointLogEntity;
|
||||||
|
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionUserPointLogVO;
|
||||||
|
import org.springblade.modules.cashAccount.excel.UserCommissionUserPointLogExcel;
|
||||||
|
import org.springblade.modules.cashAccount.wrapper.UserCommissionUserPointLogWrapper;
|
||||||
|
import org.springblade.modules.cashAccount.service.IUserCommissionUserPointLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import org.springblade.core.tool.utils.DateUtil;
|
||||||
|
import org.springblade.core.excel.util.ExcelUtil;
|
||||||
|
import org.springblade.core.tool.constant.BladeConstant;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 30%购买人获取用户积分佣金流水表 控制器
|
||||||
|
*
|
||||||
|
* @author lzq
|
||||||
|
* @since 2026-01-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("blade-user-commissionuserpointlog/commissionUserPointLog")
|
||||||
|
@Tag(name = "30%购买人获取用户积分佣金流水表", description = "30%购买人获取用户积分佣金流水表接口")
|
||||||
|
public class UserCommissionUserPointLogController extends BladeController {
|
||||||
|
|
||||||
|
private final IUserCommissionUserPointLogService commissionUserPointLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 30%购买人获取用户积分佣金流水表 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入commissionUserPointLog")
|
||||||
|
public R<UserCommissionUserPointLogVO> detail(UserCommissionUserPointLogEntity commissionUserPointLog) {
|
||||||
|
UserCommissionUserPointLogEntity detail = commissionUserPointLogService.getOne(Condition.getQueryWrapper(commissionUserPointLog));
|
||||||
|
return R.data(UserCommissionUserPointLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 30%购买人获取用户积分佣金流水表 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionUserPointLog")
|
||||||
|
public R<IPage<UserCommissionUserPointLogVO>> list(UserCommissionUserPointLogEntity commissionUserPointLog, Query query) {
|
||||||
|
IPage<UserCommissionUserPointLogEntity> pages = commissionUserPointLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionUserPointLog));
|
||||||
|
return R.data(UserCommissionUserPointLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 30%购买人获取用户积分佣金流水表 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入commissionUserPointLog")
|
||||||
|
public R<IPage<UserCommissionUserPointLogVO>> page(UserCommissionUserPointLogVO commissionUserPointLog, Query query) {
|
||||||
|
IPage<UserCommissionUserPointLogVO> pages = commissionUserPointLogService.selectUserCommissionUserPointLogPage(Condition.getPage(query), commissionUserPointLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 30%购买人获取用户积分佣金流水表 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入commissionUserPointLog")
|
||||||
|
public R save(@Valid @RequestBody UserCommissionUserPointLogEntity commissionUserPointLog) {
|
||||||
|
return R.status(commissionUserPointLogService.save(commissionUserPointLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 30%购买人获取用户积分佣金流水表 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入commissionUserPointLog")
|
||||||
|
public R update(@Valid @RequestBody UserCommissionUserPointLogEntity commissionUserPointLog) {
|
||||||
|
return R.status(commissionUserPointLogService.updateById(commissionUserPointLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 30%购买人获取用户积分佣金流水表 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入commissionUserPointLog")
|
||||||
|
public R submit(@Valid @RequestBody UserCommissionUserPointLogEntity commissionUserPointLog) {
|
||||||
|
return R.status(commissionUserPointLogService.saveOrUpdate(commissionUserPointLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 30%购买人获取用户积分佣金流水表 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(commissionUserPointLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
*/
|
||||||
|
@IsAdmin
|
||||||
|
@GetMapping("/export-commissionUserPointLog")
|
||||||
|
@ApiOperationSupport(order = 9)
|
||||||
|
@Operation(summary = "导出数据", description = "传入commissionUserPointLog")
|
||||||
|
public void exportUserCommissionUserPointLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionUserPointLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||||
|
QueryWrapper<UserCommissionUserPointLogEntity> queryWrapper = Condition.getQueryWrapper(commissionUserPointLog, UserCommissionUserPointLogEntity.class);
|
||||||
|
//if (!AuthUtil.isAdministrator()) {
|
||||||
|
// queryWrapper.lambda().eq(UserCommissionUserPointLog::getTenantId, bladeUser.getTenantId());
|
||||||
|
//}
|
||||||
|
//queryWrapper.lambda().eq(UserCommissionUserPointLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||||
|
List<UserCommissionUserPointLogExcel> list = commissionUserPointLogService.exportUserCommissionUserPointLog(queryWrapper);
|
||||||
|
ExcelUtil.export(response, "30%购买人获取用户积分佣金流水表数据" + DateUtil.time(), "30%购买人获取用户积分佣金流水表数据表", list, UserCommissionUserPointLogExcel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user