From 1b86f1120560fbfcad792606064a9bef15d42827 Mon Sep 17 00:00:00 2001
From: bklLiudl <673013083@qq.com>
Date: 星期一, 02 九月 2024 08:24:34 +0800
Subject: [PATCH] Merge branch 'master' into Liudl
---
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs | 128 +++++++++++++++++++++++++++++++++++-------
1 files changed, 107 insertions(+), 21 deletions(-)
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
index bed4f60..152ebb3 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -106,6 +106,19 @@
if (modelList.Count > 0)
{
+ if (!string.IsNullOrWhiteSpace(modelList[0].PackagNo))
+ {
+ // 鏌ヨ鏁存墭鏁伴噺 姝ゅUDF1鐢ㄦ潵瀛樺偍鏁存墭鏁伴噺銆�
+ var packagModel = Db.Queryable<SysPackag>().Where(m => m.PackagNo == modelList[0].PackagNo && m.IsDel == "0").First();
+ switch (packagModel.Level.ToString())
+ {
+ case "1": modelList[0].UDF1 = packagModel.L1Num.ToString(); break;
+ case "2": modelList[0].UDF1 = packagModel.L2Num.ToString(); break;
+ case "3": modelList[0].UDF1 = packagModel.L3Num.ToString(); break;
+ case "4": modelList[0].UDF1 = packagModel.L4Num.ToString(); break;
+ default: modelList[0].UDF1 = packagModel.L5Num.ToString(); break;
+ }
+ }
return modelList[0];
}
@@ -277,7 +290,8 @@
try
{
string sqlString = string.Empty;
- sqlString = "select b.SkuNo,b.SkuName,a.LotNo,a.Qty,a.PalletNo,a.Id from BllPalletBind a left join BllArrivalNoticeDetail b on a.ASNDetailNo = b.Id where a.IsDel = '0' and b.IsDel = '0' ";
+ sqlString = "select b.SkuNo,b.SkuName,a.LotNo,a.Qty,a.PalletNo,a.Id from BllPalletBind a " +
+ "left join BllArrivalNoticeDetail b on a.ASNDetailNo = b.Id where a.IsDel = '0' and b.IsDel = '0' ";
if (!string.IsNullOrEmpty(model.PalletNo))
{
sqlString += $"and PalletNo = '{model.PalletNo}' and a.Status = '0' ";
@@ -892,7 +906,7 @@
#endregion
#region 鍦扮爜淇℃伅(鍌ㄤ綅淇℃伅)
- var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == model.LocatNo && w.Status == "0" && w.WareHouseNo == "W02");
+ var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == model.LocatNo && w.Status == "0");
if (storageLocat == null)
{
strMsg = "-1:鍌ㄤ綅淇℃伅涓嶅瓨鍦ㄦ垨闈炵┖闂茬姸鎬侊紝璇锋牳鏌�!";
@@ -1888,16 +1902,17 @@
BoxNo,
SkuNo,
SkuName,
- LotNo,
+ LotNo,
+ BitBoxMark,
SUM(Qty) as Qty
FROM BllBoxInfo
WHERE IsDel = '0'
AND Status='0'
AND BoxNo = '{model.BoxNo}'
- GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo; ";
+ GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo,BitBoxMark; ";
var models = Db.Ado.SqlQuery<BoxInfoDto>(sqlString);
- if (models == null)
+ if (models.Count == 0 )
{
throw new Exception("绠辩爜淇℃伅涓嶅瓨鍦�!");
}
@@ -1909,6 +1924,55 @@
throw ex;
}
}
+
+ /// <summary>
+ /// 鏍规嵁绠辩爜鍚戣拷婧郴缁熻姹傛爣绛剧鐮佷俊鎭�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ public List<BoxInfoDto> GetFMBindBoxInfos(string boxno)
+ {
+ try
+ {
+ #region 绠辩爜璇锋眰鎺ュ彛锛屾寮忕郴缁熸斁寮�
+ /*var jsonData = JsonConvert.SerializeObject(boxno);
+
+ var response = HttpHelper.DoPost(url, jsonData, "绠辩爜淇℃伅璇锋眰", "FM");
+
+ var obj = JsonConvert.DeserializeObject<ErpModel>(response);//瑙f瀽杩斿洖鏁版嵁
+ if (obj.Success != 0)
+ {
+ throw new Exception("璇锋眰澶辫触" + obj.Message);
+ }*/
+ #endregion
+ string sqlString = $@"SELECT
+ ASNNo,
+ BoxNo,
+ SkuNo,
+ SkuName,
+ LotNo,
+ BitBoxMark,
+ SUM(Qty) as Qty
+ FROM BllBoxInfo
+ WHERE IsDel = '0'
+ AND Status='0'
+ AND BoxNo = '{boxno}'
+ GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo,BitBoxMark; ";
+ var models = Db.Ado.SqlQuery<BoxInfoDto>(sqlString); // response
+
+ if (models.Count == 0)
+ {
+ throw new Exception("绠辩爜淇℃伅涓嶅瓨鍦�!");
+ }
+
+ return models;
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ }
+
// 鏍规嵁鍗曟嵁鍙疯幏鍙栧崟鎹槑缁嗗垪琛�
public List<ArrivalNoticeDetailDto> GetBindArrivalNoticeDetails(ArrivalNoticeVm model)
{
@@ -4582,6 +4646,18 @@
var bindId = 0;
if (bind == null)
{
+ DateTime? pTime = null;
+ DateTime? eTime = null;
+ if (!string.IsNullOrWhiteSpace(detail.Lot1))
+ {
+ pTime = DateTime.Parse(detail.Lot1);
+ }
+ if (!string.IsNullOrWhiteSpace(detail.Lot2))
+ {
+ eTime = DateTime.Parse(detail.Lot2);
+ }
+
+
bind = new BllPalletBind
{
ASNNo = model.AsnNo,
@@ -4597,6 +4673,8 @@
SupplierLot = detail.SupplierLot,
//InspectMark = model.IsSample, //鏄惁鍙栨牱鎵樼洏 鍚庢湡涓氬姟寮�鍙戞椂 鎺ュ彛浼犲�奸渶娣诲姞瀵瑰簲瀛楁鍒ゆ柇
//SamplingQty = 0, //鍙栨牱鏁伴噺 鍚庢湡涓氬姟寮�鍙戞椂 鎺ュ彛浼犲�奸渶娣诲姞瀵瑰簲瀛楁鍒ゆ柇
+ ProductionTime = pTime,
+ ExpirationTime = eTime,
BitPalletMark = "1",
IsBale = "0",
IsBelt = "0",
@@ -4652,6 +4730,12 @@
}
else
{
+ string inspectStatusStr = "0";
+ if (sku.IsInspect == "1")
+ {
+ inspectStatusStr = "1";
+ }
+
// 搴撳瓨涓嶅瓨鍦� 鎻掑叆鏁版嵁
sd1 = new DataStockDetail()
{
@@ -4680,7 +4764,7 @@
ExpirationTime = bind.ExpirationTime,
Status = "0",
InspectMark = bind.InspectMark,
- InspectStatus = sku.IsInspect,
+ InspectStatus = inspectStatusStr,
BitPalletMark = bind.BitPalletMark,
PackagNo = detail.PackagNo, //liudl 鐢眘ku鐨勫寘瑁呯紪鍙峰彉涓哄叆搴撳崟鏄庣粏鐨勫寘瑁呯紪鐮�
IsBale = bind.IsBale,
@@ -4870,9 +4954,6 @@
sqlStr += $"insert into LogPalletTrack values('{model.PalletNo}','{model.AsnNo}','缁勭洏','0',getDate(),{userId},NULL,NULL);";
Db.Ado.ExecuteCommand(sqlStr);
new OperationASNServer().AddLogOperationAsn("PDA妯″潡", "鎵樼洏缁戝畾", model.AsnNo, "娣诲姞", $"娣诲姞浜嗘墭鐩樼爜涓猴細{model.PalletNo}鐨勭粍鐩樹俊鎭�", userId);
-
-
-
}
#endregion
@@ -4922,7 +5003,7 @@
#endregion
#region 鍦扮爜淇℃伅(鍌ㄤ綅淇℃伅)
- var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == model.LocatNo && w.Status == "0" && w.WareHouseNo == "W02");
+ var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == model.LocatNo && w.Status == "0");
if (storageLocat == null)
{
throw new Exception("鍌ㄤ綅淇℃伅涓嶅瓨鍦ㄦ垨闈炵┖闂茬姸鎬侊紝璇锋牳鏌�!");
@@ -5262,11 +5343,13 @@
//淇敼搴撳瓨鏄庣粏淇℃伅
foreach (var item in stockDetail)
{
- item.Status = "0"; //鐘舵�佹洿鏀逛负寰呭垎閰�
- item.WareHouseNo = "W02"; //鎵�灞炰粨搴�
- item.LocatNo = model.LocatNo;//鍌ㄤ綅鍦板潃
- item.UpdateTime = serverTime; //淇敼鏃堕棿
- item.UpdateUser = model.CreateUser; //淇敼浜�
+ item.Status = "0"; // 鐘舵�佹洿鏀逛负寰呭垎閰�
+ item.WareHouseNo = storageLocat.WareHouseNo; // 鎵�灞炰粨搴�
+ item.RoadwayNo = storageLocat.RoadwayNo; // 鎵�灞炲贩閬�
+ item.AreaNo = storageLocat.AreaNo; // 鎵�灞炲尯鍩�
+ item.LocatNo = model.LocatNo; // 鍌ㄤ綅鍦板潃
+ item.UpdateTime = serverTime; // 淇敼鏃堕棿
+ item.UpdateUser = model.CreateUser; // 淇敼浜�
//淇敼搴撳瓨鏄庣粏淇℃伅
Db.Updateable(item).ExecuteCommand();
}
@@ -5304,15 +5387,17 @@
};
Db.Insertable(exTask).ExecuteCommand();
//鎵樼洏缁戝畾淇℃伅
- var bindInfo = Db.Queryable<BllPalletBind>().First(w => w.IsDel == "0" && w.PalletNo == model.PalletNo && w.Status == "2" && string.IsNullOrEmpty(w.LocatNo));
+ var bindInfo = Db.Queryable<BllPalletBind>().First(w => w.IsDel == "0" && w.PalletNo == model.PalletNo
+ && w.Status == "2" && string.IsNullOrEmpty(w.LocatNo));
if (bindInfo != null)
{
- bindInfo.WareHouseNo = "W02";//鎵�灞炰粨搴�
- bindInfo.LocatNo = model.LocatNo;//鍌ㄤ綅鍦板潃
+ bindInfo.WareHouseNo = storageLocat.WareHouseNo; // 鎵�灞炰粨搴�
+ bindInfo.RoadwayNo = storageLocat.RoadwayNo; // 鎵�灞炲贩閬�
+ bindInfo.LocatNo = model.LocatNo; // 鍌ㄤ綅鍦板潃
bindInfo.UpdateTime = serverTime;
bindInfo.UpdateUser = model.CreateUser;
- bindInfo.CompleteTime = serverTime; //瀹屾垚鏃堕棿
- bindInfo.TaskNo = taskNo; //浠诲姟鍙�
+ bindInfo.CompleteTime = serverTime; // 瀹屾垚鏃堕棿
+ bindInfo.TaskNo = taskNo; // 浠诲姟鍙�
Db.Updateable(bindInfo).ExecuteCommand();
}
#endregion
@@ -5344,7 +5429,8 @@
//淇敼鍌ㄤ綅淇℃伅
Db.Updateable(storageLocat).ExecuteCommand();
- new OperationASNServer().AddLogOperationAsn("PDA妯″潡", "骞冲簱鍏ュ簱", model.PalletNo, "瀹屾垚", $"鍦≒DA涓婂畬鎴愬崟鎹彿涓猴細{model.ASNNo}鐨勬墭鐩樼爜涓猴細{model.PalletNo}鐨勫钩搴撳叆搴撴搷浣�", (int)model.CreateUser);
+ new OperationASNServer().AddLogOperationAsn("PDA妯″潡", "骞冲簱鍏ュ簱", model.PalletNo, "瀹屾垚",
+ $"鍦≒DA涓婂畬鎴愬崟鎹彿涓猴細{model.ASNNo}鐨勬墭鐩樼爜涓猴細{model.PalletNo}鐨勫钩搴撳叆搴撴搷浣�", (int)model.CreateUser);
Db.CommitTran();
}
catch (Exception ex)
--
Gitblit v1.8.0