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
b560c24b
Commit
b560c24b
authored
Jan 30, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单管理系统增加作废订单接口
parent
47c1c8b2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
1 deletions
+74
-1
SOrderController.java
...in/java/share/web/controller/system/SOrderController.java
+11
-0
SOrderDto.java
...ystem/src/main/java/share/system/domain/vo/SOrderDto.java
+13
-0
ISOrderService.java
...em/src/main/java/share/system/service/ISOrderService.java
+2
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+47
-0
SOrderMapper.xml
...-system/src/main/resources/mapper/system/SOrderMapper.xml
+1
-1
No files found.
share-admin/src/main/java/share/web/controller/system/SOrderController.java
View file @
b560c24b
...
...
@@ -14,6 +14,7 @@ import share.common.core.controller.BaseController;
import
share.common.core.domain.AjaxResult
;
import
share.common.enums.BusinessType
;
import
share.system.domain.SOrder
;
import
share.system.domain.vo.SOrderDto
;
import
share.system.request.OrderRefundRequest
;
import
share.system.service.ISOrderService
;
import
share.common.utils.poi.ExcelUtil
;
...
...
@@ -121,4 +122,14 @@ public class SOrderController extends BaseController
public
AjaxResult
<
Boolean
>
refund
(
@Validated
OrderRefundRequest
request
)
{
return
toAjax
(
sOrderService
.
refundAudit
(
request
));
}
/**
* 人工修改订单
*/
// @PreAuthorize("hasAuthority('system:order:modify')")
@PutMapping
(
value
=
"/modify"
)
public
AjaxResult
<
Boolean
>
modifyOrder
(
@RequestBody
SOrderDto
sOrderDto
)
{
return
toAjax
(
sOrderService
.
modifyOrder
(
sOrderDto
));
}
}
share-system/src/main/java/share/system/domain/vo/SOrderDto.java
0 → 100644
View file @
b560c24b
package
share
.
system
.
domain
.
vo
;
import
lombok.Data
;
@Data
public
class
SOrderDto
{
//订单滨海
private
String
orderNo
;
//是否消劵
private
Integer
isReverseconsume
;
//备注
private
String
remark
;
}
share-system/src/main/java/share/system/service/ISOrderService.java
View file @
b560c24b
...
...
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
share.system.domain.SConsumerCoupon
;
import
share.system.domain.SOrder
;
import
share.system.domain.vo.OrderVo
;
import
share.system.domain.vo.SOrderDto
;
import
share.system.domain.vo.SOrderVo
;
import
share.system.request.CreateOrderRequest
;
import
share.system.request.OrderComputedPriceRequest
;
...
...
@@ -188,4 +189,5 @@ public interface ISOrderService extends IService<SOrder>
boolean
isRefund
(
SOrder
order
,
SConsumerCoupon
coupon
);
int
modifyOrder
(
SOrderDto
sOrderDto
);
}
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
b560c24b
...
...
@@ -34,6 +34,7 @@ import share.common.utils.DateUtil;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.common.utils.SecurityUtils
;
import
share.common.utils.bean.BeanUtils
;
import
share.system.domain.*
;
import
share.system.domain.vo.*
;
...
...
@@ -104,6 +105,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Autowired
private
ISCleanRecordsService
cleanRecordsService
;
private
final
static
Long
FIVE
=
5
l
;
/**
* 查询订单
...
...
@@ -235,6 +238,50 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
return
Boolean
.
FALSE
;
}
@Override
public
int
modifyOrder
(
SOrderDto
sOrderDto
)
{
SOrder
sOrder
=
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<
SOrder
>().
eq
(
SOrder:
:
getOrderNo
,
sOrderDto
.
getOrderNo
()));
if
(
ObjectUtil
.
isEmpty
(
sOrder
))
{
throw
new
BaseException
(
"订单不存在"
);
}
if
(
OrderStatusEnum
.
INUSE
.
getCode
().
equals
(
sOrder
.
getStatus
()))
{
//订单为以开始,修改房间状态
SRoom
sRoom
=
new
SRoom
();
sRoom
.
setId
(
sOrder
.
getRoomId
());
sRoom
.
setStatus
(
RoomStatusEnum
.
FREE
.
getValue
());
roomService
.
updateById
(
sRoom
);
if
(
ObjectUtil
.
isNotEmpty
(
sOrder
.
getArrivalTime
()))
{
deviceOpService
.
actionExecute
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
VoiceEnum
.
SEND_CUSTOMER
.
getCode
(),
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
new
Date
(),
DatePattern
.
NORM_DATETIME_PATTERN
),
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetMinute
(
new
Date
(),
1
),
DatePattern
.
NORM_DATETIME_PATTERN
),
"1"
);
//延时5秒断电
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
FIVE
);
}
}
//当前时间加90分钟
Date
date
=
DateUtils
.
addMinutes
(
new
Date
(),
90
);
sOrder
.
setPreStartDate
(
date
);
sOrder
.
setPreEndDate
(
date
);
sOrder
.
setStatus
(
OrderStatusEnum
.
UNUSED
.
getCode
());
if
(
ObjectUtil
.
isNotEmpty
(
sOrder
.
getCouponId
()))
{
SConsumerCoupon
sConsumerCoupon
=
consumerCouponService
.
selectSConsumerCouponById
(
sOrder
.
getCouponId
());
if
(
sOrderDto
.
getIsReverseconsume
().
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
sConsumerCoupon
.
setUseStatus
(
CouponStatusEnum
.
EXPIRED
.
getValue
());
}
else
{
sConsumerCoupon
.
setUseStatus
(
CouponStatusEnum
.
NORMAL
.
getValue
());
}
consumerCouponService
.
updateById
(
sConsumerCoupon
);
sOrder
.
setCouponId
(
null
);
}
sOrder
.
setUpdateBy
(
SecurityUtils
.
getUsername
());
//年月日时分秒
sOrder
.
setRemark
(
sOrderDto
.
getRemark
());
sOrder
.
setUpdateTime
(
new
Date
());
redisUtil
.
delete
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
sOrderDto
.
getOrderNo
());
redisUtil
.
delete
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
sOrderDto
.
getOrderNo
());
return
baseMapper
.
updateSOrder
(
sOrder
);
}
/**
* 新增订单
*
...
...
share-system/src/main/resources/mapper/system/SOrderMapper.xml
View file @
b560c24b
...
...
@@ -225,7 +225,7 @@
<if
test=
"consumerPhone != null"
>
consumer_phone = #{consumerPhone},
</if>
<if
test=
"packId != null"
>
pack_id = #{packId},
</if>
<if
test=
"packPrice != null"
>
pack_price = #{packPrice},
</if>
<if
test=
"couponId !=
null
"
>
coupon_id = #{couponId},
</if>
<if
test=
"couponId !=
''
"
>
coupon_id = #{couponId},
</if>
<if
test=
"couponPrice != null"
>
coupon_price = #{couponPrice},
</if>
<if
test=
"totalPrice != null"
>
total_price = #{totalPrice},
</if>
<if
test=
"payPrice != null"
>
pay_price = #{payPrice},
</if>
...
...
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