From 26450eda6f0c799dc15e3003d3c742549f3faa41 Mon Sep 17 00:00:00 2001 From: ningshuxia <ningshuxia0927@outlook.com> Date: 星期一, 01 四月 2024 13:14:17 +0800 Subject: [PATCH] 修改 --- Yw.BLL.Unit.Core/01-interface/ISysDictType.cs | 9 Yw.BLL.Unit.Core/04-bll/00-helper/CALCreateHelper.cs | 19 + Yw.BLL.Unit.Core/GlobalUsings.cs | 5 Yw.BLL.Unit.Core/00-core/Mapper.cs | 37 ++ Yw.BLL.Unit.Core/Yw.BLL.Unit.Core.csproj | 18 + Yw.Service.Unit.Core/03-settings/paras/Paras_Unit_CAL_HttpClient.cs | 13 Yw.BLL.Unit.Core/03-localclient/SysDictType.cs | 266 ++++++++++++++ Yw.BLL.Unit.Core/04-bll/02-data/SysDictType.cs | 113 ++++++ Yw.BLL.Unit.Core/02-httpclient/SysDictType.cs | 14 Yw.Service.Unit.Core/03-settings/paras/Paras_Unit_CAL.cs | 26 + Yw.Service.Unit.Core/03-settings/paras/Paras_Unit.cs | 5 Yw.BLL.Unit.Core/01-interface/ISysDictData.cs | 19 + Yw.Unit.Core.sln | 8 Yw.BLL.Unit.Core/00-core/ConfigHelper.cs | 19 + Yw.BLL.Unit.Core/02-httpclient/SysDictData.cs | 45 ++ Yw.Service.Unit.Core/03-settings/paras/Paras_Unit_CAL_LocalClient.cs | 10 Yw.BLL.Unit.Core/03-localclient/SysDictData.cs | 300 ++++++++++++++++ Yw.BLL.Unit.Core/04-bll/01-type/SysDictType.cs | 98 +++++ 18 files changed, 1,023 insertions(+), 1 deletions(-) diff --git a/Yw.BLL.Unit.Core/00-core/ConfigHelper.cs b/Yw.BLL.Unit.Core/00-core/ConfigHelper.cs new file mode 100644 index 0000000..551b6c1 --- /dev/null +++ b/Yw.BLL.Unit.Core/00-core/ConfigHelper.cs @@ -0,0 +1,19 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yw.BLL.Unit +{ + internal class ConfigHelper + { + /// <summary> + /// + /// </summary> + public static string HttpUrl + { + get { return Settings.UnitParasHelper.Unit.CAL.HttpClient.HttpUrl; } + } + } +} diff --git a/Yw.BLL.Unit.Core/00-core/Mapper.cs b/Yw.BLL.Unit.Core/00-core/Mapper.cs new file mode 100644 index 0000000..bb5562e --- /dev/null +++ b/Yw.BLL.Unit.Core/00-core/Mapper.cs @@ -0,0 +1,37 @@ +锘縩amespace Yw.BLL.Dict +{ + /// <summary> + /// + /// </summary> + public class Mapper : IRegister + { + /// <summary> + /// + /// </summary> + /// <param name="config"></param> + public void Register(TypeAdapterConfig config) + { + #region 1-type + + config.ForType<Model.SysDictType, SysDictTypeDto>(); + + config.ForType<AddSysDictTypeInput, Model.SysDictType>(); + + config.ForType<UpdateSysDictTypeInput, Model.SysDictType>(); + + #endregion + + #region 2-data + + config.ForType<Model.SysDictData, SysDictDataDto>(); + + config.ForType<AddSysDictDataInput, Model.SysDictData>(); + + config.ForType<UpdateSysDictDataInput, Model.SysDictData>(); + + #endregion + + + } + } +} \ No newline at end of file diff --git a/Yw.BLL.Unit.Core/01-interface/ISysDictData.cs b/Yw.BLL.Unit.Core/01-interface/ISysDictData.cs new file mode 100644 index 0000000..5de3128 --- /dev/null +++ b/Yw.BLL.Unit.Core/01-interface/ISysDictData.cs @@ -0,0 +1,19 @@ +锘縩amespace Yw.CAL +{ + /// <summary> + /// + /// </summary> + public interface ISysDictData : IBaseCAL<AddSysDictDataInput, UpdateSysDictDataInput, SysDictDataDto>, IUpdateCode, IUpdateSorter + { + /// <summary> + /// 閫氳繃 TypeID 鑾峰彇 + /// </summary> + Task<List<SysDictDataDto>> GetByTypeID(long TypeID); + + /// <summary> + /// 閫氳繃 TypeID 鍒犻櫎 + /// </summary> + Task<bool> DeleteByTypeID(long TypeID); + + } +} diff --git a/Yw.BLL.Unit.Core/01-interface/ISysDictType.cs b/Yw.BLL.Unit.Core/01-interface/ISysDictType.cs new file mode 100644 index 0000000..62d0642 --- /dev/null +++ b/Yw.BLL.Unit.Core/01-interface/ISysDictType.cs @@ -0,0 +1,9 @@ +锘縩amespace Yw.CAL +{ + /// <summary> + /// + /// </summary> + public interface ISysDictType : IBaseCAL<AddSysDictTypeInput, UpdateSysDictTypeInput, SysDictTypeDto>, IUpdateCode, IUpdateSorter + { + } +} diff --git a/Yw.BLL.Unit.Core/02-httpclient/SysDictData.cs b/Yw.BLL.Unit.Core/02-httpclient/SysDictData.cs new file mode 100644 index 0000000..d70d882 --- /dev/null +++ b/Yw.BLL.Unit.Core/02-httpclient/SysDictData.cs @@ -0,0 +1,45 @@ +锘縩amespace Yw.CAL.HttpClient +{ + /// <summary> + /// 绯荤粺瀛楀吀鍊� + /// </summary> + public partial class SysDictData : BaseCAL_Code_Sorter<AddSysDictDataInput, UpdateSysDictDataInput, SysDictDataDto>, ISysDictData + { + protected override string Prefix + { + get { return $"{Yw.BLL.ConfigHelper.HttpUrl}/Dict/Type"; } + } + + protected override string GetUrl(string cmd) + { + return default; + } + + /// <summary> + /// 閫氳繃 TypeID 鑾峰彇 + /// </summary> + public async Task<List<SysDictDataDto>> GetByTypeID(long TypeID) + { + var url = GetUrl("GetByTypeID@1.0"); + var result = await RequestHelper.Request(url) + .SetQueryParam(nameof(TypeID), TypeID).GetAsync().ReceiveJson<Result<List<SysDictDataDto>>>(); + result.TryThrowException(); + return result.Data; + } + + /// <summary> + /// 閫氳繃 TypeID 鍒犻櫎 + /// </summary> + public async Task<bool> DeleteByTypeID(long TypeID) + { + var url = GetUrl("DeleteByTypeID@1.0"); + var result = await RequestHelper.Request(url) + .SetQueryParam(nameof(TypeID), TypeID).DeleteAsync().ReceiveJson<Result<bool>>(); + result.TryThrowException(); + return result.Data; + } + + + + } +} \ No newline at end of file diff --git a/Yw.BLL.Unit.Core/02-httpclient/SysDictType.cs b/Yw.BLL.Unit.Core/02-httpclient/SysDictType.cs new file mode 100644 index 0000000..277ffac --- /dev/null +++ b/Yw.BLL.Unit.Core/02-httpclient/SysDictType.cs @@ -0,0 +1,14 @@ +锘縩amespace Yw.CAL.HttpClient +{ + /// <summary> + /// 绯荤粺瀛楀吀绫诲瀷 + /// </summary> + public partial class SysDictType : BaseCAL_Code_Sorter<AddSysDictTypeInput, UpdateSysDictTypeInput, SysDictTypeDto>, ISysDictType + { + protected override string Prefix + { + get { return $"{Yw.BLL.ConfigHelper.HttpUrl}/Dict/Type"; } + } + + } +} \ No newline at end of file diff --git a/Yw.BLL.Unit.Core/03-localclient/SysDictData.cs b/Yw.BLL.Unit.Core/03-localclient/SysDictData.cs new file mode 100644 index 0000000..f7fd284 --- /dev/null +++ b/Yw.BLL.Unit.Core/03-localclient/SysDictData.cs @@ -0,0 +1,300 @@ +锘縩amespace Yw.CAL.LocalClient +{ + /// <summary> + /// 绯荤粺瀛楀吀鍊� + /// </summary> + public partial class SysDictData : ISysDictData + { + private readonly Yw.Service.SysDictData _service = new(); + + #region Query + + /// <summary> + /// 鑾峰彇鎵�鏈� + /// </summary> + public async Task<List<SysDictDataDto>> GetAll() + { + return await Task.Factory.StartNew(() => + { + var list = _service.GetAll(); + var vm_list = list?.Select(x => new SysDictDataDto(x)).ToList(); + return vm_list; + }); + } + + /// <summary> + /// 閫氳繃 TypeID 鑾峰彇 + /// </summary> + public async Task<List<SysDictDataDto>> GetByTypeID(long TypeID) + { + return await Task.Factory.StartNew(() => + { + var list = _service.GetByTypeID(TypeID); + var vm_list = list?.Select(x => new SysDictDataDto(x)).ToList(); + return vm_list; + }); + } + + /// <summary> + /// 閫氳繃 ID 鑾峰彇 + /// </summary> + public async Task<SysDictDataDto> GetByID(long ID) + { + return await Task.Factory.StartNew(() => + { + var model = _service.GetByID(ID); + return model == null ? null : new SysDictDataDto(model); + }); + } + + /// <summary> + /// 閫氳繃 Ids 鑾峰彇 + /// </summary> + public async Task<List<SysDictDataDto>> GetByIds(List<long> Ids) + { + return await Task.Factory.StartNew(() => + { + var list = _service.GetByIds(Ids); + var vm_list = list?.Select(x => new SysDictDataDto(x)).ToList(); + return vm_list; + }); + } + + #endregion + + #region Insert + + /// <summary> + /// 鎻掑叆涓�鏉� + /// </summary> + public async Task<long> Insert(AddSysDictDataInput input) + { + return await Task.Factory.StartNew(() => + { + var type = new Service.SysDictType().GetByID(input.TypeID); + if (type == null) + { + throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"TypeID:{input.TypeID} 鏁版嵁涓嶅瓨鍦�"); + } + if (_service.IsExistCode(input.TypeID, input.Code)) + { + throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"Code:{input.Code} 缂栫爜宸插瓨鍦�"); + } + var model = input.Adapt<AddSysDictDataInput, Model.SysDictData>(); + model.SortCode = _service.GetMaxSortCode(input.TypeID) + 1; + var id = _service.Insert(model); + return id; + }); + } + + /// <summary> + /// 鎵归噺鎻掑叆 + /// </summary> + public async Task<bool> Inserts(List<AddSysDictDataInput> inputList) + { + return await Task.Factory.StartNew(() => + { + var list = inputList.Select(x => x.Adapt<AddSysDictDataInput, Model.SysDictData>()).ToList(); + list.ForEach(x => + { + x.SortCode = _service.GetMaxSortCode(x.TypeID) + 1 + list.IndexOf(x); + }); + var bol = _service.Inserts(list); + return bol; + }); + } + + /// <summary> + /// 澶ф壒閲忔彃鍏� + /// </summary> + public async Task<bool> BulkInserts(List<AddSysDictDataInput> list) + { + return await Task.Factory.StartNew(() => + { + return false; + }); + } + + #endregion + + #region Update + + /// <summary> + /// 鏇存柊涓�鏉� + /// </summary> + public async Task<bool> Update(UpdateSysDictDataInput input) + { + return await Task.Factory.StartNew(() => + { + var model = _service.GetByID(input.ID); + if (model == null) + { + throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} 鏁版嵁涓嶅瓨鍦�"); + } + + if (_service.IsExistCodeExceptID(model.TypeID, input.Code, input.ID)) + { + throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"Code:{input.Code} 缂栫爜宸插瓨鍦�"); + } + + var rhs = new Model.SysDictData(model); + input.Adapt(rhs); + var bol = _service.Update(rhs); + return bol; + }); + } + + /// <summary> + /// 鎵归噺鏇存柊 + /// </summary> + public async Task<bool> Updates(List<UpdateSysDictDataInput> inputList) + { + return await Task.Factory.StartNew(() => + { + if (inputList == null || inputList.Count < 1) + { + return false; + } + var list = inputList.Select(x => x.Adapt<UpdateSysDictDataInput, Model.SysDictData>()).ToList(); + var bol = _service.Updates(list); + return bol; + }); + } + + /// <summary> + /// 澶ф壒閲忔洿鏂� + /// </summary> + public async Task<bool> BulkUpdates(List<UpdateSysDictDataInput> list) + { + return await Task.Factory.StartNew(() => + { + return false; + }); + } + + /// <summary> + /// 鏇存柊缂栫爜 + /// </summary> + public async Task<bool> UpdateCode(long ID, string Code) + { + return await Task.Factory.StartNew(() => + { + return false; + }); + } + + /// <summary> + /// 鏇存柊鎺掑簭鐮� + /// </summary> + public async Task<bool> UpdateSortCode(long ID, int SortCode) + { + return await Task.Factory.StartNew(() => + { + var bol = _service.UpdateSortCode(ID, SortCode); + return bol; + }); + } + + /// <summary> + /// 鏇存柊鎺掑簭 + /// </summary> + public async Task<bool> UpdateSorter(List<UpdateSortCodeInput> inputList) + { + return await Task.Factory.StartNew(() => + { + var list = inputList.Select(x => x.Adapt<Model.Sorter>()).ToList(); + var bol = _service.UpdateSorter(list); + return bol; + }); + } + + #endregion + + #region Exist + + /// <summary> + /// 鍒ゆ柇 Code 鏄惁瀛樺湪 + /// </summary> + public async Task<bool> IsExistCode(long TypeID, string Code) + { + return await Task.Factory.StartNew(() => + { + var bol = _service.IsExistCode(TypeID, Code); + return bol; + }); + } + + /// <summary> + /// 鍒ゆ柇 Code 鏄惁瀛樺湪 ExceptID + /// </summary> + public async Task<bool> IsExistCodeExceptID(long TypeID, string Code, long ExceptID) + { + return await Task.Factory.StartNew(() => + { + var bol = _service.IsExistCodeExceptID(TypeID, Code, ExceptID); + return bol; + }); + } + + #endregion + + #region Delete + + /// <summary> + /// 閫氳繃 ID 鍒犻櫎 + /// </summary> + public async Task<bool> DeleteByID(long ID) + { + return await Task.Factory.StartNew(() => + { + var bol = _service.DeleteByID(ID, out string msg); + if (!bol) + { + throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D999, msg); + } + return true; + }); + } + + /// <summary> + /// 閫氳繃 Ids 鍒犻櫎 + /// </summary> + public async Task<bool> DeleteByIds(List<long> Ids) + { + return await Task.Factory.StartNew(() => + { + return false; + }); + } + + /// <summary> + /// 閫氳繃 TypeID 鍒犻櫎 + /// </summary> + public async Task<bool> DeleteByTypeID(long TypeID) + { + return await Task.Factory.StartNew(() => + { + var bol = _service.DeleteByTypeID(TypeID, out string msg); + if (!bol) + { + throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D999, msg); + } + return true; + }); + } + + /// <summary> + /// 鍒犻櫎鍏ㄩ儴 + /// </summary> + /// <returns></returns> + public async Task<bool> DeleteAll() + { + return await Task.Factory.StartNew(() => + { + return false; + }); + } + + #endregion + } +} \ No newline at end of file diff --git a/Yw.BLL.Unit.Core/03-localclient/SysDictType.cs b/Yw.BLL.Unit.Core/03-localclient/SysDictType.cs new file mode 100644 index 0000000..398bfa6 --- /dev/null +++ b/Yw.BLL.Unit.Core/03-localclient/SysDictType.cs @@ -0,0 +1,266 @@ +锘縩amespace Yw.CAL.LocalClient +{ + /// <summary> + /// 绯荤粺瀛楀吀鍊� + /// </summary> + public partial class SysDictType : ISysDictType + { + private readonly Yw.Service.SysDictType _service = new(); + + #region Query + + /// <summary> + /// 鑾峰彇鎵�鏈� + /// </summary> + public async Task<List<SysDictTypeDto>> GetAll() + { + return await Task.Factory.StartNew(() => + { + var list = _service.GetAll(); + var vm_list = list?.Select(x => new SysDictTypeDto(x)).ToList(); + return vm_list; + }); + } + + /// <summary> + /// 閫氳繃 ID 鑾峰彇 + /// </summary> + public async Task<SysDictTypeDto> GetByID(long ID) + { + return await Task.Factory.StartNew(() => + { + var model = _service.GetByID(ID); + return model == null ? null : new SysDictTypeDto(model); + }); + } + + /// <summary> + /// 閫氳繃 Ids 鑾峰彇 + /// </summary> + public async Task<List<SysDictTypeDto>> GetByIds(List<long> Ids) + { + return await Task.Factory.StartNew(() => + { + var list = _service.GetByIds(Ids); + var vm_list = list?.Select(x => new SysDictTypeDto(x)).ToList(); + return vm_list; + }); + } + + #endregion + + #region Insert + + /// <summary> + /// 鎻掑叆涓�鏉� + /// </summary> + public async Task<long> Insert(AddSysDictTypeInput input) + { + return await Task.Factory.StartNew(() => + { + if (_service.IsExistCode(input.Code)) + { + throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"Code:{input.Code} 缂栫爜宸插瓨鍦�"); + } + var model = input.Adapt<AddSysDictTypeInput, Model.SysDictType>(); + model.SortCode = _service.GetMaxSortCode() + 1; + var id = _service.Insert(model); + return id; + }); + } + + /// <summary> + /// 鎵归噺鎻掑叆 + /// </summary> + public async Task<bool> Inserts(List<AddSysDictTypeInput> inputList) + { + return await Task.Factory.StartNew(() => + { + var list = inputList.Select(x => x.Adapt<AddSysDictTypeInput, Model.SysDictType>()).ToList(); + list.ForEach(x => + { + x.SortCode = _service.GetMaxSortCode() + 1 + list.IndexOf(x); + }); + var bol = _service.Inserts(list); + return bol; + }); + } + + /// <summary> + /// 澶ф壒閲忔彃鍏� + /// </summary> + public async Task<bool> BulkInserts(List<AddSysDictTypeInput> list) + { + return await Task.Factory.StartNew(() => + { + return false; + }); + } + + #endregion + + #region Update + + /// <summary> + /// 鏇存柊涓�鏉� + /// </summary> + public async Task<bool> Update(UpdateSysDictTypeInput input) + { + return await Task.Factory.StartNew(() => + { + var model = _service.GetByID(input.ID); + if (model == null) + { + throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} 鏁版嵁涓嶅瓨鍦�"); + } + + if (_service.IsExistCodeExceptID(input.Code, input.ID)) + { + throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"Code:{input.Code} 缂栫爜宸插瓨鍦�"); + } + + var rhs = new Model.SysDictType(model); + input.Adapt(rhs); + var bol = _service.Update(rhs); + return bol; + }); + } + + /// <summary> + /// 鎵归噺鏇存柊 + /// </summary> + public async Task<bool> Updates(List<UpdateSysDictTypeInput> inputList) + { + return await Task.Factory.StartNew(() => + { + if (inputList == null || inputList.Count < 1) + { + return false; + } + var list = inputList.Select(x => x.Adapt<UpdateSysDictTypeInput, Model.SysDictType>()).ToList(); + var bol = _service.Updates(list); + return bol; + }); + } + + /// <summary> + /// 澶ф壒閲忔洿鏂� + /// </summary> + public async Task<bool> BulkUpdates(List<UpdateSysDictTypeInput> list) + { + return await Task.Factory.StartNew(() => + { + return false; + }); + } + + /// <summary> + /// 鏇存柊缂栫爜 + /// </summary> + public async Task<bool> UpdateCode(long ID, string Code) + { + return await Task.Factory.StartNew(() => + { + return false; + }); + } + + /// <summary> + /// 鏇存柊鎺掑簭鐮� + /// </summary> + public async Task<bool> UpdateSortCode(long ID, int SortCode) + { + return await Task.Factory.StartNew(() => + { + var bol = _service.UpdateSortCode(ID, SortCode); + return bol; + }); + } + + /// <summary> + /// 鏇存柊鎺掑簭 + /// </summary> + public async Task<bool> UpdateSorter(List<UpdateSortCodeInput> inputList) + { + return await Task.Factory.StartNew(() => + { + var list = inputList.Select(x => x.Adapt<Model.Sorter>()).ToList(); + var bol = _service.UpdateSorter(list); + return bol; + }); + } + + #endregion + + #region Exist + + /// <summary> + /// 鍒ゆ柇 Code 鏄惁瀛樺湪 + /// </summary> + public async Task<bool> IsExistCode(string Code) + { + return await Task.Factory.StartNew(() => + { + var bol = _service.IsExistCode(Code); + return bol; + }); + } + + /// <summary> + /// 鍒ゆ柇 Code 鏄惁瀛樺湪 ExceptID + /// </summary> + public async Task<bool> IsExistCodeExceptID(string Code, long ExceptID) + { + return await Task.Factory.StartNew(() => + { + var bol = _service.IsExistCodeExceptID(Code, ExceptID); + return bol; + }); + } + + #endregion + + #region Delete + + /// <summary> + /// 閫氳繃 ID 鍒犻櫎 + /// </summary> + public async Task<bool> DeleteByID(long ID) + { + return await Task.Factory.StartNew(() => + { + var bol = _service.DeleteByID(ID, out string msg); + if (!bol) + { + throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D999, msg); + } + return true; + }); + } + + /// <summary> + /// 閫氳繃 Ids 鍒犻櫎 + /// </summary> + public async Task<bool> DeleteByIds(List<long> Ids) + { + return await Task.Factory.StartNew(() => + { + return false; + }); + } + + /// <summary> + /// 鍒犻櫎鍏ㄩ儴 + /// </summary> + /// <returns></returns> + public async Task<bool> DeleteAll() + { + return await Task.Factory.StartNew(() => + { + return false; + }); + } + + #endregion + } +} \ No newline at end of file diff --git a/Yw.BLL.Unit.Core/04-bll/00-helper/CALCreateHelper.cs b/Yw.BLL.Unit.Core/04-bll/00-helper/CALCreateHelper.cs new file mode 100644 index 0000000..77c8a47 --- /dev/null +++ b/Yw.BLL.Unit.Core/04-bll/00-helper/CALCreateHelper.cs @@ -0,0 +1,19 @@ +锘縩amespace Yw.BLL.Dict +{ + /// <summary> + /// CAL杈呭姪绫� + /// </summary> + internal class CALCreateHelper + { + /// <summary> + /// 鍒涘缓DAL + /// </summary> + /// <typeparam name="T"></typeparam> + /// <returns></returns> + public static T CreateCAL<T>() + { + var type = Settings.DictParasHelper.Dict.CAL.CALType; + return Yw.CALFactory.CreateCAL<T>(type); + } + } +} diff --git a/Yw.BLL.Unit.Core/04-bll/01-type/SysDictType.cs b/Yw.BLL.Unit.Core/04-bll/01-type/SysDictType.cs new file mode 100644 index 0000000..22595e3 --- /dev/null +++ b/Yw.BLL.Unit.Core/04-bll/01-type/SysDictType.cs @@ -0,0 +1,98 @@ +锘縩amespace Yw.BLL +{ + /// <summary> + /// + /// </summary> + public class SysDictType : Yw.CAL.ISysDictType + { + private readonly Yw.CAL.ISysDictType _cal = CALCreateHelper.CreateCAL<Yw.CAL.ISysDictType>(); + + #region Query銆� + public Task<List<SysDictTypeDto>> GetAll() + { + return _cal.GetAll(); + } + + public Task<SysDictTypeDto> GetByID(long ID) + { + return _cal.GetByID(ID); + } + + public Task<List<SysDictTypeDto>> GetByIds(List<long> Ids) + { + return _cal.GetByIds(Ids); + } + + #endregion + + #region Insert + + public Task<long> Insert(AddSysDictTypeInput model) + { + return _cal.Insert(model); + } + + public Task<bool> Inserts(List<AddSysDictTypeInput> list) + { + return _cal.Inserts(list); + } + + public Task<bool> BulkInserts(List<AddSysDictTypeInput> list) + { + return _cal.BulkInserts(list); + } + + #endregion + + #region Update + + public Task<bool> Update(UpdateSysDictTypeInput model) + { + return _cal.Update(model); + } + + public Task<bool> Updates(List<UpdateSysDictTypeInput> list) + { + return _cal.Updates(list); + } + + public Task<bool> BulkUpdates(List<UpdateSysDictTypeInput> list) + { + return _cal.BulkUpdates(list); + } + + public Task<bool> UpdateCode(long ID, string Code) + { + return _cal.UpdateCode(ID, Code); + } + + public Task<bool> UpdateSortCode(long ID, int SortCode) + { + return _cal.UpdateSortCode(ID, SortCode); + } + + public Task<bool> UpdateSorter(List<UpdateSortCodeInput> Sorters) + { + return _cal.UpdateSorter(Sorters); + } + + #endregion + + #region Delete銆� + public Task<bool> DeleteByID(long ID) + { + return _cal.DeleteByID(ID); + } + public Task<bool> DeleteByIds(List<long> Ids) + { + return _cal.DeleteByIds(Ids); + } + + public Task<bool> DeleteAll() + { + return _cal.DeleteAll(); + } + #endregion + + } +} diff --git a/Yw.BLL.Unit.Core/04-bll/02-data/SysDictType.cs b/Yw.BLL.Unit.Core/04-bll/02-data/SysDictType.cs new file mode 100644 index 0000000..809a7f8 --- /dev/null +++ b/Yw.BLL.Unit.Core/04-bll/02-data/SysDictType.cs @@ -0,0 +1,113 @@ +锘縩amespace Yw.BLL +{ + /// <summary> + /// + /// </summary> + public class SysDictData : Yw.CAL.ISysDictData + { + private readonly Yw.CAL.ISysDictData _cal = CALCreateHelper.CreateCAL<Yw.CAL.ISysDictData>(); + + + #region Query銆� + public Task<List<SysDictDataDto>> GetAll() + { + return _cal.GetAll(); + } + + public Task<SysDictDataDto> GetByID(long ID) + { + return _cal.GetByID(ID); + } + + public Task<List<SysDictDataDto>> GetByIds(List<long> Ids) + { + return _cal.GetByIds(Ids); + } + + + public Task<List<SysDictDataDto>> GetByTypeID(long TypeID) + { + return _cal.GetByTypeID(TypeID); + } + #endregion + + #region Insert + + public Task<long> Insert(AddSysDictDataInput model) + { + return _cal.Insert(model); + } + + public Task<bool> Inserts(List<AddSysDictDataInput> list) + { + return _cal.Inserts(list); + } + + public Task<bool> BulkInserts(List<AddSysDictDataInput> list) + { + return _cal.BulkInserts(list); + } + + #endregion + + #region Update + + public Task<bool> Update(UpdateSysDictDataInput model) + { + return _cal.Update(model); + } + + public Task<bool> Updates(List<UpdateSysDictDataInput> list) + { + return _cal.Updates(list); + } + + public Task<bool> BulkUpdates(List<UpdateSysDictDataInput> list) + { + return _cal.BulkUpdates(list); + } + + public Task<bool> UpdateCode(long ID, string Code) + { + return _cal.UpdateCode(ID, Code); + } + + public Task<bool> UpdateSortCode(long ID, int SortCode) + { + return _cal.UpdateSortCode(ID, SortCode); + } + + public Task<bool> UpdateSorter(List<UpdateSortCodeInput> Sorters) + { + return _cal.UpdateSorter(Sorters); + } + + #endregion銆� + + #region Delete銆� + public Task<bool> DeleteByID(long ID) + { + return _cal.DeleteByID(ID); + } + + public Task<bool> DeleteByTypeID(long TypeID) + { + return _cal.DeleteByTypeID(TypeID); + } + + + public Task<bool> DeleteByIds(List<long> Ids) + { + return _cal.DeleteByIds(Ids); + } + + public Task<bool> DeleteAll() + { + return _cal.DeleteAll(); + } + + #endregion + + + } +} diff --git a/Yw.BLL.Unit.Core/GlobalUsings.cs b/Yw.BLL.Unit.Core/GlobalUsings.cs new file mode 100644 index 0000000..930bf9e --- /dev/null +++ b/Yw.BLL.Unit.Core/GlobalUsings.cs @@ -0,0 +1,5 @@ +锘縢lobal using Flurl.Http; +global using Mapster; +global using Yw.BLL.Dict; +global using Yw.Dto; +global using Yw.Dto.Dict; diff --git a/Yw.BLL.Unit.Core/Yw.BLL.Unit.Core.csproj b/Yw.BLL.Unit.Core/Yw.BLL.Unit.Core.csproj new file mode 100644 index 0000000..c8e536f --- /dev/null +++ b/Yw.BLL.Unit.Core/Yw.BLL.Unit.Core.csproj @@ -0,0 +1,18 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net6.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + <Version>3.0.0</Version> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Yw.CAL.HttpClient.Core" Version="3.0.2" /> + <PackageReference Include="Yw.CALFactory.Core" Version="3.0.0" /> + <PackageReference Include="Yw.Dto.Unit.Core" Version="3.0.0" /> + <PackageReference Include="Yw.Mapster.Core" Version="3.0.0" /> + <PackageReference Include="Yw.Service.Unit.Core" Version="3.0.0" /> + </ItemGroup> + +</Project> diff --git a/Yw.Service.Unit.Core/03-settings/paras/Paras_Unit.cs b/Yw.Service.Unit.Core/03-settings/paras/Paras_Unit.cs index 4fa93d0..dfdb37b 100644 --- a/Yw.Service.Unit.Core/03-settings/paras/Paras_Unit.cs +++ b/Yw.Service.Unit.Core/03-settings/paras/Paras_Unit.cs @@ -10,5 +10,10 @@ /// 鏁版嵁搴� /// </summary> public Paras_Unit_DataBase DataBase { get; set; } + + /// <summary> + /// CAL + /// </summary> + public Paras_Unit_CAL CAL { get; set; } } } diff --git a/Yw.Service.Unit.Core/03-settings/paras/Paras_Unit_CAL.cs b/Yw.Service.Unit.Core/03-settings/paras/Paras_Unit_CAL.cs new file mode 100644 index 0000000..e037f87 --- /dev/null +++ b/Yw.Service.Unit.Core/03-settings/paras/Paras_Unit_CAL.cs @@ -0,0 +1,26 @@ +锘縩amespace Yw.Settings +{ + /// <summary> + /// + /// </summary> + public class Paras_Unit_CAL + { + /// <summary> + /// CAL绫诲瀷 + /// </summary> + public string CALType { get; set; } + + /// <summary> + /// HttpClient + /// </summary> + public Paras_Unit_CAL_HttpClient HttpClient { get; set; } + + /// <summary> + /// LocalClient + /// </summary> + public Paras_Unit_CAL_LocalClient LocalClient { get; set; } + + + } + +} diff --git a/Yw.Service.Unit.Core/03-settings/paras/Paras_Unit_CAL_HttpClient.cs b/Yw.Service.Unit.Core/03-settings/paras/Paras_Unit_CAL_HttpClient.cs new file mode 100644 index 0000000..d77134d --- /dev/null +++ b/Yw.Service.Unit.Core/03-settings/paras/Paras_Unit_CAL_HttpClient.cs @@ -0,0 +1,13 @@ +锘縩amespace Yw.Settings +{ + /// <summary> + /// + /// </summary> + public class Paras_Unit_CAL_HttpClient + { + /// <summary> + /// + /// </summary> + public string HttpUrl { get; set; } + } +} diff --git a/Yw.Service.Unit.Core/03-settings/paras/Paras_Unit_CAL_LocalClient.cs b/Yw.Service.Unit.Core/03-settings/paras/Paras_Unit_CAL_LocalClient.cs new file mode 100644 index 0000000..857a0cb --- /dev/null +++ b/Yw.Service.Unit.Core/03-settings/paras/Paras_Unit_CAL_LocalClient.cs @@ -0,0 +1,10 @@ +锘縩amespace Yw.Settings +{ + /// <summary> + /// + /// </summary> + public class Paras_Unit_CAL_LocalClient + { + + } +} diff --git a/Yw.Unit.Core.sln b/Yw.Unit.Core.sln index 796eea1..4a2f8f4 100644 --- a/Yw.Unit.Core.sln +++ b/Yw.Unit.Core.sln @@ -11,7 +11,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yw.Entry.Unit.Core", "Yw.Entry.Unit.Core\Yw.Entry.Unit.Core.csproj", "{414C843E-CEB5-475C-B798-EFE4F45556B4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yw.Dto.Unit.Core", "Yw.Dto.Unit.Core\Yw.Dto.Unit.Core.csproj", "{A94D8098-938D-4FEA-B026-91F45E7C4783}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yw.Dto.Unit.Core", "Yw.Dto.Unit.Core\Yw.Dto.Unit.Core.csproj", "{A94D8098-938D-4FEA-B026-91F45E7C4783}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yw.BLL.Unit.Core", "Yw.BLL.Unit.Core\Yw.BLL.Unit.Core.csproj", "{48032700-781C-45AC-95A7-DB03BEC013CC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -39,6 +41,10 @@ {A94D8098-938D-4FEA-B026-91F45E7C4783}.Debug|Any CPU.Build.0 = Debug|Any CPU {A94D8098-938D-4FEA-B026-91F45E7C4783}.Release|Any CPU.ActiveCfg = Release|Any CPU {A94D8098-938D-4FEA-B026-91F45E7C4783}.Release|Any CPU.Build.0 = Release|Any CPU + {48032700-781C-45AC-95A7-DB03BEC013CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {48032700-781C-45AC-95A7-DB03BEC013CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {48032700-781C-45AC-95A7-DB03BEC013CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {48032700-781C-45AC-95A7-DB03BEC013CC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- Gitblit v1.9.3