优化金蝶同步代码

This commit is contained in:
tongfei
2024-03-04 15:45:16 +08:00
parent 7aa23230d1
commit 4570b2080a
6 changed files with 27 additions and 4 deletions

View File

@@ -1077,6 +1077,11 @@
转换规则内码 转换规则内码
</summary> </summary>
</member> </member>
<member name="P:WMS.Web.Core.Dto.Erp.ErpPushDto.IsDraftWhenSaveFail">
<summary>
保存失败时是否暂存布尔类型默认false非必录 注(暂存的单据是没有编码的)
</summary>
</member>
<member name="T:WMS.Web.Core.Dto.Erp.ErpSave`1"> <member name="T:WMS.Web.Core.Dto.Erp.ErpSave`1">
<summary> <summary>
Erp同步数据时单据头 Erp同步数据时单据头

View File

@@ -52,5 +52,11 @@ namespace WMS.Web.Core.Dto.Erp
[JsonProperty("RuleId")] [JsonProperty("RuleId")]
public string RuleId { get; set; } public string RuleId { get; set; }
/// <summary>
/// 保存失败时是否暂存布尔类型默认false非必录 注(暂存的单据是没有编码的)
/// </summary>
[JsonProperty("IsDraftWhenSaveFail")]
public bool IsDraftWhenSaveFail { get; set; } = false;
} }
} }

View File

@@ -28,7 +28,7 @@ namespace WMS.Web.Domain.Options
/// erp-Id /// erp-Id
/// </summary> /// </summary>
public string ErpId { get; set; } public string ErpId { get; set; }
public readonly string cache_materail_all_key = "erp_materials_list_all";
public readonly string cache_materail_key = "erp_materials_list"; public readonly string cache_materail_key = "erp_materials_list";
public readonly string cache_org_key = "erp_org_list"; public readonly string cache_org_key = "erp_org_list";
public readonly string cache_supplier_key = "erp_supplier_list"; public readonly string cache_supplier_key = "erp_supplier_list";

View File

@@ -760,7 +760,8 @@ namespace WMS.Web.Domain.Services
RuleId = "PUR_PurchaseOrder-STK_InStock",//转换规则内码 采购订单下推采购入库单 RuleId = "PUR_PurchaseOrder-STK_InStock",//转换规则内码 采购订单下推采购入库单
FormId = FormIdParam.PUR_PurchaseOrder.ToString(), FormId = FormIdParam.PUR_PurchaseOrder.ToString(),
TargetFormId = FormIdParam.STK_InStock.ToString(), TargetFormId = FormIdParam.STK_InStock.ToString(),
DetailsId = s.ErpDetailId.ToString() DetailsId = s.ErpDetailId.ToString(),
IsDraftWhenSaveFail=true
}; };
//下推金蝶 //下推金蝶
var res = await this.Push(erpDto, s, entity.BillNo, scope); var res = await this.Push(erpDto, s, entity.BillNo, scope);

View File

@@ -323,6 +323,8 @@ namespace WMS.Web.Repositories
if (cr_ids.Count!=0) if (cr_ids.Count!=0)
query = query.Where(w => cr_ids.Contains(w.order.CreatorId)); query = query.Where(w => cr_ids.Contains(w.order.CreatorId));
else if (!string.IsNullOrEmpty(dto.Creator))
query = query.Where(w => w.order.CreatorId == 0);
if (dto.SupplierId.HasValue) if (dto.SupplierId.HasValue)
query = query.Where(w => w.detail.SupplierId == dto.SupplierId.Value); query = query.Where(w => w.detail.SupplierId == dto.SupplierId.Value);

View File

@@ -450,10 +450,14 @@ namespace WMS.Web.Repositories
List<int> ids_Receiver = new List<int>(); List<int> ids_Receiver = new List<int>();
List<int> ids_Operator = new List<int>(); List<int> ids_Operator = new List<int>();
if (!string.IsNullOrEmpty(dto.Receiver) || !string.IsNullOrEmpty(dto.Operator)) var staffList = await _basicsRepositories.GetStaffListAsync(_loginRepositories.CompanyId);
if (!string.IsNullOrEmpty(dto.Receiver))
{ {
var staffList = await _basicsRepositories.GetStaffListAsync(_loginRepositories.CompanyId);
ids_Receiver = staffList.Where(w => w.Name.Contains(dto.Receiver)).Select(s => s.Id).ToList(); ids_Receiver = staffList.Where(w => w.Name.Contains(dto.Receiver)).Select(s => s.Id).ToList();
}
if (!string.IsNullOrEmpty(dto.Operator))
{
ids_Operator = staffList.Where(w => w.Name.Contains(dto.Operator)).Select(s => s.Id).ToList(); ids_Operator = staffList.Where(w => w.Name.Contains(dto.Operator)).Select(s => s.Id).ToList();
} }
@@ -489,8 +493,13 @@ namespace WMS.Web.Repositories
if (ids_Receiver.Count() > 0) if (ids_Receiver.Count() > 0)
query = query.Where(w => ids_Receiver.Contains(w.order.ReceiverId ?? 0)); query = query.Where(w => ids_Receiver.Contains(w.order.ReceiverId ?? 0));
else if (!string.IsNullOrEmpty(dto.Receiver))
query = query.Where(w => w.order.ReceiverId == 0);
if (ids_Operator.Count() > 0) if (ids_Operator.Count() > 0)
query = query.Where(w => ids_Operator.Contains(w.order.ShelferId ?? 0)); query = query.Where(w => ids_Operator.Contains(w.order.ShelferId ?? 0));
else if (!string.IsNullOrEmpty(dto.Operator))
query = query.Where(w => w.order.ShelferId == 0);
if (dto.SupplierId.HasValue) if (dto.SupplierId.HasValue)
query = query.Where(w => w.detail.SupplierId == dto.SupplierId.Value); query = query.Where(w => w.detail.SupplierId == dto.SupplierId.Value);