| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.beust.jcommander.internal.Lists; |
| | | import com.product.common.collect.ListUtils; |
| | | import com.product.core.cache.DataPoolCacheImpl; |
| | | import com.product.core.config.CoreConst; |
| | | import com.product.core.dao.BaseDao; |
| | | import com.product.core.entity.DataTableEntity; |
| | |
| | | import com.product.core.util.CodeUtil; |
| | | import com.product.file.config.CmnConst; |
| | | import com.product.file.config.DocumentCode; |
| | | import com.product.file.config.FileCode; |
| | | import com.product.file.service.ide.IDocumentDirectoryService; |
| | | import com.product.module.sys.entity.SystemUser; |
| | | import com.product.quartz.service.impl.SysJobService; |
| | | import com.product.tool.table.enums.FieldType; |
| | | import com.product.util.BaseUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Copyright lx |
| | |
| | | public DocumentDirectoryService documentDirectoryService; |
| | | @Autowired |
| | | SysJobService sysJobService; |
| | | |
| | | /** |
| | | * 单位文件夹树 |
| | | * |
| | |
| | | sb.append(" (LENGTH(tricode) - LENGTH(REPLACE(tricode, '-', '')) + 1) \n"); |
| | | sb.append(") \n"); |
| | | sb.append("WHERE tricode LIKE ? \n"); |
| | | baseDao.executeUpdate(sb.toString(), new Object[] {tricode + "%"}); |
| | | }else { |
| | | baseDao.executeUpdate(sb.toString(), new Object[]{tricode + "%"}); |
| | | } else { |
| | | tricode = fseOrigin.getString(CmnConst.TRICODE); |
| | | } |
| | | } |
| | |
| | | fse.setValue(CmnConst.DIRECTORY_TIER, tricode.split("-").length); |
| | | return baseDao.saveFieldSetEntity(fse); |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public boolean saveFileConfig(FieldSetEntity fse) { |
| | | //获取功能表名 |
| | | FieldSetEntity functionUuid = baseDao.getFieldSet(CmnConst.PRODUCT_SYS_FUNCTIONS, fse.getString("function_uuid"), false); |
| | | |
| | | DataTableEntity field = baseDao.listTable(CmnConst.PRODUCT_SYS_DATAMODEL_FIELD, "table_uuid=? and field_name=?", new String[]{functionUuid.getString("table_uuid"), "archive_flag"}); |
| | | if (field.getRows()==0){ |
| | | DataTableEntity field = baseDao.listTable(CmnConst.PRODUCT_SYS_DATAMODEL_FIELD, "table_uuid=? and field_type='archive-sign'", new String[]{functionUuid.getString("table_uuid")}); |
| | | if (field.getRows() == 0) { |
| | | String fieldName = "archive_flag"; |
| | | FieldSetEntity fieldInfo = null; |
| | | int i = 0; |
| | | do { |
| | | if (i > 0) { |
| | | fieldName = "archive_flag_" + i; |
| | | } |
| | | fieldInfo = BaseUtil.getSingleInfoByCache("表字段信息", new String[]{functionUuid.getString("table_uuid"), fieldName}); |
| | | i++; |
| | | } while (FieldSetEntity.isEmpty(fieldInfo)); |
| | | FieldSetEntity fs = new FieldSetEntity(); |
| | | fs.setTableName(CmnConst.PRODUCT_SYS_DATAMODEL_FIELD); |
| | | fs.setValue("table_uuid",functionUuid.getString("table_uuid")); |
| | | fs.setValue("field_name","archive_flag"); |
| | | fs.setValue("field_type","int"); |
| | | fs.setValue("field_show_name","归档标识"); |
| | | fs.setValue("field_description","归档标识"); |
| | | fs.setValue("field_length",10); |
| | | fs.setValue("field_unit",0); |
| | | fs.setValue("is_required",0); |
| | | fs.setValue("is_unique",0); |
| | | fs.setValue("is_filter",0); |
| | | fs.setValue("field_sequence",0); |
| | | fs.setValue("created_by",SpringMVCContextHolder.getCurrentUser().getUser_id()); |
| | | fs.setValue("created_utc_datetime",new Date()); |
| | | fs.setValue("table_uuid", functionUuid.getString("table_uuid")); |
| | | fs.setValue("field_name", fieldName); |
| | | fs.setValue("field_type", FieldType.ARCHIVE_SIGN.getDictValue()); |
| | | fs.setValue("field_show_name", "归档标识"); |
| | | fs.setValue("field_description", "归档标识"); |
| | | fs.setValue("field_length", 4); |
| | | fs.setValue("field_unit", 0); |
| | | fs.setValue("is_required", 0); |
| | | fs.setValue("is_unique", 0); |
| | | fs.setValue("is_filter", 0); |
| | | fs.setValue("field_sequence", 0); |
| | | fs.setValue("created_by", SpringMVCContextHolder.getCurrentUser().getUser_id()); |
| | | fs.setValue("created_utc_datetime", new Date()); |
| | | baseDao.saveFieldSetEntity(fs); |
| | | FieldSetEntity table = baseDao.getFieldSet(CmnConst.PRODUCT_SYS_DATAMODEL_TABLE, functionUuid.getString("table_uuid"), false); |
| | | baseDao.executeUpdate("ALTER TABLE "+table.getString("table_name")+" ADD COLUMN archive_flag INT(4) COMMENT '归档标识';"); |
| | | baseDao.executeUpdate("ALTER TABLE " + table.getString("table_name") + " ADD COLUMN " + fieldName + " varchar(10) COMMENT '归档标识';"); |
| | | } |
| | | |
| | | |
| | | FieldSetEntity timedTask = baseDao.getFieldSetByFilter("product_sys_timed_task", "job_name=? and invoke_target like concat('%',?,'%') ", new String[]{fse.getString("filing_name") + "定时", fse.getString("uuid")}, false); |
| | | String timeTaskUuid=null; |
| | | if (!FieldSetEntity.isEmpty(timedTask)){ |
| | | timeTaskUuid=timedTask.getUUID(); |
| | | String timeTaskUuid = null; |
| | | if (!FieldSetEntity.isEmpty(timedTask)) { |
| | | timeTaskUuid = timedTask.getUUID(); |
| | | } |
| | | boolean re = baseDao.saveFieldSetEntity(fse); |
| | | createdTimeTask(fse.getString("filing_name"),fse.getString("cron"),fse.getUUID(),timeTaskUuid); |
| | | createdTimeTask(fse.getString("filing_name"), fse.getString("cron"), fse.getUUID(), timeTaskUuid); |
| | | return re; |
| | | } |
| | | |
| | | private FieldSetEntity createdTimeTask(String target_table, String execute_time, String task_uuid, String timeTaskUuid) throws BaseException { |
| | | // |
| | | FieldSetEntity fse = new FieldSetEntity(); |
| | |
| | | } |
| | | // |
| | | } |
| | | |
| | | /** |
| | | * 归档定时任务 |
| | | */ |
| | | @Transactional |
| | | public void fileTime(String uuid){ |
| | | FieldSetEntity fs = baseDao.getFieldSet(CmnConst.PRODUCT_AO_FILING_CONFIG,uuid,false); |
| | | FieldSetEntity functionUuid = baseDao.getFieldSet(CmnConst.PRODUCT_SYS_FUNCTIONS, fs.getString("function_uuid"), false); |
| | | DataTableEntity fieldTable = baseDao.listTable(CmnConst.PRODUCT_SYS_DATAMODEL_FIELD, "table_uuid=? and (field_type='file' or field_name='flow_flag')", new String[]{functionUuid.getString("table_uuid")}," field_type "); |
| | | public void fileTime(String uuid) { |
| | | FieldSetEntity fs = baseDao.getFieldSet(CmnConst.PRODUCT_AO_FILING_CONFIG, uuid, false); |
| | | FieldSetEntity function = BaseUtil.getSingleInfoByCache("所有功能", new String[]{fs.getString("function_uuid"), fs.getString(CmnConst.FUNCTION_UUID)}); |
| | | |
| | | FieldSetEntity table = baseDao.getFieldSet(CmnConst.PRODUCT_SYS_DATAMODEL_TABLE, functionUuid.getString("table_uuid"), false); |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("select concat("); |
| | | String flow_flag=""; |
| | | for (int i = 0; i <fieldTable.getRows() ; i++) { |
| | | if (i==0&&!fieldTable.getString(i, "field_name").equals("flow_flag")){ |
| | | sb.append("a.").append(fieldTable.getString(i, "field_name")); |
| | | }else if (i!=0&&!fieldTable.getString(i, "field_name").equals("flow_flag")){ |
| | | sb.append(",',',").append("a.").append(fieldTable.getString(i, "field_name")); |
| | | DataTableEntity tableFields = DataPoolCacheImpl.getInstance().getCacheData("所有字段信息并按表分组", new String[]{function.getString("table_uuid")}); |
| | | if (DataTableEntity.isEmpty(tableFields)) { |
| | | return; |
| | | } |
| | | String flowSignField = null; |
| | | String archiveFlagField = null; |
| | | |
| | | }else if (fieldTable.getString(i,"field_name").equals("flow_flag")){ |
| | | flow_flag=" and a.flow_flag=2"; |
| | | |
| | | Set<String> fileField = new HashSet<>(); |
| | | Map<String, String> map = new HashMap<>(); |
| | | for (int i = 0; i < tableFields.getRows(); i++) { |
| | | String fieldType = tableFields.getString(i, "field_type"); |
| | | if (FieldType.FILE.getDictValue().equals(fieldType)) { |
| | | fileField.add(tableFields.getString(i, "field_name")); |
| | | } else if (FieldType.FLOWSIGN.getDictValue().equals(fieldType)) { |
| | | flowSignField = tableFields.getString(i, "field_name"); |
| | | } else if (FieldType.ARCHIVE_SIGN.getDictValue().equals(fieldType)) { |
| | | archiveFlagField = tableFields.getString(i, "field_name"); |
| | | } |
| | | map.put(tableFields.getString(i, "field_name"), ""); |
| | | } |
| | | if (StringUtils.isEmpty(flowSignField) || StringUtils.isEmpty(archiveFlagField) || fileField.isEmpty()) { |
| | | return; |
| | | } |
| | | FieldSetEntity tableInfo = BaseUtil.getSingleInfoByCache("所有表信息(uuid)", new String[]{function.getString("table_uuid")}); |
| | | if (FieldSetEntity.isEmpty(tableInfo)) { |
| | | return; |
| | | } |
| | | StringBuilder sql = new StringBuilder(); |
| | | int pageSize = 1000; |
| | | String sub_folder = fs.getString("sub_folder"); |
| | | List<String> businessValueField = Lists.newArrayList(); |
| | | if (!map.containsKey(fs.getString("field_title"))) { |
| | | throw new BaseException(FileCode.ARCHIVE_FILE_TITLE_FIELD_NO_EXIST); |
| | | } |
| | | businessValueField.add(fs.getString("field_title")); |
| | | if (!StringUtils.isEmpty(sub_folder)) { |
| | | String[] split = sub_folder.split("/"); |
| | | for (int i = 0; i < split.length; i++) { |
| | | String name = split[i]; |
| | | if (StringUtils.startsWith(name, "{#") && StringUtils.endsWith(name, "#}")) { |
| | | name = split[i].replace("{#", "").replace("#}", ""); |
| | | if (map.containsKey(name)) { |
| | | businessValueField.add(name); |
| | | } |
| | | } |
| | | } |
| | | sb.append(") file,a.uuid,b.uuid directory_uuid,"); |
| | | sb.append("a.").append(fs.getString("field_title")); |
| | | sb.append(",a.").append(fs.getString("field_send_time")).append(" send_time"); |
| | | sb.append(",c.user_name "); |
| | | sb.append(" from "); |
| | | sb.append(table.getString("table_name")).append(" a "); |
| | | sb.append(" LEFT JOIN (SELECT uuid,directory_name,filing_config_field_uuid FROM product_oa_directory where filing_config_table=? and tricode_parent='").append(fs.getString("filing_catalog")).append("') b "); |
| | | sb.append("on a.").append(fs.getString("field_title")).append("=b.directory_name and a.uuid=b.filing_config_field_uuid "); |
| | | } else { |
| | | sub_folder = "{#" + fs.getString("field_title") + "#}"; |
| | | } |
| | | //查询业务数据 |
| | | sql.append("SELECT\n"); |
| | | // sql.append("\tT1.").append(fs.getString("field_title")).append(" as title"); |
| | | for (int i = 0; i < businessValueField.size(); i++) { |
| | | sql.append("\tT1." + businessValueField.get(i) + " as val_").append(i).append("\n,"); |
| | | } |
| | | sql.append("\tT2.uuid,T2.attachment_size,T2.file_name,T3.dict_label file_type\n"); |
| | | sql.append("FROM\n"); |
| | | sql.append("\t").append(tableInfo.getString(CoreConst.FIELD_TABLE_NAME)).append(" T1\n"); |
| | | sql.append("\tJOIN product_sys_flow_detail T4 ON T1.uuid=T4.record_uuid\n"); |
| | | sql.append("\tJOIN product_sys_attachments T2 ON T1.attachment = T2.uuid or T1.attachment_meeting=T2.uuid\n"); |
| | | sql.append("\tJOIN product_sys_dict T3 ON T2.attachment_type_uuid=T3.uuid\n"); |
| | | sql.append("WHERE\n"); |
| | | sql.append("\tT1.flow_flag =2\n"); |
| | | sql.append("\tAND T1." + archiveFlagField + " =1\n"); |
| | | sql.append("\tAND T4.table_name='").append(tableInfo.getString(CoreConst.FIELD_TABLE_NAME)).append("'\n"); |
| | | sql.append("\tGROUP BY 1,2,3,4 limit ").append(pageSize); |
| | | |
| | | sb.append(" LEFT JOIN product_sys_users c on a.").append(fs.getString("field_send_user")).append("=c.user_id"); |
| | | sb.append(" where (a.archive_flag!=1 or a.archive_flag is null) "); |
| | | sb.append(flow_flag); |
| | | sb.append(" ORDER BY a.id LIMIT 1000 "); |
| | | DataTableEntity files = null; |
| | | String filing_catalog = fs.getString("filing_catalog"); |
| | | FieldSetEntity parentDir = baseDao.getFieldSetByFilter(CmnConst.PRODUCT_OA_DIRECTORY, "tricode=?", new String[]{filing_catalog}, false); |
| | | if (FieldSetEntity.isEmpty(parentDir)) { |
| | | throw new BaseException(FileCode.ARCHIVE_FILE_PARENT_DIRECTORY_NO_EXIST); |
| | | } |
| | | do { |
| | | |
| | | //获取流程里面的附件sql |
| | | StringBuffer nodeSal = new StringBuffer(); |
| | | nodeSal.append(" select a.uuid,b.flow_attachment from "); |
| | | nodeSal.append(table.getString("table_name")).append(" a "); |
| | | nodeSal.append(" LEFT JOIN product_sys_flow_detail b on a.uuid=b.record_uuid "); |
| | | nodeSal.append(" where (a.archive_flag!=1 or a.archive_flag is null) and b.flow_attachment is not null"); |
| | | nodeSal.append(flow_flag); |
| | | nodeSal.append(" ORDER BY a.id LIMIT 1000 "); |
| | | |
| | | fieldLimit(sb.toString(),nodeSal.toString(),fs.getString("field_title"),fs.getString("filing_catalog"),fs.getString("turn_button"),table.getString("table_name")); |
| | | files = baseDao.listTable(sql.toString(), new Object[]{}); |
| | | if (DataTableEntity.isEmpty(files)) { |
| | | break; |
| | | } |
| | | for (int i = 0; i < files.getRows(); i++) { |
| | | FieldSetEntity file = files.getFieldSetEntity(i); |
| | | for (int i1 = 0; i1 < businessValueField.size(); i1++) { |
| | | String value = file.getString("val_" + i1); |
| | | if (StringUtils.isEmpty(value)) { |
| | | continue; |
| | | } |
| | | sub_folder = sub_folder.replace("{#" + businessValueField.get(i1) + "#}", value); |
| | | } |
| | | String[] dirs = sub_folder.split("/"); |
| | | //递归查询父级目录 |
| | | FieldSetEntity parent = parentDir; |
| | | for (int j = 0; j < dirs.length; j++) { |
| | | String dir = dirs[j]; |
| | | FieldSetEntity temp = baseDao.getFieldSetByFilter(CmnConst.PRODUCT_OA_DIRECTORY, "tricode_parent=? and directory_name=", new String[]{parent.getString("tricode"), dir}, false); |
| | | if (FieldSetEntity.isEmpty(temp)) { |
| | | //创建文件夹 |
| | | parent = addDirectory(dir, BaseUtil.createCode(CmnConst.PRODUCT_OA_DIRECTORY, |
| | | CmnConst.TRICODE, |
| | | parent.getString("tricode")), parent.getString(CmnConst.TRICODE), parent.getInteger("directory_tier") + 1, fs.getUUID(), tableInfo.getString(CoreConst.FIELD_TABLE_NAME)); |
| | | } |
| | | } |
| | | FieldSetEntity document = new FieldSetEntity(); |
| | | document.setTableName(CmnConst.PRODUCT_OA_DOCUMENT); |
| | | document.setValue("directory_uuid", parent.getUUID()); |
| | | document.setValue("file_name", file.getString("file_name")); |
| | | document.setValue("attachments_uuid", file.getUUID()); |
| | | document.setValue("file_type", file.getString("file_type")); |
| | | document.setValue("created_by", 1); |
| | | document.setValue("created_utc_datetime", new Date()); |
| | | document.setValue("file_size", file.getString("attachment_size")); |
| | | baseDao.saveFieldSetEntity(document); |
| | | } |
| | | } while (!DataTableEntity.isEmpty(files)); |
| | | |
| | | |
| | | } |
| | |
| | | * @param field_title 标题字段 |
| | | * @param filing_catalog 父级归档目录 |
| | | */ |
| | | private void fieldLimit(String sql,String nodeSal,String field_title,String filing_catalog,String turn_button,String table){ |
| | | private void fieldLimit(String sql, String nodeSal, String field_title, String sub_folder, String filing_catalog, String turn_button, String table) { |
| | | |
| | | //获取父类文档信息 |
| | | FieldSetEntity parentDirectory = baseDao.getFieldSetByFilter(CmnConst.PRODUCT_OA_DIRECTORY, "tricode=?", new String[]{filing_catalog}, false); |
| | | DataTableEntity fieldDt = baseDao.listTable(sql, new String[]{table}); |
| | | //获取流程附件并加入到file里 |
| | | DataTableEntity nodeDt = baseDao.listTable(nodeSal, new String[]{}); |
| | | for (int i = 0; i <nodeDt.getRows() ; i++) { |
| | | for (int i = 0; i < nodeDt.getRows(); i++) { |
| | | FieldSetEntity fieldfs = fieldDt.getFieldSetEntity(nodeDt.getString(i, "uuid")).get(0); |
| | | if (!FieldSetEntity.isEmpty(fieldfs)){ |
| | | if (StringUtils.isEmpty(fieldfs.getString("file"))){ |
| | | fieldfs.setValue("file",nodeDt.getString(i,"flow_attachment")); |
| | | }else { |
| | | fieldfs.setValue("file",fieldfs.getString("file")+","+nodeDt.getString(i,"flow_attachment")); |
| | | if (!FieldSetEntity.isEmpty(fieldfs)) { |
| | | if (StringUtils.isEmpty(fieldfs.getString("file"))) { |
| | | fieldfs.setValue("file", nodeDt.getString(i, "flow_attachment")); |
| | | } else { |
| | | fieldfs.setValue("file", fieldfs.getString("file") + "," + nodeDt.getString(i, "flow_attachment")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | ArrayList<String> fileList = new ArrayList<>(); |
| | | for (int i = 0; i <fieldDt.getRows() ; i++) { |
| | | for (int i = 0; i < fieldDt.getRows(); i++) { |
| | | String file = fieldDt.getString(i, "file"); |
| | | if (!StringUtils.isEmpty(file)){ |
| | | if (!StringUtils.isEmpty(file)) { |
| | | for (int j = 0; j < file.split(",").length; j++) { |
| | | fileList.add(file.split(",")[j]); |
| | | } |
| | | } |
| | | } |
| | | DataTableEntity attachments = baseDao.listTable(CmnConst.PRODUCT_SYS_ATTACHMENTS, BaseUtil.buildQuestionMarkFilter("uuid", fileList.size(), true), fileList.toArray(new String[0])); |
| | | if (fieldDt.getRows()>0) { |
| | | if (fieldDt.getRows() > 0) { |
| | | for (int i = 0; i < fieldDt.getRows(); i++) { |
| | | FieldSetEntity fs = fieldDt.getFieldSetEntity(i); |
| | | String directoryUUID=null; |
| | | if (StringUtils.isEmpty(fs.getString("directory_uuid"))){ |
| | | //根据上级目录获取目录编号 |
| | | String tricode = CodeUtil.getNewCodeByTemp(CmnConst.PRODUCT_OA_DIRECTORY, CmnConst.TRICODE, filing_catalog); |
| | | //获取目录名称 |
| | | String title = fs.getString(field_title); |
| | | directoryUUID = addDirectory(title, tricode, filing_catalog, parentDirectory.getInteger("directory_tier") + 1,fs.getUUID(),table); |
| | | String directoryUUID = null; |
| | | if (StringUtils.isEmpty(fs.getString("directory_uuid"))) { |
| | | //根据上级目录获取目录编号 |
| | | String tricode = CodeUtil.getNewCodeByTemp(CmnConst.PRODUCT_OA_DIRECTORY, CmnConst.TRICODE, filing_catalog); |
| | | //获取目录名称 |
| | | String title = fs.getString(field_title); |
| | | directoryUUID = addDirectory(title, tricode, filing_catalog, parentDirectory.getInteger("directory_tier") + 1, fs.getUUID(), table).getUUID(); |
| | | |
| | | }else { |
| | | directoryUUID=fs.getString("directory_uuid"); |
| | | } else { |
| | | directoryUUID = fs.getString("directory_uuid"); |
| | | } |
| | | String file = fs.getString("file"); |
| | | if (!StringUtils.isEmpty(file)){ |
| | | for (int j = 0; j <file.split(",").length ; j++) { |
| | | if (!StringUtils.isEmpty(file)) { |
| | | for (int j = 0; j < file.split(",").length; j++) { |
| | | //创建文件 |
| | | String f = file.split(",")[j]; |
| | | if (StringUtils.isEmpty(file.split(",")[j])||DataTableEntity.isEmpty(attachments)){ |
| | | if (StringUtils.isEmpty(file.split(",")[j]) || DataTableEntity.isEmpty(attachments)) { |
| | | continue; |
| | | } |
| | | FieldSetEntity attachmentsFs = attachments.getFieldSetEntity(f).get(0); |
| | | FieldSetEntity document = new FieldSetEntity(); |
| | | document.setTableName(CmnConst.PRODUCT_OA_DOCUMENT); |
| | | document.setValue("directory_uuid",directoryUUID); |
| | | document.setValue("file_name",attachmentsFs.getString("file_name")); |
| | | document.setValue("attachments_uuid",f); |
| | | document.setValue("directory_uuid", directoryUUID); |
| | | document.setValue("file_name", attachmentsFs.getString("file_name")); |
| | | document.setValue("attachments_uuid", f); |
| | | String[] type = f.split("\\."); |
| | | document.setValue("file_type",type[type.length-1]); |
| | | document.setValue("file_type", type[type.length - 1]); |
| | | document.setValue("created_by", 1); |
| | | document.setValue("created_utc_datetime", new Date()); |
| | | document.setValue("file_size", attachmentsFs.getString("attachment_size")); |
| | |
| | | } |
| | | FieldSetEntity document = new FieldSetEntity(); |
| | | document.setTableName(CmnConst.PRODUCT_OA_DOCUMENT); |
| | | document.setValue("directory_uuid",directoryUUID); |
| | | document.setValue("file_name",fs.getString(field_title)+" "+fs.getString("user_name")+" "+fs.getString("send_time")); |
| | | document.setValue("directory_uuid", directoryUUID); |
| | | document.setValue("file_name", fs.getString(field_title) + " " + fs.getString("user_name") + " " + fs.getString("send_time")); |
| | | document.setValue("created_by", 1); |
| | | document.setValue("created_utc_datetime", new Date()); |
| | | document.setValue("turn_button", turn_button); |
| | | document.setValue("file_size", 0); |
| | | document.setValue("file_type","虚拟文档"); |
| | | document.setValue("file_type", "虚拟文档"); |
| | | |
| | | baseDao.saveFieldSetEntity(document); |
| | | baseDao.executeUpdate("UPDATE "+table+" set archive_flag =1 where uuid=?",new String[]{fs.getUUID()}); |
| | | baseDao.executeUpdate("UPDATE " + table + " set archive_flag =1 where uuid=?", new String[]{fs.getUUID()}); |
| | | } |
| | | fieldLimit(sql,nodeSal,field_title,filing_catalog,turn_button,table); |
| | | fieldLimit(sql, nodeSal, field_title, sub_folder, filing_catalog, turn_button, table); |
| | | } |
| | | } |
| | | |
| | |
| | | * @param directory_tier 目录层级 |
| | | */ |
| | | |
| | | private String addDirectory(String field_title,String tricode,String tricode_parent,Integer directory_tier,String filing_config_field_uuid,String table){ |
| | | //新建目录 |
| | | private FieldSetEntity addDirectory(String field_title, String tricode, String tricode_parent, Integer directory_tier, String filing_config_field_uuid, String table) { |
| | | //新建目录 |
| | | FieldSetEntity fsDirectory = new FieldSetEntity(); |
| | | fsDirectory.setTableName(CmnConst.PRODUCT_OA_DIRECTORY); |
| | | fsDirectory.setValue("created_by", 1); |
| | |
| | | fsDirectory.setValue("filing_config_table", table); |
| | | |
| | | baseDao.saveFieldSetEntity(fsDirectory); |
| | | return fsDirectory.getUUID(); |
| | | return fsDirectory; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |