diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNCreateOrUpdateDTOBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNCreateOrUpdateDTOBase.cs index eb09dc9..b397cc8 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNCreateOrUpdateDTOBase.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNCreateOrUpdateDTOBase.cs @@ -1,10 +1,106 @@ using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; namespace Win_in.Sfs.Scp.WebApi.ASNs { + /// + /// 发货单创建更新基础Dto + /// public abstract class ASNCreateOrUpdateDTOBase : EntityDto { + /// + /// 发货单号(ASN Number) + /// + [Display(Name = "发货单号(AsnNumber)")] + public string AsnNumber { set; get; } + /// + /// 要货计划单号(Request Plan Number) + /// + [Display(Name = "要货计划单号(RpNumber)")] + public string RpNumber { set; get; } + + /// + /// 订单号(Purchase order number) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { set; get; } + + /// + /// 供应商代码(Supplier code) + /// + [Display(Name = "供应商代码(SupplierCode)")] + public string SupplierCode { set; get; } + + /// + /// 状态(Status) + /// + [Display(Name = "状态(Status)")] + public int Status { set; get; } + + /// + /// 联系人(Contact person) + /// + [Display(Name = "联系人(ContactName)")] + public string ContactName { set; get; } + + /// + /// 联系电话(Contact phone) + /// + [Display(Name = "联系电话(ContactPhone)")] + public string ContactPhone { set; get; } + + /// + /// 版本(Car Number) + /// + [Display(Name = "车牌号(CarNumber)")] + public string CarNumber { set; get; } + + /// + /// 仓库(Warehouse code) + /// + [Display(Name = "仓库(Warehouse)")] + public decimal Warehouse { set; get; } + + /// + /// 收货口(Warehouse Dock) + /// + [Display(Name = "收货口(WarehouseDock)")] + public string WarehouseDock { set; get; } + + /// + /// 时间窗口开始(Time window Begin) + /// + [Display(Name = "时间窗口开始(TimeWindowBegin)")] + public DateTime TimeWindowBegin { set; get; } + + /// + /// 时间窗口结束(Time window End) + /// + [Display(Name = "时间窗口结束(TimeWIndowEnd)")] + public DateTime TimeWIndowEnd { set; get; } + + /// + /// 地点(Site) + /// + [Display(Name = "地点(Site)")] + public string Site { set; get; } + + /// + /// 公司(IAC company code) + /// + [Display(Name = "公司(Comapnay)")] + public string Comapnay { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + + + public virtual ICollection ASNDetails { get; set; } } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNDTO.cs index ab2ba8e..9c09280 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNDTO.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNDTO.cs @@ -1,10 +1,106 @@ using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; namespace Win_in.Sfs.Scp.WebApi.ASNs { + /// + /// 发货单主表DTO + /// public class ASNDTO : AuditedEntityDto { + /// + /// 发货单号(ASN Number) + /// + [Display(Name = "发货单号(AsnNumber)")] + public string AsnNumber { set; get; } + /// + /// 要货计划单号(Request Plan Number) + /// + [Display(Name = "要货计划单号(RpNumber)")] + public string RpNumber { set; get; } + + /// + /// 订单号(Purchase order number) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { set; get; } + + /// + /// 供应商代码(Supplier code) + /// + [Display(Name = "供应商代码(SupplierCode)")] + public string SupplierCode { set; get; } + + /// + /// 状态(Status) + /// + [Display(Name = "状态(Status)")] + public int Status { set; get; } + + /// + /// 联系人(Contact person) + /// + [Display(Name = "联系人(ContactName)")] + public string ContactName { set; get; } + + /// + /// 联系电话(Contact phone) + /// + [Display(Name = "联系电话(ContactPhone)")] + public string ContactPhone { set; get; } + + /// + /// 版本(Car Number) + /// + [Display(Name = "车牌号(CarNumber)")] + public string CarNumber { set; get; } + + /// + /// 仓库(Warehouse code) + /// + [Display(Name = "仓库(Warehouse)")] + public decimal Warehouse { set; get; } + + /// + /// 收货口(Warehouse Dock) + /// + [Display(Name = "收货口(WarehouseDock)")] + public string WarehouseDock { set; get; } + + /// + /// 时间窗口开始(Time window Begin) + /// + [Display(Name = "时间窗口开始(TimeWindowBegin)")] + public DateTime TimeWindowBegin { set; get; } + + /// + /// 时间窗口结束(Time window End) + /// + [Display(Name = "时间窗口结束(TimeWIndowEnd)")] + public DateTime TimeWIndowEnd { set; get; } + + /// + /// 地点(Site) + /// + [Display(Name = "地点(Site)")] + public string Site { set; get; } + + /// + /// 公司(IAC company code) + /// + [Display(Name = "公司(Comapnay)")] + public string Comapnay { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + + + public virtual ICollection ASNDetails { get; set; } } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNDetailsDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNDetailsDTO.cs new file mode 100644 index 0000000..4478d8f --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNDetailsDTO.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; + +namespace Win_in.Sfs.Scp.WebApi.ASNs +{ + /// + /// 发货单明细表DTO + /// + public class ASNDetailsDTO : AuditedEntityDto + { + /// + /// 发货单号(ASN Number) + /// + [Display(Name = "发货单号(AsnNumber)")] + public string AsnNumber { set; get; } + + /// + /// 订单号(Purchase order number) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { set; get; } + + /// + /// 订单行(Purchase order Line) + /// + [Display(Name = "订单行(PoLine)")] + public string PoLine { set; get; } + + /// + /// 零件号(PartCode) + /// + [Display(Name = "零件号(PartCode)")] + public string PartCode { set; get; } + + /// + /// 批次(Lot number) + /// + [Display(Name = "批次(Lot)")] + public string Lot { set; get; } + + /// + /// 供应商批次(Supplier Lot) + /// + [Display(Name = "供应商批次(Supplierlot)")] + public string Supplierlot { set; get; } + + /// + /// 生产日期(Produce Date) + /// + [Display(Name = "生产日期(ProduceDate)")] + public DateTime ProduceDate { set; get; } + + /// + /// 计量单位(Unit of measure) + /// + [Display(Name = "计量单位(Uom)")] + public string Uom { set; get; } + + /// + /// 发货数量(Delivery quantity) + /// + [Display(Name = "发货数量(DeliverQty)")] + public decimal DeliverQty { set; get; } + + /// + /// 标包计量单位(standard package um) + /// + [Display(Name = "标包计量单位(StdPackUom)")] + public string StdPackUom { set; get; } + + /// + /// 标包数量(standard package quantiy) + /// + [Display(Name = "标包数量(StdPackQty)")] + public decimal StdPackQty { set; get; } + + /// + /// 供应商计量单位(Supplier UM) + /// + [Display(Name = "供应商计量单位(SupplierPackUom)")] + public string SupplierPackUom { set; get; } + + /// + /// 供应商包装数量(Supplier package UM) + /// + [Display(Name = "供应商包装数量(SupplierPackQty)")] + public decimal SupplierPackQty { set; get; } + + /// + /// 供应商包装转换率(UM conversion) + /// + [Display(Name = "供应商包装转换率(SupplierPackConvertRate)")] + public decimal SupplierPackConvertRate { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelCreateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelCreateDTO.cs new file mode 100644 index 0000000..d668dc2 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelCreateDTO.cs @@ -0,0 +1,7 @@ +namespace Win_in.Sfs.Scp.WebApi.ASNs +{ + public class ASNLabelCreateDTO : ASNLabelCreateOrUpdateDTOBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelCreateOrUpdateDTOBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelCreateOrUpdateDTOBase.cs new file mode 100644 index 0000000..43c7b0b --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelCreateOrUpdateDTOBase.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; + +namespace Win_in.Sfs.Scp.WebApi.ASNs +{ + /// + /// 发货单标签表创建更新基础Dto + /// + public abstract class ASNLabelCreateOrUpdateDTOBase : EntityDto + { + /// + /// 标签代码(Label code) + /// + [Display(Name = "标签代码(LabelCode)")] + public string LabelCode { get; set; } + + /// + /// 完整条码数据(Barcode barcode) + /// + [Display(Name = "完整条码数据(Barcode)")] + public string Barcode { get; set; } + + /// + /// 零件号(Part code) + /// + [Display(Name = "零件号(PartCode)")] + public string PartCode { get; set; } + + /// + /// 零件名称(Part Name) + /// + [Display(Name = "零件名称(PartName)")] + public string PartName { get; set; } + + /// + /// 零件描述(Part desc) + /// + [Display(Name = "零件描述(PartDesc)")] + public string PartDesc { get; set; } + + /// + /// 批次(Lot number) + /// + [Display(Name = "批次(Lot)")] + public bool Lot { get; set; } + + /// + /// 计量单位(UM) + /// + [Display(Name = "计量单位(Uom)")] + public bool Uom { get; set; } + + /// + /// 数量(Label quantity) + /// + [Display(Name = "数量(Qty)")] + public decimal Qty { get; set; } + + /// + /// 标包计量单位(Package UM) + /// + [Display(Name = "标包计量单位(StdPackUom)")] + public string StdPackUom { get; set; } + + /// + /// 标包数量(Package quantity) + /// + [Display(Name = "标包数量(StdPackQty)")] + public decimal StdPackQty { get; set; } + + /// + /// 供应商代码(Supplier Code) + /// + [Display(Name = "供应商代码(SupplierCode)")] + public string SupplierCode { get; set; } + + /// + /// 供应商名称(Supplier Name) + /// + [Display(Name = "供应商名称(SupplierName)")] + public string SupplierName { get; set; } + + /// + /// 订单号(Purchase order number) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { get; set; } + + /// + /// 订单行(Purchase order Line) + /// + [Display(Name = "订单行(PoLine)")] + public string PoLine { get; set; } + + /// + /// 发货单号(ASN Number) + /// + [Display(Name = "发货单号(AsnNumber)")] + public string AsnNumber { get; set; } + + /// + /// 要货计划单号(Plan number) + /// + [Display(Name = "要货计划单号(RpNumber)")] + public string RpNumber { get; set; } + + /// + /// 供应商批次(Supplier Lot) + /// + [Display(Name = "供应商批次(SupplierLot)")] + public string SupplierLot { get; set; } + + /// + /// 生产日期(Produce Date) + /// + [Display(Name = "生产日期(ProduceDate)")] + public DateTime ProduceDate { get; set; } + + /// + /// 托标签号(Pallet label number) + /// + [Display(Name = "托标签号(PalletLabelnumber)")] + public decimal PalletLabelnumber { get; set; } + + /// + /// 地点(site) + /// + [Display(Name = "地点(Site)")] + public string Site { get; set; } + + /// + /// 公司(IAC company code) + /// + [Display(Name = "公司(Company)")] + public decimal Company { get; set; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { get; set; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelDTO.cs new file mode 100644 index 0000000..8a72338 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelDTO.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; + +namespace Win_in.Sfs.Scp.WebApi.ASNs +{ + /// + /// 发货单标签表DTO + /// + public class ASNLabelDTO : AuditedEntityDto + { + /// + /// 标签代码(Label code) + /// + [Display(Name = "标签代码(LabelCode)")] + public string LabelCode { get; set; } + + /// + /// 完整条码数据(Barcode barcode) + /// + [Display(Name = "完整条码数据(Barcode)")] + public string Barcode { get; set; } + + /// + /// 零件号(Part code) + /// + [Display(Name = "零件号(PartCode)")] + public string PartCode { get; set; } + + /// + /// 零件名称(Part Name) + /// + [Display(Name = "零件名称(PartName)")] + public string PartName { get; set; } + + /// + /// 零件描述(Part desc) + /// + [Display(Name = "零件描述(PartDesc)")] + public string PartDesc { get; set; } + + /// + /// 批次(Lot number) + /// + [Display(Name = "批次(Lot)")] + public bool Lot { get; set; } + + /// + /// 计量单位(UM) + /// + [Display(Name = "计量单位(Uom)")] + public bool Uom { get; set; } + + /// + /// 数量(Label quantity) + /// + [Display(Name = "数量(Qty)")] + public decimal Qty { get; set; } + + /// + /// 标包计量单位(Package UM) + /// + [Display(Name = "标包计量单位(StdPackUom)")] + public string StdPackUom { get; set; } + + /// + /// 标包数量(Package quantity) + /// + [Display(Name = "标包数量(StdPackQty)")] + public decimal StdPackQty { get; set; } + + /// + /// 供应商代码(Supplier Code) + /// + [Display(Name = "供应商代码(SupplierCode)")] + public string SupplierCode { get; set; } + + /// + /// 供应商名称(Supplier Name) + /// + [Display(Name = "供应商名称(SupplierName)")] + public string SupplierName { get; set; } + + /// + /// 订单号(Purchase order number) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { get; set; } + + /// + /// 订单行(Purchase order Line) + /// + [Display(Name = "订单行(PoLine)")] + public string PoLine { get; set; } + + /// + /// 发货单号(ASN Number) + /// + [Display(Name = "发货单号(AsnNumber)")] + public string AsnNumber { get; set; } + + /// + /// 要货计划单号(Plan number) + /// + [Display(Name = "要货计划单号(RpNumber)")] + public string RpNumber { get; set; } + + /// + /// 供应商批次(Supplier Lot) + /// + [Display(Name = "供应商批次(SupplierLot)")] + public string SupplierLot { get; set; } + + /// + /// 生产日期(Produce Date) + /// + [Display(Name = "生产日期(ProduceDate)")] + public DateTime ProduceDate { get; set; } + + /// + /// 托标签号(Pallet label number) + /// + [Display(Name = "托标签号(PalletLabelnumber)")] + public decimal PalletLabelnumber { get; set; } + + /// + /// 地点(site) + /// + [Display(Name = "地点(Site)")] + public string Site { get; set; } + + /// + /// 公司(IAC company code) + /// + [Display(Name = "公司(Company)")] + public decimal Company { get; set; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { get; set; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelUpdateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelUpdateDTO.cs new file mode 100644 index 0000000..6f1bd41 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelUpdateDTO.cs @@ -0,0 +1,7 @@ +namespace Win_in.Sfs.Scp.WebApi.ASNs +{ + public class ASNLabelUpdateDTO : ASNLabelCreateOrUpdateDTOBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/IASNLabelAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/IASNLabelAppService.cs new file mode 100644 index 0000000..882a667 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/IASNLabelAppService.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Application.Services; + +namespace Win_in.Sfs.Scp.WebApi.ASNs +{ + public interface IASNLabelAppService:ICrudAppService + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNAppService.cs index 3d81d94..f5b9bdd 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNAppService.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNAppService.cs @@ -1,11 +1,19 @@ -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using System; using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Domain.Repositories; namespace Win_in.Sfs.Scp.WebApi.ASNs { + /// + /// 发货单服务 + /// + [AllowAnonymous] + [Route("api/SCP/ASN")] + [ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)] public class ASNAppService:CrudAppService, IASNAppService { private readonly IASNRepository _asnRepository; @@ -15,15 +23,64 @@ namespace Win_in.Sfs.Scp.WebApi.ASNs _asnRepository = repository; } + /// + ///获取一条数据 (Get a piece of data) + /// + /// + /// + [HttpGet] + [Route("{id}")] + public override Task GetAsync(Guid id) + { + return base.GetAsync(id); + } + + + /// + ///获取数据列表 (Get data list) + /// + /// + /// + [HttpGet] + [Route("")] + public override Task> GetListAsync(InputDTO input) + { + return base.GetListAsync(input); + } + + /// /// 新增实体 (Create New entity) /// - /// /// [HttpPost] + [Route("")] public override Task CreateAsync(ASNCreateDTO input) { return base.CreateAsync(input); } + + /// + /// 修改实体 (Modify entity) + /// + /// + [HttpPut] + [Route("{id}")] + public override Task UpdateAsync(Guid id, ASNUpdateDTO input) + { + return base.UpdateAsync(id, input); + } + + /// + /// 删除实体 (Delete entity) + /// + /// ID + /// + [HttpDelete] + [Route("{id}")] + public override Task DeleteAsync(Guid id) + { + return base.DeleteAsync(id); + } } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNLabelAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNLabelAppService.cs new file mode 100644 index 0000000..ae080ff --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNLabelAppService.cs @@ -0,0 +1,88 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Repositories; +using Win_in.Sfs.Scp.WebApi.ASNs; + +namespace Win_in.Sfs.Scp.WebApi.ASNs +{ + /// + ///零件服务 + /// + [AllowAnonymous] + [Route("api/SCP/ASNLabel")] + [ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)] + + public class ASNLabelAppService : CrudAppService, IASNLabelAppService + { + private readonly IASNLabelRepository _partRepository; + + public ASNLabelAppService(IASNLabelRepository repository) : base(repository) + { + _partRepository = repository; + } + + /// + ///获取一条数据 (Get a piece of data) + /// + /// + /// + [HttpGet] + [Route("{id}")] + public override Task GetAsync(Guid id) + { + return base.GetAsync(id); + } + + + /// + ///获取数据列表 (Get data list) + /// + /// + /// + [HttpGet] + [Route("")] + public override Task> GetListAsync(InputDTO input) + { + return base.GetListAsync(input); + } + + /// + /// 新增实体 (Create New entity) + /// + /// + [HttpPost] + [Route("")] + public override Task CreateAsync(ASNLabelCreateDTO input) + { + return base.CreateAsync(input); + } + + /// + /// 修改实体 (Modify entity) + /// + /// + [HttpPut] + [Route("{id}")] + public override Task UpdateAsync(Guid id, ASNLabelUpdateDTO input) + { + return base.UpdateAsync(id, input); + } + + /// + /// 删除实体 (Delete entity) + /// + /// ID + /// + [HttpDelete] + [Route("{id}")] + public override Task DeleteAsync(Guid id) + { + return base.DeleteAsync(id); + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj index 06b4093..0c12590 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj @@ -20,7 +20,6 @@ - diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASN.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASN.cs index bc43095..05b0cb0 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASN.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASN.cs @@ -1,10 +1,176 @@ using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Volo.Abp; using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.Guids; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; namespace Win_in.Sfs.Scp.WebApi { - public class ASN:AuditedAggregateRoot + /// + /// 发货单主表 + /// + public class ASN: EntityBase { - + /// + /// 发货单号(ASN Number) + /// + [Display(Name = "发货单号(AsnNumber)")] + public string AsnNumber { set; get; } + + /// + /// 要货计划单号(Request Plan Number) + /// + [Display(Name = "要货计划单号(RpNumber)")] + public string RpNumber { set; get; } + + /// + /// 订单号(Purchase order number) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { set; get; } + + /// + /// 供应商代码(Supplier code) + /// + [Display(Name = "供应商代码(SupplierCode)")] + public string SupplierCode { set; get; } + + /// + /// 状态(Status) + /// + [Display(Name = "状态(Status)")] + public int Status { set; get; } + + /// + /// 联系人(Contact person) + /// + [Display(Name = "联系人(ContactName)")] + public string ContactName { set; get; } + + /// + /// 联系电话(Contact phone) + /// + [Display(Name = "联系电话(ContactPhone)")] + public string ContactPhone { set; get; } + + /// + /// 版本(Car Number) + /// + [Display(Name = "车牌号(CarNumber)")] + public string CarNumber { set; get; } + + /// + /// 仓库(Warehouse code) + /// + [Display(Name = "仓库(Warehouse)")] + public decimal Warehouse { set; get; } + + /// + /// 收货口(Warehouse Dock) + /// + [Display(Name = "收货口(WarehouseDock)")] + public string WarehouseDock { set; get; } + + /// + /// 时间窗口开始(Time window Begin) + /// + [Display(Name = "时间窗口开始(TimeWindowBegin)")] + public DateTime TimeWindowBegin { set; get; } + + /// + /// 时间窗口结束(Time window End) + /// + [Display(Name = "时间窗口结束(TimeWIndowEnd)")] + public DateTime TimeWIndowEnd { set; get; } + + /// + /// 地点(Site) + /// + [Display(Name = "地点(Site)")] + public string Site { set; get; } + + /// + /// 公司(IAC company code) + /// + [Display(Name = "公司(Comapnay)")] + public string Comapnay { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + + + public virtual List ASNDetails { get; set; } + + + + #region details handler + public virtual void AddDetail(IGuidGenerator guidGenerator, ASNDetail detail) + { + Check.NotNull(guidGenerator, nameof(guidGenerator)); + Check.NotNull(detail, nameof(ASNDetail)); + if (IsInDetails(detail.PoNumber, detail.PoLine)) + { + throw new Exception(detail.PoNumber + detail.PoLine + "已经在明细中存在!"); + } + + ASNDetails.Add(new ASNDetail(guidGenerator.Create(), detail.AsnNumber, detail.PoNumber, detail.PoLine, detail.PartCode, detail.Lot, detail.Supplierlot, detail.ProduceDate, + detail.Uom, detail.DeliverQty, detail.StdPackUom, detail.StdPackQty, detail.SupplierPackUom,detail.SupplierPackQty,detail.SupplierPackConvertRate, detail.Remark)); + + } + + public virtual void AddDetails(IGuidGenerator guidGenerator, IEnumerable details) + { + Check.NotNull(guidGenerator, nameof(guidGenerator)); + foreach (var detail in details) + { + AddDetail(guidGenerator, detail); + } + } + + + + public virtual bool IsInDetails(string ponumber, string poline) + { + return ASNDetails.Any(di => di.PoNumber == ponumber && di.PoLine == poline); + } + + public virtual bool IsInDetails(Guid itemId) + { + return ASNDetails.Any(di => di.Id == itemId); + } + + public virtual bool UpdateDetail(IGuidGenerator guidGenerator, ASNDetail detail) + { + Check.NotNull(detail, nameof(ASNDetail)); + + var item = FindDetail(detail.Id); + + if (item == null) + { + AddDetail(guidGenerator, detail); + } + else + { + Check.NotNull(item, nameof(ASNDetail)); + + //item.Set(detail.Remark, detail.Enabled); + + } + return true; + } + + public virtual ASNDetail FindDetail(Guid itemId) + { + var item = ASNDetails.FirstOrDefault(p => p.Id == itemId); + return item; + } + + #endregion } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASNDetail.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASNDetail.cs new file mode 100644 index 0000000..5e93369 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASNDetail.cs @@ -0,0 +1,127 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Domain.Entities.Auditing; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi +{ + /// + /// 发货单明细 + /// + public class ASNDetail: EntityDetailBase + { + /// + /// 发货单号(ASN Number) + /// + [Display(Name = "发货单号(AsnNumber)")] + public string AsnNumber { set; get; } + + /// + /// 订单号(Purchase order number) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { set; get; } + + /// + /// 订单行(Purchase order Line) + /// + [Display(Name = "订单行(PoLine)")] + public string PoLine { set; get; } + + /// + /// 零件号(PartCode) + /// + [Display(Name = "零件号(PartCode)")] + public string PartCode { set; get; } + + /// + /// 批次(Lot number) + /// + [Display(Name = "批次(Lot)")] + public string Lot { set; get; } + + /// + /// 供应商批次(Supplier Lot) + /// + [Display(Name = "供应商批次(Supplierlot)")] + public string Supplierlot { set; get; } + + /// + /// 生产日期(Produce Date) + /// + [Display(Name = "生产日期(ProduceDate)")] + public DateTime ProduceDate { set; get; } + + /// + /// 计量单位(Unit of measure) + /// + [Display(Name = "计量单位(Uom)")] + public string Uom { set; get; } + + /// + /// 发货数量(Delivery quantity) + /// + [Display(Name = "发货数量(DeliverQty)")] + public decimal DeliverQty { set; get; } + + /// + /// 标包计量单位(standard package um) + /// + [Display(Name = "标包计量单位(StdPackUom)")] + public string StdPackUom { set; get; } + + /// + /// 标包数量(standard package quantiy) + /// + [Display(Name = "标包数量(StdPackQty)")] + public decimal StdPackQty { set; get; } + + /// + /// 供应商计量单位(Supplier UM) + /// + [Display(Name = "供应商计量单位(SupplierPackUom)")] + public string SupplierPackUom { set; get; } + + /// + /// 供应商包装数量(Supplier package UM) + /// + [Display(Name = "供应商包装数量(SupplierPackQty)")] + public decimal SupplierPackQty { set; get; } + + /// + /// 供应商包装转换率(UM conversion) + /// + [Display(Name = "供应商包装转换率(SupplierPackConvertRate)")] + public decimal SupplierPackConvertRate { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + + + public ASNDetail() { } + + public ASNDetail( + Guid id, string asnNumber,string poNumber, string poLine, string partCode, string lot, string supplierlot, DateTime produceDate, string uom, + decimal deliverQty, string stdPackUom, decimal stdPackQty, string supplierPackUom, decimal supplierPackQty, decimal supplierPackConvertRate, string remark) : base(id) + { + AsnNumber = asnNumber; + PoNumber = poNumber; + PoLine = poLine; + PartCode = partCode; + Lot = lot; + Supplierlot = supplierlot; + ProduceDate = produceDate; + Uom = uom; + DeliverQty = deliverQty; + StdPackUom = stdPackUom; + StdPackQty = stdPackQty; + SupplierPackUom = supplierPackUom; + SupplierPackQty = supplierPackQty; + SupplierPackConvertRate = supplierPackConvertRate; + Remark = remark; + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASNLabel.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASNLabel.cs new file mode 100644 index 0000000..fbe5b73 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASNLabel.cs @@ -0,0 +1,145 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Domain.Entities.Auditing; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi +{ + /// + /// 标签表 + /// + public class ASNLabel:EntityBase + { + /// + /// 标签代码(Label code) + /// + [Display(Name = "标签代码(LabelCode)")] + public string LabelCode { get;set;} + + /// + /// 完整条码数据(Barcode barcode) + /// + [Display(Name = "完整条码数据(Barcode)")] + public string Barcode { get;set;} + + /// + /// 零件号(Part code) + /// + [Display(Name = "零件号(PartCode)")] + public string PartCode { get;set;} + + /// + /// 零件名称(Part Name) + /// + [Display(Name = "零件名称(PartName)")] + public string PartName { get;set;} + + /// + /// 零件描述(Part desc) + /// + [Display(Name = "零件描述(PartDesc)")] + public string PartDesc { get;set;} + + /// + /// 批次(Lot number) + /// + [Display(Name = "批次(Lot)")] + public bool Lot { get;set;} + + /// + /// 计量单位(UM) + /// + [Display(Name = "计量单位(Uom)")] + public bool Uom { get;set;} + + /// + /// 数量(Label quantity) + /// + [Display(Name = "数量(Qty)")] + public decimal Qty { get;set;} + + /// + /// 标包计量单位(Package UM) + /// + [Display(Name = "标包计量单位(StdPackUom)")] + public string StdPackUom { get;set;} + + /// + /// 标包数量(Package quantity) + /// + [Display(Name = "标包数量(StdPackQty)")] + public decimal StdPackQty { get;set;} + + /// + /// 供应商代码(Supplier Code) + /// + [Display(Name = "供应商代码(SupplierCode)")] + public string SupplierCode { get;set;} + + /// + /// 供应商名称(Supplier Name) + /// + [Display(Name = "供应商名称(SupplierName)")] + public string SupplierName { get;set;} + + /// + /// 订单号(Purchase order number) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { get;set;} + + /// + /// 订单行(Purchase order Line) + /// + [Display(Name = "订单行(PoLine)")] + public string PoLine { get;set;} + + /// + /// 发货单号(ASN Number) + /// + [Display(Name = "发货单号(AsnNumber)")] + public string AsnNumber { get;set;} + + /// + /// 要货计划单号(Plan number) + /// + [Display(Name = "要货计划单号(RpNumber)")] + public string RpNumber { get;set;} + + /// + /// 供应商批次(Supplier Lot) + /// + [Display(Name = "供应商批次(SupplierLot)")] + public string SupplierLot { get;set;} + + /// + /// 生产日期(Produce Date) + /// + [Display(Name = "生产日期(ProduceDate)")] + public DateTime ProduceDate { get;set;} + + /// + /// 托标签号(Pallet label number) + /// + [Display(Name = "托标签号(PalletLabelnumber)")] + public decimal PalletLabelnumber { get;set;} + + /// + /// 地点(site) + /// + [Display(Name = "地点(Site)")] + public string Site { get;set;} + + /// + /// 公司(IAC company code) + /// + [Display(Name = "公司(Company)")] + public decimal Company { get;set;} + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { get;set;} + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/IASNLabelRepository.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/IASNLabelRepository.cs new file mode 100644 index 0000000..58d8ed3 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/IASNLabelRepository.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace Win_in.Sfs.Scp.WebApi +{ + public interface IASNLabelRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs index b24110c..64b6a96 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs @@ -47,7 +47,9 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore builder.ConfigReceipt(options); builder.ConfigPO(options); builder.ConfigPODetail(options); - + builder.ConfigASN(options); + builder.ConfigASNDetail(options); + builder.ConfigASNLabel(options); } /// @@ -266,5 +268,116 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore b.HasIndex(x => new { x.PoNumber,x.PoLine }).IsUnique(); }); } + + + /// + /// 发货单主表 + /// + private static void ConfigASN(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "_ASN", options.Schema); + + b.ConfigureByConvention(); + + b.Property(q => q.AsnNumber).IsRequired().HasMaxLength(64); + b.Property(q => q.RpNumber).IsRequired().HasMaxLength(64); + b.Property(q => q.PoNumber).HasMaxLength(64); + b.Property(q => q.SupplierCode).IsRequired().HasMaxLength(64); + b.Property(q => q.Status).IsRequired(); + b.Property(q => q.ContactName).HasMaxLength(64); + b.Property(q => q.ContactPhone).HasMaxLength(64); + b.Property(q => q.CarNumber).HasMaxLength(64); + b.Property(q => q.Warehouse).IsRequired(); + b.Property(q => q.WarehouseDock).IsRequired().HasMaxLength(64); + b.Property(q => q.TimeWindowBegin).IsRequired(); + b.Property(q => q.TimeWIndowEnd).IsRequired(); + b.Property(q => q.Site).IsRequired().HasMaxLength(64); + b.Property(q => q.Comapnay).IsRequired().HasMaxLength(64); + b.Property(q => q.Remark).HasMaxLength(4096); + b.Property(x => x.Version).HasMaxLength(64); + b.Property(x => x.SequenceNumber).HasMaxLength(64); + + b.HasMany(u => u.ASNDetails).WithOne().HasForeignKey(rd => rd.Id).OnDelete(DeleteBehavior.NoAction).IsRequired(); + + + b.HasIndex(x => new { x.AsnNumber }).IsUnique(); + }); + } + + /// + /// 发货单明细表 + /// + private static void ConfigASNDetail(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "_ASNDetail", options.Schema); + + b.ConfigureByConvention(); + + b.Property(q => q.AsnNumber).IsRequired().HasMaxLength(64); + b.Property(q => q.PoNumber).HasMaxLength(64); + b.Property(q => q.PoLine).HasMaxLength(64); + b.Property(q => q.PartCode).IsRequired().HasMaxLength(64); + b.Property(q => q.Lot).IsRequired().HasMaxLength(64); + b.Property(q => q.Supplierlot).IsRequired().HasMaxLength(64); + b.Property(q => q.ProduceDate).IsRequired(); + b.Property(q => q.Uom).IsRequired().HasMaxLength(64); + b.Property(q => q.DeliverQty).IsRequired(); + b.Property(q => q.StdPackUom).IsRequired().HasMaxLength(64); + b.Property(q => q.StdPackQty).IsRequired(); + b.Property(q => q.SupplierPackUom).IsRequired().HasMaxLength(64); + b.Property(q => q.SupplierPackQty).IsRequired(); + b.Property(q => q.SupplierPackConvertRate).IsRequired(); + b.Property(q => q.Remark).HasMaxLength(4096); + b.Property(x => x.Version).HasMaxLength(64); + + b.HasIndex(x => new { x.AsnNumber, x.PartCode }).IsUnique(); + }); + } + + /// + /// 发货单标签表 + /// + private static void ConfigASNLabel(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "_ASNLabel", options.Schema); + + b.ConfigureByConvention(); + + b.Property(q => q.LabelCode).IsRequired().HasMaxLength(64); + b.Property(q => q.Barcode).IsRequired().HasMaxLength(4096); + b.Property(q => q.PartCode).IsRequired().HasMaxLength(64); + b.Property(q => q.PartName).IsRequired().HasMaxLength(64); + b.Property(q => q.PartDesc).HasMaxLength(1024); + b.Property(q => q.Lot).IsRequired().HasMaxLength(64); + b.Property(q => q.Uom).IsRequired().HasMaxLength(64); + b.Property(q => q.Qty).IsRequired(); + b.Property(q => q.StdPackUom).IsRequired().HasMaxLength(64); + b.Property(q => q.StdPackQty).IsRequired(); + b.Property(q => q.SupplierCode).IsRequired().HasMaxLength(64); + b.Property(q => q.SupplierName).IsRequired().HasMaxLength(64); + b.Property(q => q.PoNumber).HasMaxLength(64); + b.Property(q => q.PoLine).HasMaxLength(64); + b.Property(q => q.AsnNumber).IsRequired().HasMaxLength(64); + b.Property(q => q.RpNumber).IsRequired().HasMaxLength(64); + b.Property(q => q.SupplierLot).HasMaxLength(64); + b.Property(q => q.ProduceDate).IsRequired(); + b.Property(q => q.PalletLabelnumber).IsRequired().HasMaxLength(64); + b.Property(q => q.Site).IsRequired().HasMaxLength(64); + b.Property(q => q.Company).IsRequired().HasMaxLength(64); + b.Property(q => q.Remark).HasMaxLength(4096); + + b.HasIndex(x => new { x.LabelCode }).IsUnique(); + }); + } + } } \ No newline at end of file