取消逻辑调整 原材料看板调整
This commit is contained in:
@@ -13,6 +13,7 @@ using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.Common.Redis;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
@@ -261,16 +262,16 @@ namespace Tnb.WarehouseMgr
|
||||
status = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data.is_use == "1")
|
||||
{
|
||||
status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data.is_use == "1")
|
||||
{
|
||||
status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = 0;
|
||||
}
|
||||
status = 0;
|
||||
}
|
||||
}
|
||||
lastdata = data.location_code;
|
||||
@@ -284,6 +285,269 @@ namespace Tnb.WarehouseMgr
|
||||
return LocationOutputss;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<dynamic> GetYCLlocation2()
|
||||
{
|
||||
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.region_id != WmsWareHouseConst.REGION_YCLWX_ID)
|
||||
.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>();
|
||||
List<LocationOutput> LocationOutputsSum = new List<LocationOutput>();
|
||||
foreach (var data in list)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(lastdata) && data.location_code.Substring(4, 1) != lastdata.Substring(4, 1))
|
||||
{
|
||||
LocationOutputss.Add(LocationOutputs);
|
||||
LocationOutputs = new List<LocationOutput>();
|
||||
}
|
||||
LocationOutput locationOutput = new LocationOutput();
|
||||
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();
|
||||
locationOutput.carry_code = carry.carry_code;
|
||||
locationOutput.type = 1;
|
||||
if (carrycodes.Where(p => p.carry_id == carry.id).Any())
|
||||
{
|
||||
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);
|
||||
LocationOutputsSum.Add(locationOutput);
|
||||
|
||||
// 。。。。。。
|
||||
if (data.location_code == list[list.Count - 1].location_code)
|
||||
LocationOutputss.Add(LocationOutputs);
|
||||
}
|
||||
|
||||
|
||||
YCLBoardOutput YCLBoardOutput = new YCLBoardOutput();
|
||||
YCLBoardOutput.summary = new JObject {
|
||||
{ "0", LocationOutputsSum.Where(r => r.status == 0).Count() },
|
||||
{ "1", LocationOutputsSum.Where(r => r.status == 1).Count() },
|
||||
{ "2", LocationOutputsSum.Where(r => r.status == 2).Count() },
|
||||
{ "3", LocationOutputsSum.Where(r => r.status == 3).Count() },
|
||||
{ "4", LocationOutputsSum.Where(r => r.status == 4).Count() },
|
||||
{ "5", LocationOutputsSum.Where(r => r.status == 5).Count() }
|
||||
};
|
||||
YCLBoardOutput.locationOutputs = LocationOutputss;
|
||||
|
||||
return YCLBoardOutput;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<dynamic> GetYCLlocationWX()
|
||||
{
|
||||
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.region_id == WmsWareHouseConst.REGION_YCLWX_ID)
|
||||
.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>();
|
||||
List<LocationOutput> LocationOutputsSum = new List<LocationOutput>();
|
||||
foreach (var data in list)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(lastdata) && data.location_code.Substring(4, 1) != lastdata.Substring(4, 1))
|
||||
{
|
||||
LocationOutputss.Add(LocationOutputs);
|
||||
LocationOutputs = new List<LocationOutput>();
|
||||
}
|
||||
LocationOutput locationOutput = new LocationOutput();
|
||||
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();
|
||||
locationOutput.carry_code = carry.carry_code;
|
||||
locationOutput.type = 1;
|
||||
if (carrycodes.Where(p => p.carry_id == carry.id).Any())
|
||||
{
|
||||
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);
|
||||
LocationOutputsSum.Add(locationOutput);
|
||||
|
||||
// 。。。。。。
|
||||
if (data.location_code == list[list.Count - 1].location_code)
|
||||
LocationOutputss.Add(LocationOutputs);
|
||||
}
|
||||
|
||||
|
||||
YCLBoardOutput YCLBoardOutput = new YCLBoardOutput();
|
||||
YCLBoardOutput.summary = new JObject {
|
||||
{ "0", LocationOutputsSum.Where(r => r.status == 0).Count() },
|
||||
{ "1", LocationOutputsSum.Where(r => r.status == 1).Count() },
|
||||
{ "2", LocationOutputsSum.Where(r => r.status == 2).Count() },
|
||||
{ "3", LocationOutputsSum.Where(r => r.status == 3).Count() },
|
||||
{ "4", LocationOutputsSum.Where(r => r.status == 4).Count() },
|
||||
{ "5", LocationOutputsSum.Where(r => r.status == 5).Count() }
|
||||
};
|
||||
YCLBoardOutput.locationOutputs = LocationOutputss;
|
||||
|
||||
return YCLBoardOutput;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<dynamic> GetCTUlocation()
|
||||
|
||||
Reference in New Issue
Block a user