Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
pseer
gxpt_ht
Commits
3ccfdb09
Commit
3ccfdb09
authored
Nov 29, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改售货柜对接实现类
parent
329c641e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
117 additions
and
0 deletions
+117
-0
VendingMachineController.java
...share/web/controller/system/VendingMachineController.java
+4
-0
VendingMachineSreviceImplAspect.java
...re/framework/aspectj/VendingMachineSreviceImplAspect.java
+103
-0
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+7
-0
VendingMachineSrevice.java
...main/java/share/system/service/VendingMachineSrevice.java
+2
-0
VendingMachineSreviceImpl.java
.../share/system/service/impl/VendingMachineSreviceImpl.java
+1
-0
No files found.
share-admin/src/main/java/share/web/controller/system/VendingMachineController.java
View file @
3ccfdb09
...
...
@@ -94,21 +94,25 @@ public class VendingMachineController {
vendingMachineSrevice
.
payCallback
(
payCallback
);
}
//获取设备订单
@PostMapping
(
"/orderList"
)
public
String
orderList
(
QueryOrder
queryOrder
)
{
return
vendingMachineSrevice
.
orderList
(
queryOrder
);
}
//微信⽀付宝订单出货成功,主动请求
@PostMapping
(
"/sendOrder"
)
public
String
sendOrder
(
SendOrder
sendOrder
)
{
return
vendingMachineSrevice
.
sendOrder
(
sendOrder
);
}
//取货码第三⽅验证
@PostMapping
(
"/pickupCodeCheck"
)
public
void
pickupCodeCheck
(
String
pickupCode
,
String
machineId
)
{
vendingMachineSrevice
.
pickupCodeCheck
(
pickupCode
,
machineId
);
}
//获取单条订单信息
@GetMapping
(
"/queryPayInfo"
)
public
void
queryPayInfo
(
String
machineId
,
String
orderSn
)
{
vendingMachineSrevice
.
queryPayInfo
(
machineId
,
orderSn
);
...
...
share-framework/src/main/java/share/framework/aspectj/VendingMachineSreviceImplAspect.java
0 → 100644
View file @
3ccfdb09
package
share
.
framework
.
aspectj
;
import
cn.hutool.json.JSONUtil
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.*
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.context.request.RequestAttributes
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
javax.servlet.http.HttpServletRequest
;
import
java.lang.reflect.Method
;
import
java.util.HashMap
;
import
java.util.Map
;
@Aspect
@Component
public
class
VendingMachineSreviceImplAspect
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
VendingMachineSreviceImplAspect
.
class
);
/**
* 切点函数,用于标识需要记录操作日志的方法。
* 切点表达式为:execution(* share.system.service.impl.QPServiceImpl.*(..)),表示匹配所有在share.system.service.impl.QPServiceImpl类中定义的方法。
*/
@Pointcut
(
"execution(* share.system.service.impl.VendingMachineSreviceImpl.*(..))"
)
public
void
operLogPoinCut
()
{
}
@Before
(
"operLogPoinCut()"
)
public
void
beforMethod
(
JoinPoint
point
)
{
}
@Pointcut
(
"execution(* share.system.service.impl.VendingMachineSreviceImpl.*(..))"
)
public
void
operExceptionLogPoinCut
()
{
}
/**
* 正常返回通知,拦截用户操作日志,连接点正常执行完成后执行, 如果连接点抛出异常,则不会执行
*
* @param joinPoint 切入点
* @param result 返回结果
*/
@AfterReturning
(
value
=
"operLogPoinCut()"
,
returning
=
"result"
)
public
void
saveMachineOperationLog
(
JoinPoint
joinPoint
,
Object
result
)
{
try
{
RequestAttributes
requestAttributes
=
RequestContextHolder
.
getRequestAttributes
();
if
(
requestAttributes
==
null
)
{
logger
.
warn
(
"无法获取RequestAttributes"
);
return
;
}
HttpServletRequest
request
=
(
HttpServletRequest
)
requestAttributes
.
resolveReference
(
RequestAttributes
.
REFERENCE_REQUEST
);
if
(
request
==
null
)
{
logger
.
warn
(
"无法获取HttpServletRequest"
);
return
;
}
MethodSignature
signature
=
(
MethodSignature
)
joinPoint
.
getSignature
();
Method
method
=
signature
.
getMethod
();
String
methodName
=
method
.
getName
();
String
[]
paramNames
=
signature
.
getParameterNames
();
String
params
=
argsArrayToString
(
paramNames
,
joinPoint
.
getArgs
());
logger
.
info
(
"请求参数为:{}"
,
params
);
logger
.
info
(
"返回参数为:{}"
,
result
);
logger
.
info
(
"请求地址为:{}"
,
request
.
getRequestURL
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
/**
* 异常返回通知,用于拦截异常日志信息 连接点抛出异常后执行
*/
@AfterThrowing
(
pointcut
=
"operExceptionLogPoinCut()"
,
throwing
=
"e"
)
public
void
saveExceptionLog
(
JoinPoint
joinPoint
,
Throwable
e
)
{
}
/**
* 参数拼装
*/
private
String
argsArrayToString
(
String
[]
paramNames
,
Object
[]
paramsArray
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
paramsArray
!=
null
&&
paramsArray
.
length
>
0
)
{
for
(
int
i
=
0
;
i
<
paramsArray
.
length
;
i
++)
{
if
(
paramsArray
[
i
]
!=
null
)
{
try
{
map
.
put
(
paramNames
[
i
],
paramsArray
[
i
]);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
return
JSONUtil
.
toJsonStr
(
map
);
}
}
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
3ccfdb09
...
...
@@ -127,6 +127,9 @@ public class RedisTask {
@Autowired
private
PointActivitiesService
pointActivitiesService
;
// @Resource
// private VendingMachineSrevice vendingMachineSrevice;
//15分钟的常量
final
long
FIFTEEN_MINUTES
=
60
*
15
;
...
...
@@ -257,6 +260,10 @@ public class RedisTask {
if
(!
tiktok
)
{
tiktokService
.
clientToken
();
}
// Boolean machineToken = redisTemplate.hasKey(ReceiptRdeisEnum.MACHINE_TOKEN.getValue());
// if (!machineToken) {
// vendingMachineSrevice.otherToken();
// }
wechatNewService
.
getMiniAccessToken
();
wechatNewService
.
getPublicAccessToken
();
logger
.
debug
(
"AutomaticMtSessionKey:自动续期session结束"
);
...
...
share-system/src/main/java/share/system/service/VendingMachineSrevice.java
View file @
3ccfdb09
...
...
@@ -43,4 +43,6 @@ public interface VendingMachineSrevice {
void
pickupCodeCheck
(
String
pickupCode
,
String
machineId
);
void
queryPayInfo
(
String
machineId
,
String
orderSn
);
public
String
obtain
();
}
share-system/src/main/java/share/system/service/impl/VendingMachineSreviceImpl.java
View file @
3ccfdb09
...
...
@@ -527,6 +527,7 @@ public class VendingMachineSreviceImpl implements VendingMachineSrevice {
}
@Override
public
String
obtain
()
{
String
o
;
o
=
redisUtil
.
get
(
ReceiptRdeisEnum
.
TIKTOK_CLIENT_TOKEN
.
getValue
());
...
...
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