You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
200 lines
5.5 KiB
200 lines
5.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Reflection;
|
|
|
|
namespace SiaSun.LMS.Implement
|
|
{
|
|
public class ManageCancel : ManageBase
|
|
{
|
|
/// <summary>
|
|
/// 托盘合并
|
|
/// 调用界面 ManageMerge
|
|
/// </summary>
|
|
/// <param name="mMANAGE_MAIN"></param>
|
|
/// <param name="lsMANAGE_LIST"></param>
|
|
/// <param name="sResult"></param>
|
|
/// <returns></returns>
|
|
public bool ManageCreate(SiaSun.LMS.Model.MANAGE_MAIN mMANAGE_MAIN,
|
|
List<SiaSun.LMS.Model.MANAGE_LIST> lsMANAGE_LIST, out string sResult)
|
|
{
|
|
bool bResult = true;
|
|
|
|
sResult = string.Empty;
|
|
|
|
try
|
|
{
|
|
this._P_Base_House.BeginTransaction(true);
|
|
|
|
#region 校验
|
|
|
|
#region 校验容器条码
|
|
|
|
if (!string.IsNullOrEmpty(mMANAGE_MAIN.STOCK_BARCODE))
|
|
{
|
|
string STOCK_BARCODE = mMANAGE_MAIN.STOCK_BARCODE;
|
|
|
|
if (STOCK_BARCODE.Trim().Length != 6)
|
|
{
|
|
bResult = false;
|
|
|
|
sResult = string.Format("容器条码[{0}]不合法", STOCK_BARCODE);
|
|
|
|
return bResult;
|
|
}
|
|
|
|
SiaSun.LMS.Model.GOODS_MAIN mGOODS_MAIN_CONTAINER = this._P_GOODS_MAIN.GetModel(STOCK_BARCODE.Substring(0, 1).ToUpper());
|
|
|
|
if (mGOODS_MAIN_CONTAINER == null)
|
|
{
|
|
bResult = false;
|
|
|
|
sResult = string.Format("容器条码[{0}]不合法", STOCK_BARCODE);
|
|
|
|
return bResult;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 校验容器库存
|
|
|
|
if (mMANAGE_MAIN.STOCK_BARCODE != string.Empty && (this._S_StorageService.StorageCheck(mMANAGE_MAIN.STOCK_BARCODE, Enum.AREA_TYPE.LiKu.ToString(), out sResult)))
|
|
{
|
|
bResult = false;
|
|
sResult = string.Format("托盘[{0}]已在立库区", mMANAGE_MAIN.STOCK_BARCODE);
|
|
return bResult;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
bResult = base.ManageCreate(mMANAGE_MAIN, lsMANAGE_LIST, false, false, out sResult);
|
|
|
|
if (!bResult)
|
|
{
|
|
return bResult;
|
|
}
|
|
|
|
bResult = this.ManageComplete(mMANAGE_MAIN.MANAGE_ID, false, out sResult);
|
|
|
|
if (!bResult)
|
|
{
|
|
return bResult;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
bResult = false;
|
|
|
|
sResult = ex.Message;
|
|
|
|
this._log.Fatal(string.Format("调用方法{0}发生异常。", MethodBase.GetCurrentMethod().Name), ex);
|
|
}
|
|
|
|
finally
|
|
{
|
|
if (bResult)
|
|
{
|
|
this._P_Base_House.CommitTransaction(true);
|
|
}
|
|
else
|
|
{
|
|
this._P_Base_House.RollBackTransaction(true);
|
|
}
|
|
}
|
|
|
|
return bResult;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 任务完成
|
|
/// </summary>
|
|
/// <param name="MANAGE_ID"></param>
|
|
/// <param name="bTrans"></param>
|
|
/// <param name="sResult"></param>
|
|
/// <returns></returns>
|
|
public new bool ManageComplete(int MANAGE_ID, bool bTrans, out string sResult)
|
|
{
|
|
bool bResult = true;
|
|
|
|
sResult = string.Empty;
|
|
|
|
try
|
|
{
|
|
this._P_Base_House.BeginTransaction(bTrans);
|
|
|
|
#region 校验
|
|
|
|
SiaSun.LMS.Model.MANAGE_MAIN mMANAGE_MAIN = this._P_MANAGE_MAIN.GetModel(MANAGE_ID);
|
|
|
|
bResult = null != mMANAGE_MAIN;
|
|
|
|
if (!bResult)
|
|
{
|
|
sResult = string.Format("管理任务索引[{0}]不存在", MANAGE_ID);
|
|
|
|
return bResult;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 更改库存
|
|
|
|
bResult = this._S_StorageService.StorageDelete(MANAGE_ID, out sResult);
|
|
|
|
if (!bResult)
|
|
{
|
|
return bResult;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 调用基类完成方法
|
|
|
|
bResult = base.ManageComplete(MANAGE_ID, false, out sResult);
|
|
if (!bResult)
|
|
{
|
|
return bResult;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 删除任务信息
|
|
|
|
this._P_MANAGE_DETAIL.DeleteManageID(mMANAGE_MAIN.MANAGE_ID);
|
|
|
|
this._P_MANAGE_LIST.DeleteManageID(mMANAGE_MAIN.MANAGE_ID);
|
|
|
|
this._P_MANAGE_MAIN.Delete(mMANAGE_MAIN.MANAGE_ID);
|
|
|
|
#endregion
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
bResult = false;
|
|
|
|
sResult = ex.Message;
|
|
|
|
this._log.Fatal(string.Format("调用方法{0}发生异常。", MethodBase.GetCurrentMethod().Name), ex);
|
|
}
|
|
finally
|
|
{
|
|
if (bResult)
|
|
{
|
|
this._P_Base_House.CommitTransaction(bTrans);
|
|
}
|
|
else
|
|
{
|
|
this._P_Base_House.RollBackTransaction(bTrans);
|
|
}
|
|
}
|
|
|
|
return bResult;
|
|
}
|
|
|
|
}
|
|
}
|