diff --git a/XPrint.Image/Tools/ChannelImageTool.cs b/XPrint.Image/Tools/ChannelImageTool.cs
new file mode 100644
index 0000000..404ac87
--- /dev/null
+++ b/XPrint.Image/Tools/ChannelImageTool.cs
@@ -0,0 +1,178 @@
+using HPPH;
+using ImageMagick;
+using ImageMagick.Formats;
+using Pipelines.Sockets.Unofficial.Arenas;
+using SixLabors.ImageSharp.PixelFormats;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XPrint.Image.Tools
+{
+ public class ChannelImageTool
+ {
+
+ ///
+ /// 分色接口
+ ///
+ /// 输入图片路径
+ /// 输出图片路径
+ /// icc名称
+ /// icc文件路径
+ public static void SplitColor(string inputPath, string outputPath, string iccProfilePath = "")
+ {
+ using (var image = new MagickImage(inputPath)
+ {
+ ColorSpace = ColorSpace.sRGB // 若需与 CMYK 工作流对接,改为 CMYK 并与源一致
+ })
+ {
+ //var profileBim1 = image.Get8BimProfile();
+ //if (profileBim1 != null)
+ //{
+ // var data = profileBim1.ToByteArray();
+ // File.WriteAllBytes(@"D:\8bim_white_channel", data);
+ //}
+
+
+ // 配置大端字节序
+ var writeSettings = new TiffWriteDefines();
+ writeSettings.Endian = Endian.MSB;//大端模式,兼容性好些
+ image.Alpha(AlphaOption.On);
+ image.MetaChannelCount = 0;
+
+ ushort[] area;
+ var pixels = image.GetPixels();
+ var areaAlpha = pixels.GetArea(0, 0, image.Width, image.Height)!;
+
+ image.Alpha(AlphaOption.Off);
+ image.MetaChannelCount = 1;
+
+ var pixels2 = image.GetPixels();
+
+ area = pixels2.GetArea(0, 0, image.Width, image.Height)!;
+ // 遍历每个像素,根据Alpha值设置White通道
+ for (int i = 0; i < areaAlpha.Length; i += 4)
+ {
+ // 获取原始图像的Alpha值
+ ushort alpha = areaAlpha[i + 3];
+
+ var r = area[i];
+ var g = area[i + 1];
+ var b = area[i + 2];
+
+ // 2. 计算白色墨量:通过RGB值计算灰度值(灰度越高,白色墨量越多)
+ // 公式:gray = 0.299*R + 0.587*G + 0.114*B(适配16位范围)
+ double grayValue = 0.299 * r + 0.587 * g + 0.114 * b;
+ ushort whiteInkAmount = (ushort)Math.Clamp(grayValue, 0, 65535); // 确保在0~65535范围内
+
+ // 3. 黑色填充深度 = 白色墨量(墨量越多,黑色越深)
+ // 将白色墨量直接映射到目标通道(i+4),值越高表示黑色越深
+ area[i + 3] = whiteInkAmount;
+ }
+
+ pixels2.SetPixels(area);
+
+
+
+ string bimFileName = "8bim_white_channel";
+ var bimData = File.ReadAllBytes(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"assets/{bimFileName}"));
+ var profileBim = new EightBimProfile(image, bimData);
+
+ //image.Alpha(AlphaOption.Remove);
+ profileBim.SetExifProfile(image.GetExifProfile());
+ profileBim.SetIptcProfile(image.GetIptcProfile());
+ profileBim.SetXmpProfile(image.GetXmpProfile());
+ image.SetProfile(profileBim);
+
+ profileBim.GetExifProfile()?.CreateThumbnail();
+
+ image.Settings.Compression = CompressionMethod.LZW;
+ image.SetCompression(CompressionMethod.LZW);//LZW压缩避免竖线问题
+ //writeSettings.Alpha = TiffAlpha.Associated;
+ // 保存
+ // 4. 保存结果
+ image.Write(outputPath);
+ Console.WriteLine($"填充完成,结果已保存至:{outputPath}");
+ //}
+
+ //var profileBim = image.Get8BimProfile()!;
+ //profileBim.GetExifProfile()?.RemoveThumbnail();
+ //File.WriteAllBytes(@$"D:\{bimFileName}", profileBim.ToByteArray());
+
+ //if (bimProfile != null)
+ //{
+ // var exifProfile = bimProfile.GetExifProfile();
+ // var xmpProfile = bimProfile.GetXmpProfile();
+ // var iptcProfile = bimProfile.GetIptcProfile();
+
+ // profileBim.SetExifProfile(exifProfile);
+ // profileBim.SetIptcProfile(iptcProfile);
+ // profileBim.SetXmpProfile(xmpProfile);
+ //}
+
+
+ //image.Compose = CompositeOperator.Overlay;
+
+ //var channelNames = new Dictionary
+ //{
+ // { 0, "C" }, // 假设通道索引1对应红色
+ // { 1, "M" },
+ // { 2, "Y" },
+ // { 3, "K" },
+ // { 4, "A" },
+ // { 5, "W" }
+ //};
+
+ //TiffModifier.RenameCustomChannels(@"D:\2.tiff", Path.Combine(Path.GetDirectoryName(outputPath)!, "3.tif"), channelNames);
+ // 创建包含 4 个自定义通道的图像
+ //using (System.Drawing.Image imageA = new Bitmap(new MemoryStream(image.ToByteArray())))
+ //{
+ // var items = imageA.PropertyItems;
+ //}
+ }
+ }
+
+ //private static string AddCustomXmpChannelName(string xmpXml, string channelName)
+ //{
+ // // 注意:此方法需要根据实际 XMP 结构和命名空间调整
+ // // 示例:添加自定义命名空间 "mychannel"
+ // if (!xmpXml.Contains("xmlns:mychannel"))
+ // {
+ // xmpXml = xmpXml.Replace("{channelName}";
+ // int insertPos = xmpXml.IndexOf("");
+ // if (insertPos > 0)
+ // {
+ // xmpXml = xmpXml.Insert(insertPos, channelProperty);
+ // }
+
+ // return xmpXml;
+ //}
+
+
+ //public static void GenerateMultiPageCmykTiff(MagickImage[] imagePages, string outputPath)
+ //{
+ // using (var images = new MagickImageCollection())
+ // {
+ // for (int i = 0; i < imagePages.Length; i++)
+ // {
+ // //设置dpi
+ // //imagePages[i].Density = new Density(300.00, 300.00);
+ // images.Add(imagePages[i]);
+ // }
+
+
+ // // 配置大端字节序
+ // var writeSettings = new WriteTiffBigEndianDefines();
+
+ // // 保存多页
+ // images.Write(outputPath, writeSettings);
+ // }
+ //}
+ }
+}
diff --git a/XPrintServer.Admin.Api/Controllers/BackstageUserController.cs b/XPrintServer.Admin.Api/Controllers/BackstageUserController.cs
index 41a6c84..2a39717 100644
--- a/XPrintServer.Admin.Api/Controllers/BackstageUserController.cs
+++ b/XPrintServer.Admin.Api/Controllers/BackstageUserController.cs
@@ -1,5 +1,6 @@
using CrazyStudio.Core.Common.CryptHelper;
using CrazyStudio.Core.Common.Eitities;
+using CrazyStudio.Core.Common.Eitities.Page;
using CrazyStudio.Core.Common.JWT;
using CrazyStudio.Core.Common.Tools;
using Duende.IdentityModel;
@@ -13,7 +14,7 @@ using XPrintServer.Business.Dto;
using XPrintServer.Business.Services;
using XPrintServer.DataModel.Models;
-namespace XPrintServer.Api.Controllers
+namespace XPrintServer.Admin.Api.Controllers
{
[Route("api/[controller]/[action]")]
@@ -190,5 +191,23 @@ namespace XPrintServer.Api.Controllers
{
return true;
}
+
+
+
+ [HttpPost]
+ public async Task>> GetBackstageUserList([FromBody] PageData pageData)
+ {
+ try
+ {
+ var userList = await _backstatgeUserService.GetBackstageUserList(pageData);
+ return Ok(userList);
+ }
+ catch (Exception ex)
+ {
+ await _actionLogService.AddActionLog(new ActionLog { Title = "GetBackstageUserList Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+
}
}
diff --git a/XPrintServer.Admin.Api/Controllers/MenuController.cs b/XPrintServer.Admin.Api/Controllers/MenuController.cs
new file mode 100644
index 0000000..33b0ef9
--- /dev/null
+++ b/XPrintServer.Admin.Api/Controllers/MenuController.cs
@@ -0,0 +1,156 @@
+using CrazyStudio.Core.Common.Eitities.Page;
+using Microsoft.AspNetCore.Mvc;
+using StackExchange.Redis;
+using XPrintServer.Business.Dto;
+using XPrintServer.Business.Services;
+using XPrintServer.DataModel.Models;
+
+namespace XPrintServer.Admin.Api.Controllers
+{
+
+ [Route("api/[controller]/[action]")]
+ [ApiController]
+ public class MenuController : ControllerBase
+ {
+
+ private readonly IHttpContextAccessor _httpContextAccessor;
+ private readonly MenuService _menuService;
+ private readonly UserMenuInRoleService _userMenuInRoleService;
+ private readonly ActionLogService _actionLogService;
+
+ public MenuController(IHttpContextAccessor httpContextAccessor, MenuService menuService, UserMenuInRoleService userMenuInRoleService, ActionLogService actionLogService)
+ {
+ _httpContextAccessor = httpContextAccessor;
+ _menuService = menuService;
+ _userMenuInRoleService = userMenuInRoleService;
+ _actionLogService = actionLogService;
+ }
+
+ [HttpPost]
+ public async Task AddOrUpdateMenu([FromBody] Menu menu)
+ {
+ try
+ {
+ await _menuService.AddOrUpdateMenu(menu);
+ return Ok(menu);
+ }
+ catch (Exception ex)
+ {
+ await _actionLogService.AddActionLog(new ActionLog { Title = "AddOrUpdateMenu Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+
+
+ [HttpPost]
+ public async Task MenuList([FromBody] PageData pageData)
+ {
+ try
+ {
+ var menuList = await _menuService.GetMenuList(pageData, false);
+ return Ok(menuList);
+ }
+ catch (Exception ex)
+ {
+ await _actionLogService.AddActionLog(new ActionLog { Title = "MenuList Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+
+ [HttpPost]
+ public async Task>> AllMenuList()
+ {
+ try
+ {
+ var menuList = await _menuService.GetListAsync().ConfigureAwait(false);
+ List menuTreelist = menuList.ConvertAll(m => new MenuTreeData
+ {
+ Id = m.Id,
+ ComponentPath = m.ComponentPath,
+ MenuName = m.MenuName,
+ RouteName = m.RouteName,
+ ParentId = m.ParentId,
+ IsActive = m.IsActive
+ })!;
+ List removeList = new List();
+ foreach (var menu in menuTreelist)
+ {
+ var parentMenu = menuTreelist.Find(m => m.Id == menu.ParentId);
+ if (parentMenu != null)
+ {
+ parentMenu.Children.Add(menu);
+ removeList.Add(menu);
+ }
+ }
+ foreach (var removeMenu in removeList)
+ {
+ menuTreelist.Remove(removeMenu);
+ }
+
+ return Ok(menuTreelist);
+ }
+ catch (Exception ex)
+ {
+ await _actionLogService.AddActionLog(new ActionLog { Title = "AllMenuList Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+
+ [HttpPost]
+ public async Task ActiveMenuList([FromBody] PageData pageData)
+ {
+ try
+ {
+ var menuList = await _menuService.GetMenuList(pageData, true);
+ return Ok(menuList);
+ }
+ catch (Exception ex)
+ {
+ await _actionLogService.AddActionLog(new ActionLog { Title = "ActiveMenuList Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+
+
+ [HttpPost]
+ public async Task MenuById([FromBody] Guid Id)
+ {
+ try
+ {
+ var menu = await _menuService.GetByIdAsync(Id).ConfigureAwait(false);
+ return Ok(menu);
+ }
+ catch (Exception ex)
+ {
+ await _actionLogService.AddActionLog(new ActionLog { Title = "MenuById Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+
+
+ [HttpPost]
+ public async Task DeleteMenu([FromBody] Guid Id)
+ {
+ try
+ {
+ //ʼ
+ await _menuService.Context.Ado.BeginTranAsync();
+ var isOK = await _menuService.DeleteByIdAsync(Id);
+
+ var deleteDatas = await _userMenuInRoleService.Context.Queryable().Where(um => um.MenuId == Id).SplitTable().ToListAsync().ConfigureAwait(false);
+ await _userMenuInRoleService.Context.Deleteable(deleteDatas).SplitTable().ExecuteCommandAsync().ConfigureAwait(false);
+
+ //ύ
+ await _menuService.Context.Ado.CommitTranAsync();
+ return Ok(isOK);
+ }
+ catch (Exception ex)
+ {
+ //쳣ع
+ await _menuService.Context.Ado.RollbackTranAsync();
+ await _actionLogService.AddActionLog(new ActionLog { Title = "DeleteMenu Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+ }
+}
diff --git a/XPrintServer.Admin.Api/Controllers/RoleController.cs b/XPrintServer.Admin.Api/Controllers/RoleController.cs
new file mode 100644
index 0000000..49e3cde
--- /dev/null
+++ b/XPrintServer.Admin.Api/Controllers/RoleController.cs
@@ -0,0 +1,137 @@
+using CrazyStudio.Core.Common.Eitities.Page;
+using Microsoft.AspNetCore.Mvc;
+using XPrintServer.Business.Dto;
+using XPrintServer.Business.Services;
+using XPrintServer.DataModel.Models;
+
+namespace XPrintServer.Admin.Api.Controllers
+{
+
+ [Route("api/[controller]/[action]")]
+ [ApiController]
+ public class RoleController : ControllerBase
+ {
+
+ private readonly IHttpContextAccessor _httpContextAccessor;
+ private readonly RoleService _roleService;
+ private readonly UserMenuInRoleService _userMenuInRoleService;
+ private readonly ActionLogService _actionLogService;
+
+ public RoleController(IHttpContextAccessor httpContextAccessor, RoleService roleService, UserMenuInRoleService userMenuInRoleService, ActionLogService actionLogService)
+ {
+ _httpContextAccessor = httpContextAccessor;
+ _roleService = roleService;
+ _userMenuInRoleService = userMenuInRoleService;
+ _actionLogService = actionLogService;
+ }
+
+ [HttpPost]
+ public async Task AddOrUpdateRole([FromBody] RoleInfo roleInfo)
+ {
+ try
+ {
+ //ʼ
+ await _roleService.Context.Ado.BeginTranAsync();
+
+ await _roleService.AddOrUpdateRole(roleInfo.Role);
+
+ await _userMenuInRoleService.AddOrUpdateUserMenuInRoles(roleInfo.Role.Id, roleInfo.MenuIds);
+ //ύ
+ await _roleService.Context.Ado.CommitTranAsync();
+ return Ok(roleInfo.Role);
+ }
+ catch (Exception ex)
+ {
+ //쳣ع
+ await _roleService.Context.Ado.RollbackTranAsync();
+
+ await _actionLogService.AddActionLog(new ActionLog { Title = "AddOrUpdateRole Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+
+
+ [HttpPost]
+ public async Task>> RoleList([FromBody] PageData pageData)
+ {
+ try
+ {
+ var roleList = await _roleService.GetRoleList(pageData);
+ return Ok(roleList);
+ }
+ catch (Exception ex)
+ {
+ await _actionLogService.AddActionLog(new ActionLog { Title = "RoleList Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+
+ [HttpPost]
+ public async Task>> AllRoleList()
+ {
+ try
+ {
+ var roleList = await _roleService.AllRoleList();
+ return Ok(roleList);
+ }
+ catch (Exception ex)
+ {
+ await _actionLogService.AddActionLog(new ActionLog { Title = "AllRoleList Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+
+ [HttpPost]
+ public async Task RoleById([FromBody] Guid Id)
+ {
+ try
+ {
+ var role = await _roleService.GetByIdAsync(Id).ConfigureAwait(false);
+ return Ok(role);
+ }
+ catch (Exception ex)
+ {
+ await _actionLogService.AddActionLog(new ActionLog { Title = "RoleById Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+
+ [HttpPost]
+ public async Task>> RoleMenus([FromBody] Guid Id)
+ {
+ try
+ {
+ var roleMenus = await _userMenuInRoleService.SelectRoleUserMenuIdsInRoles(Id).ConfigureAwait(false);
+ return Ok(roleMenus);
+ }
+ catch (Exception ex)
+ {
+ await _actionLogService.AddActionLog(new ActionLog { Title = "RoleMenus Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+
+
+ [HttpPost]
+ public async Task DeleteRole([FromBody] Guid Id)
+ {
+ try
+ {
+ //ʼ
+ await _roleService.Context.Ado.BeginTranAsync();
+ var isOK = await _roleService.DeleteByIdAsync(Id);
+ await _userMenuInRoleService.DeleteRoleUserMenuInRoles(Id);
+ //ύ
+ await _roleService.Context.Ado.CommitTranAsync();
+ return Ok(isOK);
+ }
+ catch (Exception ex)
+ {
+ //쳣ع
+ await _roleService.Context.Ado.RollbackTranAsync();
+ await _actionLogService.AddActionLog(new ActionLog { Title = "DeleteRole Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+ }
+}
diff --git a/XPrintServer.Admin.Api/Controllers/UserController.cs b/XPrintServer.Admin.Api/Controllers/UserController.cs
index dc6bf1c..58fd087 100644
--- a/XPrintServer.Admin.Api/Controllers/UserController.cs
+++ b/XPrintServer.Admin.Api/Controllers/UserController.cs
@@ -8,7 +8,7 @@ using System.Text.Json;
using System.Threading.Tasks;
using File = System.IO.File;
-namespace XPrintServer.Api.Controllers
+namespace XPrintServer.Admin.Api.Controllers
{
[Route("api/[controller]/[action]")]
diff --git a/XPrintServer.Api/Controllers/Common/OrderController.cs b/XPrintServer.Api/Controllers/Common/OrderController.cs
index 031b992..fc30999 100644
--- a/XPrintServer.Api/Controllers/Common/OrderController.cs
+++ b/XPrintServer.Api/Controllers/Common/OrderController.cs
@@ -141,7 +141,7 @@ namespace XPrintServer.Api.Controllers.Common
try
{
//ѯ12µ֧
- var isOK = await _orderService.BatchChangeOrderStatusToProductionFinish(orderIds);
+ var isOK = await _orderService.BatchChangeOrderStatusToProductionStatus(orderIds, OrderStatus.ProductionFinish);
return Ok(isOK);
}
catch (Exception ex)
diff --git a/XPrintServer.Api/Controllers/Common/OrderInfoController.cs b/XPrintServer.Api/Controllers/Common/OrderInfoController.cs
index 4918bd4..5566518 100644
--- a/XPrintServer.Api/Controllers/Common/OrderInfoController.cs
+++ b/XPrintServer.Api/Controllers/Common/OrderInfoController.cs
@@ -38,9 +38,15 @@ namespace XPrintServer.Api.Controllers.Common
{
try
{
- var now = DateTime.Now;
- //ѯ12µ֧
- var infoResult = await _orderInfoService.GetOrderInfoListForTime(pageData, now.AddMonths(-12), now);
+ //var now = DateTime.Now;
+ //if (pageData.StartTime == null)
+ //{
+ // pageData.StartTime = now.AddDays(-7);
+ // pageData.EndTime = now;
+ //}
+
+ //ѯһڵ֧
+ var infoResult = await _orderInfoService.GetOrderInfoListForTime(pageData, pageData.StartTime, pageData.EndTime);
return Ok(infoResult);
}
catch (Exception ex)
@@ -64,8 +70,36 @@ namespace XPrintServer.Api.Controllers.Common
//ʼ
await _orderService.Context.Ado.BeginTranAsync();
//ѯ12µ֧
- var finishOrderIds = await _orderInfoService.BatchChangeOrderInfoStatusToProductionFinish(orderInfoIds);
- bool isOK = await _orderService.BatchChangeOrderStatusToProductionFinish(finishOrderIds);
+ var finishOrderIds = await _orderInfoService.BatchChangeOrderInfoStatusToProductionFinish(orderInfoIds, ResourceStatus.ProductionFinish);
+ bool isOK = await _orderService.BatchChangeOrderStatusToProductionStatus(finishOrderIds, OrderStatus.ProductionFinish);
+
+ //ύ
+ await _orderService.Context.Ado.CommitTranAsync();
+ return Ok(isOK);
+ }
+ catch (Exception ex)
+ {
+ await _orderService.Context.Ado.RollbackTranAsync();
+ await _actionLogService.AddActionLog(new ActionLog { Title = "ProductionBatchFinish Error", Content = ex.Message + " " + ex.StackTrace, DateTime = DateTime.Now });
+ return StatusCode(500, ex.Message);
+ }
+ }
+
+ ///
+ /// Դ״̬Ϊ
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task> ProductionBatchDelete([FromBody] HashSet orderInfoIds)
+ {
+ try
+ {
+ //ʼ
+ await _orderService.Context.Ado.BeginTranAsync();
+ //ѯ֧
+ var finishOrderIds = await _orderInfoService.BatchChangeOrderInfoStatusToProductionFinish(orderInfoIds, ResourceStatus.Delete);
+ bool isOK = await _orderService.BatchChangeOrderStatusToProductionStatus(finishOrderIds, OrderStatus.ProductionFinish);
//ύ
await _orderService.Context.Ado.CommitTranAsync();
diff --git a/XPrintServer.Api/Controllers/WeatherForecastController.cs b/XPrintServer.Api/Controllers/WeatherForecastController.cs
index 1f3e753..894526f 100644
--- a/XPrintServer.Api/Controllers/WeatherForecastController.cs
+++ b/XPrintServer.Api/Controllers/WeatherForecastController.cs
@@ -39,7 +39,7 @@ namespace XPrintServer.Api.Controllers
public void TestImage()
{
//SvgTool.ImageToSvg();
- //CmykImageTool.SplitColor(@"D:\ն.png", @"D:\նOutput.tif");
+ ChannelImageTool.SplitColor(@"D:\.tif", @"D:\111.tif");
}
}
}
diff --git a/XPrintServer.Api/XPrintServer.Api.csproj b/XPrintServer.Api/XPrintServer.Api.csproj
index 5369064..9201381 100644
--- a/XPrintServer.Api/XPrintServer.Api.csproj
+++ b/XPrintServer.Api/XPrintServer.Api.csproj
@@ -25,6 +25,9 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
diff --git a/XPrintServer.Api/assets/8bim_white_channel b/XPrintServer.Api/assets/8bim_white_channel
new file mode 100644
index 0000000..c44c5d3
Binary files /dev/null and b/XPrintServer.Api/assets/8bim_white_channel differ
diff --git a/XPrintServer.Business/Dto/MenuTreeData.cs b/XPrintServer.Business/Dto/MenuTreeData.cs
new file mode 100644
index 0000000..101be52
--- /dev/null
+++ b/XPrintServer.Business/Dto/MenuTreeData.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XPrintServer.DataModel.Models;
+
+namespace XPrintServer.Business.Dto
+{
+ public class MenuTreeData : Menu
+ {
+ public List Children { get; set; } = new List();
+ }
+}
diff --git a/XPrintServer.Business/Dto/RoleInfo.cs b/XPrintServer.Business/Dto/RoleInfo.cs
new file mode 100644
index 0000000..e563677
--- /dev/null
+++ b/XPrintServer.Business/Dto/RoleInfo.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XPrintServer.DataModel.Models;
+
+namespace XPrintServer.Business.Dto
+{
+ public class RoleInfo
+ {
+ public Role Role { get; set; } = null!;
+
+ public List MenuIds { get; set; } = new List();
+ }
+}
diff --git a/XPrintServer.Business/Enums/PageOrderStatusData.cs b/XPrintServer.Business/Enums/PageOrderStatusData.cs
index 56f25f5..75720b4 100644
--- a/XPrintServer.Business/Enums/PageOrderStatusData.cs
+++ b/XPrintServer.Business/Enums/PageOrderStatusData.cs
@@ -13,5 +13,9 @@ namespace XPrintServer.Business.Enums
/// 订单状态
///
public OrderStatus Status { get; set; } = OrderStatus.None;
+
+ public DateTime? StartTime { get; set; } = null;
+
+ public DateTime? EndTime { get; set; } = null;
}
}
diff --git a/XPrintServer.Business/Services/BackstatgeUserService.cs b/XPrintServer.Business/Services/BackstatgeUserService.cs
index a3d81eb..690ab46 100644
--- a/XPrintServer.Business/Services/BackstatgeUserService.cs
+++ b/XPrintServer.Business/Services/BackstatgeUserService.cs
@@ -1,4 +1,5 @@
-using SqlSugar;
+using CrazyStudio.Core.Common.Eitities.Page;
+using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -45,5 +46,18 @@ namespace XPrintServer.Business.Services
}
return dbUser;
}
+
+ public async Task> GetBackstageUserList(PageData pageData)
+ {
+ var userList = await Context.Queryable().WhereIF(!string.IsNullOrEmpty(pageData.SearchText), bu => bu.UserName.Contains(pageData.SearchText)
+ || bu.NickName == null ? false : bu.NickName.Contains(pageData.SearchText)).SplitTable()
+ .ToPageListAsync(pageData.Page, pageData.PageSize).ConfigureAwait(false);
+ return new PageResult
+ {
+ Data = userList,
+ PageSize = pageData.PageSize,
+ Total = await Context.Queryable().SplitTable().CountAsync().ConfigureAwait(false)
+ };
+ }
}
}
diff --git a/XPrintServer.Business/Services/MenuService.cs b/XPrintServer.Business/Services/MenuService.cs
new file mode 100644
index 0000000..2390057
--- /dev/null
+++ b/XPrintServer.Business/Services/MenuService.cs
@@ -0,0 +1,56 @@
+using CrazyStudio.Core.Common.Eitities.Page;
+using CrazyStudio.Core.Common.Tools.Extensions;
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XPrintServer.Business.Services.Interface;
+using XPrintServer.DataModel;
+using XPrintServer.DataModel.Models;
+
+namespace XPrintServer.Business.Services
+{
+ public class MenuService : SqlSugarRepository