Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
|
||||
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_code { 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();
|
||||
|
||||
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)
|
||||
.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_code = input.location_code;
|
||||
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();
|
||||
|
||||
// todo 绑定记录表
|
||||
|
||||
@@ -35,7 +35,10 @@ namespace Tnb.WarehouseMgr
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IWmsCarryBindService _wmsCarryBindService;
|
||||
private readonly IWmsCarryService _wmsCarryService;
|
||||
|
||||
|
||||
|
||||
public WmsPDACarryBindService(
|
||||
ISqlSugarRepository<WmsCarryH> repository,
|
||||
IRunService runService,
|
||||
@@ -43,7 +46,8 @@ namespace Tnb.WarehouseMgr
|
||||
IUserManager userManager,
|
||||
IWareHouseService wareHouseService,
|
||||
IBillRullService billRullService,
|
||||
IWmsCarryBindService wmsCarryBindService)
|
||||
IWmsCarryBindService wmsCarryBindService,
|
||||
IWmsCarryService wmsCarryService)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -52,6 +56,7 @@ namespace Tnb.WarehouseMgr
|
||||
_billRullService = billRullService;
|
||||
_wareHouseService = wareHouseService;
|
||||
_wmsCarryBindService = wmsCarryBindService;
|
||||
_wmsCarryService = wmsCarryService;
|
||||
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();
|
||||
|
||||
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().FirstAsync(it => it.id == input.material_id);
|
||||
WmsCarryCode wmsCarryCode = new WmsCarryCode();
|
||||
wmsCarryCode.create_time = DateTime.Now;
|
||||
wmsCarryCode.carry_id = wmsCarryH.id;
|
||||
wmsCarryCode.barcode = wmsCarryH.carry_code;
|
||||
wmsCarryCode.codeqty = input.qty;
|
||||
wmsCarryCode.material_id = input.material_id;
|
||||
wmsCarryCode.material_code = basMaterial.code;
|
||||
wmsCarryCode.material_name = basMaterial.name;
|
||||
wmsCarryCode.location_id = endLocations[0].id;
|
||||
wmsCarryCode.location_code = endLocations[0].location_code;
|
||||
wmsCarryCode.code_batch = wmsTransferInstockD.pi_code;
|
||||
_ = await _db.Insertable<WmsCarryCode>(wmsCarryCode).ExecuteCommandAsync();
|
||||
|
||||
BindCarryCodeInput bindCarryCodeInput = new BindCarryCodeInput();
|
||||
|
||||
bindCarryCodeInput.carry_id = wmsCarryH.id;
|
||||
bindCarryCodeInput.barcode = wmsCarryH.carry_code;
|
||||
bindCarryCodeInput.codeqty = input.qty;
|
||||
bindCarryCodeInput.material_id = input.material_id;
|
||||
bindCarryCodeInput.material_code = basMaterial.code;
|
||||
bindCarryCodeInput.material_name = basMaterial.name;
|
||||
bindCarryCodeInput.location_id = endLocations[0].id;
|
||||
bindCarryCodeInput.location_code = endLocations[0].location_code;
|
||||
bindCarryCodeInput.code_batch = wmsTransferInstockD.pi_code;
|
||||
|
||||
await _wmsCarryService.BindCarryMaterial(bindCarryCodeInput);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user