package com.qx.cloud.dpt.rest.test;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.qx.cloud.dpt.common.util.excel.PoiUtil;
import com.qx.cloud.dpt.param.bean.DParaDimensionRel;
import com.qx.cloud.dpt.resource.bean.C2SQueryResUnstrucResByURL;
import com.qx.cloud.dpt.resource.bean.ResDimensionMapping;
import com.qx.cloud.dpt.resource.bean.ResUnstructuredResource;
import com.qx.cloud.dpt.rest.param.DParaDimensionRelRest;
import com.qx.cloud.utils.HttpClientUtil;
import com.qx.cloud.utils.UuidUtil;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* 培优视频维度关联
* 20180712 by xuchq
*/
public class ImportPeiYouVideo {
public static void main(String[] args) {
/* try {
// String jsonStr = “{‘dicDimensionRelateId’:’3a9ba781c4ed435f9608814cfc71f469’}”;//“培优视频”维度rootId
String jsonStr = “{‘dicDimensionRelateId’:’15c749accfab457483be59d1c8817c0d’}”;//“培优视频”维度rootId
String getNodeIdMapAddress = “http://localhost:8080/qxcloudres/dparadimensionrel/getNodeIdMap.rest“;
Map nodeIdMap = JSONObject.parseObject(HttpClientUtil.send(getNodeIdMapAddress, JSONObject.parseObject(jsonStr)));
System.out.println(nodeIdMap);
}catch (Exception e){
System.out.println(e);
}*/
// String url = “C:\Users\QX\Desktop\培优视频维度关联.xlsx”;
String url = “C:\Users\QX\Desktop\教学视频1 _import.xlsx”;
try {
importPeiYouVideo(url);
} catch (Exception e) {
e.printStackTrace();
}
}
private static void importPeiYouVideo(String url) throws Exception {
// DParaDimensionRel parm = new DParaDimensionRel();
// parm.setDicDimensionRelateId(“15c749accfab457483be59d1c8817c0d”);
//获取所有维度-叶子id的map集合
String jsonStr = “{‘dicDimensionRelateId’:’3a9ba781c4ed435f9608814cfc71f469’}”;//“培优视频”维度rootId
String getNodeIdMapAddress = “http://localhost:8080/qxcloudres/dparadimensionrel/getNodeIdMap.rest“;
Map nodeIdMap = JSONObject.parseObject(HttpClientUtil.send(getNodeIdMapAddress, JSONObject.parseObject(jsonStr)));
List