Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -15,6 +15,8 @@ namespace Tnb.ProductionMgr.Entities.Dto
|
||||
public string? plan_start_date { get; set; } = string.Empty;
|
||||
public int? reported_work_qty { get; set; }
|
||||
public string? status { get; set; } = string.Empty;
|
||||
|
||||
public string mo_code { get; set; }
|
||||
|
||||
public List<ReportRecordListChildrenOutput>? tablefield107 { get; set; } = new List<ReportRecordListChildrenOutput>();
|
||||
|
||||
|
||||
@@ -82,5 +82,10 @@ public partial class PrdMoTaskDefectRecord : BaseEntity<string>
|
||||
/// 任务类型
|
||||
/// </summary>
|
||||
public string mo_task_type { get; set; }
|
||||
/// <summary>
|
||||
/// 工单号
|
||||
/// </summary>
|
||||
public string? mo_code { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -69,4 +69,10 @@ public partial class PrdReportRecord : BaseEntity<string>
|
||||
/// 已报工数量
|
||||
/// </summary>
|
||||
public int reported_work_qty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单号
|
||||
/// </summary>
|
||||
public string? mo_code { get; set; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1287,6 +1287,7 @@ namespace Tnb.ProductionMgr
|
||||
record.mo_task_type = mo?.mo_type;
|
||||
record.status = taskInfo.mo_task_status;
|
||||
record.mo_task_id = taskInfo.id;
|
||||
record.mo_code = mo?.mo_code ?? "";
|
||||
//record.completed_qty = (await db.Queryable<PrdReport>().Where(it => it.mo_task_code == taskInfo.mo_task_code).SumAsync(it => it.reported_work_qty)).Value;
|
||||
prdReportLogs.Add(record);
|
||||
|
||||
@@ -1307,7 +1308,8 @@ namespace Tnb.ProductionMgr
|
||||
create_time = DateTime.Now,
|
||||
mo_task_id = taskInfo.id,
|
||||
mo_task_code = taskInfo.mo_task_code,
|
||||
mo_task_type = mo?.mo_type
|
||||
mo_task_type = mo?.mo_type,
|
||||
mo_code = mo?.mo_code ?? "",
|
||||
};
|
||||
sacipRecord.status = taskInfo.mo_task_status;
|
||||
prdTaskDefectLogs.Add(sacipRecord);
|
||||
|
||||
@@ -98,6 +98,7 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
id = a.id,
|
||||
masterial_code = a.masterial_code,
|
||||
mo_code = a.mo_code,
|
||||
masterial_name = a.masterial_name,
|
||||
mo_task_code = a.mo_task_code,
|
||||
mo_task_id = a.mo_task_code,
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
/// 4#梯设备名称
|
||||
/// </summary>
|
||||
public string DevName4 { get; set; }
|
||||
/// <summary>
|
||||
/// 心跳检测设备名称集合
|
||||
/// </summary>
|
||||
public List<string> HeartbeatDevNames { get; set; }
|
||||
public string token { get; set; }
|
||||
/// <summary>
|
||||
/// 获取设备标签列表url
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
||||
{
|
||||
public class CarryBarCodeInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 打印条码集合
|
||||
/// </summary>
|
||||
public List<string> barCodes { get; set; }
|
||||
/// <summary>
|
||||
/// 打印份数
|
||||
/// </summary>
|
||||
public int copies { get; set; } = 2;
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,8 @@
|
||||
/// <returns>获取到的状态值</returns>
|
||||
Task<(int sysStatus, int runStatus, int floorNo, int doorStatus, int agvStatus)> GetElevatorStatus(string devName,IEnumerable<string> tags, CancellationToken token);
|
||||
|
||||
|
||||
Task<Dictionary<string,int>> GetELevatorStatusMap(string devName,IEnumerable<string> tags, CancellationToken token);
|
||||
/// <summary>
|
||||
/// 检查Agv状态
|
||||
/// </summary>
|
||||
|
||||
@@ -213,9 +213,10 @@ namespace Tnb.WarehouseMgr
|
||||
/// 条码打印
|
||||
/// </summary>
|
||||
/// <param name="barCodes">条码</param>
|
||||
/// <param name="copies">打印份数</param>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
protected void BarCodePrint(List<string> barCodes)
|
||||
protected void BarCodePrint(List<string> barCodes,int copies)
|
||||
{
|
||||
TaskCompletionSource tcs = new();
|
||||
// open port.
|
||||
@@ -308,18 +309,21 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
foreach (string code in barCodes)
|
||||
{
|
||||
//print text, true type text.
|
||||
_ = PPLBUtility.B_Prn_Text(200, 50, 0, 2, 2, 2, 'N', code);
|
||||
//barcode.
|
||||
_ = PPLBUtility.B_Prn_Barcode(50, 100, 0, "1", 3, 5, 70, 'B', code);//have a counter
|
||||
// output.
|
||||
_ = PPLBUtility.B_Print_Out(1);// copy 2.
|
||||
for (int i = 0; i < copies; i++)
|
||||
{
|
||||
//print text, true type text.
|
||||
_ = PPLBUtility.B_Prn_Text(150, 50, 0, 2, 2, 2, 'N', code);
|
||||
//barcode.
|
||||
_ = PPLBUtility.B_Prn_Barcode(50, 100, 0, "1", 3, 5, 70, 'N', code);//have a counter
|
||||
// output.
|
||||
_ = PPLBUtility.B_Print_Out(1);// copy 2.
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tcs.SetException(ex);
|
||||
JNPF.Logging.Log.Error("条码打印时出现错误", ex);
|
||||
Logger.Error("条码打印时出现错误", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
try
|
||||
{
|
||||
Logger.Information($"任务链编号:{input.taskChainCode},状态:{input.status},设备ID:{input.deviceID}");
|
||||
Logger.Information($"任务链上报->任务链编号:{input.taskChainCode},状态:{input.status},设备ID:{input.deviceID}");
|
||||
/*switch (input.status)
|
||||
{
|
||||
case "CREATED": break;
|
||||
@@ -307,17 +307,20 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpPost, NonUnify, AllowAnonymous]
|
||||
public async Task<Result> TaskCallback(TaskCallBackInput input)
|
||||
{
|
||||
Log.Information($"接收参数:{JsonConvert.SerializeObject(input)}");
|
||||
Log.Information($"任务状态上报->接收参数:{JsonConvert.SerializeObject(input)}");
|
||||
try
|
||||
{
|
||||
|
||||
List<WmsDistaskH> disTasks = await _db.Queryable<WmsDistaskH>().Where(it => it.bill_code.Contains(input.taskCode)).ToListAsync();
|
||||
if (input.action == "LOAD")
|
||||
{
|
||||
Logger.Information("----------Load Begin----------");
|
||||
|
||||
TaskExecuteAfterUpInput taskExecuteAfterUpInput = new()
|
||||
{
|
||||
disTaskIds = disTasks.Select(x => x.id).ToList()
|
||||
};
|
||||
Logger.Information($"设备取返回输入参数:{JsonConvert.SerializeObject(taskExecuteAfterUpInput)}");
|
||||
await _wareHouseService.TaskExecuteAfter(taskExecuteAfterUpInput);
|
||||
Logger.Information($"Agv取货完成,任务Id:{string.Join(",", disTasks.Select(x => x.id))}");
|
||||
WmsElevatorUnexecute elevatorQueueItem = await _db.Queryable<WmsElevatorUnexecute>().FirstAsync(it => disTasks.Select(x => x.id).Contains(it.distask_id) && it.task_status == "执行中");
|
||||
@@ -332,9 +335,13 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
|
||||
Logger.Information("----------Load End----------");
|
||||
|
||||
}
|
||||
else if (input.action == "UNLOAD")
|
||||
{
|
||||
Logger.Information("----------UnLoad Begin----------");
|
||||
|
||||
TaskCompleUpInput taskCompleUpInput = new()
|
||||
{
|
||||
disTaskIds = disTasks.Select(x => x.id).ToList()
|
||||
@@ -342,6 +349,7 @@ namespace Tnb.WarehouseMgr
|
||||
Logger.Information($"taskCompleUpInput json parameter:{JsonConvert.SerializeObject(taskCompleUpInput)}");
|
||||
await _wareHouseService.TaskComplate(taskCompleUpInput);
|
||||
|
||||
Logger.Information("----------UnLoad end----------");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Dynamic;
|
||||
using DingTalk.Api.Request;
|
||||
using JNPF;
|
||||
using JNPF.Common.Extension;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -38,7 +39,8 @@ namespace Tnb.WarehouseMgr
|
||||
public async Task<dynamic> CallLiftTest(string devName, int floor)
|
||||
{
|
||||
bool isSuccefuly = false;
|
||||
(int sysStatus, int runStatus, _, int doorStatus, int agvStatus) = await GetElevatorStatus(devName, CancellationToken.None);
|
||||
var tags = new[] { "SysStatus", "RunStatus", "FloorNo", "DoorStatus", "AGVStatus" };
|
||||
(int sysStatus, int runStatus, _, int doorStatus, int agvStatus) = await GetElevatorStatus(devName, tags, CancellationToken.None);
|
||||
//判断当前楼层是否是放货楼层,如不是则呼叫电梯到当前楼层
|
||||
if (sysStatus.ToEnum<EnumSysStatus>() == EnumSysStatus.正常状态 && runStatus.ToEnum<EnumRunStatus>() == EnumRunStatus.停梯 &&
|
||||
agvStatus.ToEnum<EnumAgvStatus>() != EnumAgvStatus.AGV运行状态)
|
||||
@@ -324,11 +326,29 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
}
|
||||
return (sysStatus: sysStatus, runStatus: runStatus, floorNo: floorNo, doorStatus: doorStatus, agvStatus: agvStatus);
|
||||
return (sysStatus, runStatus, floorNo, doorStatus, agvStatus);
|
||||
|
||||
}
|
||||
|
||||
public async Task<Dictionary<string, int>> GetELevatorStatusMap(string devName, IEnumerable<string> tags, CancellationToken token)
|
||||
{
|
||||
Task<string> GetTag(string tag)
|
||||
{
|
||||
var dicCommand = new Dictionary<string, string>
|
||||
{
|
||||
["DevName"] = devName,
|
||||
["token"] = _elevatorCtlCfg.token,
|
||||
["TagName"] = tag
|
||||
};
|
||||
|
||||
return HttpClientHelper.GetAsync(_elevatorCtlCfg.GetTagUrl, pars: dicCommand);
|
||||
}
|
||||
|
||||
var tasks = tags.Select(tag => GetTag(tag));
|
||||
var results = await Task.WhenAll(tasks);
|
||||
var statusMap = results?.Select(x => JObject.Parse(x)).ToDictionary(x => x.Value<string>("Name"), x => x.Value<int>("V")) ?? default;
|
||||
return statusMap;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -345,7 +365,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
dynamic result = await WriteTagAsync(devName, ElevatorConsts.AGVControl, 1);
|
||||
JObject jo = JObject.Parse(result);
|
||||
if (jo != null && jo.Value<string>("Result").Equals("Ok", StringComparison.OrdinalIgnoreCase))
|
||||
if (jo != null && jo!.Value<string>("Result")!.Equals("Ok", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
isInAgvStatus = true;
|
||||
}
|
||||
@@ -383,10 +403,4 @@ namespace Tnb.WarehouseMgr
|
||||
return isSuccefuly;
|
||||
}
|
||||
}
|
||||
|
||||
public class ElevatorData
|
||||
{
|
||||
public string? name { get; set; }
|
||||
public string? value { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ using NPOI.OpenXmlFormats.Dml.Diagram;
|
||||
using Tnb.Common.Extension;
|
||||
using Tnb.Common.Utils;
|
||||
using Tnb.WarehouseMgr.Entities.Configs;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
using Tnb.WarehouseMgr.Entities.Exceptions;
|
||||
|
||||
@@ -42,43 +43,21 @@ namespace Tnb.WarehouseMgr
|
||||
//电梯Agv心跳检测
|
||||
_ = TimedTask(async token =>
|
||||
{
|
||||
Dictionary<string, string> parameter = new()
|
||||
foreach (var devName in _elevatorControlConfiguration.HeartbeatDevNames)
|
||||
{
|
||||
["DevName"] = _elevatorControlConfiguration.DevName3,
|
||||
["TagName"] = "AGVKeepalive",
|
||||
["Value"] = "123",
|
||||
["token"] = _elevatorControlConfiguration.token
|
||||
};
|
||||
string result = await HttpClientHelper.GetAsync(_elevatorControlConfiguration.WriteTagUrl, pars: parameter);
|
||||
await Console.Out.WriteLineAsync($"{_elevatorControlConfiguration.DevName3.Match(@"\d+")}#梯, 心跳检测结果:{result}");
|
||||
}, stoppingToken, 30, TimeSpanUnit.Seconds);
|
||||
_ = TimedTask(async token =>
|
||||
{
|
||||
Dictionary<string, string> parameter = new()
|
||||
{
|
||||
["DevName"] = _elevatorControlConfiguration.DevName4,
|
||||
["TagName"] = "AGVKeepalive",
|
||||
["Value"] = "123",
|
||||
["token"] = _elevatorControlConfiguration.token
|
||||
};
|
||||
string result = await HttpClientHelper.GetAsync(_elevatorControlConfiguration.WriteTagUrl, pars: parameter);
|
||||
await Console.Out.WriteLineAsync($"{_elevatorControlConfiguration.DevName4.Match(@"\d+")}#梯,心跳检测结果:{result}");
|
||||
}, stoppingToken, 30, TimeSpanUnit.Seconds);
|
||||
////齐套出库
|
||||
/*var kittingOutService = App.GetRequiredService<IWmskittingOutService>();
|
||||
TimedTask(token => kittingOutService.KittingOutByAdd(token), stoppingToken, 1);
|
||||
TimedTask(token => kittingOutService.KittingOutByIsToBeShipped(token), stoppingToken, 1);
|
||||
//齐套分拣
|
||||
var setSortingService = App.GetRequiredService<IWmsSetSortingService>();
|
||||
TimedTask(token => setSortingService.PackSortingByAdd(token), stoppingToken, 2);
|
||||
|
||||
Dictionary<string, string> parameter = new()
|
||||
{
|
||||
["DevName"] = devName,
|
||||
["TagName"] = ElevatorConsts.AGVKeepalive,
|
||||
["Value"] = "123",
|
||||
["token"] = _elevatorControlConfiguration.token
|
||||
};
|
||||
string result = await HttpClientHelper.GetAsync(_elevatorControlConfiguration.WriteTagUrl, pars: parameter);
|
||||
await Console.Out.WriteLineAsync($"{devName.Match(@"\d+")}#梯, 心跳检测结果:{result}");
|
||||
}
|
||||
}, stoppingToken, 30);
|
||||
|
||||
//最低库存检查
|
||||
var transferSignService = App.GetRequiredService<IWmsPDATransferSignService>();
|
||||
TimedTask(token => transferSignService.IsMinStorage(token), stoppingToken, 30, TimeSpanUnit.Minutes);*/
|
||||
|
||||
}, stoppingToken);
|
||||
|
||||
});
|
||||
return timedTask;
|
||||
}
|
||||
|
||||
@@ -86,14 +65,42 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
private Task TimedTask(Func<CancellationToken, Task> action, CancellationToken ct, int interval, TimeSpanUnit timeType = TimeSpanUnit.Seconds)
|
||||
{
|
||||
CancellationToken token = ct;
|
||||
return Task.Factory.StartNew(async () =>
|
||||
// CancellationToken token = ct;
|
||||
// return Task.Factory.StartNew(async () =>
|
||||
// {
|
||||
// while (!token.IsCancellationRequested)
|
||||
// {
|
||||
// await action(ct).Catch(async ex =>
|
||||
// {
|
||||
|
||||
// if (ex is TimedTaskException timedTaskEx and not null)
|
||||
// {
|
||||
// await _eventPublisher.PublishAsync(new LogEventSource("Log:CreateExLog", timedTaskEx.options!, new SysLogEntity
|
||||
// {
|
||||
// Id = SnowflakeIdHelper.NextId(),
|
||||
// Category = 4,
|
||||
// UserId = timedTaskEx.UserId,
|
||||
// UserName = timedTaskEx.UserName,
|
||||
// IPAddress = NetHelper.Ip,
|
||||
// RequestURL = timedTaskEx.RequestURL,
|
||||
// RequestMethod = timedTaskEx.RequestMethod,
|
||||
// Json = timedTaskEx + "\n" + timedTaskEx.InnerException?.StackTrace + "\n" + timedTaskEx?.TargetSite?.GetParameters().ToString(),
|
||||
// //PlatForm = string.Format("{0}-{1}", userAgent.OS.ToString(), userAgent.RawValue),
|
||||
// CreatorTime = DateTime.Now
|
||||
// }));
|
||||
// }
|
||||
// });
|
||||
// await TaskDelay(timeType, interval);
|
||||
// }
|
||||
// }, ct, TaskCreationOptions.None, new CustomerTaskScheduler());
|
||||
|
||||
return Task.Run(async () =>
|
||||
{
|
||||
while (!token.IsCancellationRequested)
|
||||
while (!ct.IsCancellationRequested)
|
||||
{
|
||||
|
||||
await action(ct).Catch(async ex =>
|
||||
{
|
||||
|
||||
if (ex is TimedTaskException timedTaskEx and not null)
|
||||
{
|
||||
await _eventPublisher.PublishAsync(new LogEventSource("Log:CreateExLog", timedTaskEx.options!, new SysLogEntity
|
||||
@@ -113,37 +120,7 @@ namespace Tnb.WarehouseMgr
|
||||
});
|
||||
await TaskDelay(timeType, interval);
|
||||
}
|
||||
}, ct, TaskCreationOptions.None, new CustomerTaskScheduler());
|
||||
|
||||
#region ThreadPool 线程运行会导致线程饥饿
|
||||
//return Task.Run(async () =>
|
||||
//{
|
||||
// while (!token.IsCancellationRequested)
|
||||
// {
|
||||
|
||||
// await action(cts).Catch(async ex =>
|
||||
// {
|
||||
// if (ex is TimedTaskException timedTaskEx and not null)
|
||||
// {
|
||||
// await _eventPublisher.PublishAsync(new LogEventSource("Log:CreateExLog", timedTaskEx.options!, new SysLogEntity
|
||||
// {
|
||||
// Id = SnowflakeIdHelper.NextId(),
|
||||
// Category = 4,
|
||||
// UserId = timedTaskEx.UserId,
|
||||
// UserName = timedTaskEx.UserName,
|
||||
// IPAddress = NetHelper.Ip,
|
||||
// RequestURL = timedTaskEx.RequestURL,
|
||||
// RequestMethod = timedTaskEx.RequestMethod,
|
||||
// Json = timedTaskEx + "\n" + timedTaskEx.InnerException?.StackTrace + "\n" + timedTaskEx?.TargetSite?.GetParameters().ToString(),
|
||||
// //PlatForm = string.Format("{0}-{1}", userAgent.OS.ToString(), userAgent.RawValue),
|
||||
// CreatorTime = DateTime.Now
|
||||
// }));
|
||||
// }
|
||||
// });
|
||||
// await TaskDelay(timeType, interval);
|
||||
// }
|
||||
//}, token);
|
||||
#endregion
|
||||
}, ct);
|
||||
}
|
||||
|
||||
public override Task StopAsync(CancellationToken cancellationToken)
|
||||
|
||||
@@ -840,9 +840,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
upInput.loginType = "web";
|
||||
}*/
|
||||
Logger.Information("loginType赋值前");
|
||||
upInput.loginType = "web";//(!string.IsNullOrEmpty(_userManager?.LoginType) ? "app" : "web") ?? "web";
|
||||
Logger.Information($"upInput.loginType={upInput.loginType}");
|
||||
if (dt.is_sign == 1 && dt.chain_type == "3")
|
||||
{
|
||||
Logger.Information("执行业务回更操作.....");
|
||||
|
||||
@@ -236,8 +236,9 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpPost, AllowAnonymous]
|
||||
public async Task<dynamic> BatchAdd(CarryBatchAddInput input)
|
||||
{
|
||||
int i = 0, r = 0, num = 0;
|
||||
var nonZeroPattern = @"[1-9]+";
|
||||
int r = 0, num = 0;
|
||||
//var nonZeroPattern = @"[1-9]+";
|
||||
var nonZeroPattern = @"\d+";
|
||||
var code = input.carry_code.Match(@"\D+");
|
||||
if (input.carry_code.IsMatch(@"\d+"))
|
||||
{
|
||||
@@ -246,26 +247,33 @@ namespace Tnb.WarehouseMgr
|
||||
var carrys = await _db.Queryable<WmsCarryH>().Where(it => it.carry_code.Contains(code)).ToListAsync();
|
||||
if (carrys?.Count < 1)
|
||||
{
|
||||
i = Math.Max(num, 1);
|
||||
num = Math.Max(num, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
var lastCarry = carrys?.OrderByDescending(o => o.carry_code).FirstOrDefault() ?? default;
|
||||
num = lastCarry?.carry_code.Match(nonZeroPattern).ParseToInt() ?? -1;
|
||||
i = num + 1;
|
||||
num = num + 1;
|
||||
}
|
||||
|
||||
var batchCarrys = new List<WmsCarryH>();
|
||||
for (; i <= input.quantity; i++)
|
||||
var batchCarrys = new List<WmsCarryH>(input.quantity);
|
||||
|
||||
for (var i = 1; i <= input.quantity; i++)
|
||||
{
|
||||
if (i != 1)
|
||||
{
|
||||
num += 1;
|
||||
}
|
||||
var sb = new StringBuilder();
|
||||
sb.Append(code);
|
||||
sb.Append(i.ToString().PadLeft(4, '0'));
|
||||
sb.Append(num.ToString().PadLeft(5, '0'));
|
||||
var carryCode = sb.ToString();
|
||||
WmsCarryH carry = input.Adapt<WmsCarryH>();
|
||||
carry.id = SnowflakeIdHelper.NextId();
|
||||
carry.carry_name = carryCode;
|
||||
carry.carry_code = carryCode;
|
||||
carry.is_check = 1;
|
||||
carry.status = 1;
|
||||
carry.create_id = "25398501929509";
|
||||
carry.create_time = DateTime.Now;
|
||||
batchCarrys.Add(carry);
|
||||
@@ -280,10 +288,11 @@ namespace Tnb.WarehouseMgr
|
||||
/// <param name="barCodes"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public new void BarCodePrint(List<string> barCodes)
|
||||
public new void BarCodePrint(CarryBarCodeInput input)
|
||||
{
|
||||
base.BarCodePrint(barCodes);
|
||||
|
||||
if (input.barCodes == null || input.barCodes.Count < 1) throw new ArgumentNullException(nameof(input.barCodes));
|
||||
input.barCodes = input.barCodes.OrderBy(o => o).ToList();
|
||||
base.BarCodePrint(input.barCodes, input.copies);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ namespace Tnb.WarehouseMgr
|
||||
.Mapper(it => it.material_name = (it.material_id != null && dicMaterial.ContainsKey(it.material_id)) ? dicMaterial[it.material_id].ToString() : "")
|
||||
.ToListAsync();
|
||||
|
||||
return items ?? Enumerable.Empty<dynamic>();
|
||||
return items ?? Enumerable.Empty<CarryCodeDetailOutput>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ namespace Tnb.WarehouseMgr
|
||||
if (input == null) throw new ArgumentNullException("input");
|
||||
if (input.details == null) throw new ArgumentNullException(nameof(input.details));
|
||||
|
||||
var materialIds = input.details.Select(x => x.material_id).ToList();
|
||||
var purchaseDs = await _db.Queryable<TSubEntity>().Where(it => materialIds.Contains(it.material_id)).ToListAsync();
|
||||
var ids = input.details.Select(x => x.id).ToList();
|
||||
var purchaseDs = await _db.Queryable<TSubEntity>().Where(it => ids.Contains(it.id)).ToListAsync();
|
||||
|
||||
if (purchaseDs?.Count > 0)
|
||||
{
|
||||
@@ -56,7 +56,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
foreach (var pd in purchaseDs)
|
||||
{
|
||||
var pdInput = input.details.Find(x => x.material_id == pd.material_id);
|
||||
var pdInput = input.details.Find(x => x.id == pd.id);
|
||||
if (pdInput != null)
|
||||
{
|
||||
pd.purchase_prqty += pdInput.purchase_arriveqty;
|
||||
@@ -111,7 +111,8 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
if (s_materialMap.Count == 0)
|
||||
{
|
||||
s_materialMap = await _db.Queryable<BasMaterial>().ToDictionaryAsync(x => x.id, x => x.name);
|
||||
//物料+规格型号+批次+箱号
|
||||
////s_materialMap = await _db.Queryable<BasMaterial>().ToDictionaryAsync(x => x.id, x => x.name);
|
||||
}
|
||||
var list = await _db.Queryable<TSubEntity>().Where(it => it.bill_id == pkId)
|
||||
.Mapper(it => it.material_name = s_materialMap.ContainsKey(it.material_id) ? s_materialMap[it.material_id]?.ToString() ?? "" : "")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"DevName3": "Elevator3",
|
||||
"DevName4": "Elevator4",
|
||||
"HeartbeatDevNames": [ "Elevator3", "Elevator4" ],
|
||||
"token": "780BE4144636CF47DDF3920B0F1D069B",
|
||||
"GetTagListUrl": "http://192.168.11.110:9100/Dev/GetTagList",
|
||||
"GetTagUrl": "http://192.168.11.110:9100/Dev/GetTag",
|
||||
|
||||
@@ -58,6 +58,8 @@ public class Startup : AppStartup
|
||||
//定时任务
|
||||
services.AddHostedService<TimedTaskBackgroundService>();
|
||||
//services.AddHostedService<RedisBackGround>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user