diff --git a/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml b/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml
index 54f74613..a8d36b66 100644
--- a/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml
+++ b/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml
@@ -1081,6 +1081,46 @@
单据编码
+
+
+ 修改生产入库单
+
+
+
+
+ 单据Id
+
+
+
+
+ 明细
+
+
+
+
+ 明细
+
+
+
+
+ 明细Id
+
+
+
+
+ 生产订单号订单明细Id
+
+
+
+
+ 数量
+
+
+
+
+ 批号
+
+
修改采购入库单
diff --git a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml
index 559ac0f8..fafbaab4 100644
--- a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml
+++ b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml
@@ -5700,7 +5700,7 @@
-
+
下推
diff --git a/src/WMS.Web.Core/Dto/Erp/ErpPurchaseInStockSaveDto.cs b/src/WMS.Web.Core/Dto/Erp/ErpPurchaseInStockSaveDto.cs
index d66efa48..dbaea7ed 100644
--- a/src/WMS.Web.Core/Dto/Erp/ErpPurchaseInStockSaveDto.cs
+++ b/src/WMS.Web.Core/Dto/Erp/ErpPurchaseInStockSaveDto.cs
@@ -1,10 +1,74 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
+using System.Net;
using System.Text;
namespace WMS.Web.Core.Dto.Erp
{
+
+
+
+ ///
+ /// 修改生产入库单
+ ///
+ public class ErpProduceInStockSaveDto
+ {
+ public ErpProduceInStockSaveDto() { }
+ public ErpProduceInStockSaveDto(string id)
+ {
+ this.Id = id;
+ }
+
+ ///
+ /// 单据Id
+ ///
+ [JsonProperty("FID")]
+ public string Id { get; set; }
+
+ ///
+ /// 明细
+ ///
+ [JsonProperty("FEntity")]
+ public List Details { get; set; } = new List();
+ }
+
+ ///
+ /// 明细
+ ///
+ public class ErpProduceInStockDetailsSaveDto
+ {
+ ///
+ /// 明细Id
+ ///
+ [JsonProperty("FEntryID")]
+ public string DetailId { get; set; }
+ ///
+ /// 生产订单号订单明细Id
+ ///
+ [JsonIgnore]
+ public string FMoEntryId { get; set; }
+ ///
+ /// 数量
+ ///
+ [JsonProperty("FRealQty")]
+ public decimal Qty { get; set; }
+
+ public decimal FBaseRealQty { get; set; }
+
+ public decimal FStockRealQty { get; set; }
+ public decimal FBasePrdRealQty { get; set; }
+
+
+
+ ///
+ /// 批号
+ ///
+ [JsonProperty("FLot")]
+ public ErpLotSaveDto Lot { get; set; }
+ }
+
+
///
/// 修改采购入库单
///
diff --git a/src/WMS.Web.Domain/IService/Public/IErpService.cs b/src/WMS.Web.Domain/IService/Public/IErpService.cs
index 80bab256..cd69d631 100644
--- a/src/WMS.Web.Domain/IService/Public/IErpService.cs
+++ b/src/WMS.Web.Domain/IService/Public/IErpService.cs
@@ -26,7 +26,8 @@ namespace WMS.Web.Domain.IService.Public
///
///
Task> BillQueryForPurchaseInStock(string id);
-
+ Task> BillQueryForProduceInStock(string id);
+
///
///
///
diff --git a/src/WMS.Web.Domain/Services/InStockService.cs b/src/WMS.Web.Domain/Services/InStockService.cs
index 677b083c..7f616518 100644
--- a/src/WMS.Web.Domain/Services/InStockService.cs
+++ b/src/WMS.Web.Domain/Services/InStockService.cs
@@ -986,7 +986,7 @@ namespace WMS.Web.Domain.Services
else
{
//下推金蝶
- var res = await this.Push(erpDto, det, entity.BillNo, sc_erpService, sc_inStockRepositories);
+ var res = await this.Push(erpDto, det, entity.BillNo, sc_erpService, sc_inStockRepositories,"pur");
if (res.result.IsSuccess)
entity.SyncSuccess(det.ErpDetailId, loginInfo?.UserInfo?.StaffId ?? 0, res.erpBillNo);
else
@@ -1076,7 +1076,7 @@ namespace WMS.Web.Domain.Services
else
{
//下推金蝶
- var res = await this.Push(erpDto, det, entity.BillNo, sc_erpService, sc_inStockRepositories);
+ var res = await this.Push(erpDto, det, entity.BillNo, sc_erpService, sc_inStockRepositories, "prd");
if (res.result.IsSuccess)
entity.SyncSuccess(det.ErpDetailId, loginInfo?.UserInfo?.StaffId ?? 0, res.erpBillNo);
else
@@ -1100,12 +1100,14 @@ namespace WMS.Web.Domain.Services
///
///
///
- private async Task<(Result result, SyncStatus syncStatus, string erpBillNo, string instockDetailId)> Push(ErpPushDto dto, InStockErpDetails erpDetail, string billNo, IErpService sc_erpService, IInStockRepositories sc_inStockRepositories)
+ private async Task<(Result result, SyncStatus syncStatus, string erpBillNo, string instockDetailId)> Push(ErpPushDto dto, InStockErpDetails erpDetail, string billNo, IErpService sc_erpService, IInStockRepositories sc_inStockRepositories,string pushType)
{
var erp_instock_detId = string.Empty;
try
{
- _logger.LogInformation($"入库单->开始下推 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 数据: {JsonConvert.SerializeObject(dto)}");
+ if (pushType == "prd")
+ {
+ _logger.LogInformation($"入库单->开始下推 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 数据: {JsonConvert.SerializeObject(dto)}");
//下推动作
var res = await sc_erpService.Push(dto);
if (!res.IsSuccess)
@@ -1114,12 +1116,17 @@ namespace WMS.Web.Domain.Services
return (Result.ReFailure(res.Message, res.Status), SyncStatus.Fail, "", null);
}
string id = res.Data;
- var resPurchaseInStock = await sc_erpService.BillQueryForPurchaseInStock(id);
+ var resPurchaseInStock = await sc_erpService.BillQueryForProduceInStock(id);
var purchaseInStock = resPurchaseInStock.Data;
purchaseInStock.Details[0].Qty = erpDetail.Qty;
- string formId = dto.TargetFormId.ToString();
+ purchaseInStock.Details[0].FBaseRealQty = erpDetail.Qty;
+ purchaseInStock.Details[0].FStockRealQty = erpDetail.Qty;
+ purchaseInStock.Details[0].FBasePrdRealQty = erpDetail.Qty;
+ string formId = dto.TargetFormId.ToString();
erp_instock_detId = purchaseInStock.Details[0].DetailId;
+
+
//批号生成和同步
if (string.IsNullOrEmpty(erpDetail.BatchBillNo))
{
@@ -1149,32 +1156,113 @@ namespace WMS.Web.Domain.Services
}
//保存
_logger.LogInformation($"入库单->下推成功 开始保存 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 数据: {JsonConvert.SerializeObject(purchaseInStock)}");
- var res_s = await sc_erpService.Save(purchaseInStock, formId);
- if (!res_s.IsSuccess)
- {
- _logger.LogInformation($"入库单->保存失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{res_s.Message}");
- return (Result.ReFailure(res_s.Message, res_s.Status), SyncStatus.SubmitFail, "", purchaseInStock.Details[0].DetailId);
- }
+
+ var res_s = await sc_erpService.Save(purchaseInStock, formId);
+ if (!res_s.IsSuccess)
+ {
+ _logger.LogInformation($"入库单->保存失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{res_s.Message}");
+ return (Result.ReFailure(res_s.Message, res_s.Status), SyncStatus.SubmitFail, "", purchaseInStock.Details[0].DetailId);
+ }
- //提交
- _logger.LogInformation($"入库单->保存成功 开始提交 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}");
- ErpOperateDto o_dto = new ErpOperateDto(formId, res_s.Data);//res_s.Data
- var resSubmit = await sc_erpService.Submit(o_dto, formId);
- if (!resSubmit.IsSuccess)
- {
- _logger.LogInformation($"入库单->提交失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{resSubmit.Message}");
- return (resSubmit, SyncStatus.SubmitFail, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId);
+ //提交
+ _logger.LogInformation($"入库单->保存成功 开始提交 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}");
+ ErpOperateDto o_dto = new ErpOperateDto(formId, res_s.Data);//res_s.Data
+ var resSubmit = await sc_erpService.Submit(o_dto, formId);
+ if (!resSubmit.IsSuccess)
+ {
+ _logger.LogInformation($"入库单->提交失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{resSubmit.Message}");
+ return (resSubmit, SyncStatus.SubmitFail, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId);
+ }
+ //审核
+ _logger.LogInformation($"入库单->提交成功 开始审核 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}");
+ resSubmit = await sc_erpService.Audit(o_dto, formId);
+ if (!resSubmit.IsSuccess)
+ {
+ _logger.LogInformation($"入库单->审核失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{resSubmit.Message}");
+ return (resSubmit, SyncStatus.CheckFail, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId);
+ }
+ _logger.LogInformation($"入库单->同步金蝶成功->单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}");
+
+ return (Result.ReSuccess(), SyncStatus.Success, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId);
}
- //审核
- _logger.LogInformation($"入库单->提交成功 开始审核 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}");
- resSubmit = await sc_erpService.Audit(o_dto, formId);
- if (!resSubmit.IsSuccess)
+ else
{
- _logger.LogInformation($"入库单->审核失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{resSubmit.Message}");
- return (resSubmit, SyncStatus.CheckFail, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId);
+ _logger.LogInformation($"入库单->开始下推 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 数据: {JsonConvert.SerializeObject(dto)}");
+ //下推动作
+ var res = await sc_erpService.Push(dto);
+ if (!res.IsSuccess)
+ {
+ _logger.LogInformation($"入库单->下推失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{res.Message}");
+ return (Result.ReFailure(res.Message, res.Status), SyncStatus.Fail, "", null);
+ }
+ string id = res.Data;
+ var resPurchaseInStock = await sc_erpService.BillQueryForPurchaseInStock(id);
+ var purchaseInStock = resPurchaseInStock.Data;
+ purchaseInStock.Details[0].Qty = erpDetail.Qty;
+ string formId = dto.TargetFormId.ToString();
+ erp_instock_detId = purchaseInStock.Details[0].DetailId;
+
+
+ //批号生成和同步
+ if (string.IsNullOrEmpty(erpDetail.BatchBillNo))
+ {
+ var current_erp_material = await sc_erpService.BillQueryForMaterialByNumber(erpDetail.MaterialNumber);
+ if (current_erp_material != null && current_erp_material.IsBatchManage == true)
+ {
+ //1.获取最新的erp明细信息
+ var billNo_new = await sc_inStockRepositories.GetLastBillNo();
+ //erp明细:最新批号
+ int new_firstBillNo = billNo_new == null ? 0 : (billNo_new.FirstBillNo.HasValue ? billNo_new.FirstBillNo.Value : 0);
+ int new_lastBillNo = billNo_new == null ? 0 : (billNo_new.LastBillNo.HasValue ? billNo_new.LastBillNo.Value : 0);
+
+ //生成批号
+ erpDetail.GenerateBatchBillNo(new_firstBillNo, new_lastBillNo, current_erp_material.IsBatchManage);
+ //赋值批号
+ if (!string.IsNullOrEmpty(erpDetail.BatchBillNo))
+ {
+ purchaseInStock.Details[0].Lot = new ErpLotSaveDto();
+ purchaseInStock.Details[0].Lot.Number = erpDetail.BatchBillNo;
+ }
+ }
+ }
+ else
+ {
+ purchaseInStock.Details[0].Lot = new ErpLotSaveDto();
+ purchaseInStock.Details[0].Lot.Number = erpDetail.BatchBillNo;
+ }
+ //保存
+ _logger.LogInformation($"入库单->下推成功 开始保存 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 数据: {JsonConvert.SerializeObject(purchaseInStock)}");
+
+ var res_s = await sc_erpService.Save(purchaseInStock, formId);
+ if (!res_s.IsSuccess)
+ {
+ _logger.LogInformation($"入库单->保存失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{res_s.Message}");
+ return (Result.ReFailure(res_s.Message, res_s.Status), SyncStatus.SubmitFail, "", purchaseInStock.Details[0].DetailId);
+ }
+
+ //提交
+ _logger.LogInformation($"入库单->保存成功 开始提交 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}");
+ ErpOperateDto o_dto = new ErpOperateDto(formId, res_s.Data);//res_s.Data
+ var resSubmit = await sc_erpService.Submit(o_dto, formId);
+ if (!resSubmit.IsSuccess)
+ {
+ _logger.LogInformation($"入库单->提交失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{resSubmit.Message}");
+ return (resSubmit, SyncStatus.SubmitFail, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId);
+ }
+ //审核
+ _logger.LogInformation($"入库单->提交成功 开始审核 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}");
+ resSubmit = await sc_erpService.Audit(o_dto, formId);
+ if (!resSubmit.IsSuccess)
+ {
+ _logger.LogInformation($"入库单->审核失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{resSubmit.Message}");
+ return (resSubmit, SyncStatus.CheckFail, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId);
+ }
+ _logger.LogInformation($"入库单->同步金蝶成功->单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}");
+
+ return (Result.ReSuccess(), SyncStatus.Success, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId);
+
+
}
- _logger.LogInformation($"入库单->同步金蝶成功->单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}");
- return (Result.ReSuccess(), SyncStatus.Success, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId);
}
catch (Exception ex)
diff --git a/src/WMS.Web.Domain/Services/Public/ErpService.cs b/src/WMS.Web.Domain/Services/Public/ErpService.cs
index efe3e79c..430f755e 100644
--- a/src/WMS.Web.Domain/Services/Public/ErpService.cs
+++ b/src/WMS.Web.Domain/Services/Public/ErpService.cs
@@ -155,6 +155,73 @@ namespace WMS.Web.Domain.Services.Public
}
}
+
+ public async Task>> BillQueryForPurchaseInStockBy(string purchaseDetailId, List sourceBillNos)
+ {
+ try
+ {
+ //1.先登录金蝶-拿到token
+ var token_result = await this.Init();
+ if (!token_result.IsSuccess)
+ return Result>.ReFailure(token_result);
+
+
+ //3.获取金蝶采购订单:拼接参数和条件
+ var query = new ErpBillQueryDto(token_result.Data);
+ var param = new ErpBillQueryParamDto(FormIdParam.STK_InStock.ToString());
+ param.FieldKeys = "FID,FInStockEntry_FEntryID,FRealQty,FPOOrderNo,FBillNo,FDocumentStatus";
+ param.Limit = 10000;
+ param.FilterString = $"FPOORDERENTRYID={purchaseDetailId}";
+
+ //根据原订单号查询
+ if (sourceBillNos != null && sourceBillNos.Count() > 0)
+ {
+ param.FilterString = param.FilterString + " and FBillNo not in (";
+
+ var bill_str = "";
+ int bill_index = 0;
+ //var srt_b = JsonConvert.SerializeObject(sourceBillNos);
+ foreach (var bill in sourceBillNos)
+ {
+ bill_index++;
+ if (bill_index == sourceBillNos.Count)
+ bill_str = bill_str + $"'{bill}'";
+ else
+ bill_str = bill_str + $"'{bill}'" + ",";
+ }
+ param.FilterString = param.FilterString + bill_str + ")";
+ }
+
+ query.Data = JsonConvert.SerializeObject(param);
+ var json = JsonConvert.SerializeObject(query);
+
+ //4.请求查询接口
+ var result_json = await _client.ExecuteBillQueryAsync(json);
+ var result = JsonConvert.DeserializeObject>>(result_json);
+
+ //5.返回数据的组装
+ var erp_list = new List();
+ foreach (var item in result)
+ {
+ var lis = new ErpPurchaseInStockDetailsDto();
+ lis.OrderId = item[0];
+ lis.DetailId = item[1];
+ lis.Qty = Convert.ToDecimal(item[2]);
+ lis.PurchaseBillNo = item[3];
+ lis.OrderBillNo = item[4];
+ lis.DocumentStatus = item[5];
+ lis.PurchaseDetailId = purchaseDetailId;
+ erp_list.Add(lis);
+ }
+ return Result>.ReSuccess(erp_list);
+ }
+ catch (Exception ex)
+ {
+ return Result>.ReFailure(ResultCodes.Erp_BillQuery_Error);
+ }
+ }
+
+
///
/// erp:单据查询-采购入库单
///
@@ -3004,41 +3071,24 @@ namespace WMS.Web.Domain.Services.Public
}
}
- public async Task>> BillQueryForPurchaseInStockBy(string purchaseDetailId, List sourceBillNos)
+
+
+ public async Task> BillQueryForProduceInStock(string id)
{
try
{
//1.先登录金蝶-拿到token
var token_result = await this.Init();
if (!token_result.IsSuccess)
- return Result>.ReFailure(token_result);
+ return Result.ReFailure(token_result);
//3.获取金蝶采购订单:拼接参数和条件
var query = new ErpBillQueryDto(token_result.Data);
- var param = new ErpBillQueryParamDto(FormIdParam.STK_InStock.ToString());
- param.FieldKeys = "FID,FInStockEntry_FEntryID,FRealQty,FPOOrderNo,FBillNo,FDocumentStatus";
+ var param = new ErpBillQueryParamDto(FormIdParam.PRD_INSTOCK.ToString());
+ param.FieldKeys = "FID,FEntity_FEntryID,FRealQty";
param.Limit = 10000;
- param.FilterString = $"FPOORDERENTRYID={purchaseDetailId}";
-
- //根据原订单号查询
- if (sourceBillNos != null && sourceBillNos.Count() > 0)
- {
- param.FilterString = param.FilterString + " and FBillNo not in (";
-
- var bill_str = "";
- int bill_index = 0;
- //var srt_b = JsonConvert.SerializeObject(sourceBillNos);
- foreach (var bill in sourceBillNos)
- {
- bill_index++;
- if (bill_index == sourceBillNos.Count)
- bill_str = bill_str + $"'{bill}'";
- else
- bill_str = bill_str + $"'{bill}'" + ",";
- }
- param.FilterString = param.FilterString + bill_str + ")";
- }
+ param.FilterString = $"FID={id}";
query.Data = JsonConvert.SerializeObject(param);
var json = JsonConvert.SerializeObject(query);
@@ -3048,27 +3098,89 @@ namespace WMS.Web.Domain.Services.Public
var result = JsonConvert.DeserializeObject>>(result_json);
//5.返回数据的组装
- var erp_list = new List();
+ var erp_list = new ErpProduceInStockSaveDto(id);
foreach (var item in result)
{
- var lis = new ErpPurchaseInStockDetailsDto();
- lis.OrderId = item[0];
+ var lis = new ErpProduceInStockDetailsSaveDto();
lis.DetailId = item[1];
lis.Qty = Convert.ToDecimal(item[2]);
- lis.PurchaseBillNo = item[3];
- lis.OrderBillNo = item[4];
- lis.DocumentStatus = item[5];
- lis.PurchaseDetailId = purchaseDetailId;
- erp_list.Add(lis);
+ // lis.PurchaseDetailId = "";
+ erp_list.Details.Add(lis);
}
- return Result>.ReSuccess(erp_list);
+ return Result.ReSuccess(erp_list);
}
catch (Exception ex)
{
- return Result>.ReFailure(ResultCodes.Erp_BillQuery_Error);
+ return Result.ReFailure(ResultCodes.Erp_BillQuery_Error);
}
}
+
+ //public async Task>> BillQueryForProduceInStockBy(string purchaseDetailId, List sourceBillNos)
+ //{
+ // try
+ // {
+ // //1.先登录金蝶-拿到token
+ // var token_result = await this.Init();
+ // if (!token_result.IsSuccess)
+ // return Result>.ReFailure(token_result);
+
+
+ // //3.获取金蝶采购订单:拼接参数和条件
+ // var query = new ErpBillQueryDto(token_result.Data);
+ // var param = new ErpBillQueryParamDto(FormIdParam.PRD_INSTOCK.ToString());
+ // param.FieldKeys = "FID,FEntity_FEntryID,FRealQty,FMoBillNo,FBillNo,FDocumentStatus";
+ // param.Limit = 10000;
+ // param.FilterString = $"FMoEntryId={purchaseDetailId}";
+
+ // //根据原订单号查询
+ // if (sourceBillNos != null && sourceBillNos.Count() > 0)
+ // {
+ // param.FilterString = param.FilterString + " and FBillNo not in (";
+
+ // var bill_str = "";
+ // int bill_index = 0;
+ // //var srt_b = JsonConvert.SerializeObject(sourceBillNos);
+ // foreach (var bill in sourceBillNos)
+ // {
+ // bill_index++;
+ // if (bill_index == sourceBillNos.Count)
+ // bill_str = bill_str + $"'{bill}'";
+ // else
+ // bill_str = bill_str + $"'{bill}'" + ",";
+ // }
+ // param.FilterString = param.FilterString + bill_str + ")";
+ // }
+
+ // query.Data = JsonConvert.SerializeObject(param);
+ // var json = JsonConvert.SerializeObject(query);
+
+ // //4.请求查询接口
+ // var result_json = await _client.ExecuteBillQueryAsync(json);
+ // var result = JsonConvert.DeserializeObject>>(result_json);
+
+ // //5.返回数据的组装
+ // var erp_list = new List();
+ // foreach (var item in result)
+ // {
+ // var lis = new ErpPurchaseInStockDetailsDto();
+ // lis.OrderId = item[0];
+ // lis.DetailId = item[1];
+ // lis.Qty = Convert.ToDecimal(item[2]);
+ // lis.PurchaseBillNo = item[3];
+ // lis.OrderBillNo = item[4];
+ // lis.DocumentStatus = item[5];
+ // lis.PurchaseDetailId = purchaseDetailId;
+ // erp_list.Add(lis);
+ // }
+ // return Result>.ReSuccess(erp_list);
+ // }
+ // catch (Exception ex)
+ // {
+ // return Result>.ReFailure(ResultCodes.Erp_BillQuery_Error);
+ // }
+ //}
+
public async Task>> BillQueryForProduceInStockBy(string purchaseDetailId, List sourceBillNos)
{
try
@@ -3079,12 +3191,12 @@ namespace WMS.Web.Domain.Services.Public
return Result>.ReFailure(token_result);
- //3.获取金蝶采购订单:拼接参数和条件
+ //3.获取金蝶生产汇报订单:拼接参数和条件
var query = new ErpBillQueryDto(token_result.Data);
- var param = new ErpBillQueryParamDto(FormIdParam.PRD_INSTOCK.ToString());
- param.FieldKeys = "FID,FInStockEntry_FEntryID,FRealQty,FMoBillNo,FBillNo,FDocumentStatus";
+ var param = new ErpBillQueryParamDto(FormIdParam.PRD_MORPT.ToString());
+ param.FieldKeys = "FID,FEntity_FEntryID,FQuaQty,FMoBillNo,FBillNo,FDocumentStatus";
param.Limit = 10000;
- param.FilterString = $"FMoEntryId={purchaseDetailId}";
+ param.FilterString = $"FEntryID={purchaseDetailId}";
//根据原订单号查询
if (sourceBillNos != null && sourceBillNos.Count() > 0)