记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
596c94a6
Commit
596c94a6
authored
Jul 07, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
0c3a4d8d
f7049fa9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
29 deletions
+31
-29
KylinOrderRefundsServiceImpl.java
...gzai/kylin/service/impl/KylinOrderRefundsServiceImpl.java
+17
-15
KylinRefundsStatusServiceImpl.java
...zai/kylin/service/impl/KylinRefundsStatusServiceImpl.java
+7
-7
KylinRefundsStatusServiceImpl.java
...latform/service/refund/KylinRefundsStatusServiceImpl.java
+7
-7
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/KylinOrderRefundsServiceImpl.java
View file @
596c94a6
...
...
@@ -93,10 +93,12 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
String
orderTicketsId
=
refundApplyParam
.
getOrderTicketsId
();
List
<
String
>
ticketEntityIds
=
refundApplyParam
.
getTicketEntityIds
();
List
<
Double
>
entitiesPrice
=
refundApplyParam
.
getEntitiesPrice
();
Double
RefundPriceExpress
=
refundApplyParam
.
getRefundPriceExpress
();
if
(
null
==
RefundPriceExpress
)
{
RefundPriceExpress
=
0.0
;
Double
RefundPriceExpress
Double
=
refundApplyParam
.
getRefundPriceExpress
();
if
(
null
==
RefundPriceExpress
Double
)
{
RefundPriceExpress
Double
=
0.0
;
}
BigDecimal
RefundPriceExpress
=
BigDecimal
.
valueOf
(
RefundPriceExpressDouble
);
KylinOrderTickets
orderInfo
=
kylinOrderTicketsMapper
.
selectOne
(
new
QueryWrapper
<
KylinOrderTickets
>().
eq
(
"order_tickets_id"
,
orderTicketsId
)
...
...
@@ -106,7 +108,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
);
int
thisOrderStatus
=
orderStatus
.
getStatus
();
int
thisPayStatus
=
orderStatus
.
getPayStatus
();
double
priceExpress
=
orderInfo
.
getPriceExpress
().
doubleValue
();
BigDecimal
priceExpress
=
orderInfo
.
getPriceExpress
();
// todo 转增是否能退
// 订单状态需已付款
...
...
@@ -127,11 +129,11 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
refundPriceExpressSum
=
0.0
;
}
if
(
null
==
refundApplyParam
.
getOrderRefundBatchesId
()
||
refundApplyParam
.
getOrderRefundBatchesId
().
isEmpty
())
{
// 不是批量退款
if
(
RefundPriceExpress
>
(
priceExpress
-
refundPriceExpressSum
)
)
{
if
(
RefundPriceExpress
.
compareTo
(
priceExpress
.
subtract
(
BigDecimal
.
valueOf
(
refundPriceExpressSum
)))
>
0
)
{
return
ResponseDto
.
failure
(
"快递费不能大于实际减去已退的快递费"
);
}
}
else
{
RefundPriceExpress
=
priceExpress
-
refundPriceExpressSum
;
RefundPriceExpress
=
priceExpress
.
subtract
(
BigDecimal
.
valueOf
(
refundPriceExpressSum
))
;
}
// todo 出票未出票
...
...
@@ -148,18 +150,18 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
}
// 该订单正在退款或已有退款 因支持填入价格所有取消判断
// 各个入场人订单填写的退款金额是否正确
double
priceActual
=
orderInfo
.
getPriceActual
().
doubleValue
();
BigDecimal
priceActual
=
orderInfo
.
getPriceActual
();
int
allEntitiesCount
=
kylinOrderTicketEntitiesMapper
.
selectCount
(
// 总入场人数量 排出未付款的 用来计算单入场人的价格
new
QueryWrapper
<
KylinOrderTicketEntities
>()
.
eq
(
"order_id"
,
orderTicketsId
)
.
ne
(
"is_payment"
,
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT0
)
);
double
onePrice
=
(
priceActual
-
priceExpress
)
/
allEntitiesCount
;
//单价
BigDecimal
onePrice
=
priceActual
.
subtract
(
priceExpress
).
divide
(
BigDecimal
.
valueOf
(
allEntitiesCount
))
;
//单价
List
<
Double
>
realRefundPriceList
=
new
ArrayList
<>();
if
(
null
==
refundApplyParam
.
getOrderRefundBatchesId
()
||
refundApplyParam
.
getOrderRefundBatchesId
().
isEmpty
())
{
// 不是批量退款
for
(
int
i
=
0
;
i
<=
ticketEntityIds
.
size
()
-
1
;
i
++)
{
Double
price
=
entitiesPrice
.
get
(
i
);
if
(
price
<
0
)
{
BigDecimal
price
=
BigDecimal
.
valueOf
(
entitiesPrice
.
get
(
i
)
);
if
(
price
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20021"
));
}
else
{
Double
refundedPrice
=
kylinOrderTicketEntitiesMapper
.
getRefundEntitiesPrice
(
//已退
...
...
@@ -170,7 +172,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
if
(
null
==
refundedPrice
)
{
refundedPrice
=
0.0
;
}
if
(
price
>
(
onePrice
-
refundedPrice
)
)
{
if
(
price
.
compareTo
(
onePrice
.
subtract
(
BigDecimal
.
valueOf
(
refundedPrice
)))
>
0
)
{
return
ResponseDto
.
failure
(
"超过可退款金额"
);
}
}
...
...
@@ -187,9 +189,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
if
(
null
==
refundedPrice
)
{
refundedPrice
=
0.0
;
}
Double
price
=
onePrice
-
refundedPrice
;
// 计算可退金额
if
(
price
>
0
)
{
realRefundPriceList
.
add
(
price
);
BigDecimal
price
=
onePrice
.
subtract
(
BigDecimal
.
valueOf
(
refundedPrice
))
;
// 计算可退金额
if
(
price
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
realRefundPriceList
.
add
(
price
.
doubleValue
()
);
ticketEntityIdsNew
.
add
(
ticketEntityIds
.
get
(
i
));
}
}
...
...
@@ -199,7 +201,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
boolean
res
=
kylinRefundsStatusServiceImpl
.
orderTicketRefunding
(
refundApplyParam
,
orderInfo
,
orderTicketsId
,
RefundPriceExpress
,
RefundPriceExpress
.
doubleValue
()
,
ticketEntityIds
,
realRefundPriceList
);
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/KylinRefundsStatusServiceImpl.java
View file @
596c94a6
...
...
@@ -481,14 +481,14 @@ public class KylinRefundsStatusServiceImpl {
);
// 入场人
double
priceActual
=
orderInfo
.
getPriceActual
().
doubleValue
();
double
priceExpress
=
orderInfo
.
getPriceExpress
().
doubleValue
();
BigDecimal
priceActual
=
orderInfo
.
getPriceActual
();
BigDecimal
priceExpress
=
orderInfo
.
getPriceExpress
();
int
allEntitiesCount
=
kylinOrderTicketEntitiesMapper
.
selectCount
(
// 总入场人数量 排出未付款的 用来计算单入场人的价格
new
QueryWrapper
<
KylinOrderTicketEntities
>()
.
eq
(
"order_id"
,
orderTicketsId
)
.
ne
(
"is_payment"
,
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT0
)
);
double
onePrice
=
(
priceActual
-
priceExpress
)
/
allEntitiesCount
;
//单价
BigDecimal
onePrice
=
priceActual
.
subtract
(
priceExpress
).
divide
(
BigDecimal
.
valueOf
(
allEntitiesCount
))
;
//单价
int
refundNumber
=
0
;
for
(
String
entitiesId
:
orderTicketEntitiesIdsArr
)
{
KylinOrderTicketEntities
EntitiesInfo
=
kylinOrderTicketEntitiesMapper
.
selectOne
(
//已退完成的
...
...
@@ -504,9 +504,9 @@ public class KylinRefundsStatusServiceImpl {
);
KylinOrderTicketEntities
entitiesTable
=
new
KylinOrderTicketEntities
();
double
priceNew
=
refundEntitiesInfo
.
getRefundPrice
().
doubleValue
()
+
refundedPrice
.
doubleValue
(
);
BigDecimal
priceNew
=
refundEntitiesInfo
.
getRefundPrice
().
add
(
refundedPrice
);
int
isPayment
=
0
;
if
(
priceNew
==
onePrice
)
{
if
(
priceNew
.
compareTo
(
onePrice
)
==
0
)
{
isPayment
=
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT3
;
refundNumber
++;
}
else
{
...
...
@@ -514,7 +514,7 @@ public class KylinRefundsStatusServiceImpl {
}
entitiesTable
.
setIsPayment
(
isPayment
);
entitiesTable
.
setUpdatedAt
(
LocalDateTime
.
now
());
entitiesTable
.
setRefundPrice
(
BigDecimal
.
valueOf
(
priceNew
)
);
entitiesTable
.
setRefundPrice
(
priceNew
);
Integer
[]
entitiesTableIsPayment
=
{
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT2
,
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT4
};
kylinOrderTicketEntitiesMapper
.
update
(
entitiesTable
,
new
UpdateWrapper
<
KylinOrderTicketEntities
>()
.
eq
(
"order_ticket_entities_id"
,
entitiesId
)
...
...
@@ -523,7 +523,7 @@ public class KylinRefundsStatusServiceImpl {
HashMap
<
String
,
Object
>
EntitiesVo
=
new
HashMap
<>();
EntitiesVo
.
put
(
"updatedAt"
,
DateUtil
.
getNowTime
());
EntitiesVo
.
put
(
"refundPrice"
,
BigDecimal
.
valueOf
(
priceNew
)
);
EntitiesVo
.
put
(
"refundPrice"
,
priceNew
);
EntitiesVo
.
put
(
"isPayment"
,
isPayment
);
BasicDBObject
EntitiesVov
=
new
BasicDBObject
(
"$set"
,
mongoConverter
.
convertToMongoType
(
EntitiesVo
));
UpdateResult
updateResult
=
mongoTemplate
.
getCollection
(
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
()).
updateOne
(
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/refund/KylinRefundsStatusServiceImpl.java
View file @
596c94a6
...
...
@@ -105,14 +105,14 @@ public class KylinRefundsStatusServiceImpl {
);
// 入场人
double
priceActual
=
orderInfo
.
getPriceActual
().
doubleValue
();
double
priceExpress
=
orderInfo
.
getPriceExpress
().
doubleValue
();
BigDecimal
priceActual
=
orderInfo
.
getPriceActual
();
BigDecimal
priceExpress
=
orderInfo
.
getPriceExpress
();
int
allEntitiesCount
=
kylinOrderTicketEntitiesMapper
.
selectCount
(
// 总入场人数量 排出未付款的 用来计算单入场人的价格
new
QueryWrapper
<
KylinOrderTicketEntities
>()
.
eq
(
"order_id"
,
orderTicketsId
)
.
ne
(
"is_payment"
,
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT0
)
);
double
onePrice
=
(
priceActual
-
priceExpress
)
/
allEntitiesCount
;
//单价
BigDecimal
onePrice
=
priceActual
.
subtract
(
priceExpress
).
divide
(
BigDecimal
.
valueOf
(
allEntitiesCount
))
;
//单价
int
refundNumber
=
0
;
for
(
String
entitiesId
:
orderTicketEntitiesIdsArr
)
{
KylinOrderTicketEntities
EntitiesInfo
=
kylinOrderTicketEntitiesMapper
.
selectOne
(
//已退完成的
...
...
@@ -128,9 +128,9 @@ public class KylinRefundsStatusServiceImpl {
);
KylinOrderTicketEntities
entitiesTable
=
new
KylinOrderTicketEntities
();
double
priceNew
=
refundEntitiesInfo
.
getRefundPrice
().
doubleValue
()
+
refundedPrice
.
doubleValue
(
);
BigDecimal
priceNew
=
refundEntitiesInfo
.
getRefundPrice
().
add
(
refundedPrice
);
int
isPayment
=
0
;
if
(
priceNew
==
onePrice
)
{
if
(
priceNew
.
compareTo
(
onePrice
)
==
0
)
{
isPayment
=
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT3
;
refundNumber
++;
}
else
{
...
...
@@ -138,7 +138,7 @@ public class KylinRefundsStatusServiceImpl {
}
entitiesTable
.
setIsPayment
(
isPayment
);
entitiesTable
.
setUpdatedAt
(
LocalDateTime
.
now
());
entitiesTable
.
setRefundPrice
(
BigDecimal
.
valueOf
(
priceNew
)
);
entitiesTable
.
setRefundPrice
(
priceNew
);
Integer
[]
entitiesTableIsPayment
=
{
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT2
,
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT4
};
kylinOrderTicketEntitiesMapper
.
update
(
entitiesTable
,
new
UpdateWrapper
<
KylinOrderTicketEntities
>()
.
eq
(
"order_ticket_entities_id"
,
entitiesId
)
...
...
@@ -147,7 +147,7 @@ public class KylinRefundsStatusServiceImpl {
HashMap
<
String
,
Object
>
EntitiesVo
=
new
HashMap
<>();
EntitiesVo
.
put
(
"updatedAt"
,
DateUtil
.
getNowTime
());
EntitiesVo
.
put
(
"refundPrice"
,
BigDecimal
.
valueOf
(
priceNew
)
);
EntitiesVo
.
put
(
"refundPrice"
,
priceNew
);
EntitiesVo
.
put
(
"isPayment"
,
isPayment
);
BasicDBObject
EntitiesVov
=
new
BasicDBObject
(
"$set"
,
mongoConverter
.
convertToMongoType
(
EntitiesVo
));
UpdateResult
updateResult
=
mongoTemplate
.
getCollection
(
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
()).
updateOne
(
...
...
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