From 7ed12f20250d588ee7181efa5faf0574d82ae50c Mon Sep 17 00:00:00 2001 From: lihao Date: Mon, 26 May 2025 18:42:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E7=8A=B6=E6=80=81=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/so/so/UpCloses/ClosesoUpdateBL.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/so/src/public/nccloud/api/so/so/UpCloses/ClosesoUpdateBL.java b/so/src/public/nccloud/api/so/so/UpCloses/ClosesoUpdateBL.java index 0f24c7c..a5ea41d 100644 --- a/so/src/public/nccloud/api/so/so/UpCloses/ClosesoUpdateBL.java +++ b/so/src/public/nccloud/api/so/so/UpCloses/ClosesoUpdateBL.java @@ -79,6 +79,7 @@ public class ClosesoUpdateBL extends AbstractNCCRestResource { public JSONString ClosesoUpdateBL(JSONString json) { JSONObject errojson = new JSONObject(); Set vbillcodes = new HashSet<>(); + Set billcodes = new HashSet<>(); // 创建map 9-冻结; 10-办结; 11-终止; 8:生效(取消冻结) Map operationMap = new HashMap<>(); @@ -136,9 +137,8 @@ public JSONString ClosesoUpdateBL(JSONString json) { " SET h.vdef1 = '" + operationId + "' "+ " WHERE EXISTS (" + " SELECT 1" + - " FROM so_saleorder_b b" + - " left join bd_defdoc hbd on hbd.pk_defdoc=b.vbdef1 "+ - " WHERE b.csaleorderid = h.csaleorderid" + + " FROM bd_defdoc hbd "+ + " WHERE hbd.pk_defdoc=h.VDEF6" + " AND hbd.code = '" + vctcode + "' " + " );"; @@ -153,10 +153,10 @@ public JSONString ClosesoUpdateBL(JSONString json) { return ResultMessageUtil.exceptionToJSON(new NullPointerException("vctcode:null")); } // 根据组织ID和销售订单代码获取销售订单的唯一标识 - String sql = " select h.csaleorderid,b.csaleorderbid,h.ts,hbd.code as vbillcode,o.code as pk_org from so_saleorder h " + String sql = " select h.csaleorderid,b.csaleorderbid,h.ts,hbd.code as vbillcode,o.code as pk_org,h.vbillcode as billcode from so_saleorder h " + "left join so_saleorder_b b on h.csaleorderid=b.csaleorderid " + "left join org_salesorg o on h.pk_org=o.pk_salesorg " - +" left join bd_defdoc hbd on hbd.pk_defdoc=b.vbdef1 "+ + +" left join bd_defdoc hbd on hbd.pk_defdoc=h.VDEF6 "+ "where hbd.code='" + vctcode + "' "; List result = (List) getQueryService().executeQuery(sql, new ArrayListProcessor()); @@ -175,9 +175,11 @@ public JSONString ClosesoUpdateBL(JSONString json) { String ts = (String) row[2]; bidsList.add(csaleorderbid + "," + ts); String vbillcode = (String) row[3]; + String billcode = (String) row[5]; if (vbillcode != null) { pk_org=(String)row[4]; vbillcodes.add(vbillcode); + billcodes.add(billcode); } } } @@ -239,6 +241,14 @@ public JSONString ClosesoUpdateBL(JSONString json) { int succState = updateSaleBSQty(updateSql.toString()); + for (String vbillcode : billcodes){ + // 更新流程生产订单 + String updateSql1 = " UPDATE mm_mo h" + + " SET h.vdef5 = '" + operationId + "' "+ + " WHERE h.vsrccode = '" + vbillcode + "' " + + " ;"; + updateSaleBSQty(updateSql1.toString()); + } // 如果操作成功,设置错误JSON对象的code为0,表示成功 errojson.put("status", "1"); errojson.put("message", "销售订单状态修改了"+succState+"条,"+ret2);