abp(net core)+easyui+efcore实现仓储管理系统目录

abp(net core)+easyui+efcore实现仓储管理系统——EasyUI前端页面框架 (十八)

abp(net core)+easyui+efcore实现仓储管理系统——ABP WebAPI与EasyUI结合增删改查之八(三十四)

 

在上一篇文章abp(net core)+easyui+efcore实现仓储管理系统——入库管理之一(三十七)中我们创建了入库单的实体类,并使用CodeFirst功能创建了数据库表,接下我们来创建一些有关与入库单有关的DTO类与查询分页类。

四、定义应用服务接口需要用到的DTO类

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

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

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

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

  1. using Abp.Application.Services.Dto;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5.  
  6. namespace ABP.TPLMS.InStocks.Dto
  7. {
  8.  
  9. public class PagedInStockResultRequestDto : PagedResultRequestDto
  10. {
  11.  
  12. public string Keyword { get; set; }
  13. public string InStockNo { get; set; }
  14. public DateTime BeginTime { get; set; }
  15. DateTime m_EndTime;
  16. /// <summary>
  17. /// 查询截止日期,如果当前时间小于100年前,就给一个默认日期(明天)
  18. /// </summary>
  19.  
  20. public DateTime EndTime { get
  21. {
  22.  
  23. if (m_EndTime < DateTime.Now.AddYears(-))
  24. return DateTime.Now.AddDays();
  25. else
  26. return m_EndTime;
  27. }
  28.  
  29. set
  30. {
  31. m_EndTime = value;
  32. }
  33. }
  34.  
  35. public string OwnerName { get; set; }
  36. public string No { get; set; }
  37. }
  38. }

4.右键单击“Dto”文件夹,然后选择“添加” > “类”。 将类命名为 PagedInStockDetailResultRequestDto,然后选择“添加”。此类根据入库单单号查询入库单的明细数据。代码如下。

  1. using Abp.Application.Services.Dto;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5.  
  6. namespace ABP.TPLMS.InStocks.Dto
  7. {
  8.  
  9. public class PagedInStockDetailResultRequestDto : PagedResultRequestDto
  10. {
  11.  
  12. public string Keyword { get; set; }
  13. public string InStockNo { get; set; }
  14.  
  15. }
  16. }

