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
3dc7a59f
Commit
3dc7a59f
authored
Jan 08, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠卷管理增加增加默认值
parent
2927be3b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
12 deletions
+37
-12
SCouponController.java
...n/java/share/web/controller/system/SCouponController.java
+1
-6
SConsumerCoupon.java
...em/src/main/java/share/system/domain/SConsumerCoupon.java
+4
-2
SCoupon.java
share-system/src/main/java/share/system/domain/SCoupon.java
+8
-4
SCouponServiceImpl.java
...in/java/share/system/service/impl/SCouponServiceImpl.java
+24
-0
No files found.
share-admin/src/main/java/share/web/controller/system/SCouponController.java
View file @
3dc7a59f
...
@@ -81,12 +81,7 @@ public class SCouponController extends BaseController
...
@@ -81,12 +81,7 @@ public class SCouponController extends BaseController
@PostMapping
@PostMapping
public
AjaxResult
add
(
@RequestBody
SCoupon
sCoupon
)
public
AjaxResult
add
(
@RequestBody
SCoupon
sCoupon
)
{
{
if
(
StringUtils
.
isBlank
(
sCoupon
.
getRoomType
()))
{
sCoupon
.
setRoomType
(
RoomType
.
getCodeList
());
}
if
(
StringUtils
.
isBlank
(
sCoupon
.
getStoreType
()))
{
sCoupon
.
setStoreType
(
StoreType
.
getCodeList
());
}
return
toAjax
(
sCouponService
.
insertSCoupon
(
sCoupon
));
return
toAjax
(
sCouponService
.
insertSCoupon
(
sCoupon
));
}
}
...
...
share-system/src/main/java/share/system/domain/SConsumerCoupon.java
View file @
3dc7a59f
...
@@ -66,8 +66,10 @@ public class SConsumerCoupon extends BaseEntity
...
@@ -66,8 +66,10 @@ public class SConsumerCoupon extends BaseEntity
@Excel
(
name
=
"优惠结束(有效)时段"
)
@Excel
(
name
=
"优惠结束(有效)时段"
)
private
String
couponTimeEnd
;
private
String
couponTimeEnd
;
/** 优惠券类型(1:折扣券,2,满减券,3:时长券) */
/**
@Excel
(
name
=
"优惠券类型(1:折扣券,2,团购券,3:满减券,4:套餐劵)"
)
* 优惠券类型(1:折扣券,2,团购券,3:满减券,4:时长券)
*/
@Excel
(
name
=
"优惠券类型(1:折扣券,2,团购券,3:满减券,4:时长券)"
)
private
Integer
couponType
;
private
Integer
couponType
;
/** 门槛时长 */
/** 门槛时长 */
...
...
share-system/src/main/java/share/system/domain/SCoupon.java
View file @
3dc7a59f
...
@@ -57,8 +57,10 @@ public class SCoupon extends BaseEntity
...
@@ -57,8 +57,10 @@ public class SCoupon extends BaseEntity
@Excel
(
name
=
"房间类型(1:中、2:大、3:豪华包)"
)
@Excel
(
name
=
"房间类型(1:中、2:大、3:豪华包)"
)
private
String
roomType
;
private
String
roomType
;
/** 优惠券类型(1:折扣券,2,团购券,3:满减券,4:核销券,5:充值送金额) */
/**
@Excel
(
name
=
"优惠券类型(1:折扣券,2,团购券,3:满减券,4:套餐劵)"
)
* 优惠券类型(1:折扣券,2,团购券,3:满减券,4:时长券)
*/
@Excel
(
name
=
"优惠券类型(1:折扣券,2,团购券,3:满减券,4:时长券)"
)
private
Integer
couponType
;
private
Integer
couponType
;
/** 门槛时长 */
/** 门槛时长 */
...
@@ -85,8 +87,10 @@ public class SCoupon extends BaseEntity
...
@@ -85,8 +87,10 @@ public class SCoupon extends BaseEntity
@Excel
(
name
=
"是否可叠加使用(0:不可叠加,1:可叠加)"
)
@Excel
(
name
=
"是否可叠加使用(0:不可叠加,1:可叠加)"
)
private
Integer
isOverlay
;
private
Integer
isOverlay
;
/** 第三方平台类型(1:美团,2,大众点评) */
/**
@Excel
(
name
=
"第三方平台类型(1:美团,2,大众点评)"
)
* 第三方平台类型(1:自营,2:美团)
*/
@Excel
(
name
=
"第三方平台类型(1:自营,2:美团)"
)
private
Integer
platformType
;
private
Integer
platformType
;
/** 优惠券数量 */
/** 优惠券数量 */
...
...
share-system/src/main/java/share/system/service/impl/SCouponServiceImpl.java
View file @
3dc7a59f
package
share
.
system
.
service
.
impl
;
package
share
.
system
.
service
.
impl
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
import
share.common.enums.RoomType
;
import
share.common.enums.StoreType
;
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
;
...
@@ -19,6 +24,15 @@ public class SCouponServiceImpl implements ISCouponService
...
@@ -19,6 +24,15 @@ public class SCouponServiceImpl implements ISCouponService
{
{
@Autowired
@Autowired
private
SCouponMapper
sCouponMapper
;
private
SCouponMapper
sCouponMapper
;
//默认时长
private
static
final
String
DEFAULT_DURATION
=
"0"
;
//默认折扣最大时长
private
static
final
String
DEFAULT_MAX_DURATION
=
"999"
;
//默认优惠开始(有效)时段
private
static
final
String
DEFAULT_START_TIME
=
"00:00"
;
//默认优惠结束(有效)时段
private
static
final
String
DEFAULT_END_TIME
=
"24:00"
;
/**
/**
* 查询优惠券
* 查询优惠券
...
@@ -53,6 +67,16 @@ public class SCouponServiceImpl implements ISCouponService
...
@@ -53,6 +67,16 @@ public class SCouponServiceImpl implements ISCouponService
@Override
@Override
public
int
insertSCoupon
(
SCoupon
sCoupon
)
public
int
insertSCoupon
(
SCoupon
sCoupon
)
{
{
if
(
StringUtils
.
isBlank
(
sCoupon
.
getRoomType
()))
{
sCoupon
.
setRoomType
(
RoomType
.
getCodeList
());
}
if
(
StringUtils
.
isBlank
(
sCoupon
.
getStoreType
()))
{
sCoupon
.
setStoreType
(
StoreType
.
getCodeList
());
}
sCoupon
.
setValidStartTime
(
DEFAULT_START_TIME
);
sCoupon
.
setValidEndTime
(
DEFAULT_END_TIME
);
sCoupon
.
setMinDuration
(
DEFAULT_DURATION
);
sCoupon
.
setMaxDuration
(
DEFAULT_MAX_DURATION
);
sCoupon
.
setCreateTime
(
DateUtils
.
getNowDate
());
sCoupon
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
sCouponMapper
.
insertSCoupon
(
sCoupon
);
return
sCouponMapper
.
insertSCoupon
(
sCoupon
);
}
}
...
...
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