|
|
@@ -124,7 +124,6 @@ public abstract class BasicBill {
|
|
|
public ArrayList<String> getCheckSql(boolean ischeck) throws YosException {
|
|
|
ArrayList<String> sqlList = new ArrayList<>();
|
|
|
sqlList.addAll(updateInvbal(ischeck));//更新库存
|
|
|
- sqlList.addAll(updateIcinvbal_sale(ischeck));//更新总仓可发货量
|
|
|
sqlList.addAll(updateMCode(ischeck));//更新序列号
|
|
|
sqlList.addAll(updateHongqty(ischeck));//更新红冲数量
|
|
|
sqlList.addAll(updateStatus(ischeck));//更新状态
|
|
|
@@ -185,48 +184,7 @@ public abstract class BasicBill {
|
|
|
invbalUpdate.setWhere("siteid", siteid);
|
|
|
sqlList.add(invbalUpdate.getSQL());
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- return sqlList;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 更新总仓可发货量
|
|
|
- *
|
|
|
- * @param ischeck
|
|
|
- * @return
|
|
|
- * @throws YosException
|
|
|
- */
|
|
|
- public ArrayList<String> updateIcinvbal_sale(boolean ischeck) throws YosException {
|
|
|
- Rows ICINVBAL_SALE = SQLFactory.createQuerySQL(dbConnect, "st_invbal_sale").setSiteid(siteid).setWhere("itemid", itemRows.toArrayList("itemid")).query();
|
|
|
- RowsMap ICINVBAL_SALERowsMap = ICINVBAL_SALE.toRowsMap("itemid");
|
|
|
- int i = 0;
|
|
|
- ArrayList<String> sqlList = new ArrayList<>();
|
|
|
- for (Row row : itemRows) {
|
|
|
- long st_invbal_saleid;
|
|
|
- if (ICINVBAL_SALERowsMap.containsKey(row.getString("itemid"))) {
|
|
|
- st_invbal_saleid = ICINVBAL_SALERowsMap.get(row.getString("itemid")).get(0).getLong("st_invbal_saleid");
|
|
|
- } else {
|
|
|
- st_invbal_saleid = controller.createTableID("st_invbal_sale");
|
|
|
- InsertSQL insertSQL = SQLFactory.createInsertSQL(controller, "st_invbal_sale");
|
|
|
- insertSQL.setUniqueid(st_invbal_saleid);
|
|
|
- insertSQL.setSiteid(siteid);
|
|
|
- insertSQL.setValue("itemid", row.getString("itemid"));
|
|
|
- insertSQL.setValue("candispatchqty", 0);
|
|
|
- insertSQL.setValue("cansaleqty", 0);
|
|
|
- insertSQL.setValue("qty", 0);
|
|
|
- insertSQL.setValue("changeuserid", controller.userid);
|
|
|
- insertSQL.setValue("changeby", controller.username);
|
|
|
- insertSQL.setDateValue("changedate");
|
|
|
- sqlList.add(insertSQL.getSQL());
|
|
|
}
|
|
|
- BigDecimal qty = BigDecimal.ZERO;
|
|
|
-
|
|
|
- qty = ischeck ? row.getBigDecimal("qty") : row.getBigDecimal("qty").negate();
|
|
|
-
|
|
|
- sqlList.add("update st_invbal_sale set candispatchqty=candispatchqty-" + qty + " where st_invbal_saleid=" + st_invbal_saleid);
|
|
|
}
|
|
|
return sqlList;
|
|
|
}
|