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来实现保存创建时间。代码如下:

using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing; using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text; namespace ABP.TPLMS.Entitys
{ public class OutStockOrder: Entity<int>, IHasCreationTime
{ public const int MaxLength = ;
public OutStockOrder()
{ No = string.Empty;
CustomerCode = string.Empty;
CustomerName = string.Empty;
WarehouseNo = string.Empty; DeliveryNo = string.Empty;
TallyClerk = string.Empty;
TallyTime = string.Empty;
CreationTime = DateTime.Now;
Oper = string.Empty;
Checker = string.Empty;
CheckTime = string.Empty;
Gwt = ;
Nwt = ;
PackageQty = ;
OwnerCode = string.Empty;
OwnerName = string.Empty;
Remark = string.Empty;
Status = ;
PreOutStockTime = string.Empty;
} [StringLength()]
[Required]
public string No { get; set; }
/// <summary>
/// 客户名称
/// </summary>
[StringLength(MaxLength)]
[Required]
public string CustomerName { get; set; } /// <summary>
/// 车牌号
/// </summary>
public string VehicleNo { get; set; }
/// <summary>
/// 客户代码
/// </summary>
[StringLength()]
[Required]
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)]
[Required] public string OwnerName { get; set; } public decimal Gwt { get; set; }
public decimal Nwt { get; set; }
public int PackageQty { get; set; }
/// <summary>
/// 理货时间
/// </summary>
[StringLength()] public string TallyTime { get; set; } /// <summary>
/// 理货员
/// </summary>
[StringLength()]
public string TallyClerk { get; set; } [StringLength()] public string Oper { get; set; }
public int Status { get; set; } [StringLength()] public string OwnerCode { get; set; }
/// <summary>
/// 预计出库时间
/// </summary>
[StringLength()] public string PreOutStockTime { get; set; } /// <summary>
/// 审核人
/// </summary>
[StringLength()] public string Checker { get; set; }
[StringLength()] public string CheckTime { get; set; }
[StringLength()] public string Remark { get; set; }
public DateTime CreationTime { get; set; } [StringLength()]
public string LastUpdateTime { get; set; }
[StringLength()]
public string LastOper { get; set; } }
}

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

using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text; namespace ABP.TPLMS.Entitys
{ public class OutStockOrderDetail : Entity<int>, IHasCreationTime
{ public const int MaxLength = ;
public OutStockOrderDetail()
{ this.Qty = ;
this.CargoCode = string.Empty;
this.CargoName = string.Empty;
this.Brand = string.Empty; this.Country = string.Empty;
this.CreationTime = DateTime.Now;
this.Curr = string.Empty; this.GrossWt = ;
this.Height = ;
this.HSCode = string.Empty; this.Length = ;
this.SecdLawfQty = ;
this.LawfQty = ; this.NetWt = ; this.Package = string.Empty;
this.Price = ; this.Spcf = string.Empty; this.Unit = string.Empty;
this.InStockNo = string.Empty;
this.LawfUnit = string.Empty;
this.Vol = ;
this.Width = ; this.LawfUnit = string.Empty;
this.SecdLawfUnit = string.Empty; this.Batch = string.Empty; this.InStockOrderDetailId = ; } public int SupplierId { get; set; } [MaxLength()]
public string CargoCode { get; set; } [MaxLength()]
public string HSCode { get; set; } [MaxLength(MaxLength)]
public string CargoName { get; set; } [MaxLength(MaxLength)]
public string Spcf { get; set; } [MaxLength()]
public string Unit { get; set; } /// <summary>
/// 目的国
/// </summary>
[MaxLength()]
public string DestCountry { get; set; } /// <summary>
/// 原产国
/// </summary> [MaxLength()]
public string Country { get; set; } [MaxLength()] public string Brand { get; set; }
[MaxLength()]
public string Curr { get; set; }
[MaxLength()] 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()]
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()] public string LawfUnit { get; set; }
[MaxLength()]
public string SecdLawfUnit { get; set; } [MaxLength()] public string Batch { get; set; }
public string Loc { get; set; }
} }

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

