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
287d7118
Commit
287d7118
authored
Nov 18, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加劵码
parent
cba43bb9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
68 deletions
+35
-68
SConsumptionRecordsController.java
.../web/controller/system/SConsumptionRecordsController.java
+4
-51
SRoomController.java
...ain/java/share/web/controller/system/SRoomController.java
+1
-7
ISRoomService.java
...tem/src/main/java/share/system/service/ISRoomService.java
+1
-1
RoomStatusServiceImpl.java
...java/share/system/service/impl/RoomStatusServiceImpl.java
+1
-1
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+18
-5
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+10
-3
No files found.
share-front/src/main/java/share/web/controller/system/SConsumptionRecordsController.java
View file @
287d7118
...
...
@@ -16,7 +16,9 @@ import share.common.annotation.Log;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.enums.BusinessType
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumptionRecords
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.service.ISConsumptionRecordsService
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.core.page.TableDataInfo
;
...
...
@@ -41,59 +43,10 @@ public class SConsumptionRecordsController extends BaseController
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SConsumptionRecords
sConsumptionRecords
)
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
sConsumptionRecords
.
setConsumerId
(
user
.
getId
());
startPage
();
List
<
SConsumptionRecords
>
list
=
sConsumptionRecordsService
.
selectSConsumptionRecordsList
(
sConsumptionRecords
);
return
getDataTable
(
list
);
}
/**
* 导出消费记录列表
*/
//@Log(title = "消费记录", businessType = BusinessType.EXPORT)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SConsumptionRecords
sConsumptionRecords
)
{
List
<
SConsumptionRecords
>
list
=
sConsumptionRecordsService
.
selectSConsumptionRecordsList
(
sConsumptionRecords
);
ExcelUtil
<
SConsumptionRecords
>
util
=
new
ExcelUtil
<
SConsumptionRecords
>(
SConsumptionRecords
.
class
);
util
.
exportExcel
(
response
,
list
,
"消费记录数据"
);
}
/**
* 获取消费记录详细信息
*/
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
sConsumptionRecordsService
.
selectSConsumptionRecordsById
(
id
));
}
/**
* 新增消费记录
*/
//@Log(title = "消费记录", businessType = BusinessType.INSERT)
@PostMapping
public
AjaxResult
add
(
@RequestBody
SConsumptionRecords
sConsumptionRecords
)
{
return
toAjax
(
sConsumptionRecordsService
.
insertSConsumptionRecords
(
sConsumptionRecords
));
}
/**
* 修改消费记录
*/
//@Log(title = "消费记录", businessType = BusinessType.UPDATE)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
SConsumptionRecords
sConsumptionRecords
)
{
return
toAjax
(
sConsumptionRecordsService
.
updateSConsumptionRecords
(
sConsumptionRecords
));
}
/**
* 删除消费记录
*/
//@Log(title = "消费记录", businessType = BusinessType.DELETE)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
{
return
toAjax
(
sConsumptionRecordsService
.
deleteSConsumptionRecordsByIds
(
ids
));
}
}
share-front/src/main/java/share/web/controller/system/SRoomController.java
View file @
287d7118
...
...
@@ -57,13 +57,7 @@ public class SRoomController extends BaseController {
@ApiOperation
(
value
=
"房间详情"
)
@RequestMapping
(
value
=
"/info"
,
method
=
RequestMethod
.
GET
)
public
R
<
SRoomVo
>
getInfo
(
@RequestParam
(
"id"
)
Long
id
)
{
SRoom
room
=
sRoomService
.
queryById
(
id
);
SRoomVo
vo
=
null
;
if
(
Objects
.
nonNull
(
room
))
{
vo
=
new
SRoomVo
();
BeanUtils
.
copyProperties
(
room
,
vo
);
}
return
R
.
ok
(
vo
);
return
R
.
ok
(
sRoomService
.
queryById
(
id
));
}
...
...
share-system/src/main/java/share/system/service/ISRoomService.java
View file @
287d7118
...
...
@@ -89,7 +89,7 @@ public interface ISRoomService extends IService<SRoom>
List
<
SPack
>
getPackByRoomId
(
Long
id
);
SRoom
queryById
(
Long
id
);
SRoom
Vo
queryById
(
Long
id
);
int
addRoomDevice
(
Long
roomId
,
String
[]
devIds
);
...
...
share-system/src/main/java/share/system/service/impl/RoomStatusServiceImpl.java
View file @
287d7118
...
...
@@ -132,7 +132,7 @@ public class RoomStatusServiceImpl implements RoomStatusService {
if
(
Objects
.
isNull
(
user
)||
Objects
.
isNull
(
user
.
getId
())||
order
.
getConsumerId
().
compareTo
(
user
.
getId
())!=
0
){
orderEndDate
=
DateUtils
.
addMinutes
(
orderEndDate
,
Constants
.
ROOM_LOCK_DELAY_MINUTE
);
}
if
(
timeHourDate
.
compareTo
(
orderStartDate
)==
1
&&
timeHourDate
.
compareTo
(
orderEndDate
)==
0
)
{
if
(
timeHourDate
.
compareTo
(
orderStartDate
)
>
0
&&
timeHourDate
.
compareTo
(
orderEndDate
)
<
0
)
{
vo
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
//判断订单开始时间是否是同一个小时,如果是同一个小时,占用结束时间为订单开始时间
if
(
StringUtils
.
equals
(
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH
,
timeHourDate
)
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
287d7118
...
...
@@ -206,12 +206,14 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SOrder:
:
getStoreId
,
storeId
);
queryWrapper
.
eq
(
SOrder:
:
getRoomId
,
roomId
);
queryWrapper
.
notI
n
(
SOrder:
:
getRefundStatus
,
RefundStatusEnum
.
getNotRefundStatus
());
queryWrapper
.
i
n
(
SOrder:
:
getRefundStatus
,
RefundStatusEnum
.
getNotRefundStatus
());
String
nowDayStr
=
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
day
);
String
nextDayStr
=
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
DateUtils
.
addDays
(
day
,
1
));
queryWrapper
.
apply
(
"(DATE_FORMAT(IFNULL(start_date,pre_start_date), '%Y-%m-%d') = '"
+
nowDayStr
+
"' "
+
" OR DATE_FORMAT(IFNULL(start_date,pre_start_date), '%Y-%m-%d') = '"
+
nextDayStr
+
"')"
);
queryWrapper
.
last
(
"ORDER BY IFNULL(start_date,pre_start_date) "
);
queryWrapper
.
apply
(
"(DATE_FORMAT(IFNULL(start_date,pre_start_date), '%Y-%m-%d') = '"
+
nowDayStr
+
"'"
+
" OR DATE_FORMAT(IFNULL(end_date,pre_end_date), '%Y-%m-%d') = '"
+
nowDayStr
+
"' "
+
" OR DATE_FORMAT(IFNULL(start_date,pre_start_date), '%Y-%m-%d') = '"
+
nextDayStr
+
"'"
+
"OR DATE_FORMAT(IFNULL(end_date,pre_end_date), '%Y-%m-%d') = '"
+
nextDayStr
+
"')"
);
queryWrapper
.
last
(
"ORDER BY IFNULL(pre_start_date,pre_end_date) "
);
return
list
(
queryWrapper
);
}
...
...
@@ -250,6 +252,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
consumerCoupon
.
setUseStatus
(
UserStatusEnum
.
USED
.
getCode
());
consumerCouponService
.
updateById
(
consumerCoupon
);
}
SConsumptionRecords
sConsumptionRecords
=
new
SConsumptionRecords
();
sConsumptionRecords
.
setConsumerId
(
sOrder
.
getConsumerId
());
sConsumptionRecords
.
setOrderId
(
sOrder
.
getId
());
sConsumptionRecords
.
setName
(
sOrder
.
getPackName
());
sConsumptionRecords
.
setPrice
(
sOrder
.
getPayPrice
());
sConsumptionRecordsService
.
insertSConsumptionRecords
(
sConsumptionRecords
);
}
save
(
sOrder
);
return
response
;
...
...
@@ -455,7 +463,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
public
SOrder
selectSOrderByOrderNo
(
String
orderNo
)
{
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SOrder:
:
getOrderNo
,
orderNo
);
return
getOne
(
queryWrapper
);
SOrder
one
=
getOne
(
queryWrapper
);
if
(
ObjectUtil
.
isNotEmpty
(
one
.
getCouponId
()))
{
SConsumerCoupon
consumerCoupon
=
consumerCouponService
.
getById
(
one
.
getCouponId
());
one
.
setCouponName
(
consumerCoupon
.
getName
());
}
return
one
;
}
@Override
...
...
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
287d7118
...
...
@@ -246,11 +246,18 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
}
@Override
public
SRoom
queryById
(
Long
id
)
{
public
SRoom
Vo
queryById
(
Long
id
)
{
SRoom
room
=
sRoomMapper
.
selectById
(
id
);
room
.
setOpenShopUuid
(
sStoreService
.
selectSStoreById
(
room
.
getStoreId
()).
getOpenShopUuid
());
SStore
sStore
=
sStoreService
.
selectSStoreById
(
room
.
getStoreId
());
room
.
setOpenShopUuid
(
sStore
.
getOpenShopUuid
());
room
.
setPackList
(
getPackByRoomId
(
room
.
getId
()));
return
room
;
SRoomVo
vo
=
null
;
if
(
Objects
.
nonNull
(
room
))
{
vo
=
new
SRoomVo
();
BeanUtils
.
copyProperties
(
room
,
vo
);
}
vo
.
setStoreName
(
sStore
.
getName
());
return
vo
;
}
@Override
...
...
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