212 lines
6.2 KiB
C#
212 lines
6.2 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using WMS.Model.Stock;
|
|||
|
|
using System.Data;
|
|||
|
|
using WMS.IData;
|
|||
|
|
using WMS.Common;
|
|||
|
|
|
|||
|
|
namespace WMS.Business.Stock
|
|||
|
|
{
|
|||
|
|
public class BussCounting : IBussFactory
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 增加一条记录
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="model"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string Add(CountingModel model)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.Counting.Add(model);
|
|||
|
|
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 增加一条记录及明细
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="model"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string AddAndInfo(CountingModel model,List<CountingInfoModel> infomodellist)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.Counting.Add(model);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
|
|||
|
|
foreach (CountingInfoModel infomodel in infomodellist)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.CountingInfo.Add(infomodel);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 修改一条记录
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="model"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string Update(CountingModel model)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.Counting.Update(model);
|
|||
|
|
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 修改Status
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="model"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string UpdateImprot(string id,string status)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.Counting.UpdateImport(id, status);
|
|||
|
|
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 修改一条记录及明细
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="model"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string UpdateAndInfo(CountingModel model,List<CountingInfoModel> infomodelList)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.Counting.Update(model);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
|
|||
|
|
foreach (CountingInfoModel infomodel in infomodelList)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.CountingInfo.Update(infomodel);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 删除一条记录
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="COUNT_ID"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string Delete(string COUNT_ID)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.Counting.Delete(COUNT_ID);
|
|||
|
|
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 删除一条记录
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="model"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string Delete(CountingModel model)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.Counting.Delete(model);
|
|||
|
|
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 删除一条记录及明细
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="model"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string DeleteAndInfo(CountingModel model)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.Counting.Delete(model);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
|
|||
|
|
CountingInfoModel infomodel = new CountingInfoModel() { COUNT_ID = model.COUNT_ID };
|
|||
|
|
DataProvider.Instance.CountingInfo.Delete(infomodel);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 获取集合
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="model"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public List<CountingModel> GetCountingList(CountingModel model)
|
|||
|
|
{
|
|||
|
|
DataTable table = DataProvider.Instance.Counting.GetList(model);
|
|||
|
|
if (table == null) { return null; }
|
|||
|
|
List<CountingModel> CountingModelList = ConvertHelper<CountingModel>.ConvertToList(table);
|
|||
|
|
|
|||
|
|
if (DataLogErrWrite(table, "获取盘点单"))
|
|||
|
|
{
|
|||
|
|
return CountingModelList;
|
|||
|
|
}
|
|||
|
|
return null;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 获取流水号
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string GetSerialNum()
|
|||
|
|
{
|
|||
|
|
return DataProvider.Instance.Counting.GetSerialNum();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 获取流水号
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string ReCount(CountingModel orimodel,CountingModel newmodel, List<CountingInfoModel> infolist)
|
|||
|
|
{
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
|
|||
|
|
DataProvider.Instance.Counting.Update(orimodel);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
|
|||
|
|
DataProvider.Instance.Counting.Add(newmodel);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
|
|||
|
|
foreach (CountingInfoModel infomodel in infolist)
|
|||
|
|
{
|
|||
|
|
DataProvider.Instance.CountingInfo.Add(infomodel);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
}
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|