Browse Source

新增发货单主表 发货单明细表 发货单标签表

master
xu.ding 3 years ago
parent
commit
552f0b447c
  1. 96
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNCreateOrUpdateDTOBase.cs
  2. 96
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNDTO.cs
  3. 103
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNDetailsDTO.cs
  4. 7
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelCreateDTO.cs
  5. 145
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelCreateOrUpdateDTOBase.cs
  6. 145
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelDTO.cs
  7. 7
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNLabelUpdateDTO.cs
  8. 10
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/IASNLabelAppService.cs
  9. 61
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNAppService.cs
  10. 88
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNLabelAppService.cs
  11. 1
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj
  12. 170
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASN.cs
  13. 127
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASNDetail.cs
  14. 145
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASNLabel.cs
  15. 10
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/IASNLabelRepository.cs
  16. 115
      ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs

96
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
{
/// <summary>
/// 发货单创建更新基础Dto
/// </summary>
public abstract class ASNCreateOrUpdateDTOBase : EntityDto<Guid>
{
/// <summary>
/// 发货单号(ASN Number)
/// </summary>
[Display(Name = "发货单号(AsnNumber)")]
public string AsnNumber { set; get; }
/// <summary>
/// 要货计划单号(Request Plan Number)
/// </summary>
[Display(Name = "要货计划单号(RpNumber)")]
public string RpNumber { set; get; }
/// <summary>
/// 订单号(Purchase order number)
/// </summary>
[Display(Name = "订单号(PoNumber)")]
public string PoNumber { set; get; }
/// <summary>
/// 供应商代码(Supplier code)
/// </summary>
[Display(Name = "供应商代码(SupplierCode)")]
public string SupplierCode { set; get; }
/// <summary>
/// 状态(Status)
/// </summary>
[Display(Name = "状态(Status)")]
public int Status { set; get; }
/// <summary>
/// 联系人(Contact person)
/// </summary>
[Display(Name = "联系人(ContactName)")]
public string ContactName { set; get; }
/// <summary>
/// 联系电话(Contact phone)
/// </summary>
[Display(Name = "联系电话(ContactPhone)")]
public string ContactPhone { set; get; }
/// <summary>
/// 版本(Car Number)
/// </summary>
[Display(Name = "车牌号(CarNumber)")]
public string CarNumber { set; get; }
/// <summary>
/// 仓库(Warehouse code)
/// </summary>
[Display(Name = "仓库(Warehouse)")]
public decimal Warehouse { set; get; }
/// <summary>
/// 收货口(Warehouse Dock)
/// </summary>
[Display(Name = "收货口(WarehouseDock)")]
public string WarehouseDock { set; get; }
/// <summary>
/// 时间窗口开始(Time window Begin)
/// </summary>
[Display(Name = "时间窗口开始(TimeWindowBegin)")]
public DateTime TimeWindowBegin { set; get; }
/// <summary>
/// 时间窗口结束(Time window End)
/// </summary>
[Display(Name = "时间窗口结束(TimeWIndowEnd)")]
public DateTime TimeWIndowEnd { set; get; }
/// <summary>
/// 地点(Site)
/// </summary>
[Display(Name = "地点(Site)")]
public string Site { set; get; }
/// <summary>
/// 公司(IAC company code)
/// </summary>
[Display(Name = "公司(Comapnay)")]
public string Comapnay { set; get; }
/// <summary>
/// 备注(Remark)
/// </summary>
[Display(Name = "备注(Remark)")]
public string Remark { set; get; }
public virtual ICollection<ASNDetailsDTO> ASNDetails { get; set; }
}
}

