abp(net core)+easyui+efcore實現倉儲管理系統——出庫管理之二(五十)


abp(net core)+easyui+efcore實現倉儲管理系統目錄

abp(net core)+easyui+efcore實現倉儲管理系統——EasyUI前端頁面框架 (十八)

 

       最近工作有點忙,已經有幾個月沒有更新了,計划在年前會把出庫單管理寫完。明年計划升級到Net Core 3.1或是net 5,具體看有沒有空閑時間了。這就是最近的兩個計划,不過有時候計划趕不上變化。

        在上一篇文章中我們創建了出庫單的實體類,並使用CodeFirst功能創建了數據庫表,接下我們來創建一些有關與出庫單有關的DTO類與查詢分頁類。

 

四、定義應用服務接口需要用到的DTO類

        為了在進行查詢出庫單表頭,我們需要創建, PagedOutStockResultRequestDto類,用來將查詢條件數據傳遞到基礎設施層.

    1. 在Visual Studio 2017的“解決方案資源管理器”中,右鍵單擊“ABP.TPLMS.Application”項目,在彈出菜單中選擇“添加” > “新建文件夾”,並重命名為“OutStocks”

    2. 使用鼠標右鍵單擊我們剛才創建的“OutStocks”文件夾,在彈出菜單中選擇“添加” > “新建文件夾”,並重命名為“Dto”。

    3.右鍵單擊“Dto”文件夾,然后選擇“添加” > “類”。 將類命名為 PagedOutStockResultRequestDto,然后選擇“添加”。代碼如下。

using Abp.Application.Services.Dto;
using System;
using System.Collections.Generic;
using System.Text; 

namespace ABP.TPLMS.OutStocks.Dto
{

    public class PagedOutStockResultRequestDto : PagedResultRequestDto
    {

        public string Keyword { get; set; }
       public string InStockNo { get; set; }
        public DateTime BeginTime { get; set; }

        DateTime m_EndTime;

        /// <summary>
        /// 查詢截止日期,如果當前時間小於100年前,就給一個默認日期(明天)
        /// </summary>
        public DateTime EndTime { get

            {

                if (m_EndTime < DateTime.Now.AddYears(-100))

                    return DateTime.Now.AddDays(1);

                else

                    return m_EndTime;

                    }
            set
            {
                m_EndTime = value;

            }
                }

        public string OwnerName { get; set; }

        public string No { get; set; }
    }
} 

 

      4.右鍵單擊“Dto”文件夾,然后選擇“添加” > “類”。 將類命名為 PagedOutStockDetailResultRequestDto,然后選擇“添加”。此類根據入庫單單號與出庫單單號查詢出庫單的明細數據。代碼如下。

using Abp.Application.Services.Dto;
using System;
using System.Collections.Generic;
using System.Text; 

namespace ABP.TPLMS.OutStocks.Dto
{

    public class PagedOutStockDetailResultRequestDto : PagedResultRequestDto
    {

        public string Keyword { get; set; }

        public string InStockNo { get; set; }

        public string OutStockNo { get; set; } 

    }
}

 

     5.右鍵單擊“Dto”文件夾,然后選擇“添加” > “類”。 將類命名為 OutStockOrderDto,然后選擇“添加”。代碼如下。

using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using ABP.TPLMS.Entitys;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text; 

namespace ABP.TPLMS.OutStocks.Dto
{

    [AutoMapFrom(typeof(OutStockOrder))]
    public class OutStockOrderDto : EntityDto<int>
    {

        public string No { get; set; }

        /// <summary>
        /// 客戶名稱
        /// </summary>
        public string CustomerName { get; set; }

        /// <summary>
        /// 車牌號
        /// </summary>
        public string VehicleNo { get; set; }

        /// <summary>
        /// 客戶代碼
        /// </summary>
        public string CustomerCode { get; set; }

        /// <summary>
        /// 收貨人代碼
        /// </summary>
        public string ConsigneeCode { get; set; }

        /// <summary>
        /// 收貨人
        /// </summary>
        public string Consignee { get; set; }

        /// <summary>
        /// 收貨人社會信用代碼
        /// </summary>
        public string ConsigneeSCCD { get; set; }

        /// <summary>
        /// 托運人,發貨人
        /// </summary>
        public string Shipper { get; set; }

        /// <summary>
        /// 托運人,發貨人代碼
        /// </summary>
        public string ShipperCode { get; set; }

        /// <summary>
        /// 托運人,發貨人社會信用代碼
        /// </summary>
        public string ShipperSCCD { get; set; }

