更新超时信息相关功能及配置文件
在 `appsettings.json` 中更新连接字符串,移除旧配置并优化格式。 修改 `Dt_OutTime.vue` 中的表格 URL。
新增 `IStockInfoTimeoutRepository` 和 `IStockInfoTimeoutService` 接口定义。
实现超时信息存储和服务的类,增强数据处理能力。
添加 `StockInfoTimeoutController` 控制器以处理相关 API 请求。
| | |
| | | "ConnectionStringsEncryption": false, |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //è¿æ¥å符串 |
| | | "ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=WIDESEA_WCSDBB2F;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WCSDB_BB3F;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=WIDESEA_WCSDBB2F;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WCSDB_BB3F;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | | "PolicyName": "CorsIpAccess", //çç¥åç§° |
| | |
| | | footer: "Foots", |
| | | cnName: 'è¶
æ¶ä¿¡æ¯', |
| | | name: 'stock/Dt_BillGroupStock', |
| | | url: "/Task/GetTimeout", |
| | | url:"/StockInfoTimeout/", |
| | | sortName: "createDate" |
| | | }); |
| | | const editFormFields = ref({ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace WIDESEA_IStorageBasicRepository |
| | | { |
| | | public interface IStockInfoTimeoutRepository : IRepository<DtStockInfo> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace WIDESEA_IStorageBasicService; |
| | | |
| | | public interface IStockInfoTimeoutService : IService<DtStockInfo> |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace WIDESEA_StorageBasicRepository |
| | | { |
| | | public class StockInfoTimeoutRepository : RepositoryBase<DtStockInfo>, IStockInfoTimeoutRepository |
| | | { |
| | | public StockInfoTimeoutRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Cache; |
| | | |
| | | namespace WIDESEA_StorageBasicServices.Stock |
| | | { |
| | | public class StockInfoTimeoutService : ServiceBase<DtStockInfo, IStockInfoRepository>, IStockInfoTimeoutService |
| | | { |
| | | |
| | | private readonly ISimpleCacheService _simpleCacheService; |
| | | private readonly ILocationStatusChangeRecordRepository _locationStatusChangeRecordRepository; |
| | | public StockInfoTimeoutService(IStockInfoRepository BaseDal, ISimpleCacheService simpleCacheService, ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository) : base(BaseDal) |
| | | { |
| | | _simpleCacheService = simpleCacheService; |
| | | _locationStatusChangeRecordRepository = locationStatusChangeRecordRepository; |
| | | } |
| | | |
| | | public override PageGridData<DtStockInfo> GetPageData(PageDataOptions options) |
| | | { |
| | | string wheres = ValidatePageOptions(options); |
| | | //è·åæåºå段 |
| | | Dictionary<string, SqlSugar.OrderByType> orderbyDic = GetPageDataSort(options, TProperties); |
| | | List<OrderByModel> orderByModels = new List<OrderByModel>(); |
| | | foreach (var item in orderbyDic) |
| | | { |
| | | OrderByModel orderByModel = new() |
| | | { |
| | | FieldName = item.Key, |
| | | OrderByType = item.Value |
| | | }; |
| | | orderByModels.Add(orderByModel); |
| | | } |
| | | |
| | | |
| | | int totalCount = 0; |
| | | List<SearchParameters> searchParametersList = new List<SearchParameters>(); |
| | | if (!string.IsNullOrEmpty(options.Wheres)) |
| | | { |
| | | try |
| | | { |
| | | searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | options.Filter = searchParametersList; |
| | | } |
| | | catch { } |
| | | } |
| | | |
| | | Expression<Func<DtStockInfo, bool>> locationStatus = null; |
| | | Expression<Func<DtStockInfo, bool>> roadwayNo = null; |
| | | Expression<Func<DtStockInfo, bool>> materielCode = null; |
| | | foreach (var item in searchParametersList) |
| | | { |
| | | if (item.Name.Contains("locationStatus")) |
| | | { |
| | | locationStatus = x => x.LocationInfo.LocationStatus == Convert.ToInt32(item.Value); |
| | | } |
| | | else if (item.Name.Contains("roadwayNo")) |
| | | { |
| | | roadwayNo = x => x.LocationInfo.RoadwayNo.Contains(item.Value); |
| | | } |
| | | else if (item.Name.Contains("materielCode")) |
| | | { |
| | | materielCode = x => x.StockInfoDetails.Any(d => d.MaterielCode.Contains(item.Value)); |
| | | } |
| | | } |
| | | |
| | | var now = DateTime.Now; |
| | | // 使ç¨Subtractæ¹æ³ |
| | | var threeHoursAgo = now.Subtract(TimeSpan.FromHours(3)); |
| | | |
| | | var data = BaseDal.Db.Queryable<DtStockInfo>() |
| | | .Includes(x => x.StockInfoDetails) |
| | | .Includes(x => x.LocationInfo) |
| | | .Where(x => x.OutboundTime < threeHoursAgo) |
| | | .WhereIF(!wheres.IsNullOrEmpty(), wheres) |
| | | .WhereIF(locationStatus != null, locationStatus) |
| | | .WhereIF(roadwayNo != null, roadwayNo) |
| | | .WhereIF(materielCode != null, materielCode) |
| | | .OrderBy(orderByModels) |
| | | .ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<DtStockInfo>(totalCount, data); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using WIDESEA_IStorageBasicService; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers; |
| | | |
| | | [Route("api/StockInfoTimeout")] |
| | | [ApiController] |
| | | public class StockInfoTimeoutController : ApiBaseController<IStockInfoTimeoutService, DtStockInfo> |
| | | { |
| | | public StockInfoTimeoutController(IStockInfoTimeoutService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | "Logging": { |
| | | "LogLevel": { |
| | | "Default": "Information", |
| | | "Microsoft.AspNetCore": "Warning" |
| | | } |
| | | }, |
| | | "AllowedHosts": "*", |
| | | "urls": "http://*:5000", |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | //"ConnectionString": "Data Source=192.168.15.253;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=192.168.20.251;Initial Catalog=WIDESEA_WMSDB;User ID=sa;Password=123456@gy;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionStringWCS": "Data Source=192.168.15.253;Initial Catalog=WIDESEA_WCSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionStringWCS": "Data Source=.;Initial Catalog=WIDESEA_WCSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | | "PolicyName": "CorsIpAccess", //çç¥åç§° |
| | | "EnableAllIPs": true, //å½ä¸ºtrueæ¶ï¼å¼æ¾ææIPåå¯è®¿é®ã |
| | | // æ¯æå¤ä¸ªåå端å£ï¼æ³¨æç«¯å£å·åä¸è¦å¸¦/ææï¼æ¯å¦localhost:8000/ï¼æ¯éç |
| | | // 注æï¼http://127.0.0.1:1818 å http://localhost:1818 æ¯ä¸ä¸æ ·ç |
| | | "IPs": "http://127.0.0.1:8080,http://localhost:8080,http://127.0.0.1:8081,http://localhost:8081" |
| | | }, |
| | | "ApiName": "WIDESEA", |
| | | "ExpMinutes": 120, |
| | | "Logging": { |
| | | "LogLevel": { |
| | | "Default": "Information", |
| | | "Microsoft.AspNetCore": "Warning" |
| | | } |
| | | }, |
| | | "AllowedHosts": "*", |
| | | "urls": "http://*:5000", |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | //"ConnectionString": "Data Source=192.168.15.253;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=192.168.20.251;Initial Catalog=WIDESEA_WMSDB;User ID=sa;Password=123456@gy;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionStringWCS": "Data Source=192.168.15.253;Initial Catalog=WIDESEA_WCSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionStringWCS": "Data Source=.;Initial Catalog=WIDESEA_WCSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | | "PolicyName": "CorsIpAccess", //çç¥åç§° |
| | | "EnableAllIPs": true, //å½ä¸ºtrueæ¶ï¼å¼æ¾ææIPåå¯è®¿é®ã |
| | | // æ¯æå¤ä¸ªåå端å£ï¼æ³¨æç«¯å£å·åä¸è¦å¸¦/ææï¼æ¯å¦localhost:8000/ï¼æ¯éç |
| | | // 注æï¼http://127.0.0.1:1818 å http://localhost:1818 æ¯ä¸ä¸æ ·ç |
| | | "IPs": "http://127.0.0.1:8080,http://localhost:8080,http://127.0.0.1:8081,http://localhost:8081" |
| | | }, |
| | | "ApiName": "WIDESEA", |
| | | "ExpMinutes": 120, |
| | | |
| | | // éè¦ç§»åºçè¡ |
| | | "TransfertRows": "1,4,5,8", |
| | | "CacheSettings": { |
| | | "UseRedis": false, |
| | | "RedisSettings": { |
| | | "Address": "127.0.0.1:6379", |
| | | "Password": "123456", |
| | | "Db": 9, |
| | | "ClearRedis": true |
| | | } |
| | | }, |
| | | // å
许åºåºçç¼ç |
| | | "OutBoundMateriel": [ |
| | | //{ |
| | | // "MaterielCode": "CC01050001348", |
| | | // "ProductionLine": "ZJ-8", |
| | | // "ProcessCode": "CH001" |
| | | //} |
| | | ] |
| | | // éè¦ç§»åºçè¡ |
| | | "TransfertRows": "1,4,5,8", |
| | | "CacheSettings": { |
| | | "UseRedis": false, |
| | | "RedisSettings": { |
| | | "Address": "127.0.0.1:6379", |
| | | "Password": "123456", |
| | | "Db": 9, |
| | | "ClearRedis": true |
| | | } |
| | | }, |
| | | // å
许åºåºçç¼ç |
| | | "OutBoundMateriel": [ |
| | | //{ |
| | | // "MaterielCode": "CC01050001348", |
| | | // "ProductionLine": "ZJ-8", |
| | | // "ProcessCode": "CH001" |
| | | //} |
| | | ] |
| | | } |