96
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
{
/// <summary>
/// 发货单主表DTO
/// </summary>
public class ASNDTO : AuditedEntityDto<Guid>
{
/// <summary>
/// 发货单号(ASN Number)
/// </summary>
[Display(Name = "发货单号(AsnNumber)")]
public string AsnNumber { set; get; }
/// <summary>
/// 要货计划单号(Request Plan Number)
/// </summary>
[Display(Name = "要货计划单号(RpNumber)")]
public string RpNumber { set; get; }
/// <summary>
/// 订单号(Purchase order number)
/// </summary>
[Display(Name = "订单号(PoNumber)")]
public string PoNumber { set; get; }
/// <summary>
/// 供应商代码(Supplier code)
/// </summary>
[Display(Name = "供应商代码(SupplierCode)")]
public string SupplierCode { set; get; }
/// <summary>
/// 状态(Status)
/// </summary>
[Display(Name = "状态(Status)")]
public int Status { set; get; }
/// <summary>
/// 联系人(Contact person)
/// </summary>
[Display(Name = "联系人(ContactName)")]
public string ContactName { set; get; }
/// <summary>
/// 联系电话(Contact phone)
/// </summary>
[Display(Name = "联系电话(ContactPhone)")]
public string ContactPhone { set; get; }
/// <summary>
/// 版本(Car Number)
/// </summary>
[Display(Name = "车牌号(CarNumber)")]
public string CarNumber { set; get; }
/// <summary>
/// 仓库(Warehouse code)
/// </summary>
[Display(Name = "仓库(Warehouse)")]
public decimal Warehouse { set; get; }
/// <summary>
/// 收货口(Warehouse Dock)
/// </summary>
[Display(Name = "收货口(WarehouseDock)")]
public string WarehouseDock { set; get; }
/// <summary>
/// 时间窗口开始(Time window Begin)
/// </summary>
[Display(Name = "时间窗口开始(TimeWindowBegin)")]
public DateTime TimeWindowBegin { set; get; }
/// <summary>
/// 时间窗口结束(Time window End)
/// </summary>
[Display(Name = "时间窗口结束(TimeWIndowEnd)")]
public DateTime TimeWIndowEnd { set; get; }
/// <summary>
/// 地点(Site)
/// </summary>
[Display(Name = "地点(Site)")]
public string Site { set; get; }
/// <summary>
/// 公司(IAC company code)
/// </summary>
[Display(Name = "公司(Comapnay)")]
public string Comapnay { set; get; }
/// <summary>
/// 备注(Remark)
/// </summary>
[Display(Name = "备注(Remark)")]
public string Remark { set; get; }
public virtual ICollection<ASNDetailsDTO> ASNDetails { get; set; }
}
}

103
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
{
/// <summary>
/// 发货单明细表DTO
/// </summary>
public class ASNDetailsDTO : AuditedEntityDto<Guid>
{
/// <summary>
/// 发货单号(ASN Number)
/// </summary>
[Display(Name = "发货单号(AsnNumber)")]
public string AsnNumber { set; get; }
/// <summary>
/// 订单号(Purchase order number)
/// </summary>
[Display(Name = "订单号(PoNumber)")]
public string PoNumber { set; get; }
/// <summary>
/// 订单行(Purchase order Line)
/// </summary>
[Display(Name = "订单行(PoLine)")]
public string PoLine { set; get; }
/// <summary>
/// 零件号(PartCode)
/// </summary>
[Display(Name = "零件号(PartCode)")]
public string PartCode { set; get; }
/// <summary>
/// 批次(Lot number)
/// </summary>
[Display(Name = "批次(Lot)")]
public string Lot { set; get; }
/// <summary>
/// 供应商批次(Supplier Lot)
/// </summary>
[Display(Name = "供应商批次(Supplierlot)")]
public string Supplierlot { set; get; }
/// <summary>
/// 生产日期(Produce Date)
/// </summary>
[Display(Name = "生产日期(ProduceDate)")]
public DateTime ProduceDate { set; get; }
/// <summary>
/// 计量单位(Unit of measure)
/// </summary>
[Display(Name = "计量单位(Uom)")]
public string Uom { set; get; }
/// <summary>
/// 发货数量(Delivery quantity)
/// </summary>
[Display(Name = "发货数量(DeliverQty)")]
public decimal DeliverQty { set; get; }
/// <summary>
/// 标包计量单位(standard package um)
/// </summary>
[Display(Name = "标包计量单位(StdPackUom)")]
public string StdPackUom { set; get; }
/// <summary>
/// 标包数量(standard package quantiy)
/// </summary>
[Display(Name = "标包数量(StdPackQty)")]
public decimal StdPackQty { set; get; }
/// <summary>
/// 供应商计量单位(Supplier UM)
/// </summary>
[Display(Name = "供应商计量单位(SupplierPackUom)")]
public string SupplierPackUom { set; get; }
/// <summary>
/// 供应商包装数量(Supplier package UM)
/// </summary>
[Display(Name = "供应商包装数量(SupplierPackQty)")]
public decimal SupplierPackQty { set; get; }
/// <summary>
/// 供应商包装转换率(UM conversion)
/// </summary>
[Display(Name = "供应商包装转换率(SupplierPackConvertRate)")]
public decimal SupplierPackConvertRate { set; get; }
/// <summary>
/// 备注(Remark)
/// </summary>
[Display(Name = "备注(Remark)")]
public string Remark { set; get; }
}
}

