| | |
| | | } |
| | | |
| | | @Override |
| | | public MetaEntity selectMetaByName(String name) { |
| | | return attachMapper.selectMetaByName(name); |
| | | public Integer insertAttachByMeta(String metaName, String tab, String tabGuid) { |
| | | return attachMapper.insertAttachByMeta(metaName, tab, tabGuid); |
| | | } |
| | | |
| | | /** |
| | |
| | | return; |
| | | } |
| | | |
| | | Field field = getAnnexField(list.get(0), fieldName); |
| | | Field field = UploadAttachService.getAnnexField(list.get(0), tab); |
| | | if (null == field) { |
| | | return; |
| | | } |
| | | |
| | | for (Object obj : list) { |
| | | String[] names = UploadAttachService.getNames(UploadAttachService.getAnnexName(obj, field)); |
| | | if (null == names || names.length == 0) { |
| | | continue; |
| | | } |
| | | |
| | | BaseEntity be = (BaseEntity) obj; |
| | | // |
| | | for (String name : names) { |
| | | insertAttachByMeta(name, tab, be.getEventid()); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | wrapper.apply(field + " is not null"); |
| | | |
| | | return baseMapper.selectList(wrapper); |
| | | } |
| | | |
| | | /** |
| | | * 获取附件字段 |
| | | */ |
| | | private Field getAnnexField(Object obj, String name) { |
| | | try { |
| | | Field field = obj.getClass().getDeclaredField(name); |
| | | field.setAccessible(true); |
| | | |
| | | return field; |
| | | } catch (Exception ex) { |
| | | return null; |
| | | } |
| | | } |
| | | } |