增加MES-WMS接口
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Aop.Api.Domain;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
@@ -21,6 +22,7 @@ using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Attributes;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
@@ -33,7 +35,7 @@ namespace Tnb.WarehouseMgr
|
||||
[OverideVisualDev(ModuleConsts.MODULE_WMSEMPTYOUTSTK_ID)]
|
||||
[ServiceModule(BizTypeId)]
|
||||
|
||||
public class WmsEmptyOutstockService : BaseWareHouseService
|
||||
public class WmsEmptyOutstockService : BaseWareHouseService, IWmsEmptyOutstockService
|
||||
{
|
||||
private const string BizTypeId = "26122265173285";
|
||||
private readonly ISqlSugarClient _db;
|
||||
@@ -59,6 +61,8 @@ namespace Tnb.WarehouseMgr
|
||||
OverideFuncs.CreateAsync = PDAWmsEmptyOut;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private async Task<dynamic> PDAWmsEmptyOut(VisualDevModelDataCrInput input)
|
||||
{
|
||||
|
||||
@@ -209,5 +213,42 @@ namespace Tnb.WarehouseMgr
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES空载具出库接口
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> MESEmptyCarryOutStk(MESEmptyCarryOutStkInput input)
|
||||
{
|
||||
try
|
||||
{
|
||||
var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.location_code);
|
||||
var dic = new Dictionary<string, object>();
|
||||
dic[nameof(WmsEmptyOutstockH.id)] = SnowflakeIdHelper.NextId();
|
||||
dic[nameof(WmsEmptyOutstockH.org_id)] = input.org_id;
|
||||
dic[nameof(WmsEmptyOutstockH.location_id)] = location.id;
|
||||
dic[nameof(WmsEmptyOutstockH.carrystd_id)] = input.carrystd_id;
|
||||
dic[nameof(WmsEmptyOutstockH.bill_code)] = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_EMPTYOUTSTK_ENCODE).GetAwaiter().GetResult();
|
||||
dic[nameof(WmsEmptyOutstockH.status)] = WmsWareHouseConst.BILLSTATUS_ADD_ID;
|
||||
dic[nameof(WmsEmptyOutstockH.qty)] = input.qty;
|
||||
dic[nameof(WmsEmptyOutstockH.biz_type)] = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID;
|
||||
dic[nameof(WmsEmptyOutstockH.create_id)] = input.create_id;
|
||||
dic[nameof(WmsEmptyOutstockH.create_time)] = DateTime.Now;
|
||||
|
||||
VisualDevModelDataCrInput visualDevModelDataCrInput = new VisualDevModelDataCrInput
|
||||
{
|
||||
data = dic,
|
||||
};
|
||||
await PDAWmsEmptyOut(visualDevModelDataCrInput);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
return await ToApiResult(JNPF.Common.Enums.HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
return ToApiResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user