cefafee6 by Quilan

1

1 parent 84520ece
......@@ -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;
}
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!