240 lines
5.9 KiB
C#
240 lines
5.9 KiB
C#
|
|
/// <summary>
|
|
///INTERFACE CLASS FOR TABLE t_wmsOutPickLable
|
|
///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 WmsOutPickLable : WmsOutPickLable_base
|
|
{
|
|
public WmsOutPickLable()
|
|
{
|
|
|
|
}
|
|
|
|
public WmsOutPickLable(int id): base(id)
|
|
{
|
|
|
|
}
|
|
public WmsOutPickLable(DataRow dr): base(dr)
|
|
{
|
|
|
|
}
|
|
|
|
protected override void getImp()
|
|
{
|
|
model_imp = new WmsOutPickLable_Imp();
|
|
|
|
}
|
|
|
|
//begin cust db operation, query, excute sql etc.
|
|
public DataSet QueryByName(string name)
|
|
{
|
|
cmdParameters[0] = name;
|
|
return CustQuery(100);
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 第三方亮灯数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataSet getNewPickList()
|
|
{
|
|
return CustQuery(401);
|
|
}
|
|
/// <summary>
|
|
/// 第三方数据 需维护货位和标签对应关系的数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataTable getUnMaintainLocations()
|
|
{
|
|
return CustQuery(402).Tables[0];
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// current pick details
|
|
/// from tmp table
|
|
/// </summary>
|
|
/// <param name="state"></param>
|
|
/// <returns></returns>
|
|
public DataSet getCurrentPickList(enumPickState state = enumPickState.未拣)
|
|
{
|
|
cmdParameters[0] = (int)state;
|
|
return CustQuery(500);
|
|
}
|
|
|
|
/// <summary>
|
|
/// update the picking data
|
|
/// send back by ele label
|
|
/// </summary>
|
|
/// <param name="color"></param>
|
|
/// <param name="eleId"></param>
|
|
/// <param name="pickCount"></param>
|
|
/// <returns></returns>
|
|
public int updatePickingStatus(int color,int eleId,int elabAddress,decimal pickCount,bool isPDAOuting =false)
|
|
{
|
|
|
|
cmdParameters[0] = color;
|
|
cmdParameters[1] = eleId;
|
|
cmdParameters[2] = pickCount;
|
|
cmdParameters[3] = elabAddress;
|
|
cmdParameters[4] = isPDAOuting;
|
|
return CustOper(600);
|
|
|
|
}
|
|
public int updateSeedingStatus(int port,int seedsNo, int eleId )
|
|
{
|
|
|
|
cmdParameters[0] = port;
|
|
cmdParameters[1] = seedsNo;
|
|
cmdParameters[2] = eleId;
|
|
|
|
return CustOper(620);
|
|
|
|
}
|
|
/// <summary>
|
|
/// 更新复核数据的捡货状态
|
|
/// 在更新临时捡货状态后调用
|
|
/// </summary>
|
|
/// <param name="color"></param>
|
|
/// <param name="eleId"></param>
|
|
/// <param name="elabAddress"></param>
|
|
/// <returns></returns>
|
|
public int updateValidPickingStatus(int color, int eleId, int elabAddress )
|
|
{
|
|
|
|
cmdParameters[0] = color;
|
|
cmdParameters[1] = eleId;
|
|
cmdParameters[2] = elabAddress;
|
|
|
|
return CustOper(610);
|
|
|
|
}
|
|
|
|
public int updateWaveStatus()
|
|
{
|
|
|
|
bool isReady = QueryCount() == 0;
|
|
cmdParameters[0] = isReady;
|
|
return CustOper(1000);
|
|
|
|
}
|
|
/// <summary>
|
|
/// move the current picking data to picking [t_wmsOutPickLable]
|
|
/// delete the picking finished data
|
|
/// need transaction
|
|
/// </summary>
|
|
/// <param name="isForce"></param>
|
|
/// <returns></returns>
|
|
public void finishCurrentPickingData(bool isForce)
|
|
{
|
|
|
|
// string waveOrder = "";
|
|
|
|
// DataTable dt = getCurrentPickList(enumLabelPickState.picked).Tables[0];
|
|
|
|
//foreach (DataRow dr in dt.Rows)
|
|
//{
|
|
// waveOrder = dr["waveOrder"].ToString(); //取完成拣选的waveOrder
|
|
// break;
|
|
//}
|
|
|
|
|
|
cmdParameters[0] = (int)DeiNiu.Utils.enumPickState.已拣;
|
|
if (isForce)
|
|
{
|
|
|
|
if (pickConstants.OUT_STOCK_PDA_SCAN) //处理库存
|
|
{
|
|
DataTable dt = getCurrentPickList().Tables[0];
|
|
WmsOutPickLable wp;
|
|
int i=0;
|
|
foreach (DataRow dr in dt.Rows)
|
|
{
|
|
i++;
|
|
wp = new WmsOutPickLable(dr);
|
|
|
|
|
|
updatePickingStatus(wp.color, wp.elabId, wp.elabAddress, wp.count, true);
|
|
updateValidPickingStatus(wp.color, wp.elabId, wp.elabAddress);
|
|
}
|
|
i++;
|
|
}
|
|
|
|
CustOper(710);
|
|
|
|
return;
|
|
}
|
|
CustOper(700);
|
|
|
|
// return waveOrder;
|
|
|
|
}
|
|
|
|
public void finishCurrentPickingData(string waveOrder,bool isForce)
|
|
{
|
|
|
|
cmdParameters[0] = waveOrder;
|
|
cmdParameters[1] = "";
|
|
if (isForce)
|
|
{
|
|
cmdParameters[1] = "强制结束";
|
|
}
|
|
|
|
CustOper(720);
|
|
|
|
|
|
}
|
|
public DataSet getData4Pick(string waveOrder)
|
|
{
|
|
cmdParameters[0] = waveOrder;
|
|
return CustQuery(800);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 取未拣选完毕的数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataSet getPickedData(enumPickState state)
|
|
{
|
|
cmdParameters[0] =(int) state;
|
|
return CustQuery(900);
|
|
}
|
|
/// <summary>
|
|
/// 第三方当前波次数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataSet getCurrentWavePick()
|
|
{
|
|
|
|
return CustQuery(403);
|
|
}
|
|
|
|
public DataSet getShelfLabId()
|
|
{
|
|
return CustQuery(1100);
|
|
}
|
|
|
|
}
|
|
}
|
|
|