Skip to content

Commit 52ef5a3

Browse files
committed
增加8.0升级说明
1 parent cca9900 commit 52ef5a3

35 files changed

+1691
-14
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,9 @@
101101
/vol.api/VOL.Entity/bin
102102
/vol.api/VOL.MES/obj
103103
/vol.api/VOL.MES/bin
104+
/vol.api/.vs
105+
/vol.api/VOL.Sys/obj
106+
/vol.api/VOL.Sys/bin
107+
/vol.api/VOL.WebApi/obj
108+
/vol.api/VOL.WebApi/bin
109+
/vol.api.sqlsugar/.vs

3.ef后台升级.net8.0.docx

17.7 KB
Binary file not shown.

3.sugar后台升级net8.0.docx

15.2 KB
Binary file not shown.

vol.api.sqlsugar/SqlSugar使用说明.txt

-14
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
3+
*如果要增加方法请在当前目录下Partial文件夹FormCollectionObjectController编写
4+
*/
5+
using Microsoft.AspNetCore.Mvc;
6+
using VOL.Core.Controllers.Basic;
7+
using VOL.Entity.AttributeManager;
8+
using VOL.Sys.IServices;
9+
namespace VOL.Sys.Controllers
10+
{
11+
[Route("api/FormCollectionObject")]
12+
[PermissionTable(Name = "FormCollectionObject")]
13+
public partial class FormCollectionObjectController : ApiBaseController<IFormCollectionObjectService>
14+
{
15+
public FormCollectionObjectController(IFormCollectionObjectService service)
16+
: base(service)
17+
{
18+
}
19+
}
20+
}
21+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
3+
*如果要增加方法请在当前目录下Partial文件夹FormDesignOptionsController编写
4+
*/
5+
using Microsoft.AspNetCore.Mvc;
6+
using VOL.Core.Controllers.Basic;
7+
using VOL.Entity.AttributeManager;
8+
using VOL.Sys.IServices;
9+
namespace VOL.Sys.Controllers
10+
{
11+
[Route("api/FormDesignOptions")]
12+
[PermissionTable(Name = "FormDesignOptions")]
13+
public partial class FormDesignOptionsController : ApiBaseController<IFormDesignOptionsService>
14+
{
15+
public FormDesignOptionsController(IFormDesignOptionsService service)
16+
: base(service)
17+
{
18+
}
19+
}
20+
}
21+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
*接口编写处...
3+
*如果接口需要做Action的权限验证,请在Action上使用属性
4+
*如: [ApiActionPermission("FormCollectionObject",Enums.ActionPermissionOptions.Search)]
5+
*/
6+
using Microsoft.AspNetCore.Mvc;
7+
using System;
8+
using System.Collections.Generic;
9+
using System.Threading.Tasks;
10+
using Microsoft.Extensions.DependencyInjection;
11+
using Microsoft.AspNetCore.Http;
12+
using VOL.Entity.DomainModels;
13+
using VOL.Sys.IServices;
14+
15+
namespace VOL.Sys.Controllers
16+
{
17+
public partial class FormCollectionObjectController
18+
{
19+
private readonly IFormCollectionObjectService _service;//访问业务代码
20+
private readonly IHttpContextAccessor _httpContextAccessor;
21+
22+
[ActivatorUtilitiesConstructor]
23+
public FormCollectionObjectController(
24+
IFormCollectionObjectService service,
25+
IHttpContextAccessor httpContextAccessor
26+
)
27+
: base(service)
28+
{
29+
_service = service;
30+
_httpContextAccessor = httpContextAccessor;
31+
}
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
*接口编写处...
3+
*如果接口需要做Action的权限验证,请在Action上使用属性
4+
*如: [ApiActionPermission("FormDesignOptions",Enums.ActionPermissionOptions.Search)]
5+
*/
6+
using Microsoft.AspNetCore.Mvc;
7+
using System;
8+
using System.Collections.Generic;
9+
using System.Threading.Tasks;
10+
using Microsoft.Extensions.DependencyInjection;
11+
using Microsoft.AspNetCore.Http;
12+
using VOL.Entity.DomainModels;
13+
using VOL.Sys.IServices;
14+
using VOL.Sys.IRepositories;
15+
using System.Linq;
16+
using Microsoft.EntityFrameworkCore;
17+
using VOL.Sys.Services;
18+
using VOL.Core.DBManager;
19+
using SqlSugar;
20+
21+
namespace VOL.Sys.Controllers
22+
{
23+
public partial class FormDesignOptionsController
24+
{
25+
private readonly IFormDesignOptionsService _service;//访问业务代码
26+
private readonly IHttpContextAccessor _httpContextAccessor;
27+
private readonly IFormCollectionObjectRepository _formCollectionRepository;
28+
private readonly IFormDesignOptionsRepository _formDesignOptionsRepository;
29+
[ActivatorUtilitiesConstructor]
30+
public FormDesignOptionsController(
31+
IFormDesignOptionsService service,
32+
IHttpContextAccessor httpContextAccessor,
33+
IFormCollectionObjectRepository formCollectionRepository,
34+
IFormDesignOptionsRepository formDesignOptionsRepository
35+
)
36+
: base(service)
37+
{
38+
_service = service;
39+
_httpContextAccessor = httpContextAccessor;
40+
_formCollectionRepository = formCollectionRepository;
41+
_formDesignOptionsRepository = formDesignOptionsRepository;
42+
}
43+
/// <summary>
44+
///
45+
/// </summary>
46+
/// <param name="id"></param>
47+
/// <returns></returns>
48+
[Route("getFormOptions"), HttpGet]
49+
public async Task<IActionResult> GetFormOptions(Guid id)
50+
{
51+
var options = await _formDesignOptionsRepository.FindAsIQueryable(x => x.FormId == id)
52+
.Select(s => new { s.Title, s.FormOptions })
53+
.FirstOrDefaultAsync();
54+
return Json(new { data = options });
55+
}
56+
/// <summary>
57+
///
58+
/// </summary>
59+
/// <param name="saveModel"></param>
60+
/// <returns></returns>
61+
[Route("submit"), HttpPost]
62+
public IActionResult Submit([FromBody] SaveModel saveModel)
63+
{
64+
var result = FormCollectionObjectService.Instance.Add(saveModel);
65+
return Json(result);
66+
}
67+
/// <summary>
68+
///获取有数据的设计器
69+
/// </summary>
70+
/// <returns></returns>
71+
[Route("getList"), HttpGet]
72+
public IActionResult GetList()
73+
{
74+
var query = _formCollectionRepository.FindAsIQueryable(x => true);
75+
var data = _formDesignOptionsRepository.FindAsIQueryable(x => SqlFunc.Subqueryable<FormCollectionObject>().Where(c => c.FormId == x.FormId).Any())
76+
.Select(s => new { s.FormId, s.Title, s.FormOptions })
77+
.ToList();
78+
return Json(data);
79+
80+
}
81+
}
82+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
/*
2+
*接口编写处...
3+
*如果接口需要做Action的权限验证,请在Action上使用属性
4+
*如: [ApiActionPermission("Sys_Department",Enums.ActionPermissionOptions.Search)]
5+
*/
6+
using Microsoft.AspNetCore.Mvc;
7+
using System;
8+
using System.Collections.Generic;
9+
using System.Threading.Tasks;
10+
using Microsoft.Extensions.DependencyInjection;
11+
using Microsoft.AspNetCore.Http;
12+
using VOL.Entity.DomainModels;
13+
using VOL.Sys.IServices;
14+
using VOL.Core.Filters;
15+
using VOL.Core.Enums;
16+
using VOL.Core.Extensions;
17+
using VOL.Sys.IRepositories;
18+
using Microsoft.EntityFrameworkCore;
19+
using System.Linq;
20+
using VOL.Core.ManageUser;
21+
using VOL.Core.UserManager;
22+
using SqlSugar;
23+
24+
namespace VOL.Sys.Controllers
25+
{
26+
public partial class Sys_DepartmentController
27+
{
28+
private readonly ISys_DepartmentService _service;//访问业务代码
29+
private readonly ISys_DepartmentRepository _repository;
30+
private readonly IHttpContextAccessor _httpContextAccessor;
31+
32+
[ActivatorUtilitiesConstructor]
33+
public Sys_DepartmentController(
34+
ISys_DepartmentService service,
35+
ISys_DepartmentRepository repository,
36+
IHttpContextAccessor httpContextAccessor
37+
)
38+
: base(service)
39+
{
40+
_service = service;
41+
_repository = repository;
42+
_httpContextAccessor = httpContextAccessor;
43+
}
44+
45+
46+
/// <summary>
47+
/// treetable 获取子节点数据(2021.05.02)
48+
/// </summary>
49+
/// <param name="loadData"></param>
50+
/// <returns></returns>
51+
[ApiActionPermission(ActionPermissionOptions.Search)]
52+
[HttpPost, Route("GetPageData")]
53+
public override ActionResult GetPageData([FromBody] PageDataOptions loadData)
54+
{
55+
if (loadData.Value.GetInt() == 1)
56+
{
57+
return GetTreeTableRootData(loadData).Result;
58+
}
59+
return base.GetPageData(loadData);
60+
}
61+
62+
/// <summary>
63+
/// treetable 获取子节点数据
64+
/// </summary>
65+
/// <returns></returns>
66+
[HttpPost, Route("getTreeTableRootData")]
67+
[ApiActionPermission(ActionPermissionOptions.Search)]
68+
public async Task<ActionResult> GetTreeTableRootData([FromBody] PageDataOptions options)
69+
{
70+
//页面加载根节点数据条件x => x.ParentId == 0,自己根据需要设置
71+
var query = _repository.FindAsIQueryable(x => true);
72+
if (UserContext.Current.IsSuperAdmin)
73+
{
74+
query = query.Where(x => x.ParentId == null);
75+
}
76+
else
77+
{
78+
var deptIds = UserContext.Current.DeptIds;
79+
var list = DepartmentContext.GetAllDept().Where(c => deptIds.Contains(c.id)).ToList();
80+
deptIds = list.Where(c => !list.Any(x => x.id == c.parentId)).Select(x => x.id).ToList();
81+
query = query.Where(x => deptIds.Contains(x.DepartmentId));
82+
}
83+
var queryChild = _repository.FindAsIQueryable(x => true);
84+
var rows = await query.TakeOrderByPage(options.Page, options.Rows)
85+
.OrderBy(x => x.DepartmentName).Select(s => new
86+
{
87+
s.DepartmentId,
88+
s.ParentId,
89+
s.DepartmentName,
90+
s.DepartmentCode,
91+
s.Enable,
92+
s.Remark,
93+
s.CreateDate,
94+
s.Creator,
95+
s.Modifier,
96+
s.ModifyDate,
97+
hasChildren = SqlFunc.Subqueryable<Sys_Department>().Where(x => x.ParentId == s.DepartmentId).Any()
98+
}).ToListAsync();
99+
return JsonNormal(new { total = await query.CountAsync(), rows });
100+
}
101+
102+
/// <summary>
103+
///treetable 获取子节点数据
104+
/// </summary>
105+
/// <returns></returns>
106+
[HttpPost, Route("getTreeTableChildrenData")]
107+
[ApiActionPermission(ActionPermissionOptions.Search)]
108+
public async Task<ActionResult> GetTreeTableChildrenData(Guid departmentId)
109+
{
110+
//点击节点时,加载子节点数据
111+
var query = _repository.FindAsIQueryable(x => true);
112+
var rows = await query.Where(x => x.ParentId == departmentId)
113+
.Select(s => new
114+
{
115+
s.DepartmentId,
116+
s.ParentId,
117+
s.DepartmentName,
118+
s.DepartmentCode,
119+
s.Enable,
120+
s.Remark,
121+
s.CreateDate,
122+
s.Creator,
123+
s.Modifier,
124+
s.ModifyDate,
125+
hasChildren = SqlFunc.Subqueryable<Sys_Department>().Where(x => x.ParentId == s.DepartmentId).Any()
126+
}).ToListAsync();
127+
return JsonNormal(new { rows });
128+
}
129+
}
130+
}
131+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
using Microsoft.AspNetCore.Authorization;
2+
using Microsoft.AspNetCore.Mvc;
3+
using System.Collections.Generic;
4+
using System.Threading.Tasks;
5+
using VOL.Core.Controllers.Basic;
6+
using VOL.Core.Extensions;
7+
using VOL.Core.Filters;
8+
using VOL.Sys.IServices;
9+
10+
namespace VOL.Sys.Controllers
11+
{
12+
public partial class Sys_DictionaryController
13+
{
14+
[HttpPost, Route("GetVueDictionary")]
15+
[ApiActionPermission()]
16+
public IActionResult GetVueDictionary([FromBody] string[] dicNos)
17+
{
18+
return Content(Service.GetVueDictionary(dicNos).Serialize());
19+
}
20+
/// <summary>
21+
/// table加载数据后刷新当前table数据的字典项(适用字典数据量比较大的情况)
22+
/// </summary>
23+
/// <param name="value"></param>
24+
/// <returns></returns>
25+
[HttpPost, Route("getTableDictionary")]
26+
public IActionResult GetTableDictionary([FromBody] Dictionary<string, object[]> keyData)
27+
{
28+
return Json(Service.GetTableDictionary(keyData));
29+
}
30+
/// <summary>
31+
/// 远程搜索
32+
/// </summary>
33+
/// <param name="value"></param>
34+
/// <returns></returns>
35+
[HttpPost, Route("getSearchDictionary")]
36+
public IActionResult GetSearchDictionary(string dicNo, string value)
37+
{
38+
return Json(Service.GetSearchDictionary(dicNo, value));
39+
}
40+
41+
/// <summary>
42+
/// 表单设置为远程查询,重置或第一次添加表单时,获取字典的key、value
43+
/// </summary>
44+
/// <param name="dicNo"></param>
45+
/// <param name="key"></param>
46+
/// <returns></returns>
47+
[HttpPost, Route("getRemoteDefaultKeyValue")]
48+
public async Task<IActionResult> GetRemoteDefaultKeyValue(string dicNo, string key)
49+
{
50+
return Json(await Service.GetRemoteDefaultKeyValue(dicNo, key));
51+
}
52+
/// <summary>
53+
/// 代码生成器获取所有字典项(超级管理权限)
54+
/// </summary>
55+
/// <returns></returns>
56+
[HttpPost, Route("GetBuilderDictionary")]
57+
// [ApiActionPermission(ActionRolePermission.SuperAdmin)]
58+
public async Task<IActionResult> GetBuilderDictionary()
59+
{
60+
return Json(await Service.GetBuilderDictionary());
61+
}
62+
63+
}
64+
}

0 commit comments

Comments
 (0)