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
af93e6c6
Commit
af93e6c6
authored
Jan 20, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
b5bcd547
e1557ee0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
6 deletions
+73
-6
SCouponMapper.java
...stem/src/main/java/share/system/mapper/SCouponMapper.java
+5
-1
ISCouponService.java
...m/src/main/java/share/system/service/ISCouponService.java
+4
-1
RoomPackServiceImpl.java
...n/java/share/system/service/impl/RoomPackServiceImpl.java
+10
-1
SCouponServiceImpl.java
...in/java/share/system/service/impl/SCouponServiceImpl.java
+5
-1
SStoreServiceImpl.java
...ain/java/share/system/service/impl/SStoreServiceImpl.java
+49
-2
No files found.
share-system/src/main/java/share/system/mapper/SCouponMapper.java
View file @
af93e6c6
package
share
.
system
.
mapper
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
share.system.domain.SCoupon
;
import
share.system.domain.SmsLog
;
/**
* 优惠券Mapper接口
...
...
@@ -9,7 +12,7 @@ import share.system.domain.SCoupon;
* @author ruoyi
* @date 2023-09-27
*/
public
interface
SCouponMapper
public
interface
SCouponMapper
extends
BaseMapper
<
SCoupon
>
{
/**
* 查询优惠券
...
...
@@ -68,4 +71,5 @@ public interface SCouponMapper
List
<
SCoupon
>
selectSCouponByDealgroupId
(
Long
dealgroupId
);
SCoupon
selectByDealgroupId
(
Long
dealgroupId
);
}
share-system/src/main/java/share/system/service/ISCouponService.java
View file @
af93e6c6
package
share
.
system
.
service
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.DeviceLog
;
import
share.system.domain.SCoupon
;
/**
...
...
@@ -9,7 +12,7 @@ import share.system.domain.SCoupon;
* @author ruoyi
* @date 2023-09-27
*/
public
interface
ISCouponService
public
interface
ISCouponService
extends
IService
<
SCoupon
>
{
/**
* 查询优惠券
...
...
share-system/src/main/java/share/system/service/impl/RoomPackServiceImpl.java
View file @
af93e6c6
...
...
@@ -7,9 +7,11 @@ import java.util.stream.Collectors;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.ObjectUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.system.domain.SRoom
;
import
share.system.mapper.RoomPackMapper
;
import
share.system.domain.SRoomPack
;
import
share.system.mapper.SRoomMapper
;
...
...
@@ -111,8 +113,15 @@ public class RoomPackServiceImpl extends ServiceImpl<RoomPackMapper, SRoomPack>
LambdaQueryWrapper
<
SRoomPack
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SRoomPack:
:
getPackId
,
id
);
List
<
SRoomPack
>
sRoomPackList
=
baseMapper
.
selectList
(
queryWrapper
);
List
<
Long
>
roomIds
=
sRoomPackList
.
stream
().
map
(
SRoomPack:
:
getRoomId
).
collect
(
Collectors
.
toList
());
List
<
SRoom
>
sRoomList
=
sRoomMapper
.
selectList
(
new
LambdaQueryWrapper
<
SRoom
>().
in
(
SRoom:
:
getId
,
roomIds
));
sRoomPackList
.
forEach
(
item
->
{
item
.
setRoomName
(
sRoomMapper
.
selectById
(
item
.
getRoomId
()).
getName
());
if
(
ObjectUtils
.
isNotEmpty
(
item
.
getRoomId
()))
{
Optional
<
SRoom
>
first
=
sRoomList
.
stream
().
filter
(
sRoom
->
sRoom
.
getId
().
equals
(
item
.
getRoomId
())).
findFirst
();
if
(
first
.
isPresent
())
{
item
.
setRoomName
(
first
.
get
().
getName
());
}
}
});
return
sRoomPackList
;
}
...
...
share-system/src/main/java/share/system/service/impl/SCouponServiceImpl.java
View file @
af93e6c6
...
...
@@ -7,6 +7,7 @@ import java.util.*;
import
java.util.stream.Collectors
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouDealQueryShopDealResponseEntity
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -18,11 +19,14 @@ import share.common.utils.DateUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.system.domain.SStore
;
import
share.system.domain.SmsLog
;
import
share.system.mapper.SCouponMapper
;
import
share.system.domain.SCoupon
;
import
share.system.mapper.SmsLogMapper
;
import
share.system.service.ISCouponService
;
import
share.system.service.ISStoreService
;
import
share.system.service.QPService
;
import
share.system.service.SmsLogService
;
/**
* 优惠券Service业务层处理
...
...
@@ -31,7 +35,7 @@ import share.system.service.QPService;
* @date 2023-09-27
*/
@Service
public
class
SCouponServiceImpl
implements
ISCouponService
{
public
class
SCouponServiceImpl
extends
ServiceImpl
<
SCouponMapper
,
SCoupon
>
implements
ISCouponService
{
@Autowired
private
SCouponMapper
sCouponMapper
;
@Autowired
...
...
share-system/src/main/java/share/system/service/impl/SStoreServiceImpl.java
View file @
af93e6c6
...
...
@@ -58,6 +58,8 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
private
ISOrderService
orderService
;
@Autowired
private
DeviceService
deviceService
;
@Autowired
private
ISCouponService
sCouponService
;
/**
* 查询门店
...
...
@@ -89,6 +91,12 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
*/
@Override
public
int
insertSStore
(
SStore
sStore
)
{
LambdaQueryWrapper
<
SStore
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SStore:
:
getOpenShopUuid
,
sStore
.
getOpenShopUuid
());
List
<
SStore
>
sStoreList
=
baseMapper
.
selectList
(
queryWrapper
);
if
(
CollectionUtils
.
isNotEmpty
(
sStoreList
))
{
throw
new
BaseException
(
"该门店已存在!"
);
}
sStore
.
setCreateTime
(
DateUtils
.
getNowDate
());
// 获取最新设备分组
SStore
store
=
baseMapper
.
selectByMaxDeviceGroup
();
...
...
@@ -105,7 +113,44 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
}
else
{
sStore
.
setDeviceGroup
(
"FFFA10000001"
);
}
return
baseMapper
.
insertSStore
(
sStore
);
int
i
=
baseMapper
.
insertSStore
(
sStore
);
//过滤掉没有dealgroupId的优惠券
extracted
();
return
i
;
}
private
void
extracted
()
{
List
<
SCoupon
>
sCouponList1
=
sCouponService
.
selectSCouponList
(
new
SCoupon
()).
stream
().
filter
(
item
->
item
.
getDealgroupId
()
!=
null
).
collect
(
Collectors
.
toList
());
List
<
SCoupon
>
sCouponList
=
sCouponService
.
queryShopDeal
();
List
<
SCoupon
>
sCouponList2
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
sCouponList1
))
{
sCouponList1
.
stream
().
forEach
(
item
->
{
if
(
CollectionUtils
.
isNotEmpty
(
sCouponList
))
{
sCouponList
.
stream
().
forEach
(
item1
->
{
if
(
item
.
getDealgroupId
().
equals
(
item1
.
getDealgroupId
()))
{
if
(
StringUtils
.
isNotEmpty
(
item
.
getStoreIds
()))
{
if
(
item1
.
getStoreIds
().
contains
(
item
.
getStoreIds
()))
{
return
;
}
else
{
SCoupon
sCoupon
=
new
SCoupon
();
sCoupon
.
setId
(
item
.
getId
());
sCoupon
.
setStoreIds
(
item1
.
getStoreIds
());
sCouponList2
.
add
(
sCoupon
);
}
}
else
{
SCoupon
sCoupon
=
new
SCoupon
();
sCoupon
.
setId
(
item
.
getId
());
sCoupon
.
setStoreIds
(
item1
.
getStoreIds
());
sCouponList2
.
add
(
sCoupon
);
}
}
});
}
});
}
if
(
CollectionUtils
.
isNotEmpty
(
sCouponList2
))
{
sCouponService
.
updateBatchById
(
sCouponList2
);
}
}
/**
...
...
@@ -148,7 +193,9 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
if
(
CollectionUtils
.
isNotEmpty
(
sRooms
))
{
throw
new
BaseException
(
"当前门店下存在房间,不能删除!"
);
}
return
baseMapper
.
deleteSStoreByIds
(
ids
);
int
i
=
baseMapper
.
deleteSStoreByIds
(
ids
);
extracted
();
return
i
;
}
/**
...
...
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