Class AdminSyncAction

java.lang.Object
org.apache.struts.action.Action
org.apache.struts.actions.BaseAction
org.apache.struts.actions.DispatchAction
org.bgerp.action.base.BaseAction
org.bgerp.plugin.inventoru.sync1c.action.AdminSyncAction

public class AdminSyncAction extends BaseAction
Admin UI for sync1c plugin. Manages 1C instances, engineer-warehouse mappings, import log.
  • Constructor Details

    • AdminSyncAction

      public AdminSyncAction()
  • Method Details

    • unspecified

      public org.apache.struts.action.ActionForward unspecified(DynActionForm form, ConnectionSet conSet) throws Exception
      Description copied from class: BaseAction
      Default action method if no parameter 'action' passed. Overwrite and implement.
      Overrides:
      unspecified in class BaseAction
      Parameters:
      form -
      conSet -
      Returns:
      the action forward
      Throws:
      Exception
    • create

      public org.apache.struts.action.ActionForward create(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • update

      public org.apache.struts.action.ActionForward update(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • delete

      public org.apache.struts.action.ActionForward delete(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • testConnection

      public org.apache.struts.action.ActionForward testConnection(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • mappingList

      public org.apache.struts.action.ActionForward mappingList(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • mappingCreate

      public org.apache.struts.action.ActionForward mappingCreate(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • mappingUpdate

      public org.apache.struts.action.ActionForward mappingUpdate(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • mappingDelete

      public org.apache.struts.action.ActionForward mappingDelete(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • importNow

      public org.apache.struts.action.ActionForward importNow(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • importFileForm

      public org.apache.struts.action.ActionForward importFileForm(DynActionForm form, ConnectionSet conSet) throws Exception
      Opens the CSV upload form. Request parameters:
      • storeId — optional, pre-selects the store when opened from a store's own page or the movement list (0 = let the admin pick from the full list).
      • userTier — optional, set when opened from the user-facing store card (as opposed to the admin store page), so the post-confirm redirect goes to the user-tier "Ожидающие поступления" page instead of the admin one (a scoped "кладовщик" user has no access to the admin sync1c section at all, only to this upload flow).
      Throws:
      Exception
    • importFilePreview

      public org.apache.struts.action.ActionForward importFilePreview(DynActionForm form, ConnectionSet conSet) throws Exception
      Parses the uploaded CSV (read-only, no DB writes) and resolves each row against existing items by ext_id, so the admin can review matches/new-item-creations before confirming.
      Throws:
      Exception
    • importFileConfirm

      public org.apache.struts.action.ActionForward importFileConfirm(DynActionForm form, ConnectionSet conSet) throws Exception
      Applies the reviewed/edited rows: resolves or creates the engineer-warehouse mapping for the picked store, upserts items, writes to import_pending — same confirm queue the store owner always used, just without requiring the mapping to pre-exist.
      Throws:
      Exception
    • importFileAdd

      public org.apache.struts.action.ActionForward importFileAdd(DynActionForm form, ConnectionSet conSet) throws Exception
      The "add" mode of a file upload: the ticked rows are received onto the store at once, on top of its balance — goods that came in, not a reconciliation. A permission of its own: unlike the replace mode it skips the confirmation queue and writes stock right away, and a set of permissions granting the confirmation of an upload did not mean to grant that. A refusal is thrown — nothing of the file may stay.
      Throws:
      Exception
    • odataForm

      public org.apache.struts.action.ActionForward odataForm(DynActionForm form, ConnectionSet conSet) throws Exception
      Opens the OData import form. Request parameter instanceId — optional, pre-selects the connector when opened from the instance list.
      Throws:
      Exception
    • odataPreview

      public org.apache.struts.action.ActionForward odataPreview(DynActionForm form, ConnectionSet conSet) throws Exception
      Fetches balances from 1C OData (read-only, no DB writes) and resolves each row against existing items by ext_id — same review step the CSV preview gives the admin.
      Throws:
      Exception
    • barcodesImportNow

      public org.apache.struts.action.ActionForward barcodesImportNow(DynActionForm form, ConnectionSet conSet) throws Exception
      Manually triggers the barcode register import for an OData connector (the poller does the same on schedule); returns the number of stored bindings.
      Throws:
      Exception
    • importPending

      public org.apache.struts.action.ActionForward importPending(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • importApply

      public org.apache.struts.action.ActionForward importApply(DynActionForm form, ConnectionSet conSet) throws Exception
      Defense-in-depth: this admin action normally implies full "instance:null" access (so getAccessRestriction() returns null/unrestricted for whoever holds it), but importApply/ importApplyAll/importReject/exportQueue* are independently grantable in action.xml sitting in the same "Ожидающие поступления"/"Очередь экспорта" submenus a scoped "кладовщик" permset would otherwise only get the importFile methods and import_pending for — a plausible permset-configuration mistake. Checked the same way UserImportPendingAction checks its own apply/reject.
      Throws:
      Exception
    • importApplyAll

      public org.apache.struts.action.ActionForward importApplyAll(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • importRejectAll

      public org.apache.struts.action.ActionForward importRejectAll(DynActionForm form, ConnectionSet conSet) throws Exception
      Rejects the same narrowing importApplyAll posts — see UserImportPendingAction.rejectAll.
      Throws:
      Exception
    • importReject

      public org.apache.struts.action.ActionForward importReject(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • importLog

      public org.apache.struts.action.ActionForward importLog(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • exportQueue

      public org.apache.struts.action.ActionForward exportQueue(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • exportLog

      public org.apache.struts.action.ActionForward exportLog(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • exportQueueRetry

      public org.apache.struts.action.ActionForward exportQueueRetry(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • exportQueueDelete

      public org.apache.struts.action.ActionForward exportQueueDelete(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • exportQueuePost

      public org.apache.struts.action.ActionForward exportQueuePost(DynActionForm form, ConnectionSet conSet) throws Exception
      Posts in ERP a write-off that 1C has already accepted, after posting it right away failed (ExportQueue.STATUS_UNPOSTED). Nothing is sent to 1C. A failure is thrown rather than returned: json() commits, and half of the movements must not survive.
      Throws:
      Exception
    • exportQueueDownload

      public org.apache.struts.action.ActionForward exportQueueDownload(DynActionForm form, ConnectionSet conSet) throws Exception
      Streams a CSV of all pending export queue entries for the instance — one row per write-off item, so the admin/warehouse keeper can enter them into 1C by hand. Writes directly to the HTTP response and returns null, same pattern as WorkAction.callboardGetTabel.
      Throws:
      Exception
    • exportQueueItems

      public org.apache.struts.action.ActionForward exportQueueItems(DynActionForm form, ConnectionSet conSet) throws Exception
      What one queue entry covers, shown right under its row: the same list the CSV carries, only readable — the nomenclature by title, the code 1C knows it by and the quantity. Without it the only way to see the contents of an entry was to download the file every time.
      Throws:
      Exception
    • exportQueueConfirm

      public org.apache.struts.action.ActionForward exportQueueConfirm(DynActionForm form, ConnectionSet conSet) throws Exception
      The write-off is in 1C — somebody put it there, or is about to — so the entry closes as if it had been sent, and the movements are written here.
      Throws:
      Exception
    • exportQueueConfirmAll

      public org.apache.struts.action.ActionForward exportQueueConfirmAll(DynActionForm form, ConnectionSet conSet) throws Exception
      Throws:
      Exception
    • exportQueueWriteoffLocal

      public org.apache.struts.action.ActionForward exportQueueWriteoffLocal(DynActionForm form, ConnectionSet conSet) throws Exception
      The write-off will never reach 1C — 1C is down for good, the exchange is off, the entry is old — so it is written off here alone and the entry says so. The same movements as a confirmation, and a different status on purpose: after this 1C still shows the goods standing on the warehouse, so the next stock import will offer to bring them back, and whoever looks has to be able to see why. Reserves stop hanging either way — that is what this is for, the reserve of a finished job cannot wait for an external system forever.
      Throws:
      Exception