From 0df8f305406412a1229bf412a574cb026ac802cf Mon Sep 17 00:00:00 2001 From: 18516761980 <4761516tqsxp> Date: 星期五, 24 九月 2021 13:03:12 +0800 Subject: [PATCH] # --- src/main/java/com/zy/common/service/erp/ErpService.java | 45 ++++++++++++++++++++++++++------------------- 1 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/zy/common/service/erp/ErpService.java b/src/main/java/com/zy/common/service/erp/ErpService.java index 142d9d0..f4e3d9d 100644 --- a/src/main/java/com/zy/common/service/erp/ErpService.java +++ b/src/main/java/com/zy/common/service/erp/ErpService.java @@ -300,30 +300,37 @@ public boolean incrementCPakOut(Integer FInterID, String Fnumber, Double increment, String FBillNo) { String sql = "update OutStockbillEntry set FAuxCommitQty = (FAuxCommitQty + {0,number,#}) where 1=1 and Fnumber = ''{1}'' and FInterID = {2,number,#}"; sql = MessageFormat.format(sql, increment, Fnumber, FInterID); - if (erpSqlServer.update(sql) > 0) { - sql = "select * from OutStockbillEntry where 1=1 and Fnumber = ''{0}'' and FInterID = {1,number,#}"; - sql = MessageFormat.format(sql, Fnumber, FInterID); - List<OutStockBillEntry> select = erpSqlServer.select(sql, OutStockBillEntry.class); - OutStockBillEntry outStockBillEntry = select.get(0); - boolean complete = false; - if (outStockBillEntry.getFQty().compareTo(BigDecimal.ZERO) == 1) { - if (outStockBillEntry.getFAuxCommitQty().compareTo(outStockBillEntry.getFQty()) > -1) { - complete = true; + try { + if (erpSqlServer.update(sql) > 0) { + sql = "select * from OutStockbillEntry where 1=1 and Fnumber = ''{0}'' and FInterID = {1,number,#}"; + sql = MessageFormat.format(sql, Fnumber, FInterID); + List<OutStockBillEntry> select = erpSqlServer.select(sql, OutStockBillEntry.class); + OutStockBillEntry outStockBillEntry = select.get(0); + boolean complete = false; + if (outStockBillEntry.getFQty().compareTo(BigDecimal.ZERO) == 1) { + if (outStockBillEntry.getFAuxCommitQty().compareTo(outStockBillEntry.getFQty()) > -1) { + complete = true; + } + } else { + if (outStockBillEntry.getFAuxCommitQty().compareTo(outStockBillEntry.getFAuxQty()) > -1) { + complete = true; + } } + if (complete) { + if (!completeCPakOut(FBillNo)) { + log.error("{}鍑哄簱鍗曟爣璁板畬鎴愬け璐�", FBillNo); + } + } + return true; } else { - if (outStockBillEntry.getFAuxCommitQty().compareTo(outStockBillEntry.getFAuxQty()) > -1) { - complete = true; - } + return false; } - if (complete) { - if (!completeCPakOut(FBillNo)) { - log.error("{}鍑哄簱鍗曟爣璁板畬鎴愬け璐�", FBillNo); - } - } - return true; - } else { + }catch (Exception e){ + e.printStackTrace(); + log.error("incrementCPakOut----" + sql); return false; } + } /* 鎴愬搧鍑哄簱鍗曟爣璁板畬鎴� */ -- Gitblit v1.9.1