Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manager
Project
Overview
Details
Activity
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
reyun
manager
Commits
9f474aa0
Commit
9f474aa0
authored
Aug 11, 2020
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校验客户主账号
parent
5cbf4f23
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
8 deletions
+81
-8
pom.xml
pom.xml
+18
-0
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+41
-3
ShareIncomeServiceImpl.java
...main/java/common/service/impl/ShareIncomeServiceImpl.java
+1
-1
AccountRepository.java
src/main/java/tkio/repository/AccountRepository.java
+3
-0
persistence.properties
src/main/resources/persistence.properties
+7
-2
applicationContext.xml
src/main/resources/spring/applicationContext.xml
+11
-2
No files found.
pom.xml
View file @
9f474aa0
...
...
@@ -63,6 +63,12 @@
<io.username>
root
</io.username>
<io.password>
reyun123
</io.password>
<qcloudatasource.url>
jdbc:mysql://10.3.20.32:3306/trackingio_test?characterEncoding=utf-8
</qcloudatasource.url>
<qcloudatasource.username>
root
</qcloudatasource.username>
<qcloudatasource.password>
reyun.123
</qcloudatasource.password>
<mail.host>
smtp.exmail.qq.com
</mail.host>
<mail.username>
manar@reyun.com
</mail.username>
<mail.password>
Reyun123
</mail.password>
...
...
@@ -123,6 +129,12 @@
<io.username>
root
</io.username>
<io.password>
reyun.123
</io.password>
<qcloudatasource.url>
jdbc:mysql://10.3.20.32:3306/trackingio_test?characterEncoding=utf-8
</qcloudatasource.url>
<qcloudatasource.username>
root
</qcloudatasource.username>
<qcloudatasource.password>
reyun.123
</qcloudatasource.password>
<mail.host>
smtp.263.net
</mail.host>
<mail.username>
manager@reyun.com
</mail.username>
<mail.password>
rym@123
</mail.password>
...
...
@@ -212,6 +224,12 @@
<io.username>
reyun
</io.username>
<io.password>
Reyun123
</io.password>
<qcloudatasource.url>
jdbc:mysql://172.28.16.22:3306/trackingio?characterEncoding=utf-8
</qcloudatasource.url>
<qcloudatasource.username>
reyun
</qcloudatasource.username>
<qcloudatasource.password>
Reyun123
</qcloudatasource.password>
<mail.host>
smtp.263.net
</mail.host>
<mail.username>
manager@reyun.com
</mail.username>
<mail.password>
rym@123
</mail.password>
...
...
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
9f474aa0
...
...
@@ -16,7 +16,9 @@ import org.joda.time.format.DateTimeFormat;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.RowMapper
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -42,11 +44,14 @@ import java.lang.reflect.InvocationTargetException;
import
java.lang.reflect.Method
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.text.DateFormat
;
import
java.text.DecimalFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
* Created by mxq on 2018/1/16.
...
...
@@ -196,6 +201,10 @@ public class ContractServiceImpl implements ContractService {
JdbcTemplate
jdbcTemplate
;
@Autowired
@Qualifier
(
"jdbcTemplateQcloud"
)
JdbcTemplate
jdbcTemplateqCloud
;
@Autowired
TransactionUtils
transactionUtils
;
@Autowired
...
...
@@ -332,7 +341,7 @@ public class ContractServiceImpl implements ContractService {
// return code + "-" + platform.toUpperCase() + "-" + DateUtil.getDays2(0) + "-" + lastCode;
String
codeName
=
contractRepository
.
findLastCode
(
code
,
platform
);
String
codeName
=
contractRepository
.
findLastCode
(
code
,
platform
);
if
(
"fake"
.
equals
(
platform
))
{
platform
=
"FZBWS"
;
}
...
...
@@ -2254,6 +2263,7 @@ public class ContractServiceImpl implements ContractService {
List
<
Object
[]>
args_data
=
new
ArrayList
<>();
Map
<
String
,
String
>
codeUniqueDic
=
new
HashMap
<>();
List
<
String
>
accountsEmail
=
new
ArrayList
<>();
for
(
int
j
=
1
;
j
<=
rowNumber
;
j
++)
{
Row
row_data
=
sheet
.
getRow
(
j
);
Object
[]
s_data
=
new
Object
[
titleKey
.
size
()
+
extend_size
];
...
...
@@ -2351,10 +2361,37 @@ public class ContractServiceImpl implements ContractService {
s_data
[
w
]
=
dataSTR
.
replace
(
","
,
""
);
}
else
{
s_data
[
w
]
=
dataSTR
;
if
(
"email"
.
equals
(
sheetTitle
)
&&
!
StringUtils
.
isEmpty
(
dataSTR
)
&&
"tkio"
.
equals
(
platformexcl
))
{
accountsEmail
.
add
(
dataSTR
.
trim
());
}
}
}
}
if
(!
accountsEmail
.
isEmpty
())
{
List
<
String
>
emails
=
accountRepository
.
findEmailByEmails
(
accountsEmail
);
Map
<
String
,
String
>
emailDic
;
try
(
Stream
<
String
>
emailStream
=
emails
.
stream
())
{
emailDic
=
emailStream
.
collect
(
Collectors
.
toMap
(
v
->
v
,
v
->
v
,
(
v1
,
v2
)
->
v1
));
}
//查询腾讯云 服务器上的账号
jdbcTemplateqCloud
.
query
(
"select email from account where is_super_user is true and email in ? "
,
accountsEmail
.
toArray
(),
new
RowMapper
<
Map
>()
{
@Override
public
Map
mapRow
(
ResultSet
resultSet
,
int
i
)
throws
SQLException
{
emailDic
.
put
(
resultSet
.
getString
(
"email"
),
resultSet
.
getString
(
"email"
));
return
null
;
}
});
for
(
int
i
=
0
;
i
<
accountsEmail
.
size
();
i
++)
{
String
e
=
accountsEmail
.
get
(
i
);
if
(!
emailDic
.
containsKey
(
e
))
{
return
ResultModel
.
ERROR
(
"第"
+
(
i
+
1
)
+
"行 客户主账号【"
+
e
+
"】在Office运营后台未找到,请重新上传"
);
}
}
}
//platform,product,my_body_code,create_time,code_num,type,status,back_status,ds,
s_data
[
row_already
]
=
platform
;
...
...
@@ -2382,7 +2419,9 @@ public class ContractServiceImpl implements ContractService {
sql
.
append
(
extend_row_sql
);
sql
.
append
(
") values ("
);
for
(
int
ed
=
0
,
s
=
row_already
+
extend_size
;
ed
<
s
;
ed
++)
{
for
(
int
ed
=
0
,
s
=
row_already
+
extend_size
;
ed
<
s
;
ed
++)
{
if
(
ed
==
0
)
{
sql
.
append
(
"?"
);
}
else
{
...
...
@@ -2431,7 +2470,6 @@ public class ContractServiceImpl implements ContractService {
}
public
static
void
main
(
String
[]
args
)
{
// String dateStr1 = "2019-04-30";
// String dateStr2 = "2019-04-01";
...
...
src/main/java/common/service/impl/ShareIncomeServiceImpl.java
View file @
9f474aa0
...
...
@@ -195,7 +195,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
.
divide
(
new
BigDecimal
(
205
),
15
,
BigDecimal
.
ROUND_HALF_UP
);
if
(
checkTwoTime
(
usePart
[
0
],
middlePoiont
[
0
])
&&
checkTwoTime
(
middlePoiont
[
1
],
usePart
[
1
]))
{
//选择时间范围内 19 年分摊天数 及每天分摊
//选择时间范围内 19
+ 20
年分摊天数 及每天分摊
Long
allDayShare
=
dayShare_19
.
multiply
(
new
BigDecimal
(
getDayRange
(
usePart
[
0
],
middlePoiont
[
0
])
+
1
))
.
add
(
dayShare_20
.
multiply
(
new
BigDecimal
(
getDayRange
(
middlePoiont
[
1
],
usePart
[
1
])
+
1
)))
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
();
...
...
src/main/java/tkio/repository/AccountRepository.java
View file @
9f474aa0
...
...
@@ -39,4 +39,7 @@ public interface AccountRepository extends JpaRepository<Account, Long> {
@Query
(
value
=
"select * from account where email = ?1"
,
nativeQuery
=
true
)
Account
findByEmail
(
String
email
);
@Query
(
value
=
"select email from account where is_super_user is true and email in ?1"
,
nativeQuery
=
true
)
List
<
String
>
findEmailByEmails
(
List
<
String
>
accountsEmail
);
}
src/main/resources/persistence.properties
View file @
9f474aa0
...
...
@@ -23,4 +23,9 @@ dmp.dataSource.password=${dmp.password}
io.dataSource.url
=
${io.url}
io.dataSource.username
=
${io.username}
io.dataSource.password
=
${io.password}
\ No newline at end of file
io.dataSource.password
=
${io.password}
qcloudatasource.dataSource.url
=
${qcloudatasource.url}
qcloudatasource.dataSource.username
=
${qcloudatasource.username}
qcloudatasource.dataSource.password
=
${qcloudatasource.password}
\ No newline at end of file
src/main/resources/spring/applicationContext.xml
View file @
9f474aa0
...
...
@@ -340,7 +340,16 @@
<bean
id=
"jdbcTemplate"
class=
"org.springframework.jdbc.core.JdbcTemplate"
>
<property
name=
"dataSource"
ref=
"dataSource"
></property>
</bean>
<bean
id=
"jdbcTransactionManager"
class=
"org.springframework.jdbc.datasource.DataSourceTransactionManager"
>
<property
name=
"dataSource"
ref=
"dataSource"
/>
<bean
id=
"jdbcTransactionManager"
class=
"org.springframework.jdbc.datasource.DataSourceTransactionManager"
>
<property
name=
"dataSource"
ref=
"dataSource"
/>
</bean>
<bean
id=
"qClouDataSource"
parent=
"parentDataSource"
>
<property
name=
"url"
value=
"${qcloudatasource.url}"
/>
<property
name=
"username"
value=
"${qcloudatasource.username}"
/>
<property
name=
"password"
value=
"${qcloudatasource.password}"
/>
</bean>
<bean
id=
"jdbcTemplateQcloud"
class=
"org.springframework.jdbc.core.JdbcTemplate"
>
<property
name=
"dataSource"
ref=
"qClouDataSource"
></property>
</bean>
</beans>
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