Class ImportPendingDAO
java.lang.Object
ru.bgcrm.dao.CommonDAO
org.bgerp.plugin.inventory.sync1c.dao.ImportPendingDAO
DAO for inventory_sync1c_import_pending — pending stock balance imports from 1C.
-
Nested Class Summary
Nested classes/interfaces inherited from class ru.bgcrm.dao.CommonDAO
CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T extends Id> -
Field Summary
Fields inherited from class ru.bgcrm.dao.CommonDAO
con, log, SQL_AND, SQL_DELETE, SQL_DELETE_FROM, SQL_DESC, SQL_DISTINCT, SQL_FROM, SQL_GROUP_BY, SQL_INNER_JOIN, SQL_INSERT_IGNORE_INTO, SQL_INSERT_INTO, SQL_LEFT_JOIN, SQL_LIMIT, SQL_ON_DUP_KEY_UPDATE, SQL_ORDER_BY, SQL_REPLACE, SQL_SELECT, SQL_SELECT_ALL_FROM, SQL_SELECT_COUNT_ROWS, SQL_SET, SQL_UNION_ALL, SQL_UPDATE, SQL_VALUES, SQL_VALUES_1, SQL_VALUES_2, SQL_VALUES_3, SQL_VALUES_4, SQL_VALUES_5, SQL_WHERE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(int id, int userId) Applies a pending record: upserts inventory_balance.quantity and marks as applied.intapplyAll(List<ImportPending> list, int userId) Applies all pending records from the given list.getListForInstance(int instanceId) Returns all pending records for the given 1C instance (admin view).getListForUser(int userId) Returns all pending records for the given user (via engineer warehouse userId).voidreject(int id) Rejects a pending record.voidupsert(int instanceId, int ewId, int storeId, int itemId, BigDecimal quantity) Upserts a pending record by (ew_id, item_id).Methods inherited from class ru.bgcrm.dao.CommonDAO
deleteById, foundRows, getById, getGroupedIds, getGroupedIds, getIds, getIds, getPageLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, update, updateColumn, updateIds, updateIds, updateOrInsert
-
Constructor Details
-
ImportPendingDAO
-
-
Method Details
-
upsert
public void upsert(int instanceId, int ewId, int storeId, int itemId, BigDecimal quantity) throws SQLException Upserts a pending record by (ew_id, item_id). If a record already exists (any status), it is reset to pending with the new quantity.- Throws:
SQLException
-
getListForUser
Returns all pending records for the given user (via engineer warehouse userId).- Throws:
SQLException
-
getListForInstance
Returns all pending records for the given 1C instance (admin view).- Throws:
SQLException
-
apply
Applies a pending record: upserts inventory_balance.quantity and marks as applied. Uses a single INSERT...SELECT to avoid an extra round-trip.- Throws:
SQLException
-
applyAll
Applies all pending records from the given list.- Throws:
SQLException
-
reject
Rejects a pending record.- Throws:
SQLException
-