pan
2025-12-02 d89c4f466c0922287ff88d4f61bfba71461cdbf0
Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu
已修改10个文件
285 ■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/DB/BaseDBConfig.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/Extensions/SqlsugarSetup.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBContext.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue
@@ -54,14 +54,6 @@
    const editFormOptions = ref([
      [
        {
          title: "单据类型",
          required: true,
          field: "orderType",
          type: "select",
          dataKey: "outOrderType",
          data: [],
        },
        {
        field: "orderNo",
        title: "单据编号",
        type: "string",
@@ -81,17 +73,37 @@
          readonly: true,
        },
        {
          title: "仓库",
          field: "warehouseId",
          type: "select",
          dataKey: "warehouses",
          data: [],
          required: true,
          title: "厂区",
          field: "factoryArea",
          type: "string",
        },
      ],
      [
        {
          title: "备注",
          field: "remark",
          type: "textarea",
        },
        {
          title: "业务类型",
          field: "businessType",
          type: "select",
          dataKey: "businessType",
          data: [],
          require: true,
        },
        {
          title: "是否分批",
          field: "isBatch",
          type: "select",
          dataKey: "enable",
          data: [],
          require: true,
        },
        {
          title: "操作者",
          field: "operator",
          type: "string",
        },
      ],
    ]);
