更新超时信息相关功能及配置文件
在 `appsettings.json` 中更新连接字符串,移除旧配置并优化格式。 修改 `Dt_OutTime.vue` 中的表格 URL。
新增 `IStockInfoTimeoutRepository` 和 `IStockInfoTimeoutService` 接口定义。
实现超时信息存储和服务的类,增强数据处理能力。
添加 `StockInfoTimeoutController` 控制器以处理相关 API 请求。
已修改3个文件
已添加5个文件
131 ■■■■■ 文件已修改
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_OutTime.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoTimeoutRepository.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoTimeoutService.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoTimeoutRepository.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoTimeoutService.cs 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/StockInfoTimeoutController.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -11,8 +11,8 @@
  "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", //策略名称
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_OutTime.vue
@@ -21,7 +21,7 @@
            footer: "Foots",
            cnName: '超时信息',
            name: 'stock/Dt_BillGroupStock',
            url: "/Task/GetTimeout",
            url:"/StockInfoTimeout/",
            sortName: "createDate"
        });
        const editFormFields = ref({
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoTimeoutRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
namespace WIDESEA_IStorageBasicRepository
{
    public interface IStockInfoTimeoutRepository : IRepository<DtStockInfo>
    {
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoTimeoutService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
namespace WIDESEA_IStorageBasicService;
public interface IStockInfoTimeoutService : IService<DtStockInfo>
{
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoTimeoutRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
namespace WIDESEA_StorageBasicRepository
{
    public class StockInfoTimeoutRepository : RepositoryBase<DtStockInfo>, IStockInfoTimeoutRepository
    {
        public StockInfoTimeoutRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoTimeoutService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,88 @@
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);
        }
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/StockInfoTimeoutController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
using WIDESEA_IStorageBasicService;
namespace WIDESEA_WMSServer.Controllers;
[Route("api/StockInfoTimeout")]
[ApiController]
public class StockInfoTimeoutController : ApiBaseController<IStockInfoTimeoutService, DtStockInfo>
{
    public StockInfoTimeoutController(IStockInfoTimeoutService service) : base(service)
    {
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
@@ -11,11 +11,11 @@
    //连接字符串
    //"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=.;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=123456;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", //策略名称