Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
on-site-service
Project
Project
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
external
on-site-service
Commits
202f32a0
Commit
202f32a0
authored
Aug 10, 2022
by
shangtx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 订单多次支付
parent
7f9e18b8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
ServiceOrderBizService.java
...service/miniapp/service/order/ServiceOrderBizService.java
+11
-8
No files found.
mini-app/src/main/java/com/onsiteservice/miniapp/service/order/ServiceOrderBizService.java
View file @
202f32a0
...
...
@@ -217,7 +217,6 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
int
result
=
this
.
insertSelective
(
serviceOrder
);
recordComponent
.
recordServiceOrderImg
(
serviceOrder
,
dto
.
getUrls
());
// 记录流程
if
(
result
==
1
)
{
recordComponent
.
recordProcess
(
serviceOrder
.
getId
(),
ServiceOrderStatusEnum
.
RESERVE
.
getStatus
(),
ServiceOrderStatusEnum
.
RESERVE
.
getMsg
(),
sourceEnum
,
null
,
null
,
null
);
...
...
@@ -228,14 +227,15 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
public
void
paySuccess
(
String
orderNo
,
String
info
)
{
log
.
info
(
"支付成功 orderNo: {}, info: {}"
,
orderNo
,
info
);
var
no
=
orderNo
.
split
(
"-"
)[
0
];
var
order
=
selectOneByProperty
(
"orderNo"
,
no
);
var
order
=
selectOneByProperty
(
"orderNo"
,
orderNo
);
order
.
set
OrderStatus
(
ServiceOrderStatusEnum
.
PAY
.
getStatus
()
);
order
.
setOrderStatus
(
order
.
getSkipWork
()
?
ServiceOrderStatusEnum
.
DISPATCH
.
getStatus
()
:
ServiceOrderStatusEnum
.
PAY
.
getStatus
()
);
order
.
setTotalPrice
(
order
.
getTotalPrice
().
add
(
order
.
getPrice
()));
order
.
set
PayNum
(
order
.
getPayNum
()
+
1
);
int
result
=
serviceOrderMapper
.
updateByPrimaryKeySelective
(
order
);
// 通知客服
var
logCondition
=
new
ServiceOrderLog
();
logCondition
.
setOrderId
(
order
.
getId
());
...
...
@@ -265,7 +265,8 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
}
}
if
(
result
==
1
)
{
recordComponent
.
recordProcess
(
order
.
getId
(),
ServiceOrderStatusEnum
.
PAY
.
getStatus
(),
ServiceOrderStatusEnum
.
PAY
.
getMsg
(),
ServiceOrderOpSourceEnum
.
MINI_APP
,
null
,
null
,
null
);
var
payMsg
=
String
.
format
(
ServiceOrderStatusEnum
.
PAY
.
getMsg
(),
order
.
getPrice
());
recordComponent
.
recordProcess
(
order
.
getId
(),
ServiceOrderStatusEnum
.
PAY
.
getStatus
(),
payMsg
,
ServiceOrderOpSourceEnum
.
MINI_APP
,
null
,
null
,
null
);
}
}
...
...
@@ -316,7 +317,8 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
var
user
=
userMapper
.
selectByPrimaryKey
(
userId
);
try
{
var
params
=
wechatNativePay
.
getPayParam
(
"服务预约"
,
order
.
getOrderNo
(),
order
.
getPrice
(),
notifyUrl
,
String
orderNo
=
order
.
getOrderNo
()
+
"-"
+
order
.
getPayNum
();
var
params
=
wechatNativePay
.
getPayParam
(
"服务预约"
,
orderNo
,
order
.
getPrice
(),
notifyUrl
,
user
.
getOpenId
(),
request
);
return
new
OrderPayVO
(
params
);
}
catch
(
Exception
e
)
{
...
...
@@ -425,12 +427,13 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
/**
* 获取各个状态(前端状态)下的待办数量
*
* @param userId
* @return
*/
public
Map
<
Integer
,
Integer
>
getTodoNum
(
Long
userId
)
{
User
user
=
userMapper
.
selectByPrimaryKey
(
userId
);
if
(!
ServiceUserTypeEnum
.
ADMIN
.
getId
().
equals
(
user
.
getRoleType
()))
{
if
(!
ServiceUserTypeEnum
.
ADMIN
.
getId
().
equals
(
user
.
getRoleType
()))
{
return
Map
.
of
(
1
,
0
,
3
,
0
,
4
,
0
,
5
,
0
,
6
,
0
);
}
...
...
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