You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
246 lines
8.1 KiB
246 lines
8.1 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using ICSSoft.Frame.Data.DAL;
|
|
using ICSSoft.Frame.Data.Entity;
|
|
|
|
namespace ICSSoft.Frame.Data.BLL
|
|
{
|
|
public class ICSITEMLOTBLL
|
|
{
|
|
#region AddandEdit
|
|
public static void AddandEdit(ICSITEMLot itemlot, string Appconstr)
|
|
{
|
|
try
|
|
{
|
|
ICSITEMLOTDAL.Add(itemlot, Appconstr);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region delete
|
|
public static void delete(List<String> guidList, string dsconn)
|
|
{
|
|
ICSITEMLOTDAL.deleteInfo(guidList, dsconn);
|
|
}
|
|
#endregion
|
|
|
|
#region Detaildelete
|
|
public static void Detaildelete(List<String> guidList, string dsconn)
|
|
{
|
|
ICSITEMLOTDAL.DetaildeleteInfo(guidList, dsconn);
|
|
}
|
|
#endregion
|
|
|
|
#region DetailAddandEdit
|
|
public static void DetailAddandEdit(ICSITEMLotDetail itemlot, string Appconstr)
|
|
{
|
|
try
|
|
{
|
|
ICSITEMLOTDAL.DetailADD(itemlot, Appconstr);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
public static void InsertINV(string NO, string code, int count)
|
|
{
|
|
ICSITEMLOTDAL.insert(NO, code, count);
|
|
}
|
|
|
|
public static void DeleteINV(string NO, string code, int count)
|
|
{
|
|
ICSITEMLOTDAL.delete(NO, code, count);
|
|
}
|
|
/// <summary>
|
|
/// 获取条码状态
|
|
/// </summary>
|
|
/// <param name="lotNo"></param>
|
|
/// <param name="workpointCode"></param>
|
|
/// <returns></returns>
|
|
public static string CheckLotNo(string lotNo, string workpointCode, string dsconn)
|
|
{
|
|
string errormessage = "";
|
|
DataTable dt = ICSITEMLOTDAL.CheckLotNO(lotNo, workpointCode, dsconn);
|
|
if (dt.Rows.Count == 0)
|
|
{
|
|
errormessage = "条码不存在!";
|
|
}
|
|
else
|
|
{
|
|
if (dt.Rows[0]["TYPE"].ToString() != "采购原料" && dt.Rows[0]["TYPE"].ToString() != "原材料")
|
|
{
|
|
errormessage = "条码不是采购条码,不能进行到货扫描!";
|
|
}
|
|
else if (dt.Rows[0]["BarCode"].ToString() != "" && dt.Rows[0]["BarCode"].ToString() != null)
|
|
{
|
|
errormessage = "条码已经上架!";
|
|
}
|
|
else
|
|
{
|
|
errormessage = "1";
|
|
}
|
|
}
|
|
string result = "";
|
|
if (errormessage == "1")
|
|
{
|
|
result = string.Format("{{\"code\":\"0\",\"msg\":\" \"}}");
|
|
}
|
|
else
|
|
{
|
|
result = string.Format("{{\"code\":\"1\",\"msg\":\"{0}\"}}", errormessage);
|
|
}
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// 验证ASN单信息
|
|
/// </summary>
|
|
/// <param name="lotNo"></param>
|
|
/// <param name="workpointCode"></param>
|
|
/// <param name="dsconn"></param>
|
|
/// <returns></returns>
|
|
public static string CheckASNNo(string lotNo, string workpointCode, string dsconn)
|
|
{
|
|
string errormessage = "";
|
|
DataTable dt = ICSITEMLOTDAL.CheckASNNO(lotNo, workpointCode, dsconn);
|
|
if (dt.Rows.Count == 0)
|
|
{
|
|
errormessage = "ASN单不存在!";
|
|
}
|
|
else
|
|
{
|
|
errormessage = "1";
|
|
}
|
|
string result = "";
|
|
if (errormessage == "1")
|
|
{
|
|
result = string.Format("{{\"code\":\"0\",\"msg\":\" \"}}");
|
|
}
|
|
else
|
|
{
|
|
result = string.Format("{{\"code\":\"1\",\"msg\":\"{0}\"}}", errormessage);
|
|
}
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// 验证编码信息
|
|
/// </summary>
|
|
/// <param name="lotNo"></param>
|
|
/// <param name="workpointCode"></param>
|
|
/// <param name="dsconn"></param>
|
|
/// <returns></returns>
|
|
public static string CheckLOTNum(string INVCode, string workpointCode, string dsconn)
|
|
{
|
|
string errormessage = "";
|
|
DataTable dt = ICSITEMLOTDAL.CheckLOTNum(INVCode, workpointCode, dsconn);
|
|
if (dt.Rows.Count == 0)
|
|
{
|
|
errormessage = "此编码对应物料不存在!";
|
|
}
|
|
else
|
|
{
|
|
errormessage = "1";
|
|
}
|
|
string result = "";
|
|
if (errormessage == "1")
|
|
{
|
|
result = string.Format("{{\"code\":\"0\",\"msg\":\" \"}}");
|
|
}
|
|
else
|
|
{
|
|
result = string.Format("{{\"code\":\"1\",\"msg\":\"{0}\"}}", errormessage);
|
|
}
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// 获取条码信息
|
|
/// </summary>
|
|
/// <param name="barCode"></param>
|
|
/// <param name="workpointCode"></param>
|
|
/// <returns></returns>
|
|
public static DataTable GetLotData(string barCode, string workpointCode, string dsconn)
|
|
{
|
|
DataTable dt = ICSITEMLOTDAL.GetLotData(barCode, workpointCode, dsconn);
|
|
return dt;
|
|
}
|
|
/// <summary>
|
|
/// 获取条码信息
|
|
/// </summary>
|
|
/// <param name="barCode"></param>
|
|
/// <param name="workpointCode"></param>
|
|
/// <returns></returns>
|
|
public static DataTable GetLotDataForPO(string barCode, string workpointCode, string dsconn)
|
|
{
|
|
DataTable dt = ICSITEMLOTDAL.GetLotDataForPO(barCode, workpointCode, dsconn);
|
|
return dt;
|
|
}
|
|
/// <summary>
|
|
/// 获取条码信息(半成品入库)
|
|
/// </summary>
|
|
/// <param name="barCode"></param>
|
|
/// <param name="workpointCode"></param>
|
|
/// <param name="dsconn"></param>
|
|
/// <returns></returns>
|
|
public static DataTable GetLotDataForMo(string barCode, string workpointCode, string dsconn)
|
|
{
|
|
DataTable dt = ICSITEMLOTDAL.GetLotDataForMO(barCode, workpointCode, dsconn);
|
|
return dt;
|
|
}
|
|
/// <summary>
|
|
/// 获取条码信息
|
|
/// </summary>
|
|
/// <param name="barCode"></param>
|
|
/// <param name="workpintCode"></param>
|
|
/// <param name="dsconn"></param>
|
|
/// <returns></returns>
|
|
public static DataTable GetLotNumData(string INVCode, string workpointCode, string dsconn)
|
|
{
|
|
DataTable dt = ICSITEMLOTDAL.GetLotNumData(INVCode, workpointCode, dsconn);
|
|
return dt;
|
|
}
|
|
/// <summary>
|
|
/// 获取ASN单信息(半成品入库)
|
|
/// </summary>
|
|
/// <param name="barCode"></param>
|
|
/// <param name="workpointCode"></param>
|
|
/// <param name="dsconn"></param>
|
|
/// <returns></returns>
|
|
public static DataTable GetASNDataForMO(string barCode, string workpointCode, string dsconn)
|
|
{
|
|
DataTable dt = ICSITEMLOTDAL.GetASNDataForMO(barCode, workpointCode, dsconn);
|
|
return dt;
|
|
}
|
|
#region 生成到货单
|
|
public static string CreateRCV(List<FormICSRSVDataModel.RCVData> rcv, string connection, out string docno, out string user, out string time)
|
|
{
|
|
try
|
|
{
|
|
string result = "";
|
|
string errormessage = ICSITEMLOTDAL.CreateRCV(rcv, connection, out docno, out user, out time);
|
|
if (errormessage == "OK")
|
|
{
|
|
result = string.Format("{{\"code\":\"0\",\"msg\":\" \"}}");
|
|
}
|
|
else
|
|
{
|
|
result = string.Format("{{\"code\":\"1\",\"msg\":\"{0}\"}}", errormessage);
|
|
}
|
|
return result;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|