原材料仓逻辑、看板调整
This commit is contained in:
@@ -174,10 +174,21 @@ namespace Tnb.WarehouseMgr
|
||||
public async Task<dynamic> GetYCLlocation()
|
||||
{
|
||||
List<List<LocationOutput>> LocationOutputss=new List<List<LocationOutput>>();
|
||||
var list =await _db.Queryable<BasLocation>().Where(p=> p.wh_id == "1" && p.is_type == "0" && !p.location_code.Contains("-3")).OrderBy(p=>p.location_code).ToListAsync();
|
||||
var carrys=await _db.Queryable<WmsCarryH>().ToListAsync();
|
||||
var carrycodes=await _db.Queryable<WmsCarryCode>().ToListAsync();
|
||||
var lastdata=string.Empty;
|
||||
var list =await _db.Queryable<BasLocation>().Where(p=> p.wh_id == "1" && p.is_type == "0" && !p.location_code.Contains("-3"))
|
||||
.OrderBy(p=>p.location_code).ToListAsync();
|
||||
var carrys = await _db.Queryable<WmsCarryH>().ToListAsync();
|
||||
var carrycodes = await _db.Queryable<WmsCarryCode>().ToListAsync();
|
||||
var mats = await _db.Queryable<BasMaterial>().ToListAsync();
|
||||
var qcresults = await _db.Queryable<WmsCarryCode>()
|
||||
.InnerJoin<WmsTempCode>((a, b) => a.barcode == b.barcode)
|
||||
.InnerJoin<WmsPurchaseD>((a, b, c) => c.id == b.require_id)
|
||||
.Where((a, b, c) => !string.IsNullOrEmpty(c.qc_res)).Select((a,b,c)=>new
|
||||
{
|
||||
barcode = a.barcode,
|
||||
qc_res = c.qc_res
|
||||
}).ToListAsync();
|
||||
|
||||
var lastdata = string.Empty;
|
||||
List<LocationOutput> LocationOutputs = new List<LocationOutput>();
|
||||
foreach (var data in list)
|
||||
{
|
||||
@@ -190,6 +201,7 @@ namespace Tnb.WarehouseMgr
|
||||
locationOutput.location_code = data.location_code.Replace("YCL-", "");
|
||||
locationOutput.layers = data.layers;
|
||||
locationOutput.type = 0;
|
||||
int status = 0;
|
||||
if (carrys.Where(p => p.location_id == data.id).Any())
|
||||
{
|
||||
var carry= carrys.Where(p => p.location_id == data.id).First();
|
||||
@@ -200,11 +212,69 @@ namespace Tnb.WarehouseMgr
|
||||
var carrycode = carrycodes.Where(p => p.carry_id == carry.id).First();
|
||||
locationOutput.type = 2;
|
||||
locationOutput.material_code = carrycode.material_code;
|
||||
locationOutput.barcode = carrycode.barcode;
|
||||
|
||||
if (mats.Where(p => p.id == carrycode.material_id).Any())
|
||||
{
|
||||
var mat = mats.Where(p => p.id == carrycode.material_id).First();
|
||||
locationOutput.material_name = mat.name;
|
||||
}
|
||||
|
||||
locationOutput.code_batch = carrycode.code_batch;
|
||||
locationOutput.num = carrycode.codeqty;
|
||||
|
||||
if (qcresults.Where(p => p.barcode == carrycode.barcode).Any())
|
||||
{
|
||||
var qcresult = qcresults.Where(p => p.barcode == carrycode.barcode).First();
|
||||
string qc_result = qcresult.qc_res;
|
||||
switch (qc_result)
|
||||
{
|
||||
case "await":
|
||||
{
|
||||
status = 3;
|
||||
break;
|
||||
}
|
||||
case "vergeOk":
|
||||
{
|
||||
status = 4;
|
||||
break;
|
||||
}
|
||||
case "no":
|
||||
{
|
||||
status = 5;
|
||||
break;
|
||||
}
|
||||
case "ok":
|
||||
{
|
||||
status = 2;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
status = 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = 3;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data.is_use == "1")
|
||||
{
|
||||
status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
lastdata = data.location_code;
|
||||
locationOutput.status = status;
|
||||
LocationOutputs.Add(locationOutput);
|
||||
|
||||
// 。。。。。。
|
||||
@@ -243,6 +313,7 @@ namespace Tnb.WarehouseMgr
|
||||
if (carrycodes.Where(p => p.carry_id == carry.id).Any())
|
||||
{
|
||||
var carrycode = carrycodes.Where(p => p.carry_id == carry.id).First();
|
||||
locationOutput.barcode = carrycode.barcode;
|
||||
locationOutput.type = 2;
|
||||
locationOutput.material_code = carrycode.material_code;
|
||||
locationOutput.num = carrycode.codeqty;
|
||||
|
||||
Reference in New Issue
Block a user