|
@@ -1,6 +1,7 @@
|
|
|
package com.yh.saas.plugin.yiliangyiyun.controller;
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
|
import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
|
|
@@ -11,11 +12,23 @@ import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseNumView;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseView;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.WarehousePositionStorageInfoMapper;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseBaseInfoService;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.util.Const;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
+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.HttpGet;
|
|
|
+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.message.BasicNameValuePair;
|
|
|
+import org.apache.http.util.EntityUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -43,7 +56,24 @@ public class WarehouseBaseInfoController {
|
|
|
public String addWarehouse(@RequestBody WarehouseBaseInfo warehouseBaseInfo) {
|
|
|
return warehouseBaseInfoService.addWarehouse(warehouseBaseInfo);
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 添加仓库
|
|
|
+ */
|
|
|
+ @GetMapping("/api/getToken")
|
|
|
+ public String getToken() throws IOException {
|
|
|
+ HttpGet httpGet = new HttpGet("https://bi.zhaoliangsz.com:9230/ccm-api/v1/videos/account");
|
|
|
+
|
|
|
+ CloseableHttpClient httpClient = HttpClients.createDefault();
|
|
|
+ HttpResponse response = httpClient.execute(httpGet);
|
|
|
+ HttpEntity entity = response.getEntity();
|
|
|
+ String body = EntityUtils.toString(entity, "utf-8");
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(body);
|
|
|
+ JSONObject res = jsonObject.getJSONObject("data");
|
|
|
+ if(res!=null){
|
|
|
+ return res.getString("token");
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
/**
|
|
|
* 添加临时仓库
|
|
|
*
|