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() {
|
//
|
}
|
}
|