记得上下班打卡 | 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
8e1176be
Commit
8e1176be
authored
Jul 08, 2025
by
姜秀龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
离线支付-迈之定时任务
parent
e52ecaf4
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
166 additions
and
75 deletions
+166
-75
GoblinRedisConst.java
...m/liquidnet/service/goblin/constant/GoblinRedisConst.java
+5
-0
GoblinBraceletOrderVo.java
...iquidnet/service/goblin/dto/vo/GoblinBraceletOrderVo.java
+10
-0
IGoblinRechargeWristbandService.java
...rvice/goblin/service/IGoblinRechargeWristbandService.java
+2
-2
FeignGoblinTaskClient.java
...dnet/service/feign/goblin/task/FeignGoblinTaskClient.java
+6
-0
goblin_recharge.sql
...in/liquidnet-service-goblin-impl/docu/goblin_recharge.sql
+53
-45
GoblinRechargeAmountController.java
...ice/goblin/controller/GoblinRechargeAmountController.java
+10
-19
GoblinMaiZhiJobController.java
...ce/goblin/controller/Inner/GoblinMaiZhiJobController.java
+36
-0
GoblinRechargeWristbandServiceImpl.java
...blin/service/impl/GoblinRechargeWristbandServiceImpl.java
+26
-6
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+18
-3
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/constant/GoblinRedisConst.java
View file @
8e1176be
...
@@ -356,8 +356,13 @@ public class GoblinRedisConst {
...
@@ -356,8 +356,13 @@ public class GoblinRedisConst {
public
static
final
String
GOBLIN_MIX_RESERVE_UID
=
PREFIX
.
concat
(
"mix:reserve:uid:"
);
//$mixId:$uid 混合售用户预约保存
public
static
final
String
GOBLIN_MIX_RESERVE_UID
=
PREFIX
.
concat
(
"mix:reserve:uid:"
);
//$mixId:$uid 混合售用户预约保存
// 迈之
// 充值配置的需要充值金额的列表
public
static
final
String
GOBLIN_RECHARGE_WRISTBAND
=
PREFIX
.
concat
(
"recharge:wristband"
);
public
static
final
String
GOBLIN_RECHARGE_WRISTBAND
=
PREFIX
.
concat
(
"recharge:wristband"
);
// 迈之的accessToken
public
static
final
String
GOBLIN_RECHARGE_MAIZHI_TOKEN
=
PREFIX
.
concat
(
"recharge:maizhitoken"
);
public
static
final
String
GOBLIN_RECHARGE_MAIZHI_TOKEN
=
PREFIX
.
concat
(
"recharge:maizhitoken"
);
// 获取设备编号定时任务最后一次的时间
public
static
final
String
GOBLIN_RECHARGE_DEVICE_NUMBER_ENDTIME
=
PREFIX
.
concat
(
"recharge:deviceNumber:endtime:operationNo:"
);
// 手环订单
// 手环订单
public
static
final
String
GOBLIN_BRACELET_USER
=
PREFIX
.
concat
(
"bracelet:userId:"
);
public
static
final
String
GOBLIN_BRACELET_USER
=
PREFIX
.
concat
(
"bracelet:userId:"
);
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinBraceletOrderVo.java
View file @
8e1176be
...
@@ -152,6 +152,16 @@ public class GoblinBraceletOrderVo {
...
@@ -152,6 +152,16 @@ public class GoblinBraceletOrderVo {
*/
*/
private
Integer
payStatus
;
private
Integer
payStatus
;
/**
* 迈之的分订单号
*/
private
String
foutTradeNo
;
/**
* 迈之的设备编号
*/
private
String
cardno
;
/**
/**
* 创建时间
* 创建时间
*/
*/
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/IGoblinRechargeWristbandService.java
View file @
8e1176be
...
@@ -25,7 +25,7 @@ public interface IGoblinRechargeWristbandService extends IService<GoblinRecharge
...
@@ -25,7 +25,7 @@ public interface IGoblinRechargeWristbandService extends IService<GoblinRecharge
GenerateDeviceCodeResponse
getQrcode
(
String
outno
);
GenerateDeviceCodeResponse
getQrcode
(
String
outno
);
DeviceNumberResponse
getDeviceNumber
(
Integer
operationNo
,
String
starttime
,
String
endtime
);
Boolean
getDeviceNumber
(
Integer
operationNo
);
DeviceBalanceResponse
getDeviceBalance
(
String
cardno
);
DeviceBalanceResponse
getDeviceBalance
(
String
cardno
);
...
@@ -33,5 +33,5 @@ public interface IGoblinRechargeWristbandService extends IService<GoblinRecharge
...
@@ -33,5 +33,5 @@ public interface IGoblinRechargeWristbandService extends IService<GoblinRecharge
ChangeDeviceStatusResponse
changeDeviceStatus
(
String
cardno
,
int
type
);
ChangeDeviceStatusResponse
changeDeviceStatus
(
String
cardno
,
int
type
);
ChangeDeviceStatusResponse
refundRes
(
String
cardno
);
Boolean
refundRes
(
);
}
}
liquidnet-bus-feign/liquidnet-api-feign-goblin/src/main/java/com/liquidnet/service/feign/goblin/task/FeignGoblinTaskClient.java
View file @
8e1176be
...
@@ -22,4 +22,10 @@ public interface FeignGoblinTaskClient {
...
@@ -22,4 +22,10 @@ public interface FeignGoblinTaskClient {
@GetMapping
(
"rsc/nft/job/mixList"
)
@GetMapping
(
"rsc/nft/job/mixList"
)
ResponseDto
<
Boolean
>
mixList
();
ResponseDto
<
Boolean
>
mixList
();
@GetMapping
(
"/rsc/maizhi/job/getDeviceNumber"
)
ResponseDto
<
Boolean
>
getDeviceNumber
();
@GetMapping
(
"/rsc/maizhi/job/refundRes"
)
ResponseDto
<
Boolean
>
refundRes
();
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/docu/goblin_recharge.sql
View file @
8e1176be
This diff is collapsed.
Click to expand it.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinRechargeAmountController.java
View file @
8e1176be
...
@@ -86,17 +86,13 @@ public class GoblinRechargeAmountController {
...
@@ -86,17 +86,13 @@ public class GoblinRechargeAmountController {
@ApiOperation
(
"获取设备编号列表"
)
@ApiOperation
(
"获取设备编号列表"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"param"
,
required
=
true
,
name
=
"operationNo"
,
value
=
"分订单号"
),
@ApiImplicitParam
(
type
=
"param"
,
required
=
true
,
name
=
"operationNo"
,
value
=
"分订单号"
),
@ApiImplicitParam
(
type
=
"param"
,
required
=
true
,
name
=
"starttime"
,
value
=
"分订单号"
),
@ApiImplicitParam
(
type
=
"param"
,
required
=
true
,
name
=
"endtime"
,
value
=
"分订单号"
),
})
})
public
ResponseDto
<
List
<
DeviceNumberResponse
.
NumberList
>>
getDeviceNumber
(
public
ResponseDto
<
Boolean
>
getDeviceNumber
(
@NotNull
(
message
=
"参数无效"
)
@RequestParam
(
"operationNo"
)
Integer
operationNo
,
@NotNull
(
message
=
"参数无效"
)
@RequestParam
(
"operationNo"
)
Integer
operationNo
@NotBlank
(
message
=
"参数无效"
)
@RequestParam
(
"starttime"
)
String
starttime
,
@NotBlank
(
message
=
"参数无效"
)
@RequestParam
(
"endtime"
)
String
endtime
)
{
)
{
DeviceNumberResponse
res
=
iGoblinRechargeWristbandService
.
getDeviceNumber
(
operationNo
,
starttime
,
endtime
);
Boolean
res
=
iGoblinRechargeWristbandService
.
getDeviceNumber
(
operationNo
);
if
(
null
!=
res
&&
res
.
getErrcode
()
==
200
)
{
if
(
res
)
{
return
ResponseDto
.
success
(
res
.
getList
()
);
return
ResponseDto
.
success
();
}
else
{
}
else
{
return
ResponseDto
.
failure
();
return
ResponseDto
.
failure
();
}
}
...
@@ -154,17 +150,12 @@ public class GoblinRechargeAmountController {
...
@@ -154,17 +150,12 @@ public class GoblinRechargeAmountController {
@GetMapping
(
"order/refund/result"
)
@GetMapping
(
"order/refund/result"
)
@ApiOperation
(
"退款结果查询"
)
@ApiOperation
(
"退款结果查询"
)
@ApiImplicitParams
({
public
ResponseDto
<
Boolean
>
refundRes
()
{
@ApiImplicitParam
(
type
=
"param"
,
required
=
true
,
name
=
"cardno"
,
value
=
"设备编号"
),
Boolean
res
=
iGoblinRechargeWristbandService
.
refundRes
();
})
if
(
res
)
{
public
ResponseDto
<
ChangeDeviceStatusResponse
>
refundRes
(
return
ResponseDto
.
success
();
@NotBlank
(
message
=
"参数无效:cardno"
)
@RequestParam
(
"cardno"
)
String
cardno
)
{
ChangeDeviceStatusResponse
res
=
iGoblinRechargeWristbandService
.
refundRes
(
cardno
);
if
(
null
!=
res
&&
res
.
getErrcode
()
==
200
)
{
return
ResponseDto
.
success
(
res
);
}
else
{
}
else
{
return
ResponseDto
.
failure
(
res
.
getMsg
()
);
return
ResponseDto
.
failure
();
}
}
}
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/Inner/GoblinMaiZhiJobController.java
0 → 100644
View file @
8e1176be
package
com
.
liquidnet
.
service
.
goblin
.
controller
.
Inner
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.service.IGoblinRechargeWristbandService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@Slf4j
@Api
(
tags
=
"@API:RSC"
)
@RestController
@Validated
@RequestMapping
(
"/rsc/maizhi/job"
)
public
class
GoblinMaiZhiJobController
{
@Autowired
private
IGoblinRechargeWristbandService
iGoblinRechargeWristbandService
;
@GetMapping
(
"getDeviceNumber"
)
@ApiOperation
(
"获取设备编号JOB"
)
public
ResponseDto
<
Boolean
>
getDeviceNumber
()
{
return
ResponseDto
.
success
(
iGoblinRechargeWristbandService
.
getDeviceNumber
(
2
));
}
@GetMapping
(
"refundRes"
)
@ApiOperation
(
"获取设备编号JOB"
)
public
ResponseDto
<
Boolean
>
refundRes
()
{
return
ResponseDto
.
success
(
iGoblinRechargeWristbandService
.
refundRes
());
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinRechargeWristbandServiceImpl.java
View file @
8e1176be
...
@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.time.Instant
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -111,12 +112,26 @@ public class GoblinRechargeWristbandServiceImpl extends ServiceImpl<GoblinRechar
...
@@ -111,12 +112,26 @@ public class GoblinRechargeWristbandServiceImpl extends ServiceImpl<GoblinRechar
}
}
@Override
@Override
public
DeviceNumberResponse
getDeviceNumber
(
Integer
operationNo
,
String
starttime
,
String
endtime
)
{
public
Boolean
getDeviceNumber
(
Integer
operationNo
)
{
String
accessToken
=
this
.
getAccessToken
();
String
accessToken
=
this
.
getAccessToken
();
String
endtime
=
goblinRedisUtils
.
getDeviceNumberEndTime
(
operationNo
);
if
(
null
!=
endtime
)
{
Instant
instant
=
Instant
.
EPOCH
;
long
timestamp
=
instant
.
toEpochMilli
();
endtime
=
String
.
valueOf
(
timestamp
);
}
long
timestamp
=
Instant
.
now
().
toEpochMilli
();
if
(
null
!=
accessToken
)
{
if
(
null
!=
accessToken
)
{
return
thirdMaiZhiUtils
.
getDeviceNumber
(
accessToken
,
operationNo
,
starttime
,
endtime
);
DeviceNumberResponse
res
=
thirdMaiZhiUtils
.
getDeviceNumber
(
accessToken
,
operationNo
,
endtime
,
String
.
valueOf
(
timestamp
));
if
(
null
!=
res
&&
res
.
getErrcode
()
==
200
)
{
for
(
DeviceNumberResponse
.
NumberList
info
:
res
.
getList
())
{
// jxl todo 把分订单号对应的设备编号写入 redis and 数据库
}
goblinRedisUtils
.
setDeviceNumberEndTime
(
operationNo
,
String
.
valueOf
(
timestamp
));
return
true
;
}
}
}
return
null
;
return
false
;
}
}
@Override
@Override
...
@@ -147,12 +162,17 @@ public class GoblinRechargeWristbandServiceImpl extends ServiceImpl<GoblinRechar
...
@@ -147,12 +162,17 @@ public class GoblinRechargeWristbandServiceImpl extends ServiceImpl<GoblinRechar
}
}
@Override
@Override
public
ChangeDeviceStatusResponse
refundRes
(
String
cardno
)
{
public
Boolean
refundRes
(
)
{
String
accessToken
=
this
.
getAccessToken
();
String
accessToken
=
this
.
getAccessToken
();
if
(
null
!=
accessToken
)
{
if
(
null
!=
accessToken
)
{
return
thirdMaiZhiUtils
.
refundRes
(
accessToken
,
cardno
);
// jxl todo 查询所有退款中状态的设备编号 然后循环查询结果
String
cardno
=
"sss"
;
ChangeDeviceStatusResponse
res
=
thirdMaiZhiUtils
.
refundRes
(
accessToken
,
cardno
);
// jxl todo 把结果写入 redis and mysql
return
true
;
}
else
{
return
false
;
}
}
return
null
;
}
}
private
String
getAccessToken
()
{
private
String
getAccessToken
()
{
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
8e1176be
...
@@ -2957,17 +2957,32 @@ public class GoblinRedisUtils {
...
@@ -2957,17 +2957,32 @@ public class GoblinRedisUtils {
redisUtil
.
set
(
key
,
orderVo
,
RedisKeyExpireConst
.
GOBLIN_BRACELET_USER_EXPIRE
);
redisUtil
.
set
(
key
,
orderVo
,
RedisKeyExpireConst
.
GOBLIN_BRACELET_USER_EXPIRE
);
}
}
public
GoblinBraceletOrderVo
getBraceletOrderVo
(
String
uid
,
String
orderId
){
public
GoblinBraceletOrderVo
getBraceletOrderVo
(
String
uid
,
String
orderId
)
{
String
key
=
GoblinRedisConst
.
GOBLIN_BRACELET_USER
.
concat
(
uid
).
concat
(
"orderId:"
).
concat
(
orderId
);
String
key
=
GoblinRedisConst
.
GOBLIN_BRACELET_USER
.
concat
(
uid
).
concat
(
"orderId:"
).
concat
(
orderId
);
Object
obj
=
redisUtil
.
get
(
key
);
Object
obj
=
redisUtil
.
get
(
key
);
if
(
obj
==
null
)
{
if
(
obj
==
null
)
{
// TODO 从数据库查询
// TODO 从数据库查询
return
null
;
return
null
;
}
else
{
}
else
{
return
(
GoblinBraceletOrderVo
)
obj
;
return
(
GoblinBraceletOrderVo
)
obj
;
}
}
}
}
public
String
getDeviceNumberEndTime
(
Integer
operationNo
)
{
String
key
=
GoblinRedisConst
.
GOBLIN_RECHARGE_DEVICE_NUMBER_ENDTIME
.
concat
(
String
.
valueOf
(
operationNo
));
Object
obj
=
redisUtil
.
get
(
key
);
if
(
obj
==
null
)
{
return
null
;
}
else
{
return
(
String
)
obj
;
}
}
public
void
setDeviceNumberEndTime
(
Integer
operationNo
,
String
endTime
)
{
String
key
=
GoblinRedisConst
.
GOBLIN_RECHARGE_DEVICE_NUMBER_ENDTIME
.
concat
(
String
.
valueOf
(
operationNo
));
redisUtil
.
set
(
key
,
endTime
);
}
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
...
...
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