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
a1049165
Commit
a1049165
authored
Oct 30, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加枚举类
parent
88e5bd71
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
19 deletions
+60
-19
SConsumerCouponController.java
...hare/web/controller/system/SConsumerCouponController.java
+5
-4
SCouponController.java
...n/java/share/web/controller/system/SCouponController.java
+4
-4
RoomType.java
share-common/src/main/java/share/common/enums/RoomType.java
+5
-2
StoreType.java
share-common/src/main/java/share/common/enums/StoreType.java
+5
-5
UserStatusEnum.java
...mmon/src/main/java/share/common/enums/UserStatusEnum.java
+36
-0
SCouponController.java
...n/java/share/web/controller/system/SCouponController.java
+4
-4
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+1
-0
No files found.
share-admin/src/main/java/share/web/controller/system/SConsumerCouponController.java
View file @
a1049165
...
...
@@ -82,11 +82,12 @@ public class SConsumerCouponController extends BaseController
@PostMapping
public
AjaxResult
add
(
@RequestBody
SConsumerCoupon
sConsumerCoupon
)
{
if
(
StringUtils
.
isNotBlank
(
sConsumerCoupon
.
getRoomType
())){
sConsumerCoupon
.
setRoomType
(
String
.
valueOf
(
RoomType
.
getCodeList
()));
if
(
StringUtils
.
isBlank
(
sConsumerCoupon
.
getRoomType
()))
{
sConsumerCoupon
.
setRoomType
(
RoomType
.
getCodeList
());
}
if
(
StringUtils
.
is
NotBlank
(
sConsumerCoupon
.
getStoreType
()))
{
sConsumerCoupon
.
setStoreType
(
St
ring
.
valueOf
(
StoreType
.
getCodeList
()
));
if
(
StringUtils
.
is
Blank
(
sConsumerCoupon
.
getStoreType
()))
{
sConsumerCoupon
.
setStoreType
(
St
oreType
.
getCodeList
(
));
}
return
toAjax
(
sConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
));
}
...
...
share-admin/src/main/java/share/web/controller/system/SCouponController.java
View file @
a1049165
...
...
@@ -81,11 +81,11 @@ public class SCouponController extends BaseController
@PostMapping
public
AjaxResult
add
(
@RequestBody
SCoupon
sCoupon
)
{
if
(
StringUtils
.
is
NotBlank
(
sCoupon
.
getRoomType
()))
{
sCoupon
.
setRoomType
(
String
.
valueOf
(
RoomType
.
getCodeList
()
));
if
(
StringUtils
.
is
Blank
(
sCoupon
.
getRoomType
()))
{
sCoupon
.
setRoomType
(
RoomType
.
getCodeList
(
));
}
if
(
StringUtils
.
is
NotBlank
(
sCoupon
.
getStoreType
()))
{
sCoupon
.
setStoreType
(
St
ring
.
valueOf
(
StoreType
.
getCodeList
()
));
if
(
StringUtils
.
is
Blank
(
sCoupon
.
getStoreType
()))
{
sCoupon
.
setStoreType
(
St
oreType
.
getCodeList
(
));
}
return
toAjax
(
sCouponService
.
insertSCoupon
(
sCoupon
));
}
...
...
share-common/src/main/java/share/common/enums/RoomType.java
View file @
a1049165
...
...
@@ -21,8 +21,11 @@ public enum RoomType {
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
List
<
String
>
getCodeList
()
{
return
Arrays
.
stream
(
RoomType
.
values
()).
map
(
RoomType:
:
getCode
).
collect
(
Collectors
.
toList
());
//code转1,2,3,4
public
static
String
getCodeList
()
{
List
<
String
>
list
=
Arrays
.
stream
(
StoreType
.
values
()).
map
(
StoreType:
:
getCode
).
collect
(
Collectors
.
toList
());
return
String
.
join
(
","
,
list
);
}
...
...
share-common/src/main/java/share/common/enums/StoreType.java
View file @
a1049165
...
...
@@ -18,12 +18,12 @@ public enum StoreType {
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
List
<
String
>
getCodeList
()
{
return
Arrays
.
stream
(
StoreType
.
values
()).
map
(
StoreType:
:
getCode
).
collect
(
Collectors
.
toList
());
}
//code转字符串1,2,3,4
public
static
String
getCodeList
()
{
List
<
String
>
list
=
Arrays
.
stream
(
StoreType
.
values
()).
map
(
StoreType:
:
getCode
).
collect
(
Collectors
.
toList
());
return
String
.
join
(
","
,
list
);
}
public
String
getCode
()
{
return
code
;
}
...
...
share-common/src/main/java/share/common/enums/UserStatusEnum.java
0 → 100644
View file @
a1049165
package
share
.
common
.
enums
;
public
enum
UserStatusEnum
{
/**
* (0:待使用,1:已使用,2:已失效)
*/
UNUSED
(
0
,
"待使用"
),
USED
(
1
,
"已使用"
),
EXPIRED
(
2
,
"已失效"
);
private
Integer
code
;
private
String
name
;
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
;
}
UserStatusEnum
()
{
}
UserStatusEnum
(
Integer
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
share-front/src/main/java/share/web/controller/system/SCouponController.java
View file @
a1049165
...
...
@@ -81,11 +81,11 @@ public class SCouponController extends BaseController
@PostMapping
public
AjaxResult
add
(
@RequestBody
SCoupon
sCoupon
)
{
if
(
StringUtils
.
is
NotBlank
(
sCoupon
.
getRoomType
()))
{
sCoupon
.
setRoomType
(
String
.
valueOf
(
RoomType
.
getCodeList
()
));
if
(
StringUtils
.
is
Blank
(
sCoupon
.
getRoomType
()))
{
sCoupon
.
setRoomType
(
RoomType
.
getCodeList
(
));
}
if
(
StringUtils
.
is
NotBlank
(
sCoupon
.
getStoreType
()))
{
sCoupon
.
setStoreType
(
St
ring
.
valueOf
(
StoreType
.
getCodeList
()
));
if
(
StringUtils
.
is
Blank
(
sCoupon
.
getStoreType
()))
{
sCoupon
.
setStoreType
(
St
oreType
.
getCodeList
(
));
}
return
toAjax
(
sCouponService
.
insertSCoupon
(
sCoupon
));
}
...
...
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
a1049165
...
...
@@ -80,6 +80,7 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
@Override
public
int
insertSConsumerCoupon
(
SConsumerCoupon
sConsumerCoupon
)
{
sConsumerCoupon
.
setCreateTime
(
DateUtils
.
getNowDate
());
sConsumerCoupon
.
setUseStatus
(
UserStatusEnum
.
UNUSED
.
getCode
());
return
sConsumerCouponMapper
.
insertSConsumerCoupon
(
sConsumerCoupon
);
}
...
...
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