|
|
|
@ -6,6 +6,7 @@ import cn.hutool.http.HttpUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.dsideal.base.DataEase.Model.DataEaseModel;
|
|
|
|
|
import com.dsideal.base.Tools.Util.LocalMysqlConnectUtil;
|
|
|
|
|
import com.dsideal.base.Util.CommonUtil;
|
|
|
|
|
import com.dsideal.base.Util.FileUtil;
|
|
|
|
|
import com.jfinal.kit.PathKit;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
|
|
@ -36,35 +37,6 @@ public class CopyBigScreen {
|
|
|
|
|
return JSONObject.parseObject(res).getJSONObject("data").getString("token");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 利用雪花算法获取唯一ID
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static long getSnowId() {
|
|
|
|
|
Snowflake snowflake = IdUtil.createSnowflake(1, 1);
|
|
|
|
|
return snowflake.nextId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生成随机字符串
|
|
|
|
|
*
|
|
|
|
|
* @param len
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
static String randomString(int len) {
|
|
|
|
|
String alphabetsInUpperCase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
|
|
|
String alphabetsInLowerCase = "abcdefghijklmnopqrstuvwxyz";
|
|
|
|
|
String numbers = "0123456789";
|
|
|
|
|
String allCharacters = alphabetsInLowerCase + alphabetsInUpperCase + numbers;
|
|
|
|
|
StringBuilder randomString = new StringBuilder();
|
|
|
|
|
Random random = new Random();
|
|
|
|
|
for (int i = 0; i < len; i++) {
|
|
|
|
|
int randomIndex = random.nextInt(allCharacters.length());
|
|
|
|
|
randomString.append(allCharacters.charAt(randomIndex));
|
|
|
|
|
}
|
|
|
|
|
return randomString.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 清理通过本程序生成的所有副本,为了再次生成不重复
|
|
|
|
@ -179,12 +151,11 @@ public class CopyBigScreen {
|
|
|
|
|
cityParamsInfoRecord.set("params_id", cityOuterParamsRecord.getStr("params_id"));
|
|
|
|
|
cityParamsInfoRecord.set("params_info_id", UUID.randomUUID().toString());
|
|
|
|
|
Db.use(DB_NAME).save("visualization_outer_params_info", "params_info_id", cityParamsInfoRecord);
|
|
|
|
|
|
|
|
|
|
//发布共享链接
|
|
|
|
|
Record shareRecord = new Record().setColumns(motherShareRecord);
|
|
|
|
|
shareRecord.set("resource_id", childId);
|
|
|
|
|
shareRecord.set("id", getSnowId());
|
|
|
|
|
shareRecord.set("uuid", randomString(8));//大小写字母和数字组合,长度为8
|
|
|
|
|
shareRecord.set("id", CommonUtil.getSnowId());
|
|
|
|
|
shareRecord.set("uuid", CommonUtil.randomString(8));//大小写字母和数字组合,长度为8
|
|
|
|
|
Db.use(DataEaseModel.DB_NAME).save("xpack_share", "id", shareRecord);
|
|
|
|
|
System.out.println(cityName + "修改完成");
|
|
|
|
|
}
|
|
|
|
|