| | |
| | | using HslCommunication.WebSocket; |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using Magicodes.ExporterAndImporter.Excel; |
| | | using MathNet.Numerics.Statistics.Mcmc; |
| | | using NPOI.SS.UserModel; |
| | | using NPOI.Util.Collections; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using NPOI.XSSF.UserModel; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Enums; |
| | | using System.Reflection; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.WareHouseEnum; |
| | | using WIDESEAWCS_Common.Helper; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Core.Utilities; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_IBasicInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | |
| | | |
| | | public DateTime DateTime { get; set; } |
| | | } |
| | | public partial class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService |
| | | public class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService |
| | | { |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | public ILocationInfoRepository Repository => BaseDal; |
| | |
| | | |
| | | Dictionary<string, OrderByType> orderBy = new Dictionary<string, OrderByType>() |
| | | { |
| | | { nameof(Dt_LocationInfo.Row),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Layer),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Row),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Columns),OrderByType.Desc }, |
| | | }; |
| | | |
| | | Dt_LocationInfo locationInfo = BaseDal.QueryFirst(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.Disable.ObjToInt() && !lockLocations.Contains(x.LocationCode), orderBy);//æ¥è¯¢ç©ºè´§ä½ä¿¡æ¯å¹¶æé¤5åéå
åé
çè´§ä½,æ ¹æ®å±ãåãæ·±åº¦ãè¡æåº |
| | | //Dt_LocationInfo locationInfo = BaseDal.QueryFirst(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.Disable.ObjToInt() && !lockLocations.Contains(x.LocationCode), orderBy);//æ¥è¯¢ç©ºè´§ä½ä¿¡æ¯å¹¶æé¤5åéå
åé
çè´§ä½,æ ¹æ®å±ãåãæ·±åº¦ãè¡æåº |
| | | // åå¹¶æ¥è¯¢æ¡ä»¶ï¼ä¼å
44~48åï¼è¥æ 忥å
¨é¨ |
| | | Dt_LocationInfo locationInfo = BaseDal.QueryFirst( |
| | | x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() |
| | | && x.EnableStatus != EnableStatusEnum.Disable.ObjToInt() |
| | | && !lockLocations.Contains(x.LocationCode) |
| | | && (x.Columns >= 44 && x.Columns <= 48), // ä¼å
44~48åçæ¡ä»¶ |
| | | orderBy) |
| | | ?? |
| | | BaseDal.QueryFirst( |
| | | x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() |
| | | && x.EnableStatus != EnableStatusEnum.Disable.ObjToInt() |
| | | && !lockLocations.Contains(x.LocationCode), |
| | | orderBy); |
| | | |
| | | if (locationInfo!=null) |
| | | { |
| | | LocationCache locationCache = new LocationCache() |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string savePath = AppDomain.CurrentDomain.BaseDirectory + $"ExcelExport"; |
| | | IExporter exporter = new ExcelExporter(); |
| | | options.Page = 1; |
| | | options.Rows = 30; |
| | | options.Order = "asc"; |
| | | options.Sort = "id"; |
| | | string savePath = AppDomain.CurrentDomain.BaseDirectory + "ExcelExport"; |
| | | |
| | | string where = string.Empty; |
| | | ISugarQueryable<Dt_LocationInfo> sugarQueryable = BaseDal.Db.Queryable<Dt_LocationInfo>(); |
| | | if (!string.IsNullOrEmpty(options.Wheres)) |
| | | { |
| | | try |
| | | { |
| | | List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | if (searchParametersList?.Any() == true) |
| | | { |
| | | foreach (var param in searchParametersList) |
| | | { |
| | | switch (param.Name) |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | } |
| | | // ç¡®ä¿ç®å½åå¨ |
| | | if (!Directory.Exists(savePath)) |
| | | Directory.CreateDirectory(savePath); |
| | | |
| | | |
| | | // è·åæ°æ® |
| | | ISugarQueryable<Dt_LocationInfo> query = BaseDal.Db.Queryable<Dt_LocationInfo>(); |
| | | var dataList = query.ToList(); |
| | | var properties = typeof(Dt_LocationInfo).GetProperties(); |
| | | |
| | | byte[] data = exporter.ExportAsByteArray(sugarQueryable.ToList()).Result; |
| | | |
| | | string fileName = "åºä½ä¿¡æ¯.xlsx"; |
| | | |
| | | FileHelper.WriteFile(savePath, fileName, data); |
| | | |
| | | content = WebResponseContent.Instance.OK(data: savePath + "\\" + fileName); |
| | | string filePath = TExportHelper.GetExport(savePath, properties, dataList); |
| | | return WebResponseContent.Instance.OK(data: filePath); |
| | | } |
| | | catch (Exception ex) |
| | | { |