186 lines
6.7 KiB
C#
186 lines
6.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Data;
|
|
using WMS.IData;
|
|
using WMS.Model.RK;
|
|
using WMS.Common;
|
|
using WMS.Business.Base;
|
|
using WMS.Model.Base;
|
|
|
|
namespace WMS.Business.RK
|
|
{
|
|
/// <summary>
|
|
/// 入库商品清单
|
|
/// </summary>
|
|
public class BussWareNoticeTab : IBussFactory
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
/// 查询箱子的状态
|
|
/// </summary>
|
|
/// <param name="orderId"></param>
|
|
/// <param name="GoodsId"></param>
|
|
/// <returns></returns>
|
|
public List<BoxCodeModel> GetPrintBoxData(string orderId, string GoodsId)
|
|
{
|
|
List<BoxCodeModel> boxCodeList = new List<BoxCodeModel>();
|
|
DataTable table = DataProvider.Instance.WareNoticeTab.GetPrintBoxData(orderId, GoodsId);
|
|
if(table != null)
|
|
{
|
|
boxCodeList = ConvertHelper<BoxCodeModel>.ConvertToList(table);
|
|
}
|
|
return boxCodeList;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 打印成功更改打印标记
|
|
/// </summary>
|
|
/// <param name="orderId"></param>
|
|
/// <param name="GoodsId"></param>
|
|
/// <returns></returns>
|
|
public string UpdatePrint(string orderId, string GoodsId)
|
|
{
|
|
DataProvider.Instance.WareNoticeTab.UpdatePrint(orderId, GoodsId);
|
|
WareNoticeModel note = new WareNoticeModel();
|
|
note.WAREHOUSING_ID = orderId;
|
|
note.STATE = "1";
|
|
DataProvider.Instance.WareNotice.updateWareNoticeState(note);
|
|
logList.Add(DataProvider.Instance.logData);
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|
TaCmtOrRak();
|
|
return ErrText;
|
|
|
|
}
|
|
/// <summary>
|
|
/// 查询打印数据
|
|
/// </summary>
|
|
/// <param name="orderId"></param>
|
|
/// <param name="goodsId"></param>
|
|
/// <returns></returns>
|
|
public DataTable GetPrintData(string orderId, string goodsId)
|
|
{
|
|
|
|
return DataProvider.Instance.WareNoticeTab.GetPrintData(orderId, goodsId);
|
|
}
|
|
public int GetCtPringCs(string orderId, string GoodsId)
|
|
{
|
|
int printsts = 0;
|
|
DataTable tb= DataProvider.Instance.WareNoticeTab.GetCtPringCs(orderId, GoodsId);
|
|
if(tb!=null)
|
|
{
|
|
if(tb.Rows.Count>0)
|
|
{
|
|
printsts = int.Parse(tb.Rows[0]["PrintSts"].ToString());
|
|
}
|
|
|
|
}
|
|
|
|
return printsts;
|
|
}
|
|
/// <summary>
|
|
/// 更新打印标记和装箱数
|
|
/// </summary>
|
|
/// <param name="orderId"></param>
|
|
/// <param name="GoodsId"></param>
|
|
/// <param name="GOODSVOLUME"></param>
|
|
/// <param name="BOXCT"></param>
|
|
public string UpdatePrintSts(string measureId,string orderId, string GoodsId, string GOODSVOLUME, int BOXCT)
|
|
{
|
|
DataProvider.Instance.WareNoticeTab.UpdatePrintSts(measureId,orderId, GoodsId, GOODSVOLUME, BOXCT);
|
|
|
|
return ErrText;
|
|
}
|
|
/// <summary>
|
|
/// 获取入库商品清单
|
|
/// </summary>
|
|
/// <param name="strWareNotice">入库通知单</param>
|
|
/// <returns>入库商品清单</returns>
|
|
public List<WareNoticeTabModel> GetWareNoticeTabList(WareNoticeTabModel model)
|
|
{
|
|
DataTable table = DataProvider.Instance.WareNoticeTab.GetWareNoticeTabDT(model);
|
|
List<WareNoticeTabModel> WareNoticeTabModel = ConvertHelper<WareNoticeTabModel>.ConvertToList(table);
|
|
|
|
if (DataLogErrWrite(table, "获取入库商品明细:"))
|
|
{
|
|
return WareNoticeTabModel;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 插入或修改入库商品清单
|
|
/// </summary>
|
|
/// <param name="WareNoticeTabModel">入库通知单详细Model</param>
|
|
/// <param name="Flag">操作表示符 0:新增; 1:修改</param>
|
|
/// <returns>是否成功</returns>
|
|
public string InsertOrUpdateWareNoticeTab(WareNoticeTabModel wareNoticeTabModel, int Flag)
|
|
{
|
|
//根据数量计算总金额、体积、重量
|
|
decimal amount = wareNoticeTabModel.AMOUNT;
|
|
BussGoods bg = new BussGoods();
|
|
//GoodsInfoModel gm = bg.GetGoodsList(wareNoticeTabModel.GOODS_ID,"","","")[0];
|
|
//wareNoticeTabModel.TOTAL_MONEY = gm.PRICE * amount;
|
|
//wareNoticeTabModel.TOTAL_NET_WEIGH = gm.NET_WEIGHT * amount;
|
|
//wareNoticeTabModel.TOTAL_ROUGH_WEIGHT = gm.GROSS_WEIGHT * amount;
|
|
//wareNoticeTabModel.TOTAL_VOLUME = gm.GVOLUME * amount;
|
|
|
|
//DataProvider.Instance.WareNoticeTab.InsertOrUpdateWareNoticeTab(wareNoticeTabModel, Flag);
|
|
|
|
DataLogErrWrite("插入或修改入库商品明细:");
|
|
return ErrText;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除入库商品清单
|
|
/// </summary>
|
|
/// <param name="model">入库商品清单Model</param>
|
|
/// <returns>是否成功</returns>
|
|
public string DeleteWareNoticeTab(WareNoticeTabModel model)
|
|
{
|
|
DataProvider.Instance.WareNoticeTab.DeleteWareNoticeTab(model);
|
|
logList.Add(DataProvider.Instance.logData);
|
|
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|
TaCmtOrRak();
|
|
return ErrText;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 通过入库通知单编号集合查出入库商品清单信息的集合
|
|
/// </summary>
|
|
/// <param name="strListID">类似于(1,2,3,4)</param>
|
|
/// <returns></returns>
|
|
public List<WareNoticeTabModel> GetWareNoticeTabByList(string strListID)
|
|
{
|
|
|
|
DataTable tb= DataProvider.Instance.WareNoticeTab.GetWareNoticeTabByList(strListID);
|
|
if (tb != null)
|
|
{
|
|
List<WareNoticeTabModel> WareNoticeTabModel = ConvertHelper<WareNoticeTabModel>.ConvertToList(tb);
|
|
return WareNoticeTabModel;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
///// <summary>
|
|
///// 根据角色编号返回角色所属仓库、库区
|
|
///// </summary>
|
|
///// <param name="roleID">用户角色编号</param>
|
|
///// <returns>角色所属仓库、库区</returns>
|
|
//public RoleStorageModel GetRoleStorageArea(string roleID)
|
|
//{
|
|
// DataTable table = DataProvider.Instance.WareNoticeTab.GetRoleStorageAreaDT(roleID);
|
|
// RoleStorageModel model = ConvertHelper<RoleStorageModel>.ConvertToList(table)[0];
|
|
|
|
// if (DataLogErrWrite(table, "根据角色编号返回角色所属仓库、库区"))
|
|
// {
|
|
// return model;
|
|
// }
|
|
// return null;
|
|
//}
|
|
}
|
|
}
|