@@ -153,7 +165,7 @@
        type: "string",
        width: 160,
        align: "left",
        // link: true,
        link: true,
      },
      {
        field: "upperOrderNo",
@@ -255,7 +267,7 @@
    ]);
    const detail = ref({
      cnName: "出库明细单",
      table: "OnboundOrderDetail",
      table: "Details",
      columns: [
        {
          field: "id",
@@ -320,13 +332,20 @@
          required: true,
        },
        {
          field: "rowNo",
          field: "lineNo",
          title: "行号",
          type: "string",
          width: 90,
          align: "left",
          edit: { type: "number" },
          required: true,
        },
        {
          field: "rowNo",
          title: "行号2",
          type: "int",
          width: 90,
          align: "left",
          edit: { type: "number" },
        },
        {
          field: "lockQuantity",
@@ -348,7 +367,9 @@
          type: "string",
          width: 180,
          align: "left",
          edit: { type: "select" },
          bind: { key: "orderDetailStatusEnum", data: [] },
          required: true,
        },
        {
          field: "creater",
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs
@@ -5,7 +5,9 @@
using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.AllocateEnum;
@@ -16,6 +18,7 @@
using WIDESEA_Core.CodeConfigEnum;
using WIDESEA_Core.DB;
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_Core.Seed;
using WIDESEA_IAllocateService;
using WIDESEA_IInboundService;
@@ -34,6 +37,8 @@
        public readonly IRepository<Dt_AllocateOrder> _allocateOrderRepository;
        public readonly IRepository<Dt_AllocateOrderDetail> _allocateOrderDetailRepository;
        public readonly IRepository<Dt_InboundOrderDetail> _inboundOrderDetailRepository;
        private readonly ILogger<AllocateService> _logger;
        public AllocateService(IRepository<Dt_AllocateOrder> BaseDal,
            IUnitOfWorkManage unitOfWorkManage,
@@ -41,6 +46,7 @@
            IOutboundService outboundService,
            IRepository<Dt_AllocateOrder> allocateOrderRepository,
            IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository,
            IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository,
            ILogger<AllocateService> logger) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
@@ -49,6 +55,7 @@
            _allocateOrderRepository = allocateOrderRepository;
            _allocateOrderDetailRepository = allocateOrderDetailRepository;
            _logger = logger;
            _inboundOrderDetailRepository = inboundOrderDetailRepository;
        }
        public IRepository<Dt_AllocateOrder> Repository => BaseDal;
@@ -99,7 +106,7 @@
            {
                if (businessType == BusinessTypeEnum.外部仓库调智仓)
                {
                    allocateOrder.OrderType = InOrderTypeEnum.AllocatInbound.ObjToInt();
                    allocateOrder.OrderType = (int)InOrderTypeEnum.AllocatInbound;
                    var inboundOrders = ConvertToInboundOrders(allocateOrder);
                    await _inboundService.InbounOrderService.ReceiveInboundOrder(inboundOrders, 1);
                }
@@ -107,11 +114,11 @@
                {
                    if (businessType == BusinessTypeEnum.智仓调外部仓库)
                    {
                        allocateOrder.OrderType = InOrderTypeEnum.AllocatOutbound.ObjToInt();
                        allocateOrder.OrderType = (int)InOrderTypeEnum.AllocatOutbound;
                    }
                    else if (businessType == BusinessTypeEnum.智仓调智仓)
                    {
                        allocateOrder.OrderType = InOrderTypeEnum.InternalAllocat.ObjToInt();
                        allocateOrder.OrderType = (int)InOrderTypeEnum.InternalAllocat;
                    }
                    var outboundOrders = ConvertToOutboundOrders(allocateOrder);
@@ -431,5 +438,66 @@
                return code;
            }
        }
        public override PageGridData<Dt_InboundOrderDetail> GetDetailPage(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 { }
            }
            //var data = BaseDal.Db.Queryable<Dt_AllocateOrderDetail>()
            //    .WhereIF(!wheres.IsNullOrEmpty(), wheres)
            //    .OrderBy(orderByModels)
            //    .ToPageList(options.Page, options.Rows, ref totalCount);
            //Dt_AllocateOrder allocateOrder = _allocateOrderRepository.QueryFirst(x => x.Id == (int)options.Value);
            //Dt_InboundOrder _InboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_InboundOrder>().Where(x => x.UpperOrderNo == allocateOrder.UpperOrderNo).First();
            //var details = _inboundOrderDetailRepository.QueryData(x => x.OrderId == _InboundOrder.Id );
            //foreach (var item in data)
            //{
            //    var detail = details.Where(x => x.MaterielCode == item.MaterielCode).FirstOrDefault();
            //    if (detail != null)
            //    {
            //        item.OrderQuantity = detail.OrderQuantity;
            //        item.ReceiptQuantity = detail.ReceiptQuantity;
            //        item.OverInQuantity = detail.OverInQuantity;
            //        item.OrderDetailStatus = detail.OrderDetailStatus;
            //    }
            //}
            //return new PageGridData<Dt_AllocateOrderDetail>(totalCount, data);
            Dt_AllocateOrder allocateOrder = _allocateOrderRepository.QueryFirst(x => x.Id == (int)options.Value);
            Dt_InboundOrder _InboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_InboundOrder>().Where(x => x.UpperOrderNo == allocateOrder.UpperOrderNo).First();
            var data = BaseDal.Db.Queryable<Dt_InboundOrderDetail>()
                .WhereIF(!wheres.IsNullOrEmpty(), wheres)
                .WhereIF(!_InboundOrder.IsNullOrEmpty(), x => x.OrderId == _InboundOrder.Id)
                .OrderBy(orderByModels)
                .ToPageList(options.Page, options.Rows, ref totalCount);
            return new PageGridData<Dt_InboundOrderDetail>(totalCount, data);
        }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs
@@ -150,6 +150,100 @@
            }
        }
        protected string ValidatePageOptions(PageDataOptions options)
        {
            options = options ?? new PageDataOptions();
            string where = "";
            List<SearchParameters> searchParametersList = new List<SearchParameters>();
            if (options.Filter != null && options.Filter.Count > 0)
            {
                searchParametersList.AddRange(options.Filter);
            }
            else if (!string.IsNullOrEmpty(options.Wheres))
            {
                try
                {
                    searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
                    options.Filter = searchParametersList;
                }
                catch { }
            }
            QueryRelativeList?.Invoke(searchParametersList);
            for (int i = 0; i < searchParametersList.Count; i++)
            {
                if (string.IsNullOrEmpty(searchParametersList[i].Value))
                {
                    continue;
                }
                PropertyInfo property = TProperties.Where(c => c.Name.ToUpper() == searchParametersList[i].Name.ToUpper()).FirstOrDefault();
                if (property == null) continue;
                (bool, string, object) result = property.ValidationVal(searchParametersList[i].Value);
                if (!result.Item1)
                {
                    continue;
                }
                LinqExpressionType expressionType = searchParametersList[i].DisplayType.GetLinqCondition();
                if (expressionType == LinqExpressionType.Equal)
                {
                    if (string.IsNullOrEmpty(where))
                    {
                        // é’ˆå¯¹å­—符串类型的字段使用模糊查询
                        //where += $"{searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'";
                        if (searchParametersList[i].Value.ToLower() == "true" || searchParametersList[i].Value.ToLower() == "false")
                        {
                            where += $" {searchParametersList[i].Name} = '{searchParametersList[i].Value.ToLower()}'";
                        }
                        else
                        {
                            where += $"[{searchParametersList[i].Name}] like '%{searchParametersList[i].Value}%'";
                        }
                    }
                    else
                    {
                        // é’ˆå¯¹å¸ƒå°”类型字段进行精确查询
                        if (searchParametersList[i].Value.ToLower() == "true" || searchParametersList[i].Value.ToLower() == "false")
                        {
                            where += $" and {searchParametersList[i].Name} = '{searchParametersList[i].Value.ToLower()}'";
                        }
                        else
                        {
                            where += $" and [{searchParametersList[i].Name}] like '%{searchParametersList[i].Value}%'";
                        }
                    }
                }
                else
                {
                    if (searchParametersList[i].DisplayType.GetLinqCondition() == LinqExpressionType.ThanOrEqual)
                    {
                        if (string.IsNullOrEmpty(where))
                            where += $"{searchParametersList[i].Name} >= '{searchParametersList[i].Value}'";
                        else
                            where += $" and {searchParametersList[i].Name} {searchParametersList[i].DisplayType.GetLinqCondition()} '{searchParametersList[i].Value}'";
                    }
                    else if (searchParametersList[i].DisplayType.GetLinqCondition() == LinqExpressionType.LessThanOrEqual)
                    {
                        if (string.IsNullOrEmpty(where))
                            where += $"{searchParametersList[i].Name} <= '{searchParametersList[i].Value}'";
                        else
                            where += $" and {searchParametersList[i].Name} <= '{searchParametersList[i].Value}'";
                    }
                    else
                    {
                        if (string.IsNullOrEmpty(where))
                            where += $"{searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{searchParametersList[i].Value}'";
                        else
                            where += $" and {searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{searchParametersList[i].Value}'";
                    }
                }
            }
            return where;
        }
        protected Expression<Func<TEntity, bool>> GetWhereExpression(string propertyName, object propertyValue, ParameterExpression parameter, LinqExpressionType expressionType)
        {
            Type? proType = typeof(TEntity).GetProperty(propertyName)?.PropertyType;
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Core/DB/BaseDBConfig.cs
@@ -7,6 +7,7 @@
using System.Threading.Tasks;
using WIDESEA_Core.Const;
using WIDESEA_Core.Helper;
using WIDESEA_Core.Seed;
using WIDESEA_Core.Tenants;
namespace WIDESEA_Core.DB
@@ -60,7 +61,7 @@
            {
                Connection = AppSettings.Get(MainDb.ConnectionString).DecryptDES(AppSecret.DB),
                ConnId = MainDb.CurrentDbConnId,
                DbType = DataBaseType.SqlServer
                DbType = DBContext.DbType,
            };
            listdatabaseSlaveDB.Add(mainDb);
            for (int i = 0; i < list.Count; i++)
@@ -70,7 +71,7 @@
                {
                    Connection = data.ConnectionString,
                    ConnId = data.TenantId + "",
                    DbType = (DataBaseType)data.DbType,
                    DbType = data.DbType,
                };
                mutiDBOperate.Connection = mutiDBOperate.Connection.DecryptDES(AppSecret.DB);
                listdatabaseSlaveDB.Add(mutiDBOperate);
@@ -116,6 +117,6 @@
        /// <summary>
        /// æ•°æ®åº“类型
        /// </summary>
        public DataBaseType DbType { get; set; }
        public DbType DbType { get; set; }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Core/Extensions/SqlsugarSetup.cs
@@ -35,7 +35,6 @@
            {
                var memoryCache = o.GetRequiredService<IMemoryCache>();
                // è¿žæŽ¥å­—符串
                var listConfig = new List<ConnectionConfig>
                {
                    new ConnectionConfig
@@ -43,7 +42,9 @@
                        ConfigId = MainDb.CurrentDbConnId,
                        ConnectionString = DBContext.GetMainConnectionDb().Connection,
                        IsAutoCloseConnection = true,
                        DbType = MainDb.DbType,
                        //DbType = MainDb.DbType,
                        DbType = DBContext.GetMainConnectionDb().DbType,
                        AopEvents = new AopEvents
                        {
                            OnLogExecuting = (sql, p) =>
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBContext.cs
@@ -1,4 +1,5 @@
using SqlSugar;
using Microsoft.Extensions.Logging;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -23,15 +24,32 @@
        /// </summary>
        public static MutiDBOperate GetMainConnectionDb()
        {
            string dbType = AppSettings.GetValue("DBType");
            if(Enum.TryParse(typeof(DbType),dbType,out object? result) && result != null)
            {
                DbType dataBaseType = (DbType)result;
            MutiDBOperate mainDb = new MutiDBOperate()
            {
                Connection = AppSettings.Get(MainDb.ConnectionString).DecryptDES(AppSecret.DB),
                ConnId = MainDb.CurrentDbConnId,
                DbType = DataBaseType.SqlServer
                    DbType = dataBaseType
            };
            return mainDb;
        }
            else
            {
                throw new Exception("数据库连接配置错误");
            }
            //MutiDBOperate mainDb = new MutiDBOperate()
            //{
            //    Connection = AppSettings.Get(MainDb.ConnectionString).DecryptDES(AppSecret.DB),
            //    ConnId = MainDb.CurrentDbConnId,
            //    DbType = DataBaseType.SqlServer
            //};
            //return mainDb;
        }
        /// <summary>
        /// è¿žæŽ¥å­—符串 
        /// </summary>
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs
@@ -1,5 +1,6 @@
using AutoMapper;
using SqlSugar;
using System.Dynamic;
using System.Threading.Tasks;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.OrderEnum;
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs
@@ -32,7 +32,7 @@
        /// å•据编号
        /// </summary>
        [CodeRule(RuleCodeEnum.OutboundOrderRule)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "单据编号", IsOnlyIgnoreUpdate = true)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "单据编号")]
        public string OrderNo { get; set; }
        /// <summary>
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs
@@ -83,35 +83,35 @@
        /// è¡Œå·
        /// é»˜è®¤å€¼:
        ///</summary>
        [SugarColumn(ColumnName = "lineNo", ColumnDescription = "行号")]
        [SugarColumn(ColumnName = "lineNo", ColumnDescription = "行号", DefaultValue= "0")]
        public string? lineNo { get; set; }
        /// <summary>
        /// æŒªæ–™æ•°é‡
        /// é»˜è®¤å€¼:
        ///</summary>
        [SugarColumn(ColumnName = "MoveQty", ColumnDescription = "挪料数量")]
        [SugarColumn(ColumnName = "MoveQty", ColumnDescription = "挪料数量",IsNullable = true)]
        public decimal MoveQty { get; set; }
        /// <summary>
        /// ä¾›åº”商编号
        /// é»˜è®¤å€¼:
        ///</summary>
        [SugarColumn(ColumnName = "supplyCode", ColumnDescription = "供应商编号")]
        [SugarColumn(ColumnName = "supplyCode", ColumnDescription = "供应商编号", IsNullable = true)]
        public string? SupplyCode { get; set; }
        /// <summary>
        /// æ•°é‡
        /// é»˜è®¤å€¼:
        ///</summary>
        [SugarColumn(ColumnName = "barcodeQty", ColumnDescription = "数量")]
        [SugarColumn(ColumnName = "barcodeQty", ColumnDescription = "数量", DefaultValue = "0", IsNullable = true)]
        public decimal BarcodeQty { get; set; }
        /// <summary>
        /// å•位
        /// é»˜è®¤å€¼:
        ///</summary>
        [SugarColumn(ColumnName = "barcodeUnit", ColumnDescription = "单位")]
        [SugarColumn(ColumnName = "barcodeUnit", ColumnDescription = "单位", IsNullable = true    )]
        public string BarcodeUnit { get; set; } = null!;
@@ -119,13 +119,13 @@
        ///  
        /// é»˜è®¤å€¼:
        ///</summary>
        [SugarColumn(ColumnName = "barcodemoveQty", ColumnDescription = "数量")]
        [SugarColumn(ColumnName = "barcodemoveQty", ColumnDescription = "数量" , DefaultValue = "0", IsNullable = true)]
        public decimal BarcodeMoveQty { get; set; } 
        /// <summary>
        /// ä»“库
        /// é»˜è®¤å€¼:
        ///</summary>
        [SugarColumn(ColumnName = "warehouseCode", ColumnDescription = "仓库")]
        [SugarColumn(ColumnName = "warehouseCode", ColumnDescription = "仓库", IsNullable = true)]
        public string? WarehouseCode { get; set; }
        /// <summary>
@@ -142,17 +142,22 @@
        [SugarColumn(IsIgnore = true)]
        public decimal NeedOutQuantity => OrderQuantity - MoveQty;
        [SugarColumn(IsNullable = true, ColumnDescription = "")]
        public decimal PickedQty { get; set; }
        [SugarColumn(IsNullable = true, ColumnDescription = "")]
        public string documentsNO { get; set; }
        [SugarColumn(IsNullable = true, ColumnDescription = "")]
        public decimal AllocatedQuantity { get; set; }
        [SugarColumn(IsNullable = true, ColumnDescription = "")]
        public int BatchAllocateStatus { get; set; }
        /// <summary>
        /// è™šæ‹Ÿå‡ºå…¥åº“数量
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "虚拟出入库数量")]
        public decimal NoStockOutQty { get; set; }
    }
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs
@@ -2807,7 +2807,7 @@
                        business_type = outboundOrder.BusinessType,
                        factoryArea = outboundOrder.FactoryArea,
                        operationType = 1,
                        Operator = outboundOrder.Operator,
                        Operator = App.User.UserName,
                        orderNo = outboundOrder.UpperOrderNo,
                        documentsNO = outboundOrder.OrderNo,
                        status = outboundOrder.OrderStatus,