7
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
{
}
}

145
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
{
/// <summary>
/// 发货单标签表创建更新基础Dto
/// </summary>
public abstract class ASNLabelCreateOrUpdateDTOBase : EntityDto<Guid>
{
/// <summary>
/// 标签代码(Label code)
/// </summary>
[Display(Name = "标签代码(LabelCode)")]
public string LabelCode { get; set; }
/// <summary>
/// 完整条码数据(Barcode barcode)
/// </summary>
[Display(Name = "完整条码数据(Barcode)")]
public string Barcode { get; set; }
/// <summary>
/// 零件号(Part code)
/// </summary>
[Display(Name = "零件号(PartCode)")]
public string PartCode { get; set; }
/// <summary>
/// 零件名称(Part Name)
/// </summary>
[Display(Name = "零件名称(PartName)")]
public string PartName { get; set; }
/// <summary>
/// 零件描述(Part desc)
/// </summary>
[Display(Name = "零件描述(PartDesc)")]
public string PartDesc { get; set; }
/// <summary>
/// 批次(Lot number)
/// </summary>
[Display(Name = "批次(Lot)")]
public bool Lot { get; set; }
/// <summary>
/// 计量单位(UM)
/// </summary>
[Display(Name = "计量单位(Uom)")]
public bool Uom { get; set; }
/// <summary>
/// 数量(Label quantity)
/// </summary>
[Display(Name = "数量(Qty)")]
public decimal Qty { get; set; }
/// <summary>
/// 标包计量单位(Package UM)
/// </summary>
[Display(Name = "标包计量单位(StdPackUom)")]
public string StdPackUom { get; set; }
/// <summary>
/// 标包数量(Package quantity)
/// </summary>
[Display(Name = "标包数量(StdPackQty)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 供应商代码(Supplier Code)
/// </summary>
[Display(Name = "供应商代码(SupplierCode)")]
public string SupplierCode { get; set; }
/// <summary>
/// 供应商名称(Supplier Name)
/// </summary>
[Display(Name = "供应商名称(SupplierName)")]
public string SupplierName { get; set; }
/// <summary>
/// 订单号(Purchase order number)
/// </summary>
[Display(Name = "订单号(PoNumber)")]
public string PoNumber { get; set; }
/// <summary>
/// 订单行(Purchase order Line)
/// </summary>
[Display(Name = "订单行(PoLine)")]
public string PoLine { get; set; }
/// <summary>
/// 发货单号(ASN Number)
/// </summary>
[Display(Name = "发货单号(AsnNumber)")]
public string AsnNumber { get; set; }
/// <summary>
/// 要货计划单号(Plan number)
/// </summary>
[Display(Name = "要货计划单号(RpNumber)")]
public string RpNumber { get; set; }
/// <summary>
/// 供应商批次(Supplier Lot)
/// </summary>
[Display(Name = "供应商批次(SupplierLot)")]
public string SupplierLot { get; set; }
/// <summary>
/// 生产日期(Produce Date)
/// </summary>
[Display(Name = "生产日期(ProduceDate)")]
public DateTime ProduceDate { get; set; }
/// <summary>
/// 托标签号(Pallet label number)
/// </summary>
[Display(Name = "托标签号(PalletLabelnumber)")]
public decimal PalletLabelnumber { get; set; }
/// <summary>
/// 地点(site)
/// </summary>
[Display(Name = "地点(Site)")]
public string Site { get; set; }
/// <summary>
/// 公司(IAC company code)
/// </summary>
[Display(Name = "公司(Company)")]
public decimal Company { get; set; }
/// <summary>
/// 备注(Remark)
/// </summary>
[Display(Name = "备注(Remark)")]
public string Remark { get; set; }
}
}

145
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
{
/// <summary>
/// 发货单标签表DTO
/// </summary>
public class ASNLabelDTO : AuditedEntityDto<Guid>
{
/// <summary>
/// 标签代码(Label code)
/// </summary>
[Display(Name = "标签代码(LabelCode)")]
public string LabelCode { get; set; }
/// <summary>
/// 完整条码数据(Barcode barcode)
/// </summary>
[Display(Name = "完整条码数据(Barcode)")]
public string Barcode { get; set; }
/// <summary>
/// 零件号(Part code)
/// </summary>
[Display(Name = "零件号(PartCode)")]
public string PartCode { get; set; }
/// <summary>
/// 零件名称(Part Name)
/// </summary>
[Display(Name = "零件名称(PartName)")]
public string PartName { get; set; }
/// <summary>
/// 零件描述(Part desc)
/// </summary>
[Display(Name = "零件描述(PartDesc)")]
public string PartDesc { get; set; }
/// <summary>
/// 批次(Lot number)
/// </summary>
[Display(Name = "批次(Lot)")]
public bool Lot { get; set; }
/// <summary>
/// 计量单位(UM)
/// </summary>
[Display(Name = "计量单位(Uom)")]
public bool Uom { get; set; }
/// <summary>
/// 数量(Label quantity)
/// </summary>
[Display(Name = "数量(Qty)")]
public decimal Qty { get; set; }
/// <summary>
/// 标包计量单位(Package UM)
/// </summary>
[Display(Name = "标包计量单位(StdPackUom)")]
public string StdPackUom { get; set; }
/// <summary>
/// 标包数量(Package quantity)
/// </summary>
[Display(Name = "标包数量(StdPackQty)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 供应商代码(Supplier Code)
/// </summary>
[Display(Name = "供应商代码(SupplierCode)")]
public string SupplierCode { get; set; }
/// <summary>
/// 供应商名称(Supplier Name)
/// </summary>
[Display(Name = "供应商名称(SupplierName)")]
public string SupplierName { get; set; }
/// <summary>
/// 订单号(Purchase order number)
/// </summary>
[Display(Name = "订单号(PoNumber)")]
public string PoNumber { get; set; }
/// <summary>
/// 订单行(Purchase order Line)
/// </summary>
[Display(Name = "订单行(PoLine)")]
public string PoLine { get; set; }
/// <summary>
/// 发货单号(ASN Number)
/// </summary>
[Display(Name = "发货单号(AsnNumber)")]
public string AsnNumber { get; set; }
/// <summary>
/// 要货计划单号(Plan number)
/// </summary>
[Display(Name = "要货计划单号(RpNumber)")]
public string RpNumber { get; set; }
/// <summary>
/// 供应商批次(Supplier Lot)
/// </summary>
[Display(Name = "供应商批次(SupplierLot)")]
public string SupplierLot { get; set; }
/// <summary>
/// 生产日期(Produce Date)
/// </summary>
[Display(Name = "生产日期(ProduceDate)")]
public DateTime ProduceDate { get; set; }
/// <summary>
/// 托标签号(Pallet label number)
/// </summary>
[Display(Name = "托标签号(PalletLabelnumber)")]
public decimal PalletLabelnumber { get; set; }
/// <summary>
/// 地点(site)
/// </summary>
[Display(Name = "地点(Site)")]
public string Site { get; set; }
/// <summary>
/// 公司(IAC company code)
/// </summary>
[Display(Name = "公司(Company)")]
public decimal Company { get; set; }
/// <summary>
/// 备注(Remark)
/// </summary>
[Display(Name = "备注(Remark)")]
public string Remark { get; set; }
}
}

7
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
{
}
}

10
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<ASNLabelDTO,Guid,InputDTO, ASNLabelCreateDTO, ASNLabelUpdateDTO>
{
}
}

61
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
{
/// <summary>
/// 发货单服务
/// </summary>
[AllowAnonymous]
[Route("api/SCP/ASN")]
[ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)]
public class ASNAppService:CrudAppService<ASN,ASNDTO,Guid,InputDTO,ASNCreateDTO,ASNUpdateDTO>, IASNAppService
{
private readonly IASNRepository _asnRepository;
@ -15,15 +23,64 @@ namespace Win_in.Sfs.Scp.WebApi.ASNs
_asnRepository = repository;
}
/// <summary>
///获取一条数据 (Get a piece of data)
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("{id}")]
public override Task<ASNDTO> GetAsync(Guid id)
{
return base.GetAsync(id);
}
/// <summary>
///获取数据列表 (Get data list)
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("")]
public override Task<PagedResultDto<ASNDTO>> GetListAsync(InputDTO input)
{
return base.GetListAsync(input);
}
/// <summary>
/// 新增实体 (Create New entity)
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("")]
public override Task<ASNDTO> CreateAsync(ASNCreateDTO input)
{
return base.CreateAsync(input);
}
/// <summary>
/// 修改实体 (Modify entity)
/// </summary>
/// <returns></returns>
[HttpPut]
[Route("{id}")]
public override Task<ASNDTO> UpdateAsync(Guid id, ASNUpdateDTO input)
{
return base.UpdateAsync(id, input);
}
/// <summary>
/// 删除实体 (Delete entity)
/// </summary>
/// <param name="id">ID</param>
/// <returns>无</returns>
[HttpDelete]
[Route("{id}")]
public override Task DeleteAsync(Guid id)
{
return base.DeleteAsync(id);
}
}
}

88
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
{
/// <summary>
///零件服务
/// </summary>
[AllowAnonymous]
[Route("api/SCP/ASNLabel")]
[ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)]
public class ASNLabelAppService : CrudAppService<ASNLabel, ASNLabelDTO, Guid,InputDTO, ASNLabelCreateDTO, ASNLabelUpdateDTO>, IASNLabelAppService
{
private readonly IASNLabelRepository _partRepository;
public ASNLabelAppService(IASNLabelRepository repository) : base(repository)
{
_partRepository = repository;
}
/// <summary>
///获取一条数据 (Get a piece of data)
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("{id}")]
public override Task<ASNLabelDTO> GetAsync(Guid id)
{
return base.GetAsync(id);
}
/// <summary>
///获取数据列表 (Get data list)
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("")]
public override Task<PagedResultDto<ASNLabelDTO>> GetListAsync(InputDTO input)
{
return base.GetListAsync(input);
}
/// <summary>
/// 新增实体 (Create New entity)
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("")]
public override Task<ASNLabelDTO> CreateAsync(ASNLabelCreateDTO input)
{
return base.CreateAsync(input);
}
/// <summary>
/// 修改实体 (Modify entity)
/// </summary>
/// <returns></returns>
[HttpPut]
[Route("{id}")]
public override Task<ASNLabelDTO> UpdateAsync(Guid id, ASNLabelUpdateDTO input)
{
return base.UpdateAsync(id, input);
}
/// <summary>
/// 删除实体 (Delete entity)
/// </summary>
/// <param name="id">ID</param>
/// <returns>无</returns>
[HttpDelete]
[Route("{id}")]
public override Task DeleteAsync(Guid id)
{
return base.DeleteAsync(id);
}
}
}

