| | |
| | | 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; |
| | | } |
| | | |
| | | } |
| | | |
| | | /* 成品出库单标记完成 */ |