|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using Estsh.Web.Util;
|
|
|
using Estsh.Web.Dal;
|
|
|
using System.Collections;
|
|
|
|
|
|
/***************************************************************************************************
|
|
|
*
|
|
|
* 作者:贾文涛
|
|
|
* 创建时间:2014.07.12
|
|
|
* 描述:订单管理模块业务处理类
|
|
|
* 修改日志:
|
|
|
*
|
|
|
* *************************************************************************************************/
|
|
|
namespace Estsh.Core.Services
|
|
|
{
|
|
|
public class SortOrderManageService
|
|
|
{
|
|
|
private SortOrderManageDal dal = new SortOrderManageDal(RemotingProxyProvider._remotingProxy);
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取已释放未生产的指令
|
|
|
/// </summary>
|
|
|
/// <param name="requestHt"></param>
|
|
|
/// <returns></returns>
|
|
|
public Hashtable GetNoProdOrderData(Hashtable requestHt)
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
result = dal.GetNoProdOrderData(requestHt);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
public Hashtable GetStockPartData()
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
result = dal.GetStockPartData();
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取未匹配成功的排序单数据
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public Hashtable GetNoMatchOrderData()
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
result = dal.GetNoMatchOrderData();
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取即时库存明细
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public Hashtable GetNowStock()
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
result = dal.GetNowStock();
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取即时库存汇总
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public Hashtable GetNowTotalStock()
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
result = dal.GetNowTotalStock();
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取已经释放的生产指令明细
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public Hashtable GetHasRealsed(Hashtable requestHt)
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
result = dal.GetHasRealsed(requestHt);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取已经释放的生产指令汇总
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public Hashtable GetHasRealsedTotal(Hashtable requestHt)
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
result = dal.GetHasRealsedTotal(requestHt);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 指令撤销数据
|
|
|
/// </summary>
|
|
|
/// <param name="carNO"></param>
|
|
|
/// <param name="startTime"></param>
|
|
|
/// <param name="endTime"></param>
|
|
|
/// <returns></returns>
|
|
|
public Hashtable GetDataCancel(string carNo, string startTime, string endTime)
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
result = dal.GetDataCancel(carNo,startTime,endTime);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 冲料列表
|
|
|
/// </summary>
|
|
|
/// <param name="whereSen"></param>
|
|
|
/// <returns></returns>
|
|
|
public Hashtable GetCharegeListData(string startTime, string endTime, string whereSen)
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
result = dal.GetCharegeListData(startTime, endTime, whereSen);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 充料作业
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public String partReplace(String ids)
|
|
|
{
|
|
|
StringBuilder message = new StringBuilder();
|
|
|
message.Append(Environment.NewLine + "以下产品因为已上线,无法设置为充料:" + Environment.NewLine);
|
|
|
|
|
|
String[] idArray = ids.Split(',');
|
|
|
int count = 0;
|
|
|
int failCount = 0;
|
|
|
foreach (String id in idArray)
|
|
|
{
|
|
|
if (!"".Equals(id))
|
|
|
{
|
|
|
if (this.dal.UpdateOrderTypeToCharge(id))
|
|
|
{
|
|
|
count++;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
message.Append(id+Environment.NewLine);
|
|
|
failCount++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (failCount == 0)
|
|
|
{
|
|
|
message.Clear();
|
|
|
}
|
|
|
|
|
|
return string.Format("共有 {0} 个产品已被设置为充料{1}", count, message.ToString());
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 把车号标记为跳过
|
|
|
/// </summary>
|
|
|
/// <param name="carNo"></param>
|
|
|
/// <returns></returns>
|
|
|
public int SkipCarNo(string carNos)
|
|
|
{
|
|
|
String[] idArray = carNos.Split(',');
|
|
|
int count = 0;
|
|
|
foreach (String carNo in idArray)
|
|
|
{
|
|
|
if (!"".Equals(carNo))
|
|
|
{
|
|
|
if (this.dal.SkipCarNo(carNo))
|
|
|
{
|
|
|
count++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 指令撤销操作
|
|
|
/// </summary>
|
|
|
/// <param name="data"></param>
|
|
|
/// <returns></returns>
|
|
|
public int UpdateOrderCancel(String data)
|
|
|
{
|
|
|
String[] idArray = data.Split(',');
|
|
|
int count = 0;
|
|
|
foreach (String d in idArray)
|
|
|
{
|
|
|
if (!"".Equals(d))
|
|
|
{
|
|
|
if (this.dal.UpdateOrderCancel(d))
|
|
|
{
|
|
|
count++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return count;
|
|
|
}
|
|
|
}
|
|
|
}
|