From 98dfccff8b5c641debaa6e297a69a3b205dce80c Mon Sep 17 00:00:00 2001 From: zenghao Date: Tue, 4 Apr 2017 11:34:45 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=95=86=E6=88=B7=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=93=E7=AE=97=E8=AE=B0=E5=BD=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E3=80=81=E6=94=AF=E4=BB=98=E5=AF=86=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=202.boss=E5=90=8E=E5=8F=B0=E5=A2=9E=E5=8A=A0=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=AF=86=E7=A0=81=E5=88=9D=E5=A7=8B123456?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- database.sql | 2089 +++++++++-------- .../pay/account/entity/RpSettRecord.java | 1107 ++++----- .../roncoo/pay/user/entity/RpUserInfo.java | 181 +- .../service/impl/RpUserInfoServiceImpl.java | 331 +-- .../mybatis/mapper/user/RpUserInfoMapper.xml | 173 +- .../src/main/webapp/jsp/common/pageBar.jsp | 30 +- .../controller/account/AccountController.java | 284 +-- .../pay/controller/sett/SettController.java | 109 + .../src/main/webapp/jsp/sett/list.jsp | 125 + .../src/main/webapp/jsp/system/index.jsp | 792 ++++--- 10 files changed, 2794 insertions(+), 2427 deletions(-) create mode 100644 roncoo-pay-web-merchant/src/main/java/com/roncoo/pay/controller/sett/SettController.java create mode 100644 roncoo-pay-web-merchant/src/main/webapp/jsp/sett/list.jsp diff --git a/database.sql b/database.sql index 8f2d54c..c3d92f8 100644 --- a/database.sql +++ b/database.sql @@ -1,1043 +1,1046 @@ -/*==============================================================*/ -/* dbms name: mysql 5.0 */ -/* created on: 2016-6-29 18:28:57 www.roncoo.com */ -/*==============================================================*/ - - -drop table if exists rp_account; - -drop table if exists rp_account_history; - -drop table if exists rp_pay_product; - -drop table if exists rp_pay_way; - -drop table if exists rp_sett_daily_collect; - -drop table if exists rp_sett_record; - -drop table if exists rp_sett_record_annex; - -drop table if exists rp_user_bank_account; - -drop table if exists rp_user_info; - -drop table if exists rp_user_pay_config; - -drop table if exists rp_user_pay_info; - -drop table if exists rp_account_check_batch; - -drop table if exists rp_account_check_mistake; - -drop table if exists rp_account_check_mistake_scratch_pool; - -drop table if exists rp_notify_record; - -drop table if exists rp_notify_record_log; - -drop table if exists rp_refund_record; - -drop table if exists rp_trade_payment_order; - -drop table if exists rp_trade_payment_record; - -drop table if exists seq_table; - -/*==============================================================*/ -/* table: rp_account */ -/*==============================================================*/ -create table rp_account -( - id varchar(50) not null, - create_time datetime not null, - edit_time datetime, - version bigint not null, - remark varchar(200), - account_no varchar(50) not null, - balance decimal(20,6) not null, - unbalance decimal(20,6) not null, - security_money decimal(20,6) not null, - status varchar(36) not null, - total_income decimal(20,6) not null, - total_expend decimal(20,6) not null, - today_income decimal(20,6) not null, - today_expend decimal(20,6) not null, - account_type varchar(50) not null, - sett_amount decimal(20,6) not null, - user_no varchar(50), - primary key (id) -); - -alter table rp_account comment '资金账户表'; - -/*==============================================================*/ -/* table: rp_account_history */ -/*==============================================================*/ -create table rp_account_history -( - id varchar(50) not null, - create_time datetime not null, - edit_time datetime, - version bigint not null, - remark varchar(200), - account_no varchar(50) not null, - amount decimal(20,6) not null, - balance decimal(20,6) not null, - fund_direction varchar(36) not null, - is_allow_sett varchar(36) not null, - is_complete_sett varchar(36) not null, - request_no varchar(36) not null, - bank_trx_no varchar(30), - trx_type varchar(36) not null, - risk_day int, - user_no varchar(50), - primary key (id) -); - -alter table rp_account_history comment '资金账户流水表'; - -/*==============================================================*/ -/* table: rp_pay_product */ -/*==============================================================*/ -create table rp_pay_product -( - id varchar(50) not null, - create_time datetime not null, - edit_time datetime, - version bigint not null, - status varchar(36) not null, - product_code varchar(50) not null comment '支付产品编号', - product_name varchar(200) not null comment '支付产品名称', - audit_status varchar(45), - primary key (id) -); - -alter table rp_pay_product comment '支付产品表'; - -/*==============================================================*/ -/* table: rp_pay_way */ -/*==============================================================*/ -create table rp_pay_way -( - id varchar(50) not null comment 'id', - version bigint not null default 0 comment 'version', - create_time datetime not null comment '创建时间', - edit_time datetime comment '修改时间', - pay_way_code varchar(50) not null comment '支付方式编号', - pay_way_name varchar(100) not null comment '支付方式名称', - pay_type_code varchar(50) not null comment '支付类型编号', - pay_type_name varchar(100) not null comment '支付类型名称', - pay_product_code varchar(50) comment '支付产品编号', - status varchar(36) not null comment '状态(100:正常状态,101非正常状态)', - sorts int default 1000 comment '排序(倒序排序,默认值1000)', - pay_rate double not null comment '商户支付费率', - primary key (id) -); - -alter table rp_pay_way comment '支付方式'; - -/*==============================================================*/ -/* table: rp_sett_daily_collect */ -/*==============================================================*/ -create table rp_sett_daily_collect -( - id varchar(50) not null comment 'id', - version int not null default 0 comment '版本号', - create_time datetime not null comment '创建时间', - edit_time datetime not null comment '修改时间', - account_no varchar(20) not null comment '账户编号', - user_name varchar(200) comment '用户姓名', - collect_date date not null comment '汇总日期', - collect_type varchar(50) not null comment '汇总类型(参考枚举:settdailycollecttypeenum)', - total_amount decimal(24,10) not null comment '交易总金额', - total_count int not null comment '交易总笔数', - sett_status varchar(50) not null comment '结算状态(参考枚举:settdailycollectstatusenum)', - remark varchar(300) comment '备注', - risk_day int comment '风险预存期天数', - primary key (id) -); - -alter table rp_sett_daily_collect comment '每日待结算汇总'; - -/*==============================================================*/ -/* table: rp_sett_record */ -/*==============================================================*/ -create table rp_sett_record -( - id varchar(50) not null comment 'id', - version int not null default 0 comment '版本号', - create_time datetime not null comment '创建时间', - edit_time datetime not null comment '修改时间', - sett_mode varchar(50) comment '结算发起方式(参考settmodetypeenum)', - account_no varchar(20) not null comment '账户编号', - user_no varchar(20) comment '用户编号', - user_name varchar(200) comment '用户姓名', - user_type varchar(50) comment '用户类型', - sett_date date comment '结算日期', - bank_code varchar(20) comment '银行编码', - bank_name varchar(100) comment '银行名称', - bank_account_name varchar(60) comment '开户名', - bank_account_no varchar(20) comment '开户账户', - bank_account_type varchar(50) comment '开户账户', - country varchar(200) comment '开户行所在国家', - province varchar(50) comment '开户行所在省份', - city varchar(50) comment '开户行所在城市', - areas varchar(50) comment '开户行所在区', - bank_account_address varchar(300) comment '开户行全称', - mobile_no varchar(20) comment '收款人手机号', - sett_amount decimal(24,10) comment '结算金额', - sett_fee decimal(16,6) comment '结算手续费', - remit_amount decimal(16,2) comment '结算打款金额', - sett_status varchar(50) comment '结算状态(参考枚举:settrecordstatusenum)', - remit_confirm_time datetime comment '打款确认时间', - remark varchar(200) comment '描述', - remit_remark varchar(200) comment '打款备注', - operator_loginname varchar(50) comment '操作员登录名', - operator_realname varchar(50) comment '操作员姓名', - primary key (id) -); - -alter table rp_sett_record comment '结算记录'; - -/*==============================================================*/ -/* table: rp_sett_record_annex */ -/*==============================================================*/ -create table rp_sett_record_annex -( - id varchar(50) not null, - create_time datetime not null, - edit_time datetime, - version bigint not null, - remark varchar(200), - is_delete varchar(36) not null, - annex_name varchar(200), - annex_address varchar(500) not null, - settlement_id varchar(50) not null, - primary key (id) -); - -/*==============================================================*/ -/* table: rp_user_bank_account */ -/*==============================================================*/ -create table rp_user_bank_account -( - id varchar(50) not null, - create_time datetime not null, - edit_time datetime, - version bigint not null, - remark varchar(200), - status varchar(36) not null, - user_no varchar(50) not null, - bank_name varchar(200) not null, - bank_code varchar(50) not null, - bank_account_name varchar(100) not null, - bank_account_no varchar(36) not null, - card_type varchar(36) not null, - card_no varchar(36) not null, - mobile_no varchar(50) not null, - is_default varchar(36), - province varchar(20), - city varchar(20), - areas varchar(20), - street varchar(300), - bank_account_type varchar(36) not null, - primary key (id) -); - -alter table rp_user_bank_account comment '用户银行账户表'; - -/*==============================================================*/ -/* table: rp_user_info */ -/*==============================================================*/ -create table rp_user_info -( - id varchar(50) not null, - create_time datetime not null, - status varchar(36) not null, - user_no varchar(50), - user_name varchar(100), - account_no varchar(50) not null, - primary key (id), - unique key ak_key_2 (account_no) -); - -alter table rp_user_info comment '该表用来存放用户的基本信息'; - -/*==============================================================*/ -/* table: rp_user_pay_config */ -/*==============================================================*/ -create table rp_user_pay_config -( - id varchar(50) not null, - create_time datetime not null, - edit_time datetime, - version bigint not null, - remark varchar(200), - status varchar(36) not null, - audit_status varchar(45), - is_auto_sett varchar(36) not null default 'no', - product_code varchar(50) not null comment '支付产品编号', - product_name varchar(200) not null comment '支付产品名称', - user_no varchar(50), - user_name varchar(100), - risk_day int, - pay_key varchar(50), - fund_into_type varchar(50), - pay_secret varchar(50), - primary key (id) -); - -alter table rp_user_pay_config comment '支付设置表'; - -/*==============================================================*/ -/* table: rp_user_pay_info */ -/*==============================================================*/ -create table rp_user_pay_info -( - id_ varchar(50) not null, - create_time datetime not null, - edit_time datetime, - version bigint not null, - remark varchar(200), - status varchar(36) not null, - app_id varchar(50) not null, - app_sectet varchar(100), - merchant_id varchar(50), - app_type varchar(50), - user_no varchar(50), - user_name varchar(100), - partner_key varchar(100), - pay_way_code varchar(50) not null comment '支付方式编号', - pay_way_name varchar(100) not null comment '支付方式名称', - primary key (id_) -); - -alter table rp_user_pay_info comment '该表用来存放用户开通的第三方支付信息'; - - -create table rp_account_check_batch -( - id varchar(50) not null, - version int unsigned not null, - create_time datetime not null, - editor varchar(100) comment '修改者', - creater varchar(100) comment '创建者', - edit_time datetime comment '最后修改时间', - status varchar(30) not null, - remark varchar(500), - batch_no varchar(30) not null, - bill_date date not null, - bill_type varchar(30), - handle_status varchar(10), - bank_type varchar(30), - mistake_count int(8), - unhandle_mistake_count int(8), - trade_count int(8), - bank_trade_count int(8), - trade_amount decimal(20,6), - bank_trade_amount decimal(20,6), - refund_amount decimal(20,6), - bank_refund_amount decimal(20,6), - bank_fee decimal(20,6), - org_check_file_path varchar(500), - release_check_file_path varchar(500), - release_status varchar(15), - check_fail_msg varchar(300), - bank_err_msg varchar(300), - primary key (id) -); - -alter table rp_account_check_batch comment '对账批次表 rp_account_check_batch'; - -create table rp_account_check_mistake -( - id varchar(50) not null, - version int unsigned not null, - create_time datetime not null, - editor varchar(100) comment '修改者', - creater varchar(100) comment '创建者', - edit_time datetime comment '最后修改时间', - status varchar(30), - remark varchar(500), - account_check_batch_no varchar(50) not null, - bill_date date not null, - bank_type varchar(30) not null, - order_time datetime, - merchant_name varchar(100), - merchant_no varchar(50), - order_no varchar(40), - trade_time datetime, - trx_no varchar(20), - order_amount decimal(20,6), - refund_amount decimal(20,6), - trade_status varchar(30), - fee decimal(20,6), - bank_trade_time datetime, - bank_order_no varchar(40), - bank_trx_no varchar(40), - bank_trade_status varchar(30), - bank_amount decimal(20,6), - bank_refund_amount decimal(20,6), - bank_fee decimal(20,6), - err_type varchar(30) not null, - handle_status varchar(10) not null, - handle_value varchar(1000), - handle_remark varchar(1000), - operator_name varchar(100), - operator_account_no varchar(50), - primary key (id) -); - -alter table rp_account_check_mistake comment '对账差错表 rp_account_check_mistake'; - -create table rp_account_check_mistake_scratch_pool -( - id varchar(50) not null, - version int unsigned not null, - create_time datetime not null, - editor varchar(100) comment '修改者', - creater varchar(100) comment '创建者', - edit_time datetime comment '最后修改时间', - product_name varchar(50) comment '商品名称', - merchant_order_no varchar(30) not null comment '商户订单号', - trx_no char(20) not null comment '支付流水号', - bank_order_no char(20) comment '银行订单号', - bank_trx_no varchar(30) comment '银行流水号', - order_amount decimal(20,6) default 0 comment '订单金额', - plat_income decimal(20,6) comment '平台收入', - fee_rate decimal(20,6) comment '费率', - plat_cost decimal(20,6) comment '平台成本', - plat_profit decimal(20,6) comment '平台利润', - status varchar(30) comment '状态(参考枚举:paymentrecordstatusenum)', - pay_way_code varchar(50) comment '支付通道编号', - pay_way_name varchar(100) comment '支付通道名称', - pay_success_time datetime comment '支付成功时间', - complete_time datetime comment '完成时间', - is_refund varchar(30) default '101' comment '是否退款(100:是,101:否,默认值为:101)', - refund_times smallint default 0 comment '退款次数(默认值为:0)', - success_refund_amount decimal(20,6) comment '成功退款总金额', - remark varchar(500) comment '备注', - batch_no varchar(50), - bill_date datetime -); - -alter table rp_account_check_mistake_scratch_pool comment '差错暂存池'; - -create table rp_notify_record -( - id varchar(50) not null, - version int not null, - create_time datetime not null, - editor varchar(100) comment '修改者', - creater varchar(100) comment '创建者', - edit_time datetime comment '最后修改时间', - notify_times int not null, - limit_notify_times int not null, - url varchar(2000) not null, - merchant_order_no varchar(50) not null, - merchant_no varchar(50) not null, - status varchar(50) not null comment '100:成功 101:失败', - notify_type varchar(30) comment '通知类型', - primary key (id), - key ak_key_2 (merchant_order_no) -); - -alter table rp_notify_record comment '通知记录表 rp_notify_record'; - -create table rp_notify_record_log -( - id varchar(50) not null, - version int not null, - editor varchar(100) comment '修改者', - creater varchar(100) comment '创建者', - edit_time datetime comment '最后修改时间', - create_time datetime not null, - notify_id varchar(50) not null, - request varchar(2000) not null, - response varchar(2000) not null, - merchant_no varchar(50) not null, - merchant_order_no varchar(50) not null comment '商户订单号', - http_status varchar(50) not null comment 'http状态', - primary key (id) -); - -alter table rp_notify_record_log comment '通知记录日志表 rp_notify_record_log'; - -create table rp_refund_record -( - id varchar(50) not null comment 'id', - version int not null comment '版本号', - create_time datetime comment '创建时间', - editor varchar(100) comment '修改者', - creater varchar(100) comment '创建者', - edit_time datetime comment '最后修改时间', - org_merchant_order_no varchar(50) comment '原商户订单号', - org_trx_no varchar(50) comment '原支付流水号', - org_bank_order_no varchar(50) comment '原银行订单号', - org_bank_trx_no varchar(50) comment '原银行流水号', - merchant_name varchar(100) comment '商家名称', - merchant_no varchar(100) not null comment '商家编号', - org_product_name varchar(60) comment '原商品名称', - org_biz_type varchar(30) comment '原业务类型', - org_payment_type varchar(30) comment '原支付方式类型', - refund_amount decimal(20,6) comment '订单退款金额', - refund_trx_no varchar(50) not null comment '退款流水号', - refund_order_no varchar(50) not null comment '退款订单号', - bank_refund_order_no varchar(50) comment '银行退款订单号', - bank_refund_trx_no varchar(30) comment '银行退款流水号', - result_notify_url varchar(500) comment '退款结果通知url', - refund_status varchar(30) comment '退款状态', - refund_from varchar(30) comment '退款来源(分发平台)', - refund_way varchar(30) comment '退款方式', - refund_request_time datetime comment '退款请求时间', - refund_success_time datetime comment ' 退款成功时间', - refund_complete_time datetime comment '退款完成时间', - request_apply_user_id varchar(50) comment '退款请求,申请人登录名', - request_apply_user_name varchar(90) comment '退款请求,申请人姓名', - refund_reason varchar(500) comment '退款原因', - remark varchar(3000) comment '备注', - primary key (id), - unique key ak_key_2 (refund_trx_no) -); - -alter table rp_refund_record comment '退款记录表'; - -create table rp_trade_payment_order -( - id varchar(50) not null comment 'id', - version int not null default 0 comment '版本号', - create_time datetime not null comment '创建时间', - editor varchar(100) comment '修改者', - creater varchar(100) comment '创建者', - edit_time datetime comment '最后修改时间', - status varchar(50) comment '状态(参考枚举:orderstatusenum)', - product_name varchar(300) comment '商品名称', - merchant_order_no varchar(30) not null comment '商户订单号', - order_amount decimal(20,6) default 0 comment '订单金额', - order_from varchar(30) comment '订单来源', - merchant_name varchar(100) comment '商家名称', - merchant_no varchar(100) not null comment '商户编号', - order_time datetime comment '下单时间', - order_date date comment '下单日期', - order_ip varchar(50) comment '下单ip(客户端ip,在网关页面获取)', - order_referer_url varchar(100) comment '从哪个页面链接过来的(可用于防诈骗)', - return_url varchar(600) comment '页面回调通知url', - notify_url varchar(600) comment '后台异步通知url', - cancel_reason varchar(600) comment '订单撤销原因', - order_period smallint comment '订单有效期(单位分钟)', - expire_time datetime comment '到期时间', - pay_way_code varchar(50) comment '支付方式编号', - pay_way_name varchar(100) comment '支付方式名称', - remark varchar(200) comment '支付备注', - trx_type varchar(30) comment '交易业务类型 :消费、充值等', - trx_no varchar(50) comment '支付流水号', - pay_type_code varchar(50) comment '支付类型编号', - pay_type_name varchar(100) comment '支付类型名称', - fund_into_type varchar(30) comment '资金流入类型', - is_refund varchar(30) default '101' comment '是否退款(100:是,101:否,默认值为:101)', - refund_times int default 0 comment '退款次数(默认值为:0)', - success_refund_amount decimal(20,6) comment '成功退款总金额', - field1 varchar(500), - field2 varchar(500), - field3 varchar(500), - field4 varchar(500), - field5 varchar(500), - primary key (id), - unique key ak_key_2 (merchant_order_no, merchant_no) -); - -alter table rp_trade_payment_order comment 'roncoo pay 龙果支付 支付订单表'; - -create table rp_trade_payment_record -( - id varchar(50) not null comment 'id', - version int not null default 0 comment '版本号', - create_time datetime comment '创建时间', - status varchar(30) comment '状态(参考枚举:paymentrecordstatusenum)', - editor varchar(100) comment '修改者', - creater varchar(100) comment '创建者', - edit_time datetime comment '最后修改时间', - product_name varchar(50) comment '商品名称', - merchant_order_no varchar(50) not null comment '商户订单号', - trx_no varchar(50) not null comment '支付流水号', - bank_order_no varchar(50) comment '银行订单号', - bank_trx_no varchar(50) comment '银行流水号', - merchant_name varchar(300) comment '商家名称', - merchant_no varchar(50) not null comment '商家编号', - payer_user_no varchar(50) comment '付款人编号', - payer_name varchar(60) comment '付款人名称', - payer_pay_amount decimal(20,6) default 0 comment '付款方支付金额', - payer_fee decimal(20,6) default 0 comment '付款方手续费', - payer_account_type varchar(30) comment '付款方账户类型(参考账户类型枚举:accounttypeenum)', - receiver_user_no varchar(15) comment '收款人编号', - receiver_name varchar(60) comment '收款人名称', - receiver_pay_amount decimal(20,6) default 0 comment '收款方支付金额', - receiver_fee decimal(20,6) default 0 comment '收款方手续费', - receiver_account_type varchar(30) comment '收款方账户类型(参考账户类型枚举:accounttypeenum)', - order_ip varchar(30) comment '下单ip(客户端ip,从网关中获取)', - order_referer_url varchar(100) comment '从哪个页面链接过来的(可用于防诈骗)', - order_amount decimal(20,6) default 0 comment '订单金额', - plat_income decimal(20,6) comment '平台收入', - fee_rate decimal(20,6) comment '费率', - plat_cost decimal(20,6) comment '平台成本', - plat_profit decimal(20,6) comment '平台利润', - return_url varchar(600) comment '页面回调通知url', - notify_url varchar(600) comment '后台异步通知url', - pay_way_code varchar(50) comment '支付方式编号', - pay_way_name varchar(100) comment '支付方式名称', - pay_success_time datetime comment '支付成功时间', - complete_time datetime comment '完成时间', - is_refund varchar(30) default '101' comment '是否退款(100:是,101:否,默认值为:101)', - refund_times int default 0 comment '退款次数(默认值为:0)', - success_refund_amount decimal(20,6) comment '成功退款总金额', - trx_type varchar(30) comment '交易业务类型 :消费、充值等', - order_from varchar(30) comment '订单来源', - pay_type_code varchar(50) comment '支付类型编号', - pay_type_name varchar(100) comment '支付类型名称', - fund_into_type varchar(30) comment '资金流入类型', - remark varchar(3000) comment '备注', - field1 varchar(500), - field2 varchar(500), - field3 varchar(500), - field4 varchar(500), - field5 varchar(500), - bank_return_msg varchar(2000) comment '银行返回信息', - primary key (id), - unique key ak_key_2 (trx_no) -); - -alter table rp_trade_payment_record comment '支付记录表'; - -CREATE TABLE seq_table (SEQ_NAME varchar(50) NOT NULL, CURRENT_VALUE bigint DEFAULT '1000000002' NOT NULL, INCREMENT smallint DEFAULT '1' NOT NULL, REMARK varchar(100) NOT NULL, PRIMARY KEY (SEQ_NAME)) ENGINE=InnoDB DEFAULT CHARSET=utf8; -INSERT INTO seq_table (SEQ_NAME, CURRENT_VALUE, INCREMENT, REMARK) VALUES ('ACCOUNT_NO_SEQ', 10000000, 1, '账户--账户编号'); -INSERT INTO seq_table (SEQ_NAME, CURRENT_VALUE, INCREMENT, REMARK) VALUES ('ACTIVITY_NO_SEQ', 10000006, 1, '活动--活动编号'); -INSERT INTO seq_table (SEQ_NAME, CURRENT_VALUE, INCREMENT, REMARK) VALUES ('USER_NO_SEQ', 10001113, 1, '用户--用户编号'); -INSERT INTO seq_table (SEQ_NAME, CURRENT_VALUE, INCREMENT, REMARK) VALUES ('TRX_NO_SEQ', 10000000, 1, '交易—-支付流水号'); -INSERT INTO seq_table (SEQ_NAME, CURRENT_VALUE, INCREMENT, REMARK) VALUES ('BANK_ORDER_NO_SEQ', 10000000, 1, '交易—-银行订单号'); -INSERT INTO seq_table (SEQ_NAME, CURRENT_VALUE, INCREMENT, REMARK) VALUES ('RECONCILIATION_BATCH_NO_SEQ', 10000000, 1, '对账—-批次号'); - -/*==============================================================*/ -/* create function */ -/*==============================================================*/ -CREATE FUNCTION `FUN_SEQ`(SEQ VARCHAR(50)) RETURNS BIGINT(20) -BEGIN - UPDATE SEQ_TABLE - SET CURRENT_VALUE = CURRENT_VALUE + INCREMENT - WHERE SEQ_NAME=SEQ; - RETURN FUN_SEQ_CURRENT_VALUE(SEQ); -END; - - -CREATE FUNCTION `FUN_SEQ_CURRENT_VALUE`(SEQ VARCHAR(50)) RETURNS BIGINT(20) -BEGIN - DECLARE VALUE INTEGER; - SET VALUE=0; - SELECT CURRENT_VALUE INTO VALUE - FROM SEQ_TABLE - WHERE SEQ_NAME=SEQ; - RETURN VALUE; -END; - -CREATE FUNCTION `FUN_SEQ_SET_VALUE`(SEQ VARCHAR(50), VALUE INTEGER) RETURNS BIGINT(20) -BEGIN - UPDATE SEQ_TABLE - SET CURRENT_VALUE=VALUE - WHERE SEQ_NAME=SEQ; - RETURN FUN_SEQ_CURRENT_VALUE(SEQ); -END; - -CREATE FUNCTION FUN_NOW() - RETURNS DATETIME -BEGIN -RETURN now(); -END; - - --- 时间函数 - -CREATE FUNCTION `FUN_DATE_ADD`(STR_DATE VARCHAR(10), STR_INTERVAL INTEGER) RETURNS DATE -BEGIN - RETURN date_add(STR_DATE, INTERVAL STR_INTERVAL DAY); -END; - - - - - - --- ----------------------------------------------------------------------------------------------------------------------------------- --- 注意:该脚本运行在mysql环境下,如果是其他数据库,如有需要请先修改,再执行。 -- --- 编写人:沈佳龙 (www.roncoo.com) -- --- ----------------------------------------------------------------------------------------------------------------------------------- - -drop table if exists pms_menu; - -drop table if exists pms_menu_role; - -drop table if exists pms_operator; - -drop table if exists pms_operator_log; - -drop table if exists pms_permission; - -drop table if exists pms_role; - -drop table if exists pms_role_operator; - -drop table if exists pms_role_permission; - -create table pms_menu -( - id bigint not null auto_increment, - version bigint not null, - creater varchar(50) not null comment '创建人', - create_time datetime not null comment '创建时间', - editor varchar(50) comment '修改人', - edit_time datetime comment '修改时间', - status varchar(20) not null, - remark varchar(300), - is_leaf varchar(20), - level smallint, - parent_id bigint not null, - target_name varchar(100), - number varchar(20), - name varchar(100), - url varchar(100), - primary key (id) -)auto_increment = 1000; - -alter table pms_menu comment '菜单表'; - - -alter table pms_menu comment '菜单表'; - -create table pms_menu_role -( - id bigint not null auto_increment comment '主键', - version bigint, - creater varchar(50) comment '创建人', - create_time datetime comment '创建时间', - editor varchar(50) comment '修改人', - edit_time datetime comment '修改时间', - status varchar(20), - remark varchar(300), - role_id bigint not null, - menu_id bigint not null, - primary key (id), - key ak_key_2 (role_id, menu_id) -) auto_increment = 1000; - -alter table pms_menu_role comment '权限与角色关联表'; - -create table pms_operator -( - id bigint not null auto_increment comment '主键', - version bigint not null, - creater varchar(50) not null comment '创建人', - create_time datetime not null comment '创建时间', - editor varchar(50) comment '修改人', - edit_time datetime comment '修改时间', - status varchar(20) not null, - remark varchar(300), - real_name varchar(50) not null, - mobile_no varchar(15) not null, - login_name varchar(50) not null, - login_pwd varchar(256) not null, - type varchar(20) not null, - salt varchar(50) not null, - primary key (id), - key ak_key_2 (login_name) -) auto_increment = 1000; - -alter table pms_operator comment '操作员表'; - -create table pms_operator_log -( - id bigint not null auto_increment comment '主键', - version bigint not null, - creater varchar(50) not null comment '创建人', - create_time datetime not null comment '创建时间', - editor varchar(50) comment '修改人', - edit_time datetime comment '修改时间', - status varchar(20) not null, - remark varchar(300), - operator_id bigint not null, - operator_name varchar(50) not null, - operate_type varchar(50) not null comment '操作类型(1:增加,2:修改,3:删除,4:查询)', - ip varchar(100) not null, - content varchar(3000), - primary key (id) -) auto_increment = 1000; - -alter table pms_operator_log comment '权限_操作员操作日志表'; - -create table pms_permission -( - id bigint not null auto_increment comment '主键', - version bigint not null, - creater varchar(50) not null comment '创建人', - create_time datetime not null comment '创建时间', - editor varchar(50) comment '修改人', - edit_time datetime comment '修改时间', - status varchar(20) not null, - remark varchar(300), - permission_name varchar(100) not null, - permission varchar(100) not null, - primary key (id), - key ak_key_2 (permission), - key ak_key_3 (permission_name) -) auto_increment = 1000; - -alter table pms_permission comment '权限表'; - -create table pms_role -( - id bigint not null auto_increment comment '主键', - version bigint, - creater varchar(50) comment '创建人', - create_time datetime comment '创建时间', - editor varchar(50) comment '修改人', - edit_time datetime comment '修改时间', - status varchar(20), - remark varchar(300), - role_code varchar(20) not null comment '角色类型(1:超级管理员角色,0:普通操作员角色)', - role_name varchar(100) not null, - primary key (id), - key ak_key_2 (role_name) -) auto_increment = 1000; - -alter table pms_role comment '角色表'; - -create table pms_role_operator -( - id bigint not null auto_increment comment '主键', - version bigint not null, - creater varchar(50) not null comment '创建人', - create_time datetime not null comment '创建时间', - editor varchar(50) comment '修改人', - edit_time datetime comment '修改时间', - status varchar(20) not null, - remark varchar(300), - role_id bigint not null, - operator_id bigint not null, - primary key (id), - key ak_key_2 (role_id, operator_id) -) auto_increment = 1000; - -alter table pms_role_operator comment '操作员与角色关联表'; - -create table pms_role_permission -( - id bigint not null auto_increment comment '主键', - version bigint, - creater varchar(50) comment '创建人', - create_time datetime comment '创建时间', - editor varchar(50) comment '修改人', - edit_time datetime comment '修改时间', - status varchar(20), - remark varchar(300), - role_id bigint not null, - permission_id bigint not null, - primary key (id), - key ak_key_2 (role_id, permission_id) -) auto_increment = 1000; - -alter table pms_role_permission comment '权限与角色关联表'; - - - - - --- ------------------------------step 1 菜单------------------------------------------------- --- 菜单初始化数据 --- -- 菜单的初始化数据 -insert into pms_menu (id,version,status,creater,create_time, editor, edit_time, remark, name, url, number, is_leaf, level, parent_id, target_name) values -(1,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '权限管理', '##', '001', 'NO', 1, 0, '#'), -(2,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '菜单管理', 'pms/menu/list', '00101', 'YES', 2, 1, 'cdgl'), -(3,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '权限管理', 'pms/permission/list', '00102', 'YES',2, 1, 'qxgl'), -(4,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '角色管理', 'pms/role/list', '00103', 'YES',2, 1, 'jsgl'), -(5,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '操作员管理', 'pms/operator/list', '00104', 'YES',2, 1, 'czygl'), - -(10,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '账户管理', '##', '002', 'NO', 1, 0, '#'), -(12,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '账户信息', 'account/list', '00201', 'YES',2, 10, 'zhxx'), -(13,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '账户历史信息', 'account/historyList', '00202', 'YES',2, 10, 'zhlsxx'), - - -(20,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '用户管理', '##', '003', 'NO', 1, 0, '#'), -(22,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '用户信息', 'user/info/list', '00301', 'YES',2, 20, 'yhxx'), - -(30,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '支付管理', '##', '004', 'NO', 1, 0, '#'), -(32,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '支付产品信息', 'pay/product/list', '00401', 'YES',2, 30, 'zfcpgl'), -(33,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '用户支付配置', 'pay/config/list', '00402', 'YES',2, 30, 'yhzfpz'), - -(40,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '交易管理', '##', '005', 'NO', 1, 0, '#'), -(42,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '支付订单管理', 'trade/listPaymentOrder', '00501', 'YES',2, 40, 'zfddgl'), -(43,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '支付记录管理', 'trade/listPaymentRecord', '00502', 'YES',2, 40, 'zfjjgl'), - -(50,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '结算管理', '##', '006', 'NO', 1, 0, '#'), -(52,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '结算记录管理', 'sett/list', '00601', 'YES',2, 50, 'jsjlgl'), - -(60,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '对账管理', '##', '007', 'NO', 1, 0, '#'), -(62,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '对账差错列表', 'reconciliation/list/mistake', '00701', 'YES',2, 60, 'dzcclb'), -(63,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '对账批次列表', 'reconciliation/list/checkbatch', '00702', 'YES',2, 60, 'dzpclb'), -(64,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '对账缓冲池列表', 'reconciliation/list/scratchPool', '00703', 'YES',2, 60, 'dzhcclb'); - --- ------------------------------step 2:权限功能点------------------------------------------------- --- 权限功能点的初始化数据 - - -insert into pms_permission (id,version,status,creater,create_time, editor, edit_time, remark, permission_name, permission) values - (1, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-菜单-查看','权限管理-菜单-查看','pms:menu:view'), - (2, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-菜单-添加','权限管理-菜单-添加','pms:menu:add'), - (3, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-菜单-查看','权限管理-菜单-修改','pms:menu:edit'), - (4, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-菜单-删除','权限管理-菜单-删除','pms:menu:delete'), - - (11, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-权限-查看','权限管理-权限-查看','pms:permission:view'), - (12, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-权限-添加','权限管理-权限-添加','pms:permission:add'), - (13, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-权限-修改','权限管理-权限-修改','pms:permission:edit'), - (14, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-权限-删除','权限管理-权限-删除','pms:permission:delete'), - - (21, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-角色-查看','权限管理-角色-查看','pms:role:view'), - (22, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-角色-添加','权限管理-角色-添加','pms:role:add'), - (23, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-角色-修改','权限管理-角色-修改','pms:role:edit'), - (24, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-角色-删除','权限管理-角色-删除','pms:role:delete'), - (25, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-角色-分配权限','权限管理-角色-分配权限','pms:role:assignpermission'), - - (31, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-操作员-查看','权限管理-操作员-查看','pms:operator:view'), - (32, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-操作员-添加','权限管理-操作员-添加','pms:operator:add'), - (33, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-操作员-查看','权限管理-操作员-修改','pms:operator:edit'), - (34, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-操作员-冻结与解冻','权限管理-操作员-冻结与解冻','pms:operator:changestatus'), - (35, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-操作员-重置密码','权限管理-操作员-重置密码','pms:operator:resetpwd'), - - - (51, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','账户管理-账户-查看','账户管理-账户-查看','account:accountInfo:view'), - (52, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','账户管理-账户-添加','账户管理-账户-添加','account:accountInfo:add'), - (53, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','账户管理-账户-查看','账户管理-账户-修改','account:accountInfo:edit'), - (54, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','账户管理-账户-删除','账户管理-账户-删除','account:accountInfo:delete'), - - (61, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','账户管理-账户历史-查看','账户管理-账户历史-查看','account:accountHistory:view'), - - (71, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','用户管理-用户信息-查看','用户管理-用户信息-查看','user:userInfo:view'), - (72, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','用户管理-用户信息-添加','用户管理-用户信息-添加','user:userInfo:add'), - (73, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','用户管理-用户信息-查看','用户管理-用户信息-修改','user:userInfo:edit'), - (74, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','用户管理-用户信息-删除','用户管理-用户信息-删除','user:userInfo:delete'), - - (81, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付产品-查看','支付管理-支付产品-查看','pay:product:view'), - (82, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付产品-添加','支付管理-支付产品-添加','pay:product:add'), - (83, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付产品-查看','支付管理-支付产品-修改','pay:product:edit'), - (84, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付产品-删除','支付管理-支付产品-删除','pay:product:delete'), - - (85, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付方式-查看','支付管理-支付方式-查看','pay:way:view'), - (86, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付方式-添加','支付管理-支付方式-添加','pay:way:add'), - (87, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付方式-查看','支付管理-支付方式-修改','pay:way:edit'), - (88, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付方式-删除','支付管理-支付方式-删除','pay:way:delete'), - - (91, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付配置-查看','支付管理-支付配置-查看','pay:config:view'), - (92, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付配置-添加','支付管理-支付配置-添加','pay:config:add'), - (93, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付配置-查看','支付管理-支付配置-修改','pay:config:edit'), - (94, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付配置-删除','支付管理-支付配置-删除','pay:config:delete'), - - (101, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-订单-查看','交易管理-订单-查看','trade:order:view'), - (102, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-订单-添加','交易管理-订单-添加','trade:order:add'), - (103, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-订单-查看','交易管理-订单-修改','trade:order:edit'), - (104, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-订单-删除','交易管理-订单-删除','trade:order:delete'), - - (111, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-记录-查看','交易管理-记录-查看','trade:record:view'), - (112, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-记录-添加','交易管理-记录-添加','trade:record:add'), - (113, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-记录-查看','交易管理-记录-修改','trade:record:edit'), - (114, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-记录-删除','交易管理-记录-删除','trade:record:delete'), - - (121, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','结算管理-记录-查看','结算管理-记录-查看','sett:record:view'), - (122, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','结算管理-记录-添加','结算管理-记录-添加','sett:record:add'), - (123, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','结算管理-记录-查看','结算管理-记录-修改','sett:record:edit'), - (124, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','结算管理-记录-删除','结算管理-记录-删除','sett:record:delete'), - - (131, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-差错-查看','对账管理-差错-查看','recon:mistake:view'), - (132, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-差错-添加','对账管理-差错-添加','recon:mistake:add'), - (133, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-差错-查看','对账管理-差错-修改','recon:mistake:edit'), - (134, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-差错-删除','对账管理-差错-删除','recon:mistake:delete'), - - (141, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-批次-查看','对账管理-批次-查看','recon:batch:view'), - (142, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-批次-添加','对账管理-批次-添加','recon:batch:add'), - (143, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-批次-查看','对账管理-批次-修改','recon:batch:edit'), - (144, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-批次-删除','对账管理-批次-删除','recon:batch:delete'), - - (151, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-缓冲池-查看','对账管理-缓冲池-查看','recon:scratchPool:view'), - (152, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-缓冲池-添加','对账管理-缓冲池-添加','recon:scratchPool:add'), - (153, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-缓冲池-查看','对账管理-缓冲池-修改','recon:scratchPool:edit'), - (154, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-缓冲池-删除','对账管理-缓冲池-删除','recon:scratchPool:delete'); - --- -----------------------------------step3:操作员-------------------------------------------- --- -- 操作员的初始化数据 --- admin 超级管理员 -insert into pms_operator (id,version,status,creater,create_time, editor, edit_time, remark, login_name, login_pwd,real_name,mobile_no,type,salt) -values (1, 0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '超级管理员', 'admin', 'd3c59d25033dbf980d29554025c23a75','超级管理员', '18620936193', 'ADMIN','8d78869f470951332959580424d4bf4f'); - --- guest 游客 -insert into pms_operator (id,version,status,creater,create_time, editor, edit_time, remark, login_name, login_pwd,real_name,mobile_no,type,salt) -values (2, 0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'guest','2016-06-03 11:07:43', '游客', 'guest', '3f0dbf580ee39ec03b632cb33935a363','游客', '18926215592', 'USER','183d9f2f0f2ce760e98427a5603d1c73'); - --- ------------------------------------step4:角色------------------------------------------- --- -- 角色的初始化数据 -insert into pms_role (id,version,status,creater,create_time, editor, edit_time, remark, role_code, role_name) -values (1, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'admin', '2016-06-03 11:07:43','超级管理员角色','admin', '超级管理员角色'); - -insert into pms_role (id,version,status,creater,create_time, editor, edit_time, remark, role_code, role_name) -values (2, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'guest', '2016-06-03 11:07:43','游客角色','guest', '游客角色'); - --- ------------------------------------step5:操作员和角色关联------------------------------------------- --- -- 操作员与角色关联的初始化数据 - --- admin 关联admin 和test两个角色 -insert into pms_role_operator (id,version,status,creater,create_time, editor, edit_time, remark,role_id,operator_id) values (1, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',1,1); -insert into pms_role_operator (id,version,status,creater,create_time, editor, edit_time, remark,role_id,operator_id) values (2, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,1); - --- guest 关联游客角色 (游客角色只有查看交易记录的信息) -insert into pms_role_operator (id,version,status,creater,create_time, editor, edit_time, remark,role_id,operator_id) values (3, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,2); - --- -------------------------------------step6:角色和权限关联------------------------------------------ --- -- 角色与用户功能点关联的初始化数据 - --- admin(拥有所有的权限点) -insert into pms_role_permission (role_id, permission_id) select 1,id from PMS_PERMISSION; - - --- guest (只有所有的查看权限) -insert into pms_role_permission (version,status,creater,create_time, editor, edit_time, remark,role_id,permission_id) -values - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,1), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,11), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,21), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,31), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,41), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,51), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,61), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,71), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,81), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,85), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,91), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,101), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,111), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,121), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,131), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,141), - ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,151); - --- -------------------------------------step7:角色和菜单关联------------------------------------------ --- 角色与信息关联初始化数据 --- admin - -insert into pms_menu_role(role_id, menu_id) select 1,id from PMS_MENU; - --- guest 所有的菜单(只有查看权限) -insert into pms_menu_role (role_id, menu_id) select 2,id from PMS_MENU; - --- 2016.8.5 第三方支付信息表增加支付宝线下产品字段 -alter table rp_user_pay_info add offline_app_id varchar(50); -alter table rp_user_pay_info add rsa_private_key varchar(100); -alter table rp_user_pay_info add rsa_public_key varchar(100); - --- 2016.9.5 增加登录信息字段 -alter table rp_user_info add mobile varchar(15); -alter table rp_user_info add password varchar(50); +/*==============================================================*/ +/* dbms name: mysql 5.0 */ +/* created on: 2016-6-29 18:28:57 www.roncoo.com */ +/*==============================================================*/ + + +drop table if exists rp_account; + +drop table if exists rp_account_history; + +drop table if exists rp_pay_product; + +drop table if exists rp_pay_way; + +drop table if exists rp_sett_daily_collect; + +drop table if exists rp_sett_record; + +drop table if exists rp_sett_record_annex; + +drop table if exists rp_user_bank_account; + +drop table if exists rp_user_info; + +drop table if exists rp_user_pay_config; + +drop table if exists rp_user_pay_info; + +drop table if exists rp_account_check_batch; + +drop table if exists rp_account_check_mistake; + +drop table if exists rp_account_check_mistake_scratch_pool; + +drop table if exists rp_notify_record; + +drop table if exists rp_notify_record_log; + +drop table if exists rp_refund_record; + +drop table if exists rp_trade_payment_order; + +drop table if exists rp_trade_payment_record; + +drop table if exists seq_table; + +/*==============================================================*/ +/* table: rp_account */ +/*==============================================================*/ +create table rp_account +( + id varchar(50) not null, + create_time datetime not null, + edit_time datetime, + version bigint not null, + remark varchar(200), + account_no varchar(50) not null, + balance decimal(20,6) not null, + unbalance decimal(20,6) not null, + security_money decimal(20,6) not null, + status varchar(36) not null, + total_income decimal(20,6) not null, + total_expend decimal(20,6) not null, + today_income decimal(20,6) not null, + today_expend decimal(20,6) not null, + account_type varchar(50) not null, + sett_amount decimal(20,6) not null, + user_no varchar(50), + primary key (id) +); + +alter table rp_account comment '资金账户表'; + +/*==============================================================*/ +/* table: rp_account_history */ +/*==============================================================*/ +create table rp_account_history +( + id varchar(50) not null, + create_time datetime not null, + edit_time datetime, + version bigint not null, + remark varchar(200), + account_no varchar(50) not null, + amount decimal(20,6) not null, + balance decimal(20,6) not null, + fund_direction varchar(36) not null, + is_allow_sett varchar(36) not null, + is_complete_sett varchar(36) not null, + request_no varchar(36) not null, + bank_trx_no varchar(30), + trx_type varchar(36) not null, + risk_day int, + user_no varchar(50), + primary key (id) +); + +alter table rp_account_history comment '资金账户流水表'; + +/*==============================================================*/ +/* table: rp_pay_product */ +/*==============================================================*/ +create table rp_pay_product +( + id varchar(50) not null, + create_time datetime not null, + edit_time datetime, + version bigint not null, + status varchar(36) not null, + product_code varchar(50) not null comment '支付产品编号', + product_name varchar(200) not null comment '支付产品名称', + audit_status varchar(45), + primary key (id) +); + +alter table rp_pay_product comment '支付产品表'; + +/*==============================================================*/ +/* table: rp_pay_way */ +/*==============================================================*/ +create table rp_pay_way +( + id varchar(50) not null comment 'id', + version bigint not null default 0 comment 'version', + create_time datetime not null comment '创建时间', + edit_time datetime comment '修改时间', + pay_way_code varchar(50) not null comment '支付方式编号', + pay_way_name varchar(100) not null comment '支付方式名称', + pay_type_code varchar(50) not null comment '支付类型编号', + pay_type_name varchar(100) not null comment '支付类型名称', + pay_product_code varchar(50) comment '支付产品编号', + status varchar(36) not null comment '状态(100:正常状态,101非正常状态)', + sorts int default 1000 comment '排序(倒序排序,默认值1000)', + pay_rate double not null comment '商户支付费率', + primary key (id) +); + +alter table rp_pay_way comment '支付方式'; + +/*==============================================================*/ +/* table: rp_sett_daily_collect */ +/*==============================================================*/ +create table rp_sett_daily_collect +( + id varchar(50) not null comment 'id', + version int not null default 0 comment '版本号', + create_time datetime not null comment '创建时间', + edit_time datetime not null comment '修改时间', + account_no varchar(20) not null comment '账户编号', + user_name varchar(200) comment '用户姓名', + collect_date date not null comment '汇总日期', + collect_type varchar(50) not null comment '汇总类型(参考枚举:settdailycollecttypeenum)', + total_amount decimal(24,10) not null comment '交易总金额', + total_count int not null comment '交易总笔数', + sett_status varchar(50) not null comment '结算状态(参考枚举:settdailycollectstatusenum)', + remark varchar(300) comment '备注', + risk_day int comment '风险预存期天数', + primary key (id) +); + +alter table rp_sett_daily_collect comment '每日待结算汇总'; + +/*==============================================================*/ +/* table: rp_sett_record */ +/*==============================================================*/ +create table rp_sett_record +( + id varchar(50) not null comment 'id', + version int not null default 0 comment '版本号', + create_time datetime not null comment '创建时间', + edit_time datetime not null comment '修改时间', + sett_mode varchar(50) comment '结算发起方式(参考settmodetypeenum)', + account_no varchar(20) not null comment '账户编号', + user_no varchar(20) comment '用户编号', + user_name varchar(200) comment '用户姓名', + user_type varchar(50) comment '用户类型', + sett_date date comment '结算日期', + bank_code varchar(20) comment '银行编码', + bank_name varchar(100) comment '银行名称', + bank_account_name varchar(60) comment '开户名', + bank_account_no varchar(20) comment '开户账户', + bank_account_type varchar(50) comment '开户账户', + country varchar(200) comment '开户行所在国家', + province varchar(50) comment '开户行所在省份', + city varchar(50) comment '开户行所在城市', + areas varchar(50) comment '开户行所在区', + bank_account_address varchar(300) comment '开户行全称', + mobile_no varchar(20) comment '收款人手机号', + sett_amount decimal(24,10) comment '结算金额', + sett_fee decimal(16,6) comment '结算手续费', + remit_amount decimal(16,2) comment '结算打款金额', + sett_status varchar(50) comment '结算状态(参考枚举:settrecordstatusenum)', + remit_confirm_time datetime comment '打款确认时间', + remark varchar(200) comment '描述', + remit_remark varchar(200) comment '打款备注', + operator_loginname varchar(50) comment '操作员登录名', + operator_realname varchar(50) comment '操作员姓名', + primary key (id) +); + +alter table rp_sett_record comment '结算记录'; + +/*==============================================================*/ +/* table: rp_sett_record_annex */ +/*==============================================================*/ +create table rp_sett_record_annex +( + id varchar(50) not null, + create_time datetime not null, + edit_time datetime, + version bigint not null, + remark varchar(200), + is_delete varchar(36) not null, + annex_name varchar(200), + annex_address varchar(500) not null, + settlement_id varchar(50) not null, + primary key (id) +); + +/*==============================================================*/ +/* table: rp_user_bank_account */ +/*==============================================================*/ +create table rp_user_bank_account +( + id varchar(50) not null, + create_time datetime not null, + edit_time datetime, + version bigint not null, + remark varchar(200), + status varchar(36) not null, + user_no varchar(50) not null, + bank_name varchar(200) not null, + bank_code varchar(50) not null, + bank_account_name varchar(100) not null, + bank_account_no varchar(36) not null, + card_type varchar(36) not null, + card_no varchar(36) not null, + mobile_no varchar(50) not null, + is_default varchar(36), + province varchar(20), + city varchar(20), + areas varchar(20), + street varchar(300), + bank_account_type varchar(36) not null, + primary key (id) +); + +alter table rp_user_bank_account comment '用户银行账户表'; + +/*==============================================================*/ +/* table: rp_user_info */ +/*==============================================================*/ +create table rp_user_info +( + id varchar(50) not null, + create_time datetime not null, + status varchar(36) not null, + user_no varchar(50), + user_name varchar(100), + account_no varchar(50) not null, + primary key (id), + unique key ak_key_2 (account_no) +); + +alter table rp_user_info comment '该表用来存放用户的基本信息'; + +/*==============================================================*/ +/* table: rp_user_pay_config */ +/*==============================================================*/ +create table rp_user_pay_config +( + id varchar(50) not null, + create_time datetime not null, + edit_time datetime, + version bigint not null, + remark varchar(200), + status varchar(36) not null, + audit_status varchar(45), + is_auto_sett varchar(36) not null default 'no', + product_code varchar(50) not null comment '支付产品编号', + product_name varchar(200) not null comment '支付产品名称', + user_no varchar(50), + user_name varchar(100), + risk_day int, + pay_key varchar(50), + fund_into_type varchar(50), + pay_secret varchar(50), + primary key (id) +); + +alter table rp_user_pay_config comment '支付设置表'; + +/*==============================================================*/ +/* table: rp_user_pay_info */ +/*==============================================================*/ +create table rp_user_pay_info +( + id_ varchar(50) not null, + create_time datetime not null, + edit_time datetime, + version bigint not null, + remark varchar(200), + status varchar(36) not null, + app_id varchar(50) not null, + app_sectet varchar(100), + merchant_id varchar(50), + app_type varchar(50), + user_no varchar(50), + user_name varchar(100), + partner_key varchar(100), + pay_way_code varchar(50) not null comment '支付方式编号', + pay_way_name varchar(100) not null comment '支付方式名称', + primary key (id_) +); + +alter table rp_user_pay_info comment '该表用来存放用户开通的第三方支付信息'; + + +create table rp_account_check_batch +( + id varchar(50) not null, + version int unsigned not null, + create_time datetime not null, + editor varchar(100) comment '修改者', + creater varchar(100) comment '创建者', + edit_time datetime comment '最后修改时间', + status varchar(30) not null, + remark varchar(500), + batch_no varchar(30) not null, + bill_date date not null, + bill_type varchar(30), + handle_status varchar(10), + bank_type varchar(30), + mistake_count int(8), + unhandle_mistake_count int(8), + trade_count int(8), + bank_trade_count int(8), + trade_amount decimal(20,6), + bank_trade_amount decimal(20,6), + refund_amount decimal(20,6), + bank_refund_amount decimal(20,6), + bank_fee decimal(20,6), + org_check_file_path varchar(500), + release_check_file_path varchar(500), + release_status varchar(15), + check_fail_msg varchar(300), + bank_err_msg varchar(300), + primary key (id) +); + +alter table rp_account_check_batch comment '对账批次表 rp_account_check_batch'; + +create table rp_account_check_mistake +( + id varchar(50) not null, + version int unsigned not null, + create_time datetime not null, + editor varchar(100) comment '修改者', + creater varchar(100) comment '创建者', + edit_time datetime comment '最后修改时间', + status varchar(30), + remark varchar(500), + account_check_batch_no varchar(50) not null, + bill_date date not null, + bank_type varchar(30) not null, + order_time datetime, + merchant_name varchar(100), + merchant_no varchar(50), + order_no varchar(40), + trade_time datetime, + trx_no varchar(20), + order_amount decimal(20,6), + refund_amount decimal(20,6), + trade_status varchar(30), + fee decimal(20,6), + bank_trade_time datetime, + bank_order_no varchar(40), + bank_trx_no varchar(40), + bank_trade_status varchar(30), + bank_amount decimal(20,6), + bank_refund_amount decimal(20,6), + bank_fee decimal(20,6), + err_type varchar(30) not null, + handle_status varchar(10) not null, + handle_value varchar(1000), + handle_remark varchar(1000), + operator_name varchar(100), + operator_account_no varchar(50), + primary key (id) +); + +alter table rp_account_check_mistake comment '对账差错表 rp_account_check_mistake'; + +create table rp_account_check_mistake_scratch_pool +( + id varchar(50) not null, + version int unsigned not null, + create_time datetime not null, + editor varchar(100) comment '修改者', + creater varchar(100) comment '创建者', + edit_time datetime comment '最后修改时间', + product_name varchar(50) comment '商品名称', + merchant_order_no varchar(30) not null comment '商户订单号', + trx_no char(20) not null comment '支付流水号', + bank_order_no char(20) comment '银行订单号', + bank_trx_no varchar(30) comment '银行流水号', + order_amount decimal(20,6) default 0 comment '订单金额', + plat_income decimal(20,6) comment '平台收入', + fee_rate decimal(20,6) comment '费率', + plat_cost decimal(20,6) comment '平台成本', + plat_profit decimal(20,6) comment '平台利润', + status varchar(30) comment '状态(参考枚举:paymentrecordstatusenum)', + pay_way_code varchar(50) comment '支付通道编号', + pay_way_name varchar(100) comment '支付通道名称', + pay_success_time datetime comment '支付成功时间', + complete_time datetime comment '完成时间', + is_refund varchar(30) default '101' comment '是否退款(100:是,101:否,默认值为:101)', + refund_times smallint default 0 comment '退款次数(默认值为:0)', + success_refund_amount decimal(20,6) comment '成功退款总金额', + remark varchar(500) comment '备注', + batch_no varchar(50), + bill_date datetime +); + +alter table rp_account_check_mistake_scratch_pool comment '差错暂存池'; + +create table rp_notify_record +( + id varchar(50) not null, + version int not null, + create_time datetime not null, + editor varchar(100) comment '修改者', + creater varchar(100) comment '创建者', + edit_time datetime comment '最后修改时间', + notify_times int not null, + limit_notify_times int not null, + url varchar(2000) not null, + merchant_order_no varchar(50) not null, + merchant_no varchar(50) not null, + status varchar(50) not null comment '100:成功 101:失败', + notify_type varchar(30) comment '通知类型', + primary key (id), + key ak_key_2 (merchant_order_no) +); + +alter table rp_notify_record comment '通知记录表 rp_notify_record'; + +create table rp_notify_record_log +( + id varchar(50) not null, + version int not null, + editor varchar(100) comment '修改者', + creater varchar(100) comment '创建者', + edit_time datetime comment '最后修改时间', + create_time datetime not null, + notify_id varchar(50) not null, + request varchar(2000) not null, + response varchar(2000) not null, + merchant_no varchar(50) not null, + merchant_order_no varchar(50) not null comment '商户订单号', + http_status varchar(50) not null comment 'http状态', + primary key (id) +); + +alter table rp_notify_record_log comment '通知记录日志表 rp_notify_record_log'; + +create table rp_refund_record +( + id varchar(50) not null comment 'id', + version int not null comment '版本号', + create_time datetime comment '创建时间', + editor varchar(100) comment '修改者', + creater varchar(100) comment '创建者', + edit_time datetime comment '最后修改时间', + org_merchant_order_no varchar(50) comment '原商户订单号', + org_trx_no varchar(50) comment '原支付流水号', + org_bank_order_no varchar(50) comment '原银行订单号', + org_bank_trx_no varchar(50) comment '原银行流水号', + merchant_name varchar(100) comment '商家名称', + merchant_no varchar(100) not null comment '商家编号', + org_product_name varchar(60) comment '原商品名称', + org_biz_type varchar(30) comment '原业务类型', + org_payment_type varchar(30) comment '原支付方式类型', + refund_amount decimal(20,6) comment '订单退款金额', + refund_trx_no varchar(50) not null comment '退款流水号', + refund_order_no varchar(50) not null comment '退款订单号', + bank_refund_order_no varchar(50) comment '银行退款订单号', + bank_refund_trx_no varchar(30) comment '银行退款流水号', + result_notify_url varchar(500) comment '退款结果通知url', + refund_status varchar(30) comment '退款状态', + refund_from varchar(30) comment '退款来源(分发平台)', + refund_way varchar(30) comment '退款方式', + refund_request_time datetime comment '退款请求时间', + refund_success_time datetime comment ' 退款成功时间', + refund_complete_time datetime comment '退款完成时间', + request_apply_user_id varchar(50) comment '退款请求,申请人登录名', + request_apply_user_name varchar(90) comment '退款请求,申请人姓名', + refund_reason varchar(500) comment '退款原因', + remark varchar(3000) comment '备注', + primary key (id), + unique key ak_key_2 (refund_trx_no) +); + +alter table rp_refund_record comment '退款记录表'; + +create table rp_trade_payment_order +( + id varchar(50) not null comment 'id', + version int not null default 0 comment '版本号', + create_time datetime not null comment '创建时间', + editor varchar(100) comment '修改者', + creater varchar(100) comment '创建者', + edit_time datetime comment '最后修改时间', + status varchar(50) comment '状态(参考枚举:orderstatusenum)', + product_name varchar(300) comment '商品名称', + merchant_order_no varchar(30) not null comment '商户订单号', + order_amount decimal(20,6) default 0 comment '订单金额', + order_from varchar(30) comment '订单来源', + merchant_name varchar(100) comment '商家名称', + merchant_no varchar(100) not null comment '商户编号', + order_time datetime comment '下单时间', + order_date date comment '下单日期', + order_ip varchar(50) comment '下单ip(客户端ip,在网关页面获取)', + order_referer_url varchar(100) comment '从哪个页面链接过来的(可用于防诈骗)', + return_url varchar(600) comment '页面回调通知url', + notify_url varchar(600) comment '后台异步通知url', + cancel_reason varchar(600) comment '订单撤销原因', + order_period smallint comment '订单有效期(单位分钟)', + expire_time datetime comment '到期时间', + pay_way_code varchar(50) comment '支付方式编号', + pay_way_name varchar(100) comment '支付方式名称', + remark varchar(200) comment '支付备注', + trx_type varchar(30) comment '交易业务类型 :消费、充值等', + trx_no varchar(50) comment '支付流水号', + pay_type_code varchar(50) comment '支付类型编号', + pay_type_name varchar(100) comment '支付类型名称', + fund_into_type varchar(30) comment '资金流入类型', + is_refund varchar(30) default '101' comment '是否退款(100:是,101:否,默认值为:101)', + refund_times int default 0 comment '退款次数(默认值为:0)', + success_refund_amount decimal(20,6) comment '成功退款总金额', + field1 varchar(500), + field2 varchar(500), + field3 varchar(500), + field4 varchar(500), + field5 varchar(500), + primary key (id), + unique key ak_key_2 (merchant_order_no, merchant_no) +); + +alter table rp_trade_payment_order comment 'roncoo pay 龙果支付 支付订单表'; + +create table rp_trade_payment_record +( + id varchar(50) not null comment 'id', + version int not null default 0 comment '版本号', + create_time datetime comment '创建时间', + status varchar(30) comment '状态(参考枚举:paymentrecordstatusenum)', + editor varchar(100) comment '修改者', + creater varchar(100) comment '创建者', + edit_time datetime comment '最后修改时间', + product_name varchar(50) comment '商品名称', + merchant_order_no varchar(50) not null comment '商户订单号', + trx_no varchar(50) not null comment '支付流水号', + bank_order_no varchar(50) comment '银行订单号', + bank_trx_no varchar(50) comment '银行流水号', + merchant_name varchar(300) comment '商家名称', + merchant_no varchar(50) not null comment '商家编号', + payer_user_no varchar(50) comment '付款人编号', + payer_name varchar(60) comment '付款人名称', + payer_pay_amount decimal(20,6) default 0 comment '付款方支付金额', + payer_fee decimal(20,6) default 0 comment '付款方手续费', + payer_account_type varchar(30) comment '付款方账户类型(参考账户类型枚举:accounttypeenum)', + receiver_user_no varchar(15) comment '收款人编号', + receiver_name varchar(60) comment '收款人名称', + receiver_pay_amount decimal(20,6) default 0 comment '收款方支付金额', + receiver_fee decimal(20,6) default 0 comment '收款方手续费', + receiver_account_type varchar(30) comment '收款方账户类型(参考账户类型枚举:accounttypeenum)', + order_ip varchar(30) comment '下单ip(客户端ip,从网关中获取)', + order_referer_url varchar(100) comment '从哪个页面链接过来的(可用于防诈骗)', + order_amount decimal(20,6) default 0 comment '订单金额', + plat_income decimal(20,6) comment '平台收入', + fee_rate decimal(20,6) comment '费率', + plat_cost decimal(20,6) comment '平台成本', + plat_profit decimal(20,6) comment '平台利润', + return_url varchar(600) comment '页面回调通知url', + notify_url varchar(600) comment '后台异步通知url', + pay_way_code varchar(50) comment '支付方式编号', + pay_way_name varchar(100) comment '支付方式名称', + pay_success_time datetime comment '支付成功时间', + complete_time datetime comment '完成时间', + is_refund varchar(30) default '101' comment '是否退款(100:是,101:否,默认值为:101)', + refund_times int default 0 comment '退款次数(默认值为:0)', + success_refund_amount decimal(20,6) comment '成功退款总金额', + trx_type varchar(30) comment '交易业务类型 :消费、充值等', + order_from varchar(30) comment '订单来源', + pay_type_code varchar(50) comment '支付类型编号', + pay_type_name varchar(100) comment '支付类型名称', + fund_into_type varchar(30) comment '资金流入类型', + remark varchar(3000) comment '备注', + field1 varchar(500), + field2 varchar(500), + field3 varchar(500), + field4 varchar(500), + field5 varchar(500), + bank_return_msg varchar(2000) comment '银行返回信息', + primary key (id), + unique key ak_key_2 (trx_no) +); + +alter table rp_trade_payment_record comment '支付记录表'; + +CREATE TABLE seq_table (SEQ_NAME varchar(50) NOT NULL, CURRENT_VALUE bigint DEFAULT '1000000002' NOT NULL, INCREMENT smallint DEFAULT '1' NOT NULL, REMARK varchar(100) NOT NULL, PRIMARY KEY (SEQ_NAME)) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO seq_table (SEQ_NAME, CURRENT_VALUE, INCREMENT, REMARK) VALUES ('ACCOUNT_NO_SEQ', 10000000, 1, '账户--账户编号'); +INSERT INTO seq_table (SEQ_NAME, CURRENT_VALUE, INCREMENT, REMARK) VALUES ('ACTIVITY_NO_SEQ', 10000006, 1, '活动--活动编号'); +INSERT INTO seq_table (SEQ_NAME, CURRENT_VALUE, INCREMENT, REMARK) VALUES ('USER_NO_SEQ', 10001113, 1, '用户--用户编号'); +INSERT INTO seq_table (SEQ_NAME, CURRENT_VALUE, INCREMENT, REMARK) VALUES ('TRX_NO_SEQ', 10000000, 1, '交易—-支付流水号'); +INSERT INTO seq_table (SEQ_NAME, CURRENT_VALUE, INCREMENT, REMARK) VALUES ('BANK_ORDER_NO_SEQ', 10000000, 1, '交易—-银行订单号'); +INSERT INTO seq_table (SEQ_NAME, CURRENT_VALUE, INCREMENT, REMARK) VALUES ('RECONCILIATION_BATCH_NO_SEQ', 10000000, 1, '对账—-批次号'); + +/*==============================================================*/ +/* create function */ +/*==============================================================*/ +CREATE FUNCTION `FUN_SEQ`(SEQ VARCHAR(50)) RETURNS BIGINT(20) +BEGIN + UPDATE SEQ_TABLE + SET CURRENT_VALUE = CURRENT_VALUE + INCREMENT + WHERE SEQ_NAME=SEQ; + RETURN FUN_SEQ_CURRENT_VALUE(SEQ); +END; + + +CREATE FUNCTION `FUN_SEQ_CURRENT_VALUE`(SEQ VARCHAR(50)) RETURNS BIGINT(20) +BEGIN + DECLARE VALUE INTEGER; + SET VALUE=0; + SELECT CURRENT_VALUE INTO VALUE + FROM SEQ_TABLE + WHERE SEQ_NAME=SEQ; + RETURN VALUE; +END; + +CREATE FUNCTION `FUN_SEQ_SET_VALUE`(SEQ VARCHAR(50), VALUE INTEGER) RETURNS BIGINT(20) +BEGIN + UPDATE SEQ_TABLE + SET CURRENT_VALUE=VALUE + WHERE SEQ_NAME=SEQ; + RETURN FUN_SEQ_CURRENT_VALUE(SEQ); +END; + +CREATE FUNCTION FUN_NOW() + RETURNS DATETIME +BEGIN +RETURN now(); +END; + + +-- 时间函数 + +CREATE FUNCTION `FUN_DATE_ADD`(STR_DATE VARCHAR(10), STR_INTERVAL INTEGER) RETURNS DATE +BEGIN + RETURN date_add(STR_DATE, INTERVAL STR_INTERVAL DAY); +END; + + + + + + +-- ----------------------------------------------------------------------------------------------------------------------------------- +-- 注意:该脚本运行在mysql环境下,如果是其他数据库,如有需要请先修改,再执行。 -- +-- 编写人:沈佳龙 (www.roncoo.com) -- +-- ----------------------------------------------------------------------------------------------------------------------------------- + +drop table if exists pms_menu; + +drop table if exists pms_menu_role; + +drop table if exists pms_operator; + +drop table if exists pms_operator_log; + +drop table if exists pms_permission; + +drop table if exists pms_role; + +drop table if exists pms_role_operator; + +drop table if exists pms_role_permission; + +create table pms_menu +( + id bigint not null auto_increment, + version bigint not null, + creater varchar(50) not null comment '创建人', + create_time datetime not null comment '创建时间', + editor varchar(50) comment '修改人', + edit_time datetime comment '修改时间', + status varchar(20) not null, + remark varchar(300), + is_leaf varchar(20), + level smallint, + parent_id bigint not null, + target_name varchar(100), + number varchar(20), + name varchar(100), + url varchar(100), + primary key (id) +)auto_increment = 1000; + +alter table pms_menu comment '菜单表'; + + +alter table pms_menu comment '菜单表'; + +create table pms_menu_role +( + id bigint not null auto_increment comment '主键', + version bigint, + creater varchar(50) comment '创建人', + create_time datetime comment '创建时间', + editor varchar(50) comment '修改人', + edit_time datetime comment '修改时间', + status varchar(20), + remark varchar(300), + role_id bigint not null, + menu_id bigint not null, + primary key (id), + key ak_key_2 (role_id, menu_id) +) auto_increment = 1000; + +alter table pms_menu_role comment '权限与角色关联表'; + +create table pms_operator +( + id bigint not null auto_increment comment '主键', + version bigint not null, + creater varchar(50) not null comment '创建人', + create_time datetime not null comment '创建时间', + editor varchar(50) comment '修改人', + edit_time datetime comment '修改时间', + status varchar(20) not null, + remark varchar(300), + real_name varchar(50) not null, + mobile_no varchar(15) not null, + login_name varchar(50) not null, + login_pwd varchar(256) not null, + type varchar(20) not null, + salt varchar(50) not null, + primary key (id), + key ak_key_2 (login_name) +) auto_increment = 1000; + +alter table pms_operator comment '操作员表'; + +create table pms_operator_log +( + id bigint not null auto_increment comment '主键', + version bigint not null, + creater varchar(50) not null comment '创建人', + create_time datetime not null comment '创建时间', + editor varchar(50) comment '修改人', + edit_time datetime comment '修改时间', + status varchar(20) not null, + remark varchar(300), + operator_id bigint not null, + operator_name varchar(50) not null, + operate_type varchar(50) not null comment '操作类型(1:增加,2:修改,3:删除,4:查询)', + ip varchar(100) not null, + content varchar(3000), + primary key (id) +) auto_increment = 1000; + +alter table pms_operator_log comment '权限_操作员操作日志表'; + +create table pms_permission +( + id bigint not null auto_increment comment '主键', + version bigint not null, + creater varchar(50) not null comment '创建人', + create_time datetime not null comment '创建时间', + editor varchar(50) comment '修改人', + edit_time datetime comment '修改时间', + status varchar(20) not null, + remark varchar(300), + permission_name varchar(100) not null, + permission varchar(100) not null, + primary key (id), + key ak_key_2 (permission), + key ak_key_3 (permission_name) +) auto_increment = 1000; + +alter table pms_permission comment '权限表'; + +create table pms_role +( + id bigint not null auto_increment comment '主键', + version bigint, + creater varchar(50) comment '创建人', + create_time datetime comment '创建时间', + editor varchar(50) comment '修改人', + edit_time datetime comment '修改时间', + status varchar(20), + remark varchar(300), + role_code varchar(20) not null comment '角色类型(1:超级管理员角色,0:普通操作员角色)', + role_name varchar(100) not null, + primary key (id), + key ak_key_2 (role_name) +) auto_increment = 1000; + +alter table pms_role comment '角色表'; + +create table pms_role_operator +( + id bigint not null auto_increment comment '主键', + version bigint not null, + creater varchar(50) not null comment '创建人', + create_time datetime not null comment '创建时间', + editor varchar(50) comment '修改人', + edit_time datetime comment '修改时间', + status varchar(20) not null, + remark varchar(300), + role_id bigint not null, + operator_id bigint not null, + primary key (id), + key ak_key_2 (role_id, operator_id) +) auto_increment = 1000; + +alter table pms_role_operator comment '操作员与角色关联表'; + +create table pms_role_permission +( + id bigint not null auto_increment comment '主键', + version bigint, + creater varchar(50) comment '创建人', + create_time datetime comment '创建时间', + editor varchar(50) comment '修改人', + edit_time datetime comment '修改时间', + status varchar(20), + remark varchar(300), + role_id bigint not null, + permission_id bigint not null, + primary key (id), + key ak_key_2 (role_id, permission_id) +) auto_increment = 1000; + +alter table pms_role_permission comment '权限与角色关联表'; + + + + + +-- ------------------------------step 1 菜单------------------------------------------------- +-- 菜单初始化数据 +-- -- 菜单的初始化数据 +insert into pms_menu (id,version,status,creater,create_time, editor, edit_time, remark, name, url, number, is_leaf, level, parent_id, target_name) values +(1,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '权限管理', '##', '001', 'NO', 1, 0, '#'), +(2,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '菜单管理', 'pms/menu/list', '00101', 'YES', 2, 1, 'cdgl'), +(3,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '权限管理', 'pms/permission/list', '00102', 'YES',2, 1, 'qxgl'), +(4,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '角色管理', 'pms/role/list', '00103', 'YES',2, 1, 'jsgl'), +(5,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '操作员管理', 'pms/operator/list', '00104', 'YES',2, 1, 'czygl'), + +(10,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '账户管理', '##', '002', 'NO', 1, 0, '#'), +(12,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '账户信息', 'account/list', '00201', 'YES',2, 10, 'zhxx'), +(13,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '账户历史信息', 'account/historyList', '00202', 'YES',2, 10, 'zhlsxx'), + + +(20,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '用户管理', '##', '003', 'NO', 1, 0, '#'), +(22,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '用户信息', 'user/info/list', '00301', 'YES',2, 20, 'yhxx'), + +(30,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '支付管理', '##', '004', 'NO', 1, 0, '#'), +(32,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '支付产品信息', 'pay/product/list', '00401', 'YES',2, 30, 'zfcpgl'), +(33,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '用户支付配置', 'pay/config/list', '00402', 'YES',2, 30, 'yhzfpz'), + +(40,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '交易管理', '##', '005', 'NO', 1, 0, '#'), +(42,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '支付订单管理', 'trade/listPaymentOrder', '00501', 'YES',2, 40, 'zfddgl'), +(43,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '支付记录管理', 'trade/listPaymentRecord', '00502', 'YES',2, 40, 'zfjjgl'), + +(50,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '结算管理', '##', '006', 'NO', 1, 0, '#'), +(52,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '结算记录管理', 'sett/list', '00601', 'YES',2, 50, 'jsjlgl'), + +(60,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '对账管理', '##', '007', 'NO', 1, 0, '#'), +(62,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '对账差错列表', 'reconciliation/list/mistake', '00701', 'YES',2, 60, 'dzcclb'), +(63,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '对账批次列表', 'reconciliation/list/checkbatch', '00702', 'YES',2, 60, 'dzpclb'), +(64,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '对账缓冲池列表', 'reconciliation/list/scratchPool', '00703', 'YES',2, 60, 'dzhcclb'); + +-- ------------------------------step 2:权限功能点------------------------------------------------- +-- 权限功能点的初始化数据 + + +insert into pms_permission (id,version,status,creater,create_time, editor, edit_time, remark, permission_name, permission) values + (1, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-菜单-查看','权限管理-菜单-查看','pms:menu:view'), + (2, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-菜单-添加','权限管理-菜单-添加','pms:menu:add'), + (3, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-菜单-查看','权限管理-菜单-修改','pms:menu:edit'), + (4, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-菜单-删除','权限管理-菜单-删除','pms:menu:delete'), + + (11, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-权限-查看','权限管理-权限-查看','pms:permission:view'), + (12, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-权限-添加','权限管理-权限-添加','pms:permission:add'), + (13, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-权限-修改','权限管理-权限-修改','pms:permission:edit'), + (14, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-权限-删除','权限管理-权限-删除','pms:permission:delete'), + + (21, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-角色-查看','权限管理-角色-查看','pms:role:view'), + (22, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-角色-添加','权限管理-角色-添加','pms:role:add'), + (23, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-角色-修改','权限管理-角色-修改','pms:role:edit'), + (24, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-角色-删除','权限管理-角色-删除','pms:role:delete'), + (25, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-角色-分配权限','权限管理-角色-分配权限','pms:role:assignpermission'), + + (31, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-操作员-查看','权限管理-操作员-查看','pms:operator:view'), + (32, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-操作员-添加','权限管理-操作员-添加','pms:operator:add'), + (33, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-操作员-查看','权限管理-操作员-修改','pms:operator:edit'), + (34, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-操作员-冻结与解冻','权限管理-操作员-冻结与解冻','pms:operator:changestatus'), + (35, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-操作员-重置密码','权限管理-操作员-重置密码','pms:operator:resetpwd'), + + + (51, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','账户管理-账户-查看','账户管理-账户-查看','account:accountInfo:view'), + (52, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','账户管理-账户-添加','账户管理-账户-添加','account:accountInfo:add'), + (53, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','账户管理-账户-查看','账户管理-账户-修改','account:accountInfo:edit'), + (54, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','账户管理-账户-删除','账户管理-账户-删除','account:accountInfo:delete'), + + (61, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','账户管理-账户历史-查看','账户管理-账户历史-查看','account:accountHistory:view'), + + (71, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','用户管理-用户信息-查看','用户管理-用户信息-查看','user:userInfo:view'), + (72, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','用户管理-用户信息-添加','用户管理-用户信息-添加','user:userInfo:add'), + (73, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','用户管理-用户信息-查看','用户管理-用户信息-修改','user:userInfo:edit'), + (74, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','用户管理-用户信息-删除','用户管理-用户信息-删除','user:userInfo:delete'), + + (81, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付产品-查看','支付管理-支付产品-查看','pay:product:view'), + (82, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付产品-添加','支付管理-支付产品-添加','pay:product:add'), + (83, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付产品-查看','支付管理-支付产品-修改','pay:product:edit'), + (84, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付产品-删除','支付管理-支付产品-删除','pay:product:delete'), + + (85, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付方式-查看','支付管理-支付方式-查看','pay:way:view'), + (86, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付方式-添加','支付管理-支付方式-添加','pay:way:add'), + (87, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付方式-查看','支付管理-支付方式-修改','pay:way:edit'), + (88, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付方式-删除','支付管理-支付方式-删除','pay:way:delete'), + + (91, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付配置-查看','支付管理-支付配置-查看','pay:config:view'), + (92, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付配置-添加','支付管理-支付配置-添加','pay:config:add'), + (93, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付配置-查看','支付管理-支付配置-修改','pay:config:edit'), + (94, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','支付管理-支付配置-删除','支付管理-支付配置-删除','pay:config:delete'), + + (101, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-订单-查看','交易管理-订单-查看','trade:order:view'), + (102, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-订单-添加','交易管理-订单-添加','trade:order:add'), + (103, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-订单-查看','交易管理-订单-修改','trade:order:edit'), + (104, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-订单-删除','交易管理-订单-删除','trade:order:delete'), + + (111, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-记录-查看','交易管理-记录-查看','trade:record:view'), + (112, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-记录-添加','交易管理-记录-添加','trade:record:add'), + (113, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-记录-查看','交易管理-记录-修改','trade:record:edit'), + (114, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','交易管理-记录-删除','交易管理-记录-删除','trade:record:delete'), + + (121, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','结算管理-记录-查看','结算管理-记录-查看','sett:record:view'), + (122, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','结算管理-记录-添加','结算管理-记录-添加','sett:record:add'), + (123, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','结算管理-记录-查看','结算管理-记录-修改','sett:record:edit'), + (124, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','结算管理-记录-删除','结算管理-记录-删除','sett:record:delete'), + + (131, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-差错-查看','对账管理-差错-查看','recon:mistake:view'), + (132, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-差错-添加','对账管理-差错-添加','recon:mistake:add'), + (133, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-差错-查看','对账管理-差错-修改','recon:mistake:edit'), + (134, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-差错-删除','对账管理-差错-删除','recon:mistake:delete'), + + (141, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-批次-查看','对账管理-批次-查看','recon:batch:view'), + (142, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-批次-添加','对账管理-批次-添加','recon:batch:add'), + (143, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-批次-查看','对账管理-批次-修改','recon:batch:edit'), + (144, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-批次-删除','对账管理-批次-删除','recon:batch:delete'), + + (151, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-缓冲池-查看','对账管理-缓冲池-查看','recon:scratchPool:view'), + (152, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-缓冲池-添加','对账管理-缓冲池-添加','recon:scratchPool:add'), + (153, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-缓冲池-查看','对账管理-缓冲池-修改','recon:scratchPool:edit'), + (154, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','对账管理-缓冲池-删除','对账管理-缓冲池-删除','recon:scratchPool:delete'); + +-- -----------------------------------step3:操作员-------------------------------------------- +-- -- 操作员的初始化数据 +-- admin 超级管理员 +insert into pms_operator (id,version,status,creater,create_time, editor, edit_time, remark, login_name, login_pwd,real_name,mobile_no,type,salt) +values (1, 0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '超级管理员', 'admin', 'd3c59d25033dbf980d29554025c23a75','超级管理员', '18620936193', 'ADMIN','8d78869f470951332959580424d4bf4f'); + +-- guest 游客 +insert into pms_operator (id,version,status,creater,create_time, editor, edit_time, remark, login_name, login_pwd,real_name,mobile_no,type,salt) +values (2, 0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'guest','2016-06-03 11:07:43', '游客', 'guest', '3f0dbf580ee39ec03b632cb33935a363','游客', '18926215592', 'USER','183d9f2f0f2ce760e98427a5603d1c73'); + +-- ------------------------------------step4:角色------------------------------------------- +-- -- 角色的初始化数据 +insert into pms_role (id,version,status,creater,create_time, editor, edit_time, remark, role_code, role_name) +values (1, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'admin', '2016-06-03 11:07:43','超级管理员角色','admin', '超级管理员角色'); + +insert into pms_role (id,version,status,creater,create_time, editor, edit_time, remark, role_code, role_name) +values (2, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'guest', '2016-06-03 11:07:43','游客角色','guest', '游客角色'); + +-- ------------------------------------step5:操作员和角色关联------------------------------------------- +-- -- 操作员与角色关联的初始化数据 + +-- admin 关联admin 和test两个角色 +insert into pms_role_operator (id,version,status,creater,create_time, editor, edit_time, remark,role_id,operator_id) values (1, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',1,1); +insert into pms_role_operator (id,version,status,creater,create_time, editor, edit_time, remark,role_id,operator_id) values (2, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,1); + +-- guest 关联游客角色 (游客角色只有查看交易记录的信息) +insert into pms_role_operator (id,version,status,creater,create_time, editor, edit_time, remark,role_id,operator_id) values (3, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,2); + +-- -------------------------------------step6:角色和权限关联------------------------------------------ +-- -- 角色与用户功能点关联的初始化数据 + +-- admin(拥有所有的权限点) +insert into pms_role_permission (role_id, permission_id) select 1,id from PMS_PERMISSION; + + +-- guest (只有所有的查看权限) +insert into pms_role_permission (version,status,creater,create_time, editor, edit_time, remark,role_id,permission_id) +values + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,1), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,11), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,21), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,31), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,41), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,51), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,61), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,71), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,81), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,85), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,91), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,101), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,111), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,121), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,131), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,141), + ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,151); + +-- -------------------------------------step7:角色和菜单关联------------------------------------------ +-- 角色与信息关联初始化数据 +-- admin + +insert into pms_menu_role(role_id, menu_id) select 1,id from PMS_MENU; + +-- guest 所有的菜单(只有查看权限) +insert into pms_menu_role (role_id, menu_id) select 2,id from PMS_MENU; + +-- 2016.8.5 第三方支付信息表增加支付宝线下产品字段 +alter table rp_user_pay_info add offline_app_id varchar(50); +alter table rp_user_pay_info add rsa_private_key varchar(100); +alter table rp_user_pay_info add rsa_public_key varchar(100); + +-- 2016.9.5 增加登录信息字段 +alter table rp_user_info add mobile varchar(15); +alter table rp_user_info add password varchar(50); + +-- 2017.4.4 用户信息表增加支付密码字段 +alter table rp_user_info add pay_pwd varchar(50) comment '支付密码' default '123456'; diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/account/entity/RpSettRecord.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/account/entity/RpSettRecord.java index 4add18b..0d80791 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/account/entity/RpSettRecord.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/account/entity/RpSettRecord.java @@ -1,552 +1,557 @@ -/* - * Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.roncoo.pay.account.entity; - -import java.math.BigDecimal; -import java.util.Date; - -import com.roncoo.pay.account.enums.SettModeTypeEnum; -import com.roncoo.pay.account.enums.SettRecordStatusEnum; -import com.roncoo.pay.common.core.entity.BaseEntity; -import com.roncoo.pay.user.enums.BankAccountTypeEnum; - -/** - * 结算记录 - * 龙果学院:www.roncoo.com - * @author:zenghao - */ -public class RpSettRecord extends BaseEntity { - /** - * 序列化 - */ - private static final long serialVersionUID = -507346932227359104L; - - /** 结算发起方式(参考 SettModeTypeEnum) **/ - private String settMode; - - /** 账户编号 **/ - private String accountNo; - - /** 用户编号 **/ - private String userNo; - - /** 用户类型 **/ - private String userType; - - /** 用户姓名 **/ - private String userName; - - /** 结算日期 **/ - private Date settDate; - - /** 银行编码 **/ - private String bankCode; - - /** 银行名称 **/ - private String bankName; - - /** 开户名 **/ - private String bankAccountName; - - /** 开户账户 **/ - private String bankAccountNo; - - /** 开户银行卡类型 **/ - private String bankAccountType; - - /** 开户行所在国家 **/ - private String country; - - /** 开户行所在省份 **/ - private String province; - - /** 开户行所在城市 **/ - private String city; - - /** 开户行所在区域 **/ - private String areas; - - /** 开户行全称 **/ - private String bankAccountAddress; - - /** 收款人手机号 **/ - private String mobileNo; - - /** 结算金额 **/ - private BigDecimal settAmount = BigDecimal.ZERO; - - /** 结算手续费 **/ - private BigDecimal settFee = BigDecimal.ZERO; - - /** 结算打款金额 **/ - private BigDecimal remitAmount = BigDecimal.ZERO; - - /** 结算状态(参考枚举:SettRecordStatusEnum) **/ - private String settStatus; - - /** 打款发送时间 **/ - private Date remitRequestTime; - - /** 打款确认时间 **/ - private Date remitConfirmTime; - - /** 打款备注 **/ - private String remitRemark; - - /** 操作员登录名 **/ - private String operatorLoginname; - - /** 操作员姓名 **/ - private String operatorRealname; - - /** - * 结算发起方式(参考SettModeTypeEnum) - * - * @return - */ - public String getSettMode() { - return settMode; - } - - /** - * 结算发起方式(参考SettModeTypeEnum) - */ - public void setSettMode(String settMode) { - this.settMode = settMode; - } - - public String getSettModeDesc(){ - return SettModeTypeEnum.getEnum(this.getSettMode()).getDesc(); - } - - /** 收款人手机号 **/ - public String getMobileNo() { - return mobileNo; - } - - /** 收款人手机号 **/ - public void setMobileNo(String mobileNo) { - this.mobileNo = mobileNo; - } - - /** - * 账户编号 - * - * @return - */ - public String getAccountNo() { - return accountNo; - } - - /** - * 账户编号 - * - * @param accountNo - */ - public void setAccountNo(String accountNo) { - this.accountNo = accountNo == null ? null : accountNo.trim(); - } - - /** - * userType - * - * @return the userType - * @since 1.0 - */ - - public String getUserType() { - return userType; - } - - /** - * @param userType - * the userType to set - */ - public void setUserType(String userType) { - this.userType = userType; - } - - /** - * 用户编号 - * - * @return - */ - public String getUserNo() { - return userNo; - } - - /** - * 用户编号 - * - * @param userNo - */ - public void setUserNo(String userNo) { - this.userNo = userNo == null ? null : userNo.trim(); - } - - /** - * 用户姓名 - * - * @return - */ - public String getUserName() { - return userName; - } - - /** - * 用户姓名 - * - * @param userName - */ - public void setUserName(String userName) { - this.userName = userName == null ? null : userName.trim(); - } - - /** - * 结算日期 - * - * @return - */ - public Date getSettDate() { - return settDate; - } - - /** - * 结算日期 - * - * @param settDate - */ - public void setSettDate(Date settDate) { - this.settDate = settDate; - } - - /** - * 银行编码 - * - * @return - */ - public String getBankCode() { - return bankCode; - } - - /** - * 银行编码 - * - * @param bankCode - */ - public void setBankCode(String bankCode) { - this.bankCode = bankCode == null ? null : bankCode.trim(); - } - - public String getBankName() { - return bankName; - } - - public void setBankName(String bankName) { - this.bankName = bankName; - } - - /** - * 开户名 - * - * @return - */ - public String getBankAccountName() { - return bankAccountName; - } - - /** - * 开户名 - * - * @param bankAccountName - */ - public void setBankAccountName(String bankAccountName) { - this.bankAccountName = bankAccountName == null ? null : bankAccountName.trim(); - } - - /** - * 开户账户 - * - * @return - */ - public String getBankAccountNo() { - return bankAccountNo; - } - - /** - * 开户账户 - * - * @param bankAccountNo - */ - public void setBankAccountNo(String bankAccountNo) { - this.bankAccountNo = bankAccountNo == null ? null : bankAccountNo.trim(); - } - - /** 开户银行卡类型 **/ - public String getBankAccountType() { - return bankAccountType; - } - - /** 开户银行卡类型 **/ - public void setBankAccountType(String bankAccountType) { - this.bankAccountType = bankAccountType; - } - - public String getBankAccountTypeDesc(){ - return BankAccountTypeEnum.getEnum(this.getBankAccountType()).getDesc(); - } - - /** - * 开户行所在国家 - * - * @return - */ - public String getCountry() { - return country; - } - - /** - * 开户行所在国家 - * - * @param country - */ - public void setCountry(String country) { - this.country = country == null ? null : country.trim(); - } - - /** - * 开户行所在省份 - * - * @return - */ - public String getProvince() { - return province; - } - - /** - * 开户行所在省份 - * - * @param province - */ - public void setProvince(String province) { - this.province = province == null ? null : province.trim(); - } - - /** - * 开户行所在城市 - * - * @return - */ - public String getCity() { - return city; - } - - /** - * 开户行所在城市 - * - * @param city - */ - public void setCity(String city) { - this.city = city == null ? null : city.trim(); - } - - /** 开户行所在区域 **/ - public String getAreas() { - return areas; - } - - /** 开户行所在区域 **/ - public void setAreas(String areas) { - this.areas = areas == null ? null : areas.trim(); - } - - /** - * 开户行全称 - * - * @return - */ - public String getBankAccountAddress() { - return bankAccountAddress; - } - - /** - * 开户行全称 - * - * @param bankAccountAddress - */ - public void setBankAccountAddress(String bankAccountAddress) { - this.bankAccountAddress = bankAccountAddress == null ? null : bankAccountAddress.trim(); - } - - /** - * 结算金额 - * - * @return - */ - public BigDecimal getSettAmount() { - return settAmount; - } - - /** - * 结算金额 - * - * @param settAmount - */ - public void setSettAmount(BigDecimal settAmount) { - this.settAmount = settAmount; - } - - /** - * 结算手续费 - * - * @return - */ - public BigDecimal getSettFee() { - return settFee; - } - - /** - * 结算手续费 - * - * @param settFee - */ - public void setSettFee(BigDecimal settFee) { - this.settFee = settFee; - } - - /** - * 结算打款金额 - * - * @return - */ - public BigDecimal getRemitAmount() { - return remitAmount; - } - - /** - * 结算打款金额 - * - * @param remitAmount - */ - public void setRemitAmount(BigDecimal remitAmount) { - this.remitAmount = remitAmount; - } - - /** 结算状态(参考枚举:SettRecordStatusEnum) **/ - public String getSettStatus() { - return settStatus; - } - - /** 结算状态(参考枚举:SettRecordStatusEnum) **/ - public void setSettStatus(String settStatus) { - this.settStatus = settStatus; - } - - /** - * 打款发送时间 - * - * @return - */ - public Date getRemitRequestTime() { - return remitRequestTime; - } - - /** - * 打款发送时间 - * - * @param remitRequestTime - */ - public void setRemitRequestTime(Date remitRequestTime) { - this.remitRequestTime = remitRequestTime; - } - - /** - * 打款确认时间 - * - * @return - */ - public Date getRemitConfirmTime() { - return remitConfirmTime; - } - - /** - * 打款确认时间 - * - * @param remitConfirmTime - */ - public void setRemitConfirmTime(Date remitConfirmTime) { - this.remitConfirmTime = remitConfirmTime; - } - - /** - * 打款备注 - * - * @return - */ - public String getRemitRemark() { - return remitRemark; - } - - /** - * 打款备注 - * - * @param remitRemark - */ - public void setRemitRemark(String remitRemark) { - this.remitRemark = remitRemark == null ? null : remitRemark.trim(); - } - - /** - * 操作员登录名 - * - * @return - */ - public String getOperatorLoginname() { - return operatorLoginname; - } - - /** - * 操作员登录名 - * - * @param operatorLoginname - */ - public void setOperatorLoginname(String operatorLoginname) { - this.operatorLoginname = operatorLoginname == null ? null : operatorLoginname.trim(); - } - - /** - * 操作员姓名 - * - * @return - */ - public String getOperatorRealname() { - return operatorRealname; - } - - /** - * 操作员姓名 - * - * @param operatorRealname - */ - public void setOperatorRealname(String operatorRealname) { - this.operatorRealname = operatorRealname == null ? null : operatorRealname.trim(); - } - - public String getSettStatusDesc() { - return SettRecordStatusEnum.getEnum(this.getSettStatus()).getDesc(); - } - +/* + * Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.roncoo.pay.account.entity; + +import java.math.BigDecimal; +import java.util.Date; + +import com.roncoo.pay.account.enums.SettModeTypeEnum; +import com.roncoo.pay.account.enums.SettRecordStatusEnum; +import com.roncoo.pay.common.core.entity.BaseEntity; +import com.roncoo.pay.common.core.utils.DateUtils; +import com.roncoo.pay.user.enums.BankAccountTypeEnum; + +/** + * 结算记录 + * 龙果学院:www.roncoo.com + * @author:zenghao + */ +public class RpSettRecord extends BaseEntity { + /** + * 序列化 + */ + private static final long serialVersionUID = -507346932227359104L; + + /** 结算发起方式(参考 SettModeTypeEnum) **/ + private String settMode; + + /** 账户编号 **/ + private String accountNo; + + /** 用户编号 **/ + private String userNo; + + /** 用户类型 **/ + private String userType; + + /** 用户姓名 **/ + private String userName; + + /** 结算日期 **/ + private Date settDate; + + /** 银行编码 **/ + private String bankCode; + + /** 银行名称 **/ + private String bankName; + + /** 开户名 **/ + private String bankAccountName; + + /** 开户账户 **/ + private String bankAccountNo; + + /** 开户银行卡类型 **/ + private String bankAccountType; + + /** 开户行所在国家 **/ + private String country; + + /** 开户行所在省份 **/ + private String province; + + /** 开户行所在城市 **/ + private String city; + + /** 开户行所在区域 **/ + private String areas; + + /** 开户行全称 **/ + private String bankAccountAddress; + + /** 收款人手机号 **/ + private String mobileNo; + + /** 结算金额 **/ + private BigDecimal settAmount = BigDecimal.ZERO; + + /** 结算手续费 **/ + private BigDecimal settFee = BigDecimal.ZERO; + + /** 结算打款金额 **/ + private BigDecimal remitAmount = BigDecimal.ZERO; + + /** 结算状态(参考枚举:SettRecordStatusEnum) **/ + private String settStatus; + + /** 打款发送时间 **/ + private Date remitRequestTime; + + /** 打款确认时间 **/ + private Date remitConfirmTime; + + /** 打款备注 **/ + private String remitRemark; + + /** 操作员登录名 **/ + private String operatorLoginname; + + /** 操作员姓名 **/ + private String operatorRealname; + + /** + * 结算发起方式(参考SettModeTypeEnum) + * + * @return + */ + public String getSettMode() { + return settMode; + } + + /** + * 结算发起方式(参考SettModeTypeEnum) + */ + public void setSettMode(String settMode) { + this.settMode = settMode; + } + + public String getSettModeDesc(){ + return SettModeTypeEnum.getEnum(this.getSettMode()).getDesc(); + } + + /** 收款人手机号 **/ + public String getMobileNo() { + return mobileNo; + } + + /** 收款人手机号 **/ + public void setMobileNo(String mobileNo) { + this.mobileNo = mobileNo; + } + + /** + * 账户编号 + * + * @return + */ + public String getAccountNo() { + return accountNo; + } + + /** + * 账户编号 + * + * @param accountNo + */ + public void setAccountNo(String accountNo) { + this.accountNo = accountNo == null ? null : accountNo.trim(); + } + + /** + * userType + * + * @return the userType + * @since 1.0 + */ + + public String getUserType() { + return userType; + } + + /** + * @param userType + * the userType to set + */ + public void setUserType(String userType) { + this.userType = userType; + } + + /** + * 用户编号 + * + * @return + */ + public String getUserNo() { + return userNo; + } + + /** + * 用户编号 + * + * @param userNo + */ + public void setUserNo(String userNo) { + this.userNo = userNo == null ? null : userNo.trim(); + } + + /** + * 用户姓名 + * + * @return + */ + public String getUserName() { + return userName; + } + + /** + * 用户姓名 + * + * @param userName + */ + public void setUserName(String userName) { + this.userName = userName == null ? null : userName.trim(); + } + + /** + * 结算日期 + * + * @return + */ + public Date getSettDate() { + return settDate; + } + + /** + * 结算日期 + * + * @param settDate + */ + public void setSettDate(Date settDate) { + this.settDate = settDate; + } + + /** + * 银行编码 + * + * @return + */ + public String getBankCode() { + return bankCode; + } + + /** + * 银行编码 + * + * @param bankCode + */ + public void setBankCode(String bankCode) { + this.bankCode = bankCode == null ? null : bankCode.trim(); + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + /** + * 开户名 + * + * @return + */ + public String getBankAccountName() { + return bankAccountName; + } + + /** + * 开户名 + * + * @param bankAccountName + */ + public void setBankAccountName(String bankAccountName) { + this.bankAccountName = bankAccountName == null ? null : bankAccountName.trim(); + } + + /** + * 开户账户 + * + * @return + */ + public String getBankAccountNo() { + return bankAccountNo; + } + + /** + * 开户账户 + * + * @param bankAccountNo + */ + public void setBankAccountNo(String bankAccountNo) { + this.bankAccountNo = bankAccountNo == null ? null : bankAccountNo.trim(); + } + + /** 开户银行卡类型 **/ + public String getBankAccountType() { + return bankAccountType; + } + + /** 开户银行卡类型 **/ + public void setBankAccountType(String bankAccountType) { + this.bankAccountType = bankAccountType; + } + + public String getBankAccountTypeDesc(){ + return BankAccountTypeEnum.getEnum(this.getBankAccountType()).getDesc(); + } + + /** + * 开户行所在国家 + * + * @return + */ + public String getCountry() { + return country; + } + + /** + * 开户行所在国家 + * + * @param country + */ + public void setCountry(String country) { + this.country = country == null ? null : country.trim(); + } + + /** + * 开户行所在省份 + * + * @return + */ + public String getProvince() { + return province; + } + + /** + * 开户行所在省份 + * + * @param province + */ + public void setProvince(String province) { + this.province = province == null ? null : province.trim(); + } + + /** + * 开户行所在城市 + * + * @return + */ + public String getCity() { + return city; + } + + /** + * 开户行所在城市 + * + * @param city + */ + public void setCity(String city) { + this.city = city == null ? null : city.trim(); + } + + /** 开户行所在区域 **/ + public String getAreas() { + return areas; + } + + /** 开户行所在区域 **/ + public void setAreas(String areas) { + this.areas = areas == null ? null : areas.trim(); + } + + /** + * 开户行全称 + * + * @return + */ + public String getBankAccountAddress() { + return bankAccountAddress; + } + + /** + * 开户行全称 + * + * @param bankAccountAddress + */ + public void setBankAccountAddress(String bankAccountAddress) { + this.bankAccountAddress = bankAccountAddress == null ? null : bankAccountAddress.trim(); + } + + /** + * 结算金额 + * + * @return + */ + public BigDecimal getSettAmount() { + return settAmount; + } + + /** + * 结算金额 + * + * @param settAmount + */ + public void setSettAmount(BigDecimal settAmount) { + this.settAmount = settAmount; + } + + /** + * 结算手续费 + * + * @return + */ + public BigDecimal getSettFee() { + return settFee; + } + + /** + * 结算手续费 + * + * @param settFee + */ + public void setSettFee(BigDecimal settFee) { + this.settFee = settFee; + } + + /** + * 结算打款金额 + * + * @return + */ + public BigDecimal getRemitAmount() { + return remitAmount; + } + + /** + * 结算打款金额 + * + * @param remitAmount + */ + public void setRemitAmount(BigDecimal remitAmount) { + this.remitAmount = remitAmount; + } + + /** 结算状态(参考枚举:SettRecordStatusEnum) **/ + public String getSettStatus() { + return settStatus; + } + + /** 结算状态(参考枚举:SettRecordStatusEnum) **/ + public void setSettStatus(String settStatus) { + this.settStatus = settStatus; + } + + /** + * 打款发送时间 + * + * @return + */ + public Date getRemitRequestTime() { + return remitRequestTime; + } + + /** + * 打款发送时间 + * + * @param remitRequestTime + */ + public void setRemitRequestTime(Date remitRequestTime) { + this.remitRequestTime = remitRequestTime; + } + + /** + * 打款确认时间 + * + * @return + */ + public Date getRemitConfirmTime() { + return remitConfirmTime; + } + + /** + * 打款确认时间 + * + * @param remitConfirmTime + */ + public void setRemitConfirmTime(Date remitConfirmTime) { + this.remitConfirmTime = remitConfirmTime; + } + + /** + * 打款备注 + * + * @return + */ + public String getRemitRemark() { + return remitRemark; + } + + /** + * 打款备注 + * + * @param remitRemark + */ + public void setRemitRemark(String remitRemark) { + this.remitRemark = remitRemark == null ? null : remitRemark.trim(); + } + + /** + * 操作员登录名 + * + * @return + */ + public String getOperatorLoginname() { + return operatorLoginname; + } + + /** + * 操作员登录名 + * + * @param operatorLoginname + */ + public void setOperatorLoginname(String operatorLoginname) { + this.operatorLoginname = operatorLoginname == null ? null : operatorLoginname.trim(); + } + + /** + * 操作员姓名 + * + * @return + */ + public String getOperatorRealname() { + return operatorRealname; + } + + /** + * 操作员姓名 + * + * @param operatorRealname + */ + public void setOperatorRealname(String operatorRealname) { + this.operatorRealname = operatorRealname == null ? null : operatorRealname.trim(); + } + + public String getSettStatusDesc() { + return SettRecordStatusEnum.getEnum(this.getSettStatus()).getDesc(); + } + + public String getCreateTimeDesc() { + return DateUtils.formatDate(this.getCreateTime(), "yyyy-MM-dd HH:mm:ss"); + } + } \ No newline at end of file diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/user/entity/RpUserInfo.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/user/entity/RpUserInfo.java index 1a9fc7c..8eea3d1 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/user/entity/RpUserInfo.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/user/entity/RpUserInfo.java @@ -1,87 +1,96 @@ -/* - * Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.roncoo.pay.user.entity; - -import java.io.Serializable; - -import com.roncoo.pay.common.core.entity.BaseEntity; -import com.roncoo.pay.common.core.enums.PublicStatusEnum; - -/** - * 用户信息 - * 龙果学院:www.roncoo.com - * @author:zenghao - */ -public class RpUserInfo extends BaseEntity implements Serializable { - - private String userNo; - - private String userName; - - private String accountNo; - - private static final long serialVersionUID = 1L; - - private String mobile; - - private String password; - - - public String getMobile() { - return mobile; - } - - public void setMobile(String mobile) { - this.mobile = mobile; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getUserNo() { - return userNo; - } - - public void setUserNo(String userNo) { - this.userNo = userNo == null ? null : userNo.trim(); - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName == null ? null : userName.trim(); - } - - public String getAccountNo() { - return accountNo; - } - - public void setAccountNo(String accountNo) { - this.accountNo = accountNo == null ? null : accountNo.trim(); - } - - public String getStatusDesc() { - return PublicStatusEnum.getEnum(this.getStatus()).getDesc(); - } - +/* + * Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.roncoo.pay.user.entity; + +import java.io.Serializable; + +import com.roncoo.pay.common.core.entity.BaseEntity; +import com.roncoo.pay.common.core.enums.PublicStatusEnum; + +/** + * 用户信息 + * 龙果学院:www.roncoo.com + * @author:zenghao + */ +public class RpUserInfo extends BaseEntity implements Serializable { + + private String userNo; + + private String userName; + + private String accountNo; + + private static final long serialVersionUID = 1L; + + private String mobile; + + private String password; + /** 支付密码 */ + private String payPwd; + + public String getPayPwd() { + return payPwd; + } + + public void setPayPwd(String payPwd) { + this.payPwd = payPwd; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getUserNo() { + return userNo; + } + + public void setUserNo(String userNo) { + this.userNo = userNo == null ? null : userNo.trim(); + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName == null ? null : userName.trim(); + } + + public String getAccountNo() { + return accountNo; + } + + public void setAccountNo(String accountNo) { + this.accountNo = accountNo == null ? null : accountNo.trim(); + } + + public String getStatusDesc() { + return PublicStatusEnum.getEnum(this.getStatus()).getDesc(); + } + } \ No newline at end of file diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/user/service/impl/RpUserInfoServiceImpl.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/user/service/impl/RpUserInfoServiceImpl.java index f382cbf..617f97c 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/user/service/impl/RpUserInfoServiceImpl.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/user/service/impl/RpUserInfoServiceImpl.java @@ -1,166 +1,167 @@ -/* - * Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.roncoo.pay.user.service.impl; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.roncoo.pay.account.entity.RpAccount; -import com.roncoo.pay.account.service.RpAccountService; -import com.roncoo.pay.common.core.enums.PublicStatusEnum; -import com.roncoo.pay.common.core.page.PageBean; -import com.roncoo.pay.common.core.page.PageParam; -import com.roncoo.pay.common.core.utils.EncryptUtil; -import com.roncoo.pay.common.core.utils.StringUtil; -import com.roncoo.pay.user.dao.RpUserInfoDao; -import com.roncoo.pay.user.entity.RpUserInfo; -import com.roncoo.pay.user.service.BuildNoService; -import com.roncoo.pay.user.service.RpUserInfoService; - -/** - * 用户信息service实现类 - * 龙果学院:www.roncoo.com - * @author:zenghao - */ -@Service("rpUserInfoService") -public class RpUserInfoServiceImpl implements RpUserInfoService{ - - @Autowired - private RpUserInfoDao rpUserInfoDao; - - @Autowired - private BuildNoService buildNoService; - - @Autowired - private RpAccountService rpAccountService; - - @Override - public void saveData(RpUserInfo rpUserInfo) { - rpUserInfoDao.insert(rpUserInfo); - } - - @Override - public void updateData(RpUserInfo rpUserInfo) { - rpUserInfoDao.update(rpUserInfo); - } - - @Override - public RpUserInfo getDataById(String id) { - return rpUserInfoDao.getById(id); - } - - @Override - public PageBean listPage(PageParam pageParam, RpUserInfo rpUserInfo) { - Map paramMap = new HashMap(); - paramMap.put("userNo", rpUserInfo.getUserNo()); - return rpUserInfoDao.listPage(pageParam, paramMap); - } - - /** - * 用户线下注册 - * - * @param userName - * 用户名 - * @param mobile - * 手机号 - * @param password - * 密码 - * @return - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void registerOffline(String userName, String mobile, String password) { - String userNo = buildNoService.buildUserNo(); - String accountNo = buildNoService.buildAccountNo(); - - //生成用户信息 - RpUserInfo rpUserInfo = new RpUserInfo(); - rpUserInfo.setAccountNo(accountNo); - rpUserInfo.setCreateTime(new Date()); - rpUserInfo.setId(StringUtil.get32UUID()); - rpUserInfo.setStatus(PublicStatusEnum.ACTIVE.name()); - rpUserInfo.setUserName(userName); - rpUserInfo.setUserNo(userNo); - rpUserInfo.setMobile(mobile); - rpUserInfo.setPassword(EncryptUtil.encodeMD5String(password)); - rpUserInfo.setVersion(0); - this.saveData(rpUserInfo); - - // 生成账户信息 - RpAccount rpAccount = new RpAccount(); - rpAccount.setAccountNo(accountNo); - rpAccount.setAccountType("0"); - rpAccount.setCreateTime(new Date()); - rpAccount.setEditTime(new Date()); - rpAccount.setId(StringUtil.get32UUID()); - rpAccount.setStatus(PublicStatusEnum.ACTIVE.name()); - rpAccount.setUserNo(userNo); - rpAccount.setBalance(new BigDecimal("0")); - rpAccount.setSecurityMoney(new BigDecimal("0")); - rpAccount.setSettAmount(new BigDecimal("0")); - rpAccount.setTodayExpend(new BigDecimal("0")); - rpAccount.setTodayIncome(new BigDecimal("0")); - rpAccount.setUnbalance(new BigDecimal("0")); - rpAccount.setTotalExpend(new BigDecimal("0")); - rpAccount.setTotalIncome(new BigDecimal("0")); - rpAccountService.saveData(rpAccount); - } - - /** - * 根据商户编号获取商户信息 - * - * @param merchantNo - * @return - */ - @Override - public RpUserInfo getDataByMerchentNo(String merchantNo) { - Map paramMap = new HashMap(); - paramMap.put("userNo", merchantNo); - paramMap.put("status", PublicStatusEnum.ACTIVE.name()); - return rpUserInfoDao.getBy(paramMap); - } - - /** - * 根据手机号获取商户信息 - * @param mobile - * @return - */ - @Override - public RpUserInfo getDataByMobile(String mobile){ - Map paramMap = new HashMap(); - paramMap.put("mobile", mobile); - paramMap.put("status", PublicStatusEnum.ACTIVE.name()); - return rpUserInfoDao.getBy(paramMap); - } - - /** - * 获取所有用户 - * @return - */ - @Override - public List listAll(){ - Map paramMap = new HashMap(); - paramMap.put("status", PublicStatusEnum.ACTIVE.name()); - return rpUserInfoDao.listBy(paramMap); - } +/* + * Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.roncoo.pay.user.service.impl; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.roncoo.pay.account.entity.RpAccount; +import com.roncoo.pay.account.service.RpAccountService; +import com.roncoo.pay.common.core.enums.PublicStatusEnum; +import com.roncoo.pay.common.core.page.PageBean; +import com.roncoo.pay.common.core.page.PageParam; +import com.roncoo.pay.common.core.utils.EncryptUtil; +import com.roncoo.pay.common.core.utils.StringUtil; +import com.roncoo.pay.user.dao.RpUserInfoDao; +import com.roncoo.pay.user.entity.RpUserInfo; +import com.roncoo.pay.user.service.BuildNoService; +import com.roncoo.pay.user.service.RpUserInfoService; + +/** + * 用户信息service实现类 + * 龙果学院:www.roncoo.com + * @author:zenghao + */ +@Service("rpUserInfoService") +public class RpUserInfoServiceImpl implements RpUserInfoService{ + + @Autowired + private RpUserInfoDao rpUserInfoDao; + + @Autowired + private BuildNoService buildNoService; + + @Autowired + private RpAccountService rpAccountService; + + @Override + public void saveData(RpUserInfo rpUserInfo) { + rpUserInfoDao.insert(rpUserInfo); + } + + @Override + public void updateData(RpUserInfo rpUserInfo) { + rpUserInfoDao.update(rpUserInfo); + } + + @Override + public RpUserInfo getDataById(String id) { + return rpUserInfoDao.getById(id); + } + + @Override + public PageBean listPage(PageParam pageParam, RpUserInfo rpUserInfo) { + Map paramMap = new HashMap(); + paramMap.put("userNo", rpUserInfo.getUserNo()); + return rpUserInfoDao.listPage(pageParam, paramMap); + } + + /** + * 用户线下注册 + * + * @param userName + * 用户名 + * @param mobile + * 手机号 + * @param password + * 密码 + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void registerOffline(String userName, String mobile, String password) { + String userNo = buildNoService.buildUserNo(); + String accountNo = buildNoService.buildAccountNo(); + + //生成用户信息 + RpUserInfo rpUserInfo = new RpUserInfo(); + rpUserInfo.setAccountNo(accountNo); + rpUserInfo.setCreateTime(new Date()); + rpUserInfo.setId(StringUtil.get32UUID()); + rpUserInfo.setStatus(PublicStatusEnum.ACTIVE.name()); + rpUserInfo.setUserName(userName); + rpUserInfo.setUserNo(userNo); + rpUserInfo.setMobile(mobile); + rpUserInfo.setPassword(EncryptUtil.encodeMD5String(password)); + rpUserInfo.setPayPwd(EncryptUtil.encodeMD5String("123456")); + rpUserInfo.setVersion(0); + this.saveData(rpUserInfo); + + // 生成账户信息 + RpAccount rpAccount = new RpAccount(); + rpAccount.setAccountNo(accountNo); + rpAccount.setAccountType("0"); + rpAccount.setCreateTime(new Date()); + rpAccount.setEditTime(new Date()); + rpAccount.setId(StringUtil.get32UUID()); + rpAccount.setStatus(PublicStatusEnum.ACTIVE.name()); + rpAccount.setUserNo(userNo); + rpAccount.setBalance(new BigDecimal("0")); + rpAccount.setSecurityMoney(new BigDecimal("0")); + rpAccount.setSettAmount(new BigDecimal("0")); + rpAccount.setTodayExpend(new BigDecimal("0")); + rpAccount.setTodayIncome(new BigDecimal("0")); + rpAccount.setUnbalance(new BigDecimal("0")); + rpAccount.setTotalExpend(new BigDecimal("0")); + rpAccount.setTotalIncome(new BigDecimal("0")); + rpAccountService.saveData(rpAccount); + } + + /** + * 根据商户编号获取商户信息 + * + * @param merchantNo + * @return + */ + @Override + public RpUserInfo getDataByMerchentNo(String merchantNo) { + Map paramMap = new HashMap(); + paramMap.put("userNo", merchantNo); + paramMap.put("status", PublicStatusEnum.ACTIVE.name()); + return rpUserInfoDao.getBy(paramMap); + } + + /** + * 根据手机号获取商户信息 + * @param mobile + * @return + */ + @Override + public RpUserInfo getDataByMobile(String mobile){ + Map paramMap = new HashMap(); + paramMap.put("mobile", mobile); + paramMap.put("status", PublicStatusEnum.ACTIVE.name()); + return rpUserInfoDao.getBy(paramMap); + } + + /** + * 获取所有用户 + * @return + */ + @Override + public List listAll(){ + Map paramMap = new HashMap(); + paramMap.put("status", PublicStatusEnum.ACTIVE.name()); + return rpUserInfoDao.listBy(paramMap); + } } \ No newline at end of file diff --git a/roncoo-pay-service/src/main/resources/mybatis/mapper/user/RpUserInfoMapper.xml b/roncoo-pay-service/src/main/resources/mybatis/mapper/user/RpUserInfoMapper.xml index f83906c..faeab2c 100644 --- a/roncoo-pay-service/src/main/resources/mybatis/mapper/user/RpUserInfoMapper.xml +++ b/roncoo-pay-service/src/main/resources/mybatis/mapper/user/RpUserInfoMapper.xml @@ -1,86 +1,89 @@ - - - - - - - - - - - - - - - id, create_time, status, user_no, user_name, account_no - - - - delete from rp_user_info - where id = #{id,jdbcType=VARCHAR} - - - insert into rp_user_info (id, create_time, status, - user_no, user_name, account_no, mobile, password - ) - values (#{id,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, - #{userNo,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{accountNo,jdbcType=VARCHAR}, - #{mobile,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR} - ) - - - - update rp_user_info - set create_time = #{createTime,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=VARCHAR}, - user_no = #{userNo,jdbcType=VARCHAR}, - user_name = #{userName,jdbcType=VARCHAR}, - account_no = #{accountNo,jdbcType=VARCHAR}, - mobile = #{mobile,jdbcType=VARCHAR}, - password = #{password,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - rp_user_info - - - - and status = #{status,jdbcType=VARCHAR} - and user_no = #{userNo,jdbcType=VARCHAR} - and mobile = #{mobile,jdbcType=VARCHAR} - - - - - - - - - + + + + + + + + + + + + + + + + id, create_time, status, user_no, user_name, account_no, mobile, password, pay_pwd + + + + delete from rp_user_info + where id = #{id,jdbcType=VARCHAR} + + + insert into rp_user_info (id, create_time, status, + user_no, user_name, account_no, mobile, password, + pay_pwd + ) + values (#{id,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, + #{userNo,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{accountNo,jdbcType=VARCHAR}, + #{mobile,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},#{payPwd,jdbcType=VARCHAR} + ) + + + + update rp_user_info + set create_time = #{createTime,jdbcType=TIMESTAMP}, + status = #{status,jdbcType=VARCHAR}, + user_no = #{userNo,jdbcType=VARCHAR}, + user_name = #{userName,jdbcType=VARCHAR}, + account_no = #{accountNo,jdbcType=VARCHAR}, + mobile = #{mobile,jdbcType=VARCHAR}, + password = #{password,jdbcType=VARCHAR}, + pay_pwd = #{payPwd,jdbcType=VARCHAR} + where id = #{id,jdbcType=VARCHAR} + + + rp_user_info + + + + and status = #{status,jdbcType=VARCHAR} + and user_no = #{userNo,jdbcType=VARCHAR} + and mobile = #{mobile,jdbcType=VARCHAR} + + + + + + + + + \ No newline at end of file diff --git a/roncoo-pay-web-boss/src/main/webapp/jsp/common/pageBar.jsp b/roncoo-pay-web-boss/src/main/webapp/jsp/common/pageBar.jsp index 5de398a..e2d3cf9 100644 --- a/roncoo-pay-web-boss/src/main/webapp/jsp/common/pageBar.jsp +++ b/roncoo-pay-web-boss/src/main/webapp/jsp/common/pageBar.jsp @@ -1,16 +1,16 @@ -
-
- 显示 - - 条,共${pageBean.totalCount}条, 共${pageBean.totalPage}页, 当前第${pageBean.currentPage}页 -
- +
+
+ 显示 + + 条,共${pageBean.totalCount}条, 共${pageBean.totalPage}页, 当前第${pageBean.currentPage}页 +
+
\ No newline at end of file diff --git a/roncoo-pay-web-merchant/src/main/java/com/roncoo/pay/controller/account/AccountController.java b/roncoo-pay-web-merchant/src/main/java/com/roncoo/pay/controller/account/AccountController.java index 2aee95e..036ffde 100644 --- a/roncoo-pay-web-merchant/src/main/java/com/roncoo/pay/controller/account/AccountController.java +++ b/roncoo-pay-web-merchant/src/main/java/com/roncoo/pay/controller/account/AccountController.java @@ -1,134 +1,150 @@ -/* - * Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.roncoo.pay.controller.account; - -import java.lang.reflect.InvocationTargetException; -import java.util.HashMap; -import java.util.List; -import java.util.ArrayList; - -import javax.servlet.http.HttpServletRequest; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; - -import com.alibaba.fastjson.JSON; -import com.roncoo.pay.account.entity.RpAccount; -import com.roncoo.pay.account.entity.RpAccountHistory; -import com.roncoo.pay.account.service.RpAccountHistoryService; -import com.roncoo.pay.account.service.RpAccountService; -import com.roncoo.pay.common.core.entity.ApiCommonResultVo; -import com.roncoo.pay.common.core.page.PageBean; -import com.roncoo.pay.common.core.page.PageParam; -import com.roncoo.pay.common.core.utils.EncryptUtil; -import com.roncoo.pay.controller.common.BaseController; -import com.roncoo.pay.controller.common.ConstantClass; -import com.roncoo.pay.controller.common.JSONParam; -import com.roncoo.pay.user.entity.RpPayWay; -import com.roncoo.pay.user.entity.RpUserInfo; -import com.roncoo.pay.user.entity.RpUserPayConfig; -import com.roncoo.pay.user.service.RpPayWayService; -import com.roncoo.pay.user.service.RpUserInfoService; -import com.roncoo.pay.user.service.RpUserPayConfigService; - -/** - * 账户信息 - * 龙果学院:www.roncoo.com - * @author zenghao - */ -@Controller -@RequestMapping("/merchant/account") -public class AccountController extends BaseController { - @Autowired - private RpUserPayConfigService rpUserPayConfigService; - @Autowired - private RpAccountService rpAccountService; - @Autowired - private RpPayWayService rpPayWayService; - @Autowired - private RpAccountHistoryService rpAccountHistoryService; - @Autowired - private RpUserInfoService rpUserInfoService; - - /** - * 函数功能说明 : 查询用户信息 - * - * @参数: @return - * @return String - * @throws - */ - @RequestMapping(value = "/getAccountInfo", method ={RequestMethod.POST,RequestMethod.GET}) - public String getAccountInfo(HttpServletRequest request) { - RpUserInfo rpUserInfo = (RpUserInfo)request.getSession().getAttribute(ConstantClass.USER); - String userNo = rpUserInfo.getUserNo(); - RpAccount rpAccount = rpAccountService.getDataByUserNo(userNo); - RpUserPayConfig rpUserPayConfig = rpUserPayConfigService.getByUserNo(userNo); - List rpPayWayList = new ArrayList(); - if(rpUserPayConfig != null){ - rpPayWayList = rpPayWayService.listByProductCode(rpUserPayConfig.getProductCode()); - } - - - request.setAttribute("rpAccount", rpAccount); - request.setAttribute("rpUserPayConfig", rpUserPayConfig); - request.setAttribute("rpPayWayList", rpPayWayList); - return "account/info"; - } - - @RequestMapping(value = "/ajaxAccountInfo", method ={RequestMethod.POST,RequestMethod.GET}) - @ResponseBody - public String ajaxAccountInfo(HttpServletRequest request,@RequestBody JSONParam[] params) throws IllegalAccessException, InvocationTargetException { - RpUserInfo rpUserInfo = (RpUserInfo)request.getSession().getAttribute(ConstantClass.USER); - String userNo = rpUserInfo.getUserNo(); - //convertToMap定义于父类,将参数数组中的所有元素加入一个HashMap - HashMap paramMap = convertToMap(params); - String sEcho = paramMap.get("sEcho"); - int start = Integer.parseInt(paramMap.get("iDisplayStart")); - int length = Integer.parseInt(paramMap.get("iDisplayLength")); - - //customerService.search返回的第一个元素是满足查询条件的记录总数,后面的是 - //页面当前页需要显示的记录数据 - PageParam pageParam = new PageParam(start/length+1, length); - RpAccountHistory rpAccountHistory = new RpAccountHistory(); - rpAccountHistory.setUserNo(userNo); - PageBean pageBean = rpAccountHistoryService.listPage(pageParam, rpAccountHistory); - Long count = Long.valueOf(pageBean.getTotalCount()+""); - - String jsonString = JSON.toJSONString(pageBean.getRecordList()); - String json = "{\"sEcho\":" + sEcho + ",\"iTotalRecords\":" + count.longValue() + ",\"iTotalDisplayRecords\":" + count.longValue() + ",\"aaData\":" + jsonString + "}"; - return json; - } - - @RequestMapping(value = "/savePassword", method ={RequestMethod.POST,RequestMethod.GET}) - @ResponseBody - public ApiCommonResultVo savePassword(HttpServletRequest request) throws IllegalAccessException, InvocationTargetException { - RpUserInfo rpUserInfo = (RpUserInfo)request.getSession().getAttribute(ConstantClass.USER); - String oldPassword = request.getParameter("oldPassword"); - String newPassword = request.getParameter("newPassword"); - if(!EncryptUtil.encodeMD5String(oldPassword).equals(rpUserInfo.getPassword())){ - return new ApiCommonResultVo(-1, "操作失败,密码错误", ""); - }else{ - rpUserInfo.setPassword(EncryptUtil.encodeMD5String(newPassword)); - rpUserInfoService.updateData(rpUserInfo); - request.getSession().setAttribute(ConstantClass.USER, rpUserInfo); - return new ApiCommonResultVo(0, "操作成功", ""); - } - } -} +/* + * Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.roncoo.pay.controller.account; + +import java.lang.reflect.InvocationTargetException; +import java.util.HashMap; +import java.util.List; +import java.util.ArrayList; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSON; +import com.roncoo.pay.account.entity.RpAccount; +import com.roncoo.pay.account.entity.RpAccountHistory; +import com.roncoo.pay.account.service.RpAccountHistoryService; +import com.roncoo.pay.account.service.RpAccountService; +import com.roncoo.pay.common.core.entity.ApiCommonResultVo; +import com.roncoo.pay.common.core.page.PageBean; +import com.roncoo.pay.common.core.page.PageParam; +import com.roncoo.pay.common.core.utils.EncryptUtil; +import com.roncoo.pay.controller.common.BaseController; +import com.roncoo.pay.controller.common.ConstantClass; +import com.roncoo.pay.controller.common.JSONParam; +import com.roncoo.pay.user.entity.RpPayWay; +import com.roncoo.pay.user.entity.RpUserInfo; +import com.roncoo.pay.user.entity.RpUserPayConfig; +import com.roncoo.pay.user.service.RpPayWayService; +import com.roncoo.pay.user.service.RpUserInfoService; +import com.roncoo.pay.user.service.RpUserPayConfigService; + +/** + * 账户信息 + * 龙果学院:www.roncoo.com + * @author zenghao + */ +@Controller +@RequestMapping("/merchant/account") +public class AccountController extends BaseController { + @Autowired + private RpUserPayConfigService rpUserPayConfigService; + @Autowired + private RpAccountService rpAccountService; + @Autowired + private RpPayWayService rpPayWayService; + @Autowired + private RpAccountHistoryService rpAccountHistoryService; + @Autowired + private RpUserInfoService rpUserInfoService; + + /** + * 函数功能说明 : 查询用户信息 + * + * @参数: @return + * @return String + * @throws + */ + @RequestMapping(value = "/getAccountInfo", method ={RequestMethod.POST,RequestMethod.GET}) + public String getAccountInfo(HttpServletRequest request) { + RpUserInfo rpUserInfo = (RpUserInfo)request.getSession().getAttribute(ConstantClass.USER); + String userNo = rpUserInfo.getUserNo(); + RpAccount rpAccount = rpAccountService.getDataByUserNo(userNo); + RpUserPayConfig rpUserPayConfig = rpUserPayConfigService.getByUserNo(userNo); + List rpPayWayList = new ArrayList(); + if(rpUserPayConfig != null){ + rpPayWayList = rpPayWayService.listByProductCode(rpUserPayConfig.getProductCode()); + } + + + request.setAttribute("rpAccount", rpAccount); + request.setAttribute("rpUserPayConfig", rpUserPayConfig); + request.setAttribute("rpPayWayList", rpPayWayList); + return "account/info"; + } + + @RequestMapping(value = "/ajaxAccountInfo", method ={RequestMethod.POST,RequestMethod.GET}) + @ResponseBody + public String ajaxAccountInfo(HttpServletRequest request,@RequestBody JSONParam[] params) throws IllegalAccessException, InvocationTargetException { + RpUserInfo rpUserInfo = (RpUserInfo)request.getSession().getAttribute(ConstantClass.USER); + String userNo = rpUserInfo.getUserNo(); + //convertToMap定义于父类,将参数数组中的所有元素加入一个HashMap + HashMap paramMap = convertToMap(params); + String sEcho = paramMap.get("sEcho"); + int start = Integer.parseInt(paramMap.get("iDisplayStart")); + int length = Integer.parseInt(paramMap.get("iDisplayLength")); + + //customerService.search返回的第一个元素是满足查询条件的记录总数,后面的是 + //页面当前页需要显示的记录数据 + PageParam pageParam = new PageParam(start/length+1, length); + RpAccountHistory rpAccountHistory = new RpAccountHistory(); + rpAccountHistory.setUserNo(userNo); + PageBean pageBean = rpAccountHistoryService.listPage(pageParam, rpAccountHistory); + Long count = Long.valueOf(pageBean.getTotalCount()+""); + + String jsonString = JSON.toJSONString(pageBean.getRecordList()); + String json = "{\"sEcho\":" + sEcho + ",\"iTotalRecords\":" + count.longValue() + ",\"iTotalDisplayRecords\":" + count.longValue() + ",\"aaData\":" + jsonString + "}"; + return json; + } + + @RequestMapping(value = "/savePassword", method ={RequestMethod.POST,RequestMethod.GET}) + @ResponseBody + public ApiCommonResultVo savePassword(HttpServletRequest request) throws IllegalAccessException, InvocationTargetException { + RpUserInfo rpUserInfo = (RpUserInfo)request.getSession().getAttribute(ConstantClass.USER); + String oldPassword = request.getParameter("oldPassword"); + String newPassword = request.getParameter("newPassword"); + if(!EncryptUtil.encodeMD5String(oldPassword).equals(rpUserInfo.getPassword())){ + return new ApiCommonResultVo(-1, "操作失败,密码错误", ""); + }else{ + rpUserInfo.setPassword(EncryptUtil.encodeMD5String(newPassword)); + rpUserInfoService.updateData(rpUserInfo); + request.getSession().setAttribute(ConstantClass.USER, rpUserInfo); + return new ApiCommonResultVo(0, "操作成功", ""); + } + } + + @RequestMapping(value = "/savePayPass", method = { RequestMethod.POST, RequestMethod.GET }) + @ResponseBody + public ApiCommonResultVo savePayPass(HttpServletRequest request) throws IllegalAccessException, InvocationTargetException { + RpUserInfo rpUserInfo = (RpUserInfo) request.getSession().getAttribute(ConstantClass.USER); + String oldPayPass = request.getParameter("oldPayPass"); + String newPayPass = request.getParameter("newPayPass"); + if (!EncryptUtil.encodeMD5String(oldPayPass).equals(rpUserInfo.getPayPwd())) { + return new ApiCommonResultVo(-1, "操作失败,原支付密码错误", ""); + } else { + rpUserInfo.setPayPwd(EncryptUtil.encodeMD5String(newPayPass)); + rpUserInfoService.updateData(rpUserInfo); + request.getSession().setAttribute(ConstantClass.USER, rpUserInfo); + return new ApiCommonResultVo(0, "操作成功", ""); + } + } +} diff --git a/roncoo-pay-web-merchant/src/main/java/com/roncoo/pay/controller/sett/SettController.java b/roncoo-pay-web-merchant/src/main/java/com/roncoo/pay/controller/sett/SettController.java new file mode 100644 index 0000000..1e47da4 --- /dev/null +++ b/roncoo-pay-web-merchant/src/main/java/com/roncoo/pay/controller/sett/SettController.java @@ -0,0 +1,109 @@ +/* + * Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.roncoo.pay.controller.sett; + +import java.lang.reflect.InvocationTargetException; +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSON; +import com.roncoo.pay.account.service.RpAccountService; +import com.roncoo.pay.account.service.RpSettHandleService; +import com.roncoo.pay.account.service.RpSettQueryService; +import com.roncoo.pay.common.core.page.PageBean; +import com.roncoo.pay.common.core.page.PageParam; +import com.roncoo.pay.common.core.utils.StringUtil; +import com.roncoo.pay.controller.common.BaseController; +import com.roncoo.pay.controller.common.ConstantClass; +import com.roncoo.pay.controller.common.JSONParam; +import com.roncoo.pay.user.entity.RpUserInfo; + +/** + * 结算信息 + */ +@Controller +@RequestMapping("/merchant/sett") +public class SettController extends BaseController { + private static final Log LOG = LogFactory.getLog(SettController.class); + @Autowired + private RpSettHandleService rpSettHandleService; + @Autowired + private RpSettQueryService rpSettQueryService; + @Autowired + private RpAccountService rpAccountService; + + /** + * 函数功能说明 : 查询结算记录 + * + * @参数: @return + * @return String + * @throws + */ + @RequestMapping(value = "/getSettList", method = { RequestMethod.POST, RequestMethod.GET }) + public String getAccountInfo(HttpServletRequest request) { + + return "sett/list"; + } + + @RequestMapping(value = "/ajaxSettList", method = { RequestMethod.POST, RequestMethod.GET }) + @ResponseBody + public String ajaxPaymentList(HttpServletRequest request, @RequestBody JSONParam[] params) throws IllegalAccessException, InvocationTargetException { + // convertToMap定义于父类,将参数数组中的所有元素加入一个HashMap + HashMap paramMap = convertToMap(params); + String sEcho = paramMap.get("sEcho"); + int start = Integer.parseInt(paramMap.get("iDisplayStart")); + int length = Integer.parseInt(paramMap.get("iDisplayLength")); + String beginDate = paramMap.get("beginDate"); + String endDate = paramMap.get("endDate"); + if (StringUtil.isEmpty(beginDate) && !StringUtil.isEmpty(endDate)) { + beginDate = endDate; + } + if (StringUtil.isEmpty(endDate) && !StringUtil.isEmpty(beginDate)) { + endDate = beginDate; + } + String merchantRequestNo = paramMap.get("merchantRequestNo"); + String status = paramMap.get("status"); + RpUserInfo userInfo = (RpUserInfo) request.getSession().getAttribute(ConstantClass.USER); + + // 页面当前页需要显示的记录数据 + PageParam pageParam = new PageParam(start / length + 1, length); + Map settMap = new HashMap(); + settMap.put("userNo", userInfo.getUserNo()); + settMap.put("settStatus", status); + settMap.put("merchantRequestNo", merchantRequestNo); + settMap.put("beginDate", beginDate); + settMap.put("endDate", endDate); + PageBean pageBean = rpSettQueryService.querySettRecordListPage(pageParam, settMap); + + Long count = Long.valueOf(pageBean.getTotalCount() + ""); + + String jsonString = JSON.toJSONString(pageBean.getRecordList()); + String json = "{\"sEcho\":" + sEcho + ",\"iTotalRecords\":" + count.longValue() + ",\"iTotalDisplayRecords\":" + count.longValue() + ",\"aaData\":" + jsonString + "}"; + return json; + } + +} diff --git a/roncoo-pay-web-merchant/src/main/webapp/jsp/sett/list.jsp b/roncoo-pay-web-merchant/src/main/webapp/jsp/sett/list.jsp new file mode 100644 index 0000000..59667a6 --- /dev/null +++ b/roncoo-pay-web-merchant/src/main/webapp/jsp/sett/list.jsp @@ -0,0 +1,125 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + <%@include file="../../common/taglib.jsp"%> + +
+
+
+
+

+

+
+ +
+ + + + + + + + + + + + + + + + + +
结算金额结算手续费银行名称开户名开户账户结算状态创建时间备注
+
+ +
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/roncoo-pay-web-merchant/src/main/webapp/jsp/system/index.jsp b/roncoo-pay-web-merchant/src/main/webapp/jsp/system/index.jsp index e92bc60..81561fd 100644 --- a/roncoo-pay-web-merchant/src/main/webapp/jsp/system/index.jsp +++ b/roncoo-pay-web-merchant/src/main/webapp/jsp/system/index.jsp @@ -1,349 +1,445 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - <%@include file="../../common/taglib.jsp"%> - <%@include file="../../common/lte.jsp"%> - 龙果支付-商户后台 - - - - - - -
- -
- - - - - - -
- - - - -
- - - - - -
-
-
- -
-
- - -

月交易汇总

- -
- - -
-
-
-
-
- -
- -
- -
- -
- -
- - - - - - - -
- -
- - - - - - - - - - +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + <%@include file="../../common/taglib.jsp"%> + <%@include file="../../common/lte.jsp"%> + 龙果支付-商户后台 + + + + + + +
+ +
+ + + + + + +
+ + + + +
+ + + + + + +
+
+
+ +
+
+ + +

月交易汇总

+ +
+ + +
+
+
+
+
+ +
+ +
+ +
+ +
+ +
+ + + + + + + +
+ +
+ + + + + + + + + + \ No newline at end of file