From f9190154ed17006dca9c44bb28c38cbc0fe9ee27 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期四, 12 十二月 2024 10:59:20 +0800
Subject: [PATCH] 11
---
entity/MessageCenter.cs | 12 +-
entity/MesInvItemStocks.cs | 11 ++
entity/MesSysPageview.cs | 27 +++---
service/base/MessageCenterManager.cs | 8 +-
service/base/LoginService.cs | 57 +++++++-------
service/Warehouse/MesInvItemInCDetailsManager.cs | 3
Controllers/QC/LljController.cs | 2
service/QC/LljService.cs | 2
service/Warehouse/MesInvItemOutsManager.cs | 65 ++++------------
9 files changed, 79 insertions(+), 108 deletions(-)
diff --git a/Controllers/QC/LljController.cs b/Controllers/QC/LljController.cs
index 44dbfc6..67510f1 100644
--- a/Controllers/QC/LljController.cs
+++ b/Controllers/QC/LljController.cs
@@ -41,7 +41,7 @@
try
{
dynamic resultInfos = new ExpandoObject();
- var item = new LljService().getBadge();
+ var item = new LljService().getBadge();
var tbBillList =
resultInfos.tbBillList = item;
return new ResponseResult
diff --git a/entity/MesInvItemStocks.cs b/entity/MesInvItemStocks.cs
index 3c8dffc..3b75104 100644
--- a/entity/MesInvItemStocks.cs
+++ b/entity/MesInvItemStocks.cs
@@ -210,5 +210,14 @@
[SugarColumn(ColumnName = "ITEM_ID")]
public long? ItemId { get; set; }
- [SugarColumn(ColumnName = "SUPP_ID")] public string? SuppId { get; set; }
+ /// <summary>
+ /// </summary>
+ [SugarColumn(ColumnName = "SUPP_ID")]
+ public string? SuppId { get; set; }
+
+ /// <summary>
+ /// 浠撳簱ID
+ /// </summary>
+ [SugarColumn(ColumnName = "DEPOT_ID")]
+ public int? DepotId { get; set; }
}
\ No newline at end of file
diff --git a/entity/MesSysPageview.cs b/entity/MesSysPageview.cs
index 7440f0a..2688515 100644
--- a/entity/MesSysPageview.cs
+++ b/entity/MesSysPageview.cs
@@ -9,45 +9,42 @@
public class MesSysPageview
{
/// <summary>
- /// 涓婚敭
- /// 榛樿鍊�: (newid())
- ///</summary>
+ /// 涓婚敭
+ /// 榛樿鍊�: (newid())
+ /// </summary>
[SugarColumn(ColumnName = "guid", IsPrimaryKey = true)]
public Guid Guid { get; set; }
/// <summary>
- /// 椤甸潰涓枃鍚�
- ///</summary>
+ /// 椤甸潰涓枃鍚�
+ /// </summary>
[SugarColumn(ColumnName = "PAGE_VIEW")]
public string PageView { get; set; }
/// <summary>
- /// 椤甸潰璺緞
- ///</summary>
+ /// 椤甸潰璺緞
+ /// </summary>
[SugarColumn(ColumnName = "PATH")]
public string Path { get; set; }
/// <summary>
- /// 椤甸潰鍥炬爣
- ///</summary>
+ /// 椤甸潰鍥炬爣
+ /// </summary>
[SugarColumn(ColumnName = "ICOIMG")]
public string Icoimg { get; set; }
/// <summary>
- ///
- ///</summary>
+ /// </summary>
[SugarColumn(ColumnName = "PAGE_GROUP")]
public string PageGroup { get; set; }
/// <summary>
- ///
- ///</summary>
+ /// </summary>
[SugarColumn(ColumnName = "PAGE_IDX")]
public int? PageIdx { get; set; }
/// <summary>
- ///
- ///</summary>
+ /// </summary>
[SugarColumn(ColumnName = "PAGE_STATUS")]
public bool? PageStatus { get; set; }
}
\ No newline at end of file
diff --git a/entity/MessageCenter.cs b/entity/MessageCenter.cs
index 6ad84f7..72523bf 100644
--- a/entity/MessageCenter.cs
+++ b/entity/MessageCenter.cs
@@ -87,13 +87,13 @@
public Guid? Pid { get; set; }
/// <summary>
- /// 鎵ц椤哄簭 榛樿鍊�: ((1))
+ /// 鎵ц椤哄簭 榛樿鍊�: ((1))
/// </summary>
[SugarColumn(ColumnName = "seq")]
public int? Seq { get; set; }
/// <summary>
- /// 椤甸潰璺緞
+ /// 椤甸潰璺緞
/// </summary>
[SugarColumn(ColumnName = "route")]
public string? Route { get; set; }
@@ -105,25 +105,25 @@
public string? Data { get; set; }
/// <summary>
- /// 鍙傛暟绫诲瀷
+ /// 鍙傛暟绫诲瀷
/// </summary>
[SugarColumn(ColumnName = "content_type")]
public string? ContentType { get; set; }
/// <summary>
- /// 鏄惁鏄秷鎭� 0涓烘帹閫佸け璐� 1涓烘秷鎭�,榛樿涓�0
+ /// 鏄惁鏄秷鎭� 0涓烘帹閫佸け璐� 1涓烘秷鎭�,榛樿涓�0
/// </summary>
[SugarColumn(ColumnName = "is_message")]
public int? IsMessage { get; set; }
/// <summary>
- /// 鏈�鍚庝竴娆′慨鏀规椂闂�
+ /// 鏈�鍚庝竴娆′慨鏀规椂闂�
/// </summary>
[SugarColumn(ColumnName = "update_date")]
public string? UpdateDate { get; set; }
/// <summary>
- /// 鏈�鍚庝竴娆′慨鏀逛汉
+ /// 鏈�鍚庝竴娆′慨鏀逛汉
/// </summary>
[SugarColumn(ColumnName = "update_by")]
public string? UpdateBy { get; set; }
diff --git a/service/QC/LljService.cs b/service/QC/LljService.cs
index a38eb54..fce4be8 100644
--- a/service/QC/LljService.cs
+++ b/service/QC/LljService.cs
@@ -451,9 +451,7 @@
if (qsItemOqcItem.FupAllow.IsNullOrEmpty()
&& qsItemOqcItem.FdownAllow.IsNullOrEmpty()
&& qsItemOqcItem.Fstand == null)
- {
mesQaItemsDetectDetail12.isNumber = false;
- }
}
return rkjDto;
diff --git a/service/Warehouse/MesInvItemInCDetailsManager.cs b/service/Warehouse/MesInvItemInCDetailsManager.cs
index 8ce4430..cd4dbf9 100644
--- a/service/Warehouse/MesInvItemInCDetailsManager.cs
+++ b/service/Warehouse/MesInvItemInCDetailsManager.cs
@@ -558,7 +558,8 @@
EbelnK3id = itemBarcodeDetails.EbelnK3id,
LineK3id = itemBarcodeDetails.LineK3id,
ItemId = itemBarcodeDetails.ItemId,
- BillNo = itemBarcodeDetails.BillNo
+ BillNo = itemBarcodeDetails.BillNo,
+ DepotId = Convert.ToInt32(depotCode2)
}).IgnoreColumns(true).ExecuteCommand();
itemBarcodeDetails.Hbdy ??= 0;
diff --git a/service/Warehouse/MesInvItemOutsManager.cs b/service/Warehouse/MesInvItemOutsManager.cs
index 59c5394..dd2664f 100644
--- a/service/Warehouse/MesInvItemOutsManager.cs
+++ b/service/Warehouse/MesInvItemOutsManager.cs
@@ -340,9 +340,7 @@
}
if (!UtilityHelper.CheckGuid(parsedGuid))
- {
throw new ApplicationException("鏇存柊閿欒锛屾暟鎹槸涓嶅悎娉曠殑");
- }
var userName = entity.userName ?? "system";
return Db.Updateable<MesInvItemOuts>()
@@ -382,10 +380,7 @@
message.Pid = newGuid;
var executeReturnIdentity =
Db.Insertable(message).IgnoreColumns(true).ExecuteCommand();
- if (executeReturnIdentity > 0)
- {
- return message;
- }
+ if (executeReturnIdentity > 0) return message;
throw new Exception("鑾峰彇鏁版嵁澶辫触");
}
@@ -528,7 +523,7 @@
FUnitID = d.Fnumber,
FLot = b.WorkNo,
F_MES_ENTRYID = b.Guid,
- FsrcEntryId = e.Guid.ToString(),
+ FsrcEntryId = e.Guid.ToString()
}).ToList();
@@ -537,13 +532,13 @@
var jsonEntries = materials.Select(d => new
{
- FMaterialId = d.FMaterialId,
- FRMREALQTY = d.FRMREALQTY,
- FStockId = d.FStockId,
- FUnitID = d.FUnitID,
- FLot = d.FLot,
+ d.FMaterialId,
+ d.FRMREALQTY,
+ d.FStockId,
+ d.FUnitID,
+ d.FLot,
F_MES_ENTRYID = d.F_MES_ENTRYID.ToString(),
- FsrcEntryId = d.FsrcEntryId,
+ d.FsrcEntryId
}).ToList();
var fdate = DateTime.Now.ToString("yyyy-MM-dd");
var jsonString = JsonConvert.SerializeObject(jsonEntries);
@@ -642,10 +637,7 @@
//璋冪敤瀛樺偍杩囩▼
var prcRfPdaBarcodeCgth = PrcRfPdaBarcodeCgth(query);
- if (!prcRfPdaBarcodeCgth)
- {
- throw new Exception("鎵ц澶辫触");
- }
+ if (!prcRfPdaBarcodeCgth) throw new Exception("鎵ц澶辫触");
// 鍙橀噺鐢ㄤ簬淇濆瓨鏌ヨ缁撴灉
decimal? C_SQ_QTY = 0;
@@ -687,10 +679,7 @@
var commit = UseTransaction(db =>
{
- if (string.IsNullOrEmpty(p_bill_no))
- {
- throw new Exception("璇烽�夊彇鍗曟嵁鍙凤紒");
- }
+ if (string.IsNullOrEmpty(p_bill_no)) throw new Exception("璇烽�夊彇鍗曟嵁鍙凤紒");
// Retrieve mes_inv_item_outs
var c_mes_inv_item_outs = db.Queryable<MesInvItemOuts>()
@@ -698,19 +687,13 @@
.First();
if (c_mes_inv_item_outs == null)
- {
throw new Exception("璇烽�夋嫨鎴栨壂鎻忔纭殑閲囪喘閫�璐у崟锛�");
- }
if (c_mes_inv_item_outs.Status == 0)
- {
throw new Exception("閲囪喘閫�璐х敵璇峰崟鏈鏍革紒");
- }
if (c_mes_inv_item_outs.Nflag == 1)
- {
throw new Exception("閲囪喘閫�璐у崟宸插畬缁撴帹閫丒RP,涓嶈兘鎿嶄綔锛�");
- }
// Check for duplicate barcode scan
c_num = db.Queryable<MesInvItemOutCDetails>()
@@ -719,10 +702,7 @@
b.ItemOutId == c_mes_inv_item_outs.Guid)
.Count();
- if (c_num > 0)
- {
- throw new Exception("姝ゆ潯鐮佸凡閲囪喘閫�璐ф壂鐮佸畬鎴愶紒");
- }
+ if (c_num > 0) throw new Exception("姝ゆ潯鐮佸凡閲囪喘閫�璐ф壂鐮佸畬鎴愶紒");
// Query item stock info
var c_mes_inv_item_stocks = db.Queryable<MesInvItemStocks>()
@@ -730,17 +710,13 @@
.First();
if (c_mes_inv_item_stocks == null)
- {
throw new Exception($"搴撳瓨涓棤姝ゆ潯鐮侊紝璇锋牳瀵癸紒{p_item_barcode}");
- }
// Validate depot codes
if (c_mes_inv_item_outs.DepotCode !=
c_mes_inv_item_stocks.DepotsCode)
- {
throw new Exception(
$"姝ゆ潯鐮佸睘浜庝粨搴� {c_mes_inv_item_stocks.DepotsCode} 涓庨噰璐��璐х敵璇蜂粨搴� {c_mes_inv_item_outs.DepotCode} 涓嶄竴鑷达紝璇锋牳瀵癸紒");
- }
C_STOCKNUM = c_mes_inv_item_stocks.Quantity.Value;
@@ -748,7 +724,7 @@
var quantities = db.Queryable<MesInvItemOutItems, MesInvItemOuts>(
(s, d) => new object[]
{
- JoinType.Left, s.ItemOutId == d.Guid,
+ JoinType.Left, s.ItemOutId == d.Guid
})
.Where((s, d) =>
d.ItemOutNo == p_bill_no &&
@@ -763,9 +739,7 @@
.First();
if (quantities == null)
- {
throw new Exception("閲囪喘閫�鏂欏崟 '" + p_bill_no + "'鏈鏍�");
- }
C_SQTY = quantities.TotalQuantity ?? 0;
C_OKQTY = quantities.CompletedQuantity ?? 0;
@@ -774,7 +748,7 @@
if (C_CQTY < C_STOCKNUM) return 1;
// Handle barcode reduction
- decimal p_number2 = C_STOCKNUM;
+ var p_number2 = C_STOCKNUM;
var itemOutItems = db.Queryable<MesInvItemOutItems>()
.Where(s =>
s.ItemOutId == c_mes_inv_item_outs.Guid &&
@@ -799,9 +773,7 @@
.First();
if (c_mes_inv_item_arn_detail == null)
- {
throw new Exception("鏈壘鍒伴噰璐��鏂欐潵婧愬崟鎹�");
- }
if (CMI.Quantity - CMI.TlQty <= p_number2)
{
@@ -862,15 +834,13 @@
TaskNo = CMI.WorkNo,
ItemId = c_mes_inv_item_stocks.ItemId,
EbelnK3id = c_mes_inv_item_stocks.EbelnK3id,
- LineK3id = c_mes_inv_item_stocks.LineK3id,
+ LineK3id = c_mes_inv_item_stocks.LineK3id
}).IgnoreColumns(true).ExecuteCommand();
if (p_number2 == 0)
- {
db.Deleteable<MesInvItemStocks>()
.Where(s => s.Guid == c_mes_inv_item_outs.Guid)
.ExecuteCommand();
- }
}
else
{
@@ -935,16 +905,13 @@
SuppId = c_mes_inv_item_outs.SuppId.ToString(),
ItemId = c_mes_inv_item_stocks.ItemId,
EbelnK3id = c_mes_inv_item_stocks.EbelnK3id,
- LineK3id = c_mes_inv_item_stocks.LineK3id,
+ LineK3id = c_mes_inv_item_stocks.LineK3id
}).IgnoreColumns(true).ExecuteCommand();
p_number2 = 0;
}
}
- if (p_number2 > 0)
- {
- throw new Exception("鐗╂枡鏁伴噺灏嗚秴閲囪喘閫�鏂欑敵璇峰崟鏁伴噺,鏃犳硶鍑哄簱");
- }
+ if (p_number2 > 0) throw new Exception("鐗╂枡鏁伴噺灏嗚秴閲囪喘閫�鏂欑敵璇峰崟鏁伴噺,鏃犳硶鍑哄簱");
return 1;
});
diff --git a/service/base/LoginService.cs b/service/base/LoginService.cs
index 7165202..609db41 100644
--- a/service/base/LoginService.cs
+++ b/service/base/LoginService.cs
@@ -27,44 +27,43 @@
var sql = "";
var pageViewList = Db.Queryable<MesSysPageview>()
- .Where(s=>s.PageStatus == true)
- .OrderBy(s=>s.PageIdx)
+ .Where(s => s.PageStatus == true)
+ .OrderBy(s => s.PageIdx)
.ToList();
-
- var result = new List<dynamic>();
-
+
+ var result = new List<dynamic>();
+
if ("admin".Equals(name))
{
- var groupedPageViews = pageViewList
- .GroupBy(p => string.IsNullOrEmpty(p.PageGroup) ? "鏈垎缁�" : p.PageGroup)
+ var groupedPageViews = pageViewList
+ .GroupBy(p =>
+ string.IsNullOrEmpty(p.PageGroup) ? "鏈垎缁�" : p.PageGroup)
.ToList();
-
- foreach (var group in groupedPageViews)
- {
- dynamic groupObj = new ExpandoObject();
+
+ foreach (var group in groupedPageViews)
+ {
+ dynamic groupObj = new ExpandoObject();
groupObj.groupName = group.Key; // 鍒嗙粍鍚�
- groupObj.child = new List<MesSysPageview>();
+ groupObj.child = new List<MesSysPageview>();
- foreach (var pageView in group)
- {
- groupObj.child.Add(new MesSysPageview()
- {
- Guid = pageView.Guid,
- PageView = pageView.PageView,
- Path = pageView.Path,
- Icoimg = pageView.Icoimg,
- PageGroup = pageView.PageGroup,
- PageIdx = pageView.PageIdx,
- PageStatus = pageView.PageStatus
- });
- }
+ foreach (var pageView in group)
+ groupObj.child.Add(new MesSysPageview
+ {
+ Guid = pageView.Guid,
+ PageView = pageView.PageView,
+ Path = pageView.Path,
+ Icoimg = pageView.Icoimg,
+ PageGroup = pageView.PageGroup,
+ PageIdx = pageView.PageIdx,
+ PageStatus = pageView.PageStatus
+ });
- result.Add(groupObj);
- }
-
+ result.Add(groupObj);
+ }
+
return result;
}
-
+
return null;
}
diff --git a/service/base/MessageCenterManager.cs b/service/base/MessageCenterManager.cs
index 7651a26..f712f63 100644
--- a/service/base/MessageCenterManager.cs
+++ b/service/base/MessageCenterManager.cs
@@ -110,12 +110,12 @@
{
var count = Db.Queryable<MessageCenter>()
.Where(s => s.Result == 0 && s.Status == 1
- && s.Seq == 1 && s.Title != null).Count();
-
+ && s.Seq == 1 && s.Title != null).Count();
+
var count1 = Db.Queryable<MessageCenter>()
.Where(s => s.Result == 1 && s.Status == 1
&& s.Seq == 1 && s.Title != null).Count();
-
- return [count,count1];
+
+ return [count, count1];
}
}
\ No newline at end of file
--
Gitblit v1.9.3