去除引用common.props

This commit is contained in:
2023-11-06 19:35:59 +08:00
parent 6a2154edd9
commit c6b8dfc861
810 changed files with 3910 additions and 6695 deletions

View File

@@ -1,5 +1,4 @@
using Aop.Api.Domain;
using JNPF.Common.Const;
using JNPF.Common.Const;
using JNPF.Common.Core.Handlers;
using JNPF.Common.Core.Manager;
using JNPF.Common.Enums;
@@ -7,7 +6,6 @@ using JNPF.Common.Extension;
using JNPF.Common.Manager;
using JNPF.Common.Models.User;
using JNPF.Common.Security;
using JNPF.DatabaseAccessor;
using JNPF.DependencyInjection;
using JNPF.DynamicApiController;
using JNPF.FriendlyException;

View File

@@ -1,12 +1,9 @@
using System.Collections;
using Aop.Api.Domain;
using JNPF.Common.Core.Manager;
using JNPF.Common.Core.Manager;
using JNPF.Common.Enums;
using JNPF.Common.Filter;
using JNPF.Common.Security;
using JNPF.DependencyInjection;
using JNPF.DynamicApiController;
using JNPF.Extras.CollectiveOAuth.Models;
using JNPF.FriendlyException;
using JNPF.Logging;
using JNPF.Systems.Entitys.Dto.Department;
@@ -20,7 +17,6 @@ using Mapster;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Senparc.Weixin.MP.AdvancedAPIs.Comment.CommentJson;
using SqlSugar;
using Tnb.BasicData;
using Tnb.BasicData.Entities;
@@ -315,7 +311,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
if (adminlist.Any()) await _repository.AsSugarClient().Insertable(adminlist).CallEntityMethod(m => m.Create()).ExecuteReturnEntityAsync();
#endregion
if (input.category != DictConst.RegionCategoryCompanyCode)
{
var jsonObj = input.propertyJson;
@@ -478,7 +474,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
int isOK = await _repository.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).CallEntityMethod(m => m.LastModify()).ExecuteCommandAsync();
if (!(isOK > 0)) throw Oops.Oh(ErrorCode.D2018);
//modified by zkd on 20230718 处理二维码
if (input.category != DictConst.RegionCategoryCompanyCode)
{
@@ -486,7 +482,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
var qrcode = jsonObj.GetValue("qrcode");
if (qrcode is not null && !string.IsNullOrEmpty(qrcode.ToString()))
{
if (await _repository.AsSugarClient().Queryable<BasQrcode>().AnyAsync(x => x.code == qrcode.ToString() && x.source_id!=id))
if (await _repository.AsSugarClient().Queryable<BasQrcode>().AnyAsync(x => x.code == qrcode.ToString() && x.source_id != id))
{
throw Oops.Bah("二维码总表中已存在该二维码");
}
@@ -514,7 +510,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
}
}
}
//modified by ly on 20230426 处理工位信息,将工位插入到设备表
if (input.category == DictConst.RegionCategoryStationCode)
{
@@ -555,7 +551,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
if (processVal is not null)
{
//modifyby zhoukeda 2023.06.25
var dic = _repository.GetList(x=>x.DeleteMark==null).ToDictionary(x => x.FullName, x => x.Id);
var dic = _repository.GetList(x => x.DeleteMark == null).ToDictionary(x => x.FullName, x => x.Id);
var procList = jsonObj.Value<JArray>("rowprocess");
var pids = procList.Select(x => x.Value<string>("id")).Distinct().ToList();
var dbProcIds = await _repository.AsSugarClient().Queryable<BasProcessStation>().Where(it => pids.Contains(it.process_id)).Select(it => it.process_id).ToListAsync();
@@ -584,11 +580,11 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
isOK = await _repository.AsSugarClient().Updateable<BasProcessStation>(it => new BasProcessStation { station_id = "", station_code = "" }).Where(it => curProcIds.Contains(it.process_id)).ExecuteCommandAsync();
}
}
var correlation= jsonObj.GetValue("correlation");
var correlation = jsonObj.GetValue("correlation");
if (correlation is not null)
{
await _repository.AsSugarClient().Deleteable<OrganizeRelationEntity>(p => p.OrganizeId == id && p.ObjectType == "User").ExecuteCommandAsync();
var OrganizeRelationEntitys=new List<OrganizeRelationEntity>();
var OrganizeRelationEntitys = new List<OrganizeRelationEntity>();
for (int i = 0; i < correlation.Count(); i++)
{
OrganizeRelationEntity organizeRelationEntity = new OrganizeRelationEntity();
@@ -651,7 +647,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
/// <param name="type"></param>
/// <returns></returns>
[HttpPost]
public async Task<dynamic> GetFpropertyjsonById(Dictionary<string,string> dic)
public async Task<dynamic> GetFpropertyjsonById(Dictionary<string, string> dic)
{
string id = dic["id"];
string type = dic["type"];
@@ -681,9 +677,9 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
if (dictionary.TryGetValue("rowprocess", out var value))
{
List<BasProcess> processes = JsonConvert.DeserializeObject<List<BasProcess>>(JsonConvert.SerializeObject(value));
return new Dictionary<string,object>()
return new Dictionary<string, object>()
{
["list"] = processes.Select(x=>new
["list"] = processes.Select(x => new
{
id = x.id,
code = x.process_code,
@@ -693,7 +689,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
}
}
}
return new Dictionary<string,object>()
return new Dictionary<string, object>()
{
["list"] = Enumerable.Empty<int>()
};
@@ -720,7 +716,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
return null;
}
/// <summary>
/// 根据工位id获取车间信息
/// </summary>

View File

@@ -6,10 +6,10 @@ using JNPF.Common.Security;
using JNPF.DependencyInjection;
using JNPF.DynamicApiController;
using JNPF.FriendlyException;
using JNPF.Systems.Interfaces.Permission;
using JNPF.Systems.Entitys.Dto.Group;
using JNPF.Systems.Entitys.Permission;
using JNPF.Systems.Entitys.System;
using JNPF.Systems.Interfaces.Permission;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;

View File

@@ -1,5 +1,4 @@
using JNPF.Common.Contracts;
using JNPF.Common.Core.Manager;
using JNPF.Common.Core.Manager;
using JNPF.Common.Enums;
using JNPF.Common.Extension;
using JNPF.Common.Filter;
@@ -78,7 +77,8 @@ public class OrganizeAdministratorService : IOrganizeAdministratorService, IDyna
List<string>? orgIds = dataScope.Where(x => x.ThisLayerSelect.Equals(1)).Select(x => x.OrganizeId).ToList();
if (dataScope.Any(x => x.SubLayerSelect.Equals(1)))
{
dataScope.Where(x => x.SubLayerSelect.Equals(1)).ToList().ForEach(item => {
dataScope.Where(x => x.SubLayerSelect.Equals(1)).ToList().ForEach(item =>
{
var resList = _repository.AsSugarClient().Queryable<OrganizeEntity>().Where(o => !o.Id.Equals(item.OrganizeId) && o.OrganizeIdTree.Contains(item.OrganizeId) && o.DeleteMark == null && o.EnabledMark == 1).Select(x => x.Id).ToList();
orgIds.AddRange(resList);
});
@@ -352,7 +352,7 @@ public class OrganizeAdministratorService : IOrganizeAdministratorService, IDyna
resultItem.organizeIdTree = orgItem.OrganizeIdTree;
if (userItem.ThisLayerAdd.Equals(0)) resultItem.thisLayerAdd = -1;
else if(userItem.ThisLayerAdd.Equals(1)) resultItem.thisLayerAdd = 2;
else if (userItem.ThisLayerAdd.Equals(1)) resultItem.thisLayerAdd = 2;
else if (userItem.ThisLayerAdd.Equals(3) || userItem.ThisLayerAdd.Equals(1)) resultItem.thisLayerAdd = 3;
if (userItem.ThisLayerEdit.Equals(0)) resultItem.thisLayerEdit = -1;
@@ -504,7 +504,7 @@ public class OrganizeAdministratorService : IOrganizeAdministratorService, IDyna
[UnitOfWork]
public async Task Save([FromBody] OrganizeAdminIsTratorUpInput input)
{
if(input.userId.Equals(_userManager.UserId)) throw Oops.Oh(ErrorCode.D2304);
if (input.userId.Equals(_userManager.UserId)) throw Oops.Oh(ErrorCode.D2304);
// 处理组织树 名称
List<OrganizeEntity> orgTreeNameList = GetOrgListTreeName();
@@ -552,7 +552,7 @@ public class OrganizeAdministratorService : IOrganizeAdministratorService, IDyna
});
// 管理员权限
var adminList= currList.Where(x => x.ThisLayerAdd.Equals(1) || x.ThisLayerEdit.Equals(1) || x.ThisLayerDelete.Equals(1) || x.ThisLayerSelect.Equals(1) ||
var adminList = currList.Where(x => x.ThisLayerAdd.Equals(1) || x.ThisLayerEdit.Equals(1) || x.ThisLayerDelete.Equals(1) || x.ThisLayerSelect.Equals(1) ||
x.SubLayerAdd.Equals(1) || x.SubLayerEdit.Equals(1) || x.SubLayerDelete.Equals(1) || x.SubLayerSelect.Equals(1)).Where(x => x.UserId.Equals(_userManager.UserId)).ToList().Copy();
adminList.Where(x => x.SubLayerAdd.Equals(1) || x.SubLayerEdit.Equals(1) || x.SubLayerDelete.Equals(1) || x.SubLayerSelect.Equals(1)).ToList().ForEach(item =>
{
@@ -733,7 +733,7 @@ public class OrganizeAdministratorService : IOrganizeAdministratorService, IDyna
/// <returns></returns>
private List<OrganizeAdministratorEntity> GetOrganizeAdministrators(List<OrganizeAdminCrInput> orgAdminList, string userId, List<OrganizeAdministratorEntity> oldList, List<OrganizeAdministratorEntity> adminList)
{
if(!_userManager.IsAdministrator)
if (!_userManager.IsAdministrator)
{
var addItems = new List<OrganizeAdminCrInput>();
orgAdminList.ForEach(item =>
@@ -768,7 +768,7 @@ public class OrganizeAdministratorService : IOrganizeAdministratorService, IDyna
});
oldList.ForEach(item =>
{
if(!orgAdminList.Any(x => x.organizeId.Equals(item.OrganizeId)) && !adminList.Any(x => x.OrganizeId.Equals(item.OrganizeId)))
if (!orgAdminList.Any(x => x.organizeId.Equals(item.OrganizeId)) && !adminList.Any(x => x.OrganizeId.Equals(item.OrganizeId)))
{
addItems.Add(new OrganizeAdminCrInput()
{

View File

@@ -19,7 +19,6 @@ using JNPF.Systems.Interfaces.System;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Tnb.BasicData;
using Yitter.IdGenerator;
namespace JNPF.Systems;
@@ -317,19 +316,19 @@ public class OrganizeService : IOrganizeService, IDynamicApiController, ITransie
queryWhere = queryWhere.And(x => x.DeleteMark == null);
List<OrganizeListOutput>? data = await _repository.AsQueryable().Where(queryWhere)
.WhereIF(input.keyword.IsNotEmptyOrNull(), a => a.FullName.Contains(input.keyword) || a.EnCode.Contains(input.keyword)).Select(a => new OrganizeListOutput
{
id = a.Id,
organizeIdTree = a.OrganizeIdTree,
type = a.Category,
parentId = a.ParentId,
lastFullName = a.FullName,
fullName = a.FullName,
enabledMark = a.EnabledMark,
creatorTime = a.CreatorTime,
icon = a.Category.Equals("company") ? "icon-ym icon-ym-tree-organization3" : "icon-ym icon-ym-tree-department1",
sortCode = a.SortCode,
isLeaf = true
}).ToListAsync();
{
id = a.Id,
organizeIdTree = a.OrganizeIdTree,
type = a.Category,
parentId = a.ParentId,
lastFullName = a.FullName,
fullName = a.FullName,
enabledMark = a.EnabledMark,
creatorTime = a.CreatorTime,
icon = a.Category.Equals("company") ? "icon-ym icon-ym-tree-organization3" : "icon-ym icon-ym-tree-department1",
sortCode = a.SortCode,
isLeaf = true
}).ToListAsync();
// 获取所有组织
List<OrganizeEntity>? allOrgList = GetOrgListTreeName();
@@ -420,7 +419,7 @@ public class OrganizeService : IOrganizeService, IDynamicApiController, ITransie
});
});
if(adminlist.Any()) await _repository.AsSugarClient().Insertable(adminlist).CallEntityMethod(m => m.Create()).ExecuteReturnEntityAsync();
if (adminlist.Any()) await _repository.AsSugarClient().Insertable(adminlist).CallEntityMethod(m => m.Create()).ExecuteReturnEntityAsync();
#endregion
#region
@@ -839,9 +838,9 @@ public class OrganizeService : IOrganizeService, IDynamicApiController, ITransie
public async Task<OrganizeEntity> GetAnyParentByWorkstationId(string id, string type)
{
return await _repository.AsQueryable()
.LeftJoin<OrganizeEntity>((a,b)=>a.OrganizeIdTree.Contains(b.Id) && b.Category==type)
.Where((a,b)=>a.Id==id)
.Select((a,b)=>b).FirstAsync();
.LeftJoin<OrganizeEntity>((a, b) => a.OrganizeIdTree.Contains(b.Id) && b.Category == type)
.Where((a, b) => a.Id == id)
.Select((a, b) => b).FirstAsync();
}
/// <summary>

View File

@@ -4,7 +4,6 @@ using JNPF.Common.Enums;
using JNPF.Common.Extension;
using JNPF.Common.Filter;
using JNPF.Common.Manager;
using JNPF.Common.Models.User;
using JNPF.Common.Security;
using JNPF.DependencyInjection;
using JNPF.DynamicApiController;

View File

@@ -1,5 +1,4 @@
using System.Web;
using JNPF.Common.Const;
using JNPF.Common.Core.Manager;
using JNPF.Common.Enums;
using JNPF.Common.Manager;
@@ -354,7 +353,7 @@ public class SocialsUserService : ISocialsUserService, IDynamicApiController, IT
return new WeChatOpenAuthRequest(clientConfig, authStateCache);
case DefaultAuthSourceEnum.WECHAT_ENTERPRISE:
//return new WeChatEnterpriseAuthRequest(clientConfig, authStateCache);
//return new WeChatEnterpriseAuthRequest(clientConfig, authStateCache);
case DefaultAuthSourceEnum.WECHAT_ENTERPRISE_SCAN:
clientConfig.redirectUri = HttpUtility.UrlEncode(clientConfig.redirectUri);

View File

@@ -384,7 +384,7 @@ public class UserRelationService : IUserRelationService, IDynamicApiController,
else
{
return _repository.AsSugarClient().Queryable<UserRelationEntity, UserEntity>((a, b) => new JoinQueryInfos(JoinType.Left, a.UserId == b.Id))
.Where((a, b) => b.DeleteMark == null && (objId.Contains(a.ObjectId)|| objId.Contains(a.UserId)) && b.EnabledMark > 0).Select(a => a.UserId).Distinct().ToList();
.Where((a, b) => b.DeleteMark == null && (objId.Contains(a.ObjectId) || objId.Contains(a.UserId)) && b.EnabledMark > 0).Select(a => a.UserId).Distinct().ToList();
}
}
else

View File

@@ -335,7 +335,8 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController,
user.ChangePasswordDate = DateTime.Now;
user.LastModifyTime = DateTime.Now;
user.LastModifyUserId = _userManager.UserId;
int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new {
int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new
{
it.Password,
it.ChangePasswordDate,
it.LastModifyUserId,
@@ -356,7 +357,8 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController,
userInfo.IsAdministrator = Convert.ToInt32(_userManager.IsAdministrator);
userInfo.LastModifyTime = DateTime.Now;
userInfo.LastModifyUserId = _userManager.UserId;
int isOk = await _repository.AsUpdateable(userInfo).UpdateColumns(it => new {
int isOk = await _repository.AsUpdateable(userInfo).UpdateColumns(it => new
{
it.RealName,
it.Signature,
it.Gender,
@@ -390,7 +392,8 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController,
user.Theme = input.theme;
user.LastModifyTime = DateTime.Now;
user.LastModifyUserId = _userManager.UserId;
int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new {
int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new
{
it.Theme,
it.LastModifyUserId,
it.LastModifyTime
@@ -409,7 +412,8 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController,
user.Language = input.language;
user.LastModifyTime = DateTime.Now;
user.LastModifyUserId = _userManager.UserId;
int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new {
int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new
{
it.Language,
it.LastModifyUserId,
it.LastModifyTime
@@ -428,7 +432,8 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController,
user.HeadIcon = name;
user.LastModifyTime = DateTime.Now;
user.LastModifyUserId = _userManager.UserId;
int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new {
int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new
{
it.HeadIcon,
it.LastModifyUserId,
it.LastModifyTime
@@ -521,7 +526,8 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController,
userInfo.LastModifyTime = DateTime.Now;
userInfo.LastModifyUserId = _userManager.UserId;
int isOk = await _repository.AsUpdateable(userInfo).UpdateColumns(it => new {
int isOk = await _repository.AsUpdateable(userInfo).UpdateColumns(it => new
{
it.OrganizeId,
it.PositionId,
it.LastModifyUserId,

View File

@@ -1,4 +1,4 @@
using Aop.Api.Domain;
using System.Linq.Expressions;
using JNPF.Common.Configuration;
using JNPF.Common.Const;
using JNPF.Common.Core.Manager;
@@ -32,21 +32,11 @@ using JNPF.Systems.Entitys.System;
using JNPF.Systems.Interfaces.Permission;
using JNPF.Systems.Interfaces.System;
using Mapster;
using Microsoft.AspNetCore.Authentication.OAuth;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Options;
using NPOI.SS.Formula.Eval;
using NPOI.SS.Formula.Functions;
using Org.BouncyCastle.Ocsp;
using Qiniu.Util;
using Senparc.NeuChar.App.AppStore;
using SqlSugar;
using System;
using System.Linq.Expressions;
using System.Security.Principal;
using System.Text.Json.Nodes;
namespace JNPF.Systems;
@@ -312,7 +302,8 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient
.Where((a, b) => b.ObjectType == "Organize" && orgList.Contains(b.ObjectId)).Where((a, b) => a.EnabledMark == 1 && a.DeleteMark == null)
.Where((a, b) => a.RealName.Contains(input.keyword) || a.Account.Contains(input.keyword))
.GroupBy((a, b) => new { a.Id, a.RealName, a.Account, a.EnabledMark })
.Select((a, b) => new {
.Select((a, b) => new
{
id = a.Id,
fullName = SqlFunc.MergeString(a.RealName, "/", a.Account),
enabledMark = a.EnabledMark,
@@ -357,7 +348,8 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient
var res = await _repository.AsSugarClient().Queryable<UserEntity, UserRelationEntity>((a, b) => new JoinQueryInfos(JoinType.Left, b.UserId == a.Id))
.Where((a, b) => b.ObjectType == "Organize" && b.ObjectId == input.organizeId).Where((a, b) => a.EnabledMark == 1 && a.DeleteMark == null)
.GroupBy((a, b) => new { a.Id, a.RealName, a.Account, a.EnabledMark })
.Select((a, b) => new {
.Select((a, b) => new
{
id = a.Id,
fullName = SqlFunc.MergeString(a.RealName, "/", a.Account),
enabledMark = a.EnabledMark,
@@ -564,7 +556,7 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient
var oids = userList.Where(x => x.UserId.Equals(item.id)).Select(x => x.ObjectId).ToList();
var oTree = orgList.Where(x => oids.Contains(x.Id)).Select(x => x.Description).ToList();
item.organize = string.Join(",", oTree);
//item.type = org.fullName;
//item.type = org.fullName;
});
}
@@ -1148,7 +1140,7 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient
public async Task Update(string id, [FromBody] UserUpInput input)
{
UserEntity? oldUserEntity = await _repository.GetFirstAsync(it => it.Id == id);
input.roleId = input.roleId == null ? string.Empty : input.roleId;
input.roleId = input.roleId == null ? string.Empty : input.roleId;
// 超级管理员 只有 admin 账号才有变更权限
if (_userManager.UserId != oldUserEntity.Id && oldUserEntity.IsAdministrator == 1 && _userManager.Account != "admin")
@@ -1240,7 +1232,8 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient
try
{
// 更新用户记录
int newEntity = await _repository.AsUpdateable(entity).UpdateColumns(it => new {
int newEntity = await _repository.AsUpdateable(entity).UpdateColumns(it => new
{
it.Account,
it.RealName,
it.QuickQuery,