Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
baa-pay-server
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
贺超
baa-pay-server
Commits
0d9cd283
Commit
0d9cd283
authored
Sep 17, 2021
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建项目
parent
cc4eca1e
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
472 additions
and
65 deletions
+472
-65
hibernate.cfg.xml
baa-pay-core/hibernate.cfg.xml
+1
-0
WeiXinMerchantAcquirer.java
...quant/baa/pay/acquirer/weixin/WeiXinMerchantAcquirer.java
+1
-0
LocalCacheConfiguration.java
...java/cn/quant/baa/pay/config/LocalCacheConfiguration.java
+30
-13
AccountEntity.java
.../main/java/cn/quant/baa/pay/jpa/entity/AccountEntity.java
+2
-2
AccountIds.java
...src/main/java/cn/quant/baa/pay/jpa/entity/AccountIds.java
+1
-1
CustomerEntity.java
...main/java/cn/quant/baa/pay/jpa/entity/CustomerEntity.java
+1
-1
DictionaryEntity.java
...in/java/cn/quant/baa/pay/jpa/entity/DictionaryEntity.java
+2
-2
DictionaryIds.java
.../main/java/cn/quant/baa/pay/jpa/entity/DictionaryIds.java
+1
-1
MchChannelEntity.java
...in/java/cn/quant/baa/pay/jpa/entity/MchChannelEntity.java
+1
-1
PayAccountEntity.java
...in/java/cn/quant/baa/pay/jpa/entity/PayAccountEntity.java
+2
-2
PayAccountIds.java
.../main/java/cn/quant/baa/pay/jpa/entity/PayAccountIds.java
+1
-1
PayAppEntity.java
...c/main/java/cn/quant/baa/pay/jpa/entity/PayAppEntity.java
+1
-1
PayFeatureEntity.java
...in/java/cn/quant/baa/pay/jpa/entity/PayFeatureEntity.java
+2
-2
PayFeatureIds.java
.../main/java/cn/quant/baa/pay/jpa/entity/PayFeatureIds.java
+1
-1
PayGoodsDetailEntity.java
...ava/cn/quant/baa/pay/jpa/entity/PayGoodsDetailEntity.java
+1
-1
PayHistoryEntity.java
...in/java/cn/quant/baa/pay/jpa/entity/PayHistoryEntity.java
+2
-2
PayHistoryIds.java
.../main/java/cn/quant/baa/pay/jpa/entity/PayHistoryIds.java
+1
-1
StatusCodeEntity.java
...in/java/cn/quant/baa/pay/jpa/entity/StatusCodeEntity.java
+145
-0
StatusCodeIds.java
.../main/java/cn/quant/baa/pay/jpa/entity/StatusCodeIds.java
+83
-0
StatusCodeRepository.java
...cn/quant/baa/pay/jpa/repository/StatusCodeRepository.java
+16
-0
StatusCodeDTO.java
...e/src/main/java/cn/quant/baa/pay/model/StatusCodeDTO.java
+127
-0
CheckRefundRequestData.java
...va/cn/quant/baa/pay/model/web/CheckRefundRequestData.java
+3
-1
MerchantChannelRequestData.java
...n/quant/baa/pay/model/web/MerchantChannelRequestData.java
+6
-3
MerchantStorageService.java
...java/cn/quant/baa/pay/service/MerchantStorageService.java
+14
-14
ModelBuilder.java
.../src/main/java/cn/quant/baa/pay/service/ModelBuilder.java
+2
-1
pom.xml
baa-pay-notice/pom.xml
+1
-0
MerchantController.java
...c/main/java/cn/quant/baa/pay/rest/MerchantController.java
+6
-7
PayTestController.java
...rc/main/java/cn/quant/baa/pay/rest/PayTestController.java
+9
-0
TransactionService.java
...ain/java/cn/quant/baa/pay/service/TransactionService.java
+2
-4
application-dev.properties
...rver/src/main/resources/config/application-dev.properties
+7
-3
No files found.
baa-pay-core/hibernate.cfg.xml
View file @
0d9cd283
...
...
@@ -30,6 +30,7 @@
<mapping
class=
"cn.quant.baa.pay.jpa.entity.AccountEntity"
/>
<mapping
class=
"cn.quant.baa.pay.jpa.entity.PayHistoryEntity"
/>
<mapping
class=
"cn.quant.baa.pay.jpa.entity.PayGoodsDetailEntity"
/>
<mapping
class=
"cn.quant.baa.pay.jpa.entity.StatusCodeEntity"
/>
<!-- Drop and re-create the database schema on startup -->
<!--
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/acquirer/weixin/WeiXinMerchantAcquirer.java
View file @
0d9cd283
...
...
@@ -4,6 +4,7 @@ import cn.quant.baa.pay.acquirer.AcquirerProperties;
import
cn.quant.baa.pay.acquirer.MerchantAcquirer
;
import
cn.quant.baa.pay.jpa.entity.PayHistoryEntity
;
import
cn.quant.baa.pay.model.web.*
;
import
cn.quant.spring.util.StringUtils
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/config/LocalCacheConfiguration.java
View file @
0d9cd283
...
...
@@ -10,8 +10,6 @@ import org.springframework.context.annotation.Configuration;
import
java.util.concurrent.TimeUnit
;
import
static
cn
.
quant
.
baa
.
pay
.
Constant
.
NAMESPACE_LOCAL_CACHE_TRANSACTION
;
/**
* Created by Administrator on 2021/8/23 0023.
*/
...
...
@@ -19,23 +17,42 @@ import static cn.quant.baa.pay.Constant.NAMESPACE_LOCAL_CACHE_TRANSACTION;
@EnableCaching
public
class
LocalCacheConfiguration
{
@Value
(
"${quant.baapay.local-cache-expire.time}"
)
private
Integer
expireTime
;
public
final
static
String
LOCAL_CACHE_ACQUIRER
=
"LOCAL_CACHE_ACQUIRER"
;
public
final
static
String
LOCAL_CACHE_PROFILE
=
"LOCAL_CACHE_PROFILE"
;
public
final
static
String
LOCAL_CACHE_MANAGER
=
"localCacheManager"
;
@Value
(
"${quant.baapay.acquirer.local-cache-expire.time}"
)
private
Integer
acquirerExpireTime
;
@Value
(
"${quant.baapay.acquirer.local-cache-expire.unit}"
)
private
TimeUnit
acquirerExpireUnit
;
@Value
(
"${quant.baapay.acquirer.local-cache-expire.size}"
)
private
Integer
acquirerExpireSize
;
@Value
(
"${quant.baapay.
local-cache-expire.unit
}"
)
private
TimeUnit
expireUnit
;
@Value
(
"${quant.baapay.
profile.local-cache-expire.time
}"
)
private
Integer
profileExpireTime
;
@Value
(
"${quant.baapay.
local-cache-expire.size
}"
)
private
Integer
expireSize
;
@Value
(
"${quant.baapay.
profile.local-cache-expire.unit
}"
)
private
TimeUnit
profileExpireUnit
;
@Bean
public
CacheManager
profileCacheManager
()
{
@Value
(
"${quant.baapay.profile.local-cache-expire.size}"
)
private
Integer
profileExpireSize
;
@Bean
(
value
=
LOCAL_CACHE_MANAGER
)
public
CacheManager
localCacheManager
()
{
//TODO:reload cached data
CaffeineCacheManager
cacheManager
=
new
CaffeineCacheManager
();
cacheManager
.
registerCustomCache
(
"LOCAL_PROFILE"
,
cacheManager
.
registerCustomCache
(
LOCAL_CACHE_ACQUIRER
,
Caffeine
.
newBuilder
()
.
expireAfterWrite
(
acquirerExpireTime
,
acquirerExpireUnit
)
.
maximumSize
(
acquirerExpireSize
==
null
?
500
:
acquirerExpireSize
)
.
build
());
cacheManager
.
registerCustomCache
(
LOCAL_CACHE_PROFILE
,
Caffeine
.
newBuilder
()
.
expireAfterWrite
(
expireTime
,
e
xpireUnit
)
.
maximumSize
(
expireSize
==
null
?
500
:
e
xpireSize
)
.
expireAfterWrite
(
profileExpireTime
,
profileE
xpireUnit
)
.
maximumSize
(
profileExpireSize
==
null
?
500
:
profileE
xpireSize
)
.
build
());
return
cacheManager
;
}
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/AccountEntity.java
View file @
0d9cd283
...
...
@@ -268,8 +268,8 @@ public class AccountEntity extends DescribablePartitionEntity implements Seriali
}
@Override
public
String
persistence
Key
()
{
return
ids
.
persistence
Key
();
public
String
getPersistent
Key
()
{
return
ids
.
getPersistent
Key
();
}
@Override
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/AccountIds.java
View file @
0d9cd283
...
...
@@ -40,7 +40,7 @@ public class AccountIds extends EntityPrimaryIds implements Serializable {
}
@Override
public
String
persistence
Key
()
{
public
String
getPersistent
Key
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
institutionId
,
accountRefNo
);
}
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/CustomerEntity.java
View file @
0d9cd283
...
...
@@ -88,7 +88,7 @@ public class CustomerEntity extends DescribablePartitionEntity implements Serial
}
@Override
public
String
persistence
Key
()
{
public
String
getPersistent
Key
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
customerId
);
}
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/DictionaryEntity.java
View file @
0d9cd283
...
...
@@ -51,8 +51,8 @@ public class DictionaryEntity extends OptimisticEntity implements Serializable {
}
@Override
public
String
persistence
Key
()
{
return
ids
.
persistence
Key
();
public
String
getPersistent
Key
()
{
return
ids
.
getPersistent
Key
();
}
@Override
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/DictionaryIds.java
View file @
0d9cd283
...
...
@@ -44,7 +44,7 @@ public class DictionaryIds extends EntityPrimaryIds implements Serializable {
}
@Override
public
String
persistence
Key
()
{
public
String
getPersistent
Key
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
type
,
code
);
}
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/MchChannelEntity.java
View file @
0d9cd283
...
...
@@ -75,7 +75,7 @@ public class MchChannelEntity extends DescriptionEntity implements Serializable
}
@Override
public
String
persistence
Key
()
{
public
String
getPersistent
Key
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
id
);
}
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/PayAccountEntity.java
View file @
0d9cd283
...
...
@@ -161,8 +161,8 @@ public class PayAccountEntity extends OptimisticEntity implements Serializable {
}
@Override
public
String
persistence
Key
()
{
return
ids
.
persistence
Key
();
public
String
getPersistent
Key
()
{
return
ids
.
getPersistent
Key
();
}
@Override
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/PayAccountIds.java
View file @
0d9cd283
...
...
@@ -41,7 +41,7 @@ public class PayAccountIds extends EntityPrimaryIds implements Serializable {
}
@Override
public
String
persistence
Key
()
{
public
String
getPersistent
Key
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
payChanCode
,
payAcctId
);
}
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/PayAppEntity.java
View file @
0d9cd283
...
...
@@ -115,7 +115,7 @@ public class PayAppEntity extends OptimisticEntity implements Serializable {
}
@Override
public
String
persistence
Key
()
{
public
String
getPersistent
Key
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
payAppId
);
}
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/PayFeatureEntity.java
View file @
0d9cd283
...
...
@@ -106,8 +106,8 @@ public class PayFeatureEntity extends DescriptionEntity implements Serializable
}
@Override
public
String
persistence
Key
()
{
return
ids
.
persistence
Key
();
public
String
getPersistent
Key
()
{
return
ids
.
getPersistent
Key
();
}
@Override
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/PayFeatureIds.java
View file @
0d9cd283
...
...
@@ -46,7 +46,7 @@ public class PayFeatureIds extends EntityPrimaryIds implements Serializable {
}
@Override
public
String
persistence
Key
()
{
public
String
getPersistent
Key
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
payChanCode
,
accessCode
);
}
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/PayGoodsDetailEntity.java
View file @
0d9cd283
...
...
@@ -122,7 +122,7 @@ public class PayGoodsDetailEntity extends PartitionEntity implements Serializabl
}
@Override
public
String
persistence
Key
()
{
public
String
getPersistent
Key
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
goodsId
);
}
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/PayHistoryEntity.java
View file @
0d9cd283
...
...
@@ -404,8 +404,8 @@ public class PayHistoryEntity extends DescribablePartitionEntity implements Seri
}
@Override
public
String
persistence
Key
()
{
return
ids
.
persistence
Key
();
public
String
getPersistent
Key
()
{
return
ids
.
getPersistent
Key
();
}
@Override
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/PayHistoryIds.java
View file @
0d9cd283
...
...
@@ -50,7 +50,7 @@ public class PayHistoryIds extends EntityPrimaryIds implements Serializable {
}
@Override
public
String
persistence
Key
()
{
public
String
getPersistent
Key
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
institutionId
,
productId
,
externalOrderNo
);
}
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/StatusCodeEntity.java
0 → 100644
View file @
0d9cd283
package
cn
.
quant
.
baa
.
pay
.
jpa
.
entity
;
import
cn.quant.spring.data.jpa.entity.DescriptionEntity
;
import
org.hibernate.annotations.Type
;
import
javax.persistence.*
;
import
java.util.Objects
;
/**
* Created by Administrator on 2021/9/13 0013.
*/
@Entity
@Table
(
name
=
"status_code"
)
public
class
StatusCodeEntity
extends
DescriptionEntity
{
@EmbeddedId
private
StatusCodeIds
ids
;
@Column
(
name
=
"PRIORITY"
,
nullable
=
false
)
private
Integer
priority
;
@Column
(
name
=
"CODE_TYPE"
,
nullable
=
false
,
length
=
4
)
private
String
codeType
;
@Column
(
name
=
"POSTING_CODE"
,
nullable
=
false
,
length
=
4
)
private
String
postingCode
;
@Type
(
type
=
"yes_no"
)
@Column
(
name
=
"SEND_NOTICE_FLAG"
,
nullable
=
false
,
length
=
1
)
private
Boolean
sendNoticeFlag
;
@Column
(
name
=
"REGR_CODE"
,
nullable
=
true
,
length
=
4
)
private
String
regrCode
;
@Column
(
name
=
"FAILED_CODE"
,
nullable
=
false
,
length
=
4
)
private
String
failedCode
;
@Column
(
name
=
"NEXT_CODE"
,
nullable
=
true
,
length
=
4
)
private
String
nextCode
;
@Column
(
name
=
"MESSAGE_CODE"
,
nullable
=
true
,
length
=
4
)
private
String
messageCode
;
public
StatusCodeIds
getIds
()
{
return
ids
;
}
public
void
setIds
(
StatusCodeIds
ids
)
{
this
.
ids
=
ids
;
}
public
Integer
getPriority
()
{
return
priority
;
}
public
void
setPriority
(
Integer
priority
)
{
this
.
priority
=
priority
;
}
public
String
getCodeType
()
{
return
codeType
;
}
public
void
setCodeType
(
String
codeType
)
{
this
.
codeType
=
codeType
;
}
public
String
getPostingCode
()
{
return
postingCode
;
}
public
void
setPostingCode
(
String
postingCode
)
{
this
.
postingCode
=
postingCode
;
}
public
Boolean
getSendNoticeFlag
()
{
return
sendNoticeFlag
;
}
public
void
setSendNoticeFlag
(
Boolean
sendNoticeFlag
)
{
this
.
sendNoticeFlag
=
sendNoticeFlag
;
}
public
String
getRegrCode
()
{
return
regrCode
;
}
public
void
setRegrCode
(
String
regrCode
)
{
this
.
regrCode
=
regrCode
;
}
public
String
getFailedCode
()
{
return
failedCode
;
}
public
void
setFailedCode
(
String
failedCode
)
{
this
.
failedCode
=
failedCode
;
}
public
String
getNextCode
()
{
return
nextCode
;
}
public
void
setNextCode
(
String
nextCode
)
{
this
.
nextCode
=
nextCode
;
}
public
String
getMessageCode
()
{
return
messageCode
;
}
public
void
setMessageCode
(
String
messageCode
)
{
this
.
messageCode
=
messageCode
;
}
@Override
public
String
getPersistentKey
()
{
return
ids
.
getPersistentKey
();
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
StatusCodeEntity
that
=
(
StatusCodeEntity
)
o
;
return
Objects
.
equals
(
ids
,
that
.
ids
);
}
@Override
public
String
toString
()
{
final
StringBuilder
sb
=
new
StringBuilder
(
"StatusCodeEntity{"
);
sb
.
append
(
"ids="
).
append
(
ids
);
sb
.
append
(
", priority="
).
append
(
priority
);
sb
.
append
(
", codeType='"
).
append
(
codeType
).
append
(
'\''
);
sb
.
append
(
", postingCode='"
).
append
(
postingCode
).
append
(
'\''
);
sb
.
append
(
", sendNoticeFlag="
).
append
(
sendNoticeFlag
);
sb
.
append
(
", regrCode='"
).
append
(
regrCode
).
append
(
'\''
);
sb
.
append
(
", failedCode='"
).
append
(
failedCode
).
append
(
'\''
);
sb
.
append
(
", nextCode='"
).
append
(
nextCode
).
append
(
'\''
);
sb
.
append
(
", messageCode='"
).
append
(
messageCode
).
append
(
'\''
);
sb
.
append
(
','
).
append
(
super
.
toString
());
sb
.
append
(
'}'
);
return
sb
.
toString
();
}
}
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/entity/StatusCodeIds.java
0 → 100644
View file @
0d9cd283
package
cn
.
quant
.
baa
.
pay
.
jpa
.
entity
;
import
cn.quant.spring.data.jpa.entity.EntityPrimaryIds
;
import
cn.quant.spring.util.StringUtils
;
import
javax.persistence.Column
;
import
javax.persistence.Embeddable
;
import
java.io.Serializable
;
import
java.util.Objects
;
/**
* Created by Administrator on 2021/9/13 0013.
*/
@Embeddable
public
class
StatusCodeIds
extends
EntityPrimaryIds
implements
Serializable
{
public
final
static
String
CLASS_NAME
=
StatusCodeEntity
.
class
.
getSimpleName
();
private
static
final
long
serialVersionUID
=
6497603433019425612L
;
@Column
(
name
=
"INSTITUTION_ID"
,
nullable
=
false
,
updatable
=
false
,
length
=
4
)
private
String
institutionId
;
@Column
(
name
=
"ENTITY"
,
nullable
=
false
,
updatable
=
false
,
length
=
4
)
private
String
entity
;
@Column
(
name
=
"CODE"
,
nullable
=
false
,
updatable
=
false
,
length
=
4
)
private
String
code
;
public
String
getInstitutionId
()
{
return
institutionId
;
}
public
void
setInstitutionId
(
String
institutionId
)
{
this
.
institutionId
=
institutionId
;
}
public
String
getEntity
()
{
return
entity
;
}
public
void
setEntity
(
String
entity
)
{
this
.
entity
=
entity
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
@Override
public
String
getPersistentKey
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
institutionId
,
entity
,
code
);
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
StatusCodeIds
that
=
(
StatusCodeIds
)
o
;
return
Objects
.
equals
(
institutionId
,
that
.
institutionId
)
&&
Objects
.
equals
(
entity
,
that
.
entity
)
&&
Objects
.
equals
(
code
,
that
.
code
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
CLASS_NAME
,
institutionId
,
entity
,
code
);
}
@Override
public
String
toString
()
{
final
StringBuilder
sb
=
new
StringBuilder
(
"StatusCodeIds{"
);
sb
.
append
(
"institutionId='"
).
append
(
institutionId
).
append
(
'\''
);
sb
.
append
(
", entity='"
).
append
(
entity
).
append
(
'\''
);
sb
.
append
(
", code='"
).
append
(
code
).
append
(
'\''
);
sb
.
append
(
','
).
append
(
super
.
toString
());
sb
.
append
(
'}'
);
return
sb
.
toString
();
}
}
baa-pay-core/src/main/java/cn/quant/baa/pay/jpa/repository/StatusCodeRepository.java
0 → 100644
View file @
0d9cd283
package
cn
.
quant
.
baa
.
pay
.
jpa
.
repository
;
import
cn.quant.baa.pay.jpa.entity.AccountEntity
;
import
cn.quant.baa.pay.jpa.entity.AccountIds
;
import
cn.quant.baa.pay.jpa.entity.StatusCodeEntity
;
import
cn.quant.baa.pay.jpa.entity.StatusCodeIds
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
/**
* Created by Administrator on 2021/8/22 0022.
*/
@Repository
public
interface
StatusCodeRepository
extends
JpaRepository
<
StatusCodeEntity
,
StatusCodeIds
>
{
}
baa-pay-core/src/main/java/cn/quant/baa/pay/model/StatusCodeDTO.java
0 → 100644
View file @
0d9cd283
package
cn
.
quant
.
baa
.
pay
.
model
;
import
java.io.Serializable
;
/**
* Created by Administrator on 2021/9/13 0013.
*/
public
class
StatusCodeDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
952357481570545998L
;
private
String
institutionId
;
private
String
entity
;
private
String
code
;
private
Integer
priority
;
private
String
codeType
;
private
String
postingCode
;
private
Boolean
sendNoticeFlag
;
private
String
regrCode
;
private
String
failedCode
;
private
String
nextCode
;
private
String
messageCode
;
public
String
getInstitutionId
()
{
return
institutionId
;
}
public
void
setInstitutionId
(
String
institutionId
)
{
this
.
institutionId
=
institutionId
;
}
public
String
getEntity
()
{
return
entity
;
}
public
void
setEntity
(
String
entity
)
{
this
.
entity
=
entity
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
Integer
getPriority
()
{
return
priority
;
}
public
void
setPriority
(
Integer
priority
)
{
this
.
priority
=
priority
;
}
public
String
getCodeType
()
{
return
codeType
;
}
public
void
setCodeType
(
String
codeType
)
{
this
.
codeType
=
codeType
;
}
public
String
getPostingCode
()
{
return
postingCode
;
}
public
void
setPostingCode
(
String
postingCode
)
{
this
.
postingCode
=
postingCode
;
}
public
Boolean
getSendNoticeFlag
()
{
return
sendNoticeFlag
;
}
public
void
setSendNoticeFlag
(
Boolean
sendNoticeFlag
)
{
this
.
sendNoticeFlag
=
sendNoticeFlag
;
}
public
String
getRegrCode
()
{
return
regrCode
;
}
public
void
setRegrCode
(
String
regrCode
)
{
this
.
regrCode
=
regrCode
;
}
public
String
getFailedCode
()
{
return
failedCode
;
}
public
void
setFailedCode
(
String
failedCode
)
{
this
.
failedCode
=
failedCode
;
}
public
String
getNextCode
()
{
return
nextCode
;
}
public
void
setNextCode
(
String
nextCode
)
{
this
.
nextCode
=
nextCode
;
}
public
String
getMessageCode
()
{
return
messageCode
;
}
public
void
setMessageCode
(
String
messageCode
)
{
this
.
messageCode
=
messageCode
;
}
@Override
public
String
toString
()
{
final
StringBuilder
sb
=
new
StringBuilder
(
"StatusCodeDTO{"
);
sb
.
append
(
"institutionId='"
).
append
(
institutionId
).
append
(
'\''
);
sb
.
append
(
", entity='"
).
append
(
entity
).
append
(
'\''
);
sb
.
append
(
", code='"
).
append
(
code
).
append
(
'\''
);
sb
.
append
(
", priority="
).
append
(
priority
);
sb
.
append
(
", codeType='"
).
append
(
codeType
).
append
(
'\''
);
sb
.
append
(
", postingCode='"
).
append
(
postingCode
).
append
(
'\''
);
sb
.
append
(
", sendNoticeFlag="
).
append
(
sendNoticeFlag
);
sb
.
append
(
", regrCode='"
).
append
(
regrCode
).
append
(
'\''
);
sb
.
append
(
", failedCode='"
).
append
(
failedCode
).
append
(
'\''
);
sb
.
append
(
", nextCode='"
).
append
(
nextCode
).
append
(
'\''
);
sb
.
append
(
", messageCode='"
).
append
(
messageCode
).
append
(
'\''
);
sb
.
append
(
'}'
);
return
sb
.
toString
();
}
}
baa-pay-core/src/main/java/cn/quant/baa/pay/model/web/CheckRefundRequestData.java
View file @
0d9cd283
package
cn
.
quant
.
baa
.
pay
.
model
.
web
;
import
cn.quant.baa.pay.model.BusinessRequest
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
java.io.Serializable
;
...
...
@@ -11,7 +13,7 @@ import java.io.Serializable;
* Time: 上午11:05
* Description: No Description
*/
public
class
CheckRefundRequestData
implements
Serializable
{
public
class
CheckRefundRequestData
extends
BusinessRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
4652001398076281697L
;
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/model/web/MerchantChannelRequestData.java
View file @
0d9cd283
package
cn
.
quant
.
baa
.
pay
.
model
.
web
;
import
cn.quant.spring.data.jpa.repository.PersistentKey
;
import
cn.quant.spring.util.StringUtils
;
import
java.io.Serializable
;
/**
* Created by Administrator on 2021/8/23 0023.
*/
public
class
MerchantChannelRequestData
implements
Serializable
{
public
class
MerchantChannelRequestData
implements
PersistentKey
,
Serializable
{
private
static
final
long
serialVersionUID
=
5193795607930304626L
;
private
String
chanId
;
...
...
@@ -48,8 +51,8 @@ public class MerchantChannelRequestData implements Serializable {
this
.
access
=
access
;
}
public
String
persistence
Key
()
{
return
mchId
+
"$"
+
(
channel
==
null
||
channel
.
trim
().
length
()
==
0
?
"*"
:
channel
);
public
String
getPersistent
Key
()
{
return
StringUtils
.
toDelimitedString
(
mchId
,
channel
,
access
);
}
@Override
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/service/MerchantService.java
→
baa-pay-core/src/main/java/cn/quant/baa/pay/service/MerchantS
torageS
ervice.java
View file @
0d9cd283
package
cn
.
quant
.
baa
.
pay
.
service
;
import
cn.quant.baa.pay.acquirer.AcquirerConfiguration
;
import
cn.quant.baa.pay.acquirer.AcquirerProperties
;
import
cn.quant.baa.pay.config.LocalCacheConfiguration
;
import
cn.quant.baa.pay.model.web.MerchantAcquirerProperties
;
import
cn.quant.baa.pay.model.web.MerchantChannelResponseData
;
import
cn.quant.baa.pay.model.web.MerchantChannelRequestData
;
import
cn.quant.baa.pay.acquirer.AcquirerConfiguration
;
import
cn.quant.baa.pay.model.ModelBuilder
;
import
cn.quant.baa.pay.model.web.MerchantChannelResponseData
;
import
cn.quant.spring.util.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.stereotype.Service
;
...
...
@@ -18,17 +19,20 @@ import java.util.Map;
* Created by Administrator on 2021/8/23 0023.
*/
@Service
public
class
MerchantService
{
public
class
MerchantS
torageS
ervice
{
@Autowired
private
AcquirerConfiguration
acquirerConfiguration
;
@Autowired
private
ModelBuilder
modelBuilder
;
@Autowired
private
CacheManager
cacheManager
;
// @Cacheable(cacheManager = "profileCacheManager"
// , cacheNames = "LOCAL_PROFILE"
// , key = "#requestData.persistence
Key()")
@Cacheable
(
cacheManager
=
LocalCacheConfiguration
.
LOCAL_CACHE_MANAGER
,
cacheNames
=
LocalCacheConfiguration
.
LOCAL_CACHE_ACQUIRER
,
key
=
"'MerchantChannel$'+#requestData.getPersistent
Key()"
)
public
Map
<
String
,
MerchantChannelResponseData
>
getChannels
(
MerchantChannelRequestData
requestData
)
{
String
mchId
=
requestData
.
getMchId
();
String
channel
=
requestData
.
getChannel
();
...
...
@@ -44,13 +48,9 @@ public class MerchantService {
return
response
;
}
public
MerchantAcquirerProperties
getChannel
(
MerchantChannelRequestData
requestData
)
{
return
getChannel
(
Long
.
parseLong
(
requestData
.
getChanId
()));
}
@Cacheable
(
cacheManager
=
"profileCacheManager"
,
cacheNames
=
"LOCAL_PROFILE"
,
key
=
"#id"
)
@Cacheable
(
cacheManager
=
LocalCacheConfiguration
.
LOCAL_CACHE_MANAGER
,
cacheNames
=
LocalCacheConfiguration
.
LOCAL_CACHE_ACQUIRER
,
key
=
"'MerchantChannel$'+#id"
)
public
MerchantAcquirerProperties
getChannel
(
Long
id
)
{
AcquirerProperties
profile
=
acquirerConfiguration
.
get
(
id
);
return
modelBuilder
.
toModel
(
profile
);
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/
model
/ModelBuilder.java
→
baa-pay-core/src/main/java/cn/quant/baa/pay/
service
/ModelBuilder.java
View file @
0d9cd283
package
cn
.
quant
.
baa
.
pay
.
model
;
package
cn
.
quant
.
baa
.
pay
.
service
;
import
cn.quant.baa.pay.acquirer.AcquirerProperties
;
import
cn.quant.baa.pay.config.DictionaryViewer
;
import
cn.quant.baa.pay.dict.DictType
;
import
cn.quant.baa.pay.model.DictionaryItem
;
import
cn.quant.baa.pay.model.web.MerchantAcquirerProperties
;
import
cn.quant.baa.pay.model.web.MerchantChannelResponseData
;
import
cn.quant.spring.NotSupportedException
;
...
...
baa-pay-notice/pom.xml
View file @
0d9cd283
...
...
@@ -64,6 +64,7 @@
<include>
**/*.xml
</include>
<include>
**/*.properties
</include>
<include>
**/*.txt
</include>
<include>
**/*.html
</include>
</includes>
</resource>
<resource>
...
...
baa-pay-server/src/main/java/cn/quant/baa/pay/rest/MerchantController.java
View file @
0d9cd283
...
...
@@ -7,7 +7,7 @@ import cn.quant.baa.pay.annotation.BusinessMapping;
import
cn.quant.baa.pay.context.TransactionSession
;
import
cn.quant.baa.pay.util.AssertUtils
;
import
cn.quant.baa.pay.model.BusinessRequest
;
import
cn.quant.baa.pay.service.MerchantService
;
import
cn.quant.baa.pay.service.MerchantS
torageS
ervice
;
import
cn.quant.spring.http.HttpResponseData
;
import
cn.quant.spring.rest.AbstractController
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -27,7 +27,7 @@ import static cn.quant.baa.pay.dict.MessageEnum.*;
public
class
MerchantController
extends
AbstractController
{
@Autowired
private
MerchantS
ervice
merchant
Service
;
private
MerchantS
torageService
merchantStorage
Service
;
@Autowired
private
CacheManager
cacheManager
;
...
...
@@ -45,8 +45,8 @@ public class MerchantController extends AbstractController {
}
Map
<
String
,
MerchantChannelResponseData
>
channels
=
merchantService
.
getChannels
(
data
);
ResponseEntity
<
HttpResponseData
>
entity
=
succeed
(
session
.
getRequestId
()
,
channels
);
Map
<
String
,
MerchantChannelResponseData
>
channels
=
merchantS
torageS
ervice
.
getChannels
(
data
);
ResponseEntity
<
HttpResponseData
>
entity
=
succeed
(
requestId
,
channels
);
return
entity
;
}
...
...
@@ -62,9 +62,8 @@ public class MerchantController extends AbstractController {
AssertUtils
.
throwMessage
(
EMPTY_REQ_DATA
);
}
MerchantAcquirerProperties
channel
=
merchantService
.
getChannel
(
data
);
ResponseEntity
<
HttpResponseData
>
entity
=
succeed
(
session
.
getRequestId
(),
channel
);
MerchantAcquirerProperties
channel
=
merchantStorageService
.
getChannel
(
Long
.
parseLong
(
data
.
getChanId
()));
ResponseEntity
<
HttpResponseData
>
entity
=
succeed
(
requestId
,
channel
);
return
entity
;
}
}
baa-pay-server/src/main/java/cn/quant/baa/pay/rest/PayTestController.java
View file @
0d9cd283
package
cn
.
quant
.
baa
.
pay
.
rest
;
import
cn.quant.baa.pay.annotation.BusinessMapping
;
import
cn.quant.baa.pay.component.Sequencer
;
import
cn.quant.baa.pay.context.TransactionSession
;
import
cn.quant.baa.pay.model.BusinessRequest
;
import
cn.quant.baa.pay.model.web.CheckPayRequestData
;
import
cn.quant.baa.pay.model.web.CheckRefundRequestData
;
import
cn.quant.baa.pay.model.web.PayRequestData
;
import
cn.quant.baa.pay.service.TransactionService
;
import
cn.quant.spring.context.ServerApplicationContext
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.JsonNode
;
...
...
@@ -41,6 +43,12 @@ public class PayTestController {
@Autowired
private
TransactionService
transactionService
;
@Autowired
private
ServerApplicationContext
serverApplicationContext
;
@Autowired
private
Sequencer
sequencer
;
@GetMapping
(
""
)
public
String
getPay
(
Model
model
)
{
return
"pay/index"
;
...
...
@@ -63,6 +71,7 @@ public class PayTestController {
@RequestMapping
(
"checkRefund"
)
public
String
checkRefund
(
CheckRefundRequestData
data
,
Model
model
,
HttpServletRequest
servletRequest
)
{
String
res
=
""
;
if
(
servletRequest
.
getMethod
().
equals
(
"POST"
))
{
res
=
transactionService
.
checkRefund
(
data
).
toString
();
...
...
baa-pay-server/src/main/java/cn/quant/baa/pay/service/TransactionService.java
View file @
0d9cd283
package
cn
.
quant
.
baa
.
pay
.
service
;
import
cn.quant.baa.pay.acquirer.Acquirer
;
import
cn.quant.baa.pay.acquirer.AcquirerConfiguration
;
import
cn.quant.baa.pay.acquirer.AcquirerProperties
;
import
cn.quant.baa.pay.acquirer.MerchantAcquirer
;
import
cn.quant.baa.pay.context.TransactionSession
;
import
cn.quant.baa.pay.jpa.entity.*
;
import
cn.quant.baa.pay.model.web.*
;
import
cn.quant.baa.pay.util.AssertUtils
;
import
cn.quant.baa.pay.acquirer.AcquirerProperties
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -44,9 +43,8 @@ public class TransactionService extends BusinessService {
}
@Transactional
public
TransactionSession
payHistory
(
PayRequestData
data
){
public
TransactionSession
payHistory
(
PayRequestData
data
)
{
validate
(
data
);
...
...
baa-pay-server/src/main/resources/config/application-dev.properties
View file @
0d9cd283
...
...
@@ -30,6 +30,10 @@ spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.database
=
MYSQL
quant.baapay.local-cache-expire.time
=
6000
quant.baapay.local-cache-expire.unit
=
SECONDS
quant.baapay.local-cache-expire.size
=
1000
\ No newline at end of file
quant.baapay.acquirer.local-cache-expire.time
=
6000
quant.baapay.acquirer.local-cache-expire.unit
=
SECONDS
quant.baapay.acquirer.local-cache-expire.size
=
1000
quant.baapay.profile.local-cache-expire.time
=
6000
quant.baapay.profile.local-cache-expire.unit
=
SECONDS
quant.baapay.profile.local-cache-expire.size
=
1000
\ No newline at end of file
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