优化金蝶同步代码
This commit is contained in:
@@ -1077,6 +1077,11 @@
|
||||
转换规则内码
|
||||
</summary>
|
||||
</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">
|
||||
<summary>
|
||||
Erp同步数据时单据头
|
||||
|
||||
@@ -52,5 +52,11 @@ namespace WMS.Web.Core.Dto.Erp
|
||||
[JsonProperty("RuleId")]
|
||||
public string RuleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 保存失败时是否暂存,布尔类型,默认false(非必录) 注(暂存的单据是没有编码的)
|
||||
/// </summary>
|
||||
[JsonProperty("IsDraftWhenSaveFail")]
|
||||
public bool IsDraftWhenSaveFail { get; set; } = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace WMS.Web.Domain.Options
|
||||
/// erp-Id
|
||||
/// </summary>
|
||||
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_org_key = "erp_org_list";
|
||||
public readonly string cache_supplier_key = "erp_supplier_list";
|
||||
|
||||
@@ -760,7 +760,8 @@ namespace WMS.Web.Domain.Services
|
||||
RuleId = "PUR_PurchaseOrder-STK_InStock",//转换规则内码 采购订单下推采购入库单
|
||||
FormId = FormIdParam.PUR_PurchaseOrder.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);
|
||||
|
||||
@@ -323,6 +323,8 @@ namespace WMS.Web.Repositories
|
||||
|
||||
if (cr_ids.Count!=0)
|
||||
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)
|
||||
query = query.Where(w => w.detail.SupplierId == dto.SupplierId.Value);
|
||||
|
||||
@@ -450,10 +450,14 @@ namespace WMS.Web.Repositories
|
||||
|
||||
List<int> ids_Receiver = 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))
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -489,8 +493,13 @@ namespace WMS.Web.Repositories
|
||||
|
||||
if (ids_Receiver.Count() > 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)
|
||||
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)
|
||||
query = query.Where(w => w.detail.SupplierId == dto.SupplierId.Value);
|
||||
|
||||
Reference in New Issue
Block a user