载具绑定物料
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Tnb.WarehouseMgr.Entities.Consts;
|
||||||
|
|
||||||
namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
||||||
{
|
{
|
||||||
@@ -17,5 +18,8 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
|||||||
public string location_id { get; set; } = "";
|
public string location_id { get; set; } = "";
|
||||||
public string location_code { get; set; } = "";
|
public string location_code { get; set; } = "";
|
||||||
public string code_batch { get; set; }
|
public string code_batch { get; set; }
|
||||||
|
public string unit_id { get; set; }
|
||||||
|
public string unit_code { get; set; }
|
||||||
|
public string create_id { get; set; } = WmsWareHouseConst.AdministratorUserId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -288,12 +288,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
|
|
||||||
SqlSugarClient cyDb = _db.CopyNew();
|
SqlSugarClient cyDb = _db.CopyNew();
|
||||||
|
|
||||||
string sss = cyDb.Queryable<WmsCarryH>().LeftJoin<WmsCarryCode>((a, b) => a.id == b.carry_id)
|
|
||||||
.LeftJoin<BasLocation>((a, b, c) => a.location_id == c.id)
|
|
||||||
.Where(whereExpr)
|
|
||||||
//.OrderByIF((a,b,c)=>SqlFunc.IsNullOrEmpty())
|
|
||||||
.OrderBy("a.location_code,layers,loc_line,loc_column").ToSqlString();
|
|
||||||
|
|
||||||
|
|
||||||
List<Tuple<string, WmsCarryH, WmsCarryCode, BasLocation>> items = cyDb.Queryable<WmsCarryH>().LeftJoin<WmsCarryCode>((a, b) => a.id == b.carry_id)
|
List<Tuple<string, WmsCarryH, WmsCarryCode, BasLocation>> items = cyDb.Queryable<WmsCarryH>().LeftJoin<WmsCarryCode>((a, b) => a.id == b.carry_id)
|
||||||
.LeftJoin<BasLocation>((a, b, c) => a.location_id == c.id)
|
.LeftJoin<BasLocation>((a, b, c) => a.location_id == c.id)
|
||||||
|
|||||||
@@ -326,6 +326,9 @@ namespace Tnb.WarehouseMgr
|
|||||||
wmsCarryCode.location_id = input.location_id;
|
wmsCarryCode.location_id = input.location_id;
|
||||||
wmsCarryCode.location_code = input.location_code;
|
wmsCarryCode.location_code = input.location_code;
|
||||||
wmsCarryCode.code_batch = input.code_batch;
|
wmsCarryCode.code_batch = input.code_batch;
|
||||||
|
wmsCarryCode.unit_id = input.unit_id;
|
||||||
|
wmsCarryCode.unit_code = input.unit_code;
|
||||||
|
wmsCarryCode.create_id = input.create_id;
|
||||||
await _db.Insertable<WmsCarryCode>(wmsCarryCode).ExecuteCommandAsync();
|
await _db.Insertable<WmsCarryCode>(wmsCarryCode).ExecuteCommandAsync();
|
||||||
|
|
||||||
// todo 绑定记录表
|
// todo 绑定记录表
|
||||||
|
|||||||
@@ -35,7 +35,10 @@ namespace Tnb.WarehouseMgr
|
|||||||
private readonly IBillRullService _billRullService;
|
private readonly IBillRullService _billRullService;
|
||||||
private readonly IWareHouseService _wareHouseService;
|
private readonly IWareHouseService _wareHouseService;
|
||||||
private readonly IWmsCarryBindService _wmsCarryBindService;
|
private readonly IWmsCarryBindService _wmsCarryBindService;
|
||||||
|
private readonly IWmsCarryService _wmsCarryService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public WmsPDACarryBindService(
|
public WmsPDACarryBindService(
|
||||||
ISqlSugarRepository<WmsCarryH> repository,
|
ISqlSugarRepository<WmsCarryH> repository,
|
||||||
IRunService runService,
|
IRunService runService,
|
||||||
@@ -43,7 +46,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
IUserManager userManager,
|
IUserManager userManager,
|
||||||
IWareHouseService wareHouseService,
|
IWareHouseService wareHouseService,
|
||||||
IBillRullService billRullService,
|
IBillRullService billRullService,
|
||||||
IWmsCarryBindService wmsCarryBindService)
|
IWmsCarryBindService wmsCarryBindService,
|
||||||
|
IWmsCarryService wmsCarryService)
|
||||||
{
|
{
|
||||||
_db = repository.AsSugarClient();
|
_db = repository.AsSugarClient();
|
||||||
_runService = runService;
|
_runService = runService;
|
||||||
@@ -52,6 +56,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
_billRullService = billRullService;
|
_billRullService = billRullService;
|
||||||
_wareHouseService = wareHouseService;
|
_wareHouseService = wareHouseService;
|
||||||
_wmsCarryBindService = wmsCarryBindService;
|
_wmsCarryBindService = wmsCarryBindService;
|
||||||
|
_wmsCarryService = wmsCarryService;
|
||||||
OverideFuncs.CreateAsync = PDACarryBind;
|
OverideFuncs.CreateAsync = PDACarryBind;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,18 +312,20 @@ namespace Tnb.WarehouseMgr
|
|||||||
_ = await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
|
_ = await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
|
||||||
|
|
||||||
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().FirstAsync(it => it.id == input.material_id);
|
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().FirstAsync(it => it.id == input.material_id);
|
||||||
WmsCarryCode wmsCarryCode = new WmsCarryCode();
|
|
||||||
wmsCarryCode.create_time = DateTime.Now;
|
BindCarryCodeInput bindCarryCodeInput = new BindCarryCodeInput();
|
||||||
wmsCarryCode.carry_id = wmsCarryH.id;
|
|
||||||
wmsCarryCode.barcode = wmsCarryH.carry_code;
|
bindCarryCodeInput.carry_id = wmsCarryH.id;
|
||||||
wmsCarryCode.codeqty = input.qty;
|
bindCarryCodeInput.barcode = wmsCarryH.carry_code;
|
||||||
wmsCarryCode.material_id = input.material_id;
|
bindCarryCodeInput.codeqty = input.qty;
|
||||||
wmsCarryCode.material_code = basMaterial.code;
|
bindCarryCodeInput.material_id = input.material_id;
|
||||||
wmsCarryCode.material_name = basMaterial.name;
|
bindCarryCodeInput.material_code = basMaterial.code;
|
||||||
wmsCarryCode.location_id = endLocations[0].id;
|
bindCarryCodeInput.material_name = basMaterial.name;
|
||||||
wmsCarryCode.location_code = endLocations[0].location_code;
|
bindCarryCodeInput.location_id = endLocations[0].id;
|
||||||
wmsCarryCode.code_batch = wmsTransferInstockD.pi_code;
|
bindCarryCodeInput.location_code = endLocations[0].location_code;
|
||||||
_ = await _db.Insertable<WmsCarryCode>(wmsCarryCode).ExecuteCommandAsync();
|
bindCarryCodeInput.code_batch = wmsTransferInstockD.pi_code;
|
||||||
|
|
||||||
|
await _wmsCarryService.BindCarryMaterial(bindCarryCodeInput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user