From 90ca6b5d5483cbc1c7140ba5d88b956bb0689de9 Mon Sep 17 00:00:00 2001
From: hwh <332078369@qq.com>
Date: 星期四, 08 八月 2024 14:19:02 +0800
Subject: [PATCH] pda盘点优化
---
Wms/Wms/Controllers/PdaCrController.cs | 269 +------
Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs | 1750 ++++++++++++++++++++++---------------------------
Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs | 31
3 files changed, 876 insertions(+), 1,174 deletions(-)
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
index e2e7613..1b53369 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Threading.Tasks;
using Model.ModelDto.BllCheckDto;
using Model.ModelDto.PdaDto;
using SqlSugar;
@@ -27,410 +28,376 @@
#region 鐩樼偣
//鑾峰彇鐩樺簱鍗曟鍦ㄦ墽琛屽崟鍙�
- public List<string> GetStockCheckNoList(string palletNo)
+ public async Task<List<string>> GetStockCheckNoList(string palletNo)
{
- try
+ List<string> list;
+ if (!string.IsNullOrWhiteSpace(palletNo))
{
- List<string> list;
- if (!string.IsNullOrWhiteSpace(palletNo))
- {
- list = Db.Queryable<BllStockCheckDetail>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo && m.Status == 2).Select(m => m.CRNo).Distinct().ToList();
-
- }
- else
- {
- list = Db.Queryable<BllStockCheck>().Where(m => m.IsDel == "0" && m.Status == 1).Select(m => m.CRNo)
- .Distinct().ToList();
- }
-
- return list;
+ list = await Db.Queryable<BllStockCheckDetail>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo && m.Status == 2).Select(m => m.CRNo).Distinct().ToListAsync();
}
- catch (Exception e)
+ else
{
- throw new Exception(e.Message);
+ list = await Db.Queryable<BllStockCheck>().Where(m => m.IsDel == "0" && m.Status == 1).Select(m => m.CRNo)
+ .Distinct().ToListAsync();
}
+ return list;
}
//鑾峰彇鐩樼偣鏄庣粏鐗╂枡鎵规淇℃伅
- public List<StockCheckDetailDto> GetStockCheckDetailList(string crNo, string palletNo)
+ public async Task<List<StockCheckDetailDto>> GetStockCheckDetailList(string crNo, string palletNo)
{
- try
+ if (string.IsNullOrWhiteSpace(crNo))
{
- if (string.IsNullOrWhiteSpace(crNo))
- {
- throw new Exception("鐩樼偣鍗曟嵁涓嶈兘涓虹┖");
- }
-
- var list = Db.Queryable<BllStockCheckDetail>().Where(m => m.IsDel == "0" && m.CRNo == crNo);
-
- if (!string.IsNullOrWhiteSpace(palletNo))
- {
- list = list.Where(m => m.PalletNo == palletNo);
- }
-
- var data = list.GroupBy(m => new { m.SkuNo, m.SkuName, m.LotNo }).Select(m => new StockCheckDetailDto()
- {
- SkuNo = m.SkuNo,
- SkuName = m.SkuName,
- LotNo = m.LotNo
- }).ToList();
-
- return data;
-
+ throw Oops.Bah("鐩樼偣鍗曟嵁涓嶈兘涓虹┖");
}
- catch (Exception e)
+
+ var list = Db.Queryable<BllStockCheckDetail>().Where(m => m.IsDel == "0" && m.CRNo == crNo);
+
+ if (!string.IsNullOrWhiteSpace(palletNo))
{
- throw new Exception(e.Message);
+ list = list.Where(m => m.PalletNo == palletNo);
}
+
+ var data = await list.GroupBy(m => new { m.SkuNo, m.SkuName, m.LotNo }).Select(m => new StockCheckDetailDto()
+ {
+ SkuNo = m.SkuNo,
+ SkuName = m.SkuName,
+ LotNo = m.LotNo
+ }).ToListAsync();
+
+ return data;
}
//鑾峰彇瑕佺洏鐐圭殑绠辩爜淇℃伅锛堢洏鐐硅褰曚腑鏁版嵁锛�
- public List<StockCheckLogDto> GetStockCheckLogList(string crNo, string crDetail, string palletNo, string boxNo, string isContinue)
+ public async Task<List<StockCheckLogDto>> GetStockCheckLogList(string crNo, string crDetail, string palletNo, string boxNo, string isContinue)
{
- try
+ if (string.IsNullOrWhiteSpace(crNo))
{
- if (string.IsNullOrWhiteSpace(crNo))
- {
- throw new Exception("鐩樼偣鍗曟嵁涓嶈兘涓虹┖");
- }
- if (string.IsNullOrWhiteSpace(crDetail))
- {
- throw new Exception("鐗╂枡鎵规涓嶈兘涓虹┖");
- }
- if (string.IsNullOrWhiteSpace(palletNo))
- {
- throw new Exception("鎵樼洏鐮佷笉鑳戒负绌�");
- }
+ throw Oops.Bah("鐩樼偣鍗曟嵁涓嶈兘涓虹┖");
+ }
+ if (string.IsNullOrWhiteSpace(crDetail))
+ {
+ throw Oops.Bah("鐗╂枡鎵规涓嶈兘涓虹┖");
+ }
+ if (string.IsNullOrWhiteSpace(palletNo))
+ {
+ throw Oops.Bah("鎵樼洏鐮佷笉鑳戒负绌�");
+ }
- var detail = crDetail.Split("-");
- var sku = detail[0];
- //鍒ゆ柇鏄惁涓烘棤鐮佺墿鏂�
- var skuinfo = Db.Queryable<SysMaterials>().First(m => m.IsDel == "0" && m.SkuNo == sku);
- //鍒ゆ柇鏄惁瀛樺湪鐗╂枡娑堟伅
- if (skuinfo == null)
+ var detail = crDetail.Split("-");
+ var sku = detail[0];
+ //鍒ゆ柇鏄惁涓烘棤鐮佺墿鏂�
+ var skuinfo = await Db.Queryable<SysMaterials>().FirstAsync(m => m.IsDel == "0" && m.SkuNo == sku);
+ //鍒ゆ柇鏄惁瀛樺湪鐗╂枡娑堟伅
+ if (skuinfo == null)
+ {
+ throw Oops.Bah("鎵樼洏鐮佷笉鑳戒负绌�");
+ }
+ int isQtySku = 0;
+ if (skuinfo.Type == "4" && isContinue == "1")
+ {
+ isQtySku = 1;
+ }
+ var lotNo = detail[1];
+ var list = Db.Queryable<BllStockCheckLog>().Where(m => m.IsDel == "0" && m.CRNo == crNo);
+ //var deList= Db.Queryable<BllStockCheckDetail>().Where(m => m.IsDel == "0" && m.SkuNo == sku && m.LotNo == lotNo && m.PalletNo == palletNo);
+ //if (deList.Count() == 0)
+ //{
+ // throw new Exception("鏈煡璇㈠埌鎵樼洏涓婄殑鐩樼偣鐗╂枡鎵规淇℃伅");
+ //}
+ list = list.Where(m => m.SkuNo == sku && m.LotNo == lotNo && m.PalletNo == palletNo);
+ if (!string.IsNullOrWhiteSpace(boxNo))
+ {
+ list = list.Where(m => m.BoxNo == boxNo);
+ }
+ List<StockCheckLogDto> data = new List<StockCheckLogDto>();
+ //鍒ゆ柇鏄惁涓烘棤鐮佺墿鏂�
+ if (isQtySku == 1)
+ {
+ //鑾峰彇搴撳瓨淇℃伅
+ var stockDetail = Db.Queryable<DataStockDetail>().First(a => a.IsDel == "0" && a.Status == "3" && a.SkuNo == sku && a.PalletNo == palletNo);
+
+ var model = new StockCheckLogDto()
{
- throw new Exception("鎵樼洏鐮佷笉鑳戒负绌�");
- }
- int isQtySku = 0;
- if (skuinfo.Type == "4" && isContinue == "1")
+ PalletNo = palletNo,
+ SkuNo = sku,
+ Qty = stockDetail.Qty,
+ CheckResult = 4,
+ };
+
+ data.Add(model);
+
+ }
+ else
+ {
+ data = await list.Select(m => new StockCheckLogDto()
{
- isQtySku = 1;
- }
- var lotNo = detail[1];
- var list = Db.Queryable<BllStockCheckLog>().Where(m => m.IsDel == "0" && m.CRNo == crNo);
- //var deList= Db.Queryable<BllStockCheckDetail>().Where(m => m.IsDel == "0" && m.SkuNo == sku && m.LotNo == lotNo && m.PalletNo == palletNo);
- //if (deList.Count() == 0)
- //{
- // throw new Exception("鏈煡璇㈠埌鎵樼洏涓婄殑鐩樼偣鐗╂枡鎵规淇℃伅");
- //}
- list = list.Where(m => m.SkuNo == sku && m.LotNo == lotNo && m.PalletNo == palletNo);
+ BoxNo = m.BoxNo,
+ BoxNo3 = m.BoxNo3,
+ SkuNo = m.SkuNo,
+ SkuName = m.SkuName,
+ LotNo = m.LotNo,
+ Qty = m.Qty,
+ CheckResult = m.CheckResult,
+
+ }).ToListAsync();
+
+ }
+
+ return data;
+
+ }
+
+ public async Task CrSetCheck(string crNo, string crDetail, string palletNo, string boxNo, string boxNo3, string result, decimal? qty, string isContinue, int userId)
+ {
+ if (string.IsNullOrWhiteSpace(crNo))
+ {
+ throw Oops.Bah("鐩樼偣鍗曟嵁涓嶈兘涓虹┖");
+ }
+ if (string.IsNullOrWhiteSpace(crDetail))
+ {
+ throw Oops.Bah("鐗╂枡鎵规涓嶈兘涓虹┖");
+ }
+ if (string.IsNullOrWhiteSpace(palletNo))
+ {
+ throw Oops.Bah("鎵樼洏鐮佷笉鑳戒负绌�");
+ }
+ //绠辩爜涓虹┖ 鏄暣鎵樿鐩樼偣鐨勯兘姝e父
+ var detail = crDetail.Split("-");
+ var sku = detail[0];
+ var lotNo = detail[1];
+ //鐩樼偣鏄庣粏
+ var checkDetail = await Db.Queryable<BllStockCheckDetail>().FirstAsync(m =>
+ m.IsDel == "0" && m.CRNo == crNo && m.PalletNo == palletNo && m.SkuNo == sku && m.LotNo == lotNo);
+ if (checkDetail == null)
+ {
+ throw Oops.Bah("鏈煡璇㈠埌鏈洏鐐圭殑鐩樼偣鏄庣粏淇℃伅");
+ }
+ var modSku = await Db.Queryable<SysMaterials>().Where(s => s.SkuNo == sku).FirstAsync();
+ if (modSku.IsPasteCode == "1" && isContinue == "1")
+ {
+ throw Oops.Bah("璐存爣鐗╂枡涓嶅厑璁告暟閲忕洏鐐�");
+ }
+ else if (modSku.IsPasteCode == "0" && isContinue == "0")
+ {
+ throw Oops.Bah("涓嶈创鏍囩墿鏂欒浣跨敤鏁伴噺鐩樼偣");
+ }
+ //鐩樼偣璁板綍
+ var checkLog = Db.Queryable<BllStockCheckLog>().Where(m =>
+ m.IsDel == "0" && m.CRNo == crNo && m.PalletNo == palletNo && m.SkuNo == sku && m.LotNo == lotNo && m.CheckResult == null);
+ var time = DateTime.Now;
+ //姝e父
+ if (result == "0")
+ {
if (!string.IsNullOrWhiteSpace(boxNo))
{
- list = list.Where(m => m.BoxNo == boxNo);
+ checkLog = checkLog.Where(m => m.BoxNo == boxNo);
}
- List<StockCheckLogDto> data = new List<StockCheckLogDto>();
- //鍒ゆ柇鏄惁涓烘棤鐮佺墿鏂�
- if (isQtySku == 1)
+ if (!string.IsNullOrWhiteSpace(boxNo3))
{
- //鑾峰彇搴撳瓨淇℃伅
- var stockDetail = Db.Queryable<DataStockDetail>().First(a => a.IsDel == "0" && a.Status == "3" && a.SkuNo == sku && a.PalletNo == palletNo);
+ checkLog = checkLog.Where(m => m.BoxNo3 == boxNo3);
+ }
- var model = new StockCheckLogDto()
+ if (await checkLog.CountAsync() == 0 && isContinue == "0")
+ {
+ throw Oops.Bah("鏈煡璇㈠埌鏈洏鐐圭殑绠辨敮淇℃伅");
+ }
+
+ var list = await checkLog.ToListAsync();
+ var num = 0;
+ foreach (var l in list)
+ {
+ if (l.CheckResult != null)
{
+ continue;
+ }
+ l.RealQty = l.Qty;
+ l.CheckResult = 0;
+ l.CheckDate = time;
+ l.CheckUserId = userId;
+
+ num += Convert.ToInt32(l.Qty);
+ }
+
+ if (checkDetail.RealQty == null)
+ {
+ checkDetail.RealQty = 0;
+ }
+ checkDetail.RealQty += num;
+ checkDetail.CheckResult = 0;
+ //if (checkDetail.CheckResult == null || checkDetail.CheckResult == 0)
+ //{
+ // checkDetail.CheckResult = 0;
+ //}
+ await Db.Updateable(checkDetail).ExecuteCommandAsync();
+ await Db.Updateable(list).ExecuteCommandAsync();
+ }
+ //鐩樹簭
+ else if (result == "1")
+ {
+ if (!string.IsNullOrWhiteSpace(boxNo))
+ {
+ checkLog = checkLog.Where(m => m.BoxNo == boxNo);
+ }
+ if (!string.IsNullOrWhiteSpace(boxNo3))
+ {
+ checkLog = checkLog.Where(m => m.BoxNo3 == boxNo3);
+ }
+
+ if (checkLog.Count() == 0 && isContinue == "0")
+ {
+ throw Oops.Bah("鏈煡璇㈠埌绠辨敮淇℃伅");
+ }
+
+ //
+ if (isContinue == "1")
+ {
+ if (qty == null || qty <= 0)
+ {
+ throw Oops.Bah("鏁伴噺鐩樼偣鏃躲�佺洏浜忔暟閲忎笉鑳戒负绌轰笖闇�澶т簬0");
+ }
+ }
+
+
+ var list = checkLog.ToList();
+ var num = 0;
+ foreach (var l in list)
+ {
+ l.RealQty = 0;
+ l.CheckResult = 1;
+ l.CheckDate = time;
+ l.CheckUserId = userId;
+ num -= Convert.ToInt32(l.RealQty);
+ }
+ if (checkDetail.RealQty == null)
+ {
+ checkDetail.RealQty = 0;
+ }
+ checkDetail.RealQty += num;
+ if (isContinue == "1")
+ {
+ checkDetail.RealQty = qty;
+ }
+ checkDetail.CheckResult = 1;
+ var checkInfo = await Db.Queryable<BllStockCheckLog>().FirstAsync(m =>
+ m.IsDel == "0" && m.CRNo == crNo && m.PalletNo == palletNo && m.SkuNo == sku && m.LotNo == lotNo);
+ checkInfo.RealQty = qty;
+ checkInfo.CheckResult = 1;
+
+ checkInfo.CheckUserId = userId;
+ checkInfo.CheckDate = time;
+
+ checkInfo.UpdateUser = userId;
+ checkInfo.UpdateTime = time;
+ await Db.Updateable(checkInfo).ExecuteCommandAsync();
+ await Db.Updateable(checkDetail).ExecuteCommandAsync();
+ await Db.Updateable(list).ExecuteCommandAsync();
+ }
+ //鐩樼泩
+ else if (result == "2")
+ {
+ if (isContinue == "0")
+ {
+ if (string.IsNullOrWhiteSpace(boxNo) || string.IsNullOrWhiteSpace(boxNo3))
+ {
+ throw Oops.Bah("鐩樼泩鏃剁鐮佷笌鏀爜涓嶈兘涓虹┖");
+ }
+ }
+ if (qty == null || qty <= 0)
+ {
+ throw Oops.Bah("鐩樼泩鏃舵暟閲忎笉鑳戒负绌轰笖闇�澶т簬0");
+ }
+ if (isContinue == "0")
+ {
+ var count = await Db.Queryable<DataBoxInfo>()
+ .CountAsync(m => m.IsDel == "0" && m.BoxNo == boxNo && m.BoxNo3 == boxNo3);
+ var count2 = await Db.Queryable<BllStockCheckLog>()
+ .CountAsync(m => m.IsDel == "0" && m.BoxNo == boxNo && m.BoxNo3 == boxNo3);
+ if (count > 0 || count2 > 0)
+ {
+ throw Oops.Bah("褰撳墠搴撳瓨涓凡瀛樺湪璇ョ鏀俊鎭�");
+ }
+ }
+ BllStockCheckLog crLog = new BllStockCheckLog();
+ if (isContinue == "0")
+ {
+ crLog = new BllStockCheckLog()
+ {
+ CRNo = crNo,
PalletNo = palletNo,
- SkuNo = sku,
- Qty = stockDetail.Qty,
- CheckResult = 4,
+ BoxNo = boxNo,
+ BoxNo2 = null,
+ BoxNo3 = boxNo3,
+ Qty = qty,
+ SkuNo = checkDetail.SkuNo,
+ SkuName = checkDetail.SkuName,
+ Standard = checkDetail.Standard,
+ LotNo = checkDetail.LotNo,
+ LotText = checkDetail.LotText,
+ SupplierLot = checkDetail.SupplierLot,
+
+ RealQty = qty,
+ CheckResult = 2,
+ CheckDate = time,
+ CheckUserId = userId,
+
+ CreateUser = userId,
+ CreateTime = time
};
-
- data.Add(model);
-
}
else
{
- data = list.Select(m => new StockCheckLogDto()
- {
- BoxNo = m.BoxNo,
- BoxNo3 = m.BoxNo3,
- SkuNo = m.SkuNo,
- SkuName = m.SkuName,
- LotNo = m.LotNo,
- Qty = m.Qty,
- CheckResult = m.CheckResult,
-
- }).ToList();
-
- }
-
- return data;
-
- }
- catch (Exception e)
- {
- throw new Exception(e.Message);
- }
- }
-
- public void CrSetCheck(string crNo, string crDetail, string palletNo, string boxNo, string boxNo3, string result, decimal? qty, string isContinue, int userId)
- {
- try
- {
- if (string.IsNullOrWhiteSpace(crNo))
- {
- throw Oops.Bah("鐩樼偣鍗曟嵁涓嶈兘涓虹┖");
- }
- if (string.IsNullOrWhiteSpace(crDetail))
- {
- throw Oops.Bah("鐗╂枡鎵规涓嶈兘涓虹┖");
- }
- if (string.IsNullOrWhiteSpace(palletNo))
- {
- throw Oops.Bah("鎵樼洏鐮佷笉鑳戒负绌�");
- }
- //绠辩爜涓虹┖ 鏄暣鎵樿鐩樼偣鐨勯兘姝e父
- var detail = crDetail.Split("-");
- var sku = detail[0];
- var lotNo = detail[1];
- //鐩樼偣鏄庣粏
- var checkDetail = Db.Queryable<BllStockCheckDetail>().First(m =>
- m.IsDel == "0" && m.CRNo == crNo && m.PalletNo == palletNo && m.SkuNo == sku && m.LotNo == lotNo);
- if (checkDetail == null)
- {
- throw Oops.Bah("鏈煡璇㈠埌鏈洏鐐圭殑鐩樼偣鏄庣粏淇℃伅");
- }
- var modSku = Db.Queryable<SysMaterials>().Where(s => s.SkuNo == sku).First();
- if (modSku.IsPasteCode == "1" && isContinue == "1")
- {
- throw Oops.Bah("璐存爣鐗╂枡涓嶅厑璁告暟閲忕洏鐐�");
- }
- else if (modSku.IsPasteCode == "0" && isContinue == "0")
- {
- throw Oops.Bah("涓嶈创鏍囩墿鏂欒浣跨敤鏁伴噺鐩樼偣");
- }
- //鐩樼偣璁板綍
- var checkLog = Db.Queryable<BllStockCheckLog>().Where(m =>
- m.IsDel == "0" && m.CRNo == crNo && m.PalletNo == palletNo && m.SkuNo == sku && m.LotNo == lotNo && m.CheckResult == null);
- var time = DateTime.Now;
- //姝e父
- if (result == "0")
- {
- if (!string.IsNullOrWhiteSpace(boxNo))
- {
- checkLog = checkLog.Where(m => m.BoxNo == boxNo);
- }
- if (!string.IsNullOrWhiteSpace(boxNo3))
- {
- checkLog = checkLog.Where(m => m.BoxNo3 == boxNo3);
- }
-
- if (checkLog.Count() == 0 && isContinue == "0")
- {
- throw Oops.Bah("鏈煡璇㈠埌鏈洏鐐圭殑绠辨敮淇℃伅");
- }
-
- var list = checkLog.ToList();
- var num = 0;
- foreach (var l in list)
- {
- if (l.CheckResult != null)
- {
- continue;
- }
- l.RealQty = l.Qty;
- l.CheckResult = 0;
- l.CheckDate = time;
- l.CheckUserId = userId;
-
- num += Convert.ToInt32(l.Qty);
- }
-
- if (checkDetail.RealQty == null)
- {
- checkDetail.RealQty = 0;
- }
- checkDetail.RealQty += num;
- checkDetail.CheckResult = 0;
- //if (checkDetail.CheckResult == null || checkDetail.CheckResult == 0)
- //{
- // checkDetail.CheckResult = 0;
- //}
- Db.Updateable(checkDetail).ExecuteCommand();
- Db.Updateable(list).ExecuteCommand();
- }
- //鐩樹簭
- else if (result == "1")
- {
- if (!string.IsNullOrWhiteSpace(boxNo))
- {
- checkLog = checkLog.Where(m => m.BoxNo == boxNo);
- }
- if (!string.IsNullOrWhiteSpace(boxNo3))
- {
- checkLog = checkLog.Where(m => m.BoxNo3 == boxNo3);
- }
-
- if (checkLog.Count() == 0 && isContinue == "0")
- {
- throw Oops.Bah("鏈煡璇㈠埌绠辨敮淇℃伅");
- }
-
- //
- if (isContinue == "1")
- {
- if (qty == null || qty <= 0)
- {
- throw Oops.Bah("鏁伴噺鐩樼偣鏃躲�佺洏浜忔暟閲忎笉鑳戒负绌轰笖闇�澶т簬0");
- }
- }
-
-
- var list = checkLog.ToList();
- var num = 0;
- foreach (var l in list)
- {
- l.RealQty = 0;
- l.CheckResult = 1;
- l.CheckDate = time;
- l.CheckUserId = userId;
- num -= Convert.ToInt32(l.RealQty);
- }
- if (checkDetail.RealQty == null)
- {
- checkDetail.RealQty = 0;
- }
- checkDetail.RealQty += num;
- if (isContinue == "1")
- {
- checkDetail.RealQty = qty;
- }
- checkDetail.CheckResult = 1;
- var checkInfo = Db.Queryable<BllStockCheckLog>().First(m =>
- m.IsDel == "0" && m.CRNo == crNo && m.PalletNo == palletNo && m.SkuNo == sku && m.LotNo == lotNo);
+ var checkInfo = await Db.Queryable<BllStockCheckLog>().FirstAsync(m =>
+ m.IsDel == "0" && m.CRNo == crNo && m.PalletNo == palletNo && m.SkuNo == sku && m.LotNo == lotNo);
checkInfo.RealQty = qty;
- checkInfo.CheckResult = 1;
+ checkInfo.CheckResult = 2;
checkInfo.CheckUserId = userId;
checkInfo.CheckDate = time;
checkInfo.UpdateUser = userId;
checkInfo.UpdateTime = time;
- Db.Updateable(checkInfo).ExecuteCommand();
- Db.Updateable(checkDetail).ExecuteCommand();
- Db.Updateable(list).ExecuteCommand();
+ await Db.Updateable(checkInfo).ExecuteCommandAsync();
}
- //鐩樼泩
- else if (result == "2")
+
+ if (checkDetail.RealQty == null && isContinue == "0")
{
- if (isContinue == "0")
- {
- if (string.IsNullOrWhiteSpace(boxNo) || string.IsNullOrWhiteSpace(boxNo3))
- {
- throw Oops.Bah("鐩樼泩鏃剁鐮佷笌鏀爜涓嶈兘涓虹┖");
- }
- }
- if (qty == null || qty <= 0)
- {
- throw Oops.Bah("鐩樼泩鏃舵暟閲忎笉鑳戒负绌轰笖闇�澶т簬0");
- }
- if (isContinue == "0")
- {
- var count = Db.Queryable<DataBoxInfo>()
- .Count(m => m.IsDel == "0" && m.BoxNo == boxNo && m.BoxNo3 == boxNo3);
- var count2 = Db.Queryable<BllStockCheckLog>()
- .Count(m => m.IsDel == "0" && m.BoxNo == boxNo && m.BoxNo3 == boxNo3);
- if (count > 0 || count2 > 0)
- {
- throw Oops.Bah("褰撳墠搴撳瓨涓凡瀛樺湪璇ョ鏀俊鎭�");
- }
- }
- BllStockCheckLog crLog = new BllStockCheckLog();
- if (isContinue == "0")
- {
- crLog = new BllStockCheckLog()
- {
- CRNo = crNo,
- PalletNo = palletNo,
- BoxNo = boxNo,
- BoxNo2 = null,
- BoxNo3 = boxNo3,
- Qty = qty,
- SkuNo = checkDetail.SkuNo,
- SkuName = checkDetail.SkuName,
- Standard = checkDetail.Standard,
- LotNo = checkDetail.LotNo,
- LotText = checkDetail.LotText,
- SupplierLot = checkDetail.SupplierLot,
-
- RealQty = qty,
- CheckResult = 2,
- CheckDate = time,
- CheckUserId = userId,
-
- CreateUser = userId,
- CreateTime = time
- };
- }
- else
- {
- var checkInfo = Db.Queryable<BllStockCheckLog>().First(m =>
- m.IsDel == "0" && m.CRNo == crNo && m.PalletNo == palletNo && m.SkuNo == sku && m.LotNo == lotNo);
- checkInfo.RealQty = qty;
- checkInfo.CheckResult = 2;
-
- checkInfo.CheckUserId = userId;
- checkInfo.CheckDate = time;
-
- checkInfo.UpdateUser = userId;
- checkInfo.UpdateTime = time;
- Db.Updateable(checkInfo).ExecuteCommand();
- }
-
- if (checkDetail.RealQty == null && isContinue == "0")
- {
- checkDetail.RealQty = 0;
- }
- checkDetail.RealQty += qty;
- if (isContinue == "1")
- {
- checkDetail.RealQty = qty;
- }
- checkDetail.CheckResult = 2;
- Db.Updateable(checkDetail).ExecuteCommand();
- if (isContinue == "0")
- {
- Db.Insertable(crLog).ExecuteCommand();
- }
+ checkDetail.RealQty = 0;
}
- else
+ checkDetail.RealQty += qty;
+ if (isContinue == "1")
{
- Db.RollbackTran();
- throw Oops.Bah("鐩樼偣缁撴灉涓嶇锛岃鏍稿疄锛�");
+ checkDetail.RealQty = qty;
}
- var checkLogNum = Db.Queryable<BllStockCheckLog>().Where(m => m.IsDel == "0" && m.CRNo == crNo && m.PalletNo == palletNo && m.SkuNo == sku && m.LotNo == lotNo);
- if (checkLogNum.Count(m => m.CheckResult == null) == 0)
+ checkDetail.CheckResult = 2;
+ await Db.Updateable(checkDetail).ExecuteCommandAsync();
+ if (isContinue == "0")
{
- var checkDe = Db.Queryable<BllStockCheckDetail>().First(m =>
- m.IsDel == "0" && m.CRNo == crNo && m.PalletNo == palletNo && m.SkuNo == sku && m.LotNo == lotNo);
- checkDe.Status = 3;
- Db.Updateable(checkDe).ExecuteCommand();
- var checkDeNum = Db.Queryable<BllStockCheckDetail>().Count(m =>
- m.IsDel == "0" && m.CRNo == crNo && m.Status != 3 && m.Id != checkDe.Id);
- if (checkDeNum == 0)
- {
- var check = Db.Queryable<BllStockCheck>().First(m => m.CRNo == crNo && m.IsDel == "0");
- check.Status = 2;
- check.CompleteDate = DateTime.Now;
- Db.Updateable(check).ExecuteCommand();
-
- }
+ await Db.Insertable(crLog).ExecuteCommandAsync();
}
- Db.CommitTran();
}
- catch (Exception e)
+ else
{
- Db.RollbackTran();
- throw new Exception(e.Message);
+ throw Oops.Bah("鐩樼偣缁撴灉涓嶇锛岃鏍稿疄锛�");
+ }
+ var checkLogNum = Db.Queryable<BllStockCheckLog>().Where(m => m.IsDel == "0" && m.CRNo == crNo && m.PalletNo == palletNo && m.SkuNo == sku && m.LotNo == lotNo);
+ if (await checkLogNum.CountAsync(m => m.CheckResult == null) == 0)
+ {
+ var checkDe = await Db.Queryable<BllStockCheckDetail>().FirstAsync(m =>
+ m.IsDel == "0" && m.CRNo == crNo && m.PalletNo == palletNo && m.SkuNo == sku && m.LotNo == lotNo);
+ checkDe.Status = 3;
+ await Db.Updateable(checkDe).ExecuteCommandAsync();
+ var checkDeNum = await Db.Queryable<BllStockCheckDetail>().CountAsync(m =>
+ m.IsDel == "0" && m.CRNo == crNo && m.Status != 3 && m.Id != checkDe.Id);
+ if (checkDeNum == 0)
+ {
+ var check = await Db.Queryable<BllStockCheck>().FirstAsync(m => m.CRNo == crNo && m.IsDel == "0");
+ check.Status = 2;
+ check.CompleteDate = DateTime.Now;
+ await Db.Updateable(check).ExecuteCommandAsync();
+
+ }
}
}
@@ -444,29 +411,13 @@
/// <param name="locatNo">鍌ㄤ綅缂栧彿</param>
/// <param name="palletNo">鎵樼洏鍙�</param>
/// <returns></returns>
- public List<DataStockDetail> GetStockQueryList(string locatNo, string palletNo)
+ public async Task<List<DataStockDetail>> GetStockQueryList(string locatNo, string palletNo)
{
- string str = "select LocatNo,PalletNo,SkuName,SkuNo,Standard,LotNo,Qty,LockQty,FrozenQty,InspectQty from DataStockDetail Where IsDel = @isdel";
- //鍒ゆ柇鍌ㄤ綅缂栧彿鏄惁涓虹┖
- if (!string.IsNullOrEmpty(locatNo))
- {
- str += " and LocatNo like @locatno";
- }
- //鍒ゆ柇鎵樼洏鍙锋槸鍚︿负绌�
- if (!string.IsNullOrEmpty(palletNo))
- {
- str += " and PalletNo like @palletno";
- }
+ return await Db.Queryable<DataStockDetail>()
+ .Where(s => s.IsDel == "0" && s.LocatNo.Contains(locatNo) && s.PalletNo.Contains(palletNo))
+ .OrderBy(s => new { s.LotNo, s.LocatNo, s.PalletNo })
+ .ToListAsync();
- //鎺掑簭
- str += " order by LotNo,LocatNo,PalletNo";
- List<DataStockDetail> stockList = Db.Ado.SqlQuery<DataStockDetail>(str, new
- {
- isdel = "0", //鏄惁鍒犻櫎
- locatno = "%" + locatNo + "%", //鍌ㄤ綅缂栧彿
- palletno = "%" + palletNo + "%", //鎵樼洏鍙�
- });
- return stockList;
}
#endregion
@@ -474,238 +425,145 @@
#region 鎵樼洏鍙樻洿锛堟墭鐩樿В缁戠粦瀹氾級
//鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佸拰绠卞唴鏁伴噺
- public List<PdaPalletNoCheckDto> GetDataDetailList(string palletNo)
+ public async Task<List<PdaPalletNoCheckDto>> GetDataDetailList(string palletNo)
{
- try
+ if (string.IsNullOrWhiteSpace(palletNo))
{
- if (string.IsNullOrWhiteSpace(palletNo))
+ throw Oops.Bah("鎵樼洏鍙蜂笉鑳戒负绌�");
+ }
+ var detail = await Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo).Select(m => m.Id).ToListAsync();
+ var info = await Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && detail.Contains(m.StockDetailId))
+ .GroupBy(m => m.BoxNo).Select(a => new PdaPalletNoCheckDto
{
- throw new Exception("鎵樼洏鍙蜂笉鑳戒负绌�");
- }
- var detail = Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo).Select(m => m.Id).ToList();
- var info = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && detail.Contains(m.StockDetailId))
- .GroupBy(m => m.BoxNo).Select(a => new PdaPalletNoCheckDto
- {
- BoxNo = a.BoxNo,
- Qty = SqlFunc.AggregateSum(a.Qty)
- }).ToList();
- return info;
- }
- catch (Exception e)
- {
- throw new Exception(e.Message);
- }
+ BoxNo = a.BoxNo,
+ Qty = SqlFunc.AggregateSum(a.Qty)
+ }).ToListAsync();
+ return info;
}
//鏍规嵁绠辩爜鑾峰彇鐗╂枡銆佹壒娆°�佹暟閲忕瓑淇℃伅
- public PdaPalletNoCheckDto GetBoxInfoByBox(string boxNo)
+ public async Task<PdaPalletNoCheckDto> GetBoxInfoByBox(string boxNo)
{
- try
+ if (string.IsNullOrWhiteSpace(boxNo))
{
- if (string.IsNullOrWhiteSpace(boxNo))
- {
- throw new Exception("绠辩爜涓嶈兘涓虹┖");
- }
-
- var info = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.BoxNo == boxNo)
- .GroupBy(m => new { m.BoxNo, m.SkuNo, m.SkuName, m.LotNo }).Select(a => new PdaPalletNoCheckDto
- {
- BoxNo = a.BoxNo,
- SkuNo = a.SkuNo,
- SkuName = a.SkuName,
- LotNo = a.LotNo,
- Qty = SqlFunc.AggregateSum(a.Qty)
- }).ToList();
- if (info.Count > 1)
- {
- throw new Exception("褰撳墠绠辩爜鏌ヨ鍑哄鏉$墿鏂欐垨鎵规淇℃伅锛岃鏍稿疄");
- }
-
- return info.FirstOrDefault();
+ throw Oops.Bah("绠辩爜涓嶈兘涓虹┖");
}
- catch (Exception e)
+
+ var info = await Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.BoxNo == boxNo)
+ .GroupBy(m => new { m.BoxNo, m.SkuNo, m.SkuName, m.LotNo }).Select(a => new PdaPalletNoCheckDto
+ {
+ BoxNo = a.BoxNo,
+ SkuNo = a.SkuNo,
+ SkuName = a.SkuName,
+ LotNo = a.LotNo,
+ Qty = SqlFunc.AggregateSum(a.Qty)
+ }).ToListAsync();
+ if (info.Count > 1)
{
- throw new Exception(e.Message);
+ throw Oops.Bah("褰撳墠绠辩爜鏌ヨ鍑哄鏉$墿鏂欐垨鎵规淇℃伅锛岃鏍稿疄");
}
+
+ return info.FirstOrDefault();
}
//瑙g粦鍘熸墭鐩樼粦瀹氭柊鎵樼洏
- public void SaveUnbind(string palletNo, string boxNo, string palletNoNew, int userId)
+ public async Task SaveUnbind(string palletNo, string boxNo, string palletNoNew, int userId)
{
- try
+ if (string.IsNullOrWhiteSpace(palletNo) || string.IsNullOrWhiteSpace(palletNoNew))
{
- if (string.IsNullOrWhiteSpace(palletNo) || string.IsNullOrWhiteSpace(palletNoNew))
+ throw Oops.Bah("鏂版棫鎵樼洏鍙蜂笉鑳戒负绌�");
+ }
+ if (palletNo == palletNoNew)
+ {
+ throw Oops.Bah("鏂版棫鎵樼洏鍙蜂笉鑳戒负鐩稿悓");
+ }
+ //搴撳瓨绠辨敮淇℃伅
+ var infos = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo);//鏁存墭鍙樻洿
+ if (!string.IsNullOrWhiteSpace(boxNo))
+ {
+ //鎸夌鍙樻洿
+ infos = infos.Where(m => m.IsDel == "0" && m.BoxNo == boxNo);
+ }
+ List<DataBoxInfo> infosList = await infos.ToListAsync();
+ if (infosList.Count <= 0)
+ {
+ throw Oops.Bah("鍘熸墭鐩樹笂鏈煡鍒扮鏀槑缁嗭紝璇锋牳瀹�");
+ }
+ //搴撳瓨鏄庣粏id
+ var infoIds = await infos.GroupBy(m => m.StockDetailId).Select(a => a.StockDetailId).ToListAsync();
+ if (infoIds.Count == 0)
+ {
+ throw Oops.Bah("鏈煡璇㈠埌褰撳墠绠辩爜淇℃伅锛岃鏍稿疄");
+ }
+ var comTime = DateTime.Now;
+ //鏂版墭鐩樺簱瀛樻槑缁�
+ bool newPalletHaveGoods = false;//鏂版墭鐩樹笂鏄惁鏈夌墿鍝�
+ string pallWareHouseNo = string.Empty;//鏂版墭鐩樻墍鍦ㄧ殑浣嶇疆锛堝簱澶�/骞冲簱锛�
+ var stockDetailList = await Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.PalletNo == palletNoNew).ToListAsync();
+ if (stockDetailList != null && stockDetailList.Count() > 0)
+ {
+ newPalletHaveGoods = true;
+ pallWareHouseNo = stockDetailList[0].WareHouseNo;
+ if (!string.IsNullOrEmpty(stockDetailList[0].LocatNo))
{
- throw new Exception("鏂版棫鎵樼洏鍙蜂笉鑳戒负绌�");
+ throw Oops.Bah("鏂版墭鐩樺湪绔嬪簱鍐呬笉鍏佽鍙樻洿锛岃鏍稿疄");
}
- if (palletNo == palletNoNew)
+ #region 楠岃瘉鏄惁鍏佽绔嬪簱鍚屾墭鐩樹笉鍚岀墿鏂欏叆搴撴垨鍚屾墭鐩樺悓鐗╂枡涓嶅悓鎵规鍏ュ簱
+ var box = await Db.Queryable<DataBoxInfo>().FirstAsync(m => m.IsDel == "0" && m.PalletNo == palletNoNew && m.BitBoxMark == "0");
+ if (box != null)
{
- throw new Exception("鏂版棫鎵樼洏鍙蜂笉鑳戒负鐩稿悓");
- }
- //搴撳瓨绠辨敮淇℃伅
- var infos = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo);//鏁存墭鍙樻洿
- if (!string.IsNullOrWhiteSpace(boxNo))
- {
- //鎸夌鍙樻洿
- infos = infos.Where(m => m.IsDel == "0" && m.BoxNo == boxNo);
- }
- List<DataBoxInfo> infosList = infos.ToList();
- if (infosList.Count <= 0)
- {
- throw new Exception("鍘熸墭鐩樹笂鏈煡鍒扮鏀槑缁嗭紝璇锋牳瀹�");
- }
- //搴撳瓨鏄庣粏id
- var infoIds = infos.GroupBy(m => m.StockDetailId).Select(a => a.StockDetailId).ToList();
- if (infoIds.Count == 0)
- {
- throw new Exception("鏈煡璇㈠埌褰撳墠绠辩爜淇℃伅锛岃鏍稿疄");
- }
- //寮�鍚簨鍔�
- Db.BeginTran();
- var comTime = DateTime.Now;
- //鏂版墭鐩樺簱瀛樻槑缁�
- bool newPalletHaveGoods = false;//鏂版墭鐩樹笂鏄惁鏈夌墿鍝�
- string pallWareHouseNo = string.Empty;//鏂版墭鐩樻墍鍦ㄧ殑浣嶇疆锛堝簱澶�/骞冲簱锛�
- var stockDetailList = Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.PalletNo == palletNoNew).ToList();
- if (stockDetailList != null && stockDetailList.Count() > 0)
- {
- newPalletHaveGoods = true;
- pallWareHouseNo = stockDetailList[0].WareHouseNo;
- if (!string.IsNullOrEmpty(stockDetailList[0].LocatNo))
+ foreach (var item in infosList)
{
- throw new Exception("鏂版墭鐩樺湪绔嬪簱鍐呬笉鍏佽鍙樻洿锛岃鏍稿疄");
- }
- #region 楠岃瘉鏄惁鍏佽绔嬪簱鍚屾墭鐩樹笉鍚岀墿鏂欏叆搴撴垨鍚屾墭鐩樺悓鐗╂枡涓嶅悓鎵规鍏ュ簱
- var box = Db.Queryable<DataBoxInfo>().First(m => m.IsDel == "0" && m.PalletNo == palletNoNew && m.BitBoxMark == "0");
- if (box != null)
- {
- foreach (var item in infosList)
+ if (box.SkuNo != item.SkuNo || box.LotNo != item.LotNo)
{
- if (box.SkuNo != item.SkuNo || box.LotNo != item.LotNo)
+ var funSetting = await Db.Queryable<SysFunSetting>().FirstAsync(a => a.IsDel == "0" && a.FunSetNo == "Fun045");
+ if (funSetting == null || funSetting.IsEnable == "OFF")
{
- var funSetting = Db.Queryable<SysFunSetting>().First(a => a.IsDel == "0" && a.FunSetNo == "Fun045");
- if (funSetting == null || funSetting.IsEnable == "OFF")
- {
- throw new Exception($"涓嶅厑璁哥珛搴撳悓鎵樼洏涓嶅悓鐗╂枡鍏ュ簱鎴栧悓鎵樼洏涓嶅悓鎵规鍏ュ簱锛�");
- }
+ throw Oops.Bah($"涓嶅厑璁哥珛搴撳悓鎵樼洏涓嶅悓鐗╂枡鍏ュ簱鎴栧悓鎵樼洏涓嶅悓鎵规鍏ュ簱锛�");
}
}
}
- #endregion
}
- if (!newPalletHaveGoods)//鏂版墭鐩樹笂娌℃湁鐗╁搧
+ #endregion
+ }
+ if (!newPalletHaveGoods)//鏂版墭鐩樹笂娌℃湁鐗╁搧
+ {
+ var pallet = await Db.Queryable<SysPallets>().FirstAsync(m => m.IsDel == "0" && m.PalletNo == palletNoNew);
+ if (pallet == null)
{
- var pallet = Db.Queryable<SysPallets>().First(m => m.IsDel == "0" && m.PalletNo == palletNoNew);
- if (pallet == null)
- {
- throw new Exception("鏈煡璇㈠埌鏂版墭鐩樺彿淇℃伅");
- }
- if (pallet.Status == "0")
- {
- pallet.Status = "1";//灏嗘柊鎵樼洏鐘舵�佷慨鏀逛负宸蹭娇鐢�
- Db.Updateable(pallet).ExecuteCommand();
- }
- else
- {
- throw new Exception("鏂版墭鐩樺彿鐘舵�佷笉鏄湭浣跨敤");
- }
+ throw Oops.Bah("鏈煡璇㈠埌鏂版墭鐩樺彿淇℃伅");
}
- foreach (var infoIdItem in infoIds)
+ if (pallet.Status == "0")
{
- var infosList2 = infosList.Where(w => w.StockDetailId == infoIdItem).ToList();
- //鍘熸墭鐩樺簱瀛樻槑缁�
- var stockDetail1 = Db.Queryable<DataStockDetail>().First(m => m.IsDel == "0" && m.PalletNo == palletNo && m.Id == infoIdItem);
- if (stockDetail1 == null)
- {
- throw new Exception("鏈湪鍘熸墭鐩樹笂鏌ヨ鍒扮鐮佷俊鎭紝璇锋牳瀹�");
- }
- if (!string.IsNullOrEmpty(stockDetail1.LocatNo))
- {
- throw new Exception("鍘熸墭鐩樺湪绔嬪簱鍐呬笉鍏佽鍙樻洿锛岃鏍稿疄");
- }
- var stockDetail2 = stockDetailList.FirstOrDefault(w => w.SkuNo == stockDetail1.SkuNo && w.LotNo == stockDetail1.LotNo);
+ pallet.Status = "1";//灏嗘柊鎵樼洏鐘舵�佷慨鏀逛负宸蹭娇鐢�
+ await Db.Updateable(pallet).ExecuteCommandAsync();
+ }
+ else
+ {
+ throw Oops.Bah("鏂版墭鐩樺彿鐘舵�佷笉鏄湭浣跨敤");
+ }
+ }
+ foreach (var infoIdItem in infoIds)
+ {
+ var infosList2 = infosList.Where(w => w.StockDetailId == infoIdItem).ToList();
+ //鍘熸墭鐩樺簱瀛樻槑缁�
+ var stockDetail1 = await Db.Queryable<DataStockDetail>().FirstAsync(m => m.IsDel == "0" && m.PalletNo == palletNo && m.Id == infoIdItem);
+ if (stockDetail1 == null)
+ {
+ throw Oops.Bah("鏈湪鍘熸墭鐩樹笂鏌ヨ鍒扮鐮佷俊鎭紝璇锋牳瀹�");
+ }
+ if (!string.IsNullOrEmpty(stockDetail1.LocatNo))
+ {
+ throw Oops.Bah("鍘熸墭鐩樺湪绔嬪簱鍐呬笉鍏佽鍙樻洿锛岃鏍稿疄");
+ }
+ var stockDetail2 = stockDetailList.FirstOrDefault(w => w.SkuNo == stockDetail1.SkuNo && w.LotNo == stockDetail1.LotNo);
- var stId = 0;
- if (stockDetail2 == null) //娣诲姞-鏂版墭鐩樹笂娌℃湁鍚岀墿鏂欏悓鎵规鐗╁搧
+ var stId = 0;
+ if (stockDetail2 == null) //娣诲姞-鏂版墭鐩樹笂娌℃湁鍚岀墿鏂欏悓鎵规鐗╁搧
+ {
+ //鏂版墭鐩樻坊鍔犲簱瀛樻槑缁�
+ var detail = new DataStockDetail()
{
- //鏂版墭鐩樻坊鍔犲簱瀛樻槑缁�
- var detail = new DataStockDetail()
- {
- LotNo = stockDetail1.LotNo,
- LotText = stockDetail1.LotText,
- SupplierLot = stockDetail1.SupplierLot,
- SkuNo = stockDetail1.SkuNo,
- SkuName = stockDetail1.SkuName,
- Standard = stockDetail1.Standard,
- Qty = infosList2.Sum(m => m.Qty),
- LockQty = 0,
- FrozenQty = 0,
- InspectQty = 0,
- ASNNo = stockDetail1.ASNNo,
- ASNDetailNo = stockDetail1.ASNDetailNo,
- WareHouseNo = pallWareHouseNo,
- RoadwayNo = "",
- AreaNo = "",
- LocatNo = stockDetail1.LocatNo,
- PalletNo = palletNoNew,//鏂版墭鐩樺彿
- PalletNo2 = "",
- PalletNo3 = "",
-
- CompleteTime = comTime,
- ProductionTime = stockDetail1.ProductionTime,
- ExpirationTime = stockDetail1.ExpirationTime,
- Status = "0",
- InspectMark = stockDetail1.InspectMark,
- InspectStatus = stockDetail1.InspectStatus,
- BitPalletMark = stockDetail1.BitPalletMark,
- PackagNo = stockDetail1.PackagNo,
- IsBale = "0",
- IsBelt = "0",
-
- IsDel = "0",
- CreateUser = userId,
- CreateTime = DateTime.Now
- };
- stId = Db.Insertable(detail).ExecuteReturnIdentity();
- }
- else //淇敼-鏂版墭鐩樻湁鐗╁搧
- {
- stockDetail2.Qty += infosList2.Sum(m => m.Qty);//鏂版墭鐩樺鍔犲簱瀛�
- Db.Updateable(stockDetail2).ExecuteCommand();
- stId = stockDetail2.Id;
- }
- //淇敼搴撳瓨
- stockDetail1.Qty -= infosList2.Sum(m => m.Qty);
- stockDetail1.BitPalletMark = "1";//鏄惁闆舵墭 0锛氬惁 1锛氭槸
- if (stockDetail1.Qty == 0)
- {
- Db.Deleteable(stockDetail1).ExecuteCommand();//鍒犻櫎鍘熸墭鐩樺簱瀛樻槑缁�
- //鍒ゅ師鎵樼洏杩樻湁娌℃湁璐х墿
- var stockDetail3 = Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo && m.Id != infoIds.First()).ToList();
- if (stockDetail3 == null || stockDetail3.Count <= 0)
- {
- var pallet = Db.Queryable<SysPallets>().First(m => m.IsDel == "0" && m.PalletNo == palletNo);
- pallet.Status = "0";//鍘熸墭鐩樻病鏈夎揣鐗╁悗灏嗙姸鎬佷慨鏀逛负鏈娇鐢�
- Db.Updateable(pallet).ExecuteCommand();
- }
- }
- else
- {
- Db.Updateable(stockDetail1).ExecuteCommand();//淇敼鍘熸墭鐩樺簱瀛樻槑缁�
- }
- foreach (var item in infosList2)
- {
- //淇敼搴撳瓨绠辩爜鏄庣粏
- item.StockDetailId = stId;
- item.BindNo = null;
- item.PalletNo = palletNoNew;
- Db.Updateable(item).ExecuteCommand();
- }
- //娣诲姞鎵樼洏瑙g粦缁戝畾璁板綍
- var unBind = new BllPalletUnbind()
- {
- UpbindPalletNo = palletNo,
- BindPalletNo = palletNoNew,
LotNo = stockDetail1.LotNo,
LotText = stockDetail1.LotText,
SupplierLot = stockDetail1.SupplierLot,
@@ -713,32 +571,99 @@
SkuName = stockDetail1.SkuName,
Standard = stockDetail1.Standard,
Qty = infosList2.Sum(m => m.Qty),
- PalletNo2 = stockDetail1.PalletNo2,
- PalletNo3 = stockDetail1.PalletNo3,
- BoxNo = boxNo,
- InspectNo = "",
+ LockQty = 0,
+ FrozenQty = 0,
+ InspectQty = 0,
+ ASNNo = stockDetail1.ASNNo,
+ ASNDetailNo = stockDetail1.ASNDetailNo,
+ WareHouseNo = pallWareHouseNo,
+ RoadwayNo = "",
+ AreaNo = "",
+ LocatNo = stockDetail1.LocatNo,
+ PalletNo = palletNoNew,//鏂版墭鐩樺彿
+ PalletNo2 = "",
+ PalletNo3 = "",
+
+ CompleteTime = comTime,
+ ProductionTime = stockDetail1.ProductionTime,
+ ExpirationTime = stockDetail1.ExpirationTime,
+ Status = "0",
+ InspectMark = stockDetail1.InspectMark,
InspectStatus = stockDetail1.InspectStatus,
+ BitPalletMark = stockDetail1.BitPalletMark,
+ PackagNo = stockDetail1.PackagNo,
+ IsBale = "0",
+ IsBelt = "0",
IsDel = "0",
- CreateTime = comTime,
- CreateUser = userId
+ CreateUser = userId,
+ CreateTime = DateTime.Now
};
- Db.Insertable(unBind).ExecuteCommand();
+ stId = await Db.Insertable(detail).ExecuteReturnIdentityAsync();
}
- //娣诲姞鎿嶄綔鏃ュ織
- if (string.IsNullOrEmpty(boxNo))
+ else //淇敼-鏂版墭鐩樻湁鐗╁搧
{
- boxNo = "鍏ㄩ儴";
+ stockDetail2.Qty += infosList2.Sum(m => m.Qty);//鏂版墭鐩樺鍔犲簱瀛�
+ await Db.Updateable(stockDetail2).ExecuteCommandAsync();
+ stId = stockDetail2.Id;
}
- new OperationCrServer().AddLogOperationCr("搴撳唴浣滀笟", "鎿嶄綔鏃ュ織", boxNo, "缂栬緫", $"鎵樼洏鍙樻洿锛氬師鎵樼洏鐮侊細{palletNo}涓婄殑绠辩爜{boxNo}瑙g粦锛岀粦瀹氬埌鏂版墭鐩榹palletNoNew}涓�", userId);
- //鎻愪氦浜嬪姟
- Db.CommitTran();
+ //淇敼搴撳瓨
+ stockDetail1.Qty -= infosList2.Sum(m => m.Qty);
+ stockDetail1.BitPalletMark = "1";//鏄惁闆舵墭 0锛氬惁 1锛氭槸
+ if (stockDetail1.Qty == 0)
+ {
+ await Db.Deleteable(stockDetail1).ExecuteCommandAsync();//鍒犻櫎鍘熸墭鐩樺簱瀛樻槑缁�
+ //鍒ゅ師鎵樼洏杩樻湁娌℃湁璐х墿
+ var stockDetail3 = await Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo && m.Id != infoIds.First()).ToListAsync();
+ if (stockDetail3 == null || stockDetail3.Count <= 0)
+ {
+ var pallet = Db.Queryable<SysPallets>().First(m => m.IsDel == "0" && m.PalletNo == palletNo);
+ pallet.Status = "0";//鍘熸墭鐩樻病鏈夎揣鐗╁悗灏嗙姸鎬佷慨鏀逛负鏈娇鐢�
+ await Db.Updateable(pallet).ExecuteCommandAsync();
+ }
+ }
+ else
+ {
+ await Db.Updateable(stockDetail1).ExecuteCommandAsync();//淇敼鍘熸墭鐩樺簱瀛樻槑缁�
+ }
+ foreach (var item in infosList2)
+ {
+ //淇敼搴撳瓨绠辩爜鏄庣粏
+ item.StockDetailId = stId;
+ item.BindNo = null;
+ item.PalletNo = palletNoNew;
+ await Db.Updateable(item).ExecuteCommandAsync();
+ }
+ //娣诲姞鎵樼洏瑙g粦缁戝畾璁板綍
+ var unBind = new BllPalletUnbind()
+ {
+ UpbindPalletNo = palletNo,
+ BindPalletNo = palletNoNew,
+ LotNo = stockDetail1.LotNo,
+ LotText = stockDetail1.LotText,
+ SupplierLot = stockDetail1.SupplierLot,
+ SkuNo = stockDetail1.SkuNo,
+ SkuName = stockDetail1.SkuName,
+ Standard = stockDetail1.Standard,
+ Qty = infosList2.Sum(m => m.Qty),
+ PalletNo2 = stockDetail1.PalletNo2,
+ PalletNo3 = stockDetail1.PalletNo3,
+ BoxNo = boxNo,
+ InspectNo = "",
+ InspectStatus = stockDetail1.InspectStatus,
+
+ IsDel = "0",
+ CreateTime = comTime,
+ CreateUser = userId
+ };
+ await Db.Insertable(unBind).ExecuteCommandAsync();
}
- catch (Exception e)
+ //娣诲姞鎿嶄綔鏃ュ織
+ if (string.IsNullOrEmpty(boxNo))
{
- Db.RollbackTran();
- throw new Exception(e.Message);
+ boxNo = "鍏ㄩ儴";
}
+ new OperationCrServer().AddLogOperationCr("搴撳唴浣滀笟", "鎿嶄綔鏃ュ織", boxNo, "缂栬緫", $"鎵樼洏鍙樻洿锛氬師鎵樼洏鐮侊細{palletNo}涓婄殑绠辩爜{boxNo}瑙g粦锛岀粦瀹氬埌鏂版墭鐩榹palletNoNew}涓�", userId);
}
#endregion
@@ -749,29 +674,22 @@
/// </summary>
/// <param name="palletNo"></param>
/// <returns></returns>
- public string GetPalletLocatNo(string palletNo)
+ public async Task<string> GetPalletLocatNo(string palletNo)
{
- try
+ var models = await Db.Queryable<DataStockDetail>().FirstAsync(w => w.IsDel == "0" && w.PalletNo == palletNo);
+ if (models == null)
{
- var models = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo);
- if (models == null)
- {
- throw new Exception("鎵樼洏搴撳瓨淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
- }
- if (string.IsNullOrEmpty(models.LocatNo))
- {
- throw new Exception("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
- }
- if (models.WareHouseNo != "W02")
- {
- throw new Exception("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!");
- }
- return models.LocatNo;
+ throw Oops.Bah("鎵樼洏搴撳瓨淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
}
- catch (Exception ex)
+ if (string.IsNullOrEmpty(models.LocatNo))
{
- throw new Exception(ex.Message);
+ throw Oops.Bah("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
}
+ if (models.WareHouseNo != "W02")
+ {
+ throw Oops.Bah("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!");
+ }
+ return models.LocatNo;
}
/// <summary>
@@ -779,109 +697,79 @@
/// </summary>
/// <param name="palletNo"></param>
/// <returns></returns>
- public List<SysStorageArea> GetStorageArea(string palletNo)
+ public async Task<List<SysStorageArea>> GetStorageArea(string palletNo)
{
- try
+ var storageArea = new List<SysStorageArea>();
+ if (string.IsNullOrEmpty(palletNo))
{
- var storageArea = new List<SysStorageArea>();
- if (string.IsNullOrEmpty(palletNo))
+ storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.WareHouseNo == "W02").OrderBy(o => o.AreaNo).ToListAsync();
+ }
+ else
+ {
+ var models = await Db.Queryable<DataStockDetail>().FirstAsync(w => w.IsDel == "0" && w.PalletNo == palletNo);
+ if (models == null)
{
- storageArea = Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.WareHouseNo == "W02").OrderBy(o => o.AreaNo).ToList();
+ throw Oops.Bah("鎵樼洏搴撳瓨淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
+ }
+ if (string.IsNullOrEmpty(models.LocatNo))
+ {
+ throw Oops.Bah("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
+ }
+ if (models.WareHouseNo != "W02")
+ {
+ throw Oops.Bah("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!");
+ }
+ var storageLocat = await Db.Queryable<SysStorageLocat>().FirstAsync(w => w.IsDel == "0" && w.LocatNo == models.LocatNo);
+ if (storageLocat == null)
+ {
+ throw Oops.Bah("鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
+ }
+
+ if (storageLocat.AreaNo.Contains("B0"))
+ {
+ storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo.Contains("B0") && w.WareHouseNo == "W02").OrderBy(o => o.AreaNo).ToListAsync();
}
else
{
- var models = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo);
- if (models == null)
- {
- throw new Exception("鎵樼洏搴撳瓨淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
- }
- if (string.IsNullOrEmpty(models.LocatNo))
- {
- throw new Exception("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
- }
- if (models.WareHouseNo != "W02")
- {
- throw new Exception("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!");
- }
- var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == models.LocatNo);
- if (storageLocat == null)
- {
- throw new Exception("鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
- }
-
- if (storageLocat.AreaNo.Contains("B0"))
- {
- storageArea = Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo.Contains("B0") && w.WareHouseNo == "W02").OrderBy(o => o.AreaNo).ToList();
- }
- else
- {
- storageArea = Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo.Contains("B1") && w.WareHouseNo == "W02").OrderBy(o => o.AreaNo).ToList();
- }
+ storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo.Contains("B1") && w.WareHouseNo == "W02").OrderBy(o => o.AreaNo).ToListAsync();
}
- return storageArea;
}
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
+ return storageArea;
}
/// <summary>
/// 鑾峰彇宸插垎閰嶇殑鍑哄簱鍗曟嵁
/// </summary>
/// <returns></returns>
- public List<string> GetRunSoNoticeList()
+ public async Task<List<string>> GetRunSoNoticeList()
{
- try
- {
- var allotList = Db.Queryable<BllExportNotice>().Where(m => m.IsDel == "0" && m.Status == "2").Select(m => m.SONo).Distinct().ToList();
- return allotList;
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
+ return await Db.Queryable<BllExportNotice>().Where(m => m.IsDel == "0" && m.Status == "2").Select(m => m.SONo).Distinct().ToListAsync();
}
/// <summary>
/// 鏍规嵁鎵樼洏鍙疯幏鍙栨墭鐩樹笂鐗╂枡淇℃伅
/// </summary>
/// <param name="palletNo"></param>
/// <returns></returns>
- public List<DataStockDetail> GetSkuInfoByPalletNo(string palletNo)
+ public async Task<List<DataStockDetail>> GetSkuInfoByPalletNo(string palletNo)
{
- try
+ if (string.IsNullOrEmpty(palletNo))
{
- if (string.IsNullOrEmpty(palletNo))
- {
- throw new Exception("璇锋壂鎻忔墭鐩樻潯鐮侊紒");
- }
- var skuInfoList = Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo).ToList();
- return skuInfoList;
+ throw Oops.Bah("璇锋壂鎻忔墭鐩樻潯鐮侊紒");
}
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
+ return await Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo).ToListAsync();
}
/// <summary>
/// 鏍规嵁鍑哄簱鍗曞彿鑾峰彇鍒嗛厤鐨勬墭鐩樹俊鎭�
/// </summary>
/// <param name="soNo"></param>
/// <returns></returns>
- public List<string> GetPalletNoListBySoNo(string soNo)
+ public async Task<List<string>> GetPalletNoListBySoNo(string soNo)
{
- try
+ if (string.IsNullOrEmpty(soNo))
{
- if (string.IsNullOrEmpty(soNo))
- {
- throw new Exception("璇烽�夋嫨鍑哄簱鍗曞彿锛�");
- }
- var palletNoList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SONo == soNo).Select(m => m.PalletNo).Distinct().ToList();
- return palletNoList;
+ throw Oops.Bah("璇烽�夋嫨鍑哄簱鍗曞彿锛�");
}
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
+ var palletNoList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SONo == soNo).Select(m => m.PalletNo).Distinct().ToListAsync();
+ return palletNoList;
}
/// <summary>
@@ -890,79 +778,215 @@
/// <param name="palletNo"></param>
/// <param name="areaNo"></param>
/// <param name="ruku"></param>
- public void AgvTransport(string palletNo, string areaNo, string ruku, int userId)
+ public async Task AgvTransport(string palletNo, string areaNo, string ruku, int userId)
{
if (string.IsNullOrEmpty(palletNo))
{
- throw new Exception("璇锋壂鎻忔墭鐩樻潯鐮侊紒");
+ throw Oops.Bah("璇锋壂鎻忔墭鐩樻潯鐮侊紒");
}
if (string.IsNullOrEmpty(areaNo) && string.IsNullOrEmpty(ruku))
{
- throw new Exception("璇烽�夋嫨鐩爣鍖哄煙鎴栧叆搴撳彛锛�");
+ throw Oops.Bah("璇烽�夋嫨鐩爣鍖哄煙鎴栧叆搴撳彛锛�");
}
if (!string.IsNullOrEmpty(areaNo) && !string.IsNullOrEmpty(ruku))
{
- throw new Exception("鐩爣鍖哄煙鍜屽叆搴撳彛涓嶈兘鍚屾椂閫夋嫨锛�");
+ throw Oops.Bah("鐩爣鍖哄煙鍜屽叆搴撳彛涓嶈兘鍚屾椂閫夋嫨锛�");
}
- try
- {
- string EndLocat = string.Empty;//鐩爣浣嶇疆
+ string EndLocat = string.Empty;//鐩爣浣嶇疆
- var log = Db.Queryable<LogTask>().First(w => w.IsDel == "0" && w.PalletNo == palletNo && (w.Status == "0" || w.Status == "1"));
- if (log != null)
+ var log = await Db.Queryable<LogTask>().FirstAsync(w => w.IsDel == "0" && w.PalletNo == palletNo && (w.Status == "0" || w.Status == "1"));
+ if (log != null)
+ {
+ throw Oops.Bah("璇ユ墭鐩樺凡鏈夊皬杞︾瓑寰呮墽琛屾垨姝e湪鎵ц鐨勪换鍔�!");
+ }
+ var stockDetail = await Db.Queryable<DataStockDetail>().FirstAsync(w => w.IsDel == "0" && w.PalletNo == palletNo);
+ if (stockDetail == null)
+ {
+ throw Oops.Bah("鎵樼洏涓婄墿鏂欏簱瀛樻槑缁嗕俊鎭笉瀛樺湪,璇锋鏌�!");
+ }
+ if (!string.IsNullOrEmpty(areaNo))
+ {
+ var storageArea = await Db.Queryable<SysStorageArea>().FirstAsync(w => w.IsDel == "0" && w.AreaNo == areaNo);
+ if (storageArea == null)
{
- throw new Exception("璇ユ墭鐩樺凡鏈夊皬杞︾瓑寰呮墽琛屾垨姝e湪鎵ц鐨勪换鍔�!");
+ throw Oops.Bah("鎵�閫夊尯鍩熶俊鎭笉瀛樺湪,璇锋鏌�!");
}
- var stockDetail = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo);
- if (stockDetail == null)
+ EndLocat = await GetLocat(areaNo, stockDetail.SkuNo, stockDetail.LotNo, palletNo);
+ }
+ else
+ {
+ EndLocat = ruku;
+ }
+ var stock = await Db.Queryable<DataStock>().FirstAsync(w => w.IsDel == "0" && w.SkuNo == stockDetail.SkuNo && w.LotNo == stockDetail.LotNo);
+ if (stock == null)
+ {
+ throw Oops.Bah("鎵樼洏涓婄墿鏂欏簱瀛樹俊鎭笉瀛樺湪,璇锋鏌�!");
+ }
+ if (string.IsNullOrEmpty(stockDetail.LocatNo))
+ {
+ throw Oops.Bah("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
+ }
+ if (stockDetail.WareHouseNo != "W02")
+ {
+ throw Oops.Bah("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!");
+ }
+ //璧峰鍌ㄤ綅淇℃伅
+ var storageLocat = await Db.Queryable<SysStorageLocat>().FirstAsync(w => w.IsDel == "0" && w.LocatNo == stockDetail.LocatNo);
+ if (storageLocat == null)
+ {
+ throw Oops.Bah("鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
+ }
+ //鐩爣鍌ㄤ綅淇℃伅
+ var storageLocatEnd = new SysStorageLocat();
+ if (!string.IsNullOrEmpty(areaNo))
+ {
+ storageLocatEnd = await Db.Queryable<SysStorageLocat>().FirstAsync(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0" && w.Status == "0");
+ if (storageLocatEnd == null)
{
- throw new Exception("鎵樼洏涓婄墿鏂欏簱瀛樻槑缁嗕俊鎭笉瀛樺湪,璇锋鏌�!");
+ throw Oops.Bah("鐩爣鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
}
- if (!string.IsNullOrEmpty(areaNo))
+ }
+
+ //娣诲姞鍑哄簱浠诲姟
+ var taskNo = new Common().GetMaxNo("TK");
+ var exTask = new LogTask
+ {
+ TaskNo = taskNo,
+ Sender = "WMS",
+ Receiver = "AGV",
+ IsSuccess = 0, //鏄惁涓嬪彂鎴愬姛 0澶辫触 1鎴愬姛
+
+ StartLocat = stockDetail.LocatNo,//璧峰浣嶇疆
+ EndLocat = EndLocat,//鐩爣浣嶇疆
+ PalletNo = palletNo,//鎵樼洏鐮�
+ Msg = string.Format("杞繍浠诲姟锛歿0}=>>{1}", stockDetail.LocatNo, EndLocat),
+ IsSend = 1,//鏄惁鍙啀娆′笅鍙�
+ IsCancel = 1,//鏄惁鍙彇娑�
+ IsFinish = 1,//鏄惁鍙畬鎴�
+ Type = "2",//浠诲姟绫诲瀷 0 鍏ュ簱浠诲姟 1 鍑哄簱浠诲姟 2 绉诲簱浠诲姟
+ Status = "0",//浠诲姟鐘舵��0锛氱瓑寰呮墽琛�1姝e湪鎵ц2鎵ц瀹屾垚
+ OrderType = "3",//0 鍏ュ簱鍗� 1 鍑哄簱鍗� 2 鐩樼偣鍗� 3 绉诲簱鍗�
+
+ CreateTime = DateTime.Now
+ };
+ await Db.Insertable(exTask).ExecuteCommandAsync();
+
+ //淇敼搴撳瓨鏄庣粏淇℃伅
+ stockDetail.Status = "4";//绉诲簱閿佸畾
+ stockDetail.LockQty = stockDetail.Qty;//閿佸畾搴撳瓨鏁伴噺
+ await Db.Updateable(stockDetail).ExecuteCommandAsync();
+ //淇敼搴撳瓨淇℃伅
+ stock.LockQty += (decimal)stockDetail.Qty;
+ await Db.Updateable(stock).ExecuteCommandAsync();
+
+ //淇敼璧峰鍌ㄤ綅鍦板潃鐘舵��
+ storageLocat.Status = "5";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑
+ await Db.Updateable(storageLocat).ExecuteCommandAsync();
+
+ //淇敼鐩爣鍌ㄤ綅鍦板潃鐘舵��
+ if (storageLocatEnd != null)
+ {
+ storageLocatEnd.Status = "4";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑
+ await Db.Updateable(storageLocatEnd).ExecuteCommandAsync();
+ }
+ //娣诲姞鎿嶄綔鏃ュ織璁板綍
+ var k = new OperationCrServer().AddLogOperationCr("PDA妯″潡", "AGV杞繍", palletNo, "绉诲簱", $"PDA鍛煎彨灏忚溅瀵规墭鐩樺彿锛歿palletNo}鍙戣捣杞繍", userId);
+
+ #region 鍛煎彨灏忚溅浠g爜
+
+ #endregion
+ }
+ /// <summary>
+ /// agv杞繍鍛煎彨灏忚溅鍙栬揣
+ /// </summary>
+ /// <param name="soNo"></param>
+ /// <param name="palletNo"></param>
+ /// <param name="areaNo"></param>
+ /// <param name="userId"></param>
+ public async Task AgvTransport2(string soNo, string palletNo, string areaNo, int userId)
+ {
+ if (string.IsNullOrEmpty(soNo))
+ {
+ throw Oops.Bah("璇烽�夋嫨鍑哄簱鍗曟嵁锛�");
+ }
+ if (string.IsNullOrEmpty(areaNo))
+ {
+ throw Oops.Bah("璇烽�夋嫨鐩爣鍖哄煙锛�");
+ }
+ //鍑哄簱鍗曚俊鎭�
+ var notice = await Db.Queryable<BllExportNotice>().FirstAsync(w => w.IsDel == "0" && w.SONo == soNo);
+ if (notice == null)
+ {
+ throw Oops.Bah("鍑哄簱鍗曟嵁淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
+ }
+ //鐩爣鍖哄煙淇℃伅
+ var storageArea = await Db.Queryable<SysStorageArea>().FirstAsync(w => w.IsDel == "0" && w.AreaNo == areaNo);
+ if (storageArea == null)
+ {
+ throw Oops.Bah("鎵�閫夊尯鍩熶俊鎭笉瀛樺湪,璇锋鏌�!");
+ }
+ List<DataStockDetail> stockDetailList = new List<DataStockDetail>();//闇�瑕佺殑鎵樼洏鏄庣粏
+ if (!string.IsNullOrEmpty(palletNo))//鍗曟墭鐩樺彨璐�
+ {
+ stockDetailList = await Db.Queryable<DataStockDetail>().Where(w => w.IsDel == "0" && w.PalletNo == palletNo).ToListAsync();
+ }
+ else//鏁翠釜鍑哄簱鍗曞彨璐�
+ {
+ string sqlStr = $"select * from DataStockDetail where PalletNo in (select PalletNo from BllExportAllot where IsDel='0' and SONo='{soNo}')";
+ stockDetailList = Db.Ado.SqlQuery<DataStockDetail>(sqlStr).ToList();
+ }
+ if (stockDetailList.Count <= 0)
+ {
+ throw Oops.Bah("鎵樼洏鏄庣粏涓嶅瓨鍦�,璇锋鏌�!");
+ }
+
+ var log = Db.Queryable<LogTask>().Where(w => w.IsDel == "0" && (w.Status == "0" || w.Status == "1"));//浠诲姟琛�
+ var storageLocat = Db.Queryable<SysStorageLocat>().Where(w => w.IsDel == "0");//鍌ㄤ綅琛�
+ var stock = Db.Queryable<DataStock>().Where(w => w.IsDel == "0");//搴撳瓨鎬昏〃
+ string EndLocat = string.Empty;//鐩爣浣嶇疆
+ string hasLocatNoList = string.Empty;//宸插垎閰嶇殑鍌ㄤ綅
+ foreach (var item in stockDetailList)
+ {
+ //浠诲姟淇℃伅
+ var logInfo = await log.FirstAsync(w => w.PalletNo == item.PalletNo);
+ if (logInfo != null)
{
- var storageArea = Db.Queryable<SysStorageArea>().First(w => w.IsDel == "0" && w.AreaNo == areaNo);
- if (storageArea == null)
- {
- throw new Exception("鎵�閫夊尯鍩熶俊鎭笉瀛樺湪,璇锋鏌�!");
- }
- EndLocat = GetLocat(areaNo, stockDetail.SkuNo, stockDetail.LotNo, palletNo);
+ throw Oops.Bah($"鎵樼洏鍙凤細{item.PalletNo}宸叉湁灏忚溅绛夊緟鎵ц鎴栨鍦ㄦ墽琛岀殑浠诲姟!");
+ }
+ if (string.IsNullOrEmpty(item.LocatNo))
+ {
+ throw Oops.Bah($"鎵樼洏鍙凤細{item.PalletNo}鐨勫偍浣嶄俊鎭笉瀛樺湪,璇锋鏌�!");
+ }
+ if (item.WareHouseNo != "W02")
+ {
+ throw Oops.Bah($"鎵樼洏鍙凤細{item.PalletNo}鏈湪骞冲簱鍐�,璇锋鏌�!");
+ }
+ //璧峰鍌ㄤ綅淇℃伅
+ var storageLocatBegin = await storageLocat.FirstAsync(w => w.LocatNo == item.LocatNo);
+ if (storageLocat == null)
+ {
+ throw Oops.Bah($"鎵樼洏鍙凤細{item.PalletNo}鎵�鍦ㄧ殑鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
+ }
+ //鑾峰彇鐩爣鍌ㄤ綅
+ EndLocat = await GetLocat(areaNo, item.SkuNo, item.LotNo, palletNo);
+ if (string.IsNullOrEmpty(EndLocat))
+ {
+ throw Oops.Bah("鍒嗛厤鐩爣鍌ㄤ綅澶辫触,璇锋鏌�!");
+ }
+ if (string.IsNullOrEmpty(hasLocatNoList))
+ {
+ hasLocatNoList = EndLocat;
}
else
{
- EndLocat = ruku;
- }
- var stock = Db.Queryable<DataStock>().First(w => w.IsDel == "0" && w.SkuNo == stockDetail.SkuNo && w.LotNo == stockDetail.LotNo);
- if (stock == null)
- {
- throw new Exception("鎵樼洏涓婄墿鏂欏簱瀛樹俊鎭笉瀛樺湪,璇锋鏌�!");
- }
- if (string.IsNullOrEmpty(stockDetail.LocatNo))
- {
- throw new Exception("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
- }
- if (stockDetail.WareHouseNo != "W02")
- {
- throw new Exception("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!");
- }
- //璧峰鍌ㄤ綅淇℃伅
- var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == stockDetail.LocatNo);
- if (storageLocat == null)
- {
- throw new Exception("鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
+ hasLocatNoList = hasLocatNoList + "," + EndLocat;
}
//鐩爣鍌ㄤ綅淇℃伅
- var storageLocatEnd = new SysStorageLocat();
- if (!string.IsNullOrEmpty(areaNo))
+ var storageLocatEnd = storageLocat.First(w => w.LocatNo == EndLocat && w.Flag == "0" && w.Status == "0");
+ if (storageLocatEnd == null)
{
- storageLocatEnd = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0" && w.Status == "0");
- if (storageLocatEnd == null)
- {
- throw new Exception("鐩爣鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
- }
+ throw Oops.Bah("鐩爣鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
}
-
- //寮�鍚簨鍔�
- Db.BeginTran();
//娣诲姞鍑哄簱浠诲姟
var taskNo = new Common().GetMaxNo("TK");
@@ -972,11 +996,10 @@
Sender = "WMS",
Receiver = "AGV",
IsSuccess = 0, //鏄惁涓嬪彂鎴愬姛 0澶辫触 1鎴愬姛
-
- StartLocat = stockDetail.LocatNo,//璧峰浣嶇疆
+ Msg = string.Format("杞繍浠诲姟锛歿0}=>>{1}", item.LocatNo, EndLocat),
+ StartLocat = item.LocatNo,//璧峰浣嶇疆
EndLocat = EndLocat,//鐩爣浣嶇疆
PalletNo = palletNo,//鎵樼洏鐮�
- Msg = string.Format("杞繍浠诲姟锛歿0}=>>{1}", stockDetail.LocatNo, EndLocat),
IsSend = 1,//鏄惁鍙啀娆′笅鍙�
IsCancel = 1,//鏄惁鍙彇娑�
IsFinish = 1,//鏄惁鍙畬鎴�
@@ -986,199 +1009,39 @@
CreateTime = DateTime.Now
};
- Db.Insertable(exTask).ExecuteCommand();
+ await Db.Insertable(exTask).ExecuteCommandAsync();
//淇敼搴撳瓨鏄庣粏淇℃伅
- stockDetail.Status = "4";//绉诲簱閿佸畾
- stockDetail.LockQty = stockDetail.Qty;//閿佸畾搴撳瓨鏁伴噺
- Db.Updateable(stockDetail).ExecuteCommand();
- //淇敼搴撳瓨淇℃伅
- stock.LockQty += (decimal)stockDetail.Qty;
- Db.Updateable(stock).ExecuteCommand();
+ item.Status = "4";//绉诲簱閿佸畾
+ item.LockQty = item.Qty;//閿佸畾搴撳瓨鏁伴噺
+ await Db.Updateable(item).ExecuteCommandAsync();
//淇敼璧峰鍌ㄤ綅鍦板潃鐘舵��
- storageLocat.Status = "5";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑
- Db.Updateable(storageLocat).ExecuteCommand();
-
+ storageLocatBegin.Status = "5";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑
+ await Db.Updateable(storageLocatBegin).ExecuteCommandAsync();
//淇敼鐩爣鍌ㄤ綅鍦板潃鐘舵��
- if (storageLocatEnd != null)
- {
- storageLocatEnd.Status = "4";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑
- Db.Updateable(storageLocatEnd).ExecuteCommand();
- }
+ storageLocatEnd.Status = "4";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑
+ await Db.Updateable(storageLocatEnd).ExecuteCommandAsync();
+
+ var stockInfo = await stock.FirstAsync(w => w.SkuNo == item.SkuNo && w.LotNo == item.LotNo);
+ //淇敼搴撳瓨淇℃伅
+ stockInfo.LockQty += (decimal)item.Qty;//閿佸畾鏁伴噺
+ await Db.Updateable(stockInfo).ExecuteCommandAsync();
+ }
+ if (string.IsNullOrEmpty(palletNo))
+ {
+ //娣诲姞鎿嶄綔鏃ュ織璁板綍
+ var k = new OperationCrServer().AddLogOperationCr("PDA妯″潡", "AGV杞繍", palletNo, "绉诲簱", $"PDA鍛煎彨灏忚溅瀵瑰嚭搴撳崟锛歿soNo}涓嬫墍鏈夋墭鐩樺彂璧疯浆杩�", userId);
+ }
+ else
+ {
//娣诲姞鎿嶄綔鏃ュ織璁板綍
var k = new OperationCrServer().AddLogOperationCr("PDA妯″潡", "AGV杞繍", palletNo, "绉诲簱", $"PDA鍛煎彨灏忚溅瀵规墭鐩樺彿锛歿palletNo}鍙戣捣杞繍", userId);
- //鎻愪氦浜嬪姟
- Db.CommitTran();
-
- #region 鍛煎彨灏忚溅浠g爜
-
- #endregion
}
- catch (Exception ex)
- {
- Db.RollbackTran();
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// agv杞繍鍛煎彨灏忚溅鍙栬揣
- /// </summary>
- /// <param name="soNo"></param>
- /// <param name="palletNo"></param>
- /// <param name="areaNo"></param>
- /// <param name="userId"></param>
- public void AgvTransport2(string soNo, string palletNo, string areaNo, int userId)
- {
- if (string.IsNullOrEmpty(soNo))
- {
- throw new Exception("璇烽�夋嫨鍑哄簱鍗曟嵁锛�");
- }
- if (string.IsNullOrEmpty(areaNo))
- {
- throw new Exception("璇烽�夋嫨鐩爣鍖哄煙锛�");
- }
- try
- {
- //寮�鍚簨鍔�
- Db.BeginTran();
- //鍑哄簱鍗曚俊鎭�
- var notice = Db.Queryable<BllExportNotice>().First(w => w.IsDel == "0" && w.SONo == soNo);
- if (notice == null)
- {
- throw new Exception("鍑哄簱鍗曟嵁淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
- }
- //鐩爣鍖哄煙淇℃伅
- var storageArea = Db.Queryable<SysStorageArea>().First(w => w.IsDel == "0" && w.AreaNo == areaNo);
- if (storageArea == null)
- {
- throw new Exception("鎵�閫夊尯鍩熶俊鎭笉瀛樺湪,璇锋鏌�!");
- }
- List<DataStockDetail> stockDetailList = new List<DataStockDetail>();//闇�瑕佺殑鎵樼洏鏄庣粏
- if (!string.IsNullOrEmpty(palletNo))//鍗曟墭鐩樺彨璐�
- {
- stockDetailList = Db.Queryable<DataStockDetail>().Where(w => w.IsDel == "0" && w.PalletNo == palletNo).ToList();
- }
- else//鏁翠釜鍑哄簱鍗曞彨璐�
- {
- string sqlStr = $"select * from DataStockDetail where PalletNo in (select PalletNo from BllExportAllot where IsDel='0' and SONo='{soNo}')";
- stockDetailList = Db.Ado.SqlQuery<DataStockDetail>(sqlStr).ToList();
- }
- if (stockDetailList.Count <= 0)
- {
- throw new Exception("鎵樼洏鏄庣粏涓嶅瓨鍦�,璇锋鏌�!");
- }
- var log = Db.Queryable<LogTask>().Where(w => w.IsDel == "0" && (w.Status == "0" || w.Status == "1"));//浠诲姟琛�
- var storageLocat = Db.Queryable<SysStorageLocat>().Where(w => w.IsDel == "0");//鍌ㄤ綅琛�
- var stock = Db.Queryable<DataStock>().Where(w => w.IsDel == "0");//搴撳瓨鎬昏〃
- string EndLocat = string.Empty;//鐩爣浣嶇疆
- string hasLocatNoList = string.Empty;//宸插垎閰嶇殑鍌ㄤ綅
- foreach (var item in stockDetailList)
- {
- //浠诲姟淇℃伅
- var logInfo = log.First(w => w.PalletNo == item.PalletNo);
- if (logInfo != null)
- {
- throw new Exception($"鎵樼洏鍙凤細{item.PalletNo}宸叉湁灏忚溅绛夊緟鎵ц鎴栨鍦ㄦ墽琛岀殑浠诲姟!");
- }
- if (string.IsNullOrEmpty(item.LocatNo))
- {
- throw new Exception($"鎵樼洏鍙凤細{item.PalletNo}鐨勫偍浣嶄俊鎭笉瀛樺湪,璇锋鏌�!");
- }
- if (item.WareHouseNo != "W02")
- {
- throw new Exception($"鎵樼洏鍙凤細{item.PalletNo}鏈湪骞冲簱鍐�,璇锋鏌�!");
- }
- //璧峰鍌ㄤ綅淇℃伅
- var storageLocatBegin = storageLocat.First(w => w.LocatNo == item.LocatNo);
- if (storageLocat == null)
- {
- throw new Exception($"鎵樼洏鍙凤細{item.PalletNo}鎵�鍦ㄧ殑鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
- }
- //鑾峰彇鐩爣鍌ㄤ綅
- EndLocat = GetLocat(areaNo, item.SkuNo, item.LotNo, palletNo);
- if (string.IsNullOrEmpty(EndLocat))
- {
- throw new Exception("鍒嗛厤鐩爣鍌ㄤ綅澶辫触,璇锋鏌�!");
- }
- if (string.IsNullOrEmpty(hasLocatNoList))
- {
- hasLocatNoList = EndLocat;
- }
- else
- {
- hasLocatNoList = hasLocatNoList + "," + EndLocat;
- }
- //鐩爣鍌ㄤ綅淇℃伅
- var storageLocatEnd = storageLocat.First(w => w.LocatNo == EndLocat && w.Flag == "0" && w.Status == "0");
- if (storageLocatEnd == null)
- {
- throw new Exception("鐩爣鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
- }
+ #region 鍛煎彨灏忚溅浠g爜
- //娣诲姞鍑哄簱浠诲姟
- var taskNo = new Common().GetMaxNo("TK");
- var exTask = new LogTask
- {
- TaskNo = taskNo,
- Sender = "WMS",
- Receiver = "AGV",
- IsSuccess = 0, //鏄惁涓嬪彂鎴愬姛 0澶辫触 1鎴愬姛
- Msg = string.Format("杞繍浠诲姟锛歿0}=>>{1}", item.LocatNo, EndLocat),
- StartLocat = item.LocatNo,//璧峰浣嶇疆
- EndLocat = EndLocat,//鐩爣浣嶇疆
- PalletNo = palletNo,//鎵樼洏鐮�
- IsSend = 1,//鏄惁鍙啀娆′笅鍙�
- IsCancel = 1,//鏄惁鍙彇娑�
- IsFinish = 1,//鏄惁鍙畬鎴�
- Type = "2",//浠诲姟绫诲瀷 0 鍏ュ簱浠诲姟 1 鍑哄簱浠诲姟 2 绉诲簱浠诲姟
- Status = "0",//浠诲姟鐘舵��0锛氱瓑寰呮墽琛�1姝e湪鎵ц2鎵ц瀹屾垚
- OrderType = "3",//0 鍏ュ簱鍗� 1 鍑哄簱鍗� 2 鐩樼偣鍗� 3 绉诲簱鍗�
-
- CreateTime = DateTime.Now
- };
- Db.Insertable(exTask).ExecuteCommand();
-
- //淇敼搴撳瓨鏄庣粏淇℃伅
- item.Status = "4";//绉诲簱閿佸畾
- item.LockQty = item.Qty;//閿佸畾搴撳瓨鏁伴噺
- Db.Updateable(item).ExecuteCommand();
-
- //淇敼璧峰鍌ㄤ綅鍦板潃鐘舵��
- storageLocatBegin.Status = "5";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑
- Db.Updateable(storageLocatBegin).ExecuteCommand();
- //淇敼鐩爣鍌ㄤ綅鍦板潃鐘舵��
- storageLocatEnd.Status = "4";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑
- Db.Updateable(storageLocatEnd).ExecuteCommand();
-
- var stockInfo = stock.First(w => w.SkuNo == item.SkuNo && w.LotNo == item.LotNo);
- //淇敼搴撳瓨淇℃伅
- stockInfo.LockQty += (decimal)item.Qty;//閿佸畾鏁伴噺
- Db.Updateable(stockInfo).ExecuteCommand();
- }
- if (string.IsNullOrEmpty(palletNo))
- {
- //娣诲姞鎿嶄綔鏃ュ織璁板綍
- var k = new OperationCrServer().AddLogOperationCr("PDA妯″潡", "AGV杞繍", palletNo, "绉诲簱", $"PDA鍛煎彨灏忚溅瀵瑰嚭搴撳崟锛歿soNo}涓嬫墍鏈夋墭鐩樺彂璧疯浆杩�", userId);
- }
- else
- {
- //娣诲姞鎿嶄綔鏃ュ織璁板綍
- var k = new OperationCrServer().AddLogOperationCr("PDA妯″潡", "AGV杞繍", palletNo, "绉诲簱", $"PDA鍛煎彨灏忚溅瀵规墭鐩樺彿锛歿palletNo}鍙戣捣杞繍", userId);
- }
- //鎻愪氦浜嬪姟
- Db.CommitTran();
-
- #region 鍛煎彨灏忚溅浠g爜
-
- #endregion
- }
- catch (Exception ex)
- {
- Db.RollbackTran();
- throw new Exception(ex.Message);
- }
+ #endregion
}
/// <summary>
/// 鏍规嵁鍖哄煙鍒嗛厤鍌ㄤ綅
@@ -1187,43 +1050,36 @@
/// <param name="skuNo"></param>
/// <param name="lotNo"></param>
/// <returns></returns>
- private string GetLocat(string areaNo, string skuNo, string lotNo, string palletNo, string hasLocatNoList = "")
+ private async Task<string> GetLocat(string areaNo, string skuNo, string lotNo, string palletNo, string hasLocatNoList = "")
{
- try
+ string endLocat = string.Empty;//鐩爣鍌ㄤ綅
+ //褰撶劧鍖哄煙鎵�鏈夊偍浣嶄俊鎭�
+ var storageLocatList = await Db.Queryable<SysStorageLocat>().Where(w => w.WareHouseNo == "W02" && w.AreaNo == areaNo).ToListAsync();
+ //鍚屽尯鍩熷悓鎵规鐗╂枡鐨勫偍浣嶄俊鎭�
+ List<string> locatList = await Db.Queryable<DataStockDetail>().Where(w => w.IsDel == "0" && w.SkuNo == skuNo && w.LotNo == lotNo && w.WareHouseNo == "W02" && w.AreaNo == areaNo && w.PalletNo != palletNo)
+ .OrderByDescending(o => o.LocatNo).Select(s => s.LocatNo).Distinct().ToListAsync();
+ foreach (var item in locatList)
{
- string endLocat = string.Empty;//鐩爣鍌ㄤ綅
- //褰撶劧鍖哄煙鎵�鏈夊偍浣嶄俊鎭�
- var storageLocatList = Db.Queryable<SysStorageLocat>().Where(w => w.WareHouseNo == "W02" && w.AreaNo == areaNo).ToList();
- //鍚屽尯鍩熷悓鎵规鐗╂枡鐨勫偍浣嶄俊鎭�
- List<string> locatList = Db.Queryable<DataStockDetail>().Where(w => w.IsDel == "0" && w.SkuNo == skuNo && w.LotNo == lotNo && w.WareHouseNo == "W02" && w.AreaNo == areaNo && w.PalletNo != palletNo)
- .OrderByDescending(o => o.LocatNo).Select(s => s.LocatNo).Distinct().ToList();
- foreach (var item in locatList)
- {
- var locatInfo = storageLocatList.Where(w => w.LocatNo == item).First();
+ var locatInfo = storageLocatList.Where(w => w.LocatNo == item).First();
- var locatInfo2 = storageLocatList.Where(w => w.IsDel == "0" && w.Status == "0" && w.Flag == "0" && w.LocatNo != locatInfo.LocatNo && w.Row == locatInfo.Row && !hasLocatNoList.Contains(w.LocatNo))
- .OrderByDescending(o => o.Column).First();
- if (locatInfo2 != null)
- {
- endLocat = locatInfo2.LocatNo;
- }
- }
- if (string.IsNullOrEmpty(endLocat))
+ var locatInfo2 = storageLocatList.Where(w => w.IsDel == "0" && w.Status == "0" && w.Flag == "0" && w.LocatNo != locatInfo.LocatNo && w.Row == locatInfo.Row && !hasLocatNoList.Contains(w.LocatNo))
+ .OrderByDescending(o => o.Column).First();
+ if (locatInfo2 != null)
{
- var locatInfo3 = storageLocatList.Where(w => w.IsDel == "0" && w.Flag == "0" && w.Status == "0" && !hasLocatNoList.Contains(w.LocatNo))
- .OrderByDescending(m => m.Layer).OrderByDescending(m => m.Column).OrderByDescending(m => m.Row).First();
-
- if (locatInfo3 != null)
- {
- endLocat = locatInfo3.LocatNo;
- }
+ endLocat = locatInfo2.LocatNo;
}
- return endLocat;
}
- catch (Exception ex)
+ if (string.IsNullOrEmpty(endLocat))
{
- throw new Exception(ex.Message);
+ var locatInfo3 = storageLocatList.Where(w => w.IsDel == "0" && w.Flag == "0" && w.Status == "0" && !hasLocatNoList.Contains(w.LocatNo))
+ .OrderByDescending(m => m.Layer).OrderByDescending(m => m.Column).OrderByDescending(m => m.Row).First();
+
+ if (locatInfo3 != null)
+ {
+ endLocat = locatInfo3.LocatNo;
+ }
}
+ return endLocat;
}
#endregion
diff --git a/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs b/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs
index 572ea51..746c614 100644
--- a/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs
+++ b/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs
@@ -1,6 +1,7 @@
锘縰sing System;
using System.Collections.Generic;
using System.Text;
+using System.Threading.Tasks;
using Model.ModelDto.BllCheckDto;
using Model.ModelDto.PdaDto;
using WMS.Entity.DataEntity;
@@ -17,7 +18,7 @@
/// </summary>
/// <param name="palletNo">鎵樼洏鐮�</param>
/// <returns></returns>
- List<string> GetStockCheckNoList(string palletNo);
+ Task<List<string>> GetStockCheckNoList(string palletNo);
/// <summary>
/// 鑾峰彇鐩樼偣鏄庣粏
@@ -25,7 +26,7 @@
/// <param name="crNo">鍗曟嵁鍙�</param>
/// <param name="palletNo">鎵樼洏鍙�</param>
/// <returns></returns>
- List<StockCheckDetailDto> GetStockCheckDetailList(string crNo,string palletNo);
+ Task<List<StockCheckDetailDto>> GetStockCheckDetailList(string crNo,string palletNo);
/// <summary>
/// 鑾峰彇瑕佺洏鐐圭殑绠辩爜淇℃伅锛堢洏鐐硅褰曚腑鏁版嵁锛�
@@ -36,7 +37,7 @@
/// <param name="boxNo">绠辩爜鍙�</param>
/// <param name="isContinue">鏄惁鏁伴噺鐩樼偣</param>
/// <returns></returns>
- List<StockCheckLogDto> GetStockCheckLogList(string crNo, string crDetail,string palletNo,string boxNo,string isContinue);
+ Task<List<StockCheckLogDto>> GetStockCheckLogList(string crNo, string crDetail,string palletNo,string boxNo,string isContinue);
/// <summary>
/// 鐩樼偣搴撳瓨
@@ -50,7 +51,7 @@
/// <param name="qty">鏁伴噺</param>
/// <param name="isContinue">鏄惁鏁伴噺鐩樼偣</param>
/// <param name="userId"></param>
- void CrSetCheck(string crNo, string crDetail, string palletNo, string boxNo,string boxNo3,string result, decimal? qty,string isContinue, int userId);
+ Task CrSetCheck(string crNo, string crDetail, string palletNo, string boxNo,string boxNo3,string result, decimal? qty,string isContinue, int userId);
#endregion
@@ -62,7 +63,7 @@
/// <param name="locatNo">鍌ㄤ綅缂栧彿</param>
/// <param name="palletNo">鎵樼洏鍙�</param>
/// <returns></returns>
- List<DataStockDetail> GetStockQueryList(string locatNo, string palletNo);
+ Task<List<DataStockDetail>> GetStockQueryList(string locatNo, string palletNo);
#endregion
@@ -73,14 +74,14 @@
/// </summary>
/// <param name="palletNo">鍘熸墭鐩�</param>
/// <returns></returns>
- List<PdaPalletNoCheckDto> GetDataDetailList(string palletNo);
+ Task<List<PdaPalletNoCheckDto>> GetDataDetailList(string palletNo);
/// <summary>
/// 鏍规嵁绠辩爜鑾峰彇鐗╂枡銆佹壒娆°�佹暟閲忕瓑淇℃伅
/// </summary>
/// <param name="boxNo">绠辩爜</param>
/// <returns></returns>
- PdaPalletNoCheckDto GetBoxInfoByBox(string boxNo);
+ Task<PdaPalletNoCheckDto> GetBoxInfoByBox(string boxNo);
/// <summary>
/// 瑙g粦鍘熸墭鐩樼粦瀹氭柊鎵樼洏
@@ -89,7 +90,7 @@
/// <param name="boxNo">绠辩爜</param>
/// <param name="palletNoNew">鏂版墭鐩�</param>
/// <param name="userId">鎿嶄綔浜�</param>
- void SaveUnbind(string palletNo, string boxNo, string palletNoNew, int userId);
+ Task SaveUnbind(string palletNo, string boxNo, string palletNoNew, int userId);
#endregion
@@ -99,37 +100,37 @@
/// </summary>
/// <param name="palletNo"></param>
/// <returns></returns>
- string GetPalletLocatNo(string palletNo);
+ Task<string> GetPalletLocatNo(string palletNo);
/// <summary>
/// 鑾峰彇鎵樼洏鎵�鍦ㄦゼ灞傛墍鏈夊尯鍩�
/// </summary>
/// <param name="palletNo"></param>
/// <returns></returns>
- List<SysStorageArea> GetStorageArea(string palletNo);
+ Task<List<SysStorageArea>> GetStorageArea(string palletNo);
/// <summary>
/// 鑾峰彇宸插垎閰嶇殑鍑哄簱鍗曟嵁
/// </summary>
/// <returns></returns>
- List<string> GetRunSoNoticeList();
+ Task<List<string>> GetRunSoNoticeList();
/// <summary>
/// 鏍规嵁鎵樼洏鍙疯幏鍙栨墭鐩樹笂鐗╂枡淇℃伅
/// </summary>
/// <param name="palletNo"></param>
/// <returns></returns>
- List<DataStockDetail> GetSkuInfoByPalletNo(string palletNo);
+ Task<List<DataStockDetail>> GetSkuInfoByPalletNo(string palletNo);
/// <summary>
/// 鏍规嵁鍑哄簱鍗曞彿鑾峰彇鍒嗛厤鐨勬墭鐩樹俊鎭�
/// </summary>
/// <param name="soNo"></param>
/// <returns></returns>
- List<string> GetPalletNoListBySoNo(string soNo);
+ Task<List<string>> GetPalletNoListBySoNo(string soNo);
/// <summary>
/// agv杞繍鍛煎彨灏忚溅
/// </summary>
/// <param name="palletNo"></param>
/// <param name="areaNo"></param>
/// <param name="ruku"></param>
- void AgvTransport(string palletNo, string areaNo, string ruku, int userId);
+ Task AgvTransport(string palletNo, string areaNo, string ruku, int userId);
/// <summary>
/// agv杞繍鍛煎彨灏忚溅鍙栬揣
/// </summary>
@@ -137,7 +138,7 @@
/// <param name="palletNo"></param>
/// <param name="areaNo"></param>
/// <param name="userId"></param>
- void AgvTransport2(string soNo, string palletNo, string areaNo, int userId);
+ Task AgvTransport2(string soNo, string palletNo, string areaNo, int userId);
#endregion
}
}
diff --git a/Wms/Wms/Controllers/PdaCrController.cs b/Wms/Wms/Controllers/PdaCrController.cs
index b4f542b..5170c06 100644
--- a/Wms/Wms/Controllers/PdaCrController.cs
+++ b/Wms/Wms/Controllers/PdaCrController.cs
@@ -10,6 +10,11 @@
using WMS.IBLL.IPdaServer;
using WMS.Entity.DataEntity;
using WMS.Entity.SysEntity;
+using Utility;
+using Model.ModelDto.BllCheckDto;
+using Model.ModelDto.PdaDto;
+using Microsoft.AspNetCore.Identity;
+using System.Security.Cryptography;
namespace Wms.Controllers
{
@@ -19,10 +24,12 @@
public class PdaCrController : ControllerBase
{
private readonly IPdaCrServer _pdaCrSvc;
+ private readonly UserManager _userManager;
- public PdaCrController(IPdaCrServer pdaCrSvc)
+ public PdaCrController(IPdaCrServer pdaCrSvc, UserManager userManager)
{
_pdaCrSvc = pdaCrSvc;
+ _userManager = userManager;
}
#region 鐩樼偣
@@ -33,18 +40,10 @@
/// <param name="model">PalletNo:鎵樼洏鍙�</param>
/// <returns></returns>
[HttpPost]
- public IActionResult GetStockCheckNoList(PdaCrVm model)
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ public async Task<List<string>> GetStockCheckNoList(PdaCrVm model)
{
- try
- {
- var list = _pdaCrSvc.GetStockCheckNoList(model.PalletNo);
-
- return Ok(new { code = 0, msg = "鐩樼偣鍗曚俊鎭�", data = list });
- }
- catch (Exception e)
- {
- return Ok(new { code = 1, msg = e.Message });
- }
+ return await _pdaCrSvc.GetStockCheckNoList(model.PalletNo);
}
/// <summary>
@@ -53,18 +52,10 @@
/// <param name="model">CrNo:鐩樼偣鍗曘�丳alletNo:鎵樼洏鍙�</param>
/// <returns></returns>
[HttpPost]
- public IActionResult GetStockCheckDetailList(PdaCrVm model)
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ public async Task<List<StockCheckDetailDto>> GetStockCheckDetailList(PdaCrVm model)
{
- try
- {
- var list = _pdaCrSvc.GetStockCheckDetailList(model.CrNo, model.PalletNo);
-
- return Ok(new { code = 0, msg = "鐩樼偣鍗曟槑缁嗙墿鏂欐壒娆′俊鎭�", data = list });
- }
- catch (Exception e)
- {
- return Ok(new { code = 1, msg = e.Message });
- }
+ return await _pdaCrSvc.GetStockCheckDetailList(model.CrNo, model.PalletNo);
}
/// <summary>
@@ -73,18 +64,10 @@
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
- public IActionResult GetStockCheckLogList(PdaCrVm model)
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ public async Task<List<StockCheckLogDto>> GetStockCheckLogList(PdaCrVm model)
{
- try
- {
- var list = _pdaCrSvc.GetStockCheckLogList(model.CrNo, model.CrDetail, model.PalletNo, model.BoxNo,model.isContinue);
-
- return Ok(new { code = 0, msg = "瑕佺洏鐐圭殑绠辩爜淇℃伅", data = list });
- }
- catch (Exception e)
- {
- return Ok(new { code = 1, msg = e.Message });
- }
+ return await _pdaCrSvc.GetStockCheckLogList(model.CrNo, model.CrDetail, model.PalletNo, model.BoxNo, model.isContinue);
}
/// <summary>
@@ -93,6 +76,8 @@
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
+ [UnitOfWork]
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
public IActionResult CrSetCheck(PdaCrVm model)
{
try
@@ -109,7 +94,7 @@
return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
}
- _pdaCrSvc.CrSetCheck(model.CrNo, model.CrDetail, model.PalletNo, model.BoxNo, model.BoxNo3, model.Result, model.Qty,model.isContinue, int.Parse(userId));
+ _pdaCrSvc.CrSetCheck(model.CrNo, model.CrDetail, model.PalletNo, model.BoxNo, model.BoxNo3, model.Result, model.Qty, model.isContinue, int.Parse(userId));
return Ok(new { code = 0, msg = "鐩樼偣瀹屾垚", data = "" });
}
@@ -131,22 +116,10 @@
/// <param name="skuName">鐗╂枡鍚嶇О</param>
/// <returns></returns>
[HttpGet]
- public IActionResult GetStockQueryList(string locatNo, string palletNo )
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ public async Task<List<DataStockDetail>> GetStockQueryList(string locatNo, string palletNo)
{
- try
- {
- List<DataStockDetail> stockList = _pdaCrSvc.GetStockQueryList(locatNo, palletNo);
- if (stockList.Count==0)
- {
- return Ok(new { data = stockList, code = 1, msg = "鏃犳暟鎹�" });
- }
- return Ok(new { data = stockList, code = 0, msg = "鎴愬姛" });
- }
- catch (Exception e)
- {
- return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
- }
-
+ return await _pdaCrSvc.GetStockQueryList(locatNo, palletNo);
}
#endregion
@@ -159,21 +132,10 @@
/// <param name="palletNo">鎵樼洏鍙�</param>
/// <returns></returns>
[HttpGet]
- public IActionResult GetDataDetailList(string palletNo)
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ public async Task<List<PdaPalletNoCheckDto>> GetDataDetailList(string palletNo)
{
- try
- {
- var list = _pdaCrSvc.GetDataDetailList(palletNo);
- if (list.Count == 0)
- {
- return Ok(new { data = list, code = 1, msg = "鏃犳暟鎹�" });
- }
- return Ok(new { data = list, code = 0, msg = "鎴愬姛" });
- }
- catch (Exception e)
- {
- return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
- }
+ return await _pdaCrSvc.GetDataDetailList(palletNo);
}
@@ -183,22 +145,10 @@
/// <param name="boxNo">鎵樼洏鍙�</param>
/// <returns></returns>
[HttpGet]
- public IActionResult GetBoxInfoByBox(string boxNo)
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ public async Task<PdaPalletNoCheckDto> GetBoxInfoByBox(string boxNo)
{
- try
- {
- var list = _pdaCrSvc.GetBoxInfoByBox(boxNo);
- if (list == null)
- {
- return Ok(new { data = list, code = 1, msg = "鏃犳暟鎹�" });
- }
- return Ok(new { data = list, code = 0, msg = "鎴愬姛" });
- }
- catch (Exception e)
- {
- return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
- }
-
+ return await _pdaCrSvc.GetBoxInfoByBox(boxNo);
}
/// <summary>
@@ -207,32 +157,11 @@
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
- public IActionResult SaveUnbind(PdaPalletCheckVm model)
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ [UnitOfWork]
+ public async Task SaveUnbind(PdaPalletCheckVm model)
{
- try
- {
- //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D
- var claimsIdentity = this.User.Identity as ClaimsIdentity;
- if (claimsIdentity == null)
- {
- return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
- }
- var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
- if (string.IsNullOrWhiteSpace(userId))
- {
- return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
- }
-
- var uId = int.Parse(userId);
- _pdaCrSvc.SaveUnbind(model.PalletNo, model.BoxNo, model.PalletNoNew, uId);
-
- return Ok(new { data = "", code = 0, msg = "鎴愬姛" });
- }
- catch (Exception e)
- {
- return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
- }
-
+ await _pdaCrSvc.SaveUnbind(model.PalletNo, model.BoxNo, model.PalletNoNew, _userManager.UserId);
}
#endregion
@@ -244,19 +173,10 @@
/// <param name="palletNo"></param>
/// <returns></returns>
[HttpGet]
- public IActionResult GetPalletLocatNo(string palletNo)
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ public async Task<string> GetPalletLocatNo(string palletNo)
{
- try
- {
- string result = _pdaCrSvc.GetPalletLocatNo(palletNo);
-
- return Ok(new { data = result, code = 0, msg = "鎴愬姛" });
- }
- catch (Exception e)
- {
- return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
- }
-
+ return await _pdaCrSvc.GetPalletLocatNo(palletNo);
}
/// <summary>
/// 鑾峰彇鎵樼洏鎵�鍦ㄦゼ灞傛墍鏈夊尯鍩�
@@ -264,38 +184,20 @@
/// <param name="palletNo"></param>
/// <returns></returns>
[HttpGet]
- public IActionResult GetStorageArea(string palletNo)
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ public async Task<List<SysStorageArea>> GetStorageArea(string palletNo)
{
- try
- {
- List<SysStorageArea> result = _pdaCrSvc.GetStorageArea(palletNo);
-
- return Ok(new { data = result, code = 0, msg = "鎴愬姛" });
- }
- catch (Exception e)
- {
- return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
- }
-
+ return await _pdaCrSvc.GetStorageArea(palletNo);
}
/// <summary>
/// 鑾峰彇鎵樼洏鎵�鍦ㄦゼ灞傛墍鏈夊尯鍩�
/// </summary>
/// <returns></returns>
[HttpGet]
- public IActionResult GetRunSoNoticeList()
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ public async Task<List<string>> GetRunSoNoticeList()
{
- try
- {
- List<string> result = _pdaCrSvc.GetRunSoNoticeList();
-
- return Ok(new { data = result, code = 0, msg = "鎴愬姛" });
- }
- catch (Exception e)
- {
- return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
- }
-
+ return await _pdaCrSvc.GetRunSoNoticeList();
}
/// <summary>
/// 鏍规嵁鎵樼洏鍙疯幏鍙栨墭鐩樹笂鐗╂枡淇℃伅
@@ -303,19 +205,10 @@
/// <param name="palletNo"></param>
/// <returns></returns>
[HttpGet]
- public IActionResult GetSkuInfoByPalletNo(string palletNo)
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ public async Task<List<DataStockDetail>> GetSkuInfoByPalletNo(string palletNo)
{
- try
- {
- List<DataStockDetail> result = _pdaCrSvc.GetSkuInfoByPalletNo(palletNo);
-
- return Ok(new { data = result, code = 0, msg = "鎴愬姛" });
- }
- catch (Exception e)
- {
- return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
- }
-
+ return await _pdaCrSvc.GetSkuInfoByPalletNo(palletNo);
}
/// <summary>
/// 鏍规嵁鍑哄簱鍗曞彿鑾峰彇鍒嗛厤鐨勬墭鐩樹俊鎭�
@@ -323,19 +216,10 @@
/// <param name="soNo"></param>
/// <returns></returns>
[HttpGet]
- public IActionResult GetPalletNoListBySoNo(string soNo)
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ public async Task<List<string>> GetPalletNoListBySoNo(string soNo)
{
- try
- {
- List<string> result = _pdaCrSvc.GetPalletNoListBySoNo(soNo);
-
- return Ok(new { data = result, code = 0, msg = "鎴愬姛" });
- }
- catch (Exception e)
- {
- return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
- }
-
+ return await _pdaCrSvc.GetPalletNoListBySoNo(soNo);
}
/// <summary>
/// agv杞繍鍛煎彨灏忚溅
@@ -343,31 +227,11 @@
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
- public IActionResult AgvTransport(PdaAgvTransportVm model)
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ [UnitOfWork]
+ public async Task AgvTransport(PdaAgvTransportVm model)
{
- try
- {
- //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D
- var claimsIdentity = this.User.Identity as ClaimsIdentity;
- if (claimsIdentity == null)
- {
- return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
- }
- var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
- if (string.IsNullOrWhiteSpace(userId))
- {
- return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
- }
-
- var uId = int.Parse(userId);
- _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.Ruku, uId);
-
- return Ok(new { data = "", code = 0, msg = "鎴愬姛" });
- }
- catch (Exception e)
- {
- return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
- }
+ await _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.Ruku, _userManager.UserId);
}
/// <summary>
/// agv杞繍鍛煎彨灏忚溅鍙栬揣
@@ -375,32 +239,13 @@
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
- public IActionResult AgvTransport2(PdaAgvTransportVm model)
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ [UnitOfWork]
+ public async Task AgvTransport2(PdaAgvTransportVm model)
{
- try
- {
- //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D
- var claimsIdentity = this.User.Identity as ClaimsIdentity;
- if (claimsIdentity == null)
- {
- return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
- }
- var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
- if (string.IsNullOrWhiteSpace(userId))
- {
- return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
- }
-
- var uId = int.Parse(userId);
- _pdaCrSvc.AgvTransport2(model.SoNo,model.PalletNo, model.AreaNo, uId);
-
- return Ok(new { data = "", code = 0, msg = "鎴愬姛" });
- }
- catch (Exception e)
- {
- return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
- }
+ await _pdaCrSvc.AgvTransport2(model.SoNo, model.PalletNo, model.AreaNo, _userManager.UserId);
}
+
#endregion
}
--
Gitblit v1.8.0