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
e396b965
Commit
e396b965
authored
Jun 28, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改计算订单价格
parent
487fde0a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
3 deletions
+40
-3
SOrder.java
share-system/src/main/java/share/system/domain/SOrder.java
+3
-0
SOrderVo.java
...system/src/main/java/share/system/domain/vo/SOrderVo.java
+5
-0
CreateOrderRequest.java
...rc/main/java/share/system/request/CreateOrderRequest.java
+2
-0
ActivityServiceImpl.java
...n/java/share/system/service/impl/ActivityServiceImpl.java
+3
-0
RechargeConfServiceImpl.java
...va/share/system/service/impl/RechargeConfServiceImpl.java
+9
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+9
-1
ConsumerMemberMapper.xml
...src/main/resources/mapper/system/ConsumerMemberMapper.xml
+1
-2
SOrderMapper.xml
...-system/src/main/resources/mapper/system/SOrderMapper.xml
+8
-0
No files found.
share-system/src/main/java/share/system/domain/SOrder.java
View file @
e396b965
...
...
@@ -93,6 +93,9 @@ public class SOrder extends BaseEntity
@Excel
(
name
=
"订单时长(H)"
)
private
String
timeLong
;
@Excel
(
name
=
"优惠比例"
)
private
BigDecimal
discountRatio
;
/** 预约开始时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm"
)
@Excel
(
name
=
"预约开始时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd HH:mm"
)
...
...
share-system/src/main/java/share/system/domain/vo/SOrderVo.java
View file @
e396b965
...
...
@@ -169,6 +169,11 @@ public class SOrderVo
@ApiModelProperty
(
value
=
"支付类型(1:微信,2:支付宝)"
)
private
Integer
payType
;
/**
* 优惠比例
*/
private
BigDecimal
discountRatio
;
@ApiModelProperty
(
value
=
"支付状态(0:未支付,1:已支付)"
)
private
Integer
payStatus
;
...
...
share-system/src/main/java/share/system/request/CreateOrderRequest.java
View file @
e396b965
...
...
@@ -78,5 +78,7 @@ public class CreateOrderRequest {
@ApiModelProperty
(
value
=
"标签id"
)
private
Long
roomLabelId
;
@ApiModelProperty
(
value
=
"优惠比例"
)
private
BigDecimal
discountRatio
;
}
share-system/src/main/java/share/system/service/impl/ActivityServiceImpl.java
View file @
e396b965
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.common.utils.DateUtils
;
import
share.common.utils.StringUtils
;
import
share.system.domain.Activity
;
import
share.system.domain.SStore
;
import
share.system.mapper.ActivityMapper
;
...
...
@@ -57,7 +58,9 @@ public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> i
@Override
public
int
insertActivity
(
Activity
activity
)
{
activity
.
setCreateTime
(
DateUtils
.
getNowDate
());
if
(
StringUtils
.
isEmpty
(
activity
.
getStoreIds
()))
{
activity
.
setStoreIds
(
storeService
.
list
().
stream
().
map
(
SStore:
:
getId
).
collect
(
Collectors
.
toList
()).
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
}
return
activityMapper
.
insertActivity
(
activity
);
}
...
...
share-system/src/main/java/share/system/service/impl/RechargeConfServiceImpl.java
View file @
e396b965
...
...
@@ -4,11 +4,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.common.utils.DateUtils
;
import
share.common.utils.StringUtils
;
import
share.system.domain.RechargeConf
;
import
share.system.domain.SStore
;
import
share.system.mapper.RechargeConfMapper
;
import
share.system.service.ISStoreService
;
import
share.system.service.RechargeConfService
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 充值配置Service业务层处理
...
...
@@ -20,6 +24,8 @@ import java.util.List;
public
class
RechargeConfServiceImpl
extends
ServiceImpl
<
RechargeConfMapper
,
RechargeConf
>
implements
RechargeConfService
{
@Autowired
private
RechargeConfMapper
rechargeConfMapper
;
@Autowired
private
ISStoreService
storeService
;
/**
* 查询充值配置
...
...
@@ -52,6 +58,9 @@ public class RechargeConfServiceImpl extends ServiceImpl<RechargeConfMapper, Rec
@Override
public
int
insertRechargeConf
(
RechargeConf
rechargeConf
)
{
rechargeConf
.
setCreateTime
(
DateUtils
.
getNowDate
());
if
(
StringUtils
.
isEmpty
(
rechargeConf
.
getStoreIds
()))
{
rechargeConf
.
setStoreIds
(
storeService
.
list
().
stream
().
map
(
SStore:
:
getId
).
collect
(
Collectors
.
toList
()).
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
}
return
rechargeConfMapper
.
insertRechargeConf
(
rechargeConf
);
}
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
e396b965
...
...
@@ -1869,9 +1869,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
BigDecimal
totalFee
=
new
BigDecimal
(
0
);
if
(!
ObjectUtils
.
isEmpty
(
request
.
getRoomLabelId
()))
{
RoomLabel
roomLabel
=
roomLabelService
.
selectRoomLabelById
(
request
.
getRoomLabelId
());
if
(
ObjectUtils
.
isEmpty
(
roomLabel
.
getPackId
()))
{
payPrice
=
totalPrice
;
request
.
setBuyType
(
BuyTypeEnum
.
TIME
.
getCode
());
if
(
ObjectUtils
.
isEmpty
(
roomLabel
.
getPackId
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerMember
))
{
queryWrapper
.
eq
(
Activity:
:
getLabelId
,
roomLabel
.
getLabelId
());
activity
=
activityService
.
getOne
(
queryWrapper
);
...
...
@@ -1907,11 +1907,19 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
}
priceResponse
.
setTotalFee
(
payPrice
);
if
(
totalFee
.
compareTo
(
new
BigDecimal
(
0
))
==
0
)
{
priceResponse
.
setPayFee
(
payPrice
);
}
else
{
priceResponse
.
setPayFee
(
totalFee
);
}
// 计算优惠券金额
if
(
ObjectUtil
.
isNull
(
request
.
getCouponId
())
||
request
.
getCouponId
()
<=
0
)
{
priceResponse
.
setCouponFee
(
BigDecimal
.
ZERO
);
if
(
totalFee
.
compareTo
(
new
BigDecimal
(
0
))
==
0
)
{
priceResponse
.
setPayFee
(
payPrice
);
}
else
{
priceResponse
.
setPayFee
(
totalFee
);
}
priceResponse
.
setDiscountFee
(
priceResponse
.
getTotalFee
().
subtract
(
priceResponse
.
getPayFee
()));
priceResponse
.
setDiscountRatio
(
priceResponse
.
getDiscountFee
().
divide
(
priceResponse
.
getTotalFee
()).
multiply
(
new
BigDecimal
(
100
)));
if
(
ObjectUtil
.
isNotEmpty
(
consumerMember
))
{
...
...
share-system/src/main/resources/mapper/system/ConsumerMemberMapper.xml
View file @
e396b965
...
...
@@ -57,7 +57,7 @@
m.update_by,
m.update_time,
m.remark
from s_consumer_member m join s_consumer c on m.consumer_id = c.id
from s_consumer_member m join s_consumer c on m.consumer_id = c.id
and m.is_delete = 0
<where>
<if
test=
"nickName != null and nickName != ''"
>
and c.nick_name like concat('%', #{nickName},'%')
</if>
...
...
@@ -69,7 +69,6 @@
<if
test=
"memberConfigId != null "
>
and m.member_config_id = #{memberConfigId}
</if>
<if
test=
"expirationDate != null "
>
and m.expiration_date = #{expirationDate}
</if>
<if
test=
"membershipProgress != null "
>
and m.membership_progress = #{membershipProgress}
</if>
<if
test=
"isDelete != null "
>
and m.is_delete = #{isDelete}
</if>
</where>
</select>
...
...
share-system/src/main/resources/mapper/system/SOrderMapper.xml
View file @
e396b965
...
...
@@ -22,6 +22,7 @@
<result
property=
"couponId"
column=
"coupon_id"
/>
<result
property=
"couponPrice"
column=
"coupon_price"
/>
<result
property=
"totalPrice"
column=
"total_price"
/>
<result
property=
"discountRatio"
column=
"discount_ratio"
/>
<result
property=
"payPrice"
column=
"pay_price"
/>
<result
property=
"payTime"
column=
"pay_time"
/>
<result
property=
"timeLong"
column=
"time_long"
/>
...
...
@@ -62,6 +63,7 @@
coupon_price,
total_price,
pay_price,
discount_ratio,
pay_time,
time_long,
pre_start_date,
...
...
@@ -106,6 +108,7 @@
<if
test=
"couponPrice != null and couponPrice != ''"
>
and coupon_price = #{couponPrice}
</if>
<if
test=
"totalPrice != null and totalPrice != ''"
>
and total_price = #{totalPrice}
</if>
<if
test=
"payPrice != null and payPrice != ''"
>
and pay_price = #{payPrice}
</if>
<if
test=
"discountRatio != null and discountRatio != ''"
>
and discount_ratio = #{discountRatio}
</if>
<if
test=
"startPayTime != null"
>
and DATE_FORMAT(pay_time, '%Y-%m-%d')
>
= DATE_FORMAT(#{startPayTime}, '%Y-%m-%d')
</if>
...
...
@@ -181,6 +184,7 @@
s.coupon_price,
s.total_price,
s.pay_price,
s.discount_ratio,
s.pay_time,
s.time_long,
s.pre_start_date,
...
...
@@ -225,6 +229,7 @@
s.coupon_price,
s.total_price,
s.pay_price,
s.discount_ratio,
s.pay_time,
s.time_long,
s.pre_start_date,
...
...
@@ -286,6 +291,7 @@
<if
test=
"createBy != null and createBy != ''"
>
create_by,
</if>
<if
test=
"createTime != null and createTime != ''"
>
create_time,
</if>
<if
test=
"arrivalTime != null and arrivalTime != ''"
>
arrival_time,
</if>
<if
test=
"discountRatio != null and discountRatio != ''"
>
discount_ratio,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"orderNo != null"
>
#{orderNo},
</if>
...
...
@@ -320,6 +326,7 @@
<if
test=
"createBy != null"
>
#{createBy},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"arrivalTime != null"
>
#{arrivalTime},
</if>
<if
test=
"discountRatio != null"
>
#{discountRatio},
</if>
"
</trim>
</insert>
...
...
@@ -359,6 +366,7 @@
<if
test=
"updateTime != null"
>
update_time = NOW(),
</if>
<if
test=
"arrivalTime != null"
>
arrival_time = #{arrivalTime},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"discountRatio != null"
>
discount_ratio = #{discountRatio},
</if>
</trim>
where id = #{id}
</update>
...
...
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