Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
f8d70cae
Commit
f8d70cae
authored
Mar 25, 2019
by
chase
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_mysql' of
http://code.tech.tax.asia.pwcinternal.com/root/atms
into dev_mysql
parents
0f0719ea
21aef167
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
35 deletions
+110
-35
conf.properties
atms-api/src/main/resources/conf/conf.properties
+10
-9
conf_profile_dev.properties
atms-api/src/main/resources/conf/conf_profile_dev.properties
+6
-6
conf_profile_pub.properties
atms-api/src/main/resources/conf/conf_profile_pub.properties
+9
-9
conf_profile_staging.properties
...i/src/main/resources/conf/conf_profile_staging.properties
+7
-7
EbsApiServiceImplTest.java
.../pwc/taxtech/atms/service/impl/EbsApiServiceImplTest.java
+78
-4
No files found.
atms-api/src/main/resources/conf/conf.properties
View file @
f8d70cae
...
...
@@ -48,25 +48,26 @@ file_upload_post_url=${file_upload_post_url}
file_upload_query_url
=
${file_upload_query_url}
#didi-config
#
是否调用滴滴ticket接口
#
是否调用滴滴ticket接口
check_ticket
=
${check_ticket}
#
滴滴SSO地址
#
滴滴SSO地址
get_user_info_url
=
${get_user_info_url}
#
滴滴备案TMS系统
appId
#
滴滴备案TMS系统app
Id
app_id
=
${app_id}
#
滴滴备案TMS系统
appKey
#
滴滴备案TMS系统app
Key
app_key
=
${app_key}
#cookie
最大时长
#cookie
最大时长
cookie.maxAgeSeconds
=
${cookie.maxAgeSeconds}
#
机构信息同步地址
#
机构信息同步地址
org_sync_url
=
${org_sync_url}
#
机构信息同步
token
#
机构信息同步tok
en
org_sync_token
=
${org_sync_token}
#
滴滴-与主数据接口调用的生成token所需的公钥
#
滴滴-与主数据接口调用的生成token所需的公钥
dd_pubkey
=
${dd_pubkey}
#
滴滴-EBS抽取接口地址
#
滴滴-EBS抽取接口地址
ebs_call_url
=
${ebs_call_url}
#tableau config
tableau_get_ticket
=
${tableau_get_ticket}
tableau_unreturned_tax
=
${tableau_unreturned_tax}
...
...
atms-api/src/main/resources/conf/conf_profile_dev.properties
View file @
f8d70cae
...
...
@@ -61,12 +61,12 @@ ebs_call_url=http://172.20.201.201:8020/ebs-proxy-test/dts
tableau_get_ticket
=
http://47.94.233.173:16010/trusted?username=%s
tableau_unreturned_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_tax_comparison
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet14?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_countries
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_countries
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
Others
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_cost_analysis
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet19?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_profit_and_loss
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet26?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_domestic_data
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet32?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_doc_situation
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet
8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_global_overview
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_mexican_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_doc_situation
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet
40
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_global_overview
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
InternationalOverview
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_mexican_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
Mexico
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
Australia
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
Brazil
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
atms-api/src/main/resources/conf/conf_profile_pub.properties
View file @
f8d70cae
...
...
@@ -45,8 +45,8 @@ log.level=INFO
log.debug
=
false
env_type
=
pub
file_upload_post_url
=
http://10
0.69.238.155
:8000/resource/erp_tax_system
file_upload_query_url
=
http://10
0.69.238.155
:8001/resource/erp_tax_system
file_upload_post_url
=
http://10
.88.128.214
:8000/resource/erp_tax_system
file_upload_query_url
=
http://10
.88.128.214
:8001/resource/erp_tax_system
#���ϵ�ַget_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
check_ticket
=
true
...
...
@@ -59,18 +59,18 @@ org_sync_token=174af08f
dd_pubkey
=
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url
=
http://172.20.
201.201
:8020/ebs-proxy-test/dts
ebs_call_url
=
http://172.20.
3.109
:8020/ebs-proxy-test/dts
#tableau config
tableau_get_ticket
=
http://47.94.233.173:16010/trusted?username=%s
tableau_unreturned_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_tax_comparison
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet14?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_countries
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_countries
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
Others
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_cost_analysis
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet19?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_profit_and_loss
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet26?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_domestic_data
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet32?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_doc_situation
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet
8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_global_overview
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_mexican_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_doc_situation
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet
40
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_global_overview
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
InternationalOverview
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_mexican_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
Mexico
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
Australia
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
Brazil
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
atms-api/src/main/resources/conf/conf_profile_staging.properties
View file @
f8d70cae
...
...
@@ -54,18 +54,18 @@ org_sync_token=174af08f
dd_pubkey
=
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url
=
http://172.20.
201.201
:8020/ebs-proxy-test/dts
ebs_call_url
=
http://172.20.
3.109
:8020/ebs-proxy-test/dts
#tableau config
tableau_get_ticket
=
http://47.94.233.173:16010/trusted?username=%s
tableau_unreturned_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_tax_comparison
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet14?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_countries
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_countries
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
Others
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_cost_analysis
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet19?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_profit_and_loss
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet26?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_domestic_data
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet32?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_doc_situation
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet
8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_global_overview
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_mexican_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
sheet8
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_doc_situation
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet
40
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_global_overview
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
InternationalOverview
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_mexican_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
Mexico
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
Australia
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax
=
http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/
Brazil
?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
atms-api/src/test/java/pwc/taxtech/atms/service/impl/EbsApiServiceImplTest.java
View file @
f8d70cae
...
...
@@ -2,6 +2,7 @@ package pwc.taxtech.atms.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.lang3.StringUtils
;
import
org.assertj.core.util.Lists
;
import
org.junit.Test
;
...
...
@@ -26,14 +27,21 @@ import pwc.taxtech.atms.dto.ebsdto.*;
import
pwc.taxtech.atms.dto.organization.DDSyncOrgInfo
;
import
pwc.taxtech.atms.dto.organization.OrgSyncData
;
import
pwc.taxtech.atms.entity.*
;
import
pwc.taxtech.atms.exception.ServiceException
;
import
pwc.taxtech.atms.security.dd.DtsTokenService
;
import
pwc.taxtech.atms.service.EbsApiService
;
import
sun.misc.BASE64Decoder
;
import
sun.misc.BASE64Encoder
;
import
javax.annotation.Resource
;
import
javax.crypto.Cipher
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.security.KeyFactory
;
import
java.security.PublicKey
;
import
java.security.spec.X509EncodedKeySpec
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.concurrent.*
;
public
class
EbsApiServiceImplTest
extends
CommonIT
{
...
...
@@ -52,6 +60,9 @@ public class EbsApiServiceImplTest extends CommonIT {
@Value
(
"${org_sync_token}"
)
private
String
token
;
@Resource
private
DtsTokenService
dtsTokenService
;
private
static
String
ebsCallUrl
=
"http://172.20.201.201:8020/ebs-proxy-test/dts"
;
private
static
int
corePoolSize
=
15
;
...
...
@@ -698,4 +709,66 @@ public class EbsApiServiceImplTest extends CommonIT {
return
new
Integer
(
1
);
}
}
public
String
encryptInput
(){
BASE64Encoder
base64
=
new
BASE64Encoder
();
BASE64Decoder
base64Decoder
=
new
BASE64Decoder
();
byte
[]
encodeData
;
try
{
byte
[]
publicKey
=
base64Decoder
.
decodeBuffer
(
"MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ=="
);
String
nonce
=
generateNonce
();
String
sDate
=
generateDate
();
long
rNum
=
generateRandomNumber
();
String
inputStr1
=
sDate
+
"@@"
+
"DTS"
+
"@@"
+
nonce
+
rNum
;
byte
[]
data1
=
inputStr1
.
getBytes
();
logger
.
debug
(
"原文:"
+
inputStr1
);
encodeData
=
encryptByPublicKey
(
data1
,
publicKey
);
logger
.
debug
(
"公钥加密后:"
+
base64
.
encode
(
encodeData
));
}
catch
(
Exception
ex
)
{
throw
new
ServiceException
(
"cus"
+
ex
);
}
return
base64
.
encode
(
encodeData
);
}
private
String
generateNonce
()
throws
Exception
{
String
dateTimeString
=
Long
.
toString
(
System
.
currentTimeMillis
());
byte
[]
nonceByte
=
dateTimeString
.
getBytes
();
return
Base64
.
encodeBase64String
(
nonceByte
);
}
private
String
generateDate
()
throws
Exception
{
DateFormat
dateFormatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
dateFormatter
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"UTC"
));
Date
today
=
Calendar
.
getInstance
().
getTime
();
String
created
=
dateFormatter
.
format
(
today
);
return
created
;
}
private
long
generateRandomNumber
()
throws
Exception
{
final
double
d
=
Math
.
random
();
final
long
num
=
(
int
)(
d
*
100000000000000L
);
return
num
;
}
private
static
byte
[]
encryptByPublicKey
(
byte
[]
data
,
byte
[]
key
)
throws
Exception
{
X509EncodedKeySpec
x509KeySpec
=
new
X509EncodedKeySpec
(
key
);
KeyFactory
keyFactory
=
KeyFactory
.
getInstance
(
"RSA"
);
PublicKey
publicKey
=
keyFactory
.
generatePublic
(
x509KeySpec
);
Cipher
cipher
=
Cipher
.
getInstance
(
keyFactory
.
getAlgorithm
());
cipher
.
init
(
Cipher
.
ENCRYPT_MODE
,
publicKey
);
return
cipher
.
doFinal
(
data
);
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"--------------"
);
System
.
out
.
println
(
new
EbsApiServiceImplTest
().
encryptInput
());
}
}
\ 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