Browse Source

更新版本

master
zhaoxinyu 6 months ago
parent
commit
12144334c0
  1. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
  2. 1321
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  3. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs
  4. 498
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs
  5. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs
  6. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json

@ -5,7 +5,7 @@
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,13326;Database=BJABP;User ID=sa;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True", "Default": "Server=dev.ccwin-in.com,13326;Database=BJABP;User ID=sa;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True",
//"SettleAccountService": "Server=dev.ccwin-in.com,13326;Database=BQ_SA;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True;", //"SettleAccountService": "Server=dev.ccwin-in.com,13326;Database=BQ_SA;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True;",
"SettleAccountService": "Server=dev.ccwin-in.com,13326;Database=BQ_SA;User ID=sa;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True;", "SettleAccountService": "Server=dev.ccwin-in.com,13326;Database=BQ_SA;User ID=sa;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True;Connection Timeout=120",
"ExChangeCenterService": "Server=dev.ccwin-in.com,13326;Database=ExChangeCenter;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True;", "ExChangeCenterService": "Server=dev.ccwin-in.com,13326;Database=ExChangeCenter;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True;",
"WMSBJBMPT": "Server=dev.ccwin-in.com,6208;Database=WMS_BJBMPT_2;User ID=sa;Password=ChangkeTec@2021;Trusted_Connection=False;TrustServerCertificate=True;", "WMSBJBMPT": "Server=dev.ccwin-in.com,6208;Database=WMS_BJBMPT_2;User ID=sa;Password=ChangkeTec@2021;Trusted_Connection=False;TrustServerCertificate=True;",
"questdb": "host=dev.ccwin-in.com;port=10580;username=admin;password=quest;database=vmi;ServerCompatibilityMode=NoTypeLoading;" "questdb": "host=dev.ccwin-in.com;port=10580;username=admin;password=quest;database=vmi;ServerCompatibilityMode=NoTypeLoading;"

1321
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs

File diff suppressed because it is too large

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs

@ -248,9 +248,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
var connectionString = this._serviceProvider.GetRequiredService<IConfiguration>().GetConnectionString("SettleAccountService"); var connectionString = this._serviceProvider.GetRequiredService<IConfiguration>().GetConnectionString("SettleAccountService");
using var connection = new SqlConnection(connectionString); using var connection = new SqlConnection(connectionString);
var options = new DbContextOptionsBuilder<SettleAccountDbContext>().UseSqlServer(connection).Options; var options = new DbContextOptionsBuilder<SettleAccountDbContext>().UseSqlServer(connection).Options;
using var db = new SettleAccountDbContext(options); using var db = new SettleAccountDbContext(options);
db.Database.SetCommandTimeout(new TimeSpan(2, 0, 0));
// 通过id查找作业项实体 // 通过id查找作业项实体
var entity = db.Set<JobItem>().FirstOrDefault(o => o.Id == id); var entity = db.Set<JobItem>().FirstOrDefault(o => o.Id == id);
if (entity != null) if (entity != null)

498
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs

