记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
bd7728ef
Commit
bd7728ef
authored
Jul 29, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
2ee1433a
10cbfc58
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
2 deletions
+126
-2
KylinRefundsStatusServiceImpl.java
...zai/kylin/service/impl/KylinRefundsStatusServiceImpl.java
+2
-1
SweetActionCallbackController.java
...rvice/sweet/controller/SweetActionCallbackController.java
+43
-0
SweetTemplateServiceImpl.java
.../service/sweet/service/impl/SweetTemplateServiceImpl.java
+0
-1
WechatSignUtils.java
...va/com/liquidnet/service/sweet/utils/WechatSignUtils.java
+81
-0
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/KylinRefundsStatusServiceImpl.java
View file @
bd7728ef
...
...
@@ -224,7 +224,8 @@ public class KylinRefundsStatusServiceImpl {
// 更新数据
// 订单状态表 判断是退到正在退款 已付款 部分退款?(取消,完成,失败)
int
newStatus
=
0
;
Integer
[]
whereRefundingCount
=
{
KylinTableStatusConst
.
ORDER_STATUS2
,
KylinTableStatusConst
.
ORDER_STATUS4
,
KylinTableStatusConst
.
ORDER_STATUS6
};
// Integer[] whereRefundingCount = {KylinTableStatusConst.ORDER_STATUS2, KylinTableStatusConst.ORDER_STATUS4, KylinTableStatusConst.ORDER_STATUS6};
Integer
[]
whereRefundingCount
=
{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_CANCEL
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUNDED
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
};
int
refundingCount
=
kylinOrderRefundsMapper
.
selectCount
(
new
QueryWrapper
<
KylinOrderRefunds
>().
eq
(
"order_tickets_id"
,
orderTicketsId
)
.
notIn
(
"status"
,
whereRefundingCount
)
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetActionCallbackController.java
0 → 100644
View file @
bd7728ef
package
com
.
liquidnet
.
service
.
sweet
.
controller
;
import
com.liquidnet.service.sweet.utils.WechatSignUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.PrintWriter
;
@Api
(
tags
=
"公众号动作回调"
)
@RestController
@RequestMapping
(
"/actionCallback"
)
public
class
SweetActionCallbackController
{
@GetMapping
(
"record"
)
@ApiOperation
(
"get"
)
public
void
record
(
HttpServletResponse
response
,
@RequestParam
()
String
signature
,
@RequestParam
()
String
timestamp
,
@RequestParam
()
String
nonce
,
@RequestParam
()
String
echostr
)
{
try
{
if
(
WechatSignUtils
.
checkSignature
(
signature
,
timestamp
,
nonce
))
{
PrintWriter
out
=
response
.
getWriter
();
out
.
print
(
echostr
);
out
.
close
();
}
else
{
System
.
out
.
println
(
"这里存在非法请求!"
);
}
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
@PostMapping
(
"record"
)
@ApiOperation
(
"post"
)
public
void
record
()
{
System
.
out
.
println
(
"这是post方法!"
);
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetTemplateServiceImpl.java
View file @
bd7728ef
...
...
@@ -53,7 +53,6 @@ public class SweetTemplateServiceImpl {
public
ResponseDto
send
(
String
templateId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_REMIND_ALL
;
Set
<
String
>
keys
=
redisTemplate
.
keys
(
redisKey
);
Object
hkeys
=
redisUtil
.
hkeys
(
redisKey
);
if
(!
CollectionUtils
.
isEmpty
(
keys
))
{
for
(
String
rkey
:
keys
)
{
SweetRemindVo
remindInfo
=
(
SweetRemindVo
)
redisUtil
.
get
(
rkey
);
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/utils/WechatSignUtils.java
0 → 100644
View file @
bd7728ef
package
com
.
liquidnet
.
service
.
sweet
.
utils
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.Arrays
;
/**
* <p>
* 微信开发者签名验证
* </p>
*
* @author jiangxiulong
* @since 2021-07-29 3:19 下午
*/
public
class
WechatSignUtils
{
// 与接口配置信息中的 Token 要一致
private
static
String
token
=
"tftipg1427706847"
;
/**
* 验证签名
*
* @param signature
* @param timestamp
* @param nonce
* @return
*/
public
static
boolean
checkSignature
(
String
signature
,
String
timestamp
,
String
nonce
)
{
String
[]
arr
=
new
String
[]{
token
,
timestamp
,
nonce
};
// 将 token、timestamp、nonce 三个参数进行字典序排序
Arrays
.
sort
(
arr
);
StringBuilder
content
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
arr
.
length
;
i
++)
{
content
.
append
(
arr
[
i
]);
}
MessageDigest
md
=
null
;
String
tmpStr
=
null
;
try
{
md
=
MessageDigest
.
getInstance
(
"SHA-1"
);
// 将三个参数字符串拼接成一个字符串进行 sha1 加密
byte
[]
digest
=
md
.
digest
(
content
.
toString
().
getBytes
());
tmpStr
=
byteToStr
(
digest
);
}
catch
(
NoSuchAlgorithmException
e
)
{
e
.
printStackTrace
();
}
content
=
null
;
// 将 sha1 加密后的字符串可与 signature 对比,标识该请求来源于微信
return
tmpStr
!=
null
?
tmpStr
.
equals
(
signature
.
toUpperCase
())
:
false
;
}
/**
* 将字节数组转换为十六进制字符串
*
* @param byteArray
* @return
*/
private
static
String
byteToStr
(
byte
[]
byteArray
)
{
String
strDigest
=
""
;
for
(
int
i
=
0
;
i
<
byteArray
.
length
;
i
++)
{
strDigest
+=
byteToHexStr
(
byteArray
[
i
]);
}
return
strDigest
;
}
/**
* 将字节转换为十六进制字符串
*
* @param mByte
* @return
*/
private
static
String
byteToHexStr
(
byte
mByte
)
{
char
[]
Digit
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
};
char
[]
tempArr
=
new
char
[
2
];
tempArr
[
0
]
=
Digit
[(
mByte
>>>
4
)
&
0X0F
];
tempArr
[
1
]
=
Digit
[
mByte
&
0X0F
];
String
s
=
new
String
(
tempArr
);
return
s
;
}
}
\ 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