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
553d6227
Commit
553d6227
authored
Jun 29, 2018
by
tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
垃圾通道来回修改,推广方式更改
parent
00b763b3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
214 additions
and
40 deletions
+214
-40
ComCode.java
src/main/java/com/thinkgem/jeesite/common/constant/ComCode.java
+4
-0
PayApiController.java
src/main/java/com/thinkgem/jeesite/modules/pay/api/PayApiController.java
+8
-3
JuhezhongDto.java
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/dto/JuhezhongDto.java
+14
-0
JuHeZhongPayService.java
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/service/JuHeZhongPayService.java
+32
-0
DateUtil.java
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/utils/DateUtil.java
+79
-23
PayApiService.java
src/main/java/com/thinkgem/jeesite/modules/pay/service/PayApiService.java
+0
-0
TimingService.java
src/main/java/com/thinkgem/jeesite/modules/pay/service/TimingService.java
+5
-0
PayApiDao.xml
src/main/resources/mappings/modules/pay/PayApiDao.xml
+3
-0
regist.js
src/main/webapp/static/share/js/regist.js
+15
-14
spread.html
src/main/webapp/static/share/spread.html
+54
-0
No files found.
src/main/java/com/thinkgem/jeesite/common/constant/ComCode.java
View file @
553d6227
...
...
@@ -51,6 +51,7 @@ public static final String QUICK_WEB_PAY = "/quick/web/pay";
public
static
final
String
NO_INTEGRAL_QUICK_PAY_URL
=
"/quick/pay"
;
// 无积分快捷支付
public
static
final
String
NO_INTEGRAL_ORDER_QUERY_URL
=
"/order/query"
;
// 查询订单
public
static
final
String
NOTIFY_CALLBACK_URL
=
"http://youkapay.com/youka-api/api/pay/notifyQuickPay"
;
public
static
final
String
NO_INTEGRAL_QUICK_WAP_PAY_URL
=
"/quick/pay/v2"
;
// 无积分快捷支付
public
static
final
String
EXTRA_RATE
=
"200"
;
// 附加手续费(单位:分)
...
...
@@ -114,6 +115,7 @@ public static final String QUICK_WEB_PAY = "/quick/web/pay";
public
static
final
long
hours
=
24
;
public
static
final
SimpleDateFormat
YYYYMMDD_HHMMSS
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
//HH:mm:ss 24小时制
public
static
final
SimpleDateFormat
YYYYMMDDHHMM
=
new
SimpleDateFormat
(
"yyyyMMddhhmm"
);
public
static
final
SimpleDateFormat
HHMMSS
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
/**
* 系统公共
*/
...
...
@@ -167,6 +169,8 @@ public static final String QUICK_WEB_PAY = "/quick/web/pay";
*/
public
static
final
String
STATUS_CODE_6001
=
"6001"
;
public
static
final
String
STATUS_CODE_6001_DESC
=
"订单号不存在"
;
public
static
final
String
STATUS_CODE_6002
=
"6002"
;
public
static
final
String
STATUS_CODE_6002_DESC
=
"交易时间为09:00:00-22:00:00"
;
/**
...
...
src/main/java/com/thinkgem/jeesite/modules/pay/api/PayApiController.java
View file @
553d6227
...
...
@@ -8,6 +8,7 @@ import com.thinkgem.jeesite.modules.commonError.MyException;
import
com.thinkgem.jeesite.modules.pay.entity.BalanceEntity
;
import
com.thinkgem.jeesite.modules.pay.entity.OrderEntity
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.dto.PayBackDto
;
import
com.thinkgem.jeesite.modules.pay.juhezhong.utils.DateUtil
;
import
com.thinkgem.jeesite.modules.pay.service.PayApiService
;
import
com.thinkgem.jeesite.modules.sys.entity.Dict
;
import
com.thinkgem.jeesite.modules.sys.entity.DictPayChannel
;
...
...
@@ -63,11 +64,15 @@ public class PayApiController {
public
Response
quickPay
(
JuHeZhongPayRequest
request
)
{
Response
resp
=
new
Response
();
try
{
//非交易时间直接返回
if
(!
DateUtil
.
checkTimeIsDuration
())
{
throw
new
MyException
(
ComCode
.
STATUS_CODE_6002_DESC
);
}
PayBackDto
payBackDto
=
payService
.
quickPay
(
request
);
if
((
payBackDto
.
getUrl
()
!=
null
&&
!
""
.
equals
(
payBackDto
.
getUrl
()))
||
"0"
.
equals
(
payBackDto
.
getIsUrl
()))
{
resp
.
setStatus
(
ComCode
.
STATUS_CODE_2000
);
resp
.
setMessage
(
ComCode
.
STATUS_CODE_2000_DESC
);
logger
.
debug
(
"快捷支付返回URL: {}"
,
payBackDto
.
getUrl
());
resp
.
setData
(
payBackDto
);
}
else
{
resp
.
setStatus
(
ComCode
.
STATUS_CODE_9998
);
...
...
@@ -388,7 +393,7 @@ public class PayApiController {
String
orderId
=
request
.
getParameter
(
"dsorderid"
);
String
code
=
request
.
getParameter
(
"respCode"
);
if
(
"00"
.
equals
(
code
))
{
logger
.
debug
(
"orderId: {}"
,
orderId
);
logger
.
debug
(
"orderId: {}"
,
orderId
);
OrderEntity
orderEntity
=
new
OrderEntity
();
orderEntity
.
setPayCode
(
orderId
);
...
...
@@ -577,7 +582,7 @@ public class PayApiController {
value
[
0
]
=
ov
.
toString
();
}
for
(
int
k
=
0
;
k
<
value
.
length
;
k
++)
{
logger
.
debug
(
"参数名: {} , 参数值: {}"
,
ok
,
value
[
k
]);
logger
.
debug
(
"参数名: {} , 参数值: {}"
,
ok
,
value
[
k
]);
}
}
}
...
...
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/dto/JuhezhongDto.java
View file @
553d6227
...
...
@@ -109,6 +109,20 @@ private Long timestamp;
*/
private
String
productName
;
/**
* 手续费率 例:0.005 千5
* webPay 必传
*/
private
String
userRate
;
public
String
getUserRate
(){
return
userRate
;
}
public
void
setUserRate
(
String
userRate
){
this
.
userRate
=
userRate
;
}
public
String
getUserId
(
)
{
return
userId
;
}
...
...
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/service/JuHeZhongPayService.java
View file @
553d6227
...
...
@@ -142,6 +142,13 @@ public JSONObject quickWebPay ( JuhezhongDto dto ) throws Exception {
String
respStr
=
HttpUtil
.
post
(
ComCode
.
HOST
+
ComCode
.
NO_INTEGRAL_QUICK_PAY_URL
,
params
);
return
JSONObject
.
parseObject
(
respStr
);
}
/**
* 快捷B支付接口(老)6-29停用
* @param dto
* @return
* @throws Exception
*/
public
JSONObject
quickPay
(
JuhezhongDto
dto
)
throws
Exception
{
Map
<
String
,
Object
>
params
=
Bean2Map
.
Entity2Map
(
dto
);
String
signBefore
=
SignUtils
.
signBefore
(
params
);
...
...
@@ -151,6 +158,21 @@ public JSONObject quickWebPay ( JuhezhongDto dto ) throws Exception {
return
JSONObject
.
parseObject
(
respStr
);
}
/**
* 积分快捷(wap)6-29 新接口,需要返回url,异步消息并不能代表成功,只能设置订单状态为支付中
* @param dto
* @return
* @throws Exception
*/
public
JSONObject
quickPayWap
(
JuhezhongDto
dto
)
throws
Exception
{
Map
<
String
,
Object
>
params
=
Bean2Map
.
Entity2Map
(
dto
);
String
signBefore
=
SignUtils
.
signBefore
(
params
);
String
sign
=
SignUtils
.
sign
(
signBefore
,
ComCode
.
MERCHANT_SECRET
);
params
.
put
(
"sign"
,
sign
);
String
respStr
=
HttpUtil
.
post
(
ComCode
.
HOST
+
ComCode
.
NO_INTEGRAL_QUICK_WAP_PAY_URL
,
params
);
return
JSONObject
.
parseObject
(
respStr
);
}
public
JSONObject
quickPay
(
JSONObject
dto
)
throws
Exception
{
String
signBefore
=
SignUtils
.
signBefore
(
dto
);
System
.
out
.
println
(
signBefore
);
...
...
@@ -161,6 +183,16 @@ public JSONObject quickWebPay ( JuhezhongDto dto ) throws Exception {
return
JSONObject
.
parseObject
(
respStr
);
}
public
JSONObject
quickPayWap
(
JSONObject
dto
)
throws
Exception
{
String
signBefore
=
SignUtils
.
signBefore
(
dto
);
System
.
out
.
println
(
signBefore
);
String
sign
=
SignUtils
.
sign
(
signBefore
,
ComCode
.
MERCHANT_SECRET
);
System
.
out
.
println
(
"sign:"
+
sign
);
dto
.
put
(
"sign"
,
sign
);
String
respStr
=
HttpUtil
.
post
(
ComCode
.
HOST
+
ComCode
.
NO_INTEGRAL_QUICK_WAP_PAY_URL
,
dto
);
return
JSONObject
.
parseObject
(
respStr
);
}
/**
* 查询订单状态
*
...
...
src/main/java/com/thinkgem/jeesite/modules/pay/juhezhong/utils/DateUtil.java
View file @
553d6227
package
com
.
thinkgem
.
jeesite
.
modules
.
pay
.
juhezhong
.
utils
;
import
com.thinkgem.jeesite.common.constant.ComCode
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
/**
* @author lsw
* @date 2016年1月3日
* @version 1.0
* @date 2016年1月3日
* @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
/**
* 将时间格式化成指定的字符串
*
* @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
();
}
public
static
Date
string2Date
(
String
value
,
String
fmt
)
{
try
{
return
new
SimpleDateFormat
(
fmt
).
parse
(
value
);
}
catch
(
ParseException
e
)
{
}
return
new
Date
();
}
/**
* 检验当前时间是否在一个区间范围内
* @return
*/
public
static
boolean
checkTimeIsDuration
()
{
Boolean
flag
=
false
;
String
now
=
ComCode
.
HHMMSS
.
format
(
new
Date
());
Date
time
;
try
{
time
=
ComCode
.
HHMMSS
.
parse
(
now
);
Date
start
=
ComCode
.
HHMMSS
.
parse
(
"09:00:00"
);
Date
end
=
ComCode
.
HHMMSS
.
parse
(
"22:00:00"
);
if
(
isInTimeDuration
(
time
,
start
,
end
))
{
flag
=
true
;
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
flag
;
}
/**
* 判断当前时间是否在[startTime, endTime]区间
*
* @param nowTime 当前时间
* @param startTime 开始时间
* @param endTime 结束时间
* @return
*/
public
static
boolean
isInTimeDuration
(
Date
nowTime
,
Date
startTime
,
Date
endTime
)
{
//首先判断是否与收尾时间相同,相同直接返回
if
(
nowTime
.
getTime
()
==
startTime
.
getTime
()
||
nowTime
.
getTime
()
==
endTime
.
getTime
())
{
return
true
;
}
Calendar
date
=
Calendar
.
getInstance
();
date
.
setTime
(
nowTime
);
Calendar
begin
=
Calendar
.
getInstance
();
begin
.
setTime
(
startTime
);
Calendar
end
=
Calendar
.
getInstance
();
end
.
setTime
(
endTime
);
if
(
date
.
after
(
begin
)
&&
date
.
before
(
end
))
{
return
true
;
}
else
{
return
false
;
}
}
}
\ No newline at end of file
src/main/java/com/thinkgem/jeesite/modules/pay/service/PayApiService.java
View file @
553d6227
This diff is collapsed.
Click to expand it.
src/main/java/com/thinkgem/jeesite/modules/pay/service/TimingService.java
View file @
553d6227
...
...
@@ -24,6 +24,11 @@ public class TimingService {
payApiService
.
updateOrders
();
}
@Scheduled
(
cron
=
"20 0/2 * * * ? "
)
public
void
updateOrdersHL4
(){
payApiService
.
updateOrdersHL4
();
}
@Scheduled
(
cron
=
"0 0/5 * * * ? "
)
public
void
updateUserGrade
(){
userApiService
.
updateUserLevel
();
...
...
src/main/resources/mappings/modules/pay/PayApiDao.xml
View file @
553d6227
...
...
@@ -114,6 +114,9 @@
card_code
FROM youka_orders
WHERE pay_status = 1
<if
test=
"payChannel != null and payChannel != ''"
>
AND pay_channel = #{payChannel}
</if>
<if
test=
"endTime != null and endTime != ''"
>
AND create_date
<
= #{endTime}
</if>
...
...
src/main/webapp/static/share/js/regist.js
View file @
553d6227
...
...
@@ -59,7 +59,7 @@ function validPhone(ele){
if
(
validCode
){
validCode
=
false
;
$
.
ajax
({
url
:
'http://youkapay.com
:8080
/youka-api/api/user/getIdentifyCode'
,
url
:
'http://youkapay.com/youka-api/api/user/getIdentifyCode'
,
data
:
content
,
dataType
:
'json'
,
type
:
'POST'
,
...
...
@@ -131,25 +131,26 @@ $("#submit").on("click",function(){
console
.
info
(
content
)
$
.
ajax
({
type
:
'POST'
,
url
:
'http://youkapay.com
:8080
/youka-api/api/user/signUp'
,
url
:
'http://youkapay.com/youka-api/api/user/signUp'
,
data
:
content
,
dataType
:
'json'
,
success
:
function
(
data
){
console
.
info
(
data
)
if
(
data
.
status
==
'2000'
){
//跳转到市场
// window.location = "apk下载地址";
var
user
=
navigator
.
userAgent
;
if
(
user
.
match
(
/
(
iphone os
)
/i
))
{
console
.
log
(
"isphone"
);
window
.
location
.
href
=
'https://www.pgyer.com/7aJ3'
// window.location.href='https://appsto.re/cn/KG6P2.i'
}
else
if
(
user
.
match
(
/ipad/i
)){
console
.
log
(
"isipad"
);
}
else
if
(
user
.
match
(
/
(
midp|ucweb|android|windows ce|windows mobile
)
/i
)){
console
.
log
(
"android"
);
// window.location.href='http://tstatics.iyuwan.com/files/apk/201605/Iyuwan.apk'
};
// window.location = "apk下载地址";
window
.
location
.
href
=
"http://youkapay.com/youka-api/static/share/spread.html"
;
// var user = navigator.userAgent;
// if (user.match(/(iphone os)/i)) {
// console.log("isphone");
// window.location.href = 'https://www.pgyer.com/7aJ3'
// // window.location.href='https://appsto.re/cn/KG6P2.i'
// }else if(user.match(/ipad/i)){
// console.log("isipad");
// }else if(user.match(/(midp|ucweb|android|windows ce|windows mobile)/i)){
// console.log("android");
// // window.location.href='http://tstatics.iyuwan.com/files/apk/201605/Iyuwan.apk'
// };
}
else
{
$
(
"#registError"
).
removeClass
(
"none"
);
$
(
"#registFail"
).
html
(
data
.
message
);
...
...
src/main/webapp/static/share/spread.html
0 → 100644
View file @
553d6227
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width"
>
<script
type=
"text/javascript"
src=
"js/jquery-1.9.1.min.js"
></script>
<script
type=
"text/javascript"
src=
"js/getQueryStringByName.js"
></script>
<!--
<script type="text/javascript" src="js/sha1.js"></script>
<script type="text/javascript" src="js/DES.js"></script>
-->
<script
type=
"text/javascript"
src=
"js/md5.js"
></script>
<script
type=
"text/javascript"
src=
"js/base64.js"
></script>
<link
rel=
"stylesheet"
href=
"css/style.css"
>
<title>
优卡生活
</title>
<style>
button
{
background
:
none
;
outline
:
none
;
border
:
none
;
color
:
#FFFFFF
;
display
:
block
;
width
:
50%
;
height
:
0
;
padding
:
10%
;
line-height
:
0px
;
border-radius
:
20px
;
font-size
:
25px
;
}
#ios
{
background
:
#FFBB2C
;
}
#android
{
background
:
#33FF33
;
}
.containter
{
position
:
absolute
;
width
:
100%
;
top
:
20%
;
left
:
50%
;
transform
:
translate
(
-50%
);
}
</style>
</head>
<body>
<div
align=
"center"
class=
"containter"
>
<button
onclick=
"window.open('https://www.pgyer.com/7aJ3')"
id=
"ios"
>
IOS 下载
</button>
<br>
<button
onclick=
"window.open('https://www.pgyer.com/7aJ3')"
id=
"android"
>
安卓下载
</button>
</div>
</body>
</html>
\ No newline at end of file
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