dengjunjie
2025-10-24 521fdf6c46213cad7c5c55015401154db0e78848
优化出入库历史单据头表从表查询
已修改6个文件
183 ■■■■■ 文件已修改
新建文件夹/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrderDetail_Hty.cs 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrder_Hty.cs 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderHtyServices.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderHtyServices.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WMS/src/views/inbound/inboundOrderDetail_Hty.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WMS/src/views/inbound/inboundOrder_Hty.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrderDetail_Hty.cs
@@ -1,4 +1,5 @@
using SqlSugar;
using Magicodes.ExporterAndImporter.Core;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -9,59 +10,31 @@
namespace WIDESEA_Model.Models
{
    [SugarTable("Dt_DeliveryOrderDetail_Hty", "出库明细历史表")]
    public class Dt_DeliveryOrderDetail_Hty : BaseEntity
    public class Dt_DeliveryOrderDetail_Hty : Dt_DeliveryOrderDetail, IBaseHistoryEntity
    {
        [SugarColumn(ColumnName = "HistoryId", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "历史记录主键")]
        public int HistoryId { get; set; }
        [SugarColumn(ColumnName = "Id", ColumnDescription = "原主键")]
        public int Id { get; set; }
        [SugarColumn(ColumnName = "DeliveryOrderId", IsNullable = true, ColumnDescription = "关联入库单ID")]
        public int DeliveryOrderId { get; set; }
        [SugarColumn(ColumnName = "Reservoirarea", IsNullable = true, Length = 50, ColumnDescription = "库区")]
        public string Reservoirarea { get; set; }
        [SugarColumn(ColumnName = "Goods_no", IsNullable = true, Length = 50, ColumnDescription = "药品编码")]
        public string Goods_no { get; set; }
        [SugarColumn(ColumnName = "Order_qty", IsNullable = true, ColumnDescription = "出库退货时为负数")]
        public decimal Order_qty { get; set; }
        [SugarColumn(ColumnName = "Order_Outqty", IsNullable = true, ColumnDescription = "出库完成数量")]
        public decimal Order_Outqty { get; set; }
        [SugarColumn(ColumnName = "Batch_num", IsNullable = true, Length = 50, ColumnDescription = "批号")]
        public string Batch_num { get; set; }
        [SugarColumn(ColumnName = "Exp_date", IsNullable = true, Length = 8, ColumnDescription = "校期(yyyymmmdd)")]
        public string Exp_date { get; set; }
        /// <summary>
        /// è®¢å•详情状态 æ–°å»ºï¼Œå¼€å§‹ï¼Œå·²å®Œæˆ
        /// åº“房号+状态+(新建):判断是否下发给wcs
        /// è¯¦æƒ…开始(开始)
        /// è¯¦æƒ…完成(已完成,移入历史表删除信息)
        /// åŽŸè¡¨ä¸»é”®
        /// </summary>
        [SugarColumn(ColumnName = "OotDetailStatus", IsNullable = true, Length = 50, ColumnDescription = "状态")]
        public string OotDetailStatus { get; set; }
        [ImporterHeader(Name = "原表主键")]
        [ExporterHeader(DisplayName = "原表主键")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "原表主键")]
        public int SourceId { get; set; }
        /// <summary>
        /// æ“ä½œç±»åž‹
        /// </summary>
        [ImporterHeader(Name = "操作类型")]
        [ExporterHeader(DisplayName = "操作类型")]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "操作类型")]
        public string OperateType { get; set; }
        [SugarColumn(ColumnName = "Status", IsNullable = true, ColumnDescription = "下游状态,同步状态:0未同步,1已同步(同步发给wcs)")]
        public int Status { get; set; }
        // å¯¼èˆªå±žæ€§ï¼šä¸€ä¸ªæ˜Žç»†å¯¹åº”一个药品信息
        // ä¿®æ­£å¯¼èˆªå±žæ€§ï¼šä½¿ç”¨ Goods_no å…³è” MaterielCode
        [Navigate(NavigateType.OneToOne, nameof(Goods_no), nameof(Dt_MaterielInfo.MaterielCode))]
        public Dt_MaterielInfo MedicineGoods { get; set; }
        //是否需要下面的字段
        //sku名称 productName
        //sku规格 ProductSpecifications
        //数量 quantity
        //盘亏明细 StocktakingDetails
        /// <summary>
        /// ç§»å…¥åŽ†å²æ—¶é—´
        /// </summary>
        [ImporterHeader(Name = "移入历史时间")]
        [ExporterHeader(DisplayName = "移入历史时间")]
        [SugarColumn(IsNullable = false, ColumnDescription = "移入历史时间")]
        public DateTime InsertTime { get; set; }
    }
}
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrder_Hty.cs
@@ -1,4 +1,5 @@
using SqlSugar;
using Magicodes.ExporterAndImporter.Core;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -9,55 +10,32 @@
namespace WIDESEA_Model.Models
{
    [SugarTable("Dt_DeliveryOrder_Hty", "出库单历史表")]
    public  class Dt_DeliveryOrder_Hty : BaseEntity
    public class Dt_DeliveryOrder_Hty : Dt_DeliveryOrder, IBaseHistoryEntity
    {
        [SugarColumn(ColumnName = "HistoryId", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "历史记录主键")]
        public int HistoryId { get; set; }
        [SugarColumn(ColumnName = "Id", ColumnDescription = "原主键")]
        public  int  Id { get; set; }
        [SugarColumn(ColumnName = "Out_no", IsNullable = true, Length = 50, ColumnDescription = "出库单号")]
        public string Out_no { get; set; }
        [SugarColumn(ColumnName = "Out_type", IsNullable = true, Length = 3, ColumnDescription = "出库单类型")]
        public string Out_type { get; set; }
        [SugarColumn(ColumnName = "Client_no", IsNullable = true, Length = 50, ColumnDescription = "客户代码")]
        public string Client_no { get; set; }
        [SugarColumn(ColumnName = "Client_name", IsNullable = true, Length = 50, ColumnDescription = "客户名称")]
        public string Client_name { get; set; }
        //库房号
        [SugarColumn(ColumnName = "Warehouse_no", IsNullable = true, ColumnDescription = "库房号")]
        public string Warehouse_no { get; set; }
        [SugarColumn(ColumnName = "Account_time", IsNullable = true, ColumnDescription = "出库记账时间")]
        public DateTime? Account_time { get; set; }
        [Navigate(NavigateType.OneToMany, nameof(Dt_DeliveryOrderDetail_Hty.DeliveryOrderId))]
        public new List<Dt_DeliveryOrderDetail_Hty> Details { get; set; }
        /// <summary>
        /// åŽŸè¡¨ä¸»é”®
        /// </summary>
        [ImporterHeader(Name = "原表主键")]
        [ExporterHeader(DisplayName = "原表主键")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "原表主键")]
        public int SourceId { get; set; }
        /// <summary>
        /// è¡¨å¤´çŠ¶æ€ï¼šæ–°å»ºï¼Œå¼€å§‹ï¼Œå·²å®Œæˆ //详情表全部状态为全部,在将状态改成完成后才会上传给上游系统
        /// æ“ä½œç±»åž‹
        /// </summary>
        [SugarColumn(ColumnName = "OutStatus", IsNullable = true, ColumnDescription = "状态")]
        public string OutStatus { get; set; }
        [ImporterHeader(Name = "操作类型")]
        [ExporterHeader(DisplayName = "操作类型")]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "操作类型")]
        public string OperateType { get; set; }
        //是否需要下面的字段
        //优先级 priority
        //是否取消 Is_cancel
        //优先级 priority
        //[SugarColumn(ColumnName = "Priority", IsNullable = true, ColumnDescription = "优先级")]
        //public int Priority { get; set; }
        ////是否取消 Iscancel
        //[SugarColumn(ColumnName = "Iscancel", IsNullable = true, ColumnDescription = "是否取消")]
        //public int Iscancel { get; set; }
        [Navigate(NavigateType.OneToMany, nameof(Dt_DeliveryOrderDetail.DeliveryOrderId))]
        public List<Dt_DeliveryOrderDetail> Details { get; set; }
        /// <summary>
        /// ç§»å…¥åŽ†å²æ—¶é—´
        /// </summary>
        [ImporterHeader(Name = "移入历史时间")]
        [ExporterHeader(DisplayName = "移入历史时间")]
        [SugarColumn(IsNullable = false, ColumnDescription = "移入历史时间")]
        public DateTime InsertTime { get; set; }
    }
}
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderHtyServices.cs
@@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_ISquareCabinServices;
@@ -15,5 +16,11 @@
        public CabinOrderHtyServices(IRepository<Dt_CabinOrder_Hty> BaseDal) : base(BaseDal)
        {
        }
        public override object GetDetailPage(PageDataOptions pageData)
        {
            var a = BaseDal.QueryFirst(x => x.Id == Convert.ToInt32(pageData.Value));
            pageData.Value = a.SourceId;
            return base.GetDetailPage(pageData);
        }
    }
}
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderHtyServices.cs
@@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_ISquareCabinServices;
@@ -15,5 +16,11 @@
        public DeliveryOrderHtyServices(IRepository<Dt_DeliveryOrder_Hty> BaseDal) : base(BaseDal)
        {
        }
        public override object GetDetailPage(PageDataOptions pageData)
        {
            var a = BaseDal.QueryFirst(x => x.Id == Convert.ToInt32(pageData.Value));
            pageData.Value = a.SourceId;
            return base.GetDetailPage(pageData);
        }
    }
}
н¨Îļþ¼Ð/WMS/src/views/inbound/inboundOrderDetail_Hty.vue
@@ -22,12 +22,12 @@
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'historyId',
                key: 'id',
                footer: "Foots",
                cnName: '历史入库单明细',
                name: 'dtCabinOrderDetailHty',
                url: "/DtCabinOrderDetailHty/",
                sortName: "historyId"
                sortName: "id"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
