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.
958 lines
47 KiB
958 lines
47 KiB
using ICSSoft.Common;
|
|
using ICSSoft.Entity;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Linq;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
using System.Linq;
|
|
using System.Net.Http;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ICSSoft.DataProject
|
|
{
|
|
/// <summary>
|
|
/// 使用中
|
|
/// 库内作业模块
|
|
/// </summary>
|
|
public class ICSWareHouseService
|
|
{
|
|
private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
|
|
|
#region 一步调拨
|
|
/// <summary>
|
|
/// 一步调拨
|
|
/// </summary>
|
|
/// <param name="TransCode"></param>
|
|
/// <param name="TransSequence"></param>
|
|
/// <param name="Quantity"></param>
|
|
/// <param name="WorkPoint"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void OneStepTransferDocIn(string TransCode,string TransSequence, string WorkPoint,string Quantity, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
string sql = @"UPDATE ICSTransfer SET TransferQuantity=ISNULL(TransferQuantity,0)+'{2}'
|
|
WHERE TransferNO='{0}' AND Sequence='{3}' AND WorkPoint='{1}' AND Type='1'
|
|
|
|
IF EXISTS(SELECT a.ID FROM ICSTransfer a
|
|
WHERE a.TransferNO='{0}' AND a.Sequence='{3}' and a.WorkPoint='{1}' AND a.Type='1' AND a.TransferQuantity<a.TransferQuantity)
|
|
BEGIN
|
|
RAISERROR('单据号:{0},行号:{3} 对应的源头单据已调拨数量不能大于应调拨数量!',16,1);
|
|
RETURN
|
|
END";
|
|
sql = string.Format(sql, TransCode, WorkPoint, Quantity, TransSequence);
|
|
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd))
|
|
{
|
|
throw new Exception("调拨单信息更新失败!");
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 一步调拨接口
|
|
/// </summary>
|
|
/// <param name="TransType"></param>
|
|
/// <param name="Identification"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void OneStepTransferDocInERP(string TransType, string Identification, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
#region ERP
|
|
//检验调拨单是否一次性发完
|
|
string sql = @"IF EXISTS(SELECT b.ID FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSTransfer b ON a.TransCode=b.TransferNO AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
WHERE a.Identification='{0}' AND b.Type = '1' AND b.Quantity!=b.TransferQuantity)
|
|
BEGIN
|
|
RAISERROR('调拨单下的条码必须一次性扫描完成!',16,1);
|
|
RETURN
|
|
END
|
|
SELECT b.TransferID AS ID,a.MUSER AS [User],SYSDATETIME() AS MTime,Enable AS UpdateTodoQuantity
|
|
FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSTransfer b ON a.TransCode=b.TransferNO AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSConfiguration con ON con.Code='Stock003' AND a.WorkPoint=con.WorkPoint
|
|
WHERE a.Identification='{0}' AND ERPUpload='0' AND b.Type='1'
|
|
GROUP BY b.TransferID,a.MUSER,Enable";
|
|
sql = string.Format(sql, Identification);
|
|
DataTable dt = DBHelper.SQlReturnData(sql, cmd);
|
|
|
|
string Inputstr =JsonConvert.SerializeObject(dt);
|
|
string resultStr = HTTPHelper.HttpPost(TransType, ERPUrl.OneStepTransferDocInURL, Inputstr);
|
|
Result result = new Result();
|
|
result = JsonConvert.DeserializeObject<Result>(resultStr);
|
|
if (result.Success)
|
|
{
|
|
try
|
|
{
|
|
foreach (DataRow dr in dt.Rows)
|
|
{
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, dr["ID"].ToString(), Identification, "", "", "", "", cmd);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Debug(ex.ToString());
|
|
log.Debug(resultStr);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("ERP接口调用失败:"+result.Message);
|
|
}
|
|
#endregion
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 两步调出
|
|
/// <summary>
|
|
/// 两步调出
|
|
/// </summary>
|
|
/// <param name="TransCode"></param>
|
|
/// <param name="TransSequence"></param>
|
|
/// <param name="Quantity"></param>
|
|
/// <param name="WorkPoint"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void TwoStepTransferDocOut(string TransCode, string TransSequence, string Quantity, string WorkPoint, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
string sql = @"DECLARE @Status VARCHAR(10)
|
|
SELECT @Status=a.Status FROM ICSOtherOut a
|
|
INNER JOIN ICSTransfer b ON a.TransferDetailID=b.TransferDetailID AND a.WorkPoint=b.WorkPoint
|
|
WHERE a.OutCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}'
|
|
|
|
IF (@Status IS NULL)
|
|
BEGIN
|
|
RAISERROR('两步调出订单:{0} 不存在!',16,1);
|
|
RETURN
|
|
END
|
|
ELSE IF (@Status!='1')
|
|
BEGIN
|
|
RAISERROR('两步调出订单:{0} 不是开立状态!',16,1);
|
|
RETURN
|
|
END
|
|
UPDATE a SET OutQuantity=ISNULL(OutQuantity,0)+'{2}'
|
|
FROM ICSOtherOut a
|
|
INNER JOIN ICSTransfer b ON a.TransferDetailID=b.TransferDetailID AND a.WorkPoint=b.WorkPoint
|
|
WHERE a.OutCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}'
|
|
|
|
IF EXISTS(SELECT a.ID FROM ICSOtherOut a
|
|
INNER JOIN ICSTransfer b ON a.TransferDetailID=b.TransferDetailID AND a.WorkPoint=b.WorkPoint
|
|
WHERE a.OutCode='{0}' AND a.Sequence='{3}' and a.WorkPoint='{1}' AND a.Quantity<a.OutQuantity)
|
|
BEGIN
|
|
RAISERROR('单据号:{0},行号:{3} 对应的源头单据已发数量不能大于应发数量!',16,1);
|
|
RETURN
|
|
END";
|
|
|
|
sql = string.Format(sql, TransCode, WorkPoint, Quantity, TransSequence);
|
|
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd))
|
|
{
|
|
throw new Exception("两步调出单更新失败!");
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 两步调出接口
|
|
/// </summary>
|
|
/// <param name="TransType"></param>
|
|
/// <param name="Identification"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void TwoStepTransferDocOutERP(string TransType, string Identification, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
#region ERP
|
|
string sql = @"IF EXISTS(SELECT b.ID FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSOtherOut b ON a.TransCode=b.OutCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSTransfer c ON b.TransferDetailID=c.TransferDetailID AND b.WorkPoint=c.WorkPoint
|
|
WHERE a.Identification='{0}' AND b.Quantity!=b.OutQuantity)
|
|
BEGIN
|
|
RAISERROR('两步调出单下的条码必须一次性扫描完成!',16,1);
|
|
RETURN
|
|
END
|
|
SELECT b.OutID AS ID,a.MUSER AS [User],SYSDATETIME() AS MTime,Enable AS UpdateTodoQuantity
|
|
FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSOtherOut b ON a.TransCode=b.OutCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSTransfer c ON b.TransferDetailID=c.TransferDetailID AND b.WorkPoint=c.WorkPoint
|
|
INNER JOIN ICSConfiguration con ON con.Code='Stock002' AND a.WorkPoint=con.WorkPoint
|
|
WHERE a.Identification='{0}' AND ERPUpload='0'
|
|
GROUP BY b.OutID,a.MUSER,Enable";
|
|
sql = string.Format(sql, Identification);
|
|
DataTable dt = DBHelper.SQlReturnData(sql, cmd);
|
|
|
|
string Inputstr = JsonConvert.SerializeObject(dt);
|
|
string resultStr = HTTPHelper.HttpPost(TransType, ERPUrl.TwoStepTransferDocOutURL, Inputstr);
|
|
Result result = new Result();
|
|
result = JsonConvert.DeserializeObject<Result>(resultStr);
|
|
if (result.Success)
|
|
{
|
|
try
|
|
{
|
|
foreach (DataRow dr in dt.Rows)
|
|
{
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, dr["ID"].ToString(), Identification, "", "", "", "", cmd);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Debug(ex.ToString());
|
|
log.Debug(resultStr);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("ERP接口调用失败:"+result.Message);
|
|
}
|
|
#endregion
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 两步调入
|
|
/// <summary>
|
|
/// 两步调入
|
|
/// </summary>
|
|
/// <param name="TransCode"></param>
|
|
/// <param name="TransSequence"></param>
|
|
/// <param name="Quantity"></param>
|
|
/// <param name="WorkPoint"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void TwoStepTransferDocIn(string TransCode, string TransSequence, string LotNo, string Quantity, string WorkPoint, SqlCommand cmd)
|
|
{
|
|
//需要关联其他入库单
|
|
try
|
|
{
|
|
string sql = @"DECLARE @Status VARCHAR(10)
|
|
SELECT @Status=Otin.Status FROM ICSOtherIn Otin
|
|
INNER JOIN ICSTransfer tra ON Otin.TransferDetailID=tra.TransferDetailID AND Otin.WorkPoint=tra.WorkPoint
|
|
INNER JOIN ICSOtherOut out ON out.TransferDetailID=tra.TransferDetailID AND out.WorkPoint=tra.WorkPoint
|
|
INNER JOIN ICSWareHouseLotInfoLog log ON out.OutCode=log.TransCode AND out.Sequence=log.TransSequence AND out.WorkPoint=log.WorkPoint
|
|
INNER JOIN ICSWareHouseLotInfo a ON a.LotNo=log.LotNo AND a.WorkPoint=log.WorkPoint
|
|
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND Otin.InCode='{2}' AND Otin.Sequence='{3}'
|
|
|
|
IF (@Status IS NULL)
|
|
BEGIN
|
|
RAISERROR('条码:{0} 对应的源头单据不存在!',16,1);
|
|
RETURN
|
|
END
|
|
ELSE IF (@Status!='1')
|
|
BEGIN
|
|
RAISERROR('条码:{0} 对应的源头单据不是开立状态!',16,1);
|
|
RETURN
|
|
END
|
|
UPDATE Otin SET InQuantity=ISNULL(InQuantity,0)+'{2}'
|
|
FROM ICSOtherIn Otin
|
|
INNER JOIN ICSTransfer tra ON Otin.TransferDetailID=tra.TransferDetailID AND Otin.WorkPoint=tra.WorkPoint
|
|
INNER JOIN ICSOtherOut out ON out.TransferDetailID=tra.TransferDetailID AND out.WorkPoint=tra.WorkPoint
|
|
INNER JOIN ICSWareHouseLotInfoLog log ON out.OutCode=log.TransCode AND out.Sequence=log.TransSequence AND out.WorkPoint=log.WorkPoint
|
|
INNER JOIN ICSWareHouseLotInfo a ON a.LotNo=log.LotNo AND a.WorkPoint=log.WorkPoint
|
|
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND Otin.InCode='{2}' AND Otin.Sequence='{3}'
|
|
IF EXISTS(SELECT a.LotNo FROM ICSOtherIn Otin
|
|
INNER JOIN ICSTransfer tra ON Otin.TransferDetailID=tra.TransferDetailID AND Otin.WorkPoint=tra.WorkPoint
|
|
INNER JOIN ICSOtherOut out ON out.TransferDetailID=tra.TransferDetailID AND out.WorkPoint=tra.WorkPoint
|
|
INNER JOIN ICSWareHouseLotInfoLog log ON out.OutCode=log.TransCode AND out.Sequence=log.TransSequence AND out.WorkPoint=log.WorkPoint
|
|
INNER JOIN ICSWareHouseLotInfo a ON a.LotNo=log.LotNo AND a.WorkPoint=log.WorkPoint
|
|
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND Otin.InCode='{2}' AND Otin.Sequence='{3}' AND Otin.Quantity<Otin.InQuantity)
|
|
BEGIN
|
|
RAISERROR('条码:{0}对应的源头单据已调入数量不能大于应调入数量!',16,1);
|
|
END";
|
|
sql = string.Format(sql, LotNo, WorkPoint, Quantity,TransCode,TransSequence);
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd))
|
|
{
|
|
throw new Exception("两步调入单更新失败!");
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 两步调入接口
|
|
/// </summary>
|
|
/// <param name="TransType"></param>
|
|
/// <param name="Identification"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void TwoStepTransferDocInERP(string TransType, string Identification, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
#region ERP
|
|
string sql = @"IF EXISTS(SELECT b.ID FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSOtherIn b ON a.TransCode=b.InCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSTransfer c ON b.TransferDetailID=c.TransferDetailID AND b.WorkPoint=c.WorkPoint
|
|
WHERE a.Identification='{0}' AND b.Quantity!=b.InQuantity)
|
|
BEGIN
|
|
RAISERROR('两步调入单下的条码必须一次性扫描完成!',16,1);
|
|
RETURN
|
|
END
|
|
SELECT b.InID AS ID,a.MUSER AS [User],SYSDATETIME() AS MTime,Enable AS UpdateTodoQuantity
|
|
FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSOtherIn b ON a.TransCode=b.InCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSTransfer c ON b.TransferDetailID=c.TransferDetailID AND b.WorkPoint=c.WorkPoint
|
|
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
|
|
WHERE a.Identification='{0}' AND ERPUpload='0'
|
|
GROUP BY b.InID,a.MUSER,Enable";
|
|
sql = string.Format(sql, Identification);
|
|
DataTable dt = DBHelper.SQlReturnData(sql, cmd);
|
|
|
|
string Inputstr = JsonConvert.SerializeObject(dt);
|
|
string resultStr = HTTPHelper.HttpPost(TransType, ERPUrl.TwoStepTransferDocInURL, Inputstr);
|
|
Result result = new Result();
|
|
result = JsonConvert.DeserializeObject<Result>(resultStr);
|
|
if (result.Success)
|
|
{
|
|
try
|
|
{
|
|
foreach (DataRow dr in dt.Rows)
|
|
{
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, dr["ID"].ToString(), Identification, "", "", "", "", cmd);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Debug(ex.ToString());
|
|
log.Debug(resultStr);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("ERP接口调用失败:"+result.Message);
|
|
}
|
|
#endregion
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 其他出库
|
|
/// <summary>
|
|
/// 其他出库
|
|
/// </summary>
|
|
/// <param name="TransCode"></param>
|
|
/// <param name="TransSequence"></param>
|
|
/// <param name="Quantity"></param>
|
|
/// <param name="WorkPoint"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void OtherOutDoc(string TransCode, string TransSequence, string Quantity, string WorkPoint, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
string sql = @"DECLARE @Status VARCHAR(10)
|
|
SELECT @Status=a.Status FROM ICSOtherOut a
|
|
WHERE a.OutCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}'
|
|
|
|
IF (@Status IS NULL)
|
|
BEGIN
|
|
RAISERROR('其他出库订单:{0} 不存在!',16,1);
|
|
RETURN
|
|
END
|
|
ELSE IF (@Status!='1')
|
|
BEGIN
|
|
RAISERROR('其他出库订单:{0} 不是开立状态!',16,1);
|
|
RETURN
|
|
END
|
|
UPDATE a SET OutQuantity=ISNULL(OutQuantity,0)+'{2}'
|
|
FROM ICSOtherOut a
|
|
WHERE a.OutCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}'
|
|
|
|
IF EXISTS(SELECT a.ID FROM ICSOtherOut a
|
|
WHERE a.OutCode='{0}' AND a.Sequence='{3}' and a.WorkPoint='{1}' AND a.Quantity<a.OutQuantity)
|
|
BEGIN
|
|
RAISERROR('单据号:{0},行号:{3} 对应的源头单据已发数量不能大于应发数量!',16,1);
|
|
RETURN
|
|
END";
|
|
|
|
sql = string.Format(sql, TransCode, WorkPoint, Quantity, TransSequence);
|
|
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd))
|
|
{
|
|
throw new Exception("其他出库单更新失败!");
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 其他出库接口
|
|
/// </summary>
|
|
/// <param name="TransType"></param>
|
|
/// <param name="Identification"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void OtherOutDocERP(string TransType, string Identification, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
#region ERP
|
|
string sql = @"IF EXISTS(SELECT b.ID FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSOtherOut b ON a.TransCode=b.OutCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
WHERE a.Identification='{0}' AND b.Quantity!=b.OutQuantity)
|
|
BEGIN
|
|
RAISERROR('其他出库单下的条码必须一次性扫描完成!',16,1);
|
|
RETURN
|
|
END
|
|
SELECT b.OutID AS ID,a.MUSER AS [User],SYSDATETIME() AS MTime,Enable AS UpdateTodoQuantity
|
|
FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSOtherOut b ON a.TransCode=b.OutCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSConfiguration con ON con.Code='Stock002' AND a.WorkPoint=con.WorkPoint
|
|
WHERE a.Identification='{0}' AND ERPUpload='0'
|
|
GROUP BY b.OutID,a.MUSER,Enable";
|
|
sql = string.Format(sql, Identification);
|
|
DataTable dt = DBHelper.SQlReturnData(sql, cmd);
|
|
|
|
string Inputstr = JsonConvert.SerializeObject(dt);
|
|
string resultStr = HTTPHelper.HttpPost(TransType, ERPUrl.OtherOutDocURL, Inputstr);
|
|
Result result = new Result();
|
|
result = JsonConvert.DeserializeObject<Result>(resultStr);
|
|
if (result.Success)
|
|
{
|
|
try
|
|
{
|
|
foreach (DataRow dr in dt.Rows)
|
|
{
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, dr["ID"].ToString(), Identification, "", "", "", "", cmd);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Debug(ex.ToString());
|
|
log.Debug(resultStr);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("ERP接口调用失败:"+result.Message);
|
|
}
|
|
#endregion
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 其他入库
|
|
/// <summary>
|
|
/// 其他入库
|
|
/// </summary>
|
|
/// <param name="TransCode"></param>
|
|
/// <param name="TransSequence"></param>
|
|
/// <param name="Quantity"></param>
|
|
/// <param name="WorkPoint"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void OtherInDoc(string LotNo, string Quantity, string WorkPoint, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
string sql = @"DECLARE @Status VARCHAR(10)
|
|
SELECT @Status=c.Status FROM ICSInventoryLot a
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSOtherIn c ON b.TransCode=c.InCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
|
|
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}'
|
|
|
|
IF (@Status IS NULL)
|
|
BEGIN
|
|
RAISERROR('条码:{0} 对应的源头单据不存在!',16,1);
|
|
RETURN
|
|
END
|
|
ELSE IF (@Status!='1')
|
|
BEGIN
|
|
RAISERROR('条码:{0} 对应的源头单据不是开立状态!',16,1);
|
|
RETURN
|
|
END
|
|
UPDATE c SET InQuantity=ISNULL(InQuantity,0)+'{2}'
|
|
FROM ICSInventoryLot a
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSOtherIn c ON b.TransCode=c.InCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
|
|
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}'
|
|
IF EXISTS(SELECT a.LotNo FROM ICSInventoryLot a
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSOtherIn c ON b.TransCode=c.InCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
|
|
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND c.Quantity<c.InQuantity)
|
|
BEGIN
|
|
RAISERROR('条码:{0}对应的源头单据已入数量不能大于应入数量!',16,1);
|
|
END";
|
|
sql = string.Format(sql, LotNo, WorkPoint, Quantity);
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd))
|
|
{
|
|
throw new Exception("其他入库单更新失败!");
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 其他入库接口
|
|
/// </summary>
|
|
/// <param name="TransType"></param>
|
|
/// <param name="Identification"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void OtherInDocERP(string TransType, string Identification, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
#region ERP
|
|
string sql = @"IF EXISTS(SELECT b.ID FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSOtherIn b ON a.TransCode=b.InCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
WHERE a.Identification='{0}' AND b.Quantity!=b.InQuantity)
|
|
BEGIN
|
|
RAISERROR('其他入库单下的条码必须一次性扫描完成!',16,1);
|
|
RETURN
|
|
END
|
|
SELECT b.InID AS ID,a.MUSER AS [User],SYSDATETIME() AS MTime,Enable AS UpdateTodoQuantity
|
|
FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSOtherIn b ON a.TransCode=b.InCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
|
|
WHERE a.Identification='{0}' AND ERPUpload='0'
|
|
GROUP BY b.InID,a.MUSER,Enable";
|
|
sql = string.Format(sql, Identification);
|
|
DataTable dt = DBHelper.SQlReturnData(sql, cmd);
|
|
|
|
string Inputstr = JsonConvert.SerializeObject(dt);
|
|
string resultStr = HTTPHelper.HttpPost(TransType, ERPUrl.OtherInDocURL, Inputstr);
|
|
Result result = new Result();
|
|
result = JsonConvert.DeserializeObject<Result>(resultStr);
|
|
if (result.Success)
|
|
{
|
|
try
|
|
{
|
|
foreach (DataRow dr in dt.Rows)
|
|
{
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, dr["ID"].ToString(), Identification, "", "", "", "", cmd);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Debug(ex.ToString());
|
|
log.Debug(resultStr);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("ERP接口调用失败:"+result.Message);
|
|
}
|
|
#endregion
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 拆卸单
|
|
/// <summary>
|
|
/// 拆卸单
|
|
/// </summary>
|
|
/// <param name="TransCode"></param>
|
|
/// <param name="TransSequence"></param>
|
|
/// <param name="Quantity"></param>
|
|
/// <param name="WorkPoint"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void DisassemblyDoc(string LotNo, string Quantity, string WorkPoint, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
string sql = @"DECLARE @Status VARCHAR(10)
|
|
SELECT @Status=c.Status FROM ICSInventoryLot a
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSDisassemblyDoc c ON b.TransCode=c.DABDOCCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
|
|
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND c.DABDOCType='2'
|
|
|
|
IF (@Status IS NULL)
|
|
BEGIN
|
|
RAISERROR('条码:{0} 对应的源头单据不存在!',16,1);
|
|
RETURN
|
|
END
|
|
ELSE IF (@Status!='1')
|
|
BEGIN
|
|
RAISERROR('条码:{0} 对应的源头单据不是开立状态!',16,1);
|
|
RETURN
|
|
END
|
|
UPDATE c SET DABDOCQuantity=ISNULL(DABDOCQuantity,0)+'{2}'
|
|
FROM ICSInventoryLot a
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSDisassemblyDoc c ON b.TransCode=c.DABDOCCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
|
|
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}'
|
|
IF EXISTS(SELECT a.LotNo FROM ICSInventoryLot a
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSDisassemblyDoc c ON b.TransCode=c.DABDOCCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
|
|
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND c.Quantity<c.DABDOCQuantity)
|
|
BEGIN
|
|
RAISERROR('条码:{0}对应的源头单据已拆卸数量不能大于应拆卸数量!',16,1);
|
|
END";
|
|
|
|
sql = string.Format(sql, LotNo, WorkPoint, Quantity);
|
|
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd))
|
|
{
|
|
throw new Exception("拆卸单更新失败!");
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 拆卸单更新套件锁定数量
|
|
/// </summary>
|
|
/// <param name="Identification"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void DisassemblyDoc(string Identification, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
string sql = @"UPDATE e SET e.Quantity=e.Quantity-e.LockQuantity,e.LockQuantity=0
|
|
FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSDisassemblyDoc c ON b.TransCode=c.DABDOCCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
|
|
INNER JOIN ICSWareHouseLotInfoLog d ON b.TransCode=d.TransCode AND d.TransSequence='1' AND b.WorkPoint=d.WorkPoint
|
|
INNER JOIN ICSWareHouseLotInfo e ON d.LotNo=e.LotNo AND d.WorkPoint=e.WorkPoint
|
|
WHERE a.Identification='{0}' AND d.ERPUpload='0' AND d.Lock='1'";
|
|
|
|
sql = string.Format(sql, Identification);
|
|
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd))
|
|
{
|
|
throw new Exception("拆卸单套件更新失败!");
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 拆卸单接口
|
|
/// </summary>
|
|
/// <param name="TransType"></param>
|
|
/// <param name="Identification"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void DisassemblyDocERP(string TransType, string Identification, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
#region ERP
|
|
string sql = @"IF EXISTS(SELECT b.ID FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSDisassemblyDoc b ON a.TransCode=b.DABDOCCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
WHERE a.Identification='{0}' AND b.Quantity!=b.DABDOCQuantity)
|
|
BEGIN
|
|
RAISERROR('拆卸单下的条码必须一次性扫描完成!',16,1);
|
|
RETURN
|
|
END
|
|
SELECT b.DABDOCID AS ID,a.MUSER AS [User],SYSDATETIME() AS MTime,Enable AS UpdateTodoQuantity
|
|
FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSDisassemblyDoc b ON a.TransCode=b.DABDOCCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSConfiguration con ON con.Code='Stock003' AND a.WorkPoint=con.WorkPoint
|
|
WHERE a.Identification='{0}' AND ERPUpload='0'
|
|
GROUP BY b.DABDOCID,a.MUSER,Enable";
|
|
sql = string.Format(sql, Identification);
|
|
DataTable dt = DBHelper.SQlReturnData(sql, cmd);
|
|
|
|
string Inputstr = JsonConvert.SerializeObject(dt);
|
|
string resultStr = HTTPHelper.HttpPost(TransType, ERPUrl.DisassemblyDocURL, Inputstr);
|
|
Result result = new Result();
|
|
result = JsonConvert.DeserializeObject<Result>(resultStr);
|
|
if (result.Success)
|
|
{
|
|
try
|
|
{
|
|
foreach (DataRow dr in dt.Rows)
|
|
{
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, dr["ID"].ToString(), Identification, "", "", "", "", cmd);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Debug(ex.ToString());
|
|
log.Debug(resultStr);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("ERP接口调用失败:"+result.Message);
|
|
}
|
|
#endregion
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 借用
|
|
/// <summary>
|
|
/// 借用
|
|
/// </summary>
|
|
/// <param name="TransCode"></param>
|
|
/// <param name="TransSequence"></param>
|
|
/// <param name="Quantity"></param>
|
|
/// <param name="WorkPoint"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void BrrowDoc(string TransCode, string TransSequence, string Quantity, string WorkPoint, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
string sql = @"DECLARE @Status VARCHAR(10)
|
|
SELECT @Status=a.Status FROM ICSBrrow a
|
|
WHERE a.BrrowCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}'
|
|
|
|
IF (@Status IS NULL)
|
|
BEGIN
|
|
RAISERROR('借用单:{0} 不存在!',16,1);
|
|
RETURN
|
|
END
|
|
ELSE IF (@Status!='2')
|
|
BEGIN
|
|
RAISERROR('借用单:{0} 不是审核状态!',16,1);
|
|
RETURN
|
|
END
|
|
UPDATE a SET BrrowQuantity=ISNULL(BrrowQuantity,0)+'{2}'
|
|
FROM ICSBrrow a
|
|
WHERE a.BrrowCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}'
|
|
|
|
IF EXISTS(SELECT a.ID FROM ICSBrrow a
|
|
WHERE a.BrrowCode='{0}' AND a.Sequence='{3}' and a.WorkPoint='{1}' AND a.Quantity<a.BrrowQuantity)
|
|
BEGIN
|
|
RAISERROR('单据号:{0},行号:{3} 对应的源头单据已发数量不能大于应发数量!',16,1);
|
|
RETURN
|
|
END";
|
|
|
|
sql = string.Format(sql, TransCode, WorkPoint, Quantity, TransSequence);
|
|
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd))
|
|
{
|
|
throw new Exception("借用单更新失败!");
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 借用接口
|
|
/// </summary>
|
|
/// <param name="TransType"></param>
|
|
/// <param name="Identification"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void BrrowDocERP(string TransType, string Identification, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
#region ERP
|
|
string sql = @"SELECT a.FromWarehouseCode+b.BrrowCode+a.MUSER AS Costre,a.FromWarehouseCode AS WarehouseCode,b.BrrowCode,a.MUSER,ROW_NUMBER() OVER (ORDER BY a.FromWarehouseCode,b.BrrowCode,b.BrrowDetailID,a.InvCode) AS Sequence,
|
|
a.InvCode,SUM(a.Quantity) AS Quantity,0 AS Amount,b.BrrowDetailID,Enable AS UpdateTodoQuantity
|
|
INTO #TempERP
|
|
FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSBrrow b ON a.TransCode=b.BrrowCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSConfiguration con ON con.Code='Stock002' AND a.WorkPoint=con.WorkPoint
|
|
WHERE a.Identification='{0}' AND ERPUpload='0'
|
|
GROUP BY a.FromWarehouseCode,b.BrrowCode,a.MUSER,a.InvCode,b.BrrowDetailID,Enable
|
|
|
|
SELECT DISTINCT Costre,'' AS DepCode,WarehouseCode AS WHCode,'归还单' AS SourceType,BrrowCode AS SourceCode,MUSER AS [User],SYSDATETIME() AS MTime,UpdateTodoQuantity FROM #TempERP
|
|
SELECT Costre,Sequence,InvCode,Quantity,Amount,BrrowDetailID AS SourceDetailID FROM #TempERP
|
|
|
|
DROP TABLE #TempERP";
|
|
sql = string.Format(sql, Identification);
|
|
DataSet ds = DBHelper.SQlReturnDataSet(sql, cmd);
|
|
|
|
string Inputstr = DataToJsonHelper.DataSetToJson(ds, "details", "Costre");
|
|
string resultStr = HTTPHelper.HttpPost(TransType, ERPUrl.BrrowDocURL, Inputstr);
|
|
Result result = new Result();
|
|
result = JsonConvert.DeserializeObject<Result>(resultStr);
|
|
if (result.Success)
|
|
{
|
|
try
|
|
{
|
|
JArray res = (JArray)JsonConvert.DeserializeObject(result.Data.ToString());
|
|
foreach (var item in res)
|
|
{
|
|
JObject jo = (JObject)item;
|
|
JArray resdetail = (JArray)JsonConvert.DeserializeObject(jo["details"].ToString());
|
|
foreach (var detail in resdetail)
|
|
{
|
|
JObject det = (JObject)detail;
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, det["SourceDetailID"].ToString(), Identification, jo["ID"].ToString(), det["DetailID"].ToString(), jo["OtherOutCode"].ToString(), det["Sequence"].ToString(), cmd);
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Debug(ex.ToString());
|
|
log.Debug(resultStr);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("ERP接口调用失败:" + result.Message);
|
|
}
|
|
#endregion
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 归还
|
|
/// <summary>
|
|
/// 归还
|
|
/// </summary>
|
|
/// <param name="TransCode"></param>
|
|
/// <param name="TransSequence"></param>
|
|
/// <param name="Quantity"></param>
|
|
/// <param name="WorkPoint"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void ReturnDoc(string LotNo, string Quantity, string WorkPoint, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
string sql = @"DECLARE @Status VARCHAR(10)
|
|
SELECT @Status=c.Status FROM ICSInventoryLot a
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSReturn c ON b.TransCode=c.ReturnCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
|
|
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}'
|
|
|
|
IF (@Status IS NULL)
|
|
BEGIN
|
|
RAISERROR('条码:{0} 对应的源头单据不存在!',16,1);
|
|
RETURN
|
|
END
|
|
ELSE IF (@Status!='2')
|
|
BEGIN
|
|
RAISERROR('条码:{0} 对应的源头单据不是审核状态!',16,1);
|
|
RETURN
|
|
END
|
|
UPDATE c SET ReturnQuantity=ISNULL(ReturnQuantity,0)+'{2}'
|
|
FROM ICSInventoryLot a
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSReturn c ON b.TransCode=c.ReturnCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
|
|
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}'
|
|
IF EXISTS(SELECT a.LotNo FROM ICSInventoryLot a
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSReturn c ON b.TransCode=c.ReturnCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
|
|
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND c.Quantity<c.ReturnQuantity)
|
|
BEGIN
|
|
RAISERROR('条码:{0}对应的源头单据已归还数量不能大于应归还数量!',16,1);
|
|
END";
|
|
sql = string.Format(sql, LotNo, WorkPoint, Quantity);
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd))
|
|
{
|
|
throw new Exception("归还单更新失败!");
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 归还接口
|
|
/// </summary>
|
|
/// <param name="TransType"></param>
|
|
/// <param name="Identification"></param>
|
|
/// <param name="cmd"></param>
|
|
public static void ReturnDocERP(string TransType, string Identification, SqlCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
#region ERP
|
|
string sql = @"SELECT a.ToWarehouseCode+b.ReturnCode+a.MUSER AS Costre,a.ToWarehouseCode AS WarehouseCode,b.ReturnCode,a.MUSER,ROW_NUMBER() OVER (ORDER BY a.ToWarehouseCode,b.ReturnCode,b.ReturnDetailID,a.InvCode) AS Sequence,
|
|
a.InvCode,SUM(a.Quantity) AS Quantity,0 AS Amount,b.ReturnDetailID,Enable AS UpdateTodoQuantity
|
|
INTO #TempERP
|
|
FROM ICSWareHouseLotInfoLog a
|
|
INNER JOIN ICSReturn b ON a.TransCode=b.ReturnCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
|
|
INNER JOIN ICSConfiguration con ON con.Code='Stock002' AND a.WorkPoint=con.WorkPoint
|
|
WHERE a.Identification='{0}' AND ERPUpload='0'
|
|
GROUP BY a.ToWarehouseCode,b.ReturnCode,a.MUSER,a.InvCode,b.ReturnDetailID,Enable
|
|
|
|
SELECT DISTINCT Costre,'' AS DepCode,WarehouseCode AS WHCode,'归还单' AS SourceType,ReturnCode AS SourceCode,MUSER AS [User],SYSDATETIME() AS MTime,UpdateTodoQuantity FROM #TempERP
|
|
SELECT Costre,Sequence,InvCode,Quantity,Amount,ReturnDetailID AS SourceDetailID FROM #TempERP
|
|
|
|
DROP TABLE #TempERP";
|
|
sql = string.Format(sql, Identification);
|
|
DataSet ds = DBHelper.SQlReturnDataSet(sql, cmd);
|
|
|
|
string Inputstr = DataToJsonHelper.DataSetToJson(ds, "details", "Costre");
|
|
string resultStr = HTTPHelper.HttpPost(TransType, ERPUrl.ReturnDocURL, Inputstr);
|
|
Result result = new Result();
|
|
result = JsonConvert.DeserializeObject<Result>(resultStr);
|
|
if (result.Success)
|
|
{
|
|
try
|
|
{
|
|
JArray res = (JArray)JsonConvert.DeserializeObject(result.Data.ToString());
|
|
foreach (var item in res)
|
|
{
|
|
JObject jo = (JObject)item;
|
|
JArray resdetail = (JArray)JsonConvert.DeserializeObject(jo["details"].ToString());
|
|
foreach (var detail in resdetail)
|
|
{
|
|
JObject det = (JObject)detail;
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, det["SourceDetailID"].ToString(), Identification, jo["ID"].ToString(), det["DetailID"].ToString(), jo["OtherInCode"].ToString(), det["Sequence"].ToString(), cmd);
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Debug(ex.ToString());
|
|
log.Debug(resultStr);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("ERP接口调用失败:" + result.Message);
|
|
}
|
|
#endregion
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
}
|