1、库位导入代码调整
2、电梯通信代码调整
This commit is contained in:
@@ -3,14 +3,19 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Extension;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.Common.Extension;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Configs;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Entity;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
@@ -21,9 +26,11 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IUserManager _userManager;
|
||||
public WmsInternalTempTestService(ISqlSugarRepository<BasLocation> repo)
|
||||
private readonly IConfiguration _configuration;
|
||||
public WmsInternalTempTestService(ISqlSugarRepository<BasLocation> repo, IConfiguration configuration)
|
||||
{
|
||||
_db = repo.AsSugarClient();
|
||||
_configuration = configuration;
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改列
|
||||
@@ -48,7 +55,7 @@ namespace Tnb.WarehouseMgr
|
||||
public async Task UpdateStkMinsync()
|
||||
{
|
||||
await _db.Ado.BeginTranAsync();
|
||||
List<WmsStkTemp> list = await _db.Queryable<WmsStkTemp>().InnerJoin<BasMaterial>((a, b) => a.material_code==b.code)
|
||||
List<WmsStkTemp> list = await _db.Queryable<WmsStkTemp>().InnerJoin<BasMaterial>((a, b) => a.material_code == b.code)
|
||||
.InnerJoin<BasLocation>((a, b, c) => a.location_code == c.location_code)
|
||||
.Select((a, b, c) => new WmsStkTemp
|
||||
{
|
||||
@@ -57,7 +64,7 @@ namespace Tnb.WarehouseMgr
|
||||
unit_id = b.unit_id
|
||||
|
||||
}, true).ToListAsync();
|
||||
foreach (var carrycode in list)
|
||||
foreach (var carrycode in list)
|
||||
{
|
||||
//更新载具条码及状态
|
||||
WmsCarryCode wmsCarryCode = new();
|
||||
@@ -79,7 +86,7 @@ namespace Tnb.WarehouseMgr
|
||||
wmsCarryCode.material_specification = carrycode.material_specification;
|
||||
wmsCarryCode.container_no = carrycode.container_no;
|
||||
wmsCarryCode.create_time = DateTime.Now;
|
||||
|
||||
|
||||
if (wmsCarryCode.carry_id != null && wmsCarryCode.location_id != null)
|
||||
{
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { carry_status = ((int)EnumCarryStatus.占用).ToString(), location_id = wmsCarryCode.location_id, location_code = wmsCarryCode.location_code }).Where(it => it.id == wmsCarryCode.carry_id).ExecuteCommandAsync();
|
||||
@@ -99,5 +106,12 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Ado.CommitTranAsync();
|
||||
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
public Task<string> GetConfigItem()
|
||||
{
|
||||
var locCfg = _configuration.Build<LocationConfiguration>();
|
||||
return Task.FromResult(_configuration["TestLocation"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user