This commit is contained in:
2024-10-21 17:01:55 +08:00
8 changed files with 45 additions and 23 deletions

View File

@@ -579,6 +579,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
}
// 未锁定且已占用且库位中没有记录托盘 此时认为是叠盘机送过来的
// 20241018 业务变更 后续删除
var wmsLoc = db_BGWCarrySupplementtimer.Queryable<BasLocation>()
.LeftJoin<WmsCarryH>((a, b) => a.id == b.location_id)
.Where((a, b) => a.is_lock == 0 && a.is_use == "1"
@@ -606,7 +607,23 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
return false;
else
return true;
}).Select(r => r.Key);
}).Select(r => r.Key).ToList();
if (wmsLoc.Count() == 0)
{
OutStockStrategyQuery OutStockStrategyInput = new()
{
carrystd_id = WmsWareHouseConst.CARRY_TP_ID,
warehouse_id = WmsWareHouseConst.WAREHOUSE_YCL_ID,
Size = 1
};
List<WmsCarryH>? carrys = await _wareHouseService.OutStockStrategy(OutStockStrategyInput, db_BGWCarrySupplementtimer);
if (carrys.Count > 0)
{
wmsLoc = await db_BGWCarrySupplementtimer.Queryable<BasLocation>().Where(r => r.id == carrys[0].location_id).ToListAsync();
}
}
if (wmsLoc.Count() == 0)

View File

@@ -107,7 +107,7 @@ public partial class WmsPurchaseQcrecord : BaseEntity<string>
///
/// </summary>
[SugarColumn(IsIgnore = true)]
public string? material_specification { get; set; }
public string? container_no { get; set; }
}

View File

@@ -550,16 +550,16 @@ namespace Tnb.WarehouseMgr
BasLocation startLocation = item.Item4;
WmsSterilizationInstockH wmsSterilizationInstockH = await _db.Queryable<WmsSterilizationInstockH>().Where(r => r.carry_id == wmsCarryH.id
&& r.status == WmsWareHouseConst.BILLSTATUS_ADD_ID && r.origin == "外协调拨入库").FirstAsync();
if (wmsSterilizationInstockH == null)
{
throw new Exception($"【四楼静置仓到成品库】载具{wmsCarryH.carry_code}没有找到新增状态且来源是外协调拨入库的灭菌入库记录!");
}
if (wmsCarryH.location_id != wmsSterilizationInstockH.location_id)
{
throw new Exception($"【四楼静置仓到成品库】载具{wmsCarryH.carry_code}实际位置与灭菌入库记录位置不一致");
}
//WmsSterilizationInstockH wmsSterilizationInstockH = await _db.Queryable<WmsSterilizationInstockH>().Where(r => r.carry_id == wmsCarryH.id
//&& r.status == WmsWareHouseConst.BILLSTATUS_ADD_ID && r.origin == "外协调拨入库").FirstAsync();
//if (wmsSterilizationInstockH == null)
//{
// throw new Exception($"【四楼静置仓到成品库】载具{wmsCarryH.carry_code}没有找到新增状态且来源是外协调拨入库的灭菌入库记录!");
//}
//if (wmsCarryH.location_id != wmsSterilizationInstockH.location_id)
//{
// throw new Exception($"【四楼静置仓到成品库】载具{wmsCarryH.carry_code}实际位置与灭菌入库记录位置不一致");
//}
BasLocation startlocation = await _db.Queryable<BasLocation>().Where(r => r.id == wmsCarryH.location_id).FirstAsync();
@@ -568,11 +568,11 @@ namespace Tnb.WarehouseMgr
throw new Exception($"【四楼静置仓到成品库】 起点库位{startlocation.location_code}已锁定");
}
wmsSterilizationInstockH.status = WmsWareHouseConst.BILLSTATUS_ON_ID;
wmsSterilizationInstockH.cp_location_id = endLocations[instockLocIndex].id;
wmsSterilizationInstockH.cp_location_code = endLocations[instockLocIndex].location_code;
//wmsSterilizationInstockH.status = WmsWareHouseConst.BILLSTATUS_ON_ID;
//wmsSterilizationInstockH.cp_location_id = endLocations[instockLocIndex].id;
//wmsSterilizationInstockH.cp_location_code = endLocations[instockLocIndex].location_code;
await _db.Updateable(wmsSterilizationInstockH).UpdateColumns(r => new { r.status, r.cp_location_id, r.cp_location_code }).ExecuteCommandAsync();
//await _db.Updateable(wmsSterilizationInstockH).UpdateColumns(r => new { r.status, r.cp_location_id, r.cp_location_code }).ExecuteCommandAsync();
// 转库单载具子表
WmsMaterialTransferCarry wmsMaterialTransferCarry = new WmsMaterialTransferCarry();

