13693261870
2024-09-29 a3a2ebee5df9902e923963a6f94396765f9d79fb
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
58
package com.se.simu.service;
 
import cn.hutool.json.JSONUtil;
import com.se.simu.config.PropertiesConfig;
import com.se.simu.domain.dto.ConfigDto;
import com.se.simu.domain.po.DataPo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
 
/**
 * 内涝求解器服务类
 *
 * @author WWW
 * @date   2024-09-29
 */
@Slf4j
@Service
@SuppressWarnings("ALL")
public class UwService {
    @Resource
    PropertiesConfig config;
 
    public void createRainFile() {
 
    }
 
    public void createConfig(DataPo data) throws IOException {
        ConfigDto dto = new ConfigDto();
        dto.setProperties(data.getInPath(), data.getDuration(), config);
 
        String json = JSONUtil.toJsonPrettyStr(dto);
        String filePath = config.getInPath() + File.separator + data.getInPath() + ".json";
 
        FileWriter fw = new FileWriter(filePath);
        BufferedWriter bw = new BufferedWriter(fw);
        bw.write(json);
        bw.close();
        fw.close();
    }
 
    public void callExe() {
        //
    }
 
    public void copeWaterFiles() {
        //
    }
 
    public void copeDrainFiles() {
        //
    }
}