c0702d3c by shiyunfei
2 parents d6e710be bbbac712
......@@ -7,8 +7,11 @@ jdbc.password=BOE190326jdfyy
spd_service_url = http://10.146.9.50:8080/medicinal-web/a/spdrecvsupplier/
spd_common_url = http://10.146.9.50:8080/medicinal-web/a/
huarun_service_url = http://61.190.54.189:8001/huarun/spd/syn/
platform_url= http://61.190.54.189:8001/huarun/
#spd服务地址
spd_wechat_url = http://10.146.9.50:8080/medicinal-web/a/wechat/
spd_wechat_login=http://10.146.9.50:8080/medicinal-web/a/login
......
......@@ -7,8 +7,11 @@ jdbc.password=BOE190326jdfyy
spd_service_url = http://10.146.9.50:8080/medicinal-web/a/spdrecvsupplier/
spd_common_url = http://10.146.8.221:9002/medicinal-web/a/
huarun_service_url = http://61.190.54.189:8001/huarun/spd/syn/
platform_url= http://61.190.54.189:8005/huarun/
#spd服务地址
spd_wechat_url = http://10.146.9.50:8080/medicinal-web/a/wechat/
spd_wechat_login=http://10.146.9.50:8080/medicinal-web/a/login
......
......@@ -10,6 +10,9 @@ public class PlatformConstant {
//SPD接口地址
public static final String PlatForm_SPD_Url = Global.getConfig("spd_service_url");
//SPD接口地址
public static final String PlatForm_SPD_Common_Url = Global.getConfig("spd_common_url");
//推送对账,发药,库存平台地址
public static final String PlatForm_URL = Global.getConfig("platform_url");
......
......@@ -8,11 +8,14 @@ import javax.servlet.http.HttpServletRequest;
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;
......@@ -111,6 +114,7 @@ public class SpdControlller {
@Autowired
private SuInvoiceBackService suInvoiceBackService;
private static HttpClient client;
@RequestMapping(value="/setMFMedGoods")
@ResponseBody
......@@ -926,4 +930,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(PlatformConstant.PlatForm_SPD_Common_Url+"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(PlatformConstant.PlatForm_SPD_Common_Url+"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(PlatformConstant.PlatForm_SPD_Common_Url+"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;
}
}
......
......@@ -7,8 +7,11 @@ jdbc.password=BOE190326jdfyy
spd_service_url = http://10.146.9.50:8080/medicinal-web/a/spdrecvsupplier/
spd_common_url = http://10.146.9.50:8080/medicinal-web/a/
huarun_service_url = http://61.190.54.189:8001/huarun/spd/syn/
platform_url= http://61.190.54.189:8001/huarun/
#spd服务地址
spd_wechat_url = http://10.146.9.50:8080/medicinal-web/a/wechat/
spd_wechat_login=http://10.146.9.50:8080/medicinal-web/a/login
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!