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
f0f22a27
Commit
f0f22a27
authored
Oct 31, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增套餐管理
parent
f95e8668
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
193 additions
and
173 deletions
+193
-173
PackController.java
...main/java/share/web/controller/system/PackController.java
+20
-10
RoomPackController.java
.../java/share/web/controller/system/RoomPackController.java
+10
-10
CouponTypeEnum.java
...mmon/src/main/java/share/common/enums/CouponTypeEnum.java
+6
-4
PackController.java
...main/java/share/web/controller/system/PackController.java
+10
-10
RoomPackController.java
.../java/share/web/controller/system/RoomPackController.java
+10
-10
SRoomController.java
...ain/java/share/web/controller/system/SRoomController.java
+2
-8
SPack.java
share-system/src/main/java/share/system/domain/SPack.java
+1
-3
SRoom.java
share-system/src/main/java/share/system/domain/SRoom.java
+2
-2
SRoomPack.java
...e-system/src/main/java/share/system/domain/SRoomPack.java
+1
-3
SRoomVo.java
...-system/src/main/java/share/system/domain/vo/SRoomVo.java
+7
-0
PackMapper.java
...-system/src/main/java/share/system/mapper/PackMapper.java
+9
-9
RoomPackMapper.java
...tem/src/main/java/share/system/mapper/RoomPackMapper.java
+9
-9
IPackService.java
...stem/src/main/java/share/system/service/IPackService.java
+10
-10
IRoomPackService.java
.../src/main/java/share/system/service/IRoomPackService.java
+9
-9
ISRoomService.java
...tem/src/main/java/share/system/service/ISRoomService.java
+2
-2
PackServiceImpl.java
.../main/java/share/system/service/impl/PackServiceImpl.java
+19
-16
RoomPackServiceImpl.java
...n/java/share/system/service/impl/RoomPackServiceImpl.java
+16
-19
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+42
-31
PackMapper.xml
share-system/src/main/resources/mapper/system/PackMapper.xml
+4
-4
RoomPackMapper.xml
...ystem/src/main/resources/mapper/system/RoomPackMapper.xml
+4
-4
No files found.
share-admin/src/main/java/share/web/controller/system/PackController.java
View file @
f0f22a27
...
@@ -16,8 +16,9 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -16,8 +16,9 @@ import org.springframework.web.bind.annotation.RestController;
import
share.common.annotation.Log
;
import
share.common.annotation.Log
;
import
share.common.core.controller.BaseController
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.domain.R
;
import
share.common.enums.BusinessType
;
import
share.common.enums.BusinessType
;
import
share.system.domain.Pack
;
import
share.system.domain.
S
Pack
;
import
share.system.service.IPackService
;
import
share.system.service.IPackService
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableDataInfo
;
...
@@ -39,21 +40,30 @@ public class PackController extends BaseController {
...
@@ -39,21 +40,30 @@ public class PackController extends BaseController {
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:pack:list')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
Pack
p
ack
)
{
public
TableDataInfo
list
(
SPack
SP
ack
)
{
startPage
();
startPage
();
List
<
Pack
>
list
=
packService
.
selectPackList
(
p
ack
);
List
<
SPack
>
list
=
packService
.
selectPackList
(
SP
ack
);
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
/**
/**
* 查询套餐列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:pack:list')"
)
@GetMapping
(
"/query"
)
public
R
<
List
<
SPack
>>
query
()
{
return
R
.
ok
(
packService
.
selectPackList
(
new
SPack
()));
}
/**
* 导出套餐列表
* 导出套餐列表
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:pack:export')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:export')"
)
@Log
(
title
=
"套餐"
,
businessType
=
BusinessType
.
EXPORT
)
@Log
(
title
=
"套餐"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
Pack
p
ack
)
{
public
void
export
(
HttpServletResponse
response
,
SPack
SP
ack
)
{
List
<
Pack
>
list
=
packService
.
selectPackList
(
p
ack
);
List
<
SPack
>
list
=
packService
.
selectPackList
(
SP
ack
);
ExcelUtil
<
Pack
>
util
=
new
ExcelUtil
<
Pack
>(
Pack
.
class
);
ExcelUtil
<
SPack
>
util
=
new
ExcelUtil
<
SPack
>(
S
Pack
.
class
);
util
.
exportExcel
(
response
,
list
,
"套餐数据"
);
util
.
exportExcel
(
response
,
list
,
"套餐数据"
);
}
}
...
@@ -72,8 +82,8 @@ public class PackController extends BaseController {
...
@@ -72,8 +82,8 @@ public class PackController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:pack:add')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:add')"
)
@Log
(
title
=
"套餐"
,
businessType
=
BusinessType
.
INSERT
)
@Log
(
title
=
"套餐"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
@PostMapping
public
AjaxResult
add
(
@RequestBody
Pack
p
ack
)
{
public
AjaxResult
add
(
@RequestBody
SPack
SP
ack
)
{
return
toAjax
(
packService
.
insertPack
(
p
ack
));
return
toAjax
(
packService
.
insertPack
(
SP
ack
));
}
}
/**
/**
...
@@ -82,8 +92,8 @@ public class PackController extends BaseController {
...
@@ -82,8 +92,8 @@ public class PackController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:pack:edit')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:edit')"
)
@Log
(
title
=
"套餐"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"套餐"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@RequestBody
Pack
p
ack
)
{
public
AjaxResult
edit
(
@RequestBody
SPack
SP
ack
)
{
return
toAjax
(
packService
.
updatePack
(
p
ack
));
return
toAjax
(
packService
.
updatePack
(
SP
ack
));
}
}
/**
/**
...
...
share-admin/src/main/java/share/web/controller/system/RoomPackController.java
View file @
f0f22a27
...
@@ -17,7 +17,7 @@ import share.common.annotation.Log;
...
@@ -17,7 +17,7 @@ import share.common.annotation.Log;
import
share.common.core.controller.BaseController
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.domain.AjaxResult
;
import
share.common.enums.BusinessType
;
import
share.common.enums.BusinessType
;
import
share.system.domain.RoomPack
;
import
share.system.domain.
S
RoomPack
;
import
share.system.service.IRoomPackService
;
import
share.system.service.IRoomPackService
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableDataInfo
;
...
@@ -39,9 +39,9 @@ public class RoomPackController extends BaseController {
...
@@ -39,9 +39,9 @@ public class RoomPackController extends BaseController {
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:pack:list')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
RoomPack
r
oomPack
)
{
public
TableDataInfo
list
(
SRoomPack
SR
oomPack
)
{
startPage
();
startPage
();
List
<
RoomPack
>
list
=
roomPackService
.
selectRoomPackList
(
r
oomPack
);
List
<
SRoomPack
>
list
=
roomPackService
.
selectRoomPackList
(
SR
oomPack
);
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
...
@@ -51,9 +51,9 @@ public class RoomPackController extends BaseController {
...
@@ -51,9 +51,9 @@ public class RoomPackController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:pack:export')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:export')"
)
@Log
(
title
=
"包房套餐关系"
,
businessType
=
BusinessType
.
EXPORT
)
@Log
(
title
=
"包房套餐关系"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
RoomPack
r
oomPack
)
{
public
void
export
(
HttpServletResponse
response
,
SRoomPack
SR
oomPack
)
{
List
<
RoomPack
>
list
=
roomPackService
.
selectRoomPackList
(
r
oomPack
);
List
<
SRoomPack
>
list
=
roomPackService
.
selectRoomPackList
(
SR
oomPack
);
ExcelUtil
<
RoomPack
>
util
=
new
ExcelUtil
<
RoomPack
>(
RoomPack
.
class
);
ExcelUtil
<
SRoomPack
>
util
=
new
ExcelUtil
<
SRoomPack
>(
S
RoomPack
.
class
);
util
.
exportExcel
(
response
,
list
,
"包房套餐关系数据"
);
util
.
exportExcel
(
response
,
list
,
"包房套餐关系数据"
);
}
}
...
@@ -72,8 +72,8 @@ public class RoomPackController extends BaseController {
...
@@ -72,8 +72,8 @@ public class RoomPackController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:pack:add')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:add')"
)
@Log
(
title
=
"包房套餐关系"
,
businessType
=
BusinessType
.
INSERT
)
@Log
(
title
=
"包房套餐关系"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
@PostMapping
public
AjaxResult
add
(
@RequestBody
RoomPack
r
oomPack
)
{
public
AjaxResult
add
(
@RequestBody
SRoomPack
SR
oomPack
)
{
return
toAjax
(
roomPackService
.
insertRoomPack
(
r
oomPack
));
return
toAjax
(
roomPackService
.
insertRoomPack
(
SR
oomPack
));
}
}
/**
/**
...
@@ -82,8 +82,8 @@ public class RoomPackController extends BaseController {
...
@@ -82,8 +82,8 @@ public class RoomPackController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:pack:edit')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:edit')"
)
@Log
(
title
=
"包房套餐关系"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"包房套餐关系"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@RequestBody
RoomPack
r
oomPack
)
{
public
AjaxResult
edit
(
@RequestBody
SRoomPack
SR
oomPack
)
{
return
toAjax
(
roomPackService
.
updateRoomPack
(
r
oomPack
));
return
toAjax
(
roomPackService
.
updateRoomPack
(
SR
oomPack
));
}
}
/**
/**
...
...
share-common/src/main/java/share/common/enums/CouponTypeEnum.java
View file @
f0f22a27
package
share
.
common
.
enums
;
package
share
.
common
.
enums
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* @Author wwl
* @Author wwl
* @Date 2023/10/19 17:06
* @Date 2023/10/19 17:06
*/
*/
public
enum
CouponTypeEnum
{
public
enum
CouponTypeEnum
{
//1:折扣券,2,团购券,3:满减券,4:核销券,5:充值送金额,6:套餐劵
DISCOUNT
(
1
,
"1"
,
"折扣券"
),
DISCOUNT
(
1
,
"1"
,
"折扣券"
),
CASH
(
2
,
"2"
,
"满减券(现金券)"
),
CASH
(
2
,
"2"
,
"满减券(现金券)"
),
DURATION
(
3
,
"3"
,
"时长券"
);
DURATION
(
3
,
"3"
,
"时长券"
),
VERIFICATION
(
4
,
"4"
,
"核销券"
),
RECHARGE
(
5
,
"5"
,
"充值送金额"
),
PACKAGE
(
6
,
"6"
,
"套餐劵"
),
;
private
Integer
code
;
private
Integer
code
;
private
String
value
;
private
String
value
;
...
...
share-front/src/main/java/share/web/controller/system/PackController.java
View file @
f0f22a27
...
@@ -9,7 +9,7 @@ import share.common.core.domain.AjaxResult;
...
@@ -9,7 +9,7 @@ import share.common.core.domain.AjaxResult;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableDataInfo
;
import
share.common.enums.BusinessType
;
import
share.common.enums.BusinessType
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.utils.poi.ExcelUtil
;
import
share.system.domain.Pack
;
import
share.system.domain.
S
Pack
;
import
share.system.service.IPackService
;
import
share.system.service.IPackService
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -32,9 +32,9 @@ public class PackController extends BaseController {
...
@@ -32,9 +32,9 @@ public class PackController extends BaseController {
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:pack:list')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
Pack
p
ack
)
{
public
TableDataInfo
list
(
SPack
SP
ack
)
{
startPage
();
startPage
();
List
<
Pack
>
list
=
packService
.
selectPackList
(
p
ack
);
List
<
SPack
>
list
=
packService
.
selectPackList
(
SP
ack
);
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
...
@@ -44,9 +44,9 @@ public class PackController extends BaseController {
...
@@ -44,9 +44,9 @@ public class PackController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:pack:export')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:export')"
)
@Log
(
title
=
"套餐"
,
businessType
=
BusinessType
.
EXPORT
)
@Log
(
title
=
"套餐"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
Pack
p
ack
)
{
public
void
export
(
HttpServletResponse
response
,
SPack
SP
ack
)
{
List
<
Pack
>
list
=
packService
.
selectPackList
(
p
ack
);
List
<
SPack
>
list
=
packService
.
selectPackList
(
SP
ack
);
ExcelUtil
<
Pack
>
util
=
new
ExcelUtil
<
Pack
>(
Pack
.
class
);
ExcelUtil
<
SPack
>
util
=
new
ExcelUtil
<
SPack
>(
S
Pack
.
class
);
util
.
exportExcel
(
response
,
list
,
"套餐数据"
);
util
.
exportExcel
(
response
,
list
,
"套餐数据"
);
}
}
...
@@ -65,8 +65,8 @@ public class PackController extends BaseController {
...
@@ -65,8 +65,8 @@ public class PackController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:pack:add')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:add')"
)
@Log
(
title
=
"套餐"
,
businessType
=
BusinessType
.
INSERT
)
@Log
(
title
=
"套餐"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
@PostMapping
public
AjaxResult
add
(
@RequestBody
Pack
p
ack
)
{
public
AjaxResult
add
(
@RequestBody
SPack
SP
ack
)
{
return
toAjax
(
packService
.
insertPack
(
p
ack
));
return
toAjax
(
packService
.
insertPack
(
SP
ack
));
}
}
/**
/**
...
@@ -75,8 +75,8 @@ public class PackController extends BaseController {
...
@@ -75,8 +75,8 @@ public class PackController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:pack:edit')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:edit')"
)
@Log
(
title
=
"套餐"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"套餐"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@RequestBody
Pack
p
ack
)
{
public
AjaxResult
edit
(
@RequestBody
SPack
SP
ack
)
{
return
toAjax
(
packService
.
updatePack
(
p
ack
));
return
toAjax
(
packService
.
updatePack
(
SP
ack
));
}
}
/**
/**
...
...
share-front/src/main/java/share/web/controller/system/RoomPackController.java
View file @
f0f22a27
...
@@ -17,7 +17,7 @@ import share.common.annotation.Log;
...
@@ -17,7 +17,7 @@ import share.common.annotation.Log;
import
share.common.core.controller.BaseController
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.domain.AjaxResult
;
import
share.common.enums.BusinessType
;
import
share.common.enums.BusinessType
;
import
share.system.domain.RoomPack
;
import
share.system.domain.
S
RoomPack
;
import
share.system.service.IRoomPackService
;
import
share.system.service.IRoomPackService
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableDataInfo
;
...
@@ -39,9 +39,9 @@ public class RoomPackController extends BaseController {
...
@@ -39,9 +39,9 @@ public class RoomPackController extends BaseController {
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:pack:list')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
RoomPack
r
oomPack
)
{
public
TableDataInfo
list
(
SRoomPack
SR
oomPack
)
{
startPage
();
startPage
();
List
<
RoomPack
>
list
=
roomPackService
.
selectRoomPackList
(
r
oomPack
);
List
<
SRoomPack
>
list
=
roomPackService
.
selectRoomPackList
(
SR
oomPack
);
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
...
@@ -51,9 +51,9 @@ public class RoomPackController extends BaseController {
...
@@ -51,9 +51,9 @@ public class RoomPackController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:pack:export')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:export')"
)
@Log
(
title
=
"包房套餐关系"
,
businessType
=
BusinessType
.
EXPORT
)
@Log
(
title
=
"包房套餐关系"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
RoomPack
r
oomPack
)
{
public
void
export
(
HttpServletResponse
response
,
SRoomPack
SR
oomPack
)
{
List
<
RoomPack
>
list
=
roomPackService
.
selectRoomPackList
(
r
oomPack
);
List
<
SRoomPack
>
list
=
roomPackService
.
selectRoomPackList
(
SR
oomPack
);
ExcelUtil
<
RoomPack
>
util
=
new
ExcelUtil
<
RoomPack
>(
RoomPack
.
class
);
ExcelUtil
<
SRoomPack
>
util
=
new
ExcelUtil
<
SRoomPack
>(
S
RoomPack
.
class
);
util
.
exportExcel
(
response
,
list
,
"包房套餐关系数据"
);
util
.
exportExcel
(
response
,
list
,
"包房套餐关系数据"
);
}
}
...
@@ -72,8 +72,8 @@ public class RoomPackController extends BaseController {
...
@@ -72,8 +72,8 @@ public class RoomPackController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:pack:add')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:add')"
)
@Log
(
title
=
"包房套餐关系"
,
businessType
=
BusinessType
.
INSERT
)
@Log
(
title
=
"包房套餐关系"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
@PostMapping
public
AjaxResult
add
(
@RequestBody
RoomPack
r
oomPack
)
{
public
AjaxResult
add
(
@RequestBody
SRoomPack
SR
oomPack
)
{
return
toAjax
(
roomPackService
.
insertRoomPack
(
r
oomPack
));
return
toAjax
(
roomPackService
.
insertRoomPack
(
SR
oomPack
));
}
}
/**
/**
...
@@ -82,8 +82,8 @@ public class RoomPackController extends BaseController {
...
@@ -82,8 +82,8 @@ public class RoomPackController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:pack:edit')"
)
@PreAuthorize
(
"@ss.hasPermi('system:pack:edit')"
)
@Log
(
title
=
"包房套餐关系"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"包房套餐关系"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@RequestBody
RoomPack
r
oomPack
)
{
public
AjaxResult
edit
(
@RequestBody
SRoomPack
SR
oomPack
)
{
return
toAjax
(
roomPackService
.
updateRoomPack
(
r
oomPack
));
return
toAjax
(
roomPackService
.
updateRoomPack
(
SR
oomPack
));
}
}
/**
/**
...
...
share-front/src/main/java/share/web/controller/system/SRoomController.java
View file @
f0f22a27
...
@@ -3,25 +3,19 @@ package share.web.controller.system;
...
@@ -3,25 +3,19 @@ package share.web.controller.system;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
import
javax.servlet.http.HttpServletResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
share.common.annotation.Log
;
import
share.common.core.controller.BaseController
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.domain.R
;
import
share.common.core.domain.R
;
import
share.common.enums.BusinessType
;
import
share.system.domain.SPack
;
import
share.system.domain.Pack
;
import
share.system.domain.SRoom
;
import
share.system.domain.SRoom
;
import
share.system.domain.vo.RoomStatusVo
;
import
share.system.domain.vo.RoomStatusVo
;
import
share.system.domain.vo.SRoomVo
;
import
share.system.domain.vo.SRoomVo
;
import
share.system.service.ISRoomService
;
import
share.system.service.ISRoomService
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableDataInfo
;
import
share.system.service.RoomStatusService
;
import
share.system.service.RoomStatusService
;
...
@@ -92,7 +86,7 @@ public class SRoomController extends BaseController {
...
@@ -92,7 +86,7 @@ public class SRoomController extends BaseController {
*/
*/
@ApiOperation
(
value
=
"通过房间ID查询套餐"
)
@ApiOperation
(
value
=
"通过房间ID查询套餐"
)
@RequestMapping
(
value
=
"/roomId"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/roomId"
,
method
=
RequestMethod
.
GET
)
public
R
<
List
<
Pack
>>
getPackByRoomId
(
@RequestParam
(
"id"
)
Long
id
)
{
public
R
<
List
<
S
Pack
>>
getPackByRoomId
(
@RequestParam
(
"id"
)
Long
id
)
{
return
R
.
ok
(
sRoomService
.
getPackByRoomId
(
id
));
return
R
.
ok
(
sRoomService
.
getPackByRoomId
(
id
));
}
}
...
...
share-system/src/main/java/share/system/domain/Pack.java
→
share-system/src/main/java/share/system/domain/
S
Pack.java
View file @
f0f22a27
...
@@ -6,8 +6,6 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
...
@@ -6,8 +6,6 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
share.common.annotation.Excel
;
import
share.common.annotation.Excel
;
import
share.common.core.domain.BaseEntity
;
import
share.common.core.domain.BaseEntity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
lombok.Data
;
import
lombok.Data
;
/**
/**
...
@@ -17,7 +15,7 @@ import lombok.Data;
...
@@ -17,7 +15,7 @@ import lombok.Data;
* @date 2023-10-31
* @date 2023-10-31
*/
*/
@Data
@Data
public
class
Pack
extends
BaseEntity
{
public
class
S
Pack
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/**
/**
...
...
share-system/src/main/java/share/system/domain/SRoom.java
View file @
f0f22a27
...
@@ -76,9 +76,9 @@ public class SRoom extends BaseEntity
...
@@ -76,9 +76,9 @@ public class SRoom extends BaseEntity
private
String
params2
;
private
String
params2
;
/**
/**
* 套餐ID
数组
* 套餐ID
*/
*/
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
Long
[]
packIds
;
private
String
packIds
;
}
}
share-system/src/main/java/share/system/domain/RoomPack.java
→
share-system/src/main/java/share/system/domain/
S
RoomPack.java
View file @
f0f22a27
...
@@ -4,8 +4,6 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
...
@@ -4,8 +4,6 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
share.common.annotation.Excel
;
import
share.common.annotation.Excel
;
import
share.common.core.domain.BaseEntity
;
import
share.common.core.domain.BaseEntity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
lombok.Data
;
import
lombok.Data
;
/**
/**
...
@@ -15,7 +13,7 @@ import lombok.Data;
...
@@ -15,7 +13,7 @@ import lombok.Data;
* @date 2023-10-31
* @date 2023-10-31
*/
*/
@Data
@Data
public
class
RoomPack
extends
BaseEntity
{
public
class
S
RoomPack
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/**
/**
...
...
share-system/src/main/java/share/system/domain/vo/SRoomVo.java
View file @
f0f22a27
package
share
.
system
.
domain
.
vo
;
package
share
.
system
.
domain
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -81,6 +82,12 @@ public class SRoomVo extends BaseEntity
...
@@ -81,6 +82,12 @@ public class SRoomVo extends BaseEntity
@ApiModelProperty
(
value
=
"其他可能硬件接入参数(备用2)"
)
@ApiModelProperty
(
value
=
"其他可能硬件接入参数(备用2)"
)
private
String
params2
;
private
String
params2
;
/**
* 套餐ID
*/
@TableField
(
exist
=
false
)
private
String
packIds
;
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
...
...
share-system/src/main/java/share/system/mapper/PackMapper.java
View file @
f0f22a27
...
@@ -3,7 +3,7 @@ package share.system.mapper;
...
@@ -3,7 +3,7 @@ package share.system.mapper;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
share.system.domain.Pack
;
import
share.system.domain.
S
Pack
;
/**
/**
* 套餐Mapper接口
* 套餐Mapper接口
...
@@ -11,38 +11,38 @@ import share.system.domain.Pack;
...
@@ -11,38 +11,38 @@ import share.system.domain.Pack;
* @author wuwenlong
* @author wuwenlong
* @date 2023-10-31
* @date 2023-10-31
*/
*/
public
interface
PackMapper
extends
BaseMapper
<
Pack
>
{
public
interface
PackMapper
extends
BaseMapper
<
S
Pack
>
{
/**
/**
* 查询套餐
* 查询套餐
*
*
* @param id 套餐主键
* @param id 套餐主键
* @return 套餐
* @return 套餐
*/
*/
public
Pack
selectPackById
(
Long
id
);
public
S
Pack
selectPackById
(
Long
id
);
/**
/**
* 查询套餐列表
* 查询套餐列表
*
*
* @param
p
ack 套餐
* @param
SP
ack 套餐
* @return 套餐集合
* @return 套餐集合
*/
*/
public
List
<
Pack
>
selectPackList
(
Pack
p
ack
);
public
List
<
SPack
>
selectPackList
(
SPack
SP
ack
);
/**
/**
* 新增套餐
* 新增套餐
*
*
* @param
p
ack 套餐
* @param
SP
ack 套餐
* @return 结果
* @return 结果
*/
*/
public
int
insertPack
(
Pack
p
ack
);
public
int
insertPack
(
SPack
SP
ack
);
/**
/**
* 修改套餐
* 修改套餐
*
*
* @param
p
ack 套餐
* @param
SP
ack 套餐
* @return 结果
* @return 结果
*/
*/
public
int
updatePack
(
Pack
p
ack
);
public
int
updatePack
(
SPack
SP
ack
);
/**
/**
* 删除套餐
* 删除套餐
...
...
share-system/src/main/java/share/system/mapper/RoomPackMapper.java
View file @
f0f22a27
...
@@ -3,7 +3,7 @@ package share.system.mapper;
...
@@ -3,7 +3,7 @@ package share.system.mapper;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
share.system.domain.RoomPack
;
import
share.system.domain.
S
RoomPack
;
/**
/**
* 包房套餐关系Mapper接口
* 包房套餐关系Mapper接口
...
@@ -11,38 +11,38 @@ import share.system.domain.RoomPack;
...
@@ -11,38 +11,38 @@ import share.system.domain.RoomPack;
* @author wuwenlong
* @author wuwenlong
* @date 2023-10-31
* @date 2023-10-31
*/
*/
public
interface
RoomPackMapper
extends
BaseMapper
<
RoomPack
>
{
public
interface
RoomPackMapper
extends
BaseMapper
<
S
RoomPack
>
{
/**
/**
* 查询包房套餐关系
* 查询包房套餐关系
*
*
* @param id 包房套餐关系主键
* @param id 包房套餐关系主键
* @return 包房套餐关系
* @return 包房套餐关系
*/
*/
public
RoomPack
selectRoomPackById
(
Long
id
);
public
S
RoomPack
selectRoomPackById
(
Long
id
);
/**
/**
* 查询包房套餐关系列表
* 查询包房套餐关系列表
*
*
* @param
r
oomPack 包房套餐关系
* @param
SR
oomPack 包房套餐关系
* @return 包房套餐关系集合
* @return 包房套餐关系集合
*/
*/
public
List
<
RoomPack
>
selectRoomPackList
(
RoomPack
r
oomPack
);
public
List
<
SRoomPack
>
selectRoomPackList
(
SRoomPack
SR
oomPack
);
/**
/**
* 新增包房套餐关系
* 新增包房套餐关系
*
*
* @param
r
oomPack 包房套餐关系
* @param
SR
oomPack 包房套餐关系
* @return 结果
* @return 结果
*/
*/
public
int
insertRoomPack
(
RoomPack
r
oomPack
);
public
int
insertRoomPack
(
SRoomPack
SR
oomPack
);
/**
/**
* 修改包房套餐关系
* 修改包房套餐关系
*
*
* @param
r
oomPack 包房套餐关系
* @param
SR
oomPack 包房套餐关系
* @return 结果
* @return 结果
*/
*/
public
int
updateRoomPack
(
RoomPack
r
oomPack
);
public
int
updateRoomPack
(
SRoomPack
SR
oomPack
);
/**
/**
* 删除包房套餐关系
* 删除包房套餐关系
...
...
share-system/src/main/java/share/system/service/IPackService.java
View file @
f0f22a27
...
@@ -3,7 +3,7 @@ package share.system.service;
...
@@ -3,7 +3,7 @@ package share.system.service;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.Pack
;
import
share.system.domain.
S
Pack
;
/**
/**
* 套餐Service接口
* 套餐Service接口
...
@@ -11,38 +11,38 @@ import share.system.domain.Pack;
...
@@ -11,38 +11,38 @@ import share.system.domain.Pack;
* @author wuwenlong
* @author wuwenlong
* @date 2023-10-31
* @date 2023-10-31
*/
*/
public
interface
IPackService
extends
IService
<
Pack
>
{
public
interface
IPackService
extends
IService
<
S
Pack
>
{
/**
/**
* 查询套餐
* 查询套餐
*
*
* @param id 套餐主键
* @param id 套餐主键
* @return 套餐
* @return 套餐
*/
*/
public
Pack
selectPackById
(
Long
id
);
public
S
Pack
selectPackById
(
Long
id
);
/**
/**
* 查询套餐列表
* 查询套餐列表
*
*
* @param
p
ack 套餐
* @param
SP
ack 套餐
* @return 套餐集合
* @return 套餐集合
*/
*/
public
List
<
Pack
>
selectPackList
(
Pack
p
ack
);
public
List
<
SPack
>
selectPackList
(
SPack
SP
ack
);
/**
/**
* 新增套餐
* 新增套餐
*
*
* @param
p
ack 套餐
* @param
SP
ack 套餐
* @return 结果
* @return 结果
*/
*/
public
int
insertPack
(
Pack
p
ack
);
public
int
insertPack
(
SPack
SP
ack
);
/**
/**
* 修改套餐
* 修改套餐
*
*
* @param
p
ack 套餐
* @param
SP
ack 套餐
* @return 结果
* @return 结果
*/
*/
public
int
updatePack
(
Pack
p
ack
);
public
int
updatePack
(
SPack
SP
ack
);
/**
/**
* 批量删除套餐
* 批量删除套餐
...
@@ -60,5 +60,5 @@ public interface IPackService extends IService<Pack> {
...
@@ -60,5 +60,5 @@ public interface IPackService extends IService<Pack> {
*/
*/
public
int
deletePackById
(
Long
id
);
public
int
deletePackById
(
Long
id
);
List
<
Pack
>
selectPackListByIds
(
List
<
Long
>
packIds
);
List
<
S
Pack
>
selectPackListByIds
(
List
<
Long
>
packIds
);
}
}
share-system/src/main/java/share/system/service/IRoomPackService.java
View file @
f0f22a27
...
@@ -3,7 +3,7 @@ package share.system.service;
...
@@ -3,7 +3,7 @@ package share.system.service;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.RoomPack
;
import
share.system.domain.
S
RoomPack
;
/**
/**
* 包房套餐关系Service接口
* 包房套餐关系Service接口
...
@@ -11,38 +11,38 @@ import share.system.domain.RoomPack;
...
@@ -11,38 +11,38 @@ import share.system.domain.RoomPack;
* @author wuwenlong
* @author wuwenlong
* @date 2023-10-31
* @date 2023-10-31
*/
*/
public
interface
IRoomPackService
extends
IService
<
RoomPack
>
{
public
interface
IRoomPackService
extends
IService
<
S
RoomPack
>
{
/**
/**
* 查询包房套餐关系
* 查询包房套餐关系
*
*
* @param id 包房套餐关系主键
* @param id 包房套餐关系主键
* @return 包房套餐关系
* @return 包房套餐关系
*/
*/
public
RoomPack
selectRoomPackById
(
Long
id
);
public
S
RoomPack
selectRoomPackById
(
Long
id
);
/**
/**
* 查询包房套餐关系列表
* 查询包房套餐关系列表
*
*
* @param
r
oomPack 包房套餐关系
* @param
SR
oomPack 包房套餐关系
* @return 包房套餐关系集合
* @return 包房套餐关系集合
*/
*/
public
List
<
RoomPack
>
selectRoomPackList
(
RoomPack
r
oomPack
);
public
List
<
SRoomPack
>
selectRoomPackList
(
SRoomPack
SR
oomPack
);
/**
/**
* 新增包房套餐关系
* 新增包房套餐关系
*
*
* @param
r
oomPack 包房套餐关系
* @param
SR
oomPack 包房套餐关系
* @return 结果
* @return 结果
*/
*/
public
int
insertRoomPack
(
RoomPack
r
oomPack
);
public
int
insertRoomPack
(
SRoomPack
SR
oomPack
);
/**
/**
* 修改包房套餐关系
* 修改包房套餐关系
*
*
* @param
r
oomPack 包房套餐关系
* @param
SR
oomPack 包房套餐关系
* @return 结果
* @return 结果
*/
*/
public
int
updateRoomPack
(
RoomPack
r
oomPack
);
public
int
updateRoomPack
(
SRoomPack
SR
oomPack
);
/**
/**
* 批量删除包房套餐关系
* 批量删除包房套餐关系
...
...
share-system/src/main/java/share/system/service/ISRoomService.java
View file @
f0f22a27
...
@@ -3,7 +3,7 @@ package share.system.service;
...
@@ -3,7 +3,7 @@ package share.system.service;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.Pack
;
import
share.system.domain.
S
Pack
;
import
share.system.domain.SRoom
;
import
share.system.domain.SRoom
;
import
share.system.domain.vo.SRoomVo
;
import
share.system.domain.vo.SRoomVo
;
...
@@ -85,5 +85,5 @@ public interface ISRoomService extends IService<SRoom>
...
@@ -85,5 +85,5 @@ public interface ISRoomService extends IService<SRoom>
String
openDoor
(
Long
id
);
String
openDoor
(
Long
id
);
List
<
Pack
>
getPackByRoomId
(
Long
id
);
List
<
S
Pack
>
getPackByRoomId
(
Long
id
);
}
}
share-system/src/main/java/share/system/service/impl/PackServiceImpl.java
View file @
f0f22a27
...
@@ -2,12 +2,13 @@ package share.system.service.impl;
...
@@ -2,12 +2,13 @@ package share.system.service.impl;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
share.system.mapper.PackMapper
;
import
share.system.mapper.PackMapper
;
import
share.system.domain.Pack
;
import
share.system.domain.
S
Pack
;
import
share.system.service.IPackService
;
import
share.system.service.IPackService
;
/**
/**
...
@@ -17,7 +18,7 @@ import share.system.service.IPackService;
...
@@ -17,7 +18,7 @@ import share.system.service.IPackService;
* @date 2023-10-31
* @date 2023-10-31
*/
*/
@Service
@Service
public
class
PackServiceImpl
extends
ServiceImpl
<
PackMapper
,
Pack
>
implements
IPackService
{
public
class
PackServiceImpl
extends
ServiceImpl
<
PackMapper
,
S
Pack
>
implements
IPackService
{
@Autowired
@Autowired
private
PackMapper
packMapper
;
private
PackMapper
packMapper
;
...
@@ -28,43 +29,43 @@ public class PackServiceImpl extends ServiceImpl<PackMapper, Pack> implements IP
...
@@ -28,43 +29,43 @@ public class PackServiceImpl extends ServiceImpl<PackMapper, Pack> implements IP
* @return 套餐
* @return 套餐
*/
*/
@Override
@Override
public
Pack
selectPackById
(
Long
id
)
{
public
S
Pack
selectPackById
(
Long
id
)
{
return
packMapper
.
selectPackById
(
id
);
return
packMapper
.
selectPackById
(
id
);
}
}
/**
/**
* 查询套餐列表
* 查询套餐列表
*
*
* @param
p
ack 套餐
* @param
SP
ack 套餐
* @return 套餐
* @return 套餐
*/
*/
@Override
@Override
public
List
<
Pack
>
selectPackList
(
Pack
p
ack
)
{
public
List
<
SPack
>
selectPackList
(
SPack
SP
ack
)
{
return
packMapper
.
selectPackList
(
p
ack
);
return
packMapper
.
selectPackList
(
SP
ack
);
}
}
/**
/**
* 新增套餐
* 新增套餐
*
*
* @param
p
ack 套餐
* @param
SP
ack 套餐
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
insertPack
(
Pack
p
ack
)
{
public
int
insertPack
(
SPack
SP
ack
)
{
p
ack
.
setCreateTime
(
DateUtils
.
getNowDate
());
SP
ack
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
packMapper
.
insertPack
(
p
ack
);
return
packMapper
.
insertPack
(
SP
ack
);
}
}
/**
/**
* 修改套餐
* 修改套餐
*
*
* @param
p
ack 套餐
* @param
SP
ack 套餐
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
updatePack
(
Pack
p
ack
)
{
public
int
updatePack
(
SPack
SP
ack
)
{
p
ack
.
setUpdateTime
(
DateUtils
.
getNowDate
());
SP
ack
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
packMapper
.
updatePack
(
p
ack
);
return
packMapper
.
updatePack
(
SP
ack
);
}
}
/**
/**
...
@@ -90,7 +91,9 @@ public class PackServiceImpl extends ServiceImpl<PackMapper, Pack> implements IP
...
@@ -90,7 +91,9 @@ public class PackServiceImpl extends ServiceImpl<PackMapper, Pack> implements IP
}
}
@Override
@Override
public
List
<
Pack
>
selectPackListByIds
(
List
<
Long
>
packIds
)
{
public
List
<
SPack
>
selectPackListByIds
(
List
<
Long
>
packIds
)
{
return
packMapper
.
selectBatchIds
(
packIds
);
LambdaQueryWrapper
<
SPack
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
in
(
SPack:
:
getId
,
packIds
);
return
packMapper
.
selectList
(
queryWrapper
);
}
}
}
}
share-system/src/main/java/share/system/service/impl/RoomPackServiceImpl.java
View file @
f0f22a27
package
share
.
system
.
service
.
impl
;
package
share
.
system
.
service
.
impl
;
import
java.sql.Wrapper
;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
share.system.domain.SCleanRecords
;
import
share.system.mapper.RoomPackMapper
;
import
share.system.mapper.RoomPackMapper
;
import
share.system.domain.RoomPack
;
import
share.system.domain.
S
RoomPack
;
import
share.system.service.IRoomPackService
;
import
share.system.service.IRoomPackService
;
/**
/**
...
@@ -21,7 +18,7 @@ import share.system.service.IRoomPackService;
...
@@ -21,7 +18,7 @@ import share.system.service.IRoomPackService;
* @date 2023-10-31
* @date 2023-10-31
*/
*/
@Service
@Service
public
class
RoomPackServiceImpl
extends
ServiceImpl
<
RoomPackMapper
,
RoomPack
>
implements
IRoomPackService
{
public
class
RoomPackServiceImpl
extends
ServiceImpl
<
RoomPackMapper
,
S
RoomPack
>
implements
IRoomPackService
{
@Autowired
@Autowired
private
RoomPackMapper
roomPackMapper
;
private
RoomPackMapper
roomPackMapper
;
...
@@ -32,43 +29,43 @@ public class RoomPackServiceImpl extends ServiceImpl<RoomPackMapper, RoomPack> i
...
@@ -32,43 +29,43 @@ public class RoomPackServiceImpl extends ServiceImpl<RoomPackMapper, RoomPack> i
* @return 包房套餐关系
* @return 包房套餐关系
*/
*/
@Override
@Override
public
RoomPack
selectRoomPackById
(
Long
id
)
{
public
S
RoomPack
selectRoomPackById
(
Long
id
)
{
return
roomPackMapper
.
selectRoomPackById
(
id
);
return
roomPackMapper
.
selectRoomPackById
(
id
);
}
}
/**
/**
* 查询包房套餐关系列表
* 查询包房套餐关系列表
*
*
* @param
r
oomPack 包房套餐关系
* @param
SR
oomPack 包房套餐关系
* @return 包房套餐关系
* @return 包房套餐关系
*/
*/
@Override
@Override
public
List
<
RoomPack
>
selectRoomPackList
(
RoomPack
r
oomPack
)
{
public
List
<
SRoomPack
>
selectRoomPackList
(
SRoomPack
SR
oomPack
)
{
return
roomPackMapper
.
selectRoomPackList
(
r
oomPack
);
return
roomPackMapper
.
selectRoomPackList
(
SR
oomPack
);
}
}
/**
/**
* 新增包房套餐关系
* 新增包房套餐关系
*
*
* @param
r
oomPack 包房套餐关系
* @param
SR
oomPack 包房套餐关系
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
insertRoomPack
(
RoomPack
r
oomPack
)
{
public
int
insertRoomPack
(
SRoomPack
SR
oomPack
)
{
r
oomPack
.
setCreateTime
(
DateUtils
.
getNowDate
());
SR
oomPack
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
roomPackMapper
.
insertRoomPack
(
r
oomPack
);
return
roomPackMapper
.
insertRoomPack
(
SR
oomPack
);
}
}
/**
/**
* 修改包房套餐关系
* 修改包房套餐关系
*
*
* @param
r
oomPack 包房套餐关系
* @param
SR
oomPack 包房套餐关系
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
updateRoomPack
(
RoomPack
r
oomPack
)
{
public
int
updateRoomPack
(
SRoomPack
SR
oomPack
)
{
r
oomPack
.
setUpdateTime
(
DateUtils
.
getNowDate
());
SR
oomPack
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
roomPackMapper
.
updateRoomPack
(
r
oomPack
);
return
roomPackMapper
.
updateRoomPack
(
SR
oomPack
);
}
}
/**
/**
...
@@ -100,8 +97,8 @@ public class RoomPackServiceImpl extends ServiceImpl<RoomPackMapper, RoomPack> i
...
@@ -100,8 +97,8 @@ public class RoomPackServiceImpl extends ServiceImpl<RoomPackMapper, RoomPack> i
@Override
@Override
public
int
deleteRoomPackByRoomId
(
Long
id
)
{
public
int
deleteRoomPackByRoomId
(
Long
id
)
{
LambdaQueryWrapper
<
RoomPack
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
S
RoomPack
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
RoomPack:
:
getRoomId
,
id
);
queryWrapper
.
eq
(
S
RoomPack:
:
getRoomId
,
id
);
return
roomPackMapper
.
delete
(
queryWrapper
);
return
roomPackMapper
.
delete
(
queryWrapper
);
}
}
}
}
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
f0f22a27
...
@@ -11,8 +11,8 @@ import share.common.enums.RoleTypeEnum;
...
@@ -11,8 +11,8 @@ import share.common.enums.RoleTypeEnum;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
share.system.domain.Pack
;
import
share.system.domain.
S
Pack
;
import
share.system.domain.RoomPack
;
import
share.system.domain.
S
RoomPack
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumer
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.SRoomVo
;
import
share.system.domain.vo.SRoomVo
;
...
@@ -54,6 +54,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
...
@@ -54,6 +54,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
public
SRoomVo
selectSRoomById
(
Long
id
)
public
SRoomVo
selectSRoomById
(
Long
id
)
{
{
SRoom
sRoom
=
sRoomMapper
.
selectSRoomById
(
id
);
SRoom
sRoom
=
sRoomMapper
.
selectSRoomById
(
id
);
sRoom
.
setPackIds
(
roomPackService
.
selectPackListByRoomId
(
id
).
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
if
(
Objects
.
nonNull
(
sRoom
)&&
sRoom
.
getId
()!=
null
){
if
(
Objects
.
nonNull
(
sRoom
)&&
sRoom
.
getId
()!=
null
){
return
convertVoList
(
new
ArrayList
<
SRoom
>(){{
add
(
sRoom
);}}).
get
(
0
);
return
convertVoList
(
new
ArrayList
<
SRoom
>(){{
add
(
sRoom
);}}).
get
(
0
);
}
}
...
@@ -70,6 +71,9 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
...
@@ -70,6 +71,9 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
public
List
<
SRoomVo
>
selectSRoomList
(
SRoom
sRoom
)
public
List
<
SRoomVo
>
selectSRoomList
(
SRoom
sRoom
)
{
{
List
<
SRoom
>
roomList
=
sRoomMapper
.
selectSRoomList
(
sRoom
);
List
<
SRoom
>
roomList
=
sRoomMapper
.
selectSRoomList
(
sRoom
);
roomList
.
forEach
(
o
->
{
o
.
setPackIds
(
roomPackService
.
selectPackListByRoomId
(
o
.
getId
()).
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
});
return
convertVoList
(
roomList
);
return
convertVoList
(
roomList
);
}
}
...
@@ -101,25 +105,32 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
...
@@ -101,25 +105,32 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
@Override
@Override
public
int
insertSRoom
(
SRoom
sRoom
)
public
int
insertSRoom
(
SRoom
sRoom
)
{
{
//判断套餐ID
int
i
=
0
;
if
(
sRoom
.
getPackIds
().
length
>
0
)
{
try
{
List
<
Pack
>
packList
=
packService
.
selectPackListByIds
(
Arrays
.
asList
(
sRoom
.
getPackIds
()));
sRoom
.
setCreateTime
(
DateUtils
.
getNowDate
());
if
(
CollectionUtils
.
isEmpty
(
packList
))
{
i
=
sRoomMapper
.
insertSRoom
(
sRoom
);
throw
new
RuntimeException
(
"套餐不存在"
);
//判断套餐ID
if
(!
sRoom
.
getPackIds
().
isEmpty
())
{
//String 转Long
List
<
SPack
>
SPackList
=
packService
.
selectPackListByIds
(
Arrays
.
asList
(
sRoom
.
getPackIds
().
split
(
","
)).
stream
().
map
(
Long:
:
valueOf
).
collect
(
Collectors
.
toList
()));
if
(
CollectionUtils
.
isEmpty
(
SPackList
))
{
throw
new
RuntimeException
(
"套餐不存在"
);
}
List
<
Long
>
list
=
Arrays
.
asList
(
sRoom
.
getPackIds
().
split
(
","
)).
stream
().
map
(
Long:
:
valueOf
).
collect
(
Collectors
.
toList
());
List
<
SRoomPack
>
SRoomPackList
=
new
ArrayList
<>();
list
.
stream
().
forEach
(
o
->
{
SRoomPack
SRoomPack
=
new
SRoomPack
();
SRoomPack
.
setPackId
(
o
);
SRoomPack
.
setRoomId
(
sRoom
.
getId
());
SRoomPack
.
setCreateTime
(
DateUtils
.
getNowDate
());
SRoomPackList
.
add
(
SRoomPack
);
});
roomPackService
.
saveBatch
(
SRoomPackList
);
}
}
List
<
Long
>
list
=
Arrays
.
asList
(
sRoom
.
getPackIds
());
}
catch
(
Exception
e
)
{
List
<
RoomPack
>
roomPackList
=
new
ArrayList
<>();
throw
new
RuntimeException
(
"新增房间失败"
);
list
.
stream
().
forEach
(
o
->
{
RoomPack
roomPack
=
new
RoomPack
();
roomPack
.
setPackId
(
o
);
roomPack
.
setRoomId
(
sRoom
.
getId
());
roomPack
.
setCreateTime
(
DateUtils
.
getNowDate
());
roomPackList
.
add
(
roomPack
);
});
roomPackService
.
saveBatch
(
roomPackList
);
}
}
sRoom
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
i
;
return
sRoomMapper
.
insertSRoom
(
sRoom
);
}
}
/**
/**
...
@@ -132,24 +143,24 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
...
@@ -132,24 +143,24 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
public
int
updateSRoom
(
SRoom
sRoom
)
public
int
updateSRoom
(
SRoom
sRoom
)
{
{
//判断套餐ID
//判断套餐ID
if
(
sRoom
.
getPackIds
().
length
>
0
)
{
if
(
!
sRoom
.
getPackIds
().
isEmpty
()
)
{
//判断套餐ID
//判断套餐ID
List
<
Pack
>
packList
=
packService
.
selectPackListByIds
(
Arrays
.
asList
(
sRoom
.
getPackIds
()));
List
<
SPack
>
SPackList
=
packService
.
selectPackListByIds
(
Arrays
.
asList
(
sRoom
.
getPackIds
().
split
(
","
)).
stream
().
map
(
Long:
:
valueOf
).
collect
(
Collectors
.
toList
()));
if
(
CollectionUtils
.
isEmpty
(
p
ackList
))
{
if
(
CollectionUtils
.
isEmpty
(
SP
ackList
))
{
throw
new
RuntimeException
(
"套餐不存在"
);
throw
new
RuntimeException
(
"套餐不存在"
);
}
}
//删除原有套餐
//删除原有套餐
roomPackService
.
deleteRoomPackByRoomId
(
sRoom
.
getId
());
roomPackService
.
deleteRoomPackByRoomId
(
sRoom
.
getId
());
List
<
Long
>
list
=
Arrays
.
asList
(
sRoom
.
getPackIds
());
List
<
Long
>
list
=
Arrays
.
asList
(
sRoom
.
getPackIds
()
.
split
(
","
)).
stream
().
map
(
Long:
:
valueOf
).
collect
(
Collectors
.
toList
()
);
List
<
RoomPack
>
r
oomPackList
=
new
ArrayList
<>();
List
<
SRoomPack
>
SR
oomPackList
=
new
ArrayList
<>();
list
.
stream
().
forEach
(
o
->
{
list
.
stream
().
forEach
(
o
->
{
RoomPack
roomPack
=
new
RoomPack
();
SRoomPack
SRoomPack
=
new
S
RoomPack
();
r
oomPack
.
setPackId
(
o
);
SR
oomPack
.
setPackId
(
o
);
r
oomPack
.
setRoomId
(
sRoom
.
getId
());
SR
oomPack
.
setRoomId
(
sRoom
.
getId
());
r
oomPack
.
setCreateTime
(
DateUtils
.
getNowDate
());
SR
oomPack
.
setCreateTime
(
DateUtils
.
getNowDate
());
roomPackList
.
add
(
r
oomPack
);
SRoomPackList
.
add
(
SR
oomPack
);
});
});
roomPackService
.
saveBatch
(
r
oomPackList
);
roomPackService
.
saveBatch
(
SR
oomPackList
);
}
}
sRoom
.
setUpdateTime
(
DateUtils
.
getNowDate
());
sRoom
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
sRoomMapper
.
updateSRoom
(
sRoom
);
return
sRoomMapper
.
updateSRoom
(
sRoom
);
...
@@ -223,7 +234,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
...
@@ -223,7 +234,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
}
}
@Override
@Override
public
List
<
Pack
>
getPackByRoomId
(
Long
id
)
{
public
List
<
S
Pack
>
getPackByRoomId
(
Long
id
)
{
List
<
Long
>
packIds
=
roomPackService
.
selectPackListByRoomId
(
id
);
List
<
Long
>
packIds
=
roomPackService
.
selectPackListByRoomId
(
id
);
return
packService
.
selectPackListByIds
(
packIds
);
return
packService
.
selectPackListByIds
(
packIds
);
}
}
...
...
share-system/src/main/resources/mapper/system/PackMapper.xml
View file @
f0f22a27
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"share.system.mapper.PackMapper"
>
<mapper
namespace=
"share.system.mapper.PackMapper"
>
<resultMap
type=
"Pack"
id=
"PackResult"
>
<resultMap
type=
"
S
Pack"
id=
"PackResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"duration"
column=
"duration"
/>
<result
property=
"duration"
column=
"duration"
/>
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
from s_pack
from s_pack
</sql>
</sql>
<select
id=
"selectPackList"
parameterType=
"Pack"
resultMap=
"PackResult"
>
<select
id=
"selectPackList"
parameterType=
"
S
Pack"
resultMap=
"PackResult"
>
<include
refid=
"selectPackVo"
/>
<include
refid=
"selectPackVo"
/>
<where>
<where>
<if
test=
"name != null and name != ''"
>
and name like concat('%', #{name}, '%')
</if>
<if
test=
"name != null and name != ''"
>
and name like concat('%', #{name}, '%')
</if>
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
where id = #{id}
where id = #{id}
</select>
</select>
<insert
id=
"insertPack"
parameterType=
"Pack"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insertPack"
parameterType=
"
S
Pack"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into s_pack
insert into s_pack
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"name != null"
>
name,
</if>
<if
test=
"name != null"
>
name,
</if>
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
</trim>
</trim>
</insert>
</insert>
<update
id=
"updatePack"
parameterType=
"Pack"
>
<update
id=
"updatePack"
parameterType=
"
S
Pack"
>
update s_pack
update s_pack
<trim
prefix=
"SET"
suffixOverrides=
","
>
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"name != null"
>
name = #{name},
</if>
<if
test=
"name != null"
>
name = #{name},
</if>
...
...
share-system/src/main/resources/mapper/system/RoomPackMapper.xml
View file @
f0f22a27
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"share.system.mapper.RoomPackMapper"
>
<mapper
namespace=
"share.system.mapper.RoomPackMapper"
>
<resultMap
type=
"RoomPack"
id=
"RoomPackResult"
>
<resultMap
type=
"
S
RoomPack"
id=
"RoomPackResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"roomId"
column=
"room_id"
/>
<result
property=
"roomId"
column=
"room_id"
/>
<result
property=
"packId"
column=
"pack_id"
/>
<result
property=
"packId"
column=
"pack_id"
/>
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
from s_room_pack
from s_room_pack
</sql>
</sql>
<select
id=
"selectRoomPackList"
parameterType=
"RoomPack"
resultMap=
"RoomPackResult"
>
<select
id=
"selectRoomPackList"
parameterType=
"
S
RoomPack"
resultMap=
"RoomPackResult"
>
<include
refid=
"selectRoomPackVo"
/>
<include
refid=
"selectRoomPackVo"
/>
<where>
<where>
<if
test=
"roomId != null "
>
and room_id = #{roomId}
</if>
<if
test=
"roomId != null "
>
and room_id = #{roomId}
</if>
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
where room_id = #{roomId}
where room_id = #{roomId}
</select>
</select>
<insert
id=
"insertRoomPack"
parameterType=
"RoomPack"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insertRoomPack"
parameterType=
"
S
RoomPack"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into s_room_pack
insert into s_room_pack
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"roomId != null"
>
room_id,
</if>
<if
test=
"roomId != null"
>
room_id,
</if>
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
</trim>
</trim>
</insert>
</insert>
<update
id=
"updateRoomPack"
parameterType=
"RoomPack"
>
<update
id=
"updateRoomPack"
parameterType=
"
S
RoomPack"
>
update s_room_pack
update s_room_pack
<trim
prefix=
"SET"
suffixOverrides=
","
>
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"roomId != null"
>
room_id = #{roomId},
</if>
<if
test=
"roomId != null"
>
room_id = #{roomId},
</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