| | |
| | | |
| | | private static String tabs = "''"; |
| | | |
| | | private final static Map<String, String> ATTACH_TABS = new HashMap<>(); |
| | | public final static Map<String, String> ATTACH_TABS = new HashMap<>(); |
| | | |
| | | private final static Log log = LogFactory.getLog(UploadAttachService.class); |
| | | |
| | |
| | | return 0; |
| | | } |
| | | |
| | | Field field = getAnnexField(list.get(0), meta); |
| | | Field field = getAnnexField(list.get(0), meta.getTab()); |
| | | String folder = meta.getName().split("\\.")[0].trim().toLowerCase() + File.separator; |
| | | |
| | | int rows = 0; |
| | |
| | | /** |
| | | * 获取名称 |
| | | */ |
| | | private String[] getNames(String str) { |
| | | public static String[] getNames(String str) { |
| | | if (StringHelper.isEmpty(str)) { |
| | | return null; |
| | | } |
| | |
| | | /** |
| | | * 获取附件字段 |
| | | */ |
| | | private Field getAnnexField(Object obj, MetaEntity meta) { |
| | | public static Field getAnnexField(Object obj, String tab) { |
| | | try { |
| | | String str = ATTACH_TABS.get(meta.getTab()); |
| | | String str = ATTACH_TABS.get(tab); |
| | | |
| | | Field field = obj.getClass().getDeclaredField(str); |
| | | field.setAccessible(true); |
| | |
| | | /** |
| | | * 获取附件名称 |
| | | */ |
| | | private String getAnnexName(Object obj, Field field) { |
| | | public static String getAnnexName(Object obj, Field field) { |
| | | try { |
| | | Object val = field.get(obj); |
| | | |
| | |
| | | private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) { |
| | | DownloadEntity de = new DownloadEntity(); |
| | | de.setName(FileHelper.getFileName(file)); |
| | | // 1-Shp文件,2-专题图,3-元数据,4-业务数据,5-管道分析,6-统计报告,7-附件 |
| | | // 1-Shp文件,2-专题图,3-元数据,4-业务数据,5-管道分析,6-统计报告,7-附件文件,8-瓦片文件 |
| | | de.setType(7); |
| | | de.setSizes(FileHelper.sizeToMb(new File(file).length())); |
| | | de.setDepid(ue.getDepid()); |