Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
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
huluobin
gogirl-miniapp-backend
Commits
81691b1b
Commit
81691b1b
authored
Mar 14, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
79677493
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
112 additions
and
90 deletions
+112
-90
MarketService.java
...ain/java/com/gogirl/application/market/MarketService.java
+1
-1
MarketServiceImpl.java
...com/gogirl/application/market/impl/MarketServiceImpl.java
+37
-21
ScheduleManageServiceImpl.java
...plication/order/serve/impl/ScheduleManageServiceImpl.java
+0
-0
CouponCustomerRelevance.java
.../gogirl/domain/market/coupon/CouponCustomerRelevance.java
+2
-0
TimesCardCustomerRelevance.java
...l/domain/market/timescard/TimesCardCustomerRelevance.java
+18
-1
TimesCardOrderServeDetail.java
...rl/domain/market/timescard/TimesCardOrderServeDetail.java
+0
-46
TimesCardUsedRecord.java
...m/gogirl/domain/market/timescard/TimesCardUsedRecord.java
+29
-0
ScheduleManage.java
...in/java/com/gogirl/domain/order/serve/ScheduleManage.java
+12
-8
ScheduleServe.java
...ain/java/com/gogirl/domain/order/serve/ScheduleServe.java
+8
-8
CloneUtil.java
...java/com/gogirl/infrastructure/common/util/CloneUtil.java
+1
-3
SetTimesCardCommand.java
...com/gogirl/shared/market/command/SetTimesCardCommand.java
+0
-2
ScheduleManageCommand.java
...d/order/serve/command/schedule/ScheduleManageCommand.java
+2
-0
ScheduleServeCommand.java
...ed/order/serve/command/schedule/ScheduleServeCommand.java
+2
-0
No files found.
src/main/java/com/gogirl/application/market/MarketService.java
View file @
81691b1b
...
...
@@ -28,7 +28,7 @@ public interface MarketService {
void
setTimesCard
(
SetTimesCardCommand
cmd
);
/**
*
设置订单卡券状态
*
更新订单卡券状态已使用
*
* @param orderId
*/
...
...
src/main/java/com/gogirl/application/market/impl/MarketServiceImpl.java
View file @
81691b1b
...
...
@@ -70,7 +70,7 @@ public class MarketServiceImpl implements MarketService {
throw
new
RRException
();
}
//
清除之前设置的卡券关联
//
将订单之前绑定的内部券设置为未使用
List
<
CouponCustomerRelevance
>
setterCouponCustomerRelevanceList
=
couponCustomerRelevanceService
.
list
(
new
LambdaQueryWrapper
<
CouponCustomerRelevance
>()
.
eq
(
CouponCustomerRelevance:
:
getOrderId
,
cmd
.
getOrderId
())
...
...
@@ -78,26 +78,29 @@ public class MarketServiceImpl implements MarketService {
setterCouponCustomerRelevanceList
.
forEach
(
couponCustomerRelevance
->
{
couponCustomerRelevance
.
setOrderId
(
null
);
couponCustomerRelevance
.
setState
(
null
);
couponCustomerRelevance
.
setState
(
1
);
});
if
(
ListUtil
.
isNotEmpty
(
setterCouponCustomerRelevanceList
))
{
couponCustomerRelevanceService
.
saveOrUpdateBatch
(
setterCouponCustomerRelevanceList
);
}
couponCustomerRelevanceService
.
updateBatchById
(
setterCouponCustomerRelevanceList
);
couponOrderRelevanceService
.
remove
(
new
LambdaQueryWrapper
<
CouponOrderRelevance
>()
.
eq
(
CouponOrderRelevance:
:
getOrderId
,
cmd
.
getOrderId
())
.
in
(
CouponOrderRelevance:
:
getCouponCustomerRelevanceId
,
setterCouponCustomerRelevanceList
.
stream
().
map
(
CouponCustomerRelevance:
:
getId
).
collect
(
Collectors
.
toList
())));
//删除这些卡券对应的卡券订单折扣详情
couponOrderRelevanceService
.
remove
(
new
LambdaQueryWrapper
<
CouponOrderRelevance
>()
.
eq
(
CouponOrderRelevance:
:
getOrderId
,
cmd
.
getOrderId
())
.
in
(
CouponOrderRelevance:
:
getCouponCustomerRelevanceId
,
setterCouponCustomerRelevanceList
.
stream
().
map
(
CouponCustomerRelevance:
:
getId
).
collect
(
Collectors
.
toList
())));
//set
List
<
CouponCustomerRelevance
>
couponCustomerRelevanceList
=
(
List
<
CouponCustomerRelevance
>)
couponCustomerRelevanceService
.
listByIds
(
cmd
.
getInnerCouponCustomerRelevanceIds
());
couponCustomerRelevanceList
.
forEach
(
couponCustomerRelevance
->
{
couponCustomerRelevance
.
setOrderId
(
cmd
.
getOrderId
());
//选择使用
couponCustomerRelevance
.
setState
(
CouponCustomerRelevance
.
STATE_CHOSE
);
});
couponCustomerRelevanceService
.
saveOrUpdateBatch
(
couponCustomerRelevanceList
);
}
//设置卡券关联
List
<
CouponCustomerRelevance
>
couponCustomerRelevanceList
=
(
List
<
CouponCustomerRelevance
>)
couponCustomerRelevanceService
.
listByIds
(
cmd
.
getInnerCouponCustomerRelevanceIds
());
if
(
ListUtil
.
isNotEmpty
(
couponCustomerRelevanceList
))
{
couponCustomerRelevanceList
.
forEach
(
couponCustomerRelevance
->
{
couponCustomerRelevance
.
setOrderId
(
cmd
.
getOrderId
());
//选择使用
couponCustomerRelevance
.
setState
(
CouponCustomerRelevance
.
STATE_CHOSE
);
});
couponCustomerRelevanceService
.
updateBatchById
(
couponCustomerRelevanceList
);
}
}
@Override
...
...
@@ -106,7 +109,7 @@ public class MarketServiceImpl implements MarketService {
if
(
cmd
.
getOrderId
()
==
null
)
{
throw
new
RRException
();
}
//删除
之前设置的外部券
//删除
订单的外部卡券关联
couponCustomerRelevanceService
.
remove
(
new
LambdaQueryWrapper
<
CouponCustomerRelevance
>()
.
eq
(
CouponCustomerRelevance:
:
getOrderId
,
cmd
.
getOrderId
())
...
...
@@ -137,8 +140,7 @@ public class MarketServiceImpl implements MarketService {
if
(
cmd
.
getOrderId
()
==
null
)
{
throw
new
RRException
();
}
//删除已经绑定的次卡
//删除订单已经绑定的次卡
timesCardUsedRecordService
.
remove
(
new
LambdaQueryWrapper
<
TimesCardUsedRecord
>()
.
eq
(
TimesCardUsedRecord:
:
getOrderId
,
cmd
.
getOrderId
()));
...
...
@@ -146,8 +148,10 @@ public class MarketServiceImpl implements MarketService {
//用户次卡
TimesCardCustomerRelevance
cardCustomerRelevance
=
timesCardCustomerRelevanceService
.
getById
(
id
);
//当前次卡所有使用记录
List
<
TimesCardUsedRecord
>
timesCardUsedRecordList
=
timesCardUsedRecordService
.
list
(
new
LambdaQueryWrapper
<
TimesCardUsedRecord
>().
eq
(
TimesCardUsedRecord:
:
getCardRelevanceCustomerId
,
cardCustomerRelevance
.
getId
()));
List
<
TimesCardUsedRecord
>
timesCardUsedRecordList
=
timesCardUsedRecordService
.
list
(
new
LambdaQueryWrapper
<
TimesCardUsedRecord
>().
eq
(
TimesCardUsedRecord:
:
getCardRelevanceCustomerId
,
cardCustomerRelevance
.
getId
()));
//如果次卡已使用记录等于次卡总次数
if
(
timesCardUsedRecordList
.
stream
()
.
filter
(
record
->
record
.
getStatus
().
equals
(
TimesCardUsedRecord
.
STATUS_USED
))
...
...
@@ -155,31 +159,43 @@ public class MarketServiceImpl implements MarketService {
throw
new
RRException
(
"次卡已经用完"
);
}
//如果次卡还有次数就新建关联
//如果次卡还有
未绑定的
次数就新建关联
if
(
cardCustomerRelevance
.
getSumTimes
()
>
timesCardUsedRecordList
.
size
())
{
TimesCardUsedRecord
timesCardUsedRecord
=
TimesCardUsedRecord
.
builder
()
//订单id
.
orderId
(
cmd
.
getOrderId
())
//次卡类型id
.
cardTypeId
(
cardCustomerRelevance
.
getCardTypeId
())
//次卡名称
.
name
(
cardCustomerRelevance
.
getName
())
//次卡id
.
cardRelevanceCustomerId
(
cardCustomerRelevance
.
getId
())
//绑定时间
.
time
(
new
Date
())
//选择使用
.
status
(
TimesCardUsedRecord
.
STATUS_CHOSE
)
//次卡用户id
.
customerId
(
cardCustomerRelevance
.
getCustomerId
())
//次卡当次能抵扣的金额
.
discountAmount
(
cardCustomerRelevance
.
getDiscountAmount
())
//次卡当次实际支付金额
.
payAmount
(
cardCustomerRelevance
.
getPayAmount
())
.
type
(
1
)
.
build
();
timesCardUsedRecordService
.
saveOrUpdate
(
timesCardUsedRecord
);
//新增一条次卡选择使用记录
timesCardUsedRecordService
.
save
(
timesCardUsedRecord
);
}
//替换
else
{
//从所有的次卡记录中过滤出一条次卡选择记录
TimesCardUsedRecord
timesCardUsedRecord
=
timesCardUsedRecordList
.
stream
()
.
filter
(
record
->
record
.
getStatus
().
equals
(
TimesCardUsedRecord
.
STATUS_CHOSE
))
.
findAny
()
.
orElseThrow
(
RRException:
:
new
);
//更新次卡选择记录对应的订单
timesCardUsedRecord
.
setOrderId
(
cmd
.
getOrderId
());
timesCardUsedRecord
.
setTime
(
new
Date
());
timesCardUsedRecordService
.
saveOrUpdate
(
timesCardUsedRecord
);
...
...
src/main/java/com/gogirl/application/order/serve/impl/ScheduleManageServiceImpl.java
View file @
81691b1b
This diff is collapsed.
Click to expand it.
src/main/java/com/gogirl/domain/market/coupon/CouponCustomerRelevance.java
View file @
81691b1b
...
...
@@ -80,8 +80,10 @@ public class CouponCustomerRelevance implements Serializable {
private
BigDecimal
payAmount
;
@ApiModelProperty
(
"卡券来源"
)
private
String
sourceFrom
;
@ApiModelProperty
(
"卡券来源id"
)
private
String
sourceFromId
;
private
Integer
orderId
;
@ApiModelProperty
(
"1-计算 2-不计算"
)
...
...
src/main/java/com/gogirl/domain/market/timescard/TimesCardCustomerRelevance.java
View file @
81691b1b
...
...
@@ -23,27 +23,39 @@ public class TimesCardCustomerRelevance {
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
"次卡种类id"
)
private
Integer
cardTypeId
;
@ApiModelProperty
(
"次卡名字"
)
private
String
name
;
@ApiModelProperty
(
"次卡持有人id"
)
private
Integer
customerId
;
@ApiModelProperty
(
"单次优惠价格"
)
private
BigDecimal
discountAmount
;
@ApiModelProperty
(
"单次算业绩价格"
)
@ApiModelProperty
(
"单次支付价格"
)
private
BigDecimal
payAmount
;
@ApiModelProperty
(
"购卡时间"
)
private
Date
createTime
;
@ApiModelProperty
(
"已使用次数"
)
private
Integer
usedTimes
;
@ApiModelProperty
(
"总共使用次数"
)
private
Integer
sumTimes
;
@ApiModelProperty
(
"有效期,开始时间"
)
private
Date
validStartTime
;
@ApiModelProperty
(
"有效期,截止时间"
)
private
Date
validEndTime
;
@ApiModelProperty
(
"购卡推荐人"
)
private
String
refereeId
;
@ApiModelProperty
(
"1正常使用;2.次数用完;3.已过期;"
)
private
Integer
status
;
...
...
@@ -53,8 +65,13 @@ public class TimesCardCustomerRelevance {
@TableField
(
exist
=
false
)
private
List
<
TimesCardUsedRecord
>
timesCardUsedRecordList
;
//状态-正常
public
static
Integer
STATUS_NORMAL
=
1
;
//状态-次数用完
public
static
Integer
STATUS_END
=
2
;
//状态-已过期
public
static
Integer
STATUS_OVER_TIME
=
3
;
/**
...
...
src/main/java/com/gogirl/domain/market/timescard/TimesCardOrderServeDetail.java
deleted
100644 → 0
View file @
79677493
package
com
.
gogirl
.
domain
.
market
.
timescard
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* 次卡次数详情使用情况
*/
@Data
@AllArgsConstructor
@Builder
@TableName
(
"times_card_order_serve_detail"
)
public
class
TimesCardOrderServeDetail
{
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
/**
* 该次次卡使用记录在对应服务上折扣的金额
*/
private
BigDecimal
discountAmount
;
/**
* 该次次卡使用记录在对应服务
*/
@ApiModelProperty
(
"订单服务id"
)
private
Integer
orderServeId
;
/**
* 该次次卡使用记录在对应服务上的实付金额
*/
@ApiModelProperty
(
"支付"
)
private
BigDecimal
payForOrderServe
;
/**
* 该次次卡使用记录id
*/
private
Integer
timesCardUserRecordId
;
}
src/main/java/com/gogirl/domain/market/timescard/TimesCardUsedRecord.java
View file @
81691b1b
...
...
@@ -27,33 +27,62 @@ public class TimesCardUsedRecord {
public
static
Integer
STATUS_USED
=
2
;
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
"次卡类型id"
)
private
Integer
cardTypeId
;
@ApiModelProperty
(
"用户id"
)
private
Integer
customerId
;
@ApiModelProperty
(
"次卡id"
)
private
Integer
cardRelevanceCustomerId
;
@ApiModelProperty
(
"生成记录时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
time
;
@ApiModelProperty
(
"1.购卡记录;2;用卡记录"
)
private
Integer
type
;
@ApiModelProperty
(
"订单id"
)
private
Integer
orderId
;
@ApiModelProperty
(
"美甲服务id"
)
private
Integer
serveId
;
@ApiModelProperty
(
"订单服务的id"
)
private
Integer
orderServeId
;
@ApiModelProperty
(
"美甲师id,store_technician表id"
)
private
Integer
technicianId
;
@ApiModelProperty
(
"店铺id"
)
private
Integer
departmentId
;
@ApiModelProperty
(
"服务名称?"
)
private
String
serveName
;
@ApiModelProperty
(
"美甲师名称?"
)
private
String
technicianName
;
@ApiModelProperty
(
"店铺名称?"
)
private
String
departmentName
;
@ApiModelProperty
(
"1.已选择次卡,待付款;2.已使用;3.已取消选择"
)
private
Integer
status
;
@ApiModelProperty
(
"次卡名称?"
)
private
String
name
;
@ApiModelProperty
(
"能抵扣的金额"
)
private
BigDecimal
discountAmount
;
@ApiModelProperty
(
"支付金额"
)
private
BigDecimal
payAmount
;
@ApiModelProperty
(
"实际抵扣的金额"
)
private
BigDecimal
actualDiscountAmount
;
/**
* 非数据库字段
*/
...
...
src/main/java/com/gogirl/domain/order/serve/ScheduleManage.java
View file @
81691b1b
...
...
@@ -15,10 +15,7 @@ import lombok.NoArgsConstructor;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.Set
;
import
java.util.TreeSet
;
import
java.util.*
;
/**
* Created by yinyong on 2018/9/28.
...
...
@@ -137,14 +134,21 @@ public class ScheduleManage implements Serializable {
private
String
scheduleDate
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"预约下服务列表"
)
@ApiModelProperty
(
"预约下服务列表
去重
"
)
private
Set
<
ScheduleServe
>
listScheduleServer
=
new
TreeSet
<>(
Comparator
.
comparing
(
o
->
o
.
getSchId
()
+
";"
+
o
.
getServeId
()));
@TableField
(
exist
=
false
)
private
List
<
ScheduleServe
>
scheduleServeList
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"预约用户信息"
)
private
Customer
customer
;
// public ScheduleManage() {
// listScheduleServer = new TreeSet<>(Comparator.comparing(o -> o.getSchId() + ";" + o.getServeId()));
// }
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
+
","
+
remark
;
}
public
void
addScheduleServeList
(
Collection
<
ScheduleServe
>
scheduleServes
)
{
listScheduleServer
.
addAll
(
scheduleServes
);
}
}
src/main/java/com/gogirl/domain/order/serve/ScheduleServe.java
View file @
81691b1b
...
...
@@ -113,16 +113,16 @@ public class ScheduleServe implements Serializable {
private
String
servePicturePath
;
@ApiModelProperty
(
"服务价格"
)
private
BigDecimal
servePrice
;
private
BigDecimal
servePrice
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"服务分类"
)
private
String
serveType
;
@ApiModelProperty
(
"服务价格"
)
private
BigDecimal
price
;
private
BigDecimal
price
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"服务状态 1-已预约 2-服务中 3-已完成"
)
private
Integer
status
;
private
Integer
status
=
1
;
@TableField
(
value
=
"`explain`"
)
@ApiModelProperty
(
"售后说明"
)
...
...
@@ -166,11 +166,6 @@ public class ScheduleServe implements Serializable {
@ApiModelProperty
(
""
)
private
List
<
LinkedHashMap
>
listTechnician
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
""
)
private
BigDecimal
serveChangePrice
;
@ApiModelProperty
(
"实际开始时间"
)
private
Date
actualStartTime
;
...
...
@@ -180,4 +175,9 @@ public class ScheduleServe implements Serializable {
@TableField
(
exist
=
false
)
private
Integer
actualServeDuration
;
private
BigDecimal
promotionPrice
;
private
Integer
producePromotionTimeId
;
}
src/main/java/com/gogirl/infrastructure/common/util/CloneUtil.java
View file @
81691b1b
...
...
@@ -20,9 +20,7 @@ public class CloneUtil {
objectInputStream
=
new
ObjectInputStream
(
byteArrayInputStream
);
Object
targetOjb
=
objectInputStream
.
readObject
();
return
(
T
)
targetOjb
;
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
}
catch
(
ClassNotFoundException
|
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
// 关闭流
...
...
src/main/java/com/gogirl/shared/market/command/SetTimesCardCommand.java
View file @
81691b1b
...
...
@@ -15,7 +15,5 @@ public class SetTimesCardCommand {
private
Integer
orderId
;
// private OrderManageDTO orderManageDTO;
private
List
<
Integer
>
timesCardIds
;
}
src/main/java/com/gogirl/shared/order/serve/command/schedule/ScheduleManageCommand.java
View file @
81691b1b
...
...
@@ -47,5 +47,7 @@ public class ScheduleManageCommand implements Serializable {
@ApiModelProperty
(
"下单店铺名称"
)
private
String
departmentName
;
private
Integer
activityId
;
private
List
<
ScheduleServeCommand
>
scheduleServeDTOList
;
}
src/main/java/com/gogirl/shared/order/serve/command/schedule/ScheduleServeCommand.java
View file @
81691b1b
...
...
@@ -89,4 +89,6 @@ public class ScheduleServeCommand implements Serializable {
private
Integer
status
;
private
Boolean
isCustomerPick
;
private
Integer
leisureDiscountConfigId
;
}
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