Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-common
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1c09bf27
authored
Aug 26, 2017
by
caosy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add the miss file
parent
d7d7136a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
293 additions
and
0 deletions
fun-common-soa/src/main/java/com/ctrip/fun/golf/api/express/ExpressController.java
fun-common-soa/src/main/java/com/ctrip/fun/golf/service/express/ExpressService.java
fun-common-soa/src/main/java/com/ctrip/fun/golf/service/express/vo/TaskRequest.java
fun-common-soa/src/main/java/com/ctrip/fun/golf/service/insurance/EXV_BIS_IFRONT_PCIS_AWGE_001_PRD.PFX
fun-common-soa/src/main/java/com/ctrip/fun/golf/service/message/.gitignore
fun-common-soa/src/main/resources/EXV_BIS_IFRONT_PCIS_AWGE_001_PRD.PFX
fun-common-soa/src/main/resources/debug/app.properties
fun-common-soa/src/main/resources/debug/logback.properties
fun-common-soa/src/main/java/com/ctrip/fun/golf/api/express/ExpressController.java
0 → 100644
View file @
1c09bf27
package
com
.
ctrip
.
fun
.
golf
.
api
.
express
;
import
java.io.Serializable
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.ctrip.fun.common.vo.Request
;
import
com.ctrip.fun.common.vo.Response
;
import
com.ctrip.fun.common.vo.ResponseStatusEnum
;
import
com.ctrip.fun.common.vo.basic.ExpressBean
;
import
com.ctrip.fun.golf.service.express.ExpressService
;
/**
* 快递信息请求
*
* @author gaoc
*
*/
@Controller
@RequestMapping
(
"/express"
)
public
class
ExpressController
{
@Autowired
private
ExpressService
expressService
=
null
;
@ResponseBody
@RequestMapping
(
value
=
"/request"
,
method
=
RequestMethod
.
POST
)
public
Response
<
Serializable
>
sendOnce
(
@RequestBody
Request
<
ExpressBean
>
request
)
{
Boolean
flag
=
this
.
expressService
.
requestExpress
(
request
.
getBody
());
Response
<
Serializable
>
respose
=
new
Response
<
Serializable
>();
if
(
flag
){
respose
.
setStatus
(
ResponseStatusEnum
.
SUCCESS
.
getValue
());
respose
.
setMessage
(
ResponseStatusEnum
.
SUCCESS
.
getMsg
());
}
else
{
respose
.
setStatus
(
ResponseStatusEnum
.
FAIL
.
getValue
());
respose
.
setMessage
(
ResponseStatusEnum
.
FAIL
.
getMsg
());
}
return
respose
;
}
}
fun-common-soa/src/main/java/com/ctrip/fun/golf/service/express/ExpressService.java
0 → 100644
View file @
1c09bf27
package
com
.
ctrip
.
fun
.
golf
.
service
.
express
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.NameValuePair
;
import
org.apache.http.client.entity.UrlEncodedFormEntity
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClientBuilder
;
import
org.apache.http.message.BasicNameValuePair
;
import
org.apache.http.util.EntityUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
com.ctrip.fun.common.core.util.EncryptUtil
;
import
com.ctrip.fun.common.core.util.JsonUtil
;
import
com.ctrip.fun.common.vo.basic.ExpressBean
;
import
com.ctrip.fun.golf.service.express.vo.TaskRequest
;
import
com.ctrip.fun.mall.vo.order.MallExpressNameEnum
;
/**
* 用来请求快递信息
*
* @author gaoc
* @version 1.0.0
*/
public
class
ExpressService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ExpressService
.
class
);
@Value
(
"${expressUrl}"
)
private
String
expressUrl
=
null
;
@Value
(
"${expressKey}"
)
private
String
expressKey
=
null
;
@Value
(
"${callbackurl}"
)
private
String
callbackurl
=
null
;
@Value
(
"${expressSalt}"
)
private
String
expressSalt
=
null
;
@Value
(
"${useSystemProxy}"
)
private
boolean
useSystemProxy
=
false
;
private
void
requestOneExpress
(
ExpressBean
expressBean
)
throws
Exception
{
TaskRequest
req
=
new
TaskRequest
();
req
.
setCompany
(
MallExpressNameEnum
.
valueOf
(
expressBean
.
getCompanyNo
()).
getCode
());
// req.setFrom("上海浦东新区");
// req.setTo("广东深圳南山区");
req
.
setNumber
(
expressBean
.
getExpressNo
());
req
.
getParameters
().
put
(
"callbackurl"
,
callbackurl
);
req
.
getParameters
().
put
(
"salt"
,
EncryptUtil
.
getMD5Str
(
expressSalt
+
expressBean
.
getExpressNo
()));
req
.
setKey
(
expressKey
);
// 创建HttpClientBuilder
HttpClientBuilder
httpClientBuilder
=
HttpClientBuilder
.
create
();
if
(
useSystemProxy
)
{
httpClientBuilder
.
useSystemProperties
();
}
// HttpClient
CloseableHttpClient
closeableHttpClient
=
httpClientBuilder
.
build
();
HttpPost
post
=
new
HttpPost
(
expressUrl
);
post
.
addHeader
(
"content-charset"
,
"application/json;charset=UTF-8"
);
// 在头文件中设置转码
List
<
NameValuePair
>
formparams
=
new
ArrayList
<
NameValuePair
>();
formparams
.
add
(
new
BasicNameValuePair
(
"schema"
,
"json"
));
formparams
.
add
(
new
BasicNameValuePair
(
"param"
,
JsonUtil
.
writeValueAsString
(
req
)));
UrlEncodedFormEntity
entity
=
new
UrlEncodedFormEntity
(
formparams
);
post
.
setEntity
(
entity
);
HttpResponse
httpResponse
=
closeableHttpClient
.
execute
(
post
);
HttpEntity
httpEntity
=
httpResponse
.
getEntity
();
String
result
=
EntityUtils
.
toString
(
httpEntity
,
"UTF-8"
);
logger
.
info
(
"expressNo:"
+
req
.
getNumber
()
+
" request Express result="
+
result
);
post
.
releaseConnection
();
}
/**
* 请求物流信息
*/
public
Boolean
requestExpress
(
ExpressBean
expressBean
)
{
Boolean
result
=
true
;
try
{
this
.
requestOneExpress
(
expressBean
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
result
=
false
;
}
return
result
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ExpressService
e
=
new
ExpressService
();
e
.
callbackurl
=
"http://mall.iwanoutdoor.com/fun-mall-mobile/express/execute"
;
e
.
expressKey
=
"eezQpjws5509"
;
e
.
expressSalt
=
"123"
;
e
.
expressUrl
=
"http://www.kuaidi100.com/poll"
;
ExpressBean
expressBean
=
new
ExpressBean
();
expressBean
.
setCompanyNo
(
11
);
expressBean
.
setExpressNo
(
"968434104741"
);
e
.
requestOneExpress
(
expressBean
);
}
}
fun-common-soa/src/main/java/com/ctrip/fun/golf/service/express/vo/TaskRequest.java
0 → 100644
View file @
1c09bf27
package
com
.
ctrip
.
fun
.
golf
.
service
.
express
.
vo
;
import
java.util.HashMap
;
public
class
TaskRequest
{
private
String
company
;
private
String
number
;
private
String
from
;
private
String
to
;
private
String
key
;
private
String
src
;
private
HashMap
<
String
,
String
>
parameters
=
new
HashMap
<
String
,
String
>();
public
String
getCompany
()
{
return
company
;
}
public
void
setCompany
(
String
company
)
{
this
.
company
=
company
;
}
public
String
getNumber
()
{
return
number
;
}
public
void
setNumber
(
String
number
)
{
this
.
number
=
number
;
}
public
String
getFrom
()
{
return
from
;
}
public
void
setFrom
(
String
from
)
{
this
.
from
=
from
;
}
public
String
getTo
()
{
return
to
;
}
public
void
setTo
(
String
to
)
{
this
.
to
=
to
;
}
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
String
getSrc
()
{
return
src
;
}
public
void
setSrc
(
String
src
)
{
this
.
src
=
src
;
}
public
HashMap
<
String
,
String
>
getParameters
()
{
return
parameters
;
}
public
void
setParameters
(
HashMap
<
String
,
String
>
parameters
)
{
this
.
parameters
=
parameters
;
}
}
fun-common-soa/src/main/java/com/ctrip/fun/golf/service/insurance/EXV_BIS_IFRONT_PCIS_AWGE_001_PRD.PFX
0 → 100644
View file @
1c09bf27
File added
fun-common-soa/src/main/java/com/ctrip/fun/golf/service/message/.gitignore
0 → 100644
View file @
1c09bf27
/MessageService.java
fun-common-soa/src/main/resources/EXV_BIS_IFRONT_PCIS_AWGE_001_PRD.PFX
0 → 100644
View file @
1c09bf27
File added
fun-common-soa/src/main/resources/debug/app.properties
0 → 100644
View file @
1c09bf27
imageEndpoint
=
http://7x2w1g.com1.z0.glb.clouddn.com
accessKey
=
s_FZUyzvhxv10JMRzJOBwy5rObZWYlEwwNC9rVt2
secretKey
=
flCPDL5VVrWx4n9VnzSr6zN1wN4XZega_3cWPqmH
bucketName
=
ofrog
corpId
=
wj5007
corpPwd
=
5376wh
corpService
=
1069007205007
corpUrl
=
http://cloud.hongshutech.com:8080/sms_send2.do
useSystemProxy
=
false
# timeout
rpcReadTimeout
=
300000
rpcConnectionTimeout
=
300000
#weather
weather.appkey
=
10003
weather.serverPath
=
http://api.k780.com:88/?app=weather.future&weaid=
weather.sign
=
sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json
weather.imagePath
=
http://7x2w1g.com1.z0.glb.clouddn.com/
#payment2
payment.createPayOrderPath
=
http://ws.security.pay.fat103.qa.nt.ctripcorp.com/api-webapp/json/createpayorder
payment.payOrderOperatePath
=
http://ws.security.pay.fat103.qa.nt.ctripcorp.com/api-webapp/json/payoperation
payment.queryPayStatusPath
=
http://ws.security.pay.fat103.qa.nt.ctripcorp.com/api-webapp/json/queryPayStatus
payment.serverBaseNotifyPath
=
http://10.8.55.46:8080/fun-golf-service
#payment.createPayOrderPath=https://payapi.ctrip.com/api-webapp/json/CreatePayOrder
#payment.payOrderOperatePath=https://payapi.ctrip.com/api-webapp/json/payoperation
#payment.queryPayStatusPath=https://payapi.ctrip.com/api-webapp/json/queryPayStatus
#payment.serverBaseNotifyPath=http://localhost:8080/fun-golf-service
#express
expressUrl
=
http://www.kuaidi100.com/poll
expressKey
=
eezQpjws5509
callbackurl
=
https://api.iwanoutdoor.com/fun-golf-mobile/express/change
expressSalt
=
2dfb8831-5158-4132-bfd0-4418dec995b5
#pingan
PINGAN_URL
=
https://222.68.184.181:8007
PINGAN_PORT
=
8007
PINGAN_KEYSTOREPASSWORD
=
paic1234
PINGAN_TRUSTSTOREPASSWORD
=
paic1234
PINGAN_ELECTRONIC_URL
=
http://epcis-ptp-dmzstg1.pingan.com.cn:9080/epcis.ptp.partner.getAhsEPolicyPDFWithCert.do
#connect
proxyHost
=
10.8.16.106
proxyPort
=
8080
#umeng
umeng_api_key
=
57e8b616e0f55afc8e0028e8
umeng_api_secret
=
10330b5a6e779ed78b2b3aa64bdbe517
android_umeng_appkey
=
561b6553e0f55a0aa10045cd
android_umeng_appMasterSecret
=
eo3cnlm1pmhuvy0a26m4syt2vfqmahiy
ios_umeng_appkey
=
55238b36fd98c5ae680005b6
ios_umeng_appMasterSecret
=
hnrphs6jqykvbywvegdlmp6uwjoxnkpr
ios_umeng_productionMode
=
false
#rongyun
rongyun_appkey
=
tdrvipksrrcm5
rongyun_appsecret
=
x4368Fr6lZw
\ No newline at end of file
fun-common-soa/src/main/resources/debug/logback.properties
0 → 100644
View file @
1c09bf27
log.base
=
/opt/logs/tomcat
slf4j.root
=
<root><level value="INFO" /><appender-ref ref="stdout" /></root><root><level value="DEBUG" /><appender-ref ref="logstash" /></root>
\ 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