| | |
| | | |
| | | select * from lf.sys_dir order by id; |
| | | select zoning from lf.sys_coord group by zoning; |
| | | |
| | | select id, name from lf.sys_dir where pid = 0 and id > 1; |
| | | |
| | | |
| | | |
| | |
| | | import com.lf.server.entity.ctrl.TabMapperEntity; |
| | | import com.lf.server.entity.ctrl.UploadEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.service.all.BaseUploadService; |
| | |
| | | @PostMapping(value = "/uploadFiles") |
| | | public ResponseMsg<Object> uploadFiles(String path, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | List<MetaEntity> list = baseUploadService.uploadData(null, path, req, res); |
| | | List<MetaFileEntity> list = baseUploadService.uploadData(null, path, req, res); |
| | | if (null == list || list.isEmpty()) { |
| | | return fail("没有找到上传文件", null); |
| | | } |
| | |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询映射") |
| | |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.ctrl.ShpRecordEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.AesHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | |
| | | return fail("用户未登录", null); |
| | | } |
| | | |
| | | List<MetaEntity> list = uploaderService.uploadData(null, null, req, res); |
| | | List<MetaFileEntity> list = uploaderService.uploadData(null, null, req, res); |
| | | if (list == null || list.size() < StaticData.FOUR) { |
| | | return fail("没有找到已上传的数据或不完整", null); |
| | | } |
| | |
| | | import com.lf.server.entity.ctrl.MarkJsonEntity; |
| | | import com.lf.server.entity.data.DownloadEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.show.MarkEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | |
| | | return fail("用户未登录", null); |
| | | } |
| | | |
| | | List<MetaEntity> meList = uploaderService.uploadData(null, null, req, res); |
| | | List<MetaFileEntity> meList = uploaderService.uploadData(null, null, req, res); |
| | | if (meList == null || meList.size() < StaticData.FOUR) { |
| | | return fail("没有找到已上传的数据或不完整", null); |
| | | } |
| | |
| | | public class MetaFileEntity implements Serializable { |
| | | private static final long serialVersionUID = -3688958480700165163L; |
| | | |
| | | private String eventid; |
| | | |
| | | private int metaid; |
| | | |
| | | private int dirid; |
| | | |
| | | private int depid; |
| | | |
| | | private int verid; |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private String guid; |
| | | |
| | | private String path; |
| | | |
| | | private double sizes; |
| | | |
| | | private String bstab; |
| | | |
| | | private int bsrows; |
| | | |
| | | private String mdtab; |
| | | |
| | | private int mdrows; |
| | | |
| | | public String getEventid() { |
| | | return eventid; |
| | | } |
| | | |
| | | public void setEventid(String eventid) { |
| | | this.eventid = eventid; |
| | | } |
| | | |
| | | public int getMetaid() { |
| | | return metaid; |
| | | } |
| | | |
| | | public void setMetaid(int metaid) { |
| | | this.metaid = metaid; |
| | | } |
| | | |
| | | public int getDirid() { |
| | | return dirid; |
| | | } |
| | | |
| | | public void setDirid(int dirid) { |
| | | this.dirid = dirid; |
| | | } |
| | | |
| | | public int getDepid() { |
| | | return depid; |
| | | } |
| | | |
| | | public void setDepid(int depid) { |
| | | this.depid = depid; |
| | | } |
| | | |
| | | public int getVerid() { |
| | | return verid; |
| | | } |
| | | |
| | | public void setVerid(int verid) { |
| | | this.verid = verid; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getGuid() { |
| | | return guid; |
| | | } |
| | | |
| | | public void setGuid(String guid) { |
| | | this.guid = guid; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | public double getSizes() { |
| | | return sizes; |
| | | } |
| | | |
| | | public void setSizes(double sizes) { |
| | | this.sizes = sizes; |
| | | } |
| | | |
| | | public String getBstab() { |
| | | return bstab; |
| | | } |
| | | |
| | | public void setBstab(String bstab) { |
| | | this.bstab = bstab; |
| | | } |
| | | |
| | | public int getBsrows() { |
| | | return bsrows; |
| | | } |
| | | |
| | | public void setBsrows(int bsrows) { |
| | | this.bsrows = bsrows; |
| | | } |
| | | |
| | | public String getMdtab() { |
| | | return mdtab; |
| | | } |
| | | |
| | | public void setMdtab(String mdtab) { |
| | | this.mdtab = mdtab; |
| | | } |
| | | |
| | | public int getMdrows() { |
| | | return mdrows; |
| | | } |
| | | |
| | | public void setMdrows(int mdrows) { |
| | | this.mdrows = mdrows; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.twmacinta.util.MD5; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.apache.commons.logging.Log; |
| | |
| | | /** |
| | | * 删除文件 |
| | | */ |
| | | public static void deleteFiles(List<MetaEntity> list) { |
| | | public static void deleteFiles(List<MetaFileEntity> list) { |
| | | try { |
| | | for (MetaEntity mf : list) { |
| | | for (MetaFileEntity mf : list) { |
| | | File f = new File(mf.getPath()); |
| | | if (f.exists()) { |
| | | f.delete(); |
| | |
| | | package com.lf.server.service.all; |
| | | |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.helper.FileHelper; |
| | | import com.lf.server.helper.PathHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | |
| | | /** |
| | | * 上传文件 |
| | | */ |
| | | public <T> List<MetaEntity> uploadData(T t, String path, HttpServletRequest req, HttpServletResponse res) throws Exception { |
| | | public <T> List<MetaFileEntity> uploadData(T t, String path, HttpServletRequest req, HttpServletResponse res) throws Exception { |
| | | StandardMultipartHttpServletRequest request = (StandardMultipartHttpServletRequest) req; |
| | | req.setCharacterEncoding("utf-8"); |
| | | res.setContentType("application/json;charset=utf-8"); |
| | |
| | | if (t != null) { |
| | | setEntity(t, request); |
| | | } |
| | | List<MetaEntity> list = getFiles(path, request); |
| | | |
| | | return list; |
| | | return getFiles(path, request); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 获取文件 |
| | | */ |
| | | public List<MetaEntity> getFiles(String subPath, StandardMultipartHttpServletRequest req) throws Exception { |
| | | List<MetaEntity> list = new ArrayList<MetaEntity>(); |
| | | public List<MetaFileEntity> getFiles(String subPath, StandardMultipartHttpServletRequest req) throws Exception { |
| | | List<MetaFileEntity> list = new ArrayList<>(); |
| | | |
| | | String path = pathHelper.getTempPath(subPath); |
| | | Iterator<String> iterator = req.getFileNames(); |
| | | while (iterator.hasNext()) { |
| | | MultipartFile file = req.getFile(iterator.next()); |
| | | if (StringHelper.isEmpty(file.getOriginalFilename())) { |
| | | if (null == file || StringHelper.isEmpty(file.getOriginalFilename())) { |
| | | continue; |
| | | } |
| | | |
| | | double sizes = FileHelper.sizeToMb(file.getSize()); |
| | | MetaEntity mf = new MetaEntity(); |
| | | MetaFileEntity mf = new MetaFileEntity(); |
| | | mf.setName(file.getOriginalFilename()); |
| | | |
| | | double sizes = FileHelper.sizeToMb(file.getSize()); |
| | | mf.setSizes(sizes); |
| | | mf.setPath(path + File.separator + mf.getName()); |
| | | |
| | |
| | | |
| | | import com.lf.server.entity.ctrl.ShpRecordEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.helper.FileHelper; |
| | | import com.lf.server.helper.ShpHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public ShpRecordEntity readShpFirstRecord(List<MetaEntity> list) { |
| | | public ShpRecordEntity readShpFirstRecord(List<MetaFileEntity> list) { |
| | | String fileName = null; |
| | | for (MetaEntity mf : list) { |
| | | for (MetaFileEntity mf : list) { |
| | | if (mf.getName().toLowerCase().indexOf(".shp") > -1) { |
| | | fileName = mf.getPath(); |
| | | break; |
| | |
| | | import com.lf.server.entity.ctrl.MarkJsonEntity; |
| | | import com.lf.server.entity.data.DownloadEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.show.MarkEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.*; |
| | |
| | | * @param list ShapeFile文件列表 |
| | | * @return Mark实体类集合 |
| | | */ |
| | | public List<MarkJsonEntity> readShpForMarks(List<MetaEntity> list) { |
| | | public List<MarkJsonEntity> readShpForMarks(List<MetaFileEntity> list) { |
| | | String fileName = null; |
| | | for (MetaEntity mf : list) { |
| | | if (mf.getName().toLowerCase().indexOf(".shp") > -1) { |
| | | for (MetaFileEntity mf : list) { |
| | | if (mf.getName().toLowerCase().contains(".shp")) { |
| | | fileName = mf.getPath(); |
| | | break; |
| | | } |
| | |
| | | </select> |
| | | |
| | | <select id="selectProject" resultType="com.lf.server.entity.ctrl.IdNameEntity"> |
| | | select id, name from lf.sys_dir where pid = 0 and id > 0 |
| | | select id, name from lf.sys_dir where pid = 0 and id > 1 |
| | | </select> |
| | | </mapper> |