using HH.WMS.BLL.Basic;
|
using HH.WMS.DAL;
|
using HH.WMS.DAL.Common;
|
using HH.WMS.Entitys;
|
using HH.WMS.Entitys.Basic;
|
using HH.WMS.Entitys.Common;
|
using Newtonsoft.Json;
|
/********************************************************************************
|
|
** auth: DBS
|
|
** date: 2018/11/14 20:32:52
|
|
** desc: 尚未编写描述
|
|
** Ver.: V1.0.0
|
|
*********************************************************************************/
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace HH.WMS.BLL.Common
|
{
|
public class MONGO_KEYTYPE_MAPBLL : BaseBLL
|
{
|
public MONGO_KEYTYPE_MAP GetEntity(string barCode)
|
{
|
return CreateDAL<MONGO_KEYTYPE_MAPDAL>().GetEntity(barCode);
|
}
|
|
public List<MONGO_KEYTYPE_MAP> GetList(List<string> barCodeList)
|
{
|
return CreateDAL<MONGO_KEYTYPE_MAPDAL>().GetList(barCodeList);
|
}
|
|
public ScanCodeClass AnalysisCode(string barCode)
|
{
|
MONGO_KEYTYPE_MAP map = GetEntity(barCode);
|
if (map == null) return null;
|
ScanCodeClass scanCodeMode = new ScanCodeClass();
|
switch (map.Type)
|
{
|
case "1"://CS程序打印条码
|
MONGO_PRINT_BARCODE barcode = BLLCreator.Create<MONGO_PRINT_BARCODEBLL>().GetValue(barCode);
|
scanCodeMode = new ScanCodeClass() { Key = map.Key, Type = map.Type, PrintBarCode = barcode };
|
break;
|
case "2"://三生XML唯一码
|
TN_WM_B_UNIQUE_BARCODEEntity uniqueCode = BLLCreator.Create<TN_WM_B_UNIQUE_BARCODEBLL>().GetValue(barCode);
|
if (uniqueCode == null)
|
{
|
scanCodeMode = null;
|
break;
|
}
|
AutoBomItemEntity itemEnity = BLLCreator.Create<TN_WMS_ITEMBLL>().GetItem(uniqueCode.CN_S_ITEM_CODE);
|
if (uniqueCode != null)
|
{
|
if (itemEnity == null)
|
{
|
scanCodeMode = null;
|
}
|
else
|
{
|
uniqueCode.CN_F_MIN_PACK_QTY = Convert.ToString(itemEnity.CN_F_MIN_PACK_QTY);
|
uniqueCode.CN_C_IS_LOT_OUT = Convert.ToString(itemEnity.CN_C_IS_LOT_OUT);
|
uniqueCode.CN_C_IS_SN = Convert.ToString(itemEnity.CN_C_IS_SN);
|
uniqueCode.AuxiliaryUnitList = itemEnity.AuxiliaryUnitList;//辅助单位
|
scanCodeMode = new ScanCodeClass() { Key = map.Key, Type = map.Type, uniqueCode = uniqueCode };
|
}
|
|
}
|
break;
|
case "3":
|
break;
|
case "4"://准物料编码
|
var index = barCode.IndexOf("$");
|
var qty = 1;
|
if (index > 0)
|
{
|
qty = Convert.ToInt32(barCode.Substring(barCode.IndexOf("$"), barCode.Length));
|
barCode = barCode.Substring(0, barCode.IndexOf("$"));
|
}
|
AutoBomItemEntity itemenity = BLLCreator.Create<TN_WMS_ITEMBLL>().GetItem(barCode);
|
|
AutoBomItemQtyEntity qtyEntity = new AutoBomItemQtyEntity()
|
{
|
itemEntity = itemenity,
|
itemEntityQty = qty
|
};
|
scanCodeMode = new ScanCodeClass() { Key = map.Key, Type = map.Type, Item = qtyEntity };
|
break;
|
case "5"://物流单号
|
scanCodeMode = new ScanCodeClass() { Key = map.Key, Type = map.Type, Item = null };
|
break;
|
default:
|
break;
|
}
|
|
return scanCodeMode;
|
}
|
|
public ScanCodeClass AnalysisCodeYS(string barCode, string isUse)
|
{
|
ScanCodeClass scanCodeMode = new ScanCodeClass();
|
MONGO_PRINT_BARCODE barcode = BLLCreator.Create<MONGO_PRINT_BARCODEBLL>().GetValueYS(barCode, isUse);
|
if (barcode == null)
|
{
|
return null;
|
}
|
scanCodeMode = new ScanCodeClass() { Key = "", Type = "1", PrintBarCode = barcode };
|
return scanCodeMode;
|
}
|
public ScanCodeClass AnalysisCodeBackYS(string barCode, string isUse)
|
{
|
ScanCodeClass scanCodeMode = new ScanCodeClass();
|
List<MONGO_PRINT_BARCODE> barcode = BLLCreator.Create<MONGO_PRINT_BARCODEBLL>().GetValueBackYS(barCode, isUse);
|
if (barcode.Count > 0)
|
{
|
scanCodeMode = new ScanCodeClass() { Key = "", Type = "1", PrintBarCode = barcode[0] };
|
}
|
else
|
{
|
return null;
|
}
|
return scanCodeMode;
|
}
|
public bool Insert(List<MONGO_KEYTYPE_MAP> list)
|
{
|
return CreateDAL<MONGO_KEYTYPE_MAPDAL>().Insert(list);
|
}
|
}
|
}
|