质检模块
This commit is contained in:
@@ -468,9 +468,11 @@ namespace Tnb.QcMgr
|
||||
//}, db);
|
||||
#endregion
|
||||
|
||||
List<PrdReport> prdReports= await db.Queryable<PrdReport>().Where(x => x.mo_task_id == prdMoTask.id && x.create_time >= CheckTaskInput.startEndTime[0].TimeStampToDateTime() && x.create_time <= CheckTaskInput.startEndTime[1].TimeStampToDateTime()).ToListAsync();
|
||||
//List<string> carryCodes = await db.Queryable<PrdReport>().Where(x => x.mo_task_id == prdMoTask.id && x.create_time >= CheckTaskInput.startEndTime[0].TimeStampToDateTime() && x.create_time <= CheckTaskInput.startEndTime[1].TimeStampToDateTime()).Select(x => x.material_box_code).Distinct().ToListAsync();
|
||||
var carryCodes= prdReports.Select(r=>r.material_box_code).Distinct().ToList();
|
||||
//载具需要在中储仓和暂存仓才需要暂控
|
||||
List<PrdReport> prdReports = await db.Queryable<PrdReport>().LeftJoin<WmsCarryH>((a, b) => a.material_box_code == b.carry_code).LeftJoin<BasLocation>((a, b, c) => b.location_id == c.id).LeftJoin<BasWarehouse>((a, b, c, d) => c.wh_id == d.id).Where((a, b, c, d) => a.mo_task_id == prdMoTask.id && a.create_time >= CheckTaskInput.startEndTime[0].TimeStampToDateTime() && a.create_time <= CheckTaskInput.startEndTime[1].TimeStampToDateTime() && (c.wh_id == WmsWareHouseConst.WAREHOUSE_ZC_ID || c.wh_id == WmsWareHouseConst.WAREHOUSE_ZCC_ID)).ToListAsync();
|
||||
if (prdReports != null)
|
||||
{
|
||||
var carryCodes = prdReports.Select(r => r.material_box_code).Distinct().ToList();
|
||||
if (carryCodes != null && carryCodes.Count > 0)
|
||||
{
|
||||
await db.Updateable<WmsCarryH>()
|
||||
@@ -512,7 +514,7 @@ namespace Tnb.QcMgr
|
||||
|
||||
#region 记录暂控处理单主/子表信息
|
||||
|
||||
if(carryCodes!=null && carryCodes.Count > 0)
|
||||
if (carryCodes != null && carryCodes.Count > 0)
|
||||
{
|
||||
|
||||
var basMaterial = await db.Queryable<BasMaterial>().Where(r => r.id == prdMoTask.material_id).FirstAsync();
|
||||
@@ -594,7 +596,7 @@ namespace Tnb.QcMgr
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -140,6 +140,21 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
wmsMaterialSignH.biz_type = wmsDistaskH.biz_type;
|
||||
|
||||
//已记录的物料签收记录表
|
||||
var wmsMaterialSignDs_ed = await _db.Queryable<WmsMaterialSignD>().Where(r => r.source_id == wmsDistaskH.source_id).ToListAsync();
|
||||
if (wmsMaterialSignDs_ed != null && wmsMaterialSignDs_ed.Count > 0)
|
||||
{
|
||||
//已下发数量
|
||||
var wmsRawmatOutstockD = await _db.Queryable<WmsRawmatOutstockD>().Where(r => r.id == wmsDistaskH.source_id).FirstAsync();
|
||||
var signed_qty = wmsMaterialSignDs_ed.Sum(r => r.sign_qty);//已签收数量
|
||||
var nowSign_qty = input.details.Sum(r => r.sign_qty);//当前需要签收数量
|
||||
//总签收数量不能大于总的下发数量
|
||||
if (signed_qty + nowSign_qty > wmsRawmatOutstockD.actual_outstock_qty)
|
||||
{
|
||||
throw new AppFriendlyException($"已签收数量{signed_qty},当前签收数量{nowSign_qty},总签收数量{signed_qty + nowSign_qty}不能大于已下发数量{wmsRawmatOutstockD.actual_outstock_qty}", 500);
|
||||
}
|
||||
}
|
||||
|
||||
// wms其它出库记录主表
|
||||
OtherOutstockAddDetailInput otherOutstockAddDetailInput = new OtherOutstockAddDetailInput();
|
||||
switch (wmsDistaskH.biz_type)
|
||||
@@ -197,6 +212,7 @@ namespace Tnb.WarehouseMgr
|
||||
wmsMaterialSignD.code_batch = wmsCarryCode.code_batch;
|
||||
wmsMaterialSignD.qty = wmsCarryCode.codeqty;
|
||||
wmsMaterialSignD.sign_qty = item.sign_qty;
|
||||
wmsMaterialSignD.source_id = wmsDistaskH.source_id;
|
||||
wmsMaterialSignDs.Add(wmsMaterialSignD);
|
||||
wmsCarryCode.codeqty = wmsCarryCode.codeqty - item.sign_qty;
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
"Cache": {
|
||||
"CacheType": "RedisCache", //MemoryCache
|
||||
"ip": "127.0.0.1",
|
||||
"port": 6379,
|
||||
"port": 6378,
|
||||
"password": "05jWEoJa8v",
|
||||
"RedisConnectionString": "{0}:{1},password={2}, poolsize=500,ssl=false,defaultDatabase=0"
|
||||
},
|
||||
"Redis": {
|
||||
"ip": "127.0.0.1",
|
||||
"port": 6379,
|
||||
"port": 6378,
|
||||
"password": "05jWEoJa8v",
|
||||
"RedisConnectionString": "{0}:{1},password={2}, poolsize=500,ssl=false,defaultDatabase=0"
|
||||
},
|
||||
"Redis2": {
|
||||
"ip": "127.0.0.1",
|
||||
"port": 6379,
|
||||
"port": 6378,
|
||||
"password": "05jWEoJa8v",
|
||||
"RedisConnectionString": "{0}:{1},password={2}, poolsize=500,ssl=false,defaultDatabase=1"
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
"DBType": "PostgreSQL", //MySql;SqlServer;Oracle;PostgreSQL;Dm;Kdbndp;Sqlite;
|
||||
//"Host": "192.168.11.109",
|
||||
"Host": "127.0.0.1",
|
||||
"Port": "5432",
|
||||
"Port": "5431",
|
||||
//"DBName": "tianyi_db",
|
||||
//"UserName": "postgres",
|
||||
//"Password": "pass@word123",
|
||||
"DBName": "tianyi",
|
||||
"UserName": "postgres",
|
||||
"Password": "pass@word123",
|
||||
"DBName": "tianyi_cwk2",
|
||||
"UserName": "totong",
|
||||
"Password": "IPANyxGSKxIXg0dBM",
|
||||
//SqlServer
|
||||
//"DefaultConnection": "server={0},{1};database={2};uid={3};pwd={4};MultipleActiveResultSets=true"
|
||||
//Kdbndp
|
||||
|
||||
Reference in New Issue
Block a user