From 2b35a7bc0ee4cae4016692386a9d073870becdf6 Mon Sep 17 00:00:00 2001
From: admin <qiutairan163@163.com>
Date: 星期四, 04 十二月 2025 16:35:57 +0800
Subject: [PATCH] 格式化代码
---
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs | 178 +++++++++++++++++++++++++++++-----------------------------
1 files changed, 89 insertions(+), 89 deletions(-)
diff --git a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
index bdd298f..316f878 100644
--- a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -37,16 +37,16 @@
#region 浜嬩欢鏂规硶
public async Task<List<ArrivalNoticeDto>> GetArrivalNoticeList(ArrivalNoticeVm model, RefAsync<int> count)
{
- var modelList = await Db.Queryable<BllArrivalNotice,BllArrivalNoticeDetail, SysUserInfor, SysUserInfor,
- SysUserInfor>((tb1, tb2, tb3, tb4,tb5) => new JoinQueryInfos(
+ var modelList = await Db.Queryable<BllArrivalNotice, BllArrivalNoticeDetail, SysUserInfor, SysUserInfor,
+ SysUserInfor>((tb1, tb2, tb3, tb4, tb5) => new JoinQueryInfos(
JoinType.Left, tb1.ASNNo == tb2.ASNNo,
JoinType.Left, tb1.CreateUser == tb3.Id,
JoinType.Left, tb1.UpdateUser == tb4.Id,
JoinType.Left, tb1.CheckUser == tb5.Id))
.WhereIF(!string.IsNullOrWhiteSpace(model.ASNNo), tb1 => tb1.ASNNo.Contains(model.ASNNo))
- .WhereIF(!string.IsNullOrWhiteSpace(model.LotNo), (tb1,tb2) => tb2.LotNo.Contains(model.LotNo))
- .WhereIF(!string.IsNullOrWhiteSpace(model.SkuNo), (tb1,tb2) => tb2.SkuNo.Contains(model.SkuNo))
- .WhereIF(!string.IsNullOrWhiteSpace(model.SkuName), (tb1,tb2) => tb2.SkuName.Contains(model.SkuName))
+ .WhereIF(!string.IsNullOrWhiteSpace(model.LotNo), (tb1, tb2) => tb2.LotNo.Contains(model.LotNo))
+ .WhereIF(!string.IsNullOrWhiteSpace(model.SkuNo), (tb1, tb2) => tb2.SkuNo.Contains(model.SkuNo))
+ .WhereIF(!string.IsNullOrWhiteSpace(model.SkuName), (tb1, tb2) => tb2.SkuName.Contains(model.SkuName))
.WhereIF(!string.IsNullOrWhiteSpace(model.CustomerName), tb1 => tb1.CustomerName.Contains(model.CustomerName))
.WhereIF(!string.IsNullOrWhiteSpace(model.OrderCode), tb1 => tb1.OrderCode.Contains(model.OrderCode))
.WhereIF(!string.IsNullOrWhiteSpace(model.Status), tb1 => tb1.Status == model.Status)
@@ -76,13 +76,13 @@
CompleteTime = tb1.CompleteTime,
CreateTime = tb1.CreateTime,
CreateUserName = tb3.RealName,
- UserName=tb1.UserName,
+ UserName = tb1.UserName,
UpdateTime = ((DateTime)tb1.UpdateTime).ToString("yyyy-MM-dd HH:mm:ss"),
UpdateUserName = tb4.RealName
}).ToPageListAsync(model.Page, model.Limit, count);
- return modelList;
+ return modelList;
}
public async Task<List<ArrivalNoticeDetailDto>> GetArrivalNoticeDetailList(ArrivalNoticeDetailVm model, RefAsync<int> count)
@@ -94,48 +94,48 @@
var modelList = await Db.Queryable<BllArrivalNoticeDetail>().Where(item)
.LeftJoin<BllArrivalNotice>((tb1, tb2) => tb1.ASNNo == tb2.ASNNo)
- .LeftJoin<SysUserInfor>((tb1, tb2,tb3) => tb1.CreateUser == tb3.Id)
- .LeftJoin<SysUserInfor>((tb1,tb2,tb3,tb4) => tb1.UpdateUser == tb4.Id)
- .LeftJoin<SysMaterials>((tb1, tb2, tb3, tb4,tb5) => tb1.SkuNo == tb5.SkuNo && tb5.IsDel == "0")
- .LeftJoin<SysUnit>((tb1, tb2, tb3, tb4, tb5,tb6) => tb5.UnitNo == tb6.UnitNo && tb6.IsDel == "0")
- .LeftJoin<SysPackag>((tb1, tb2, tb3, tb4, tb5, tb6,tb7) => tb1.PackagNo == tb7.PackagNo && tb7.IsDel == "0")
- .Select((tb1, tb2, tb3, tb4, tb5,tb6, tb7) => new ArrivalNoticeDetailDto()
- {
- Id = tb1.Id,
- ASNNo = tb1.ASNNo,
- SkuNo = tb1.SkuNo,
- SkuName = tb1.SkuName,
- Standard = tb1.Standard,
- LotNo = tb1.LotNo,
- LotText = tb1.LotText,
- Qty = tb1.Qty,
- FactQty = tb1.FactQty,
- CompleteQty = tb1.CompleteQty,
- IsSampling = tb1.IsSampling,
- InspectStatus = tb1.InspectStatus,
- PackagNo = tb1.PackagNo,
- PackagName = tb7.PackagName,
- UnitName = tb6.UnitName,
- IsBale = tb1.IsBale,
- IsBelt = tb1.IsBelt,
- SupplierLot = tb1.SupplierLot,
- Status = tb1.Status,
- AsnType = tb2.Type,
- AsnStatus = tb2.Status,
- IsPasteCode = tb5.IsPasteCode,
- Lot1 = tb1.Lot1,
- Lot2 = tb1.Lot2,
- UDF1 = tb1.UDF1,
- UDF2 = tb1.UDF2,
- UDF3 = tb1.UDF3,
- UDF4 = tb1.UDF4,
- UDF5 = tb1.UDF5,
- CompleteTime = tb1.CompleteTime,
- CreateTime = tb1.CreateTime,
- CreateUserName = tb3.RealName,
- UpdateTime = ((DateTime)tb1.UpdateTime).ToString("yyyy-MM-dd HH:mm:ss"),
+ .LeftJoin<SysUserInfor>((tb1, tb2, tb3) => tb1.CreateUser == tb3.Id)
+ .LeftJoin<SysUserInfor>((tb1, tb2, tb3, tb4) => tb1.UpdateUser == tb4.Id)
+ .LeftJoin<SysMaterials>((tb1, tb2, tb3, tb4, tb5) => tb1.SkuNo == tb5.SkuNo && tb5.IsDel == "0")
+ .LeftJoin<SysUnit>((tb1, tb2, tb3, tb4, tb5, tb6) => tb5.UnitNo == tb6.UnitNo && tb6.IsDel == "0")
+ .LeftJoin<SysPackag>((tb1, tb2, tb3, tb4, tb5, tb6, tb7) => tb1.PackagNo == tb7.PackagNo && tb7.IsDel == "0")
+ .Select((tb1, tb2, tb3, tb4, tb5, tb6, tb7) => new ArrivalNoticeDetailDto()
+ {
+ Id = tb1.Id,
+ ASNNo = tb1.ASNNo,
+ SkuNo = tb1.SkuNo,
+ SkuName = tb1.SkuName,
+ Standard = tb1.Standard,
+ LotNo = tb1.LotNo,
+ LotText = tb1.LotText,
+ Qty = tb1.Qty,
+ FactQty = tb1.FactQty,
+ CompleteQty = tb1.CompleteQty,
+ IsSampling = tb1.IsSampling,
+ InspectStatus = tb1.InspectStatus,
+ PackagNo = tb1.PackagNo,
+ PackagName = tb7.PackagName,
+ UnitName = tb6.UnitName,
+ IsBale = tb1.IsBale,
+ IsBelt = tb1.IsBelt,
+ SupplierLot = tb1.SupplierLot,
+ Status = tb1.Status,
+ AsnType = tb2.Type,
+ AsnStatus = tb2.Status,
+ IsPasteCode = tb5.IsPasteCode,
+ Lot1 = tb1.Lot1,
+ Lot2 = tb1.Lot2,
+ UDF1 = tb1.UDF1,
+ UDF2 = tb1.UDF2,
+ UDF3 = tb1.UDF3,
+ UDF4 = tb1.UDF4,
+ UDF5 = tb1.UDF5,
+ CompleteTime = tb1.CompleteTime,
+ CreateTime = tb1.CreateTime,
+ CreateUserName = tb3.RealName,
+ UpdateTime = ((DateTime)tb1.UpdateTime).ToString("yyyy-MM-dd HH:mm:ss"),
UpdateUserName = tb4.RealName
- }).ToPageListAsync(model.Page, model.Limit, count);
+ }).ToPageListAsync(model.Page, model.Limit, count);
return modelList;
}
@@ -155,13 +155,13 @@
data.ProductionTime = string.IsNullOrEmpty(detail.Lot1) ? "" : Convert.ToDateTime(detail.Lot1).ToString("yyyy-MM-dd");
data.ExpirationTime = string.IsNullOrEmpty(detail.Lot2) ? "" : Convert.ToDateTime(detail.Lot2).ToString("yyyy-MM-dd");
data.SupplierLot = detail.SupplierLot;
- var labelQty = Db.Queryable<BllBoxInfo>().Where(m => m.IsDel == "0" && m.ASNDetailNo == id).Sum(m => m.Qty + (m.SamplingQty == null? 0: m.SamplingQty));
+ var labelQty = Db.Queryable<BllBoxInfo>().Where(m => m.IsDel == "0" && m.ASNDetailNo == id).Sum(m => m.Qty + (m.SamplingQty == null ? 0 : m.SamplingQty));
if (labelQty == null)
{
labelQty = 0;
}
var qty = detail.Qty - labelQty;
- if (qty<0)
+ if (qty < 0)
{
qty = 0;
}
@@ -292,7 +292,7 @@
}
}
-
+
lock (AsnLock)
{
// 鎬昏〃瀹炰綋璧嬪��
@@ -306,7 +306,7 @@
Status = "0",
LotNo = model.LotNo,
LotText = model.LotText,
- SupplierLot = model.SupplierLot,
+ SupplierLot = model.SupplierLot,
CreateUser = (int)model.CreateUser
};
@@ -330,8 +330,8 @@
strMessage = "-1:鏁伴噺蹇呴』澶т簬0;";
continue;
}
-
- if ( model.Type == "5" || model.Type == "6" || model.Type == "7")
+
+ if (model.Type == "5" || model.Type == "6" || model.Type == "7")
{
if (!string.IsNullOrWhiteSpace(detailModel.LotNo))
{
@@ -375,16 +375,16 @@
{
string toDayTime = DateTime.Now.ToString("yyyyMM");
var maxBoxCodeStr = Db.Queryable<BllArrivalNoticeDetail>()
- .Where(m => m.IsDel == "0" && m.BoxCodeStr.Contains("BK")
+ .Where(m => m.IsDel == "0" && m.BoxCodeStr.Contains("BK")
&& m.CreateTime.ToString("yyyyMM") == DateTime.Now.ToString("yyyyMM")).Max(m => m.BoxCodeStr);
- if(string.IsNullOrWhiteSpace(maxBoxCodeStr))
+ if (string.IsNullOrWhiteSpace(maxBoxCodeStr))
{
string codeEndStr = (1 + codeStrNum).ToString().PadLeft(4, '0');
maxBoxCodeStr = "BK" + toDayTime.Substring(2, 4) + codeEndStr;
}
else
{
- maxBoxCodeStr = "BK" + (int.Parse(maxBoxCodeStr.Replace("BK", "")) + 1 + codeStrNum).ToString();
+ maxBoxCodeStr = "BK" + (int.Parse(maxBoxCodeStr.Replace("BK", "")) + 1 + codeStrNum).ToString();
}
detailModel.BoxCodeStr = maxBoxCodeStr;
@@ -393,10 +393,10 @@
// 鍒ゆ柇鏄惁宸插瓨鍦ㄥ綋鍓嶆槑缁�
int com = Db.Queryable<BllArrivalNoticeDetail>()
- .Where(m => m.ASNNo == model.ASNNo
- && m.SkuNo == detailModel.SkuNo
- && m.LotNo == detailModel.LotNo
- && m.Id != (int)detailModel.Id
+ .Where(m => m.ASNNo == model.ASNNo
+ && m.SkuNo == detailModel.SkuNo
+ && m.LotNo == detailModel.LotNo
+ && m.Id != (int)detailModel.Id
&& m.IsDel == "0").ToList().Count();
if (com > 0)
{
@@ -492,7 +492,7 @@
details.Add(detail);
}
-
+
// 鍒ゆ柇鏄惁瀛樺湪琚繃婊ゆ帀鐨勬槑缁�
if (details.Count <= 0)
{
@@ -504,7 +504,7 @@
var rowCount = Db.Insertable(ASNModel).ExecuteCommand();
var rowDetailCount = 0;
- if (details.Count > 0)
+ if (details.Count > 0)
{
rowDetailCount = Db.Insertable(details).ExecuteCommand();
}
@@ -560,9 +560,9 @@
}
}
}
- catch(Exception ex)
+ catch (Exception ex)
{
- throw new Exception($"鐗╂枡缂栫爜锛歿model.AsnDetail[0].SkuNo},鐗╂枡鍚嶇О锛歿model.AsnDetail[0].SkuName}锛屽鍏ュけ璐ワ細"+ex.Message);
+ throw new Exception($"鐗╂枡缂栫爜锛歿model.AsnDetail[0].SkuNo},鐗╂枡鍚嶇О锛歿model.AsnDetail[0].SkuName}锛屽鍏ュけ璐ワ細" + ex.Message);
// ignored
}
}
@@ -897,8 +897,8 @@
asnModel.UpdateUser = model.CreateUser;
// 鍒犻櫎鏄庣粏鍗�
- var asnDetails = Db.Queryable<BllArrivalNoticeDetail>().Where(m => m.ASNNo == model.ASNNo && m.IsDel =="0").ToList();
- foreach (BllArrivalNoticeDetail asnDetail in asnDetails)
+ var asnDetails = Db.Queryable<BllArrivalNoticeDetail>().Where(m => m.ASNNo == model.ASNNo && m.IsDel == "0").ToList();
+ foreach (BllArrivalNoticeDetail asnDetail in asnDetails)
{
asnDetail.IsDel = "1";
asnDetail.UpdateTime = editDateTime;
@@ -956,14 +956,14 @@
return "-1:鍏ュ簱鍗曠姸鎬佸凡鍙樻洿锛屼笉鍙垹闄�!";
}
- if (asnModel.Origin != "褰曞叆" )//&& asnModel.Origin != "閲囪喘鍗�"
+ if (asnModel.Origin != "褰曞叆")//&& asnModel.Origin != "閲囪喘鍗�"
{
return "-1:涓婃父绯荤粺涓嬪彂鐨勫崟鎹紝涓嶅彲鍒犻櫎;";
}
var asnDetail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.ASNNo == model.ASNNo && m.IsDel == "0" && m.Id == model.Id);
- if (asnDetail == null)
+ if (asnDetail == null)
{
return "-1:鏄庣粏鐘舵�佸凡鍙樻洿锛屼笉鍙垹闄�!";
}
@@ -993,11 +993,11 @@
Db.Ado.BeginTran();
int rowCount = Db.Updateable(asnModel).ExecuteCommand();
rowCount += Db.Updateable(asnDetail).ExecuteCommand();
- if (boxList.Count>0)
+ if (boxList.Count > 0)
{
- rowCount += Db.Deleteable(boxList).ExecuteCommand();
+ rowCount += Db.Deleteable(boxList).ExecuteCommand();
}
-
+
if (rowCount < 2)
{
Db.RollbackTran();
@@ -1006,8 +1006,8 @@
Db.Ado.CommitTran();
var detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.Id == model.Id);
- new OperationASNServer().AddLogOperationAsn("鍏ュ簱浣滀笟", "鍏ュ簱鍗曟嵁", model.ASNNo, "鍒犻櫎",
- $"鍒犻櫎浜嗗崟鎹彿涓簕model.ASNNo}銆佺墿鏂欎负{detail.SkuNo}銆佹壒娆″彿涓簕detail.LotNo}鐨勫崟鎹俊鎭�",
+ new OperationASNServer().AddLogOperationAsn("鍏ュ簱浣滀笟", "鍏ュ簱鍗曟嵁", model.ASNNo, "鍒犻櫎",
+ $"鍒犻櫎浜嗗崟鎹彿涓簕model.ASNNo}銆佺墿鏂欎负{detail.SkuNo}銆佹壒娆″彿涓簕detail.LotNo}鐨勫崟鎹俊鎭�",
Convert.ToInt32(model.CreateUser));
return "";
@@ -1031,7 +1031,7 @@
}
var palletBind = Db.Queryable<BllPalletBind>()
- .Where(m => m.IsDel == "0" && m.ASNNo == notice.ASNNo
+ .Where(m => m.IsDel == "0" && m.ASNNo == notice.ASNNo
&& m.Status != "2" && m.Status != "3").ToList();
if (palletBind != null && palletBind.Count > 0)
@@ -1042,7 +1042,7 @@
// 鎬诲崟鍏冲崟
var asnModel = Db.Queryable<BllArrivalNotice>().First(m => m.Id == id);
- if (asnModel != null)
+ if (asnModel != null)
{
asnModel.Status = "3";
asnModel.CompleteTime = comTime;
@@ -1051,7 +1051,7 @@
}
// 灏嗘湭瀹屾垚鐨勬槑缁嗘敼涓哄凡瀹屾垚
var asnDetails = Db.Queryable<BllArrivalNoticeDetail>().Where(m => m.Id == id && m.Status == "2").ToList();
- foreach (BllArrivalNoticeDetail asnDetail in asnDetails)
+ foreach (BllArrivalNoticeDetail asnDetail in asnDetails)
{
asnDetail.Status = "2";
asnDetail.CompleteTime = comTime;
@@ -1345,7 +1345,7 @@
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
- public ErpModel CreateAsn(SendAsnVm model,string userName)
+ public ErpModel CreateAsn(SendAsnVm model, string userName)
{
try
{
@@ -1355,7 +1355,7 @@
resultModel.Message = "鍗曟嵁绫诲瀷涓嶅彲涓虹┖!";
return resultModel;
}
-
+
if (string.IsNullOrEmpty(model.orderNo.ToString()))
{
resultModel.Message = "涓婃父绯荤粺鍗曞彿涓嶅彲涓虹┖!";
@@ -1513,11 +1513,11 @@
}
var item = new BackAsnDetail()
{
- POSNR=d.OrderDetailCode,
+ POSNR = d.OrderDetailCode,
MATNR = d.SkuNo,
- MAKTX=d.SkuName,
+ MAKTX = d.SkuName,
LFIMG = d.CompleteQty.ToString(),
- MEINS= mater.UnitNo,
+ MEINS = mater.UnitNo,
CHARG = d.LotNo,
HSDAT = d.Lot1,
VFDAT = d.Lot2
@@ -1568,7 +1568,7 @@
try
{
Db.BeginTran();
- if (code.Substring(0,2) == "AS")
+ if (code.Substring(0, 2) == "AS")
{
var notice = Db.Queryable<BllArrivalNotice>().First(m => m.ASNNo == code && m.IsDel == "0");
if (notice == null)
@@ -1627,7 +1627,7 @@
new OperationASNServer().AddLogOperationAsn("PDA妯″潡", "澶嶆牳鍗曟嵁", code, "澶嶆牳", $"澶嶆牳浜嗗崟鎹彿涓簕code}鐨勫崟鎹俊鎭�", userId);
}
- else if (code.Substring(0,2) == "SO")
+ else if (code.Substring(0, 2) == "SO")
{
var notice = Db.Queryable<BllExportNotice>().First(m => m.SONo == code && m.IsDel == "0");
if (notice == null)
@@ -1684,7 +1684,7 @@
new OperationSOServer().AddLogOperationSo("PDA妯″潡", "澶嶆牳鍗曟嵁", code, "澶嶆牳", $"澶嶆牳浜嗗崟鎹彿涓簕code}鐨勫崟鎹俊鎭�", userId);
}
Db.CommitTran();
-
+
return true;
}
catch (Exception e)
@@ -1861,7 +1861,7 @@
//鏇存柊鍌ㄤ綅鐘舵��
Db.Updateable(palletLocatInfo).ExecuteCommand();
//鑾峰彇鐩爣鍌ㄤ綅鍦板潃
- SysStorageLocat EndLocat = GetLocat(asnDetailModel.SkuNo, asnDetailModel.LotNo, bindPalletNoItem,hasLocatNoList);
+ SysStorageLocat EndLocat = GetLocat(asnDetailModel.SkuNo, asnDetailModel.LotNo, bindPalletNoItem, hasLocatNoList);
if (EndLocat == null)
{
resultModel.Message = "鏈壘鍒扮洰鏍囧偍浣嶅湴鍧�淇℃伅!";
@@ -1889,8 +1889,8 @@
IsBale = "0",
IsBelt = "0",
- WareHouseNo= EndLocat.WareHouseNo,//鎵�灞炰粨搴�
- LocatNo=EndLocat.LocatNo,//鍌ㄤ綅鍦板潃
+ WareHouseNo = EndLocat.WareHouseNo,//鎵�灞炰粨搴�
+ LocatNo = EndLocat.LocatNo,//鍌ㄤ綅鍦板潃
CreateUser = 0
};
@@ -1902,7 +1902,7 @@
foreach (var completeDetailYuItem in palletCompleteDetailYuModelList)
{
Expression<Func<BllBoxInfo, bool>> exp = Expressionable.Create<BllBoxInfo>()
- .And(it => it.BoxNo== completeDetailYuItem.BoxNo)
+ .And(it => it.BoxNo == completeDetailYuItem.BoxNo)
.AndIF(!string.IsNullOrEmpty(completeDetailYuItem.BoxNo2), it => it.BoxNo2 == completeDetailYuItem.BoxNo2)
.AndIF(!string.IsNullOrEmpty(completeDetailYuItem.BoxNo3), it => it.BoxNo3 == completeDetailYuItem.BoxNo3)
.ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏�
--
Gitblit v1.8.0