162 lines
6.7 KiB
C#
162 lines
6.7 KiB
C#
using Epost.Common;
|
||
using Epost.Model;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Configuration;
|
||
using System.Data;
|
||
using System.Data.OracleClient;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
using static Epost.Common.LogHelper;
|
||
|
||
namespace Epost.DAL
|
||
{
|
||
public class WmsDAL
|
||
{
|
||
DB_Oracle DB_Oracle = new DB_Oracle();
|
||
DataBaseOpration.OprationOraDAL MidDB;
|
||
|
||
public WmsDAL()
|
||
{
|
||
MidDB = DB_Oracle.GetInstance();
|
||
}
|
||
#region 查询条码对照列表
|
||
public DataTable SkuList()
|
||
{
|
||
try
|
||
{
|
||
string sql = string.Format("select * from tdas_sortplu");
|
||
|
||
return MidDB.GetsqlForDT(sql);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
|
||
LogHelper.WriteLogInfo("查询WMSSKU列表异常:" + ex.Message);
|
||
return null;
|
||
}
|
||
|
||
}
|
||
#endregion
|
||
#region 修改wms数据为已完成拣货
|
||
|
||
public bool UpWmsOrdersState(string matchid)
|
||
{
|
||
|
||
try
|
||
{
|
||
string state = "03";
|
||
|
||
string sql = string.Format("update idx_puttolight set TaskProcess='{0}' where TaskProcess = '02' and RELEASEFLAG = 'Y' and tasktype='ST' and FIRSTSEGTRACEID='{1}'",
|
||
state,
|
||
matchid);
|
||
LogHelper.WriteLogInfo("修改wms数据为已开始拣货" + sql);
|
||
long x = MidDB.UpdateSql(sql);
|
||
if (x > 0)
|
||
return true;
|
||
return false;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(GetType(), "UpWmsOrdersState_Error:" + ex.Message);
|
||
return false;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 调用存储过程解析sku
|
||
public string getSku(string barcode)
|
||
{
|
||
try
|
||
{
|
||
|
||
|
||
LogHelper.WriteLogInfo("调用存储过程", Log_Type.JOB_DONE);
|
||
OracleParameter[] paras = new OracleParameter[27];//----------
|
||
paras[0] = new OracleParameter("IN_Warehouse", OracleType.NVarChar,10);
|
||
paras[0].Value = "";
|
||
paras[1] = new OracleParameter("IN_Operation", OracleType.NVarChar, 10);
|
||
paras[1].Value = "";
|
||
paras[2] = new OracleParameter("IN_Para1", OracleType.NVarChar, 10);
|
||
paras[2].Value = "DPS_SORT";
|
||
paras[3] = new OracleParameter("IN_Para2", OracleType.NVarChar, 10);
|
||
paras[3].Value = "";
|
||
paras[4] = new OracleParameter("IN_CustomerID", OracleType.NVarChar, 10);
|
||
paras[4].Value = "";
|
||
paras[5] = new OracleParameter("IN_SupplierID", OracleType.NVarChar, 10);
|
||
paras[5].Value = "";
|
||
paras[6] = new OracleParameter("IN_Barcode", OracleType.NVarChar, 10);
|
||
paras[6].Value = barcode;
|
||
paras[7] = new OracleParameter("IN_Language", OracleType.NVarChar, 10);
|
||
paras[7].Value = "cn";
|
||
paras[8] = new OracleParameter("IN_UserID", OracleType.NVarChar, 10);
|
||
paras[8].Value = "wpsadmin";
|
||
|
||
//回参
|
||
paras[9] = new OracleParameter("IN_SKU", OracleType.NVarChar, 10);
|
||
paras[9].Direction = ParameterDirection.Output;
|
||
paras[10] = new OracleParameter("IN_Qty", OracleType.NVarChar, 10);
|
||
paras[10].Direction = ParameterDirection.Output;
|
||
paras[11] = new OracleParameter("IN_TraceID", OracleType.NVarChar, 10);
|
||
paras[11].Direction = ParameterDirection.Output;
|
||
paras[12] = new OracleParameter("IN_LotAtt01", OracleType.NVarChar, 10);
|
||
paras[12].Direction = ParameterDirection.Output;
|
||
paras[13] = new OracleParameter("IN_LotAtt02", OracleType.NVarChar, 10);
|
||
paras[13].Direction = ParameterDirection.Output;
|
||
paras[14] = new OracleParameter("IN_LotAtt03", OracleType.NVarChar, 10);
|
||
paras[14].Direction = ParameterDirection.Output;
|
||
paras[15] = new OracleParameter("IN_LotAtt04", OracleType.NVarChar, 10);
|
||
paras[15].Direction = ParameterDirection.Output;
|
||
paras[16] = new OracleParameter("IN_LotAtt05", OracleType.NVarChar, 10);
|
||
paras[16].Direction = ParameterDirection.Output;
|
||
paras[17] = new OracleParameter("IN_LotAtt06", OracleType.NVarChar, 10);
|
||
paras[17].Direction = ParameterDirection.Output;
|
||
paras[18] = new OracleParameter("IN_LotAtt07", OracleType.NVarChar, 10);
|
||
paras[18].Direction = ParameterDirection.Output;
|
||
paras[19] = new OracleParameter("IN_LotAtt08", OracleType.NVarChar, 10);
|
||
paras[19].Direction = ParameterDirection.Output;
|
||
paras[20] = new OracleParameter("IN_LotAtt09", OracleType.NVarChar, 10);
|
||
paras[20].Direction = ParameterDirection.Output;
|
||
paras[21] = new OracleParameter("IN_LotAtt10", OracleType.NVarChar, 10);
|
||
paras[21].Direction = ParameterDirection.Output;
|
||
paras[22] = new OracleParameter("IN_LotAtt11", OracleType.NVarChar, 10);
|
||
paras[22].Direction = ParameterDirection.Output;
|
||
paras[23] = new OracleParameter("IN_LotAtt12", OracleType.NVarChar, 10);
|
||
paras[23] = new OracleParameter("IN_Asnno", OracleType.NVarChar);
|
||
paras[24] = new OracleParameter("IN_AsnLineno", OracleType.NVarChar, 10);
|
||
paras[24].Direction = ParameterDirection.Output;
|
||
paras[25] = new OracleParameter("In_serialNo", OracleType.NVarChar, 10);
|
||
paras[25].Direction = ParameterDirection.Output;
|
||
paras[26] = new OracleParameter("OUT_Return_Code", OracleType.NVarChar, 10);
|
||
paras[26].Direction = ParameterDirection.Output;
|
||
|
||
string x = OrcaleDB.ExecuteNonQueryProd(CommandType.StoredProcedure, "SPCOM_SKUBarcodeAnalyzer", paras);
|
||
string str = string.Empty;
|
||
if (x !="1")
|
||
{
|
||
str = "成功!";
|
||
}
|
||
else
|
||
{
|
||
str = "失败";
|
||
}
|
||
LogHelper.WriteLogInfo("调用存储过程返回结果1:" + x + str , Log_Type.JOB_DONE);
|
||
return x;
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
|
||
LogHelper.WriteLogInfo("调用存储过程失败:" + ex.Message);
|
||
return "1";
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
|
||
|
||
|
||
}
|
||
}
|