199 lines
5.0 KiB
C#
199 lines
5.0 KiB
C#
|
|
/// <summary>
|
|
///INTERFACE CLASS FOR TABLE t_wmsOutPickDetail
|
|
///By wm with codesmith.
|
|
///on 05/22/2017
|
|
/// </summary>
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Data;
|
|
using DeiNiu.Utils;
|
|
|
|
namespace DeiNiu.wms.Data.Model
|
|
{
|
|
[Serializable]
|
|
public class WmsOutPickDetail : WmsOutPickDetail_base
|
|
{
|
|
public WmsOutPickDetail()
|
|
{
|
|
|
|
}
|
|
|
|
public WmsOutPickDetail(int id)
|
|
: base(id)
|
|
{
|
|
|
|
}
|
|
public WmsOutPickDetail(DataRow dr)
|
|
: base(dr)
|
|
{
|
|
|
|
}
|
|
|
|
protected override void getImp()
|
|
{
|
|
model_imp = new WmsOutPickDetail_Imp();
|
|
|
|
}
|
|
|
|
|
|
//begin cust db operation, query, excute sql etc.
|
|
public DataSet QueryByName(string name)
|
|
{
|
|
cmdParameters[0] = name;
|
|
return CustQuery(100);
|
|
}
|
|
|
|
private WmsGoods _goods;
|
|
|
|
public WmsGoods goods
|
|
{
|
|
get
|
|
{
|
|
|
|
if (_goods == null)
|
|
{
|
|
_goods = new WmsGoods(_goodsId, _skuId, _batch, (enumWhType)_whtype);
|
|
}
|
|
|
|
return _goods;
|
|
}
|
|
// set { _goods = value; }
|
|
}
|
|
|
|
private WmsLocation _location;
|
|
public WmsLocation location
|
|
{
|
|
get
|
|
{
|
|
if (_location == null)
|
|
{
|
|
_location = new WmsLocation(locationId);
|
|
|
|
}
|
|
return _location;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
/// <summary>
|
|
/// 取商品库存总量
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public decimal getGoodsStockCnt()
|
|
{
|
|
return getGoodsStockCnt(-1);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据货位类型取商品库存总量
|
|
/// </summary>
|
|
/// <param name="locVolType"></param>
|
|
/// <returns></returns>
|
|
private decimal getGoodsStockCnt(int locVolType)
|
|
{
|
|
|
|
cmdParameters[0] = _whtype;
|
|
cmdParameters[1] = _skuId;
|
|
cmdParameters[2] = locVolType;
|
|
|
|
DataTable dt = CustQuery(200).Tables[0];
|
|
|
|
try
|
|
{
|
|
foreach (DataRow dr in dt.Rows)
|
|
{
|
|
return Convert.ToDecimal(dr[0].ToString());
|
|
}
|
|
}
|
|
catch (Exception e) // not exist in stock
|
|
{
|
|
return 0m;
|
|
}
|
|
|
|
return 0m;
|
|
|
|
} */
|
|
/*
|
|
/// <summary>
|
|
/// 根据货位类型取商品库存总量
|
|
/// </summary>
|
|
/// <param name="locVolType">货位类型</param>
|
|
/// <returns></returns>
|
|
public decimal getGoodsStockCnt(DeiNiu.Utils.enumWhLocVol locVol) // to use goods.stockBulkCount
|
|
{
|
|
// DeiNiu.Utils.LogHelper.WriteLog(this.GetType(),"start to get good stock cnt");
|
|
return getGoodsStockCnt((int)locVol);
|
|
// DeiNiu.Utils.LogHelper.WriteLog(this.GetType(), "end to get good stock cnt");
|
|
|
|
}
|
|
*/
|
|
|
|
#region obsoleted
|
|
/*
|
|
public int saveError(string orderNo)
|
|
{
|
|
WmsOutPickDetail_error pe = new WmsOutPickDetail_error();
|
|
pe.orderNo = orderNo;
|
|
pe._batch = _batch;
|
|
pe._batch1Count = _batch1Count;
|
|
pe._batch2Count = _batch2Count;
|
|
pe._boxcnt = _boxcnt;
|
|
pe._bulkCount = _bulkCount;
|
|
pe._count = _count;
|
|
pe._customerId = _customerId;
|
|
pe._customerName = _customerName;
|
|
pe._description = _description;
|
|
pe._goodsId = _goodsId;
|
|
pe._pickOrderNo = _pickOrderNo;
|
|
pe._productDate = _productDate;
|
|
pe._validDate = _validDate;
|
|
pe._whtype = _whtype;
|
|
return pe.Add();
|
|
|
|
}
|
|
* */
|
|
#endregion
|
|
|
|
public void updateErpSaleDetail_deng(bool isOn)
|
|
{
|
|
cmdParameters[0] = pickOrderNo;
|
|
cmdParameters[1] = locationId;
|
|
cmdParameters[2] = count;
|
|
cmdParameters[3] = skuId;
|
|
DataTable dt = CustQuery(300).Tables[0];
|
|
foreach (DataRow dr in dt.Rows)
|
|
{
|
|
int id = Convert.ToInt32(dr["id"].ToString());
|
|
Erp_sale_d esd = new Erp_sale_d(id);
|
|
if (isOn)
|
|
{
|
|
esd.liangdeng = true;
|
|
}
|
|
else
|
|
{
|
|
esd.dengmie = true;
|
|
}
|
|
esd.Update();
|
|
break;
|
|
}
|
|
}
|
|
|
|
public bool isAllPicked(string orderNo)
|
|
{
|
|
cmdParameters[0] = orderNo;
|
|
cmdParameters[1] = (int)enumOutStockDetailStatus.完成分拣;
|
|
cmdParameters[2] = (int)enumOutStockDetailStatus.播种完成;
|
|
return queryCount(400)==0;
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|