Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Quilan
/
medicinal-supplier
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
cefafee6
authored
2019-11-21 10:57:44 +0800
by
Quilan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1
1 parent
84520ece
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
src/main/java/com/phxl/modules/goods/web/spd/SpdControlller.java
src/main/java/com/phxl/modules/goods/web/spd/SpdControlller.java
View file @
cefafee
...
...
@@ -11,11 +11,14 @@ import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
import
org.apache.commons.fileupload.disk.DiskFileItem
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.NameValuePair
;
import
org.apache.http.client.HttpClient
;
import
org.apache.http.client.entity.UrlEncodedFormEntity
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.entity.mime.MultipartEntityBuilder
;
import
org.apache.http.entity.mime.content.FileBody
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.message.BasicNameValuePair
;
import
org.apache.http.util.EntityUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -125,6 +128,7 @@ public class SpdControlller {
@Autowired
private
SuInvoiceBackService
suInvoiceBackService
;
private
static
HttpClient
client
;
@RequestMapping
(
value
=
"/setMFMedGoods"
)
@ResponseBody
...
...
@@ -940,4 +944,74 @@ public class SpdControlller {
interfaceLogService
.
setResultLog
(
response
,
logId
,
exception
);
return
result
;
}
/**
* 库存查询接口
* @param params
* @return
*/
@RequestMapping
(
"/querystock"
)
@ResponseBody
public
String
querystock
(
@RequestBody
String
params
){
logger
.
debug
(
"查询库存:{}"
,
params
);
String
result
=
""
;
try
{
result
=
HTTPClient
.
sendJsonDataByPost
(
"http://10.146.8.221:9002/medicinal-web/a/StoreDetail/queryDrugByDeptAll"
,
params
);
}
catch
(
Exception
e
)
{
result
=
e
.
getMessage
();
}
return
result
;
}
/**
* 近效期查询接口
* @param params
* @return
*/
@RequestMapping
(
"/queryexpir"
)
@ResponseBody
public
String
queryexpir
(
@RequestBody
String
params
){
logger
.
debug
(
"查询近效期:{}"
,
params
);
String
result
=
""
;
try
{
result
=
HTTPClient
.
sendJsonDataByPost
(
"http://10.146.8.221:9002/medicinal-web/a/ypjxq/statics/list"
,
params
);
}
catch
(
Exception
e
)
{
result
=
e
.
getMessage
();
}
return
result
;
}
/**
* 呆滞品查询接口
* @param params
* @return
*/
@RequestMapping
(
"/querydetained"
)
@ResponseBody
public
String
querydetained
(
@RequestBody
String
params
){
logger
.
debug
(
"查询近效期:{}"
,
params
);
String
result
=
""
;
if
(
client
==
null
){
client
=
HttpClients
.
createDefault
();
}
try
{
JSONObject
objec
=
JSON
.
parseObject
(
params
);
List
<
NameValuePair
>
param
=
new
ArrayList
<
NameValuePair
>();
param
.
add
(
new
BasicNameValuePair
(
"depetCode"
,
objec
.
getString
(
"depetCode"
)));
param
.
add
(
new
BasicNameValuePair
(
"pageNo"
,
objec
.
getString
(
"pageNo"
)));
param
.
add
(
new
BasicNameValuePair
(
"pageSize"
,
objec
.
getString
(
"pageSize"
)));
param
.
add
(
new
BasicNameValuePair
(
"startTime"
,
objec
.
getString
(
"startTime"
)));
param
.
add
(
new
BasicNameValuePair
(
"endTime"
,
objec
.
getString
(
"endTime"
)));
HttpPost
post
=
new
HttpPost
(
"http://10.146.8.221:9002/medicinal-web/a/statics/delayStore/list"
);
post
.
setHeader
(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
post
.
setEntity
(
new
UrlEncodedFormEntity
(
param
));
HttpResponse
reponse
=
client
.
execute
(
post
);
HttpEntity
entity
=
reponse
.
getEntity
();
result
=
EntityUtils
.
toString
(
entity
,
"UTF-8"
);
}
catch
(
Exception
e
)
{
result
=
e
.
getMessage
();
}
return
result
;
}
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment