1
This commit is contained in:
@@ -310,6 +310,8 @@ namespace Tnb.ProductionMgr
|
|||||||
.Where(x => x.equip_id == equipment.id && x.status == 0).OrderByDescending(x => x.create_time)
|
.Where(x => x.equip_id == equipment.id && x.status == 0).OrderByDescending(x => x.create_time)
|
||||||
.FirstAsync();
|
.FirstAsync();
|
||||||
string create_id = prdReport.create_id;
|
string create_id = prdReport.create_id;
|
||||||
|
UserEntity user = await db.Queryable<UserEntity>().SingleAsync(x => x.Id == create_id);
|
||||||
|
string org_id = user.OrganizeId;
|
||||||
if (prdReport == null)
|
if (prdReport == null)
|
||||||
{
|
{
|
||||||
throw Oops.Bah("未找到提报记录");
|
throw Oops.Bah("未找到提报记录");
|
||||||
@@ -335,7 +337,7 @@ namespace Tnb.ProductionMgr
|
|||||||
station_id = prdReport.station,
|
station_id = prdReport.station,
|
||||||
workline_id = workline?.Id ?? "",
|
workline_id = workline?.Id ?? "",
|
||||||
workshop_id = workshop?.Id ?? "",
|
workshop_id = workshop?.Id ?? "",
|
||||||
// org_id = _userManager.GetUserInfo().Result.organizeId,
|
org_id = org_id,
|
||||||
// warehouse_id = basLocation?.wh_id,
|
// warehouse_id = basLocation?.wh_id,
|
||||||
warehouse_id = warehouse_id,
|
warehouse_id = warehouse_id,
|
||||||
status = 0,
|
status = 0,
|
||||||
@@ -349,7 +351,7 @@ namespace Tnb.ProductionMgr
|
|||||||
material_code = basMaterial.code,
|
material_code = basMaterial.code,
|
||||||
unit_id = prdReport.unit_id,
|
unit_id = prdReport.unit_id,
|
||||||
barcode = prdReport.barcode,
|
barcode = prdReport.barcode,
|
||||||
code_batch = prdReport.barcode + "0001",
|
code_batch = prdReport.mo_task_code,
|
||||||
quantity = (int)prdReport.reported_qty,
|
quantity = (int)prdReport.reported_qty,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -360,7 +362,7 @@ namespace Tnb.ProductionMgr
|
|||||||
{
|
{
|
||||||
instock = new MESWmsInstockHInput()
|
instock = new MESWmsInstockHInput()
|
||||||
{
|
{
|
||||||
// org_id = _userManager.GetUserInfo().Result.organizeId,
|
org_id = org_id,
|
||||||
bill_date = DateTime.Now,
|
bill_date = DateTime.Now,
|
||||||
bill_type = DictConst.CHANCHENGPINRUKUDAN,
|
bill_type = DictConst.CHANCHENGPINRUKUDAN,
|
||||||
// warehouse_id = basLocation?.wh_id,
|
// warehouse_id = basLocation?.wh_id,
|
||||||
@@ -379,7 +381,7 @@ namespace Tnb.ProductionMgr
|
|||||||
material_id = prdReport.material_id,
|
material_id = prdReport.material_id,
|
||||||
material_code = basMaterial.code,
|
material_code = basMaterial.code,
|
||||||
unit_id = prdReport.unit_id,
|
unit_id = prdReport.unit_id,
|
||||||
code_batch = prdReport.barcode,
|
code_batch = prdReport.mo_task_code,
|
||||||
pr_qty = (int)prdReport.reported_qty,
|
pr_qty = (int)prdReport.reported_qty,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -389,10 +391,11 @@ namespace Tnb.ProductionMgr
|
|||||||
material_code = basMaterial.code,
|
material_code = basMaterial.code,
|
||||||
unit_id = prdReport.unit_id,
|
unit_id = prdReport.unit_id,
|
||||||
barcode = prdReport.barcode,
|
barcode = prdReport.barcode,
|
||||||
code_batch = prdReport.barcode + "0001",
|
code_batch = prdReport.mo_task_code,
|
||||||
codeqty = (int)prdReport.reported_qty,
|
codeqty = (int)prdReport.reported_qty,
|
||||||
});
|
});
|
||||||
// string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
// string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||||
|
// string domain = "http://localhost:9232";
|
||||||
string domain = "http://tnb.tuotong-tech.com";
|
string domain = "http://tnb.tuotong-tech.com";
|
||||||
Dictionary<string, object> header = new()
|
Dictionary<string, object> header = new()
|
||||||
{
|
{
|
||||||
@@ -401,7 +404,7 @@ namespace Tnb.ProductionMgr
|
|||||||
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK, JsonConvert.SerializeObject(mesCreateInstockInput), header);
|
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK, JsonConvert.SerializeObject(mesCreateInstockInput), header);
|
||||||
Log.Information(sendResult);
|
Log.Information(sendResult);
|
||||||
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
|
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
|
||||||
result2 = authResponse.code != 200 || !authResponse.data.ObjToBool()
|
result2 = authResponse.code != 200 || !(bool)authResponse.data
|
||||||
? throw Oops.Bah(authResponse.msg)
|
? throw Oops.Bah(authResponse.msg)
|
||||||
: await db.Ado.UseTranAsync(async () =>
|
: await db.Ado.UseTranAsync(async () =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1503,7 +1503,8 @@ namespace Tnb.ProductionMgr
|
|||||||
report.create_id = _userManager.UserId;
|
report.create_id = _userManager.UserId;
|
||||||
report.create_time = DateTime.Now;
|
report.create_time = DateTime.Now;
|
||||||
// report.batch = input.mo_task_code + DateTimeOffset.Now.ToUnixTimeSeconds().ToString();
|
// report.batch = input.mo_task_code + DateTimeOffset.Now.ToUnixTimeSeconds().ToString();
|
||||||
report.barcode = input.mo_task_code + DateTimeOffset.Now.ToUnixTimeSeconds().ToString();
|
// report.barcode = input.mo_task_code + DateTimeOffset.Now.ToUnixTimeSeconds().ToString();
|
||||||
|
report.barcode = input.mo_task_code+"0001";
|
||||||
report.equip_id = prdMoTask.eqp_id;
|
report.equip_id = prdMoTask.eqp_id;
|
||||||
report.mbom_process_id = prdMoTask.mbom_process_id;
|
report.mbom_process_id = prdMoTask.mbom_process_id;
|
||||||
report.station = input.station;
|
report.station = input.station;
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ namespace Tnb.ProductionMgr
|
|||||||
}
|
}
|
||||||
public Task StartAsync(CancellationToken cancellationToken)
|
public Task StartAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
Readtimer = new Timer(GetRedisData, null, TimeSpan.Zero, TimeSpan.FromSeconds(60));
|
Readtimer = new Timer(GetRedisData, null, TimeSpan.Zero, TimeSpan.FromSeconds(300));
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
public Task StopAsync(CancellationToken cancellationToken)
|
public Task StopAsync(CancellationToken cancellationToken)
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
instockCOdes.Add(c);
|
instockCOdes.Add(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string orgId = _userManager.User.OrganizeId;
|
string orgId = _userManager.User?.OrganizeId ?? input.instock.org_id;
|
||||||
_ = await _db.Insertable(instockCOdes).CallEntityMethod(it => it.Create(orgId)).ExecuteCommandAsync();
|
_ = await _db.Insertable(instockCOdes).CallEntityMethod(it => it.Create(orgId)).ExecuteCommandAsync();
|
||||||
|
|
||||||
//生成预任务申请
|
//生成预任务申请
|
||||||
@@ -372,7 +372,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
|
|
||||||
WmsPretaskH preTask = new()
|
WmsPretaskH preTask = new()
|
||||||
{
|
{
|
||||||
org_id = _userManager.User.OrganizeId,
|
org_id = orgId,
|
||||||
startlocation_id = sPoint?.location_id ?? string.Empty,
|
startlocation_id = sPoint?.location_id ?? string.Empty,
|
||||||
startlocation_code = sPoint?.location_code ?? string.Empty,
|
startlocation_code = sPoint?.location_code ?? string.Empty,
|
||||||
endlocation_id = ePoint?.location_id ?? string.Empty,
|
endlocation_id = ePoint?.location_id ?? string.Empty,
|
||||||
@@ -389,7 +389,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
area_code = it.Key,
|
area_code = it.Key,
|
||||||
require_id = instock?.id ?? string.Empty,
|
require_id = instock?.id ?? string.Empty,
|
||||||
require_code = instock?.bill_code ?? string.Empty,
|
require_code = instock?.bill_code ?? string.Empty,
|
||||||
create_id = _userManager.UserId,
|
create_id = instock.create_id,
|
||||||
create_time = DateTime.Now
|
create_time = DateTime.Now
|
||||||
};
|
};
|
||||||
return preTask;
|
return preTask;
|
||||||
@@ -448,16 +448,16 @@ namespace Tnb.WarehouseMgr
|
|||||||
{
|
{
|
||||||
WmsHandleCode handleCode = jo.Adapt<WmsHandleCode>();
|
WmsHandleCode handleCode = jo.Adapt<WmsHandleCode>();
|
||||||
handleCode.id = SnowflakeIdHelper.NextId();
|
handleCode.id = SnowflakeIdHelper.NextId();
|
||||||
handleCode.org_id = _userManager.User.OrganizeId;
|
handleCode.org_id = orgId;
|
||||||
handleCode.bill_id = operBillId;
|
handleCode.bill_id = operBillId;
|
||||||
handleCode.create_id = _userManager.UserId;
|
handleCode.create_id = instock.create_id;
|
||||||
handleCode.create_time = DateTime.Now;
|
handleCode.create_time = DateTime.Now;
|
||||||
preTaskUpInput.PreTaskHandleCodes.Add(handleCode);
|
preTaskUpInput.PreTaskHandleCodes.Add(handleCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//生成载具条码记录
|
//生成载具条码记录
|
||||||
List<WmsCarryCode> carryCodes = preTaskUpInput.PreTaskHandleCodes.Adapt<List<WmsCarryCode>>();
|
List<WmsCarryCode> carryCodes = preTaskUpInput.PreTaskHandleCodes.Adapt<List<WmsCarryCode>>();
|
||||||
|
|
||||||
carryCodes.ForEach(x =>
|
carryCodes.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.id = SnowflakeIdHelper.NextId();
|
x.id = SnowflakeIdHelper.NextId();
|
||||||
|
|||||||
Reference in New Issue
Block a user