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
768681f2
Commit
768681f2
authored
Apr 25, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
套餐增加是否开启字段
parent
1546f950
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
8 deletions
+26
-8
SPack.java
share-system/src/main/java/share/system/domain/SPack.java
+3
-0
RoomLabelVo.java
...tem/src/main/java/share/system/domain/vo/RoomLabelVo.java
+1
-0
CreateOrderRequest.java
...rc/main/java/share/system/request/CreateOrderRequest.java
+3
-1
RoomLabelServiceImpl.java
.../java/share/system/service/impl/RoomLabelServiceImpl.java
+1
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+12
-7
PackMapper.xml
share-system/src/main/resources/mapper/system/PackMapper.xml
+6
-0
No files found.
share-system/src/main/java/share/system/domain/SPack.java
View file @
768681f2
...
...
@@ -72,4 +72,7 @@ public class SPack extends BaseEntity {
@Excel
(
name
=
"是否固定结束时间:0否,1是"
)
private
Integer
isFixedEndTime
;
@Excel
(
name
=
"是否开启:0否,1是"
)
private
Integer
isOpen
;
}
share-system/src/main/java/share/system/domain/vo/RoomLabelVo.java
View file @
768681f2
...
...
@@ -11,6 +11,7 @@ public class RoomLabelVo extends RoomLabel {
private
String
roomName
;
private
String
labelName
;
private
String
packName
;
private
Integer
openPack
;
private
Long
labelType
;
private
String
labelDuration
;
private
BigDecimal
packPrice
;
...
...
share-system/src/main/java/share/system/request/CreateOrderRequest.java
View file @
768681f2
...
...
@@ -8,7 +8,6 @@ import lombok.EqualsAndHashCode;
import
lombok.experimental.Accessors
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
import
java.util.Date
;
...
...
@@ -77,5 +76,8 @@ public class CreateOrderRequest {
@NotNull
(
message
=
"实际支付金额不能为空"
)
private
BigDecimal
payFee
;
@ApiModelProperty
(
value
=
"标签id"
)
private
Long
roomLabelId
;
}
share-system/src/main/java/share/system/service/impl/RoomLabelServiceImpl.java
View file @
768681f2
...
...
@@ -145,6 +145,7 @@ public class RoomLabelServiceImpl extends ServiceImpl<RoomLabelMapper, RoomLabel
vo
.
setRoomName
(
roomMap
.
containsKey
(
item
.
getRoomId
())
?
roomMap
.
get
(
item
.
getRoomId
()).
getName
()
:
""
);
vo
.
setPackName
(
packMap
.
containsKey
(
item
.
getPackId
())
?
packMap
.
get
(
item
.
getPackId
()).
getName
()
:
""
);
vo
.
setPackPrice
(
packMap
.
containsKey
(
item
.
getPackId
())
?
packMap
.
get
(
item
.
getPackId
()).
getPrice
()
:
new
BigDecimal
(
"0.0"
));
vo
.
setOpenPack
(
packMap
.
containsKey
(
item
.
getPackId
())
?
packMap
.
get
(
item
.
getPackId
()).
getIsOpen
()
:
null
);
vo
.
setLabelName
(
labelMap
.
containsKey
(
item
.
getLabelId
())
?
labelMap
.
get
(
item
.
getLabelId
()).
getName
()
:
""
);
vo
.
setLabelType
(
labelMap
.
containsKey
(
item
.
getLabelId
())
?
labelMap
.
get
(
item
.
getLabelId
()).
getType
()
:
null
);
vo
.
setLabelDuration
(
labelMap
.
containsKey
(
item
.
getLabelId
())
?
labelMap
.
get
(
item
.
getLabelId
()).
getDuration
()
:
""
);
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
768681f2
...
...
@@ -817,7 +817,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
//生成订单
SOrder
sOrder
=
generatSOrder
(
request
,
user
);
//校验订单金额
checkOrderPrice
(
sOrder
,
user
);
checkOrderPrice
(
sOrder
,
user
,
request
);
//校验订单预约时间
checkOrderDate
(
request
);
//校验订单套餐
...
...
@@ -1098,10 +1098,11 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
}
private
void
checkOrderPrice
(
SOrder
order
,
SConsumer
user
)
{
OrderComputedPriceRequest
request
=
new
OrderComputedPriceRequest
();
BeanUtils
.
copyProperties
(
order
,
request
);
ComputedOrderPriceResponse
priceResponse
=
computedPrice
(
request
,
user
);
private
void
checkOrderPrice
(
SOrder
order
,
SConsumer
user
,
CreateOrderRequest
request
)
{
OrderComputedPriceRequest
orderComputedPriceRequest
=
new
OrderComputedPriceRequest
();
BeanUtils
.
copyProperties
(
order
,
orderComputedPriceRequest
);
orderComputedPriceRequest
.
setRoomLabelId
(
request
.
getRoomLabelId
());
ComputedOrderPriceResponse
priceResponse
=
computedPrice
(
orderComputedPriceRequest
,
user
);
if
(
priceResponse
.
getPayFee
().
compareTo
(
order
.
getPayPrice
())
!=
0
)
{
throw
new
BaseException
(
"订单金额异常!"
);
}
...
...
@@ -1759,7 +1760,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
payPrice
=
totalPrice
;
break
;
case
PACK:
//套餐模式
payPrice
=
computeTotalPrice
(
request
.
getPackId
());
payPrice
=
computeTotalPrice
(
request
.
getPackId
()
,
totalPrice
);
break
;
default
:
throw
new
BaseException
(
"购买方式类型异常!"
);
...
...
@@ -1779,12 +1780,16 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
return
priceResponse
;
}
private
BigDecimal
computeTotalPrice
(
Long
packId
)
{
private
BigDecimal
computeTotalPrice
(
Long
packId
,
BigDecimal
totalPrice
)
{
SPack
pack
=
packService
.
getById
(
packId
);
if
(
Objects
.
isNull
(
pack
))
{
throw
new
BaseException
(
"计算订单金额套餐ID异常!"
);
}
if
(
pack
.
getIsOpen
().
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
return
pack
.
getPrice
();
}
else
{
return
totalPrice
;
}
}
/**
...
...
share-system/src/main/resources/mapper/system/PackMapper.xml
View file @
768681f2
...
...
@@ -14,6 +14,7 @@
<result
property=
"packaEndPeriod"
column=
"packa_end_period"
/>
<result
property=
"firstOrderAvailable"
column=
"first_order_available"
/>
<result
property=
"isFixedEndTime"
column=
"is_fixed_end_time"
/>
<result
property=
"isOpen"
column=
"is_open"
/>
<result
property=
"type"
column=
"type"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createTime"
column=
"create_time"
/>
...
...
@@ -32,6 +33,7 @@
packa_end_period,
first_order_available,
is_fixed_end_time,
is_open,
type,
create_by,
create_time,
...
...
@@ -60,6 +62,7 @@
#{isFixedEndTime}
</if>
<if
test=
"type != null and type != '' or type==0"
>
and type = #{type}
</if>
<if
test=
"isOpen != null and isOpen != '' or isOpen==0"
>
and is_open = #{isOpen}
</if>
</where>
</select>
...
...
@@ -78,6 +81,7 @@
<if
test=
"packaEndPeriod != null"
>
packa_end_period,
</if>
<if
test=
"firstOrderAvailable != null"
>
first_order_available,
</if>
<if
test=
"isFixedEndTime != null"
>
is_fixed_end_time,
</if>
<if
test=
"isOpen != null"
>
is_open,
</if>
<if
test=
"type != null"
>
type,
</if>
<if
test=
"sort != null"
>
sort,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
...
...
@@ -94,6 +98,7 @@
<if
test=
"packaEndPeriod != null"
>
#{packaEndPeriod},
</if>
<if
test=
"firstOrderAvailable != null"
>
#{firstOrderAvailable},
</if>
<if
test=
"isFixedEndTime != null"
>
#{isFixedEndTime},
</if>
<if
test=
"isOpen != null"
>
#{isOpen},
</if>
<if
test=
"type != null"
>
#{type},
</if>
<if
test=
"sort != null"
>
#{sort},
</if>
<if
test=
"createBy != null"
>
#{createBy},
</if>
...
...
@@ -114,6 +119,7 @@
<if
test=
"packaEndPeriod != null"
>
packa_end_period = #{packaEndPeriod},
</if>
<if
test=
"firstOrderAvailable != null"
>
first_order_available = #{firstOrderAvailable},
</if>
<if
test=
"isFixedEndTime != null"
>
is_fixed_end_time = #{isFixedEndTime},
</if>
<if
test=
"isOpen != null"
>
is_open = #{isOpen},
</if>
<if
test=
"type != null"
>
type = #{type},
</if>
<if
test=
"sort != null"
>
sort = #{sort},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
...
...
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