5.右键单击“Dto”文件夹,然后选择“添加” > “类”。 将类命名为 PagedInStockDetailLocResultRequestDto,然后选择“添加”。此类根据入库单明细的ID查询入库单某条明细数据的库位信息。代码如下。

  1. using Abp.Application.Services.Dto;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5.  
  6. namespace ABP.TPLMS.InStocks.Dto
  7. {
  8.  
  9. public class PagedInStockDetailLocResultRequestDto : PagedResultRequestDto
  10. {
  11.  
  12. public string Keyword { get; set; }
  13. public int InStockOrderDetailId { get; set; }
  14.  
  15. }
  16. }

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

  1. using Abp.Application.Services.Dto;
  2. using Abp.AutoMapper;
  3. using ABP.TPLMS.Entitys;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Text;
  7.  
  8. namespace ABP.TPLMS.InStocks.Dto
  9. {
  10.  
  11. [AutoMapFrom(typeof(InStockOrder))]
  12. public class InStockOrderDto : EntityDto<int>
  13. {
  14.  
  15. public string No { get; set; }
  16. /// <summary>
  17. /// 客户名称
  18. /// </summary>
  19. public string CustomerName { get; set; }
  20.  
  21. public string WarehouseType { get; set; }
  22.  
  23. /// <summary>
  24. /// 客户代码
  25. /// </summary>
  26. public string CustomerCode { get; set; }
  27.  
  28. /// <summary>
  29. /// 送货单号
  30. /// </summary>
  31. public string DeliveryNo { get; set; }
  32. /// <summary>
  33. /// 仓库号
  34. /// </summary>
  35. public string WarehouseNo { get; set; }
  36.  
  37. /// <summary>
  38. /// 货主
  39. /// </summary>
  40. public string OwnerName { get; set; }
  41.  
  42. /// <summary>
  43. /// 毛重
  44. /// </summary>
  45. public decimal Gwt { get; set; }
  46. public decimal Nwt { get; set; }
  47. public int PackageQty { get; set; }
  48.  
  49. /// <summary>
  50. /// 接收时间
  51. /// </summary>
  52. public string ReceiveTime { get; set; }
  53.  
  54. /// <summary>
  55. /// 接收人
  56. /// </summary>
  57.  
  58. public string Receiver { get; set; }
  59. public string Oper { get; set; }
  60. public int Status { get; set; }
  61. public string OwnerCode { get; set; }
  62.  
  63. /// <summary>
  64. /// 预计送货时间
  65. /// </summary>
  66.  
  67. public string PreDeliveryTime { get; set; }
  68.  
  69. /// <summary>
  70. /// 审核人
  71. /// </summary>
  72.  
  73. public string Checker { get; set; }
  74. public string CheckTime { get; set; }
  75.  
  76. public string Remark { get; set; }
  77. public DateTime CreationTime { get; set; }
  78.  
  79. public string LastUpdateTime { get; set; }
  80. public string LastOper { get; set; }
  81.  
  82. public List<InStockOrderDetailDto> InStockOrderDetail { get; set; }
  83.  
  84. }
  85.  
  86. }

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

  1. using Abp.Application.Services.Dto;
  2. using Abp.AutoMapper;
  3. using ABP.TPLMS.Entitys;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.ComponentModel.DataAnnotations;
  7. using System.Text;
  8.  
  9. namespace ABP.TPLMS.InStocks.Dto
  10. {
  11.  
  12. [AutoMapTo(typeof(InStockOrder))]
  13. public class CreateUpdateInStockOrderDto : EntityDto<int>
  14. {
  15.  
  16. public const int MaxLength = ;
  17.  
  18. [StringLength()]
  19. [Required]
  20. public string No { get; set; }
  21.  
  22. /// <summary>
  23. /// 客户名称
  24. /// </summary>
  25.  
  26. [StringLength(MaxLength)]
  27. [Required]
  28. public string CustomerName { get; set; }
  29.  
  30. public string WarehouseType { get; set; }
  31.  
  32. /// <summary>
  33. /// 客户代码
  34. /// </summary>
  35.  
  36. [StringLength()]
  37. [Required]
  38. public string CustomerCode { get; set; }
  39.  
  40. /// <summary>
  41. /// 送货单号
  42. /// </summary>
  43. public string DeliveryNo { get; set; }
  44.  
  45. /// <summary>
  46. /// 仓库号
  47. /// </summary>
  48. public string WarehouseNo { get; set; }
  49.  
  50. /// <summary>
  51. /// 货主
  52. /// </summary>
  53. [StringLength(MaxLength)]
  54. [Required]
  55. public string OwnerName { get; set; }
  56. public decimal Gwt { get; set; }
  57. public decimal Nwt { get; set; }
  58. public int PackageQty { get; set; }
  59.  
  60. /// <summary>
  61. /// 接收时间
  62. /// </summary>
  63. [StringLength()]
  64. public string ReceiveTime { get; set; }
  65.  
  66. /// <summary>
  67. /// 接收人
  68. /// </summary>
  69. [StringLength()]
  70. public string Receiver { get; set; }
  71.  
  72. [StringLength()]
  73.  
  74. public string Oper { get; set; }
  75. public int Status { get; set; }
  76. [StringLength()]
  77. public string OwnerCode { get; set; }
  78.  
  79. /// <summary>
  80. /// 预计送货时间
  81. /// </summary>
  82. [StringLength()]
  83. public string PreDeliveryTime { get; set; }
  84.  
  85. /// <summary>
  86. /// 审核人
  87. /// </summary>
  88. [StringLength()]
  89. public string Checker { get; set; }
  90. [StringLength()]
  91. public string CheckTime { get; set; }
  92. [StringLength()]
  93. public string Remark { get; set; }
  94. public DateTime CreationTime { get; set; }
  95.  
  96. [StringLength()]
  97. public string LastUpdateTime { get; set; }
  98.  
  99. [StringLength()]
  100. public string LastOper { get; set; }
  101. public List<CreateUpdateInStockOrderDetailDto> InStockOrderDetail { get; set; }
  102. }
  103. }
 
   8. 重复上面的第6-7步,我们来创建InStockDetailDto与CreateUpdateInStockDetailDto、InStockDetailLocDto与CreateUpdateInStockDetailLocDto。

