提示
This commit is contained in:
Binary file not shown.
@@ -135,8 +135,8 @@ namespace WMS.Web.Api.Controllers
|
|||||||
sbns.Add(sourceBillNo);
|
sbns.Add(sourceBillNo);
|
||||||
|
|
||||||
//2.同步金蝶
|
//2.同步金蝶
|
||||||
return await _inStockTaskService.Sysn(sbns);
|
// return await _inStockTaskService.Sysn(sbns);
|
||||||
// return await _inStockTaskService.Sysn(null);//alter by yzh
|
return await _inStockTaskService.Sysn(null);//alter by yzh
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
"AppOptions": {
|
"AppOptions": {
|
||||||
"DBConnectionString": "Server=rm-wz9215skklas0287pwo.mysql.rds.aliyuncs.com; Database=test_wmsdb;User Id=orico_erp;password=Orico2023;port=3306;CharSet=gb2312;Connect Timeout=150;", //测试数据库连接地址
|
"DBConnectionString": "Server=rm-wz9215skklas0287pwo.mysql.rds.aliyuncs.com; Database=test_wmsdb;User Id=orico_erp;password=Orico2023;port=3306;CharSet=gb2312;Connect Timeout=150;", //测试数据库连接地址
|
||||||
// "DBConnectionString": "Server=rm-wz9215skklas0287pwo.mysql.rds.aliyuncs.com; Database=wms_db;User Id=orico_erp;password=Orico2023;port=3306;CharSet=gb2312;Connect Timeout=150;", //正式数据库连接地址
|
// "DBConnectionString": "Server=rm-wz9215skklas0287pwo.mysql.rds.aliyuncs.com; Database=wms_db;User Id=orico_erp;password=Orico2023;port=3306;CharSet=gb2312;Connect Timeout=150;", //正式数据库连接地址
|
||||||
"RedisConnectionString": "47.106.232.90:6379,password=orico.2020,DefaultDatabase=3", //测试redis连接地址
|
"RedisConnectionString": "47.106.232.90:6379,password=orico.2020,DefaultDatabase=3", //测试redis连接地址test_wmsdb
|
||||||
//"RedisConnectionString": "47.106.232.90:6379,password=orico.2020,DefaultDatabase=2", //正式redis连接地址
|
//"RedisConnectionString": "47.106.232.90:6379,password=orico.2020,DefaultDatabase=2", //正式redis连接地址
|
||||||
"RedisIpRateLimitingConnectionString": "47.110.156.96:16379,password=123456,DefaultDatabase=2", //redis连接地址
|
"RedisIpRateLimitingConnectionString": "47.110.156.96:16379,password=123456,DefaultDatabase=2", //redis连接地址
|
||||||
"SingleBaseUrl": "http://127.0.0.1:8066/api", //单点服务连接地址
|
"SingleBaseUrl": "http://127.0.0.1:8066/api", //单点服务连接地址
|
||||||
|
|||||||
@@ -1212,6 +1212,16 @@
|
|||||||
单据体
|
单据体
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.Erp.ErpMaterialDtoJian.MaterialNumber">
|
||||||
|
<summary>
|
||||||
|
物料编码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.Erp.ErpMaterialDtoJian.Specifications">
|
||||||
|
<summary>
|
||||||
|
物料规格型号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Core.Dto.Erp.ErpMaterialDto">
|
<member name="T:WMS.Web.Core.Dto.Erp.ErpMaterialDto">
|
||||||
<summary>
|
<summary>
|
||||||
对应金蝶,物料信息
|
对应金蝶,物料信息
|
||||||
@@ -1272,6 +1282,16 @@
|
|||||||
是否启用批号管理
|
是否启用批号管理
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.Erp.ErpMaterialDto.FModifyDate">
|
||||||
|
<summary>
|
||||||
|
修改日期
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.Erp.ErpMaterialDto.FCreateDate">
|
||||||
|
<summary>
|
||||||
|
创建日期
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Core.Dto.Erp.Org.ErpOrgDto">
|
<member name="T:WMS.Web.Core.Dto.Erp.Org.ErpOrgDto">
|
||||||
<summary>
|
<summary>
|
||||||
金蝶组织-基本信息
|
金蝶组织-基本信息
|
||||||
|
|||||||
@@ -3475,6 +3475,13 @@
|
|||||||
<param name="isBatchManage"></param>
|
<param name="isBatchManage"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Infrastructure.IMaterialsRepositories.GetEntityListAddMaterial(System.Collections.Generic.List{System.String})">
|
||||||
|
<summary>
|
||||||
|
列表
|
||||||
|
</summary>
|
||||||
|
<param name="materNumbers"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.Infrastructure.IMaterialsRepositories.UpdateRange(System.Collections.Generic.List{WMS.Web.Domain.Entitys.Materials},System.Boolean)">
|
<member name="M:WMS.Web.Domain.Infrastructure.IMaterialsRepositories.UpdateRange(System.Collections.Generic.List{WMS.Web.Domain.Entitys.Materials},System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
修改物料
|
修改物料
|
||||||
|
|||||||
@@ -4,6 +4,17 @@ using System.Text;
|
|||||||
|
|
||||||
namespace WMS.Web.Core.Dto.Erp
|
namespace WMS.Web.Core.Dto.Erp
|
||||||
{
|
{
|
||||||
|
public class ErpMaterialDtoJian
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 物料编码
|
||||||
|
/// </summary>
|
||||||
|
public string MaterialNumber { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料规格型号
|
||||||
|
/// </summary>
|
||||||
|
public string Specifications { get; set; }
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 对应金蝶,物料信息
|
/// 对应金蝶,物料信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -60,5 +71,16 @@ namespace WMS.Web.Core.Dto.Erp
|
|||||||
/// 是否启用批号管理
|
/// 是否启用批号管理
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBatchManage { get; set; }
|
public bool IsBatchManage { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? FModifyDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? FCreateDate { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,5 +69,9 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
/// 是否启用批号管理
|
/// 是否启用批号管理
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBatchManage { get; set; }
|
public bool IsBatchManage { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,13 @@ namespace WMS.Web.Domain.IService.Public
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ResultList<ErpInStockResultDto>> BillQueryForAssembledApp_Disassembly(List<string> sourceBillNos = null, DateTime? beginTime = null, bool isCheck = true);
|
Task<ResultList<ErpInStockResultDto>> BillQueryForAssembledApp_Disassembly(List<string> sourceBillNos = null, DateTime? beginTime = null, bool isCheck = true);
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 生产汇报
|
||||||
|
///// </summary>
|
||||||
|
///// <param name="sourceBillNos"></param>
|
||||||
|
///// <param name="beginTime"></param>
|
||||||
|
///// <param name="isCheck"></param>
|
||||||
|
///// <returns></returns>
|
||||||
Task<ResultList<ErpInStockResultDto>> BillQueryForProduceSotckin(List<string> sourceBillNos = null, DateTime? beginTime = null, bool isCheck = true);
|
Task<ResultList<ErpInStockResultDto>> BillQueryForProduceSotckin(List<string> sourceBillNos = null, DateTime? beginTime = null, bool isCheck = true);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,16 @@ namespace WMS.Web.Domain.Infrastructure
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<Materials>> GetEntityList(List<string> materNumbers, bool isBatchManage);
|
Task<List<Materials>> GetEntityList(List<string> materNumbers, bool isBatchManage);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="materNumbers"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Materials>> GetEntityListAddMaterial(List<string> materNumbers);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 修改物料
|
/// 修改物料
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -257,12 +257,26 @@ namespace WMS.Web.Domain.Services
|
|||||||
{
|
{
|
||||||
if (billNos == null || billNos.Count == 0)
|
if (billNos == null || billNos.Count == 0)
|
||||||
{
|
{
|
||||||
var beginTime = DateTime.Now.AddHours(-20);//默认拉去8小时以内的数据,ALTER BY YZH
|
// var beginTime = DateTime.Now.AddHours(-20);//默认拉去8小时以内的数据,ALTER BY YZH
|
||||||
|
var beginTime = DateTime.Now.AddDays(-200);//默认拉去8小时以内的数据,ALTER BY YZH这里要改回去
|
||||||
|
|
||||||
////6.同步数据:生产入库单
|
|
||||||
//var ProduceSotck_result = await this.SsynProduceSotck(null, isTransaction, beginTime);
|
//6.同步数据:生产入库单
|
||||||
//if (!ProduceSotck_result.IsSuccess)
|
var ProduceSotck_result = await this.SsynProduceSotck(null, isTransaction, beginTime);
|
||||||
// return Result.ReFailure(ProduceSotck_result.Message, ProduceSotck_result.Status);
|
if (!ProduceSotck_result.IsSuccess)
|
||||||
|
return Result.ReFailure(ProduceSotck_result.Message, ProduceSotck_result.Status);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//4.同步数据:分步式入库单
|
||||||
|
var Transferin_result = await this.SysnTransferin(null, isTransaction, beginTime);
|
||||||
|
if (!Transferin_result.IsSuccess)
|
||||||
|
return Result.ReFailure(Transferin_result.Message, Transferin_result.Status);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -281,10 +295,6 @@ namespace WMS.Web.Domain.Services
|
|||||||
if (!TransferDirect_result.IsSuccess)
|
if (!TransferDirect_result.IsSuccess)
|
||||||
return Result.ReFailure(TransferDirect_result.Message, TransferDirect_result.Status);
|
return Result.ReFailure(TransferDirect_result.Message, TransferDirect_result.Status);
|
||||||
|
|
||||||
//4.同步数据:分步式入库单
|
|
||||||
var Transferin_result = await this.SysnTransferin(null, isTransaction, beginTime);
|
|
||||||
if (!Transferin_result.IsSuccess)
|
|
||||||
return Result.ReFailure(Transferin_result.Message, Transferin_result.Status);
|
|
||||||
|
|
||||||
//5.同步数据:组装拆卸单
|
//5.同步数据:组装拆卸单
|
||||||
var AssembledApp_result = await this.SysnAssembledApp(null, isTransaction, beginTime);
|
var AssembledApp_result = await this.SysnAssembledApp(null, isTransaction, beginTime);
|
||||||
@@ -781,7 +791,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
List<string> TransferDirect_sourceBillNos = new List<string>();
|
List<string> TransferDirect_sourceBillNos = new List<string>();
|
||||||
List<string> Transferin_sourceBillNos = new List<string>();
|
List<string> Transferin_sourceBillNos = new List<string>();
|
||||||
List<string> AssembledApp_sourceBillNos = new List<string>();
|
List<string> AssembledApp_sourceBillNos = new List<string>();
|
||||||
List<string> ProduceSotck_sourceBillNos = new List<string>();//生产入库
|
// List<string> ProduceSotck_sourceBillNos = new List<string>();//生产入库
|
||||||
|
|
||||||
foreach (var entity in list)
|
foreach (var entity in list)
|
||||||
{
|
{
|
||||||
@@ -795,17 +805,17 @@ namespace WMS.Web.Domain.Services
|
|||||||
AssembledApp_sourceBillNos.Add(entity.SourceBillNo);
|
AssembledApp_sourceBillNos.Add(entity.SourceBillNo);
|
||||||
else if (entity.Type == InstockType.Miscellaneous)
|
else if (entity.Type == InstockType.Miscellaneous)
|
||||||
Miscellaneous_sourceBillNos.Add(entity.SourceBillNo);
|
Miscellaneous_sourceBillNos.Add(entity.SourceBillNo);
|
||||||
else if (entity.Type == InstockType.ProduceSotck)
|
//else if (entity.Type == InstockType.ProduceSotck)
|
||||||
ProduceSotck_sourceBillNos.Add(entity.SourceBillNo);
|
// ProduceSotck_sourceBillNos.Add(entity.SourceBillNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ProduceSotck_sourceBillNos.Count() > 0)//生产入库
|
//if (ProduceSotck_sourceBillNos.Count() > 0)//生产入库
|
||||||
{
|
//{
|
||||||
var erp_result = await _erpService.BillQueryForProduceSotckin(ProduceSotck_sourceBillNos, null);
|
// var erp_result = await _erpService.BillQueryForProduceSotckin(ProduceSotck_sourceBillNos, null);
|
||||||
if (!erp_result.IsSuccess)
|
// if (!erp_result.IsSuccess)
|
||||||
return Result<List<ErpInStockResultDto>>.ReFailure(erp_result.Message, erp_result.Status);
|
// return Result<List<ErpInStockResultDto>>.ReFailure(erp_result.Message, erp_result.Status);
|
||||||
erp_list.AddRange(erp_result.Data);
|
// erp_list.AddRange(erp_result.Data);
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (Instock_sourceBillNos.Count() > 0)
|
if (Instock_sourceBillNos.Count() > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -530,7 +530,9 @@ namespace WMS.Web.Domain.Services.Public
|
|||||||
|
|
||||||
//2.时间条件:可能还有其它条件
|
//2.时间条件:可能还有其它条件
|
||||||
//var beginTime = DateTime.Now.AddDays(-2).ToString("yyyy-MM-dd 00:00:00");
|
//var beginTime = DateTime.Now.AddDays(-2).ToString("yyyy-MM-dd 00:00:00");
|
||||||
var beginStr = DateTime.Now.AddDays(-3).ToString("yyyy-MM-dd HH:mm:ss");
|
// var beginStr = DateTime.Now.AddDays(-3).ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
var beginStr = DateTime.Now.AddDays(-180).ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
// var beginStr = DateTime.Now.AddDays(-180).ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
if (beginTime != null) beginStr = beginTime?.ToString("yyyy-MM-dd HH:mm:ss");
|
if (beginTime != null) beginStr = beginTime?.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
var endTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
var endTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
//3.获取金蝶分步式入库订单:拼接参数和条件
|
//3.获取金蝶分步式入库订单:拼接参数和条件
|
||||||
@@ -546,6 +548,7 @@ namespace WMS.Web.Domain.Services.Public
|
|||||||
//当金蝶系统物料明细行调出仓库和调入仓库相同, 数据不需要拉取
|
//当金蝶系统物料明细行调出仓库和调入仓库相同, 数据不需要拉取
|
||||||
//param.FilterString = " FDocumentStatus='C' and FBillTypeID='e65a4f29743a44b7b67dc8145e1f9c92'";
|
//param.FilterString = " FDocumentStatus='C' and FBillTypeID='e65a4f29743a44b7b67dc8145e1f9c92'";
|
||||||
param.FilterString = " 1=1";
|
param.FilterString = " 1=1";
|
||||||
|
param.FilterString += " and FSrcBillType<>'STK_TRANSFERIN'";
|
||||||
if (isCheck) param.FilterString += " and FDocumentStatus='C'";
|
if (isCheck) param.FilterString += " and FDocumentStatus='C'";
|
||||||
param.FilterString += " and FSrcStockId!=FDestStockId";
|
param.FilterString += " and FSrcStockId!=FDestStockId";
|
||||||
for (int i = 0; i < stocks.Count(); i++)
|
for (int i = 0; i < stocks.Count(); i++)
|
||||||
@@ -668,7 +671,7 @@ namespace WMS.Web.Domain.Services.Public
|
|||||||
if (i == 0)
|
if (i == 0)
|
||||||
{
|
{
|
||||||
param.FilterString += " and (";
|
param.FilterString += " and (";
|
||||||
param.FilterString += $"(FSTOCKID.FNumber='{stocks[i].Code}' and FPrdOrgId.FNumber='{stocks[i].ErpOrgCode}')";
|
param.FilterString += $"(FSTOCKID.FNumber='{stocks[i].Code}' and FPrdOrgId.FNumber='{stocks[i].ErpOrgCode}')";
|
||||||
// param.FilterString += $"( FPrdOrgId.FNumber='{stocks[i].ErpOrgCode}')";
|
// param.FilterString += $"( FPrdOrgId.FNumber='{stocks[i].ErpOrgCode}')";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -724,7 +727,7 @@ namespace WMS.Web.Domain.Services.Public
|
|||||||
lis.OrgCode = item[3];
|
lis.OrgCode = item[3];
|
||||||
lis.ErpDetailId = Convert.ToInt32(item[12]);
|
lis.ErpDetailId = Convert.ToInt32(item[12]);
|
||||||
lis.Type = (int)InstockType.ProduceSotck;
|
lis.Type = (int)InstockType.ProduceSotck;
|
||||||
lis.SaleBillNo= item[1];
|
lis.SaleBillNo = item[1];
|
||||||
erp_list.Add(lis);
|
erp_list.Add(lis);
|
||||||
}
|
}
|
||||||
//_logger.LogInformation("分步式调入条数:" + erp_list.Count);
|
//_logger.LogInformation("分步式调入条数:" + erp_list.Count);
|
||||||
@@ -738,6 +741,7 @@ namespace WMS.Web.Domain.Services.Public
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// erp:单据查询-组装拆卸单-组装(成品入库)
|
/// erp:单据查询-组装拆卸单-组装(成品入库)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2227,6 +2231,7 @@ namespace WMS.Web.Domain.Services.Public
|
|||||||
//7.V01.05.00: 当金蝶系统物料明细行调出仓库和调入仓库相同, 数据不需要拉取
|
//7.V01.05.00: 当金蝶系统物料明细行调出仓库和调入仓库相同, 数据不需要拉取
|
||||||
//param.FilterString = "FDocumentStatus='C' and FBillTypeID='de3bcacc98434ec68a358aa5abcd9183'";
|
//param.FilterString = "FDocumentStatus='C' and FBillTypeID='de3bcacc98434ec68a358aa5abcd9183'";
|
||||||
param.FilterString = " 1=1";
|
param.FilterString = " 1=1";
|
||||||
|
param.FilterString += " and FSrcBillType<>'STK_TRANSFERIN'";//add by yzh
|
||||||
if (isCheck) param.FilterString += " and FDocumentStatus='C'";
|
if (isCheck) param.FilterString += " and FDocumentStatus='C'";
|
||||||
param.FilterString += " and FMaterialID.FERPCLSID not in (10,11,6)";
|
param.FilterString += " and FMaterialID.FERPCLSID not in (10,11,6)";
|
||||||
param.FilterString += " and FSrcStockID!=FDestStockID";
|
param.FilterString += " and FSrcStockID!=FDestStockID";
|
||||||
|
|||||||
@@ -32,6 +32,30 @@ namespace WMS.Web.Domain.Services
|
|||||||
_materialsRepositories = materialsRepositories;
|
_materialsRepositories = materialsRepositories;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//public string GetSpecifications(mats_result entitys, string MaterialNumber)
|
||||||
|
//{
|
||||||
|
// string strReturn = "";
|
||||||
|
// foreach (var item in entitys)
|
||||||
|
// {
|
||||||
|
|
||||||
|
// if (item.MaterialNumber == MaterialNumber)
|
||||||
|
// {
|
||||||
|
// if (strReturn == "")
|
||||||
|
// {
|
||||||
|
// strReturn = item.Specifications;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// strReturn = strReturn + "," + item.SerialNumber;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return strReturn;
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 同步金蝶新的物料
|
/// 同步金蝶新的物料
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -40,7 +64,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_logger.LogInformation("同步金蝶新物料:开始->" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
_logger.LogInformation("同步SyncNewMaterials新金蝶新物料:开始->" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||||
//1.获取全部物料编码
|
//1.获取全部物料编码
|
||||||
var materialNumbers = await _materialsRepositories.GetAllNumbers();
|
var materialNumbers = await _materialsRepositories.GetAllNumbers();
|
||||||
//1.1通过hash处理
|
//1.1通过hash处理
|
||||||
@@ -65,6 +89,64 @@ namespace WMS.Web.Domain.Services
|
|||||||
if (!isSuccess)
|
if (!isSuccess)
|
||||||
return Result.ReFailure(ResultCodes.DateWriteError);
|
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||||
}
|
}
|
||||||
|
//修改有更新的数据
|
||||||
|
if (mats.Count != 0)
|
||||||
|
{
|
||||||
|
var isFModifyDateMatNumbs = mats.Where(x => x.FModifyDate>=DateTime.Now.AddDays(-2)).Select(x =>new { MaterialNumber= x.MaterialNumber, Specifications=x.Specifications }).ToList();
|
||||||
|
//取:金蝶拉取的已启用批号管理的物料并且本地数据库中的未启用批号管理的物料;来更新批号管理修改为true
|
||||||
|
|
||||||
|
_logger.LogInformation("取到需要同步的金蝶修改物料规格yzh:" + isFModifyDateMatNumbs.Count+"个");
|
||||||
|
List<string> s = new List<string>();
|
||||||
|
foreach (var ismat in isFModifyDateMatNumbs)
|
||||||
|
{
|
||||||
|
s.Add(ismat.MaterialNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
var updateList = await _materialsRepositories.GetEntityListAddMaterial(s);
|
||||||
|
if (isFModifyDateMatNumbs.Count != 0)
|
||||||
|
{
|
||||||
|
//updateList.ForEach(x => { x.Specifications = ; });
|
||||||
|
|
||||||
|
foreach(var entity in updateList)
|
||||||
|
{
|
||||||
|
// entity.Specifications = mats_result[];
|
||||||
|
foreach (var mat in isFModifyDateMatNumbs)
|
||||||
|
{
|
||||||
|
if (entity.MaterialNumber== mat.MaterialNumber)
|
||||||
|
{
|
||||||
|
entity.Specifications = mat.Specifications;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var isSuccess = await _materialsRepositories.UpdateRange(updateList);
|
||||||
|
if (!isSuccess)
|
||||||
|
_logger.LogInformation("同步金蝶修改物料-修改物料规格yzh:失败");
|
||||||
|
else
|
||||||
|
_logger.LogInformation("同步金蝶修改物料-修改物料规格yzh:成功->" + updateList.Count + "条");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// List<string> s = new List<string>();
|
||||||
|
//foreach (var ismat in isFModifyDateMatNumbs)
|
||||||
|
// {
|
||||||
|
// s.Add(ismat.MaterialNumber);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// var updateList = await _materialsRepositories.GetEntityListAddMaterial(s);
|
||||||
|
// if (updateList.Count != 0)
|
||||||
|
// {
|
||||||
|
// updateList.ForEach(x => { x.Specifications = ; });
|
||||||
|
// var isSuccess = await _materialsRepositories.UpdateRange(updateList);
|
||||||
|
// if (!isSuccess)
|
||||||
|
// _logger.LogInformation("同步金蝶新物料-修改物料:失败");
|
||||||
|
// else
|
||||||
|
// _logger.LogInformation("同步金蝶新物料-修改物料:成功->" + updateList.Count + "条");
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
//5.修改物料数据
|
//5.修改物料数据
|
||||||
if (mats.Count != 0)
|
if (mats.Count != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -126,10 +126,21 @@ namespace WMS.Web.Repositories
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<Materials>> GetEntityList(List<string> materNumbers, bool isBatchManage)
|
public async Task<List<Materials>> GetEntityList(List<string> materNumbers, bool isBatchManage)
|
||||||
{
|
{
|
||||||
|
|
||||||
var entitys = await _context.Materials.Where(x => materNumbers.Contains(x.MaterialNumber) && x.IsBatchManage == isBatchManage).ToListAsync();
|
var entitys = await _context.Materials.Where(x => materNumbers.Contains(x.MaterialNumber) && x.IsBatchManage == isBatchManage).ToListAsync();
|
||||||
return entitys;
|
return entitys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取全部的物料编码2
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<Materials>> GetEntityListAddMaterial(List<string> materNumbers)
|
||||||
|
{
|
||||||
|
var entitys = await _context.Materials.Where(x => materNumbers.Contains(x.MaterialNumber)).ToListAsync();
|
||||||
|
return entitys;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 修改物料
|
/// 修改物料
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user