        /// <summary>
        /// 通知人
        /// </summary>
        public string Notify { get; set; }

        /// <summary>
        /// 通知人代碼
        /// </summary>
        public string NotifyCode { get; set; }

        /// <summary>
        /// 通知人社會信用代碼
        /// </summary>
        public string NotifySCCD { get; set; }

        /// <summary>
        /// 送貨單號
        /// </summary>
        public string DeliveryNo { get; set; }

        /// <summary>
        /// 倉庫號
        /// </summary>
        public string WarehouseNo { get; set; }

        /// <summary>
        /// 貨主
        /// </summary>

        [StringLength(MaxLength)]
        public string OwnerName { get; set; }

        public decimal Gwt { get; set; }
        public decimal Nwt { get; set; }
        public int PackageQty { get; set; }

        /// <summary>
        /// 理貨時間
        /// </summary>
        public string TallyTime { get; set; }

        /// <summary>
        /// 理貨員
        /// </summary>    

        public string TallyClerk { get; set; }
        public string Oper { get; set; }

        public int Status { get; set; }
        public string OwnerCode { get; set; }

        /// <summary>
        /// 預計出庫時間
        /// </summary>
        public string PreOutStockTime { get; set; }

        /// <summary>
        /// 審核人
        /// </summary>
      public string Checker { get; set; }       
        public string CheckTime { get; set; }     

        public string Remark { get; set; }

        public DateTime CreationTime { get; set; }     
        public string LastUpdateTime { get; set; }      

        public string LastOper { get; set; }

        public List<OutStockOrderDetailDto> OutStockOrderDetail { get; set; }

    }
} 

 

    6.右鍵單擊“Dto”文件夾,然后選擇“添加” > “類”。 將類命名為 CreateUpdateOutStockOrderDto,然后選擇“添加”。代碼如下。

using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using ABP.TPLMS.Entitys;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace ABP.TPLMS.OutStocks.Dto
{

    [AutoMapTo(typeof(OutStockOrder))]

    public  class CreateUpdateOutStockOrderDto : EntityDto<int>
    {

        public const int MaxLength = 255;

        [StringLength(50)]

        [Required]

        public string No { get; set; }

        /// <summary>
        /// 客戶名稱
        /// </summary>

        [StringLength(MaxLength)]

        public string CustomerName { get; set; }

 

        /// <summary>
        /// 車牌號
        /// </summary>

        public string VehicleNo { get; set; }

        /// <summary>
        /// 客戶代碼
        /// </summary>
        [StringLength(50)]

        public string CustomerCode { get; set; }

 

        /// <summary>
        /// 收貨人代碼
        /// </summary>
        [Required]
        public string ConsigneeCode { get; set; }

         /// <summary>
        /// 收貨人
        /// </summary>
        [Required]
        public string Consignee { get; set; }

        /// <summary>
        /// 收貨人社會信用代碼
        /// </summary>
        public string ConsigneeSCCD { get; set; }

        /// <summary>
        /// 托運人,發貨人
        /// </summary>
        [Required]
        public string Shipper { get; set; }

         /// <summary>
        /// 托運人,發貨人代碼
        /// </summary>
        [Required]
        public string ShipperCode { get; set; }

        /// <summary>
        /// 托運人,發貨人社會信用代碼
        /// </summary>
        public string ShipperSCCD { get; set; }

 
        /// <summary>
        /// 通知人
        /// </summary>
        public string Notify { get; set; }

 

        /// <summary>
        /// 通知人代碼
        /// </summary>
        public string NotifyCode { get; set; }


        /// <summary>
        /// 通知人社會信用代碼
        /// </summary>
        public string NotifySCCD { get; set; }

 

        /// <summary>
        /// 送貨單號
        /// </summary>
        public string DeliveryNo { get; set; }

        /// <summary>
        /// 倉庫號
        /// </summary>
        public string WarehouseNo { get; set; }

        /// <summary>
        /// 貨主
        /// </summary>
        [StringLength(MaxLength)]
        [Required]
        public string OwnerName { get; set; }


        public decimal Gwt { get; set; }
        public decimal Nwt { get; set; }
        public int PackageQty { get; set; }

        /// <summary>
        /// 理貨時間
        /// </summary>
        [StringLength(20)]
        public string TallyTime { get; set; }

        /// <summary>
        /// 理貨員
        /// </summary>

        [StringLength(50)]
        public string TallyClerk { get; set; }

 
        [StringLength(50)]
        public string Oper { get; set; }
        public int Status { get; set; }

        [StringLength(50)]
        public string OwnerCode { get; set; }

        /// <summary>
        /// 預計出庫時間
        /// </summary>
        [StringLength(20)]

        public string PreOutStockTime { get; set; }

        /// <summary>
        /// 審核人
        /// </summary>
        [StringLength(50)]

        public string Checker { get; set; }
        [StringLength(20)]

        public string CheckTime { get; set; }
        [StringLength(1000)]

        public string Remark { get; set; }
        public DateTime CreationTime { get; set; }

        [StringLength(20)]
        public string LastUpdateTime { get; set; }

        [StringLength(50)]

       public string LastOper { get; set; }

        public List<CreateUpdateInStockOrderDetailDto> InStockOrderDetail { get; set; }

    }

}

 

  7. 重復上面的第3,4,5步,我們來創建OutStockDetailDto與CreateUpdateOutStockDetailDto。

 

  7.1 OutStockDetailDto

using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using ABP.TPLMS.Entitys;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;


namespace ABP.TPLMS.OutStocks.Dto
{
    [AutoMapFrom(typeof(OutStockOrderDetail))]
    public class OutStockOrderDetailDto : EntityDto<int>
    {
        public int SupplierId { get; set; }
        public string CargoCode { get; set; }
        public string HSCode { get; set; }    
        public string CargoName { get; set; }
        public string Spcf { get; set; }   
        public string Unit { get; set; }
        /// <summary>
        /// 目的國
        /// </summary>   
        public string DestCountry { get; set; }

       /// <summary>
        /// 原產國
        /// </summary>     
        public string Country { get; set; }

        public string Brand { get; set; }    
        public string Curr { get; set; }
 
        public string Package { get; set; }
        public decimal Length { get; set; }

        public decimal Width { get; set; }
        public decimal Height { get; set; }

        public decimal Vol { get; set; }
        public decimal Price { get; set; }
        public decimal TotalAmt { get; set; }

        public decimal GrossWt { get; set; }
 

        public decimal NetWt { get; set; }
        public DateTime CreationTime { get; set; }    
        public string InStockNo { get; set; }

        public int InStockOrderDetailId { get; set; }
        public decimal Qty { get; set; }
        public decimal LawfQty { get; set; }
        public decimal SecdLawfQty { get; set; }


        public string LawfUnit { get; set; }    
        public string SecdLawfUnit { get; set; }
        public string Batch { get; set; }

        public string Loc { get; set; } 
    }
} 

 

     7.2 CreateUpdateOutStockDetailDto

using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using ABP.TPLMS.Entitys;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text; 

namespace ABP.TPLMS.OutStocks.Dto
{

    [AutoMapTo(typeof(OutStockOrderDetail))]
    public class CreateUpdateOutStockOrderDetailDto : EntityDto<int>
    {

        public const int MaxLength = 255;
        public int SupplierId { get; set; }

        [MaxLength(50)]
        public string CargoCode { get; set; }

        [MaxLength(10)]
        public string HSCode { get; set; }

        [MaxLength(MaxLength)]
        public string CargoName { get; set; }

        [MaxLength(MaxLength)]
        public string Spcf { get; set; }

        [MaxLength(20)]
        public string Unit { get; set; }

        /// <summary>
        /// 目的國
        /// </summary>
        [MaxLength(20)]
        public string DestCountry { get; set; }

        /// <summary>
        /// 原產國
        /// </summary>
        [MaxLength(20)]
        public string Country { get; set; }

        [MaxLength(50)]
        public string Brand { get; set; }

        [MaxLength(20)]
        public string Curr { get; set; }

        [MaxLength(20)]
        public string Package { get; set; }

        public decimal Length { get; set; }
        public decimal Width { get; set; }
        public decimal Height { get; set; }
        public decimal Vol { get; set; }

 

        public decimal Price { get; set; }
        public decimal TotalAmt { get; set; }
        public decimal GrossWt { get; set; }

        public decimal NetWt { get; set; }

        public DateTime CreationTime { get; set; }

        [MaxLength(20)]

        public string InStockNo { get; set; }

        public int InStockOrderDetailId { get; set; }

        public decimal Qty { get; set; }

        public decimal LawfQty { get; set; }

        public decimal SecdLawfQty { get; set; }

        [MaxLength(20)]

        public string LawfUnit { get; set; }

        [MaxLength(20)]
        public string SecdLawfUnit { get; set; }

        [MaxLength(20)]
        public string Batch { get; set; }

        public string Loc { get; set; }
    }

}

 


 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM