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

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

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

一.前言

出库单的功能。能学习了出库单管理之后,WMS的 最基本的功能算是完成了。当然一个成熟的WMS还包括了盘点,报表,策略规则,移库功能及与其他系统(ERP、TMS等)的接口,实现无缝集成,打破信息孤岛,让数据实时、准确和同步。

二、出库单的流程

1.一般情况下会有一个前置的OMS系统——即订单管理系统。主要功能之一是由客户填写订单。

2.客户把订单下第三方物流公司时,第三方物流公司会生成出货单推送到仓库时,系统会自动生成拣货单,理货员根据拣货单拣货,并制作出库单,然后打印标签,粘贴条码标签,分配托盘,核验条码标签,货物装箱,订舱出库,并在系统中对出库单进行审核通过。整个流程如下图。

当然我们接下来要实现的出库单功能,没有这么复杂。

三、创建出库单实体

1. 做为一个出库单,在数据库中一般存在两张表,表头OutStockOrder,表体OutStockDetail

2.在Visual Studio 2017的“解决方案资源管理器”中,右键单击“ABP.TPLMS.Core”项目的“Entitys”文件夹,在弹出菜单中选择“添加” >

> “类”。 将类命名为 OutStockOrder,然后选择“添加”。

3.创建OutStockOrder类继承自Entity<int>,通过实现审计模块中的IHasCreationTime来实现保存创建时间。代码如下:

  1. using Abp.Domain.Entities;
  2. using Abp.Domain.Entities.Auditing;
  3.  
  4. using System;
  5. using System.Collections.Generic;
  6. using System.ComponentModel.DataAnnotations;
  7. using System.Text;
  8.  
  9. namespace ABP.TPLMS.Entitys
  10. {
  11.  
  12. public class OutStockOrder: Entity<int>, IHasCreationTime
  13. {
  14.  
  15. public const int MaxLength = ;
  16. public OutStockOrder()
  17. {
  18.  
  19. No = string.Empty;
  20. CustomerCode = string.Empty;
  21. CustomerName = string.Empty;
  22. WarehouseNo = string.Empty;
  23.  
  24. DeliveryNo = string.Empty;
  25. TallyClerk = string.Empty;
  26. TallyTime = string.Empty;
  27. CreationTime = DateTime.Now;
  28. Oper = string.Empty;
  29. Checker = string.Empty;
  30. CheckTime = string.Empty;
  31. Gwt = ;
  32. Nwt = ;
  33. PackageQty = ;
  34. OwnerCode = string.Empty;
  35. OwnerName = string.Empty;
  36. Remark = string.Empty;
  37. Status = ;
  38. PreOutStockTime = string.Empty;
  39. }
  40.  
  41. [StringLength()]
  42. [Required]
  43. public string No { get; set; }
  44. /// <summary>
  45. /// 客户名称
  46. /// </summary>
  47. [StringLength(MaxLength)]
  48. [Required]
  49. public string CustomerName { get; set; }
  50.  
  51. /// <summary>
  52. /// 车牌号
  53. /// </summary>
  54. public string VehicleNo { get; set; }
  55. /// <summary>
  56. /// 客户代码
  57. /// </summary>
  58. [StringLength()]
  59. [Required]
  60. public string CustomerCode { get; set; }
  61.  
  62. /// <summary>
  63. /// 收货人代码
  64. /// </summary>
  65. public string ConsigneeCode { get; set; }
  66.  
  67. /// <summary>
  68. /// 收货人
  69. /// </summary>
  70. public string Consignee{get ;set;}
  71.  
  72. /// <summary>
  73. /// 收货人社会信用代码
  74. /// </summary>
  75. public string ConsigneeSCCD { get; set; }
  76.  
  77. /// <summary>
  78. /// 托运人,发货人
  79. /// </summary>
  80. public string Shipper { get; set; }
  81.  
  82. /// <summary>
  83. /// 托运人,发货人代码
  84. /// </summary>
  85. public string ShipperCode { get; set; }
  86.  
  87. /// <summary>
  88. /// 托运人,发货人社会信用代码
  89. /// </summary>
  90. public string ShipperSCCD { get; set; }
  91.  
  92. /// <summary>
  93. /// 通知人
  94. /// </summary>
  95. public string Notify { get; set; }
  96.  
  97. /// <summary>
  98. /// 通知人代码
  99. /// </summary>
  100. public string NotifyCode { get; set; }
  101.  
  102. /// <summary>
  103. /// 通知人社会信用代码
  104. /// </summary>
  105. public string NotifySCCD { get; set; }
  106.  
  107. /// <summary>
  108. /// 出货单号
  109. /// </summary>
  110. public string DeliveryNo { get; set; }
  111.  
  112. /// <summary>
  113. /// 仓库号
  114. /// </summary>
  115. public string WarehouseNo { get; set; }
  116.  
  117. /// <summary>
  118. /// 货主
  119. /// </summary>
  120. [StringLength(MaxLength)]
  121. [Required]
  122.  
  123. public string OwnerName { get; set; }
  124.  
  125. public decimal Gwt { get; set; }
  126. public decimal Nwt { get; set; }
  127. public int PackageQty { get; set; }
  128. /// <summary>
  129. /// 理货时间
  130. /// </summary>
  131. [StringLength()]
  132.  
  133. public string TallyTime { get; set; }
  134.  
  135. /// <summary>
  136. /// 理货员
  137. /// </summary>
  138. [StringLength()]
  139. public string TallyClerk { get; set; }
  140.  
  141. [StringLength()]
  142.  
  143. public string Oper { get; set; }
  144. public int Status { get; set; }
  145.  
  146. [StringLength()]
  147.  
  148. public string OwnerCode { get; set; }
  149. /// <summary>
  150. /// 预计出库时间
  151. /// </summary>
  152. [StringLength()]
  153.  
  154. public string PreOutStockTime { get; set; }
  155.  
  156. /// <summary>
  157. /// 审核人
  158. /// </summary>
  159. [StringLength()]
  160.  
  161. public string Checker { get; set; }
  162. [StringLength()]
  163.  
  164. public string CheckTime { get; set; }
  165. [StringLength()]
  166.  
  167. public string Remark { get; set; }
  168. public DateTime CreationTime { get; set; }
  169.  
  170. [StringLength()]
  171. public string LastUpdateTime { get; set; }
  172. [StringLength()]
  173. public string LastOper { get; set; }
  174.  
  175. }
  176. }

4. 重得第2,3步,我们在“ABP.TPLMS.Core”项目的“Entitys”文件夹,创建OutStockOrderDetail类。代码如下:

  1. using Abp.Domain.Entities;
  2. using Abp.Domain.Entities.Auditing;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.ComponentModel.DataAnnotations.Schema;
  7. using System.Text;
  8.  
  9. namespace ABP.TPLMS.Entitys
  10. {
  11.  
  12. public class OutStockOrderDetail : Entity<int>, IHasCreationTime
  13. {
  14.  
  15. public const int MaxLength = ;
  16. public OutStockOrderDetail()
  17. {
  18.  
  19. this.Qty = ;
  20. this.CargoCode = string.Empty;
  21. this.CargoName = string.Empty;
  22. this.Brand = string.Empty;
  23.  
  24. this.Country = string.Empty;
  25. this.CreationTime = DateTime.Now;
  26. this.Curr = string.Empty;
  27.  
  28. this.GrossWt = ;
  29. this.Height = ;
  30. this.HSCode = string.Empty;
  31.  
  32. this.Length = ;
  33. this.SecdLawfQty = ;
  34. this.LawfQty = ;
  35.  
  36. this.NetWt = ;
  37.  
  38. this.Package = string.Empty;
  39. this.Price = ;
  40.  
  41. this.Spcf = string.Empty;
  42.  
  43. this.Unit = string.Empty;
  44. this.InStockNo = string.Empty;
  45. this.LawfUnit = string.Empty;
  46. this.Vol = ;
  47. this.Width = ;
  48.  
  49. this.LawfUnit = string.Empty;
  50. this.SecdLawfUnit = string.Empty;
  51.  
  52. this.Batch = string.Empty;
  53.  
  54. this.InStockOrderDetailId = ;
  55.  
  56. }
  57.  
  58. public int SupplierId { get; set; }
  59.  
  60. [MaxLength()]
  61. public string CargoCode { get; set; }
  62.  
  63. [MaxLength()]
  64. public string HSCode { get; set; }
  65.  
  66. [MaxLength(MaxLength)]
  67. public string CargoName { get; set; }
  68.  
  69. [MaxLength(MaxLength)]
  70. public string Spcf { get; set; }
  71.  
  72. [MaxLength()]
  73. public string Unit { get; set; }
  74.  
  75. /// <summary>
  76. /// 目的国
  77. /// </summary>
  78. [MaxLength()]
  79. public string DestCountry { get; set; }
  80.  
  81. /// <summary>
  82. /// 原产国
  83. /// </summary>
  84.  
  85. [MaxLength()]
  86. public string Country { get; set; }
  87.  
  88. [MaxLength()]
  89.  
  90. public string Brand { get; set; }
  91. [MaxLength()]
  92. public string Curr { get; set; }
  93. [MaxLength()]
  94.  
  95. public string Package { get; set; }
  96. public decimal Length { get; set; }
  97. public decimal Width { get; set; }
  98. public decimal Height { get; set; }
  99. public decimal Vol { get; set; }
  100.  
  101. public decimal Price { get; set; }
  102. public decimal TotalAmt { get; set; }
  103. public decimal GrossWt { get; set; }
  104.  
  105. public decimal NetWt { get; set; }
  106.  
  107. public DateTime CreationTime { get; set; }
  108. [MaxLength()]
  109. public string InStockNo { get; set; }
  110. public int InStockOrderDetailId { get; set; }
  111.  
  112. public decimal Qty { get; set; }
  113. public decimal LawfQty { get; set; }
  114. public decimal SecdLawfQty { get; set; }
  115. [MaxLength()]
  116.  
  117. public string LawfUnit { get; set; }
  118. [MaxLength()]
  119. public string SecdLawfUnit { get; set; }
  120.  
  121. [MaxLength()]
  122.  
  123. public string Batch { get; set; }
  124. public string Loc { get; set; }
  125. }
  126.  
  127. }

