diff --git a/SoEasyPlatform/Apis/ProjectGroupApp/ProjectGroupController.cs b/SoEasyPlatform/Apis/ProjectGroupApp/ProjectGroupController.cs index 8c486fdd1e5586be5f6ef866087cc02ff1a1c791..869e6ec402857395a334efb6796855e8237576c8 100644 --- a/SoEasyPlatform/Apis/ProjectGroupApp/ProjectGroupController.cs +++ b/SoEasyPlatform/Apis/ProjectGroupApp/ProjectGroupController.cs @@ -141,7 +141,7 @@ namespace SoEasyPlatform.Apis var group = Db.Queryable().InSingle(pgid); var projectids = group.ProjectIds; var list = Db.Queryable().In(projectids).OrderBy(it => it.ModelId).ToList(); - + result.Data = group.SolutionPath; try { Db.BeginTran(); @@ -150,7 +150,7 @@ namespace SoEasyPlatform.Apis var name = System.IO.Path.GetFileName(item.Path); item.Path = System.IO.Path.Combine(group.SolutionPath, name); - result.Data = item.Path; + Db.Updateable(item).ExecuteCommand(); new CodeTableController(null).CreateFileByProjectId(new ProjectViewModel2 @@ -159,13 +159,17 @@ namespace SoEasyPlatform.Apis ProjectId = item.Id, DbId = dbid, ModelId = item.ModelId - }, list.Last() == item); + }, false); } + if (!System.IO.Directory.Exists(System.IO.Path.Combine("wwwroot", "temp"))) + { + System.IO.Directory.CreateDirectory(System.IO.Path.Combine("wwwroot", "temp"));//不存在就创建文件夹 + } var zipName = $"{DateTime.Now.ToString("yyyy-MM-dd-hh-mm-ss")}.zip"; var zipPath = System.IO.Path.Combine("wwwroot", "temp", zipName); ZipHelper.ZipFileDirectory(result.Data, zipPath); - result.Data = zipPath; + result.Data = System.IO.Path.Combine("temp", zipName); Db.CommitTran(); } diff --git a/SoEasyPlatform/wwwroot/views/system/BuilderAll.js b/SoEasyPlatform/wwwroot/views/system/BuilderAll.js index 1bcfeb309789cf8804a690bb45be1daa3e5ad792..fe46d598d4b9ebb564a6f7c5fb88427d91016bf8 100644 --- a/SoEasyPlatform/wwwroot/views/system/BuilderAll.js +++ b/SoEasyPlatform/wwwroot/views/system/BuilderAll.js @@ -9,12 +9,11 @@ btnStudent.onclick = function () { "用该功能之前需要先配置实体(菜单3种方式)".$Alert(); } btnBack.onclick = function () { - window.location.href = "/Solution"; + window.location.href = "/Solution"; } -btnProjectGroup.onclick = function () -{ +btnProjectGroup.onclick = function () { var gridInfo = divGrid.$GridInfo(); - if (gridInfo.length >0) { + if (gridInfo.length > 0) { btnProjectGroup.$Loading(); configs.url.BuilderProjects.$Ajax({ callback: function (msg) { @@ -27,7 +26,7 @@ btnProjectGroup.onclick = function () } btnProjectGroup.$CloseLoading(); }, - data: { "model": JSON.stringify(gridInfo), pgid: hidProjectGroupid.value, dbid:txtDbId.value} + data: { "model": JSON.stringify(gridInfo), pgid: hidProjectGroupid.value, dbid: txtDbId.value } }) } else { "请选择一条数据".$Alert(); @@ -41,6 +40,8 @@ btnProjectGroupHttp.onclick = function () { configs.url.BuilderProjectsByHttp.$Ajax({ callback: function (msg) { if (msg.IsSuccess) { + + window.open(msg.Data, "_blank"); "生成成功".$Alert(); btnSearch.click(); }