1
ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj

@ -20,7 +20,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="ASNs\" />
<Folder Include="POs\" />
</ItemGroup>

170
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<Guid>
/// <summary>
/// 发货单主表
/// </summary>
public class ASN: EntityBase<Guid>
{
/// <summary>
/// 发货单号(ASN Number)
/// </summary>
[Display(Name = "发货单号(AsnNumber)")]
public string AsnNumber { set; get; }
/// <summary>
/// 要货计划单号(Request Plan Number)
/// </summary>
[Display(Name = "要货计划单号(RpNumber)")]
public string RpNumber { set; get; }
/// <summary>
/// 订单号(Purchase order number)
/// </summary>
[Display(Name = "订单号(PoNumber)")]
public string PoNumber { set; get; }
/// <summary>
/// 供应商代码(Supplier code)
/// </summary>
[Display(Name = "供应商代码(SupplierCode)")]
public string SupplierCode { set; get; }
/// <summary>
/// 状态(Status)
/// </summary>
[Display(Name = "状态(Status)")]
public int Status { set; get; }
/// <summary>
/// 联系人(Contact person)
/// </summary>
[Display(Name = "联系人(ContactName)")]
public string ContactName { set; get; }
/// <summary>
/// 联系电话(Contact phone)
/// </summary>
[Display(Name = "联系电话(ContactPhone)")]
public string ContactPhone { set; get; }
/// <summary>
/// 版本(Car Number)
/// </summary>
[Display(Name = "车牌号(CarNumber)")]
public string CarNumber { set; get; }
/// <summary>
/// 仓库(Warehouse code)
/// </summary>
[Display(Name = "仓库(Warehouse)")]
public decimal Warehouse { set; get; }
/// <summary>
/// 收货口(Warehouse Dock)
/// </summary>
[Display(Name = "收货口(WarehouseDock)")]
public string WarehouseDock { set; get; }
/// <summary>
/// 时间窗口开始(Time window Begin)
/// </summary>
[Display(Name = "时间窗口开始(TimeWindowBegin)")]
public DateTime TimeWindowBegin { set; get; }
/// <summary>
/// 时间窗口结束(Time window End)
/// </summary>
[Display(Name = "时间窗口结束(TimeWIndowEnd)")]
public DateTime TimeWIndowEnd { set; get; }
/// <summary>
/// 地点(Site)
/// </summary>
[Display(Name = "地点(Site)")]
public string Site { set; get; }
/// <summary>
/// 公司(IAC company code)
/// </summary>
[Display(Name = "公司(Comapnay)")]
public string Comapnay { set; get; }
/// <summary>
/// 备注(Remark)
/// </summary>
[Display(Name = "备注(Remark)")]
public string Remark { set; get; }
public virtual List<ASNDetail> 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<ASNDetail> 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
}
}

