记得上下班打卡 | 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
3d6743aa
Commit
3d6743aa
authored
Jun 21, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
主动完成退款
parent
72a0c905
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
35 deletions
+38
-35
KylinOrderRefundAdminController.java
...oller/zhengzai/kylin/KylinOrderRefundAdminController.java
+1
-1
refund.html
...ain/resources/templates/zhengzai/kylin/refund/refund.html
+3
-0
KylinRefundsStatusServiceImpl.java
...zai/kylin/service/impl/KylinRefundsStatusServiceImpl.java
+34
-34
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/kylin/KylinOrderRefundAdminController.java
View file @
3d6743aa
...
@@ -184,7 +184,7 @@ public class KylinOrderRefundAdminController extends BaseController {
...
@@ -184,7 +184,7 @@ public class KylinOrderRefundAdminController extends BaseController {
}
}
}
}
// 主动完成退款
// 主动完成退款
没有批量
@RequiresPermissions
(
"kylin:refund:completed"
)
@RequiresPermissions
(
"kylin:refund:completed"
)
@PostMapping
(
"completed"
)
@PostMapping
(
"completed"
)
@ResponseBody
@ResponseBody
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/refund/refund.html
View file @
3d6743aa
...
@@ -94,6 +94,7 @@
...
@@ -94,6 +94,7 @@
var
executeFlag
=
[[
$
{@
permission
.
hasPermi
(
'kylin:refund:execute'
)}]];
var
executeFlag
=
[[
$
{@
permission
.
hasPermi
(
'kylin:refund:execute'
)}]];
var
cancelFlag
=
[[
$
{@
permission
.
hasPermi
(
'kylin:refund:cancel'
)}]];
var
cancelFlag
=
[[
$
{@
permission
.
hasPermi
(
'kylin:refund:cancel'
)}]];
var
reapplyFlag
=
[[
$
{@
permission
.
hasPermi
(
'kylin:refund:reapply'
)}]];
var
reapplyFlag
=
[[
$
{@
permission
.
hasPermi
(
'kylin:refund:reapply'
)}]];
var
completedFlag
=
[[
$
{@
permission
.
hasPermi
(
'kylin:refund:completed'
)}]];
var
prefix
=
ctx
+
"kylin/refund"
;
var
prefix
=
ctx
+
"kylin/refund"
;
...
@@ -189,6 +190,7 @@
...
@@ -189,6 +190,7 @@
detailUrl
:
prefix
+
"/details/{id}"
,
detailUrl
:
prefix
+
"/details/{id}"
,
cancelUrl
:
prefix
+
"/cancel"
,
cancelUrl
:
prefix
+
"/cancel"
,
reapplyUrl
:
prefix
+
"/reapply"
,
reapplyUrl
:
prefix
+
"/reapply"
,
completedUrl
:
prefix
+
"/completed"
,
modalName
:
"-订单退款"
,
modalName
:
"-订单退款"
,
columns
:
[{
columns
:
[{
checkbox
:
true
checkbox
:
true
...
@@ -236,6 +238,7 @@
...
@@ -236,6 +238,7 @@
actions
.
push
(
'<a class="btn btn-primary btn-xs '
+
executeFlag
+
'" href="javascript:void(0)" onclick="execute(
\'
'
+
row
.
orderRefundsId
+
'
\'
)"></i>二审</a> '
);
actions
.
push
(
'<a class="btn btn-primary btn-xs '
+
executeFlag
+
'" href="javascript:void(0)" onclick="execute(
\'
'
+
row
.
orderRefundsId
+
'
\'
)"></i>二审</a> '
);
actions
.
push
(
'<a class="btn btn-danger btn-xs '
+
cancelFlag
+
'" href="javascript:void(0)" onclick="$.operate.remove(
\'
'
+
row
.
orderRefundsId
+
'
\'
,
\'
确定取消退款申请吗?
\'
, table.options.cancelUrl)"></i>取消</a> '
);
actions
.
push
(
'<a class="btn btn-danger btn-xs '
+
cancelFlag
+
'" href="javascript:void(0)" onclick="$.operate.remove(
\'
'
+
row
.
orderRefundsId
+
'
\'
,
\'
确定取消退款申请吗?
\'
, table.options.cancelUrl)"></i>取消</a> '
);
actions
.
push
(
'<a class="btn btn-warning btn-xs '
+
reapplyFlag
+
'" href="javascript:void(0)" onclick="$.operate.remove(
\'
'
+
row
.
orderRefundsId
+
'
\'
,
\'
确定重新提交退款审核吗?
\'
, table.options.reapplyUrl)"></i>重新提交</a> '
);
actions
.
push
(
'<a class="btn btn-warning btn-xs '
+
reapplyFlag
+
'" href="javascript:void(0)" onclick="$.operate.remove(
\'
'
+
row
.
orderRefundsId
+
'
\'
,
\'
确定重新提交退款审核吗?
\'
, table.options.reapplyUrl)"></i>重新提交</a> '
);
actions
.
push
(
'<a class="btn btn-warning btn-xs '
+
completedFlag
+
'" href="javascript:void(0)" onclick="$.operate.remove(
\'
'
+
row
.
orderRefundsId
+
'
\'
,
\'
确定主动完成退款吗?
\'
, table.options.completedUrl)"></i>主动完成退款</a> '
);
return
actions
.
join
(
''
);
return
actions
.
join
(
''
);
}
}
}]
}]
...
...
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 @
3d6743aa
...
@@ -7,6 +7,7 @@ import com.liquidnet.client.admin.common.utils.ShiroUtils;
...
@@ -7,6 +7,7 @@ import com.liquidnet.client.admin.common.utils.ShiroUtils;
import
com.liquidnet.client.admin.common.utils.StringUtils
;
import
com.liquidnet.client.admin.common.utils.StringUtils
;
import
com.liquidnet.client.admin.zhengzai.kylin.utils.DataUtils
;
import
com.liquidnet.client.admin.zhengzai.kylin.utils.DataUtils
;
import
com.liquidnet.client.admin.zhengzai.kylin.utils.MongoVoUtils
;
import
com.liquidnet.client.admin.zhengzai.kylin.utils.MongoVoUtils
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.HttpUtil
;
import
com.liquidnet.commons.lang.util.HttpUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
...
@@ -20,11 +21,13 @@ import com.liquidnet.service.kylin.mapper.*;
...
@@ -20,11 +21,13 @@ import com.liquidnet.service.kylin.mapper.*;
import
com.mongodb.BasicDBObject
;
import
com.mongodb.BasicDBObject
;
import
com.mongodb.client.model.FindOneAndUpdateOptions
;
import
com.mongodb.client.model.FindOneAndUpdateOptions
;
import
com.mongodb.client.model.ReturnDocument
;
import
com.mongodb.client.model.ReturnDocument
;
import
com.mongodb.client.result.UpdateResult
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.bson.Document
;
import
org.bson.Document
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.convert.MongoConverter
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -33,6 +36,7 @@ import org.springframework.util.MultiValueMap;
...
@@ -33,6 +36,7 @@ import org.springframework.util.MultiValueMap;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -74,6 +78,9 @@ public class KylinRefundsStatusServiceImpl {
...
@@ -74,6 +78,9 @@ public class KylinRefundsStatusServiceImpl {
@Autowired
@Autowired
MongoTemplate
mongoTemplate
;
MongoTemplate
mongoTemplate
;
@Autowired
private
MongoConverter
mongoConverter
;
@Autowired
@Autowired
private
DataUtils
dataUtils
;
private
DataUtils
dataUtils
;
...
@@ -409,14 +416,12 @@ public class KylinRefundsStatusServiceImpl {
...
@@ -409,14 +416,12 @@ public class KylinRefundsStatusServiceImpl {
double
onePrice
=
(
priceActual
-
priceExpress
)
/
allEntitiesCount
;
//单价
double
onePrice
=
(
priceActual
-
priceExpress
)
/
allEntitiesCount
;
//单价
int
refundNumber
=
0
;
int
refundNumber
=
0
;
for
(
String
entitiesId
:
orderTicketEntitiesIdsArr
)
{
for
(
String
entitiesId
:
orderTicketEntitiesIdsArr
)
{
Double
refundedPrice
=
kylinOrderTicketEntitiesMapper
.
getRefundOverEntitiesPrice
(
//已退完成的
KylinOrderTicketEntities
EntitiesInfo
=
kylinOrderTicketEntitiesMapper
.
selectOne
(
//已退完成的
orderTicketsId
,
new
QueryWrapper
<
KylinOrderTicketEntities
>()
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUNDED
,
.
eq
(
"order_ticket_entities_id"
,
entitiesId
)
entitiesId
);
);
if
(
null
==
refundedPrice
)
{
BigDecimal
refundedPrice
=
EntitiesInfo
.
getRefundPrice
();
refundedPrice
=
0.0
;
}
KylinOrderRefundEntities
refundEntitiesInfo
=
kylinOrderRefundsEntitiesMapper
.
selectOne
(
KylinOrderRefundEntities
refundEntitiesInfo
=
kylinOrderRefundsEntitiesMapper
.
selectOne
(
new
QueryWrapper
<
KylinOrderRefundEntities
>()
new
QueryWrapper
<
KylinOrderRefundEntities
>()
.
eq
(
"order_refunds_id"
,
refundInfo
.
getOrderRefundsId
())
.
eq
(
"order_refunds_id"
,
refundInfo
.
getOrderRefundsId
())
...
@@ -425,32 +430,30 @@ public class KylinRefundsStatusServiceImpl {
...
@@ -425,32 +430,30 @@ public class KylinRefundsStatusServiceImpl {
KylinOrderTicketEntities
entitiesTable
=
new
KylinOrderTicketEntities
();
KylinOrderTicketEntities
entitiesTable
=
new
KylinOrderTicketEntities
();
double
priceNew
=
refundEntitiesInfo
.
getRefundPrice
().
doubleValue
()
+
refundedPrice
.
doubleValue
();
double
priceNew
=
refundEntitiesInfo
.
getRefundPrice
().
doubleValue
()
+
refundedPrice
.
doubleValue
();
int
isPayment
=
0
;
if
(
priceNew
==
onePrice
)
{
if
(
priceNew
==
onePrice
)
{
entitiesTable
.
setIsPayment
(
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT3
)
;
isPayment
=
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT3
;
refundNumber
++;
refundNumber
++;
}
else
{
}
else
{
entitiesTable
.
setIsPayment
(
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT4
)
;
isPayment
=
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT4
;
}
}
entitiesTable
.
setIsPayment
(
isPayment
);
entitiesTable
.
setUpdatedAt
(
LocalDateTime
.
now
());
entitiesTable
.
setUpdatedAt
(
LocalDateTime
.
now
());
entitiesTable
.
setRefundPrice
(
BigDecimal
.
valueOf
(
priceNew
));
entitiesTable
.
setRefundPrice
(
BigDecimal
.
valueOf
(
priceNew
));
Integer
[]
entitiesTableIsPayment
=
{
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT2
,
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT4
};
kylinOrderTicketEntitiesMapper
.
update
(
entitiesTable
,
new
UpdateWrapper
<
KylinOrderTicketEntities
>()
kylinOrderTicketEntitiesMapper
.
update
(
entitiesTable
,
new
UpdateWrapper
<
KylinOrderTicketEntities
>()
.
eq
(
"order_ticket_entities_id"
,
entitiesId
)
.
eq
(
"order_ticket_entities_id"
,
entitiesId
)
.
eq
(
"is_payment"
,
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT2
)
.
in
(
"is_payment"
,
entitiesTableIsPayment
)
);
);
KylinOrderTicketEntitiesVo
kylinOrderTicketEntitiesVo
=
new
KylinOrderTicketEntitiesVo
();
HashMap
<
String
,
Object
>
EntitiesVo
=
new
HashMap
<>();
if
(
priceNew
==
onePrice
)
{
EntitiesVo
.
put
(
"updatedAt"
,
DateUtil
.
getNowTime
());
kylinOrderTicketEntitiesVo
.
setIsPayment
(
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT3
);
EntitiesVo
.
put
(
"refundPrice"
,
BigDecimal
.
valueOf
(
priceNew
));
}
else
{
EntitiesVo
.
put
(
"isPayment"
,
isPayment
);
kylinOrderTicketEntitiesVo
.
setIsPayment
(
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT4
);
BasicDBObject
EntitiesVov
=
new
BasicDBObject
(
"$set"
,
mongoConverter
.
convertToMongoType
(
EntitiesVo
));
}
UpdateResult
updateResult
=
mongoTemplate
.
getCollection
(
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
()).
updateOne
(
kylinOrderTicketEntitiesVo
.
setUpdatedAt
(
LocalDateTime
.
now
().
toString
());
kylinOrderTicketEntitiesVo
.
setRefundPrice
(
BigDecimal
.
valueOf
(
priceNew
));
BasicDBObject
entitiesObject
=
new
BasicDBObject
(
"$set"
,
JSON
.
parse
(
JsonUtils
.
toJson
(
kylinOrderTicketEntitiesVo
)));
Document
entitiesDoc
=
mongoTemplate
.
getCollection
(
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
()).
findOneAndUpdate
(
Query
.
query
(
Criteria
.
where
(
"orderTicketEntitiesId"
).
is
(
entitiesId
)).
getQueryObject
(),
Query
.
query
(
Criteria
.
where
(
"orderTicketEntitiesId"
).
is
(
entitiesId
)).
getQueryObject
(),
entitiesObject
,
EntitiesVov
new
FindOneAndUpdateOptions
().
returnDocument
(
ReturnDocument
.
AFTER
)
);
);
dataUtils
.
delOrderTicketEntitiesRedis
(
entitiesId
);
dataUtils
.
delOrderTicketEntitiesRedis
(
entitiesId
);
...
@@ -468,17 +471,15 @@ public class KylinRefundsStatusServiceImpl {
...
@@ -468,17 +471,15 @@ public class KylinRefundsStatusServiceImpl {
.
eq
(
"order_tickets_id"
,
orderTicketsId
)
.
eq
(
"order_tickets_id"
,
orderTicketsId
)
);
);
KylinOrderTicketVo
kylinOrderTicketVoOrder
=
new
KylinOrderTicketVo
();
HashMap
<
String
,
Object
>
orderVo
=
new
HashMap
<>();
kylinOrderTicketVoOrder
.
setStatus
(
newStatus
);
orderVo
.
put
(
"updatedAt"
,
DateUtil
.
getNowTime
());
kylinOrderTicketVoOrder
.
setRefundNumber
(
num
);
orderVo
.
put
(
"priceRefund"
,
BigDecimal
.
valueOf
(
price
));
kylinOrderTicketVoOrder
.
setUpdatedAt
(
LocalDateTime
.
now
().
toString
());
orderVo
.
put
(
"status"
,
newStatus
);
// TODO: 2021/6/16 error
orderVo
.
put
(
"refundNumber"
,
num
);
// kylinOrderTicketVoOrder.setPriceRefund(BigDecimal.valueOf(price));
BasicDBObject
orderVov
=
new
BasicDBObject
(
"$set"
,
mongoConverter
.
convertToMongoType
(
orderVo
));
BasicDBObject
orderEntitiesObject
=
new
BasicDBObject
(
"$set"
,
JSON
.
parse
(
JsonUtils
.
toJson
(
kylinOrderTicketVoOrder
)));
UpdateResult
orderUpdateResult
=
mongoTemplate
.
getCollection
(
KylinOrderTicketVo
.
class
.
getSimpleName
()).
updateOne
(
Document
docOrder
=
mongoTemplate
.
getCollection
(
KylinOrderTicketVo
.
class
.
getSimpleName
()).
findOneAndUpdate
(
Query
.
query
(
Criteria
.
where
(
"orderTicketsId"
).
is
(
orderTicketsId
)).
getQueryObject
(),
Query
.
query
(
Criteria
.
where
(
"orderTicketsId"
).
is
(
orderTicketsId
)).
getQueryObject
(),
orderEntitiesObject
,
orderVov
new
FindOneAndUpdateOptions
().
returnDocument
(
ReturnDocument
.
AFTER
)
);
);
dataUtils
.
delOrderTicketRedis
(
orderTicketsId
);
dataUtils
.
delOrderTicketRedis
(
orderTicketsId
);
mongoVoUtils
.
resetOrderListVo
(
orderInfo
.
getUserId
(),
2
,
orderTicketsId
,
null
);
mongoVoUtils
.
resetOrderListVo
(
orderInfo
.
getUserId
(),
2
,
orderTicketsId
,
null
);
...
@@ -490,7 +491,6 @@ public class KylinRefundsStatusServiceImpl {
...
@@ -490,7 +491,6 @@ public class KylinRefundsStatusServiceImpl {
kylinOrderRefunds
.
setRefundType
(
refundCallbackParam
.
getRefund_type
());
kylinOrderRefunds
.
setRefundType
(
refundCallbackParam
.
getRefund_type
());
kylinOrderRefunds
.
setRefundId
(
refundCallbackParam
.
getRefund_id
());
kylinOrderRefunds
.
setRefundId
(
refundCallbackParam
.
getRefund_id
());
kylinOrderRefunds
.
setRefundAt
(
refundCallbackParam
.
getRefund_at
());
kylinOrderRefunds
.
setRefundAt
(
refundCallbackParam
.
getRefund_at
());
kylinOrderRefunds
.
setRefundError
(
refundCallbackParam
.
getRefund_error
());
kylinOrderRefunds
.
setUpdatedAt
(
LocalDateTime
.
now
());
kylinOrderRefunds
.
setUpdatedAt
(
LocalDateTime
.
now
());
kylinOrderRefundsMapper
.
update
(
kylinOrderRefundsMapper
.
update
(
kylinOrderRefunds
,
kylinOrderRefunds
,
...
...
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