| | |
| | | base.AfterExecuteOperationTransaction(e); |
| | | List<string> sqlList = new List<string>(); |
| | | string sql = ""; |
| | | //审核时更新生产用料清单表明细领料数量 |
| | | //反审核时更新生产用料清单表明细领料数量 |
| | | Entity entity = this.BusinessInfo.GetEntity("FEntity");//获取明细信息 |
| | | foreach (var billObj in e.SelectedRows) |
| | | { |
| | | DynamicObjectCollection entryRows = entity.DynamicProperty.GetValue(billObj.DataEntity) |
| | | as DynamicObjectCollection; |
| | | foreach (var entryRow in entryRows) |
| | | { |
| | | string fDayPlanFentryId = entryRow["FDayPlanFentryId"].ToString(); |
| | | string fHQtyMust = entryRow["FHQtyMust"].ToString(); |
| | | string fUseRate = entryRow["FUseRate"].ToString(); |
| | | string fDwyl = entryRow["FDwyl"].ToString(); |
| | | string fHPPBomEntryID = entryRow["FHPPBomEntryID"].ToString(); |
| | | sql = string.Format($"/*dialect*/update Sc_DayPlanPPBomBillSub set FHQtyMust = {fHQtyMust},FUseRate = { fUseRate} where FEntryID ={fDayPlanFentryId} "); |
| | | sqlList.Add(sql); |
| | | sql = string.Format(@"/*dialect*/ |
| | | update T_PRD_PPBOMENTRY set |
| | | FBASENEEDQTY = c.FHQtyMust, |
| | | FBASEMUSTQTY = c.FHQtyMust, |
| | | FSTDQTY = c.FHQtyMust, |
| | | FNEEDQTY = c.FHQtyMust, |
| | | FMUSTQTY = c.FHQtyMust, |
| | | FUSERATE = (c.FHQtyMust / {0} / b.FQTY *100) |
| | | from T_PRD_PPBOMENTRY a |
| | | join T_PRD_PPBOM b on a.FID=b.FID |
| | | join (select sum(FHQtyMust) FHQtyMust,FHPPBomEntryID from Sc_DayPlanPPBomBillSub where FHPPBomEntryID = {1} group by FHPPBomEntryID) c on a.FENTRYID=c.FHPPBomEntryID |
| | | where a.FENTRYID = {1}", fDwyl, fHPPBomEntryID); |
| | | sqlList.Add(sql); |
| | | sql = string.Format(@"/*dialect*/ |
| | | update T_PRD_PPBOMENTRY_Q set |
| | | FNOPICKEDQTY = b.FMUSTQTY - a.FPICKEDQTY, |
| | | FBASENOPICKEDQTY = b.FMUSTQTY - a.FPICKEDQTY |
| | | from T_PRD_PPBOMENTRY_Q a |
| | | join T_PRD_PPBOMENTRY b on a.FENTRYID=b.FENTRYID |
| | | where a.FENTRYID = {0} |
| | | ", fHPPBomEntryID); |
| | | sqlList.Add(sql); |
| | | } |
| | | sql = $"/*dialect*/ exec pr_FSHRjhylqdBgUpdate {billObj["Id"].ToString()}"; |
| | | sqlList.Add(sql); |
| | | } |
| | | DBServiceHelper.ExecuteBatch(Context, sqlList); |
| | | } |