8.1 InStockDetailDto

  1. using Abp.Application.Services.Dto;
  2. using Abp.AutoMapper;
  3. using Abp.Domain.Entities;
  4. using Abp.Domain.Entities.Auditing;
  5. using ABP.TPLMS.Entitys;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel.DataAnnotations;
  9. using System.ComponentModel.DataAnnotations.Schema;
  10. using System.Text;
  11.  
  12. namespace ABP.TPLMS.InStocks.Dto
  13. {
  14.  
  15. [AutoMapFrom(typeof(InStockOrderDetail))]
  16. public class InStockOrderDetailDto : EntityDto<int>
  17. {
  18.  
  19. public int SupplierId { get; set; }
  20.  
  21. public string CargoCode { get; set; }
  22. public string HSCode { get; set; }
  23. public string CargoName { get; set; }
  24. public string Spcf { get; set; }
  25.  
  26. public string Unit { get; set; }
  27. public string Country { get; set; }
  28. public string Brand { get; set; }
  29. public string Curr { get; set; }
  30. public string Package { get; set; }
  31.  
  32. public decimal Length { get; set; }
  33.  
  34. public decimal Width { get; set; }
  35.  
  36. public decimal Height { get; set; }
  37. public decimal Vol { get; set; }
  38.  
  39. public decimal Price { get; set; }
  40. public decimal TotalAmt { get; set; }
  41.  
  42. public decimal GrossWt { get; set; }
  43. public decimal NetWt { get; set; }
  44. public DateTime CreationTime { get; set; }
  45.  
  46. public string InStockNo { get; set; }
  47. public int SeqNo { get; set; }
  48.  
  49. public decimal Qty { get; set; }
  50. public decimal LawfQty { get; set; }
  51. public decimal SecdLawfQty { get; set; }
  52.  
  53. public string LawfUnit { get; set; }
  54. public string SecdLawfUnit { get; set; }
  55.  
  56. public string Batch { get; set; }
  57. public int DeliveryOrderDetailId { get; set; }
  58. [NotMapped]
  59. public List<InStockOrderDetailLoc> InStockOrderDetailLoc { get; set; }
  60. }
  61. }

