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; }
}
}
abp(net core)+easyui+efcore实现仓储管理系统——出库管理之二(五十)的更多相关文章
- abp(net core)+easyui+efcore实现仓储管理系统——出库管理之三(五十一)
abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统--ABP总体介绍(一) abp(net core)+ ...
- abp(net core)+easyui+efcore实现仓储管理系统——出库管理之三(五十二)
abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统--ABP总体介绍(一) abp(net core)+ ...
- abp(net core)+easyui+efcore实现仓储管理系统——出库管理之四(五十三)
abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统--ABP总体介绍(一) abp(net core)+ ...
- abp(net core)+easyui+efcore实现仓储管理系统——出库管理之五(五十四)
abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统--ABP总体介绍(一) abp(net core)+ ...
- abp(net core)+easyui+efcore实现仓储管理系统——出库管理之六(五十五)
abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统--ABP总体介绍(一) abp(net core)+ ...
- Abp(net core)+easyui+efcore实现仓储管理系统——出库管理之七(五十六)
abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统--ABP总体介绍(一) abp(net core)+ ...
- Abp(net core)+easyui+efcore实现仓储管理系统——出库管理之八(五十七)
abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统--ABP总体介绍(一) abp(net core)+ ...
- abp(net core)+easyui+efcore实现仓储管理系统——出库管理之一(四十九)
abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...
- abp(net core)+easyui+efcore实现仓储管理系统——入库管理之九(四十五)
abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...
随机推荐
- Linux常用命令--不断更新
Linux命令: !. 1.[root@loc8lhost/root]# 表示登陆进去系统,其中#是超级⽤用户也即root⽤用 户的系统提示符 #. 2.reboot命令可以重启系统 $. 3.关闭系 ...
- UNITY3D UGUI学习--canvas
首先从canvas的参数说起走. Canvas Component是UI布局和渲染的抽象空间,所有的UI元素都必须在此组件之下. Render Mode UI的渲染方式,有三种: Screen Spa ...
- 用IDEA一年了,终于敢说自己会用了
作为Java老兵,我也是用了很多年的eclipse,为了与时俱进,于是切换到了IDEA.刚开始的时候感觉很不适应,感觉这玩意儿不如eclipse好用,影响工作效率,于是又换回eclipse. 但是很多 ...
- TDengine能比Hadoop快10倍?
之前对国产的时序大数据存储引擎 TDengine 感兴趣,因为号称比Hadoop快十倍,一直很好奇怎么实现的,所以最近抽空看了下白皮书和设计文档. 如果用一句话总结,就是 TDengine 是为特定的 ...
- Java的字符串操作
目录 Java的字符串操作 一.不同字符串操作的对比 1.1 C++中const修饰指针 const在星号的左边,是被指向的常量不可变 const在星号的右边,是指针的指向不可变 二. Java字符串 ...
- vue 多代理
多代理就要建立多个axios实例对象 vueconfig devServer: { open: true, host: "localhost", // host: "10 ...
- 8成以上的java线程状态图都画错了,看看这个-图解java并发第二篇
本文作为图解java并发编程的第二篇,前一篇访问地址如下所示: 图解进程线程.互斥锁与信号量-看完还不懂你来打我 图形说明 在开始想写这篇文章之前,我去网上搜索了很多关于线程状态转换的图,我惊讶的发现 ...
- OneDrive 折腾记
起因 百度云的一系列劝退操作 OneDrive 5T 有点香 OneDrive 介绍 OneDrive有两种, 个人版 OneDrive 和 教育企业版 OneDrive for Business 个 ...
- PHP对象传值 - 引用传值
对象传值本质上是引用传值,将一个对象变量($a)赋值给另个变量($b),实际上是将$a存储的对象内存引用地址赋值$b,此时两个变量指向的就是一个对象.其中一个变量发送改变,另一个也会跟着改变.和引用变 ...
- Tomcat 第一篇:源码导入 IDEA 编辑器
1 引言 做 Java 的同学应该都见过上面这只名字叫 Tomcat 的猫,毕竟这只猫在过去和现在都是全球最流行的 Web 容器之一. 很有意思的一件事儿是从我接触这只猫开始,从来不知道它的中文名字是 ...