diff --git a/README.md b/README.md index 340de77c..37ae03e5 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,27 @@ # 龙果支付系统 -龙果支付系统是国内首款开源的互联网支付系统,其核心目的是汇聚所有主流支付渠道,打造一个轻量、便捷、易用且集支付、资金清算于一体的支付系统。 +龙果支付系统是国内首款开源的互联网支付系统,其核心目标是汇聚所有主流支付渠道,打造一款轻量、便捷、易用,且集支付、资金对账、资金清结算于一体的支付系统,满足互联网业务系统的收款和业务资金管理需求。 ######主要特点: -1. 具备支付系统通用的支付、对账、清算、资金账户等核心模块 +1. 具备支付系统通用的支付、对账、清算、资金账户管理、支付订单管理等功能; -2. 配套系统文档,轻松嵌入任何需要支付的场景 +2. 目前已接通“支付宝即时到账”和“微信扫码支付”通道; -3. 支持直连和间连两种支付模式,任君选择 +3. 支持直连和间连两种支付模式,任君选择; -4. 系统能仅提供支付渠道负责交易处理,也可做资金清算 +4. 通过支付网关,业务系统可以轻松实现统一支付接入; -5. 搭配运营后台,数据的监控与管理可以兼得 +5. 搭配运营后台,支付数据的监控和管理可以兼得; -6. 目前已接通支付宝“即时到账”和微信“扫码支付”功能,后续会持续完善 +6. 配套完善的系统使用文档,可轻松嵌入任何需要支付的场景; -7. 龙果支付团队目前已经公司运作化并有其他的盈利来源,可确保系统稳定的发展总体结构 +7. 龙果支付系统产品技术团队是一支拥有多年第三方支付系统设计研发经验的团队,会为龙果支付系统持续提供商业级的免费开源技术服务支持。 ---------------------------------------------------------------------------------- -######总体结构: - -![Alt text](http://static.roncoo.com/images/FzcNSYhKF2aEsFWpQKtpP5XwKkGxZ26Z.png) +######应用架构: +![应用架构](http://git.oschina.net/uploads/images/2016/0726/171546_239efc3b_860625.jpeg "应用架构") --------- @@ -34,9 +33,11 @@ 系统详细介绍:http://www.roncoo.com/article/detail/124373 +系统搭建部署:http://www.roncoo.com/article/detail/124511 + 官方QQ群:287684257,欢迎大家加入,共同探讨互联网金融支付行业业务、技术等。 -![Alt text](http://static.roncoo.com/images/kbSMH3b3p8XwE6CbjSeHbjMK25JYNYRX.png) +![Alt text](http://git.oschina.net/uploads/images/2016/0722/175850_9e020e87_860625.png) diff --git a/UPDATELOG.md b/UPDATELOG.md new file mode 100644 index 00000000..2185f441 --- /dev/null +++ b/UPDATELOG.md @@ -0,0 +1,25 @@ +###### v0.0.4-2016.8.15 +1. 修复权限模块bug +2. 修改对账模块配置文件路径 +3. 去除登录指引 +4. 修复网关界面轮询bug + +---------------------------------------------------------------------------------- + +###### v0.0.3-2016.8.7 +1. 修改taglib.jsp路径 +2. 更新maven 依赖jar包,去除javaee-api.jar +3. 增加支付宝当面付通道 +4. 发起结算时增加可结算余额查询 + +---------------------------------------------------------------------------------- + +###### v0.0.2-2016.8.1 +1. 修复账户、用户查询bug +2. 添加结算金额验证 +3. 修复结算定时器路径配置错误 + +---------------------------------------------------------------------------------- + +###### v0.0.1-2016.7.25 +初始版本 diff --git a/database.sql b/database.sql new file mode 100644 index 00000000..dd809202 --- /dev/null +++ b/database.sql @@ -0,0 +1,1040 @@ +/*==============================================================*/ +/* 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); + diff --git a/pom.xml b/pom.xml index 10a2b98a..a248b2ef 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.roncoo.pay.common roncoo-pay - 0.0.1-SNAPSHOT + 0.0.4-SNAPSHOT pom roncoo-pay @@ -69,6 +69,9 @@ 2.5 2.0.2 5.11.4 + 3.12.1.GA + 1.1 + @@ -221,6 +224,17 @@ log4j ${log4j_version} + + + javassist + javassist + ${javassist.version} + + + javax.transaction + jta + ${transaction.version} + @@ -289,6 +303,47 @@ 1.10 + + + commons-configuration + commons-configuration + 1.10 + + + + + com.google.zxing + core + 2.1 + + + + + com.google.code.gson + gson + 2.3.1 + + + + + + org.hamcrest + hamcrest-core + 1.3 + + + + alipay + alipay-trade-sdk + 1.0 + + + + alipay + alipay-sdk-java20151021120052 + 1.0 + + jaxen jaxen diff --git a/roncoo-pay-app-notify/pom.xml b/roncoo-pay-app-notify/pom.xml index a796ed26..7bb6bb51 100644 --- a/roncoo-pay-app-notify/pom.xml +++ b/roncoo-pay-app-notify/pom.xml @@ -5,11 +5,11 @@ com.roncoo.pay.common roncoo-pay - 0.0.1-SNAPSHOT + 0.0.4-SNAPSHOT com.roncoo.pay.common roncoo-pay-app-notify - 0.0.1-SNAPSHOT + 0.0.4-SNAPSHOT roncoo-app-notify http://maven.apache.org diff --git a/roncoo-pay-app-notify/src/main/java/com/roncoo/pay/app/notify/message/ConsumerSessionAwareMessageListener.java b/roncoo-pay-app-notify/src/main/java/com/roncoo/pay/app/notify/message/ConsumerSessionAwareMessageListener.java index 8029e9e6..9e51e56a 100644 --- a/roncoo-pay-app-notify/src/main/java/com/roncoo/pay/app/notify/message/ConsumerSessionAwareMessageListener.java +++ b/roncoo-pay-app-notify/src/main/java/com/roncoo/pay/app/notify/message/ConsumerSessionAwareMessageListener.java @@ -24,15 +24,13 @@ import com.roncoo.pay.notify.entity.RpNotifyRecord; import com.roncoo.pay.notify.enums.NotifyStatusEnum; import com.roncoo.pay.notify.service.RpNotifyService; - import org.apache.activemq.command.ActiveMQTextMessage; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.jms.listener.SessionAwareMessageListener; - -import javax.jms.*; +import javax.jms.Message; +import javax.jms.MessageListener; import java.util.Date; /** diff --git a/roncoo-pay-app-reconciliation/pom.xml b/roncoo-pay-app-reconciliation/pom.xml index 2ee5c5c9..8183ad49 100644 --- a/roncoo-pay-app-reconciliation/pom.xml +++ b/roncoo-pay-app-reconciliation/pom.xml @@ -4,7 +4,7 @@ com.roncoo.pay.common roncoo-pay - 0.0.1-SNAPSHOT + 0.0.4-SNAPSHOT com.roncoo.pay.app roncoo-pay-app-reconciliation @@ -133,4 +133,4 @@ - \ No newline at end of file + diff --git a/roncoo-pay-app-reconciliation/src/main/resources/spring-task.xml b/roncoo-pay-app-reconciliation/src/main/resources/spring-task.xml index da34ecc2..a3a778de 100644 --- a/roncoo-pay-app-reconciliation/src/main/resources/spring-task.xml +++ b/roncoo-pay-app-reconciliation/src/main/resources/spring-task.xml @@ -8,7 +8,7 @@ http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.2.xsd"> - + diff --git a/roncoo-pay-app-settlement/pom.xml b/roncoo-pay-app-settlement/pom.xml index 6d7f0f2b..df6999bd 100644 --- a/roncoo-pay-app-settlement/pom.xml +++ b/roncoo-pay-app-settlement/pom.xml @@ -5,7 +5,7 @@ com.roncoo.pay.common roncoo-pay - 0.0.1-SNAPSHOT + 0.0.4-SNAPSHOT com.roncoo.pay.app roncoo-pay-app-settlement diff --git a/roncoo-pay-app-settlement/src/main/resources/spring-context.xml b/roncoo-pay-app-settlement/src/main/resources/spring-context.xml index 414a63c9..ad491ed6 100644 --- a/roncoo-pay-app-settlement/src/main/resources/spring-context.xml +++ b/roncoo-pay-app-settlement/src/main/resources/spring-context.xml @@ -1,19 +1,4 @@ - - + - + @@ -57,4 +42,4 @@ - \ No newline at end of file + diff --git a/roncoo-pay-common-core/pom.xml b/roncoo-pay-common-core/pom.xml index 91ea7b64..7f2cd957 100644 --- a/roncoo-pay-common-core/pom.xml +++ b/roncoo-pay-common-core/pom.xml @@ -4,7 +4,7 @@ com.roncoo.pay.common roncoo-pay - 0.0.1-SNAPSHOT + 0.0.4-SNAPSHOT roncoo-pay-common-core roncoo-pay-common-core @@ -133,9 +133,14 @@ + - javax - javaee-api + javassist + javassist + + + javax.transaction + jta @@ -174,11 +179,45 @@ commons-codec + + + commons-configuration + commons-configuration + + + + + com.google.zxing + core + + + + + com.google.code.gson + gson + + + + + org.hamcrest + hamcrest-core + + org.jdom jdom + + alipay + alipay-sdk-java20151021120052 + + + + alipay + alipay-trade-sdk + + diff --git a/roncoo-pay-common-core/src/main/java/com/roncoo/pay/common/core/enums/PayTypeEnum.java b/roncoo-pay-common-core/src/main/java/com/roncoo/pay/common/core/enums/PayTypeEnum.java index 80bb0b6d..ba13f8f4 100644 --- a/roncoo-pay-common-core/src/main/java/com/roncoo/pay/common/core/enums/PayTypeEnum.java +++ b/roncoo-pay-common-core/src/main/java/com/roncoo/pay/common/core/enums/PayTypeEnum.java @@ -33,6 +33,8 @@ public enum PayTypeEnum { DIRECT_PAY("ALIPAY","即时到账"), + F2F_PAY("ALIPAY","条码支付"), + ALI_TEST("ALIPAY","支付宝测试"); /** 所属支付方式 */ diff --git a/roncoo-pay-common-core/src/main/java/com/roncoo/pay/common/core/enums/PublicStatusEnum.java b/roncoo-pay-common-core/src/main/java/com/roncoo/pay/common/core/enums/PublicStatusEnum.java index 25db38c7..a2f00c6c 100644 --- a/roncoo-pay-common-core/src/main/java/com/roncoo/pay/common/core/enums/PublicStatusEnum.java +++ b/roncoo-pay-common-core/src/main/java/com/roncoo/pay/common/core/enums/PublicStatusEnum.java @@ -53,6 +53,7 @@ public static Map> toMap() { for (int num = 0; num < ary.length; num++) { Map map = new HashMap(); String key = ary[num].name(); + map.put("value", ary[num].name()); map.put("desc", ary[num].getDesc()); enumMap.put(key, map); } diff --git a/roncoo-pay-service/pom.xml b/roncoo-pay-service/pom.xml index f2494893..53f1f0e5 100644 --- a/roncoo-pay-service/pom.xml +++ b/roncoo-pay-service/pom.xml @@ -4,7 +4,7 @@ com.roncoo.pay.common roncoo-pay - 0.0.1-SNAPSHOT + 0.0.4-SNAPSHOT com.roncoo.pay.service @@ -48,6 +48,7 @@ shiro-web 1.2.5 + diff --git a/roncoo-pay-service/src/lib/alipay-sdk-java20151021120052.jar b/roncoo-pay-service/src/lib/alipay-sdk-java20151021120052.jar new file mode 100755 index 00000000..e941e2c6 Binary files /dev/null and b/roncoo-pay-service/src/lib/alipay-sdk-java20151021120052.jar differ diff --git a/roncoo-pay-service/src/lib/alipay-trade-sdk.jar b/roncoo-pay-service/src/lib/alipay-trade-sdk.jar new file mode 100755 index 00000000..6e4f5c9a Binary files /dev/null and b/roncoo-pay-service/src/lib/alipay-trade-sdk.jar differ diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/RpAccountService.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/RpAccountService.java index e837b56e..071de983 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/RpAccountService.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/RpAccountService.java @@ -53,4 +53,12 @@ public interface RpAccountService{ */ PageBean listPage(PageParam pageParam, RpAccount rpAccount); + /** + * 根据userNo获取数据 + * + * @param userNo + * @return + */ + RpAccount getDataByUserNo(String userNo); + } \ No newline at end of file diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/impl/RpAccountHistoryServiceImpl.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/impl/RpAccountHistoryServiceImpl.java index e713a2fd..e850bb50 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/impl/RpAccountHistoryServiceImpl.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/impl/RpAccountHistoryServiceImpl.java @@ -56,6 +56,7 @@ public RpAccountHistory getDataById(String id) { @Override public PageBean listPage(PageParam pageParam, RpAccountHistory rpAccountHistory) { Map paramMap = new HashMap(); + paramMap.put("accountNo", rpAccountHistory.getAccountNo()); return rpAccountHistoryDao.listPage(pageParam, paramMap); } } \ No newline at end of file diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/impl/RpAccountServiceImpl.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/impl/RpAccountServiceImpl.java index f4855a42..3c59de47 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/impl/RpAccountServiceImpl.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/impl/RpAccountServiceImpl.java @@ -59,4 +59,11 @@ public PageBean listPage(PageParam pageParam, RpAccount rpAccount) { paramMap.put("accountNo", rpAccount.getAccountNo()); return rpAccountDao.listPage(pageParam, paramMap); } + + @Override + public RpAccount getDataByUserNo(String userNo){ + Map paramMap = new HashMap(); + paramMap.put("userNo", userNo); + return rpAccountDao.getBy(paramMap); + } } \ No newline at end of file diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/impl/RpSettHandleServiceImpl.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/impl/RpSettHandleServiceImpl.java index a83500a8..913d23fa 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/impl/RpSettHandleServiceImpl.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/account/service/impl/RpSettHandleServiceImpl.java @@ -245,6 +245,7 @@ public void audit(String settId, String settStatus, String remark){ /** * 打款 */ + @Transactional(rollbackFor = Exception.class) public void remit(String settId, String settStatus, String remark){ RpSettRecord settRecord = rpSettRecordDao.getById(settId); if(!settRecord.getSettStatus().equals(SettRecordStatusEnum.CONFIRMED.name())){ diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/dao/PmsRolePermissionDao.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/dao/PmsRolePermissionDao.java index bd96637b..9fea7da3 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/dao/PmsRolePermissionDao.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/dao/PmsRolePermissionDao.java @@ -44,4 +44,8 @@ public interface PmsRolePermissionDao extends PermissionBaseDao listByRoleIds(String roleIdsStr); + + public void deleteByRoleIdAndPermissionId(Long roleId, Long permissionId); + + public void deleteByRoleId(Long roleId); } diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/dao/impl/PmsRolePermissionDaoImpl.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/dao/impl/PmsRolePermissionDaoImpl.java index 50455a98..91c7c260 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/dao/impl/PmsRolePermissionDaoImpl.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/dao/impl/PmsRolePermissionDaoImpl.java @@ -16,7 +16,9 @@ package com.roncoo.pay.permission.dao.impl; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.springframework.stereotype.Repository; @@ -54,4 +56,15 @@ public List listByRoleIds(String roleIdsStr) { List roldIds = Arrays.asList(roleIdsStr.split(",")); return super.getSqlSession().selectList(getStatement("listByRoleIds"), roldIds); } + + public void deleteByRoleIdAndPermissionId(Long roleId, Long permissionId){ + Map paramMap = new HashMap(); + paramMap.put("roleId", roleId); + paramMap.put("permissionId", permissionId); + super.getSqlSession().delete(getStatement("deleteByRoleIdAndPermissionId"), paramMap); + } + + public void deleteByRoleId(Long roleId){ + super.getSqlSession().delete(getStatement("deleteByRoleId"), roleId); + } } diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/PmsMenuRoleService.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/PmsMenuRoleService.java index 212c88f7..2e0dc825 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/PmsMenuRoleService.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/PmsMenuRoleService.java @@ -40,4 +40,6 @@ public interface PmsMenuRoleService { */ public void deleteByRoleId(Long roleId); + public void saveRoleMenu(Long roleId, String roleMenuStr); + } diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/PmsPermissionService.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/PmsPermissionService.java index 7b60544f..62236c50 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/PmsPermissionService.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/PmsPermissionService.java @@ -97,5 +97,10 @@ public interface PmsPermissionService { * @return */ String getPermissionIdsByRoleId(Long roleId); + + /** + * 查询所有的权限 + */ + List listAll(); } diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/PmsRolePermissionService.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/PmsRolePermissionService.java index 4799c9b2..76fd48ce 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/PmsRolePermissionService.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/PmsRolePermissionService.java @@ -64,5 +64,10 @@ public interface PmsRolePermissionService { * @return */ PageBean listPage(PageParam pageParam, PmsRolePermission pmsRolePermission); + + /** + * 保存角色和权限之间的关联关系 + */ + void saveRolePermission(Long roleId, String rolePermissionStr); } diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsMenuRoleServiceImpl.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsMenuRoleServiceImpl.java index 18411331..f78f3fa1 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsMenuRoleServiceImpl.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsMenuRoleServiceImpl.java @@ -19,7 +19,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.alibaba.druid.util.StringUtils; import com.roncoo.pay.permission.dao.PmsMenuRoleDao; import com.roncoo.pay.permission.entity.PmsMenuRole; import com.roncoo.pay.permission.service.PmsMenuRoleService; @@ -62,4 +64,20 @@ public void deleteByRoleId(Long roleId) { pmsMenuRoleDao.deleteByRoleId(roleId); } + @Transactional(rollbackFor = Exception.class) + public void saveRoleMenu(Long roleId, String roleMenuStr){ + // 删除原来的角色与权限关联 + pmsMenuRoleDao.deleteByRoleId(roleId); + if (!StringUtils.isEmpty(roleMenuStr)) { + // 创建新的关联 + String[] menuIds = roleMenuStr.split(","); + for (int i = 0; i < menuIds.length; i++) { + Long menuId = Long.valueOf(menuIds[i]); + PmsMenuRole item = new PmsMenuRole(); + item.setMenuId(menuId); + item.setRoleId(roleId); + pmsMenuRoleDao.insert(item); + } + } + } } diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsOperatorServiceImpl.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsOperatorServiceImpl.java index 6c298977..853bf9f3 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsOperatorServiceImpl.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsOperatorServiceImpl.java @@ -15,17 +15,18 @@ */ package com.roncoo.pay.permission.service.impl; +import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import javax.transaction.Transactional; - import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +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.permission.dao.PmsOperatorDao; @@ -148,22 +149,22 @@ public PmsOperator findOperatorByLoginName(String loginName) { * . */ - @Transactional(rollbackOn = Exception.class) + @Transactional public void saveOperator(PmsOperator pmsOperator, String roleOperatorStr) { // 保存操作员信息 pmsOperatorDao.insert(pmsOperator); // 保存角色关联信息 if (StringUtils.isNotBlank(roleOperatorStr) && roleOperatorStr.length() > 0) { - saveOrUpdateOperatorRole(pmsOperator.getId(), roleOperatorStr); + saveOrUpdateOperatorRole(pmsOperator, roleOperatorStr); } } /** * 保存用户和角色之间的关联关系 */ - private void saveOrUpdateOperatorRole(long operatorId, String roleIdsStr) { + private void saveOrUpdateOperatorRole(PmsOperator pmsOperator, String roleIdsStr) { // 删除原来的角色与操作员关联 - List listPmsOperatorRoles = pmsOperatorRoleDao.listByOperatorId(operatorId); + List listPmsOperatorRoles = pmsOperatorRoleDao.listByOperatorId(pmsOperator.getId()); Map delMap = new HashMap(); for (PmsOperatorRole pmsOperatorRole : listPmsOperatorRoles) { delMap.put(pmsOperatorRole.getRoleId(), pmsOperatorRole); @@ -175,8 +176,11 @@ private void saveOrUpdateOperatorRole(long operatorId, String roleIdsStr) { long roleId = Long.parseLong(roleIds[i]); if (delMap.get(roleId) == null) { PmsOperatorRole pmsOperatorRole = new PmsOperatorRole(); - pmsOperatorRole.setOperatorId(operatorId); + pmsOperatorRole.setOperatorId(pmsOperator.getId()); pmsOperatorRole.setRoleId(roleId); + pmsOperatorRole.setCreater(pmsOperator.getCreater()); + pmsOperatorRole.setCreateTime(new Date()); + pmsOperatorRole.setStatus(PublicStatusEnum.ACTIVE.name()); pmsOperatorRoleDao.insert(pmsOperatorRole); } else { delMap.remove(roleId); @@ -187,7 +191,7 @@ private void saveOrUpdateOperatorRole(long operatorId, String roleIdsStr) { Iterator iterator = delMap.keySet().iterator(); while (iterator.hasNext()) { long roleId = iterator.next(); - pmsOperatorRoleDao.deleteByRoleIdAndOperatorId(roleId, operatorId); + pmsOperatorRoleDao.deleteByRoleIdAndOperatorId(roleId, pmsOperator.getId()); } } @@ -202,7 +206,7 @@ private void saveOrUpdateOperatorRole(long operatorId, String roleIdsStr) { public void updateOperator(PmsOperator pmsOperator, String roleOperatorStr) { pmsOperatorDao.update(pmsOperator); // 更新角色信息 - this.saveOrUpdateOperatorRole(pmsOperator.getId(), roleOperatorStr); + this.saveOrUpdateOperatorRole(pmsOperator, roleOperatorStr); } } diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsPermissionServiceImpl.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsPermissionServiceImpl.java index 2be267a5..0abb3e1a 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsPermissionServiceImpl.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsPermissionServiceImpl.java @@ -141,4 +141,11 @@ public String getPermissionIdsByRoleId(Long roleId) { return actionIds.toString(); } + /** + * 查询所有的权限 + */ + public List listAll() { + Map paramMap = new HashMap(); + return pmsPermissionDao.listBy(paramMap); + } } diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsRolePermissionServiceImpl.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsRolePermissionServiceImpl.java index a6d8fe24..d9be74f1 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsRolePermissionServiceImpl.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/permission/service/impl/PmsRolePermissionServiceImpl.java @@ -17,12 +17,14 @@ import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import com.alibaba.druid.util.StringUtils; import com.roncoo.pay.common.core.page.PageBean; @@ -134,5 +136,25 @@ public PageBean listPage(PageParam pageParam, PmsRolePermission pmsRolePermissio Map paramMap = new HashMap(); return pmsRolePermissionDao.listPage(pageParam, paramMap); } + + /** + * 保存角色和权限之间的关联关系 + */ + @Transactional(rollbackFor = Exception.class) + public void saveRolePermission(Long roleId, String rolePermissionStr){ + // 删除原来的角色与权限关联 + pmsRolePermissionDao.deleteByRoleId(roleId); + if (!StringUtils.isEmpty(rolePermissionStr)) { + // 创建新的关联 + String[] permissionIds = rolePermissionStr.split(","); + for (int i = 0; i < permissionIds.length; i++) { + Long permissionId = Long.valueOf(permissionIds[i]); + PmsRolePermission item = new PmsRolePermission(); + item.setPermissionId(permissionId); + item.setRoleId(roleId); + pmsRolePermissionDao.insert(item); + } + } + } } diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/reconciliation/fileDown/impl/WinXinFileDown.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/reconciliation/fileDown/impl/WinXinFileDown.java index ac02be80..539622c6 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/reconciliation/fileDown/impl/WinXinFileDown.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/reconciliation/fileDown/impl/WinXinFileDown.java @@ -30,7 +30,7 @@ import com.roncoo.pay.reconciliation.fileDown.service.FileDown; import com.roncoo.pay.reconciliation.utils.FileUtils; import com.roncoo.pay.reconciliation.utils.SignHelper; -import com.roncoo.pay.reconciliation.utils.WechatBaseUtils; +import com.roncoo.pay.reconciliation.utils.WeiXinBaseUtils; import com.roncoo.pay.reconciliation.utils.https.HttpClientUtil; import com.roncoo.pay.reconciliation.utils.https.HttpResponse; import com.roncoo.pay.trade.utils.WeixinConfigUtil; @@ -136,7 +136,7 @@ public String generateXml() { params.put("bill_date", bill_date); params.put("bill_type", bill_type); // 随机字符串,不长于32,调用随机数函数生成,将得到的值转换为字符串 - params.put("nonce_str", WechatBaseUtils.createNoncestr()); + params.put("nonce_str", WeiXinBaseUtils.createNoncestr()); // 过滤空值 for (Iterator> it = params.entrySet().iterator(); it.hasNext();) { @@ -148,7 +148,7 @@ public String generateXml() { String sign = SignHelper.getSign(params, appSecret); params.put("sign", sign.toUpperCase()); - return WechatBaseUtils.arrayToXml(params); + return WeiXinBaseUtils.arrayToXml(params); } } diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/reconciliation/utils/WechatBaseUtils.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/reconciliation/utils/WeiXinBaseUtils.java similarity index 98% rename from roncoo-pay-service/src/main/java/com/roncoo/pay/reconciliation/utils/WechatBaseUtils.java rename to roncoo-pay-service/src/main/java/com/roncoo/pay/reconciliation/utils/WeiXinBaseUtils.java index dab855dd..e8bf82b2 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/reconciliation/utils/WechatBaseUtils.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/reconciliation/utils/WeiXinBaseUtils.java @@ -17,7 +17,7 @@ * @版本:V1.0 * */ -public class WechatBaseUtils { +public class WeiXinBaseUtils { private static String chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; /** diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/entity/RoncooPayGoodsDetails.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/entity/RoncooPayGoodsDetails.java new file mode 100644 index 00000000..6a276445 --- /dev/null +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/entity/RoncooPayGoodsDetails.java @@ -0,0 +1,63 @@ +package com.roncoo.pay.trade.entity; + +/** + * 功能说明:龙果支付商品明细描述 + * + * + * @author Peter + * 龙果学院(www.roncoo.com) + */ +public class RoncooPayGoodsDetails { + + /** 构造函数 传入所需参数 **/ + public RoncooPayGoodsDetails (String goodsId , String goodsName ,Long singlePrice , Integer nums){ + this.goodsId = goodsId; + this.goodsName = goodsName; + this.singlePrice = singlePrice; + this.nums = nums; + } + + /** 商品ID **/ + private String goodsId; + + /** 名称 **/ + private String goodsName; + + /** 单价 **/ + private Long singlePrice; + + /** 数量 **/ + private Integer nums; + + public String getGoodsId() { + return goodsId; + } + + public void setGoodsId(String goodsId) { + this.goodsId = goodsId; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public Long getSinglePrice() { + return singlePrice; + } + + public void setSinglePrice(Long singlePrice) { + this.singlePrice = singlePrice; + } + + public Integer getNums() { + return nums; + } + + public void setNums(Integer nums) { + this.nums = nums; + } +} diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/service/RpTradePaymentManagerService.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/service/RpTradePaymentManagerService.java index 34775792..e3fc9df7 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/service/RpTradePaymentManagerService.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/service/RpTradePaymentManagerService.java @@ -15,6 +15,7 @@ */ package com.roncoo.pay.trade.service; +import com.roncoo.pay.trade.vo.F2FPayResultVo; import com.roncoo.pay.trade.vo.OrderPayResultVo; import com.roncoo.pay.trade.vo.RpPayGateWayPageShowVo; import com.roncoo.pay.trade.vo.ScanPayResultVo; @@ -59,6 +60,26 @@ public ScanPayResultVo initDirectScanPay(String payKey, String productName, Stri , String notifyUrl, String remark, String field1, String field2, String field3, String field4, String field5); + /** + * 条码支付,对应的是支付宝的条码支付或者微信的刷卡支付 + * @param payKey 商户支付key + * @param authCode 支付授权码 + * @param productName 产品名称 + * @param orderNo 商户订单号 + * @param orderDate 下单日期 + * @param orderTime 下单时间 + * @param orderPrice 订单金额(元) + * @param payWayCode 支付方式 + * @param orderIp 下单IP + * @param remark 支付备注 + * @param field1 扩展字段1 + * @param field2 扩展字段2 + * @param field3 扩展字段3 + * @param field4 扩展字段4 + * @param field5 扩展字段5 + * @return + */ + public F2FPayResultVo f2fPay(String payKey,String authCode , String productName, String orderNo, Date orderDate, Date orderTime, BigDecimal orderPrice, String payWayCode, String orderIp, String remark, String field1, String field2, String field3, String field4, String field5); /** * 完成扫码支付(支付宝即时到账支付) * @param payWayCode diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/service/impl/RpTradePaymentManagerServiceImpl.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/service/impl/RpTradePaymentManagerServiceImpl.java index cf60670d..3f600583 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/service/impl/RpTradePaymentManagerServiceImpl.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/service/impl/RpTradePaymentManagerServiceImpl.java @@ -23,6 +23,7 @@ import com.roncoo.pay.notify.service.RpNotifyService; import com.roncoo.pay.trade.dao.RpTradePaymentOrderDao; import com.roncoo.pay.trade.dao.RpTradePaymentRecordDao; +import com.roncoo.pay.trade.entity.RoncooPayGoodsDetails; import com.roncoo.pay.trade.entity.RpTradePaymentOrder; import com.roncoo.pay.trade.entity.RpTradePaymentRecord; import com.roncoo.pay.trade.entity.weixinpay.WeiXinPrePay; @@ -38,8 +39,10 @@ import com.roncoo.pay.trade.utils.WeiXinPayUtils; import com.roncoo.pay.trade.utils.WeixinConfigUtil; import com.roncoo.pay.trade.utils.alipay.config.AlipayConfigUtil; +import com.roncoo.pay.trade.utils.alipay.f2fpay.AliF2FPaySubmit; import com.roncoo.pay.trade.utils.alipay.util.AlipayNotify; import com.roncoo.pay.trade.utils.alipay.util.AlipaySubmit; +import com.roncoo.pay.trade.vo.F2FPayResultVo; import com.roncoo.pay.trade.vo.OrderPayResultVo; import com.roncoo.pay.trade.vo.RpPayGateWayPageShowVo; import com.roncoo.pay.trade.vo.ScanPayResultVo; @@ -100,6 +103,9 @@ public class RpTradePaymentManagerServiceImpl implements RpTradePaymentManagerSe @Autowired private RpAccountTransactionService rpAccountTransactionService; + @Autowired + private AliF2FPaySubmit aliF2FPaySubmit; + /** * 初始化直连扫码支付数据,直连扫码支付初始化方法规则 * 1:根据(商户编号 + 商户订单号)确定订单是否存在 @@ -173,6 +179,169 @@ public ScanPayResultVo initDirectScanPay(String payKey, String productName, Stri } + /** + * 条码支付,对应的是支付宝的条码支付或者微信的刷卡支付 + * + * @param payKey 商户支付key + * @param authCode 支付授权码 + * @param productName 产品名称 + * @param orderNo 商户订单号 + * @param orderDate 下单日期 + * @param orderTime 下单时间 + * @param orderPrice 订单金额(元) + * @param payWayCode 支付方式 + * @param orderIp 下单IP + * @param remark 支付备注 + * @param field1 扩展字段1 + * @param field2 扩展字段2 + * @param field3 扩展字段3 + * @param field4 扩展字段4 + * @param field5 扩展字段5 + * @return + */ + @Override + public F2FPayResultVo f2fPay(String payKey, String authCode, String productName, String orderNo, Date orderDate, Date orderTime, BigDecimal orderPrice, String payWayCode, String orderIp, String remark, String field1, String field2, String field3, String field4, String field5) { + + RpUserPayConfig rpUserPayConfig = rpUserPayConfigService.getByPayKey(payKey); + if (rpUserPayConfig == null){ + throw new UserBizException(UserBizException.USER_PAY_CONFIG_ERRPR,"用户支付配置有误"); + } + + if (StringUtil.isEmpty(authCode)){ + throw new TradeBizException(TradeBizException.TRADE_PARAM_ERROR,"支付授权码不能为空"); + } + //根据支付产品及支付方式获取费率 + RpPayWay payWay = null; + if (PayWayEnum.WEIXIN.name().equals(payWayCode)){ +// payWay = rpPayWayService.getByPayWayTypeCode(rpUserPayConfig.getProductCode(), payWayCode, PayTypeEnum.SCANPAY.name()); + }else if (PayWayEnum.ALIPAY.name().equals(payWayCode)){ + payWay = rpPayWayService.getByPayWayTypeCode(rpUserPayConfig.getProductCode(), payWayCode, PayTypeEnum.F2F_PAY.name()); + } + + if(payWay == null){ + throw new UserBizException(UserBizException.USER_PAY_CONFIG_ERRPR,"用户支付配置有误"); + } + + String merchantNo = rpUserPayConfig.getUserNo();//商户编号 + RpUserInfo rpUserInfo = rpUserInfoService.getDataByMerchentNo(merchantNo); + if (rpUserInfo == null){ + throw new UserBizException(UserBizException.USER_IS_NULL,"用户不存在"); + } + + RpTradePaymentOrder rpTradePaymentOrder = rpTradePaymentOrderDao.selectByMerchantNoAndMerchantOrderNo(merchantNo, orderNo); + if (rpTradePaymentOrder == null){ + rpTradePaymentOrder = sealRpTradePaymentOrder( merchantNo, rpUserInfo.getUserName() , productName, orderNo, orderDate, orderTime, orderPrice, payWayCode, PayWayEnum.getEnum(payWayCode).getDesc() , rpUserPayConfig.getFundIntoType() , orderIp, 5, "f2fPay", "f2fPay", remark, field1, field2, field3, field4, field5); + rpTradePaymentOrderDao.insert(rpTradePaymentOrder); + }else{ + if (rpTradePaymentOrder.getOrderAmount().compareTo(orderPrice) != 0 ){ + throw new TradeBizException(TradeBizException.TRADE_ORDER_ERROR,"错误的订单"); + } + + if (TradeStatusEnum.SUCCESS.name().equals(rpTradePaymentOrder.getStatus())){ + throw new TradeBizException(TradeBizException.TRADE_ORDER_ERROR,"订单已支付成功,无需重复支付"); + } + } + + return getF2FPayResultVo( rpTradePaymentOrder , payWay , payKey , rpUserPayConfig.getPaySecret() , authCode ,null); + } + + /** + * 通过支付订单及商户费率生成支付记录 + * @param rpTradePaymentOrder 支付订单 + * @param payWay 商户支付配置 + * @return + */ + private F2FPayResultVo getF2FPayResultVo(RpTradePaymentOrder rpTradePaymentOrder ,RpPayWay payWay , String payKey , String merchantPaySecret , String authCode ,List< RoncooPayGoodsDetails > roncooPayGoodsDetailses){ + + F2FPayResultVo f2FPayResultVo = new F2FPayResultVo(); + String payWayCode = payWay.getPayWayCode();//支付方式 + + if (PayWayEnum.WEIXIN.name().equals(payWay.getPayWayCode())){ + rpTradePaymentOrder.setPayTypeCode(PayTypeEnum.SCANPAY.name());//支付类型 + rpTradePaymentOrder.setPayTypeName(PayTypeEnum.SCANPAY.getDesc());//支付方式 + }else if(PayWayEnum.ALIPAY.name().equals(payWay.getPayWayCode())){ + rpTradePaymentOrder.setPayTypeCode(PayTypeEnum.DIRECT_PAY.name());//支付类型 + rpTradePaymentOrder.setPayTypeName(PayTypeEnum.DIRECT_PAY.getDesc());//支付方式 + } + + rpTradePaymentOrder.setPayWayCode(payWay.getPayWayCode()); + rpTradePaymentOrder.setPayWayName(payWay.getPayWayName()); + + RpTradePaymentRecord rpTradePaymentRecord = sealRpTradePaymentRecord( rpTradePaymentOrder.getMerchantNo(), rpTradePaymentOrder.getMerchantName() , rpTradePaymentOrder.getProductName(), rpTradePaymentOrder.getMerchantOrderNo(), rpTradePaymentOrder.getOrderAmount(), payWay.getPayWayCode(), payWay.getPayWayName() , rpTradePaymentOrder.getFundIntoType() , BigDecimal.valueOf(payWay.getPayRate()) , rpTradePaymentOrder.getOrderIp(), rpTradePaymentOrder.getReturnUrl(), rpTradePaymentOrder.getNotifyUrl(), rpTradePaymentOrder.getRemark(), rpTradePaymentOrder.getField1(), rpTradePaymentOrder.getField2(), rpTradePaymentOrder.getField3(), rpTradePaymentOrder.getField4(), rpTradePaymentOrder.getField5()); + rpTradePaymentRecordDao.insert(rpTradePaymentRecord); + + if (PayWayEnum.WEIXIN.name().equals(payWayCode)){//微信支付 + throw new TradeBizException(TradeBizException.TRADE_PAY_WAY_ERROR,"暂未开通微信刷卡支付"); + }else { + if (PayWayEnum.ALIPAY.name().equals(payWayCode)) {//支付宝支付 + + RpUserPayInfo rpUserPayInfo = rpUserPayInfoService.getByUserNo(rpTradePaymentOrder.getMerchantNo(),payWayCode); + if (rpUserPayInfo == null){ + throw new UserBizException(UserBizException.USER_PAY_CONFIG_ERRPR,"商户支付配置有误"); + } + + aliF2FPaySubmit.initConfigs(rpTradePaymentOrder.getFundIntoType(), rpUserPayInfo.getOfflineAppId(), rpUserPayInfo.getAppId(), rpUserPayInfo.getRsaPrivateKey(), rpUserPayInfo.getRsaPublicKey()); + Map aliPayReturnMsg = aliF2FPaySubmit.f2fPay(rpTradePaymentRecord.getBankOrderNo(), rpTradePaymentOrder.getProductName(), "", authCode, rpTradePaymentRecord.getOrderAmount(), roncooPayGoodsDetailses); + + rpTradePaymentOrder.setStatus(aliPayReturnMsg.get("status"));//支付订单状态 + rpTradePaymentOrderDao.update(rpTradePaymentOrder);//修改支付订单 + + rpTradePaymentRecord.setStatus(aliPayReturnMsg.get("status"));//设置消费状态 + rpTradePaymentRecord.setBankTrxNo(aliPayReturnMsg.get("bankTrxNo"));//银行流水号 + rpTradePaymentRecord.setBankReturnMsg(aliPayReturnMsg.get("bankReturnMsg"));//银行返回信息 + rpTradePaymentRecordDao.update(rpTradePaymentRecord); + + } else { + throw new TradeBizException(TradeBizException.TRADE_PAY_WAY_ERROR, "错误的支付方式"); + } + } + + + Map paramMap = new HashMap(); + f2FPayResultVo.setStatus(rpTradePaymentRecord.getStatus());//支付结果 + paramMap.put("status",rpTradePaymentRecord.getStatus()); + + f2FPayResultVo.setField1(rpTradePaymentRecord.getField1());//扩展字段1 + paramMap.put("field1",rpTradePaymentRecord.getField1()); + + f2FPayResultVo.setField2(rpTradePaymentRecord.getField2());//扩展字段2 + paramMap.put("field2",rpTradePaymentRecord.getField2()); + + f2FPayResultVo.setField3(rpTradePaymentRecord.getField3());//扩展字段3 + paramMap.put("field3",rpTradePaymentRecord.getField3()); + + f2FPayResultVo.setField4(rpTradePaymentRecord.getField4());//扩展字段4 + paramMap.put("field4",rpTradePaymentRecord.getField4()); + + f2FPayResultVo.setField5(rpTradePaymentRecord.getField5());//扩展字段5 + paramMap.put("field5",rpTradePaymentRecord.getField5()); + + f2FPayResultVo.setOrderIp(rpTradePaymentRecord.getOrderIp());//下单ip + paramMap.put("orderIp",rpTradePaymentRecord.getOrderIp()); + + f2FPayResultVo.setOrderNo(rpTradePaymentRecord.getMerchantOrderNo());//商户订单号 + paramMap.put("merchantOrderNo",rpTradePaymentRecord.getMerchantOrderNo()); + + f2FPayResultVo.setPayKey(payKey);//支付号 + paramMap.put("payKey",payKey); + + f2FPayResultVo.setProductName(rpTradePaymentRecord.getProductName());//产品名称 + paramMap.put("productName",rpTradePaymentRecord.getProductName()); + + f2FPayResultVo.setRemark(rpTradePaymentRecord.getRemark());//支付备注 + paramMap.put("remark",rpTradePaymentRecord.getRemark()); + + f2FPayResultVo.setTrxNo(rpTradePaymentRecord.getTrxNo());//交易流水号 + paramMap.put("trxNo", rpTradePaymentRecord.getTrxNo()); + + String sign = MerchantApiUtil.getSign(paramMap, merchantPaySecret); + + f2FPayResultVo.setSign(sign); + return f2FPayResultVo; + } + + + /** * 支付成功方法 * @param rpTradePaymentRecord @@ -429,7 +598,7 @@ private ScanPayResultVo getScanPayResultVo(RpTradePaymentOrder rpTradePaymentOrd WeiXinPrePay weiXinPrePay = sealWeixinPerPay(appid , mch_id , rpTradePaymentOrder.getProductName() ,rpTradePaymentOrder.getRemark() , rpTradePaymentRecord.getBankOrderNo() , rpTradePaymentOrder.getOrderAmount() , rpTradePaymentOrder.getOrderTime() , rpTradePaymentOrder.getOrderPeriod() , WeiXinTradeTypeEnum.NATIVE , rpTradePaymentRecord.getBankOrderNo() ,"" ,rpTradePaymentOrder.getOrderIp()); - String prePayXml = WeiXinPayUtils.getPrePayXml(weiXinPrePay, WeixinConfigUtil.readConfig("partnerKey")); + String prePayXml = WeiXinPayUtils.getPrePayXml(weiXinPrePay, partnerKey); //调用微信支付的功能,获取微信支付code_url Map prePayRequest = WeiXinPayUtils.httpXmlRequest(WeixinConfigUtil.readConfig("prepay_url"), "POST", prePayXml); if (WeixinTradeStateEnum.SUCCESS.name().equals(prePayRequest.get("return_code")) && WeixinTradeStateEnum.SUCCESS.name().equals(prePayRequest.get("result_code"))) { diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/utils/alipay/f2fpay/AliF2FPaySubmit.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/utils/alipay/f2fpay/AliF2FPaySubmit.java new file mode 100644 index 00000000..62db2708 --- /dev/null +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/utils/alipay/f2fpay/AliF2FPaySubmit.java @@ -0,0 +1,231 @@ +package com.roncoo.pay.trade.utils.alipay.f2fpay; + +import com.alipay.api.AlipayResponse; +import com.alipay.api.domain.TradeFundBill; +import com.alipay.api.response.AlipayTradeQueryResponse; +import com.alipay.demo.trade.config.Configs; +import com.alipay.demo.trade.model.ExtendParams; +import com.alipay.demo.trade.model.GoodsDetail; +import com.alipay.demo.trade.model.builder.AlipayTradePayContentBuilder; +import com.alipay.demo.trade.model.result.AlipayF2FPayResult; +import com.alipay.demo.trade.model.result.AlipayF2FQueryResult; +import com.alipay.demo.trade.service.AlipayMonitorService; +import com.alipay.demo.trade.service.AlipayTradeService; +import com.alipay.demo.trade.service.impl.AlipayMonitorServiceImpl; +import com.alipay.demo.trade.service.impl.AlipayTradeServiceImpl; +import com.alipay.demo.trade.service.impl.AlipayTradeWithHBServiceImpl; +import com.alipay.demo.trade.utils.Utils; +import com.roncoo.pay.trade.entity.RoncooPayGoodsDetails; +import com.roncoo.pay.trade.enums.TradeStatusEnum; +import com.roncoo.pay.trade.vo.F2FPayResultVo; +import com.roncoo.pay.user.enums.FundInfoTypeEnum; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Repository; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 功能说明:支付宝当面付功能提交类 + * + * + * @author Peter + * 龙果学院(www.roncoo.com) + */ +@Repository("aliF2FPaySubmit") +public class AliF2FPaySubmit { + + private static final Logger LOG = LoggerFactory.getLogger(AliF2FPaySubmit.class); + + private AlipayTradeService tradeService; + + private AlipayTradeService tradeWithHBService; + + private AlipayMonitorService monitorService; + +// static { +// /** 一定要在创建AlipayTradeService之前调用Configs.init()设置默认参数 +// * Configs会读取classpath下的alipayrisk10.properties文件配置信息,如果找不到该文件则确认该文件是否在classpath目录 +// */ +// Configs.init("zfbinfo.properties"); +// +// /** 使用Configs提供的默认参数 +// * AlipayTradeService可以使用单例或者为静态成员对象,不需要反复new +// */ +// tradeService = new AlipayTradeServiceImpl.ClientBuilder().build(); +// +// /** 支付宝当面付2.0服务(集成了交易保障接口逻辑)**/ +// tradeWithHBService = new AlipayTradeWithHBServiceImpl.ClientBuilder().build(); +// +// /** 如果需要在程序中覆盖Configs提供的默认参数, 可以使用ClientBuilder类的setXXX方法修改默认参数 否则使用代码中的默认设置 */ +// monitorService = new AlipayMonitorServiceImpl.ClientBuilder() +// .setCharset("GBK") +// .setFormat("json") +// .build(); +// } + + + /** + * 初始化当面付支付配置 + * @param appId + * @param pid + * @param privateKey + * @param publicKey + */ + public void initConfigs (String fundInfoType,String appId , String pid , String privateKey , String publicKey){ + + /** 一定要在创建AlipayTradeService之前调用Configs.init()设置默认参数 + * Configs会读取classpath下的alipayrisk10.properties文件配置信息,如果找不到该文件则确认该文件是否在classpath目录 + */ + Configs.init("zfbinfo.properties"); + + if (FundInfoTypeEnum.MERCHANT_RECEIVES.name().equals(fundInfoType)){//商户收款 + Configs.setAppid(appId); + Configs.setPid(pid); + Configs.setPrivateKey(privateKey); + Configs.setPublicKey(publicKey); + } + + /** 使用Configs提供的默认参数 + * AlipayTradeService可以使用单例或者为静态成员对象,不需要反复new + */ + tradeService = new AlipayTradeServiceImpl.ClientBuilder().build(); + + /** 支付宝当面付2.0服务(集成了交易保障接口逻辑)**/ + tradeWithHBService = new AlipayTradeWithHBServiceImpl.ClientBuilder().build(); + + /** 如果需要在程序中覆盖Configs提供的默认参数, 可以使用ClientBuilder类的setXXX方法修改默认参数 否则使用代码中的默认设置 */ + monitorService = new AlipayMonitorServiceImpl.ClientBuilder() + .setCharset("GBK") + .setFormat("json") + .build(); + } + + /** + * 支付宝当面付 + * @param outTradeNo 商户请求支付订单号 + * @param subject 订单名称 + * @param body 订单描述 + * @param authCode 支付授权码 + * @param amount 支付金额 + * @param roncooPayGoodsDetailses + */ + public Map f2fPay(String outTradeNo , String subject , String body ,String authCode , BigDecimal amount , List roncooPayGoodsDetailses) { + Map returnMap = new HashMap(); + + String totalAmount = amount.toString() ;//订单金额 + String undiscountableAmount = "0.0";//默认折扣金额为0,建议由业务系统记录折扣金额,值传递给支付宝实际支付金额 + String storeId = "roncoo_pay_store_id"; // (必填) 商户门店编号,通过门店号和商家后台可以配置精准到门店的折扣信息,详询支付宝技术支持 + // 业务扩展参数,目前可添加由支付宝分配的系统商编号(通过setSysServiceProviderId方法),详情请咨询支付宝技术支持 + String providerId = "2088100200300400500"; + ExtendParams extendParams = new ExtendParams(); + extendParams.setSysServiceProviderId(providerId); + String timeExpress = "5m";// 支付超时,线下扫码交易定义为5分钟 + + // 商品明细列表,需填写购买商品详细信息, + List goodsDetailList = new ArrayList(); + if (roncooPayGoodsDetailses != null && roncooPayGoodsDetailses.size() > 0){ + for (RoncooPayGoodsDetails roncooPayGoodsDetails : roncooPayGoodsDetailses){ + // 创建一个商品信息,参数含义分别为商品id(使用国标)、名称、单价(单位为分)、数量,如果需要添加商品类别,详见GoodsDetail + GoodsDetail goods = GoodsDetail.newInstance(roncooPayGoodsDetails.getGoodsId(), roncooPayGoodsDetails.getGoodsName(), roncooPayGoodsDetails.getSinglePrice(), roncooPayGoodsDetails.getNums()); + // 创建好一个商品后添加至商品明细列表 + goodsDetailList.add(goods); + } + } + + // 创建请求builder,设置请求参数 + AlipayTradePayContentBuilder builder = new AlipayTradePayContentBuilder() + .setOutTradeNo(outTradeNo) + .setSubject(subject) + .setAuthCode(authCode) + .setTotalAmount(totalAmount) + .setStoreId(storeId) + .setUndiscountableAmount(undiscountableAmount) + .setBody(body) + .setExtendParams(extendParams) + .setGoodsDetailList(goodsDetailList) + .setTimeExpress(timeExpress); + + // 调用tradePay方法获取当面付应答 + AlipayF2FPayResult result = tradeService.tradePay(builder); + switch (result.getTradeStatus()) { + case SUCCESS: + LOG.info("支付宝支付成功: )"); + returnMap.put("status",TradeStatusEnum.SUCCESS.name()); + returnMap.put("bankTrxNo",result.getResponse().getTradeNo()); + break; + + case FAILED: + LOG.error("支付宝支付失败!!!"); + returnMap.put("status",TradeStatusEnum.FAILED.name()); + break; + + case UNKNOWN: + returnMap.put("status", TradeStatusEnum.WAITING_PAYMENT.name());//未知支付状态的订单,置为等待支付状态 + LOG.error("系统异常,订单状态未知!!!"); + break; + + default: + returnMap.put("status",TradeStatusEnum.FAILED.name()); + LOG.error("不支持的交易状态,交易返回异常!!!"); + break; + } + + returnMap.put("bankReturnMsg",result.getResponse() == null ? "" : result.getResponse().getBody());//银行返回信息 + return returnMap; + } + + + /** + * 根据商户订单号查询商户 + * @param outTradeNo + */ + public void f2fPayquery(String outTradeNo) { + + AlipayF2FQueryResult result = tradeService.queryTradeResult(outTradeNo); + switch (result.getTradeStatus()) { + case SUCCESS: + LOG.info("查询返回该订单支付成功: )"); + + AlipayTradeQueryResponse response = result.getResponse(); + dumpResponse(response); + + LOG.info(response.getTradeStatus()); + if (Utils.isListNotEmpty(response.getFundBillList())) { + for (TradeFundBill bill : response.getFundBillList()) { + LOG.info(bill.getFundChannel() + ":" + bill.getAmount()); + } + } + break; + + case FAILED: + LOG.error("查询返回该订单支付失败或被关闭!!!"); + break; + + case UNKNOWN: + LOG.error("系统异常,订单支付状态未知!!!"); + break; + + default: + LOG.error("不支持的交易状态,交易返回异常!!!"); + break; + } + } + + public void dumpResponse(AlipayResponse response) { + if (response != null) { + LOG.info(String.format("code:%s, msg:%s", response.getCode(), response.getMsg())); + if (StringUtils.isNotEmpty(response.getSubCode())) { + LOG.info(String.format("subCode:%s, subMsg:%s", response.getSubCode(), response.getSubMsg())); + } + LOG.info("body:" + response.getBody()); + } + } + + +} diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/utils/alipay/util/AliPayUtil.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/utils/alipay/util/AliPayUtil.java index ce7c1f18..13b88be2 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/utils/alipay/util/AliPayUtil.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/utils/alipay/util/AliPayUtil.java @@ -1,6 +1,5 @@ package com.roncoo.pay.trade.utils.alipay.util; -import javax.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.Iterator; import java.util.Map; diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/vo/F2FPayResultVo.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/vo/F2FPayResultVo.java new file mode 100644 index 00000000..82b472ef --- /dev/null +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/trade/vo/F2FPayResultVo.java @@ -0,0 +1,166 @@ +package com.roncoo.pay.trade.vo; + +import com.roncoo.pay.trade.enums.TradeStatusEnum; + +/** + * 功能说明: + * + * + * @author Peter + * 龙果学院(www.roncoo.com) + */ +public class F2FPayResultVo { + + /** + * 交易状态 + */ + private String status; + + /** + * 交易流水号流水号 + */ + private String trxNo; + + /** + * 商户订单号 + */ + private String orderNo; + + /** + * 支付KEY + */ + private String payKey; + + /** 产品名称 **/ + private String productName; + + /** 支付备注 **/ + private String remark; + + /** 下单Ip **/ + private String orderIp; + + /** 备注字段1 **/ + private String field1; + + /** 备注字段2 **/ + private String field2; + + /** 备注字段3 **/ + private String field3; + + /** 备注字段4 **/ + private String field4; + + /** 备注字段5 **/ + private String field5; + + /** + * 签名数据 + */ + private String sign; + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getTrxNo() { + return trxNo; + } + + public void setTrxNo(String trxNo) { + this.trxNo = trxNo; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getPayKey() { + return payKey; + } + + public void setPayKey(String payKey) { + this.payKey = payKey; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getOrderIp() { + return orderIp; + } + + public void setOrderIp(String orderIp) { + this.orderIp = orderIp; + } + + public String getField1() { + return field1; + } + + public void setField1(String field1) { + this.field1 = field1; + } + + public String getField2() { + return field2; + } + + public void setField2(String field2) { + this.field2 = field2; + } + + public String getField3() { + return field3; + } + + public void setField3(String field3) { + this.field3 = field3; + } + + public String getField4() { + return field4; + } + + public void setField4(String field4) { + this.field4 = field4; + } + + public String getField5() { + return field5; + } + + public void setField5(String field5) { + this.field5 = field5; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/user/entity/RpUserPayInfo.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/user/entity/RpUserPayInfo.java index 43749c9e..d944f61f 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/user/entity/RpUserPayInfo.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/user/entity/RpUserPayInfo.java @@ -58,8 +58,46 @@ public class RpUserPayInfo extends BaseEntity implements Serializable { private String payWayCode; private String payWayName; + + /** + * 支付宝线下产品appid + */ + private String offlineAppId; + /** + * 支付宝私钥 + */ + private String rsaPrivateKey; + + /** + * 支付宝公钥 + */ + private String rsaPublicKey; + + public String getOfflineAppId() { + return offlineAppId; + } + + public void setOfflineAppId(String offlineAppId) { + this.offlineAppId = offlineAppId; + } + + public String getRsaPrivateKey() { + return rsaPrivateKey; + } + + public void setRsaPrivateKey(String rsaPrivateKey) { + this.rsaPrivateKey = rsaPrivateKey; + } + + public String getRsaPublicKey() { + return rsaPublicKey; + } + + public void setRsaPublicKey(String rsaPublicKey) { + this.rsaPublicKey = rsaPublicKey; + } - public String getPayWayCode() { + public String getPayWayCode() { return payWayCode; } diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/user/service/RpUserPayConfigService.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/user/service/RpUserPayConfigService.java index 08d29a4a..9a24e633 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/user/service/RpUserPayConfigService.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/user/service/RpUserPayConfigService.java @@ -85,7 +85,8 @@ public interface RpUserPayConfigService{ * 创建用户支付配置 */ void createUserPayConfig(String userNo, String userName, String productCode, String productName, Integer riskDay, String fundIntoType, - String isAutoSett, String appId, String merchantId, String partnerKey, String ali_partner, String ali_sellerId, String ali_key) throws PayBizException; + String isAutoSett, String appId, String merchantId, String partnerKey, String ali_partner, String ali_sellerId, String ali_key, + String ali_appid, String ali_rsaPrivateKey, String ali_rsaPublicKey) throws PayBizException; /** * 删除支付产品 @@ -97,7 +98,8 @@ void createUserPayConfig(String userNo, String userName, String productCode, Str * 修改用户支付配置 */ void updateUserPayConfig(String userNo, String productCode, String productName, Integer riskDay, String fundIntoType, - String isAutoSett, String appId, String merchantId, String partnerKey, String ali_partner, String ali_sellerId, String ali_key) throws PayBizException; + String isAutoSett, String appId, String merchantId, String partnerKey, String ali_partner, String ali_sellerId, String ali_key, + String ali_appid, String ali_rsaPrivateKey, String ali_rsaPublicKey) throws PayBizException; /** * 审核 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 19109031..99c82446 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 @@ -71,6 +71,7 @@ public RpUserInfo getDataById(String id) { @Override public PageBean listPage(PageParam pageParam, RpUserInfo rpUserInfo) { Map paramMap = new HashMap(); + paramMap.put("userNo", rpUserInfo.getUserNo()); return rpUserInfoDao.listPage(pageParam, paramMap); } diff --git a/roncoo-pay-service/src/main/java/com/roncoo/pay/user/service/impl/RpUserPayConfigServiceImpl.java b/roncoo-pay-service/src/main/java/com/roncoo/pay/user/service/impl/RpUserPayConfigServiceImpl.java index eeb278de..46169f50 100644 --- a/roncoo-pay-service/src/main/java/com/roncoo/pay/user/service/impl/RpUserPayConfigServiceImpl.java +++ b/roncoo-pay-service/src/main/java/com/roncoo/pay/user/service/impl/RpUserPayConfigServiceImpl.java @@ -136,7 +136,7 @@ public List listByProductCode(String productCode, String auditS @Override public void createUserPayConfig(String userNo, String userName, String productCode, String productName, Integer riskDay, String fundIntoType, String isAutoSett, String appId, String merchantId, String partnerKey, - String ali_partner, String ali_sellerId, String ali_key) throws PayBizException{ + String ali_partner, String ali_sellerId, String ali_key, String ali_appid, String ali_rsaPrivateKey, String ali_rsaPublicKey) throws PayBizException{ RpUserPayConfig payConfig = rpUserPayConfigDao.getByUserNo(userNo, null); if(payConfig != null){ @@ -208,6 +208,9 @@ public void createUserPayConfig(String userNo, String userName, String productCo rpUserPayInfo.setUserNo(userNo); rpUserPayInfo.setUserName(userName); rpUserPayInfo.setStatus(PublicStatusEnum.ACTIVE.name()); + rpUserPayInfo.setOfflineAppId(ali_appid); + rpUserPayInfo.setRsaPrivateKey(ali_rsaPrivateKey); + rpUserPayInfo.setRsaPublicKey(ali_rsaPublicKey); rpUserPayInfoService.saveData(rpUserPayInfo); }else{ rpUserPayInfo.setEditTime(new Date()); @@ -216,6 +219,9 @@ public void createUserPayConfig(String userNo, String userName, String productCo rpUserPayInfo.setPartnerKey(ali_key); rpUserPayInfo.setPayWayCode(PayWayEnum.ALIPAY.name()); rpUserPayInfo.setPayWayName(PayWayEnum.ALIPAY.getDesc()); + rpUserPayInfo.setOfflineAppId(ali_appid); + rpUserPayInfo.setRsaPrivateKey(ali_rsaPrivateKey); + rpUserPayInfo.setRsaPublicKey(ali_rsaPublicKey); rpUserPayInfoService.updateData(rpUserPayInfo); } } @@ -248,7 +254,7 @@ public void deleteUserPayConfig(String userNo) throws PayBizException{ @Override public void updateUserPayConfig(String userNo, String productCode, String productName, Integer riskDay, String fundIntoType, String isAutoSett, String appId, String merchantId, String partnerKey, - String ali_partner, String ali_sellerId, String ali_key) throws PayBizException{ + String ali_partner, String ali_sellerId, String ali_key, String ali_appid, String ali_rsaPrivateKey, String ali_rsaPublicKey) throws PayBizException{ RpUserPayConfig rpUserPayConfig = rpUserPayConfigDao.getByUserNo(userNo, null); if(rpUserPayConfig == null){ throw new PayBizException(PayBizException.USER_PAY_CONFIG_IS_NOT_EXIST,"用户支付配置不存在"); @@ -312,6 +318,9 @@ public void updateUserPayConfig(String userNo, String productCode, String produc rpUserPayInfo.setUserNo(userNo); rpUserPayInfo.setUserName(rpUserPayConfig.getUserName()); rpUserPayInfo.setStatus(PublicStatusEnum.ACTIVE.name()); + rpUserPayInfo.setOfflineAppId(ali_appid); + rpUserPayInfo.setRsaPrivateKey(ali_rsaPrivateKey); + rpUserPayInfo.setRsaPublicKey(ali_rsaPublicKey); rpUserPayInfoService.saveData(rpUserPayInfo); }else{ rpUserPayInfo.setEditTime(new Date()); @@ -320,6 +329,9 @@ public void updateUserPayConfig(String userNo, String productCode, String produc rpUserPayInfo.setPartnerKey(ali_key); rpUserPayInfo.setPayWayCode(PayWayEnum.ALIPAY.name()); rpUserPayInfo.setPayWayName(PayWayEnum.ALIPAY.getDesc()); + rpUserPayInfo.setOfflineAppId(ali_appid); + rpUserPayInfo.setRsaPrivateKey(ali_rsaPrivateKey); + rpUserPayInfo.setRsaPublicKey(ali_rsaPublicKey); rpUserPayInfoService.updateData(rpUserPayInfo); } } diff --git a/roncoo-pay-service/src/main/resources/alipay_config.properties b/roncoo-pay-service/src/main/resources/alipay_config.properties index 2b1e1f1f..5ff2f93a 100644 --- a/roncoo-pay-service/src/main/resources/alipay_config.properties +++ b/roncoo-pay-service/src/main/resources/alipay_config.properties @@ -1,10 +1,10 @@ ################################################# 支付宝分页查询账单配置 ##################################################### #合作身份者ID,签约账号,以2088开头由16位纯数字组成的字符串,查看地址:https://b.alipay.com/order/pidAndKey.htm -partner=222222 +partner=111111111 #MD5密钥,安全检验码,由数字和字母组成的32位字符串,查看地址:https://b.alipay.com/order/pidAndKey.htm -key=1111111111 +key=2222222222 #支付宝提供给商户的服务接入网关URL(新) alipay_gateway_new=https\://mapi.alipay.com/gateway.do? @@ -19,7 +19,7 @@ log_path=C\:\\ input_charset=utf-8 #收款支付宝账号,以2088开头由16位纯数字组成的字符串,一般情况下收款账号就是签约账号 -seller_id=3333333 +seller_id=3333333333 #支付宝消息验证地址 https_verify_url=https\://mapi.alipay.com/gateway.do?service\=notify_verify& diff --git a/roncoo-pay-service/src/main/resources/mybatis/mapper/account/RpAccountMapper.xml b/roncoo-pay-service/src/main/resources/mybatis/mapper/account/RpAccountMapper.xml index ecdb7fda..6be2523a 100644 --- a/roncoo-pay-service/src/main/resources/mybatis/mapper/account/RpAccountMapper.xml +++ b/roncoo-pay-service/src/main/resources/mybatis/mapper/account/RpAccountMapper.xml @@ -81,10 +81,10 @@ and create_time_ between #{beginDate} AND CONCAT(#{endDate},' 23:59:59') - and account_no_ = #{accountNo} + and account_no = #{accountNo} and status = #{status} and user_no = #{userNo} - and account_type_ = #{accountType} + and account_type = #{accountType} and user_no not in diff --git a/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsMenuMapper.xml b/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsMenuMapper.xml index f1460da9..8e617f8f 100644 --- a/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsMenuMapper.xml +++ b/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsMenuMapper.xml @@ -39,7 +39,7 @@ where ID = #{id} and VERSION = #{version} - + delete from where ID = #{id} diff --git a/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsMenuRoleMapper.xml b/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsMenuRoleMapper.xml index 76ffcbdc..56b9d4dc 100644 --- a/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsMenuRoleMapper.xml +++ b/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsMenuRoleMapper.xml @@ -36,8 +36,12 @@ diff --git a/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsOperatorMapper.xml b/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsOperatorMapper.xml index 36ea078f..ce396dcd 100644 --- a/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsOperatorMapper.xml +++ b/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsOperatorMapper.xml @@ -4,7 +4,7 @@ PMS_OPERATOR - PMS_OPERATOR_ROLE + PMS_ROLE_OPERATOR @@ -72,7 +72,7 @@ order by ID - + delete from where ID = #{id} @@ -82,7 +82,7 @@ and login_name = #{loginName} and status = #{status} - and type = #{type} + and type = #{type} and REALNAME like CONCAT(CONCAT('%', #{realName}), '%') @@ -110,7 +110,7 @@ select O.* from O LEFT JOIN - + RO ON O.ID = RO.operator_id WHERE RO.role_id = #{roleId} diff --git a/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsPermissionMapper.xml b/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsPermissionMapper.xml index ad13afe4..9846b2af 100644 --- a/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsPermissionMapper.xml +++ b/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsPermissionMapper.xml @@ -84,9 +84,16 @@ where permission = #{permission} and id != #{id} + + - - + delete from where id = #{id} @@ -108,7 +115,7 @@ - + order by create_time desc limit #{pageFirst}, #{pageSize} @@ -120,5 +127,14 @@ + \ No newline at end of file diff --git a/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsRoleMapper.xml b/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsRoleMapper.xml index a993550e..b7b87cb4 100644 --- a/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsRoleMapper.xml +++ b/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsRoleMapper.xml @@ -75,7 +75,7 @@ order by id - + delete from where id = #{id} diff --git a/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsRolePermissionMapper.xml b/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsRolePermissionMapper.xml index a7471165..32eb52b3 100644 --- a/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsRolePermissionMapper.xml +++ b/roncoo-pay-service/src/main/resources/mybatis/mapper/permission/PmsRolePermissionMapper.xml @@ -63,5 +63,11 @@ where role_id = #{roleId} + + + delete from + + where role_id = #{roleId} and permission_id = #{permissionId} + \ No newline at end of file diff --git a/roncoo-pay-service/src/main/resources/mybatis/mapper/user/RpUserPayInfoMapper.xml b/roncoo-pay-service/src/main/resources/mybatis/mapper/user/RpUserPayInfoMapper.xml index 7a738ba4..002be684 100644 --- a/roncoo-pay-service/src/main/resources/mybatis/mapper/user/RpUserPayInfoMapper.xml +++ b/roncoo-pay-service/src/main/resources/mybatis/mapper/user/RpUserPayInfoMapper.xml @@ -17,11 +17,14 @@ - + + + id_, create_time, edit_time, version, remark, status, app_id, app_sectet, merchant_id, - app_type, user_no, user_name, partner_key, pay_way_code, pay_way_name + app_type, user_no, user_name, partner_key, pay_way_code, pay_way_name, offline_app_id, rsa_private_key, + rsa_public_key + + APPID: + + + + 支付宝私钥: + + + + 支付宝公钥: + + @@ -134,6 +146,9 @@ $("#ali_partner").attr("class", ""); $("#ali_sellerId").attr("class", ""); $("#ali_key").attr("class", ""); + $("#ali_appid").attr("class", ""); + $("#ali_rsaPrivateKey").attr("class", ""); + $("#ali_rsaPublicKey").attr("class", ""); if(fundIntoType == 'MERCHANT_RECEIVES'){ if(productCode != ""){ $.ajax({ @@ -157,6 +172,9 @@ $("#ali_partner").attr("class", "required"); $("#ali_sellerId").attr("class", "required"); $("#ali_key").attr("class", "required"); + $("#ali_appid").attr("class", "required"); + $("#ali_rsaPrivateKey").attr("class", "required"); + $("#ali_rsaPublicKey").attr("class", "required"); } } } diff --git a/roncoo-pay-web-boss/src/main/webapp/jsp/pay/config/edit.jsp b/roncoo-pay-web-boss/src/main/webapp/jsp/pay/config/edit.jsp index 1caf653e..53b0f3e7 100644 --- a/roncoo-pay-web-boss/src/main/webapp/jsp/pay/config/edit.jsp +++ b/roncoo-pay-web-boss/src/main/webapp/jsp/pay/config/edit.jsp @@ -93,6 +93,18 @@ 收款账号: + + APPID: + + + + 支付宝私钥: + + + + 支付宝公钥: + + @@ -133,6 +145,9 @@ function changeWePay(){ $("#ali_partner").attr("class", ""); $("#ali_sellerId").attr("class", ""); $("#ali_key").attr("class", ""); + $("#ali_appid").attr("class", ""); + $("#ali_rsaPrivateKey").attr("class", ""); + $("#ali_rsaPublicKey").attr("class", ""); if(fundIntoType == 'MERCHANT_RECEIVES'){ if(productCode != ""){ @@ -157,6 +172,9 @@ function changeWePay(){ $("#ali_partner").attr("class", "required"); $("#ali_sellerId").attr("class", "required"); $("#ali_key").attr("class", "required"); + $("#ali_appid").attr("class", "required"); + $("#ali_rsaPrivateKey").attr("class", "required"); + $("#ali_rsaPublicKey").attr("class", "required"); } } } diff --git a/roncoo-pay-web-boss/src/main/webapp/jsp/pms/PmsMenuLookUp.jsp b/roncoo-pay-web-boss/src/main/webapp/jsp/pms/PmsMenuLookUp.jsp deleted file mode 100644 index 4613b921..00000000 --- a/roncoo-pay-web-boss/src/main/webapp/jsp/pms/PmsMenuLookUp.jsp +++ /dev/null @@ -1,34 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@include file="/page/inc/taglib.jsp"%> - - - - -菜单模块 - - - - - -
- -
- -
-
-
-
- ${tree } -
-
-
-
-
-
- \ No newline at end of file diff --git a/roncoo-pay-web-boss/src/main/webapp/jsp/pms/PmsOperatorChangeOwnPwd.jsp b/roncoo-pay-web-boss/src/main/webapp/jsp/pms/PmsOperatorChangeOwnPwd.jsp deleted file mode 100644 index 2d5515f0..00000000 --- a/roncoo-pay-web-boss/src/main/webapp/jsp/pms/PmsOperatorChangeOwnPwd.jsp +++ /dev/null @@ -1,36 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@include file="../../common/taglib/taglib.jsp"%> -
-
-
- - - -
- - -
-
- - -
-
- - -
-
-
-
- - 提示:修改密码后要重新登录才能操作! -
-
-
-
    -
  • -
    -
  • -
