package com.ruoyi.hywz.utils;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class QuantityUtils {



    public static void main(String[] args) {

        try {
            // 调用CMD命令
            // 算法程序地址
            String command = "C:\\Users\\25364\\Desktop\\工作\\jar\\dist\\07郴州专业仓定额v02-打包";
            Process process = Runtime.getRuntime().exec(command);
//            ProcessBuilder builder = new ProcessBuilder("D:\\work\\czcbde\\dist\\sjtest.exe","conf.ini");
//            Process process = builder.start();

            // 获取命令输出结果
            InputStream inputStream = process.getInputStream();
            BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "GBK")); // 设置编码为GBK
            String line;
            while ((line = reader.readLine()) != null) {
                System.out.println(line);
            }

            // 等待命令执行完成
            process.waitFor();
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
    }

}
