将定时任务操作者改为,当前系统管理员
This commit is contained in:
@@ -261,7 +261,13 @@ namespace Tnb.WarehouseMgr.Entities.Consts
|
||||
/// 单据类型-来料入库单
|
||||
/// </summary>
|
||||
public const string BILLTYPE_MATERIALINSTOCK_ID = "25103338755861";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 管理员Id(天益4厂管理员)
|
||||
/// </summary>
|
||||
public const string AdministratorUserId = "25398501929509";
|
||||
/// <summary>
|
||||
/// 组织Id(天益4厂)
|
||||
/// </summary>
|
||||
public const string AdministratorOrgId = "25193668006933";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,8 @@ namespace Tnb.WarehouseMgr
|
||||
/// </summary>
|
||||
/// <param name="barCodes">条码</param>
|
||||
/// <returns></returns>
|
||||
protected Task BarCodePrint(List<string> barCodes)
|
||||
[NonAction]
|
||||
protected void BarCodePrint(List<string> barCodes)
|
||||
{
|
||||
var tcs = new TaskCompletionSource();
|
||||
// open port.
|
||||
@@ -226,14 +227,20 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
if (0 != ret)
|
||||
return null;
|
||||
return ;
|
||||
|
||||
// sample setting.
|
||||
PPLBUtility.B_Set_Originpoint(0, 0);
|
||||
PPLBUtility.B_Select_Option(2);
|
||||
PPLBUtility.B_Set_Darkness(8);
|
||||
PPLBUtility.B_Del_Pcx("*");// delete all picture.
|
||||
PPLBUtility.B_Set_LabelForSmartPrint(254 * 3, 30);//label information: length= 3 * 25.4 mm, gap= 3 mm.
|
||||
//PPLBUtility.B_Set_LabelForSmartPrint(254 * 3, 30);//label information: length= 3 * 25.4 mm, gap= 3 mm. 254 * 3, 30
|
||||
PPLBUtility.B_Set_Labwidth(80 * 8);
|
||||
//var labelWidth = 640; //254 * 3; // 标签宽度
|
||||
//var barcodeWidth = 320; // 条码宽度
|
||||
//var barcodeX = (labelWidth - barcodeWidth) / 2;
|
||||
//B_Prn_Barcode(barcodeX, 100, 0, "QRcode", 1, 0, 2, 2, "YourBarcodeData"); 8
|
||||
|
||||
|
||||
|
||||
foreach (var code in barCodes)
|
||||
@@ -241,8 +248,8 @@ namespace Tnb.WarehouseMgr
|
||||
//print text, true type text.
|
||||
PPLBUtility.B_Prn_Text(200, 50, 0, 2, 2, 2, 'N', code);
|
||||
//barcode.
|
||||
PPLBUtility.B_Prn_Barcode(160, 100, 0, "E80", 8, 500, 70, 'N', code);//have a counter
|
||||
// output.
|
||||
PPLBUtility.B_Prn_Barcode(50, 100, 0, "1", 3, 5, 70, 'B', code);//have a counter
|
||||
// output.
|
||||
PPLBUtility.B_Print_Out(1);// copy 2.
|
||||
}
|
||||
}
|
||||
@@ -254,9 +261,8 @@ namespace Tnb.WarehouseMgr
|
||||
finally
|
||||
{
|
||||
// close port.
|
||||
//PPLBUtility.B_ClosePrn();
|
||||
PPLBUtility.B_ClosePrn();
|
||||
}
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
#region 斑马打印
|
||||
|
||||
@@ -24,6 +24,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Natasha.CSharp;
|
||||
using NetTaste;
|
||||
using Tnb.Common.Extension;
|
||||
using Tnb.WarehouseMgr.Entities.Attributes;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
@@ -85,14 +86,14 @@ namespace Tnb.WarehouseMgr
|
||||
_eventPublisher = App.GetRequiredService<IEventPublisher>();
|
||||
//齐套出库
|
||||
var kittingOutService = App.GetRequiredService<IWmskittingOutService>();
|
||||
TimedTask(cts => kittingOutService.KittingOutByAdd(stoppingToken), stoppingToken, 1);
|
||||
TimedTask(cts => kittingOutService.KittingOutByIsToBeShipped(stoppingToken), stoppingToken, 1);
|
||||
TimedTask(token => kittingOutService.KittingOutByAdd(token), stoppingToken, 1);
|
||||
TimedTask(token => kittingOutService.KittingOutByIsToBeShipped(token), stoppingToken, 1);
|
||||
//齐套分拣
|
||||
var setSortingService = App.GetRequiredService<IWmsSetSortingService>();
|
||||
TimedTask(cts => setSortingService.PackSortingByAdd(cts), stoppingToken, 1);
|
||||
TimedTask(token => setSortingService.PackSortingByAdd(token), stoppingToken, 1);
|
||||
//最低库存检查
|
||||
var transferSignService = App.GetRequiredService<IWmsPDATransferSignService>();
|
||||
TimedTask(cts => transferSignService.IsMinStorage(cts), stoppingToken, 30, TimeSpanUnit.Minutes);
|
||||
TimedTask(token => transferSignService.IsMinStorage(token), stoppingToken, 30, TimeSpanUnit.Minutes);
|
||||
|
||||
}, stoppingToken);
|
||||
|
||||
@@ -167,7 +168,6 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
IsStarted = false;
|
||||
return Task.CompletedTask;
|
||||
//return base.StopAsync(cancellationToken);
|
||||
}
|
||||
|
||||
private Task TaskDelay(TimeSpanUnit timeType, int interval)
|
||||
|
||||
@@ -581,6 +581,12 @@ namespace Tnb.WarehouseMgr
|
||||
public async Task<bool> GenPreTask(List<WmsPretaskH> preTasks, List<WmsPretaskCode> preTaskCodes)
|
||||
{
|
||||
//如果预任务出现起终库位相同,则删除对应预任务
|
||||
//modifiy by ly on 20230922 将当前预任务操作者设为四场管理员
|
||||
preTasks.ForEach(pt =>
|
||||
{
|
||||
pt.org_id = WmsWareHouseConst.AdministratorOrgId;
|
||||
pt.create_id = WmsWareHouseConst.AdministratorUserId;
|
||||
});
|
||||
if (preTasks.FindAll(it => it.startlocation_id == it.endlocation_id)?.Count > 0)
|
||||
{
|
||||
preTasks.RemoveAll(it => it.startlocation_id == it.endlocation_id);
|
||||
|
||||
@@ -227,7 +227,8 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpPost]
|
||||
public async Task BarCodePrint(List<string> barCodes)
|
||||
{
|
||||
await base.BarCodePrint(barCodes);
|
||||
base.BarCodePrint(barCodes);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -377,19 +377,6 @@ namespace Tnb.WarehouseMgr
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测试获取路径
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<dynamic> GetTest()
|
||||
{
|
||||
//D:\Workspce\tianyi\TuoTong-LowCodePlatform-BackEnd\apihost\Tnb.API.Entry\bin\Debug\net6.0\
|
||||
var dllPath = Path.Combine(AppContext.BaseDirectory, @"Library\x64");
|
||||
var files = Directory.GetFiles(dllPath);
|
||||
return dllPath;
|
||||
}
|
||||
|
||||
|
||||
public async Task<dynamic> PrintTest(List<string> barCodes)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user