-
-
-
diff --git a/roncoo-pay-web-boss/src/main/webapp/jsp/pms/PmsOperatorViewOwnInfo.jsp b/roncoo-pay-web-boss/src/main/webapp/jsp/pms/PmsOperatorViewOwnInfo.jsp deleted file mode 100644 index f31562e1..00000000 --- a/roncoo-pay-web-boss/src/main/webapp/jsp/pms/PmsOperatorViewOwnInfo.jsp +++ /dev/null @@ -1,65 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@include file="../../common/taglib/taglib.jsp"%> -
-
-
-

- - ${loginName } -

-

- - ${realName } -

-

- - -

-

- - ${mobileNo } -

-

- - - 激活 - 冻结 - -- - -

-

- - - 普通操作员 - 超级管理员 - -- - -

-

- - -

-

- - -

-

- - - - - -- - -

-

- - ${remark } -

-
-
-
    -
  • -
-
-
-
\ No newline at end of file diff --git a/roncoo-pay-web-boss/src/main/webapp/jsp/pms/assignMenuUI.jsp b/roncoo-pay-web-boss/src/main/webapp/jsp/pms/assignMenuUI.jsp new file mode 100644 index 00000000..9f7b6b31 --- /dev/null +++ b/roncoo-pay-web-boss/src/main/webapp/jsp/pms/assignMenuUI.jsp @@ -0,0 +1,113 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@include file="../../common/taglib/taglib.jsp"%> +
+
+
+ + + + + +
+
+
+ +
+
+
+
+
+
+ 全选 + + + +
+
+
+
+
+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
序号登录名用户姓名
${st.index+1}${item.loginName }${item.realName }
+
+
+
+
+
+
+
    +
  • +
  • +