using Microsoft.EntityFrameworkCore;
using Abp.Zero.EntityFrameworkCore;
using ABP.TPLMS.Authorization.Roles;
using ABP.TPLMS.Authorization.Users;
using ABP.TPLMS.MultiTenancy;
using ABP.TPLMS.Entitys; namespace ABP.TPLMS.EntityFrameworkCore
{
public class TPLMSDbContext : AbpZeroDbContext<Tenant, Role, User, TPLMSDbContext>
{ /* Define a DbSet for each entity of the application */ public TPLMSDbContext(DbContextOptions<TPLMSDbContext> options)
: base(options)
{ } public DbSet<Module> Modules { get; set; }
public DbSet<Supplier> Suppliers { get; set; }
public DbSet<Cargo> Cargos { get; set; }
public DbSet<Org> Orgs { get; set; } public virtual DbSet<InStockOrder> InStockOrder { get; set; }
public virtual DbSet<InStockOrderDetail> InStockOrderDetail { get; set; } public virtual DbSet<InStockOrderDetailLoc> InStockOrderDetailLoc { get; set; } public virtual DbSet<OutStockOrder> OutStockOrder { get; set; }
public virtual DbSet<OutStockOrderDetail> OutStockOrderDetail { get; set; } } }

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. <学习笔记 之 JQuery 基础语法>

    jQuery 库 - 特性 jQuery 是一个 JavaScript 函数库. jQuery 库包含以下特性: HTML 元素选取 HTML 元素操作 CSS 操作 HTML 事件函数 JavaSc ...

  2. Azure AD(一)入门认识

    一,引言(吹水) 距离上一次介绍Azure Functions的相关博文以及过期快一个月了,本来早早都想好已经规划好的Azure的相关的学习的路线,无奈还是由于自己文笔不好以及自身太懒,导致博文没有更 ...

  3. Phoenix and Distribution(字典序贪心)

    \(给定一串字母,分成k份,使得最大字典序最小.(字母可以任意组合)\) \(------------------------------issue~------------------------\ ...

  4. B. Heaters 思维题 贪心 区间覆盖

    B. Heaters 这个题目虽然只有1500的分数,但是我还是感觉挺思维的,我今天没有写出来,然后看了一下题解 很少做这种区间覆盖的题目,也不是很擅长,接下来讲讲我看完题解后的思路. 题目大意是:给 ...

  5. GoF23:设计模式概述

    目录 学习设计模式的意义 GoF23 创建型模式(5种) 结构型模式(7种) 行为型模式(11种) OOP七大原则 开闭原则(总的纲领) 里氏替换原则 依赖倒置原则 单一职责原则 接口隔离原则 迪米特 ...

  6. CC2530通用IO口的输入输出

    一.引脚概述 CC2530有40 个引脚.其中,有21个数字I/O端口,其中P0和P1是8 位端口,P2仅有5位可以使用.P2端口的5个引脚中,有2个需要用作仿真,有2个需要用作晶振.所以可供我们使用 ...

  7. vue-cli3.0读取外部化配置文件来修改公共路径

    之前我写过一篇通过nginx配置代理转发的博客,正常来说也是正确的,但不足之处在了甲方还用了F5负载均衡和gateway来代理转发.所以之前我认为的请求->nginx转发代理->后端服务, ...

  8. qgis控制滚轮转动地图比例尺的变化幅度

    需求:在比例尺1万-10万之间,鼠标滚轮转动比例尺的变化幅度为1万重写滚轮事件 void Xx::wheelEvent(QWheelEvent*event){ double curScale = sc ...

  9. Spring Boot 入门(十三):集成Hasor的Dataway模块,干掉后台,自动配置接口

    终于出湖北了,封闭2个月,家里没电脑,感觉好久没自主撸代码啊啊啊啊啊啊啊啊啊啊啊啊啊. 连接上篇文章Spring Boot 入门(十二):报表导出,对比poi.jxl和esayExcel的效率,继续从 ...

  10. (电脑连不上热点)电脑连上了WIFI,但是显示网络不可用怎么办?

    假如WIFI没有问题的话,那这个就是电脑网络堵塞的问题了,下面是解决的办法: 情况一 1.首先win键+R打开运行框,输入cmd 2.然后在命令行输入 ipconfig -release ipconf ...