现场问题处理
This commit is contained in:
@@ -59,8 +59,7 @@ namespace Tnb.WarehouseMgr
|
||||
.LeftJoin<WmsCarrystd>((a, b, c, d) => d.id == b.carrystd_id)
|
||||
.LeftJoin<WmsCarryCode>((a, b, c, d, e) => e.carry_id == b.id)
|
||||
.LeftJoin<BasMaterial>((a, b, c, d, e, f) => f.id == e.material_id)
|
||||
.Where((a, b, c, d, e) => a.is_type == ((int)EnumLocationType.存储库位).ToString()
|
||||
&& ((!string.IsNullOrEmpty(b.carry_code) && b.carry_status != "0" && b.carry_status != "6") || string.IsNullOrEmpty(b.carry_code)))
|
||||
.Where((a, b, c, d, e) => ((!string.IsNullOrEmpty(b.carry_code) && b.carry_status != "0" && b.carry_status != "6") || string.IsNullOrEmpty(b.carry_code)))
|
||||
.WhereIF(!string.IsNullOrEmpty(warehouse_id), (a, b, c, d) => c.id == warehouse_id)
|
||||
.WhereIF(!string.IsNullOrEmpty(carry_code), (a, b, c, d) => b.carry_code.Contains(carry_code))
|
||||
.WhereIF(!string.IsNullOrEmpty(material_code), (a, b, c, d, e, f) => e.material_code.Contains(material_code))
|
||||
@@ -71,8 +70,8 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
warehouse_name = c.whname,
|
||||
carry_id = b.id,
|
||||
carry_code = a.is_use == "1" && string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_code,
|
||||
carry_name = a.is_use == "1" && string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_name,
|
||||
carry_code = a.is_use == "1" && string.IsNullOrEmpty(b.carry_code) && c.id == WmsWareHouseConst.WAREHOUSE_YCL_ID ? "空托盘堆垛" : b.carry_code,
|
||||
carry_name = a.is_use == "1" && string.IsNullOrEmpty(b.carry_code) && c.id == WmsWareHouseConst.WAREHOUSE_YCL_ID ? "空托盘堆垛" : b.carry_name,
|
||||
carry_status = b.is_lock == 1 ? "锁定" : "未锁定",
|
||||
carry_type = d.carrystd_name,
|
||||
location_code = a.location_code,
|
||||
@@ -101,7 +100,7 @@ namespace Tnb.WarehouseMgr
|
||||
.InnerJoin<WmsCarryCode>((a, b, c, d, e, f) => f.carry_id == e.membercarry_id)
|
||||
.InnerJoin<BasMaterial>((a, b, c, d, e, f, g) => g.id == f.material_id)
|
||||
.InnerJoin<WmsCarryH>((a, b, c, d, e, f, g, h) => h.id == e.membercarry_id)
|
||||
.Where((a, b, c, d, e) => a.is_type == ((int)EnumLocationType.存储库位).ToString() && b.carry_status != "0" && b.carry_status != "6")
|
||||
.Where((a, b, c, d, e) => b.carry_status != "0" && b.carry_status != "6")
|
||||
.WhereIF(!string.IsNullOrEmpty(warehouse_id), (a, b, c, d) => c.id == warehouse_id)
|
||||
.WhereIF(!string.IsNullOrEmpty(carry_code), (a, b, c, d, e, f, g, h) => b.carry_code.Contains(carry_code)|| h.carry_code.Contains(carry_code))
|
||||
.WhereIF(!string.IsNullOrEmpty(material_code), (a, b, c, d, e, f, g) => g.code.Contains(material_code))
|
||||
@@ -205,51 +204,56 @@ namespace Tnb.WarehouseMgr
|
||||
var warehouse_id = "";
|
||||
var carry_code = "";
|
||||
var material_code = "";
|
||||
var container_no = "";
|
||||
var code_batch = "";
|
||||
if (!input.queryJson.IsNullOrWhiteSpace())
|
||||
{
|
||||
warehouse_id = JObject.Parse(input.queryJson).Value<string>(nameof(WmsCarryCode.warehouse_id));
|
||||
carry_code = JObject.Parse(input.queryJson).Value<string>(nameof(WmsCarryCode.carry_code));
|
||||
material_code = JObject.Parse(input.queryJson).Value<string>(nameof(WmsCarryCode.material_code));
|
||||
code_batch = JObject.Parse(input.queryJson).Value<string>(nameof(WmsCarryCode.code_batch));
|
||||
container_no = JObject.Parse(input.queryJson).Value<string>(nameof(WmsCarryCode.container_no));
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<WmsCarryStockReport> items = await _db.Queryable<BasLocation>()
|
||||
.LeftJoin<WmsCarryH>((a, b) => b.location_id == a.id)
|
||||
.InnerJoin<BasWarehouse>((a, b, c) => a.wh_id == c.id)
|
||||
.LeftJoin<WmsCarrystd>((a, b, c, d) => d.id == b.carrystd_id)
|
||||
.LeftJoin<WmsCarryCode>((a, b, c, d, e) => e.carry_id == b.id)
|
||||
.LeftJoin<BasMaterial>((a, b, c, d, e, f) => f.id == e.material_id)
|
||||
.Where((a, b, c, d, e) => a.is_type == ((int)EnumLocationType.存储库位).ToString() && a.is_use == "1"
|
||||
&& ((!string.IsNullOrEmpty(b.carry_code) && b.carry_status != "0" && b.carry_status != "6") || string.IsNullOrEmpty(b.carry_code)))
|
||||
.WhereIF(!string.IsNullOrEmpty(warehouse_id), (a, b, c, d) => c.id == warehouse_id)
|
||||
.WhereIF(!string.IsNullOrEmpty(carry_code), (a, b, c, d) => b.carry_code.Contains(carry_code))
|
||||
.WhereIF(!string.IsNullOrEmpty(material_code), (a, b, c, d, e, f) => e.material_code.Contains(material_code))
|
||||
.OrderByDescending((a, b, c, d, e, f) => b.carry_code)
|
||||
.Select((a, b, c, d, e, f) => new WmsCarryStockReport
|
||||
{
|
||||
warehouse_name = c.whname,
|
||||
carry_id = b.id,
|
||||
carry_code = a.is_use == "1" && string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_code,
|
||||
carry_name = a.is_use == "1" && 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 = a.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,
|
||||
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") : ""
|
||||
})
|
||||
.OrderBy((a) => a.location_code)
|
||||
.ToListAsync();
|
||||
.LeftJoin<WmsCarryH>((a, b) => b.location_id == a.id)
|
||||
.InnerJoin<BasWarehouse>((a, b, c) => a.wh_id == c.id)
|
||||
.LeftJoin<WmsCarrystd>((a, b, c, d) => d.id == b.carrystd_id)
|
||||
.LeftJoin<WmsCarryCode>((a, b, c, d, e) => e.carry_id == b.id)
|
||||
.LeftJoin<BasMaterial>((a, b, c, d, e, f) => f.id == e.material_id)
|
||||
.Where((a, b, c, d, e) => ((!string.IsNullOrEmpty(b.carry_code) && b.carry_status != "0" && b.carry_status != "6") || string.IsNullOrEmpty(b.carry_code)))
|
||||
.WhereIF(!string.IsNullOrEmpty(warehouse_id), (a, b, c, d) => c.id == warehouse_id)
|
||||
.WhereIF(!string.IsNullOrEmpty(carry_code), (a, b, c, d) => b.carry_code.Contains(carry_code))
|
||||
.WhereIF(!string.IsNullOrEmpty(material_code), (a, b, c, d, e, f) => e.material_code.Contains(material_code))
|
||||
.WhereIF(!string.IsNullOrEmpty(code_batch), (a, b, c, d, e, f) => e.code_batch.Contains(code_batch))
|
||||
.WhereIF(!string.IsNullOrEmpty(container_no), (a, b, c, d, e, f) => f.container_no.Contains(container_no))
|
||||
.OrderByDescending((a, b, c, d, e, f) => b.carry_code)
|
||||
.Select((a, b, c, d, e, f) => new WmsCarryStockReport
|
||||
{
|
||||
warehouse_name = c.whname,
|
||||
carry_id = b.id,
|
||||
carry_code = a.is_use == "1" && string.IsNullOrEmpty(b.carry_code) && c.id == WmsWareHouseConst.WAREHOUSE_YCL_ID ? "空托盘堆垛" : b.carry_code,
|
||||
carry_name = a.is_use == "1" && string.IsNullOrEmpty(b.carry_code) && c.id == WmsWareHouseConst.WAREHOUSE_YCL_ID ? "空托盘堆垛" : 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 = a.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,
|
||||
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") : ""
|
||||
})
|
||||
.OrderBy((a) => a.location_code)
|
||||
.ToListAsync();
|
||||
|
||||
// 料架
|
||||
List<WmsCarryStockReport> items_LJ = await _db.Queryable<BasLocation>()
|
||||
@@ -264,6 +268,8 @@ namespace Tnb.WarehouseMgr
|
||||
.WhereIF(!string.IsNullOrEmpty(warehouse_id), (a, b, c, d) => c.id == warehouse_id)
|
||||
.WhereIF(!string.IsNullOrEmpty(carry_code), (a, b, c, d, e, f, g, h) => b.carry_code.Contains(carry_code) || h.carry_code.Contains(carry_code))
|
||||
.WhereIF(!string.IsNullOrEmpty(material_code), (a, b, c, d, e, f, g) => g.code.Contains(material_code))
|
||||
.WhereIF(!string.IsNullOrEmpty(code_batch), (a, b, c, d, e, f, g) => f.code_batch.Contains(code_batch))
|
||||
.WhereIF(!string.IsNullOrEmpty(container_no), (a, b, c, d, e, f, g) => g.container_no.Contains(container_no))
|
||||
.Select((a, b, c, d, e, f, g, h) => new WmsCarryStockReport
|
||||
{
|
||||
warehouse_name = c.whname,
|
||||
|
||||
Reference in New Issue
Block a user