管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2022-11-12 3e707d56a647c29055e1e64800a9300e9c1aa091
ExportMap/cs/ExportUtil.cs
@@ -1,4 +1,5 @@
using LFServer.Models;
using ExportMap.cs;
using LFServer.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -140,6 +141,7 @@
            try
            {
                string cmdText = string.Format("python {0} -qgz {1} -qpt {2}", py, qgz, qpt);
                LogOut.Info(cmdText);
                Process p = new Process();
                p.StartInfo.FileName = "cmd.exe";
@@ -160,10 +162,9 @@
                string info = so.ReadToEnd();
                str = se.ReadToEnd();
                if (p.HasExited == false)
                {
                    p.Kill();
                }
                if (!string.IsNullOrEmpty(str)) LogOut.Error(str);
                if (p.HasExited == false) p.Kill();
                si.Close();
                so.Close();
@@ -172,6 +173,7 @@
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.StackTrace);
                str = ex.Message;
            }
@@ -182,8 +184,9 @@
        /// 生成
        /// </summary>
        /// <param name="args">出图参数</param>
        /// <param name="err">错误信息</param>
        /// <returns>图片路径</returns>
        public static string Generate(ExportArgs args)
        public static string Generate(ExportArgs args, ref string err)
        {
            string date = DateStr;
            string sub = GetExportSubFolder();
@@ -194,7 +197,7 @@
            args.SetDefault();
            CreateTemplate(args);
            string info = ExecPython(PyFile, qgz, args.qpt);
            err = ExecPython(PyFile, qgz, args.qpt);
            string qptFile = Path.Combine(SourcesPath, args.qpt);
            if (File.Exists(qptFile))
@@ -262,7 +265,7 @@
                return rm != null && rm.code == 200 && rm.result;
            }
            catch (Exception ex)
            catch
            {
                return false;
            }