记得上下班打卡 | 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
b2cb9a57
Commit
b2cb9a57
authored
Jun 06, 2021
by
anjiabin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab.zhengzai.tv/dongjingwei/liquidnet-bus-v1
into dev
parents
025eb45b
36042a8a
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
270 additions
and
315 deletions
+270
-315
RefundApplyParam.java
...m/liquidnet/service/kylin/dto/param/RefundApplyParam.java
+2
-0
KylinStationCheckRefreshVo.java
...dnet/service/kylin/dto/vo/KylinStationCheckRefreshVo.java
+25
-0
KylinStationPerformanceVo.java
...idnet/service/kylin/dto/vo/KylinStationPerformanceVo.java
+9
-0
KylinOrderRefundAdminController.java
...oller/zhengzai/kylin/KylinOrderRefundAdminController.java
+26
-22
KylinOrderRefundBatchAdminController.java
.../zhengzai/kylin/KylinOrderRefundBatchAdminController.java
+0
-2
application-dev.yml
...t-client-admin-web/src/main/resources/application-dev.yml
+4
-0
application-prod.yml
...-client-admin-web/src/main/resources/application-prod.yml
+3
-0
application-test.yml
...-client-admin-web/src/main/resources/application-test.yml
+3
-0
KylinOrderRefundsServiceImpl.java
...gzai/kylin/service/impl/KylinOrderRefundsServiceImpl.java
+61
-141
KylinRefundExecuteServiceImpl.java
...zai/kylin/service/impl/KylinRefundExecuteServiceImpl.java
+13
-29
KylinRefundPerformancesAdminServiceImpl.java
...service/impl/KylinRefundPerformancesAdminServiceImpl.java
+0
-3
KylinRefundsStatusServiceImpl.java
...zai/kylin/service/impl/KylinRefundsStatusServiceImpl.java
+44
-80
liquidnet-service-kylin-dev.yml
...s-config/liquidnet-config/liquidnet-service-kylin-dev.yml
+0
-3
liquidnet-service-kylin-test.yml
...-config/liquidnet-config/liquidnet-service-kylin-test.yml
+0
-3
KylinStationController.java
...dnet/service/kylin/controller/KylinStationController.java
+80
-32
No files found.
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/param/RefundApplyParam.java
View file @
b2cb9a57
...
...
@@ -33,4 +33,6 @@ public class RefundApplyParam implements Serializable {
private
String
refuse
;
private
String
type
;
}
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/vo/KylinStationCheckRefreshVo.java
0 → 100644
View file @
b2cb9a57
package
com
.
liquidnet
.
service
.
kylin
.
dto
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@ApiModel
(
value
=
"KylinStationCheckRefreshVo"
,
description
=
"下载刷新验票信息响应参数"
)
@Data
public
class
KylinStationCheckRefreshVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
7313121561515036798L
;
private
KylinStationPerformanceVo
performanceVo
;
private
List
<
KylinStationCheckOrderVo
>
checkOrderVos
;
private
static
final
KylinStationCheckRefreshVo
obj
=
new
KylinStationCheckRefreshVo
();
public
static
KylinStationCheckRefreshVo
getNew
()
{
try
{
return
(
KylinStationCheckRefreshVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
KylinStationCheckRefreshVo
();
}
}
}
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/vo/KylinStationPerformanceVo.java
View file @
b2cb9a57
...
...
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
@ApiModel
(
value
=
"KylinStationPerformanceVo"
,
description
=
"演出列表响应参数"
)
...
...
@@ -29,6 +30,14 @@ public class KylinStationPerformanceVo implements Serializable, Cloneable {
private
List
<
KylinStationTicketVo
>
ticketVoList
;
@ApiModelProperty
(
position
=
18
,
value
=
"可下载时间"
)
private
String
canDownTime
;
@ApiModelProperty
(
position
=
20
,
value
=
"票房"
)
private
BigDecimal
priceSum
;
@ApiModelProperty
(
position
=
21
,
value
=
"票量[9]"
)
private
Integer
number
;
@ApiModelProperty
(
position
=
22
,
value
=
"已验票量[9]"
)
private
Integer
checkedNum
;
@ApiModelProperty
(
position
=
23
,
value
=
"余量[9]"
)
private
Integer
remainderNum
;
private
static
final
KylinStationPerformanceVo
obj
=
new
KylinStationPerformanceVo
();
...
...
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 @
b2cb9a57
...
...
@@ -6,6 +6,7 @@ import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import
com.liquidnet.client.admin.common.core.page.TableDataInfo
;
import
com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinOrderRefundsServiceImpl
;
import
com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinOrderTicketsAdminServiceImpl
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.kylin.constant.KylinTableStatusConst
;
import
com.liquidnet.service.kylin.dao.OrderRefundDao
;
import
com.liquidnet.service.kylin.dto.param.RefundApplyParam
;
...
...
@@ -19,8 +20,6 @@ import org.springframework.stereotype.Controller;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.*
;
import
javax.websocket.server.PathParam
;
/**
* <p>
* 后台单订单退款 服务实现类
...
...
@@ -88,11 +87,11 @@ public class KylinOrderRefundAdminController extends BaseController {
@ResponseBody
public
AjaxResult
refundApply
(
RefundApplyParam
refundApplyParam
)
{
try
{
Boolean
res
=
kylinOrderRefundsServiceImpl
.
refundApply
(
refundApplyParam
);
if
(
res
)
{
ResponseDto
res
=
kylinOrderRefundsServiceImpl
.
refundApply
(
refundApplyParam
);
if
(
res
.
isSuccess
()
)
{
return
success
();
}
else
{
return
error
(
"申请退款失败"
);
return
error
(
res
.
getMessage
()
);
}
}
catch
(
Exception
e
)
{
return
error
(
e
.
getMessage
());
...
...
@@ -104,11 +103,12 @@ public class KylinOrderRefundAdminController extends BaseController {
@ResponseBody
public
AjaxResult
refundCancel
(
RefundApplyParam
refundApplyParam
)
{
try
{
Boolean
res
=
kylinOrderRefundsServiceImpl
.
refundCancel
(
refundApplyParam
);
if
(
res
)
{
refundApplyParam
.
setType
(
"cancel"
);
ResponseDto
res
=
kylinOrderRefundsServiceImpl
.
refundCheckStatus
(
refundApplyParam
);
if
(
res
.
isSuccess
())
{
return
success
();
}
else
{
return
error
(
"取消退款失败"
);
return
error
(
res
.
getMessage
()
);
}
}
catch
(
Exception
e
)
{
return
error
(
e
.
getMessage
());
...
...
@@ -120,12 +120,12 @@ public class KylinOrderRefundAdminController extends BaseController {
@ResponseBody
public
AjaxResult
refundReapply
(
RefundApplyParam
refundApplyParam
)
{
try
{
Boolean
res
=
kylinOrderRefundsServiceImpl
.
refundReapply
(
refundApplyParam
);
if
(
res
)
{
refundApplyParam
.
setType
(
"reapply"
);
ResponseDto
res
=
kylinOrderRefundsServiceImpl
.
refundCheckStatus
(
refundApplyParam
);
if
(
res
.
isSuccess
())
{
return
success
();
}
else
{
// 不是重新发起退款,而是重新发起退款审核
return
error
(
"再次发起退款审核失败"
);
return
error
(
res
.
getMessage
());
}
}
catch
(
Exception
e
)
{
return
error
(
e
.
getMessage
());
...
...
@@ -138,18 +138,20 @@ public class KylinOrderRefundAdminController extends BaseController {
@ResponseBody
public
AjaxResult
refundReview
(
RefundApplyParam
refundApplyParam
)
{
try
{
Boolean
res
=
false
;
ResponseDto
res
=
null
;
Integer
status
=
refundApplyParam
.
getStatus
();
if
(
status
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
)
{
// 通过
res
=
kylinOrderRefundsServiceImpl
.
refundApproved
(
refundApplyParam
);
refundApplyParam
.
setType
(
"approved"
);
res
=
kylinOrderRefundsServiceImpl
.
refundCheckStatus
(
refundApplyParam
);
}
if
(
status
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
)
{
// 驳回
res
=
kylinOrderRefundsServiceImpl
.
refundReject
(
refundApplyParam
);
refundApplyParam
.
setType
(
"reject"
);
res
=
kylinOrderRefundsServiceImpl
.
refundCheckStatus
(
refundApplyParam
);
}
if
(
res
)
{
if
(
res
.
isSuccess
()
)
{
return
success
();
}
else
{
return
error
(
"审核退款失败"
);
return
error
(
res
.
getMessage
()
);
}
}
catch
(
Exception
e
)
{
return
error
(
e
.
getMessage
());
...
...
@@ -162,18 +164,20 @@ public class KylinOrderRefundAdminController extends BaseController {
@ResponseBody
public
AjaxResult
refundExecute
(
RefundApplyParam
refundApplyParam
)
{
try
{
Boolean
res
=
false
;
ResponseDto
res
=
null
;
Integer
status
=
refundApplyParam
.
getStatus
();
if
(
status
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_UNFILLED
)
{
// 通过
res
=
kylinOrderRefundsServiceImpl
.
refundUnfilled
(
refundApplyParam
);
refundApplyParam
.
setType
(
"unfilled"
);
res
=
kylinOrderRefundsServiceImpl
.
refundCheckStatus
(
refundApplyParam
);
}
if
(
status
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
)
{
// 驳回
res
=
kylinOrderRefundsServiceImpl
.
refundRefuse
(
refundApplyParam
);
refundApplyParam
.
setType
(
"refuse"
);
res
=
kylinOrderRefundsServiceImpl
.
refundCheckStatus
(
refundApplyParam
);
}
if
(
res
)
{
if
(
res
.
isSuccess
()
)
{
return
success
();
}
else
{
return
error
(
"审核退款失败"
);
return
error
(
res
.
getMessage
()
);
}
}
catch
(
Exception
e
)
{
return
error
(
e
.
getMessage
());
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/kylin/KylinOrderRefundBatchAdminController.java
View file @
b2cb9a57
...
...
@@ -6,11 +6,9 @@ import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import
com.liquidnet.client.admin.common.core.page.TableDataInfo
;
import
com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinRefundPerformancesAdminServiceImpl
;
import
com.liquidnet.service.kylin.dao.OrderRefundBatchDao
;
import
com.liquidnet.service.kylin.dto.param.RefundApplyParam
;
import
com.liquidnet.service.kylin.dto.param.RefundBatchApplyParam
;
import
com.liquidnet.service.kylin.dto.param.RefundBatchSearchParam
;
import
com.liquidnet.service.kylin.dto.vo.KylinOrderRefundBatchesVo
;
import
com.liquidnet.service.kylin.dto.vo.OrderDetailsVo
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/application-dev.yml
View file @
b2cb9a57
...
...
@@ -24,6 +24,10 @@ liquidnet:
username
:
testmall
password
:
zhengzai!mYT
database-name
:
dev_ln_scene
url-refund
:
apply
:
"
http://devpay.zhengzai.tv/refund/single"
notify
:
"
https://devzuul.zhengzai.tv/kylin/refund/callback"
# end-dev-这里是配置信息基本值
spring
:
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/application-prod.yml
View file @
b2cb9a57
...
...
@@ -24,6 +24,9 @@ liquidnet:
username
:
testmall
password
:
zhengzai!mYT
database-name
:
test_ln_scene
url-refund
:
apply
:
"
http://pay.zhengzai.tv/refund/single"
notify
:
"
https://zuul.zhengzai.tv/kylin/refund/callback"
# end-dev-这里是配置信息基本值
spring
:
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/application-test.yml
View file @
b2cb9a57
...
...
@@ -24,6 +24,9 @@ liquidnet:
username
:
zhengzai
password
:
$hAh4SGcDQ
database-name
:
test_ln_scene
url-refund
:
apply
:
"
http://testpay.zhengzai.tv/refund/single"
notify
:
"
https://zuul.zhengzai.tv/kylin/refund/callback"
# end-dev-这里是配置信息基本值
spring
:
...
...
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 @
b2cb9a57
...
...
@@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.client.admin.zhengzai.kylin.utils.DataUtils
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.kylin.constant.KylinTableStatusConst
;
import
com.liquidnet.service.kylin.dao.OrderRefundDao
;
import
com.liquidnet.service.kylin.dto.param.RefundApplyParam
;
...
...
@@ -23,7 +23,6 @@ import com.liquidnet.service.kylin.mapper.KylinOrderTicketStatusMapper;
import
com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper
;
import
com.liquidnet.service.kylin.service.IKylinOrderRefundsService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpException
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
...
...
@@ -33,7 +32,7 @@ import java.util.List;
/**
* <p>
* 订单退款表 服务实现类
* 订单退款表 服务实现类
处理逻辑判断
* </p>
*
* @author jiangxiulong
...
...
@@ -60,14 +59,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
@Autowired
MongoTemplate
mongoTemplate
;
public
Boolean
refundApply
(
RefundApplyParam
refundApplyParam
)
throws
Exception
{
/*int count = 0;
count = kylinOrderTicketsMapper.selectCount(
new UpdateWrapper<KylinOrderTickets>().eq("order_tickets_id", refundApplyParam.getOrderTicketsId()).eq("coupon_type", "no")
);
if (count > 0) {
throw new Exception("使用满减券 暂不能退款");
}*/
public
ResponseDto
refundApply
(
RefundApplyParam
refundApplyParam
)
{
String
orderTicketsId
=
refundApplyParam
.
getOrderTicketsId
();
List
<
String
>
ticketEntityIds
=
refundApplyParam
.
getTicketEntityIds
();
double
RefundPriceExpress
=
refundApplyParam
.
getRefundPriceExpress
();
...
...
@@ -86,15 +78,15 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
// 订单状态需已付款
if
(
thisOrderStatus
!=
KylinTableStatusConst
.
ORDER_STATUS1
)
{
throw
new
HttpException
(
"订单状态信息有误"
);
return
ResponseDto
.
failure
(
"订单状态信息有误"
);
}
// 订单支付状态需为已支付
if
(
thisPayStatus
!=
KylinTableStatusConst
.
ORDER_PAY_STATUS1
)
{
throw
new
HttpException
(
"订单支付信息有误"
);
return
ResponseDto
.
failure
(
"订单支付信息有误"
);
}
// 传的快递费不能大于实际的快递费
if
(
RefundPriceExpress
>
priceExpress
)
{
throw
new
HttpException
(
"快递费不能大于实际的快递费"
);
return
ResponseDto
.
failure
(
"快递费不能大于实际的快递费"
);
}
// 该订单正在退款或已有退款
QueryWrapper
<
KylinOrderRefunds
>
refundingCountQuery
=
new
QueryWrapper
<
KylinOrderRefunds
>()
...
...
@@ -105,19 +97,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
}
int
refundingCount
=
kylinOrderRefundsMapper
.
selectCount
(
refundingCountQuery
);
if
(
refundingCount
>
0
)
{
throw
new
HttpException
(
"该订单正在退款或已有退款"
);
return
ResponseDto
.
failure
(
"该订单正在退款或已有退款"
);
}
// 该订单的入场人未付款/正在退款/已退款
// TODO: 2021/5/27 出票未出票不知是否要处理
/*QueryWrapper<KylinOrderTicketEntities> notPayCountQuery = new QueryWrapper<KylinOrderTicketEntities>()
.in("order_ticket_entities_id", ticketEntityIds)
.in("is_payment", new Integer[]{
KylinTableStatusConst.ENTITIES_IS_PAYMENT0,
KylinTableStatusConst.ENTITIES_IS_PAYMENT2,
KylinTableStatusConst.ENTITIES_IS_PAYMENT3});
int notPayCount = kylinOrderTicketEntitiesMapper.selectCount(notPayCountQuery);*/
// 选择退款的入场人是否正确
// TODO: 2021/5/27 出票未出票不知是否要处理
QueryWrapper
<
KylinOrderTicketEntities
>
choiceCountQuery
=
new
QueryWrapper
<
KylinOrderTicketEntities
>()
...
...
@@ -127,7 +109,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
int
choiceCount
=
kylinOrderTicketEntitiesMapper
.
selectCount
(
choiceCountQuery
);
int
ticketEntityCount
=
ticketEntityIds
.
size
();
if
(
choiceCount
<
0
||
choiceCount
!=
ticketEntityCount
)
{
throw
new
HttpException
(
"入场人订单有误或不存在"
);
return
ResponseDto
.
failure
(
"入场人订单有误或不存在"
);
}
boolean
res
=
kylinRefundsStatusServiceImpl
.
orderTicketRefunding
(
...
...
@@ -136,142 +118,80 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
ticketEntityCount
,
ticketEntityIds
);
if
(
res
)
{
return
true
;
return
ResponseDto
.
success
()
;
}
else
{
return
false
;
return
ResponseDto
.
failure
(
"操作失败"
)
;
}
}
public
Boolean
refundCancel
(
RefundApplyParam
refundApplyParam
)
throws
Exception
{
List
<
String
>
orderRefundsIdList
=
refundApplyParam
.
getIds
();
Integer
[]
orderRefundStatus
=
{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPLY
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
List
<
KylinOrderRefunds
>
refundList
=
kylinOrderRefundsMapper
.
selectList
(
new
QueryWrapper
<
KylinOrderRefunds
>()
.
eq
(
"type"
,
KylinTableStatusConst
.
ORDER_REFUND_TYPE_APPLY
)
.
in
(
"order_refunds_id"
,
orderRefundsIdList
)
.
in
(
"status"
,
orderRefundStatus
)
);
if
(
orderRefundsIdList
.
size
()
!=
refundList
.
size
())
{
throw
new
Exception
(
"订单需未审核、已驳回、已回绝,非自动退款订单"
);
}
boolean
res
=
kylinRefundsStatusServiceImpl
.
orderTicketRefundCancel
(
refundList
);
if
(
res
)
{
return
true
;
}
else
{
return
false
;
}
}
public
Boolean
refundReapply
(
RefundApplyParam
refundApplyParam
)
throws
Exception
{
List
<
String
>
orderRefundsIdList
=
refundApplyParam
.
getIds
();
Integer
[]
orderRefundStatus
=
{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
List
<
KylinOrderRefunds
>
refundList
=
kylinOrderRefundsMapper
.
selectList
(
new
QueryWrapper
<
KylinOrderRefunds
>()
.
eq
(
"type"
,
KylinTableStatusConst
.
ORDER_REFUND_TYPE_APPLY
)
.
in
(
"order_refunds_id"
,
orderRefundsIdList
)
.
in
(
"status"
,
orderRefundStatus
)
);
if
(
orderRefundsIdList
.
size
()
!=
refundList
.
size
())
{
throw
new
Exception
(
"订单需一审驳回或二审驳回"
);
}
boolean
res
=
kylinRefundsStatusServiceImpl
.
orderTicketRefundReapply
(
refundList
);
if
(
res
)
{
return
true
;
}
else
{
return
false
;
}
}
public
Boolean
refundApproved
(
RefundApplyParam
refundApplyParam
)
throws
Exception
{
public
ResponseDto
refundCheckStatus
(
RefundApplyParam
refundApplyParam
)
{
String
type
=
refundApplyParam
.
getType
();
List
<
String
>
orderRefundsIdList
=
refundApplyParam
.
getIds
();
if
(
orderRefundsIdList
.
size
()
<=
0
)
{
throw
new
Exception
(
"无退款订单"
);
}
String
reject
=
refundApplyParam
.
getReject
();
Integer
[]
orderRefundStatus
=
{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPLY
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
List
<
KylinOrderRefunds
>
refundList
=
kylinOrderRefundsMapper
.
selectList
(
new
QueryWrapper
<
KylinOrderRefunds
>()
.
eq
(
"type"
,
KylinTableStatusConst
.
ORDER_REFUND_TYPE_APPLY
)
.
in
(
"order_refunds_id"
,
orderRefundsIdList
)
.
in
(
"status"
,
orderRefundStatus
)
);
if
(
orderRefundsIdList
.
size
()
!=
refundList
.
size
())
{
throw
new
Exception
(
"订单需未审核、已驳回、已回绝,请检查订单状态"
);
return
ResponseDto
.
failure
(
"无退款订单"
);
}
boolean
res
=
kylinRefundsStatusServiceImpl
.
orderTicketRefundApproved
(
refundList
,
reject
);
if
(
res
)
{
return
true
;
}
else
{
return
false
;
Integer
[]
orderRefundStatus
=
null
;
Integer
orderType
=
KylinTableStatusConst
.
ORDER_REFUND_TYPE_APPLY
;
switch
(
type
)
{
default
:
return
ResponseDto
.
failure
(
"type类型错误"
);
case
"cancel"
:
orderRefundStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPLY
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
break
;
case
"reapply"
:
orderRefundStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
break
;
case
"approved"
:
orderRefundStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPLY
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
break
;
case
"reject"
:
orderRefundStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPLY
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
break
;
case
"unfilled"
:
orderRefundStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_ERROR
};
break
;
case
"refuse"
:
orderRefundStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_ERROR
};
break
;
}
}
public
Boolean
refundReject
(
RefundApplyParam
refundApplyParam
)
throws
Exception
{
List
<
String
>
orderRefundsIdList
=
refundApplyParam
.
getIds
();
String
reject
=
refundApplyParam
.
getReject
();
Integer
[]
orderRefundStatus
=
{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPLY
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
List
<
KylinOrderRefunds
>
refundList
=
kylinOrderRefundsMapper
.
selectList
(
new
QueryWrapper
<
KylinOrderRefunds
>()
.
eq
(
"type"
,
KylinTableStatusConst
.
ORDER_REFUND_TYPE_APPLY
)
.
eq
(
"type"
,
orderType
)
.
in
(
"order_refunds_id"
,
orderRefundsIdList
)
.
in
(
"status"
,
orderRefundStatus
)
);
if
(
orderRefundsIdList
.
size
()
!=
refundList
.
size
())
{
throw
new
Exception
(
"订单需未审核、已审核、已回绝,请检查订单状态
"
);
return
ResponseDto
.
failure
(
"当前状态不允许操作
"
);
}
boolean
res
=
kylinRefundsStatusServiceImpl
.
orderTicketRefundReject
(
refundList
,
reject
);
if
(
res
)
{
return
true
;
}
else
{
return
false
;
}
}
public
Boolean
refundUnfilled
(
RefundApplyParam
refundApplyParam
)
throws
Exception
{
List
<
String
>
orderRefundsIdList
=
refundApplyParam
.
getIds
();
String
refuse
=
refundApplyParam
.
getRefuse
();
Integer
[]
orderRefundStatus
=
{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_ERROR
};
List
<
KylinOrderRefunds
>
refundList
=
kylinOrderRefundsMapper
.
selectList
(
new
QueryWrapper
<
KylinOrderRefunds
>()
.
eq
(
"type"
,
KylinTableStatusConst
.
ORDER_REFUND_TYPE_APPLY
)
.
in
(
"order_refunds_id"
,
orderRefundsIdList
)
.
in
(
"status"
,
orderRefundStatus
)
);
if
(
orderRefundsIdList
.
size
()
!=
refundList
.
size
())
{
throw
new
Exception
(
"订单需已审核、退款失败,请检查订单状态"
);
}
boolean
res
=
kylinRefundsStatusServiceImpl
.
orderTicketRefundUnfilled
(
refundList
,
refuse
);
if
(
res
)
{
return
true
;
}
else
{
return
false
;
}
}
public
Boolean
refundRefuse
(
RefundApplyParam
refundApplyParam
)
throws
Exception
{
List
<
String
>
orderRefundsIdList
=
refundApplyParam
.
getIds
();
boolean
res
=
false
;
String
reject
=
refundApplyParam
.
getReject
();
String
refuse
=
refundApplyParam
.
getRefuse
();
Integer
[]
orderRefundStatus
=
{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_ERROR
};
List
<
KylinOrderRefunds
>
refundList
=
kylinOrderRefundsMapper
.
selectList
(
new
QueryWrapper
<
KylinOrderRefunds
>()
.
eq
(
"type"
,
KylinTableStatusConst
.
ORDER_REFUND_TYPE_APPLY
)
.
in
(
"order_refunds_id"
,
orderRefundsIdList
)
.
in
(
"status"
,
orderRefundStatus
)
);
if
(
orderRefundsIdList
.
size
()
!=
refundList
.
size
())
{
throw
new
Exception
(
"订单需已审核、退款失败,请检查订单状态"
);
switch
(
type
)
{
case
"cancel"
:
res
=
kylinRefundsStatusServiceImpl
.
orderTicketRefundCancel
(
refundList
);
break
;
case
"reapply"
:
res
=
kylinRefundsStatusServiceImpl
.
orderRefundChangeStatus
(
refundList
,
type
,
""
,
""
);
break
;
case
"approved"
:
res
=
kylinRefundsStatusServiceImpl
.
orderRefundChangeStatus
(
refundList
,
type
,
reject
,
""
);
break
;
case
"Reject"
:
res
=
kylinRefundsStatusServiceImpl
.
orderRefundChangeStatus
(
refundList
,
type
,
reject
,
""
);
break
;
case
"unfilled"
:
res
=
kylinRefundsStatusServiceImpl
.
orderTicketRefundUnfilled
(
refundList
,
refuse
);
break
;
case
"refuse"
:
res
=
kylinRefundsStatusServiceImpl
.
orderRefundChangeStatus
(
refundList
,
type
,
""
,
refuse
);
break
;
}
boolean
res
=
kylinRefundsStatusServiceImpl
.
orderTicketRefundRefuse
(
refundList
,
refuse
);
if
(
res
)
{
return
true
;
return
ResponseDto
.
success
()
;
}
else
{
return
false
;
return
ResponseDto
.
failure
(
"操作失败"
)
;
}
}
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/KylinRefundExecuteServiceImpl.java
View file @
b2cb9a57
...
...
@@ -2,6 +2,7 @@ package com.liquidnet.client.admin.zhengzai.kylin.service.impl;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.kylin.constant.KylinTableStatusConst
;
import
com.liquidnet.service.kylin.dto.param.RefundApplyParam
;
import
com.liquidnet.service.kylin.dto.param.RefundBatchApplyParam
;
...
...
@@ -15,7 +16,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -67,7 +67,7 @@ public class KylinRefundExecuteServiceImpl {
if
(
order
.
getPriceExpress
()
!=
null
)
{
refundApplyParam
.
setRefundPriceExpress
(
order
.
getPriceExpress
().
doubleValue
());
}
Boolean
res
=
kylinOrderRefundsServiceImpl
.
refundApply
(
refundApplyParam
);
ResponseDto
res
=
kylinOrderRefundsServiceImpl
.
refundApply
(
refundApplyParam
);
}
count
=
orderList
.
size
();
...
...
@@ -91,17 +91,21 @@ public class KylinRefundExecuteServiceImpl {
break
;
case
"review"
:
if
(
status
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
)
{
// 通过申请
type
=
"approved"
;
whereStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPLY
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
}
if
(
status
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
)
{
// 驳回申请
type
=
"reject"
;
whereStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPLY
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
}
break
;
case
"execute"
:
if
(
status
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_UNFILLED
)
{
// 执行退款
type
=
"unfilled"
;
whereStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_ERROR
};
}
if
(
status
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
)
{
// 拒绝退款
type
=
"refuse"
;
whereStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_ERROR
};
}
break
;
...
...
@@ -121,34 +125,14 @@ public class KylinRefundExecuteServiceImpl {
RefundApplyParam
refundApplyParam
=
new
RefundApplyParam
();
refundApplyParam
.
setIds
(
refundIds
);
Boolean
res
=
null
;
switch
(
type
)
{
case
"reapply"
:
res
=
kylinOrderRefundsServiceImpl
.
refundReapply
(
refundApplyParam
);
break
;
case
"cancel"
:
res
=
kylinOrderRefundsServiceImpl
.
refundCancel
(
refundApplyParam
);
break
;
case
"review"
:
if
(
status
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
)
{
// 通过申请
res
=
kylinOrderRefundsServiceImpl
.
refundApproved
(
refundApplyParam
);
}
if
(
status
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
)
{
// 驳回申请
res
=
kylinOrderRefundsServiceImpl
.
refundReject
(
refundApplyParam
);
}
break
;
case
"execute"
:
if
(
status
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_UNFILLED
)
{
// 执行退款
res
=
kylinOrderRefundsServiceImpl
.
refundUnfilled
(
refundApplyParam
);
}
if
(
status
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
)
{
// 拒绝退款
res
=
kylinOrderRefundsServiceImpl
.
refundRefuse
(
refundApplyParam
);
}
break
;
default
:
throw
new
Exception
(
"type异常,无法操作"
);
refundApplyParam
.
setType
(
type
);
if
(
null
!=
refundBatchApplyParam
.
getRefuse
())
{
refundApplyParam
.
setRefuse
(
refundBatchApplyParam
.
getRefuse
());
}
if
(
null
!=
refundBatchApplyParam
.
getReject
())
{
refundApplyParam
.
setReject
(
refundBatchApplyParam
.
getReject
());
}
ResponseDto
res
=
kylinOrderRefundsServiceImpl
.
refundCheckStatus
(
refundApplyParam
);
}
count
=
refundList
.
size
();
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/KylinRefundPerformancesAdminServiceImpl.java
View file @
b2cb9a57
...
...
@@ -4,17 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.client.admin.zhengzai.kylin.utils.DataUtils
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.kylin.constant.KylinRedisConst
;
import
com.liquidnet.service.kylin.constant.KylinTableStatusConst
;
import
com.liquidnet.service.kylin.dao.OrderRefundBatchDao
;
import
com.liquidnet.service.kylin.dto.param.RefundBatchApplyParam
;
import
com.liquidnet.service.kylin.dto.param.RefundBatchSearchParam
;
import
com.liquidnet.service.kylin.dto.vo.KylinOrderRefundBatchesVo
;
import
com.liquidnet.service.kylin.dto.vo.KylinPerformanceVo
;
import
com.liquidnet.service.kylin.entity.KylinOrderRefundBatches
;
import
com.liquidnet.service.kylin.mapper.KylinOrderRefundBatchesMapper
;
import
com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper
;
...
...
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 @
b2cb9a57
...
...
@@ -26,11 +26,10 @@ import com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper;
import
com.mongodb.BasicDBObject
;
import
com.mongodb.client.model.FindOneAndUpdateOptions
;
import
com.mongodb.client.model.ReturnDocument
;
import
com.sun.media.jfxmedia.logging.Logger
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpException
;
import
org.bson.Document
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
...
...
@@ -45,7 +44,7 @@ import java.util.stream.Collectors;
/**
* <p>
*
退款表 服务实现类
*
订单退款表 服务实现类 处理数据 退款后状态的变化
* </p>
*
* @author jiaangxiulong
...
...
@@ -55,6 +54,11 @@ import java.util.stream.Collectors;
@Service
public
class
KylinRefundsStatusServiceImpl
{
@Value
(
"${liquidnet.url-refund.apply}"
)
private
String
applyUrl
;
@Value
(
"${liquidnet.url-refund.notify}"
)
private
String
notifyUrl
;
@Autowired
private
KylinOrderTicketsMapper
kylinOrderTicketsMapper
;
...
...
@@ -77,7 +81,7 @@ public class KylinRefundsStatusServiceImpl {
RefundApplyParam
refundApplyParam
,
KylinOrderTickets
orderInfo
,
String
orderTicketsId
,
double
RefundPriceExpress
,
double
priceExpress
,
int
ticketEntityCount
,
List
<
String
>
ticketEntityIds
)
throws
HttpException
{
)
{
// 处理数据
String
authId
=
ShiroUtils
.
getUserId
().
toString
();
String
authName
=
ShiroUtils
.
getLoginName
();
...
...
@@ -225,90 +229,53 @@ public class KylinRefundsStatusServiceImpl {
return
true
;
}
public
boolean
orderTicketRefundReapply
(
List
<
KylinOrderRefunds
>
refundList
)
{
String
authId
=
ShiroUtils
.
getUserId
().
toString
();
String
authName
=
ShiroUtils
.
getLoginName
();
KylinOrderRefunds
kylinOrderRefunds
=
new
KylinOrderRefunds
();
kylinOrderRefunds
.
setStatus
(
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPLY
);
kylinOrderRefunds
.
setApplicantId
(
authId
);
kylinOrderRefunds
.
setApplicantName
(
authName
);
kylinOrderRefunds
.
setApplicantAt
(
LocalDateTime
.
now
());
List
<
String
>
refundIds
=
refundList
.
stream
().
map
(
KylinOrderRefunds
->
KylinOrderRefunds
.
getOrderRefundsId
()).
collect
(
Collectors
.
toList
());
kylinOrderRefundsMapper
.
update
(
kylinOrderRefunds
,
new
UpdateWrapper
<
KylinOrderRefunds
>().
in
(
"order_refunds_id"
,
refundIds
)
);
return
true
;
}
public
boolean
orderTicketRefundApproved
(
List
<
KylinOrderRefunds
>
refundList
,
String
reject
)
{
String
authId
=
ShiroUtils
.
getUserId
().
toString
();
String
authName
=
ShiroUtils
.
getLoginName
();
KylinOrderRefunds
kylinOrderRefunds
=
new
KylinOrderRefunds
();
kylinOrderRefunds
.
setStatus
(
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
);
kylinOrderRefunds
.
setAuditorId
(
authId
);
kylinOrderRefunds
.
setAuditorName
(
authName
);
kylinOrderRefunds
.
setAuditorAt
(
LocalDateTime
.
now
());
kylinOrderRefunds
.
setReject
(
reject
);
List
<
String
>
refundIds
=
refundList
.
stream
().
map
(
KylinOrderRefunds
->
KylinOrderRefunds
.
getOrderRefundsId
()).
collect
(
Collectors
.
toList
());
kylinOrderRefundsMapper
.
update
(
kylinOrderRefunds
,
new
UpdateWrapper
<
KylinOrderRefunds
>().
in
(
"order_refunds_id"
,
refundIds
)
);
return
true
;
}
public
boolean
orderTicketRefundReject
(
List
<
KylinOrderRefunds
>
refundList
,
String
reject
)
{
public
boolean
orderRefundChangeStatus
(
List
<
KylinOrderRefunds
>
refundList
,
String
type
,
String
reject
,
String
refuse
)
{
String
authId
=
ShiroUtils
.
getUserId
().
toString
();
String
authName
=
ShiroUtils
.
getLoginName
();
KylinOrderRefunds
kylinOrderRefunds
=
new
KylinOrderRefunds
();
kylinOrderRefunds
.
setStatus
(
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
);
kylinOrderRefunds
.
setAuditorId
(
authId
);
kylinOrderRefunds
.
setAuditorName
(
authName
);
kylinOrderRefunds
.
setAuditorAt
(
LocalDateTime
.
now
());
kylinOrderRefunds
.
setReject
(
reject
);
List
<
String
>
refundIds
=
refundList
.
stream
().
map
(
KylinOrderRefunds
->
KylinOrderRefunds
.
getOrderRefundsId
()).
collect
(
Collectors
.
toList
());
switch
(
type
)
{
case
"reapply"
:
kylinOrderRefunds
.
setStatus
(
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPLY
);
kylinOrderRefunds
.
setApplicantId
(
authId
);
kylinOrderRefunds
.
setApplicantName
(
authName
);
kylinOrderRefunds
.
setApplicantAt
(
LocalDateTime
.
now
());
break
;
case
"approved"
:
kylinOrderRefunds
.
setStatus
(
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
);
kylinOrderRefunds
.
setAuditorId
(
authId
);
kylinOrderRefunds
.
setAuditorName
(
authName
);
kylinOrderRefunds
.
setAuditorAt
(
LocalDateTime
.
now
());
kylinOrderRefunds
.
setReject
(
reject
);
break
;
case
"Reject"
:
kylinOrderRefunds
.
setStatus
(
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
);
kylinOrderRefunds
.
setAuditorId
(
authId
);
kylinOrderRefunds
.
setAuditorName
(
authName
);
kylinOrderRefunds
.
setAuditorAt
(
LocalDateTime
.
now
());
kylinOrderRefunds
.
setReject
(
reject
);
break
;
case
"refuse"
:
kylinOrderRefunds
.
setStatus
(
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
);
kylinOrderRefunds
.
setExecutorId
(
authId
);
kylinOrderRefunds
.
setExecutorName
(
authName
);
kylinOrderRefunds
.
setExecutorAt
(
LocalDateTime
.
now
());
kylinOrderRefunds
.
setRefuse
(
refuse
);
break
;
}
kylinOrderRefundsMapper
.
update
(
kylinOrderRefunds
,
new
UpdateWrapper
<
KylinOrderRefunds
>().
in
(
"order_refunds_id"
,
refundIds
)
List
<
String
>
orderRefundIds
=
refundList
.
stream
().
map
(
KylinOrderRefunds
->
KylinOrderRefunds
.
getOrderRefundsId
()).
collect
(
Collectors
.
toList
()
);
return
true
;
}
public
boolean
orderTicketRefundRefuse
(
List
<
KylinOrderRefunds
>
refundList
,
String
refuse
)
{
String
authId
=
ShiroUtils
.
getUserId
().
toString
();
String
authName
=
ShiroUtils
.
getLoginName
();
KylinOrderRefunds
kylinOrderRefunds
=
new
KylinOrderRefunds
();
kylinOrderRefunds
.
setStatus
(
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
);
kylinOrderRefunds
.
setExecutorId
(
authId
);
kylinOrderRefunds
.
setExecutorName
(
authName
);
kylinOrderRefunds
.
setExecutorAt
(
LocalDateTime
.
now
());
kylinOrderRefunds
.
setRefuse
(
refuse
);
List
<
String
>
refundIds
=
refundList
.
stream
().
map
(
KylinOrderRefunds
->
KylinOrderRefunds
.
getOrderRefundsId
()).
collect
(
Collectors
.
toList
());
kylinOrderRefundsMapper
.
update
(
kylinOrderRefunds
,
new
UpdateWrapper
<
KylinOrderRefunds
>().
in
(
"order_refunds_id"
,
r
efundIds
)
new
UpdateWrapper
<
KylinOrderRefunds
>().
in
(
"order_refunds_id"
,
orderR
efundIds
)
);
return
true
;
}
public
boolean
orderTicketRefundUnfilled
(
List
<
KylinOrderRefunds
>
refundList
,
String
refuse
)
throws
Exception
{
public
boolean
orderTicketRefundUnfilled
(
List
<
KylinOrderRefunds
>
refundList
,
String
refuse
)
{
String
authId
=
ShiroUtils
.
getUserId
().
toString
();
String
authName
=
ShiroUtils
.
getLoginName
();
...
...
@@ -320,9 +287,6 @@ public class KylinRefundsStatusServiceImpl {
kylinOrderRefunds
.
setRefuse
(
refuse
);
// List<String> refundIds = refundList.stream().map(KylinOrderRefunds -> KylinOrderRefunds.getOrderRefundsId()).collect(Collectors.toList());
// 开始执行退款
String
postUrl
=
"http://testpay.zhengzai.tv/refund/single"
;
for
(
KylinOrderRefunds
refund
:
refundList
)
{
KylinOrderTickets
oderInfo
=
kylinOrderTicketsMapper
.
selectOne
(
new
QueryWrapper
<
KylinOrderTickets
>()
...
...
@@ -333,7 +297,7 @@ public class KylinRefundsStatusServiceImpl {
params
.
add
(
"order_refund_code"
,
refund
.
getOrderRefundCode
());
params
.
add
(
"price"
,
refund
.
getPrice
().
toString
());
params
.
add
(
"reason"
,
refund
.
getReason
());
params
.
add
(
"notify_url"
,
"http://zuul.zhengzai.tv/kylin/refund/callback"
);
params
.
add
(
"notify_url"
,
notifyUrl
);
String
sign
=
StringUtils
.
Ksort
(
params
);
sign
=
sign
.
concat
(
"&key="
).
concat
(
"R7tXY9smPQPG9Ku5yI0u6sfnlckmk04V"
);
...
...
@@ -345,7 +309,7 @@ public class KylinRefundsStatusServiceImpl {
// start
// TODO: 2021/5/31 待整理
String
postResult
=
null
;
postResult
=
HttpUtil
.
post
(
post
Url
,
params
);
postResult
=
HttpUtil
.
post
(
apply
Url
,
params
);
JsonNode
postResultNew
=
JsonUtils
.
fromJson
(
postResult
,
JsonNode
.
class
);
// 请求提审接口结果
if
(
postResultNew
.
get
(
"message"
).
toString
()
!=
"OK"
)
{
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-kylin-dev.yml
View file @
b2cb9a57
...
...
@@ -21,9 +21,6 @@ liquidnet:
pay
:
"
http://testpay.zhengzai.tv/"
check
:
"
http://testpay.zhengzai.tv/order/verify"
localUrl
:
"
https://zuul.zhengzai.tv/kylin/order/syncOrder"
url-refund
:
apply
:
"
http://testpay.zhengzai.tv/refund/single"
notify
:
"
https://devzuul.zhengzai.tv/kylin/refund/callback"
#以下为spring各环境个性配置
spring
:
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-kylin-test.yml
View file @
b2cb9a57
...
...
@@ -21,9 +21,6 @@ liquidnet:
pay
:
"
http://testpay.zhengzai.tv/"
check
:
"
http://testpay.zhengzai.tv/order/verify"
localUrl
:
"
https://zuul.zhengzai.tv/kylin/order/syncOrder"
url-refund
:
apply
:
"
http://testpay.zhengzai.tv/refund/single"
notify
:
"
https://zuul.zhengzai.tv/kylin/refund/callback"
#以下为spring各环境个性配置
spring
:
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/controller/KylinStationController.java
View file @
b2cb9a57
...
...
@@ -103,7 +103,7 @@ public class KylinStationController {
@ApiOperation
(
value
=
"演出列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mod"
,
value
=
"模块[recent-近期的,over-历史]"
,
allowableValues
=
"recent,over"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
tru
e
,
dataType
=
"String"
,
name
=
"match"
,
value
=
"匹配字符[title|cityName|fieldName]"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
fals
e
,
dataType
=
"String"
,
name
=
"match"
,
value
=
"匹配字符[title|cityName|fieldName]"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Integer"
,
name
=
"pageNo"
,
value
=
"页码"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Integer"
,
name
=
"pageSize"
,
value
=
"页记录数"
,
example
=
"5"
),
})
...
...
@@ -179,11 +179,15 @@ public class KylinStationController {
Map
<
String
,
String
>
performanceRelationMap
=
performanceRelationList
.
stream
().
collect
(
Collectors
.
toMap
(
CheckPerformanceRelationParam:
:
getPerformanceId
,
CheckPerformanceRelationParam:
:
getCanDownTime
));
// 补充演出列表票种统计
voList
.
forEach
(
r
->
{
for
(
KylinStationPerformanceVo
r
:
voList
)
{
// 演出的所有订单票明细
List
<
KylinOrderTicketEntitiesVo
>
performanceTicketEntitiesVoList
=
oteVoMap
.
get
(
r
.
getPerformancesId
());
if
(!
CollectionUtils
.
isEmpty
(
performanceTicketEntitiesVoList
))
continue
;
// 订单票明细按票种分组
Map
<
String
,
List
<
KylinOrderTicketEntitiesVo
>>
performanceTicketEntitiesVoMap
=
performanceTicketEntitiesVoList
.
stream
().
collect
(
Collectors
.
groupingBy
(
KylinOrderTicketEntitiesVo:
:
getTicketId
));
Map
<
String
,
List
<
KylinOrderTicketEntitiesVo
>>
performanceTicketEntitiesVoMap
=
performanceTicketEntitiesVoList
.
stream
().
collect
(
Collectors
.
groupingBy
(
KylinOrderTicketEntitiesVo:
:
getTicketId
));
List
<
KylinStationTicketVo
>
ticketVoList
=
new
ArrayList
<>();
...
...
@@ -218,19 +222,13 @@ public class KylinStationController {
ticketVoList
.
add
(
stationTicketVo
);
}
KylinStationTicketVo
sumTicketVo
=
KylinStationTicketVo
.
getNew
();
sumTicketVo
.
setTicketId
(
"TT"
);
sumTicketVo
.
setTitle
(
"合计"
);
sumTicketVo
.
setPriceSum
(
priceSum
);
sumTicketVo
.
setNumber
(
number
);
sumTicketVo
.
setCheckedNum
(
checkedNum
);
sumTicketVo
.
setRemainderNum
(
remainderNum
);
ticketVoList
.
add
(
sumTicketVo
);
r
.
setPriceSum
(
priceSum
);
r
.
setNumber
(
number
);
r
.
setCheckedNum
(
checkedNum
);
r
.
setRemainderNum
(
remainderNum
);
r
.
setTicketVoList
(
ticketVoList
);
r
.
setCanDownTime
(
performanceRelationMap
.
get
(
r
.
getPerformancesId
()));
}
);
}
}
}
}
catch
(
Exception
e
)
{
...
...
@@ -246,7 +244,7 @@ public class KylinStationController {
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"performanceId"
,
value
=
"演出ID[64]"
),
})
@GetMapping
(
"download"
)
public
ResponseDto
<
List
<
KylinStationCheckOrderVo
>
>
downloadTicketData
(
@RequestParam
String
performanceId
)
{
public
ResponseDto
<
KylinStationCheckRefreshVo
>
downloadTicketData
(
@RequestParam
String
performanceId
)
{
log
.
info
(
"performanceId:{}"
,
performanceId
);
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
...
...
@@ -266,27 +264,52 @@ public class KylinStationController {
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20608"
));
}
List
<
KylinStationCheckOrderVo
>
voList
=
new
ArrayList
<>();
List
<
KylinStationCheckOrderVo
>
checkOrderVos
;
// 查取演出对应的订单票明细
Query
orderTicketEntitiesVoQuery
=
Query
.
query
(
Criteria
.
where
(
"performanceId"
).
is
(
performanceId
).
and
(
"isPayment"
).
is
(
1
));
voList
=
mongoTemplate
.
find
(
orderTicketEntitiesVoQuery
,
KylinStationCheckOrderVo
.
class
,
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
());
checkOrderVos
=
mongoTemplate
.
find
(
orderTicketEntitiesVoQuery
,
KylinStationCheckOrderVo
.
class
,
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
());
Query
query
=
Query
.
query
(
Criteria
.
where
(
"orderTicketsId"
).
in
(
voList
.
stream
().
map
(
KylinStationCheckOrderVo:
:
getOrderId
).
toArray
()
checkOrderVos
.
stream
().
map
(
KylinStationCheckOrderVo:
:
getOrderId
).
toArray
()
));
query
.
fields
().
include
(
"orderTicketsId"
).
include
(
"qrCode"
);
List
<
KylinOrderTicketVo
>
orderTicketVoList
=
mongoTemplate
.
find
(
query
,
KylinOrderTicketVo
.
class
,
KylinOrderTicketVo
.
class
.
getSimpleName
());
for
(
KylinOrderTicketVo
t
:
orderTicketVoList
)
for
(
KylinStationCheckOrderVo
r
:
voList
)
for
(
KylinOrderTicketVo
t
:
orderTicketVoList
)
{
for
(
KylinStationCheckOrderVo
r
:
checkOrderVos
)
{
if
(
r
.
getOrderId
().
equals
(
t
.
getOrderTicketsId
()))
{
r
.
setQrCode
(
t
.
getQrCode
());
r
.
setUserMobile
(
t
.
getUserMobile
());
r
.
setUserName
(
t
.
getUserName
());
}
return
ResponseDto
.
success
(
voList
);
}
}
KylinStationCheckRefreshVo
vo
=
KylinStationCheckRefreshVo
.
getNew
();
vo
.
setCheckOrderVos
(
checkOrderVos
);
{
// 查取演出信息
KylinStationPerformanceVo
performanceVo
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"performancesId"
).
is
(
performanceId
)),
KylinStationPerformanceVo
.
class
,
KylinPerformanceVo
.
class
.
getSimpleName
());
// 查取订单对应票种
Query
performanceTicketVoQuery
=
Query
.
query
(
Criteria
.
where
(
"ticketsId"
).
in
(
checkOrderVos
.
stream
().
filter
(
distinctByKey
(
KylinStationCheckOrderVo:
:
getTicketId
)).
map
(
KylinStationCheckOrderVo:
:
getTicketId
).
toArray
()
));
List
<
KylinTicketVo
>
performanceTicketVoList
=
mongoTemplate
.
find
(
performanceTicketVoQuery
,
KylinTicketVo
.
class
,
KylinTicketVo
.
class
.
getSimpleName
());
List
<
KylinStationTicketVo
>
ticketVoList
=
new
ArrayList
<>();
for
(
KylinTicketVo
r
:
performanceTicketVoList
)
{
KylinStationTicketVo
stationTicketVo
=
KylinStationTicketVo
.
getNew
();
stationTicketVo
.
setTicketId
(
r
.
getTicketsId
());
stationTicketVo
.
setTitle
(
r
.
getTitle
());
stationTicketVo
.
setPrice
(
r
.
getPrice
());
stationTicketVo
.
setUseStart
(
r
.
getUseStart
());
stationTicketVo
.
setUseEnd
(
r
.
getUseEnd
());
ticketVoList
.
add
(
stationTicketVo
);
}
performanceVo
.
setTicketVoList
(
ticketVoList
);
vo
.
setPerformanceVo
(
performanceVo
);
}
return
ResponseDto
.
success
(
vo
);
}
@ApiOperation
(
value
=
"上载验票数据"
)
...
...
@@ -305,7 +328,7 @@ public class KylinStationController {
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"latestUpdateAt"
,
value
=
"最近更新时间[yyyy-MM-dd HH:mm:ss]"
),
})
@PostMapping
(
"refresh"
)
public
ResponseDto
<
List
<
KylinStationCheckOrderVo
>
>
refreshTicketData
(
@RequestParam
String
performanceId
,
@RequestParam
String
latestUpdateAt
)
{
public
ResponseDto
<
KylinStationCheckRefreshVo
>
refreshTicketData
(
@RequestParam
String
performanceId
,
@RequestParam
String
latestUpdateAt
)
{
log
.
info
(
"refresh performanceId:{},latestUpdateAt:{}"
,
performanceId
,
latestUpdateAt
);
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
...
...
@@ -325,25 +348,50 @@ public class KylinStationController {
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20608"
));
}
List
<
KylinStationCheckOrderVo
>
voList
=
new
ArrayList
<>();
List
<
KylinStationCheckOrderVo
>
checkOrderVos
;
// 查取演出对应的订单票明细
Query
orderTicketEntitiesVoQuery
=
Query
.
query
(
Criteria
.
where
(
"performanceId"
).
is
(
performanceId
).
and
(
"updatedAt"
).
gte
(
latestUpdateAt
)
);
voList
=
mongoTemplate
.
find
(
orderTicketEntitiesVoQuery
,
KylinStationCheckOrderVo
.
class
,
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
());
checkOrderVos
=
mongoTemplate
.
find
(
orderTicketEntitiesVoQuery
,
KylinStationCheckOrderVo
.
class
,
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
());
Query
query
=
Query
.
query
(
Criteria
.
where
(
"orderTicketsId"
).
in
(
voList
.
stream
().
map
(
KylinStationCheckOrderVo:
:
getOrderId
).
toArray
()
checkOrderVos
.
stream
().
map
(
KylinStationCheckOrderVo:
:
getOrderId
).
toArray
()
));
query
.
fields
().
include
(
"orderTicketsId"
).
include
(
"qrCode"
);
List
<
KylinOrderTicketVo
>
orderTicketVoList
=
mongoTemplate
.
find
(
query
,
KylinOrderTicketVo
.
class
,
KylinOrderTicketVo
.
class
.
getSimpleName
());
for
(
KylinOrderTicketVo
t
:
orderTicketVoList
)
for
(
KylinStationCheckOrderVo
r
:
voList
)
for
(
KylinOrderTicketVo
t
:
orderTicketVoList
)
{
for
(
KylinStationCheckOrderVo
r
:
checkOrderVos
)
{
if
(
r
.
getOrderId
().
equals
(
t
.
getOrderTicketsId
()))
r
.
setQrCode
(
t
.
getQrCode
());
return
ResponseDto
.
success
(
voList
);
}
}
KylinStationCheckRefreshVo
vo
=
KylinStationCheckRefreshVo
.
getNew
();
vo
.
setCheckOrderVos
(
checkOrderVos
);
{
// 查取演出信息
KylinStationPerformanceVo
performanceVo
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"performancesId"
).
is
(
performanceId
)),
KylinStationPerformanceVo
.
class
,
KylinPerformanceVo
.
class
.
getSimpleName
());
// 查取订单对应票种
Query
performanceTicketVoQuery
=
Query
.
query
(
Criteria
.
where
(
"ticketsId"
).
in
(
checkOrderVos
.
stream
().
filter
(
distinctByKey
(
KylinStationCheckOrderVo:
:
getTicketId
)).
map
(
KylinStationCheckOrderVo:
:
getTicketId
).
toArray
()
));
List
<
KylinTicketVo
>
performanceTicketVoList
=
mongoTemplate
.
find
(
performanceTicketVoQuery
,
KylinTicketVo
.
class
,
KylinTicketVo
.
class
.
getSimpleName
());
List
<
KylinStationTicketVo
>
ticketVoList
=
new
ArrayList
<>();
for
(
KylinTicketVo
r
:
performanceTicketVoList
)
{
KylinStationTicketVo
stationTicketVo
=
KylinStationTicketVo
.
getNew
();
stationTicketVo
.
setTicketId
(
r
.
getTicketsId
());
stationTicketVo
.
setTitle
(
r
.
getTitle
());
stationTicketVo
.
setPrice
(
r
.
getPrice
());
stationTicketVo
.
setUseStart
(
r
.
getUseStart
());
stationTicketVo
.
setUseEnd
(
r
.
getUseEnd
());
ticketVoList
.
add
(
stationTicketVo
);
}
performanceVo
.
setTicketVoList
(
ticketVoList
);
vo
.
setPerformanceVo
(
performanceVo
);
}
return
ResponseDto
.
success
(
vo
);
}
/* ------------------------------------------------------------------ */
...
...
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