ke
2024-05-21 d66db353604bb60b5ae7c82f213b872b44e56837
全景图更新切图功能kl  5-21 18
1 files modified
20 ■■■■■ changed files
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/skPanorama/controller/SkPanoramaController.java 20 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/skPanorama/controller/SkPanoramaController.java
@@ -430,7 +430,10 @@
    private static final String  linShiformateBaseUrl = "/data/panorama/formate/";
    @PostMapping("/formatePic")
    public R  formatePic(@RequestParam String ids) throws IOException, InterruptedException, IM4JavaException {
        System.err.println(ids);
        List<Long> idlist = Func.toLongList(ids);
        ArrayList<SkPanoramaEntity> panoramalist = new ArrayList<SkPanoramaEntity>();
@@ -476,7 +479,10 @@
                HashMap<String, Integer> imgInfoRT = Img4JavaUtil.getImgInfoRT(lingshiqjfile);
                Integer width = imgInfoRT.get("width");
                Integer height = imgInfoRT.get("height");
                System.err.println(id);
                System.err.println("图片分辨率:"+ width +" * " + height);
                if (width == height * 2) {
                    System.err.println("符合标准");
                    // 已经符合格式化标准
                    SkPanoramaEntity upEntity = new SkPanoramaEntity();
                    upEntity.setId(id);
@@ -484,6 +490,14 @@
                    upEntity.setPicwidth(width);
                    upEntity.setStatus(PanoramaUtilDict.panorama_status_2);
                    justUpdateStatusList.add(upEntity);
                    // 完成格式化后删除原始临时图片
                    Path qietuPath = Paths.get(lingshiPic);
                    File yuanspic = qietuPath.toFile();
                    if (yuanspic.exists()) {
                        // 删除指定文件,不存在报异常
                        FileUtils.forceDelete(yuanspic);
                    }
//                    boolean b = skPanoramaService.updateById(upEntity);
//                    return R.status( b);
                } else {
@@ -538,16 +552,18 @@
            }
        }
        System.err.println("panoramalist:"+panoramalist.size());
        boolean b = false;
        if (panoramalist != null && panoramalist.size()>0) {
             b = skPanoramaService.updateBatchById(panoramalist);
        } else {
             b = true;
        }
        System.err.println("justUpdateStatusList:"+justUpdateStatusList.size());
        boolean formatB = false;
        // 已上传的全景图已符合比例,仅用改变数据状态
        if (panoramalist != null && panoramalist.size()>0) {
        if (justUpdateStatusList != null && justUpdateStatusList.size()>0) {
             formatB = skPanoramaService.updateBatchById(justUpdateStatusList);
        } else {
            formatB = true;