注塑空载具出库优化
This commit is contained in:
@@ -2,6 +2,8 @@ using Aop.Api.Domain;
|
||||
using JNPF;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
@@ -51,6 +53,33 @@ namespace Tnb.ProductionMgr
|
||||
_billRullService = billRullService;
|
||||
_wmsEmptyOutstockService = wmsEmptyOutstockService;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<dynamic> test()
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
|
||||
await db.Ado.BeginTranAsync();
|
||||
BasUnit basUnit = new BasUnit();
|
||||
basUnit.id = SnowflakeIdHelper.NextId();
|
||||
basUnit.unit_name = "aaa";
|
||||
basUnit.unit_code = "bbb";
|
||||
await db.Insertable(basUnit).ExecuteCommandAsync();
|
||||
|
||||
await db.Ado.CommitTranAsync();
|
||||
|
||||
await db.Ado.BeginTranAsync();
|
||||
BasUnit basUnit2 = new BasUnit();
|
||||
basUnit2.id = SnowflakeIdHelper.NextId();
|
||||
basUnit2.unit_name = "ccc";
|
||||
basUnit2.unit_code = "ddd";
|
||||
await db.Insertable(basUnit2).ExecuteCommandAsync();
|
||||
|
||||
await db.Ado.CommitTranAsync();
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注塑空载具出库
|
||||
@@ -60,56 +89,83 @@ namespace Tnb.ProductionMgr
|
||||
[AllowAnonymous]
|
||||
public async Task<dynamic> EmptyCarryOutStk()
|
||||
{
|
||||
bool cs01 = _redisData.Get<bool>("CallCcuEmptyin_cs01");
|
||||
bool c503 = _redisData.Get<bool>("CallCtuEmptyin c503");
|
||||
bool cs01Flag = _redisData.Get<bool>("CallCcuEmptyin_cs01_flag");
|
||||
bool c503Flag = _redisData.Get<bool>("CallCtuEmptyin c503_flag");
|
||||
if (cs01 && !cs01Flag)
|
||||
bool? cs01 = await _redisData.TryGetValueByKeyField<bool?>("YTCS", "CallCtuEmptyIn_CS01");
|
||||
bool? cs03 = await _redisData.TryGetValueByKeyField<bool?>("YTCS", "CallCtuEmptyIn_CS03");
|
||||
bool cs01Flag = _redisData.Get<bool>("YTCS_CallCtuEmptyIn_CS01_flag");
|
||||
bool cs03Flag = _redisData.Get<bool>("YTCS_CallCtuEmptyIn_CS03_flag");
|
||||
if (cs01==true && !cs01Flag)
|
||||
{
|
||||
MESEmptyCarryOutStkInput input = new MESEmptyCarryOutStkInput();
|
||||
input.org_id = "";
|
||||
input.location_code = "SSX-021-001";
|
||||
input.warehouse_id = WmsWareHouseConst.WAREHOUSE_ZC_ID;
|
||||
input.carrystd_id = WmsWareHouseConst.LIAOXIANGID;
|
||||
input.qty = 5;
|
||||
Log.Information($"【EmptyCarryOutStk】左输送线空箱入呼叫开始,参数:{JsonConvert.SerializeObject(input)}");
|
||||
Result result = await _wmsEmptyOutstockService.MESEmptyCarryOutStk(input);
|
||||
if (result.code == HttpStatusCode.OK)
|
||||
{
|
||||
Log.Information("【EmptyCarryOutStk】左输送线空箱入呼叫成功");
|
||||
_redisData.Set("CallCcuEmptyin_cs01_flag", true, TimeSpan.FromMinutes(20));
|
||||
}
|
||||
BasFactoryConfig config = await _repository.AsSugarClient().Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.DOMAIN);
|
||||
HttpUtils.RequestGet($"http://localhost:9232/api/production/time-work/empty-carry-out-stk-left");
|
||||
}
|
||||
|
||||
if (c503 && !c503Flag)
|
||||
if (cs03==true && !cs03Flag)
|
||||
{
|
||||
MESEmptyCarryOutStkInput input = new MESEmptyCarryOutStkInput();
|
||||
input.org_id = "";
|
||||
input.location_code = "SSX-021-003";
|
||||
input.warehouse_id = WmsWareHouseConst.WAREHOUSE_ZC_ID;
|
||||
input.carrystd_id = WmsWareHouseConst.LIAOXIANGID;
|
||||
input.qty = 5;
|
||||
Log.Information($"【EmptyCarryOutStk】右输送线空箱入呼叫开始,参数:{JsonConvert.SerializeObject(input)}");
|
||||
Result result = await _wmsEmptyOutstockService.MESEmptyCarryOutStk(input);
|
||||
if (result.code == HttpStatusCode.OK)
|
||||
{
|
||||
Log.Information("【EmptyCarryOutStk】右输送线空箱入呼叫成功");
|
||||
_redisData.Set("CallCtuEmptyin c503_flag", true, TimeSpan.FromMinutes(20));
|
||||
}
|
||||
BasFactoryConfig config = await _repository.AsSugarClient().Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.DOMAIN);
|
||||
HttpUtils.RequestGet($"http://localhost:9232/api/production/time-work/empty-carry-out-stk-right");
|
||||
}
|
||||
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<dynamic> EmptyCarryOutStkLeft()
|
||||
{
|
||||
MESEmptyCarryOutStkInput input = new MESEmptyCarryOutStkInput();
|
||||
input.org_id = WmsWareHouseConst.AdministratorOrgId;
|
||||
input.location_code = "SSX-021-001";
|
||||
input.warehouse_id = WmsWareHouseConst.WAREHOUSE_ZC_ID;
|
||||
input.carrystd_id = WmsWareHouseConst.LIAOXIANGID;
|
||||
input.qty = 1;
|
||||
input.create_id = WmsWareHouseConst.AdministratorUserId;
|
||||
Log.Information($"【EmptyCarryOutStk】左输送线空箱入呼叫开始,参数:{JsonConvert.SerializeObject(input)}");
|
||||
Result result = await _wmsEmptyOutstockService.MESEmptyCarryOutStk(input);
|
||||
if (result.code == HttpStatusCode.OK)
|
||||
{
|
||||
Log.Information("【EmptyCarryOutStk】左输送线空箱入呼叫成功");
|
||||
//_redisData.Set("YTCS_CallCtuEmptyIn_CS01_flag", true, TimeSpan.FromMinutes(20));
|
||||
}
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<dynamic> EmptyCarryOutStkRight()
|
||||
{
|
||||
MESEmptyCarryOutStkInput input = new MESEmptyCarryOutStkInput();
|
||||
input.org_id = WmsWareHouseConst.AdministratorOrgId;
|
||||
input.location_code = "SSX-021-003";
|
||||
input.warehouse_id = WmsWareHouseConst.WAREHOUSE_ZC_ID;
|
||||
input.carrystd_id = WmsWareHouseConst.LIAOXIANGID;
|
||||
input.qty = 1;
|
||||
input.create_id = WmsWareHouseConst.AdministratorUserId;
|
||||
Log.Information($"【EmptyCarryOutStk】右输送线空箱入呼叫开始,参数:{JsonConvert.SerializeObject(input)}");
|
||||
Result result = await _wmsEmptyOutstockService.MESEmptyCarryOutStk(input);
|
||||
if (result.code == HttpStatusCode.OK)
|
||||
{
|
||||
Log.Information("【EmptyCarryOutStk】右输送线空箱入呼叫成功");
|
||||
//_redisData.Set("YTCS_CallCtuEmptyIn_CS03_flag", true, TimeSpan.FromMinutes(20));
|
||||
}
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<dynamic> FixedPointDelivery()
|
||||
{
|
||||
bool value = _redisData.Get<bool>("DB100.132.0");
|
||||
bool valueFlag = _redisData.Get<bool>("DB100.132.0_flag");
|
||||
if (value && !valueFlag)
|
||||
bool? value = await _redisData.TryGetValueByKeyField<bool?>("hxjA", "DB100.132.0");
|
||||
bool valueFlag = _redisData.Get<bool>("hxjA_DB100.132.0_flag");
|
||||
if (value==true && !valueFlag)
|
||||
{
|
||||
bool? cs01 = await _redisData.TryGetValueByKeyField<bool?>("YTCS", "CallCtuEmptyIn_CS01");
|
||||
bool? cs03 = await _redisData.TryGetValueByKeyField<bool?>("YTCS", "CallCtuEmptyIn_CS03");
|
||||
string startLocationCode = cs01==false ? "SSX-021-001" : cs03==false ? "SSX-021-003" : "";
|
||||
if (startLocationCode.IsEmpty())
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<String, Object> postData = new Dictionary<string, object>();
|
||||
|
||||
@@ -125,7 +181,7 @@ namespace Tnb.ProductionMgr
|
||||
if(authResponse.code == 200 && authResponse.data.ObjToBool())
|
||||
{
|
||||
Log.Information("【FixedPointDelivery】注塑定点配送成功");
|
||||
_redisData.Set("DB100.132.0_flag", true, TimeSpan.FromMinutes(20));
|
||||
//_redisData.Set("DB100.132.0_flag", true, TimeSpan.FromMinutes(20));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user