Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -47,10 +47,12 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IDictionaryDataService _dictionaryDataService;
|
||||
public WareHouseService(ISqlSugarRepository<WmsInstockH> repository, IDictionaryDataService dictionaryDataService)
|
||||
private readonly IBillRullService _billRullService;
|
||||
public WareHouseService(ISqlSugarRepository<WmsInstockH> repository, IDictionaryDataService dictionaryDataService, IBillRullService billRullService)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_dictionaryDataService = dictionaryDataService;
|
||||
_billRullService= billRullService;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据载具Id带出库位、仓库信息
|
||||
@@ -231,6 +233,7 @@ namespace Tnb.WarehouseMgr
|
||||
items.ForEach(x =>
|
||||
{
|
||||
x.is_chain = 0;
|
||||
|
||||
x.chain_type = "0";
|
||||
});
|
||||
}
|
||||
@@ -266,6 +269,12 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
var moveNum = itGroup.First().move_num;
|
||||
var items = itGroup.Adapt<List<WmsDistaskH>>();
|
||||
items.ForEach(x =>
|
||||
{
|
||||
x.status = WmsWareHouseConst.TASK_BILL_STATUS_DZX_ID;
|
||||
x.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_TASK_EXECUTE_ENCODE).GetAwaiter().GetResult();
|
||||
x.is_sign = 1;
|
||||
});
|
||||
var areaPreTasks = itGroup.ToList();
|
||||
if (moveNum == 1)
|
||||
{
|
||||
@@ -460,16 +469,14 @@ namespace Tnb.WarehouseMgr
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task GenTaskHandleAfter(GenPreTaskUpInput input)
|
||||
public async Task GenInStockTaskHandleAfter(GenPreTaskUpInput input)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _db.Ado.BeginTranAsync();
|
||||
//根据载具移入Id,回更单据状态
|
||||
await _db.Updateable<WmsMoveInstock>().SetColumns(it => new WmsMoveInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == input.PreTaskId).ExecuteCommandAsync();
|
||||
//根据生成的预任务,插入预任务操作记录
|
||||
await _db.Insertable(input.PreTaskRecord).ExecuteCommandAsync();
|
||||
if(input.PreTaskHandleCodes.Count > 0)
|
||||
if (input.PreTaskHandleCodes.Count > 0)
|
||||
{
|
||||
await _db.Insertable(input.PreTaskHandleCodes).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
@@ -138,8 +138,10 @@ namespace Tnb.WarehouseMgr
|
||||
handleH.create_id = _userManager.UserId;
|
||||
handleH.create_time = DateTime.Now;
|
||||
preTaskUpInput.PreTaskRecord = handleH;
|
||||
//根据载具移入Id,回更单据状态
|
||||
await _db.Updateable<WmsMoveInstock>().SetColumns(it => new WmsMoveInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.PreTaskId).ExecuteCommandAsync();
|
||||
|
||||
await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -157,7 +157,6 @@ namespace Tnb.WarehouseMgr
|
||||
handleCode.code_batch = jo.Value<string>(nameof(WmsHandleCode.code_batch));
|
||||
handleCode.codeqty = jo.Value<int>(nameof(WmsHandleCode.codeqty));
|
||||
handleCode.unit_id = _db.Queryable<BasMaterial>().Single(it => it.id == materialId).unit_id;
|
||||
//handleCode.unit_code=_db.Queryable<BasMaterial>().Single(it => it.id == materialId);
|
||||
handleCode.create_id = _userManager.UserId;
|
||||
handleCode.create_time = DateTime.Now;
|
||||
preTaskUpInput.PreTaskHandleCodes.Add(handleCode);
|
||||
@@ -165,7 +164,9 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
}
|
||||
await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);
|
||||
await _db.Insertable(preTaskUpInput.PreTaskRecord).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { carry_code = input.data[nameof(WmsCarryH.carry_code)].ToString(), is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode }).Where(it => it.id == preTaskUpInput.CarryId).ExecuteCommandAsync();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user