@@ -69,7 +69,7 @@
            ]);
            const columns = ref([
                {
                    field: 'historyId',
                    field: 'id',
                    title: '历史记录主键',
                    type: 'int',
                    width: 120,
@@ -79,7 +79,7 @@
                    align: 'left'
                },
                {
                    field: 'id',
                    field: 'sourceId',
                    title: '原主键',
                    type: 'int',
                    width: 100,
@@ -288,8 +288,8 @@
            sort: true
        }
    ],
    sortName: "orderId",
    key: "orderId"
    sortName: "sourceId",
    key: "sourceId"
});
            return {
                table,
н¨Îļþ¼Ð/WMS/src/views/inbound/inboundOrder_Hty.vue
@@ -22,12 +22,12 @@
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'historyId',
                key: 'id',
                footer: "Foots",
                cnName: '历史入库单',
                name: 'CabinOrderHty',
                url: "/CabinOrderHty/",
                sortName: "historyId"
                sortName: "id"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
@@ -66,7 +66,7 @@
            ]);
            const columns = ref([
                {
                    field: 'historyId',
                    field: 'id',
                    title: '历史记录主键',
                    type: 'int',
                    width: 120,
@@ -76,7 +76,7 @@
                    align: 'left'
                },
                {
                    field: 'id',
                    field: 'sourceId',
                    title: '原主键',
                    type: 'int',
                    width: 100,
@@ -172,7 +172,7 @@
                url: "/CabinOrderDetailHty/",
                columns: [
                    {
                        field: 'historyId',
                        field: 'id',
                        title: '历史记录主键',
                        type: 'int',
                        width: 120,
@@ -182,7 +182,7 @@
                        align: 'left'
                    },
                    {
                        field: 'id',
                        field: 'sourceId',
                        title: '原主键',
                        type: 'int',
                        width: 100,
@@ -279,8 +279,8 @@
                        sort: true
                    }
                ],
                sortName: "historyId",
                key: "historyId"
                sortName: "id",
                key: "id"
            });
            return {
                table,