| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据GUID查询GDB") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "GUID", dataType = "String", paramType = "query", example = "d58e66d9606a4b85e7c8ab43b3db0b55") |
| | | }) |
| | | @GetMapping(value = "/selectGdbByGuid") |
| | | public ResponseMsg<Object> selectGdbByGuid(String guid) { |
| | | try { |
| | | if (StringHelper.isEmpty(guid)) { |
| | | return fail("文件GUID值不能为空", null); |
| | | } |
| | | |
| | | List<MetaEntity> rs = metaService.selectGdbByGuid(guid); |
| | | |
| | | return success(null == rs ? 0 : rs.size(), rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据父ID分页查询并返回记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "metaid", value = "父ID", dataType = "String", paramType = "query", example = "0"), |
| | |
| | | |
| | | public final static String SHP = ".shp"; |
| | | |
| | | public final static String _GDB = "gdb"; |
| | | |
| | | public final static String GDB = ".gdb"; |
| | | |
| | | public final static String JPG = ".jpg"; |
| | |
| | | public List<MetaEntity> selectByPage(String depcode, String dircode, Integer verid, String name, Integer limit, Integer offset); |
| | | |
| | | /** |
| | | * 根据GUID查询GDB |
| | | * |
| | | * @param guid |
| | | * @return |
| | | */ |
| | | public List<MetaEntity> selectGdbByGuid(String guid); |
| | | |
| | | /** |
| | | * 查询记录数 |
| | | * |
| | | * @param depcode |
| | |
| | | MetaFileEntity mf = createMetaFileEntity(meta); |
| | | mf.setDircode(dircode); |
| | | mf.setEventid(StringHelper.getGuid()); |
| | | mf.setName(fileName + "\\" + tab); |
| | | // mf.setName(fileName + "\\" + tab) |
| | | mf.setName(fileName); |
| | | mf.setExtName(extName); |
| | | mf.setSizes(FileHelper.sizeToMb(f.length())); |
| | | mf.setPath(f.getPath().substring(start)); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MetaEntity> selectGdbByGuid(String guid) { |
| | | return metaMapper.selectGdbByGuid(guid); |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectMetasForCount(String depcode, String dirs, String name) { |
| | | depcode = StringHelper.getRightLike(depcode); |
| | | name = StringHelper.getLikeUpperStr(name); |
| | |
| | | import java.io.File; |
| | | import java.sql.Timestamp; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | private void insertMetas(List<MetaFileEntity> list) { |
| | | int metaId = insertParentMeta(list); |
| | | |
| | | List<String> guids = new ArrayList<>(); |
| | | for (MetaFileEntity mf : list) { |
| | | if (null != mf.getMsg()) { |
| | | continue; |
| | | } |
| | | |
| | | MetaEntity me = createMeta(mf, metaId); |
| | | if (StaticData._GDB.equals(me.getType())) { |
| | | if (guids.contains(me.getGuid())) { |
| | | me.setMetaid(-1); |
| | | } else { |
| | | guids.add(me.getGuid()); |
| | | } |
| | | } |
| | | |
| | | metaService.insert(me); |
| | | String err = mf.getRows() < mf.getRecords() ? "(" + (mf.getRecords() - mf.getRows()) + " 条失败)" : ""; |
| | | mf.setMsg(me.getId() > 0 ? String.format("成功%s", err) : "失败"); |
| | |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_meta |
| | | <where> |
| | | 1 = 1 |
| | | ismeta between 0 and 1 |
| | | <if test="depcode != null"> |
| | | and depcode like #{depcode} |
| | | </if> |
| | |
| | | select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName |
| | | from lf.sys_meta a |
| | | <where> |
| | | 1 = 1 |
| | | ismeta between 0 and 1 |
| | | <if test="depcode != null"> |
| | | and depcode like #{depcode} |
| | | </if> |
| | |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectGdbByGuid" resultType="com.lf.server.entity.data.MetaEntity"> |
| | | select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName |
| | | from lf.sys_meta a |
| | | where type = 'gdb' and guid = #{guid}; |
| | | </select> |
| | | |
| | | <select id="selectMetasForCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_meta |
| | | <where> |