转库单同步调整 库存报表调整
This commit is contained in:
@@ -34,10 +34,7 @@ namespace Tnb.WarehouseMgr
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 转库单
|
||||
/// </summary>
|
||||
[HttpPost, NonUnify, AllowAnonymous]
|
||||
[HttpPost]
|
||||
public async Task<dynamic> CarryStock(CarryStockInput input)
|
||||
{
|
||||
var warehouse_id = "";
|
||||
@@ -66,25 +63,25 @@ namespace Tnb.WarehouseMgr
|
||||
.OrderByDescending((a, b, c, d, e, f) => b.carry_code)
|
||||
.Select((a, b, c, d, e, f) => new WmsCarryStockReport
|
||||
{
|
||||
仓库名称 = c.whname,
|
||||
warehouse_name = c.whname,
|
||||
carry_id = b.id,
|
||||
载具编码 = string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_code,
|
||||
载具名称 = string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_name,
|
||||
载具状态 = b.is_lock == 1 ? "锁定" : "未锁定",
|
||||
载具类型 = d.carrystd_name,
|
||||
库位编码 = a.location_code,
|
||||
库位名称 = a.location_name,
|
||||
库位状态 = b.is_lock == 1 ? "锁定" : "未锁定",
|
||||
入库时间 = b.instock_time != null ? b.instock_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
|
||||
条码 = e.barcode,
|
||||
批次 = e.code_batch,
|
||||
数量 = e.codeqty,
|
||||
carry_code = string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_code,
|
||||
carry_name = string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_name,
|
||||
carry_status = b.is_lock == 1 ? "锁定" : "未锁定",
|
||||
carry_type = d.carrystd_name,
|
||||
location_code = a.location_code,
|
||||
location_name = a.location_name,
|
||||
location_status = b.is_lock == 1 ? "锁定" : "未锁定",
|
||||
instock_time = b.instock_time != null ? b.instock_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
|
||||
barcode = e.barcode,
|
||||
code_batch = e.code_batch,
|
||||
qty = e.codeqty,
|
||||
material_id = e.material_id,
|
||||
物料编码 = e.material_code,
|
||||
物料名称 = f.name,
|
||||
单位 = e.unit_id,
|
||||
操作用户 = e.create_id,
|
||||
绑定时间 = e.create_time != null ? e.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
|
||||
material_code = e.material_code,
|
||||
material_name = f.name,
|
||||
unit = e.unit_id,
|
||||
creator = e.create_id,
|
||||
bind_time = e.create_time != null ? e.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
@@ -104,27 +101,27 @@ namespace Tnb.WarehouseMgr
|
||||
.WhereIF(!string.IsNullOrEmpty(material_id), (a, b, c, d, e, f, g) => g.id == material_id)
|
||||
.Select((a, b, c, d, e, f, g, h) => new WmsCarryStockReport
|
||||
{
|
||||
仓库名称 = c.whname,
|
||||
warehouse_name = c.whname,
|
||||
carry_id = b.id,
|
||||
载具编码 = b.carry_code,
|
||||
载具名称 = b.carry_name,
|
||||
子载具编码 = h.carry_code,
|
||||
子载具名称 = h.carry_name,
|
||||
载具状态 = b.is_lock == 1 ? "锁定" : "未锁定",
|
||||
载具类型 = d.carrystd_name,
|
||||
库位编码 = a.location_code,
|
||||
库位名称 = a.location_name,
|
||||
库位状态 = b.is_lock == 1 ? "锁定" : "未锁定",
|
||||
入库时间 = b.instock_time != null ? b.instock_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
|
||||
条码 = f.barcode,
|
||||
批次 = f.code_batch,
|
||||
数量 = f.codeqty,
|
||||
carry_code = b.carry_code,
|
||||
carry_name = b.carry_name,
|
||||
membercarry_code = h.carry_code,
|
||||
membercarry_name = h.carry_name,
|
||||
carry_status = b.is_lock == 1 ? "锁定" : "未锁定",
|
||||
carry_type = d.carrystd_name,
|
||||
location_code = a.location_code,
|
||||
location_name = a.location_name,
|
||||
location_status = b.is_lock == 1 ? "锁定" : "未锁定",
|
||||
instock_time = b.instock_time != null ? b.instock_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
|
||||
barcode = f.barcode,
|
||||
code_batch = f.code_batch,
|
||||
qty = f.codeqty,
|
||||
material_id = f.material_id,
|
||||
物料编码 = f.material_code,
|
||||
物料名称 = g.name,
|
||||
单位 = f.unit_id,
|
||||
操作用户 = f.create_id,
|
||||
绑定时间 = f.create_time != null ? f.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
|
||||
material_code = f.material_code,
|
||||
material_name = g.name,
|
||||
unit = f.unit_id,
|
||||
creator = f.create_id,
|
||||
bind_time = f.create_time != null ? f.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
@@ -138,7 +135,7 @@ namespace Tnb.WarehouseMgr
|
||||
_ = storeMap.TryGetValue(itGroup.Key, out WmsCarryStockReport? report);
|
||||
WmsCarryStockReportH stockReport = report.Adapt<WmsCarryStockReportH>();
|
||||
|
||||
if (report.载具编码 != "空托盘堆垛")
|
||||
if (report.carry_code != "空托盘堆垛")
|
||||
{
|
||||
List<WmsCarryStockReport> curCarryCodes = items.FindAll(x => x.carry_id == itGroup.Key.carry_id);
|
||||
|
||||
@@ -148,19 +145,19 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
index++;
|
||||
WmsCarryStockReportCode wmsCarryStockReportCode = new();
|
||||
wmsCarryStockReportCode.序号 = index;
|
||||
wmsCarryStockReportCode.index = index;
|
||||
//wmsCarryStockReportCode.carry_id = x.carry_id;
|
||||
wmsCarryStockReportCode.载具编码 = !string.IsNullOrEmpty(x.子载具编码) ? x.子载具编码 : x.载具编码;
|
||||
wmsCarryStockReportCode.载具名称 = !string.IsNullOrEmpty(x.子载具名称) ? x.子载具名称 : x.载具名称;
|
||||
wmsCarryStockReportCode.carry_code = !string.IsNullOrEmpty(x.membercarry_code) ? x.membercarry_code : x.carry_code;
|
||||
wmsCarryStockReportCode.carry_name = !string.IsNullOrEmpty(x.membercarry_name) ? x.membercarry_name : x.carry_name;
|
||||
//wmsCarryStockReportCode.material_id = x.material_id;
|
||||
wmsCarryStockReportCode.物料编号 = x.物料编码;
|
||||
wmsCarryStockReportCode.物料名称 = x.物料编码;
|
||||
wmsCarryStockReportCode.条码 = x.条码;
|
||||
wmsCarryStockReportCode.批次 = x.批次;
|
||||
wmsCarryStockReportCode.数量 = x.数量;
|
||||
wmsCarryStockReportCode.单位 = x.单位;
|
||||
wmsCarryStockReportCode.material_code = x.material_code;
|
||||
wmsCarryStockReportCode.material_name = x.material_name;
|
||||
wmsCarryStockReportCode.barcode = x.barcode;
|
||||
wmsCarryStockReportCode.code_batch = x.code_batch;
|
||||
wmsCarryStockReportCode.qty = x.qty;
|
||||
wmsCarryStockReportCode.unit = x.unit;
|
||||
//wmsCarryStockReportCode.创建用户 = x.操作用户;
|
||||
wmsCarryStockReportCode.绑定时间 = x.绑定时间;
|
||||
wmsCarryStockReportCode.bind_time = x.bind_time;
|
||||
|
||||
wmsCarryStockReportCodes.Add(wmsCarryStockReportCode);
|
||||
});
|
||||
@@ -176,7 +173,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
int rowIndex = 0;
|
||||
List<WmsCarryStockReportH> pages = result.Skip((input.currentPage - 1) * input.pageSize).Take(input.pageSize).ToList();
|
||||
pages.ForEach(page => { rowIndex++; page.序号 = rowIndex; });
|
||||
pages.ForEach(page => { rowIndex++; page.index = rowIndex; });
|
||||
|
||||
SqlSugarPagedList<WmsCarryStockReportH> pagedList = new()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user