|
@@ -7,6 +7,7 @@ import com.skyversation.xjcy.bean.*;
|
|
|
import com.skyversation.xjcy.util.HttpUtil;
|
|
import com.skyversation.xjcy.util.HttpUtil;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.core.io.FileSystemResource;
|
|
import org.springframework.core.io.FileSystemResource;
|
|
|
|
|
+import org.springframework.core.io.Resource;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.LinkedMultiValueMap;
|
|
import org.springframework.util.LinkedMultiValueMap;
|
|
|
import org.springframework.util.MultiValueMap;
|
|
import org.springframework.util.MultiValueMap;
|
|
@@ -52,7 +53,7 @@ public class DMSService {
|
|
|
return jsonObject;
|
|
return jsonObject;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public String updateToDms(List<JSONObject> objs,String token,DMSColumn column) {
|
|
|
|
|
|
|
+ public String updateToDms(Collection<JSONObject> objs,String token,DMSColumn column) {
|
|
|
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
|
|
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
|
|
|
params.add("modelId",column.getModelId());
|
|
params.add("modelId",column.getModelId());
|
|
|
params.add("json",JSON.toJSONString(objs));
|
|
params.add("json",JSON.toJSONString(objs));
|
|
@@ -60,17 +61,17 @@ public class DMSService {
|
|
|
headers.put("token", token);
|
|
headers.put("token", token);
|
|
|
return HttpUtil.requestPost(path+"/content/updateContentByJson",params,headers);
|
|
return HttpUtil.requestPost(path+"/content/updateContentByJson",params,headers);
|
|
|
}
|
|
}
|
|
|
- public String importToDms(FileSystemResource file, String token, DMSImport importType) {
|
|
|
|
|
|
|
+ public String importToDms(Resource resource, String token, DMSImport importType) {
|
|
|
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
|
|
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
|
|
|
params.add("columnId",importType.getColumn().getId());
|
|
params.add("columnId",importType.getColumn().getId());
|
|
|
- params.add("length", importType.getLength());
|
|
|
|
|
params.add("contentParam",importType.getContent());
|
|
params.add("contentParam",importType.getContent());
|
|
|
params.add("titleParam",importType.getTitle());
|
|
params.add("titleParam",importType.getTitle());
|
|
|
- params.add("content",importType.getRelation());
|
|
|
|
|
- params.add("file",file);
|
|
|
|
|
|
|
+ params.add("parseArray",importType.getRelation());
|
|
|
|
|
+ params.add("secretLevel",0);
|
|
|
|
|
+ params.add("file",resource);
|
|
|
Map<String,String> headers = new HashMap<>();
|
|
Map<String,String> headers = new HashMap<>();
|
|
|
headers.put("token", token);
|
|
headers.put("token", token);
|
|
|
- return HttpUtil.requestPost(path+"/content/contentImportExcelJsonFileData",params,headers);
|
|
|
|
|
|
|
+ return HttpUtil.requestPost(path+"/content/importBeautifiedExcel",params,headers);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private List<JSONObject> queryDmsList(DMSRequest request, String token, String columnId) {
|
|
private List<JSONObject> queryDmsList(DMSRequest request, String token, String columnId) {
|