Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fzm-joying
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
lei
fzm-joying
Commits
1d97e6ad
Commit
1d97e6ad
authored
Feb 15, 2022
by
tangtuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
ae45b327
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
49 additions
and
30 deletions
+49
-30
CopyrightTask.java
...n/src/main/java/com/fzm/admin/schedule/CopyrightTask.java
+3
-1
application-dev.yml
joying-admin/src/main/resources/application-dev.yml
+2
-0
application-local.yml
joying-admin/src/main/resources/application-local.yml
+2
-0
application-nj.yml
joying-admin/src/main/resources/application-nj.yml
+2
-0
AuthenticationInterceptor.java
...com/fzm/common/interceptor/AuthenticationInterceptor.java
+1
-1
NftService.java
...mmon/src/main/java/com/fzm/common/service/NftService.java
+2
-2
OrderService.java
...on/src/main/java/com/fzm/common/service/OrderService.java
+2
-1
CopyrightApplyServiceImpl.java
...om/fzm/common/service/impl/CopyrightApplyServiceImpl.java
+9
-12
NftServiceImpl.java
...main/java/com/fzm/common/service/impl/NftServiceImpl.java
+2
-3
OrderServiceImpl.java
...in/java/com/fzm/common/service/impl/OrderServiceImpl.java
+19
-6
NftController.java
...rc/main/java/com/fzm/portal/controller/NftController.java
+4
-3
NftListener.java
...al/src/main/java/com/fzm/portal/listener/NftListener.java
+1
-1
logback.2022-02-11.0.log
logs/logback.2022-02-11.0.log
+0
-0
logback.2022-02-15.0.log
logs/logback.2022-02-15.0.log
+0
-0
No files found.
joying-admin/src/main/java/com/fzm/admin/schedule/CopyrightTask.java
View file @
1d97e6ad
...
...
@@ -14,6 +14,7 @@ import com.fzm.common.entity.dto.CopyrightQueryResponse;
import
com.fzm.common.entity.dto.EvidenceHashMessage
;
import
com.fzm.common.entity.vo.NftVo
;
import
com.fzm.common.enums.CopyrightApplyState
;
import
com.fzm.common.enums.OrderStatus
;
import
com.fzm.common.enums.PayScene
;
import
com.fzm.common.enums.RefundLaunchChannel
;
import
com.fzm.common.properties.CopyrightProperties
;
...
...
@@ -127,6 +128,7 @@ public class CopyrightTask {
continue
;
}
copyrightApply
.
setRegisterState
(
registerState
);
copyrightApply
.
setUpdateDate
(
new
Date
());
if
(
registerState
.
equals
(
CopyrightApplyState
.
SUCCEEDED
.
getCode
()))
{
// 审核成功
String
nftHash
=
copyrightApply
.
getNftHash
();
...
...
@@ -149,7 +151,7 @@ public class CopyrightTask {
}
else
if
(
registerState
.
equals
(
CopyrightApplyState
.
FAILED
.
getCode
()))
{
// 审核失败,更新驳回原因,主动发起退款
copyrightApply
.
setRejectReason
(
copyrightResponse
.
getRemark
());
Order
order
=
orderService
.
getByPaySceneAndProductId
(
PayScene
.
COPYRIGHT
.
getCode
(),
copyrightApply
.
getId
());
Order
order
=
orderService
.
getByPaySceneAndProductId
(
PayScene
.
COPYRIGHT
.
getCode
(),
copyrightApply
.
getId
()
,
OrderStatus
.
PAYED
.
getStatus
()
);
if
(
order
!=
null
)
{
wxPayService
.
refund
(
order
.
getId
(),
RefundLaunchChannel
.
USER
.
getCode
());
}
...
...
joying-admin/src/main/resources/application-dev.yml
View file @
1d97e6ad
...
...
@@ -103,6 +103,8 @@ wx-pay:
api-v3-key
:
D864DA53FEF8ACD41519064967DC10D2
mch-serial-num
:
72A62544B0A08A214FAEC780108692EDC6E7D5FA
private-key-path
:
apiclient_key.pem
pay-notify-url
:
https://test.inmvo.com/proxyApi/wx-pay/notify/jsapi
refund-notify-url
:
https://test.inmvo.com/proxyApi/wx-pay/notify/refund
sms
:
app-key
:
Yiru
...
...
joying-admin/src/main/resources/application-local.yml
View file @
1d97e6ad
...
...
@@ -104,6 +104,8 @@ wx-pay:
api-v3-key
:
D864DA53FEF8ACD41519064967DC10D2
mch-serial-num
:
72A62544B0A08A214FAEC780108692EDC6E7D5FA
private-key-path
:
apiclient_key.pem
pay-notify-url
:
https://test.inmvo.com/proxyApi/wx-pay/notify/jsapi
refund-notify-url
:
https://test.inmvo.com/proxyApi/wx-pay/notify/refund
sms
:
app-key
:
Yiru
...
...
joying-admin/src/main/resources/application-nj.yml
View file @
1d97e6ad
...
...
@@ -104,6 +104,8 @@ wx-pay:
api-v3-key
:
D864DA53FEF8ACD41519064967DC10D2
mch-serial-num
:
72A62544B0A08A214FAEC780108692EDC6E7D5FA
private-key-path
:
apiclient_key.pem
pay-notify-url
:
https://test.inmvo.com/proxyApi/wx-pay/notify/jsapi
refund-notify-url
:
https://test.inmvo.com/proxyApi/wx-pay/notify/refund
sms
:
app-key
:
Yiru
...
...
joying-common/src/main/java/com/fzm/common/interceptor/AuthenticationInterceptor.java
View file @
1d97e6ad
...
...
@@ -68,7 +68,7 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
AbstractUser
user
;
String
redisToken
;
if
(
TokenConstant
.
TOKEN_APP_ID_PORTAL
.
equals
(
appId
))
{
//
门户
用户
//
h5
用户
user
=
userService
.
getById
(
userId
);
redisToken
=
redisUtil
.
get
(
RedisConstant
.
PORTAL_USER_TOKEN_PREFIX
+
userId
);
}
else
{
...
...
joying-common/src/main/java/com/fzm/common/service/NftService.java
View file @
1d97e6ad
...
...
@@ -2,7 +2,6 @@ package com.fzm.common.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.fzm.common.entity.Nft
;
import
com.fzm.common.entity.NftDto
;
import
com.fzm.common.entity.vo.CollectionNftVo
;
import
com.fzm.common.entity.vo.NftListVo
;
import
com.fzm.common.entity.vo.NftVo
;
...
...
@@ -186,8 +185,9 @@ public interface NftService extends IService<Nft> {
/**
* 获取当前用户正在发行中的nft列表
* @return
* @param status
*/
List
<
Nft
>
getPublishingList
();
List
<
Nft
>
getPublishingList
(
Integer
status
);
...
...
joying-common/src/main/java/com/fzm/common/service/OrderService.java
View file @
1d97e6ad
...
...
@@ -20,9 +20,10 @@ public interface OrderService extends IService<Order> {
*
* @param payScene
* @param productId
* @param orderStatus
* @return
*/
Order
getByPaySceneAndProductId
(
Integer
payScene
,
Integer
productId
);
Order
getByPaySceneAndProductId
(
Integer
payScene
,
Integer
productId
,
Integer
orderStatus
);
/**
* 更新订单状态
...
...
joying-common/src/main/java/com/fzm/common/service/impl/CopyrightApplyServiceImpl.java
View file @
1d97e6ad
...
...
@@ -17,10 +17,7 @@ import com.fzm.common.entity.dto.CopyrightResponse;
import
com.fzm.common.entity.vo.CopyrightApplyVo
;
import
com.fzm.common.entity.vo.CopyrightCertificateVo
;
import
com.fzm.common.entity.vo.CopyrightVo
;
import
com.fzm.common.enums.CopyrightApplyState
;
import
com.fzm.common.enums.PayScene
;
import
com.fzm.common.enums.RefundLaunchChannel
;
import
com.fzm.common.enums.ResultCode
;
import
com.fzm.common.enums.*
;
import
com.fzm.common.exception.GlobalException
;
import
com.fzm.common.mapper.CopyrightApplyMapper
;
import
com.fzm.common.properties.CopyrightProperties
;
...
...
@@ -188,7 +185,7 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper,
copyright
.
setRegisterState
(
CopyrightApplyState
.
WITHDRAW
.
getCode
());
updateById
(
copyright
);
// 用户撤回后,需要主动退款
Order
order
=
orderService
.
getByPaySceneAndProductId
(
PayScene
.
COPYRIGHT
.
getCode
(),
id
);
Order
order
=
orderService
.
getByPaySceneAndProductId
(
PayScene
.
COPYRIGHT
.
getCode
(),
id
,
OrderStatus
.
PAYED
.
getStatus
()
);
if
(
order
!=
null
)
{
wxPayService
.
refund
(
order
.
getId
(),
RefundLaunchChannel
.
USER
.
getCode
());
}
...
...
@@ -287,9 +284,9 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper,
copyrightFileService
.
saveBatch
(
files
);
}
if
(
CollectionUtil
.
isNotEmpty
(
copyrightDTO
.
getAuthors
()))
{
// 删除作者信息
// 删除
原
作者信息
copyrightAuthorService
.
delByCopyrightId
(
copyrightDTO
.
getId
());
// 保存作者信息
// 保存
修改后的
作者信息
ArrayList
<
CopyrightAuthor
>
authors
=
new
ArrayList
<>();
for
(
CopyrightDTO
.
Author
author
:
copyrightDTO
.
getAuthors
())
{
CopyrightAuthor
copyrightAuthor
=
new
CopyrightAuthor
(
author
);
...
...
@@ -299,9 +296,9 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper,
copyrightAuthorService
.
saveBatch
(
authors
);
}
if
(
CollectionUtil
.
isNotEmpty
(
copyrightDTO
.
getAuthorityIds
()))
{
// 删除权力信息
// 删除
原
权力信息
copyrightAuthorityRelationService
.
delByCopyrightId
(
copyrightDTO
.
getId
());
// 保存权力信息
// 保存
修改后的
权力信息
ArrayList
<
CopyrightAuthorityRelation
>
relations
=
new
ArrayList
<>();
for
(
Integer
authorityId
:
copyrightDTO
.
getAuthorityIds
())
{
CopyrightAuthorityRelation
relation
=
new
CopyrightAuthorityRelation
(
copyrightApply
.
getId
(),
authorityId
);
...
...
@@ -310,9 +307,9 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper,
copyrightAuthorityRelationService
.
saveBatch
(
relations
);
}
if
(
CollectionUtil
.
isNotEmpty
(
copyrightDTO
.
getOwnerIds
()))
{
// 删除著作权人信息
// 删除
原
著作权人信息
copyrightApplyOwnerRelationService
.
delByCopyrightId
(
copyrightDTO
.
getId
());
// 保存著作权人信息
// 保存
修改后的
著作权人信息
ArrayList
<
CopyrightApplyOwnerRelation
>
owners
=
new
ArrayList
<>();
for
(
Integer
ownerId
:
copyrightDTO
.
getOwnerIds
())
{
owners
.
add
(
new
CopyrightApplyOwnerRelation
(
copyrightApply
.
getId
(),
copyrightOwnerService
.
getById
(
ownerId
)));
...
...
@@ -353,7 +350,7 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper,
copyright
.
setRejectReason
(
rejectReason
);
updateById
(
copyright
);
// 管理员驳回后,需要自动发起退款
Order
order
=
orderService
.
getByPaySceneAndProductId
(
PayScene
.
COPYRIGHT
.
getCode
(),
id
);
Order
order
=
orderService
.
getByPaySceneAndProductId
(
PayScene
.
COPYRIGHT
.
getCode
(),
id
,
OrderStatus
.
PAYED
.
getStatus
()
);
if
(
order
!=
null
)
{
wxPayService
.
refund
(
order
.
getId
(),
RefundLaunchChannel
.
USER
.
getCode
());
}
...
...
joying-common/src/main/java/com/fzm/common/service/impl/NftServiceImpl.java
View file @
1d97e6ad
...
...
@@ -35,7 +35,6 @@ import com.github.pagehelper.PageHelper;
import
com.github.pagehelper.PageInfo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.redisson.Redisson
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.dao.DuplicateKeyException
;
...
...
@@ -260,12 +259,12 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
}
@Override
public
List
<
Nft
>
getPublishingList
()
{
public
List
<
Nft
>
getPublishingList
(
Integer
status
)
{
String
token
=
request
.
getHeader
(
"Authorization"
);
Integer
userId
=
JwtUtil
.
getUserIdFromToken
(
token
);
QueryWrapper
<
Nft
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"user_id"
,
userId
).
eq
(
"publish_status"
,
PublishStatus
.
PUBLISHING
.
getCode
()
).
eq
(
"publish_status"
,
status
).
orderByDesc
(
"publish_time"
);
return
this
.
list
(
queryWrapper
);
}
...
...
joying-common/src/main/java/com/fzm/common/service/impl/OrderServiceImpl.java
View file @
1d97e6ad
...
...
@@ -2,6 +2,7 @@ package com.fzm.common.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.fzm.common.entity.Charge
;
import
com.fzm.common.entity.Order
;
import
com.fzm.common.entity.dto.OrderDto
;
import
com.fzm.common.entity.dto.OrderProcessMsg
;
...
...
@@ -9,10 +10,7 @@ import com.fzm.common.entity.vo.OrderVo;
import
com.fzm.common.enums.*
;
import
com.fzm.common.exception.GlobalException
;
import
com.fzm.common.mapper.OrderMapper
;
import
com.fzm.common.service.CopyrightApplyService
;
import
com.fzm.common.service.NftService
;
import
com.fzm.common.service.OrderService
;
import
com.fzm.common.service.WxPayService
;
import
com.fzm.common.service.*
;
import
com.fzm.common.utils.JwtUtil
;
import
com.fzm.common.utils.SnowflakeUtil
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
...
...
@@ -56,12 +54,15 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
@Resource
private
WxPayService
wxPayService
;
@Resource
private
ChargeService
chargeService
;
@Override
public
Order
getByPaySceneAndProductId
(
Integer
payScene
,
Integer
productId
)
{
public
Order
getByPaySceneAndProductId
(
Integer
payScene
,
Integer
productId
,
Integer
orderStatus
)
{
QueryWrapper
<
Order
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"pay_scene"
,
payScene
)
.
eq
(
"product_id"
,
productId
)
.
eq
(
"order_status"
,
OrderStatus
.
PAYED
.
getStatus
()
);
.
eq
(
"order_status"
,
orderStatus
);
return
this
.
getOne
(
queryWrapper
);
}
...
...
@@ -75,6 +76,18 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
@Override
public
Order
createOrder
(
OrderDto
orderDto
)
{
Charge
charge
=
chargeService
.
getByType
(
orderDto
.
getPayScene
());
if
(!
orderDto
.
getFee
().
equals
(
charge
.
getFee
()))
{
throw
GlobalException
.
newException
(
ResultCode
.
FAILED
,
"订单创建失败, 金额有误"
);
}
Order
successOrder
=
this
.
getByPaySceneAndProductId
(
orderDto
.
getPayScene
(),
orderDto
.
getProductId
(),
OrderStatus
.
PAYED
.
getStatus
());
if
(
successOrder
!=
null
)
{
throw
GlobalException
.
newException
(
ResultCode
.
FAILED
,
"当前产品已支付成功,请勿重复创建订单"
);
}
Order
payingOrder
=
this
.
getByPaySceneAndProductId
(
orderDto
.
getPayScene
(),
orderDto
.
getProductId
(),
OrderStatus
.
PAYING
.
getStatus
());
if
(
payingOrder
!=
null
)
{
throw
GlobalException
.
newException
(
ResultCode
.
FAILED
,
"当前产品有一笔待支付订单,请勿重复创建"
);
}
Order
order
=
new
Order
();
long
id
=
snowflakeUtil
.
snowflakeId
();
Integer
productId
=
orderDto
.
getProductId
();
...
...
joying-portal/src/main/java/com/fzm/portal/controller/NftController.java
View file @
1d97e6ad
...
...
@@ -195,9 +195,10 @@ public class NftController {
return
ResponseModel
.
success
(
nftService
.
getById
(
id
));
}
@Authentication
@GetMapping
(
"/publishing-list"
)
@ApiOperation
(
value
=
"
获取当前用户正在发行中
的nft列表"
)
public
ResponseModel
<
List
<
Nft
>>
getPublishingList
(
)
{
return
ResponseModel
.
success
(
nftService
.
getPublishingList
());
@ApiOperation
(
value
=
"
根据状态获取用户
的nft列表"
)
public
ResponseModel
<
List
<
Nft
>>
listByStatus
(
@RequestParam
Integer
status
)
{
return
ResponseModel
.
success
(
nftService
.
getPublishingList
(
status
));
}
}
joying-portal/src/main/java/com/fzm/portal/listener/NftListener.java
View file @
1d97e6ad
...
...
@@ -86,7 +86,7 @@ public class NftListener {
// nft发行失败,需要把nft的发行状态改成failed,然后主动发起退款
nft
.
setPublishStatus
(
PublishStatus
.
FAILED
.
getCode
());
nftService
.
updateById
(
nft
);
Order
order
=
orderService
.
getByPaySceneAndProductId
(
PayScene
.
NFT
.
getCode
(),
nft
.
getId
());
Order
order
=
orderService
.
getByPaySceneAndProductId
(
PayScene
.
NFT
.
getCode
(),
nft
.
getId
()
,
OrderStatus
.
PAYED
.
getStatus
()
);
if
(
order
!=
null
)
{
wxPayService
.
refund
(
order
.
getId
(),
RefundLaunchChannel
.
USER
.
getCode
());
}
...
...
logs/logback.2022-02-11.0.log
0 → 100644
View file @
1d97e6ad
This source diff could not be displayed because it is too large. You can
view the blob
instead.
logs/logback.2022-02-15.0.log
0 → 100644
View file @
1d97e6ad
This diff is collapsed.
Click to expand it.
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