diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryCodeDetailOutput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryCodeDetailOutput.cs
index 6c391389..41dec7d9 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryCodeDetailOutput.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryCodeDetailOutput.cs
@@ -14,15 +14,15 @@ namespace Tnb.WarehouseMgr.Entities.Dto
///
/// 物料单位
///
- public string unit_id { get; set; }
+ public string? unit_id { get; set; }
///
/// 条码编号
///
- public string barcode { get; set; }
+ public string? barcode { get; set; }
///
/// 条码批次
///
- public string code_batch { get; set; }
+ public string? code_batch { get; set; }
///
/// 条码数量
///
@@ -30,12 +30,12 @@ namespace Tnb.WarehouseMgr.Entities.Dto
///
/// 物料编号
///
- public string material_code { get; set; }
+ public string? material_code { get; set; }
///
/// 物料名称
///
- public string material_name { get; set; }
+ public string? material_name { get; set; }
- public string material_id { get; set; }
+ public string? material_id { get; set; }
}
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/InStockDetailOutput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/InStockDetailOutput.cs
index 7d239f16..f93348fd 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/InStockDetailOutput.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/InStockDetailOutput.cs
@@ -14,31 +14,31 @@ namespace Tnb.WarehouseMgr.Entities.Dto
///
/// 入库单明细Id
///
- public string id { get; set; }
+ public string? id { get; set; }
///
/// 入库单Id
///
- public string bill_id { get; set; }
+ public string? bill_id { get; set; }
///
/// 单位id
///
- public string unit_id { get; set; }
+ public string? unit_id { get; set; }
///
/// 批次
///
- public string code_batch { get; set; }
+ public string? code_batch { get; set; }
///
/// 入库仓库Id
///
- public string warehouse_id { get; set; }
+ public string? warehouse_id { get; set; }
///
/// 执行状态
///
- public string line_status { get; set; }
+ public string? line_status { get; set; }
///
/// 原因
///
- public string reason { get; set; }
+ public string? reason { get; set; }
///
/// 需求数量
///
@@ -78,6 +78,6 @@ namespace Tnb.WarehouseMgr.Entities.Dto
///
/// 条码明细
///
- public List CodeDetails { get; set; }
+ public List? CodeDetails { get; set; }
}
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs
index 422946cd..01aa48a3 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs
@@ -22,7 +22,7 @@ public partial class WmsCarryCode : BaseEntity, IWmsCarryEntity
///
/// 上级载具ID
///
- public string? carry_id { get; set; }
+ public string carry_id { get; set; }
///
/// 物品ID
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/BasRegionUserService.cs b/WarehouseMgr/Tnb.WarehouseMgr/BasRegionUserService.cs
index 172c4134..3ca2e321 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/BasRegionUserService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/BasRegionUserService.cs
@@ -46,7 +46,7 @@ namespace Tnb.WarehouseMgr
}
if (input.data.ContainsKey(nameof(BasRegionUser.region_id)) && input.data.ContainsKey(nameof(BasRegionUser.user_id)))
{
- var regionId = input.data[nameof(BasRegionUser.region_id)].ToString();
+ var regionId = input.data[nameof(BasRegionUser.region_id)].ToString()!;
var userId = input.data[nameof(BasRegionUser.user_id)].ToString();
var user = await _db.Queryable().Where(it => it.region_id == regionId && it.user_id == userId).FirstAsync();
if (user != null)
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/Dp.cs b/WarehouseMgr/Tnb.WarehouseMgr/Dp.cs
index 245a7fc0..cea22b84 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/Dp.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/Dp.cs
@@ -25,9 +25,6 @@ namespace Tnb.WarehouseMgr
///
/// 动态规划函数
///
- ///
- ///
- ///
///
public void DpFunc(List roads, List pointIds, Dictionary isVisited, string sPointId, string ePointId, dynamic ArrivedEpoint)
{
@@ -37,7 +34,7 @@ namespace Tnb.WarehouseMgr
if (!isVisited[sPointId])
{
pointIds.Add(sPointId);
- set.Add(roads.Find(x => x.startpoint_id == sPointId).startpoint_code);
+ set.Add(roads?.Find(x => x.startpoint_id == sPointId)?.startpoint_code!);
isVisited[sPointId] = true;
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs
index 336c76f3..63917c94 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs
@@ -119,7 +119,7 @@ namespace Tnb.WarehouseMgr
x.bill_d_id = wmsInstockD.id;
});
}
- isOk = await _update(wmsInstockD, wmsInstockCodes);
+ isOk = await _update(wmsInstockD, wmsInstockCodes!);
break;
case EnumInOutStockType.Out:
var wmsOutstockD = input.Adapt();
@@ -143,12 +143,11 @@ namespace Tnb.WarehouseMgr
///
/// 根据明细Id获取出入库明细信息
///
- ///
///
[HttpGet]
- public async Task GetInOutStockCodesById([FromQuery] InOutStockDetailQuery input)
+ public async Task GetInOutStockCodesById([FromQuery] InOutStockDetailQuery input)
{
- dynamic result = null;
+ dynamic? result = null;
var dic = await _dictionaryDataService.GetDictionaryByTypeId(WmsWareHouseConst.WMS_INSTOCK_D_BILL_STATUS_TYPEID);
switch (input.inoutStockType)
{
@@ -175,7 +174,7 @@ namespace Tnb.WarehouseMgr
all_amount = a.all_amount,
CodeDetails = SqlFunc.Subqueryable().Where(it => it.bill_d_id == a.id).ToList(),
})
- .Mapper(it => it.line_status = dic.ContainsKey(it.line_status) ? dic[it.line_status]?.ToString()! : "")
+ .Mapper(it => it.line_status = dic.ContainsKey(it.line_status!) ? dic[it.line_status!]?.ToString()! : "")
.ToListAsync();
break;
@@ -218,9 +217,8 @@ namespace Tnb.WarehouseMgr
items = await _db.Queryable().Where(it => it.wh_id == input.warehouse_id && it.is_lock == 0 && it.is_type == "0" && it.is_use == (int)EnumCarryStatus.空闲).OrderBy(it => new { it.layers, it.loc_line, it.loc_column }, OrderByType.Asc).ToListAsync();
}
- catch (Exception ex)
+ catch (Exception)
{
-
throw;
}
return items.Take(input.Size).ToList();
@@ -232,7 +230,7 @@ namespace Tnb.WarehouseMgr
[HttpGet]
public async Task OutStockStrategy()
{
- return Task.FromResult(true);
+ return await Task.FromResult(true);
}
///
/// 生成任务执行
@@ -475,11 +473,12 @@ namespace Tnb.WarehouseMgr
await _db.Updateable().SetColumns(it => new WmsCarryH { is_lock = 0, location_id = multiList[i].endlocation_id, location_code = multiList[i].endlocation_code }).Where(it => it.id == multiList[i].carry_id).ExecuteCommandAsync();
//更新条码的库位和仓库信息
var carryCodes = await _db.Queryable().Where(it => it.id == multiList[i].carry_id).ToListAsync();
- if (carryCodes?.Count>0) {
+ if (carryCodes?.Count > 0)
+ {
var loc = await _db.Queryable().SingleAsync(it => it.id == multiList[i].endlocation_id);
await _db.Updateable().SetColumns(it => new WmsCarryCode { warehouse_id = loc.wh_id, location_id = multiList[i].endlocation_id, location_code = multiList[i].endlocation_code }).Where(it => it.id == multiList[i].carry_id).ExecuteCommandAsync();
}
-
+
}
}
//更新库位信息,使用状态为 使用,锁定状态为未锁定
@@ -503,7 +502,7 @@ namespace Tnb.WarehouseMgr
foreach (var dt in disTasks)
{
var disTaskCodes = await _db.Queryable().Where(it => it.bill_id == dt.id).ToListAsync();
- var upInput = new WareHouseUpInput { bizTypeId = dt.biz_type, requireId = dt.require_id, distaskCodes = disTaskCodes, carryIds = disTasks.Select(x => x.carry_id).ToList() };
+ var upInput = new WareHouseUpInput { bizTypeId = dt.biz_type, requireId = dt.require_id!, distaskCodes = disTaskCodes, carryIds = disTasks.Select(x => x.carry_id).ToList() };
upInput.loginType = !_userManager.LoginType.IsNullOrEmpty() ? "app" : "web";
if (dt.is_sign == 1 && dt.chain_type == "3")
{
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs
index 50e377e4..3cb9e96c 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs
@@ -122,7 +122,7 @@ namespace Tnb.WarehouseMgr
}
await _db.Ado.CommitTranAsync();
}
- catch (Exception ex)
+ catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryLedgerService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryLedgerService.cs
index c8c37253..682d63c4 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryLedgerService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryLedgerService.cs
@@ -99,7 +99,7 @@ namespace Tnb.WarehouseMgr
// }
//}
}
- return data;
+ return data!;
}
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveInStockService.cs
index ab349cb8..e6df3d6f 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveInStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveInStockService.cs
@@ -69,10 +69,10 @@ namespace Tnb.WarehouseMgr
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_CARRYMOVEINSTOCK_ID, true);
await _runService.Create(templateEntity, input);
//入库取终点 //出库起点
- var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
+ var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString()!, Size = 1 };
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
- WmsPointH sPoint = null;
- WmsPointH ePoint = null;
+ WmsPointH sPoint = null!;
+ WmsPointH ePoint = null!;
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
{
sPoint = await _db.Queryable().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
@@ -95,11 +95,11 @@ namespace Tnb.WarehouseMgr
var ePoint = it.LastOrDefault();
WmsPretaskH preTask = new();
- preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.org_id = _userManager.User.OrganizeId!;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
@@ -108,7 +108,7 @@ namespace Tnb.WarehouseMgr
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = input.data["ReturnIdentity"].ToString();
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
@@ -116,24 +116,24 @@ namespace Tnb.WarehouseMgr
preTask.create_time = DateTime.Now;
return preTask;
}).ToList();
- var isOk = await _wareHouseService.GenPreTask(preTasks, null);
+ var isOk = await _wareHouseService.GenPreTask(preTasks, null!);
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
- preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
+ preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
- preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
- preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
- preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
+ preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
+ preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
+ preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
WmsHandleH handleH = new();
handleH.org_id = _userManager.User.OrganizeId;
- handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString();
- handleH.endlocation_id = endLocations[0].id;
- handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString();
- handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString();
- handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString();
- handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString();
+ handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString()!;
+ handleH.endlocation_id = endLocations![0].id;
+ handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
+ handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString()!;
+ handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString()!;
+ handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!;
handleH.require_id = input.data["ReturnIdentity"].ToString();
handleH.require_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
handleH.create_id = _userManager.UserId;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs
index 92f7b4b2..5a01a90e 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs
@@ -93,10 +93,10 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = new();
preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
@@ -105,7 +105,7 @@ namespace Tnb.WarehouseMgr
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = input.data["ReturnIdentity"].ToString();
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
@@ -122,11 +122,11 @@ namespace Tnb.WarehouseMgr
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
- preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
+ preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
- preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
- preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
- preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
+ preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
+ preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
+ preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
preTaskUpInput.PreTaskRecords = preTasks.Adapt>();
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
//根据载具移出Id,回更单据状态
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs
index 42cab97b..0aba37d9 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs
@@ -60,7 +60,7 @@ namespace Tnb.WarehouseMgr
{
var carryOutPut = await _db.Queryable().Where(it => it.id == carryId).Select().FirstAsync();
if (carryOutPut == null) throw new AppFriendlyException("找不到载具", 500);
- carryOutPut.carryDetails = await _db.Queryable().Where(it=>it.carry_id == carryId).ToListAsync();
+ carryOutPut.carryDetails = await _db.Queryable().Where(it => it.carry_id == carryId).ToListAsync();
carryOutPut.carryCodes = await _db.Queryable().Where(it => it.carry_id == carryId).ToListAsync();
carryOutPut.carryMats = await _db.Queryable().Where(it => it.carry_id == carryId).ToListAsync();
return carryOutPut;
@@ -154,6 +154,7 @@ namespace Tnb.WarehouseMgr
return isOk;
}
+ [NonAction]
public async Task UpdateNullCarry(WmsCarryH carryObj)
{
var row = -1;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs
index 7b8577ae..f458c58b 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs
@@ -113,7 +113,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
- catch (Exception ex)
+ catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCollocationSchemeSevice.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCollocationSchemeSevice.cs
index dbf2277d..9150fd9a 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCollocationSchemeSevice.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCollocationSchemeSevice.cs
@@ -53,7 +53,7 @@ namespace Tnb.WarehouseMgr
if (input.data.ContainsKey(nameof(WmsCollocationSchemeH.material_code)))
{
- materialCode = input.data[nameof(WmsCollocationSchemeH.material_code)]?.ToString();
+ materialCode = input.data[nameof(WmsCollocationSchemeH.material_code)]?.ToString()!;
}
if (input.data.ContainsKey(nameof(WmsCollocationSchemeH.seq)) && input.data[nameof(WmsCollocationSchemeH.seq)] != null)
{
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs
index 524da1b1..df656f83 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs
@@ -47,7 +47,6 @@ namespace Tnb.WarehouseMgr
private readonly IWareHouseService _wareHouseService;
private readonly IBillRullService _billRullService;
private readonly IUserManager _userManager;
- public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
public WmsDeliveryService(
ISqlSugarRepository repository,
IRunService runService,
@@ -137,10 +136,10 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = new();
preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
@@ -149,7 +148,7 @@ namespace Tnb.WarehouseMgr
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_TRANSFER_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = input.data["ReturnIdentity"].ToString();
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
@@ -157,7 +156,7 @@ namespace Tnb.WarehouseMgr
preTask.create_time = DateTime.Now;
return preTask;
}).ToList();
- var isOk = await _wareHouseService.GenPreTask(preTasks, null);
+ var isOk = await _wareHouseService.GenPreTask(preTasks, null!);
if (isOk)
{
if (input.data.ContainsKey(nameof(WmsDelivery.startlocation_id)) && input.data.ContainsKey(nameof(WmsDelivery.endlocation_id)) && input.data[nameof(WmsDelivery.endlocation_id)] != null && input.data[nameof(WmsDelivery.endlocation_id)] != null)
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs
index 8f2eca3b..80e2155d 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs
@@ -69,7 +69,7 @@ namespace Tnb.WarehouseMgr
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSEMPTYINSTOCK_ID, true);
await _runService.Create(templateEntity, input);
//入库取终点
- var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
+ var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString()!, Size = 1 };
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
WmsPointH sPoint = null;
WmsPointH ePoint = null;
@@ -96,10 +96,10 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = new();
preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
@@ -108,7 +108,7 @@ namespace Tnb.WarehouseMgr
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = input.data["ReturnIdentity"].ToString();
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
@@ -120,22 +120,22 @@ namespace Tnb.WarehouseMgr
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
- preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
+ preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
- preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
- preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
+ preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
+ preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
preTaskUpInput.LocationIds = points.Select(x => x.id).ToList();
preTaskUpInput.PreTaskRecords = preTasks.Adapt>();
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
WmsHandleH handleH = new();
handleH.org_id = _userManager.User.OrganizeId;
- handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString();
- handleH.endlocation_id = endLocations[0].id;
- handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString();
- handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString();
- handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString();
- handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString();
+ handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString()!;
+ handleH.endlocation_id = endLocations![0].id;
+ handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
+ handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString()!;
+ handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString()!;
+ handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!;
handleH.require_id = input.data["ReturnIdentity"].ToString();
handleH.require_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
handleH.create_id = _userManager.UserId;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs
index f99e6907..e22b93d0 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs
@@ -143,18 +143,18 @@ namespace Tnb.WarehouseMgr
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
- preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
+ preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
preTaskUpInput.CarryId = carrys![i].id;
- preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
- preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
- preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
+ preTaskUpInput.CarryStartLocationId = points!.FirstOrDefault()!.location_id!;
+ preTaskUpInput.CarryStartLocationCode = points!.FirstOrDefault()!.location_code!;
+ preTaskUpInput.LocationIds = points!.Select(x => x.location_id).ToList()!;
//更新明细表
WmsEmptyOutstockD wmsEmptyOutstockD = new();
wmsEmptyOutstockD.id = SnowflakeIdHelper.NextId();
wmsEmptyOutstockD.bill_id = preTaskUpInput.RquireId;
wmsEmptyOutstockD.biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID;
- wmsEmptyOutstockD.location_id = ePoint.location_id;
+ wmsEmptyOutstockD.location_id = ePoint.location_id!;
wmsEmptyOutstockD.status = WmsWareHouseConst.BILLSTATUS_ON_ID;
wmsEmptyOutstockD.carry_id = carrys[i].id;
wmsEmptyOutstockD.carry_code = carrys[i].carry_code;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsFeedingService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsFeedingService.cs
index e1c65cae..bc4576b2 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsFeedingService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsFeedingService.cs
@@ -42,7 +42,7 @@ namespace Tnb.WarehouseMgr
.Select(a => new CarryCodeDetailOutput
{
barcode = a.barcode,
- code_batch = a.code_batch,
+ code_batch = a.code_batch!,
codeqty = a.codeqty,
material_code = a.material_code,
material_id = a.material_id,
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs
index c424d449..1aeb40d0 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs
@@ -9,6 +9,7 @@ using JNPF.Common.Dtos.VisualDev;
using JNPF.Common.Extension;
using JNPF.Common.Security;
using JNPF.FriendlyException;
+using JNPF.Logging;
using JNPF.Systems.Interfaces.System;
using Mapster;
using Microsoft.AspNetCore.Mvc;
@@ -42,11 +43,19 @@ namespace Tnb.WarehouseMgr
private readonly IWareHouseService _wareHouseService;
private readonly IBillRullService _billRullService;
private static Dictionary _dicBillCodes = new();
- public WmsInStockService(ISqlSugarRepository repository, IDictionaryDataService dictionaryDataService, IUserManager userManager)
+ public WmsInStockService(
+ ISqlSugarRepository repository,
+ IDictionaryDataService dictionaryDataService,
+ IUserManager userManager,
+ IBillRullService billRullService,
+ IWareHouseService wareHouseService
+ )
{
_db = repository.AsSugarClient();
_dictionaryDataService = dictionaryDataService;
_userManager = userManager;
+ _billRullService = billRullService;
+ _wareHouseService = wareHouseService;
}
///
/// 根据入库申请单ID获取申请单明细信息
@@ -150,7 +159,7 @@ namespace Tnb.WarehouseMgr
}
}
- private async Task CreateInstock(WmsInstockD detail, int no)
+ private Task CreateInstock(WmsInstockD detail, int no)
{
WmsTempCode barCode = new();
barCode.org_id = detail.org_id;
@@ -167,7 +176,7 @@ namespace Tnb.WarehouseMgr
barCode.require_code = _dicBillCodes.ContainsKey(detail.bill_id) ? _dicBillCodes[detail.bill_id]?.ToString() : "";
barCode.create_id = _userManager.UserId;
barCode.create_time = DateTime.Now;
- return barCode;
+ return Task.FromResult(barCode);
}
@@ -210,7 +219,8 @@ namespace Tnb.WarehouseMgr
await _db.Updateable().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync();
//如果是自动单据,需要回更上层系统
}
- else {
+ else
+ {
//任务没有结束,更新状态为工作中
await _db.Updateable().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync();
}
@@ -230,8 +240,8 @@ namespace Tnb.WarehouseMgr
///
///
///
- //[HttpPost]
- private async Task MESCreateInstock(VisualDevModelDataCrInput input)
+ [HttpPost]
+ public async Task MESCreateInstock(VisualDevModelDataCrInput input)
{
try
{
@@ -240,8 +250,9 @@ namespace Tnb.WarehouseMgr
List instockds = new();
List instockcodes = new();
//入库申请主表
- if (input.data.ContainsKey("wmsInStockH")) {
- instock = input.data.ContainsKey("wmsInStockH").ToObject();
+ if (input.data.ContainsKey("wmsInStockH"))
+ {
+ instock = input.data.ContainsKey("wmsInStockH").ToObject();
}
//入库申请物料明细表
if (input.data.ContainsKey("wmsInStockds"))
@@ -252,13 +263,16 @@ namespace Tnb.WarehouseMgr
}
}
//入库申请条码明细表
- if (input.data.ContainsKey("wmsInStockCodes")) {
- if (input.data["wmsInStockCodes"] != null && input.data["wmsInStockCodes"].IsNotEmptyOrNull()) {
+ if (input.data.ContainsKey("wmsInStockCodes"))
+ {
+ if (input.data["wmsInStockCodes"] != null && input.data["wmsInStockCodes"].IsNotEmptyOrNull())
+ {
instockcodes = input.data["wmsInStockCodes"].ToObject>();
}
}
//如果数据不全,
- if (instock.IsNotEmptyOrNull() || instock.carry_id.IsEmpty()|| instock.location_id.IsEmpty() || instockds.Count<1 || instockcodes.Count<1) {
+ if (instock.IsNull() || instock.carry_id.IsEmpty() || instock.location_id.IsEmpty() || instockds.Count < 1 || instockcodes.Count < 1)
+ {
//报错, 提示数据不全。
throw new AppFriendlyException("数据不全!", 500);
}
@@ -267,7 +281,7 @@ namespace Tnb.WarehouseMgr
instock.biz_type = WmsWareHouseConst.BIZTYPE_WMSINSTOCK_ID;
instock.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_INSTOCK_ENCODE).GetAwaiter().GetResult();
instock.generate_type = "1";// 自动
- instock.sync_status =WmsWareHouseConst.SYNC_STATUS__NOTSYNC;//未同步
+ instock.sync_status = WmsWareHouseConst.SYNC_STATUS__NOTSYNC;//未同步
instock.print_status = WmsWareHouseConst.PRINT_STATUS_PRINTCOMPLETE;//已打印
instock.status = WmsWareHouseConst.BILLSTATUS_ADD_ID;// 新增
instock.create_time = DateTime.Now;
@@ -288,6 +302,7 @@ namespace Tnb.WarehouseMgr
//条码表
foreach (var instockcode in instockcodes)
{
+ instockcode.id = SnowflakeIdHelper.NextId();
var materialId = instockcode.material_id;
var materialCode = instockcode.material_code;
var codeBatch = instockcode.code_batch;
@@ -305,10 +320,10 @@ namespace Tnb.WarehouseMgr
instockCOdes.Add(c);
}
}
- var orgId = _userManager.User.OrganizeId;
+ var orgId = _userManager.User.OrganizeId;
await _db.Insertable(instockCOdes).CallEntityMethod(it => it.Create(orgId)).ExecuteCommandAsync();
-
+
//生成预任务申请
//入库取终点 //出库起点
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = instock.warehouse_id, Size = 1 };
@@ -348,8 +363,8 @@ namespace Tnb.WarehouseMgr
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = instock.biz_type;
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
- preTask.carry_id = instock.carry_id;
- preTask.carry_code = instock.carry_code;
+ preTask.carry_id = instock.carry_id!;
+ preTask.carry_code = instock.carry_code!;
preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = instock.id;
@@ -384,11 +399,10 @@ namespace Tnb.WarehouseMgr
var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes);
if (isOk)
{
- var requireIdField = "require_id";
var preTaskUpInput = new GenPreTaskUpInput();
preTaskUpInput.RquireId = instock.id;
- preTaskUpInput.CarryId = instock.carry_id;
+ preTaskUpInput.CarryId = instock.carry_id!;
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
@@ -400,9 +414,9 @@ namespace Tnb.WarehouseMgr
{
var handleH = instock.Adapt();
operBillId = handleH.id = SnowflakeIdHelper.NextId();
- handleH.startlocation_id = instock.location_id;
- handleH.carry_id = instock.carry_id;
- handleH.carry_code = instock.carry_code;
+ handleH.startlocation_id = instock.location_id!;
+ handleH.carry_id = instock.carry_id!;
+ handleH.carry_code = instock.carry_code!;
preTaskUpInput.PreTaskRecord = handleH;
}
//创建预任务条码操作记录
@@ -426,7 +440,7 @@ namespace Tnb.WarehouseMgr
{
x.id = SnowflakeIdHelper.NextId();
x.is_out = 0;
- x.carry_id = instock.carry_id;
+ x.carry_id = instock!.carry_id!;
});
await _db.Insertable(carryCodes).ExecuteCommandAsync();
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
@@ -435,7 +449,7 @@ namespace Tnb.WarehouseMgr
if (instockCOdes?.Count > 0)
{
await _db.Updateable().SetColumns(it => new WmsInstockD { line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => instockCOdes.Select(x => x.bill_d_id).Contains(it.id)).ExecuteCommandAsync();
- await _db.Updateable().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == instock.id).ExecuteCommandAsync();
+ await _db.Updateable().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == instock!.id).ExecuteCommandAsync();
}
}
}
@@ -446,6 +460,7 @@ namespace Tnb.WarehouseMgr
}
catch (Exception ex)
{
+ JNPF.Logging.Log.Error(ex.Message);
await _db.Ado.RollbackTranAsync();
throw;
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs
index aac5ea10..57d856cf 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs
@@ -70,7 +70,7 @@ namespace Tnb.WarehouseMgr
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSKITTINGINSTK_ID, true);
await _runService.Create(templateEntity, input);
//入库取终点 //出库起点
- var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
+ var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString()!, Size = 1 };
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
WmsPointH sPoint = null;
WmsPointH ePoint = null;
@@ -97,10 +97,10 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = new();
preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
@@ -109,7 +109,7 @@ namespace Tnb.WarehouseMgr
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = input.data["ReturnIdentity"].ToString();
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
@@ -143,20 +143,20 @@ namespace Tnb.WarehouseMgr
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
- preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
+ preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
- preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
- preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
- preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
+ preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
+ preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
+ preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
WmsHandleH handleH = new();
handleH.org_id = _userManager.User.OrganizeId;
- handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString();
- handleH.endlocation_id = endLocations[0].id;
- handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString();
- handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString();
- handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString();
- handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString();
+ handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString()!;
+ handleH.endlocation_id = endLocations![0].id;
+ handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
+ handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString()!;
+ handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString()!;
+ handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!;
handleH.require_id = input.data["ReturnIdentity"].ToString();
handleH.require_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
handleH.create_id = _userManager.UserId;
@@ -173,7 +173,7 @@ namespace Tnb.WarehouseMgr
carryCodes.ForEach(x =>
{
x.id = SnowflakeIdHelper.NextId();
- x.carry_id = input.data[nameof(WmsHandleH.carry_id)].ToString();
+ x.carry_id = input.data[nameof(WmsHandleH.carry_id)].ToString()!;
x.create_id = _userManager.UserId;
x.create_time = DateTime.Now;
});
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutBaleService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutBaleService.cs
index ffe89bbd..bc9210e6 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutBaleService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutBaleService.cs
@@ -96,10 +96,10 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = new();
preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
@@ -108,7 +108,7 @@ namespace Tnb.WarehouseMgr
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = input.data["ReturnIdentity"].ToString();
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
@@ -126,11 +126,11 @@ namespace Tnb.WarehouseMgr
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
- preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
+ preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
- preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
- preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
- preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
+ preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
+ preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
+ preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
preTaskUpInput.PreTaskRecords = preTasks.Adapt>();
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
//根据载具移出Id,回更单据状态
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs
index 44e952a1..56bc3f13 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Aop.Api.Domain;
+using JNPF.Common.Contracts;
using JNPF.Common.Core.Manager;
using JNPF.Common.Dtos.VisualDev;
using JNPF.Common.Extension;
@@ -16,6 +17,7 @@ using JNPF.VisualDev.Interfaces;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
+using SqlSugar.DbConvert;
using Tnb.BasicData.Entities;
using Tnb.WarehouseMgr.Entities;
using Tnb.WarehouseMgr.Entities.Attributes;
@@ -231,7 +233,7 @@ namespace Tnb.WarehouseMgr
var curPreTaskCodes = partCodes.Adapt>();
curPreTaskCodes.ForEach(x =>
{
- x.id=SnowflakeIdHelper.NextId();
+ x.id = SnowflakeIdHelper.NextId();
x.bill_id = pt.id;
x.create_time = DateTime.Now;
});
@@ -282,14 +284,24 @@ namespace Tnb.WarehouseMgr
[HttpGet]
public async Task Testxx()
{
- var carryCodePropNames = typeof(WmsCarryCode).GetProperties().Select(p => p.Name);
- var outStockCodePropNames = typeof(WmsSetsortingCode).GetProperties().Select(p => p.Name);
- var intersects = carryCodePropNames.Intersect(outStockCodePropNames).ToList();
- var excepts = carryCodePropNames.Except(outStockCodePropNames).ToList();
- var excepts2 = outStockCodePropNames.Except(carryCodePropNames).ToList();
+ //var carryCodePropNames = typeof(WmsCarryCode).GetProperties().Select(p => p.Name);
+ //var outStockCodePropNames = typeof(WmsSetsortingCode).GetProperties().Select(p => p.Name);
+ //var intersects = carryCodePropNames.Intersect(outStockCodePropNames).ToList();
+ //var excepts = carryCodePropNames.Except(outStockCodePropNames).ToList();
+ //var excepts2 = outStockCodePropNames.Except(carryCodePropNames).ToList();
//bill_id,bill_line,bill_d_id,bill_d_line,code_qty
- var str = "";
+
+ //try
+ //{
+ // var dddd = await _db.Queryable().Where(it => it.status == 8).ToListAsync();
+ //}
+ //catch (Exception ex)
+ //{
+
+ // throw;
+ //}
+ //var str = "";
}
@@ -324,7 +336,7 @@ namespace Tnb.WarehouseMgr
}
x.id = SnowflakeIdHelper.NextId();
x.bill_id = input.requireId;
- x.bill_d_id = billDId;
+ x.bill_d_id = billDId!;
x.org_id = _userManager.User.OrganizeId;
x.create_id = _userManager.UserId;
x.create_time = DateTime.Now;
@@ -376,7 +388,7 @@ namespace Tnb.WarehouseMgr
}
x.id = SnowflakeIdHelper.NextId();
x.bill_id = input.requireId;
- x.bill_d_id = billDId;
+ x.bill_d_id = billDId!;
x.org_id = _userManager.User.OrganizeId;
x.create_id = _userManager.UserId;
x.create_time = DateTime.Now;
@@ -413,7 +425,7 @@ namespace Tnb.WarehouseMgr
await _db.Updateable().SetColumns(it => new WmsOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync();
}
- var carryCodes = await _db.Queryable().Where(it => input.carryIds.Contains(it.carry_id)).ToListAsync();
+ var carryCodes = await _db.Queryable().Where(it => input.carryIds.Contains(it.carry_id!)).ToListAsync();
var dicCodeQty = carryCodes.GroupBy(g => g.barcode).ToDictionary(x => x.Key, x => x.First().codeqty);
var dicUpdate = new Dictionary();
var delBarcodes = new List();
@@ -480,4 +492,22 @@ namespace Tnb.WarehouseMgr
}
}
}
+
+ [SugarTable("test_tt")]
+ public class TestTT
+ {
+ [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
+ public int id { get; set; }
+ //[SugarColumn( SqlParameterDbType = typeof(CommonPropertyConvert))]
+ public int status { get; set; }
+ }
+
+ public enum EnumTestType
+ {
+ Normal = 1,
+ Error = 2,
+ Warn = 4,
+ Info = 8,
+ Faild = 16,
+ }
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDABindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDABindService.cs
index 66cc277b..392adc56 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDABindService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDABindService.cs
@@ -29,17 +29,9 @@ namespace Tnb.WarehouseMgr
[OverideVisualDev(ModuleConsts.MODULE_WMSBINDINGPDA_ID)]
public class WmsPDABindService : WmsCarryService, IPdaStroage
{
- private readonly ISqlSugarClient _db;
- private readonly IUserManager _userManager;
- private readonly IBillRullService _billRullService;
- private readonly IRunService _runService;
- private readonly IVisualDevService _visualDevService;
- public WmsPDABindService(
- ISqlSugarRepository repository,
- IUserManager userManager,
- IBillRullService billRullService,
- IRunService runService,
- IVisualDevService visualDevService) : base(repository, userManager, billRullService, runService, visualDevService)
+ public WmsPDABindService(ISqlSugarRepository repository, IUserManager userManager,
+ IBillRullService billRullService, IRunService runService,
+ IVisualDevService visualDevService) : base(repository, userManager, billRullService, runService, visualDevService)
{
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs
index fd621afc..b799a1e7 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs
@@ -69,7 +69,7 @@ namespace Tnb.WarehouseMgr
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true);
await _runService.Create(templateEntity, input);
//入库取终点 //出库起点
- var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
+ var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString()!, Size = 1 };
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
WmsPointH sPoint = null;
WmsPointH ePoint = null;
@@ -96,10 +96,10 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = new();
preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
@@ -108,7 +108,7 @@ namespace Tnb.WarehouseMgr
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = input.data["ReturnIdentity"].ToString();
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
@@ -120,11 +120,11 @@ namespace Tnb.WarehouseMgr
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
- preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
+ preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
- preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
- preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
- preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
+ preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
+ preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
+ preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
preTaskUpInput.PreTaskRecords = preTasks.Adapt>();
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
//根据载具移入Id,回更单据状态
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs
index 2cd84bfc..372ff3da 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs
@@ -93,10 +93,10 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = new();
preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
@@ -105,7 +105,7 @@ namespace Tnb.WarehouseMgr
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = input.data["ReturnIdentity"].ToString();
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
@@ -123,11 +123,11 @@ namespace Tnb.WarehouseMgr
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
- preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
+ preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
- preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
- preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
- preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
+ preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
+ preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
+ preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
preTaskUpInput.PreTaskRecords = preTasks.Adapt>();
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryReplaceService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryReplaceService.cs
index bb06bbc8..711685ce 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryReplaceService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryReplaceService.cs
@@ -29,11 +29,6 @@ namespace Tnb.WarehouseMgr
[OverideVisualDev(ModuleConsts.MODULE_WMSCARRYREPLACEPDA_ID)]
public class WmsPDACarryReplaceService : WmsCarryService ,IPdaStroage
{
- private readonly ISqlSugarClient _db;
- private readonly IUserManager _userManager;
- private readonly IBillRullService _billRullService;
- private readonly IRunService _runService;
- private readonly IVisualDevService _visualDevService;
public WmsPDACarryReplaceService(
ISqlSugarRepository repository,
IUserManager userManager,
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryUnbindService .cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryUnbindService .cs
index 2e499b53..ccb87675 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryUnbindService .cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryUnbindService .cs
@@ -93,7 +93,7 @@ namespace Tnb.WarehouseMgr
}
carry.carry_status = ((int)EnumCarryStatus.空闲).ToString();
row = await _db.Updateable(carry).ExecuteCommandAsync();
- subCarry.carry_status = ((int)EnumCarryStatus.空闲).ToString();
+ subCarry!.carry_status = ((int)EnumCarryStatus.空闲).ToString();
row = await _db.Updateable(subCarry).ExecuteCommandAsync();
isOk = (row > 0);
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs
index 2ecb1828..70997e37 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs
@@ -36,25 +36,30 @@ namespace Tnb.WarehouseMgr
public class WmsPDADeliveryService : BaseWareHouseService, IPdaStroage
{
private const string BizTypeId = "26125644258853";
- private readonly ISqlSugarClient _db;
- private readonly IRunService _runService;
- private readonly IVisualDevService _visualDevService;
- private readonly IBasLocationService _basLocationService;
- private readonly IWareHouseService _wareHouseService;
- private readonly IBillRullService _billRullService;
- private readonly IUserManager _userManager;
- public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
+ private readonly ISqlSugarClient? _db;
+ private readonly IRunService? _runService;
+ private readonly IVisualDevService? _visualDevService;
+ private readonly IBasLocationService? _basLocationService;
+ private readonly IWareHouseService? _wareHouseService;
+ private readonly IBillRullService? _billRullService;
+ private readonly IUserManager? _userManager;
public WmsPDADeliveryService(
ISqlSugarRepository repository,
IRunService runService,
IVisualDevService visualDevService,
- IBasLocationService basLocationService
+ IBasLocationService basLocationService,
+ IBillRullService billRullService,
+ IWareHouseService wareHouseService,
+ IUserManager userManager
)
{
_db = repository.AsSugarClient();
_runService = runService;
_visualDevService = visualDevService;
_basLocationService = basLocationService;
+ _billRullService = billRullService;
+ _wareHouseService = wareHouseService;
+ _userManager = userManager;
OverideFuncs.CreateAsync = Create;
}
///
@@ -91,30 +96,30 @@ namespace Tnb.WarehouseMgr
endLocationId = input.data[nameof(WmsDelivery.endlocation_id)]?.ToString()!;
}
var locIds = new[] { startLocationId, endLocationId };
- var locs = await _basLocationService.GetLocationInfobyIds(locIds);
+ var locs = await _basLocationService?.GetLocationInfobyIds(locIds)!;
if (locs?.Count > 0)
{
var isStoreLoc = locs.Where(x => !x.IsNullOrEmpty()).Select(x => x.is_type.ParseToInt()).Any(x => x == (int)EnumLocationType.存储库位);
if (isStoreLoc) throw new AppFriendlyException("起始库位不能为存储库位", 500);
}
- VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSDELIVERYPDA_ID, true);
+ VisualDevEntity? templateEntity = await _visualDevService?.GetInfoById(ModuleConsts.MODULE_WMSDELIVERYPDA_ID, true)!;
await _runService.Create(templateEntity, input);
// 计算路径,插入预任务申请
- WmsPointH sPoint = null;
- WmsPointH ePoint = null;
+ WmsPointH sPoint = null!;
+ WmsPointH ePoint = null!;
if (input.data.ContainsKey(nameof(WmsDelivery.startlocation_id)))
{
- sPoint = await _db.Queryable().FirstAsync(it => it.location_id == input.data[nameof(WmsTransfer.startlocation_id)].ToString());
+ sPoint = await _db?.Queryable().FirstAsync(it => it.location_id == input.data[nameof(WmsTransfer.startlocation_id)].ToString())!;
}
if (input.data.ContainsKey(nameof(WmsTransfer.endlocation_id)))
{
- ePoint = await _db.Queryable().FirstAsync(it => it.location_id == input.data[nameof(WmsTransfer.endlocation_id)].ToString());
+ ePoint = await _db!.Queryable().FirstAsync(it => it.location_id == input.data[nameof(WmsTransfer.endlocation_id)].ToString());
}
if (sPoint != null && ePoint != null)
{
- var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
+ var points = await _wareHouseService!.PathAlgorithms(sPoint.id, ePoint.id);
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
if (points?.Count > 0)
{
@@ -125,20 +130,20 @@ namespace Tnb.WarehouseMgr
var ePoint = it.LastOrDefault();
WmsPretaskH preTask = new();
- preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.org_id = _userManager!.User.OrganizeId;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
- preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
+ preTask.bill_code = _billRullService!.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSDELIVERY_ID;
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_TRANSFER_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = input.data["ReturnIdentity"].ToString();
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
@@ -146,7 +151,7 @@ namespace Tnb.WarehouseMgr
preTask.create_time = DateTime.Now;
return preTask;
}).ToList();
- var isOk = await _wareHouseService.GenPreTask(preTasks, null);
+ var isOk = await _wareHouseService.GenPreTask(preTasks, null!);
if (isOk)
{
if (input.data.ContainsKey(nameof(WmsDelivery.startlocation_id)) && input.data.ContainsKey(nameof(WmsDelivery.endlocation_id)) && input.data[nameof(WmsDelivery.endlocation_id)] != null && input.data[nameof(WmsDelivery.endlocation_id)] != null)
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs
index 35f24ada..90b8591b 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs
@@ -68,10 +68,10 @@ namespace Tnb.WarehouseMgr
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSEMPTYINSTKPDA_ID, true);
await _runService.Create(templateEntity, input);
//入库取终点
- var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
+ var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString()!, Size = 1 };
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
- WmsPointH sPoint = null;
- WmsPointH ePoint = null;
+ WmsPointH sPoint = null!;
+ WmsPointH ePoint = null!;
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
{
sPoint = await _db.Queryable().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
@@ -95,10 +95,10 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = new();
preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
@@ -107,7 +107,7 @@ namespace Tnb.WarehouseMgr
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = input.data["ReturnIdentity"].ToString();
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
@@ -119,21 +119,21 @@ namespace Tnb.WarehouseMgr
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
- preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
+ preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
- preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
- preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
+ preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
+ preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
preTaskUpInput.LocationIds = points.Select(x => x.id).ToList();
preTaskUpInput.PreTaskRecords = preTasks.Adapt>();
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
WmsHandleH handleH = new();
handleH.org_id = _userManager.User.OrganizeId;
- handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString();
+ handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString()!;
handleH.endlocation_id = endLocations[0].id;
- handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString();
- handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString();
- handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString();
- handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString();
+ handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
+ handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString()!;
+ handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString()!;
+ handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!;
handleH.require_id = input.data["ReturnIdentity"].ToString();
handleH.require_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
handleH.create_id = _userManager.UserId;
@@ -151,7 +151,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
- catch (Exception ex)
+ catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs
index 310f9b00..baa5f93f 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs
@@ -9,6 +9,7 @@ using JNPF.Common.Enums;
using JNPF.Common.Extension;
using JNPF.Common.Security;
using JNPF.FriendlyException;
+using JNPF.Logging;
using JNPF.Systems.Interfaces.System;
using JNPF.VisualDev;
using JNPF.VisualDev.Entitys;
@@ -78,8 +79,8 @@ namespace Tnb.WarehouseMgr
&& a.carry_status == ((int)EnumCarryStatus.空闲).ToString() && a.is_lock == 0 && b.is_lock == 0 && b.is_type == ((int)EnumLocationType.存储库位).ToString() )
.ToListAsync();
- WmsPointH sPoint = null;
- WmsPointH ePoint = null;
+ WmsPointH sPoint = null!;
+ WmsPointH ePoint = null!;
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
{
ePoint = await _db.Queryable().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
@@ -139,18 +140,18 @@ namespace Tnb.WarehouseMgr
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
- preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
+ preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
preTaskUpInput.CarryId = carrys![i].id;
- preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
- preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
- preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
+ preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
+ preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
+ preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
//更新明细表
WmsEmptyOutstockD wmsEmptyOutstockD = new();
wmsEmptyOutstockD.id = SnowflakeIdHelper.NextId();
wmsEmptyOutstockD.bill_id = preTaskUpInput.RquireId;
wmsEmptyOutstockD.biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID;
- wmsEmptyOutstockD.location_id = ePoint.location_id;
+ wmsEmptyOutstockD.location_id = ePoint!.location_id!;
wmsEmptyOutstockD.status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID;
wmsEmptyOutstockD.carry_id = carrys[i].id;
wmsEmptyOutstockD.carry_code = carrys[i].carry_code;
@@ -162,11 +163,11 @@ namespace Tnb.WarehouseMgr
WmsHandleH handleH = new();
handleH.org_id = _userManager.User.OrganizeId;
handleH.startlocation_id = carrys?[i].location_id!;
- handleH.endlocation_id = ePoint.location_id;
+ handleH.endlocation_id = ePoint!.location_id!;
handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString()!;
handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString()!;
- handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString();
+ handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!;
handleH.require_id = input.data["ReturnIdentity"].ToString();
handleH.require_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
handleH.create_id = _userManager.UserId;
@@ -187,6 +188,7 @@ namespace Tnb.WarehouseMgr
}
catch (Exception ex)
{
+ Log.Error("空载具出库错误",ex);
await _db.Ado.RollbackTranAsync();
throw;
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCancelService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCancelService.cs
index bb3519c0..a858ef0e 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCancelService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCancelService.cs
@@ -85,7 +85,7 @@ namespace Tnb.WarehouseMgr
}
await _db.Ado.CommitTranAsync();
}
- catch (Exception ex)
+ catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCompleteService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCompleteService.cs
index 2fc1896c..12f92255 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCompleteService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCompleteService.cs
@@ -66,7 +66,7 @@ namespace Tnb.WarehouseMgr
List list = new();
if (input.data.ContainsKey(nameof(WmsDistaskH.id)))
{
- list.Add(input.data[nameof(WmsDistaskH.id)].ToString());
+ list.Add(input.data[nameof(WmsDistaskH.id)].ToString()!);
taskCompleUpInput.disTaskIds = list;
await _wareHouseService.TaskComplate(taskCompleUpInput);
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionReexcuteService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionReexcuteService.cs
index 6f528490..5ee18bfa 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionReexcuteService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionReexcuteService.cs
@@ -66,7 +66,7 @@ namespace Tnb.WarehouseMgr
//获取任务的协议,进行重新下发
await _db.Ado.CommitTranAsync();
}
- catch (Exception ex)
+ catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAFeedingService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAFeedingService.cs
index 1f3f458c..5b3ba0e3 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAFeedingService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAFeedingService.cs
@@ -77,7 +77,7 @@ namespace Tnb.WarehouseMgr
var carry = await _db.Queryable().SingleAsync(it => it.id == carryId);
var feedBox = await _db.Queryable().SingleAsync(it => it.feedbox_code == feedBoxCode);
var carryMaterial = await _db.Queryable().FirstAsync(it => it.carry_id == carryId);
- //var carryCodes = await _db.Queryable().Where(it => it.carry_id == carryId).ToListAsync();
+ var carryCodes = await _db.Queryable().Where(it => it.carry_id == carryId).ToListAsync();
if (carryMaterial != null && feedBox != null && carry != null)
{
//更新投料箱
@@ -156,30 +156,5 @@ namespace Tnb.WarehouseMgr
}
return row;
}
-
- private async Task _updateSubCarry(ExChangeCarryInput input) where T : BaseEntity, IWmsCarryEntity, new()
- {
- var row = -1;
- var items = await _db.Queryable().Where(it => it.carry_id == input.old_carry_id).ToListAsync();
- if (items?.Count > 0)
- {
- List newItems = DeepCopyHelper.DeepCopyList(items);
- if (newItems?.Count > 0)
- {
- newItems.ForEach(x =>
- {
- x.id = SnowflakeIdHelper.NextId();
- x.carry_id = input.new_carry_id;
-
- });
- row = await _db.Insertable(newItems).ExecuteCommandAsync();
- }
- if (row > 0)
- {
- row = await _db.Deleteable(items).ExecuteCommandAsync();
- }
- }
- return (row > 0);
- }
}
}
\ No newline at end of file
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs
index a2f903ce..aff09c11 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs
@@ -205,7 +205,7 @@ namespace Tnb.WarehouseMgr
{
x.id = SnowflakeIdHelper.NextId();
x.is_out = 0;
- x.carry_id = input.data[nameof(WmsCarryCode.carry_id)]?.ToString();
+ x.carry_id = input.data[nameof(WmsCarryCode.carry_id)]?.ToString()!;
});
//生成入库申请条码
var instockDetails = await _db.Queryable()
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs
index 54c69b7b..b38da441 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs
@@ -69,7 +69,7 @@ namespace Tnb.WarehouseMgr
//VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSINBALEINSTKPDA_ID, true);
//await _runService.Create(templateEntity, input);
//入库取终点 //出库起点
- var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
+ var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString()!, Size = 1 };
var inbaleItem = await _db.Queryable().SingleAsync(it => it.bill_code == input.data[nameof(WmsInbale.bill_code)].ToString());
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
WmsPointH sPoint = null;
@@ -97,10 +97,10 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = new();
preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
@@ -109,7 +109,7 @@ namespace Tnb.WarehouseMgr
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = inbaleItem.id;
preTask.require_code = inbaleItem.bill_code;
@@ -117,24 +117,24 @@ namespace Tnb.WarehouseMgr
preTask.create_time = DateTime.Now;
return preTask;
}).ToList();
- var isOk = await _wareHouseService.GenPreTask(preTasks, null);
+ var isOk = await _wareHouseService.GenPreTask(preTasks, null!);
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
preTaskUpInput.RquireId = inbaleItem.id;
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
- preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
- preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
- preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
+ preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
+ preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
+ preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
WmsHandleH handleH = new();
handleH.org_id = _userManager.User.OrganizeId;
- handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString();
- handleH.endlocation_id = endLocations[0].id;
- handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString();
- handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString();
- handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString();
- handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString();
+ handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString()!;
+ handleH.endlocation_id = endLocations![0].id!;
+ handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
+ handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString()!;
+ handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString()!;
+ handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!;
handleH.require_id = inbaleItem.id;
handleH.require_code = inbaleItem.bill_code;
handleH.create_id = _userManager.UserId;
@@ -154,7 +154,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
- catch (Exception ex)
+ catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAKittingInStkService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAKittingInStkService.cs
index c7821ac4..5d18f990 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAKittingInStkService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAKittingInStkService.cs
@@ -32,14 +32,6 @@ namespace Tnb.WarehouseMgr
[OverideVisualDev(ModuleConsts.MODULE_WMSKITTINGINSTKPDA_ID)]
public class WmsPDAKittingInStkService : WmsKittingInStkService, IPdaStroage
{
- private readonly ISqlSugarClient _db;
- private readonly IRunService _runService;
- private readonly IVisualDevService _visualDevService;
- private readonly IWareHouseService _wareHouseService;
- private readonly IBillRullService _billRullService;
- private readonly IUserManager _userManager;
-
-
public WmsPDAKittingInStkService(
ISqlSugarRepository repository,
IRunService runService,
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAOutBaleServiceService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAOutBaleServiceService.cs
index 77069d90..d7435614 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAOutBaleServiceService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAOutBaleServiceService.cs
@@ -67,8 +67,8 @@ namespace Tnb.WarehouseMgr
await _runService.Create(templateEntity, input);
//出库取起点
var carry = await _db.Queryable().FirstAsync(it => it.id == input.data[nameof(WmsOutbale.carry_id)].ToString());
- WmsPointH sPoint = null;
- WmsPointH ePoint = null;
+ WmsPointH? sPoint = null;
+ WmsPointH? ePoint = null;
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
{
ePoint = await _db.Queryable().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
@@ -93,10 +93,10 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = new();
preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
@@ -105,7 +105,7 @@ namespace Tnb.WarehouseMgr
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = input.data["ReturnIdentity"].ToString();
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
@@ -119,15 +119,15 @@ namespace Tnb.WarehouseMgr
{
preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
}
- var isOk = await _wareHouseService.GenPreTask(preTasks, null);
+ var isOk = await _wareHouseService.GenPreTask(preTasks, null!);
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
- preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
+ preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
- preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
- preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
- preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
+ preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
+ preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
+ preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
preTaskUpInput.PreTaskRecords = preTasks.Adapt>();
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs
index 41b169d3..d141ab91 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs
@@ -93,10 +93,10 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = new();
preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
@@ -105,7 +105,7 @@ namespace Tnb.WarehouseMgr
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_TRANSFER_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = input.data["ReturnIdentity"].ToString();
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsRobotCallbackService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsRobotCallbackService.cs
index aaa2e876..0e0152e7 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsRobotCallbackService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsRobotCallbackService.cs
@@ -89,14 +89,14 @@ namespace Tnb.WarehouseMgr
visualDevModelCrInput.data[nameof(InStockStrategyQuery.warehouse_id)] = kittingout.warehouse_id;
visualDevModelCrInput.data[nameof(WmsKittingInstock.carry_id)] = input.carry_id;
visualDevModelCrInput.data[nameof(WmsKittingInstock.carry_code)] = input.carry_code;
- visualDevModelCrInput.data[nameof(WmsKittingInstock.collocation_scheme_id)] = carry.collocation_scheme_id;
- visualDevModelCrInput.data[nameof(WmsKittingInstock.collocation_scheme_code)] = carry.collocation_scheme_code;
+ visualDevModelCrInput.data[nameof(WmsKittingInstock.collocation_scheme_id)] = carry!.collocation_scheme_id!;
+ visualDevModelCrInput.data[nameof(WmsKittingInstock.collocation_scheme_code)] = carry!.collocation_scheme_code!;
visualDevModelCrInput.data[nameof(WmsKittingInstock.seq)] = kittingout.seq;
visualDevModelCrInput.data[nameof(WmsKittingInstock.biz_type)] = WmsWareHouseConst.BIZTYPE_WMSKITTINGINSTK_ID;
visualDevModelCrInput.data[nameof(WmsKittingInstock.status)] = WmsWareHouseConst.BILLSTATUS_ADD_ID;
visualDevModelCrInput.data[nameof(WmsKittingInstock.create_id)] = _userManager.UserId;
visualDevModelCrInput.data[nameof(WmsKittingInstock.create_time)] = DateTime.Now;
- visualDevModelCrInput.data[nameof(WmsKittingInstock.location_id)] = carry.location_id;
+ visualDevModelCrInput.data[nameof(WmsKittingInstock.location_id)] = carry!.location_id!;
visualDevModelCrInput.data[nameof(WmsKittingInstock.bill_code)] = _billRullService.GetBillNumber("WmsKittingInStk").GetAwaiter().GetResult();
visualDevModelCrInput.data[nameof(WmsKittingInstock.source_id)] = kittingout.id;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsRouteMgrService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsRouteMgrService.cs
index 3c806096..8da9436f 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsRouteMgrService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsRouteMgrService.cs
@@ -25,13 +25,12 @@ namespace Tnb.WarehouseMgr
///
[OverideVisualDev(ModuleId)]
- public class WmsRouteMgrService : BaseWareHouseService, IWmsRouteMgrService,IPdaStroage
+ public class WmsRouteMgrService : BaseWareHouseService, IWmsRouteMgrService
{
- private const string ModuleId = "26100621140773";
+ private const string ModuleId = "26100621140773";//26100621140773
private readonly ISqlSugarClient _db;
private readonly IRunService _runService;
private readonly IVisualDevService _visualDevService;
- public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
public WmsRouteMgrService(ISqlSugarRepository repository, IRunService runService, IVisualDevService visualDevService)
{
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs
index db3b429a..6221d0c4 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs
@@ -253,7 +253,7 @@ namespace Tnb.WarehouseMgr
}
x.id = SnowflakeIdHelper.NextId();
x.bill_id = input.requireId;
- x.bill_d_id = billDId;
+ x.bill_d_id = billDId!;
x.org_id = _userManager.User.OrganizeId;
x.create_id = _userManager.UserId;
x.create_time = DateTime.Now;
@@ -286,7 +286,7 @@ namespace Tnb.WarehouseMgr
var carry = await _db.Queryable().SingleAsync(it => it.id == carryId);
if (carry != null)
{
- if (carry.location_id.IsNotEmptyOrNull())
+ if (carry!.location_id!.IsNotEmptyOrNull())
{
await _db.Updateable().SetColumns(it => new BasLocation { is_use = (int)EnumCarryStatus.空闲 }).Where(it => it.id == carry.location_id).ExecuteCommandAsync();
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs
index e0c78d87..07365b75 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs
@@ -68,7 +68,7 @@ namespace Tnb.WarehouseMgr
var carry = await _db.Queryable().SingleAsync(it => it.id == input.carryId);
if (carry != null)
{
- if (carry.location_id.IsNotEmptyOrNull())
+ if (carry!.location_id!.IsNotEmptyOrNull())
{
var loc = await _db.Queryable().SingleAsync(it => it.id == carry.location_id);
loc.is_use = (int)EnumCarryStatus.空闲;
@@ -77,7 +77,7 @@ namespace Tnb.WarehouseMgr
carry.location_id = null;
carry.location_code = null;
await _db.Updateable(carry).UpdateColumns(it => new { it.location_id, it.location_code }).ExecuteCommandAsync();
- var disTask = await _db.Queryable().SingleAsync(it => it.id == input.disTaskId);
+ WmsDistaskH? disTask = await _db.Queryable().SingleAsync(it => it.id == input.disTaskId);
if (disTask != null)
{
if (_dicBizType.ContainsKey(disTask.biz_type))
@@ -86,33 +86,11 @@ namespace Tnb.WarehouseMgr
{
loginType = "web",
bizTypeId = disTask.biz_type,
- requireId = disTask.require_id,
+ requireId = disTask!.require_id!,
carryIds = new List { input.carryId },
distaskCodes = input.distaskCodes
};
await DoUpdate(upInput); //回更业务
- //switch (_dicBizType[disTask.biz_type])
- //{
- // case "空载具出库":
- // case "寄存出库":
- // case "齐套出库":
- // case "一般出库":
- // {
-
- // WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List { input.carryId }, distaskCodes = input.distaskCodes };
- // await DoUpdate(upInput); //回更业务
-
-
- // }
- // break;
- // case "载具移出":
- // {
- // WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List { input.carryId }, distaskCodes = input.distaskCodes };
- // await DoUpdate(upInput); //回更业务
- // }
- // break;
-
- //}
}
disTask.is_sign = 1;
await _db.Updateable(disTask).UpdateColumns(it => it.is_sign).ExecuteCommandAsync();
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs
index c5f83a4a..c02ba155 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs
@@ -68,8 +68,8 @@ namespace Tnb.WarehouseMgr
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSTRANSFER_ID, true);
await _runService.Create(templateEntity, input);
// 计算路径,插入预任务申请
- WmsPointH sPoint = null;
- WmsPointH ePoint = null;
+ WmsPointH? sPoint = null;
+ WmsPointH? ePoint = null;
if (input.data.ContainsKey(nameof(WmsTransfer.startlocation_id)))
{
sPoint = await _db.Queryable().FirstAsync(it => it.location_id == input.data[nameof(WmsTransfer.startlocation_id)].ToString());
@@ -93,10 +93,10 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = new();
preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
@@ -105,7 +105,7 @@ namespace Tnb.WarehouseMgr
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_TRANSFER_TYPE_ID;
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
- preTask.area_id = sPoint?.area_id;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = input.data["ReturnIdentity"].ToString();
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
@@ -113,7 +113,7 @@ namespace Tnb.WarehouseMgr
preTask.create_time = DateTime.Now;
return preTask;
}).ToList();
- var isOk = await _wareHouseService.GenPreTask(preTasks, null);
+ var isOk = await _wareHouseService.GenPreTask(preTasks, null!);
if (isOk)
{
//查询库位表
@@ -141,7 +141,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
- catch (Exception ex)
+ catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs
index de9f28a0..c3079634 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs
@@ -70,7 +70,7 @@ namespace Tnb.WarehouseMgr
if (carrys?.Count > 0)
{
var firstCarry = carrys.FirstOrDefault();
- GenPreTaskUpInput genPreTaskInput = new() { CarryId = firstCarry.id };
+ GenPreTaskUpInput genPreTaskInput = new() { CarryId = firstCarry!.id! };
await _warehouseService.GenInStockTaskHandleAfter(genPreTaskInput, it => new WmsCarryH { is_lock = 1 }, null!);
ko.status = WmsWareHouseConst.BILLSTATUS_TOBESHIPPED_ID;
ko.carry_id = firstCarry.id;
@@ -161,19 +161,19 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = new();
preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id;
- preTask.startlocation_code = sPoint?.location_code;
- preTask.endlocation_id = ePoint?.location_id;
- preTask.endlocation_code = ePoint?.location_code;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = ko.biz_type;
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
- preTask.carry_id = ko.carry_id;
- preTask.carry_code = ko.carry_code;
- preTask.area_id = sPoint?.area_id;
+ preTask.carry_id = ko!.carry_id!;
+ preTask.carry_code = ko!.carry_code!;
+ preTask.area_id = sPoint?.area_id!;
preTask.area_code = it.Key;
preTask.require_id = ko.id;
preTask.require_code = ko.bill_code;
@@ -184,7 +184,7 @@ namespace Tnb.WarehouseMgr
await _warehouseService.GenPreTask(preTasks, null!);
var subCarrys = await _db.Queryable().Where(it => it.carry_id == ko.carry_id).ToListAsync();
var carryIds = subCarrys.Select(x => x.carry_id).Concat(new[] { ko.carry_id }).Distinct().ToList();
- GenPreTaskUpInput genPreTaskInput = new() { CarryIds = carryIds, LocationIds = new List { carry.location_id, ko.location_id } };
+ GenPreTaskUpInput genPreTaskInput = new() { CarryIds = carryIds, LocationIds = new List { carry.location_id!, ko.location_id! } };
await _warehouseService.GenInStockTaskHandleAfter(genPreTaskInput, it => new WmsCarryH { is_lock = 1, carry_status = ((int)EnumCarryStatus.齐套).ToString() }, it => new BasLocation { is_lock = 1 });
}
@@ -218,7 +218,7 @@ namespace Tnb.WarehouseMgr
}
x.id = SnowflakeIdHelper.NextId();
x.bill_id = input.requireId;
- x.bill_d_id = billDId;
+ x.bill_d_id = billDId!;
x.org_id = _userManager.User.OrganizeId;
x.create_id = _userManager.UserId;
x.create_time = DateTime.Now;
diff --git a/common/Tnb.Common/Extension/Extensions.cs b/common/Tnb.Common/Extension/Extensions.cs
index 31a2e9a4..df2b983a 100644
--- a/common/Tnb.Common/Extension/Extensions.cs
+++ b/common/Tnb.Common/Extension/Extensions.cs
@@ -691,6 +691,16 @@ public static partial class Extensions
{
return ObjToString(thisValue) != string.Empty && ObjToString(thisValue) != "undefined" && ObjToString(thisValue) != "null";
}
+ ///
+ /// 是否为空
+ /// added by ly on 20230703
+ ///
+ ///
+ ///
+ public static bool IsNull(this object thisValue)
+ {
+ return thisValue == null;
+ }
#endregion
diff --git a/visualdev/Tnb.VisualDev.Engine/Core/FormDataParsing.cs b/visualdev/Tnb.VisualDev.Engine/Core/FormDataParsing.cs
index 5dd420a1..39a3b500 100644
--- a/visualdev/Tnb.VisualDev.Engine/Core/FormDataParsing.cs
+++ b/visualdev/Tnb.VisualDev.Engine/Core/FormDataParsing.cs
@@ -529,6 +529,8 @@ public class FormDataParsing : ITransient
return res.ToString().ParseToDateTime();
else if (model.__config__.jnpfKey.Equals(JnpfKeyConst.NUMINPUT) || model.__config__.jnpfKey.Equals(JnpfKeyConst.SWITCH))//modify by zhoukeda 2023427 开关默认数字
return res;
+ else if (model.__config__.jnpfKey.Equals(JnpfKeyConst.SELECT) && model.multiple)//modifyby zhoukeda 20230703 下拉框多选 数据保存为json
+ return res.ToJsonString();
else return res.ToString();
}
else