改了领料出库
This commit is contained in:
Binary file not shown.
@@ -5477,7 +5477,7 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.OutStockTask.GetOutStockTaskByNoResponse.Type">
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.GetOutStockTaskByNoResponse.Type">
|
||||||
<summary>
|
<summary>
|
||||||
单据类型 1 销售出库,2 其他出库,3 直接调拨出库,4 分步式调出,5 组装拆卸出库
|
单据类型 1 销售出库,2 其他出库,3 直接调拨出库,4 分步式调出,5 组装拆卸出库,6.领料出库
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.OutStockTask.GetOutStockTaskByNoResponse.BillNo">
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.GetOutStockTaskByNoResponse.BillNo">
|
||||||
|
|||||||
@@ -4455,6 +4455,12 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.IService.Public.IErpService.BillQueryForPickingOutStock(System.Collections.Generic.List{System.String},System.Nullable{System.DateTime},System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
erp:单据查询-领料出库单
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.IService.Public.IErpService.BillQueryForSalOutStock(System.String)">
|
<member name="M:WMS.Web.Domain.IService.Public.IErpService.BillQueryForSalOutStock(System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
erp:查询销售出库单信息
|
erp:查询销售出库单信息
|
||||||
@@ -6018,6 +6024,14 @@
|
|||||||
<param name="sourceBillNos"></param>
|
<param name="sourceBillNos"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Services.OutStockTaskService.BillQueryForPickingOutStock(System.Boolean,System.Collections.Generic.List{System.String},System.Nullable{System.DateTime})">
|
||||||
|
<summary>
|
||||||
|
生产领料出库
|
||||||
|
</summary>
|
||||||
|
<param name="isTransaction"></param>
|
||||||
|
<param name="sourceBillNos"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.Services.OutStockTaskService.BillQueryForTransferOutOutStock(System.Boolean,System.Collections.Generic.List{System.String},System.Nullable{System.DateTime})">
|
<member name="M:WMS.Web.Domain.Services.OutStockTaskService.BillQueryForTransferOutOutStock(System.Boolean,System.Collections.Generic.List{System.String},System.Nullable{System.DateTime})">
|
||||||
<summary>
|
<summary>
|
||||||
分布式调出
|
分布式调出
|
||||||
@@ -7358,6 +7372,11 @@
|
|||||||
生产入库单(来源于生产汇报单)
|
生产入库单(来源于生产汇报单)
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="F:WMS.Web.Domain.Values.Erp.FormIdParam.PRD_PickMtrl">
|
||||||
|
<summary>
|
||||||
|
领料出库单(来源于普通领料出库单)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Values.ExportStatus">
|
<member name="T:WMS.Web.Domain.Values.ExportStatus">
|
||||||
<summary>
|
<summary>
|
||||||
文件导出状态
|
文件导出状态
|
||||||
@@ -7698,6 +7717,11 @@
|
|||||||
组装拆卸出库
|
组装拆卸出库
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="F:WMS.Web.Domain.Values.OutStockType.PickingOut">
|
||||||
|
<summary>
|
||||||
|
领料出库
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Values.ProductInventoryType">
|
<member name="T:WMS.Web.Domain.Values.ProductInventoryType">
|
||||||
<summary>
|
<summary>
|
||||||
成品即时库存类型
|
成品即时库存类型
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace WMS.Web.Core.Dto.OutStockTask
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单据类型 1 销售出库,2 其他出库,3 直接调拨出库,4 分步式调出,5 组装拆卸出库
|
/// 单据类型 1 销售出库,2 其他出库,3 直接调拨出库,4 分步式调出,5 组装拆卸出库,6.领料出库
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Type { get; set; }
|
public int Type { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -120,6 +120,14 @@ namespace WMS.Web.Domain.IService.Public
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ResultList<ErpDeliveryNoticeOutStockResultDto>> BillQueryForSalOutStock(List<string> sourceBillNos = null, DateTime? beginTime = null, bool isCheck = true);
|
Task<ResultList<ErpDeliveryNoticeOutStockResultDto>> BillQueryForSalOutStock(List<string> sourceBillNos = null, DateTime? beginTime = null, bool isCheck = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// erp:单据查询-领料出库单
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ResultList<ErpDeliveryNoticeOutStockResultDto>> BillQueryForPickingOutStock(List<string> sourceBillNos = null, DateTime? beginTime = null, bool isCheck = true);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// erp:查询销售出库单信息
|
/// erp:查询销售出库单信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -347,6 +347,22 @@ namespace WMS.Web.Domain.Services
|
|||||||
|
|
||||||
return await this.SsynDate(erp_result.Data.ToList(), isTransaction);
|
return await this.SsynDate(erp_result.Data.ToList(), isTransaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生产领料出库
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="isTransaction"></param>
|
||||||
|
/// <param name="sourceBillNos"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<Result> BillQueryForPickingOutStock(bool isTransaction, List<string> sourceBillNos = null, DateTime? beginTime = null)
|
||||||
|
{
|
||||||
|
var erp_result = await _erpService.BillQueryForPickingOutStock(sourceBillNos, beginTime);
|
||||||
|
if (!erp_result.IsSuccess)
|
||||||
|
return Result.ReFailure(erp_result.Message, erp_result.Status);
|
||||||
|
|
||||||
|
return await this.SsynDate(erp_result.Data.ToList(), isTransaction);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分布式调出
|
/// 分布式调出
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -397,6 +413,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
|
|
||||||
return await this.SsynDate(erp_result.Data.ToList(), isTransaction);
|
return await this.SsynDate(erp_result.Data.ToList(), isTransaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 销售出库单
|
/// 销售出库单
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -449,6 +466,10 @@ namespace WMS.Web.Domain.Services
|
|||||||
result = await BillQueryForMisDeliveryOutStock(false, null, begin);
|
result = await BillQueryForMisDeliveryOutStock(false, null, begin);
|
||||||
if (!result.IsSuccess) isRollback = true;
|
if (!result.IsSuccess) isRollback = true;
|
||||||
|
|
||||||
|
result = await BillQueryForPickingOutStock(false, null, begin);
|
||||||
|
if (!result.IsSuccess) isRollback = true;
|
||||||
|
|
||||||
|
|
||||||
//更新时间管理
|
//更新时间管理
|
||||||
//isSuccess = await _erpOpsSyncDateRepositories.Edit(ErpOpsSyncType.OutStock, false);
|
//isSuccess = await _erpOpsSyncDateRepositories.Edit(ErpOpsSyncType.OutStock, false);
|
||||||
//if (!isSuccess) isRollback = true;
|
//if (!isSuccess) isRollback = true;
|
||||||
@@ -470,6 +491,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
List<string> TransferOut_Nos = new List<string>();
|
List<string> TransferOut_Nos = new List<string>();
|
||||||
List<string> AssembledApp_Nos = new List<string>();
|
List<string> AssembledApp_Nos = new List<string>();
|
||||||
List<string> MisDeliveryOut_Nos = new List<string>();
|
List<string> MisDeliveryOut_Nos = new List<string>();
|
||||||
|
List<string> PickingOut_Nos = new List<string>();
|
||||||
var taskList = await _outStockTaskRepositories.GetListByBillNo(billNos);
|
var taskList = await _outStockTaskRepositories.GetListByBillNo(billNos);
|
||||||
foreach (var entity in taskList)
|
foreach (var entity in taskList)
|
||||||
{
|
{
|
||||||
@@ -483,6 +505,9 @@ namespace WMS.Web.Domain.Services
|
|||||||
AssembledApp_Nos.AddRange(entity.Details.SelectMany(s => s.ErpDetails).Select(s => s.SourceBillNo));
|
AssembledApp_Nos.AddRange(entity.Details.SelectMany(s => s.ErpDetails).Select(s => s.SourceBillNo));
|
||||||
else if (entity.Type == OutStockType.Miscellaneous)
|
else if (entity.Type == OutStockType.Miscellaneous)
|
||||||
MisDeliveryOut_Nos.AddRange(entity.Details.SelectMany(s => s.ErpDetails).Select(s => s.SourceBillNo));
|
MisDeliveryOut_Nos.AddRange(entity.Details.SelectMany(s => s.ErpDetails).Select(s => s.SourceBillNo));
|
||||||
|
else if (entity.Type == OutStockType.PickingOut)
|
||||||
|
PickingOut_Nos.AddRange(entity.Details.SelectMany(s => s.ErpDetails).Select(s => s.SourceBillNo));
|
||||||
|
|
||||||
}
|
}
|
||||||
if (TransferOut_Nos.Count() > 0)
|
if (TransferOut_Nos.Count() > 0)
|
||||||
{
|
{
|
||||||
@@ -511,6 +536,12 @@ namespace WMS.Web.Domain.Services
|
|||||||
result = await BillQueryForMisDeliveryOutStock(false, MisDeliveryOut_Nos);
|
result = await BillQueryForMisDeliveryOutStock(false, MisDeliveryOut_Nos);
|
||||||
if (!result.IsSuccess) isRollback = true;
|
if (!result.IsSuccess) isRollback = true;
|
||||||
}
|
}
|
||||||
|
if (PickingOut_Nos.Count() > 0)
|
||||||
|
{
|
||||||
|
result = await BillQueryForPickingOutStock(false, MisDeliveryOut_Nos);
|
||||||
|
if (!result.IsSuccess) isRollback = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//4.提交事务
|
//4.提交事务
|
||||||
|
|||||||
@@ -2102,6 +2102,107 @@ namespace WMS.Web.Domain.Services.Public
|
|||||||
return ResultList<ErpDeliveryNoticeOutStockResultDto>.ReFailure(ResultCodes.Erp_BillQuery_Error);
|
return ResultList<ErpDeliveryNoticeOutStockResultDto>.ReFailure(ResultCodes.Erp_BillQuery_Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<ResultList<ErpDeliveryNoticeOutStockResultDto>> BillQueryForPickingOutStock(List<string> sourceBillNos = null, DateTime? beginTime = null, bool isCheck = true)
|
||||||
|
{
|
||||||
|
string result_json = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
var stocks = await _basicsRepositories.GetUcStockAsync(ManagementSystemCode.GLXT0004.ToString(), "", _appOptions.CompanyId);
|
||||||
|
if (stocks.Count == 0)
|
||||||
|
return ResultList<ErpDeliveryNoticeOutStockResultDto>.ReFailure(ResultCodes.ErpStockNoData);
|
||||||
|
//var stocks_codes = string.Join(",",stocks.Select(x => x.Id));
|
||||||
|
var stocks_codes = string.Join(",", stocks.Select(x => $"'{x.Code}'"));
|
||||||
|
var stocks_orgs = string.Join(",", stocks.Select(x => $"'{x.ErpOrgCode}'"));
|
||||||
|
|
||||||
|
//1.先登录金蝶-拿到token
|
||||||
|
var token_result = await this.Init();
|
||||||
|
if (!token_result.IsSuccess)
|
||||||
|
return ResultList<ErpDeliveryNoticeOutStockResultDto>.ReFailure(token_result);
|
||||||
|
|
||||||
|
//2.时间条件:可能还有其它条件
|
||||||
|
|
||||||
|
var beginStr = DateTime.Now.AddYears(-30).ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
if (beginTime != null) beginStr = beginTime?.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
var endStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
//3.获取金蝶采购订单:拼接参数和条件
|
||||||
|
var query = new ErpBillQueryDto(token_result.Data);
|
||||||
|
var param = new ErpBillQueryParamDto(FormIdParam.PRD_PickMtrl.ToString());
|
||||||
|
param.FieldKeys = "FBillNo,FOrderNo,FDeliveryOrgID,FCustomerID,FMaterialID.FNumber,FStockID.FNumber,FStockLocID,FQty,F_ENTRYREMARKS,FCreateDate,FEntity_FEntryID,FDeliveryOrgID.FNumber";//FEntryID
|
||||||
|
param.Limit = 10000;
|
||||||
|
//查询条件:备注其中的条件值以金蝶的值为准!!!
|
||||||
|
//1.创建时间在两天前和当天时间之间
|
||||||
|
//2.审核状态:已审核
|
||||||
|
//3.未出库数量>0
|
||||||
|
//4.日期>=系统上线之日
|
||||||
|
//5.仓库:wms系统的仓库值---现在这个没有加,因为还单点没有和金蝶同步
|
||||||
|
//6.物料 物料属性=费用或资产或服务的排除 不拉取
|
||||||
|
param.FilterString = " 1=1";
|
||||||
|
if (isCheck) param.FilterString += " and FDocumentStatus='C'";
|
||||||
|
param.FilterString += " and FRemainOutQty>=0";
|
||||||
|
param.FilterString += " and FMaterialID.FERPCLSID not in (10,11,6)";
|
||||||
|
//param.FilterString += " and FStockID.FNumber in (" + stocks_codes + ")";
|
||||||
|
//param.FilterString += " and FDeliveryOrgID.FNumber in (" + stocks_orgs + ")";
|
||||||
|
for (int i = 0; i < stocks.Count(); i++)
|
||||||
|
{
|
||||||
|
if (i == 0)
|
||||||
|
{
|
||||||
|
param.FilterString += " and (";
|
||||||
|
param.FilterString += $"(FStockID.FNumber='{stocks[i].Code}' and FDeliveryOrgID.FNumber='{stocks[i].ErpOrgCode}')";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
param.FilterString += $" or (FStockID.FNumber='{stocks[i].Code}' and FDeliveryOrgID.FNumber='{stocks[i].ErpOrgCode}')";
|
||||||
|
if (i == stocks.Count() - 1) param.FilterString += ")";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据原订单号查询
|
||||||
|
if (sourceBillNos != null && sourceBillNos.Count() > 0)
|
||||||
|
{
|
||||||
|
var srt_b = string.Join(",", sourceBillNos.Select(x => $"'{x}'"));
|
||||||
|
param.FilterString += " and FBillNo in (" + srt_b + ")";
|
||||||
|
}
|
||||||
|
else//没有指定单号搜索 则带时间范围 FApproveDate
|
||||||
|
param.FilterString += " and FApproveDate>='" + beginStr + "' and FApproveDate<='" + endStr + "'";
|
||||||
|
|
||||||
|
query.Data = JsonConvert.SerializeObject(param);
|
||||||
|
var json = JsonConvert.SerializeObject(query);
|
||||||
|
|
||||||
|
//4.请求查询接口
|
||||||
|
result_json = await _client.ExecuteBillQueryAsync(json);
|
||||||
|
var result = JsonConvert.DeserializeObject<List<List<string>>>(result_json);
|
||||||
|
|
||||||
|
//5.返回数据的组装
|
||||||
|
var erp_list = new List<ErpDeliveryNoticeOutStockResultDto>();
|
||||||
|
foreach (var item in result)
|
||||||
|
{
|
||||||
|
var lis = new ErpDeliveryNoticeOutStockResultDto();
|
||||||
|
lis.SourceBillNo = item[0];
|
||||||
|
lis.SaleBillNo = item[1];
|
||||||
|
lis.DeliveryOrgId = Convert.ToInt32(item[2]);
|
||||||
|
lis.ReceiptCustomerId = Convert.ToInt32(item[3]);
|
||||||
|
lis.MaterialNumber = item[4];
|
||||||
|
lis.StockCode = item[5];
|
||||||
|
lis.SubStockId = Convert.ToInt32(item[6]);
|
||||||
|
lis.AccruedQty = Convert.ToDecimal(item[7]);
|
||||||
|
lis.Remark = item[8];
|
||||||
|
lis.CreateTime = Convert.ToDateTime(item[9]);
|
||||||
|
lis.Type = (int)OutStockType.Sal;
|
||||||
|
lis.Erp_DetailId = Convert.ToInt32(item[10]);
|
||||||
|
lis.OrgCode = item[11];
|
||||||
|
erp_list.Add(lis);
|
||||||
|
}
|
||||||
|
return ResultList<ErpDeliveryNoticeOutStockResultDto>.ReSuccess(erp_list);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError($"BillQueryForDeliveryNoticeOutStock->拉取金蝶数据失败yzh:{ex.Message} 返回json:{result_json}");
|
||||||
|
return ResultList<ErpDeliveryNoticeOutStockResultDto>.ReFailure(ResultCodes.Erp_BillQuery_Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 直接调拨出库
|
/// 直接调拨出库
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2754,6 +2855,8 @@ namespace WMS.Web.Domain.Services.Public
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<Result<ErpPurchaseInStockSaveDto>> BillQueryForPurchaseInStock(string id)
|
public async Task<Result<ErpPurchaseInStockSaveDto>> BillQueryForPurchaseInStock(string id)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -86,5 +86,11 @@ namespace WMS.Web.Domain.Values.Erp
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
PRD_MORPT = 19,
|
PRD_MORPT = 19,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 领料出库单(来源于普通领料出库单)
|
||||||
|
/// </summary>
|
||||||
|
PRD_PickMtrl = 20,
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,5 +35,10 @@ namespace WMS.Web.Domain.Values
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[EnumRemark("组装拆卸出库")]
|
[EnumRemark("组装拆卸出库")]
|
||||||
Assembled = 5,
|
Assembled = 5,
|
||||||
|
/// <summary>
|
||||||
|
/// 领料出库
|
||||||
|
/// </summary>
|
||||||
|
[EnumRemark("领料出库")]
|
||||||
|
PickingOut = 6,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user