8.2 CreateUpdateInStockDetailDto

  1. using Abp.Application.Services.Dto;
  2. using Abp.AutoMapper;
  3. using Abp.Domain.Entities;
  4. using Abp.Domain.Entities.Auditing;
  5. using ABP.TPLMS.Entitys;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel.DataAnnotations;
  9. using System.ComponentModel.DataAnnotations.Schema;
  10. using System.Text;
  11.  
  12. namespace ABP.TPLMS.InStocks.Dto
  13. {
  14.  
  15. [AutoMapTo(typeof(InStockOrderDetail))]
  16. public class CreateUpdateInStockOrderDetailDto : EntityDto<int>
  17. {
  18.  
  19. public const int MaxLength = ;
  20. public int SupplierId { get; set; }
  21. [MaxLength()]
  22. public string CargoCode { get; set; }
  23.  
  24. [MaxLength()]
  25. public string HSCode { get; set; }
  26.  
  27. [MaxLength(MaxLength)]
  28. public string CargoName { get; set; }
  29.  
  30. [MaxLength(MaxLength)]
  31. public string Spcf { get; set; }
  32.  
  33. [MaxLength()]
  34. public string Unit { get; set; }
  35.  
  36. [MaxLength()]
  37. public string Country { get; set; }
  38.  
  39. [MaxLength()]
  40. public string Brand { get; set; }
  41.  
  42. [MaxLength()]
  43. public string Curr { get; set; }
  44.  
  45. [MaxLength()]
  46. public string Package { get; set; }
  47.  
  48. public decimal Length { get; set; }
  49. public decimal Width { get; set; }
  50.  
  51. public decimal Height { get; set; }
  52. public decimal Vol { get; set; }
  53.  
  54. public decimal Price { get; set; }
  55. public decimal TotalAmt { get; set; }
  56. public decimal GrossWt { get; set; }
  57.  
  58. public decimal NetWt { get; set; }
  59.  
  60. public DateTime CreationTime { get; set; }
  61.  
  62. [MaxLength()]
  63. public string InStockNo { get; set; }
  64. public int SeqNo { get; set; }
  65. public decimal Qty { get; set; }
  66. public decimal LawfQty { get; set; }
  67.  
  68. public decimal SecdLawfQty { get; set; }
  69.  
  70. [MaxLength()]
  71. public string LawfUnit { get; set; }
  72. [MaxLength()]
  73. public string SecdLawfUnit { get; set; }
  74. [MaxLength()]
  75.  
  76. public string Batch { get; set; }
  77. public int DeliveryOrderDetailId { get; set; }
  78.  
  79. [NotMapped]
  80. public List<InStockOrderDetailLoc> InStockOrderDetailLoc { get; set; }
  81.  
  82. }
  83. }

8.3  InStockDetailLocDto

  1. using Abp.Application.Services.Dto;
  2. using Abp.AutoMapper;
  3. using Abp.Domain.Entities;
  4. using Abp.Domain.Entities.Auditing;
  5. using ABP.TPLMS.Entitys;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel.DataAnnotations;
  9. using System.Text;
  10.  
  11. namespace ABP.TPLMS.InStocks.Dto
  12. {
  13.  
  14. public class InStockOrderDetailLocDto : EntityDto<int>
  15. {
  16. [AutoMapFrom(typeof(InStockOrderDetailLoc))]
  17. public InStockOrderDetailLocDto()
  18. {
  19. this.Qty = ;
  20. this.SeqNo = ;
  21. this.Loc = string.Empty;
  22. this.CreationTime = DateTime.Now;
  23. this.InStockOrderDetailId = ;
  24.  
  25. }
  26.  
  27. public int InStockOrderDetailId { get; set; }
  28. public int SeqNo { get; set; }
  29. public string Loc { get; set; }
  30. public decimal Qty { get; set; }
  31. public DateTime CreationTime { get; set; }
  32. }
  33. }

8.4  CreateUpdateInStockDetailLocDto。

  1. using Abp.Application.Services.Dto;
  2. using Abp.AutoMapper;
  3. using Abp.Domain.Entities;
  4. using Abp.Domain.Entities.Auditing;
  5. using ABP.TPLMS.Entitys;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel.DataAnnotations;
  9. using System.Text;
  10.  
  11. namespace ABP.TPLMS.InStocks.Dto
  12. {
  13.  
  14. public class CreateUpdateInStockOrderDetailLocDto : EntityDto<int>
  15. {
  16.  
  17. [AutoMapTo(typeof(InStockOrderDetailLoc))]
  18. public CreateUpdateInStockOrderDetailLocDto()
  19. {
  20.  
  21. this.Qty = ;
  22. this.SeqNo = ;
  23. this.Loc = string.Empty;
  24. this.CreationTime = DateTime.Now;
  25. this.InStockOrderDetailId = ;
  26. }
  27. public int InStockOrderDetailId { get; set; }
  28. public int SeqNo { get; set; }
  29. [StringLength()]
  30. public string Loc { get; set; }
  31. public decimal Qty { get; set; }
  32. public DateTime CreationTime { get; set; }
  33. }
  34. }
 

