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
ef425347
Commit
ef425347
authored
Aug 20, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店增加门店管理人员
parent
cbb2cf93
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
10 deletions
+44
-10
PositionEnum.java
...common/src/main/java/share/common/enums/PositionEnum.java
+3
-2
SStoreController.java
...in/java/share/web/controller/system/SStoreController.java
+6
-0
SConsumerVo.java
...tem/src/main/java/share/system/domain/vo/SConsumerVo.java
+2
-0
ISStoreService.java
...em/src/main/java/share/system/service/ISStoreService.java
+2
-0
SConsumerServiceImpl.java
.../java/share/system/service/impl/SConsumerServiceImpl.java
+6
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+12
-8
SStoreServiceImpl.java
...ain/java/share/system/service/impl/SStoreServiceImpl.java
+13
-0
No files found.
share-common/src/main/java/share/common/enums/PositionEnum.java
View file @
ef425347
...
@@ -6,8 +6,9 @@ public enum PositionEnum {
...
@@ -6,8 +6,9 @@ public enum PositionEnum {
CLEANER
(
1
,
"保洁人员"
),
CLEANER
(
1
,
"保洁人员"
),
ADMIN
(
2
,
"管理员"
),
ADMIN
(
2
,
"管理员"
),
//客服
//客服
CUSTOMER_SERVICE
(
3
,
"客服"
);
CUSTOMER_SERVICE
(
3
,
"客服"
),
;
//门店管理
MANAGE
(
4
,
"门店管理"
);
private
Integer
code
;
private
Integer
code
;
private
String
name
;
private
String
name
;
...
...
share-front/src/main/java/share/web/controller/system/SStoreController.java
View file @
ef425347
...
@@ -81,6 +81,12 @@ public class SStoreController extends BaseController
...
@@ -81,6 +81,12 @@ public class SStoreController extends BaseController
return
success
(
sStoreService
.
storeList
());
return
success
(
sStoreService
.
storeList
());
}
}
//用户管理的门店
@GetMapping
(
"/manageList"
)
@ApiOperation
(
value
=
"门店管理负责的门店"
)
public
AjaxResult
manageList
()
{
return
success
(
sStoreService
.
manageList
());
}
@PostMapping
(
"/queryByStoreIds"
)
@PostMapping
(
"/queryByStoreIds"
)
public
R
<
List
<
SStoreVo
>>
queryByStoreIds
(
@RequestBody
SStoreDto
dto
)
{
public
R
<
List
<
SStoreVo
>>
queryByStoreIds
(
@RequestBody
SStoreDto
dto
)
{
return
R
.
ok
(
sStoreService
.
queryByStoreIds
(
dto
));
return
R
.
ok
(
sStoreService
.
queryByStoreIds
(
dto
));
...
...
share-system/src/main/java/share/system/domain/vo/SConsumerVo.java
View file @
ef425347
...
@@ -20,6 +20,8 @@ public class SConsumerVo extends SConsumer {
...
@@ -20,6 +20,8 @@ public class SConsumerVo extends SConsumer {
private
Boolean
isCleaner
;
private
Boolean
isCleaner
;
private
Boolean
isManage
;
private
Boolean
isAdmin
;
private
Boolean
isAdmin
;
private
Long
consumerId
;
private
Long
consumerId
;
...
...
share-system/src/main/java/share/system/service/ISStoreService.java
View file @
ef425347
...
@@ -115,4 +115,6 @@ public interface ISStoreService extends IService<SStore>
...
@@ -115,4 +115,6 @@ public interface ISStoreService extends IService<SStore>
List
<
SStore
>
storeNameByIds
(
List
<
Long
>
ids
);
List
<
SStore
>
storeNameByIds
(
List
<
Long
>
ids
);
List
<
SStore
>
manageList
();
}
}
share-system/src/main/java/share/system/service/impl/SConsumerServiceImpl.java
View file @
ef425347
...
@@ -246,6 +246,12 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
...
@@ -246,6 +246,12 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
}
else
{
}
else
{
vo
.
setIsAdmin
(
true
);
vo
.
setIsAdmin
(
true
);
}
}
List
<
Long
>
managerList
=
storeConsumerMapper
.
selectByConsumerId
(
currentUser
.
getId
(),
PositionEnum
.
MANAGE
.
getCode
());
if
(
CollectionUtils
.
isEmpty
(
managerList
))
{
vo
.
setIsManage
(
false
);
}
else
{
vo
.
setIsManage
(
true
);
}
if
(
ObjectUtil
.
isNull
(
currentUser
))
{
if
(
ObjectUtil
.
isNull
(
currentUser
))
{
throw
new
BaseException
(
"您的登录已过期,请先登录"
);
throw
new
BaseException
(
"您的登录已过期,请先登录"
);
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
ef425347
...
@@ -2906,13 +2906,24 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -2906,13 +2906,24 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Override
@Override
public
OrderStatisticsResponse
statistics
(
OrderStatisticsRequest
request
)
{
public
OrderStatisticsResponse
statistics
(
OrderStatisticsRequest
request
)
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
throw
new
RuntimeException
(
"当前用户不是店员"
);
}
List
<
Long
>
longs
=
storeConsumerMapper
.
selectByConsumerId
(
user
.
getId
(),
PositionEnum
.
MANAGE
.
getCode
());
if
(
CollectionUtils
.
isEmpty
(
longs
))
{
throw
new
RuntimeException
(
"当前用户不是门店管理人员"
);
}
//判断longs是否包含request.getStoreId()
if
(!
longs
.
contains
(
request
.
getStoreId
()))
{
throw
new
RuntimeException
(
"当前用户不是该门店管理人员"
);
}
List
<
Recharge
>
rechargeList
=
rechargeService
.
list
(
new
LambdaQueryWrapper
<
Recharge
>()
List
<
Recharge
>
rechargeList
=
rechargeService
.
list
(
new
LambdaQueryWrapper
<
Recharge
>()
.
ge
(
Recharge:
:
getCreateTime
,
request
.
getStartTime
())
.
ge
(
Recharge:
:
getCreateTime
,
request
.
getStartTime
())
.
le
(
Recharge:
:
getCreateTime
,
request
.
getEndTime
())
.
le
(
Recharge:
:
getCreateTime
,
request
.
getEndTime
())
.
eq
(
Recharge:
:
getStatus
,
YesNoEnum
.
yes
.
getIndex
())
.
eq
(
Recharge:
:
getStatus
,
YesNoEnum
.
yes
.
getIndex
())
);
);
Map
<
Long
,
SCoupon
>
sCouponMap
=
sCouponService
.
list
().
stream
().
collect
(
Collectors
.
toMap
(
SCoupon:
:
getId
,
Function
.
identity
()));
Map
<
Long
,
SCoupon
>
sCouponMap
=
sCouponService
.
list
().
stream
().
collect
(
Collectors
.
toMap
(
SCoupon:
:
getId
,
Function
.
identity
()));
//获取rechargeList中的所有rechargeAmount的和
BigDecimal
rechargeAmount
=
rechargeList
.
stream
().
map
(
Recharge:
:
getRechargeAmount
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
BigDecimal
rechargeAmount
=
rechargeList
.
stream
().
map
(
Recharge:
:
getRechargeAmount
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
OrderStatisticsResponse
statisticsResponse
=
new
OrderStatisticsResponse
();
OrderStatisticsResponse
statisticsResponse
=
new
OrderStatisticsResponse
();
Map
<
Long
,
SConsumerCoupon
>
map
=
new
HashMap
<>();
Map
<
Long
,
SConsumerCoupon
>
map
=
new
HashMap
<>();
...
@@ -2945,7 +2956,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -2945,7 +2956,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SCoupon
sCoupon
=
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
());
SCoupon
sCoupon
=
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
());
statisticsResponse
.
setMeituanRefundFee
(
statisticsResponse
.
getMeituanRefundFee
().
add
(
sCoupon
.
getCouponPayPrice
()));
statisticsResponse
.
setMeituanRefundFee
(
statisticsResponse
.
getMeituanRefundFee
().
add
(
sCoupon
.
getCouponPayPrice
()));
}
}
}
else
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
}
else
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
sConsumerCoupon
.
getCouponPayPrice
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
sConsumerCoupon
.
getCouponPayPrice
()))
{
statisticsResponse
.
setDouyinRefundFee
(
statisticsResponse
.
getDouyinRefundFee
().
add
(
sConsumerCoupon
.
getCouponPayPrice
()));
statisticsResponse
.
setDouyinRefundFee
(
statisticsResponse
.
getDouyinRefundFee
().
add
(
sConsumerCoupon
.
getCouponPayPrice
()));
...
@@ -2953,7 +2963,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -2953,7 +2963,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SCoupon
sCoupon
=
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
());
SCoupon
sCoupon
=
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
());
statisticsResponse
.
setDouyinRefundFee
(
statisticsResponse
.
getDouyinRefundFee
().
add
(
sCoupon
.
getCouponPayPrice
()));
statisticsResponse
.
setDouyinRefundFee
(
statisticsResponse
.
getDouyinRefundFee
().
add
(
sCoupon
.
getCouponPayPrice
()));
}
}
// statisticsResponse.setDouyinRefundFee(statisticsResponse.getDouyinRefundFee().add(sConsumerCoupon.getCouponPayPrice()));
}
}
}
}
}
}
...
@@ -2973,11 +2982,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -2973,11 +2982,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
else
{
}
else
{
SCoupon
sCoupon
=
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
());
SCoupon
sCoupon
=
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
());
statisticsResponse
.
setMeituanFee
(
statisticsResponse
.
getMeituanFee
().
add
(
sCoupon
.
getCouponPayPrice
()));
statisticsResponse
.
setMeituanFee
(
statisticsResponse
.
getMeituanFee
().
add
(
sCoupon
.
getCouponPayPrice
()));
// statisticsResponse.setMeituanRefundFee(statisticsResponse.getMeituanRefundFee().add(sCoupon.getCouponPayPrice()));
}
}
// statisticsResponse.setMeituanFee(statisticsResponse.getMeituanFee().add(sConsumerCoupon.getCouponPayPrice()));
}
else
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
}
else
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
sConsumerCoupon
.
getCouponPayPrice
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
sConsumerCoupon
.
getCouponPayPrice
()))
{
statisticsResponse
.
setDouyinFee
(
statisticsResponse
.
getDouyinFee
().
add
(
sConsumerCoupon
.
getCouponPayPrice
()));
statisticsResponse
.
setDouyinFee
(
statisticsResponse
.
getDouyinFee
().
add
(
sConsumerCoupon
.
getCouponPayPrice
()));
...
@@ -2985,7 +2990,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -2985,7 +2990,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SCoupon
sCoupon
=
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
());
SCoupon
sCoupon
=
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
());
statisticsResponse
.
setDouyinFee
(
statisticsResponse
.
getDouyinFee
().
add
(
sCoupon
.
getCouponPayPrice
()));
statisticsResponse
.
setDouyinFee
(
statisticsResponse
.
getDouyinFee
().
add
(
sCoupon
.
getCouponPayPrice
()));
}
}
// statisticsResponse.setDouyinFee(statisticsResponse.getDouyinFee().add(sConsumerCoupon.getCouponPayPrice()));
}
}
}
}
}
}
...
...
share-system/src/main/java/share/system/service/impl/SStoreServiceImpl.java
View file @
ef425347
...
@@ -376,6 +376,19 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
...
@@ -376,6 +376,19 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
return
this
.
list
(
queryWrapper
);
return
this
.
list
(
queryWrapper
);
}
}
@Override
public
List
<
SStore
>
manageList
()
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
throw
new
BaseException
(
"当前用户不是店员!"
);
}
List
<
Long
>
storeIdList
=
storeConsumerMapper
.
selectByConsumerId
(
user
.
getId
(),
PositionEnum
.
MANAGE
.
getCode
());
if
(
CollectionUtils
.
isEmpty
(
storeIdList
))
{
throw
new
RuntimeException
(
"当前用户不是门店管理人员"
);
}
return
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
SStore
>().
in
(
SStore:
:
getId
,
storeIdList
));
}
/**
/**
* 门店DO集合转换VO集合,按距离排序
* 门店DO集合转换VO集合,按距离排序
*
*
...
...
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