优化调整

This commit is contained in:
2024-05-24 14:21:14 +08:00
parent 2a66f244dd
commit 86d07260af
5 changed files with 150 additions and 17 deletions

View File

@@ -93,12 +93,14 @@ namespace Tnb.ProductionMgr
string result = "";
bool? cs01 = await _redisData.TryGetValueByKeyField<bool?>("YTCS", "CallCtuEmptyIn_CS01");
bool? cs03 = await _redisData.TryGetValueByKeyField<bool?>("YTCS", "CallCtuEmptyIn_CS03");
bool? cs06 = await _redisData.TryGetValueByKeyField<bool?>("YTCS", "CallCtuEmptyIn_CS06");
bool cs01Flag = _redisData.Get<bool>("YTCS_CallCtuEmptyIn_CS01_flag");
bool cs03Flag = _redisData.Get<bool>("YTCS_CallCtuEmptyIn_CS03_flag");
bool cs06Flag = _redisData.Get<bool>("YTCS_CallCtuEmptyIn_CS06_flag");
if (cs01==true && !cs01Flag)
{
BasFactoryConfig config = await _repository.AsSugarClient().Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.DOMAIN);
string response = HttpUtils.RequestGet($"{config.value}/api/production/time-work/empty-carry-out-stk-left");
string response = HttpUtils.RequestGet($"{config.value}/api/production/time-work/empty-carry-out-stk-ctu1");
// string response = HttpUtils.RequestGet($"http://localhost:9232/api/production/time-work/empty-carry-out-stk-left");
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(response);
result += authResponse.data.ToString();
@@ -107,7 +109,16 @@ namespace Tnb.ProductionMgr
if (cs03==true && !cs03Flag)
{
BasFactoryConfig config = await _repository.AsSugarClient().Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.DOMAIN);
string response = HttpUtils.RequestGet($"{config.value}/api/production/time-work/empty-carry-out-stk-right");
string response = HttpUtils.RequestGet($"{config.value}/api/production/time-work/empty-carry-out-stk-ctu3");
// string response = HttpUtils.RequestGet($"http://localhost:9232/api/production/time-work/empty-carry-out-stk-right");
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(response);
result += authResponse.data.ToString();
}
if (cs06==true && !cs06Flag)
{
BasFactoryConfig config = await _repository.AsSugarClient().Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.DOMAIN);
string response = HttpUtils.RequestGet($"{config.value}/api/production/time-work/empty-carry-out-stk-ctu6");
// string response = HttpUtils.RequestGet($"http://localhost:9232/api/production/time-work/empty-carry-out-stk-right");
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(response);
result += authResponse.data.ToString();
@@ -118,7 +129,7 @@ namespace Tnb.ProductionMgr
[HttpGet]
[AllowAnonymous]
public async Task<string> EmptyCarryOutStkLeft()
public async Task<string> EmptyCarryOutStkCtu1()
{
string msg = "";
MESEmptyCarryOutStkInput input = new MESEmptyCarryOutStkInput();
@@ -128,25 +139,25 @@ namespace Tnb.ProductionMgr
input.carrystd_id = WmsWareHouseConst.LIAOXIANGID;
input.qty = 1;
input.create_id = WmsWareHouseConst.AdministratorUserId;
Log.Information($"【EmptyCarryOutStk】左输送线空箱入呼叫开始,参数:{JsonConvert.SerializeObject(input)}");
Log.Information($"【EmptyCarryOutStk】ctu1空箱入呼叫开始,参数:{JsonConvert.SerializeObject(input)}");
Result result = await _wmsEmptyOutstockService.MESEmptyCarryOutStk(input);
if (result.code == HttpStatusCode.OK)
{
msg = "左输送线空箱入呼叫成功";
Log.Information("【EmptyCarryOutStk】左输送线空箱入呼叫成功");
msg = "ctu1空箱入呼叫成功";
Log.Information("【EmptyCarryOutStk】ctu1空箱入呼叫成功");
//_redisData.Set("YTCS_CallCtuEmptyIn_CS01_flag", true, TimeSpan.FromMinutes(20));
}
else
{
msg = $"左输送线空箱入呼叫失败:{result.msg}";
Log.Error($"【EmptyCarryOutStk】左输送线空箱入呼叫失败:{result.msg}");
msg = $"ctu1空箱入呼叫失败:{result.msg}";
Log.Error($"【EmptyCarryOutStk】ctu1空箱入呼叫失败:{result.msg}");
}
return msg;
}
[HttpGet]
[AllowAnonymous]
public async Task<string> EmptyCarryOutStkRight()
public async Task<string> EmptyCarryOutStkCtu3()
{
string msg = "";
MESEmptyCarryOutStkInput input = new MESEmptyCarryOutStkInput();
@@ -156,18 +167,46 @@ namespace Tnb.ProductionMgr
input.carrystd_id = WmsWareHouseConst.LIAOXIANGID;
input.qty = 1;
input.create_id = WmsWareHouseConst.AdministratorUserId;
Log.Information($"【EmptyCarryOutStk】右输送线空箱入呼叫开始,参数:{JsonConvert.SerializeObject(input)}");
Log.Information($"【EmptyCarryOutStk】ctu3空箱入呼叫开始,参数:{JsonConvert.SerializeObject(input)}");
Result result = await _wmsEmptyOutstockService.MESEmptyCarryOutStk(input);
if (result.code == HttpStatusCode.OK)
{
msg = "右输送线空箱入呼叫成功";
Log.Information("【EmptyCarryOutStk】右输送线空箱入呼叫成功");
msg = "ctu3空箱入呼叫成功";
Log.Information("【EmptyCarryOutStk】ctu3空箱入呼叫成功");
//_redisData.Set("YTCS_CallCtuEmptyIn_CS03_flag", true, TimeSpan.FromMinutes(20));
}
else
{
msg = $"右输送线空箱入呼叫失败:{result.msg}";
Log.Error($"【EmptyCarryOutStk】右输送线空箱入呼叫失败:{result.msg}");
msg = $"ctu3空箱入呼叫失败:{result.msg}";
Log.Error($"【EmptyCarryOutStk】ctu3空箱入呼叫失败:{result.msg}");
}
return msg;
}
[HttpGet]
[AllowAnonymous]
public async Task<string> EmptyCarryOutStkCtu6()
{
string msg = "";
MESEmptyCarryOutStkInput input = new MESEmptyCarryOutStkInput();
input.org_id = WmsWareHouseConst.AdministratorOrgId;
input.location_code = "SSX-011-006";
input.warehouse_id = WmsWareHouseConst.WAREHOUSE_ZC_ID;
input.carrystd_id = WmsWareHouseConst.LIAOXIANGID;
input.qty = 1;
input.create_id = WmsWareHouseConst.AdministratorUserId;
Log.Information($"【EmptyCarryOutStk】ctu6空箱入呼叫开始,参数:{JsonConvert.SerializeObject(input)}");
Result result = await _wmsEmptyOutstockService.MESEmptyCarryOutStk(input);
if (result.code == HttpStatusCode.OK)
{
msg = "ctu6空箱入呼叫成功";
Log.Information("【EmptyCarryOutStk】ctu6空箱入呼叫成功");
//_redisData.Set("YTCS_CallCtuEmptyIn_CS03_flag", true, TimeSpan.FromMinutes(20));
}
else
{
msg = $"ctu6空箱入呼叫失败:{result.msg}";
Log.Error($"【EmptyCarryOutStk】ctu6空箱入呼叫失败:{result.msg}");
}
return msg;
}