127
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
{
/// <summary>
/// 发货单明细
/// </summary>
public class ASNDetail: EntityDetailBase<Guid>
{
/// <summary>
/// 发货单号(ASN Number)
/// </summary>
[Display(Name = "发货单号(AsnNumber)")]
public string AsnNumber { set; get; }
/// <summary>
/// 订单号(Purchase order number)
/// </summary>
[Display(Name = "订单号(PoNumber)")]
public string PoNumber { set; get; }
/// <summary>
/// 订单行(Purchase order Line)
/// </summary>
[Display(Name = "订单行(PoLine)")]
public string PoLine { set; get; }
/// <summary>
/// 零件号(PartCode)
/// </summary>
[Display(Name = "零件号(PartCode)")]
public string PartCode { set; get; }
/// <summary>
/// 批次(Lot number)
/// </summary>
[Display(Name = "批次(Lot)")]
public string Lot { set; get; }
/// <summary>
/// 供应商批次(Supplier Lot)
/// </summary>
[Display(Name = "供应商批次(Supplierlot)")]
public string Supplierlot { set; get; }
/// <summary>
/// 生产日期(Produce Date)
/// </summary>
[Display(Name = "生产日期(ProduceDate)")]
public DateTime ProduceDate { set; get; }
/// <summary>
/// 计量单位(Unit of measure)
/// </summary>
[Display(Name = "计量单位(Uom)")]
public string Uom { set; get; }
/// <summary>
/// 发货数量(Delivery quantity)
/// </summary>
[Display(Name = "发货数量(DeliverQty)")]
public decimal DeliverQty { set; get; }
/// <summary>
/// 标包计量单位(standard package um)
/// </summary>
[Display(Name = "标包计量单位(StdPackUom)")]
public string StdPackUom { set; get; }
/// <summary>
/// 标包数量(standard package quantiy)
/// </summary>
[Display(Name = "标包数量(StdPackQty)")]
public decimal StdPackQty { set; get; }
/// <summary>
/// 供应商计量单位(Supplier UM)
/// </summary>
[Display(Name = "供应商计量单位(SupplierPackUom)")]
public string SupplierPackUom { set; get; }
/// <summary>
/// 供应商包装数量(Supplier package UM)
/// </summary>
[Display(Name = "供应商包装数量(SupplierPackQty)")]
public decimal SupplierPackQty { set; get; }
/// <summary>
/// 供应商包装转换率(UM conversion)
/// </summary>
[Display(Name = "供应商包装转换率(SupplierPackConvertRate)")]
public decimal SupplierPackConvertRate { set; get; }
/// <summary>
/// 备注(Remark)
/// </summary>
[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;
}
}
}

