فهرست منبع

滨江一本帐上传下载图形BUG修改

liutao 11 ماه پیش
والد
کامیت
8efc4186bb

+ 8 - 11
BJYSYBZ_S/src/main/java/com/zjugis/ysgzybz/service/impl/YbzBJService.java

@@ -303,15 +303,19 @@ public class YbzBJService {
     public String exportOneShape(CommonDTO dto) {
         File rootPath = new File(System.getProperty("user.dir"));
         String prefix = UUID.randomUUID().toString();
-        String dkFileName = prefix + ".shp";
-        String formatFileName = "shp" + File.separator + dkFileName;
+        Map<String, Object> resultMap = dao.exportOne(dto);
+        String shape = resultMap.get("shape").toString();
+        String dkbh = resultMap.get("dkbh").toString();
+        if (StringUtils.isEmpty(dkbh)) {
+            dkbh = "dk";
+        }
+        String dkFileName = dkbh + ".shp";
+        String formatFileName = "shp" + File.separator + prefix + File.separator + dkFileName;
         File dkFile = new File(rootPath, formatFileName);
         if (!dkFile.getParentFile().exists()) {
             dkFile.getParentFile().mkdirs();
         }
         String fileFullPath = dkFile.getAbsolutePath();
-        Map<String, Object> resultMap = dao.exportOne(dto);
-        String shape = resultMap.get("shape").toString();
         Geometry geometry = null;
         try {
             geometry = GeometryUtil.wkt2Geometry(shape);
@@ -331,13 +335,6 @@ public class YbzBJService {
         //压缩shp
         ShapeUtil.zipShapeFile(fileFullPath);
 
-        //删除临时生产的.shp文件
-        File shpFile = new File(fileFullPath);
-        String shpRoot = shpFile.getParentFile().getPath();
-        File[] files = new File(shpRoot).listFiles(file -> file.getName().startsWith(prefix) && !file.getName().endsWith(".zip"));
-        for (File file : files) {
-            file.delete();
-        }
         return fileFullPath.replace(".shp", ".zip");
     }
 

+ 1 - 1
BJYSYBZ_S/src/main/resources/mapper/YbzBJMapper.xml

@@ -879,7 +879,7 @@
         <if test="dto.name1 != null and dto.name1 !=''">
             and jsdw like concat('%', concat(#{dto.name1}, '%'))
         </if>
-        order by fzsj desc nulls last
+        order by fzsj desc
     </select>
     <select id="manageExportList" resultType="com.zjugis.ysgzybz.domain.dto.ManageDTO">
         select