300 lines
11 KiB
C#
300 lines
11 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using WMS.Model.RK;
|
|||
|
|
using WMS.Model.Base;
|
|||
|
|
using System.Data;
|
|||
|
|
using WMS.IData;
|
|||
|
|
using WMS.Common;
|
|||
|
|
|
|||
|
|
|
|||
|
|
namespace WMS.Business.RK
|
|||
|
|
{
|
|||
|
|
public class BussStorageLot:IBussFactory
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 入库订单
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="model"></param>
|
|||
|
|
/// <param name="listmodel"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string AddCodeDiskLotData(StorageLotModel model,List<CodeDiskModel> listmodel, string stand)
|
|||
|
|
{
|
|||
|
|
model.LOT_ID = IBussFactory<WMS.Business.Base.BussDocumentTable>.Instance().GetDocumentStream("收货单");
|
|||
|
|
if(stand.Trim().Length==0)
|
|||
|
|
{
|
|||
|
|
stand = GetStaion(listmodel[0].Goods_id, model.STO_ID);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
DataProvider.Instance.StorageLot.AddLotData(model);//insert into T_RK_STORAGE_LOT
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
|
|||
|
|
foreach (CodeDiskModel modelInfo in listmodel)
|
|||
|
|
{
|
|||
|
|
modelInfo.LOT_ID = model.LOT_ID;
|
|||
|
|
modelInfo.ConveyorID = stand;
|
|||
|
|
DataProvider.Instance.CodeDisk.AddZpData(modelInfo);//T_RK_CODEDISK;
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
//写上架任务表T_ONGOODSSHELF
|
|||
|
|
|
|||
|
|
AutoRkGoodsInfo onInfo = new AutoRkGoodsInfo();
|
|||
|
|
onInfo.GOODSID = modelInfo.Goods_id;
|
|||
|
|
onInfo.CTL = modelInfo.Pallet_id;
|
|||
|
|
|
|||
|
|
onInfo.SHELF_NUM = modelInfo.Goods_Num;
|
|||
|
|
onInfo.STORAGE_ID = "YTJY001";
|
|||
|
|
onInfo.LOCATION_ID = modelInfo.LOCATION_ID;
|
|||
|
|
onInfo.STATUS = "1";
|
|||
|
|
onInfo.LOT_ID = model.LOT_ID;
|
|||
|
|
DataProvider.Instance.AutoRkData.InsertGoodsInfoShelf(onInfo);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
}
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 入库站台
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="goodsId"></param>
|
|||
|
|
/// <param name="STORAGE_ID"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
string GetStaion(string goodsId, string STORAGE_ID)
|
|||
|
|
{
|
|||
|
|
string station = "";
|
|||
|
|
DataTable tb = DataProvider.Instance.AutoRkData.GetDecData(STORAGE_ID);
|
|||
|
|
if (tb != null)
|
|||
|
|
{
|
|||
|
|
if (tb.Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
///查询 已经有入库任务和库存任务
|
|||
|
|
DataSet tbMis = DataProvider.Instance.AutoRkData.GetdecStationData(goodsId, STORAGE_ID);
|
|||
|
|
if (tbMis != null)
|
|||
|
|
{
|
|||
|
|
if (tbMis.Tables.Count > 0)
|
|||
|
|
{
|
|||
|
|
if (tbMis.Tables[0].Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
if (tb.AsEnumerable().Count(r => r["ConveyorID"].ToString() == tbMis.Tables[0].Rows[0]["instand"].ToString()) > 0)
|
|||
|
|
{
|
|||
|
|
station = tbMis.Tables[0].Rows[0]["instand"].ToString();
|
|||
|
|
return station;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
if (tbMis.Tables[1].Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
if (tb.AsEnumerable().Count(r => r["ConveyorID"].ToString() == tbMis.Tables[1].Rows[0]["instand"].ToString()) > 0)
|
|||
|
|
{
|
|||
|
|
station = tbMis.Tables[1].Rows[0]["instand"].ToString();
|
|||
|
|
return station;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
station = tb.Rows[0]["ConveyorID"].ToString();
|
|||
|
|
return station;
|
|||
|
|
}
|
|||
|
|
return "";
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
return "";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 增加一条数据
|
|||
|
|
/// </summary>
|
|||
|
|
public string AddLotData(StorageLotModel model, List<StorageLotInfoModel> listmodel)
|
|||
|
|
{
|
|||
|
|
model.LOT_ID = IBussFactory<WMS.Business.Base.BussDocumentTable>.Instance().GetDocumentStream("收货单");
|
|||
|
|
|
|||
|
|
DataProvider.Instance.StorageLot.AddLotData(model);
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
|
|||
|
|
foreach (StorageLotInfoModel modelInfo in listmodel)
|
|||
|
|
{
|
|||
|
|
modelInfo.LOT_ID = model.LOT_ID;
|
|||
|
|
DataProvider.Instance.StorageLot.AddLotInfo(modelInfo);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
if (model.NOTICE_ID.Trim().Length > 0)
|
|||
|
|
{
|
|||
|
|
WareNoticeModel ware = new WareNoticeModel();
|
|||
|
|
ware.WAREHOUSING_ID = model.NOTICE_ID;
|
|||
|
|
ware.STATE = "2";
|
|||
|
|
ware.CONFIRM_PERSON = model.OPERATORID;
|
|||
|
|
DataProvider.Instance.WareNotice.RevieWareNotiec(ware);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
}
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 更新一条数据
|
|||
|
|
/// </summary>
|
|||
|
|
public string Update(StorageLotModel model)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.StorageLot.Update(model);
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 更新一条数据
|
|||
|
|
/// </summary>
|
|||
|
|
public string Update(StorageLotModel model, List<StorageLotInfoModel> listmodel)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.StorageLot.Update(model, listmodel);
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 获得收货记录
|
|||
|
|
/// </summary>
|
|||
|
|
public List<StorageLotModel> GetList(StorageLotModel modle)
|
|||
|
|
{
|
|||
|
|
DataTable dt = DataProvider.Instance.StorageLot.GetStorageList(modle);
|
|||
|
|
List<StorageLotModel> list = ConvertHelper<StorageLotModel>.ConvertToList(dt);
|
|||
|
|
return list;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 删除一条数据
|
|||
|
|
/// </summary>
|
|||
|
|
public string Cancel(StorageLotModel model)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.StorageLot.Cancel(model);
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 删除一条数据
|
|||
|
|
/// </summary>
|
|||
|
|
public string Delete(StorageLotModel model, List<StorageLotInfoModel> listmodel, bool flag)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.StorageLot.Delete(model, listmodel, flag);
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//public List<StorageLotInfoModel> GetStorageLotInfo(string lot_id)
|
|||
|
|
//{
|
|||
|
|
// List<StorageLotInfoModel> list = new List<StorageLotInfoModel>();
|
|||
|
|
// DataTable table = DataProvider.Instance.StorageLot.GetStorageLotInfo(lot_id);
|
|||
|
|
// if (table != null)
|
|||
|
|
// {
|
|||
|
|
// list = ConvertHelper<StorageLotInfoModel>.ConvertToList(table);
|
|||
|
|
|
|||
|
|
// }
|
|||
|
|
// return list;
|
|||
|
|
//}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 获取已经入库的单据
|
|||
|
|
/// </summary>PackWeighingData
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public List<StorageLotModel> GetLotStatusFinish(string area_id)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
DataTable isQc = DataProvider.Instance.PackWeighing.SearchWeightNum("FrmQc");//是否质检
|
|||
|
|
|
|||
|
|
|
|||
|
|
DataTable table =new DataTable();
|
|||
|
|
if(isQc.Rows.Count==0)
|
|||
|
|
{
|
|||
|
|
table = DataProvider.Instance.StorageLot.GetLotStatusFinish("0", area_id);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (isQc.Rows[0]["paramvalue"].ToString() == "1")
|
|||
|
|
{
|
|||
|
|
table = DataProvider.Instance.StorageLot.GetLotStatusFinish("1", area_id);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
table = DataProvider.Instance.StorageLot.GetLotStatusFinish("0", area_id);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
List<StorageLotModel> list = ConvertHelper<StorageLotModel>.ConvertToList(table);
|
|||
|
|
return list;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 获得收货记录
|
|||
|
|
/// </summary>
|
|||
|
|
public List<StorageLotModel> StorageLotGetList(StorageLotModel modle)
|
|||
|
|
{
|
|||
|
|
DataTable dt = DataProvider.Instance.StorageLot.GetStorageList(modle);
|
|||
|
|
List<StorageLotModel> list = ConvertHelper<StorageLotModel>.ConvertToList(dt);
|
|||
|
|
return list;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 获得收货记录
|
|||
|
|
/// </summary>
|
|||
|
|
public List<StorageLotInfoModel> GetInfoList(string id)
|
|||
|
|
{
|
|||
|
|
DataTable dt = DataProvider.Instance.StorageLot.GetInfoList(id);
|
|||
|
|
List<StorageLotInfoModel> list = ConvertHelper<StorageLotInfoModel>.ConvertToList(dt);
|
|||
|
|
return list;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 获得收货记录
|
|||
|
|
/// </summary>
|
|||
|
|
public List<StorageLotInfoModel> GetInfoList(StorageLotInfoModel model)
|
|||
|
|
{
|
|||
|
|
DataTable dt = DataProvider.Instance.StorageLot.GetStorageInfoList(model);
|
|||
|
|
List<StorageLotInfoModel> list = ConvertHelper<StorageLotInfoModel>.ConvertToList(dt);
|
|||
|
|
return list;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 打印
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string Print(StorageLotModel model, PrintInfoModel print)
|
|||
|
|
{
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
|
|||
|
|
DataProvider.Instance.StorageLot.Update(model);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
DataProvider.Instance.PrintInfo.InsertPrintInfo(print);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 更新入库明细
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="upFuc"></param>
|
|||
|
|
/// <param name="insertFuc"></param>
|
|||
|
|
/// <param name="delFuc"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string newStorageLotInfoFuc(List<StorageLotInfoModel> upFuc, List<StorageLotInfoModel> insertFuc, List<StorageLotInfoModel> delFuc,StorageLotModel model)
|
|||
|
|
{
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
DataProvider.Instance.StorageLot.newStorageLotInfoFuc(upFuc, insertFuc, delFuc);
|
|||
|
|
DataProvider.Instance.StorageLot.Update(model, new List<StorageLotInfoModel>());
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|