main
黄海 7 months ago
parent 411a1308b6
commit 2086213009

@ -1,4 +1,4 @@
package Tools;
package Tools.ZhengZhou103;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSONArray;
@ -16,29 +16,11 @@ import java.sql.*;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public class AddZhengZhou103GongWenNum {
public class AddWenNum {
//下面的工作流定义没有用到,但是结合工作界面才能读懂是什么意思
//select * from t_intellioa_flow_define where flow_name='0105改-收文登记流程'; -- flow_id = 68 工作流id
public static String dirPath = "D:\\ZhengZhou103";
/**
*
*
* @param tableName
* @param content
*/
public static void BackupData(String tableName, String content) {
File directory = new File(dirPath);
if (!directory.exists() && directory.isDirectory()) {
//创建目录
directory.mkdirs();
}
//备份的文件名称: 当前时间的年月日时分秒
String path = tableName + "_" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + ".json";
FileUtil.writeUtf8String(content, path);
}
/**
* Form
@ -51,8 +33,6 @@ public class AddZhengZhou103GongWenNum {
//1、修改form下的json数据
String sql = "select form_id,form_json from t_intellioa_flow_form where form_id=?";
String form_json = Db.findFirst(sql, form_id).getStr("form_json");
//备份
BackupData("t_intellioa_flow_form", form_json);
JSONObject jo = JSONObject.parseObject(form_json);
int id = 0;
for (Object fieldList : jo.getJSONArray("field_list")) {
@ -92,8 +72,6 @@ public class AddZhengZhou103GongWenNum {
String sql = "select field_id,field_attribute from t_intellioa_flow_form_field where form_id=36 and field_label='原文号' and is_deleted=0;";
Record record = Db.findFirst(sql);
String field_attribute = record.getStr("field_attribute");
//备份
BackupData("t_intellioa_flow_form_field", field_attribute);
int field_id = record.getInt("field_id");
JSONObject jo = JSONObject.parseObject(field_attribute);
JSONArray ja = jo.getJSONArray("textAry");
Loading…
Cancel
Save