Browse Source

提交

master
mahao 2 years ago
parent
commit
2c213e3f62
  1. 12
      src/WmsWebApi.Application/ProductRecieve/ProductRecieveService.cs
  2. 8
      src/WmsWebApi.Application/StockMove/StockMoveService.cs
  3. 172
      src/WmsWebApi.Domain/WMS/TS_UNI_API.cs
  4. 2
      src/WmsWebApi.EntityFrameworkCore/EntityFrameworkCore/WmsWebApiDbContext.cs
  5. 12
      src/WmsWebApi.EntityFrameworkCore/EntityFrameworkCore/WmsWebApiDbContextModelCreatingExtensions.cs

12
src/WmsWebApi.Application/ProductRecieve/ProductRecieveService.cs

@ -16,6 +16,7 @@ using WmsWebApi.Domain;
using WmsWebApi.EntityFrameworkCore;
using WmsWebApi.Jsons;
using WmsWebApi.Wms;
using WmsWebApi.WMS;
namespace WmsWebApi.ProductRecieve;
@ -81,11 +82,11 @@ public class ProductRecieveService : ApplicationService, IProductRecieveService
});
}
[HttpPost("add")]
[HttpPost("add/IF01")]
public async Task<ReturnResult> AddAsync([FromBody] object content)
{
var result = new ReturnResult();
result.MESSAGE = "";
result.MESSAGE = String.Empty;
PRDto _PRDto;
//bool bUpdate = false,bOtherWork = false, bDel = false,bNotFind = false, bPartGroup = false;
bool bErr = false;
@ -121,11 +122,13 @@ public class ProductRecieveService : ApplicationService, IProductRecieveService
List<TS_STOCK_DETAIL> _stockUpdateList = new List<TS_STOCK_DETAIL>();
List<TS_STOCK_DETAIL> _stockDelList = new List<TS_STOCK_DETAIL>();
List<TL_TRANSACTION> _transList = new List<TL_TRANSACTION>();
List<TS_UNI_API> listTSUNIAPI = new List<TS_UNI_API>();
#region 添加BILL
var tbBill = new TB_BILL
{
BillNum = "AGV." + DateTime.Now.ToString("yyyyMMddHHmmss"),
SourceBillNum = _PRDto.SourceBillNum,
SourceBillNum2 = _PRDto.SourceBillNum,
BillTime = DateTime.Now,
StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
@ -295,6 +298,11 @@ public class ProductRecieveService : ApplicationService, IProductRecieveService
result.TYPE = 'E';
apiPRdto.ITYPE = result.MESSAGE;
}
else
{
result.MESSAGE = "成功";
apiPRdto.ITYPE = "成功";
}
try
{
await AddWmsWebApiProductRecieveDTONowUnitOfWorkAsync(apiPRdto);

8
src/WmsWebApi.Application/StockMove/StockMoveService.cs

@ -91,10 +91,11 @@ public class StockMoveService : ApplicationService, IStockMoveService
/// <param name="content"></param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
[HttpPost("add")]
[HttpPost("add/IF02")]
public async Task<ReturnResult> AddAsync([FromBody] object content)
{
var result = new ReturnResult();
result.MESSAGE = String.Empty;
SSDto _SSDto;
//bool bUpdate = false,bOtherWork = false, bDel = false,bNotFind = false, bPartGroup = false;
bool bErr = false;
@ -135,6 +136,7 @@ public class StockMoveService : ApplicationService, IStockMoveService
var tbBill = new TB_BILL
{
BillNum = "AGVM." + DateTime.Now.ToString("yyyyMMddHHmmss"),
SourceBillNum = _SSDto.SourceBillNum,
SourceBillNum2 = _SSDto.SourceBillNum,
BillTime = DateTime.Now,
StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
@ -436,6 +438,10 @@ public class StockMoveService : ApplicationService, IStockMoveService
result.TYPE = 'E';
apiSSdto.ITYPE = result.MESSAGE;
}
else
{
apiSSdto.ITYPE = "成功";
}
try
{
await AddWmsWebApiStockMoveDTONowUnitOfWorkAsync(apiSSdto);

172
src/WmsWebApi.Domain/WMS/TS_UNI_API.cs

@ -0,0 +1,172 @@
using System;
using Volo.Abp.Domain.Entities;
namespace WmsWebApi.WMS
{
public class TS_UNI_API : Entity<int>
{
#region 实体属性
/// <summary>
/// 接口类型
/// </summary>
public string InterfaceType { get; set; }
/// <summary>
/// 接口表
/// </summary>
public string TableName { get; set; }
/// <summary>
/// 单据类型
/// </summary>
public int? BillType { get; set; }
/// <summary>
/// 子单据类型
/// </summary>
public int? SubBillType { get; set; }
/// <summary>
/// 单据编号
/// </summary>
public string BillNum { get; set; }
/// <summary>
/// 零件号
/// </summary>
public string PartCode { get; set; }
/// <summary>
/// 批次
/// </summary>
public string Batch { get; set; }
/// <summary>
/// 来源库位
/// </summary>
public string FromLoc { get; set; }
/// <summary>
/// 目标库位
/// </summary>
public string ToLoc { get; set; }
/// <summary>
/// 来源ERP库位
/// </summary>
public string FromErpLoc { get; set; }
/// <summary>
/// 目标ERP库位
/// </summary>
public string ToErpLoc { get; set; }
/// <summary>
/// 数量
/// </summary>
public double? Qty { get; set; }
/// <summary>
/// 状态
/// </summary>
public int? State { get; set; }
/// <summary>
/// 创建操作员
/// </summary>
public string CreateOper { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 发送时间
/// </summary>
public DateTime? PutTime { get; set; }
/// <summary>
/// 客户编号
/// </summary>
public string CustId { get; set; }
/// <summary>
/// 供应商编号
/// </summary>
public string VendId { get; set; }
/// <summary>
/// 采购单位
/// </summary>
public string PoUnit { get; set; }
/// <summary>
/// 存储单位
/// </summary>
public string LocUnit { get; set; }
/// <summary>
/// 生效日期
/// </summary>
public DateTime? ValidDate { get; set; }
/// <summary>
/// ERP单据号
/// </summary>
public string ErpBillNum { get; set; }
/// <summary>
/// ERP行号
/// </summary>
public int? ErpLineNum { get; set; }
/// <summary>
/// 器具编号
/// </summary>
public string EqptCode { get; set; }
/// <summary>
/// 器具类型
/// </summary>
public string EqptType { get; set; }
/// <summary>
/// 供应商批次
/// </summary>
public string VendBatch { get; set; }
/// <summary>
/// 生产线
/// </summary>
public string WorklineId { get; set; }
/// <summary>
/// 上游单据号
/// </summary>
public string SourceBillNum { get; set; }
/// <summary>
/// ProcessId
/// </summary>
public int? ProcessId { get; set; }
/// <summary>
/// GoodQty
/// </summary>
public double? GoodQty { get; set; }
/// <summary>
/// ScrapQty
/// </summary>
public double? ScrapQty { get; set; }
/// <summary>
/// InvalidQty
/// </summary>
public double? InvalidQty { get; set; }
#endregion
}
}

2
src/WmsWebApi.EntityFrameworkCore/EntityFrameworkCore/WmsWebApiDbContext.cs

@ -10,6 +10,7 @@ using WmsWebApi.PPlan;
using WmsWebApi.Purchase;
using WmsWebApi.TbOrfers;
using WmsWebApi.Wms;
using WmsWebApi.WMS;
using WmsWebApi.ZlldcjLogs;
namespace WmsWebApi.EntityFrameworkCore
@ -44,6 +45,7 @@ namespace WmsWebApi.EntityFrameworkCore
public virtual DbSet<WmsWebApiStockMoveDTO> StockMoveDtos { get; set; }
public virtual DbSet<WmsWebApiProductRecieveDTO> ProductRecieveDtos { get; set; }
public virtual DbSet<TB_STOCK_MOVE> TbStockMoves { get; set; }
public virtual DbSet<TS_UNI_API> TSUNIAPIs { get; set; }
public WmsWebApiDbContext(DbContextOptions<WmsWebApiDbContext> options)
: base(options)

12
src/WmsWebApi.EntityFrameworkCore/EntityFrameworkCore/WmsWebApiDbContextModelCreatingExtensions.cs

@ -10,6 +10,7 @@ using WmsWebApi.PPlan;
using WmsWebApi.Purchase;
using WmsWebApi.TbOrfers;
using WmsWebApi.Wms;
using WmsWebApi.WMS;
using WmsWebApi.ZlldcjLogs;
namespace WmsWebApi.EntityFrameworkCore
@ -88,6 +89,7 @@ namespace WmsWebApi.EntityFrameworkCore
ConfigureWmsWebApiStockMove(builder);
ConfigureTbStockMoves(builder);
ConfigureTSUNIAPIs(builder);
}
private static void ConfigureTbOrder(ModelBuilder builder)
@ -683,5 +685,15 @@ namespace WmsWebApi.EntityFrameworkCore
b.Property(p => p.EnumRetryStatus).HasMaxLength(64).HasConversion<string>();
});
}
private static void ConfigureTSUNIAPIs(ModelBuilder builder)
{
builder.Entity<TS_UNI_API>(b =>
{
b.ToTable("TS_UNI_API", WmsWebApiDbProperties.DbSchema);
b.ConfigureByConvention();
b.Property(q => q.Id).HasColumnName("UID").ValueGeneratedOnAdd();
});
}
}
}
Loading…
Cancel
Save