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
010cbd85
Commit
010cbd85
authored
Jan 23, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户信息增加职务判断
parent
92c09319
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
9 deletions
+34
-9
SConsumerController.java
...java/share/web/controller/system/SConsumerController.java
+2
-1
SStoreController.java
...in/java/share/web/controller/system/SStoreController.java
+1
-1
SConsumerVo.java
...tem/src/main/java/share/system/domain/vo/SConsumerVo.java
+4
-0
ISStoreService.java
...em/src/main/java/share/system/service/ISStoreService.java
+1
-0
SConsumerService.java
.../src/main/java/share/system/service/SConsumerService.java
+1
-1
SConsumerServiceImpl.java
.../java/share/system/service/impl/SConsumerServiceImpl.java
+21
-2
SStoreServiceImpl.java
...ain/java/share/system/service/impl/SStoreServiceImpl.java
+4
-4
No files found.
share-front/src/main/java/share/web/controller/system/SConsumerController.java
View file @
010cbd85
...
@@ -15,6 +15,7 @@ import share.common.core.domain.AjaxResult;
...
@@ -15,6 +15,7 @@ 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.common.enums.BusinessType
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumer
;
import
share.system.domain.vo.SConsumerVo
;
import
share.system.service.SConsumerService
;
import
share.system.service.SConsumerService
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableDataInfo
;
...
@@ -38,7 +39,7 @@ public class SConsumerController extends BaseController
...
@@ -38,7 +39,7 @@ public class SConsumerController extends BaseController
*/
*/
@ApiOperation
(
value
=
"个人中心-用户信息"
)
@ApiOperation
(
value
=
"个人中心-用户信息"
)
@RequestMapping
(
value
=
"/info"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/info"
,
method
=
RequestMethod
.
GET
)
public
R
<
SConsumer
>
getSConsumerCenter
()
{
public
R
<
SConsumer
Vo
>
getSConsumerCenter
()
{
return
R
.
ok
(
sConsumerService
.
getSConsumer
());
return
R
.
ok
(
sConsumerService
.
getSConsumer
());
}
}
...
...
share-front/src/main/java/share/web/controller/system/SStoreController.java
View file @
010cbd85
...
@@ -81,7 +81,7 @@ public class SStoreController extends BaseController
...
@@ -81,7 +81,7 @@ public class SStoreController extends BaseController
/**
/**
* 用户负责的门店设备
* 用户负责的门店设备
*/
*/
@GetMapping
(
"/storeList
ByConsumer
"
)
@GetMapping
(
"/storeList"
)
@ApiOperation
(
value
=
"查询全部门店及全部房间,每个房间绑定的设备列表"
)
@ApiOperation
(
value
=
"查询全部门店及全部房间,每个房间绑定的设备列表"
)
public
AjaxResult
storeList
()
{
public
AjaxResult
storeList
()
{
return
success
(
sStoreService
.
storeList
());
return
success
(
sStoreService
.
storeList
());
...
...
share-system/src/main/java/share/system/domain/vo/SConsumerVo.java
View file @
010cbd85
...
@@ -16,4 +16,8 @@ public class SConsumerVo extends SConsumer {
...
@@ -16,4 +16,8 @@ public class SConsumerVo extends SConsumer {
private
Integer
position
;
private
Integer
position
;
private
Boolean
isCleaner
;
private
Boolean
isAdmin
;
}
}
share-system/src/main/java/share/system/service/ISStoreService.java
View file @
010cbd85
...
@@ -99,4 +99,5 @@ public interface ISStoreService extends IService<SStore>
...
@@ -99,4 +99,5 @@ public interface ISStoreService extends IService<SStore>
int
dataSync
();
int
dataSync
();
List
<
SStoreVo
>
storeList
();
List
<
SStoreVo
>
storeList
();
}
}
share-system/src/main/java/share/system/service/SConsumerService.java
View file @
010cbd85
...
@@ -91,7 +91,7 @@ public interface SConsumerService extends IService<SConsumer>
...
@@ -91,7 +91,7 @@ public interface SConsumerService extends IService<SConsumer>
* 获取当前登陆用户个人信息(空则返回异常)
* 获取当前登陆用户个人信息(空则返回异常)
* @return
* @return
*/
*/
SConsumer
getSConsumer
();
SConsumer
Vo
getSConsumer
();
/**
/**
* 获取当前登陆用户个人信息
* 获取当前登陆用户个人信息
...
...
share-system/src/main/java/share/system/service/impl/SConsumerServiceImpl.java
View file @
010cbd85
...
@@ -12,11 +12,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -12,11 +12,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
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
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.springframework.beans.BeanUtils
;
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
org.springframework.util.CollectionUtils
;
import
share.common.constant.Constants
;
import
share.common.constant.Constants
;
import
share.common.constant.SmsConstants
;
import
share.common.constant.SmsConstants
;
import
share.common.enums.ConsumerCouponUseStatusEnum
;
import
share.common.enums.ConsumerCouponUseStatusEnum
;
import
share.common.enums.PayStatusEnum
;
import
share.common.enums.PositionEnum
;
import
share.common.enums.RoleTypeEnum
;
import
share.common.enums.RoleTypeEnum
;
import
share.common.exception.base.BaseException
;
import
share.common.exception.base.BaseException
;
import
share.common.utils.BaseUtil
;
import
share.common.utils.BaseUtil
;
...
@@ -172,7 +176,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
...
@@ -172,7 +176,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
}
}
@Override
@Override
public
SConsumer
getSConsumer
()
{
public
SConsumer
Vo
getSConsumer
()
{
SConsumer
currentUser
=
getInfo
();
SConsumer
currentUser
=
getInfo
();
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
sConsumerCoupon
.
setConsumerId
(
currentUser
.
getId
());
sConsumerCoupon
.
setConsumerId
(
currentUser
.
getId
());
...
@@ -181,10 +185,25 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
...
@@ -181,10 +185,25 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
if
(
count
>
0
){
if
(
count
>
0
){
currentUser
.
setNumber
(
count
);
currentUser
.
setNumber
(
count
);
}
}
SConsumerVo
vo
=
new
SConsumerVo
();
BeanUtils
.
copyProperties
(
currentUser
,
vo
);
List
<
Long
>
longList
=
storeConsumerMapper
.
selectByConsumerId
(
currentUser
.
getId
(),
PositionEnum
.
CLEANER
.
getCode
());
if
(
CollectionUtils
.
isEmpty
(
longList
))
{
vo
.
setIsCleaner
(
false
);
}
else
{
vo
.
setIsCleaner
(
true
);
}
List
<
Long
>
adminList
=
storeConsumerMapper
.
selectByConsumerId
(
currentUser
.
getId
(),
PositionEnum
.
ADMIN
.
getCode
());
if
(
CollectionUtils
.
isEmpty
(
adminList
))
{
vo
.
setIsAdmin
(
false
);
}
else
{
vo
.
setIsAdmin
(
true
);
}
if
(
ObjectUtil
.
isNull
(
currentUser
))
{
if
(
ObjectUtil
.
isNull
(
currentUser
))
{
throw
new
BaseException
(
"您的登录已过期,请先登录"
);
throw
new
BaseException
(
"您的登录已过期,请先登录"
);
}
}
return
currentUser
;
return
vo
;
}
}
/**
/**
...
...
share-system/src/main/java/share/system/service/impl/SStoreServiceImpl.java
View file @
010cbd85
...
@@ -443,19 +443,19 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
...
@@ -443,19 +443,19 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
}
}
return
0
;
return
0
;
}
}
@Override
@Override
public
List
<
SStoreVo
>
storeList
()
{
public
List
<
SStoreVo
>
storeList
()
{
//查询所有门店
List
<
SStore
>
sStores
=
baseMapper
.
selectSStoreList
(
new
SStore
());
SConsumer
user
=
consumerService
.
getInfo
();
SConsumer
user
=
consumerService
.
getInfo
();
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
throw
new
BaseException
(
"当前用户不是店员!"
);
throw
new
BaseException
(
"当前用户不是店员!"
);
}
}
List
<
Long
>
storeIds
=
storeConsumerMapper
.
selectByConsumerId
(
user
.
getId
(),
PositionEnum
.
CLEANER
.
getCode
());
List
<
Long
>
storeIds
=
storeConsumerMapper
.
selectByConsumerId
(
user
.
getId
(),
PositionEnum
.
ADMIN
.
getCode
());
if
(
CollectionUtils
.
isEmpty
(
storeIds
))
{
if
(
CollectionUtils
.
isEmpty
(
storeIds
))
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
//查询所有门店
List
<
SStore
>
sStores
=
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
SStore
>().
in
(
SStore:
:
getId
,
storeIds
));
List
<
SStoreVo
>
voList
=
new
ArrayList
<>();
List
<
SStoreVo
>
voList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
sStores
))
{
if
(
CollectionUtils
.
isNotEmpty
(
sStores
))
{
voList
=
convertDosToVos
(
sStores
);
voList
=
convertDosToVos
(
sStores
);
...
...
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