5.定义入库单的实体之后,我们去“ABP.TPLMS.EntityFrameworkCore”项目中的“TPLMSDbContext”类中定义实体对应的DbSet,以应用Code First 数据迁移。添加以下代码

  1. using Microsoft.EntityFrameworkCore;
  2. using Abp.Zero.EntityFrameworkCore;
  3. using ABP.TPLMS.Authorization.Roles;
  4. using ABP.TPLMS.Authorization.Users;
  5. using ABP.TPLMS.MultiTenancy;
  6. using ABP.TPLMS.Entitys;
  7.  
  8. namespace ABP.TPLMS.EntityFrameworkCore
  9. {
  10. public class TPLMSDbContext : AbpZeroDbContext<Tenant, Role, User, TPLMSDbContext>
  11. {
  12.  
  13. /* Define a DbSet for each entity of the application */
  14.  
  15. public TPLMSDbContext(DbContextOptions<TPLMSDbContext> options)
  16. : base(options)
  17. {
  18.  
  19. }
  20.  
  21. public DbSet<Module> Modules { get; set; }
  22. public DbSet<Supplier> Suppliers { get; set; }
  23. public DbSet<Cargo> Cargos { get; set; }
  24. public DbSet<Org> Orgs { get; set; }
  25.  
  26. public virtual DbSet<InStockOrder> InStockOrder { get; set; }
  27. public virtual DbSet<InStockOrderDetail> InStockOrderDetail { get; set; }
  28.  
  29. public virtual DbSet<InStockOrderDetailLoc> InStockOrderDetailLoc { get; set; }
  30.  
  31. public virtual DbSet<OutStockOrder> OutStockOrder { get; set; }
  32. public virtual DbSet<OutStockOrderDetail> OutStockOrderDetail { get; set; }
  33.  
  34. }
  35.  
  36. }

