|
@ -690,21 +690,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
// { version = $"{before.ToString()}11"; }
|
|
|
// { version = $"{before.ToString()}11"; }
|
|
|
// else if (p_billtime >= lastYear.AddMonths(11) && p_billtime <= beforeYear)
|
|
|
// else if (p_billtime >= lastYear.AddMonths(11) && p_billtime <= beforeYear)
|
|
|
// { version = $"{before.ToString()}12"; }
|
|
|
// { version = $"{before.ToString()}12"; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (string.IsNullOrEmpty(version))
|
|
|
// if (string.IsNullOrEmpty(version))
|
|
|
// {
|
|
|
// {
|
|
|
// return 200802;//找不到的数据默认写到这个区间
|
|
|
// return 200802;//找不到的数据默认写到这个区间
|
|
|
// }
|
|
|
// }
|
|
|
// return int.Parse(version);
|
|
|
// return int.Parse(version);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int GetVersionByBillTime(DateTime p_billtime, string p_day) |
|
|
private int GetVersionByBillTime(DateTime p_billtime, string p_day) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
@ -828,6 +820,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.UID = 000; |
|
|
seDetail.UID = 000; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
|
|
|
seDetail.PartCode= item.RealPartCode; |
|
|
|
|
|
seDetail.RealPartCode=item.RealPartCode; |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.ErpToLoc = item.ErpToLoc; |
|
|
seDetail.ErpToLoc = item.ErpToLoc; |
|
|
seDetail.Qty = item.Qty; |
|
|
seDetail.Qty = item.Qty; |
|
@ -861,6 +855,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.UID = 000; |
|
|
seDetail.UID = 000; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
|
|
|
seDetail.PartCode = item.RealPartCode; |
|
|
|
|
|
seDetail.RealPartCode = item.RealPartCode; |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.ErpToLoc = item.ErpToLoc; |
|
|
seDetail.ErpToLoc = item.ErpToLoc; |
|
|
seDetail.Qty = item.Qty; |
|
|
seDetail.Qty = item.Qty; |
|
@ -907,6 +903,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.UID = 000; |
|
|
seDetail.UID = 000; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
|
|
|
seDetail.PartCode = item.RealPartCode; |
|
|
|
|
|
seDetail.RealPartCode = item.RealPartCode; |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.ErpToLoc = item.ErpToLoc; |
|
|
seDetail.ErpToLoc = item.ErpToLoc; |
|
|
seDetail.Qty = item.Qty; |
|
|
seDetail.Qty = item.Qty; |
|
@ -919,7 +917,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
seDetails.Add(seDetail); |
|
|
seDetails.Add(seDetail); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var result = await CheckBusinessJISLocation(seDetails, businessType).ConfigureAwait(false); |
|
|
var result = await CheckBusinessJISLocation(seDetails, businessType).ConfigureAwait(false); |
|
|
if (result != "ok") |
|
|
if (result != "ok") |
|
|
{ |
|
|
{ |
|
@ -953,6 +950,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
seDetail.SubBillType = 0; |
|
|
seDetail.SubBillType = 0; |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.UID = 000; |
|
|
seDetail.UID = 000; |
|
|
|
|
|
seDetail.PartCode = item.RealPartCode; |
|
|
|
|
|
seDetail.RealPartCode = item.RealPartCode; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.ErpToLoc = item.ErpToLoc; |
|
|
seDetail.ErpToLoc = item.ErpToLoc; |
|
@ -998,6 +997,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
seDetail.SubBillType = 0; |
|
|
seDetail.SubBillType = 0; |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.UID = 000; |
|
|
seDetail.UID = 000; |
|
|
|
|
|
seDetail.PartCode = item.RealPartCode; |
|
|
|
|
|
|
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.ToErpLocCode = item.ErpToLoc; |
|
|
seDetail.ToErpLocCode = item.ErpToLoc; |
|
@ -1005,6 +1006,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
seDetail.PN = item.VinCode; |
|
|
seDetail.PN = item.VinCode; |
|
|
seDetail.LU = item.CustPartCode; |
|
|
seDetail.LU = item.CustPartCode; |
|
|
seDetail.CustPartCode = item.CustPartCode; |
|
|
seDetail.CustPartCode = item.CustPartCode; |
|
|
|
|
|
|
|
|
|
|
|
seDetail.PartCode = item.RealPartCode; |
|
|
seDetail.BillTime = DateTime.Now; |
|
|
seDetail.BillTime = DateTime.Now; |
|
|
seDetail.Remark = "期初初始化"; |
|
|
seDetail.Remark = "期初初始化"; |
|
|
seDetails.Add(seDetail); |
|
|
seDetails.Add(seDetail); |
|
@ -1042,6 +1045,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
seDetail.SubBillType = 0; |
|
|
seDetail.SubBillType = 0; |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.UID = 000; |
|
|
seDetail.UID = 000; |
|
|
|
|
|
seDetail.PartCode = item.RealPartCode; |
|
|
|
|
|
|
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.ToErpLocCode = item.ErpToLoc; |
|
|
seDetail.ToErpLocCode = item.ErpToLoc; |
|
@ -1086,6 +1091,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
seDetail.SubBillType = 0; |
|
|
seDetail.SubBillType = 0; |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.UID = 000; |
|
|
seDetail.UID = 000; |
|
|
|
|
|
seDetail.PartCode = item.RealPartCode; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.ToErpLocCode = item.ErpToLoc; |
|
|
seDetail.ToErpLocCode = item.ErpToLoc; |
|
@ -1131,6 +1137,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
seDetail.UID = 000; |
|
|
seDetail.UID = 000; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
|
|
|
seDetail.PartCode = item.RealCode; |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
seDetail.ToErpLocCode = item.ErpToLoc; |
|
|
seDetail.ToErpLocCode = item.ErpToLoc; |
|
|
seDetail.Qty = item.Qty; |
|
|
seDetail.Qty = item.Qty; |
|
@ -1167,7 +1174,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
|
private async Task<IActionResult> BeginTran<T>(List<T> p_list, List<VmiLog> logList) where T : SE_BASE, new() |
|
|
private async Task<IActionResult> BeginTran<T>(List<T> p_list, List<VmiLog> logList) where T : SE_BASE, new() |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
//var messageList = logList.Select(log => new VmiMessage { Message = JsonSerializer.Serialize(log) }).ToList();
|
|
|
//var messageList = logList.Select(log => new VmiMessage { Message = JsonSerializer.Serialize(log) }).ToList();
|
|
|
var connectionString = this._serviceProvider.GetRequiredService<IConfiguration>().GetConnectionString("SettleAccountService"); |
|
|
var connectionString = this._serviceProvider.GetRequiredService<IConfiguration>().GetConnectionString("SettleAccountService"); |
|
|
var options = new DbContextOptionsBuilder<SettleAccountDbContext>().UseSqlServer(connectionString).Options; |
|
|
var options = new DbContextOptionsBuilder<SettleAccountDbContext>().UseSqlServer(connectionString).Options; |
|
@ -1190,7 +1196,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
{ |
|
|
{ |
|
|
itm.Version= GetVersionByBillTime(itm.ShippingDate, value); |
|
|
itm.Version= GetVersionByBillTime(itm.ShippingDate, value); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
await context.BulkInsertAsync(p_list).ConfigureAwait(false); |
|
|
await context.BulkInsertAsync(p_list).ConfigureAwait(false); |
|
|
await context.BulkInsertAsync(logList).ConfigureAwait(false); |
|
|
await context.BulkInsertAsync(logList).ConfigureAwait(false); |
|
|
transaction.Commit(); |
|
|
transaction.Commit(); |
|
@ -1237,7 +1242,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
p.Value == "JisHBPO" |
|
|
p.Value == "JisHBPO" |
|
|
).ToList(); |
|
|
).ToList(); |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
case EnumBusinessType.MaiDanJianHBPO: |
|
|
case EnumBusinessType.MaiDanJianHBPO: |
|
|
locList = locList.Where(p => p.Value == "MaiDanJianHBPO").ToList(); |
|
|
locList = locList.Where(p => p.Value == "MaiDanJianHBPO").ToList(); |
|
|
break; |
|
|
break; |
|
@ -1278,7 +1282,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
var locList = _codeRepository.Where(p => p.Project == "库位").ToList(); |
|
|
var locList = _codeRepository.Where(p => p.Project == "库位").ToList(); |
|
|
switch (enumBusinessType) |
|
|
switch (enumBusinessType) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
case EnumBusinessType.ZhiGongJianBBAC: |
|
|
case EnumBusinessType.ZhiGongJianBBAC: |
|
|
locList = locList.Where(p => p.Value == "ZhiGongJianBBAC顺义" || p.Value == "ZhiGongJianBBAC").ToList(); |
|
|
locList = locList.Where(p => p.Value == "ZhiGongJianBBAC顺义" || p.Value == "ZhiGongJianBBAC").ToList(); |
|
|
break; |
|
|
break; |
|
@ -1291,11 +1294,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
case EnumBusinessType.YinDuJian: |
|
|
case EnumBusinessType.YinDuJian: |
|
|
locList = locList.Where(p => p.Value == "YinDuJian").ToList(); |
|
|
locList = locList.Where(p => p.Value == "YinDuJian").ToList(); |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
var locs = locList.Select(p => p.Description).ToList(); |
|
|
var locs = locList.Select(p => p.Description).ToList(); |
|
|
if (p_list.Any(p => !locs.Contains(p.ToErpLocCode))) |
|
|
if (p_list.Any(p => !locs.Contains(p.ToErpLocCode))) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return "发运数据有不在" + string.Join(",", locs) + "库位中"; |
|
|
return "发运数据有不在" + string.Join(",", locs) + "库位中"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1342,6 +1346,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
} |
|
|
} |
|
|
var logList = tupleList.Select(o => o.Item1).ToList(); |
|
|
var logList = tupleList.Select(o => o.Item1).ToList(); |
|
|
logList.AsParallel().ForEach(Update); |
|
|
logList.AsParallel().ForEach(Update); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//List<BBAC_SE_DETAIL> seDetails = new List<BBAC_SE_DETAIL>();
|
|
|
//List<BBAC_SE_DETAIL> seDetails = new List<BBAC_SE_DETAIL>();
|
|
|
//List<HBPO_SE_DETAIL> hbpo_seDetails=new List<HBPO_SE_DETAIL>();
|
|
|
//List<HBPO_SE_DETAIL> hbpo_seDetails=new List<HBPO_SE_DETAIL>();
|
|
|
//List<PUB_SE_DETAIL> pub_seDetails=new List<PUB_SE_DETAIL>();
|
|
|
//List<PUB_SE_DETAIL> pub_seDetails=new List<PUB_SE_DETAIL>();
|
|
@ -1724,7 +1732,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
catch (Exception ex) |
|
|
catch (Exception ex) |
|
|
{ |
|
|
{ |
|
|
this._logger.LogError(ex.ToString()); |
|
|
this._logger.LogError(ex.ToString()); |
|
|
return new JsonResult(new { code = 500, data = ex.ToString(), message = ex.Message }); ; |
|
|
return new JsonResult(new { code = 500, data = ex.ToString(), message = ex.Message }); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|