145
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
{
/// <summary>
/// 标签表
/// </summary>
public class ASNLabel:EntityBase<Guid>
{
/// <summary>
/// 标签代码(Label code)
/// </summary>
[Display(Name = "标签代码(LabelCode)")]
public string LabelCode { get;set;}
/// <summary>
/// 完整条码数据(Barcode barcode)
/// </summary>
[Display(Name = "完整条码数据(Barcode)")]
public string Barcode { get;set;}
/// <summary>
/// 零件号(Part code)
/// </summary>
[Display(Name = "零件号(PartCode)")]
public string PartCode { get;set;}
/// <summary>
/// 零件名称(Part Name)
/// </summary>
[Display(Name = "零件名称(PartName)")]
public string PartName { get;set;}
/// <summary>
/// 零件描述(Part desc)
/// </summary>
[Display(Name = "零件描述(PartDesc)")]
public string PartDesc { get;set;}
/// <summary>
/// 批次(Lot number)
/// </summary>
[Display(Name = "批次(Lot)")]
public bool Lot { get;set;}
/// <summary>
/// 计量单位(UM)
/// </summary>
[Display(Name = "计量单位(Uom)")]
public bool Uom { get;set;}
/// <summary>
/// 数量(Label quantity)
/// </summary>
[Display(Name = "数量(Qty)")]
public decimal Qty { get;set;}
/// <summary>
/// 标包计量单位(Package UM)
/// </summary>
[Display(Name = "标包计量单位(StdPackUom)")]
public string StdPackUom { get;set;}
/// <summary>
/// 标包数量(Package quantity)
/// </summary>
[Display(Name = "标包数量(StdPackQty)")]
public decimal StdPackQty { get;set;}
/// <summary>
/// 供应商代码(Supplier Code)
/// </summary>
[Display(Name = "供应商代码(SupplierCode)")]
public string SupplierCode { get;set;}
/// <summary>
/// 供应商名称(Supplier Name)
/// </summary>
[Display(Name = "供应商名称(SupplierName)")]
public string SupplierName { get;set;}
/// <summary>
/// 订单号(Purchase order number)
/// </summary>
[Display(Name = "订单号(PoNumber)")]
public string PoNumber { get;set;}
/// <summary>
/// 订单行(Purchase order Line)
/// </summary>
[Display(Name = "订单行(PoLine)")]
public string PoLine { get;set;}
/// <summary>
/// 发货单号(ASN Number)
/// </summary>
[Display(Name = "发货单号(AsnNumber)")]
public string AsnNumber { get;set;}
/// <summary>
/// 要货计划单号(Plan number)
/// </summary>
[Display(Name = "要货计划单号(RpNumber)")]
public string RpNumber { get;set;}
/// <summary>
/// 供应商批次(Supplier Lot)
/// </summary>
[Display(Name = "供应商批次(SupplierLot)")]
public string SupplierLot { get;set;}
/// <summary>
/// 生产日期(Produce Date)
/// </summary>
[Display(Name = "生产日期(ProduceDate)")]
public DateTime ProduceDate { get;set;}
/// <summary>
/// 托标签号(Pallet label number)
/// </summary>
[Display(Name = "托标签号(PalletLabelnumber)")]
public decimal PalletLabelnumber { get;set;}
/// <summary>
/// 地点(site)
/// </summary>
[Display(Name = "地点(Site)")]
public string Site { get;set;}
/// <summary>
/// 公司(IAC company code)
/// </summary>
[Display(Name = "公司(Company)")]
public decimal Company { get;set;}
/// <summary>
/// 备注(Remark)
/// </summary>
[Display(Name = "备注(Remark)")]
public string Remark { get;set;}
}
}

10
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<ASNLabel, Guid>
{
}
}

115
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);
}
/// <summary>
@ -266,5 +268,116 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore
b.HasIndex(x => new { x.PoNumber,x.PoLine }).IsUnique();
});
}
/// <summary>
/// 发货单主表
/// </summary>
private static void ConfigASN(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options)
{
builder.Entity<ASN>(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();
});
}
/// <summary>
/// 发货单明细表
/// </summary>
private static void ConfigASNDetail(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options)
{
builder.Entity<ASNDetail>(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();
});
}
/// <summary>
/// 发货单标签表
/// </summary>
private static void ConfigASNLabel(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options)
{
builder.Entity<ASNLabel>(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();
});
}
}
}
Loading…
Cancel
Save