View File

@@ -121,7 +121,10 @@ namespace Tnb.WarehouseMgr
// 托盘对应入库单
List<WmsInstockH> instock_mains = await _db.Queryable<WmsInstockH>().Where(x => x.source_id == wmsOutsourceD.fk_wms_outsource_order_id).ToListAsync();
if (instock_mains.Count == 0)
{
throw Oops.Bah($"委外收货单{wmsOutsourceH.bill_code}不存在此明细的入库记录!可能是入库任务还未执行完成或者物料是由人工入库");
}
List<WmsInstockD> allInstockDetails = await _db.Queryable<WmsInstockD>().Where(it => instock_mains.Select(r => r.id).Contains(it.bill_id) && it.material_code == wmsOutsourceD.matcode && it.code_batch == wmsOutsourceD.code_batch).OrderBy(x=>x.id).ToListAsync();
List<Dictionary<string, object>> requestData = new List<Dictionary<string, object>>();

View File

@@ -204,7 +204,7 @@ namespace Tnb.WarehouseMgr
is_lock = 0,
is_end = 0,
require_id = WmsOutsourceD.id,
require_code = WmsOutsourceH.outsource_order,
require_code = WmsOutsourceH.bill_code,
create_id = _userManager.UserId,
create_time = DateTime.Now,
required_type = WmsWareHouseConst.BILLTYPE_OUTSOURCE_ID,

View File

@@ -430,7 +430,7 @@ namespace Tnb.WarehouseMgr
case WmsWareHouseConst.BILLTYPE_OUTSOURCE_ID:
{
bill_type = WmsWareHouseConst.BILLTYPE_OUTSOURCEINSTOCK_ID;
source_main_id = (await _dbScanInStockByRedis.Queryable<WmsOutsourceD>().FirstAsync(it => it.id == source_id)).erp_outsource_order_d_pk;
source_main_id = (await _dbScanInStockByRedis.Queryable<WmsOutsourceD>().FirstAsync(it => it.id == source_id)).fk_wms_outsource_order_id;
break;
}
case WmsWareHouseConst.BILLTYPE_RAWMATTRANSFERINSTOCK_ID:

View File

@@ -135,8 +135,9 @@ namespace Tnb.WarehouseMgr
List<WmsInstockH> instock_mains = await _db.Queryable<WmsInstockH>().Where(x => x.source_id == wmsPurchaseD.bill_id).ToListAsync();
if (instock_mains.Count == 0)
{
throw Oops.Bah("不存在此明细的入库记录!可能是入库任务还未执行完成或者物料是由人工入库");
throw Oops.Bah($"采购收货单{wmsPurchaseH.bill_code}不存在此明细的入库记录!可能是入库任务还未执行完成或者物料是由人工入库");
}
List<WmsInstockD> allInstockDetails = await _db.Queryable<WmsInstockD>().Where(it => instock_mains.Select(r => r.id).Contains(it.bill_id) && it.material_id == wmsPurchaseD.material_id && it.code_batch == wmsPurchaseD.code_batch).OrderBy(x=>x.id).ToListAsync();

View File

@@ -91,9 +91,9 @@ namespace Tnb.WarehouseMgr
var _start_time = time.Count > 0 ? (long)time[0] : 0;
var _end_time = time.Count > 1 ? (long)time[1] : 0;
DateTimeOffset _start_timeofs = DateTimeOffset.FromUnixTimeSeconds((long)_start_time);
DateTimeOffset _start_timeofs = DateTimeOffset.FromUnixTimeMilliseconds((long)_start_time);
DateTime start_time = _start_timeofs.DateTime;
DateTimeOffset _end_timeofs = DateTimeOffset.FromUnixTimeSeconds((long)_end_time);
DateTimeOffset _end_timeofs = DateTimeOffset.FromUnixTimeMilliseconds((long)_end_time);
DateTime end_time = _end_timeofs.DateTime;
var data = await _db.Queryable<WmsPurchaseQcrecord>()
@@ -112,7 +112,8 @@ namespace Tnb.WarehouseMgr
material_id = a.material_id,
material_code = a.material_code,
material_name = a.material_name,
material_specification = b.material_specification,
container_no = b.material_standard,
material_spec = b.material_specification,
unit_id = c.FullName,
purchase_qty = a.purchase_qty,
purchase_prqty = a.purchase_prqty,