From 8a9708ffc75c57120d35126f6d7a4f97c6822642 Mon Sep 17 00:00:00 2001
From: zhou keda <1315948824@qq.com>
Date: Fri, 28 Jun 2024 16:04:51 +0800
Subject: [PATCH] bug
---
.../IPrdMaterialReceiptService.cs | 12 +++++------
.../Tnb.ProductionMgr/PrdFeedingService.cs | 4 ++--
.../PrdMaterialReceiptService.cs | 21 +++++++++++++++++--
3 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMaterialReceiptService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMaterialReceiptService.cs
index 460fbbcc..0da2bd3b 100644
--- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMaterialReceiptService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMaterialReceiptService.cs
@@ -7,12 +7,12 @@ namespace Tnb.ProductionMgr.Interfaces
///
public interface IPrdMaterialReceiptService
{
- ///
- /// 根据铁片二维码获取信息
- ///
- ///
- ///
- public Task GetInfoByQrCode(string qrCode);
+ // ///
+ // /// 根据铁片二维码获取信息
+ // ///
+ // ///
+ // ///
+ // public Task GetInfoByQrCode(string qrCode);
///
/// 保存数据
diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs
index 9dc55371..2e75fa17 100644
--- a/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs
@@ -507,8 +507,8 @@ namespace Tnb.ProductionMgr
{
org = prdFeedingH.org_id,
create_id = prdFeedingH.create_id,
- carry_id = prdFeedingH.carry_id,
- carry_code = prdFeedingH.carry_code,
+ carry_id = prdMaterialReceiptH.carry_id,
+ carry_code = prdMaterialReceiptH.carry_code,
carrystd_id = carry.carrystd_id,
membercarry_code = item.member_carry_code,
membercarry_id = item.member_carry_id,
diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs
index e58eb8e1..d63ddb33 100644
--- a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs
@@ -64,8 +64,11 @@ namespace Tnb.ProductionMgr
[HttpPost]
- public async Task GetInfoByQrCode(string qrCode)
+ public async Task GetInfoByQrCode(Dictionary dic)
{
+ string qrCode = dic["qrcode"];
+ string station_id = dic["station_id"];
+
ISqlSugarClient db = _repository.AsSugarClient();
// var result = await db.Queryable()
// .Where((a) => a.carry_code == qrCode)
@@ -87,12 +90,25 @@ namespace Tnb.ProductionMgr
// })
// }).FirstAsync();
+ OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(station_id, DictConst.RegionCategoryWorklineCode);
+ PrdMoTask prdMoTask = await db.Queryable().Where(x => x.workline_id == workline.Id && x.worker_id == _userManager.UserId && x.mo_task_status==DictConst.InProgressEnCode)
+ .FirstAsync();
+
+ if (prdMoTask == null)
+ {
+ throw Oops.Bah("未找到进行中的任务单");
+ }
+
+ List ids = await db.Queryable()
+ .Where(x => x.mo_task_id == prdMoTask.id).Select(x=>x.id).ToListAsync();
+
+
if (await db.Queryable()
.AnyAsync(x => x.member_carry_code == qrCode && x.is_all_feeding == 0))
{
FeedingDetailOutput result = await db.Queryable()
.LeftJoin((a, b) => b.carry_code==qrCode)
- .Where((a) => a.member_carry_code == qrCode && a.is_all_feeding == 0)
+ .Where((a) => a.member_carry_code == qrCode && a.is_all_feeding == 0 && ids.Contains(a.material_receipt_id))
.Select((a, b) => new FeedingDetailOutput
{
carry_id = b.id,
@@ -432,6 +448,7 @@ namespace Tnb.ProductionMgr
CarryQueryOutput carryQueryOutput = await _wmsCarryQueryService.MESCarryQueryResult(new MESCarryQueryResultInput(){carry_code = carry.carry_code});
if (carryQueryOutput.wmsCarryCodes != null && carryQueryOutput.wmsCarryCodes.Count > 0)
{
+ Log.Information($"签收载具信息{JsonConvert.SerializeObject(carryQueryOutput)}");
foreach (var item in carryQueryOutput.wmsCarryCodes)
{