Skip to main content

Overview

The Depot API provides comprehensive endpoints for managing warehouses, inventory transactions, and stock movements in jshERP. This includes depot management, depot head (transaction headers), and depot items (transaction details).

Depot Management

Manage warehouse/depot entities including creation, updates, and configuration.

Get Depot Info

Retrieve detailed information about a specific depot by ID.
GET /depot/info?id={id}
id
Long
required
The unique identifier of the depot
code
integer
Response status code (200 for success)
data
object

List Depots

Retrieve a paginated list of depots with optional search filters.
GET /depot/list?search={search}
JSON string containing search parameters:
  • name: Depot name filter
  • type: Depot type filter
  • remark: Remark filter

Create Depot

Create a new depot/warehouse.
POST /depot/add
name
string
required
Depot name
address
string
Physical address
type
integer
Depot type
principal
Long
Principal user ID
enabled
boolean
Enable/disable depot (default: true)
remark
string
Additional remarks
curl -X POST "http://localhost:9999/jshERP-boot/depot/add" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Main Warehouse",
    "address": "123 Storage St, City",
    "type": 1,
    "enabled": true,
    "remark": "Primary storage facility"
  }'

Update Depot

Update an existing depot’s information.
PUT /depot/update
id
Long
required
Depot ID to update
name
string
Updated depot name
address
string
Updated address

Delete Depot

Delete a depot by ID.
DELETE /depot/delete?id={id}
id
Long
required
Depot ID to delete

Batch Delete Depots

Delete multiple depots at once.
DELETE /depot/deleteBatch?ids={ids}
ids
string
required
Comma-separated depot IDs (e.g., “1,2,3”)

Get All Depots

Retrieve all depots without pagination.
GET /depot/getAllList
code
integer
Response status code
data
array
Array of depot objects

Get User Depots

Retrieve depots accessible by the current user.
GET /depot/findDepotByCurrentUser
curl -X GET "http://localhost:9999/jshERP-boot/depot/findDepotByCurrentUser" \
  -H "Authorization: Bearer {token}"

Get Depots with Stock

Retrieve depots along with stock information for a specific material.
GET /depot/getAllListWithStock?mId={mId}
mId
Long
required
Material ID to get stock information for
code
integer
Response status code
data
array

Update Default Depot

Set a depot as the default depot.
POST /depot/updateIsDefault
id
Long
required
Depot ID to set as default

Batch Set Status

Enable or disable multiple depots at once.
POST /depot/batchSetStatus
status
boolean
required
true to enable, false to disable
ids
string
required
Comma-separated depot IDs

Depot Head (Transaction Headers)

Manage depot transaction headers including purchase orders, sales orders, transfers, and other inventory movements.

Get Depot Head Info

GET /depotHead/info?id={id}
id
Long
required
Depot head ID

List Depot Heads

Retrieve depot transaction headers with advanced filtering.
GET /depotHead/list?search={search}
search
string
JSON string containing search parameters:
  • type: Transaction type (入库/出库/其它)
  • subType: Sub-type (采购/销售/调拨/etc.)
  • number: Bill number
  • beginTime: Start date
  • endTime: End date
  • organId: Organization ID
  • depotId: Depot ID
  • status: Status filter

Create Depot Head and Details

Create a new depot transaction with header and line items.
POST /depotHead/addDepotHeadAndDetail
info
string
required
JSON string of depot head information
rows
string
required
JSON string of depot item rows
curl -X POST "http://localhost:9999/jshERP-boot/depotHead/addDepotHeadAndDetail" \
  -H "Content-Type: application/json" \
  -d '{
    "info": "{\"type\":\"入库\",\"subType\":\"采购\",\"organId\":1,\"operTime\":\"2024-01-15 10:00:00\"}",
    "rows": "[{\"materialId\":101,\"operNumber\":50,\"unitPrice\":25.50,\"depotId\":1}]"
  }'

Update Depot Head and Details

Update an existing depot transaction.
PUT /depotHead/updateDepotHeadAndDetail
info
string
required
JSON string of updated depot head information (must include id)
rows
string
required
JSON string of updated depot item rows

Delete Depot Head

DELETE /depotHead/delete?id={id}
id
Long
required
Depot head ID to delete

Batch Delete Depot Heads

