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
f95e8668
Commit
f95e8668
authored
Oct 31, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
房间管理增加套餐逻辑
parent
4695f84b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
138 additions
and
3 deletions
+138
-3
PlatformTypeEnum.java
...on/src/main/java/share/common/enums/PlatformTypeEnum.java
+36
-0
SourceTypeEnum.java
...mmon/src/main/java/share/common/enums/SourceTypeEnum.java
+36
-0
SConsumerCoupon.java
...em/src/main/java/share/system/domain/SConsumerCoupon.java
+1
-1
SRoom.java
share-system/src/main/java/share/system/domain/SRoom.java
+7
-0
IRoomPackService.java
.../src/main/java/share/system/service/IRoomPackService.java
+2
-0
QPServiceImpl.java
...rc/main/java/share/system/service/impl/QPServiceImpl.java
+6
-2
RoomPackServiceImpl.java
...n/java/share/system/service/impl/RoomPackServiceImpl.java
+11
-0
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+39
-0
No files found.
share-common/src/main/java/share/common/enums/PlatformTypeEnum.java
0 → 100644
View file @
f95e8668
package
share
.
common
.
enums
;
public
enum
PlatformTypeEnum
{
//1:自营,2:美团
SELF
(
"1"
,
"自营"
),
MEITUAN
(
"2"
,
"美团"
);
private
String
code
;
private
String
name
;
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
PlatformTypeEnum
(
String
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
PlatformTypeEnum
()
{
}
}
share-common/src/main/java/share/common/enums/SourceTypeEnum.java
0 → 100644
View file @
f95e8668
package
share
.
common
.
enums
;
public
enum
SourceTypeEnum
{
//1:领取,2:赠送,3:验券
RECEIVE
(
"1"
,
"领取"
),
GIVE
(
"2"
,
"赠送"
),
CHECK
(
"3"
,
"验券"
);
private
String
code
;
private
String
name
;
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
SourceTypeEnum
(
String
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
SourceTypeEnum
()
{
}
}
share-system/src/main/java/share/system/domain/SConsumerCoupon.java
View file @
f95e8668
...
@@ -57,7 +57,7 @@ public class SConsumerCoupon extends BaseEntity
...
@@ -57,7 +57,7 @@ public class SConsumerCoupon extends BaseEntity
private
String
couponTimeEnd
;
private
String
couponTimeEnd
;
/** 优惠券类型(1:折扣券,2,满减券,3:时长券) */
/** 优惠券类型(1:折扣券,2,满减券,3:时长券) */
@Excel
(
name
=
"优惠券类型(1:折扣券,2,
满减券,3:时长券
)"
)
@Excel
(
name
=
"优惠券类型(1:折扣券,2,
团购券,3:满减券,4:核销券,5:充值送金额,6:套餐劵
)"
)
private
Integer
couponType
;
private
Integer
couponType
;
/** 门槛时长 */
/** 门槛时长 */
...
...
share-system/src/main/java/share/system/domain/SRoom.java
View file @
f95e8668
package
share
.
system
.
domain
;
package
share
.
system
.
domain
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
lombok.Data
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
...
@@ -74,4 +75,10 @@ public class SRoom extends BaseEntity
...
@@ -74,4 +75,10 @@ public class SRoom extends BaseEntity
@Excel
(
name
=
"其他可能硬件接入参数(备用2)"
)
@Excel
(
name
=
"其他可能硬件接入参数(备用2)"
)
private
String
params2
;
private
String
params2
;
/**
* 套餐ID数组
*/
@TableField
(
exist
=
false
)
private
Long
[]
packIds
;
}
}
share-system/src/main/java/share/system/service/IRoomPackService.java
View file @
f95e8668
...
@@ -61,4 +61,6 @@ public interface IRoomPackService extends IService<RoomPack> {
...
@@ -61,4 +61,6 @@ public interface IRoomPackService extends IService<RoomPack> {
public
int
deleteRoomPackById
(
Long
id
);
public
int
deleteRoomPackById
(
Long
id
);
List
<
Long
>
selectPackListByRoomId
(
Long
id
);
List
<
Long
>
selectPackListByRoomId
(
Long
id
);
int
deleteRoomPackByRoomId
(
Long
id
);
}
}
share-system/src/main/java/share/system/service/impl/QPServiceImpl.java
View file @
f95e8668
...
@@ -11,10 +11,14 @@ import com.dianping.openapi.sdk.api.tuangou.TuangouReceiptPrepare;
...
@@ -11,10 +11,14 @@ import com.dianping.openapi.sdk.api.tuangou.TuangouReceiptPrepare;
import
com.dianping.openapi.sdk.api.tuangou.TuangouReceiptReverseConsume
;
import
com.dianping.openapi.sdk.api.tuangou.TuangouReceiptReverseConsume
;
import
com.dianping.openapi.sdk.api.tuangou.entity.*
;
import
com.dianping.openapi.sdk.api.tuangou.entity.*
;
import
com.dianping.openapi.sdk.httpclient.DefaultOpenAPIClient
;
import
com.dianping.openapi.sdk.httpclient.DefaultOpenAPIClient
;
import
com.sun.deploy.services.PlatformType
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
share.common.enums.DataSourceType
;
import
share.common.enums.PlatformTypeEnum
;
import
share.common.enums.SourceTypeEnum
;
import
share.common.utils.uuid.UUID
;
import
share.common.utils.uuid.UUID
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumerCoupon
;
import
share.system.domain.SConsumerCoupon
;
...
@@ -74,8 +78,8 @@ public class QPServiceImpl implements QPService {
...
@@ -74,8 +78,8 @@ public class QPServiceImpl implements QPService {
sConsumerCoupon
.
setDuration
(
sCoupon
.
getDuration
());
sConsumerCoupon
.
setDuration
(
sCoupon
.
getDuration
());
sConsumerCoupon
.
setMinPrice
(
sCoupon
.
getMinPrice
());
sConsumerCoupon
.
setMinPrice
(
sCoupon
.
getMinPrice
());
sConsumerCoupon
.
setSubPrice
(
sCoupon
.
getSubPrice
());
sConsumerCoupon
.
setSubPrice
(
sCoupon
.
getSubPrice
());
sConsumerCoupon
.
setSourceType
(
"3"
);
sConsumerCoupon
.
setSourceType
(
SourceTypeEnum
.
CHECK
.
getCode
()
);
sConsumerCoupon
.
setPlatformType
(
"2"
);
sConsumerCoupon
.
setPlatformType
(
PlatformTypeEnum
.
MEITUAN
.
getCode
()
);
sConsumerCoupon
.
setStartDate
(
sCoupon
.
getStartDate
());
sConsumerCoupon
.
setStartDate
(
sCoupon
.
getStartDate
());
sConsumerCoupon
.
setEndDate
(
item
.
getReceiptEndDate
());
sConsumerCoupon
.
setEndDate
(
item
.
getReceiptEndDate
());
sConsumerCoupon
.
setCouponTimeStart
(
sCoupon
.
getValidStartTime
());
sConsumerCoupon
.
setCouponTimeStart
(
sCoupon
.
getValidStartTime
());
...
...
share-system/src/main/java/share/system/service/impl/RoomPackServiceImpl.java
View file @
f95e8668
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.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.RoomPack
;
import
share.system.service.IRoomPackService
;
import
share.system.service.IRoomPackService
;
...
@@ -93,4 +97,11 @@ public class RoomPackServiceImpl extends ServiceImpl<RoomPackMapper, RoomPack> i
...
@@ -93,4 +97,11 @@ public class RoomPackServiceImpl extends ServiceImpl<RoomPackMapper, RoomPack> i
public
List
<
Long
>
selectPackListByRoomId
(
Long
id
)
{
public
List
<
Long
>
selectPackListByRoomId
(
Long
id
)
{
return
roomPackMapper
.
selectPackListByRoomId
(
id
);
return
roomPackMapper
.
selectPackListByRoomId
(
id
);
}
}
@Override
public
int
deleteRoomPackByRoomId
(
Long
id
)
{
LambdaQueryWrapper
<
RoomPack
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
RoomPack:
:
getRoomId
,
id
);
return
roomPackMapper
.
delete
(
queryWrapper
);
}
}
}
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
f95e8668
...
@@ -12,6 +12,7 @@ import share.common.utils.DateUtils;
...
@@ -12,6 +12,7 @@ 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.Pack
;
import
share.system.domain.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
;
...
@@ -100,6 +101,23 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
...
@@ -100,6 +101,23 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
@Override
@Override
public
int
insertSRoom
(
SRoom
sRoom
)
public
int
insertSRoom
(
SRoom
sRoom
)
{
{
//判断套餐ID
if
(
sRoom
.
getPackIds
().
length
>
0
)
{
List
<
Pack
>
packList
=
packService
.
selectPackListByIds
(
Arrays
.
asList
(
sRoom
.
getPackIds
()));
if
(
CollectionUtils
.
isEmpty
(
packList
))
{
throw
new
RuntimeException
(
"套餐不存在"
);
}
List
<
Long
>
list
=
Arrays
.
asList
(
sRoom
.
getPackIds
());
List
<
RoomPack
>
roomPackList
=
new
ArrayList
<>();
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
());
sRoom
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
sRoomMapper
.
insertSRoom
(
sRoom
);
return
sRoomMapper
.
insertSRoom
(
sRoom
);
}
}
...
@@ -113,6 +131,26 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
...
@@ -113,6 +131,26 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
@Override
@Override
public
int
updateSRoom
(
SRoom
sRoom
)
public
int
updateSRoom
(
SRoom
sRoom
)
{
{
//判断套餐ID
if
(
sRoom
.
getPackIds
().
length
>
0
)
{
//判断套餐ID
List
<
Pack
>
packList
=
packService
.
selectPackListByIds
(
Arrays
.
asList
(
sRoom
.
getPackIds
()));
if
(
CollectionUtils
.
isEmpty
(
packList
))
{
throw
new
RuntimeException
(
"套餐不存在"
);
}
//删除原有套餐
roomPackService
.
deleteRoomPackByRoomId
(
sRoom
.
getId
());
List
<
Long
>
list
=
Arrays
.
asList
(
sRoom
.
getPackIds
());
List
<
RoomPack
>
roomPackList
=
new
ArrayList
<>();
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
.
setUpdateTime
(
DateUtils
.
getNowDate
());
sRoom
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
sRoomMapper
.
updateSRoom
(
sRoom
);
return
sRoomMapper
.
updateSRoom
(
sRoom
);
}
}
...
@@ -126,6 +164,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
...
@@ -126,6 +164,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
@Override
@Override
public
int
deleteSRoomByIds
(
Long
[]
ids
)
public
int
deleteSRoomByIds
(
Long
[]
ids
)
{
{
roomPackService
.
deleteRoomPackByIds
(
ids
);
return
sRoomMapper
.
deleteSRoomByIds
(
ids
);
return
sRoomMapper
.
deleteSRoomByIds
(
ids
);
}
}
...
...
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