调整获取随机数方式
This commit is contained in:
@@ -290,7 +290,7 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpGet]
|
||||
public async Task<dynamic> GetTaskDetailByCheckType([FromQuery] CheckDetailQuery input)
|
||||
{
|
||||
if(_carryMap.Count == 0)
|
||||
if (_carryMap.Count == 0)
|
||||
{
|
||||
_carryMap = await _db.Queryable<WmsCarryH>().ToDictionaryAsync(x => x.id, x => x.carry_code);
|
||||
}
|
||||
@@ -299,28 +299,26 @@ namespace Tnb.WarehouseMgr
|
||||
.And((a, b, c) => a.wh_id == input.warehouse_id)
|
||||
.And((a, b, c) => a.is_type == ((int)EnumLocationType.存储库位).ToString())
|
||||
.And((a, b, c) => c.is_lock == 0);
|
||||
|
||||
switch (input.CheckType)
|
||||
filterExpable = input.CheckType switch
|
||||
{
|
||||
case EnumCheckType.物料盘点:
|
||||
filterExpable.AndIF(!string.IsNullOrEmpty(input.material_id), (a, b, c) => b.material_id == input.material_id);
|
||||
break;
|
||||
case EnumCheckType.批次盘点:
|
||||
filterExpable.AndIF(input.regionIds?.Count> 0, (a, b, c) => input.regionIds.Contains(a.region_id));
|
||||
break;
|
||||
}
|
||||
EnumCheckType.物料盘点 => filterExpable.AndIF(!string.IsNullOrEmpty(input.material_id), (a, b, c) => b.material_id == input.material_id),
|
||||
EnumCheckType.批次盘点 => filterExpable.AndIF(input.regionIds?.Count > 0, (a, b, c) => input.regionIds.Contains(a.region_id)),
|
||||
_ => filterExpable,
|
||||
};
|
||||
var carryCodes = await _db.Queryable<BasLocation>().InnerJoin<WmsCarryCode>((a, b) => a.id == b.location_id)
|
||||
.InnerJoin<WmsCarryH>((a, b, c) => b.carry_id == c.id)
|
||||
.Where(filterExpable.ToExpression())
|
||||
.Select<WmsCarryCode>()
|
||||
.ToListAsync();
|
||||
|
||||
List<CheckTaskDetailOutput> outputs = carryCodes.GroupBy(g => new { g.material_code, g.code_batch, g.location_code, g.carry_id }).Select(x => new CheckTaskDetailOutput
|
||||
|
||||
List<WmsCheckstockD> outputs = carryCodes.GroupBy(g => new { g.material_code, g.code_batch, g.location_code, g.carry_id }).Select(x => new WmsCheckstockD
|
||||
{
|
||||
material_code = x.Key.material_code,
|
||||
code_batch = x.Key.code_batch,
|
||||
location_code = x.Key.location_code,
|
||||
carry_id = x.Key.carry_id,
|
||||
carry_code = _carryMap[x.Key.carry_id]?.ToString() ?? string.Empty,
|
||||
location_id = x.FirstOrDefault(y => y.location_code == x.Key.location_code)?.location_id ?? string.Empty,
|
||||
location_code = x.Key.location_code,
|
||||
pr_qty = x.Sum(d => d.codeqty),
|
||||
closing_status = WmsWareHouseConst.CLOSINGSTATUS_WJS_ID,
|
||||
qty = 0,
|
||||
|
||||
Reference in New Issue
Block a user