| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.sql.Timestamp; |
| | |
| | | @Autowired |
| | | DirService dirService; |
| | | |
| | | @Resource |
| | | RasterService rasterService; |
| | | |
| | | @Override |
| | | public List<CoordEntity> selectCoords(String zoning) { |
| | | return uploadMapper.selectCoords(zoning); |
| | |
| | | */ |
| | | public void insertFiles(UserEntity ue, List<MetaFileEntity> list, HttpServletRequest req) { |
| | | checkMetaFiles(ue, list); |
| | | readRasterInfo(list); |
| | | List<MetaFileEntity> xlsList = getExcelFiles(list); |
| | | loadData(list); |
| | | copyFiles(list); |
| | |
| | | MetaEntity old = metaService.selectByGuid(mf.getGuid(), getDirCode(mf), null); |
| | | if (null != old) { |
| | | mf.setMsg("已存在"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 读取栅格信息 |
| | | */ |
| | | private void readRasterInfo(List<MetaFileEntity> list) { |
| | | for (MetaFileEntity mf : list) { |
| | | if (null != mf.getMsg()) { |
| | | continue; |
| | | } |
| | | |
| | | if (StaticData.RASTER_EXT.contains("." + mf.getType())) { |
| | | rasterService.readRasterInfo(mf, mf.getPath()); |
| | | } |
| | | } |
| | | } |
| | |
| | | MetaEntity me = createMeta(mf, metaId); |
| | | if (StaticData.NGDB.equals(me.getType())) { |
| | | if (guids.contains(me.getGuid())) { |
| | | me.setIsmeta((short)-1); |
| | | me.setIsmeta((short) -1); |
| | | } else { |
| | | guids.add(me.getGuid()); |
| | | } |
| | |
| | | me.setRows(mf.getRows()); |
| | | me.setCreateUser(mf.getCreateUser()); |
| | | me.setCreateTime(mf.getCreateTime()); |
| | | // 栅格信息 |
| | | me.setGeom(StringHelper.isEmpty(mf.getGeom()) ? "null" : mf.getGeom()); |
| | | me.setSensortype(mf.getSensortype()); |
| | | me.setAcqTime(mf.getAcqTime()); |
| | | me.setResolution(mf.getResolution()); |
| | | me.setGridsize(mf.getGridsize()); |
| | | me.setCoorSys(mf.getCoorSys()); |
| | | me.setEpsg(mf.getEpsg()); |
| | | me.sethDatum(mf.gethDatum()); |
| | | me.setMataType(mf.getMataType()); |
| | | me.setBands(mf.getBands()); |
| | | me.setBandType(mf.getBandType()); |
| | | me.setCt(mf.getCt()); |
| | | |
| | | return me; |
| | | } |