From 2ca0bc7acb2fe719581e426eb5c7da96053cb31d Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周三, 03 12月 2025 11:42:57 +0800
Subject: [PATCH] 禁用操作日志
---
iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 107 insertions(+), 8 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 b7f4f72..8203f06 100644
--- a/iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs
+++ b/iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs
@@ -165,6 +165,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 +177,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 +199,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;
}
@@ -239,6 +251,15 @@
.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,
WorkingProcedureCurrent = s.a.WorkingProcedureCurrent,
EquipmentID = s.a.EquipmentID,
@@ -486,13 +507,13 @@
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("宸ヤ欢鍑哄簱澶辫触锛氭暟鎹笉鑳戒负绌猴紒");
+ throw Oops.Oh("宸ヤ欢鍏ュ簱澶辫触锛氭暟鎹笉鑳戒负绌猴紒");
}
List<OutBoundDetailsInput> WorkPieceInfoLst = input.WorkPieceInfoLst;
@@ -504,22 +525,31 @@
List<WorkPieceInfo> db_WorkPieceInfoList = await _workPieceInfoRep.Where(w => queryOP80NewCodeList.Contains(w.OP80NewCode) && w.IsDeleted == false).ToListAsync();
+ var addOutBoundLogList = new List<WorkPieceOutboundRecord>();
+
foreach (var item in WorkPieceInfoLst)
{
- var itemModel = db_itemModelList.FirstOrDefault(w => w.OP80NewCode == item.OP80NewCode);
+ var itemModel = db_itemModelList.FirstOrDefault(w => w.OP80NewCode == item.OP80NewCode && w.IsDeleted == false);
if (itemModel != null)
{
//itemModel.IsDeleted = true;
//itemModel.Remark = itemModel.Remark ?? "" + "浜屾鍙戣揣鑷姩鎾ら攢鍙戣揣";
//await _workPieceOutboundRep.UpdateAsync(itemModel);
+
+ /*
var createitme = itemModel.CreatedTime == null ? "" : (((DateTimeOffset)itemModel.CreatedTime).UtcDateTime.ToString("yyyy-MM-dd HH:mm:ss"));
throw Oops.Oh($"鎴愬搧鐮亄itemModel.OP80NewCode}宸插嚭搴擄紝鍑哄簱鏃堕棿:{createitme}");
+
+ //*/
+
+ //涓嶅啀鎻愮ず鍑烘潵锛岃嚜鍔ㄥ拷鐣� 銆怑ditby shaocx,2024-09-04銆�
+ continue;
}
var workPiece = db_WorkPieceInfoList.FirstOrDefault(w => w.OP80NewCode == item.OP80NewCode);
if (workPiece != null)
{
workPiece.OutPerson = CurrentUserInfo.Name;
- workPiece.OutRemark = "鎾ら攢宸ヤ欢鍑哄簱";
+ workPiece.OutRemark = "鎾ら攢宸ヤ欢鍏ュ簱";
workPiece.OutTime = DateTime.Now;
workPiece.IsOut = false;
@@ -537,9 +567,28 @@
};
addOutBoundList.Add(outBoundLog);
+ var outBoundLogRecord = new WorkPieceOutboundRecord
+ {
+ OperationType = OutboundOperationType.鍏ュ簱.ToString(),
+ WorkPieceID = workPiece?.WorkPieceID,
+ OP80NewCode = item.OP80NewCode,
+
+ CreatedUserId = CurrentUserInfo.UserId,
+ CreatedUserName = CurrentUserInfo.Name,
+
+
+ //CarNo = input.CarNo,
+ Remark = "宸ヤ欢鍏ュ簱",
+
+ };
+ addOutBoundLogList.Add(outBoundLogRecord);
+
}
await _workPieceOutboundRep.InsertAsync(addOutBoundList);
+
+ await _workPieceOutboundRecordRep.InsertAsync(addOutBoundLogList);
+
return "鍑哄簱鎴愬姛";
}
@@ -667,7 +716,7 @@
return "涓嬬嚎鎴愬姛";
}
-
+
/// <summary>
@@ -693,6 +742,12 @@
w.CarNo == input.CarNo
&& w.UnLineStage == PieceUnLineStage.宸蹭笅绾�
&& w.IsDeleted == false).ToListAsync();
+
+ if (db_WorkPieceOutboundList?.Count == 0)
+ {
+ throw Oops.Oh("娌℃湁鍙嚭搴撶殑鏁版嵁锛�");
+ }
+
var queryOP80NewCodeList = db_WorkPieceOutboundList.Select(x => x.OP80NewCode).ToList();
@@ -867,6 +922,50 @@
}
+
+ /// <summary>
+ /// 鍑哄簱缁熻
+ /// </summary>
+ /// <param name="input"></param>
+ /// <returns></returns>
+ [HttpPost("getOutBoundWorkPieceInfoCountList")]
+ [DisableOpLog]
+ public async Task<List<OutBoundWorkPieceInfoCountOutput>> GetOutBoundWorkPieceInfoCountList([FromBody] OutBoundWorkPieceInfoCountInput input)
+ {
+ /*
+ //娴嬭瘯
+ List<OutBoundWorkPieceInfoCountOutput> outBoundWorkPieceInfoCountOutputs = new List<OutBoundWorkPieceInfoCountOutput>();
+ outBoundWorkPieceInfoCountOutputs.Add(new OutBoundWorkPieceInfoCountOutput()
+ {
+ Count = 10,
+ WorkPieceOutboundUserName = "AAA"
+ });
+ outBoundWorkPieceInfoCountOutputs.Add(new OutBoundWorkPieceInfoCountOutput()
+ {
+ Count = 99,
+ WorkPieceOutboundUserName = "BBb"
+ });
+ return outBoundWorkPieceInfoCountOutputs;
+ //*/
+
+
+ //DateTimeOffset now = DateTimeOffset.Now; // 鑾峰彇褰撳墠鏃堕棿锛屽寘鎷椂鍖哄亸绉婚噺
+ DateTimeOffset now = input.Date; // 鑾峰彇褰撳墠鏃堕棿锛屽寘鎷椂鍖哄亸绉婚噺
+ DateTimeOffset startOfDay = new DateTimeOffset(now.Year, now.Month, now.Day, 0, 0, 0, now.Offset); // 褰撳ぉ寮�濮嬫椂闂�
+ DateTimeOffset endOfDay = new DateTimeOffset(now.Year, now.Month, now.Day, 23, 59, 59, now.Offset); // 褰撳ぉ缁撴潫鏃堕棿
+ List<WorkPieceOutbound> db_itemModelList = await _workPieceOutboundRep.Where(w => w.CreatedTime >= startOfDay
+ && w.CreatedTime <= endOfDay && w.IsDeleted == false).ToListAsync();
+ //姹囨�诲垎缁�
+ var groupList = db_itemModelList.GroupBy(g => g.WorkPieceOutboundUserName).Select(s => new OutBoundWorkPieceInfoCountOutput()
+ {
+ WorkPieceOutboundUserName = s.Key,
+ Count = s.ToList().Count
+ }).ToList();
+ return groupList;
+ //*/
+ }
+
+
#endregion
}
--
Gitblit v1.9.3