This commit is contained in:
2025-08-28 19:23:07 +08:00
parent 2066763c90
commit e3cf45c336
4 changed files with 80 additions and 61 deletions

View File

@@ -582,8 +582,30 @@ namespace Pilot_KD_Parino.Sal_Order
{
IOperationResult result = new OperationResult();
//获取单据转换规则
ConvertRuleElement ruleElement = ServiceHelper.GetService<IConvertService>().GetConvertRules(this.Context, source, target).FirstOrDefault();
ConvertRuleElement ruleElement;
var ruleElementList = ServiceHelper.GetService<IConvertService>().GetConvertRules(this.Context, source, target).ToList();
if (source == "PUR_PurchaseOrder" && target== "PUR_ReceiveBill")
{
ruleElement = ruleElementList.Where(t => t.OriginKey == "cc8862d6-9368-4f7d-bc83-38ce217b6ba1").FirstOrDefault();
}
else if (source == "PUR_ReceiveBill" && target == "STK_InStock")
{
ruleElement = ruleElementList.Where(t => t.OriginKey == "e51ffa3e-3a6f-4084-8868-9370f5977bcc").FirstOrDefault();
}
else if (source == "SAL_SaleOrder" && target == "SAL_DELIVERYNOTICE")
{
ruleElement = ruleElementList.Where(t => t.OriginKey == "9090ab67-7255-4a33-a457-a70fa2d90536").FirstOrDefault();
}
else if (source == "SAL_DELIVERYNOTICE" && target == "SAL_OUTSTOCK")
{
ruleElement = ruleElementList.Where(t => t.OriginKey == "59bef03a-5c03-426b-8cc3-7631d11a951b").FirstOrDefault();
}
else
ruleElement = ServiceHelper.GetService<IConvertService>().GetConvertRules(this.Context, source, target).FirstOrDefault();
//如下代码 直接通过查询数据库获取单据转换源单数据
ListSelectedRowCollection rows = new ListSelectedRowCollection();
int i = 0;