新增物料标签查询接口
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto.Outputs
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料标签查询返回结果
|
||||
/// </summary>
|
||||
public class MaterailLabelOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料ID
|
||||
/// </summary>
|
||||
public string material_id { get; set; }
|
||||
/// <summary>
|
||||
/// 物料编号
|
||||
/// </summary>
|
||||
public string material_code { get; set; }
|
||||
/// <summary>
|
||||
/// 批次
|
||||
/// </summary>
|
||||
public string code_batch { get; set;}
|
||||
/// <summary>
|
||||
/// 采购单号
|
||||
/// </summary>
|
||||
public string purchase_code { get; set; }
|
||||
/// <summary>
|
||||
/// 供应商
|
||||
/// </summary>
|
||||
public string supplier_id { get; set; }
|
||||
/// <summary>
|
||||
/// 条码数量
|
||||
/// </summary>
|
||||
public decimal barcode_qty { get; set; }
|
||||
/// <summary>
|
||||
/// 单位ID
|
||||
/// </summary>
|
||||
public string unit_id { get; set; }
|
||||
/// <summary>
|
||||
/// 入库单号
|
||||
/// </summary>
|
||||
public string in_bill_code { get; set; }
|
||||
/// <summary>
|
||||
/// 入库时间
|
||||
/// </summary>
|
||||
public DateTime instock_time { get; set; }
|
||||
/// <summary>
|
||||
/// 出库单号
|
||||
/// </summary>
|
||||
public string out_bill_code { get; set; }
|
||||
/// <summary>
|
||||
/// 出库时间
|
||||
/// </summary>
|
||||
public DateTime? outstock_time { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库ID
|
||||
/// </summary>
|
||||
public string warehouse_id { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库名称
|
||||
/// </summary>
|
||||
public string warehouse_name { get; set; }
|
||||
/// <summary>
|
||||
/// 库位ID
|
||||
/// </summary>
|
||||
public string location_id { get; set; }
|
||||
/// <summary>
|
||||
/// 库位编号
|
||||
/// </summary>
|
||||
public string location_code { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF.Common.Filter;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto.Queries
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料标签查询输入参数
|
||||
/// </summary>
|
||||
public class MaterialLabelQuery : PageInputBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 所属组织Id
|
||||
/// </summary>
|
||||
public string org_id { get; set; }
|
||||
/// <summary>
|
||||
/// 条码编号
|
||||
/// </summary>
|
||||
public List<string> barcode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,6 @@ namespace Tnb.WarehouseMgr
|
||||
var carry = await _db.Queryable<WmsCarryH>().FirstAsync(a => a.carry_code == input.carry_code && a.status == 1);
|
||||
if (carry.IsNull()) throw new AppFriendlyException($"编号{input.carry_code},对应载具不存在或被禁用", 500);
|
||||
var mCarryIdDic = await _db.Queryable<WmsCarryD>().Where(it => it.carry_id == carry.id).ToDictionaryAsync(x => x.membercarry_id, x => x.membercarry_code);
|
||||
//var mCarryIdDic = carryDsLst.ToDictionary(x => x.membercarry_id, x => x.membercarry_code);
|
||||
Expression<Func<WmsCarryCode, bool>> whereExp = carry.carrystd_id == WmsWareHouseConst.CARRY_LJSTD_ID && mCarryIdDic.Keys?.Count > 0
|
||||
? a => mCarryIdDic.Keys.Contains(a.carry_id)
|
||||
: a => a.carry_id == carry.id;
|
||||
|
||||
@@ -7,6 +7,7 @@ using Aop.Api.Domain;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
@@ -26,6 +27,8 @@ using Tnb.WarehouseMgr.Entities.Attributes;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Outputs;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Queries;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
@@ -481,5 +484,31 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
return isSuccessFul;
|
||||
}
|
||||
/// <summary>
|
||||
/// 物料标签查询
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> MesFetchInOutStockInfoByBarCode(MaterialLabelQuery input)
|
||||
{
|
||||
var pagedList = await _db.Queryable<WmsInstockH>().InnerJoin<WmsInstockCode>((a, b) => a.id == b.bill_id)
|
||||
.LeftJoin<WmsOutstockCode>((a, b, c) => b.barcode == c.barcode)
|
||||
.WhereIF(!string.IsNullOrEmpty(input.org_id), (a, b, c) => a.org_id == input.org_id)
|
||||
.Where((a, b, c) => input.barcode.Contains(b.barcode))
|
||||
.Select((a, b, c) => new MaterailLabelOutput
|
||||
{
|
||||
barcode_qty = b.codeqty,
|
||||
in_bill_code = a.bill_code,
|
||||
out_bill_code = SqlFunc.Subqueryable<WmsOutstockH>().Where(it => it.id == c.bill_id).Select(it => it.bill_code),
|
||||
instock_time = a.create_time,
|
||||
outstock_time = SqlFunc.Subqueryable<WmsOutstockH>().Where(it => it.id == c.bill_id).Select(it => it.create_time),
|
||||
}, true)
|
||||
.ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
return PageResult<MaterailLabelOutput>.SqlSugarPageResult(pagedList); ;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public class Startup : AppStartup
|
||||
SnowflakeIdHelper.InitYitIdWorker();
|
||||
|
||||
bool isStartTimeJob = App.GetConfig<bool>("IsStartTimeJob");
|
||||
if (isStartTimeJob)
|
||||
serviceProvider.GetRequiredService<ITimeTaskService>().StartTimerJob();
|
||||
//if (isStartTimeJob)
|
||||
// serviceProvider.GetRequiredService<ITimeTaskService>().StartTimerJob();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user