改了,不传销售订单的
This commit is contained in:
@@ -450,17 +450,18 @@ namespace WMS.Web.Domain.Services
|
||||
//DateTime begin = await _erpOpsSyncDateRepositories.Get(ErpOpsSyncType.OutStock);
|
||||
if (begin == null)
|
||||
begin = DateTime.Now.AddHours(-8);//默认拉去8小时以内的数据,ALTER BY YZH
|
||||
// begin = DateTime.Now.AddDays(-200);//默认拉去8小时以内的数据,ALTER BY YZH
|
||||
//更新时间范围内所有
|
||||
//result = await BillQueryForTransferOutOutStock(false, null, begin);
|
||||
//if (!result.IsSuccess) isRollback = true;
|
||||
// begin = DateTime.Now.AddDays(-200);//默认拉去8小时以内的数据,ALTER BY YZH
|
||||
//更新时间范围内所有
|
||||
//result = await BillQueryForTransferOutOutStock(false, null, begin);
|
||||
//if (!result.IsSuccess) isRollback = true;
|
||||
|
||||
result = await BillQueryForSalOutStock(false, null, begin);
|
||||
if (!result.IsSuccess) isRollback = true;
|
||||
result = await BillQueryForPickingOutStock(false, null, begin);
|
||||
if (!result.IsSuccess) isRollback = true;
|
||||
|
||||
|
||||
result = await BillQueryForSalOutStock(false, null, begin);
|
||||
if (!result.IsSuccess) isRollback = true;
|
||||
|
||||
result = await BillQueryForTransferDirectOutStock(false, null, begin);
|
||||
if (!result.IsSuccess) isRollback = true;
|
||||
result = await BillQueryForTransferOutOutStock(false, null, begin);
|
||||
|
||||
@@ -2714,13 +2714,111 @@ namespace WMS.Web.Domain.Services.Public
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 销售出库单
|
||||
/// </summary>
|
||||
/// <param name="sourceBillNos"></param>
|
||||
/// <param name="beginTime"></param>
|
||||
/// <returns></returns>
|
||||
//public async Task<ResultList<ErpDeliveryNoticeOutStockResultDto>> BillQueryForSalOutStock(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.SAL_OUTSTOCK.ToString());
|
||||
// param.FieldKeys = "FBillNo,FSoorDerno,FStockOrgId,FCustomerID,FMaterialID.FNumber,FStockID.FNumber,FStockLocID,FSALUNITQTY,F_ENTRYREMARKS,FCreateDate,FEntity_FENTRYID,FStockOrgId.FNumber";//FEntryID
|
||||
// param.Limit = 10000;
|
||||
// //查询条件:备注其中的条件值以金蝶的值为准!!!
|
||||
// //1.创建时间在两天前和当天时间之间
|
||||
// //2.审核状态:已审核
|
||||
// //4.日期>=系统上线之日
|
||||
// //5.仓库:wms系统的仓库值---现在这个没有加,因为还单点没有和金蝶同步
|
||||
// //6.物料 物料属性=费用或资产或服务的排除 不拉取
|
||||
// //param.FilterString = "FDocumentStatus='C' and FBillTypeID='ad0779a4685a43a08f08d2e42d7bf3e9'";
|
||||
// param.FilterString = " 1=1";
|
||||
// if (isCheck) param.FilterString += " and FDocumentStatus='C' and FSrcType<>'SAL_SaleOrder'";
|
||||
// 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 FStockOrgId.FNumber='{stocks[i].ErpOrgCode}')";
|
||||
// }
|
||||
// else
|
||||
// param.FilterString += $" or (FStockID.FNumber='{stocks[i].Code}' and FStockOrgId.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($"BillQueryForSalOutStock->拉取金蝶数据失败yzh:{ex.Message} 返回json:{result_json}");
|
||||
// return ResultList<ErpDeliveryNoticeOutStockResultDto>.ReFailure(ResultCodes.Erp_BillQuery_Error);
|
||||
// }
|
||||
//}
|
||||
|
||||
public async Task<ResultList<ErpDeliveryNoticeOutStockResultDto>> BillQueryForSalOutStock(List<string> sourceBillNos = null, DateTime? beginTime = null, bool isCheck = true)
|
||||
{
|
||||
string result_json = "";
|
||||
@@ -2757,7 +2855,7 @@ namespace WMS.Web.Domain.Services.Public
|
||||
//6.物料 物料属性=费用或资产或服务的排除 不拉取
|
||||
//param.FilterString = "FDocumentStatus='C' and FBillTypeID='ad0779a4685a43a08f08d2e42d7bf3e9'";
|
||||
param.FilterString = " 1=1";
|
||||
if (isCheck) param.FilterString += " and FDocumentStatus='C'";
|
||||
if (isCheck) param.FilterString += " and FDocumentStatus='C' and FSrcType<>'SAL_SaleOrder'";
|
||||
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 + ")";
|
||||
|
||||
Reference in New Issue
Block a user