From 820715f221332b8b291a31fb0bd88b9fca59ddbd Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周四, 04 12月 2025 10:19:08 +0800
Subject: [PATCH] 222
---
iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs | 52 +++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 41 insertions(+), 11 deletions(-)
diff --git a/iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs b/iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs
index 699af9d..4c79719 100644
--- a/iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs
+++ b/iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs
@@ -1,15 +1,16 @@
锘縰sing Furion.DatabaseAccessor;
-using Furion.FriendlyException;
-using iWare.Wms.Core.Util;
-using iWare.Wms.Core;
-using Mapster;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.EntityFrameworkCore;
using Furion.DependencyInjection;
using Furion.DynamicApiController;
-using System.Text;
+using Furion.FriendlyException;
+using iWare.Wms.Core;
using iWare.Wms.Core.Enum;
+using iWare.Wms.Core.Util;
+using Mapster;
using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Internal;
+using System.Text;
namespace iWare.Wms.Application.Service.Pda
{
@@ -165,6 +166,8 @@
[HttpPost("UpdateAlertStatus")]
public async Task<int> UpdateAlertStatus(EquipmentAlertClose input)
{
+ var v_GetEquipmentAlert = await _v_GetEquipmentAlertRep.FirstAsync(x => x.Id == input.v_get_equipment_alert_id);
+
var equipmentBaseInfo = await _equipmentBaseInfoRep.FirstOrDefaultAsync(u => u.EquipmentId == input.EquipmentId && u.IsDeleted == false);
if (equipmentBaseInfo == null)
@@ -175,17 +178,21 @@
{
throw Oops.Oh($"鏈紶鍏ラ渶鍏抽棴鐨勫憡璀︾被鍨�,涓嶈兘鍏抽棴锛�");
}
+ //鍛婅绫诲瀷 锛�1锛氭竻娲楁恫鏇存崲鍛婅锛�2锛氬垁鍏锋洿鎹㈠憡璀︼紱3锛氬垏鍓婃恫鏇存崲鍛婅锛�4锛氳澶囧憡璀︼級
if (input.AlertType.Equals("1"))
{
equipmentBaseInfo.Detergentchangetime = DateTime.Now;
+ v_GetEquipmentAlert.IsAlertDetergent = false;
}
else if (input.AlertType.Equals("2"))
{
equipmentBaseInfo.KnifeToolChangeTime = DateTime.Now;
+ v_GetEquipmentAlert.IsAlertKnifeTool = false;
}
else if (input.AlertType.Equals("3"))
{
equipmentBaseInfo.CuttingFluidChangeTime = DateTime.Now;
+ v_GetEquipmentAlert.IsAlertCuttingFluid = false;
}
else if (input.AlertType.Equals("4"))
{
@@ -193,12 +200,18 @@
if (equipmentCurrentMonitor != null)
{
equipmentCurrentMonitor.IsCloseAlert = true;
+ await _equipmentCurrentMonitorRep.UpdateAsync(equipmentCurrentMonitor);
}
+ v_GetEquipmentAlert.IsAlert = false;
}
else
{
throw Oops.Oh($"璁惧{input.EquipmentId}浼犲叆鍛婅绫诲瀷{input.AlertType}涓嶅瓨鍦�,涓嶈兘鍏抽棴锛�");
}
+
+ var isSucess = await _equipmentBaseInfoRep.UpdateAsync(equipmentBaseInfo);
+ await _v_GetEquipmentAlertRep.UpdateAsync(v_GetEquipmentAlert);
+
return 0;
}
@@ -234,12 +247,29 @@
{
var workPieceProcesss = await _workPieceProcessRep.DetachedEntities
.Join(_equipmentBaseInfoRep.DetachedEntities, a => a.EquipmentID, b => b.EquipmentId, (a, b) => new { a, b })
+ // 鏂板 Left Join 鍒� _workPieceInfo 琛�
+ .Join(_workPieceInfoRep.DetachedEntities,
+ temp => temp.a.WorkPieceID, // 浣跨敤涔嬪墠 Join 缁撴灉鐨� a.WorkPieceID
+ c => c.WorkPieceID, // _workPieceInfo 琛ㄧ殑 WorkPieceID
+ (temp, c) => new { temp.a, temp.b, workPieceInfo = c }) // 鍒涘缓鏂扮殑鍖垮悕绫诲瀷鍖呭惈涓変釜瀹炰綋
+
.Where(!string.IsNullOrEmpty(input.WorkPieceID), u => u.a.WorkPieceID.Equals(input.WorkPieceID))
.Where(o => !string.IsNullOrEmpty(o.a.WorkPieceID))
.Select(s => new WorkPieceProcessOutput
{
Id = s.a.Id,
+
+ JiaJuGongWei = s.a.JiaJuGongWei,
+
+ DataCapturePointCname = s.a.DataCapturePointCname,
+ UpdateDataCapturePointCname = s.a.UpdateDataCapturePointCname,
+ QualityNoOkReason = s.a.QualityNoOkReason,
+ CreateUserName = s.a.CreatedUserName,
+ UpdatedUserName = s.a.UpdatedUserName,
+
WorkPieceID = s.a.WorkPieceID,
+ OP80NewCode = s.workPieceInfo.OP80NewCode,//鎴愬搧鐮�
+
WorkingProcedureCurrent = s.a.WorkingProcedureCurrent,
EquipmentID = s.a.EquipmentID,
EquipmentName = s.b.EquipmentName,
@@ -486,10 +516,10 @@
public async Task<string> outBoundWorkPiece([FromBody] OutBoundInput input)
{
- if (input.Password == null || !input.Password.Equals("123456"))
- {
- throw Oops.Oh("淇敼宸ヤ欢璐ㄩ噺鐘舵�佸け璐ワ細瀵嗙爜杈撳叆閿欒锛�");
- }
+ //if (input.Password == null || !input.Password.Equals("123456"))
+ //{
+ // throw Oops.Oh("淇敼宸ヤ欢璐ㄩ噺鐘舵�佸け璐ワ細瀵嗙爜杈撳叆閿欒锛�");
+ //}
if (input.WorkPieceInfoLst.Count < 1)
{
throw Oops.Oh("宸ヤ欢鍏ュ簱澶辫触锛氭暟鎹笉鑳戒负绌猴紒");
--
Gitblit v1.9.3