/// <summary> /// 上传未通过 /// </summary> /// <param name="stm">服务端发来未通过信息</param> /// <param name="gnpy">任务渠道</param> /// <param name="appSrc">时间戳文件夹</param> public string Uploa(string stm, string gnpy, string appSrc) { if (stm == "无未通过报告") { return("无未通过报告"); } var tempStr = stm.Substring(0, stm.Length - 1).Split(',', '-', ':'); try { for (var i = 0; i < tempStr.Length; i += 3) { if (DirFile.IsExistFile($@"{ProjectSite}data\script\environinit\tempDate\{tempStr[i + 1]}.xlsx")) { var destFilePath = $@"{ApkSite}{gnpy}\{appSrc}\excel\{tempStr[i]}"; RunCmdPython($@"{ProjectSite}main\pngzip\pngzip.py", $@"{ProjectSite}data\result\image\{tempStr[i + 1]}"); DirFile.CopyFolder($@"{ProjectSite}data\result\image\{tempStr[i + 1]}", $@"{destFilePath}\操作步骤图片"); DirFile.Copy($@"{ProjectSite}data\result\excel\{tempStr[i + 2]}.xlsx", $@"{destFilePath}\{tempStr[i + 2]}.xlsx"); } else if (DirFile.IsExistDirectory($@"{ProjectSite}data\result\image\{tempStr[i + 1]}")) { RunCmdPython($@"{ProjectSite}main\pngzip\pngzip.py", $@"{ProjectSite}data\result\image\{tempStr[i + 1]}"); DirFile.CopyFolder( $@"{ProjectSite}data\result\image\{tempStr[i + 1]}", $@"{ApkSite}{gnpy}\{appSrc}\failed\{tempStr[i]}"); } } } catch (Exception) { // ignored } DirFile.CopyFolder($@"{ProjectSite}data\script\environinit\tempDate", $@"{ApkSite}{gnpy}\{appSrc}\tempDate"); return("上传完成"); }
public string CopyScript(string gnpy, string apkVersion) { if (gnpy == "myht") { return("脚本文件复制完成"); } var sArray = apkVersion.Split('.'); var path = $@"{ProjectSite}data\script\AllVersion\{sArray[0]}.{sArray[1]}.X"; if (!DirFile.IsExistDirectory(path)) { var dir = new DirectoryInfo($@"{ProjectSite}data\script\AllVersion").GetDirectories("*.X"); // 复制最大文件夹中的内容 DirFile.CopyFolder($@"{ProjectSite}data\script\AllVersion\{DirFile.SortAsFileName(ref dir)}", path); } DirFile.CopyFolder(path, $@"{ProjectSite}data\script"); DirFile.Copy($@"{ProjectSite}data\script\environinit\UserInfo.xml", $@"{ProjectSite}xmlconfig\UserInfo.xml"); DirFile.Copy($@"{ProjectSite}data\script\environinit\accountid.xml", $@"{ProjectSite}xmlconfig\accountid.xml"); return("脚本文件复制完成"); }