|
|
@@ -2,11 +2,6 @@ package com.uas.eis.controller;
|
|
|
|
|
|
import com.uas.eis.core.config.SpObserver;
|
|
|
import com.uas.eis.service.SERESService;
|
|
|
-import org.apache.http.client.methods.CloseableHttpResponse;
|
|
|
-import org.apache.http.client.methods.HttpPost;
|
|
|
-import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
-import org.apache.http.impl.client.HttpClients;
|
|
|
-import org.apache.http.util.EntityUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -27,9 +22,7 @@ public class SERESController {
|
|
|
@ResponseBody
|
|
|
public Map<String, Object> getStock() throws IOException {
|
|
|
SpObserver.putSp("AW_ZHJK");
|
|
|
- Map<String, Object> modelMap = new HashMap<String, Object>();
|
|
|
- String token=seresService.getToken();
|
|
|
- modelMap.put("token",token);
|
|
|
+ Map<String, Object> modelMap = seresService.getStock();
|
|
|
return modelMap;
|
|
|
}
|
|
|
|
|
|
@@ -58,6 +51,20 @@ public class SERESController {
|
|
|
return modelMap;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /***************************************************************************************************************************************/
|
|
|
+ //以下为测试用
|
|
|
+ //获取token
|
|
|
+ @PostMapping("/erp/ZHJK/getToken")
|
|
|
+ @ResponseBody
|
|
|
+ public Map<String, Object> getToken() throws IOException {
|
|
|
+ SpObserver.putSp("AW_ZHJK");
|
|
|
+ Map<String, Object> modelMap = new HashMap<String, Object>();
|
|
|
+ String token=seresService.getToken();
|
|
|
+ modelMap.put("token",token);
|
|
|
+ return modelMap;
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/erp/ZHJK/test")
|
|
|
@ResponseBody
|
|
|
public Map<String, Object> test(@RequestParam String token) throws Exception {
|
|
|
@@ -65,7 +72,7 @@ public class SERESController {
|
|
|
Map<String, Object> modelMap = seresService.test(token);
|
|
|
return modelMap;
|
|
|
}
|
|
|
-
|
|
|
+ //校验Token有效性
|
|
|
@PostMapping("/erp/ZHJK/testToken")
|
|
|
@ResponseBody
|
|
|
public Map<String, Object> testToken(@RequestParam String token) throws Exception {
|
|
|
@@ -74,11 +81,20 @@ public class SERESController {
|
|
|
modelMap.put("success", true);
|
|
|
return modelMap;
|
|
|
}
|
|
|
-
|
|
|
+ //对应正式请求/erp/ZHJK/getStock
|
|
|
@PostMapping("/erp/ZHJK/testGetStock")
|
|
|
@ResponseBody
|
|
|
public Map<String, Object> testGetStock(@RequestParam String token) throws Exception {
|
|
|
+ SpObserver.putSp("AW_ZHJK");
|
|
|
Map<String, Object> modelMap =seresService.testGetStock(token);
|
|
|
+ modelMap.put("token",token);
|
|
|
+ return modelMap;
|
|
|
+ }
|
|
|
+ //临时用于ERP端获取展示数据
|
|
|
+ @PostMapping("/erp/ZHJK/testGetStockData")
|
|
|
+ @ResponseBody
|
|
|
+ public Map<String, Object> testGetStockData(@RequestParam String token) throws Exception {
|
|
|
+ Map<String, Object> modelMap =seresService.testGetStockData(token);
|
|
|
modelMap.put("success", true);
|
|
|
return modelMap;
|
|
|
}
|