Compare commits

...

2 Commits

7 changed files with 56 additions and 20 deletions

View File

@ -270,9 +270,21 @@ namespace DeiNiu.wms.Data.Model
sqlCmd.Parameters.AddWithValue("@batch", mObj.CmdParameters[2]);
break;
case 1002: //by flowno and seedsNo
_strSql = "SELECT * FROM v_stockOutPort WHERE pickOrderNo=@seedsNo and flowNo = @flowNo and goodsId=@goodsId and isnull(batch,@batch )=@batch ";
LogHelper.debug(GetType(), _strSql);
sqlCmd.CommandText = _strSql;
sqlCmd.Parameters.AddWithValue("@flowNo", mObj.CmdParameters[0]);
sqlCmd.Parameters.AddWithValue("@goodsId", mObj.CmdParameters[1]);
sqlCmd.Parameters.AddWithValue("@batch", mObj.CmdParameters[2]);
sqlCmd.Parameters.AddWithValue("@seedsNo", mObj.CmdParameters[3]);
break;
case 1100: //getFreeTasks
_strSql = "SELECT * FROM [v_stockOutBatchPickDetail] a WHERE " +
" jobNo is not null" +
_strSql = "SELECT * FROM [v_stockOutBatchPickDetail] a WHERE cast(createtime as date) = cast(getdate() as date) " +
" and jobNo is not null" +
" and isnull(takeBy,0) =0 ";
if (Convert.ToInt32(mObj.CmdParameters[4]) > 0)
@ -331,8 +343,8 @@ namespace DeiNiu.wms.Data.Model
case 1110: //getFreeTasks by jobNo
_strSql = "SELECT top (@cnt) * FROM [v_stockOutBatchPickDetail] a WHERE " +
" jobNo is not null" +
_strSql = "SELECT top (@cnt) * FROM [v_stockOutBatchPickDetail] a WHERE cast(createtime as date) = cast(getdate() as date) " +
" and jobNo is not null" +
" and elabId =0 " +
" and isnull(takeBy,0) =0 " +
" and ( isWeightSeeds=0 or isWeightSeeds =1 and partion =@partion )"; //区的任务可跨区获取,或获取指定区的任务

View File

