Class EngineerWarehouseDAO

java.lang.Object
ru.bgcrm.dao.CommonDAO
org.bgerp.plugin.inventoru.sync1c.dao.EngineerWarehouseDAO

public class EngineerWarehouseDAO extends CommonDAO
DAO for EngineerWarehouse (inventoru_sync1c_engineer_warehouse table).
  • Constructor Details

    • EngineerWarehouseDAO

      public EngineerWarehouseDAO(Connection con)
  • Method Details

    • getListByInstance

      public List<EngineerWarehouse> getListByInstance(int instanceId) throws SQLException
      Throws:
      SQLException
    • getListByUser

      public List<EngineerWarehouse> getListByUser(int userId) throws SQLException
      Throws:
      SQLException
    • isSerialMasterStore

      public boolean isSerialMasterStore(int storeId) throws SQLException
      Whether 1C decides which serial numbers stand on this store: the store takes part in an enabled exchange whose protocol reports stock per serial (hs). The file protocol is a person carrying a CSV and OData reads a register without series, so on such stores the placement of units is kept by ERP.
      Throws:
      SQLException
    • getExportMapping

      public EngineerWarehouse getExportMapping(int storeId) throws SQLException
      The row a write-off of this store is exported through. A store may carry rows of several instances — a CSV upload leaves a manual: row behind, and the store may be connected over HS later — so the first row found is not good enough: a disabled instance never sends, and with an HS instance present 1C is the master of the stock and has to receive the write-off with its serial numbers, not a file nobody carries there.
      Returns:
      the row of an enabled instance, a push (hs) one first; null if none.
      Throws:
      SQLException
    • getByStoreId

      public EngineerWarehouse getByStoreId(int instanceId, int storeId) throws SQLException
      The row of one store in one instance. A store may be exchanged with more than one 1C base, and then asking by store alone returns whichever row came first — the wrong one half of the time.
      Throws:
      SQLException
    • updateIdentity

      public void updateIdentity(int ewId, String warehouseId, String warehouseName, String locationName) throws SQLException
      Refreshes what the row says about the 1C side of a store. The row is kept from the store's parameters, so a changed parameter has to reach it — otherwise the record drifts and the import keeps asking 1C about a warehouse under its former name.
      Throws:
      SQLException
    • get

      public EngineerWarehouse get(int id) throws SQLException
      Throws:
      SQLException
    • create

      public void create(EngineerWarehouse ew) throws SQLException
      Throws:
      SQLException
    • updateStoreId

      public void updateStoreId(int ewId, int storeId) throws SQLException
      Throws:
      SQLException
    • delete

      public void delete(int id) throws SQLException
      Throws:
      SQLException
    • fromRs

      public static EngineerWarehouse fromRs(ResultSet rs) throws SQLException
      Throws:
      SQLException