6.从菜单中选择“工具->NuGet包管理器器—>程序包管理器控制台”菜单。

7. 在PMC中,默认项目选择EntityframeworkCore对应的项目后。输入以下命令:Add-Migration AddEntityOutStock,创建迁移。如下图。

8. 在上面的命令执行完毕之后,创建成功后,会在Migrations文件夹下创建时间_AddEntityOutStock格式的类文件,这些代码是基于DbContext指定的模型。如下图。

9.在程序包管理器控制台,输入Update-Database,回车执行迁移。执行成功后,如下图。

10. 在SQL Server Management Studio中查看数据库,OutStockOrder、OutStockOrderDetail两张表创建成功。

abp(net core)+easyui+efcore实现仓储管理系统——出库管理之一(四十九)的更多相关文章

  1. abp(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. K - Painful Bases 状压dp

    Painful Bases LightOJ - 1021 这个题目一开始看,感觉有点像数位dp,但是因为是最多有16进制,因为限制了每一个数字都不同最多就有16个数. 所以可以用状压dp,看网上题解是 ...

  2. 网络流二十四题,题解summary

    没有全部写完,有几题以后再补吧. 第一题:最简单的:飞行员配对方案问题 讲讲这个题目为什么可以用网络流? 因为这个题目是要进行两两之间的匹配,这个就可以想到用二分图匹配,二分图匹配又可以用网络流写. ...

  3. 使用 Minikube 安装 Kubernetes

    概述: 单机低配置主机也可以玩转kubernetes集群.该文章是将介绍使用Minikube安装Kubernetes集群(一般用于本地/开发环境). 配置环境: 硬件:CPU 至少2个核心,至少2.5 ...

  4. CSS实现div填充剩余高度

    相信小伙伴们经常会遇到这个问题,我也是填了很多坑,查了很多资料,才解决的,下面我列出2个方法: 我们的需求如图: 1:(这个方法不推荐使用,因为可能会因为设备不同,而出现未知BUG,特别是div出现p ...

  5. CF-612D The Union of k-Segments 差分

    D. The Union of k-Segments 题意 给出n个线段,以及一个数字k,让求出有哪些线段:线段上所有的点至少被覆盖了k次. 思路 假如忽略掉线段的左右端点范围,肯定是使用差分来维护每 ...

  6. PK,FK, UK,DF, CK

    PK 主键 constraint primary key FK 主外键关系 constraint foreign references UK 唯一约束 constraint unique key DF ...

  7. 手把手golang教程【二】——数组与切片

    本文始发于个人公众号:TechFlow,原创不易,求个关注 今天是golang专题的第五篇,这一篇我们将会了解golang中的数组和切片的使用. 数组与切片 golang当中数组和C++中的定义类似, ...

  8. kali2020解决安装pip的问题

    在以前的版本中,我们需要安装pip时,只需要执行下面命令即可安装: apt-get install python-pip 但是在更新到2020.1以后,上面的命令安装会提示无法定位安装包的问题! 解决 ...

  9. 学习笔记:平衡树-splay

    嗯好的今天我们来谈谈cosplay splay是一种操作,是一种调整二叉排序树的操作,但是它并不会时时刻刻保持一个平衡,因为它会根据每一次操作把需要操作的点旋转到根节点上 所谓二叉排序树,就是满足对树 ...

  10. JavaScript和TypeScript的区别和联系

    转载自:http://web.jobbole.com/93618/?utm_source=group.jobbole.com&utm_medium=relatedArticles JavaSc ...