@ -60,6 +60,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
_dbcontext.BulkDelete(ls); _dbcontext.BulkDelete(ls);
} }
} }
var jis1 = p_list.Where(p => p.Site == "1040").ToList(); var jis1 = p_list.Where(p => p.Site == "1040").ToList();
var jis2 = p_list.Where(p => p.Site == "1046").ToList(); var jis2 = p_list.Where(p => p.Site == "1046").ToList();
List<BBAC_NOT_SA_DETAIL> notlist = new List<BBAC_NOT_SA_DETAIL>(); List<BBAC_NOT_SA_DETAIL> notlist = new List<BBAC_NOT_SA_DETAIL>();
@ -106,79 +107,118 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
var part_group_small = t1.Where(p => p.Amt < 10000000).ToList(); var part_group_small = t1.Where(p => p.Amt < 10000000).ToList();
if (part_group_big.Count > 0) if (part_group_big.Count > 0)
{ {
foreach (var itm in part_group_big) var partlist = part_group_big.Select(p => p.LU).ToList();
var ls = bbac_can_list.Where(p => partlist.Contains(p.LU)).ToList();
var billNum = OrderNumberGenerator.GenerateOrderNumber("N");
var bbac_sa = new BBAC_CAN_SA();
bbac_sa.SetId(Guid.NewGuid());
bbac_sa.BillNum = billNum;
bbac_sa.InvGroupNum = billNum;
bbac_sa.Version = int.Parse(DateTime.Now.ToString("yyyyMM"));
bbac_sa.State = SettleBillState.;
bbac_sa.SettleBillNum = string.Empty;
bbac_sa.Site = "1040";
bbac_sa.BusinessType = EnumBusinessType.JisBBAC;
billList.Add(bbac_sa);
foreach (var itm1 in ls)
{ {
var ls = bbac_can_list.Where(p => p.LU == itm.LU).ToList(); var _detailEntity = new BBAC_CAN_SA_DETAIL(
decimal sum = 0; guid: GuidGenerator.Create(),
List<BBAC_CAN_SA_DETAIL> details = new List<BBAC_CAN_SA_DETAIL>(); keyCode: itm1.KeyCode,
foreach (var itm1 in ls) version: itm1.Version,
{ billNum: billNum,
sum += (itm1.Qty * itm1.Price); settleBillNum: itm1.SettleBillNum,
if (sum > 10000000) lU: itm1.LU,
{ pN: itm1.PN,
var billNum = OrderNumberGenerator.GenerateOrderNumber("N"); site: itm1.Site,
var bbac_sa = new BBAC_CAN_SA(); qty: itm1.Qty,
bbac_sa.SetId(Guid.NewGuid()); price: itm1.Price,
bbac_sa.BillNum = billNum; category: itm1.BusinessType,
bbac_sa.InvGroupNum = billNum; isReturn: itm1.IsReturn,
bbac_sa.Version = int.Parse(DateTime.Now.ToString("yyyyMM")); settleDate: itm1.SettleDate,
bbac_sa.State = SettleBillState.; groupNum: itm1.GroupNum,
bbac_sa.SettleBillNum = string.Empty; invGroupNum: billNum,
bbac_sa.Site = "1040"; contactid: itm1.ContractDocID,
bbac_sa.BusinessType = EnumBusinessType.JisBBAC; invbillnum: string.Empty,
billList.Add(bbac_sa); partcode: itm1.PartCode
foreach (var itm2 in details) );
{ _detailEntity.RealPartCode = itm1.RealPartCode;
itm2.SetBillNum(billNum); billDetails.Add(_detailEntity);
itm2.SetGroupNum(billNum);
billDetails.Add(itm2);
}
var test = details.Sum(p => p.Price * p.Qty);
var count = details.Count;
details = new List<BBAC_CAN_SA_DETAIL>();
sum = itm1.Qty * itm1.Price;
}
var _detailEntity = new BBAC_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm1.KeyCode,
version: itm1.Version,
billNum: string.Empty,
settleBillNum: itm1.SettleBillNum,
lU: itm1.LU,
pN: itm1.PN,
site: itm1.Site,
qty: itm1.Qty,
price: itm1.Price,
category: itm1.BusinessType,
isReturn: itm1.IsReturn,
settleDate: itm1.SettleDate,
groupNum: itm1.GroupNum,
invGroupNum: string.Empty,
contactid: itm1.ContractDocID,
invbillnum: string.Empty,
partcode: itm1.PartCode
);
_detailEntity.RealPartCode = itm1.RealPartCode;
details.Add(_detailEntity);
}
var billNum1 = OrderNumberGenerator.GenerateOrderNumber("N");
var bbac_sa1 = new BBAC_CAN_SA();
bbac_sa1.SetId(Guid.NewGuid());
bbac_sa1.BillNum = billNum1;
bbac_sa1.InvGroupNum = billNum1;
bbac_sa1.Version = int.Parse(DateTime.Now.ToString("yyyyMM"));
bbac_sa1.State = SettleBillState.;
bbac_sa1.SettleBillNum = string.Empty;
bbac_sa1.Site = "1040";
bbac_sa1.BusinessType = EnumBusinessType.JisBBAC;
billList.Add(bbac_sa1);
foreach (var detail in details)
{
detail.SetBillNum(billNum1);
detail.SetGroupNum(billNum1);
billDetails.Add(detail);
}
} }
//foreach (var itm in part_group_big)
//{
// var ls = bbac_can_list.Where(p => p.LU == itm.LU).ToList();
// decimal sum = 0;
// List<BBAC_CAN_SA_DETAIL> details = new List<BBAC_CAN_SA_DETAIL>();
// foreach (var itm1 in ls)
// {
// sum += (itm1.Qty * itm1.Price);
// if (sum > 10000000)
// {
// var billNum = OrderNumberGenerator.GenerateOrderNumber("N");
// var bbac_sa = new BBAC_CAN_SA();
// bbac_sa.SetId(Guid.NewGuid());
// bbac_sa.BillNum = billNum;
// bbac_sa.InvGroupNum = billNum;
// bbac_sa.Version = int.Parse(DateTime.Now.ToString("yyyyMM"));
// bbac_sa.State = SettleBillState.未结状态;
// bbac_sa.SettleBillNum = string.Empty;
// bbac_sa.Site = "1040";
// bbac_sa.BusinessType = EnumBusinessType.JisBBAC;
// billList.Add(bbac_sa);
// foreach (var itm2 in details)
// {
// itm2.SetBillNum(billNum);
// itm2.SetGroupNum(billNum);
// billDetails.Add(itm2);
// }
// var test = details.Sum(p => p.Price * p.Qty);
// var count = details.Count;
// details = new List<BBAC_CAN_SA_DETAIL>();
// sum = itm1.Qty * itm1.Price;
// }
// var _detailEntity = new BBAC_CAN_SA_DETAIL(
// guid: GuidGenerator.Create(),
// keyCode: itm1.KeyCode,
// version: itm1.Version,
// billNum: string.Empty,
// settleBillNum: itm1.SettleBillNum,
// lU: itm1.LU,
// pN: itm1.PN,
// site: itm1.Site,
// qty: itm1.Qty,
// price: itm1.Price,
// category: itm1.BusinessType,
// isReturn: itm1.IsReturn,
// settleDate: itm1.SettleDate,
// groupNum: itm1.GroupNum,
// invGroupNum: string.Empty,
// contactid: itm1.ContractDocID,
// invbillnum: string.Empty,
// partcode: itm1.PartCode
// );
// _detailEntity.RealPartCode = itm1.RealPartCode;
// details.Add(_detailEntity);
// }
// var billNum1 = OrderNumberGenerator.GenerateOrderNumber("N");
// var bbac_sa1 = new BBAC_CAN_SA();
// bbac_sa1.SetId(Guid.NewGuid());
// bbac_sa1.BillNum = billNum1;
// bbac_sa1.InvGroupNum = billNum1;
// bbac_sa1.Version = int.Parse(DateTime.Now.ToString("yyyyMM"));
// bbac_sa1.State = SettleBillState.未结状态;
// bbac_sa1.SettleBillNum = string.Empty;
// bbac_sa1.Site = "1040";
// bbac_sa1.BusinessType = EnumBusinessType.JisBBAC;
// billList.Add(bbac_sa1);
// foreach (var detail in details)
// {
// detail.SetBillNum(billNum1);
// detail.SetGroupNum(billNum1);
// billDetails.Add(detail);
// }
//}
} }
if (part_group_small.Count > 0) if (part_group_small.Count > 0)
{ {
@ -335,77 +375,117 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
var part_group_small = t1.Where(p => p.Amt < 10000000).ToList(); var part_group_small = t1.Where(p => p.Amt < 10000000).ToList();
if (part_group_big.Count > 0) if (part_group_big.Count > 0)
{ {
foreach (var itm in part_group_big)
var partlist = part_group_big.Select(p => p.LU).ToList();
var ls = bbac_can_list.Where(p => partlist.Contains(p.LU)).ToList();
var billNum = OrderNumberGenerator.GenerateOrderNumber("N");
var bbac_sa = new BBAC_CAN_SA();
bbac_sa.SetId(Guid.NewGuid());
bbac_sa.BillNum = billNum;
bbac_sa.InvGroupNum = billNum;
bbac_sa.Version = int.Parse(DateTime.Now.ToString("yyyyMM"));
bbac_sa.State = SettleBillState.;
bbac_sa.SettleBillNum = string.Empty;
bbac_sa.Site = "1046";
bbac_sa.BusinessType = EnumBusinessType.JisBBAC;
billList.Add(bbac_sa);
foreach (var itm1 in ls)
{ {
var ls = bbac_can_list.Where(p => p.LU == itm.LU).ToList(); var _detailEntity = new BBAC_CAN_SA_DETAIL(
decimal sum = 0; guid: GuidGenerator.Create(),
List<BBAC_CAN_SA_DETAIL> details = new List<BBAC_CAN_SA_DETAIL>(); keyCode: itm1.KeyCode,
foreach (var itm1 in ls) version: itm1.Version,
{ billNum: billNum,
sum += (itm1.Qty * itm1.Price); settleBillNum: itm1.SettleBillNum,
if (sum > 10000000) lU: itm1.LU,
{ pN: itm1.PN,
var billNum = OrderNumberGenerator.GenerateOrderNumber("N"); site: itm1.Site,
var bbac_sa = new BBAC_CAN_SA(); qty: itm1.Qty,
bbac_sa.SetId(Guid.NewGuid()); price: itm1.Price,
bbac_sa.BillNum = billNum; category: itm1.BusinessType,
bbac_sa.InvGroupNum = billNum; isReturn: itm1.IsReturn,
bbac_sa.Version = int.Parse(DateTime.Now.ToString("yyyyMM")); settleDate: itm1.SettleDate,
bbac_sa.State = SettleBillState.; groupNum: itm1.GroupNum,
bbac_sa.SettleBillNum = string.Empty; invGroupNum: billNum,
bbac_sa.Site = "1046"; contactid: itm1.ContractDocID,
bbac_sa.BusinessType = EnumBusinessType.JisBBAC; invbillnum: string.Empty,
billList.Add(bbac_sa); partcode: itm1.PartCode
foreach (var itm2 in details) );
{ _detailEntity.RealPartCode = itm1.RealPartCode;
itm2.SetBillNum(billNum); billDetails.Add(_detailEntity);
itm2.SetGroupNum(billNum);
billDetails.Add(itm2);
}
details = new List<BBAC_CAN_SA_DETAIL>();
sum = itm1.Qty * itm1.Price;
}
var _detailEntity = new BBAC_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm1.KeyCode,
version: itm1.Version,
billNum: string.Empty,
settleBillNum: itm1.SettleBillNum,
lU: itm1.LU,
pN: itm1.PN,
site: itm1.Site,
qty: itm1.Qty,
price: itm1.Price,
category: itm1.BusinessType,
isReturn: itm1.IsReturn,
settleDate: itm1.SettleDate,
groupNum: itm1.GroupNum,
invGroupNum: string.Empty,
contactid: itm1.ContractDocID,
invbillnum: string.Empty,
partcode: itm1.PartCode
);
_detailEntity.RealPartCode = itm1.RealPartCode;
details.Add(_detailEntity);
}
var billNum1 = OrderNumberGenerator.GenerateOrderNumber("N");
var bbac_sa1 = new BBAC_CAN_SA();
bbac_sa1.SetId(Guid.NewGuid());
bbac_sa1.BillNum = billNum1;
bbac_sa1.InvGroupNum = billNum1;
bbac_sa1.Version = int.Parse(DateTime.Now.ToString("yyyyMM"));
bbac_sa1.State = SettleBillState.;
bbac_sa1.SettleBillNum = string.Empty;
bbac_sa1.Site = "1046";
bbac_sa1.BusinessType = EnumBusinessType.JisBBAC;
billList.Add(bbac_sa1);
foreach (var detail in details)
{
detail.SetBillNum(billNum1);
detail.SetGroupNum(billNum1);
billDetails.Add(detail);
}
} }
//foreach (var itm in part_group_big)
//{
// var ls = bbac_can_list.Where(p => p.LU == itm.LU).ToList();
// decimal sum = 0;
// List<BBAC_CAN_SA_DETAIL> details = new List<BBAC_CAN_SA_DETAIL>();
// foreach (var itm1 in ls)
// {
// sum += (itm1.Qty * itm1.Price);
// if (sum > 10000000)
// {
// var billNum = OrderNumberGenerator.GenerateOrderNumber("N");
// var bbac_sa = new BBAC_CAN_SA();
// bbac_sa.SetId(Guid.NewGuid());
// bbac_sa.BillNum = billNum;
// bbac_sa.InvGroupNum = billNum;
// bbac_sa.Version = int.Parse(DateTime.Now.ToString("yyyyMM"));
// bbac_sa.State = SettleBillState.未结状态;
// bbac_sa.SettleBillNum = string.Empty;
// bbac_sa.Site = "1046";
// bbac_sa.BusinessType = EnumBusinessType.JisBBAC;
// billList.Add(bbac_sa);
// foreach (var itm2 in details)
// {
// itm2.SetBillNum(billNum);
// itm2.SetGroupNum(billNum);
// billDetails.Add(itm2);
// }
// details = new List<BBAC_CAN_SA_DETAIL>();
// sum = itm1.Qty * itm1.Price;
// }
// var _detailEntity = new BBAC_CAN_SA_DETAIL(
// guid: GuidGenerator.Create(),
// keyCode: itm1.KeyCode,
// version: itm1.Version,
// billNum: string.Empty,
// settleBillNum: itm1.SettleBillNum,
// lU: itm1.LU,
// pN: itm1.PN,
// site: itm1.Site,
// qty: itm1.Qty,
// price: itm1.Price,
// category: itm1.BusinessType,
// isReturn: itm1.IsReturn,
// settleDate: itm1.SettleDate,
// groupNum: itm1.GroupNum,
// invGroupNum: string.Empty,
// contactid: itm1.ContractDocID,
// invbillnum: string.Empty,
// partcode: itm1.PartCode
// );
// _detailEntity.RealPartCode = itm1.RealPartCode;
// details.Add(_detailEntity);
// }
// var billNum1 = OrderNumberGenerator.GenerateOrderNumber("N");
// var bbac_sa1 = new BBAC_CAN_SA();
// bbac_sa1.SetId(Guid.NewGuid());
// bbac_sa1.BillNum = billNum1;
// bbac_sa1.InvGroupNum = billNum1;
// bbac_sa1.Version = int.Parse(DateTime.Now.ToString("yyyyMM"));
// bbac_sa1.State = SettleBillState.未结状态;
// bbac_sa1.SettleBillNum = string.Empty;
// bbac_sa1.Site = "1046";
// bbac_sa1.BusinessType = EnumBusinessType.JisBBAC;
// billList.Add(bbac_sa1);
// foreach (var detail in details)
// {
// detail.SetBillNum(billNum1);
// detail.SetGroupNum(billNum1);
// billDetails.Add(detail);
// }
//}
} }
if (part_group_small.Count > 0) if (part_group_small.Count > 0)
{ {
@ -635,75 +715,75 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
var part_group_small = t1.Where(p => p.Amt < 10000000).ToList(); var part_group_small = t1.Where(p => p.Amt < 10000000).ToList();
if (part_group_big.Count > 0) if (part_group_big.Count > 0)
{ {
foreach (var itm in part_group_big) //foreach (var itm in part_group_big)
{ //{
var ls = hbpo_can_list.Where(p => p.LU == itm.LU).ToList(); // var ls = hbpo_can_list.Where(p => p.LU == itm.LU).ToList();
decimal sum = 0; // decimal sum = 0;
List<HBPO_CAN_SA_DETAIL> details = new List<HBPO_CAN_SA_DETAIL>(); // List<HBPO_CAN_SA_DETAIL> details = new List<HBPO_CAN_SA_DETAIL>();
foreach (var itm1 in ls) // foreach (var itm1 in ls)
{ // {
sum += (itm1.Qty * itm1.Price); // sum += (itm1.Qty * itm1.Price);
if (sum > 10000000) // if (sum > 10000000)
{ // {
var billNum = OrderNumberGenerator.GenerateOrderNumber("N"); // var billNum = OrderNumberGenerator.GenerateOrderNumber("N");
var bbac_sa = new HBPO_CAN_SA(); // var bbac_sa = new HBPO_CAN_SA();
bbac_sa.SetId(Guid.NewGuid()); // bbac_sa.SetId(Guid.NewGuid());
bbac_sa.BillNum = billNum; // bbac_sa.BillNum = billNum;
bbac_sa.InvGroupNum = billNum; // bbac_sa.InvGroupNum = billNum;
bbac_sa.Version = int.Parse(DateTime.Now.ToString("yyyyMM")); // bbac_sa.Version = int.Parse(DateTime.Now.ToString("yyyyMM"));
bbac_sa.State = SettleBillState.; // bbac_sa.State = SettleBillState.未结状态;
bbac_sa.SettleBillNum = string.Empty; // bbac_sa.SettleBillNum = string.Empty;
bbac_sa.Site = "104T"; // bbac_sa.Site = "104T";
bbac_sa.BusinessType = EnumBusinessType.JisBBAC; // bbac_sa.BusinessType = EnumBusinessType.JisBBAC;
billList.Add(bbac_sa); // billList.Add(bbac_sa);
foreach (var itm2 in details) // foreach (var itm2 in details)
{ // {
itm2.SetBillNum(billNum); // itm2.SetBillNum(billNum);
itm2.SetGroupNum(billNum); // itm2.SetGroupNum(billNum);
billDetails.Add(itm2); // billDetails.Add(itm2);
} // }
details = new List<HBPO_CAN_SA_DETAIL>(); // details = new List<HBPO_CAN_SA_DETAIL>();
sum = itm1.Qty * itm1.Price; // sum = itm1.Qty * itm1.Price;
} // }
var _detailEntity = new HBPO_CAN_SA_DETAIL( // var _detailEntity = new HBPO_CAN_SA_DETAIL(
guid: GuidGenerator.Create(), // guid: GuidGenerator.Create(),
keyCode: itm1.KeyCode, // keyCode: itm1.KeyCode,
version: itm1.Version, // version: itm1.Version,
billNum: string.Empty, // billNum: string.Empty,
settleBillNum: itm1.SettleBillNum, // settleBillNum: itm1.SettleBillNum,
lU: itm1.LU, // lU: itm1.LU,
pN: itm1.PN, // pN: itm1.PN,
site: itm1.Site, // site: itm1.Site,
qty: itm1.Qty, // qty: itm1.Qty,
price: itm1.Price, // price: itm1.Price,
businessType: itm1.BusinessType, // businessType: itm1.BusinessType,
settleDate: itm1.SettleDate, // settleDate: itm1.SettleDate,
groupNum: itm1.GroupNum, // groupNum: itm1.GroupNum,
invGroupNum: string.Empty, // invGroupNum: string.Empty,
invbillnum: string.Empty, // invbillnum: string.Empty,
partcode: itm1.PartCode // partcode: itm1.PartCode
); // );
_detailEntity.RealPartCode = itm1.RealPartCode; // _detailEntity.RealPartCode = itm1.RealPartCode;
details.Add(_detailEntity); // details.Add(_detailEntity);
} // }
var billNum1 = OrderNumberGenerator.GenerateOrderNumber("N"); // var billNum1 = OrderNumberGenerator.GenerateOrderNumber("N");
var bbac_sa1 = new HBPO_CAN_SA(); // var bbac_sa1 = new HBPO_CAN_SA();
bbac_sa1.SetId(Guid.NewGuid()); // bbac_sa1.SetId(Guid.NewGuid());
bbac_sa1.BillNum = billNum1; // bbac_sa1.BillNum = billNum1;
bbac_sa1.InvGroupNum = billNum1; // bbac_sa1.InvGroupNum = billNum1;
bbac_sa1.Version = int.Parse(DateTime.Now.ToString("yyyyMM")); // bbac_sa1.Version = int.Parse(DateTime.Now.ToString("yyyyMM"));
bbac_sa1.State = SettleBillState.; // bbac_sa1.State = SettleBillState.未结状态;
bbac_sa1.SettleBillNum = string.Empty; // bbac_sa1.SettleBillNum = string.Empty;
bbac_sa1.Site = "104T"; // bbac_sa1.Site = "104T";
bbac_sa1.BusinessType = EnumBusinessType.JisBBAC; // bbac_sa1.BusinessType = EnumBusinessType.JisBBAC;
billList.Add(bbac_sa1); // billList.Add(bbac_sa1);
foreach (var detail in details) // foreach (var detail in details)
{ // {
detail.SetBillNum(billNum1); // detail.SetBillNum(billNum1);
detail.SetGroupNum(billNum1); // detail.SetGroupNum(billNum1);
billDetails.Add(detail); // billDetails.Add(detail);
} // }
} //}
} }
if (part_group_small.Count > 0) if (part_group_small.Count > 0)
{ {

5
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

@ -38,11 +38,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
private readonly INormalEfCoreRepository<INVOICE_GRP, Guid> _repository; private readonly INormalEfCoreRepository<INVOICE_GRP, Guid> _repository;
private readonly INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> _groupRepository; private readonly INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> _groupRepository;
private readonly INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> _detailRepository; private readonly INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> _detailRepository;
private readonly INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> _nothbpoRepository; private readonly INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> _nothbpoRepository;
private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _notpubRepository; private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _notpubRepository;
private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relationRepository; private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relationRepository;
private readonly INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> _notRepository; private readonly INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> _notRepository;
private readonly INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> _adjRepository; private readonly INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> _adjRepository;
@ -501,8 +498,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invGroupNum: itm.InvGroupNum, invGroupNum: itm.InvGroupNum,
site: itm.Site, site: itm.Site,
enumBusinessType:itm.BusinessType enumBusinessType:itm.BusinessType
); );
bbac.SetBusinessType(itm.BusinessType); bbac.SetBusinessType(itm.BusinessType);
bbacmainlist.Add(bbac); bbacmainlist.Add(bbac);

10
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs

@ -105,12 +105,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单
} }
if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC || first.BusinessType == EnumBusinessType.YinDuJian) if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC || first.BusinessType == EnumBusinessType.YinDuJian)
{ {
var ls = p_list.Select(p => p.GroupNum).Distinct().ToList(); var ls = p_list.Select(p => p.GroupNum).Distinct().ToList();
var notlist = _notRepository.Where(p => ls.Contains(p.GroupNum) && p.BusinessType==first.BusinessType).AsNoTracking().ToList();//JIT_ASN整发 var notlist = p_list;//JIT_ASN整发
if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC) if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC)
{ {
var subqueryA = (from a in notlist var subqueryA = (from a in notlist
@ -152,14 +150,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
List<PriceList> priceLists = new List<PriceList>(); List<PriceList> priceLists = new List<PriceList>();
foreach (var itm in notlist) foreach (var itm in notlist)
{ {
var priceListEntity = priceList.Where(p => p.IsCancel == false) var priceListEntity = priceList.Where(p => p.IsCancel == false)
.Where(t => t.LU == itm.LU) .Where(t => t.LU == itm.LU)
.Where(t => itm.SettleDate >= t.BeginTime && itm.SettleDate <= t.EndTime && t.ClientCode == itm.Site) .Where(t => itm.SettleDate >= t.BeginTime && itm.SettleDate <= t.EndTime && t.ClientCode == itm.Site)
.OrderByDescending(t => t.Date) .OrderByDescending(t => t.Date)
.ThenByDescending(t => t.CreationTime) .ThenByDescending(t => t.CreationTime)
.FirstOrDefault(); .FirstOrDefault();
if (priceListEntity != null) if (priceListEntity != null)
{ {
itm.Price = priceListEntity.Price; itm.Price = priceListEntity.Price;
@ -168,9 +164,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
itm.Price = 0; itm.Price = 0;
} }
} }
var result1 = notlist.Where(p=>p.Price!=0); var result1 = notlist.Where(p=>p.Price!=0);
var jit1 = result1.Where(p => p.Site == "1040").ToList(); var jit1 = result1.Where(p => p.Site == "1040").ToList();
var jit2 = result1.Where(p => p.Site == "1046").ToList(); var jit2 = result1.Where(p => p.Site == "1046").ToList();
@ -456,8 +450,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
} }
await _repository.DbContext.BulkDeleteAsync(notList).ConfigureAwait(false); await _repository.DbContext.BulkDeleteAsync(notList).ConfigureAwait(false);
await _repository.DbContext.BulkInsertAsync(billList).ConfigureAwait(false); await _repository.DbContext.BulkInsertAsync(billList).ConfigureAwait(false);

Loading…
Cancel
Save