From 13b4d92f6f8f429bb9a404cc8fb8c6a16d40271d Mon Sep 17 00:00:00 2001 From: mzr <1562242162@qq.com> Date: Mon, 30 Dec 2024 19:33:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E6=96=99=E8=AE=A1=E5=88=92=E8=BD=AC?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E7=94=B3=E8=AF=B7=E5=8D=95-=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ic/src/private/nc/bs/pub/action/N_4455_WRITE.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ic/src/private/nc/bs/pub/action/N_4455_WRITE.java b/ic/src/private/nc/bs/pub/action/N_4455_WRITE.java index feaf849..fc26fe9 100644 --- a/ic/src/private/nc/bs/pub/action/N_4455_WRITE.java +++ b/ic/src/private/nc/bs/pub/action/N_4455_WRITE.java @@ -74,9 +74,12 @@ public class N_4455_WRITE extends AbstractCompiler2 { // 通过备料计划的表体主键查询已申请数量 String getApplyNumSql = "SELECT NVL(SUM(nassistnum),0) nassistnum " + "FROM ic_sapply_b " - + "WHERE NVL(dr,0) = 0 AND csourcebillbid = '[csourcebillbid]' and cgeneralbid != '[bid]'"; + + "WHERE NVL(dr,0) = 0 AND csourcebillbid = '[csourcebillbid]'"; getApplyNumSql = getApplyNumSql.replace("[csourcebillbid]", csourcebillbid); - getApplyNumSql = getApplyNumSql.replace("[bid]", bodyVO.getPrimaryKey()); + // 修改的时候加上子表主键 + if (null != outVOs[0] && null != outVOs[0].getHead() && null != outVOs[0].getHead().getCgeneralhid()) { + getApplyNumSql += " AND cgeneralbid != '" + bodyVO.getPrimaryKey() + "'"; + } Object nassistnum = getBaseDAO().executeQuery(getApplyNumSql, new ColumnProcessor("nassistnum")); UFDouble applyNum = new UFDouble(String.valueOf(nassistnum));