|
@ -52,8 +52,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
bbacquery = bbacquery.Where(filers.ToLambda<BBAC_NOT_SA_DETAIL>()); |
|
|
bbacquery = bbacquery.Where(filers.ToLambda<BBAC_NOT_SA_DETAIL>()); |
|
|
} |
|
|
} |
|
|
var p_list = bbacquery.ToList(); |
|
|
var p_list = bbacquery.ToList(); |
|
|
|
|
|
if (p_list.Count == 0) |
|
|
|
|
|
{ |
|
|
|
|
|
var ls = _dbcontext.Set<CodeSetting>().Where(p => p.Project == "BBAC_NOT" && p.Value == "True").ToList(); |
|
|
|
|
|
if (ls.Any()) |
|
|
|
|
|
{ |
|
|
|
|
|
_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>(); |
|
@ -107,6 +113,28 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
List<BBAC_CAN_SA_DETAIL> details = new List<BBAC_CAN_SA_DETAIL>(); |
|
|
List<BBAC_CAN_SA_DETAIL> details = new List<BBAC_CAN_SA_DETAIL>(); |
|
|
foreach (var itm1 in ls) |
|
|
foreach (var itm1 in ls) |
|
|
{ |
|
|
{ |
|
|
|
|
|
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); |
|
|
sum += (itm1.Qty * itm1.Price); |
|
|
sum += (itm1.Qty * itm1.Price); |
|
|
if (sum > 10000000) |
|
|
if (sum > 10000000) |
|
|
{ |
|
|
{ |
|
@ -130,29 +158,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
details = new List<BBAC_CAN_SA_DETAIL>(); |
|
|
details = new List<BBAC_CAN_SA_DETAIL>(); |
|
|
sum = 0; |
|
|
sum = 0; |
|
|
} |
|
|
} |
|
|
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 billNum1 = OrderNumberGenerator.GenerateOrderNumber("N"); |
|
|
var bbac_sa1 = new BBAC_CAN_SA(); |
|
|
var bbac_sa1 = new BBAC_CAN_SA(); |
|
@ -265,6 +270,28 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
List<BBAC_CAN_SA_DETAIL> details = new List<BBAC_CAN_SA_DETAIL>(); |
|
|
List<BBAC_CAN_SA_DETAIL> details = new List<BBAC_CAN_SA_DETAIL>(); |
|
|
foreach (var itm1 in ls) |
|
|
foreach (var itm1 in ls) |
|
|
{ |
|
|
{ |
|
|
|
|
|
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); |
|
|
sum += (itm1.Qty * itm1.Price); |
|
|
sum += (itm1.Qty * itm1.Price); |
|
|
if (sum > 10000000) |
|
|
if (sum > 10000000) |
|
|
{ |
|
|
{ |
|
@ -288,29 +315,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
details = new List<BBAC_CAN_SA_DETAIL>(); |
|
|
details = new List<BBAC_CAN_SA_DETAIL>(); |
|
|
sum = 0; |
|
|
sum = 0; |
|
|
} |
|
|
} |
|
|
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 billNum1 = OrderNumberGenerator.GenerateOrderNumber("N"); |
|
|
var bbac_sa1 = new BBAC_CAN_SA(); |
|
|
var bbac_sa1 = new BBAC_CAN_SA(); |
|
@ -439,6 +443,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
bbacquery = bbacquery.Where(filers.ToLambda<HBPO_NOT_SA_DETAIL>()); |
|
|
bbacquery = bbacquery.Where(filers.ToLambda<HBPO_NOT_SA_DETAIL>()); |
|
|
} |
|
|
} |
|
|
var p_list = bbacquery.ToList(); |
|
|
var p_list = bbacquery.ToList(); |
|
|
|
|
|
|
|
|
|
|
|
if (p_list.Count == 0) |
|
|
|
|
|
{ |
|
|
|
|
|
var ls = _dbcontext.Set<CodeSetting>().Where(p => p.Project == "BBAC_NOT" && p.Value == "True").ToList(); |
|
|
|
|
|
if (ls.Any()) |
|
|
|
|
|
{ |
|
|
|
|
|
_dbcontext.BulkDelete(ls); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var jis1 = p_list.Where(p => p.Site == "104T").ToList(); |
|
|
var jis1 = p_list.Where(p => p.Site == "104T").ToList(); |
|
|
if (jis1.Count > 0) |
|
|
if (jis1.Count > 0) |
|
|
{ |
|
|
{ |
|
@ -488,6 +502,26 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
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) |
|
|
{ |
|
|
{ |
|
|
|
|
|
var _detailEntity = new HBPO_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, |
|
|
|
|
|
businessType: itm1.BusinessType, |
|
|
|
|
|
settleDate: itm1.SettleDate, |
|
|
|
|
|
groupNum: itm1.GroupNum, |
|
|
|
|
|
invGroupNum: string.Empty, |
|
|
|
|
|
invbillnum: string.Empty, |
|
|
|
|
|
partcode: itm1.PartCode |
|
|
|
|
|
); |
|
|
|
|
|
_detailEntity.RealPartCode = itm1.RealPartCode; |
|
|
|
|
|
details.Add(_detailEntity); |
|
|
sum += (itm1.Qty * itm1.Price); |
|
|
sum += (itm1.Qty * itm1.Price); |
|
|
if (sum > 10000000) |
|
|
if (sum > 10000000) |
|
|
{ |
|
|
{ |
|
@ -511,26 +545,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
details = new List<HBPO_CAN_SA_DETAIL>(); |
|
|
details = new List<HBPO_CAN_SA_DETAIL>(); |
|
|
sum = 0; |
|
|
sum = 0; |
|
|
} |
|
|
} |
|
|
var _detailEntity = new HBPO_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, |
|
|
|
|
|
businessType: itm1.BusinessType, |
|
|
|
|
|
settleDate: itm1.SettleDate, |
|
|
|
|
|
groupNum: itm1.GroupNum, |
|
|
|
|
|
invGroupNum: string.Empty, |
|
|
|
|
|
invbillnum: string.Empty, |
|
|
|
|
|
partcode: itm1.PartCode |
|
|
|
|
|
); |
|
|
|
|
|
_detailEntity.RealPartCode = itm1.RealPartCode; |
|
|
|
|
|
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(); |
|
|