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
66a455f8
Commit
66a455f8
authored
Oct 27, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改魔法值
parent
12c9d33a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
6 deletions
+51
-6
CouponTypeEnum.java
...mmon/src/main/java/share/common/enums/CouponTypeEnum.java
+9
-0
PayStatusEnum.java
...ommon/src/main/java/share/common/enums/PayStatusEnum.java
+33
-0
SConsumerServiceImpl.java
.../java/share/system/service/impl/SConsumerServiceImpl.java
+2
-1
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+3
-3
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+2
-1
SStoreServiceImpl.java
...ain/java/share/system/service/impl/SStoreServiceImpl.java
+2
-1
No files found.
share-common/src/main/java/share/common/enums/CouponTypeEnum.java
View file @
66a455f8
...
@@ -45,4 +45,13 @@ public enum CouponTypeEnum {
...
@@ -45,4 +45,13 @@ public enum CouponTypeEnum {
}
}
return
null
;
return
null
;
}
}
public
static
CouponTypeEnum
getTypeCode
(
Integer
code
)
{
for
(
CouponTypeEnum
type
:
CouponTypeEnum
.
values
())
{
if
(
type
.
getCode
().
equals
(
code
))
{
return
type
;
}
}
return
null
;
}
}
}
share-common/src/main/java/share/common/enums/PayStatusEnum.java
0 → 100644
View file @
66a455f8
package
share
.
common
.
enums
;
public
enum
PayStatusEnum
{
//0:未支付,1:已支付
UNPAID
(
0
,
"未支付"
),
PAID
(
1
,
"已支付"
);
private
Integer
code
;
private
String
name
;
PayStatusEnum
(
Integer
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
PayStatusEnum
()
{
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
share-system/src/main/java/share/system/service/impl/SConsumerServiceImpl.java
View file @
66a455f8
...
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
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.exception.base.BaseException
;
import
share.common.exception.base.BaseException
;
import
share.common.utils.BaseUtil
;
import
share.common.utils.BaseUtil
;
import
share.common.utils.DateUtil
;
import
share.common.utils.DateUtil
;
...
@@ -160,7 +161,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
...
@@ -160,7 +161,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
SConsumer
currentUser
=
getInfo
();
SConsumer
currentUser
=
getInfo
();
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
sConsumerCoupon
.
setConsumerId
(
currentUser
.
getId
());
sConsumerCoupon
.
setConsumerId
(
currentUser
.
getId
());
sConsumerCoupon
.
setUseStatus
(
0
);
sConsumerCoupon
.
setUseStatus
(
ConsumerCouponUseStatusEnum
.
WAIT_USE
.
getCode
()
);
int
count
=
sConsumerCouponService
.
selectSConsumerCouponConut
(
sConsumerCoupon
);
int
count
=
sConsumerCouponService
.
selectSConsumerCouponConut
(
sConsumerCoupon
);
if
(
count
>
0
){
if
(
count
>
0
){
currentUser
.
setNumber
(
count
);
currentUser
.
setNumber
(
count
);
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
66a455f8
...
@@ -361,8 +361,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
...
@@ -361,8 +361,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
@Override
@Override
public
List
<
SOrder
>
queryList
()
{
public
List
<
SOrder
>
queryList
()
{
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SOrder:
:
getPayStatus
,
1
);
queryWrapper
.
eq
(
SOrder:
:
getPayStatus
,
PayStatusEnum
.
PAID
.
getCode
()
);
queryWrapper
.
ne
(
SOrder:
:
getRefundStatus
,
0
);
queryWrapper
.
ne
(
SOrder:
:
getRefundStatus
,
RefundStatusEnum
.
UNREFUND
.
getCode
()
);
return
sOrderMapper
.
selectList
(
queryWrapper
);
return
sOrderMapper
.
selectList
(
queryWrapper
);
}
}
...
@@ -446,7 +446,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
...
@@ -446,7 +446,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
if
(
date
.
compareTo
(
consumerCoupon
.
getEndDate
())
>
0
)
{
if
(
date
.
compareTo
(
consumerCoupon
.
getEndDate
())
>
0
)
{
throw
new
BaseException
(
"此优惠券已经失效了"
);
throw
new
BaseException
(
"此优惠券已经失效了"
);
}
}
CouponTypeEnum
couponType
=
CouponTypeEnum
.
getType
(
consumerCoupon
.
getCouponType
());
CouponTypeEnum
couponType
=
CouponTypeEnum
.
getType
Code
(
consumerCoupon
.
getCouponType
());
switch
(
couponType
){
switch
(
couponType
){
case
DISCOUNT:
//TODO 折扣券
case
DISCOUNT:
//TODO 折扣券
break
;
break
;
...
...
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
66a455f8
...
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -7,6 +7,7 @@ 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
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
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
;
...
@@ -142,7 +143,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
...
@@ -142,7 +143,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper,SRoom> implements
@Override
@Override
public
String
openDoor
(
Long
id
)
{
public
String
openDoor
(
Long
id
)
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
if
(!
user
.
getRoleType
().
equals
(
"1"
))
{
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
throw
new
RuntimeException
(
"当前用户不是保洁人员"
);
throw
new
RuntimeException
(
"当前用户不是保洁人员"
);
}
}
SRoom
room
=
sRoomMapper
.
selectById
(
id
);
SRoom
room
=
sRoomMapper
.
selectById
(
id
);
...
...
share-system/src/main/java/share/system/service/impl/SStoreServiceImpl.java
View file @
66a455f8
...
@@ -11,6 +11,7 @@ import org.bouncycastle.util.Store;
...
@@ -11,6 +11,7 @@ import org.bouncycastle.util.Store;
import
org.locationtech.spatial4j.context.SpatialContext
;
import
org.locationtech.spatial4j.context.SpatialContext
;
import
org.locationtech.spatial4j.distance.DistanceUtils
;
import
org.locationtech.spatial4j.distance.DistanceUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
share.common.enums.RoleTypeEnum
;
import
share.common.enums.YesNoEnum
;
import
share.common.enums.YesNoEnum
;
import
share.common.exception.base.BaseException
;
import
share.common.exception.base.BaseException
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
...
@@ -253,7 +254,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
...
@@ -253,7 +254,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
@Override
@Override
public
List
<
SStoreVo
>
listVoByCleaner
()
{
public
List
<
SStoreVo
>
listVoByCleaner
()
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
if
(
Integer
.
parseInt
(
user
.
getRoleType
())
!=
1
)
{
if
(
!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
())
)
{
throw
new
BaseException
(
"当前用户不是保洁人员!"
);
throw
new
BaseException
(
"当前用户不是保洁人员!"
);
}
}
//查询保洁人员所属门店
//查询保洁人员所属门店
...
...
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