@ -223,6 +223,15 @@ namespace DeiNiu.wms.Data.Model
cmdParameters[2] = batch;
return CustQuery(1001).Tables[0];
}
public DataTable getFlowNoDetails(string seedsNo,string flowNo, string goodsId, string batch)
{
cmdParameters[0] = flowNo;
cmdParameters[1] = goodsId;
cmdParameters[2] = batch;
cmdParameters[3] = seedsNo;
return CustQuery(1002).Tables[0];
}
public DataTable getFreeTasks(int partion, int lineId, bool batchOnly,enumOrderType orderType,int empId=0)
{

View File

@ -1575,11 +1575,22 @@ namespace DeiNiu.wms.Logical
WmsFlow wmsFlow = new WmsFlow(preInNo);
if(wmsFlow.state == (int)enumFlowTaskStatus.)
{
return enumRepResult.;
logIn.Debug("start to 完验 " + (enumFlowTaskStatus)wmsFlow.state);
// return enumRepResult.成功;
}
int cnt = 0;
List<Erp_purch> lst = preInObj.getPuchObjescts(preInNo);
foreach (Erp_purch obj in lst)
{
if (obj.wms_state >= (int)enumInStockOrderStatus.)
{
return enumRepResult.;
}
// obj.Update();
}
using (TransactionScope scope = new TransactionScope())
{
@ -1600,7 +1611,7 @@ namespace DeiNiu.wms.Logical
foreach (Erp_purch obj in lst)
{
obj.wms_state = (int)enumInStockOrderStatus.;
obj.wms_state = (int)enumInStockOrderStatus.;
obj.Update();
}
@ -3033,7 +3044,7 @@ namespace DeiNiu.wms.Logical
logERP.Debug(string.Format(" notice ERP purch order {0},response {1}", ((Erp_purch)purchObj).pur_order, responseText));
((Erp_purch)purchObj).erp_state = (int)enumErpOrderStatus.;
((Erp_purch)purchObj).wms_state = (int)enumInStockOrderStatus.; //辣得叫 不存在多次收货情况,到货通知单完验
((Erp_purch)purchObj).wms_state = (int)enumInStockOrderStatus.; //辣得叫 不存在多次收货情况,到货通知单完验
if (response.StatusCode == HttpStatusCode.OK)
{

View File

@ -1464,7 +1464,9 @@ namespace DeiNiu.wms.Logical
}
WmsOutPickDetail wod = new WmsOutPickDetail(outDetailId);
// logTest.Debug(string.Format("seeds pickdetail {0}", wod.ToString()));
logTest.Debug(string.Format("seeds pickdetail {0}", wod.ToString()));
if (wod.ID==0 || !isZhitongSeed && string.IsNullOrEmpty(wod.seedsPickNo) )
{
logTest.Debug(string.Format(" detialId {0}, seedsNo is null, {1}", outDetailId, enumRepResult.));
@ -1559,9 +1561,9 @@ namespace DeiNiu.wms.Logical
// pickport with flowno can be multi records, update the finished seeds count in loop
// 更新总拣记录 pickport with flowno can be multi records, update the finished seeds count in loop
DataTable dt = getWmsOutPickPort.getFlowNoDetails(flowNo, wod.goodsId, batch);
DataTable dt = getWmsOutPickPort.getFlowNoDetails(wod.seedsPickNo, flowNo, wod.goodsId, batch);
List<WmsOutPickPort> lstSeeds = new List<WmsOutPickPort>();
List<WmsPlateStock_tmp> lstUpdate = new List<WmsPlateStock_tmp>();
;
@ -1753,7 +1755,7 @@ namespace DeiNiu.wms.Logical
log.Debug(string.Format("2 seeds done cnt {0}, totalcnt of task {1}, lstUpdate.Count {2}", seedsDoneCnt, dt.Rows.Count, lstUpdate.Count));
wmsflow.finishedTasksPlus(operId, seedCnt / wod.goods.bigCount, true, false); //下架任务更新分播数据
wmsflow.finishedTasksPlus(operId, seedCnt / wod.goods.minOperateCount, true, false); //下架任务更新分播数据
WmsFlow wmsflowCust = new WmsFlow(wmsflow.orderNo, wod.customerId + "-" + operId); //按分播单 和客户ID 分播ID 创建分播任务
if (wmsflowCust.ID == 0)
@ -1768,7 +1770,7 @@ namespace DeiNiu.wms.Logical
wmsflowCust.Add();
}
wmsflowCust.finishedTasksPlus(operId, seedCnt / wod.goods.bigCount, true); //更新分播任务
wmsflowCust.finishedTasksPlus(operId, seedCnt / wod.goods.minOperateCount, true); //更新分播任务
// log.Debug(" 2 WmsPlateStock_tmp lstUpdate count " + lstUpdate.Count);
@ -2051,7 +2053,7 @@ namespace DeiNiu.wms.Logical
wid.Update();
flow.finishedTasksPlus(operId,seedCnt/wod.goods.bigCount,true,wid.seedOutCnt>=wid.validCount);
flow.finishedTasksPlus(operId,seedCnt/wod.goods.minOperateCount,true,wid.seedOutCnt>=wid.validCount);
wod.Update();

View File

@ -3551,7 +3551,7 @@ namespace DeiNiu.wms.Logical
stk.Update();
flow.finishedTasksPlus(operId, pickCount / goods.bigCount);
flow.finishedTasksPlus(operId, pickCount / goods.minOperateCount);
scope.Complete();
@ -3872,7 +3872,7 @@ namespace DeiNiu.wms.Logical
}
}
flow.finishedTasksPlus(operId, pickCount / goods.bigCount);
flow.finishedTasksPlus(operId, pickCount / goods.minOperateCount);
try
{
log.Debug("flow.owner: " + flow.owner);

File diff suppressed because one or more lines are too long

View File

@ -327,7 +327,9 @@ namespace DeiNiu.Wcf
public void truncateDataForTestOnly()
{
try {
#if DEBUG
lir.createDataForTestOnly();
#endif
}catch(Exception er)
{
log.Error(er);