| | |
| | | package com.lf.server.service.sys; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.lf.server.entity.all.BaseEntity; |
| | | import com.lf.server.entity.data.FmeLogEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.sys.AttachEntity; |
| | | import com.lf.server.helper.ClassHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return attachMapper.updateFmeLog(id); |
| | | } |
| | | |
| | | @Override |
| | | public MetaEntity selectMetaByName(String name) { |
| | | return attachMapper.selectMetaByName(name); |
| | | } |
| | | |
| | | /** |
| | | * 同步附件 |
| | | */ |
| | | public void syncAttaches(FmeLogEntity entity) { |
| | | String tab = entity.getPgNs() + "." + entity.getTcdm(); |
| | | String field = UploadAttachService.ATTACH_TABS.get(tab); |
| | | String fieldName = UploadAttachService.ATTACH_TABS.get(tab); |
| | | |
| | | List<?> list = selectRowsByParentid(entity.getTcdm().replace("_", ""), entity.getParentid(), field); |
| | | List<?> list = selectRowsByParentid(entity.getTcdm().replace("_", ""), entity.getParentid(), fieldName); |
| | | if (null == list || list.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | // |
| | | Field field = getAnnexField(list.get(0), fieldName); |
| | | if (null == field) { |
| | | return; |
| | | } |
| | | |
| | | for (Object obj : list) { |
| | | BaseEntity be = (BaseEntity) obj; |
| | | // |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | } |