140 lines
15 KiB
SQL
140 lines
15 KiB
SQL
ALTER TABLE `tb_member_project`
|
||
MODIFY COLUMN `project_name` varchar(50) COMMENT '标协会员项目',
|
||
ADD COLUMN `charge_standard` decimal(12, 2) COMMENT '收费标准',
|
||
ADD COLUMN `charge_notice_no` varchar(150) COMMENT '收费通知号',
|
||
ADD COLUMN `charge_notice_file_id` varchar(500) COMMENT '收费通知文件id',
|
||
ADD COLUMN `council_charge_standard` decimal(12, 2) COMMENT '理事会收费标准',
|
||
ADD COLUMN `council_charge_notice_no` varchar(150) COMMENT '理事会收费通知号',
|
||
ADD COLUMN `council_charge_notice_file_id` varchar(500) COMMENT '理事会收费通知文件id',
|
||
ADD COLUMN `remark` varchar(600) COMMENT '备注';
|
||
|
||
# 会员状态字典
|
||
DELETE FROM sys_dict_item WHERE id='1433258355958185986';
|
||
UPDATE sys_dict SET description='会员状态(2-未缴费 3-已缴费;4-已过期)' WHERE id='1433258288161456129' AND del_flag=0;
|
||
|
||
ALTER TABLE `tb_member_project_subitem`
|
||
add column contract_num varchar(50) comment '合同编号',
|
||
add column charge_notice_no varchar(150) comment '收费通知号',
|
||
add column charge_notice_id varchar(500) comment '收费通知文件id',
|
||
add column remark varchar(600) comment '备注',
|
||
add column estimated_arrival_date datetime comment '预估到账日期',
|
||
add column effective_date date comment '生效日期',
|
||
add column invalidation_date date comment '失效日期',
|
||
add column ticket_collection tinyint(1) comment '提票';
|
||
|
||
|
||
-- auto-generated definition
|
||
create table tb_member_project_file
|
||
(
|
||
id varchar(36) not null
|
||
primary key,
|
||
create_by varchar(50) null comment '创建人',
|
||
create_time datetime null comment '创建日期',
|
||
update_by varchar(50) null comment '更新人',
|
||
update_time datetime null comment '更新日期',
|
||
project_id varchar(50) null comment '项目id',
|
||
file_id varchar(32) null comment '文件id'
|
||
)
|
||
comment '标协会员项目其他资料';
|
||
|
||
create index Index_1
|
||
on tb_member_project_file (project_id);
|
||
|
||
-- sys_permission表 工作组成员维护-调账按钮权限
|
||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `external_terminal_show`) VALUES ('1763033213871173633', '1430718058514440194', '调账', NULL, NULL, NULL, NULL, 2, 'workingGroupMember:editAccount', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'chh', '2024-02-29 10:47:28', NULL, NULL, 0, 0, '1', 0, 1);
|
||
-- sys_permission表 工作组成员维护-批量新增成员单位按钮权限
|
||
INSERT INTO `sys_permission`( id, parent_id, name, perms, perms_type, sort_no, menu_type, is_leaf, is_route, keep_alive, create_by, del_flag, hidden, create_time, status, always_show, internal_or_external, external_terminal_show ) VALUES ( '1765549986109550594', '1430718058514440194', '批量新增成员单位', 'workingGroupMember:batchAdd', '1', 1.0, 2, true, true, false, 'chh', 0, false, '2024-03-07 09:28:13', '1', false, false, true );
|
||
-- sys_permission表 起草组成员维护-批量新增成员单位按钮权限
|
||
INSERT INTO `sys_permission`( id, parent_id, name, perms, perms_type, sort_no, menu_type, is_leaf, is_route, keep_alive, create_by, del_flag, hidden, create_time, status, always_show, internal_or_external, external_terminal_show ) VALUES ( '1765550773875339266', '1736668960149286914', '批量新增成员单位', 'draftingGroupMember:batchAdd', '1', 1.0, 2, true, true, false, 'chh', 0, false, '2024-03-07 09:31:21', '1', false, false, true );
|
||
-- sys_permission表 企业管理-是否打包企业按钮权限
|
||
INSERT INTO sys_permission ( id, parent_id, name, perms, perms_type, sort_no, menu_type, is_leaf, is_route, keep_alive, create_by, del_flag, hidden, create_time, status, always_show, internal_or_external, external_terminal_show ) VALUES ( '1765573709906612225', '1430376267109978113', '是否打包企业', 'company:updatePackageEnterprise', '1', 1.0, 2, true, true, false, 'chh', 0, false, '2024-03-07 11:02:29', '1', false, false, true )
|
||
|
||
ALTER TABLE `pay_mail_bill`
|
||
ADD COLUMN `invoice_file_id` varchar(500) NULL COMMENT '发票附件id' AFTER `no_tax_amount`;
|
||
|
||
ALTER TABLE `pay_working_group`
|
||
ADD COLUMN `pay_flag` tinyint(1) NULL DEFAULT NULL COMMENT '是否收费标识(0不收费 1收费)' AFTER `update_time`;
|
||
|
||
ALTER TABLE `pay_company_management`
|
||
ADD COLUMN `package_enterprise` varchar(6) NULL COMMENT '是否打包企业' AFTER `link_bank_number`;
|
||
|
||
-- 管理端单点登录到企业端的按钮权限
|
||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `external_terminal_show`) VALUES ('1763082128575033345', '9502685863ab87f0ad1134142788a385', '企业端', NULL, NULL, NULL, NULL, 2, 'enterpriseTerminal:singleSignLogin', '0', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'LKGLZ', '2024-02-29 14:01:51', NULL, NULL, 0, 0, '1', 0, 1);
|
||
-- 管理端标协会员下增加会员统计和标准统计菜单
|
||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `external_terminal_show`) VALUES ('1765915681293688833', '1438394322899558402', '标准统计', '/incomePayments/memberManage/stardsStandardStatistics', 'incomePayments/memberManage/StardsStandardStatistics', NULL, NULL, 1, NULL, '1', 8.40, 0, NULL, 1, 1, 0, 0, NULL, 'LKGLZ', '2024-03-08 09:41:22', NULL, NULL, 0, 0, '1', 0, 1);
|
||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `external_terminal_show`) VALUES ('1765583520246108161', '1438394322899558402', '会员统计', '/incomePayments/memberManage/stardsMemberStatistics', 'incomePayments/memberManage/StardsMemberStatistics', NULL, NULL, 1, NULL, '1', 8.30, 0, NULL, 1, 1, 0, 0, NULL, 'LKGLZ', '2024-03-07 11:41:29', NULL, NULL, 0, 0, '1', 0, 1);
|
||
|
||
-- 字典项目类型新增打包项目
|
||
INSERT INTO sys_dict_item ( id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time ) VALUES ( '1767089980854767618', '1435541165297995778', '打包项目', '8', '', 8, 1, 'chh', '2024-03-11 15:27:37' )
|
||
-- 字典来款用途新增打包
|
||
INSERT INTO sys_dict_item ( id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time ) VALUES ( '1767090351832567809', '1431145150766923778', '打包', '22', '', 22, 1, 'chh', '2024-03-11 15:29:05' )
|
||
# 会员到期提醒消息模板
|
||
INSERT INTO sys_sms_template ( id, template_code, template_name, template_content, template_type, recipient, create_by, create_time ) VALUES ( '1767384966368137217', 'GL_16_HTTZ_EXPIRE', '15', '<p>【中汽标协】尊敬的会员朋友,您的会员权限将于${expiredDay}到期,请及时续费,以免影响您的会员权益。</p>', '2,3', '1', 'LKGLZ', '2024-03-12 10:59:47' );
|
||
# 处理历史数据
|
||
update income_payments.tb_member_project_subitem tmps
|
||
left join standards_association.tb_member_info tmi on tmps.company_name = tmi.company_name
|
||
set tmps.effective_date = tmi.effective_date, tmps.invalidation_date = tmi.invalidation_date
|
||
where 1=1;
|
||
# 会议打包统计视图
|
||
create view v_meeting_pack_statistical as
|
||
SELECT
|
||
p1.id,
|
||
p1.meeting_id,
|
||
p1.company_name,
|
||
p1.company_contact_name,
|
||
p1.pay_mode,
|
||
p1.amount_receivable AS allMoney,
|
||
p1.confirm_amount AS confirm_amount,
|
||
p1.invoice_amount AS billMoney,
|
||
p1.paid_amount AS comeAllMoney,
|
||
ifnull(p2.meeting_costs,p2.meeting_costs_two_topic) meeting_costs_a,
|
||
ifnull(p2.meeting_costs_vip,p2.meeting_costs_three_topic) meeting_costs_b,
|
||
p2.meeting_name,
|
||
p2.meeting_type,
|
||
( SELECT DATE_FORMAT( payment_date, '%Y' ) FROM pay_confirm_payment_record p3 WHERE p3.project_id = p1.id LIMIT 1 ) AS payment_year
|
||
FROM
|
||
pay_meeting_situation p1
|
||
LEFT JOIN pay_meeting p2 ON p1.meeting_id = p2.id;
|
||
|
||
INSERT INTO sys_dict ( id, dict_name, dict_code, description, del_flag, create_by, create_time ) VALUES ( '1767759337591001089', '标准类型', 'standard_type', '(强/推/行/团/地)', 0, 'LKGLZ', '2024-03-13 11:47:24' );
|
||
INSERT INTO sys_dict_item ( id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time ) VALUES ( '1767759519305027585', '1767759337591001089', '强', '1', '', 1, 1, 'LKGLZ', '2024-03-13 11:48:07' );
|
||
INSERT INTO sys_dict_item ( id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time ) VALUES ( '1767759572883066882', '1767759337591001089', '推', '2', '', 2, 1, 'LKGLZ', '2024-03-13 11:48:20' );
|
||
INSERT INTO sys_dict_item ( id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time ) VALUES ( '1767759602968809474', '1767759337591001089', '行', '3', '', 3, 1, 'LKGLZ', '2024-03-13 11:48:27' );
|
||
INSERT INTO sys_dict_item ( id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time ) VALUES ( '1767759630173065218', '1767759337591001089', '团', '4', '', 4, 1, 'LKGLZ', '2024-03-13 11:48:33' );
|
||
INSERT INTO sys_dict_item ( id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time ) VALUES ( '1767759654927847426', '1767759337591001089', '地', '5', '', 5, 1, 'LKGLZ', '2024-03-13 11:48:39' );
|
||
INSERT INTO sys_dict ( id, dict_name, dict_code, description, del_flag, create_by, create_time ) VALUES ( '1767760166330945537', '制修订', 'preparation_and_revision', '(制定/修订)', 0, 'LKGLZ', '2024-03-13 11:50:41' );
|
||
INSERT INTO sys_dict_item ( id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time ) VALUES ( '1767760194743160834', '1767760166330945537', '制定', '1', '', 1, 1, 'LKGLZ', '2024-03-13 11:50:48' );
|
||
INSERT INTO sys_dict_item ( id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time ) VALUES ( '1767760221213413378', '1767760166330945537', '修订', '2', '', 2, 1, 'LKGLZ', '2024-03-13 11:50:54' );
|
||
|
||
ALTER TABLE `pay_pack_company`
|
||
ADD COLUMN `mail_contacts_id` varchar(32) NULL DEFAULT NULL COMMENT '邮寄联系人id' AFTER `pay_flag`,
|
||
ADD COLUMN `receivable_amount` decimal(12, 2) NULL DEFAULT NULL COMMENT '应收金额(元)' AFTER `mail_contacts_id`,
|
||
ADD COLUMN `tax_rate` varchar(10) NULL DEFAULT NULL COMMENT '税率' AFTER `receivable_amount`,
|
||
ADD COLUMN `tax` decimal(12, 2) NULL DEFAULT 0.00 COMMENT '税额' AFTER `tax_rate`,
|
||
ADD COLUMN `no_tax_amount` decimal(12, 2) NULL DEFAULT 0.00 COMMENT '未税金额' AFTER `tax`,
|
||
ADD COLUMN `estimated_arrival_date` date NULL DEFAULT NULL COMMENT '预估到账日期' AFTER `no_tax_amount`,
|
||
ADD COLUMN `charge_way` tinyint(1) NULL DEFAULT NULL COMMENT '来款方式(1:无,2:合同,3:收费通知)' AFTER `estimated_arrival_date`,
|
||
ADD COLUMN `contract_num` varchar(50) NULL DEFAULT NULL COMMENT '合同编号' AFTER `charge_way`,
|
||
ADD COLUMN `charge` varchar(255) NULL DEFAULT NULL COMMENT '收费通知唯一标识(收费通知号A:a,收费通知号B:b)' AFTER `contract_num`,
|
||
ADD COLUMN `charge_notice_no` varchar(50) NULL DEFAULT NULL COMMENT '收费通知号' AFTER `charge`,
|
||
ADD COLUMN `charge_notice_id` text NULL COMMENT '收费通知文件id' AFTER `charge_notice_no`,
|
||
ADD COLUMN `need_invoice` tinyint(1) NULL DEFAULT NULL COMMENT '需要发票(1:增值税普通发票,2:增值税专用发票,3:否)' AFTER `charge_notice_id`,
|
||
ADD COLUMN `in_account` tinyint(1) NULL DEFAULT NULL COMMENT '到账(1:全额(对勾),2:0(X),3:>0 && <总金额(半满标志))' AFTER `need_invoice`,
|
||
ADD COLUMN `make_invoice` tinyint(1) NULL DEFAULT NULL COMMENT '开票(1:全额(对勾),2:0(X),3:>0 && <总金额(半满标志))' AFTER `in_account`,
|
||
ADD COLUMN `income_affirm` tinyint(1) NULL DEFAULT 0 COMMENT '确认收入' AFTER `make_invoice`,
|
||
ADD COLUMN `confirm_no_tax_amount` decimal(12, 2) NULL DEFAULT 0.00 COMMENT '确认金额未税' AFTER `income_affirm`,
|
||
ADD COLUMN `confirm_tax` decimal(12, 2) NULL DEFAULT 0.00 COMMENT '确认金额税额' AFTER `confirm_no_tax_amount`,
|
||
ADD COLUMN `paid_no_tax_amount` decimal(12, 2) NULL DEFAULT 0.00 COMMENT '到账金额未税' AFTER `confirm_tax`,
|
||
ADD COLUMN `paid_tax` decimal(12, 2) NULL DEFAULT 0.00 COMMENT '到账金额税额' AFTER `paid_no_tax_amount`,
|
||
ADD COLUMN `invoice_no_tax_amount` decimal(12, 2) NULL DEFAULT 0.00 COMMENT '开票金额未税' AFTER `paid_tax`,
|
||
ADD COLUMN `invoice_tax` decimal(12, 2) NULL DEFAULT 0.00 COMMENT '开票金额税额' AFTER `invoice_no_tax_amount`,
|
||
ADD COLUMN `paid_amount` decimal(12, 2) NULL DEFAULT NULL COMMENT '实收金额' AFTER `invoice_tax`,
|
||
ADD COLUMN `confirm_amount` decimal(12, 2) NULL DEFAULT 0.00 COMMENT '确认金额' AFTER `paid_amount`;
|
||
|
||
-- 增加标协会议报名信息维护菜单
|
||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `external_terminal_show`) VALUES ('1767832237586100225', '1438394322899558402', '标协会议报名信息维护', '/incomePayments/memberManage/stardsMemberProjectMeetingApplyInfo', 'incomePayments/memberManage/StardsMemberProjectMeetingApplyInfo', NULL, NULL, 1, NULL, '1', 6.00, 0, NULL, 1, 1, 0, 1, NULL, 'LKGLZ', '2024-03-13 16:37:05', NULL, NULL, 0, 0, '1', 0, 1);
|
||
# 删除企业管理员类型
|
||
update pay_contacts_management set role_code = 1 where 1=1;
|
||
|
||
# 处理单位开票信息 是否为打包企业
|
||
UPDATE pay_company_management set package_enterprise = 'false' where package_enterprise is NULL |