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
ceb2132d
Commit
ceb2132d
authored
Nov 03, 2023
by
wuwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cancel order dev;
parent
87146584
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
3 deletions
+30
-3
SOrderController.java
...in/java/share/web/controller/system/SOrderController.java
+11
-1
ISOrderService.java
...em/src/main/java/share/system/service/ISOrderService.java
+7
-1
CallbackServiceImpl.java
...n/java/share/system/service/impl/CallbackServiceImpl.java
+0
-1
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+12
-0
No files found.
share-front/src/main/java/share/web/controller/system/SOrderController.java
View file @
ceb2132d
...
@@ -14,7 +14,6 @@ import share.common.core.domain.R;
...
@@ -14,7 +14,6 @@ import share.common.core.domain.R;
import
share.common.core.redis.RedisUtil
;
import
share.common.core.redis.RedisUtil
;
import
share.common.utils.JsonConvertUtil
;
import
share.common.utils.JsonConvertUtil
;
import
share.system.domain.SOrder
;
import
share.system.domain.SOrder
;
import
share.system.domain.vo.MyRecord
;
import
share.system.request.CreateOrderRequest
;
import
share.system.request.CreateOrderRequest
;
import
share.system.request.OrderComputedPriceRequest
;
import
share.system.request.OrderComputedPriceRequest
;
import
share.system.response.ComputedOrderPriceResponse
;
import
share.system.response.ComputedOrderPriceResponse
;
...
@@ -22,6 +21,8 @@ import share.system.response.OrderPayResultResponse;
...
@@ -22,6 +21,8 @@ import share.system.response.OrderPayResultResponse;
import
share.system.service.ISOrderService
;
import
share.system.service.ISOrderService
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableDataInfo
;
import
javax.validation.constraints.NotBlank
;
/**
/**
* 订单Controller
* 订单Controller
*
*
...
@@ -86,6 +87,15 @@ public class SOrderController extends BaseController
...
@@ -86,6 +87,15 @@ public class SOrderController extends BaseController
return
R
.
ok
(
response
);
return
R
.
ok
(
response
);
}
}
/**
* 取消订单
*/
@ApiOperation
(
value
=
"取消订单"
)
@RequestMapping
(
value
=
"/cancel"
,
method
=
RequestMethod
.
POST
)
public
R
<
Boolean
>
cancel
(
@RequestBody
@Validated
@NotBlank
(
message
=
"订单编号不能为空"
)
String
orderNo
)
{
return
R
.
ok
(
sOrderService
.
cancel
(
orderNo
));
}
/**
/**
* 根据参数计算订单价格
* 根据参数计算订单价格
...
...
share-system/src/main/java/share/system/service/ISOrderService.java
View file @
ceb2132d
...
@@ -5,7 +5,6 @@ import java.util.List;
...
@@ -5,7 +5,6 @@ import java.util.List;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.SOrder
;
import
share.system.domain.SOrder
;
import
share.system.domain.vo.MyRecord
;
import
share.system.request.CreateOrderRequest
;
import
share.system.request.CreateOrderRequest
;
import
share.system.request.OrderComputedPriceRequest
;
import
share.system.request.OrderComputedPriceRequest
;
import
share.system.request.OrderRefundRequest
;
import
share.system.request.OrderRefundRequest
;
...
@@ -116,4 +115,11 @@ public interface ISOrderService extends IService<SOrder>
...
@@ -116,4 +115,11 @@ public interface ISOrderService extends IService<SOrder>
* @return
* @return
*/
*/
List
<
SOrder
>
validOrder
();
List
<
SOrder
>
validOrder
();
/**
* 取消订单
* @param orderNo
* @return
*/
boolean
cancel
(
String
orderNo
);
}
}
share-system/src/main/java/share/system/service/impl/CallbackServiceImpl.java
View file @
ceb2132d
...
@@ -163,7 +163,6 @@ public class CallbackServiceImpl implements CallbackService {
...
@@ -163,7 +163,6 @@ public class CallbackServiceImpl implements CallbackService {
sb
.
append
(
"</xml>"
);
sb
.
append
(
"</xml>"
);
return
sb
.
toString
();
return
sb
.
toString
();
}
}
redisUtil
.
lPush
(
Constants
.
ORDER_TASK_PAY_SUCCESS_AFTER
,
sOrder
.
getOrderNo
());
sb
.
append
(
"<return_code><![CDATA[SUCCESS]]></return_code>"
);
sb
.
append
(
"<return_code><![CDATA[SUCCESS]]></return_code>"
);
sb
.
append
(
"<return_msg><![CDATA[OK]]></return_msg>"
);
sb
.
append
(
"<return_msg><![CDATA[OK]]></return_msg>"
);
break
;
break
;
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
ceb2132d
...
@@ -367,6 +367,18 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
...
@@ -367,6 +367,18 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
}
}
@Override
@Override
public
boolean
cancel
(
String
orderNo
)
{
SOrder
order
=
getByOrderNo
(
orderNo
);
if
(
Objects
.
isNull
(
order
)){
throw
new
BaseException
(
"订单不存在!"
);
}
order
.
setStatus
(
OrderStatusEnum
.
CANCEL
.
getCode
());
order
.
setRefundStatus
(
RefundStatusEnum
.
APPLY
.
getCode
());
updateById
(
order
);
return
true
;
}
@Override
public
String
openDoor
(
Long
id
)
{
public
String
openDoor
(
Long
id
)
{
SOrder
sOrder
=
sOrderMapper
.
selectSOrderById
(
id
);
SOrder
sOrder
=
sOrderMapper
.
selectSOrderById
(
id
);
if
(
Objects
.
isNull
(
sOrder
))
{
if
(
Objects
.
isNull
(
sOrder
))
{
...
...
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