bp(net core)+easyui+efcore实现仓储管理系统——入库管理之二(三十八)的更多相关文章

  1. bp(net core)+easyui+efcore实现仓储管理系统——入库管理之三存储过程(三十九)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

  2. abp(net core)+easyui+efcore实现仓储管理系统——入库管理之九(四十五)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

  3. abp(net core)+easyui+efcore实现仓储管理系统——入库管理之四(四十)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

  4. abp(net core)+easyui+efcore实现仓储管理系统——入库管理之五(四十一)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

  5. abp(net core)+easyui+efcore实现仓储管理系统——入库管理之六(四十二)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

  6. abp(net core)+easyui+efcore实现仓储管理系统——入库管理之七(四十三)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

  7. abp(net core)+easyui+efcore实现仓储管理系统——入库管理之八(四十四)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

  8. abp(net core)+easyui+efcore实现仓储管理系统——入库管理之十(四十六)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

  9. abp(net core)+easyui+efcore实现仓储管理系统——入库管理之十一(四十七)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

随机推荐

  1. 【2】从零认识中心极限思想-e往无尽

    目录 e往无尽 单调性.有界性 \(e^{-x^2}\)的积分性质 函数列的近似 傅里叶的方案 三角函数系的正交性 傅立叶展开 傅立叶展开式的指数形式 e往无尽 无论是学高数,还是学习数分,我们在讲到 ...

  2. ionic 创建服务命令

    创建Util工具库 ionic g provider Util

  3. Serverless 基本概念入门

    从行业趋势看,Serverless 是云计算必经的一场革命 2019 年,Serverless 被 Gartner 称为最有潜力的云计算技术发展方向,并被赋予是必然性的发展趋势.Serverless ...

  4. springboot支付项目之springboot集成jpa

    springboot集成spring-jpa 本文主要内容: 1:spring boot怎么集成spring-jpa以及第一个jpa查询示例 如jpa几个常用注解.lombok注解使用 2:怎么设置i ...

  5. <c:if >标签的坑!!

    <c:if test="${trans.Transition}"> <input id="${trans.nextnode}" type=&q ...

  6. 吴裕雄--天生自然python学习笔记:python文档操作插入图片

    向 Word 文件中插入图片 向 Word 文件插入图片的语法为: 例如,在 cl ip graph.docx 文件的第 4 段插入 ce ll.jpg 图片,井将图片文件保存于 Word 文件内: ...

  7. 树形dp(最小支配集)

    http://poj.org/problem?id=3659 #include<iostream> #include<cstring> #include<algorith ...

  8. python后端面试第二部分:网络编程和并发编程--长期维护

    1. 简述 OSI 七层协议. 2. 什么是C/S和B/S架构? 3. 简述 三次握手.四次挥手的流程. 4. 什么是arp协议? 5. TCP和UDP的区别? 6. 什么是局域网和广域网? 7. 为 ...

  9. 图表|Line graphs|Bar graphs|Pie graphs|Scatter graphs|标目|标值|图解|图题|标值|

    科研论文写作-图表 图像的特点是直观性高效,可用于描述非线性关系,将文字难以描述的内容表达出来. Line graphs中有自变量和因变量,用于表示变化趋势.为了清晰简洁和易于辨认,所以其中的线条最好 ...

  10. perf4j+logback配置 非spring 可使用注解

    最近项目打算使用perf4j进行性能监控,由于项目没有使用spring,而又不想对代码入侵过高,打算使用注解的方式进行接入.perf4j采用AspectJ库实现AOP. 具体接入方法如下: logba ...