|
|
using Estsh.Core.Model.Result;
|
|
|
using Estsh.Core.Models;
|
|
|
using Estsh.Core.Repository.IRepositories;
|
|
|
using Estsh.Core.Services.IServices;
|
|
|
using Estsh.Core.Util;
|
|
|
using System.Collections;
|
|
|
using System.Data;
|
|
|
using System.Text;
|
|
|
|
|
|
/***************************************************************************************************
|
|
|
*
|
|
|
* 更新人:sitong.dong
|
|
|
* 描述:库存插单
|
|
|
* 修改时间:2022.06.22
|
|
|
* 修改日志:系统迭代升级
|
|
|
*
|
|
|
**************************************************************************************************/
|
|
|
namespace Estsh.Core.Services
|
|
|
{
|
|
|
public class ProductionOrderReleaseService : BaseService<GStockOrder>, IProductionOrderReleaseService
|
|
|
{
|
|
|
private readonly IProductionOrderReleaseRepository repository;
|
|
|
|
|
|
public ProductionOrderReleaseService(IProductionOrderReleaseRepository _repository) : base(_repository)
|
|
|
{
|
|
|
repository = _repository;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取客户产线列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> GetCustPDLine()
|
|
|
{
|
|
|
return repository.GetCustPDLine();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取产线列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> GetPdline()
|
|
|
{
|
|
|
return repository.GetPdline();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取配置名称
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
//public ArrayList GetModelName()
|
|
|
//{
|
|
|
// Hashtable result = new Hashtable();
|
|
|
// DataTable dt = repository.GetModelName();
|
|
|
// return DataTypeConvert.NewObject.DataTableToArrayList(dt);
|
|
|
//}
|
|
|
/// <summary>
|
|
|
/// 根据客户产线查询车型
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> GetMode_type(string CustPDLine)
|
|
|
{
|
|
|
return repository.GetMode_type(CustPDLine);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据车型编号查询座椅配置
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> GetModelList(int ModelType)
|
|
|
{
|
|
|
return repository.GetModelList(ModelType);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取班次
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> Getshift()
|
|
|
{
|
|
|
return repository.Getshift();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取生产类型
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> GetProdType()
|
|
|
{
|
|
|
return repository.GetProdType();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据配置编号获取总成清单
|
|
|
/// </summary>
|
|
|
/// <param name="modelID">配置编号</param>
|
|
|
/// <returns>总成清单</returns>
|
|
|
public List<SysBom> GetBomDetail(int modelID)
|
|
|
{
|
|
|
return repository.GetBomDetail(modelID);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据配置编号获取总成清单
|
|
|
/// </summary>
|
|
|
/// <param name="modelID">配置编号</param>
|
|
|
/// <returns>总成清单</returns>
|
|
|
public List<SysBom> GetBomDetailTable(int modelID)
|
|
|
{
|
|
|
return repository.GetBomDetail(modelID);
|
|
|
}
|
|
|
|
|
|
//库存插单保存按钮
|
|
|
public bool isExist(string order_no)
|
|
|
{
|
|
|
return repository.isExist(order_no);
|
|
|
}
|
|
|
|
|
|
//加载单据编号
|
|
|
public string GetOrderNo(string stockOrder, string p)
|
|
|
{
|
|
|
return repository.GetOrderNo(stockOrder, p);
|
|
|
}
|
|
|
|
|
|
public bool Insert_g_stock_order(GStockOrder order)
|
|
|
{
|
|
|
return repository.Insert_g_stock_order(order);
|
|
|
|
|
|
}
|
|
|
|
|
|
public bool Insert_g_stock_order_detail(GStockOrderDetail modelparams)
|
|
|
{
|
|
|
return repository.Insert_g_stock_order_detail(modelparams);
|
|
|
}
|
|
|
|
|
|
///<summary>
|
|
|
/// 调用存储过程 dbo.sys_release_stock_order 释放生产指令
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public string ReleaseStockOrder(string order_no)
|
|
|
{
|
|
|
return repository.ReleaseStockOrder(order_no);
|
|
|
}
|
|
|
|
|
|
///<summary>
|
|
|
/// 调用存储过程 dbo.sys_assign_stock_order 分配虚拟料架
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public string AssignStockOrder(string custPDLine)
|
|
|
{
|
|
|
return repository.AssignStockOrder(custPDLine);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取要打印的条码数据(前排)
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<GHtWorkorderSn> GetSN(string orderNo)
|
|
|
{
|
|
|
return repository.GetSN(orderNo);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 更新条码的打印状态
|
|
|
/// </summary>
|
|
|
/// <param name="serialNumber">条码</param>
|
|
|
/// <returns>是否成功</returns>
|
|
|
//public bool UpdateSNPrintStatus(string serialNumber)
|
|
|
//{
|
|
|
// return repository.UpdateSNPrintStatus(serialNumber);
|
|
|
//}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取要打印的条码数据(后排)
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<GWorkorderSn> GetBackSN(string orderNo)
|
|
|
{
|
|
|
return repository.GetBackSN(orderNo);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 初始化全局的静态变量
|
|
|
/// </summary>
|
|
|
/// <param name="proxy"></param>
|
|
|
public string TrayPagePrintCount(string param)
|
|
|
{
|
|
|
return repository.TrayPagePrintCount(param);
|
|
|
}
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
//条码补打
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取补打信息
|
|
|
/// </summary>
|
|
|
/// <param name="serialNumber">过程条码 OR 合格证条码</param>
|
|
|
/// <returns></returns>
|
|
|
public List<GWorkorderSn> GetReprintDataBySN(string type, string serialNumber, int count, bool isOrderByInLineTime)
|
|
|
{
|
|
|
return repository.GetReprintDataBySN(type, serialNumber, count, isOrderByInLineTime);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 更新条码的补打状态
|
|
|
/// </summary>
|
|
|
/// <param name="sn">条码</param>
|
|
|
/// <returns>是否更新成功</returns>
|
|
|
public bool UpdateSNReprintStatus(string serialNumber)
|
|
|
{
|
|
|
return repository.UpdateSNReprintStatus(serialNumber);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取要 打印过程条码 信息
|
|
|
/// </summary>
|
|
|
/// <param name="serialNumber"></param>
|
|
|
//public void PrintSerialNumber(string serialNumber)
|
|
|
public List<GWorkorderSn> PrintSerialNumber(string serialNumber)
|
|
|
{
|
|
|
return repository.PrintSerialNumber(serialNumber);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据配置编号获取过程条码打印的张数
|
|
|
/// </summary>
|
|
|
public int GetModelBarcodeCount(string serialNumber)
|
|
|
{
|
|
|
return repository.GetModelBarcodeCount(serialNumber);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 更新条码的打印状态
|
|
|
/// </summary>
|
|
|
/// <param name="serialNumber">条码</param>
|
|
|
/// <returns>是否成功</returns>
|
|
|
public bool UpdateSNPrintStatus(string serialNumber,string userId)
|
|
|
{
|
|
|
return repository.UpdateSNPrintStatus(serialNumber, userId);
|
|
|
}
|
|
|
|
|
|
// 打印合格证
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据配置编号获取合格证条码打印的张数
|
|
|
/// </summary>
|
|
|
public int GetModelQACount(string serialNumber)
|
|
|
{
|
|
|
return repository.GetModelQACount(serialNumber);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据零件号查询零件ID
|
|
|
/// </summary>
|
|
|
public int getPartId(string partNo)
|
|
|
{
|
|
|
return repository.getPartId(partNo);
|
|
|
}
|
|
|
|
|
|
//打印后排的的合格证条码
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据条码获取对应后排条码的打印信息
|
|
|
/// </summary>
|
|
|
/// <param name="serialNumber">条码</param>
|
|
|
/// <returns>后排条码的打印信息</returns>
|
|
|
public List<GWorkorderSn> GetBackSNs(string serialNumber)
|
|
|
{
|
|
|
return repository.GetBackSNs(serialNumber);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|