记得上下班打卡 | 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
22a098c4
Commit
22a098c4
authored
Jul 08, 2025
by
姜秀龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
离线支付-迈之接口
parent
1650f26c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
111 additions
and
25 deletions
+111
-25
MaiZhiAllVo.java
...java/com/liquidnet/service/goblin/dto/vo/MaiZhiAllVo.java
+4
-8
IGoblinRechargeWristbandService.java
...rvice/goblin/service/IGoblinRechargeWristbandService.java
+4
-0
GoblinRechargeAmountController.java
...ice/goblin/controller/GoblinRechargeAmountController.java
+33
-1
GoblinRechargeWristbandServiceImpl.java
...blin/service/impl/GoblinRechargeWristbandServiceImpl.java
+18
-0
ThirdMaiZhiUtils.java
...a/com/liquidnet/service/goblin/util/ThirdMaiZhiUtils.java
+52
-16
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/MaiZhiAllVo.java
View file @
22a098c4
...
...
@@ -157,6 +157,7 @@ public class MaiZhiAllVo {
private
String
cardno
;
private
Integer
total
;
private
Integer
page
;
@Data
public
static
class
Record
{
private
String
note
;
...
...
@@ -166,15 +167,10 @@ public class MaiZhiAllVo {
}
}
// 变更设备状态参数和响应类
@Data
public
static
class
ChangeDeviceStatusParam
{
private
String
cardno
;
private
int
type
;
}
// 变更设备状态
@Data
public
static
class
ChangeDeviceStatusResponse
{
private
String
result
;
private
String
msg
;
private
Integer
errcode
;
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/IGoblinRechargeWristbandService.java
View file @
22a098c4
...
...
@@ -30,4 +30,8 @@ public interface IGoblinRechargeWristbandService extends IService<GoblinRecharge
DeviceBalanceResponse
getDeviceBalance
(
String
cardno
);
DeviceRecordResponse
getDeviceRecord
(
String
cardno
,
Integer
page
);
ChangeDeviceStatusResponse
changeDeviceStatus
(
String
cardno
,
int
type
);
ChangeDeviceStatusResponse
refundRes
(
String
cardno
);
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinRechargeAmountController.java
View file @
22a098c4
...
...
@@ -126,7 +126,7 @@ public class GoblinRechargeAmountController {
})
public
ResponseDto
<
DeviceRecordResponse
>
getDeviceRecord
(
@NotBlank
(
message
=
"参数无效:cardno"
)
@RequestParam
(
"cardno"
)
String
cardno
,
@NotNull
(
message
=
"参数无效:
cardno
"
)
@RequestParam
(
"page"
)
Integer
page
@NotNull
(
message
=
"参数无效:
page
"
)
@RequestParam
(
"page"
)
Integer
page
)
{
DeviceRecordResponse
res
=
iGoblinRechargeWristbandService
.
getDeviceRecord
(
cardno
,
page
);
if
(
null
!=
res
&&
res
.
getErrcode
()
==
200
)
{
...
...
@@ -136,4 +136,36 @@ public class GoblinRechargeAmountController {
}
}
@GetMapping
(
"order/refund/apply"
)
@ApiOperation
(
"退款申请"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"param"
,
required
=
true
,
name
=
"cardno"
,
value
=
"设备编号"
),
})
public
ResponseDto
<
ChangeDeviceStatusResponse
>
refundApply
(
@NotBlank
(
message
=
"参数无效:cardno"
)
@RequestParam
(
"cardno"
)
String
cardno
)
{
ChangeDeviceStatusResponse
res
=
iGoblinRechargeWristbandService
.
changeDeviceStatus
(
cardno
,
1
);
if
(
null
!=
res
&&
res
.
getErrcode
()
==
200
)
{
return
ResponseDto
.
success
(
res
);
}
else
{
return
ResponseDto
.
failure
(
res
.
getMsg
());
}
}
@GetMapping
(
"order/refund/result"
)
@ApiOperation
(
"退款结果查询"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"param"
,
required
=
true
,
name
=
"cardno"
,
value
=
"设备编号"
),
})
public
ResponseDto
<
ChangeDeviceStatusResponse
>
refundRes
(
@NotBlank
(
message
=
"参数无效:cardno"
)
@RequestParam
(
"cardno"
)
String
cardno
)
{
ChangeDeviceStatusResponse
res
=
iGoblinRechargeWristbandService
.
refundRes
(
cardno
);
if
(
null
!=
res
&&
res
.
getErrcode
()
==
200
)
{
return
ResponseDto
.
success
(
res
);
}
else
{
return
ResponseDto
.
failure
(
res
.
getMsg
());
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinRechargeWristbandServiceImpl.java
View file @
22a098c4
...
...
@@ -137,6 +137,24 @@ public class GoblinRechargeWristbandServiceImpl extends ServiceImpl<GoblinRechar
return
null
;
}
@Override
public
ChangeDeviceStatusResponse
changeDeviceStatus
(
String
cardno
,
int
type
)
{
String
accessToken
=
this
.
getAccessToken
();
if
(
null
!=
accessToken
)
{
return
thirdMaiZhiUtils
.
changeDeviceStatus
(
accessToken
,
cardno
,
type
);
}
return
null
;
}
@Override
public
ChangeDeviceStatusResponse
refundRes
(
String
cardno
)
{
String
accessToken
=
this
.
getAccessToken
();
if
(
null
!=
accessToken
)
{
return
thirdMaiZhiUtils
.
refundRes
(
accessToken
,
cardno
);
}
return
null
;
}
private
String
getAccessToken
()
{
String
token
=
goblinRedisUtils
.
getMaiZhiAccessToken
();
if
(
null
==
token
)
{
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/ThirdMaiZhiUtils.java
View file @
22a098c4
...
...
@@ -232,22 +232,58 @@ public class ThirdMaiZhiUtils {
}
}
public
ChangeDeviceStatusResponse
changeDeviceStatus
(
ChangeDeviceStatusParam
param
,
String
token
)
throws
Exception
{
String
url
=
"https://www.mz-cx.com/home/openapi/upd_cardtype"
;
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
set
(
"Authorization"
,
"Bearer "
+
token
);
UriComponentsBuilder
builder
=
UriComponentsBuilder
.
fromHttpUrl
(
url
)
.
queryParam
(
"cardno"
,
param
.
getCardno
())
.
queryParam
(
"type"
,
param
.
getType
());
HttpEntity
<
Void
>
request
=
new
HttpEntity
<>(
headers
);
ResponseEntity
<
ChangeDeviceStatusResponse
>
response
=
restTemplate
.
exchange
(
builder
.
toUriString
(),
HttpMethod
.
GET
,
request
,
ChangeDeviceStatusResponse
.
class
);
if
(
response
.
getStatusCode
()
==
HttpStatus
.
OK
)
{
return
response
.
getBody
();
}
else
{
throw
new
Exception
(
"Device status change failed with status: "
+
response
.
getStatusCode
());
public
ChangeDeviceStatusResponse
changeDeviceStatus
(
String
accessToken
,
String
cardno
,
int
type
)
{
try
{
String
url
=
"https://www.mz-cx.com/home/openapi/upd_cardtype"
;
// 创建请求头并设置 Authorization
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
headers
.
set
(
"access-token"
,
accessToken
);
UriComponentsBuilder
builder
=
UriComponentsBuilder
.
fromHttpUrl
(
url
)
.
queryParam
(
"cardno"
,
cardno
)
.
queryParam
(
"type"
,
type
);
HttpEntity
<
Void
>
request
=
new
HttpEntity
<>(
headers
);
ResponseEntity
<
String
>
response
=
restTemplate
.
exchange
(
builder
.
toUriString
(),
HttpMethod
.
GET
,
request
,
String
.
class
);
// 处理响应
if
(
response
.
getStatusCode
()
==
HttpStatus
.
OK
)
{
return
JsonUtils
.
fromJson
(
response
.
getBody
(),
ChangeDeviceStatusResponse
.
class
);
}
else
{
throw
new
Exception
(
"changeDeviceStatus API failed with status: "
+
response
.
getStatusCode
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
public
ChangeDeviceStatusResponse
refundRes
(
String
accessToken
,
String
cardno
)
{
try
{
String
url
=
"https://www.mz-cx.com/home/openapi/get_cardtui"
;
// 创建请求头并设置 Authorization
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
headers
.
set
(
"access-token"
,
accessToken
);
UriComponentsBuilder
builder
=
UriComponentsBuilder
.
fromHttpUrl
(
url
)
.
queryParam
(
"cardno"
,
cardno
);
HttpEntity
<
Void
>
request
=
new
HttpEntity
<>(
headers
);
ResponseEntity
<
String
>
response
=
restTemplate
.
exchange
(
builder
.
toUriString
(),
HttpMethod
.
GET
,
request
,
String
.
class
);
// 处理响应
if
(
response
.
getStatusCode
()
==
HttpStatus
.
OK
)
{
return
JsonUtils
.
fromJson
(
response
.
getBody
(),
ChangeDeviceStatusResponse
.
class
);
}
else
{
throw
new
Exception
(
"refundRes API failed with status: "
+
response
.
getStatusCode
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
...
...
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