DELETE /depotHead/deleteBatch?ids={ids}
ids
string
required
Comma-separated depot head IDs

Batch Set Status

Approve or reverse approval for depot transactions.
POST /depotHead/batchSetStatus
status
string
required
Status value (“0” for pending, “1” for approved)
ids
string
required
Comma-separated depot head IDs

Force Close Batch

Force close depot transactions.
POST /depotHead/forceCloseBatch
ids
string
required
Comma-separated depot head IDs to force close

In/Out Detail Report

Get detailed inventory in/out transactions report.
GET /depotHead/findInOutDetail
currentPage
integer
required
Current page number
pageSize
integer
required
Number of records per page
type
string
required
Transaction type (“入库” or “出库”)
beginTime
string
required
Start date (YYYY-MM-DD)
endTime
string
required
End date (YYYY-MM-DD)
depotId
Long
Filter by depot ID
materialParam
string
Material search parameter
code
integer
Response status code
data
object

In/Out Material Count

Get aggregated material in/out statistics.
GET /depotHead/findInOutMaterialCount
currentPage
integer
required
Current page number
pageSize
integer
required
Number of records per page
type
string
required
Transaction type
beginTime
string
required
Start date
endTime
string
required
End date

Get Statement Account

Retrieve account statements for suppliers or customers.
GET /depotHead/getStatementAccount
currentPage
integer
required
Current page number
pageSize
integer
required
Records per page
beginTime
string
required
Start date
endTime
string
required
End date
supplierType
string
required
“供应商” for vendor or “客户” for customer
organId
integer
Organization ID filter
hasDebt
integer
Filter by debt status (1 for has debt, 0 for no debt)

Get Detail by Number

Retrieve depot transaction details by bill number.
GET /depotHead/getDetailByNumber?number={number}
number
string
required
Bill number

Get Buy and Sale Statistics

Get purchase and sales statistics for dashboard.
GET /depotHead/getBuyAndSaleStatistics
code
integer
Response status code
data
object
Contains today’s, yesterday’s, monthly, and yearly purchase/sale statistics

Depot Item (Transaction Details)

Manage individual line items within depot transactions.

Get Detail List

Retrieve line items for a specific depot transaction.
GET /depotItem/getDetailList?headerId={headerId}
headerId
Long
required
Depot head ID
mpList
string
Material property list
Link type (e.g., “basic”)
isReadOnly
string
“1” for read-only mode

Find Stock by Depot and BarCode

Get current stock level for a material in a depot.
GET /depotItem/findStockByDepotAndBarCode
depotId
Long
Depot ID (optional)
barCode
string
required
Material barcode
curl -X GET "http://localhost:9999/jshERP-boot/depotItem/findStockByDepotAndBarCode?depotId=1&barCode=ABC123"

Get In/Out Stock Report

Comprehensive inventory movement report.
GET /depotItem/getInOutStock
currentPage
integer
required
Page number
pageSize
integer
required
Records per page
beginTime
string
required
Start date (YYYY-MM-DD)
endTime
string
required
End date (YYYY-MM-DD)
depotIds
string
Comma-separated depot IDs
materialParam
string
required
Material search parameter
categoryId
Long
Material category filter

Purchase Statistics

Get purchase statistics by material.
GET /depotItem/buyIn
currentPage
integer
required
Page number
pageSize
integer
required
Records per page
beginTime
string
required
Start date
endTime
string
required
End date
materialParam
string
required
Material search parameter

Sales Statistics

Get sales statistics by material.
GET /depotItem/saleOut
currentPage
integer
required
Page number
pageSize
integer
required
Records per page
beginTime
string
required
Start date
endTime
string
required
End date
materialParam
string
required
Material search parameter

Retail Statistics

Get retail sales statistics.
GET /depotItem/retailOut
currentPage
integer
required
Page number
pageSize
integer
required
Records per page
beginTime
string
required
Start date
endTime
string
required
End date
materialParam
string
required
Material search parameter

Stock Warning Report

Get materials with stock levels outside safe thresholds.
GET /depotItem/findStockWarningCount
currentPage
integer
required
Page number
pageSize
integer
required
Records per page
materialParam
string
required
Material search parameter
depotId
Long
Depot ID filter
categoryId
Long
Category ID filter
code
integer
Response status code
data
object

Build docs developers (and LLMs) love