| | |
| | | import com.lf.server.entity.all.BaseEntity; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.data.*; |
| | | import com.lf.server.entity.sys.DepEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.*; |
| | | import com.lf.server.mapper.all.BasicMapper; |
| | |
| | | excelLoader(list, req); |
| | | loadData(list); |
| | | copyFiles(list); |
| | | publishFiles(list); |
| | | // publishFiles(list) |
| | | insertMetas(list); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 加载空间数据 |
| | | */ |
| | | private void loadSpatialData(MetaFileEntity mf) { |
| | | public void loadSpatialData(MetaFileEntity mf) { |
| | | BasicMapper basicMapper = ClassHelper.getBasicMapper(mf.getEntity()); |
| | | if (null == basicMapper) { |
| | | return; |
| | |
| | | } |
| | | switch (mf.getExtName()) { |
| | | case StaticData.MPT: |
| | | linkFiles(mf, StaticData.MPT_EXT, pathHelper.getConfig().getPublishMptPath()); |
| | | linkFiles(mf, StaticData.MPT_EXT, pathHelper.getConfig().getUploadPath() + File.separator + "SG"); |
| | | break; |
| | | case StaticData.D3DML: |
| | | linkFiles(mf, null, pathHelper.getConfig().getPublish3dmlPath()); |
| | | linkFiles(mf, null, pathHelper.getConfig().getUploadPath() + File.separator + "SG"); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | } |
| | | |
| | | for (String ext : exts) { |
| | | File f=new File(source.replace(mf.getExtName(), ext)); |
| | | if (f.exists()&&!f.isDirectory()) { |
| | | File f = new File(source.replace(mf.getExtName(), ext)); |
| | | if (f.exists() && !f.isDirectory()) { |
| | | createFileLink(source.replace(mf.getExtName(), ext), target.replace(mf.getExtName(), ext)); |
| | | } |
| | | } |
| | |
| | | * 插入元数据 |
| | | */ |
| | | private void insertMetas(List<MetaFileEntity> list) { |
| | | int metaId = insertParentMeta(list); |
| | | for (MetaFileEntity mf : list) { |
| | | if (null != mf.getMsg()) { |
| | | continue; |
| | | } |
| | | |
| | | MetaEntity me = createMeta(mf); |
| | | MetaEntity me = createMeta(mf, metaId); |
| | | metaService.insert(me); |
| | | |
| | | mf.setMsg(me.getId() > 0 ? "成功" : "失败"); |
| | |
| | | /** |
| | | * 创建元数据 |
| | | */ |
| | | private MetaEntity createMeta(MetaFileEntity mf) { |
| | | private MetaEntity createMeta(MetaFileEntity mf, int metaId) { |
| | | MetaEntity me = new MetaEntity(); |
| | | me.setMetaid(metaId); |
| | | me.setEventid(mf.getEventid()); |
| | | me.setDircode(mf.getDircode()); |
| | | me.setDepcode(mf.getDepcode()); |
| | |
| | | |
| | | return me; |
| | | } |
| | | |
| | | /** |
| | | * 插入父元数据 |
| | | */ |
| | | private int insertParentMeta(List<MetaFileEntity> list) { |
| | | for (MetaFileEntity mf : list) { |
| | | if (null != mf.getMsg() || !mf.getIsMeta()) { |
| | | continue; |
| | | } |
| | | |
| | | MetaEntity me = createMeta(mf, 0); |
| | | me.setIsmeta((short) 1); |
| | | metaService.insert(me); |
| | | mf.setMsg(me.getId() > 0 ? "成功" : "失败"); |
| | | |
| | | return me.getId(); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | } |