This commit is contained in:
tongfei
2024-04-09 15:35:22 +08:00
parent 54c472fdd8
commit 0d3f14372e
2 changed files with 20 additions and 18 deletions

View File

@@ -796,25 +796,25 @@ namespace WMS.Web.Domain.Services
var purchaseInStock = resPurchaseInStock.Data;
purchaseInStock.Details[0].Qty = erpDetail.Qty;
//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);
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);
// _logger.LogInformation($"入库单->批号{erpDetail.BatchBillNo}");
// if (!string.IsNullOrEmpty(erpDetail.BatchBillNo))
// purchaseInStock.Details[0].Lot = erpDetail.BatchBillNo;
// }
//}
//else
// purchaseInStock.Details[0].Lot = erpDetail.BatchBillNo;
erpDetail.GenerateBatchBillNo(new_firstBillNo, new_lastBillNo, current_erp_material.IsBatchManage);
_logger.LogInformation($"入库单->批号{erpDetail.BatchBillNo}");
if (!string.IsNullOrEmpty(erpDetail.BatchBillNo))
purchaseInStock.Details[0].Lot = erpDetail.BatchBillNo;
}
}
else
purchaseInStock.Details[0].Lot = erpDetail.BatchBillNo;
string formId = dto.TargetFormId.ToString();
_logger.LogInformation($"入库单->开始同步金蝶 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 数据: {JsonConvert.SerializeObject(dto)}");

View File

@@ -1565,6 +1565,8 @@ namespace WMS.Web.Domain.Services.Public
var query = new ErpBillQueryDto(token_result.Data, formId);
var param = new ErpSave<T>(formId, dto);
query.Data = JsonConvert.SerializeObject(param);
_logger.LogInformation("同步数据保存:测试" + JsonConvert.SerializeObject(query));
//保存
var result_json = await _client.SaveAsync(JsonConvert.SerializeObject(query));