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.
1449 lines
43 KiB
1449 lines
43 KiB
1 year ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using ChangKeTec.Wms.Models.Enums;
|
||
|
using CK.SCP.Models;
|
||
|
using CK.SCP.Models.Enums;
|
||
|
|
||
|
namespace ChangKeTec.Wms.Models.Wms
|
||
|
{
|
||
|
|
||
|
public partial class TB_INSPECT
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
public partial class TB_CHECK_DETAIL
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TB_PICK_FACT
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TB_MATERIAL_RECEIVE ToMaterialReceive(TF_PO_DETAIL poDetail)
|
||
|
{
|
||
|
|
||
|
|
||
|
var part = WmsCache.GetPart(PartCode);
|
||
|
if (part == null)
|
||
|
{
|
||
|
throw new WmsException(ErrorCode.DataNotFound, PartCode, "零件号未找到");
|
||
|
}
|
||
|
return new TB_MATERIAL_RECEIVE
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
FromLocCode = FromLocCode,
|
||
|
ToLocCode = ToLocCode,
|
||
|
Qty = Qty,
|
||
|
State = State,
|
||
|
VendBatch = VendBatch,
|
||
|
PoBillNum = poDetail.BillNum,
|
||
|
PoLineNum = poDetail.LineNum,
|
||
|
PoUnit = poDetail.PoUnit,
|
||
|
LocUnit = part.Unit
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public TB_STOCK_MOVE ToStockMove()
|
||
|
{
|
||
|
var part = WmsCache.GetPart(PartCode);
|
||
|
if (part == null)
|
||
|
{
|
||
|
throw new WmsException(ErrorCode.DataNotFound, PartCode, "零件号未找到");
|
||
|
}
|
||
|
return new TB_STOCK_MOVE
|
||
|
{
|
||
|
BillNum = BillNum,
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
FromBatch = Batch,
|
||
|
ToBatch = Batch,
|
||
|
FromLocCode = FromLocCode,
|
||
|
ToLocCode = ToLocCode,
|
||
|
Qty = Qty,
|
||
|
FromState = State,
|
||
|
ToState = State,
|
||
|
VendBatch = VendBatch,
|
||
|
VendId = VendId,
|
||
|
FromEqptCode = EqptCode,
|
||
|
ToEqptCode = ""
|
||
|
};
|
||
|
}
|
||
|
|
||
|
|
||
|
public TB_STOCK_MOVE ToStockMove(string asnNumb, EnumStockState toState)
|
||
|
{
|
||
|
var part = WmsCache.GetPart(PartCode);
|
||
|
if (part == null)
|
||
|
{
|
||
|
throw new WmsException(ErrorCode.DataNotFound, PartCode, "零件号未找到");
|
||
|
}
|
||
|
return new TB_STOCK_MOVE
|
||
|
{
|
||
|
BillNum= BillNum,
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
FromBatch = Batch,
|
||
|
ToBatch = asnNumb,
|
||
|
FromLocCode = FromLocCode,
|
||
|
ToLocCode = ToLocCode,
|
||
|
Qty = Qty,
|
||
|
FromState = State,
|
||
|
ToState = toState,
|
||
|
VendBatch = VendBatch,
|
||
|
VendId = VendId,
|
||
|
FromEqptCode = EqptCode,
|
||
|
ToEqptCode = "",
|
||
|
ToBarCode = BarCode.Substring(0,BarCode.IndexOf('.')+1) + asnNumb
|
||
|
};
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
public partial class TB_PICK_INVOICE
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
public partial class TB_MATERIAL_BACK
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TB_STOCK_MOVE ToStockMove()
|
||
|
{
|
||
|
|
||
|
return new TB_STOCK_MOVE
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
FromBatch = FromBatch,
|
||
|
ToBatch = ToBatch,//TODO 来源批次为空批
|
||
|
FromLocCode = FromLocCode,
|
||
|
ToLocCode = ToLocCode,
|
||
|
Qty = Qty,
|
||
|
FromEqptCode = EqptCode,
|
||
|
ToEqptCode = EqptCode,
|
||
|
FromState = State,
|
||
|
ToState = State,
|
||
|
// Unit = WmsCache.GetUnit(this.PartCode),
|
||
|
// ProduceDate = this.ProduceDate,
|
||
|
VendBatch = VendBatch,
|
||
|
VendId = VendId
|
||
|
};
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TB_MATERIAL_RETURN
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_DETAIL ToStockDetailOut(TB_BILL bill)
|
||
|
{
|
||
|
return new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
|
||
|
Batch = Batch,
|
||
|
EqptCode = EqptCode,
|
||
|
LocCode = FromLocCode,
|
||
|
AreaCode = WmsCache.GetAreaCode(FromLocCode),
|
||
|
Qty = Qty,
|
||
|
UpdateQty = -Qty, //出库更新数量为负
|
||
|
VendId = bill.VendId,
|
||
|
State = State,
|
||
|
ProduceDate = ProduceDate,
|
||
|
OverdueDate = ProduceDate.AddDays(WmsCache.GetValidateDays(PartCode)),
|
||
|
VendBatch = VendBatch
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TB_PRODUCT_REPAIR
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TB_STOCK_MOVE ToStockMove()
|
||
|
{
|
||
|
|
||
|
return new TB_STOCK_MOVE
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
FromBatch = Batch,
|
||
|
ToBatch = Batch,
|
||
|
FromLocCode = FromLocCode,
|
||
|
ToLocCode = ToLocCode,
|
||
|
Qty = Qty,
|
||
|
FromEqptCode = EqptCode,
|
||
|
ToEqptCode = EqptCode,
|
||
|
FromState = State,
|
||
|
ToState = State
|
||
|
// Unit = WmsCache.GetUnit(this.PartCode),
|
||
|
// ProduceDate = this.ProduceDate,
|
||
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_DETAIL ToStockDetailIn(WmsEntities db,string partcode, EnumStockState state)
|
||
|
{
|
||
|
var stockDetail =
|
||
|
db.TS_STOCK_DETAIL.SingleOrDefault(
|
||
|
p => p.BarCode == BarCode && p.PartCode == partcode && p.LocCode == ToLocCode && p.State == State);
|
||
|
if (stockDetail != null)
|
||
|
{
|
||
|
var detailIn = stockDetail.Clone();
|
||
|
detailIn.Qty = Qty;
|
||
|
detailIn.UpdateQty = Qty;
|
||
|
detailIn.EqptCode = EqptCode;
|
||
|
return detailIn;
|
||
|
}
|
||
|
return new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = partcode,
|
||
|
Batch = Batch,
|
||
|
EqptCode = EqptCode,
|
||
|
LocCode = ToLocCode,
|
||
|
AreaCode = WmsCache.GetAreaCode(ToLocCode),
|
||
|
Qty = Qty,
|
||
|
UpdateQty = Qty,
|
||
|
State = state,
|
||
|
ReceiveDate = DateTime.Now,
|
||
|
Remark = PartCode,
|
||
|
};
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* public partial class TB_PRODUCT_RETURN
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_DETAIL ToStockDetailIn(TB_BILL bill)
|
||
|
{
|
||
|
return new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
|
||
|
Batch = Batch,
|
||
|
EqptCode = EqptCode,
|
||
|
LocCode = ToLocCode,
|
||
|
AreaCode = WmsCache.GetAreaCode(ToLocCode),
|
||
|
Qty = Qty,
|
||
|
UpdateQty = Qty,
|
||
|
VendId = bill.VendId,
|
||
|
ProduceDate = ProduceDate,
|
||
|
OverdueDate = ProduceDate.AddDays(WmsCache.GetValidateDays(PartCode)),
|
||
|
State = EnumStockState.隔离
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public TB_STOCK_MOVE ToStockMove()
|
||
|
{
|
||
|
|
||
|
return new TB_STOCK_MOVE
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
FromBatch = Batch,
|
||
|
ToBatch = Batch,
|
||
|
FromLocCode = FromLocCode,
|
||
|
ToLocCode = ToLocCode,
|
||
|
Qty = Qty,
|
||
|
FromEqptCode = EqptCode,
|
||
|
ToEqptCode = EqptCode,
|
||
|
FromState = State,
|
||
|
ToState = State
|
||
|
// Unit = WmsCache.GetUnit(this.PartCode),
|
||
|
// ProduceDate = this.ProduceDate,
|
||
|
};
|
||
|
}
|
||
|
}*/
|
||
|
|
||
|
public partial class TB_OTHER_INOUT
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_DETAIL ToStockDetailIn(TB_BILL bill)
|
||
|
{
|
||
|
var part = WmsCache.GetPart(PartCode);
|
||
|
if (part == null)
|
||
|
{
|
||
|
throw new WmsException(ErrorCode.DataNotFound, PartCode, "零件号未找到");
|
||
|
}
|
||
|
return new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
|
||
|
Batch = Batch,
|
||
|
EqptCode = EqptCode,
|
||
|
LocCode = ToLocCode,
|
||
|
AreaCode = WmsCache.GetAreaCode(ToLocCode),
|
||
|
Qty = Qty,
|
||
|
UpdateQty = Qty,
|
||
|
VendId = bill.VendId,
|
||
|
ProduceDate = ProduceDate,
|
||
|
OverdueDate = ProduceDate.AddDays(WmsCache.GetValidateDays(PartCode)),
|
||
|
State = State,
|
||
|
ReceiveDate = DateTime.Now,
|
||
|
VendBatch = Batch,
|
||
|
Remark = Remark
|
||
|
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_DETAIL ToStockDetailOut(TB_BILL bill)
|
||
|
{
|
||
|
return new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
|
||
|
Batch = Batch,
|
||
|
EqptCode = EqptCode,
|
||
|
LocCode = FromLocCode,
|
||
|
AreaCode = WmsCache.GetAreaCode(FromLocCode),
|
||
|
Qty = Qty,
|
||
|
UpdateQty = -Qty, //出库更新数量为负
|
||
|
VendId = bill.VendId,
|
||
|
ProduceDate = ProduceDate,
|
||
|
OverdueDate = ProduceDate.AddDays(WmsCache.GetValidateDays(PartCode)),
|
||
|
State = State,
|
||
|
ReceiveDate = DateTime.Now,
|
||
|
VendBatch = Batch
|
||
|
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TA_PAYMENT_DAY
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TS_VIN_PART
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
public TB_PRODUCT_SELL ToProductSell(string erpSoNum, TS_STOCK_DETAIL detail)
|
||
|
{
|
||
|
return new TB_PRODUCT_SELL
|
||
|
{
|
||
|
SoBillNum = erpSoNum,
|
||
|
BarCode = detail.BarCode + "." + CustPartCode,
|
||
|
PartCode = CustPartCode,
|
||
|
Batch = VinCode,
|
||
|
FromLocCode = detail.LocCode,
|
||
|
Qty = Qty,
|
||
|
EqptCode = detail.EqptCode,
|
||
|
State = VinState
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TS_VIN_STOCK
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
public TS_VIN_STOCK Clone()
|
||
|
{
|
||
|
return new TS_VIN_STOCK
|
||
|
{
|
||
|
PartCode = PartCode,
|
||
|
VinCode = VinCode,
|
||
|
LocCode = LocCode,
|
||
|
ProjectId = ProjectId,
|
||
|
EqptCode = EqptCode,
|
||
|
PlanOrderId = PlanOrderId,
|
||
|
Qty = Qty,
|
||
|
Amount = Amount,
|
||
|
ReceiveDate = ReceiveDate,
|
||
|
SendDate = SendDate,
|
||
|
BalanceDate = BalanceDate,
|
||
|
VinState = VinState
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public VinStockIn ToStockIn(decimal inQty, EnumStockState vinState)
|
||
|
{
|
||
|
return new VinStockIn
|
||
|
{
|
||
|
PartCode = PartCode,
|
||
|
VinCode = VinCode,
|
||
|
LocCode = LocCode,
|
||
|
InQty = inQty,
|
||
|
VinState = vinState,
|
||
|
TemplateDetail = this
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public VinStockOut ToStockOut(decimal outQty)
|
||
|
{
|
||
|
return new VinStockOut
|
||
|
{
|
||
|
PartCode = PartCode,
|
||
|
VinCode = VinCode,
|
||
|
LocCode = LocCode,
|
||
|
OutQty = outQty,
|
||
|
VinState = VinState
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TS_STOCK_DETAIL
|
||
|
{
|
||
|
// public EnumStockState StockState => (EnumStockState) State;
|
||
|
//
|
||
|
// public string DescStockState => EnumHelper.GetDesc(EnumStockState);
|
||
|
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TS_VIN ToTsVinSell(string erpSoNum, string operName)
|
||
|
{
|
||
|
return new TS_VIN
|
||
|
{
|
||
|
CreateOper = operName,
|
||
|
CreateTime = DateTime.Now,
|
||
|
SourceId = erpSoNum,
|
||
|
EqptCode = EqptCode,
|
||
|
VinCode = Batch,
|
||
|
Batch = Batch,
|
||
|
Flag = 2,
|
||
|
PlanOrderId = PlanOrderId,
|
||
|
PartCode = PartCode,
|
||
|
ProjectId = WmsCache.GetProjectId(PartCode)
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public TB_PRODUCT_SELL ToProductSell(string erpSoNum, decimal qty)
|
||
|
{
|
||
|
return new TB_PRODUCT_SELL
|
||
|
{
|
||
|
SoBillNum = erpSoNum,
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
FromLocCode = LocCode,
|
||
|
Qty = qty,
|
||
|
EqptCode = EqptCode,
|
||
|
State = 0,
|
||
|
Remark = ""
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public TB_CHECK_DETAIL ToCheckDetail(TB_CHECK_LOC locBill)
|
||
|
{
|
||
|
return new TB_CHECK_DETAIL
|
||
|
{
|
||
|
BillNum = locBill.BillNum,
|
||
|
BillLocCode = locBill.LocCode,
|
||
|
BookLocCode = locBill.LocCode,
|
||
|
CheckLocCode = "",
|
||
|
OperName = "",
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
EqptCode = EqptCode??"",
|
||
|
BookQty = Qty,
|
||
|
CheckQty = 0,
|
||
|
ReCheckQty = 0,
|
||
|
CheckTime = WmsCache.GetServerTimeString(),
|
||
|
State = State,
|
||
|
VendId = VendId,
|
||
|
VendBatch = VendBatch,
|
||
|
ProduceDate = ProduceDate,
|
||
|
|
||
|
// EnumCheckState = EnumCheckState.新增,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_DETAIL Clone()
|
||
|
{
|
||
|
return new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
LocCode = LocCode,
|
||
|
AreaCode = AreaCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
VendId = VendId,
|
||
|
EqptCode = EqptCode,
|
||
|
PlanOrderId = PlanOrderId,
|
||
|
State = State,
|
||
|
Qty = 0,
|
||
|
Amount = Amount,
|
||
|
ProduceDate = ProduceDate,
|
||
|
OverdueDate = OverdueDate,
|
||
|
UpdateTime = UpdateTime,
|
||
|
UpdateQty = 0,
|
||
|
TracebackCode = TracebackCode,
|
||
|
ReceiveDate = ReceiveDate,
|
||
|
VendBatch = VendBatch,
|
||
|
|
||
|
VinState = VinState
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_CUST ToCust()
|
||
|
{
|
||
|
return new TS_STOCK_CUST
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
LocCode = LocCode,
|
||
|
AreaCode = AreaCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
VendId = VendId,
|
||
|
EqptCode = EqptCode,
|
||
|
PlanOrderId = PlanOrderId,
|
||
|
State = State,
|
||
|
Qty = 0,
|
||
|
Amount = Amount,
|
||
|
ProduceDate = ProduceDate,
|
||
|
OverdueDate = OverdueDate,
|
||
|
UpdateTime = UpdateTime,
|
||
|
UpdateQty = 0,
|
||
|
TracebackCode = TracebackCode,
|
||
|
ReceiveDate = ReceiveDate,
|
||
|
VendBatch = VendBatch,
|
||
|
|
||
|
VinState = VinState
|
||
|
};
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
public TB_STOCK_MOVE ToStockMove( EnumStockState toState)
|
||
|
{
|
||
|
return new TB_STOCK_MOVE
|
||
|
{ BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
FromBatch = Batch,
|
||
|
ToBatch = Batch,
|
||
|
FromLocCode = LocCode,
|
||
|
ToLocCode = LocCode,
|
||
|
Qty = Qty,
|
||
|
FromState = State,
|
||
|
ToState = toState,
|
||
|
VendBatch = VendBatch,
|
||
|
VendId = VendId,
|
||
|
FromEqptCode = EqptCode,
|
||
|
ToEqptCode = EqptCode,
|
||
|
ToBarCode = BarCode
|
||
|
};
|
||
|
}
|
||
|
|
||
|
|
||
|
public StockIn ToStockIn(decimal inQty, EnumStockState state, string remark,EnumTransType transType)
|
||
|
{
|
||
|
return new StockIn
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
LocCode = LocCode,
|
||
|
State = state,
|
||
|
InQty = inQty,
|
||
|
Remark = remark,
|
||
|
TemplateDetail = this,
|
||
|
TransType = transType
|
||
|
|
||
|
};
|
||
|
}
|
||
|
|
||
|
|
||
|
public StockOut ToStockOut(decimal outQty,EnumTransType transType)
|
||
|
{
|
||
|
return new StockOut
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
LocCode = LocCode,
|
||
|
State = State,
|
||
|
OutQty = outQty,
|
||
|
TransType = transType
|
||
|
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_DETAIL ToNewStockDetail()
|
||
|
{
|
||
|
return new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = PartCode,
|
||
|
LocCode = LocCode,
|
||
|
AreaCode = AreaCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
VendId = VendId,
|
||
|
EqptCode = EqptCode,
|
||
|
PlanOrderId = PlanOrderId,
|
||
|
State = State,
|
||
|
Qty = 0,
|
||
|
Amount = Amount,
|
||
|
ProduceDate = ProduceDate,
|
||
|
OverdueDate = OverdueDate,
|
||
|
UpdateTime = UpdateTime,
|
||
|
UpdateQty = 0,
|
||
|
TracebackCode = TracebackCode,
|
||
|
ReceiveDate = ReceiveDate,
|
||
|
VendBatch = VendBatch,
|
||
|
|
||
|
VinState = VinState
|
||
|
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public class EnumTransType
|
||
|
{
|
||
|
public static implicit operator TransType(EnumTransType v)
|
||
|
{
|
||
|
throw new NotImplementedException();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TB_BILL
|
||
|
{
|
||
|
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TB_BILL ToInspectBill(EnumSubBillType subBillType)
|
||
|
{
|
||
|
return new TB_BILL
|
||
|
{
|
||
|
// BillNum = "IS."+this.BillNum,
|
||
|
SourceBillNum = BillNum,
|
||
|
SourceBillNum2 = SourceBillNum,
|
||
|
BillType = EnumBillType.Inspect,
|
||
|
OperName = OperName,
|
||
|
VendId = VendId,
|
||
|
SubBillType = subBillType,
|
||
|
GUID = Guid.NewGuid(),
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TB_MATERIAL_RECEIVE
|
||
|
{
|
||
|
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_DETAIL ToStockDetailIn(TB_BILL bill)
|
||
|
{
|
||
|
var part = WmsCache.GetPart(PartCode);
|
||
|
if (part == null)
|
||
|
{
|
||
|
throw new WmsException(ErrorCode.DataNotFound, PartCode, "零件未找到");
|
||
|
}
|
||
|
var stock = new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
EqptCode = EqptCode,
|
||
|
LocCode = ToLocCode,
|
||
|
AreaCode = WmsCache.GetAreaCode(ToLocCode),
|
||
|
Qty = Qty,
|
||
|
UpdateQty = Qty,
|
||
|
VendId = bill.VendId,
|
||
|
ProduceDate = ProduceDate,
|
||
|
OverdueDate = (ProduceDate).AddDays(WmsCache.GetValidateDays(PartCode)),
|
||
|
ReceiveDate = ReceiveDate,
|
||
|
VendBatch = VendBatch,
|
||
|
Remark = Remark
|
||
|
};
|
||
|
|
||
|
stock.State = part.InspectType == (int)InspectType.No ? EnumStockState.合格 : EnumStockState.待检;
|
||
|
|
||
|
|
||
|
return stock;
|
||
|
}
|
||
|
|
||
|
public TB_INSPECT ToInspect(TB_BILL bill)
|
||
|
{
|
||
|
|
||
|
return new TB_INSPECT
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
LocCode = ToLocCode,
|
||
|
InspectType = WmsCache.GetInspectType(PartCode),
|
||
|
ReceiveQty = Qty,
|
||
|
SampleQty = Qty,
|
||
|
InspQty = Qty,
|
||
|
PassQty = 0,
|
||
|
VendBatch = VendBatch,
|
||
|
VendId = VendId,
|
||
|
PoBillNum = PoBillNum,
|
||
|
PoLine = PoLineNum,
|
||
|
State = State,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public TB_PICK_FACT ToPickFact(TB_BILL bill, string fromLocCode,string toLocCode)
|
||
|
{
|
||
|
return new TB_PICK_FACT
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
FromLocCode = fromLocCode,
|
||
|
ToLocCode = toLocCode,
|
||
|
Qty = Qty,
|
||
|
EqptCode = EqptCode,
|
||
|
State = EnumStockState.合格,
|
||
|
VendId = bill.VendId,
|
||
|
VendBatch = VendBatch,
|
||
|
Remark = Remark
|
||
|
|
||
|
};
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
public partial class TB_PRODUCT_RECEIVE
|
||
|
{
|
||
|
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_DETAIL ToStockDetailIn()
|
||
|
{
|
||
|
var part = WmsCache.GetPart(PartCode);
|
||
|
if (part == null)
|
||
|
{
|
||
|
throw new WmsException(ErrorCode.DataNotFound, PartCode, $"零件号 {PartCode} 未找到");
|
||
|
}
|
||
|
if (part.State != PartState.A.ToString())
|
||
|
{
|
||
|
throw new WmsException(ErrorCode.DataNotFound, PartCode, $"零件状态 {part.State} 无法收货");
|
||
|
}
|
||
|
|
||
|
var detail = new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
|
||
|
Batch = Batch,
|
||
|
EqptCode = EqptCode,
|
||
|
LocCode = ToLocCode,
|
||
|
AreaCode = WmsCache.GetAreaCode(ToLocCode),
|
||
|
Qty = Qty,
|
||
|
UpdateQty = Qty,
|
||
|
ProduceDate = ProduceDate,
|
||
|
OverdueDate = (ProduceDate).AddDays(WmsCache.GetValidateDays(PartCode)),
|
||
|
ReceiveDate = ReceiveDate,
|
||
|
|
||
|
VendId = LineId,
|
||
|
TracebackCode = TraceBackCode,
|
||
|
Remark = Remark
|
||
|
};
|
||
|
if (GoodQty > 0)
|
||
|
{
|
||
|
if (WmsCache.Config.成品生成报检单)
|
||
|
{
|
||
|
detail.State = part.InspectType == (int) InspectType.No ? EnumStockState.合格 : EnumStockState.待检;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
detail.State = EnumStockState.合格;
|
||
|
}
|
||
|
}
|
||
|
else if (ScrapQty > 0)
|
||
|
detail.State = EnumStockState.生产报废;
|
||
|
else if (InvalidQty > 0)
|
||
|
detail.State = EnumStockState.其它报废;
|
||
|
|
||
|
|
||
|
return detail;
|
||
|
}
|
||
|
|
||
|
public TB_INSPECT ToInspect()
|
||
|
{
|
||
|
|
||
|
return new TB_INSPECT
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
LocCode = ToLocCode,
|
||
|
InspectType = WmsCache.GetInspectType(PartCode),
|
||
|
ReceiveQty = Qty,
|
||
|
InspQty = Qty,
|
||
|
SampleQty = Qty,
|
||
|
PassQty = 0,
|
||
|
State = State,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_DETAIL ToStockDetailOut()
|
||
|
{
|
||
|
var part = WmsCache.GetPart(PartCode);
|
||
|
if (part == null)
|
||
|
{
|
||
|
throw new WmsException(ErrorCode.DataNotFound, PartCode, $"零件号 {PartCode} 未找到");
|
||
|
}
|
||
|
if (part.State != PartState.A.ToString())
|
||
|
{
|
||
|
throw new WmsException(ErrorCode.DataNotFound, PartCode, $"零件状态 {part.State} 无法收货");
|
||
|
}
|
||
|
|
||
|
var detail = new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
|
||
|
Batch = Batch,
|
||
|
EqptCode = EqptCode,
|
||
|
LocCode = ToLocCode,
|
||
|
AreaCode = WmsCache.GetAreaCode(ToLocCode),
|
||
|
Qty = Qty,
|
||
|
UpdateQty = Qty,
|
||
|
ProduceDate = ProduceDate,
|
||
|
OverdueDate = (ProduceDate).AddDays(WmsCache.GetValidateDays(PartCode)),
|
||
|
ReceiveDate = ReceiveDate,
|
||
|
State = EnumStockState.合格,
|
||
|
VendId = LineId,
|
||
|
TracebackCode = TraceBackCode,
|
||
|
Remark = Remark
|
||
|
};
|
||
|
|
||
|
|
||
|
return detail;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TB_PRODUCT_SELL
|
||
|
{
|
||
|
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_DETAIL ToStockDetailOut()
|
||
|
{
|
||
|
return new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
|
||
|
Batch = Batch,
|
||
|
EqptCode = EqptCode,
|
||
|
LocCode = FromLocCode,
|
||
|
AreaCode = WmsCache.GetAreaCode(FromLocCode),
|
||
|
Qty = Qty,
|
||
|
UpdateQty = -Qty, //出库更新数量为负
|
||
|
State = EnumStockState.合格,
|
||
|
VendBatch = Batch
|
||
|
|
||
|
|
||
|
};
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
public partial class TB_STOCK_MOVE
|
||
|
{
|
||
|
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
private TS_STOCK_DETAIL ToStockDetailIn(TS_STOCK_DETAIL stockDetail )
|
||
|
{
|
||
|
if (stockDetail == null)
|
||
|
return new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode =string.IsNullOrEmpty(ToBarCode)?BarCode:ToBarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = ToBatch,
|
||
|
EqptCode = ToEqptCode,
|
||
|
LocCode = ToLocCode,
|
||
|
AreaCode = WmsCache.GetAreaCode(ToLocCode),
|
||
|
Qty = Qty,
|
||
|
UpdateQty = Qty,
|
||
|
// ProduceDate = this.ProduceDate,
|
||
|
// OverdueDate = (this.ProduceDate).AddDays(WmsCache.GetValidateDays(this.PartCode)),
|
||
|
State = ToState,
|
||
|
ReceiveDate = DateTime.Now,
|
||
|
VendBatch = VendBatch,
|
||
|
VendId = VendId
|
||
|
//TODO 以下字段如何获取
|
||
|
// TracebackCode = this.TracebackCode,
|
||
|
// VinState = this.VinState,
|
||
|
// Amount = this.Amount,
|
||
|
// UpdateTime = this.UpdateTime,
|
||
|
// PlanOrderId = this.PlanOrderId,
|
||
|
};
|
||
|
var detailIn = stockDetail.Clone();
|
||
|
detailIn.Qty = Qty;
|
||
|
detailIn.UpdateQty = Qty;
|
||
|
detailIn.EqptCode = ToEqptCode;
|
||
|
return detailIn;
|
||
|
}
|
||
|
|
||
|
public StockOut ToStockOut()
|
||
|
{
|
||
|
return new StockOut
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = FromBatch,
|
||
|
LocCode = FromLocCode,
|
||
|
State = FromState,
|
||
|
OutQty = Qty,
|
||
|
//TransType = EnumTransType.None,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public StockIn ToStockIn(TS_STOCK_DETAIL stockDetail)
|
||
|
{
|
||
|
//取得目标库位信息
|
||
|
string area = WmsCache.GetAreaCode(ToLocCode);
|
||
|
|
||
|
//获得设定的库存状态
|
||
|
var state = ToState;
|
||
|
|
||
|
//集中特殊处理的库位对应的状态
|
||
|
if (area == EnumStoreArea.HOLD.ToString())
|
||
|
{
|
||
|
state = EnumStockState.隔离;
|
||
|
}
|
||
|
else if (area == EnumStoreArea.SCRAP.ToString())
|
||
|
{
|
||
|
state = EnumStockState.生产报废;
|
||
|
}
|
||
|
else if (area == EnumStoreArea.INVALID.ToString())
|
||
|
{
|
||
|
state = EnumStockState.其它报废;
|
||
|
}
|
||
|
|
||
|
//生成对应的入库信息
|
||
|
var stockIn = new StockIn
|
||
|
{
|
||
|
BarCode =string.IsNullOrEmpty(ToBarCode)?BarCode:ToBarCode,
|
||
|
PartCode = PartCode,
|
||
|
LocCode = ToLocCode,
|
||
|
State = state,
|
||
|
InQty = Qty,
|
||
|
Remark = Remark,
|
||
|
TemplateDetail = ToStockDetailIn(stockDetail),
|
||
|
//TransType = EnumTransType.None
|
||
|
};
|
||
|
if (WmsCache.Config.线边库去批 && area == EnumStoreArea.WIP.ToString())
|
||
|
{
|
||
|
var part = WmsCache.GetPart(stockIn.TemplateDetail.PartCode);
|
||
|
|
||
|
var barcode = stockIn.TemplateDetail.PartCode + WmsCache.Config.空批次编号;
|
||
|
if (part.ManageType == EnumManageType.单包装)
|
||
|
barcode += ".";
|
||
|
stockIn.BarCode = barcode;
|
||
|
stockIn.TemplateDetail.BarCode = barcode;
|
||
|
stockIn.TemplateDetail.Batch = "";
|
||
|
}
|
||
|
|
||
|
return stockIn;
|
||
|
}
|
||
|
|
||
|
public TB_INSPECT ToInspect()
|
||
|
{
|
||
|
|
||
|
return new TB_INSPECT
|
||
|
{
|
||
|
BarCode = BarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = ToBatch,
|
||
|
LocCode = ToLocCode,
|
||
|
// InspectType = WmsCache.GetInspectType(PartCode),
|
||
|
InspectType = InspectType.All,
|
||
|
ReceiveQty = Qty,
|
||
|
InspQty = Qty,
|
||
|
SampleQty = Qty,
|
||
|
PassQty = 0,
|
||
|
State = ToState,
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TB_PACK_UNPACK
|
||
|
{
|
||
|
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_DETAIL ToStockDetailOut()
|
||
|
{
|
||
|
return new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = FromBarCode,
|
||
|
PartCode = PartCode,
|
||
|
|
||
|
Batch = Batch,
|
||
|
EqptCode = FromEqptCode,
|
||
|
LocCode = FromLocCode,
|
||
|
AreaCode = WmsCache.GetAreaCode(FromLocCode),
|
||
|
Qty = Qty,
|
||
|
UpdateQty = -Qty, //出库更新数量为负
|
||
|
ProduceDate = ProduceDate,
|
||
|
OverdueDate = ProduceDate.AddDays(WmsCache.GetValidateDays(PartCode)),
|
||
|
State = State,
|
||
|
ReceiveDate = DateTime.Now,
|
||
|
VendBatch = Batch
|
||
|
|
||
|
|
||
|
};
|
||
|
}
|
||
|
|
||
|
|
||
|
public TS_STOCK_DETAIL ToStockDetailIn(WmsEntities db)
|
||
|
{
|
||
|
|
||
|
var stockDetail = db.TS_STOCK_DETAIL.SingleOrDefault(p => p.BarCode == ToBarCode &&p.PartCode==PartCode && p.LocCode == ToLocCode && p.State == State);
|
||
|
if (stockDetail != null)
|
||
|
{
|
||
|
var detailIn = stockDetail.Clone();
|
||
|
detailIn.Qty = Qty;
|
||
|
detailIn.UpdateQty = Qty;
|
||
|
detailIn.EqptCode = ToEqptCode;
|
||
|
return detailIn;
|
||
|
}
|
||
|
return new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = ToBarCode,
|
||
|
PartCode = PartCode,
|
||
|
|
||
|
Batch = Batch,
|
||
|
EqptCode = ToEqptCode,
|
||
|
LocCode = ToLocCode,
|
||
|
AreaCode = WmsCache.GetAreaCode(ToLocCode),
|
||
|
Qty = Qty,
|
||
|
UpdateQty = Qty,
|
||
|
ReceiveDate = DateTime.Now,
|
||
|
ProduceDate = ProduceDate,
|
||
|
OverdueDate = (ProduceDate).AddDays(WmsCache.GetValidateDays(PartCode)),
|
||
|
State = State,
|
||
|
|
||
|
VendBatch = VendBatch,
|
||
|
VendId = VendId
|
||
|
//TODO 以下字段如何获取
|
||
|
// TracebackCode = this.TracebackCode,
|
||
|
// VinState = this.VinState,
|
||
|
// Amount = this.Amount,
|
||
|
// UpdateTime = this.UpdateTime,
|
||
|
// PlanOrderId = this.PlanOrderId,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public StockOut ToStockOut()
|
||
|
{
|
||
|
return new StockOut
|
||
|
{
|
||
|
BarCode = FromBarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
LocCode = FromLocCode,
|
||
|
State = State,
|
||
|
OutQty = Qty,
|
||
|
//TransType = EnumTransType.None,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public StockIn ToStockIn(WmsEntities db)
|
||
|
{
|
||
|
return new StockIn
|
||
|
{
|
||
|
BarCode = ToBarCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
LocCode = ToLocCode,
|
||
|
State = State,
|
||
|
InQty = Qty,
|
||
|
TemplateDetail = ToStockDetailIn(db),
|
||
|
Remark = Remark,
|
||
|
//TransType = EnumTransType.None
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TL_OPER
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TA_PART
|
||
|
{
|
||
|
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TA_PART_S ToS()
|
||
|
{
|
||
|
return new TA_PART_S
|
||
|
{
|
||
|
PartCode = PartCode,
|
||
|
ErpPartCode = ErpPartCode,
|
||
|
PartDesc1 = PartDesc1,
|
||
|
PartDesc2 = PartDesc2,
|
||
|
ProjectId = ProjectId,
|
||
|
Unit = Unit,
|
||
|
PartKind = PartKind,
|
||
|
ManageType = ManageType,
|
||
|
InspectType = InspectType,
|
||
|
State = State,
|
||
|
Configuration = Configuration,
|
||
|
LinesidePackQty = LinesidePackQty,
|
||
|
PartType = PartType,
|
||
|
DefaultReceiveLocCode = DefaultReceiveLocCode,
|
||
|
DistributionType = DistributionType,
|
||
|
PartGroup = PartGroup,
|
||
|
StockPackQty = StockPackQty
|
||
|
};
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
public partial class TA_STORE_LOCATION
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TA_BILLTYPE
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TA_CONFIG
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TS_INTERFACE
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TS_VIN
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TB_BILL ToBill(EnumBillType billType)
|
||
|
{
|
||
|
return new TB_BILL
|
||
|
{
|
||
|
BillType = billType,
|
||
|
OperName = CreateOper,
|
||
|
SourceBillNum = VinCode,
|
||
|
SourceBillNum2 = PlanOrderId,
|
||
|
ProjectId = ProjectId,
|
||
|
StartTime = CreateTime.ToString(),
|
||
|
GUID = Guid.NewGuid(),
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public TS_STOCK_DETAIL ToStockDetailIn(string toLocCode, decimal amount)
|
||
|
{
|
||
|
// var tsStockDetail = new TS_STOCK_DETAIL
|
||
|
// {
|
||
|
// BarCode = this.VinCode + "." + this.PartCode,
|
||
|
// PlanOrderId = this.PlanOrderId,
|
||
|
//
|
||
|
// PartCode = this.PartCode,
|
||
|
// Batch = this.Batch,
|
||
|
// EqptCode = this.EqptCode,
|
||
|
// LocCode = toLocCode,
|
||
|
// UpdateTime = DateTime.Now,
|
||
|
// // State = (int)VinState.Received,
|
||
|
// Amount = amount,
|
||
|
// Qty = 0,
|
||
|
// UpdateQty = 1,
|
||
|
// };
|
||
|
// var part = WmsCache.GetPart( this.PartCode);
|
||
|
return new TS_STOCK_DETAIL
|
||
|
{
|
||
|
BarCode = GetBarCode(),
|
||
|
PlanOrderId = PlanOrderId,
|
||
|
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
EqptCode = EqptCode,
|
||
|
LocCode = toLocCode,
|
||
|
AreaCode = WmsCache.GetAreaCode(toLocCode),
|
||
|
UpdateTime = DateTime.Now,
|
||
|
Amount = amount,
|
||
|
Qty = 1,
|
||
|
UpdateQty = 1,
|
||
|
ProduceDate = CreateTime,
|
||
|
OverdueDate = CreateTime.AddDays(WmsCache.GetValidateDays(PartCode)),
|
||
|
State = EnumStockState.合格,
|
||
|
ReceiveDate = DateTime.Now,
|
||
|
VinState = (int)VinState.Received,
|
||
|
Remark = ""
|
||
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
public TS_VIN_HIS ToVinHis()
|
||
|
{
|
||
|
return new TS_VIN_HIS
|
||
|
{
|
||
|
SourceId = SourceId,
|
||
|
EqptCode = EqptCode,
|
||
|
CreateOper = CreateOper,
|
||
|
CreateTime = CreateTime,
|
||
|
Flag = Flag,
|
||
|
VinCode = VinCode,
|
||
|
PartCode = PartCode,
|
||
|
ProjectId = WmsCache.GetProjectId(PartCode),
|
||
|
PlanOrderId = PlanOrderId,
|
||
|
Batch = Batch,
|
||
|
ExecTime = DateTime.Now,
|
||
|
ErrorCode = ErrorCode,
|
||
|
ErrorText = ErrorText
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public string GetBarCode()
|
||
|
{
|
||
|
return PartCode.Trim() + "." + Batch.Trim();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TS_VIN_HIS
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
public partial class TS_SORT_DETAIL
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
public TS_VIN ToTsVinReceive(string operName)
|
||
|
{
|
||
|
return new TS_VIN
|
||
|
{
|
||
|
CreateOper = operName,
|
||
|
CreateTime = DateTime.Now,
|
||
|
SourceId = BillNum,
|
||
|
EqptCode = "",
|
||
|
VinCode = VinCode,
|
||
|
Batch = VinCode,
|
||
|
Flag = 0,
|
||
|
PlanOrderId = SeqNum,
|
||
|
PartCode = PartCode,
|
||
|
ProjectId = ProjectId
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public TS_VIN ToTsVinDeliver(string operName)
|
||
|
{
|
||
|
return new TS_VIN
|
||
|
{
|
||
|
CreateOper = operName,
|
||
|
CreateTime = DateTime.Now,
|
||
|
SourceId = BillNum,
|
||
|
EqptCode = "",
|
||
|
VinCode = VinCode,
|
||
|
Batch = VinCode,
|
||
|
Flag = 1,
|
||
|
PlanOrderId = SeqNum,
|
||
|
PartCode = PartCode,
|
||
|
ProjectId = ProjectId
|
||
|
};
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
public partial class TR_BALANCE_COMPARE_VIN
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TA_VENDER
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
public partial class TS_UNI_API
|
||
|
{
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return EntitiesHelper.GetPropertiesString(this);
|
||
|
}
|
||
|
|
||
|
public TS_UNI_API_HIS ToHis()
|
||
|
{
|
||
|
return new TS_UNI_API_HIS
|
||
|
{
|
||
|
InterfaceType = InterfaceType,
|
||
|
TableName = TableName,
|
||
|
BillType = BillType,
|
||
|
SubBillType = SubBillType,
|
||
|
BillNum = BillNum,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
FromLoc = FromLoc,
|
||
|
ToLoc = ToLoc,
|
||
|
FromErpLoc = FromErpLoc,
|
||
|
ToErpLoc = ToErpLoc,
|
||
|
Qty = Qty,
|
||
|
GoodQty = GoodQty,
|
||
|
ScrapQty = ScrapQty,
|
||
|
InvalidQty = InvalidQty,
|
||
|
State = State,
|
||
|
CreateOper = CreateOper,
|
||
|
CreateTime = CreateTime,
|
||
|
PutTime = PutTime,
|
||
|
CustId = CustId,
|
||
|
VendId = VendId,
|
||
|
PoUnit = PoUnit,
|
||
|
LocUnit = LocUnit,
|
||
|
ValidDate = ValidDate,
|
||
|
ErpBillNum = ErpBillNum,
|
||
|
ErpLineNum = ErpLineNum,
|
||
|
EqptCode = EqptCode,
|
||
|
EqptType = EqptType,
|
||
|
VendBatch = VendBatch,
|
||
|
WorklineId = WorklineId,
|
||
|
ProcessId = ProcessId,
|
||
|
SourceBillNum = SourceBillNum
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TB_OFFICE_RECIVE
|
||
|
{
|
||
|
public StockIn ToStockIn(decimal inQty, TS_STOCK_DETAIL stockdetail, string remark = "")
|
||
|
{
|
||
|
return new StockIn
|
||
|
{
|
||
|
BarCode = PartCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
LocCode = ToLocCode,
|
||
|
State = stockdetail.State,
|
||
|
InQty = ReciveQty,
|
||
|
Remark = remark,
|
||
|
TemplateDetail = stockdetail,
|
||
|
//TransType = EnumTransType.None
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public partial class TB_OFFICE_OUT
|
||
|
{
|
||
|
public StockOut ToStockOut(TS_STOCK_DETAIL stockdetail)
|
||
|
{
|
||
|
return new StockOut()
|
||
|
{
|
||
|
BarCode = PartCode,
|
||
|
PartCode = PartCode,
|
||
|
Batch = Batch,
|
||
|
LocCode = FromLocCode,
|
||
|
State = stockdetail.State,
|
||
|
OutQty = OutQty,
|
||
|
//TransType = EnumTransType.Out
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
}
|