+
+
+
+ diff --git a/roncoo-pay-web-boss/src/main/webapp/jsp/pms/assignPermissionUI.jsp b/roncoo-pay-web-boss/src/main/webapp/jsp/pms/assignPermissionUI.jsp index 285373b1..baca4c77 100644 --- a/roncoo-pay-web-boss/src/main/webapp/jsp/pms/assignPermissionUI.jsp +++ b/roncoo-pay-web-boss/src/main/webapp/jsp/pms/assignPermissionUI.jsp @@ -1,22 +1,32 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="../../common/taglib/taglib.jsp"%>
+
- - + + + +
- ${menuActionTree } +
+ 全选 + + + +
@@ -43,13 +53,13 @@ - + ${st.index+1} - ${loginName } - ${realName } + ${item.loginName } + ${item.realName } - +
@@ -59,56 +69,45 @@
    -
  • +
+
diff --git a/roncoo-pay-web-boss/src/main/webapp/jsp/pms/pmsMenuAdd.jsp b/roncoo-pay-web-boss/src/main/webapp/jsp/pms/pmsMenuAdd.jsp index 66915e56..7f9d2402 100644 --- a/roncoo-pay-web-boss/src/main/webapp/jsp/pms/pmsMenuAdd.jsp +++ b/roncoo-pay-web-boss/src/main/webapp/jsp/pms/pmsMenuAdd.jsp @@ -11,6 +11,7 @@ +

diff --git a/roncoo-pay-web-boss/src/main/webapp/jsp/pms/pmsMenuList.jsp b/roncoo-pay-web-boss/src/main/webapp/jsp/pms/pmsMenuList.jsp index fd12a9e8..f643f66a 100644 --- a/roncoo-pay-web-boss/src/main/webapp/jsp/pms/pmsMenuList.jsp +++ b/roncoo-pay-web-boss/src/main/webapp/jsp/pms/pmsMenuList.jsp @@ -71,7 +71,7 @@ ul.rightTools li { \ No newline at end of file diff --git a/roncoo-pay-web-boss/src/main/webapp/jsp/system/login.jsp b/roncoo-pay-web-boss/src/main/webapp/jsp/system/login.jsp index 15600778..639704c5 100644 --- a/roncoo-pay-web-boss/src/main/webapp/jsp/system/login.jsp +++ b/roncoo-pay-web-boss/src/main/webapp/jsp/system/login.jsp @@ -74,10 +74,6 @@ -

-



请先到龙果学院注册, 然后使用注册账户登录! - -