Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
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
胡慧
cash-loan-flow-boss
Commits
7a2fff6d
Commit
7a2fff6d
authored
Aug 14, 2019
by
WeiWei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善XYQB数据源配置
parent
83f15dd8
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
51 additions
and
18 deletions
+51
-18
Order.java
...n/quantgroup/cashloanflowboss/api/order/entity/Order.java
+4
-0
CashLoanFlowBossDataSourceConfiguration.java
...uration/data/CashLoanFlowBossDataSourceConfiguration.java
+1
-1
XYQBCenter.java
...antgroup/cashloanflowboss/spi/xyqb/client/XYQBCenter.java
+1
-1
Contract.java
...quantgroup/cashloanflowboss/spi/xyqb/entity/Contract.java
+5
-3
FundLending.java
...ntgroup/cashloanflowboss/spi/xyqb/entity/FundLending.java
+5
-3
ContractRepository.java
...hloanflowboss/spi/xyqb/repository/ContractRepository.java
+3
-1
FundLendingRepository.java
...anflowboss/spi/xyqb/repository/FundLendingRepository.java
+2
-0
XYQBDataSourceConfiguration.java
...flowboss/spi/xyqb/source/XYQBDataSourceConfiguration.java
+27
-8
XYQBDataSourceProperty.java
...hloanflowboss/spi/xyqb/source/XYQBDataSourceProperty.java
+3
-1
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/api/order/entity/Order.java
View file @
7a2fff6d
...
...
@@ -4,6 +4,8 @@ import cn.quantgroup.cashloanflowboss.core.persistence.Primary;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
/**
* function:
...
...
@@ -13,6 +15,8 @@ import javax.persistence.Column;
*/
@Data
@Entity
@Table
(
name
=
"order"
)
public
class
Order
extends
Primary
{
@Column
(
name
=
"channel_order_number"
)
private
String
channelOrderNumber
;
...
...
src/main/java/cn/quantgroup/cashloanflowboss/core/configuration/data/CashLoanFlowBossDataSourceConfiguration.java
View file @
7a2fff6d
...
...
@@ -63,7 +63,7 @@ public class CashLoanFlowBossDataSourceConfiguration {
public
LocalContainerEntityManagerFactoryBean
entityManager
(
EntityManagerFactoryBuilder
builder
)
{
return
builder
.
dataSource
(
createDataSource
())
.
packages
(
"cn.quantgroup"
)
.
packages
(
"cn.quantgroup
.cashloanflowboss.api
"
)
.
persistenceUnit
(
uniquename
)
.
build
();
}
...
...
src/main/java/cn/quantgroup/cashloanflowboss/spi/xyqb/client/XYQBCenter.java
View file @
7a2fff6d
...
...
@@ -11,7 +11,7 @@ import java.util.Map;
* Created by WeiWei on 2019/8/12.
*/
@Component
@FeignClient
(
name
=
"XYQBCenter"
,
url
=
"${}"
,
fallback
=
XYQBCenter
.
Fallback
.
class
)
@FeignClient
(
name
=
"XYQBCenter"
,
url
=
"${
api.https
}"
,
fallback
=
XYQBCenter
.
Fallback
.
class
)
public
interface
XYQBCenter
{
@PostMapping
(
value
=
"/ex/paycenter/pay_notify"
,
consumes
=
"application/x-www-form-urlencoded"
)
...
...
src/main/java/cn/quantgroup/cashloanflowboss/spi/xyqb/entity/Contract.java
View file @
7a2fff6d
...
...
@@ -2,9 +2,7 @@ package cn.quantgroup.cashloanflowboss.spi.xyqb.entity;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
javax.persistence.*
;
/**
* Created by WeiWei on 2019/8/12.
...
...
@@ -14,6 +12,10 @@ import javax.persistence.Table;
@Table
(
name
=
"contract"
)
public
class
Contract
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
private
Long
id
;
/**
* 用户ID
*/
...
...
src/main/java/cn/quantgroup/cashloanflowboss/spi/xyqb/entity/FundLending.java
View file @
7a2fff6d
...
...
@@ -2,9 +2,7 @@ package cn.quantgroup.cashloanflowboss.spi.xyqb.entity;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
javax.persistence.*
;
import
java.math.BigDecimal
;
import
java.util.Date
;
...
...
@@ -16,6 +14,10 @@ import java.util.Date;
@Table
(
name
=
"waiting_funding_corp_operate_people"
)
public
class
FundLending
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
private
Long
id
;
/**
* 借款订单号
*/
...
...
src/main/java/cn/quantgroup/cashloanflowboss/spi/xyqb/repository/ContractRepository.java
View file @
7a2fff6d
package
cn
.
quantgroup
.
cashloanflowboss
.
spi
.
xyqb
.
repository
;
import
cn.quantgroup.cashloanflowboss.spi.xyqb.entity.Contract
;
import
cn.quantgroup.cashloanflowboss.spi.xyqb.source.XYQBDataSource
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.CrudRepository
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -8,8 +9,9 @@ import org.springframework.stereotype.Repository;
/**
* Created by WeiWei on 2019/8/13.
*/
@XYQBDataSource
@Repository
public
interface
ContractRepository
extends
CrudRepository
<
Contract
,
Integer
>
{
public
interface
ContractRepository
extends
CrudRepository
<
Contract
,
Long
>
{
/**
* 更新合同状态
...
...
src/main/java/cn/quantgroup/cashloanflowboss/spi/xyqb/repository/FundLendingRepository.java
View file @
7a2fff6d
package
cn
.
quantgroup
.
cashloanflowboss
.
spi
.
xyqb
.
repository
;
import
cn.quantgroup.cashloanflowboss.spi.xyqb.entity.FundLending
;
import
cn.quantgroup.cashloanflowboss.spi.xyqb.source.XYQBDataSource
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.CrudRepository
;
import
org.springframework.data.repository.query.Param
;
...
...
@@ -12,6 +13,7 @@ import java.util.Map;
/**
* Created by WeiWei on 2019/8/12.
*/
@XYQBDataSource
@Repository
public
interface
FundLendingRepository
extends
CrudRepository
<
FundLending
,
Integer
>
{
...
...
src/main/java/cn/quantgroup/cashloanflowboss/spi/xyqb/source/XYQBDataSourceConfiguration.java
View file @
7a2fff6d
...
...
@@ -2,28 +2,33 @@ package cn.quantgroup.cashloanflowboss.spi.xyqb.source;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.jpa.repository.config.EnableJpaRepositories
;
import
org.springframework.orm.jpa.JpaTransactionManager
;
import
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
javax.persistence.EntityManagerFactory
;
import
javax.sql.DataSource
;
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories
(
basePackages
=
{
"cn.quantgroup
"
}
,
includeFilters
=
@ComponentScan
.
Filter
(
XYQBDataSource
.
class
))
@EnableJpaRepositories
(
basePackages
=
{
"cn.quantgroup
.cashloanflowboss.spi.xyqb"
},
entityManagerFactoryRef
=
"xyqbEntityManager"
,
transactionManagerRef
=
"xyqbTransactionManager"
,
includeFilters
=
@ComponentScan
.
Filter
(
XYQBDataSource
.
class
))
public
class
XYQBDataSourceConfiguration
{
@Bean
public
DataSource
xyqbDataSource
(
@Autowired
XYQBDataSourceProperty
dataSourceProperty
)
{
@ConfigurationProperties
(
prefix
=
"data.xyqb"
)
public
DataSource
xyqbDataSource
()
{
DruidDataSource
source
=
DruidDataSourceBuilder
.
create
().
build
();
source
.
setMaxActive
(
dataSourceProperty
.
getMaxActive
());
source
.
setMinIdle
(
dataSourceProperty
.
getMinIdle
());
source
.
setInitialSize
(
dataSourceProperty
.
getInitialSize
());
source
.
setMaxActive
(
200
);
source
.
setMinIdle
(
10
);
source
.
setInitialSize
(
10
);
source
.
setMaxWait
(
500000
);
source
.
setTimeBetweenEvictionRunsMillis
(
60000
);
source
.
setMinEvictableIdleTimeMillis
(
300000
);
...
...
@@ -32,9 +37,23 @@ public class XYQBDataSourceConfiguration {
source
.
setTestOnBorrow
(
false
);
source
.
setTestOnReturn
(
false
);
source
.
setPoolPreparedStatements
(
Boolean
.
FALSE
);
return
source
;
}
@Bean
public
LocalContainerEntityManagerFactoryBean
xyqbEntityManager
(
EntityManagerFactoryBuilder
builder
,
DataSource
xyqbDataSource
)
{
return
builder
.
dataSource
(
xyqbDataSource
)
.
packages
(
"cn.quantgroup.cashloanflowboss"
)
.
persistenceUnit
(
"XYQB-DataSource"
)
.
build
();
}
@Bean
public
PlatformTransactionManager
xyqbTransactionManager
(
EntityManagerFactory
entityManagerFactory
)
{
return
new
JpaTransactionManager
(
entityManagerFactory
);
}
}
src/main/java/cn/quantgroup/cashloanflowboss/spi/xyqb/source/XYQBDataSourceProperty.java
View file @
7a2fff6d
...
...
@@ -2,12 +2,14 @@ package cn.quantgroup.cashloanflowboss.spi.xyqb.source;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Component
;
/**
* Created by WeiWei on 2019/8/12.
*/
@Data
@ConfigurationProperties
(
"application.datasource.xyqb"
)
@Component
@ConfigurationProperties
(
"application.database.xyqb"
)
public
class
XYQBDataSourceProperty
{
/**
...
...
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