|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Object gboat2.attachment.AttachmentHelper
public class AttachmentHelper
将初始预期应该上传的文件与已经上传的附件做对比合并,形成前端附件上传组件所需要的附件列表
构造方法摘要 | |
---|---|
protected |
AttachmentHelper()
|
方法摘要 | |
---|---|
static void |
deleteAttachment(String attachId)
删除附件 |
static void |
deleteAttachmentByBelongId(String belongId)
删除 附件 by belongId |
static void |
deleteAttachments(String[] attachIds)
删除附件(可以删除多个,id以,分隔) |
static Map<AttachConfig,List<Attachment>> |
findAttachments(String configCode,
String belongId)
根据业务模块的编码及主记录的主键,获取某个业务模块的所有附件配置对象及其对应的附件列表 |
static TypedAttachments |
findAttachmentsBy(String configCode,
String belongId)
获取某个模块的所有附件 |
static String |
findAttachmentsJsonBy(String configCode,
String belongId)
获取某个模块的所有附件 |
static List<Attachment> |
findAttachsBy(String belongId)
根据belongId返回某个宿主对象的附件列表 |
static List<Attachment> |
findAttachsBy(String belongId,
String attachType)
已过时。 replaced by IAttachmentService.getAttachmentsBy(String, String) |
static List<Attachment> |
findAttachsBy(String belongId,
String[] attachNames)
已过时。 replaced by IAttachmentService.getAttachmentsBy(String, String[]) |
static String |
findAttachsJsonBy(String belongId)
根据指定belongId的附件列表, 返回json字符串形式 |
static String |
findAttachsJsonBy(String belongId,
String[][] types)
已过时。 replaced by #findAttachsJsonBy(String, List) |
static String |
findAttachsJsonByAttachNames(String belongId,
String[][] types)
已过时。 |
static List<AttachmentVO> |
findAttachVOsBy(String belongId)
根据belongId返回某个宿主对象的附件列表 |
static List<Attachment> |
findSortedAttachsBy(String belongId,
String[][] types)
已过时。 |
static String |
findSortedAttachsJsonBy(String belongId,
String[][] types)
已过时。 |
static String |
getAbsoluteSavepath(Attachment attch)
获取指定附件的绝对路径,以便访问对应的文件 |
static File |
getAttachmentFile(Attachment attach)
返回附件对应的文件对象 |
static List<Attachment> |
getAttachmentsByAttachIds(String attachIds)
|
static String[][] |
getAvailableAttachTypeByCode(String attachCode)
已过时。 replaced by IAttachmentService.getAvailableAttachTypesByCode(String) |
static DownloadRecord |
getLastDownloadRecord(String organId,
String belongId,
String attachType)
判断指定类型的附件是否被下载过 |
static String |
getSavepathRoot()
取得保存附件的根路径,该路径是绝对路径,在读取附件文件时,需要将此根路径与savepath拼在一起 |
static Boolean |
isDownLoadFile(String organId,
String belongId,
String attachType)
判断指定类型的附件是否被下载过 |
static void |
saveAttachment(Attachment attach)
保存附件 |
static String |
toAttachsJson(List<Attachment> attachs,
String[][] types)
已过时。 replaced by toJsonString(TypedAttachments)
转换为附件组件使用的json字符串 |
static String |
toJsonString(List<Attachment> attachs)
将一个附件列表转成json 数组字符串形式 |
static String |
toJsonString(TypedAttachments attachs)
|
static void |
updateAttachsBelongId(String[] attachIds,
String belongId)
批量更新附件的belongId,将指定的所有附件的belongId更新为指定的值 |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
protected AttachmentHelper()
方法详细信息 |
---|
public static List<Attachment> findAttachsBy(String belongId)
belongId
- 宿主id
public static List<AttachmentVO> findAttachVOsBy(String belongId)
belongId
- 宿主id
public static File getAttachmentFile(Attachment attach)
attach
-
public static List<Attachment> getAttachmentsByAttachIds(String attachIds)
public static List<Attachment> findAttachsBy(String belongId, String attachType)
IAttachmentService.getAttachmentsBy(String, String)
belongId
- 宿主idattachType
- 附件类型
public static List<Attachment> findAttachsBy(String belongId, String[] attachNames)
IAttachmentService.getAttachmentsBy(String, String[])
belongId
- 宿主idattachNames
- 附件类型
public static List<Attachment> findSortedAttachsBy(String belongId, String[][] types)
belongId
- 宿主id,如果belongId为null,则认为指定的附件列表中所有附件均未上传过types
- 要求的附件列表,如new String[][]{{"附件1", "0"},{"附件2", "1"},{"附件3", "1"}},1为必传附件,0为选传附件
public static String findSortedAttachsJsonBy(String belongId, String[][] types)
belongId
- 宿主idtypes
- 要求的附件列表,如new String[][]{{"附件1", "0"},{"附件2", "1"},{"附件3", "1"}},1为必传附件,0为选传附件
public static String findAttachsJsonBy(String belongId, String[][] types)
#findAttachsJsonBy(String, List)
belongId
- 宿主idtypes
- 附件类型描述,如new String[][]{{"类型1", "0","memo"},...},1为必传附件,0为选传附件。如果只是查看附件,则本参数置为null即可。
{ types : [{name:'类型1', required : 1...},...], uploadeds : [] //附件列表的json格式 }
public static TypedAttachments findAttachmentsBy(String configCode, String belongId)
configCode
- 配置模块的编码belongId
- belongId 如果belongId为空,则不查询附件列表,适合在新增数据的情况下使用
public static Map<AttachConfig,List<Attachment>> findAttachments(String configCode, String belongId)
configCode
- 业务模块的编码belongId
- 业务记录的主键(主表的ID),可以为 null
public static String findAttachmentsJsonBy(String configCode, String belongId)
configCode
- 配置模块的编码belongId
- belongId 如果belongId为空,则不查询附件列表,适合在新增数据的情况下使用
{ types : [{name:'类型1', required : 'true', ...},...], uploadeds : [] //附件列表的json格式 }
public static String toAttachsJson(List<Attachment> attachs, String[][] types)
toJsonString(TypedAttachments)
转换为附件组件使用的json字符串
attachs
- 附件列表types
- 附件类型描述
public static String toJsonString(TypedAttachments attachs)
public static String findAttachsJsonByAttachNames(String belongId, String[][] types)
belongId
- types
-
public static String toJsonString(List<Attachment> attachs)
attachs
- 附件列表
public static String findAttachsJsonBy(String belongId)
belongId
- 宿主id
public static void updateAttachsBelongId(String[] attachIds, String belongId)
attachIds
- 附件idbelongId
- 宿主idpublic static void saveAttachment(Attachment attach)
Attachment
- attach 附件public static void deleteAttachments(String[] attachIds)
attachIds
- Attachment的id组成的字符串数组public static Boolean isDownLoadFile(String organId, String belongId, String attachType)
organId
- belongId
- attachType
- public static DownloadRecord getLastDownloadRecord(String organId, String belongId, String attachType)
organId
- belongId
- attachType
- public static void deleteAttachment(String attachId)
attachId
- Attachment idpublic static void deleteAttachmentByBelongId(String belongId)
belongId
- 主对象的主键,同时又是附件的belongIdpublic static String getSavepathRoot()
public static String getAbsoluteSavepath(Attachment attch)
attch
-
public static String[][] getAvailableAttachTypeByCode(String attachCode)
IAttachmentService.getAvailableAttachTypesByCode(String)
attachCode
-
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |