博客
关于我
abp(net core)+easyui+efcore实现仓储管理系统——入库管理之二(三十八)
阅读量:417 次
发布时间:2019-03-06

本文共 9591 字,大约阅读时间需要 31 分钟。

如何创建入库单相关的DTO类与查询分页类

在上一篇文章中,我们创建了入库单的实体类,并使用CodeFirst功能创建了数据库表。接下来,我们将创建与入库单相关的DTO类与查询分页类。

创建应用服务接口所需的DTO类

为了在进行查询入库单表头时,我们需要创建PagedInStockResultRequestDto类,用以将查询条件数据传递到基础设施层。

在Visual Studio 2017的“解决方案资源管理器”中,右键单击“ABP.TPLMS.Application”项目,在弹出菜单中选择“添加” > “新建文件夹”,并重命名为“InStocks”。

右键单击我们刚才创建的“InStocks”文件夹,在弹出菜单中选择“添加” > “新建文件夹”,并重命名为“Dto”。

右键单击“Dto”文件夹,然后选择“添加” > “类”。将类命名为PagedInStockResultRequestDto,然后选择“添加”。代码如下:

using Abp.Application.Services.Dto;using System;using System.Collections.Generic;using System.Text;namespace ABP.TPLMS.InStocks.Dto{public class PagedInStockResultRequestDto : PagedResultRequestDto{public string Keyword { get; set; }public string InStockNo { get; set; }public DateTime BeginTime { get; set; }DateTime m_EndTime;///

/// 查询截止日期,如果当前时间小于100年前,就给一个默认日期(明天)/// public DateTime EndTime{get{if (m_EndTime < DateTime.Now.AddYears(-100))return DateTime.Now.AddDays(1);elsereturn m_EndTime;}set{m_EndTime = value;}}public string OwnerName { get; set; }public string No { get; set; }}}

右键单击“Dto”文件夹,然后选择“添加” > “类”。将类命名为PagedInStockDetailResultRequestDto,然后选择“添加”。代码如下:

using Abp.Application.Services.Dto;using System;using System.Collections.Generic;using System.Text;namespace ABP.TPLMS.InStocks.Dto{public class PagedInStockDetailResultRequestDto : PagedResultRequestDto{public string Keyword { get; set; }public string InStockNo { get; set; }}}

右键单击“Dto”文件夹,然后选择“添加” > “类”。将类命名为PagedInStockDetailLocResultRequestDto,然后选择“添加”。代码如下:

using Abp.Application.Services.Dto;using System;using System.Collections.Generic;using System.Text;namespace ABP.TPLMS.InStocks.Dto{public class PagedInStockDetailLocResultRequestDto : PagedResultRequestDto{public string Keyword { get; set; }public int InStockOrderDetailId { get; set; }}}

右键单击“Dto”文件夹,然后选择“添加” > “类”。将类命名为InStockOrderDto,然后选择“添加”。代码如下:

using Abp.Application.Services.Dto;using Abp.AutoMapper;using ABP.TPLMS.Entitys;using System;using System.Collections.Generic;using System.Text;namespace ABP.TPLMS.InStocks.Dto{[AutoMapFrom(typeof(InStockOrder))]public class InStockOrderDto : EntityDto{public string No { get; set; }///

/// 客户名称/// public string CustomerName { get; set; }public string WarehouseType { get; set; }///
/// 客户代码/// public string CustomerCode { get; set; }///
/// 送货单号/// public string DeliveryNo { get; set; }///
/// 仓库号/// public string WarehouseNo { get; set; }///
/// 货主/// public string OwnerName { get; set; }///
/// 毛重/// public decimal Gwt { get; set; }public decimal Nwt { get; set; }public int PackageQty { get; set; }///
/// 接收时间/// public string ReceiveTime { get; set; }///
/// 接收人/// public string Receiver { get; set; }public string Oper { get; set; }public int Status { get; set; }public string OwnerCode { get; set; }///
/// 预计送货时间/// public string PreDeliveryTime { get; set; }///
/// 审核人/// 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
InStockOrderDetail { get; set; }}}

右键单击“Dto”文件夹,然后选择“添加” > “类”。将类命名为CreateUpdateInStockOrderDto,然后选择“添加”。代码如下:

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.InStocks.Dto{[AutoMapTo(typeof(InStockOrder))]public class CreateUpdateInStockOrderDto : EntityDto{public const int MaxLength = 255;[StringLength(50)][Required]public string No { get; set; }///

/// 客户名称/// [StringLength(MaxLength)][Required]public string CustomerName { get; set; }public string WarehouseType { get; set; }///
/// 客户代码/// [StringLength(50)][Required]public string CustomerCode { get; set; }///
/// 送货单号/// public string DeliveryNo { get; set; }///
/// 仓库号/// public string WarehouseNo { get; set; }///
/// 货主/// [StringLength(MaxLength)][Required]public string OwnerName { get; set; }public decimal Gwt { get; set; }public decimal Nwt { get; set; }public int PackageQty { get; set; }///
/// 接收时间/// [StringLength(20)]public string ReceiveTime { get; set; }///
/// 接收人/// [StringLength(50)]public string Receiver { get; set; }[StringLength(50)]public string Oper { get; set; }public int Status { get; set; }[StringLength(50)]public string OwnerCode { get; set; }///
/// 预计送货时间/// [StringLength(20)]public string PreDeliveryTime { get; set; }///
/// 审核人/// [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
InStockOrderDetail { get; set; }}}

右键单击“Dto”文件夹,然后选择“添加” > “类”。将类命名为InStockDetailDto与CreateUpdateInStockDetailDto、InStockDetailLocDto与CreateUpdateInStockDetailLocDto。

InStockDetailDto

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.InStocks.Dto{[AutoMapFrom(typeof(InStockOrderDetail))]public class InStockOrderDetailDto : EntityDto{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; }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 SeqNo { 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 int DeliveryOrderDetailId { get; set; }[NotMapped]public List

InStockOrderDetailLoc { get; set; }}}

CreateUpdateInStockDetailDto

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.InStocks.Dto{[AutoMapTo(typeof(InStockOrderDetail))]public class CreateUpdateInStockOrderDetailDto : EntityDto{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; }[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 SeqNo { 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 int DeliveryOrderDetailId { get; set; }[NotMapped]public List

InStockOrderDetailLoc { get; set; }}}

InStockDetailLocDto

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.Text;namespace ABP.TPLMS.InStocks.Dto{public class InStockOrderDetailLocDto : EntityDto{[AutoMapFrom(typeof(InStockOrderDetailLoc))]public InStockOrderDetailLocDto(){this.Qty = 0;this.SeqNo = 0;this.Loc = string.Empty;this.CreationTime = DateTime.Now;this.InStockOrderDetailId = 0;}public int InStockOrderDetailId { get; set; }public int SeqNo { get; set; }public string Loc { get; set; }public decimal Qty { get; set; }public DateTime CreationTime { get; set; }}}

CreateUpdateInStockDetailLocDto

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.Text;namespace ABP.TPLMS.InStocks.Dto{public class CreateUpdateInStockOrderDetailLocDto : EntityDto{[AutoMapTo(typeof(InStockOrderDetailLoc))]public CreateUpdateInStockOrderDetailLocDto(){this.Qty = 0;this.SeqNo = 0;this.Loc = string.Empty;this.CreationTime = DateTime.Now;this.InStockOrderDetailId = 0;}public int InStockOrderDetailId { get; set; }public int SeqNo { get; set; }[StringLength(50)]public string Loc { get; set; }public decimal Qty { get; set; }public DateTime CreationTime { get; set; }}}

转载地址:http://bgmkz.baihongyu.com/

你可能感兴趣的文章
Nginx配置代理解决本地html进行ajax请求接口跨域问题
查看>>
Nginx配置参数中文说明
查看>>
Nginx配置好ssl,但$_SERVER[‘HTTPS‘]取不到值
查看>>
Nginx配置如何一键生成
查看>>
Nginx配置实例-负载均衡实例:平均访问多台服务器
查看>>
NHibernate学习[1]
查看>>
NIFI1.21.0通过Postgresql11的CDC逻辑复制槽实现_指定表多表增量同步_增删改数据分发及删除数据实时同步_通过分页解决变更记录过大问题_02----大数据之Nifi工作笔记0054
查看>>
NIFI从MySql中增量同步数据_通过Mysql的binlog功能_实时同步mysql数据_配置binlog_使用处理器抓取binlog数据_实际操作01---大数据之Nifi工作笔记0040
查看>>
NIFI从MySql中增量同步数据_通过Mysql的binlog功能_实时同步mysql数据_配置数据路由_实现数据插入数据到目标数据库_实际操作03---大数据之Nifi工作笔记0042
查看>>
NIFI同步MySql数据_到SqlServer_错误_驱动程序无法通过使用安全套接字层(SSL)加密与SQL Server_Navicat连接SqlServer---大数据之Nifi工作笔记0047
查看>>
Nifi同步过程中报错create_time字段找不到_实际目标表和源表中没有这个字段---大数据之Nifi工作笔记0066
查看>>
NIFI大数据进阶_离线同步MySql数据到HDFS_02_实际操作_splitjson处理器_puthdfs处理器_querydatabasetable处理器---大数据之Nifi工作笔记0030
查看>>
NIFI大数据进阶_连接与关系_设置数据流负载均衡_设置背压_设置展现弯曲_介绍以及实际操作---大数据之Nifi工作笔记0027
查看>>
NIFI数据库同步_多表_特定表同时同步_实际操作_MySqlToMysql_可推广到其他数据库_Postgresql_Hbase_SqlServer等----大数据之Nifi工作笔记0053
查看>>
NIFI汉化_替换logo_二次开发_Idea编译NIFI最新源码_详细过程记录_全解析_Maven编译NIFI避坑指南001---大数据之Nifi工作笔记0068
查看>>
NIFI集群_内存溢出_CPU占用100%修复_GC overhead limit exceeded_NIFI: out of memory error ---大数据之Nifi工作笔记0017
查看>>
NIFI集群_队列Queue中数据无法清空_清除队列数据报错_无法删除queue_解决_集群中机器交替重启删除---大数据之Nifi工作笔记0061
查看>>
NIH发布包含10600张CT图像数据库 为AI算法测试铺路
查看>>
Nim教程【十二】
查看>>
Nim游戏
查看>>