wuww
2025-04-12 dc57a3e8d8d6a603fdff1a8028284fc9f8655a52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.se.nsl.service;
 
import cn.hutool.core.io.FileUtil;
import com.se.nsl.config.PropertiesConfig;
import com.se.nsl.domain.dto.LayerDto;
import com.se.nsl.domain.dto.ResultDto;
import com.se.nsl.domain.po.DataPo;
import com.se.nsl.domain.vo.BuildingDepthVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.io.File;
import java.util.List;
 
@Slf4j
@Service
@SuppressWarnings("ALL")
public class TestService {
    @Resource
    PropertiesConfig config;
 
    @Resource
    ResultService resultService;
 
    public void test(DataPo data) {
        String basePath = config.getInPath() + File.separator + data.getInPath() + File.separator;
        ResultDto dto = new ResultDto(
                data.getInPath(),
                basePath + config.getTerrainFile(),
                basePath + config.getBuildingFile(),
                basePath + config.getWaterPath(),
                basePath + config.getFlowPath(),
                config.getInPath(),
                config.getOutPath(),
                data.getEpsg());
        LayerDto layer = new LayerDto(config.getVer(), data.getEpsg(), config.getSizes());
        process(dto, layer);
    }
 
    private void process(ResultDto dto, LayerDto layer) {
        try {
//            copeTerrain(dto, layer);
//            copeBuilding(dto, layer);
//            List<BuildingDepthVo> buildings = copeWater(dto, layer);
//            copeFlow(dto, layer);
//            copeLayerJson(dto, layer);
//            copeRainFallJson(dto, layer);
//            copeBuildingDepthJson(dto, buildings);
        } finally {
            File dir = new File(dto.getTemp());
            if (dir.exists()) {
                FileUtil.del(dir);
            }
        }
    }
}