BaoKai_202508_Wms_Jingwang_.../WMS.SqlServerData/BaseData/StorageAreaLocationData.cs
2025-08-24 21:52:42 +08:00

521 lines
31 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WMS.IData;using Oracle.ManagedDataAccess.Client;
using System.Data;
using WMS.DBUtility;
using WMS.Model.Base;
using WMS.IData.IBase;
using Oracle.ManagedDataAccess.Client;
namespace WMS.SqlServerData.BaseData
{
public class StorageAreaLocationData :IStorageAreaLocation
{//主键仓库ID、库位ID
/// <summary>
/// 根据库位获取高度
/// </summary>
/// <param name="locid"></param>
/// <returns></returns>
public DataTable GetLocHgh(string locid,string STORAGE_ID)
{
string sqlStr = " select LOCATION_HEIGHT from T_BASE_STORAGE_AREA_LOCATION where LOCATION_ID='" + locid+ "' and STORAGE_ID='"+ STORAGE_ID + "'";
return SystemDataObject.Instance.GetDataTable(sqlStr);
}
public void UpdateLocSts(string loc, string sts)
{
string sqlStr = "update T_BASE_STORAGE_AREA_LOCATION set STATUS='" + sts + "' where LOCATION_ID='" + loc + "' ";
SystemDataObject.Instance.ExecuteSql(sqlStr);
}
/// <summary>
/// 更改库位的容积,长,高
/// </summary>
/// <param name="mData"></param>
public void UpdateLoc(StorageAreaLocationModel mData)
{
string sqlStr = "update T_BASE_STORAGE_AREA_LOCATION " +
"set LOCATION_LONG = '"+ mData .LOCATION_LONG+ "'," +
" LOCATION_HEIGHT = '" + mData.LOCATION_HEIGHT + "', " +
"LOCATION_WIDTH = '" + mData.LOCATION_WIDTH + "', " +
"HASVOLUME = '" + mData.HASVOLUME + "', ABC_ID = '" + mData.ABC_ID + "', " +
"BEARWEIGHT = '" + mData.BEARWEIGHT + "' where LOCATION_ID = '" + mData.LOCATION_ID + "' ";
SystemDataObject.Instance.ExecuteSql(sqlStr);
}
public DataTable GetCtLocData(string STORAGE_ID,string locId )
{
string sqlStr = "select count(*)a from T_BASE_STORAGE_AREA_LOCATION where STORAGE_ID ='"+ STORAGE_ID + "' and LOCATION_ID='"+locId+"' ";
return SystemDataObject.Instance.GetDataTable(sqlStr);
}
public DataTable GetLocData(string decid, string row)
{
string sqlStr = @"
select * from (select location_id,row1,cln,layer1, '2' as Status ,sort,decId,STORAGE_ID,LOCATION_HEIGHT,REMARK,depth
from T_BASE_STORAGE_AREA_LOCATION where location_id in (select location_id from T_MI_STOCK )
union all
select location_id, row1, cln, layer1, Status, sort, decId,STORAGE_ID,LOCATION_HEIGHT,REMARK,depth
from T_BASE_STORAGE_AREA_LOCATION where location_id not in (select location_id from T_MI_STOCK )) a"; // and layer='"+ row + "'
return SystemDataObject.Instance.GetDataTable(sqlStr.ToString());
}
public DataSet GetTableDecId(string decId,string STORAGE_ID)
{
string sqlStr =@" select * from t_base_storage_area_location where decid='"+decId+"';select sts from t_decname where decid='"+decId+ "' and STORAGE_ID='"+ STORAGE_ID + "'";
return SystemDataObject.Instance.GetDataSet(sqlStr);
}
public void UpdateAgeId(string STORAGE_AREA_ID,string locID)
{
string sqlstr =@"update T_BASE_STORAGE_AREA_LOCATION set STORAGE_AREA_ID='"+ STORAGE_AREA_ID + "' where LOCATION_ID='" + locID + "' ";
SystemDataObject.Instance.ExecuteSql(sqlstr);
}
public DataTable GetLocationStatus(string hgh)
{
string sqlStr =@"select row1,cln,layer1,LOCATION_ID,LOCATION_HEIGHT
from t_base_storage_area_location
where status = '0' and LOCATION_HEIGHT >= " + hgh + " order by sort ";
return SystemDataObject.Instance.GetDataTable(sqlStr);
}
/// <summary>
/// 获取开始库位和结束库位
/// </summary>
/// <param name="strAreaInfoID"></param>
/// <returns></returns>
public DataTable GetLocationInfoBeginEnd(string staorgid,string strAreaInfoID)
{
string sqlStr =@"select t.location_id, t.sort,t.hasvolume,t.volume
from t_base_storage_area_location t
join T_BASE_LOC_AREA a
on t.location_id = a.location_id
where status = '0' and t.storage_id =
'" + staorgid + "' and a.storage_area_id = '" + strAreaInfoID + "' order by convert(int,t.location_id) ";
return SystemDataObject.Instance.GetDataTable(sqlStr);
}
/// <summary>
/// 获取库位信息结果集
/// </summary>
/// <param name="locationInfoModel">库位信息</param>
/// <returns>库位信息结果集</returns>
public DataTable GetLocationInfoDS(StorageAreaLocationModel locationInfoModel)
{
StringBuilder sqlBuilder = new StringBuilder();
sqlBuilder.AppendLine("select ");
sqlBuilder.AppendLine(" c.LOCATION_ID , --库位编号 ");
//sqlBuilder.AppendLine(" c.location_name , --库位名称 ");
//sqlBuilder.AppendLine(" c.location_short_name , --库位简称 ");
sqlBuilder.AppendLine(" c.py_name , --拼音简称 ");
sqlBuilder.AppendLine(" c.storage_id , --所属仓库 外键 ");
//sqlBuilder.AppendLine(" c.storage_area_id , --所属库区 外键 ");
sqlBuilder.AppendLine(" (case c.islock when '1' then '是' when '0' then '否' else '其他' end) islock , --有锁 0否 1是 ");
sqlBuilder.AppendLine(" c.location_long , --长 ");
sqlBuilder.AppendLine(" c.location_width , --宽 ");
sqlBuilder.AppendLine(" c.location_height ,--高 ");
sqlBuilder.AppendLine(" c.volume , --容积 ");
sqlBuilder.AppendLine(" c.hasvolume , --已占用容积 ");
sqlBuilder.AppendLine(" c.bearweight , --承载重量 ");
sqlBuilder.AppendLine(" c.abc_id , --ABC分类 ");
sqlBuilder.AppendLine(" c.sort , --排序 ");
sqlBuilder.AppendLine(" (case c.status when '1' then '停用' when '0' then '正常' else '其他' end) status , --状态 0正常 1停用");
sqlBuilder.AppendLine(" ISNULL(c.remark,' ') remark ,--备注 ");
sqlBuilder.AppendLine(" c.version , --版本号 ");
sqlBuilder.AppendLine(" m.STORAGE_AREA_NAME , --所属库区 ");
sqlBuilder.AppendLine(" b.STORAGE_NAME, --所属仓库 ");
sqlBuilder.AppendLine(" c.operatorid, --操作人 ");
sqlBuilder.AppendLine(" c.operatedate, --操作日期 ");
sqlBuilder.AppendLine("c.row1,c.cln,c.layer1,a.STORAGE_AREA_ID from ");
sqlBuilder.AppendLine(" T_BASE_STORAGE_AREA_LOCATION c left join T_BASE_LOC_AREA a on c.location_id = a.location_id ");
sqlBuilder.AppendLine(" left join t_base_storageinfo b on c.storage_id = b.storage_id left join T_BASE_STORAGE_AREA m on c.STORAGE_ID=m.STORAGE_AREA_ID");
sqlBuilder.AppendLine("where ");
sqlBuilder.AppendLine(" 1=1 ");
if (!string.IsNullOrEmpty(locationInfoModel.LOCATION_ID))
{
sqlBuilder.AppendLine(" and c.LOCATION_ID = '" + locationInfoModel.LOCATION_ID + "'");
}
if (!string.IsNullOrEmpty(locationInfoModel.STORAGE_AREA_ID))
{
//算上其子库区的库位
//string sqlStr =@"select b.storage_area_id from T_BASE_STORAGE_AREA a left join T_BASE_STORAGE_AREA b on a.storage_area_id = b.parent_id where a.storage_area_id = '" + locationInfoModel.STORAGE_AREA_ID + "'";
//DataTable temp = SystemDataObject.Instance.GetDataTable(sqlStr);
//if (string.IsNullOrEmpty(temp.Rows[0][0].ToString()))
//{
sqlBuilder.AppendLine(" and a.STORAGE_AREA_ID = '" + locationInfoModel.STORAGE_AREA_ID + "'");
//}
//else {
// sqlBuilder.AppendLine(" and (a.STORAGE_AREA_ID = '" + locationInfoModel.STORAGE_AREA_ID + "' or a.STORAGE_AREA_ID = '" + temp.Rows[0][0].ToString() + "' )");
//}
}
if (!string.IsNullOrEmpty(locationInfoModel.STATUS))
{
sqlBuilder.AppendLine(" and c.STATUS = '" + locationInfoModel.STATUS + "'");
}
sqlBuilder.AppendLine(" order by c.sort,c.storage_id,c.location_id");
return SystemDataObject.Instance.GetDataTable(sqlBuilder.ToString());
}
/// <summary>
/// 获取库位信息结果集
/// </summary>
/// <param name="locationInfoModel">库位信息</param>
/// <returns>库位信息结果集</returns>
public DataTable GetLocationInfoDS()
{
StringBuilder sqlBuilder = new StringBuilder();
sqlBuilder.AppendLine("select ");
sqlBuilder.AppendLine(" c.location_id , --库位编号 ");
//sqlBuilder.AppendLine(" c.location_name , --库位名称 ");
//sqlBuilder.AppendLine(" c.location_short_name , --库位简称 ");
sqlBuilder.AppendLine(" c.py_name , --拼音简称 ");
sqlBuilder.AppendLine(" c.storage_id , --所属仓库 外键 ");
//sqlBuilder.AppendLine(" c.storage_area_id , --所属库区 外键 ");
sqlBuilder.AppendLine(" (case c.islock when '1' then '是' when '0' then '否' else '其他' end) islock , --有锁 0否 1是 ");
sqlBuilder.AppendLine(" c.location_long , --长 ");
sqlBuilder.AppendLine(" c.location_width , --宽 ");
sqlBuilder.AppendLine(" c.location_height , --高 ");
sqlBuilder.AppendLine(" c.volume , --容积 ");
sqlBuilder.AppendLine(" c.hasvolume , --已占用容积 ");
sqlBuilder.AppendLine(" c.bearweight , --承载重量 ");
sqlBuilder.AppendLine(" c.abc_id , --ABC分类 ");
sqlBuilder.AppendLine(" c.sort , --排序 ");
sqlBuilder.AppendLine(" c.Status, --Status 0正常 1停用");
sqlBuilder.AppendLine(" ISNULL(c.remark,' ') remark ,--备注 ");
sqlBuilder.AppendLine(" c.version , --版本号 ");
//sqlBuilder.AppendLine(" a.STORAGE_AREA_NAME --所属库区 ");
sqlBuilder.AppendLine(" c.operatorid, --操作人 ");
sqlBuilder.AppendLine(" c.operatedate , --操作日期 ");
sqlBuilder.AppendLine(" c.row1, --所属仓库 ");
sqlBuilder.AppendLine(" c.cln, --操作人 ");
sqlBuilder.AppendLine(" c.layer1 , --操作日期 ");
sqlBuilder.AppendLine(" c.decId, --所属仓库 ");
sqlBuilder.AppendLine(" c.instand --操作人 ");
sqlBuilder.AppendLine("from ");
sqlBuilder.AppendLine(" T_BASE_STORAGE_AREA_LOCATION c ");
sqlBuilder.AppendLine("where ");
sqlBuilder.AppendLine(" 1=1 ");
sqlBuilder.AppendLine(" order by c.STATUS desc,SORT");
return SystemDataObject.Instance.GetDataTable(sqlBuilder.ToString());
}
public DataTable GetLocStsData(string decID)
{
string sqlStr = @"select * from (select islock,location_id,row1,cln,layer1, '2' as Status ,sort,decId,STORAGE_ID,LOCATION_HEIGHT,DEPTH
from T_BASE_STORAGE_AREA_LOCATION where location_id in (select location_id from T_MI_STOCK )
union all
select islock,location_id, row1, cln, layer1, Status, sort, decId,STORAGE_ID,LOCATION_HEIGHT,DEPTH
from T_BASE_STORAGE_AREA_LOCATION where location_id not in (select location_id from T_MI_STOCK )) a order by a.cln asc, a.row1 asc,a.layer1 asc";
return SystemDataObject.Instance.GetDataTable(sqlStr.ToString());
}
#region
public void UpdLocationInfo(StorageAreaLocationModel locationInfoModel)
{
string sqlstr =@"update
T_BASE_STORAGE_AREA_LOCATION
set
py_name =:py_name ,
islock =:islock ,
location_long =:location_long ,
location_width =:location_width ,
location_height =:location_height ,
volume =:volume ,
hasvolume =:hasvolume ,
bearweight =:bearweight ,
abc_id =:abc_id ,
sort =:sort ,
status =:status ,
remark =:remark ,
version =:version ,
operatorid =:operatorid ,
operatedate =getdate()
where
storage_id =:storage_id and
location_id =:location_id ";
OracleParameter[] parameter = new OracleParameter[]
{
new OracleParameter(":py_name",OracleDbType.Varchar2),
//new OracleParameter("storage_area_id",OracleDbType.Varchar2),
new OracleParameter(":islock",OracleDbType.Varchar2),
new OracleParameter(":location_long",OracleDbType.Decimal),
new OracleParameter(":location_width",OracleDbType.Decimal),
new OracleParameter(":location_height",OracleDbType.Decimal),
new OracleParameter(":volume",OracleDbType.Decimal),
new OracleParameter(":hasvolume",OracleDbType.Decimal),
new OracleParameter(":bearweight",OracleDbType.Decimal),
new OracleParameter(":abc_id",OracleDbType.Varchar2),
new OracleParameter(":sort",OracleDbType.Decimal),
new OracleParameter(":status",OracleDbType.Varchar2),
new OracleParameter(":remark",OracleDbType.Varchar2),
new OracleParameter(":version",OracleDbType.Varchar2),
new OracleParameter(":operatorid",OracleDbType.Varchar2),
new OracleParameter(":storage_id",OracleDbType.Varchar2),
new OracleParameter(":location_id",OracleDbType.Varchar2)
};
parameter[0].Value = locationInfoModel.PY_NAME;
//parameter[2].Value = locationInfoModel.STORAGE_AREA_ID;
parameter[1].Value = locationInfoModel.ISLOCK;
parameter[2].Value = locationInfoModel.LOCATION_LONG;
parameter[3].Value = locationInfoModel.LOCATION_WIDTH;
parameter[4].Value = locationInfoModel.LOCATION_HEIGHT;
parameter[5].Value = locationInfoModel.VOLUME;
parameter[6].Value = locationInfoModel.HASVOLUME;
parameter[7].Value = locationInfoModel.BEARWEIGHT;
parameter[8].Value = locationInfoModel.ABC_ID;
parameter[9].Value = locationInfoModel.SORT;
parameter[10].Value = locationInfoModel.STATUS;
parameter[11].Value = locationInfoModel.REMARK;
parameter[12].Value = locationInfoModel.VERSION;
parameter[13].Value = locationInfoModel.OPERATORID;
parameter[14].Value = locationInfoModel.STORAGE_ID;
parameter[15].Value = locationInfoModel.LOCATION_ID;
SystemDataObject.Instance.ExecuteSql(sqlstr, parameter);
}
/// <summary>
/// 插入或修改库位信息
/// </summary>
/// <param name="locationInfoModel">库位信息</param>
/// <param name="flag">flag 操作标示符 0新增 1:修改</param>
public void InsLocationInfo(StorageAreaLocationModel locationInfoModel)
{
string sqlstr = " insert into T_BASE_STORAGE_AREA_LOCATION" +
" (location_id,py_name,storage_id,islock,location_long,location_width,location_height" +
" ,volume,hasvolume,bearweight,abc_id,sort," +
" status,remark,version,operatorid,decId,instand,outStand,inline,outLine,row1,cln,layer1)" +
" values ( '" + locationInfoModel.LOCATION_ID + "', '" + locationInfoModel.PY_NAME + "','" + locationInfoModel.STORAGE_ID + "'," +
" '" + locationInfoModel.ISLOCK + "' ,'" + locationInfoModel.LOCATION_LONG + "','" + locationInfoModel.LOCATION_WIDTH + "'," +
" '" + locationInfoModel.LOCATION_HEIGHT + "', '" + locationInfoModel.VOLUME + "','" + locationInfoModel.HASVOLUME + "'," +
" '" + locationInfoModel.BEARWEIGHT + "','" + locationInfoModel.ABC_ID + "', " +
"'" + locationInfoModel.SORT + "','" + locationInfoModel.STATUS + "','" + locationInfoModel.REMARK + "','" + locationInfoModel.VERSION + "'," +
"'" + locationInfoModel.OPERATORID + "','" + locationInfoModel.decId + "','" + locationInfoModel.instand + "','" + locationInfoModel.outStand + "'," +
"'" + locationInfoModel.inline + "','" + locationInfoModel.outLine + "','" + locationInfoModel.row1 + "','" + locationInfoModel.cln + "','" + locationInfoModel.layer1 +"' )";
// OracleParameter[] parameter = new OracleParameter[]
// {
// new OracleParameter(":location_id",OracleDbType.Varchar2),//1
// new OracleParameter(":py_name",OracleDbType.Varchar2),//2
// new OracleParameter(":storage_id",OracleDbType.Varchar2),//3
// new OracleParameter(":islock",OracleDbType.Varchar2),//4
// new OracleParameter(":location_long",OracleDbType.Decimal),//5
// new OracleParameter(":location_width",OracleDbType.Decimal),//6
// new OracleParameter(":location_height",OracleDbType.Decimal),
// new OracleParameter(":volume",OracleDbType.Decimal),
// new OracleParameter(":hasvolume",OracleDbType.Decimal),
// new OracleParameter(":bearweight",OracleDbType.Decimal),
// new OracleParameter(":abc_id",OracleDbType.Varchar2),
// new OracleParameter(":sort",OracleDbType.Decimal),
// new OracleParameter(":status",OracleDbType.Varchar2),
// new OracleParameter(":remark",OracleDbType.Varchar2),
// new OracleParameter(":version",OracleDbType.Varchar2),
//new OracleParameter(":operatorid",OracleDbType.Varchar2),
// new OracleParameter(":decId",OracleDbType.Varchar2),
// new OracleParameter(":instand",OracleDbType.Varchar2),
// new OracleParameter(":outStand",OracleDbType.Varchar2),
// new OracleParameter(":inline",OracleDbType.Varchar2),
// new OracleParameter(":outLine",OracleDbType.Varchar2),
// new OracleParameter(":row",OracleDbType.Varchar2),
// new OracleParameter(":cln",OracleDbType.Varchar2),
// new OracleParameter(":layer",OracleDbType.Varchar2)
// };
// parameter[0].Value = locationInfoModel.LOCATION_ID;
// parameter[1].Value = locationInfoModel.LOCATION_ID;
// parameter[2].Value = locationInfoModel.STORAGE_ID;
// parameter[3].Value = locationInfoModel.ISLOCK;
// parameter[4].Value = locationInfoModel.LOCATION_LONG;
// parameter[5].Value = locationInfoModel.LOCATION_WIDTH;
// parameter[6].Value = locationInfoModel.LOCATION_HEIGHT;
// parameter[7].Value = locationInfoModel.VOLUME;
// parameter[8].Value = locationInfoModel.HASVOLUME;
// parameter[9].Value = locationInfoModel.BEARWEIGHT;
// parameter[10].Value = locationInfoModel.ABC_ID;
// parameter[11].Value = locationInfoModel.SORT;
// parameter[12].Value = locationInfoModel.STATUS;
// parameter[13].Value = locationInfoModel.REMARK;
// parameter[14].Value = locationInfoModel.VERSION;
// parameter[15].Value = locationInfoModel.OPERATORID;
// parameter[16].Value = locationInfoModel.decId;
// parameter[17].Value = locationInfoModel.instand;
// parameter[18].Value = locationInfoModel.outStand;
// parameter[19].Value = locationInfoModel.inline;
// parameter[20].Value = locationInfoModel.outLine;
// parameter[21].Value = locationInfoModel.row1;
// parameter[22].Value = locationInfoModel.cln;
// parameter[23].Value = locationInfoModel.layer1;
SystemDataObject.Instance.ExecuteSql(sqlstr);
}
#endregion
#region IDID修改某库位已占用体积
/// <summary>
/// 通过仓库ID、库位ID修改某库位已占用体积
/// </summary>
/// <param name="locationInfoModel">库位Model</param>
public void UpdateLocHasVolume(StorageAreaLocationModel locationInfoModel)
{
string sqlstr =@"update
T_BASE_STORAGE_AREA_LOCATION
set
hasvolume=:hasvolume,
operatorid=:operatorid,
operatedate=getdate()
where
storage_id=:storage_id and
location_id=:location_id";
OracleParameter[] parameter = new OracleParameter[]
{
new OracleParameter(":hasvolume",OracleDbType.Decimal),
new OracleParameter(":operatorid",OracleDbType.Varchar2),
new OracleParameter(":storage_id",OracleDbType.Varchar2),
new OracleParameter(":location_id",OracleDbType.Varchar2),
};
parameter[0].Value = locationInfoModel.HASVOLUME;
parameter[1].Value = locationInfoModel.OPERATORID;
parameter[2].Value = locationInfoModel.STORAGE_ID;
parameter[3].Value = locationInfoModel.LOCATION_ID;
SystemDataObject.Instance.ExecuteSql(sqlstr, parameter);
}
#endregion
#region
/// <summary>
/// 根据库位编号、仓库编号删除库位信息
/// </summary>
/// <param name="strLocationInfoId">库位编号</param>
/// <param name="strStorageInfoID">仓库编号</param>
public void DeleteLocationInfo(string strLocationInfoId, string strStorageInfoID)
{
string sqlstr =@"delete from T_BASE_STORAGE_AREA_LOCATION where location_id =:location_id and storage_id =:storage_id";
OracleParameter[] parameter = new OracleParameter[]{
new OracleParameter(":location_id",OracleDbType.Varchar2),
new OracleParameter(":storage_id",OracleDbType.Varchar2),
};
parameter[0].Value = strLocationInfoId;
parameter[1].Value = strStorageInfoID;
SystemDataObject.Instance.ExecuteSql(sqlstr, parameter);
}
#endregion
/// <summary>
/// 根据库区编号删除库位信息
/// </summary>
/// <param name="strAreaInfoID">库区编号</param>
public void DeleteLocationInfoByAreaInfoID(string strAreaInfoID)
{
string sqlstr =@"delete from T_BASE_STORAGE_AREA_LOCATION where location_id in (select location_id from t_base_loc_area where STORAGE_AREA_ID =:storage_area_id)";
OracleParameter[] parameter = new OracleParameter[]{
new OracleParameter(":storage_area_id",OracleDbType.Varchar2),
};
parameter[0].Value = strAreaInfoID;
SystemDataObject.Instance.ExecuteSql(sqlstr, parameter);
}
/// <summary>
/// 根据仓库编号删除库位信息
/// </summary>
/// <param name="strStorageInfoID">仓库编号</param>
public void DeleteLocationInfoByStorageInfoID(string strStorageInfoID) {
string sqlstr =@"delete from T_BASE_STORAGE_AREA_LOCATION where storage_id =:storage_id";
OracleParameter[] parameter = new OracleParameter[]{
new OracleParameter(":storage_id",OracleDbType.Varchar2),
};
parameter[0].Value = strStorageInfoID;
SystemDataObject.Instance.ExecuteSql(sqlstr, parameter);
}
/// <summary>
/// 根据仓库编号停用或启用库位
/// </summary>
/// <param name="strStorageInfoID">仓库编号</param>
/// <param name="flag">0停用1正常</param>
public void CloseLocationInfoByStorageInfoID(string strStorageInfoID,int flag)
{
string sqlstr =@"update T_BASE_STORAGE_AREA_LOCATION set status = '" + flag + "' where storage_id =:storage_id";
OracleParameter[] parameter = new OracleParameter[]{
new OracleParameter(":storage_id",OracleDbType.Varchar2),
};
parameter[0].Value = strStorageInfoID;
SystemDataObject.Instance.ExecuteSqlCommit(sqlstr, parameter);
}
/// <summary>
/// 根据库区编号停用或启用库位
/// </summary>
/// <param name="strAreaInfoID">库区编号</param>
/// <param name="flag">0停用1正常</param>
public void CloseLocationInfoByAreaInfoID(string strAreaInfoID, int flag)
{
string sqlstr =@"update T_BASE_STORAGE_AREA_LOCATION set status = '" + flag + "' where location_id in (select location_id from t_base_loc_area where STORAGE_AREA_ID =:storage_area_id)";
OracleParameter[] parameter = new OracleParameter[]{
new OracleParameter(":storage_area_id",OracleDbType.Varchar2),
};
parameter[0].Value = strAreaInfoID;
SystemDataObject.Instance.ExecuteSqlCommit(sqlstr, parameter);
}
/// <summary>
/// 删除属于某仓库分类的库位信息
/// </summary>
/// <param name="strStorageTypeID">某仓库分类</param>
public void DeleteLocationInfoByStorageTypeID(string strStorageTypeID)
{
string sqlstr =@"delete
from
T_BASE_STORAGE_AREA_LOCATION
where
STORAGE_ID
in
(
select
STORAGE_ID
from
T_BASE_STORAGEINFO
where
STORAGE_TYPE_ID =:STORAGE_TYPE_ID
)";
OracleParameter[] parameter = new OracleParameter[]{
new OracleParameter(":STORAGE_TYPE_ID",OracleDbType.Varchar2),
};
parameter[0].Value = strStorageTypeID;
SystemDataObject.Instance.ExecuteSql(sqlstr, parameter);
}
}
}