|
@ -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,16 +107,8 @@ 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 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 billNum = OrderNumberGenerator.GenerateOrderNumber("N"); |
|
|
var bbac_sa = new BBAC_CAN_SA(); |
|
|
var bbac_sa = new BBAC_CAN_SA(); |
|
|
bbac_sa.SetId(Guid.NewGuid()); |
|
|
bbac_sa.SetId(Guid.NewGuid()); |
|
@ -127,22 +120,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
bbac_sa.Site = "1040"; |
|
|
bbac_sa.Site = "1040"; |
|
|
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 itm1 in ls) |
|
|
{ |
|
|
{ |
|
|
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( |
|
|
var _detailEntity = new BBAC_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: billNum, |
|
|
settleBillNum: itm1.SettleBillNum, |
|
|
settleBillNum: itm1.SettleBillNum, |
|
|
lU: itm1.LU, |
|
|
lU: itm1.LU, |
|
|
pN: itm1.PN, |
|
|
pN: itm1.PN, |
|
@ -153,32 +137,88 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
isReturn: itm1.IsReturn, |
|
|
isReturn: itm1.IsReturn, |
|
|
settleDate: itm1.SettleDate, |
|
|
settleDate: itm1.SettleDate, |
|
|
groupNum: itm1.GroupNum, |
|
|
groupNum: itm1.GroupNum, |
|
|
invGroupNum: string.Empty, |
|
|
invGroupNum: billNum, |
|
|
contactid: itm1.ContractDocID, |
|
|
contactid: itm1.ContractDocID, |
|
|
invbillnum: string.Empty, |
|
|
invbillnum: string.Empty, |
|
|
partcode: itm1.PartCode |
|
|
partcode: itm1.PartCode |
|
|
); |
|
|
); |
|
|
_detailEntity.RealPartCode = itm1.RealPartCode; |
|
|
_detailEntity.RealPartCode = itm1.RealPartCode; |
|
|
details.Add(_detailEntity); |
|
|
billDetails.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,16 +375,9 @@ 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 => p.LU == itm.LU).ToList(); |
|
|
var ls = bbac_can_list.Where(p => partlist.Contains(p.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 billNum = OrderNumberGenerator.GenerateOrderNumber("N"); |
|
|
var bbac_sa = new BBAC_CAN_SA(); |
|
|
var bbac_sa = new BBAC_CAN_SA(); |
|
|
bbac_sa.SetId(Guid.NewGuid()); |
|
|
bbac_sa.SetId(Guid.NewGuid()); |
|
@ -356,20 +389,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
bbac_sa.Site = "1046"; |
|
|
bbac_sa.Site = "1046"; |
|
|
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 itm1 in ls) |
|
|
{ |
|
|
{ |
|
|
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( |
|
|
var _detailEntity = new BBAC_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: billNum, |
|
|
settleBillNum: itm1.SettleBillNum, |
|
|
settleBillNum: itm1.SettleBillNum, |
|
|
lU: itm1.LU, |
|
|
lU: itm1.LU, |
|
|
pN: itm1.PN, |
|
|
pN: itm1.PN, |
|
@ -380,32 +406,86 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
isReturn: itm1.IsReturn, |
|
|
isReturn: itm1.IsReturn, |
|
|
settleDate: itm1.SettleDate, |
|
|
settleDate: itm1.SettleDate, |
|
|
groupNum: itm1.GroupNum, |
|
|
groupNum: itm1.GroupNum, |
|
|
invGroupNum: string.Empty, |
|
|
invGroupNum: billNum, |
|
|
contactid: itm1.ContractDocID, |
|
|
contactid: itm1.ContractDocID, |
|
|
invbillnum: string.Empty, |
|
|
invbillnum: string.Empty, |
|
|
partcode: itm1.PartCode |
|
|
partcode: itm1.PartCode |
|
|
); |
|
|
); |
|
|
_detailEntity.RealPartCode = itm1.RealPartCode; |
|
|
_detailEntity.RealPartCode = itm1.RealPartCode; |
|
|
details.Add(_detailEntity); |
|
|
billDetails.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) |
|
|
{ |
|
|
{ |
|
|