记得上下班打卡 | 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
bd9d4486
Commit
bd9d4486
authored
May 28, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge del
parent
357cf589
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
0 additions
and
815 deletions
+0
-815
KylinRefundAdminController.java
...ce/kylin/controller/admin/KylinRefundAdminController.java
+0
-59
KylinRefundBatchAdminController.java
...lin/controller/admin/KylinRefundBatchAdminController.java
+0
-167
KylinOrderRefundsServiceImpl.java
...ylin/service/impl/admin/KylinOrderRefundsServiceImpl.java
+0
-20
KylinRefundExecuteServiceImpl.java
...lin/service/impl/admin/KylinRefundExecuteServiceImpl.java
+0
-123
KylinRefundHttpSubmitServiceImpl.java
.../service/impl/admin/KylinRefundHttpSubmitServiceImpl.java
+0
-105
KylinRefundPerformancesAdminServiceImpl.java
...e/impl/admin/KylinRefundPerformancesAdminServiceImpl.java
+0
-201
KylinRefundsServiceImpl.java
...ice/kylin/service/impl/admin/KylinRefundsServiceImpl.java
+0
-55
KylinRefundsStatusServiceImpl.java
...lin/service/impl/admin/KylinRefundsStatusServiceImpl.java
+0
-85
No files found.
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/controller/admin/KylinRefundAdminController.java
deleted
100644 → 0
View file @
357cf589
package
com
.
liquidnet
.
service
.
kylin
.
controller
.
admin
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.kylin.service.impl.admin.KylinRefundsServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>
* 后台单订单退款 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-05-25 10:58 上午
*/
@Api
(
tags
=
"后端-单订单退款"
)
@RestController
@RequestMapping
(
"admin/refund"
)
public
class
KylinRefundAdminController
{
@Autowired
private
KylinRefundsServiceImpl
kylinRefundsServiceImpl
;
@PostMapping
(
"apply"
)
@ApiOperation
(
"申请退款"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"orderTicketsId"
,
value
=
"订单id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"orderType"
,
value
=
"订单order_ticket 商品order_product"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"reason"
,
value
=
"备注"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"remark"
,
value
=
"备注"
),
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"Integer"
,
name
=
"batch_id"
,
value
=
"批量id"
),
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"refundData"
,
value
=
"退款数据"
)
})
public
ResponseDto
<
Object
>
refundApply
(
@RequestBody
String
orderTicketsId
,
@RequestBody
String
orderType
,
@RequestBody
String
reason
,
@RequestBody
String
remark
,
@RequestBody
Integer
batch_id
,
@RequestBody
String
refundData
)
throws
Exception
{
Boolean
res
=
kylinRefundsServiceImpl
.
refundApply
(
orderTicketsId
,
orderType
,
reason
,
remark
,
batch_id
,
refundData
);
if
(
res
)
{
return
ResponseDto
.
success
();
}
else
{
return
ResponseDto
.
failure
(
"申请退款失败"
);
}
}
}
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/controller/admin/KylinRefundBatchAdminController.java
deleted
100644 → 0
View file @
357cf589
package
com
.
liquidnet
.
service
.
kylin
.
controller
.
admin
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.kylin.service.impl.admin.KylinRefundPerformancesAdminServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
/**
* <p>
* 后台按演出批量退款 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-05-25 11:07 上午
*/
@Api
(
tags
=
"后端-批量退款"
)
@RestController
@RequestMapping
(
"admin/refundBatch"
)
public
class
KylinRefundBatchAdminController
{
@Autowired
private
KylinRefundPerformancesAdminServiceImpl
kylinRefundPerformancesAdminServiceImpl
;
@PostMapping
(
"apply"
)
@ApiOperation
(
"申请演出退款"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"targetId"
,
value
=
"ID targetType=1为演出id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"Integer"
,
name
=
"targetType"
,
value
=
"类型 1演出"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"reason"
,
value
=
"申请备注"
,
required
=
true
),
})
public
ResponseDto
<
Object
>
refundBatchApply
(
@RequestBody
String
targetId
,
@RequestBody
Integer
targetType
,
@RequestBody
String
reason
)
{
Integer
authId
=
1
;
String
authName
=
"jxl"
;
String
token
=
"22adsd34tt"
;
HashMap
<
String
,
Object
>
otherParam
=
new
HashMap
();
otherParam
.
put
(
"token"
,
token
);
otherParam
.
put
(
"reason"
,
reason
);
try
{
if
(
1
==
targetType
)
{
Boolean
res
=
kylinRefundPerformancesAdminServiceImpl
.
refundBatchApply
(
targetId
,
targetType
,
authId
,
authName
,
otherParam
);
if
(
res
)
{
return
ResponseDto
.
success
();
}
else
{
return
ResponseDto
.
failure
(
"申请演出退款失败"
);
}
}
else
{
return
ResponseDto
.
failure
(
"参数错误"
);
}
}
catch
(
Exception
e
)
{
return
ResponseDto
.
failure
(
e
.
getMessage
());
}
}
@PostMapping
(
"reapply"
)
@ApiOperation
(
"再次提交审核"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"refundBatchId"
,
value
=
"refundBatchId 批量id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"remark"
,
value
=
"再次提交备注"
,
required
=
true
),
})
public
ResponseDto
<
Object
>
refundBatchApply
(
@RequestBody
String
refundBatchId
,
@RequestBody
String
remark
)
throws
Exception
{
String
token
=
"22adsd34tt"
;
HashMap
<
String
,
Object
>
otherParam
=
new
HashMap
();
otherParam
.
put
(
"token"
,
token
);
otherParam
.
put
(
"type"
,
"reapply"
);
Boolean
res
=
kylinRefundPerformancesAdminServiceImpl
.
refundBatchReapply
(
refundBatchId
,
remark
,
otherParam
);
if
(
res
)
{
return
ResponseDto
.
success
();
}
else
{
return
ResponseDto
.
failure
(
"提交审核失败"
);
}
}
@PostMapping
(
"cancel"
)
@ApiOperation
(
"取消退款"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"refundBatchId"
,
value
=
"refundBatchId 批量id"
,
required
=
true
)
})
public
ResponseDto
<
Object
>
refundBatchCancel
(
@RequestBody
String
refundBatchId
)
throws
Exception
{
String
token
=
"22adsd34tt"
;
HashMap
<
String
,
Object
>
otherParam
=
new
HashMap
();
otherParam
.
put
(
"token"
,
token
);
otherParam
.
put
(
"type"
,
"cancel"
);
Boolean
res
=
kylinRefundPerformancesAdminServiceImpl
.
refundBatchCancel
(
refundBatchId
,
otherParam
);
if
(
res
)
{
return
ResponseDto
.
success
();
}
else
{
return
ResponseDto
.
failure
(
"取消退款失败"
);
}
}
@PostMapping
(
"review"
)
@ApiOperation
(
"审核/驳回"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"refundBatchId"
,
value
=
"refundBatchId 批量id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"Integer"
,
name
=
"status"
,
value
=
"状态 3运营驳回审核 4运营通过审核"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"reject"
,
value
=
"备注"
,
required
=
true
)
})
public
ResponseDto
<
Object
>
refundBatchReview
(
@RequestBody
String
refundBatchId
,
@RequestBody
Integer
status
,
@RequestBody
String
reject
)
throws
Exception
{
String
token
=
"22adsd34tt"
;
HashMap
<
String
,
Object
>
otherParam
=
new
HashMap
();
otherParam
.
put
(
"token"
,
token
);
otherParam
.
put
(
"type"
,
"review"
);
otherParam
.
put
(
"status"
,
status
);
otherParam
.
put
(
"reject"
,
reject
);
Boolean
res
=
kylinRefundPerformancesAdminServiceImpl
.
refundBatchReview
(
refundBatchId
,
otherParam
);
if
(
res
)
{
return
ResponseDto
.
success
();
}
else
{
return
ResponseDto
.
failure
(
"审核失败"
);
}
}
@PostMapping
(
"execute"
)
@ApiOperation
(
"执行退款/拒绝退款"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"refundBatchId"
,
value
=
"refundBatchId 批量id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"Integer"
,
name
=
"status"
,
value
=
"状态 5财务驳回审核 6财务通过审核"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"body"
,
dataType
=
"String"
,
name
=
"refuse"
,
value
=
"备注"
,
required
=
true
)
})
public
ResponseDto
<
Object
>
refundBatchExecute
(
@RequestBody
String
refundBatchId
,
@RequestBody
Integer
status
,
@RequestBody
String
refuse
)
throws
Exception
{
String
token
=
"22adsd34tt"
;
HashMap
<
String
,
Object
>
otherParam
=
new
HashMap
();
otherParam
.
put
(
"token"
,
token
);
otherParam
.
put
(
"type"
,
"execute"
);
otherParam
.
put
(
"status"
,
status
);
otherParam
.
put
(
"refuse"
,
refuse
);
Boolean
res
=
kylinRefundPerformancesAdminServiceImpl
.
refundBatchExecute
(
refundBatchId
,
otherParam
);
if
(
res
)
{
return
ResponseDto
.
success
();
}
else
{
return
ResponseDto
.
failure
(
"审核失败"
);
}
}
}
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/admin/KylinOrderRefundsServiceImpl.java
deleted
100644 → 0
View file @
357cf589
package
com
.
liquidnet
.
service
.
kylin
.
service
.
impl
.
admin
;
import
com.liquidnet.service.kylin.entity.KylinOrderRefunds
;
import
com.liquidnet.service.kylin.mapper.KylinOrderRefundsMapper
;
import
com.liquidnet.service.kylin.service.IKylinOrderRefundsService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
/**
* <p>
* 订单退款表 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-05-26
*/
@Service
public
class
KylinOrderRefundsServiceImpl
extends
ServiceImpl
<
KylinOrderRefundsMapper
,
KylinOrderRefunds
>
implements
IKylinOrderRefundsService
{
}
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/admin/KylinRefundExecuteServiceImpl.java
deleted
100644 → 0
View file @
357cf589
package
com
.
liquidnet
.
service
.
kylin
.
service
.
impl
.
admin
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.service.kylin.constant.KylinTableStatusConst
;
import
com.liquidnet.service.kylin.entity.*
;
import
com.liquidnet.service.kylin.mapper.KylinOrderTicketEntitiesMapper
;
import
com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper
;
import
com.liquidnet.service.kylin.mapper.KylinRefundBatchesMapper
;
import
com.liquidnet.service.kylin.mapper.KylinRefundsMapper
;
import
com.liquidnet.service.kylin.service.IKylinRefundBatchesService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* <p>
* 后台退款 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-05-25 19:50 下午
*/
@Service
public
class
KylinRefundExecuteServiceImpl
extends
ServiceImpl
<
KylinRefundBatchesMapper
,
KylinRefundBatches
>
implements
IKylinRefundBatchesService
{
@Autowired
private
KylinOrderTicketsMapper
kylinOrderTicketsMapper
;
@Autowired
private
KylinRefundsMapper
kylinRefundsMapper
;
@Autowired
private
KylinOrderTicketEntitiesMapper
kylinOrderTicketEntitiesMapper
;
@Autowired
RedisUtil
redisUtil
;
@Autowired
private
KylinRefundHttpSubmitServiceImpl
kylinRefundHttpSubmitServiceImpl
;
@Async
public
void
refundBatchApply
(
String
targetId
,
String
refundBatchId
,
HashMap
<
String
,
Object
>
otherParam
)
throws
Exception
{
int
count
;
int
limitNum
=
100
;
int
mid
=
0
;
do
{
List
<
KylinOrderTickets
>
orderList
=
kylinOrderTicketsMapper
.
getOrderEntities
(
targetId
,
mid
,
limitNum
);
for
(
KylinOrderTickets
v
:
orderList
)
{
List
<
KylinOrderTicketEntities
>
entitiesList
=
kylinOrderTicketEntitiesMapper
.
selectList
(
new
UpdateWrapper
<
KylinOrderTicketEntities
>().
eq
(
"order_id"
,
v
.
getOrderTicketsId
())
.
eq
(
"is_payment"
,
"yes"
)
);
// 请求php接口
kylinRefundHttpSubmitServiceImpl
.
httpApply
(
v
,
entitiesList
,
otherParam
,
refundBatchId
);
}
count
=
orderList
.
size
();
KylinOrderTickets
lastInfo
=
orderList
.
get
(
count
-
1
);
mid
=
lastInfo
.
getMid
();
}
while
(
count
>=
limitNum
);
}
@Async
public
void
refundBatchStatus
(
String
refundBatchId
,
HashMap
<
String
,
Object
>
otherParam
)
throws
Exception
{
// 处理查询订单状态
Integer
[]
whereStatus
=
{};
Integer
whereType
=
KylinTableStatusConst
.
ORDER_REFUND_TYPE_APPLY
;
switch
((
String
)
otherParam
.
get
(
"type"
))
{
case
"reapply"
:
whereStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
break
;
case
"cancel"
:
whereStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPLY
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
break
;
case
"review"
:
if
(
otherParam
.
get
(
"status"
)
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
)
{
// 通过申请
whereStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPLY
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
}
if
(
otherParam
.
get
(
"status"
)
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
)
{
// 驳回申请
whereStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPLY
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
};
}
break
;
case
"execute"
:
if
(
otherParam
.
get
(
"status"
)
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_UNFILLED
)
{
// 执行退款
whereStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_ERROR
};
}
if
(
otherParam
.
get
(
"status"
)
==
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
)
{
// 拒绝退款
whereStatus
=
new
Integer
[]{
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_ERROR
};
}
break
;
default
:
throw
new
Exception
(
"type异常,无法操作"
);
}
int
count
;
int
limitNum
=
1
;
int
mid
=
0
;
do
{
List
<
KylinRefunds
>
refundList
=
kylinRefundsMapper
.
getRefundList
(
whereType
,
refundBatchId
,
whereStatus
,
mid
,
limitNum
);
List
<
String
>
refundIds
=
null
;
if
(!
refundList
.
isEmpty
())
{
for
(
KylinRefunds
v
:
refundList
)
{
String
refundId
=
v
.
getRefundId
();
refundIds
.
add
(
refundId
);
}
// 请求php接口
kylinRefundHttpSubmitServiceImpl
.
httpStatus
(
refundIds
,
otherParam
);
}
count
=
refundList
.
size
();
KylinRefunds
lastInfo
=
refundList
.
get
(
count
-
1
);
mid
=
lastInfo
.
getMid
();
}
while
(
count
>=
limitNum
);
}
}
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/admin/KylinRefundHttpSubmitServiceImpl.java
deleted
100644 → 0
View file @
357cf589
package
com
.
liquidnet
.
service
.
kylin
.
service
.
impl
.
admin
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.liquidnet.commons.lang.util.HttpUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.kylin.entity.KylinOrderTicketEntities
;
import
com.liquidnet.service.kylin.entity.KylinOrderTickets
;
import
com.liquidnet.service.kylin.entity.KylinRefundBatches
;
import
com.liquidnet.service.kylin.mapper.KylinRefundBatchesMapper
;
import
com.liquidnet.service.kylin.service.IKylinRefundBatchesService
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* <p>
* 后台退款 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-05-26 13:00 下午
*/
@Service
public
class
KylinRefundHttpSubmitServiceImpl
extends
ServiceImpl
<
KylinRefundBatchesMapper
,
KylinRefundBatches
>
implements
IKylinRefundBatchesService
{
@Async
public
void
httpApply
(
KylinOrderTickets
orderInfo
,
List
<
KylinOrderTicketEntities
>
entitiesList
,
HashMap
<
String
,
Object
>
otherParam
,
String
refundBatchId
)
throws
Exception
{
String
postUrl
=
"apply"
;
// 构造退款数据
List
<
String
>
ticketEntityIds
=
null
;
if
(!
entitiesList
.
isEmpty
())
{
for
(
KylinOrderTicketEntities
v
:
entitiesList
)
{
String
orderTicketsId
=
v
.
getOrderTicketEntitiesId
();
ticketEntityIds
.
add
(
orderTicketsId
);
}
}
HashMap
<
String
,
Object
>
refundData
=
new
HashMap
();
refundData
.
put
(
"ticket_entity_ids"
,
ticketEntityIds
);
refundData
.
put
(
"matter_items"
,
new
ArrayList
());
//搭售不处理
if
(
ticketEntityIds
.
isEmpty
())
{
throw
new
Exception
(
"查询详情出错"
);
}
// 发起退款申请
MultiValueMap
<
String
,
String
>
headers
=
new
LinkedMultiValueMap
();
headers
.
add
(
"Authorization"
,
otherParam
.
get
(
"token"
).
toString
());
MultiValueMap
<
String
,
String
>
formParams
=
new
LinkedMultiValueMap
();
formParams
.
add
(
"order_type"
,
"order_ticket"
);
formParams
.
add
(
"order_id"
,
orderInfo
.
getOrderTicketsId
());
formParams
.
add
(
"batch_id"
,
refundBatchId
);
formParams
.
add
(
"reason"
,
otherParam
.
get
(
"reason"
).
toString
());
formParams
.
add
(
"refund_data"
,
JsonUtils
.
toJson
(
refundData
));
/*HashMap<String, Object> postParams = new HashMap();
postParams.put("headers", headers);
postParams.put("form_params", formParams);*/
// 请求提审接口参数
String
postResult
=
HttpUtil
.
post
(
postUrl
,
formParams
,
headers
);
JsonNode
postResultNew
=
JsonUtils
.
fromJson
(
postResult
,
JsonNode
.
class
);
// 请求提审接口结果
if
(
postResultNew
.
get
(
"message"
).
toString
()
!=
"OK"
)
{
throw
new
Exception
(
"申请退款出错"
);
}
}
@Async
public
void
httpStatus
(
List
<
String
>
refundIds
,
HashMap
<
String
,
Object
>
otherParam
)
throws
Exception
{
String
postUrl
=
"reapply"
;
// 发起退款申请
MultiValueMap
<
String
,
String
>
headers
=
new
LinkedMultiValueMap
();
headers
.
add
(
"Authorization"
,
otherParam
.
get
(
"token"
).
toString
());
MultiValueMap
<
String
,
String
>
formParams
=
new
LinkedMultiValueMap
();
formParams
.
put
(
"ids"
,
refundIds
);
String
reject
=
otherParam
.
get
(
"reject"
).
toString
();
if
(
reject
.
isEmpty
())
reject
=
""
;
String
refuse
=
otherParam
.
get
(
"refuse"
).
toString
();
if
(
refuse
.
isEmpty
())
refuse
=
""
;
String
status
=
(
String
)
otherParam
.
get
(
"status"
);
if
(
status
.
isEmpty
())
status
=
"0"
;
formParams
.
add
(
"reject"
,
reject
);
formParams
.
add
(
"status"
,
status
);
formParams
.
add
(
"refuse"
,
refuse
);
// 请求提审接口参数
String
postResult
=
HttpUtil
.
post
(
postUrl
,
formParams
,
headers
);
JsonNode
postResultNew
=
JsonUtils
.
fromJson
(
postResult
,
JsonNode
.
class
);
// 请求提审接口结果
if
(
postResultNew
.
get
(
"message"
).
toString
()
!=
"OK"
)
{
throw
new
Exception
(
"操作出错"
);
}
}
}
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/admin/KylinRefundPerformancesAdminServiceImpl.java
deleted
100644 → 0
View file @
357cf589
package
com
.
liquidnet
.
service
.
kylin
.
service
.
impl
.
admin
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
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.dto.vo.KylinPerformanceVo
;
import
com.liquidnet.service.kylin.entity.KylinRefundBatches
;
import
com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper
;
import
com.liquidnet.service.kylin.mapper.KylinRefundBatchesMapper
;
import
com.liquidnet.service.kylin.service.IKylinRefundBatchesService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
/**
* <p>
* 后台退款 服务实现类
* status 0待付款,1已付款,2已关闭,3正在退款,4已退款, 5待关闭
* pay_status 支付状态:0未支付 1已支付 2支付失败等
* </p>
*
* @author jiangxiulong
* @since 2021-05-25 11:26 上午
*/
@Service
public
class
KylinRefundPerformancesAdminServiceImpl
extends
ServiceImpl
<
KylinRefundBatchesMapper
,
KylinRefundBatches
>
implements
IKylinRefundBatchesService
{
@Autowired
private
KylinOrderTicketsMapper
kylinOrderTicketsMapper
;
@Autowired
private
KylinRefundBatchesMapper
kylinRefundBatchesMapper
;
@Autowired
private
KylinRefundExecuteServiceImpl
kylinRefundExecuteServiceImpl
;
@Autowired
RedisUtil
redisUtil
;
public
Boolean
refundBatchApply
(
String
targetId
,
Integer
targetType
,
Integer
authId
,
String
authName
,
HashMap
<
String
,
Object
>
OtherParam
)
throws
Exception
{
HashMap
<
String
,
Object
>
priceNum
=
kylinOrderTicketsMapper
.
getPriceNum
(
targetId
);
Double
totalPrice
=
(
Double
)
priceNum
.
get
(
"total_price"
);
Integer
totalNum
=
(
Integer
)
priceNum
.
get
(
"total_num"
);
if
(
totalPrice
<
0
||
totalNum
<
0
)
throw
new
Exception
(
"当前演出暂无需要退款的订单,请确认后重试!"
);
// 汇总退款
String
[]
paymentTypeAlipayArray
=
{
"APPALIPAY"
,
"WAPALIPAY"
,
"alipay"
};
double
totalRefundAlipay
=
kylinOrderTicketsMapper
.
getTotalPrice
(
targetId
,
"price_actual"
,
paymentTypeAlipayArray
);
String
[]
paymentTypeWepayArray
=
{
"APPWEPAY"
,
"APPLETWEPAY"
,
"WAPWEPAY"
,
"JSWEPAY"
,
"wepay"
};
double
totalRefundWepay
=
kylinOrderTicketsMapper
.
getTotalPrice
(
targetId
,
"price_actual"
,
paymentTypeWepayArray
);
double
totalPriceExpressAlipay
=
kylinOrderTicketsMapper
.
getTotalPrice
(
targetId
,
"price_express"
,
paymentTypeAlipayArray
);
double
totalPriceExpressWepay
=
kylinOrderTicketsMapper
.
getTotalPrice
(
targetId
,
"price_express"
,
paymentTypeWepayArray
);
KylinRefundBatches
refundBatchesInfo
=
kylinRefundBatchesMapper
.
selectOne
(
new
UpdateWrapper
<
KylinRefundBatches
>().
eq
(
"target_id"
,
targetId
).
eq
(
"target_type"
,
targetType
).
orderByDesc
(
"refund_batch_id"
)
);
if
(
refundBatchesInfo
.
getRefundBatchId
().
isEmpty
()
||
refundBatchesInfo
.
getStatus
()
==
KylinTableStatusConst
.
STATUS_CANCEL
||
refundBatchesInfo
.
getStatus
()
==
KylinTableStatusConst
.
STATUS_FINANCE_ADOPT
)
{
// 添加演出退款记录
KylinPerformanceVo
performancesInfo
=
(
KylinPerformanceVo
)
redisUtil
.
hget
(
KylinRedisConst
.
PERFORMANCES
,
targetId
);
String
refundBatchId
=
IDGenerator
.
nextSnowId
().
toString
();
KylinRefundBatches
createData
=
new
KylinRefundBatches
();
createData
.
setRefundBatchId
(
refundBatchId
);
createData
.
setTargetTitle
(
performancesInfo
.
getTitle
());
createData
.
setTotalPrice
(
BigDecimal
.
valueOf
(
totalPrice
));
createData
.
setTotalNum
(
totalNum
);
createData
.
setTotalRefundAlipay
(
BigDecimal
.
valueOf
(
totalRefundAlipay
));
createData
.
setTotalRefundWepay
(
BigDecimal
.
valueOf
(
totalRefundWepay
));
createData
.
setTotalPriceExpressAlipay
(
BigDecimal
.
valueOf
(
totalPriceExpressAlipay
));
createData
.
setTotalPriceExpressWepay
(
BigDecimal
.
valueOf
(
totalPriceExpressWepay
));
createData
.
setApplicantId
(
authId
);
createData
.
setApplicantName
(
authName
);
createData
.
setStatus
(
KylinTableStatusConst
.
STATUS_APPLY
);
createData
.
setApplicantAt
(
LocalDateTime
.
now
());
int
resNum
=
kylinRefundBatchesMapper
.
insert
(
createData
);
if
(
resNum
>
0
)
{
// 开始执行批量提交审核 分批处理退款申请
kylinRefundExecuteServiceImpl
.
refundBatchApply
(
targetId
,
refundBatchId
,
OtherParam
);
return
true
;
}
else
{
return
false
;
}
}
else
{
throw
new
Exception
(
"该演出已经提交过申请,请刷新申请列表查看"
);
}
}
public
Boolean
refundBatchReapply
(
String
refundBatchId
,
String
remark
,
HashMap
<
String
,
Object
>
otherParam
)
throws
Exception
{
Integer
[]
paymentTypeAlipayArray
=
{
KylinTableStatusConst
.
STATUS_OPERATE_REJECT
,
KylinTableStatusConst
.
STATUS_FINANCE_REJECT
};
KylinRefundBatches
refundBatchesInfo
=
kylinRefundBatchesMapper
.
selectOne
(
new
UpdateWrapper
<
KylinRefundBatches
>().
eq
(
"refund_batch_id"
,
refundBatchId
).
in
(
"status"
,
paymentTypeAlipayArray
)
);
if
(!
refundBatchesInfo
.
getRefundBatchId
().
isEmpty
())
{
// 开始执行批量提交审核 分批处理退款申请
kylinRefundExecuteServiceImpl
.
refundBatchStatus
(
refundBatchId
,
otherParam
);
KylinRefundBatches
params
=
new
KylinRefundBatches
();
params
.
setStatus
(
KylinTableStatusConst
.
STATUS_APPLY
);
params
.
setRemark
(
remark
);
kylinRefundBatchesMapper
.
update
(
params
,
new
UpdateWrapper
<
KylinRefundBatches
>().
eq
(
"refund_batch_id"
,
refundBatchId
));
return
true
;
}
else
{
throw
new
Exception
(
"当前状态下不允许此操作"
);
}
}
public
Boolean
refundBatchCancel
(
String
refundBatchId
,
HashMap
<
String
,
Object
>
otherParam
)
throws
Exception
{
Integer
[]
paymentTypeAlipayArray
=
{
KylinTableStatusConst
.
STATUS_APPLY
,
KylinTableStatusConst
.
STATUS_OPERATE_REJECT
,
KylinTableStatusConst
.
STATUS_OPERATE_ADOPT
,
KylinTableStatusConst
.
STATUS_FINANCE_REJECT
};
KylinRefundBatches
refundBatchesInfo
=
kylinRefundBatchesMapper
.
selectOne
(
new
UpdateWrapper
<
KylinRefundBatches
>().
eq
(
"refund_batch_id"
,
refundBatchId
).
in
(
"status"
,
paymentTypeAlipayArray
)
);
if
(!
refundBatchesInfo
.
getRefundBatchId
().
isEmpty
())
{
// 开始执行批量提交审核 分批处理退款申请
kylinRefundExecuteServiceImpl
.
refundBatchStatus
(
refundBatchId
,
otherParam
);
KylinRefundBatches
params
=
new
KylinRefundBatches
();
params
.
setStatus
(
KylinTableStatusConst
.
STATUS_CANCEL
);
kylinRefundBatchesMapper
.
update
(
params
,
new
UpdateWrapper
<
KylinRefundBatches
>().
eq
(
"refund_batch_id"
,
refundBatchId
));
return
true
;
}
else
{
throw
new
Exception
(
"当前状态下不允许此操作"
);
}
}
public
Boolean
refundBatchReview
(
String
refundBatchId
,
HashMap
<
String
,
Object
>
otherParam
)
throws
Exception
{
Integer
batchStatus
=
(
Integer
)
otherParam
.
get
(
"status"
);
Integer
updateStatus
=
0
;
if
(
KylinTableStatusConst
.
STATUS_OPERATE_REJECT
==
batchStatus
)
{
// 驳回
updateStatus
=
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REJECT
;
}
else
if
(
KylinTableStatusConst
.
STATUS_OPERATE_ADOPT
==
batchStatus
)
{
// 通过
updateStatus
=
KylinTableStatusConst
.
ORDER_REFUND_STATUS_APPROVED
;
}
Integer
[]
paymentTypeAlipayArray
=
{
KylinTableStatusConst
.
STATUS_APPLY
};
KylinRefundBatches
refundBatchesInfo
=
kylinRefundBatchesMapper
.
selectOne
(
new
UpdateWrapper
<
KylinRefundBatches
>().
eq
(
"refund_batch_id"
,
refundBatchId
).
in
(
"status"
,
paymentTypeAlipayArray
)
);
if
(!
refundBatchesInfo
.
getRefundBatchId
().
isEmpty
())
{
// 开始执行批量提交审核 分批处理退款申请
otherParam
.
put
(
"status"
,
updateStatus
);
kylinRefundExecuteServiceImpl
.
refundBatchStatus
(
refundBatchId
,
otherParam
);
KylinRefundBatches
params
=
new
KylinRefundBatches
();
params
.
setStatus
(
batchStatus
);
params
.
setReject
((
String
)
otherParam
.
get
(
"reject"
));
params
.
setAuditorId
(
2
);
params
.
setAuditorName
(
"2222"
);
params
.
setAuditorAt
(
LocalDateTime
.
now
());
kylinRefundBatchesMapper
.
update
(
params
,
new
UpdateWrapper
<
KylinRefundBatches
>().
eq
(
"refund_batch_id"
,
refundBatchId
));
return
true
;
}
else
{
throw
new
Exception
(
"当前状态下不允许此操作"
);
}
}
public
Boolean
refundBatchExecute
(
String
refundBatchId
,
HashMap
<
String
,
Object
>
otherParam
)
throws
Exception
{
Integer
batchStatus
=
(
Integer
)
otherParam
.
get
(
"status"
);
Integer
updateStatus
=
0
;
if
(
KylinTableStatusConst
.
STATUS_FINANCE_REJECT
==
batchStatus
)
{
// 驳回
updateStatus
=
KylinTableStatusConst
.
ORDER_REFUND_STATUS_REFUSE
;
}
else
if
(
KylinTableStatusConst
.
STATUS_FINANCE_ADOPT
==
batchStatus
)
{
// 通过
updateStatus
=
KylinTableStatusConst
.
ORDER_REFUND_STATUS_UNFILLED
;
}
Integer
[]
paymentTypeAlipayArray
=
{
KylinTableStatusConst
.
STATUS_APPLY
};
KylinRefundBatches
refundBatchesInfo
=
kylinRefundBatchesMapper
.
selectOne
(
new
UpdateWrapper
<
KylinRefundBatches
>().
eq
(
"refund_batch_id"
,
refundBatchId
).
in
(
"status"
,
paymentTypeAlipayArray
)
);
if
(!
refundBatchesInfo
.
getRefundBatchId
().
isEmpty
())
{
// 开始执行批量提交审核 分批处理退款申请
otherParam
.
put
(
"status"
,
updateStatus
);
kylinRefundExecuteServiceImpl
.
refundBatchStatus
(
refundBatchId
,
otherParam
);
KylinRefundBatches
params
=
new
KylinRefundBatches
();
params
.
setStatus
(
batchStatus
);
params
.
setRefuse
((
String
)
otherParam
.
get
(
"refuse"
));
params
.
setExecutorId
(
2
);
params
.
setExecutorName
(
"2222"
);
params
.
setExecutorAt
(
LocalDateTime
.
now
());
kylinRefundBatchesMapper
.
update
(
params
,
new
UpdateWrapper
<
KylinRefundBatches
>().
eq
(
"refund_batch_id"
,
refundBatchId
));
return
true
;
}
else
{
throw
new
Exception
(
"当前状态下不允许此操作"
);
}
}
}
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/admin/KylinRefundsServiceImpl.java
deleted
100644 → 0
View file @
357cf589
package
com
.
liquidnet
.
service
.
kylin
.
service
.
impl
.
admin
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.kylin.entity.KylinOrderTickets
;
import
com.liquidnet.service.kylin.entity.KylinRefundBatches
;
import
com.liquidnet.service.kylin.entity.KylinRefunds
;
import
com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper
;
import
com.liquidnet.service.kylin.mapper.KylinRefundsMapper
;
import
com.liquidnet.service.kylin.service.IKylinRefundsService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* <p>
* 退款表 服务实现类
* </p>
*
* @author liquidnet
* @since 2021-05-26
*/
@Service
public
class
KylinRefundsServiceImpl
extends
ServiceImpl
<
KylinRefundsMapper
,
KylinRefunds
>
implements
IKylinRefundsService
{
@Autowired
private
KylinOrderTicketsMapper
kylinOrderTicketsMapper
;
@Autowired
private
KylinRefundsStatusServiceImpl
kylinRefundsStatusServiceImpl
;
public
Boolean
refundApply
(
String
orderTicketsId
,
String
orderType
,
String
reason
,
String
remark
,
Integer
batch_id
,
String
refundData
)
throws
Exception
{
int
count
=
0
;
if
(
orderType
==
"order_ticket"
){
count
=
kylinOrderTicketsMapper
.
selectCount
(
new
UpdateWrapper
<
KylinOrderTickets
>().
eq
(
"order_tickets_id"
,
orderTicketsId
).
eq
(
"coupon_type2"
,
"full"
)
);
}
if
(
count
>
0
){
throw
new
Exception
(
"使用满减券 暂不能退款"
);
}
if
(
orderType
==
"order_ticket"
)
{
// 票务退款
JsonNode
refundDataJson
=
JsonUtils
.
fromJson
(
refundData
,
JsonNode
.
class
);
JsonNode
ticketEntityIds
=
refundDataJson
.
get
(
"ticketEntityIds"
);
int
authId
=
0
;
String
authName
=
"sss"
;
kylinRefundsStatusServiceImpl
.
orderTicketRefunding
(
authId
,
authName
,
orderTicketsId
,
ticketEntityIds
,
reason
,
remark
,
batch_id
);
}
return
true
;
}
}
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/admin/KylinRefundsStatusServiceImpl.java
deleted
100644 → 0
View file @
357cf589
package
com
.
liquidnet
.
service
.
kylin
.
service
.
impl
.
admin
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.liquidnet.service.kylin.constant.KylinTableStatusConst
;
import
com.liquidnet.service.kylin.entity.KylinOrderRefunds
;
import
com.liquidnet.service.kylin.entity.KylinOrderTicketStatus
;
import
com.liquidnet.service.kylin.entity.KylinOrderTickets
;
import
com.liquidnet.service.kylin.entity.KylinRefunds
;
import
com.liquidnet.service.kylin.mapper.KylinOrderRefundsMapper
;
import
com.liquidnet.service.kylin.mapper.KylinOrderTicketStatusMapper
;
import
com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper
;
import
com.liquidnet.service.kylin.mapper.KylinRefundsMapper
;
import
com.liquidnet.service.kylin.service.IKylinRefundsService
;
import
org.apache.http.HttpException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Arrays
;
import
java.util.HashSet
;
import
java.util.Set
;
/**
* <p>
* 退款表 服务实现类
* </p>
*
* @author jiaangxiulong
* @since 2021-05-26
*/
@Service
public
class
KylinRefundsStatusServiceImpl
extends
ServiceImpl
<
KylinRefundsMapper
,
KylinRefunds
>
implements
IKylinRefundsService
{
@Autowired
private
KylinOrderTicketsMapper
kylinOrderTicketsMapper
;
@Autowired
private
KylinOrderTicketStatusMapper
kylinOrderTicketStatusMapper
;
@Autowired
private
KylinOrderRefundsMapper
kylinOrderRefundsMapper
;
public
void
orderTicketRefunding
(
int
authId
,
String
authName
,
String
orderTicketsId
,
JsonNode
ticketEntityIds
,
String
reason
,
String
remark
,
Integer
batch_id
)
throws
HttpException
{
/*KylinOrderTickets orderInfo = kylinOrderTicketsMapper.selectOne(
new UpdateWrapper<KylinOrderTickets>().eq("order_tickets_id", orderTicketsId)
);
KylinOrderTicketStatus orderStatus = kylinOrderTicketStatusMapper.selectOne(
new UpdateWrapper<KylinOrderTicketStatus>().eq("order_id", orderTicketsId)
);
// 订单状态,已支付(其它情况)、已关闭(超时支付、已支付但出票失败等情况)
Integer[] statusArr = {KylinTableStatusConst.STATUS_PAID, KylinTableStatusConst.STATUS_CLOSE, KylinTableStatusConst.STATUS_DELETE};
Set<String> set = new HashSet(Arrays.asList(statusArr));
if (!set.contains(orderStatus.getStatus())) {
throw new HttpException("订单状态信息有误");
}
// 订单支付状态需为已支付
if (orderStatus.getPayStatus() != 1) {
throw new HttpException("订单支付信息有误");
}
// 该订单正在退款或已有退款
int refundingCount = kylinOrderRefundsMapper.selectCount(
new UpdateWrapper<KylinOrderRefunds>().eq("order_id", orderTicketsId)
.eq("order_type", "order_ticket")
.ne("status", KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL)
);
if (refundingCount > 0) {
throw new HttpException("该订单正在退款或已有退款");
}*/
// 本次退款批次
/*int maxRefundBatch = kylinOrderRefundsMapper.selectCount(
new UpdateWrapper<KylinOrderRefunds>().eq("order_id", orderTicketsId)
.setSql(max)
.ne("status", KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL)
);
$max_refund_batch = OrderRefund::onWriteConnection()->where('order_id', $order_id)->max('batch');
$batch = $max_refund_batch ? $max_refund_batch + 1 : 1;
# 本次退款总金额
$refund_total_price = 0;*/
}
}
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