1.相关业务增加source_id和source_code
2.入库申请查询明细单增加仓库名称回传字段
This commit is contained in:
@@ -52,6 +52,11 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
||||
/// </summary>
|
||||
public string source_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单据代码
|
||||
/// </summary>
|
||||
public string source_code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建用户
|
||||
/// </summary>
|
||||
|
||||
@@ -53,7 +53,17 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
||||
/// </summary>
|
||||
public string location_code { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 来源单据ID
|
||||
/// </summary>
|
||||
public string source_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单据号
|
||||
/// </summary>
|
||||
public string source_code { get; set; }
|
||||
|
||||
|
||||
}
|
||||
public class MESWmsOutstockDInput
|
||||
{
|
||||
|
||||
@@ -76,6 +76,10 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
||||
/// </summary>
|
||||
public string source_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单据号
|
||||
/// </summary>
|
||||
public string source_code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 顺序号
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using JNPF.Common.Contracts;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 入库申请明细表
|
||||
/// </summary>
|
||||
|
||||
public partial class WmsInstockD : BaseEntity<string>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 仓库名称
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string warehouse_name { get; set; }
|
||||
}
|
||||
@@ -69,6 +69,11 @@ public partial class WmsKittingInstock : BaseEntity<string>
|
||||
/// </summary>
|
||||
public string? source_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单据ID
|
||||
/// </summary>
|
||||
public string? source_code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单单据类型
|
||||
/// </summary>
|
||||
|
||||
@@ -94,6 +94,11 @@ public partial class WmsKittingoutH : BaseEntity<string>
|
||||
/// </summary>
|
||||
public string? source_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单据ID
|
||||
/// </summary>
|
||||
public string? source_code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单单据类型
|
||||
/// </summary>
|
||||
|
||||
@@ -114,6 +114,16 @@ public partial class WmsOutstockH : BaseEntity<string>
|
||||
/// </summary>
|
||||
public string? use_dept_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单据ID
|
||||
/// </summary>
|
||||
public string source_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单据号
|
||||
/// </summary>
|
||||
public string source_code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
|
||||
@@ -89,6 +89,12 @@ public partial class WmsSetsortingH : BaseEntity<string>
|
||||
/// </summary>
|
||||
public string? source_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单据号
|
||||
/// </summary>
|
||||
public string? source_code { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 来源单单据类型
|
||||
/// </summary>
|
||||
|
||||
@@ -70,7 +70,12 @@ namespace Tnb.WarehouseMgr
|
||||
public async Task<dynamic> GetInStockDetailsListById([FromRoute] string billId)
|
||||
{
|
||||
var dic = await _dictionaryDataService.GetDictionaryByTypeId(WmsWareHouseConst.WMS_INSTOCK_D_BILL_STATUS_TYPEID);
|
||||
var items = await _db.Queryable<WmsInstockD>().Where(it => it.bill_id == billId).ToListAsync();
|
||||
var items = await _db.Queryable<WmsInstockD>().LeftJoin<BasWarehouse>((a,b)=>a.warehouse_id == b.id)
|
||||
.Select((a, b) => new WmsInstockD
|
||||
{
|
||||
warehouse_name = b.whname
|
||||
},true)
|
||||
.Where(a => a.bill_id == billId).ToListAsync();
|
||||
_db.ThenMapper(items,
|
||||
it => it.line_status = dic.ContainsKey(it.line_status) ? dic[it.line_status]?.ToString()! : "");
|
||||
return items;
|
||||
|
||||
@@ -91,10 +91,10 @@ namespace Tnb.WarehouseMgr
|
||||
if (sPoint != null && ePoint != null)
|
||||
{
|
||||
var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
|
||||
if (points.Count <= 2) throw new AppFriendlyException("该路径不存在", 500);
|
||||
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
|
||||
if (points?.Count > 0)
|
||||
{
|
||||
if (points.Count <= 2) throw new AppFriendlyException("该路径不存在", 500);
|
||||
var preTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
|
||||
{
|
||||
var sPoint = it.FirstOrDefault();
|
||||
@@ -124,6 +124,8 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
preTask.create_id = _userManager.UserId;
|
||||
preTask.create_time = DateTime.Now;
|
||||
preTask.source_id = input.data[nameof(WmsKittingInstock.source_id)].ToString();
|
||||
preTask.source_code = input.data[nameof(WmsKittingInstock.source_code)].ToString();
|
||||
return preTask;
|
||||
}).ToList();
|
||||
List<WmsCarryCode> carryCodes = new();
|
||||
|
||||
@@ -92,15 +92,16 @@ namespace Tnb.WarehouseMgr
|
||||
List<WmsCarryCode> carryCodes = new();
|
||||
foreach (var os in outStockDList)
|
||||
{
|
||||
var OutStockStrategyInput = new OutStockStrategyQuery {
|
||||
var OutStockStrategyInput = new OutStockStrategyQuery
|
||||
{
|
||||
carry_id = input.data[nameof(OutStockStrategyQuery.carry_id)].ToString(),
|
||||
warehouse_id = input.data[nameof(WmsOutstockH.warehouse_id)].ToString(),
|
||||
material_id = os.material_id,
|
||||
code_batch = os.code_batch,
|
||||
};
|
||||
var outStkCarrys = await _wareHouseService.OutStockStrategy(OutStockStrategyInput);
|
||||
};
|
||||
var outStkCarrys = await _wareHouseService.OutStockStrategy(OutStockStrategyInput);
|
||||
var carryCodesPart = await _db.Queryable<WmsCarryH>().InnerJoin<WmsCarryCode>((a, b) => a.id == b.carry_id).InnerJoin<BasLocation>((a, b, c) => a.location_id == c.id)
|
||||
.Where((a,b) => outStkCarrys.Select(x=>x.id).Contains(b.carry_id))
|
||||
.Where((a, b) => outStkCarrys.Select(x => x.id).Contains(b.carry_id))
|
||||
.Select<WmsCarryCode>()
|
||||
.ToListAsync();
|
||||
if (carryCodesPart?.Count > 0)
|
||||
@@ -167,8 +168,8 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
carryIds = allOutIds.Concat(sortingOutIds).ToList();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.全部出).ToString() }).Where(it => allOutIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.分拣出).ToString() }).Where(it => sortingOutIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.全部出).ToString(), source_id = input.data[nameof(WmsOutstockH.source_id)].ToString(), source_code = input.data[nameof(WmsOutstockH.source_code)].ToString() }).Where(it => allOutIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.分拣出).ToString(), source_id = input.data[nameof(WmsOutstockH.source_id)].ToString(), source_code = input.data[nameof(WmsOutstockH.source_code)].ToString() }).Where(it => sortingOutIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
|
||||
@@ -378,7 +379,7 @@ namespace Tnb.WarehouseMgr
|
||||
.Select<WmsCarryCode>()
|
||||
.ToListAsync();
|
||||
if (carryCodesPart?.Count > 0)
|
||||
{
|
||||
{
|
||||
var codeQty = carryCodes.Sum(x => x.codeqty);
|
||||
if (codeQty < os.pr_qty)
|
||||
{
|
||||
@@ -450,8 +451,8 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
await _db.Insertable(outstock).ExecuteCommandAsync();
|
||||
await _db.Insertable(outstockDs).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.全部出).ToString() }).Where(it => allOutIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.分拣出).ToString() }).Where(it => sortingOutIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.全部出).ToString(), source_id = outstock.source_id, source_code = outstock.source_code }).Where(it => allOutIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.分拣出).ToString(), source_id = outstock.source_id, source_code = outstock.source_code }).Where(it => sortingOutIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
|
||||
}
|
||||
var carrys = await _db.Queryable<WmsCarryH>().Where(it => carryIds.Contains(it.id)).ToListAsync();
|
||||
@@ -497,7 +498,9 @@ namespace Tnb.WarehouseMgr
|
||||
require_id = outstock.id.ToString(),
|
||||
require_code = outstock.bill_code?.ToString(),
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now
|
||||
create_time = DateTime.Now,
|
||||
source_id = outstock.source_id,
|
||||
source_code = outstock.source_code,
|
||||
};
|
||||
|
||||
return preTask;
|
||||
|
||||
@@ -136,7 +136,9 @@ namespace Tnb.WarehouseMgr
|
||||
require_code = input.data[nameof(WmsHandleH.require_code)]?.ToString(),
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
};
|
||||
source_id = input.data[nameof(WmsKittingInstock.source_id)].ToString(),
|
||||
source_code = input.data[nameof(WmsKittingInstock.source_code)].ToString()
|
||||
};
|
||||
|
||||
return preTask;
|
||||
}).ToList();
|
||||
@@ -252,7 +254,7 @@ namespace Tnb.WarehouseMgr
|
||||
// 更新临时条码表 状态is_end
|
||||
await _db.Updateable<WmsTempCode>().SetColumns(it => new WmsTempCode { is_end = 1 }).Where(it => instockCOdes.Select(x => x.barcode).Contains(it.barcode)).ExecuteCommandAsync();
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
it => new WmsCarryH { carry_code = input.data[nameof(WmsCarryH.carry_code)].ToString()!, is_lock = 1, carry_status = ((int)EnumCarryStatus.占用).ToString(), location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
||||
it => new WmsCarryH { carry_code = input.data[nameof(WmsCarryH.carry_code)].ToString()!, is_lock = 1, carry_status = ((int)EnumCarryStatus.占用).ToString(), location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode, source_id = input.data[nameof(WmsOutstockH.source_id)].ToString(), source_code = input.data[nameof(WmsOutstockH.source_code)].ToString() },
|
||||
it => new BasLocation { is_lock = 1, is_use = ((int)EnumCarryStatus.占用).ToString() });
|
||||
if (instockCOdes?.Count > 0)
|
||||
{
|
||||
|
||||
@@ -99,7 +99,8 @@ namespace Tnb.WarehouseMgr
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.create_time)] = DateTime.Now;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.location_id)] = carry!.location_id!;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.bill_code)] = _billRullService.GetBillNumber("WmsKittingInStk").GetAwaiter().GetResult();
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.source_id)] = kittingout.id;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.source_id)] = kittingout.source_id;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.source_code)] = kittingout.source_code;
|
||||
|
||||
|
||||
var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == kittingout.location_id);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.ArrayExtensions;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -141,7 +142,14 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Insertable(carryMats).ExecuteCommandAsync();
|
||||
|
||||
carryIds = carryMats.Select(x => x.carry_id).Distinct().ToList();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.全部出).ToString(), collocation_scheme_id = singleSorting.collocation_scheme_id, collocation_scheme_code = singleSorting.collocation_scheme_code }).Where(it => carryIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsCarryH>()
|
||||
.SetColumns(it => new WmsCarryH {
|
||||
out_status = ((int)EnumOutStatus.全部出).ToString(),
|
||||
collocation_scheme_id = singleSorting.collocation_scheme_id,
|
||||
collocation_scheme_code = singleSorting.collocation_scheme_code,
|
||||
source_id = singleSorting.source_id,
|
||||
source_code = singleSorting.source_code })
|
||||
.Where(it => carryIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
//天益项目不需要
|
||||
//await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.分拣出).ToString() }).Where(it => sortingOutIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
}
|
||||
@@ -159,6 +167,7 @@ namespace Tnb.WarehouseMgr
|
||||
List<string> locIds = new();
|
||||
|
||||
var mid = 6;
|
||||
|
||||
if (carrys.Length > mid)
|
||||
{
|
||||
var leftCarrys = carrys[..mid];
|
||||
@@ -246,7 +255,9 @@ namespace Tnb.WarehouseMgr
|
||||
require_id = requireId,
|
||||
require_code = requireCode,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now
|
||||
create_time = DateTime.Now,
|
||||
source_id = carry.source_id,
|
||||
source_code = carry.source_code,
|
||||
};
|
||||
return preTask;
|
||||
}).ToList();
|
||||
|
||||
@@ -96,6 +96,12 @@ namespace Tnb.WarehouseMgr
|
||||
ko.carry_id = firstCarry?.id;
|
||||
ko.carry_code = firstCarry?.carry_code;
|
||||
await _db.Updateable(ko).UpdateColumns(it => new { it.status, it.carry_id, it.carry_code }).ExecuteCommandAsync();
|
||||
if (firstCarry != null)
|
||||
{
|
||||
firstCarry.source_id = ko.source_id;
|
||||
firstCarry.source_code = ko.source_code;
|
||||
await _db.Updateable(firstCarry).UpdateColumns(it => new { it.source_id, it.source_code }).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -206,7 +212,9 @@ namespace Tnb.WarehouseMgr
|
||||
require_id = ko.id,
|
||||
require_code = ko.bill_code,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now
|
||||
create_time = DateTime.Now,
|
||||
source_id = ko.source_id,
|
||||
source_code = ko.source_code
|
||||
};
|
||||
return preTask;
|
||||
}).ToList();
|
||||
@@ -381,7 +389,6 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
|
||||
await KittingOutByAdd();
|
||||
isSuccessFul = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user