0
This commit is contained in:
@@ -1,18 +1,19 @@
|
|||||||
using Gatedge.NewOrientLandMark.BOS.Services;
|
using System;
|
||||||
using Kingdee.BOS.App;
|
|
||||||
using Kingdee.BOS.Contracts;
|
|
||||||
using Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn;
|
|
||||||
using Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn.Args;
|
|
||||||
using Kingdee.BOS.Core.Metadata.FieldElement;
|
|
||||||
using Kingdee.BOS.Orm.DataEntity;
|
|
||||||
using Kingdee.BOS.ServiceHelper;
|
|
||||||
using Kingdee.BOS.Util;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Gatedge.NewOrientLandMark.BOS.Services;
|
||||||
|
using Kingdee.BOS.App;
|
||||||
|
using Kingdee.BOS.Contracts;
|
||||||
|
using Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn;
|
||||||
|
using Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn.Args;
|
||||||
|
using Kingdee.BOS.Core.Metadata.FieldElement;
|
||||||
|
using Kingdee.BOS.Log;
|
||||||
|
using Kingdee.BOS.Orm.DataEntity;
|
||||||
|
using Kingdee.BOS.ServiceHelper;
|
||||||
|
using Kingdee.BOS.Util;
|
||||||
|
|
||||||
namespace Gatedge.NewOrientLandMark.BOS.PlugIn.PUR_PurchaseOrder.ConvertPlugIn
|
namespace Gatedge.NewOrientLandMark.BOS.PlugIn.PUR_PurchaseOrder.ConvertPlugIn
|
||||||
{
|
{
|
||||||
@@ -65,7 +66,8 @@ namespace Gatedge.NewOrientLandMark.BOS.PlugIn.PUR_PurchaseOrder.ConvertPlugIn
|
|||||||
e.TargetBusinessInfo.GetField("FStockId") as BaseDataField;
|
e.TargetBusinessInfo.GetField("FStockId") as BaseDataField;
|
||||||
BaseDataField StockStatusField =
|
BaseDataField StockStatusField =
|
||||||
e.TargetBusinessInfo.GetField("FStockStatusId") as BaseDataField;
|
e.TargetBusinessInfo.GetField("FStockStatusId") as BaseDataField;
|
||||||
|
BaseDataField LotField =
|
||||||
|
e.TargetBusinessInfo.GetField("FLot") as BaseDataField;
|
||||||
IViewService service = ServiceHelper.GetService<IViewService>();
|
IViewService service = ServiceHelper.GetService<IViewService>();
|
||||||
//根据内码获取物料基础资料对象
|
//根据内码获取物料基础资料对象
|
||||||
var org = bill.DataEntity["StockOrgId"] as DynamicObject; // 调出组织
|
var org = bill.DataEntity["StockOrgId"] as DynamicObject; // 调出组织
|
||||||
@@ -91,7 +93,7 @@ namespace Gatedge.NewOrientLandMark.BOS.PlugIn.PUR_PurchaseOrder.ConvertPlugIn
|
|||||||
var unitId = Convert.ToInt64(item["UnitId_Id"]); // 主单位
|
var unitId = Convert.ToInt64(item["UnitId_Id"]); // 主单位
|
||||||
var priceUnitId = Convert.ToInt64(item["PriceUnitID_Id"]); // 计价单位
|
var priceUnitId = Convert.ToInt64(item["PriceUnitID_Id"]); // 计价单位
|
||||||
var remainInStockUnitId = Convert.ToInt64(item["RemainInStockUnitId_Id"]); // 采购单位
|
var remainInStockUnitId = Convert.ToInt64(item["RemainInStockUnitId_Id"]); // 采购单位
|
||||||
var baseUnitId = Convert.ToInt64(material["BaseUnitID_Id"]); // 基础单位
|
var baseUnitId = Convert.ToInt64(item["BaseUnitID_Id"]); // 基础单位
|
||||||
//var snUnitId = Convert.ToInt64(item["SNUnitID_Id"]); // 序列号单位
|
//var snUnitId = Convert.ToInt64(item["SNUnitID_Id"]); // 序列号单位
|
||||||
var qty = Convert.ToDecimal(CustomParams["InStockQty"]);
|
var qty = Convert.ToDecimal(CustomParams["InStockQty"]);
|
||||||
item["RealQty"] = qty; // 填写实收数
|
item["RealQty"] = qty; // 填写实收数
|
||||||
@@ -112,19 +114,27 @@ namespace Gatedge.NewOrientLandMark.BOS.PlugIn.PUR_PurchaseOrder.ConvertPlugIn
|
|||||||
{
|
{
|
||||||
var BaseRealQty = unitService.GetQtyByUtilConverRate(materialId, unitId, baseUnitId, qty);
|
var BaseRealQty = unitService.GetQtyByUtilConverRate(materialId, unitId, baseUnitId, qty);
|
||||||
item["RemainInStockBaseQty"] = BaseRealQty;
|
item["RemainInStockBaseQty"] = BaseRealQty;
|
||||||
|
item["BaseUnitQty"] = BaseRealQty;
|
||||||
}
|
}
|
||||||
|
|
||||||
var lotId = CustomParams["FLot_Id"].ToString();
|
var lotId = CustomParams["FLot_Id"].ToString();
|
||||||
var lotText = CustomParams["FLot_Text"].ToString();
|
var lotText = CustomParams["FLot_Text"]?.ToString().Trim();
|
||||||
// 如果批号不为空,则赋值
|
// 如果批号不为空,则赋值
|
||||||
if (!lotText.IsNullOrEmpty())
|
if (!lotText.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
if (!lotId.IsNullOrEmpty())
|
// 如果批号Id不为空,赋值批号
|
||||||
|
if (!lotId.IsNullOrEmpty() && lotId != "0")
|
||||||
{
|
{
|
||||||
|
var lot = service.LoadSingle(this.Context, lotId, LotField.RefFormDynamicObjectType);
|
||||||
|
item["Lot_Id"] = lot["Id"];
|
||||||
|
item["Lot"] = lot;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item["Lot_Text"] = lotText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new Exception("1111");
|
//throw new Exception("1111");
|
||||||
//if (snUnitId != 0)
|
//if (snUnitId != 0)
|
||||||
//{
|
//{
|
||||||
// var snQty = unitService.GetQtyByUtilConverRate(materialId, unitId, snUnitId, qty);
|
// var snQty = unitService.GetQtyByUtilConverRate(materialId, unitId, snUnitId, qty);
|
||||||
|
|||||||
Reference in New Issue
Block a user