This commit is contained in:
2023-11-22 16:02:09 +08:00
parent e35811b36d
commit 9cfc0a0e8a
6 changed files with 40 additions and 16 deletions

View File

@@ -198,7 +198,8 @@ namespace Tnb.ProductionMgr
codeqty = Convert.ToInt32(item.ContainsKey("quantity") ? item["quantity"] : "0"),
});
}
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://tnb.tuotong-tech.com";
Dictionary<string, object> header = new()
{
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
@@ -275,11 +276,20 @@ namespace Tnb.ProductionMgr
}
ISqlSugarClient db = _repository.AsSugarClient();
EqpEquipment equipment = await db.Queryable<EqpEquipment>()
.LeftJoin<EqpDaq>((x,y)=>x.id==y.equip_id)
.Where((x,y) => y.equip_code==equip_code && y.label_name==label_code && y.label_point=="提报装箱称重点位")
.Select((x,y)=>x)
.FirstAsync();
EqpEquipment equipment = null;
try
{
equipment = await db.Queryable<EqpEquipment>()
.LeftJoin<EqpDaq>((x,y)=>x.id==y.equip_id)
.Where((x,y) => y.equip_code==equip_code && y.label_name==label_code && y.label_point=="提报装箱称重点位")
.Select((x,y)=>x)
.FirstAsync();
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
if (equipment == null)
{
throw Oops.Bah("未找到机台");
@@ -299,6 +309,7 @@ namespace Tnb.ProductionMgr
PrdReport prdReport = await db.Queryable<PrdReport>()
.Where(x => x.equip_id == equipment.id && x.status == 0).OrderByDescending(x => x.create_time)
.FirstAsync();
string create_id = prdReport.create_id;
if (prdReport == null)
{
throw Oops.Bah("未找到提报记录");
@@ -317,14 +328,14 @@ namespace Tnb.ProductionMgr
{
bill_type = DictConst.CHANCHENGPINRUKUDAN,
bill_date = DateTime.Now,
create_id = _userManager.UserId,
create_id = create_id,
location_code = basLocation.location_code,
carry_code = prdReport.material_box_code,
is_check = 1,
station_id = prdReport.station,
workline_id = workline?.Id ?? "",
workshop_id = workshop?.Id ?? "",
org_id = _userManager.GetUserInfo().Result.organizeId,
// org_id = _userManager.GetUserInfo().Result.organizeId,
// warehouse_id = basLocation?.wh_id,
warehouse_id = warehouse_id,
status = 0,
@@ -349,13 +360,13 @@ namespace Tnb.ProductionMgr
{
instock = new MESWmsInstockHInput()
{
org_id = _userManager.GetUserInfo().Result.organizeId,
// org_id = _userManager.GetUserInfo().Result.organizeId,
bill_date = DateTime.Now,
bill_type = DictConst.CHANCHENGPINRUKUDAN,
// warehouse_id = basLocation?.wh_id,
warehouse_id = warehouse_id,
source_id = prdInstockH.id,
create_id = _userManager.UserId,
create_id = create_id,
carry_code = prdReport.material_box_code,
location_code = basLocation.location_code,
is_check = 1,
@@ -381,10 +392,11 @@ namespace Tnb.ProductionMgr
code_batch = prdReport.barcode + "0001",
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://tnb.tuotong-tech.com";
Dictionary<string, object> header = new()
{
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
// ["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
};
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK, JsonConvert.SerializeObject(mesCreateInstockInput), header);
Log.Information(sendResult);
@@ -488,7 +500,8 @@ namespace Tnb.ProductionMgr
code_batch = prdReport.barcode + "0001",
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://tnb.tuotong-tech.com";
Dictionary<string, object> header = new()
{
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
@@ -598,7 +611,8 @@ namespace Tnb.ProductionMgr
code_batch = prdReport.barcode + "0001",
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://tnb.tuotong-tech.com";
Dictionary<string, object> header = new()
{
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
@@ -782,7 +796,8 @@ namespace Tnb.ProductionMgr
});
}
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://tnb.tuotong-tech.com";
Dictionary<string, object> header = new()
{
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]

View File

@@ -220,7 +220,7 @@ namespace Tnb.ProductionMgr
}
public Task StartAsync(CancellationToken cancellationToken)
{
Readtimer = new Timer(GetRedisData, null, TimeSpan.Zero, TimeSpan.FromMinutes(5));
Readtimer = new Timer(GetRedisData, null, TimeSpan.Zero, TimeSpan.FromSeconds(60));
return Task.CompletedTask;
}
public Task StopAsync(CancellationToken cancellationToken)

View File

@@ -6,6 +6,7 @@ using JNPF.EventBus;
using JNPF.FriendlyException;
using JNPF.Systems.Interfaces.System;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Tnb.BasicData.Entities;
@@ -267,6 +268,7 @@ namespace Tnb.WarehouseMgr
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public async Task<dynamic> MESCreateInstock(MESCreateInstockInput input)
{
bool isSuccessFul = false;
@@ -498,6 +500,7 @@ namespace Tnb.WarehouseMgr
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public async Task<dynamic> MesFetchInOutStockInfoByBarCode(MaterialLabelQuery input)
{
if (input.IsNull())

View File

@@ -13,6 +13,7 @@ using JNPF.VisualDev;
using JNPF.VisualDev.Entitys;
using JNPF.VisualDev.Interfaces;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using SqlSugar;
@@ -551,6 +552,7 @@ namespace Tnb.WarehouseMgr
/// <returns></returns>
[HttpPost]
//[NonUnify]
[AllowAnonymous]
public async Task<dynamic> MESCreateOutstock(MESCreateOutstockInput input)
{
bool isSuccessful = true;

View File

@@ -2,6 +2,7 @@
using JNPF.Common.Extension;
using JNPF.Systems.Interfaces.System;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Tnb.BasicData.Entities;
@@ -114,6 +115,7 @@ namespace Tnb.WarehouseMgr
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public async Task<dynamic> MESCarrySign(MESCarrySignInput input)
{
if (input.IsNull())

View File

@@ -12,6 +12,7 @@ using JNPF.LinqBuilder;
using JNPF.Logging;
using JNPF.Systems.Interfaces.System;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Tnb.BasicData.Entities;
@@ -391,6 +392,7 @@ namespace Tnb.WarehouseMgr
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public async Task<dynamic> MESKittingOutStk(List<MESKittingOutStkInput> input)
{
bool isSuccessFul = false;