2024-02-06 19:36:47 +08:00
|
|
|
|
using System.Data;
|
2023-05-23 16:13:17 +08:00
|
|
|
|
using DeiNiu.Utils;
|
|
|
|
|
using DeiNiu.wms.Data.Model;
|
2024-02-06 19:36:47 +08:00
|
|
|
|
using DeiNiu.wms.Logical;
|
2023-05-23 16:13:17 +08:00
|
|
|
|
namespace DeiNiu.Wcf
|
|
|
|
|
{
|
|
|
|
|
// 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码、svc 和配置文件中的类名“LocationService”。
|
|
|
|
|
public class StockLocationService : basicService, IStockLocationService
|
|
|
|
|
{
|
|
|
|
|
private static lWmslocation _loc;
|
|
|
|
|
private static lWmsStock _stock;
|
|
|
|
|
private static lWmsStockPandian _pandian;
|
|
|
|
|
|
|
|
|
|
lWmsStockPandian pandian
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_pandian == null || _pandian.operId != getOperId())
|
|
|
|
|
{
|
|
|
|
|
_pandian = new lWmsStockPandian(getOperId());
|
|
|
|
|
}
|
|
|
|
|
return _pandian;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lWmsStock stock
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_stock == null || _stock.operId != getOperId())
|
|
|
|
|
{
|
|
|
|
|
_stock = new lWmsStock(getOperId());
|
|
|
|
|
}
|
|
|
|
|
return _stock;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lWmslocation loc
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_loc == null || _loc.operId != getOperId())
|
|
|
|
|
{
|
|
|
|
|
_loc = new lWmslocation(getOperId());
|
|
|
|
|
}
|
|
|
|
|
return _loc;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void addLocations(Structs locs)
|
|
|
|
|
{
|
|
|
|
|
loc.addLocations(locs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool updateWhLocations(int[] ids, Structs locs)
|
|
|
|
|
{
|
|
|
|
|
return loc.updateWhLocations(ids, locs);
|
|
|
|
|
}
|
|
|
|
|
public bool updateSizeLocations(int[] ids, Structs locs)
|
|
|
|
|
{
|
|
|
|
|
return loc.updateSizeLocations(ids, locs);
|
|
|
|
|
}
|
|
|
|
|
public bool updateLocationTranLines(int[] ids, Structs locs)
|
|
|
|
|
{
|
|
|
|
|
return loc.updateLocationTranLines(ids, locs);
|
|
|
|
|
}
|
|
|
|
|
public bool updateLocationABC(int[] ids, Structs locs)
|
|
|
|
|
{
|
|
|
|
|
return loc.updateLocationABC(ids, locs);
|
|
|
|
|
}
|
|
|
|
|
public bool updateLocationStoreType(int[] ids, Structs locs)
|
|
|
|
|
{
|
|
|
|
|
return loc.updateLocationStoreType(ids, locs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool updateLocationLabelId(int[] ids, Structs locs)
|
|
|
|
|
{
|
|
|
|
|
return loc.updateLocationLabelId(ids, locs);
|
|
|
|
|
}
|
|
|
|
|
public bool updateLocationStatus(int[] ids, int status)
|
|
|
|
|
{
|
|
|
|
|
return loc.updateLocationStatus(ids, status);
|
|
|
|
|
}
|
|
|
|
|
public bool updateLocationOwner(int[] ids, Structs locs)
|
|
|
|
|
{
|
|
|
|
|
return loc.updateLocationOwner(ids, locs);
|
|
|
|
|
}
|
|
|
|
|
public DataSet Query(string querystr, int rownumStart, int rownumEnd)
|
|
|
|
|
{
|
|
|
|
|
return loc.Query(querystr, rownumStart, rownumEnd);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
public DataSet QueryNodes(DataTable dic, string query, int rownumStart, int rownumEnd)
|
|
|
|
|
{
|
|
|
|
|
return loc.Query(dic, query, rownumStart, rownumEnd);
|
|
|
|
|
}
|
|
|
|
|
public DataTable getStockRecord(string orderNo)
|
|
|
|
|
{
|
|
|
|
|
return stock.wmsStock.getStockRecord(orderNo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DataSet getStockDiff(string querystr, int rownumStart, int rownumEnd)
|
|
|
|
|
{
|
|
|
|
|
return stock.wmsStock.getStockDiff(querystr, rownumStart, rownumEnd);
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-21 19:18:23 +08:00
|
|
|
|
public DataTable getWmsStockDetails(string goodsId,int skuId,string extrQuery)
|
2023-05-23 16:13:17 +08:00
|
|
|
|
{
|
2023-11-21 19:18:23 +08:00
|
|
|
|
return stock.wmsStock.getWmsStockDetails(goodsId,skuId, extrQuery);
|
2023-05-23 16:13:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DataTable getStockFreeLocations(string goodsId, int count)
|
|
|
|
|
{
|
|
|
|
|
return stock.wmsStock.getFreeStockLocations(goodsId, count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int upDownStockLocation(string locId, string goodsId, int skuId, string batch, string reason, decimal count, int type)
|
|
|
|
|
{
|
|
|
|
|
return (int)stock.upDownGoodsCountWithLocation(locId, goodsId, skuId, batch, count, reason, (enumStockRecordType)type, -1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DataSet getDataWaiting4Maintain(string query,int start,int end)
|
|
|
|
|
{
|
|
|
|
|
return new WmsStockMaintain().getDataWaiting4Maintain(query, start, end);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 养护记录
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
|
|
public DataSet getDataMaintainRecords(string query,int start,int end)
|
|
|
|
|
{
|
|
|
|
|
return new WmsStockMaintain().getDataMaintainRecords(query, start, end);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 临近有效期列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="days"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
|
|
public DataSet getDataNearValid(int days, int start, int end)
|
|
|
|
|
{
|
|
|
|
|
return new WmsStockMaintain().getDataNearValid(days, start, end);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 失效药品
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
|
|
public DataSet getDataInvaild( int start,int end)
|
|
|
|
|
{
|
|
|
|
|
return new WmsStockMaintain().getDataInvaild( start, end);
|
|
|
|
|
}
|
2024-02-06 19:36:47 +08:00
|
|
|
|
public int updateJobCross(int[] ids, bool isCross)
|
|
|
|
|
{
|
|
|
|
|
return loc.updateLocJobCross(ids, isCross);
|
|
|
|
|
}
|
2023-05-23 16:13:17 +08:00
|
|
|
|
|
|
|
|
|
public DataSet queryStockGoods(string queryStr, int start, int end)
|
|
|
|
|
{
|
|
|
|
|
return stock.Query(queryStr, start, end);
|
|
|
|
|
}
|
|
|
|
|
public DataSet querySumStockGoods(string queryStr, int start, int end)
|
|
|
|
|
{
|
|
|
|
|
return stock.wmsStock.QuerySum(queryStr, start, end);
|
|
|
|
|
}
|
|
|
|
|
public DataSet querySumStockGoodsNoBatch(string querystr, int rownumStart, int rownumEnd)
|
|
|
|
|
{
|
|
|
|
|
return stock.wmsStock.QuerySumNoBatch(querystr, rownumStart, rownumEnd);
|
|
|
|
|
}
|
|
|
|
|
public DataSet queryBulkRep(string queryStr, int start, int end)
|
|
|
|
|
{
|
|
|
|
|
return stock.wmsStock.QueryBulkRep(queryStr, start, end);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool createGoodsRepOrder(string[] goodsRep)
|
|
|
|
|
{
|
|
|
|
|
return new lWmsOutRequest(getOperId()).createGoodsRepOrder(goodsRep);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DataTable getLocationsUsedPercent()
|
|
|
|
|
{
|
|
|
|
|
return loc.getLocationsUsedPercent();
|
|
|
|
|
}
|
|
|
|
|
public DataSet queryStockRecords(string querystr, int rownumStart, int rownumEnd)
|
|
|
|
|
{
|
|
|
|
|
return stock.wmsStock.queryStockRecords(querystr, rownumStart, rownumEnd);
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-06 19:36:47 +08:00
|
|
|
|
public void initalSkus(bool isDownOnly,int start)
|
2023-05-23 16:13:17 +08:00
|
|
|
|
{
|
2024-02-06 19:36:47 +08:00
|
|
|
|
stock.initialSkus( isDownOnly,start);
|
2023-05-23 16:13:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------盘点-------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
2023-11-21 19:18:23 +08:00
|
|
|
|
public bool createPandianOrder(int panType, bool noticeErp, int createBy, string inputValues, string stockCondition)
|
2023-05-23 16:13:17 +08:00
|
|
|
|
{
|
2023-11-21 19:18:23 +08:00
|
|
|
|
pandian.createPanOrder(panType, noticeErp, createBy, inputValues, stockCondition);
|
2023-05-23 16:13:17 +08:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool startPandianOrder(string orderNo)
|
|
|
|
|
{
|
|
|
|
|
return pandian.startPandian(orderNo);
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-06 19:36:47 +08:00
|
|
|
|
public bool canStartNewPandian()
|
|
|
|
|
{
|
|
|
|
|
return pandian.canStartNewPandian();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2023-05-23 16:13:17 +08:00
|
|
|
|
public DataSet queryPandianOrders(string queryStr, int start, int end)
|
|
|
|
|
{
|
|
|
|
|
return pandian.Query(queryStr, start, end);
|
|
|
|
|
}
|
|
|
|
|
public bool delPandianOrder(string orderNo)
|
|
|
|
|
{
|
|
|
|
|
return pandian.delPandian(orderNo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DataSet queryPandianBanlanceDetail(string orderNo, string goodsId, int start, int end)
|
|
|
|
|
{
|
|
|
|
|
return pandian.getWmsStockPandian.getPandianBanlanceDetail(orderNo,start,end,goodsId);
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-21 19:18:23 +08:00
|
|
|
|
public DataSet queryPandianResult(string orderNo, string goodsId, int start, int end)
|
|
|
|
|
{
|
|
|
|
|
return pandian.getWmsStockPandian.queryPandianResult(orderNo, start, end, goodsId);
|
|
|
|
|
}
|
|
|
|
|
public DataSet queryPandianResultSum(string orderNo, string goodsId, int start, int end)
|
|
|
|
|
{
|
|
|
|
|
return pandian.getWmsStockPandian.queryPandianResultSum(orderNo, start, end, goodsId);
|
|
|
|
|
}
|
|
|
|
|
public DataSet getPandianBanlance(string orderNo, int start, int end)
|
2023-05-23 16:13:17 +08:00
|
|
|
|
{
|
2023-11-21 19:18:23 +08:00
|
|
|
|
return pandian.getWmsStockPandian.getPandianBanlance(orderNo ,start, end);
|
2023-05-23 16:13:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DataTable getPandianOrder(string orderNo)
|
|
|
|
|
{
|
|
|
|
|
return pandian.getWmsStockPandian.getPandianOrder(orderNo);
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-21 19:18:23 +08:00
|
|
|
|
public DataTable getPandianTargetItem(string orderNo,string locationId)
|
|
|
|
|
{
|
|
|
|
|
return pandian.getWmsStockPandian.getPandianTargetItem(orderNo, locationId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DataTable getPandianTargetItems(string orderNo )
|
|
|
|
|
{
|
|
|
|
|
return pandian.getWmsStockPandian.getPandianTargetItems(orderNo );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-23 16:13:17 +08:00
|
|
|
|
public bool adjustPandianStock(string orderNo,bool isRollBack )
|
|
|
|
|
{
|
|
|
|
|
return pandian.adjustPandianStock(orderNo, isRollBack);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool finishPandian(string orderNo)
|
|
|
|
|
{
|
|
|
|
|
return pandian.finishPandian(orderNo) ;
|
|
|
|
|
}
|
2023-11-21 19:18:23 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 采集完成
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="orderNo"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public bool stopPandianPick(string orderNo)
|
|
|
|
|
{
|
|
|
|
|
return pandian.stopPandianPick(orderNo);
|
|
|
|
|
}
|
2023-05-23 16:13:17 +08:00
|
|
|
|
|
|
|
|
|
//test only
|
|
|
|
|
public void initalErpSaleSku()
|
|
|
|
|
{
|
|
|
|
|
stock.initialErpSaledSku();
|
|
|
|
|
}
|
|
|
|
|
public void formatLocName()
|
|
|
|
|
{
|
|
|
|
|
new WmsLocation().formatLocName();
|
|
|
|
|
}
|
2024-02-06 19:36:47 +08:00
|
|
|
|
|
|
|
|
|
public bool updateLocScale(int[] ids, Structs locs)
|
|
|
|
|
{
|
|
|
|
|
return loc.updateLocScale(ids, locs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DataSet queryPlateStock(string querystr, int rownumStart, int rownumEnd)
|
|
|
|
|
{
|
|
|
|
|
return stock.wmsStock.queryPlateStock(querystr, rownumStart, rownumEnd);
|
|
|
|
|
}
|
|
|
|
|
public DataTable queryPerformanceKPI(string querystr,bool isSum)
|
|
|
|
|
{
|
|
|
|
|
return stock.wmsStock.queryPerformanceKPI(querystr,isSum);
|
|
|
|
|
}
|
|
|
|
|
public DataTable getElbPartStks(string locationId)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return stock.wmsStock.getElbPartStks(new WmsLocation(locationId).part);
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-23 16:13:17 +08:00
|
|
|
|
}
|
|
|
|
|
}
|