Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
youka-api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
java-youka-wallet
youka-api
Commits
2fedb02f
Commit
2fedb02f
authored
Apr 09, 2018
by
Java-聂换换
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商户进件
parent
40e2dddb
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
405 additions
and
6 deletions
+405
-6
ComCode.java
src/main/java/com/thinkgem/jeesite/common/constant/ComCode.java
+8
-0
MerchantsEntering.java
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/dto/MerchantsEntering.java
+33
-0
JuHeZhongPayIntegralService.java
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/service/JuHeZhongPayIntegralService.java
+98
-0
DateUtil.java
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/utils/DateUtil.java
+40
-0
HttpUtil.java
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/utils/HttpUtil.java
+92
-1
MakeOrderNum.java
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/utils/MakeOrderNum.java
+54
-0
OrderService.java
src/main/java/com/thinkgem/jeesite/modules/pay/service/OrderService.java
+7
-2
UserApiDao.java
src/main/java/com/thinkgem/jeesite/modules/user/dao/UserApiDao.java
+2
-0
UserApiService.java
src/main/java/com/thinkgem/jeesite/modules/user/service/UserApiService.java
+47
-1
UserDao.xml
src/main/resources/mappings/modules/user/UserDao.xml
+24
-2
No files found.
src/main/java/com/thinkgem/jeesite/common/constant/ComCode.java
View file @
2fedb02f
...
@@ -29,6 +29,14 @@ public class ComCode {
...
@@ -29,6 +29,14 @@ public class ComCode {
public
static
final
String
EXTRA_RATE
=
"200"
;
// 附加手续费(单位:分)
public
static
final
String
EXTRA_RATE
=
"200"
;
// 附加手续费(单位:分)
public
static
final
String
INTEGRAL_MERCHANT_ID
=
"100532502191215"
;
// 商户号
public
static
final
String
INTEGRAL_MERCHANT_KEY
=
"781ed0d6-9657-404c-9f91-79eff2e0b782"
;
//"670993bf-dd22-4464-9d81-69595d36b794"; // 商户key
public
static
final
String
INTEGRAL_MERCHANT_SECRET
=
"0033fc8d-161b-4e97-87de-efed7a34bdea"
;
//"289ada73-27db-49e0-b2ad-3ae1613a665a"; // 商户sescet
public
static
final
String
INTEGRAL_QUICK_PAY_URL
=
"/quick/pay"
;
// 积分快捷支付
public
static
final
String
INTEGRAL_ORDER_QUERY_URL
=
"/order/query"
;
// 积分查询订单
//快捷处理
public
static
final
String
INTEGRAL_MERCHANT_REG_URL
=
"/api/quick/pay/handle"
;
/**
/**
* duolabao相关参数
* duolabao相关参数
...
...
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/dto/MerchantsEntering.java
0 → 100644
View file @
2fedb02f
package
com
.
thinkgem
.
jeesite
.
modules
.
pay
.
juhezhong
.
dto
;
import
java.math.BigDecimal
;
public
class
MerchantsEntering
extends
CommonDto
{
private
String
subMchId
;
//子商户号
private
String
subMerchantName
;
// 商户名称
private
String
serviceType
;
// 操作类型 1(参考附录)
private
String
idType
;
//证件类型
private
String
accName
;
//持卡人姓名
private
String
accNo
;
//卡号
private
String
accProvince
;
//开通省份
private
String
accCity
;
//开通城市
private
String
mobile
;
//预留手机号
private
String
idNo
;
//证件号码
private
BigDecimal
settleRate
;
//结算费率
private
BigDecimal
extraRate
;
//T0费率
private
Integer
accType
;
//账户类型
private
String
bankCode
;
}
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/service/JuHeZhongPayIntegralService.java
0 → 100644
View file @
2fedb02f
package
com
.
thinkgem
.
jeesite
.
modules
.
pay
.
juhezhong
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.thinkgem.jeesite.common.constant.ComCode
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.dto.CommonDto
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.dto.MerchantDto
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.dto.MerchantsEntering
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.utils.Bean2Map
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.utils.SignUtils
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.utils.HttpUtil
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.utils.*
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Map
;
@Transactional
@Service
public
class
JuHeZhongPayIntegralService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
Logger
.
class
);
/**
* 查询订单状态
*
* @param dto
* @return
* @throws Exception
*/
public
JSONObject
query
(
CommonDto
dto
)
throws
Exception
{
dto
.
setMerchantId
(
ComCode
.
MERCHANT_ID
);
dto
.
setMerchantKey
(
ComCode
.
INTEGRAL_MERCHANT_KEY
);
Map
<
String
,
Object
>
params
=
Bean2Map
.
Entity2Map
(
dto
);
String
signBefore
=
SignUtils
.
signBefore
(
params
);
String
sign
=
SignUtils
.
sign
(
signBefore
,
ComCode
.
INTEGRAL_MERCHANT_SECRET
);
params
.
put
(
"sign"
,
sign
);
String
respStr
=
HttpUtil
.
post
(
ComCode
.
HOST
+
ComCode
.
INTEGRAL_ORDER_QUERY_URL
,
params
);
logger
.
info
(
"respStr:{}"
,
respStr
);
return
JSONObject
.
parseObject
(
respStr
);
}
public
JSONObject
quickPayHandle
(
JSONObject
dto
)
throws
Exception
{
dto
.
put
(
"merchantId"
,
ComCode
.
INTEGRAL_MERCHANT_ID
);
dto
.
put
(
"timestamp"
,
System
.
currentTimeMillis
());
String
signBefore
=
SignUtils
.
signBefore
(
dto
);
String
sign
=
SignUtils
.
sign
(
signBefore
,
ComCode
.
INTEGRAL_MERCHANT_SECRET
);
dto
.
put
(
"sign"
,
sign
);
logger
.
info
(
"signBefore:{},sign:{}"
,
signBefore
,
sign
);
String
respStr
=
HttpUtil
.
post
(
ComCode
.
HOST
+
ComCode
.
INTEGRAL_MERCHANT_REG_URL
,
dto
.
toJSONString
());
System
.
out
.
println
(
respStr
);
return
JSONObject
.
parseObject
(
respStr
);
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
// JSONObject dto = new JSONObject();
// dto.put("orderId","12323243435545465");
// dto.put("serviceType","4");
// dto.put("","");
// JuHeZhongPayIntegralService juHeZhongPayIntegralService = new JuHeZhongPayIntegralService();
// JSONObject jsonObject = juHeZhongPayIntegralService.quickPayHandle(dto);
// System.out.println(jsonObject.toJSONString());
JuHeZhongPayIntegralService
juHeZhongPayIntegralService
=
new
JuHeZhongPayIntegralService
();
JSONObject
dto
=
new
JSONObject
();
dto
.
put
(
"orderId"
,
MakeOrderNum
.
makeOrderNum
());
//标识请求唯一(非订单号)
dto
.
put
(
"serviceType"
,
1
);
//服务类型
dto
.
put
(
"merchantId"
,
ComCode
.
INTEGRAL_MERCHANT_ID
);
//商户号
dto
.
put
(
"subMerchantName"
,
"niehh"
);
//对公的就按照营业执照的注册名称进行商户名的报备进件,个体户的需要突出省,市,区一级营业范围,如:“XX市+XX区+法人名称+营业范围”--例“北京市朝阳区洪新阳饭店”而且一个身份证不要重复入很多个做银联二维码交易的商户 原则上一个身份证下只有一个做银联二维码交易的户,23:00—7:00,这段时间,银联二维码可以交易,不结算
dto
.
put
(
"accName"
,
"聂换换"
);
//开户名称
dto
.
put
(
"accNo"
,
"6217000180000770507"
);
//开户账号
dto
.
put
(
"accType"
,
1
);
//1=个人账户 0=企业账户1=个人账户
dto
.
put
(
"bankName"
,
"建设银行"
);
//开户银行名(支行全称)
dto
.
put
(
"bankCode"
,
"105100000017"
);
//联行号
dto
.
put
(
"mobile"
,
"13722537737"
);
dto
.
put
(
"idNo"
,
"130434199212214429"
);
//身份证号
dto
.
put
(
"settleType"
,
"795934"
);
//费率类型 795934
dto
.
put
(
"address"
,
"天津市河西区"
);
//地址
dto
.
put
(
"merchantKey"
,
ComCode
.
INTEGRAL_MERCHANT_KEY
);
//商户key
dto
.
put
(
"timestamp"
,
System
.
currentTimeMillis
());
//时间戳
JSONObject
jsonObject
=
juHeZhongPayIntegralService
.
quickPayHandle
(
dto
);
String
signBefore
=
SignUtils
.
signBefore
(
jsonObject
);
String
sign
=
SignUtils
.
sign
(
signBefore
,
ComCode
.
INTEGRAL_MERCHANT_SECRET
);
//B105004538
System
.
out
.
println
(
jsonObject
.
toJSONString
());
}
}
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/utils/DateUtil.java
0 → 100644
View file @
2fedb02f
package
com
.
thinkgem
.
jeesite
.
modules
.
pay
.
juhezhong
.
utils
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
/**
* @author lsw
* @date 2016年1月3日
* @version 1.0
* @desc 日期工具类
*/
public
class
DateUtil
{
/**
* 将时间格式化成指定的字符串
*
* @param date
* @param ftm
* @return
*/
public
static
String
format2str
(
Date
date
,
String
ftm
)
{
return
new
SimpleDateFormat
(
ftm
).
format
(
date
);
}
/**
* 装字符串格式化成指定日期时间
* @param value
* @param fmt
* @return
*/
public
static
Date
string2Date
(
String
value
,
String
fmt
){
try
{
return
new
SimpleDateFormat
(
fmt
).
parse
(
value
);
}
catch
(
ParseException
e
)
{
}
return
new
Date
();
}
}
\ No newline at end of file
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/utils/HttpUtil.java
View file @
2fedb02f
...
@@ -4,17 +4,24 @@ import org.apache.http.HttpEntity;
...
@@ -4,17 +4,24 @@ import org.apache.http.HttpEntity;
import
org.apache.http.HttpResponse
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.HttpStatus
;
import
org.apache.http.HttpStatus
;
import
org.apache.http.NameValuePair
;
import
org.apache.http.NameValuePair
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.client.entity.UrlEncodedFormEntity
;
import
org.apache.http.client.entity.UrlEncodedFormEntity
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.client.params.ClientPNames
;
import
org.apache.http.client.params.ClientPNames
;
import
org.apache.http.config.Registry
;
import
org.apache.http.config.RegistryBuilder
;
import
org.apache.http.conn.socket.ConnectionSocketFactory
;
import
org.apache.http.conn.socket.PlainConnectionSocketFactory
;
import
org.apache.http.conn.ssl.SSLConnectionSocketFactory
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.DefaultHttpClient
;
import
org.apache.http.impl.client.DefaultHttpClient
;
import
org.apache.http.impl.client.DefaultHttpRequestRetryHandler
;
import
org.apache.http.impl.client.DefaultHttpRequestRetryHandler
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.impl.conn.PoolingClientConnectionManager
;
import
org.apache.http.impl.conn.PoolingClientConnectionManager
;
import
org.apache.http.impl.conn.PoolingHttpClientConnectionManager
;
import
org.apache.http.message.BasicNameValuePair
;
import
org.apache.http.message.BasicNameValuePair
;
import
org.apache.http.params.BasicHttpParams
;
import
org.apache.http.params.BasicHttpParams
;
import
org.apache.http.params.CoreConnectionPNames
;
import
org.apache.http.params.CoreConnectionPNames
;
...
@@ -22,8 +29,12 @@ import org.apache.http.params.HttpParams;
...
@@ -22,8 +29,12 @@ import org.apache.http.params.HttpParams;
import
org.apache.http.util.EntityUtils
;
import
org.apache.http.util.EntityUtils
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
javax.net.ssl.SSLContext
;
import
javax.net.ssl.TrustManager
;
import
javax.net.ssl.X509TrustManager
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.security.cert.CertificateException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -37,10 +48,12 @@ import java.util.Map;
...
@@ -37,10 +48,12 @@ import java.util.Map;
public
class
HttpUtil
{
public
class
HttpUtil
{
private
static
final
org
.
slf4j
.
Logger
log
=
LoggerFactory
.
getLogger
(
HttpUtil
.
class
);
private
static
final
org
.
slf4j
.
Logger
log
=
LoggerFactory
.
getLogger
(
HttpUtil
.
class
);
private
static
PoolingHttpClientConnectionManager
cm
=
null
;
private
static
PoolingClientConnectionManager
conMgr
=
null
;
private
static
PoolingClientConnectionManager
conMgr
=
null
;
private
static
RequestConfig
defaultRequestConfig
=
null
;
static
{
static
{
HttpParams
params
=
new
BasicHttpParams
();
HttpParams
params
=
new
BasicHttpParams
();
Integer
CONNECTION_TIMEOUT
=
2
*
1000
;
//设置请求超时2秒钟 根据业务调整
Integer
CONNECTION_TIMEOUT
=
2
*
1000
;
//设置请求超时2秒钟 根据业务调整
...
@@ -56,6 +69,25 @@ public class HttpUtil {
...
@@ -56,6 +69,25 @@ public class HttpUtil {
conMgr
.
setMaxTotal
(
2000
);
conMgr
.
setMaxTotal
(
2000
);
conMgr
.
setDefaultMaxPerRoute
(
conMgr
.
getMaxTotal
());
conMgr
.
setDefaultMaxPerRoute
(
conMgr
.
getMaxTotal
());
try
{
//采用绕过验证的方式处理https请求
SSLContext
sslcontext
=
createIgnoreVerifySSL
();
Registry
<
ConnectionSocketFactory
>
socketFactoryRegistry
=
RegistryBuilder
.<
ConnectionSocketFactory
>
create
()
.
register
(
"https"
,
new
SSLConnectionSocketFactory
(
sslcontext
))
.
register
(
"http"
,
new
PlainConnectionSocketFactory
())
.
build
();
cm
=
new
PoolingHttpClientConnectionManager
(
socketFactoryRegistry
);
cm
.
setMaxTotal
(
2000
);
cm
.
setDefaultMaxPerRoute
(
20
);
defaultRequestConfig
=
RequestConfig
.
custom
()
.
setSocketTimeout
(
30000
)
.
setConnectTimeout
(
30000
)
.
setConnectionRequestTimeout
(
30000
)
.
setStaleConnectionCheckEnabled
(
true
)
.
build
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
public
static
String
get
(
String
url
,
String
param
)
{
public
static
String
get
(
String
url
,
String
param
)
{
...
@@ -159,6 +191,38 @@ public class HttpUtil {
...
@@ -159,6 +191,38 @@ public class HttpUtil {
}
}
}
}
public
static
String
post
(
String
url
,
String
json
)
throws
Exception
{
CloseableHttpClient
httpclient
=
HttpClients
.
custom
().
setConnectionManager
(
cm
).
build
();
HttpPost
httpPost
=
null
;
CloseableHttpResponse
response
=
null
;
String
str
=
""
;
try
{
httpPost
=
new
HttpPost
(
url
);
StringEntity
postingString
=
new
StringEntity
(
json
,
"UTF-8"
);
// json传递
httpPost
.
setEntity
(
postingString
);
httpPost
.
setHeader
(
"Content-type"
,
"application/json"
);
response
=
httpclient
.
execute
(
httpPost
);
try
{
HttpEntity
entity
=
response
.
getEntity
();
str
=
EntityUtils
.
toString
(
entity
,
"UTF-8"
);
log
.
debug
(
"httpclient调用状态:"
+
response
.
getStatusLine
());
log
.
debug
(
"httpclient调用结果{}"
,
str
);
// return EntityUtils.toString(response.getEntity());
return
str
;
}
finally
{
response
.
close
();
}
}
finally
{
if
(
response
!=
null
)
{
response
.
close
();
}
if
(
httpPost
!=
null
)
{
httpPost
.
releaseConnection
();
}
}
}
public
static
String
postRaw
(
String
url
,
String
json
)
throws
Exception
{
public
static
String
postRaw
(
String
url
,
String
json
)
throws
Exception
{
...
@@ -223,4 +287,31 @@ public class HttpUtil {
...
@@ -223,4 +287,31 @@ public class HttpUtil {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
private
static
SSLContext
createIgnoreVerifySSL
()
throws
Exception
{
SSLContext
sc
=
SSLContext
.
getInstance
(
"SSLv3"
);
// 实现一个X509TrustManager接口,用于绕过验证,不用修改里面的方法
X509TrustManager
trustManager
=
new
X509TrustManager
()
{
@Override
public
void
checkClientTrusted
(
java
.
security
.
cert
.
X509Certificate
[]
paramArrayOfX509Certificate
,
String
paramString
)
throws
CertificateException
{
}
@Override
public
void
checkServerTrusted
(
java
.
security
.
cert
.
X509Certificate
[]
paramArrayOfX509Certificate
,
String
paramString
)
throws
CertificateException
{
}
@Override
public
java
.
security
.
cert
.
X509Certificate
[]
getAcceptedIssuers
()
{
return
null
;
}
};
sc
.
init
(
null
,
new
TrustManager
[]{
trustManager
},
null
);
return
sc
;
}
}
}
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/utils/MakeOrderNum.java
0 → 100644
View file @
2fedb02f
package
com
.
thinkgem
.
jeesite
.
modules
.
pay
.
juhezhong
.
utils
;
import
java.util.Date
;
/**
* Created by lishi on 2017/11/1.
*/
public
class
MakeOrderNum
{
/**
* 锁对象,可以为任意对象
*/
private
static
Object
lockObj
=
"lockerOrder"
;
/**
* 订单号生成计数器
*/
private
static
long
orderNumCount
=
0L
;
/**
* 每毫秒生成订单号数量最大值
*/
private
static
int
maxPerMSECSize
=
1000
;
/**
* 订单号生成
*/
public
static
String
makeOrderNum
()
{
String
finOrderNum
=
""
;
try
{
// 最终生成的订单号
synchronized
(
lockObj
)
{
// 取系统当前时间作为订单号变量前半部分,精确到毫秒
long
nowLong
=
Long
.
parseLong
(
DateUtil
.
format2str
(
new
Date
(),
"yyyyMMddHHmmssSSS"
));
// 计数器到最大值归零,可扩展更大,目前1毫秒处理峰值1000个,1秒100万
if
(
orderNumCount
>=
maxPerMSECSize
)
{
orderNumCount
=
0L
;
}
//组装订单号
String
countStr
=
maxPerMSECSize
+
orderNumCount
+
""
;
finOrderNum
=
nowLong
+
countStr
.
substring
(
1
);
orderNumCount
++;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
finOrderNum
;
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
makeOrderNum
());
System
.
out
.
println
(
makeOrderNum
());
}
}
src/main/java/com/thinkgem/jeesite/modules/pay/service/OrderService.java
View file @
2fedb02f
...
@@ -26,16 +26,21 @@ public class OrderService {
...
@@ -26,16 +26,21 @@ public class OrderService {
public
List
<
OrderEntity
>
getOrderList
(
OrderRequest
request
){
public
List
<
OrderEntity
>
getOrderList
(
OrderRequest
request
){
if
(
request
.
getStartDate
()!=
null
&&
request
.
getStartDate
()
!=
0
){
if
(
request
.
getStartDate
()!=
null
&&
request
.
getStartDate
()
!=
0
){
request
.
setStartTime
(
DateUtils
.
formatDate
(
new
Date
(
request
.
getStartDate
()),
"yyyy-MM-dd"
)
+
" 00:00:00"
);
request
.
setStartTime
(
DateUtils
.
formatDate
(
new
Date
(
request
.
getStartDate
()
*
1000
),
"yyyy-MM-dd"
)
+
" 00:00:00"
);
}
}
if
(
request
.
getEndDate
()
!=
null
&&
request
.
getEndDate
()
!=
0
){
if
(
request
.
getEndDate
()
!=
null
&&
request
.
getEndDate
()
!=
0
){
request
.
setEndTime
(
DateUtils
.
formatDate
(
new
Date
(
request
.
getEndDate
()),
"yyyy-MM-dd"
)
+
" 23:59:59"
);
request
.
setEndTime
(
DateUtils
.
formatDate
(
new
Date
(
request
.
getEndDate
()
*
1000
),
"yyyy-MM-dd"
)
+
" 23:59:59"
);
}
}
return
orderApiDao
.
getOrderList
(
request
);
return
orderApiDao
.
getOrderList
(
request
);
}
}
public
static
void
main
(
String
[]
args
){
Date
date
=
new
Date
(
1522723599416L
);
System
.
out
.
println
(
new
Date
(
1522723775000
l
));
System
.
out
.
println
(
System
.
currentTimeMillis
());
}
}
}
src/main/java/com/thinkgem/jeesite/modules/user/dao/UserApiDao.java
View file @
2fedb02f
...
@@ -79,6 +79,8 @@ public interface UserApiDao {
...
@@ -79,6 +79,8 @@ public interface UserApiDao {
List
<
BelongBankEntity
>
getBelongBank
(
UserRequest
request
);
List
<
BelongBankEntity
>
getBelongBank
(
UserRequest
request
);
BelongBankEntity
getBelongBankEntity
(
UserRequest
request
);
Level
getLevelByUserLevel
(
UserRequest
request
);
Level
getLevelByUserLevel
(
UserRequest
request
);
}
}
src/main/java/com/thinkgem/jeesite/modules/user/service/UserApiService.java
View file @
2fedb02f
...
@@ -9,8 +9,10 @@ import com.thinkgem.jeesite.common.utils.MD5;
...
@@ -9,8 +9,10 @@ import com.thinkgem.jeesite.common.utils.MD5;
import
com.thinkgem.jeesite.modules.commonError.MyException
;
import
com.thinkgem.jeesite.modules.commonError.MyException
;
import
com.thinkgem.jeesite.modules.message.MessageUtils
;
import
com.thinkgem.jeesite.modules.message.MessageUtils
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.dto.MerchantDto
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.dto.MerchantDto
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.service.JuHeZhongPayIntegralService
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.service.JuHeZhongPayService
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.service.JuHeZhongPayService
;
import
com.thinkgem.jeesite.modules.pay.entity.RateEntity
;
import
com.thinkgem.jeesite.modules.pay.entity.RateEntity
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.utils.MakeOrderNum
;
import
com.thinkgem.jeesite.modules.user.bean.IdentityCodeRequest
;
import
com.thinkgem.jeesite.modules.user.bean.IdentityCodeRequest
;
import
com.thinkgem.jeesite.modules.user.bean.UserRequest
;
import
com.thinkgem.jeesite.modules.user.bean.UserRequest
;
import
com.thinkgem.jeesite.modules.user.dao.UserApiDao
;
import
com.thinkgem.jeesite.modules.user.dao.UserApiDao
;
...
@@ -41,6 +43,9 @@ public class UserApiService {
...
@@ -41,6 +43,9 @@ public class UserApiService {
@Autowired
@Autowired
private
JuHeZhongPayService
juHeZhongPayService
;
private
JuHeZhongPayService
juHeZhongPayService
;
@Autowired
private
JuHeZhongPayIntegralService
juHeZhongPayIntegralService
;
public
UserEntity
getUserInfo
(
Request
request
)
{
public
UserEntity
getUserInfo
(
Request
request
)
{
UserEntity
user
=
userDao
.
getUserInfo
(
request
);
UserEntity
user
=
userDao
.
getUserInfo
(
request
);
// 以下两行代码应Android要求,增加空detail和card
// 以下两行代码应Android要求,增加空detail和card
...
@@ -221,7 +226,8 @@ public class UserApiService {
...
@@ -221,7 +226,8 @@ public class UserApiService {
// 为用户卡注册subMerchantId
// 为用户卡注册subMerchantId
String
type
=
"1"
;
// 默认将卡片添加为对私
String
type
=
"1"
;
// 默认将卡片添加为对私
String
status
=
"0"
;
// 新增卡片审核状态均为未审核
String
status
=
"0"
;
// 新增卡片审核状态均为未审核
String
subMerchantId
=
null
;
//registJuHeZhongPay(request, type);
// String subMerchantId = null;//registJuHeZhongPay(request, type);
String
subMerchantId
=
quickPayHandleJuhezhong
(
request
,
type
);
// 更新银行卡详情
// 更新银行卡详情
CardEntity
cardStatusEntity
=
new
CardEntity
(
request
.
getSubMerchantCode
(),
"N"
);
CardEntity
cardStatusEntity
=
new
CardEntity
(
request
.
getSubMerchantCode
(),
"N"
);
userDao
.
updateCardStatus
(
cardStatusEntity
);
userDao
.
updateCardStatus
(
cardStatusEntity
);
...
@@ -325,6 +331,46 @@ public class UserApiService {
...
@@ -325,6 +331,46 @@ public class UserApiService {
return
jsonObject
.
getString
(
"subMchId"
);
return
jsonObject
.
getString
(
"subMchId"
);
}
}
public
String
quickPayHandleJuhezhong
(
UserRequest
request
,
String
type
)
throws
MyException
,
Exception
{
UserEntity
userEntity
=
userDao
.
getUserInfo
(
request
);
BelongBankEntity
belongBankEntity
=
userDao
.
getBelongBankEntity
(
request
);
if
(
userEntity
==
null
)
{
throw
new
MyException
(
"用户信息为空"
);
}
UserDetailEntity
userDetailEntity
=
userDao
.
getUserDetailByCode
(
userEntity
);
RateEntity
rateEntityParam
=
new
RateEntity
(
userEntity
.
getLevel
(),
"quick"
);
RateEntity
rateEntity
=
userDao
.
getRateByLevel
(
rateEntityParam
);
if
(
rateEntity
==
null
)
{
throw
new
MyException
(
"费率等级信息为空"
);
}
JSONObject
dto
=
new
JSONObject
();
dto
.
put
(
"orderId"
,
MakeOrderNum
.
makeOrderNum
());
//标识请求唯一(非订单号)
dto
.
put
(
"serviceType"
,
1
);
//服务类型
dto
.
put
(
"merchantId"
,
ComCode
.
INTEGRAL_MERCHANT_ID
);
//商户号
dto
.
put
(
"subMerchantName"
,
request
.
getRealName
()
);
//对公的就按照营业执照的注册名称进行商户名的报备进件,个体户的需要突出省,市,区一级营业范围,如:“XX市+XX区+法人名称+营业范围”--例“北京市朝阳区洪新阳饭店”而且一个身份证不要重复入很多个做银联二维码交易的商户 原则上一个身份证下只有一个做银联二维码交易的户,23:00—7:00,这段时间,银联二维码可以交易,不结算
dto
.
put
(
"accName"
,
request
.
getRealName
());
//开户名称
dto
.
put
(
"accNo"
,
request
.
getCardNo
());
//开户账号
dto
.
put
(
"accType"
,
1
);
//1=个人账户 0=企业账户1=个人账户
dto
.
put
(
"bankName"
,
belongBankEntity
.
getBankName
());
//开户银行名(支行全称)
dto
.
put
(
"bankCode"
,
request
.
getBelongBank
());
//联行号
dto
.
put
(
"mobile"
,
request
.
getMobile
());
dto
.
put
(
"idNo"
,
request
.
getIdCard
());
//身份证号
dto
.
put
(
"settleType"
,
"795934"
);
//费率类型 795934
dto
.
put
(
"address"
,
request
.
getCardPlace
());
//地址
dto
.
put
(
"merchantKey"
,
ComCode
.
INTEGRAL_MERCHANT_KEY
);
//商户key
dto
.
put
(
"timestamp"
,
System
.
currentTimeMillis
());
//时间戳
JSONObject
jsonObject
=
juHeZhongPayIntegralService
.
quickPayHandle
(
dto
);
if
(!
"0000"
.
equals
(
jsonObject
.
getString
(
"code"
)))
{
throw
new
MyException
(
jsonObject
.
getString
(
"msg"
));
}
return
jsonObject
.
getString
(
"subMchId"
);
}
/**
/**
* 修改JuHeZhong支付用户费率
* 修改JuHeZhong支付用户费率
*
*
...
...
src/main/resources/mappings/modules/user/UserDao.xml
View file @
2fedb02f
...
@@ -368,10 +368,10 @@
...
@@ -368,10 +368,10 @@
debit_card,
debit_card,
create_by,
create_by,
update_by,
update_by,
update_date
= CURRENT_TIMESTAMP
update_date
)
)
VALUES
VALUES
(#{code}, #{userCode}, #{realName}, #{idCard}, #{idCardPlace}, #{idCardFront}, #{idCardBack}, #{idCardHold}, #{debitCard}, #{createdUser}, #{modifiedUser})
(#{code}, #{userCode}, #{realName}, #{idCard}, #{idCardPlace}, #{idCardFront}, #{idCardBack}, #{idCardHold}, #{debitCard}, #{createdUser}, #{modifiedUser}
,now()
)
</insert>
</insert>
<update
id=
"updateUserDetail"
>
<update
id=
"updateUserDetail"
>
...
@@ -642,6 +642,28 @@
...
@@ -642,6 +642,28 @@
WHERE
WHERE
del_flag = '0'
del_flag = '0'
</select>
</select>
<select
id=
"getBelongBankEntity"
resultType=
"com.thinkgem.jeesite.modules.user.entity.BelongBankEntity"
>
SELECT
yb.id,
yb.code,
yb.bank_code AS bankCode,
yb.bank_name AS bankName,
yb.bank_short AS bankShort,
yb.create_date AS created,
yb.create_by AS createdUser,
yb.update_date AS modified,
yb.update_by AS modifiedUser,
yb.del_flag AS delFlag
FROM
youka_bank yb
WHERE
del_flag = '0'
AND yb.bank_code = #{belongBank}
</select>
<select
id=
"getRateListByLevel"
resultType=
"com.thinkgem.jeesite.modules.pay.entity.RateEntity"
>
<select
id=
"getRateListByLevel"
resultType=
"com.thinkgem.jeesite.modules.pay.entity.RateEntity"
>
SELECT
SELECT
yr.user_level AS userLevel,
yr.user_level AS userLevel,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment