修正代码合并的问题
This commit is contained in:
commit
6ddd51ad0b
|
@ -18,19 +18,19 @@ using System.Threading;
|
|||
namespace DeiNiu.wms.Logical
|
||||
{
|
||||
[Serializable]
|
||||
public class lWmsPlate :lbase
|
||||
public class lWmsPlate : lbase
|
||||
{
|
||||
WmsPlate _obj;
|
||||
public lWmsPlate()
|
||||
{
|
||||
initialize();
|
||||
initialize();
|
||||
}
|
||||
|
||||
public WmsPlate getWmsPlate
|
||||
public WmsPlate getWmsPlate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_obj == null)
|
||||
if (_obj == null)
|
||||
{
|
||||
_obj = new WmsPlate();
|
||||
|
||||
|
@ -61,9 +61,9 @@ namespace DeiNiu.wms.Logical
|
|||
{
|
||||
get
|
||||
{
|
||||
if (_lop == null || _lop.operId!=operId)
|
||||
if (_lop == null || _lop.operId != operId)
|
||||
{
|
||||
// log.Debug(string.Format("_lop is null? {0},lop.operId {1}, operId {2}", _lop == null, lop.operId, operId));
|
||||
// log.Debug(string.Format("_lop is null? {0},lop.operId {1}, operId {2}", _lop == null, lop.operId, operId));
|
||||
_lop = new lWmsOutPickRequest(operId);
|
||||
|
||||
}
|
||||
|
@ -79,12 +79,12 @@ namespace DeiNiu.wms.Logical
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// get all data
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// get all data
|
||||
/// </summary>
|
||||
public DataSet getAllData()
|
||||
{
|
||||
return _obj.Query();
|
||||
return _obj.Query();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -97,13 +97,13 @@ namespace DeiNiu.wms.Logical
|
|||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// get a record by id
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// get a record by id
|
||||
/// </summary>
|
||||
public void initialize(int id)
|
||||
{
|
||||
{
|
||||
_obj = id != 0 ? new WmsPlate(id) : new WmsPlate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get a record by id 0
|
||||
|
@ -113,12 +113,12 @@ namespace DeiNiu.wms.Logical
|
|||
initialize(0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// get a record by id
|
||||
/// </summary>
|
||||
public void initialize(DataRow dr)
|
||||
{
|
||||
_obj = new WmsPlate(dr);
|
||||
_obj = new WmsPlate(dr);
|
||||
}
|
||||
|
||||
protected override DeiNiu.Data.BaseObject.BaseModel getModel()
|
||||
|
@ -128,7 +128,7 @@ namespace DeiNiu.wms.Logical
|
|||
|
||||
//begin cust db operation, query, excute sql etc.
|
||||
|
||||
internal int add(WmsPlate obj,int count)
|
||||
internal int add(WmsPlate obj, int count)
|
||||
{
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
|
@ -147,7 +147,7 @@ namespace DeiNiu.wms.Logical
|
|||
/// put goods into a plate
|
||||
/// </summary>
|
||||
|
||||
public enumRegPlateResult inPlate(string plateId,enumPlateStatus type, string goodsId,string barcode,int skuId,decimal count,string orderNo)
|
||||
public enumRegPlateResult inPlate(string plateId, enumPlateStatus type, string goodsId, string barcode, int skuId, decimal count, string orderNo)
|
||||
{
|
||||
/*if (valid( plateId, type, goodsId, skuId) == enumRegPlateResult.成功)
|
||||
{
|
||||
|
@ -229,7 +229,7 @@ namespace DeiNiu.wms.Logical
|
|||
WmsGoods wg = new WmsGoods(goodsId);
|
||||
foreach (DataRow dr in dt.Rows)
|
||||
{
|
||||
if ( Convert.ToInt32(dr["goodsType"].ToString()) == wg.goodsType)//存在goods type
|
||||
if (Convert.ToInt32(dr["goodsType"].ToString()) == wg.goodsType)//存在goods type
|
||||
{
|
||||
return enumRegPlateResult.成功;
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ namespace DeiNiu.wms.Logical
|
|||
}
|
||||
|
||||
|
||||
return enumRegPlateResult.成功;
|
||||
return enumRegPlateResult.成功;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -277,7 +277,7 @@ namespace DeiNiu.wms.Logical
|
|||
}
|
||||
|
||||
WmsPlatePack wpp = new WmsPlatePack();
|
||||
// wpp.getUpPlateId(fromPlate);
|
||||
// wpp.getUpPlateId(fromPlate);
|
||||
|
||||
|
||||
wpp.plateId = toPlate;
|
||||
|
@ -307,7 +307,7 @@ namespace DeiNiu.wms.Logical
|
|||
|
||||
List<WmsFlow> jflows = new List<WmsFlow>();
|
||||
|
||||
foreach(WmsOutPickRequest wop in requests)
|
||||
foreach (WmsOutPickRequest wop in requests)
|
||||
{
|
||||
jflows.Add(new WmsFlow(wop.pickOrderNo + fromPlate));
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ namespace DeiNiu.wms.Logical
|
|||
}
|
||||
*/
|
||||
|
||||
foreach(WmsFlow flow in jflows)
|
||||
foreach (WmsFlow flow in jflows)
|
||||
{
|
||||
flow.finishedTasksPlus(operId, 1);
|
||||
}
|
||||
|
@ -420,8 +420,8 @@ namespace DeiNiu.wms.Logical
|
|||
{
|
||||
if (string.IsNullOrEmpty(req.loadTruckJob) && string.IsNullOrEmpty(toP.jobNo))
|
||||
{
|
||||
req.loadTruckJob = toP.jobNo;
|
||||
req.Update();
|
||||
req.loadTruckJob = toP.jobNo;
|
||||
req.Update();
|
||||
}
|
||||
|
||||
|
||||
|
@ -535,7 +535,7 @@ namespace DeiNiu.wms.Logical
|
|||
toP.lineId = fromP.lineId;
|
||||
|
||||
}
|
||||
else if (WmsConstants.IS_PLATE_IN_LINE && toP.lineId != (fromP.lineId) && fromP.lineId > 0)
|
||||
else if (WmsConstants.IS_PLATE_IN_LINE && toP.lineId != (fromP.lineId) && fromP.lineId > 0)
|
||||
{
|
||||
return enumRegPlateResult.集货线路不同;
|
||||
}
|
||||
|
@ -746,15 +746,15 @@ namespace DeiNiu.wms.Logical
|
|||
}
|
||||
|
||||
WmsPlateStock_tmp ptmp = new WmsPlateStock_tmp();
|
||||
WmsFlow jflow = new WmsFlow();
|
||||
// List<WmsFlow> jflows = new List<WmsFlow>();
|
||||
WmsFlow jflow = new WmsFlow();
|
||||
// List<WmsFlow> jflows = new List<WmsFlow>();
|
||||
|
||||
|
||||
|
||||
|
||||
WmsPlate toP = new WmsPlate(toPlate);
|
||||
int lineId = fromP.lineId;
|
||||
if (fromP.ID == 0 || fromP.volume==0 ) //临时容器
|
||||
if (fromP.ID == 0 || fromP.volume == 0) //临时容器
|
||||
{
|
||||
|
||||
DataTable dt2 = ptmp.getStockLst(fromPlate);
|
||||
|
@ -799,7 +799,7 @@ namespace DeiNiu.wms.Logical
|
|||
toP.lineId = lineId;
|
||||
}
|
||||
|
||||
if(WmsConstants.IS_PLATE_IN_LINE && lineId>0 && lineId != toP.lineId)
|
||||
if (WmsConstants.IS_PLATE_IN_LINE && lineId > 0 && lineId != toP.lineId)
|
||||
{
|
||||
|
||||
return enumRegPlateResult.集货线路不同;
|
||||
|
@ -826,12 +826,12 @@ namespace DeiNiu.wms.Logical
|
|||
|
||||
if (jflow.ID > 0)
|
||||
{
|
||||
jflow.finishedTasksPlus(operId,1, false, true);
|
||||
jflow.finishedTasksPlus(operId, 1, false, true);
|
||||
}
|
||||
|
||||
wpp.removeUp();
|
||||
wpp.removeUp();
|
||||
|
||||
int id= wpp.Add();
|
||||
int id = wpp.Add();
|
||||
|
||||
log.Debug("load truck add plate pack id " + id);
|
||||
|
||||
|
@ -840,7 +840,7 @@ namespace DeiNiu.wms.Logical
|
|||
{
|
||||
toP.transNo = Util.getOrderNo(enumCreateOrderType.transOrder, _obj.getNextSeq(enumCreateOrderType.transOrder));
|
||||
|
||||
logPlate.Debug(string.Format("2 plate {0} start new trans {1}, top.ID {2}", toPlate, toP.transNo,toP.ID));
|
||||
logPlate.Debug(string.Format("2 plate {0} start new trans {1}, top.ID {2}", toPlate, toP.transNo, toP.ID));
|
||||
new lTmsTranRequest(operId).createSimpleTran(requests, toP);// req.transNo = toP.transNo;
|
||||
|
||||
// return enumRegPlateResult.完成装车集货后才能装车;
|
||||
|
@ -900,7 +900,7 @@ namespace DeiNiu.wms.Logical
|
|||
}
|
||||
}
|
||||
|
||||
if (WmsConstants.IS_PLATE_IN_LINE && !WmsConstants.AUTO_LOAD_TRUCK )
|
||||
if (WmsConstants.IS_PLATE_IN_LINE && !WmsConstants.AUTO_LOAD_TRUCK)
|
||||
{
|
||||
if (fromP.ID > 0)
|
||||
{
|
||||
|
@ -921,6 +921,8 @@ namespace DeiNiu.wms.Logical
|
|||
//to release plate of Line
|
||||
// 线路码头容器里面的客户容器是否已经全部装车了,如果都已装车(释放),则释放线路容器
|
||||
|
||||
|
||||
|
||||
if (fromP.plateLevel == (int)enumPlateLevel.客户集货)
|
||||
{
|
||||
WmsPlate linePlate = new WmsPlate(fromP.inPlate);
|
||||
|
@ -941,7 +943,7 @@ namespace DeiNiu.wms.Logical
|
|||
|
||||
|
||||
string ldTask = fromP.jobNo;
|
||||
// if (string.IsNullOrEmpty(ldTask)) // 非固定容器、非客户集货类型的容器,容器没有装车任务信息
|
||||
// if (string.IsNullOrEmpty(ldTask)) // 非固定容器、非客户集货类型的容器,容器没有装车任务信息
|
||||
{
|
||||
foreach (WmsOutPickRequest req in requests) //容器里可能有多个分拣单,多个装车任务
|
||||
{
|
||||
|
@ -968,7 +970,7 @@ namespace DeiNiu.wms.Logical
|
|||
|
||||
if (plate.ID > 0 && plate.type != (int)enumPlateLevel.运输车)
|
||||
{
|
||||
// return enumRegPlateResult.发车需要运输类型的容器;
|
||||
// return enumRegPlateResult.发车需要运输类型的容器;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1046,22 +1048,22 @@ namespace DeiNiu.wms.Logical
|
|||
{
|
||||
wop = new WmsOutPickPort(dr);
|
||||
|
||||
WmsStock st = new WmsStock(wop.locationId, Convert.ToInt32(dr["skuId"].ToString()), dr["goodsId"].ToString());
|
||||
WmsStock st = new WmsStock(wop.locationId, Convert.ToInt32(dr["skuId"].ToString()), dr["goodsId"].ToString());
|
||||
|
||||
if (wop.virtialCnt > 0) //还回未出库虚拟库存
|
||||
{
|
||||
st.virtialCount -= wop.virtialCnt;
|
||||
st.virtialCount = st.virtialCount > 0 ? st.virtialCount : 0;
|
||||
if (wop.virtialCnt > 0) //还回未出库虚拟库存
|
||||
{
|
||||
st.virtialCount -= wop.virtialCnt;
|
||||
st.virtialCount = st.virtialCount > 0 ? st.virtialCount : 0;
|
||||
|
||||
WmsStock virSt = st.getVirStock(st.goodsId);
|
||||
virSt.countOuting -= wop.virtialCnt;
|
||||
virSt.updateCountOut();
|
||||
}
|
||||
WmsStock virSt = st.getVirStock(st.goodsId);
|
||||
virSt.countOuting -= wop.virtialCnt;
|
||||
virSt.updateCountOut();
|
||||
}
|
||||
|
||||
st.countOuting -= wop.count;
|
||||
st.countOuting = st.countOuting > 0 ? st.countOuting : 0; ;
|
||||
st.countOuting -= wop.count;
|
||||
st.countOuting = st.countOuting > 0 ? st.countOuting : 0; ;
|
||||
|
||||
st.updateCountOut();
|
||||
st.updateCountOut();
|
||||
|
||||
}
|
||||
wop.closePickPorts(req.pickOrderNo);
|
||||
|
@ -1147,24 +1149,25 @@ namespace DeiNiu.wms.Logical
|
|||
return 0;
|
||||
}
|
||||
|
||||
public void releasePlateStock(string plateId,decimal count, int inPortId =0,int outPortId =0)
|
||||
public void releasePlateStock(string plateId, decimal count, int inPortId = 0, int outPortId = 0)
|
||||
{
|
||||
logPlate.Debug(string.Format("plateId {0},count {1},inPortId {2},outPortId {3}", plateId, count, inPortId, outPortId));
|
||||
logPlate.Debug(string.Format("plateId {0},count {1},inPortId {2},outPortId {3}", plateId, count, inPortId, outPortId));
|
||||
WmsPlateStock_tmp plateStock = new WmsPlateStock_tmp();
|
||||
if(count==0 && inPortId==0 && outPortId == 0)
|
||||
if (count == 0 && inPortId == 0 && outPortId == 0)
|
||||
{
|
||||
int cnt= plateStock.releasePlate(plateId);
|
||||
logPlate.Debug(string.Format("release plate {0} ",plateId));
|
||||
int cnt = plateStock.releasePlate(plateId);
|
||||
logPlate.Debug(string.Format("release plate {0} ", plateId));
|
||||
return;
|
||||
}
|
||||
|
||||
DataTable dt;
|
||||
if (inPortId > 0) {
|
||||
dt = plateStock.getPlateIn(plateId, inPortId);
|
||||
if (inPortId > 0)
|
||||
{
|
||||
dt = plateStock.getPlateIn(plateId, inPortId);
|
||||
}
|
||||
else
|
||||
|
||||
dt = plateStock.getPlateOut(plateId, outPortId);
|
||||
dt = plateStock.getPlateOut(plateId, outPortId);
|
||||
|
||||
logPlate.Debug(string.Format(" stk items count {0} ", dt.Rows.Count));
|
||||
foreach (DataRow dr in dt.Rows)
|
||||
|
@ -1187,16 +1190,16 @@ namespace DeiNiu.wms.Logical
|
|||
|
||||
}
|
||||
|
||||
public DataTable getPateJobsDt(string plateId, bool showSub = false)
|
||||
public DataTable getPateJobsDt(string plateId, bool showSub = false)
|
||||
{
|
||||
DataTable dt = getWmsPlate.getPateJobsDt( plateId, showSub );
|
||||
DataTable dt = getWmsPlate.getPateJobsDt(plateId, showSub);
|
||||
logTest.Debug(string.Format("plate {0} ,showSub {1}, all contents size {2}", plateId, showSub, dt.Rows.Count));
|
||||
return dt;
|
||||
}
|
||||
|
||||
internal DataTable queryRegistedPlate(string flowNo)
|
||||
{
|
||||
return getWmsPlate.queryRegistedPlate(flowNo);
|
||||
return getWmsPlate.queryRegistedPlate(flowNo);
|
||||
}
|
||||
internal DataTable getFromPlate(string flowNo)
|
||||
{
|
||||
|
@ -1207,7 +1210,7 @@ namespace DeiNiu.wms.Logical
|
|||
|
||||
internal enumRegPlateResult takeOutPlate(string fromPlate, string plate)
|
||||
{
|
||||
WmsPlatePack wpp = new WmsPlatePack(fromPlate,plate);
|
||||
WmsPlatePack wpp = new WmsPlatePack(fromPlate, plate);
|
||||
log.Debug(string.Format("fromPlate {0}, plate {1}", fromPlate, plate));
|
||||
if (wpp.ID == 0)
|
||||
{
|
||||
|
@ -1242,18 +1245,18 @@ namespace DeiNiu.wms.Logical
|
|||
/// <param name="validReason"></param>
|
||||
/// <param name="finialValidation">是否只纠正账目,品相正确只是数量差异,则按实际拿的发</param>
|
||||
/// <returns></returns>
|
||||
internal enumOutValidResult plateValidation(string plateId,int portId,int skuId,string productDate,string validDate,string batch, decimal validationCnt, string validReason,bool finialValidation=true)
|
||||
internal enumOutValidResult plateValidation(string plateId, int portId, int skuId, string productDate, string validDate, string batch, decimal validationCnt, string validReason, bool finialValidation = true)
|
||||
{
|
||||
|
||||
log.Debug(string.Format("容器复核。。。。 portId {0}, skuId {1}, productDate {2}, validDate {3}, batch {4}, validationCnt {5}, validReason {6}, finialValidation {7}",
|
||||
portId, skuId, productDate, validDate, batch, validationCnt, validReason, finialValidation));
|
||||
WmsPlateStock_tmp wst = new WmsPlateStock_tmp().getModelByOutPort(plateId,portId);
|
||||
portId, skuId, productDate, validDate, batch, validationCnt, validReason, finialValidation));
|
||||
WmsPlateStock_tmp wst = new WmsPlateStock_tmp().getModelByOutPort(plateId, portId);
|
||||
|
||||
WmsOutPickPort wpp = new WmsOutPickPort(portId);
|
||||
WmsOutPickDetail wpd = new WmsOutPickDetail(wpp.pickDetailId);
|
||||
|
||||
|
||||
// WmsOrderRequest wor = new WmsOrderRequest();
|
||||
// WmsOrderRequest wor = new WmsOrderRequest();
|
||||
|
||||
|
||||
wpp.validationCnt = validationCnt;
|
||||
|
@ -1272,18 +1275,18 @@ namespace DeiNiu.wms.Logical
|
|||
log.Debug(string.Format("容器复核 原数量 {0}, 差异 {1} ", wst.count, diffCnt));
|
||||
|
||||
|
||||
WmsStock stk = null;
|
||||
WmsStock stk = null;
|
||||
WmsStockRecord wsr = null;
|
||||
if (diffCnt != 0)
|
||||
{
|
||||
wst.count = validationCnt;
|
||||
wsr = new WmsStockRecord(wpp.recordId);
|
||||
stk = new WmsStock(wpp.locationId, skuId);
|
||||
// stk.adjustingCnt += diffCnt;
|
||||
stk = new WmsStock(wpp.locationId, skuId);
|
||||
// stk.adjustingCnt += diffCnt;
|
||||
stk.count += diffCnt;
|
||||
|
||||
|
||||
log.Debug(string.Format("容器复核 volType {0}, 差异 {1}, pickdetail id {2} ,pick bulk cnt {3}, seeded cnt {4} pick batch cnt {5} ", wst.count, diffCnt,wpd.ID, wpd.bulkPicked,wpd.seeded,wpd.batchPicked));
|
||||
log.Debug(string.Format("容器复核 volType {0}, 差异 {1}, pickdetail id {2} ,pick bulk cnt {3}, seeded cnt {4} pick batch cnt {5} ", wst.count, diffCnt, wpd.ID, wpd.bulkPicked, wpd.seeded, wpd.batchPicked));
|
||||
|
||||
//少拿不补
|
||||
//多拿不退
|
||||
|
@ -1306,11 +1309,11 @@ namespace DeiNiu.wms.Logical
|
|||
if (diffCnt != 0)
|
||||
{
|
||||
string description = string.Format("\n 业务类型:{0} {5},拣货任务{1},计划数量 {2}, 实际数量{3}, 备注:{4}", "容器复核",
|
||||
wpp.ID,wpp.count,validationCnt, validReason, finialValidation ? " 按拣货数量发货" :" 实物多退少补,按需求发" );
|
||||
wpp.ID, wpp.count, validationCnt, validReason, finialValidation ? " 按拣货数量发货" : " 实物多退少补,按需求发");
|
||||
|
||||
log.Debug(description);
|
||||
|
||||
int i = wpd.Update();
|
||||
int i = wpd.Update();
|
||||
|
||||
log.Debug(" pick detail count updated rows " + i);
|
||||
|
||||
|
@ -1351,11 +1354,11 @@ namespace DeiNiu.wms.Logical
|
|||
return getWmsPlate.getLatestPlate(custId, goodsId).plateId;
|
||||
}
|
||||
|
||||
public DataTable getUnLoadTruckStks(string toPlate, int cnt)
|
||||
public DataTable getUnLoadTruckStks(string toPlate, int cnt)
|
||||
{
|
||||
log.Debug(string.Format("...... to getUnLoadTruckStks plateId {0}",toPlate));
|
||||
log.Debug(string.Format("...... to getUnLoadTruckStks plateId {0}", toPlate));
|
||||
WmsPlate toP = new WmsPlate(toPlate);
|
||||
return plateStk.getUnLoadTruckStks(toP.transNo,cnt);
|
||||
return plateStk.getUnLoadTruckStks(toP.transNo, cnt);
|
||||
}
|
||||
|
||||
public DataTable getLoadContent(string toPlate)
|
||||
|
@ -1365,12 +1368,11 @@ namespace DeiNiu.wms.Logical
|
|||
|
||||
internal string getGoodsById(string goodsId)
|
||||
{
|
||||
WmsGoods goods = new WmsGoods(goodsId,0,"");
|
||||
return goods.stockAvCount+"";
|
||||
WmsGoods goods = new WmsGoods(goodsId, 0, "");
|
||||
return goods.stockAvCount + "";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue