Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mini-wms
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
周海峰
mini-wms
Commits
835ab1b5
Commit
835ab1b5
authored
Dec 11, 2025
by
wangchunyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计相关功能
parent
bdfed8f5
全部展开
显示空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
811 行增加
和
404 行删除
+811
-404
ruoyi-admin-vue/src/api/inventory/inventory.js
+9
-0
ruoyi-admin-vue/src/views/inventory/report_view/inbound_outbound_statistics.vue
+0
-1
ruoyi-admin-vue/src/views/inventory/report_view/inventory_detail.vue
+0
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/InventoryController.java
+177
-25
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/InventoryStatisticsController.java
+54
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/Inventory.java
+44
-223
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/vo/InboundOutboundStatisticsVO.java
+77
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/vo/InventorySummaryVO.java
+48
-151
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/vo/InventoryVo.java
+167
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InventoryMapper.java
+12
-4
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InventoryStatisticsMapper.java
+22
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/StorageLocationsMapper.java
+9
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/WarehousesMapper.java
+7
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryService.java
+2
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryStatisticsService.java
+20
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
+7
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryStatisticsServiceImpl.java
+25
-0
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
+0
-0
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryStatisticsMapper.xml
+112
-0
ruoyi-inventory/src/main/resources/mapper/inventory/StorageLocationsMapper.xml
+13
-0
ruoyi-inventory/src/main/resources/mapper/inventory/WarehousesMapper.xml
+6
-0
没有找到文件。
ruoyi-admin-vue/src/api/inventory/inventory.js
View file @
835ab1b5
import
request
from
'@/utils/request'
// 查询库存列表
export
function
listInventoryCount
(
query
)
{
return
request
({
url
:
'/inventory/inventory/listCount'
,
method
:
'get'
,
params
:
query
})
}
// 查询库存列表
export
function
listInventory
(
query
)
{
return
request
({
url
:
'/inventory/inventory/list'
,
...
...
ruoyi-admin-vue/src/views/inventory/report_view/inbound_outbound_statistics.vue
View file @
835ab1b5
...
...
@@ -83,7 +83,6 @@
<div
class=
"table-container"
>
<el-table
v-loading=
"loading"
:data=
"statisticsList"
border
height=
"100%"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"60"
align=
"center"
/>
<el-table-column
label=
"物料ID"
align=
"center"
prop=
"materialId"
width=
"150"
/>
<el-table-column
label=
"物料名称"
align=
"center"
prop=
"materialName"
min-width=
"150"
show-overflow-tooltip
/>
<el-table-column
label=
"入库次数"
align=
"center"
prop=
"inboundCount"
width=
"100"
/>
<el-table-column
label=
"出库次数"
align=
"center"
prop=
"outboundCount"
width=
"100"
/>
...
...
ruoyi-admin-vue/src/views/inventory/report_view/inventory_detail.vue
View file @
835ab1b5
差异被折叠。
点击展开。
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/InventoryController.java
View file @
835ab1b5
差异被折叠。
点击展开。
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/InventoryStatisticsController.java
0 → 100644
View file @
835ab1b5
package
com
.
ruoyi
.
inventory
.
controller
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.common.enums.BusinessType
;
import
com.ruoyi.common.utils.poi.ExcelUtil
;
import
com.ruoyi.inventory.domain.vo.InboundOutboundStatisticsVO
;
import
com.ruoyi.inventory.service.IInventoryStatisticsService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
* 出入库统计
*/
@RestController
@RequestMapping
(
"/inventory/statistics"
)
public
class
InventoryStatisticsController
extends
BaseController
{
@Autowired
private
IInventoryStatisticsService
inventoryStatisticsService
;
/**
* 出入库统计列表
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:statistics:list')"
)
@GetMapping
(
"/inboundOutbound"
)
public
TableDataInfo
list
(
InboundOutboundStatisticsVO
query
)
{
startPage
();
List
<
InboundOutboundStatisticsVO
>
list
=
inventoryStatisticsService
.
selectInboundOutboundStatistics
(
query
);
return
getDataTable
(
list
);
}
/**
* 导出出入库统计
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:statistics:export')"
)
@Log
(
title
=
"出入库统计"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/inboundOutbound/export"
)
public
void
export
(
HttpServletResponse
response
,
InboundOutboundStatisticsVO
query
)
{
List
<
InboundOutboundStatisticsVO
>
list
=
inventoryStatisticsService
.
selectInboundOutboundStatistics
(
query
);
ExcelUtil
<
InboundOutboundStatisticsVO
>
util
=
new
ExcelUtil
<>(
InboundOutboundStatisticsVO
.
class
);
util
.
exportExcel
(
response
,
list
,
"出入库统计数据"
);
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/Inventory.java
View file @
835ab1b5
package
com
.
ruoyi
.
inventory
.
domain
;
import
java.util.Date
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.ruoyi.common.annotation.Excel
;
...
...
@@ -13,6 +16,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi
* @date 2025-12-03
*/
@Data
public
class
Inventory
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -112,243 +116,60 @@ public class Inventory extends BaseEntity
/** 预警类型 */
private
String
alertType
;
public
String
getWarehousesId
()
{
return
warehousesId
;
}
public
void
setWarehousesId
(
String
warehousesId
)
{
this
.
warehousesId
=
warehousesId
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getId
()
{
return
id
;
}
public
void
setInventoryType
(
Long
inventoryType
)
{
this
.
inventoryType
=
inventoryType
;
}
public
Long
getInventoryType
()
{
return
inventoryType
;
}
public
void
setOrderId
(
String
orderId
)
{
this
.
orderId
=
orderId
;
}
public
String
getOrderId
()
{
return
orderId
;
}
public
void
setMaterialId
(
String
materialId
)
{
this
.
materialId
=
materialId
;
}
public
String
getMaterialId
()
{
return
materialId
;
}
public
void
setBatchId
(
String
batchId
)
{
this
.
batchId
=
batchId
;
}
public
String
getBatchId
()
{
return
batchId
;
}
public
void
setLocationId
(
String
locationId
)
{
this
.
locationId
=
locationId
;
}
public
String
getLocationId
()
{
return
locationId
;
}
public
void
setOwnerId
(
String
ownerId
)
{
this
.
ownerId
=
ownerId
;
}
public
String
getOwnerId
()
{
return
ownerId
;
}
public
void
setQuantity
(
Long
quantity
)
{
this
.
quantity
=
quantity
;
}
public
Long
getQuantity
()
{
return
quantity
;
}
public
void
setLockedQuantity
(
Long
lockedQuantity
)
{
this
.
lockedQuantity
=
lockedQuantity
;
}
public
Long
getLockedQuantity
()
{
return
lockedQuantity
;
}
public
void
setUnitWeight
(
Long
unitWeight
)
{
this
.
unitWeight
=
unitWeight
;
}
/** 物料名称 */
@ExcelProperty
(
value
=
"物料名称"
,
index
=
1
)
private
String
materialName
;
public
Long
getUnitWeight
()
{
return
unitWeight
;
}
/** 最低库存 */
private
Long
minStockLevel
;
/** 最高库存 */
private
Long
maxStockLevel
;
public
void
setTotalWeight
(
Long
totalWeight
)
{
this
.
totalWeight
=
totalWeight
;
}
/** SAP物料号 */
@Excel
(
name
=
"SAP物料号"
)
private
String
sapNo
;
public
Long
getTotalWeight
()
{
return
totalWeight
;
}
/** TS Code */
@Excel
(
name
=
"TS Code"
)
private
String
tsCode
;
public
void
setTotalVolume
(
Long
totalVolume
)
{
this
.
totalVolume
=
totalVolume
;
}
/** 危险类别 */
private
String
hazardId
;
public
Long
getTotalVolume
()
{
return
totalVolume
;
}
/** 危险类别 */
@Excel
(
name
=
"危险类别"
)
private
String
hazard
;
public
void
setProductionDate
(
Date
productionDate
)
{
this
.
productionDate
=
productionDate
;
}
/** 规格型号 */
@Excel
(
name
=
"规格型号"
)
private
String
specification
;
public
Date
getProductionDate
()
{
return
productionDate
;
}
/** 计量单位 */
@Excel
(
name
=
"计量单位"
)
private
String
materialUnit
;
public
void
setExpirationDate
(
Date
expirationDate
)
{
this
.
expirationDate
=
expirationDate
;
}
/** 包装重量 */
// @Excel(name = "包装重量")
private
Double
packageWeight
;
public
Date
getExpirationDate
()
{
return
expirationDate
;
}
/** 体积 */
private
Double
volume
;
public
void
setInventoryStatus
(
Long
inventoryStatus
)
{
this
.
inventoryStatus
=
inventoryStatus
;
}
/** 保质期天数 */
private
Integer
shelfLifeDays
;
public
Long
getInventoryStatus
()
{
return
inventoryStatus
;
}
public
void
setLastInboundTime
(
Date
lastInboundTime
)
{
this
.
lastInboundTime
=
lastInboundTime
;
}
public
Date
getLastInboundTime
()
{
return
lastInboundTime
;
}
/** 存储温度要求 */
// @Excel(name = "存储温度要求")
private
String
storageTemperature
;
public
void
setLastOutboundTime
(
Date
lastOutboundTime
)
{
this
.
lastOutboundTime
=
lastOutboundTime
;
}
/** 特殊存储要求 */
// @Excel(name = "特殊存储要求")
private
String
specialRequirements
;
public
Date
getLastOutboundTime
()
{
return
lastOutboundTime
;
}
private
String
warehousesName
;
private
String
locationName
;
private
String
ownerName
;
public
void
setIsUsed
(
Long
isUsed
)
{
this
.
isUsed
=
isUsed
;
}
public
Long
getIsUsed
()
{
return
isUsed
;
}
public
void
setSortNo
(
Long
sortNo
)
{
this
.
sortNo
=
sortNo
;
}
public
Long
getSortNo
()
{
return
sortNo
;
}
public
void
setCreateUserCode
(
String
createUserCode
)
{
this
.
createUserCode
=
createUserCode
;
}
public
String
getCreateUserCode
()
{
return
createUserCode
;
}
public
void
setUpdateUserCode
(
String
updateUserCode
)
{
this
.
updateUserCode
=
updateUserCode
;
}
public
String
getUpdateUserCode
()
{
return
updateUserCode
;
}
public
void
setWarehousesCode
(
String
warehousesCode
)
{
this
.
warehousesCode
=
warehousesCode
;
}
public
String
getWarehousesCode
()
{
return
warehousesCode
;
}
public
void
setAlertType
(
String
alertType
)
{
this
.
alertType
=
alertType
;
}
public
String
getAlertType
()
{
return
alertType
;
}
@Override
public
String
toString
()
{
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/vo/InboundOutboundStatisticsVO.java
0 → 100644
View file @
835ab1b5
package
com
.
ruoyi
.
inventory
.
domain
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ruoyi.common.annotation.Excel
;
import
com.ruoyi.common.core.domain.BaseEntity
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 出入库统计视图对象
* 按物料汇总入库/出库次数、数量及金额
*/
@Data
public
class
InboundOutboundStatisticsVO
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 物料ID */
// @Excel(name = "物料ID")
private
String
materialId
;
/** 物料名称 */
@Excel
(
name
=
"物料名称"
)
private
String
materialName
;
/** 入库次数 */
@Excel
(
name
=
"入库次数"
)
private
Integer
inboundCount
;
/** 出库次数 */
@Excel
(
name
=
"出库次数"
)
private
Integer
outboundCount
;
/** 入库数量 */
@Excel
(
name
=
"入库数量"
)
private
BigDecimal
inboundQuantity
;
/** 出库数量 */
@Excel
(
name
=
"出库数量"
)
private
BigDecimal
outboundQuantity
;
/** 入库总额 */
@Excel
(
name
=
"入库总额"
)
private
BigDecimal
inboundAmount
;
/** 出库总额 */
@Excel
(
name
=
"出库总额"
)
private
BigDecimal
outboundAmount
;
/** 金额差(入库-出库) */
@Excel
(
name
=
"总额差"
)
private
BigDecimal
amountDiff
;
/** 开始日期(主表日期过滤) */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
startDate
;
/** 结束日期(主表日期过滤) */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
endDate
;
/** 仓库ID */
private
String
warehouseId
;
/** 仓库编码(支持模糊) */
private
String
warehousesCode
;
/** 库位ID */
private
String
locationId
;
/** 物料编码/ID查询 */
private
String
materialCode
;
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/vo/InventorySummaryVO.java
View file @
835ab1b5
...
...
@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth;
import
com.alibaba.excel.annotation.write.style.HeadFontStyle
;
import
com.alibaba.excel.annotation.write.style.HeadStyle
;
import
com.alibaba.excel.enums.poi.FillPatternTypeEnum
;
import
com.ruoyi.common.annotation.Excel
;
import
lombok.Data
;
//import org.apache.poi.ss.usermodel.FillPatternType;
...
...
@@ -32,176 +33,72 @@ public class InventorySummaryVO implements Serializable
@ExcelProperty
(
value
=
"物料名称"
,
index
=
1
)
private
String
materialName
;
/** 库存类别 */
@ExcelProperty
(
value
=
"库存类别"
,
index
=
2
)
private
String
inventoryTypeName
;
/** 最低库存 */
private
Long
minStockLevel
;
/** 最高库存 */
private
Long
maxStockLevel
;
/**
仓库编码
*/
@Excel
Property
(
value
=
"仓库编码"
,
index
=
3
)
private
String
warehousesCode
;
/**
SAP物料号
*/
@Excel
(
name
=
"SAP物料号"
)
private
String
sapNo
;
/**
仓库名称
*/
@Excel
Property
(
value
=
"仓库名称"
,
index
=
4
)
private
String
warehouseNam
e
;
/**
TS Code
*/
@Excel
(
name
=
"TS Code"
)
private
String
tsCod
e
;
/** 库位ID */
@ExcelProperty
(
value
=
"库位ID"
,
index
=
5
)
private
String
locationId
;
/** 危险类别 */
private
String
hazardId
;
/**
库位名称
*/
@Excel
Property
(
value
=
"库位名称"
,
index
=
6
)
private
String
locationName
;
/**
危险类别
*/
@Excel
(
name
=
"危险类别"
)
private
String
hazard
;
/**
货主ID
*/
@Excel
Property
(
value
=
"货主ID"
,
index
=
7
)
private
String
ownerId
;
/**
规格型号
*/
@Excel
(
name
=
"规格型号"
)
private
String
specification
;
/**
货主名称
*/
@Excel
Property
(
value
=
"货主名称"
,
index
=
8
)
private
String
ownerName
;
/**
计量单位
*/
@Excel
(
name
=
"计量单位"
)
private
String
materialUnit
;
/**
总库存数
量 */
@Excel
Property
(
value
=
"总库存数量"
,
index
=
9
)
private
Long
totalQuantity
;
/**
单位重
量 */
@Excel
(
name
=
"单位重量"
)
private
Double
unitWeight
;
/** 总锁定数量 */
@ExcelProperty
(
value
=
"总锁定数量"
,
index
=
10
)
private
Long
totalLockedQuantity
;
/** 总可用数量 */
@ExcelProperty
(
value
=
"总可用数量"
,
index
=
11
)
private
Long
totalAvailableQuantity
;
/** 包装重量 */
// @Excel(name = "包装重量")
private
Double
packageWeight
;
/** 总重量 */
@ExcelProperty
(
value
=
"总重量"
,
index
=
12
)
private
Double
totalWeight
;
/** 总体积 */
@ExcelProperty
(
value
=
"总体积"
,
index
=
13
)
private
Double
totalVolume
;
/** 库存状态 */
@ExcelProperty
(
value
=
"库存状态"
,
index
=
14
)
private
String
inventoryStatusName
;
public
String
getMaterialId
()
{
return
materialId
;
}
public
void
setMaterialId
(
String
materialId
)
{
this
.
materialId
=
materialId
;
}
public
String
getMaterialName
()
{
return
materialName
;
}
public
void
setMaterialName
(
String
materialName
)
{
this
.
materialName
=
materialName
;
}
public
String
getInventoryTypeName
()
{
return
inventoryTypeName
;
}
public
void
setInventoryTypeName
(
String
inventoryTypeName
)
{
this
.
inventoryTypeName
=
inventoryTypeName
;
}
public
String
getWarehousesCode
()
{
return
warehousesCode
;
}
public
void
setWarehousesCode
(
String
warehousesCode
)
{
this
.
warehousesCode
=
warehousesCode
;
}
public
String
getWarehouseName
()
{
return
warehouseName
;
}
public
void
setWarehouseName
(
String
warehouseName
)
{
this
.
warehouseName
=
warehouseName
;
}
/** 体积 */
private
Double
volume
;
public
String
getLocationId
()
{
return
locationId
;
}
/** 保质期天数 */
private
Integer
shelfLifeDays
;
public
void
setLocationId
(
String
locationId
)
{
this
.
locationId
=
locationId
;
}
/** 存储温度要求 */
// @Excel(name = "存储温度要求")
private
String
storageTemperature
;
public
String
getLocationName
()
{
return
locationName
;
}
/** 特殊存储要求 */
// @Excel(name = "特殊存储要求")
private
String
specialRequirements
;
public
void
setLocationName
(
String
locationName
)
{
this
.
locationName
=
locationName
;
}
public
String
getOwnerId
()
{
return
ownerId
;
}
public
void
setOwnerId
(
String
ownerId
)
{
this
.
ownerId
=
ownerId
;
}
public
String
getOwnerName
()
{
return
ownerName
;
}
public
void
setOwnerName
(
String
ownerName
)
{
this
.
ownerName
=
ownerName
;
}
public
Long
getTotalQuantity
()
{
return
totalQuantity
;
}
public
void
setTotalQuantity
(
Long
totalQuantity
)
{
this
.
totalQuantity
=
totalQuantity
;
}
public
Long
getTotalLockedQuantity
()
{
return
totalLockedQuantity
;
}
public
void
setTotalLockedQuantity
(
Long
totalLockedQuantity
)
{
this
.
totalLockedQuantity
=
totalLockedQuantity
;
}
public
Long
getTotalAvailableQuantity
()
{
return
totalAvailableQuantity
;
}
public
void
setTotalAvailableQuantity
(
Long
totalAvailableQuantity
)
{
this
.
totalAvailableQuantity
=
totalAvailableQuantity
;
}
public
Double
getTotalWeight
()
{
return
totalWeight
;
}
public
void
setTotalWeight
(
Double
totalWeight
)
{
this
.
totalWeight
=
totalWeight
;
}
/** 总库存数量 */
@ExcelProperty
(
value
=
"总库存数量"
,
index
=
9
)
private
Long
totalQuantity
;
public
Double
getTotalVolume
()
{
return
totalVolume
;
}
/** 总锁定数量 */
@ExcelProperty
(
value
=
"总锁定数量"
,
index
=
10
)
private
Long
totalLockedQuantity
;
public
void
setTotalVolume
(
Double
totalVolume
)
{
this
.
totalVolume
=
totalVolume
;
}
/** 总可用数量 */
@ExcelProperty
(
value
=
"总可用数量"
,
index
=
11
)
private
Long
totalAvailableQuantity
;
public
String
getInventoryStatusName
()
{
return
inventoryStatusName
;
}
private
String
alterType
;
public
void
setInventoryStatusName
(
String
inventoryStatusName
)
{
this
.
inventoryStatusName
=
inventoryStatusName
;
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/vo/InventoryVo.java
0 → 100644
View file @
835ab1b5
package
com
.
ruoyi
.
inventory
.
domain
.
vo
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ruoyi.common.annotation.Excel
;
import
com.ruoyi.common.core.domain.BaseEntity
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
java.util.Date
;
/**
* 库存对象 inventory
*
* @author cy
* @date 2025-12-03
*/
@Data
public
class
InventoryVo
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 编号 */
private
String
id
;
/** 库存类别1普通2退库 */
// @Excel(name = "库存类别")
private
Long
inventoryType
;
/** 入库单号 */
// @Excel(name = "入库单号")
private
String
orderId
;
/** 物料ID 检索条件 */
// @Excel(name = "物料ID 检索条件")
private
String
materialId
;
/** SAP物料号 */
@Excel
(
name
=
"SAP物料号"
)
private
String
sapNo
;
/** TS Code */
@Excel
(
name
=
"TS Code"
)
private
String
tsCode
;
/** 物料名称 */
@Excel
(
name
=
"物料名称"
)
private
String
materialName
;
/** 批次ID 检索条件 */
@Excel
(
name
=
"批次"
)
private
String
batchId
;
/** 批次ID 检索条件 */
// @Excel(name = "仓库ID ")
private
String
warehousesId
;
/** 仓库编码 检索条件 */
private
String
warehousesCode
;
@Excel
(
name
=
"仓库 "
)
private
String
warehousesName
;
/** 库位ID 检索条件 */
private
String
locationId
;
@Excel
(
name
=
"库位"
)
private
String
locationName
;
@Excel
(
name
=
"货主"
)
private
String
ownerName
;
/** 货主ID 检索条件 */
private
String
ownerId
;
/** 库存数量 */
@Excel
(
name
=
"库存数量"
)
private
Long
quantity
;
/** 锁定数量 */
@Excel
(
name
=
"锁定数量"
)
private
Long
lockedQuantity
;
/** 单位重量 */
// @Excel(name = "单位重量")
private
Long
unitWeight
;
/** 总重量 暂无用 */
// @Excel(name = "总重量")
private
Long
totalWeight
;
/** 总体积 暂无用 */
// @Excel(name = "总体积")
private
Long
totalVolume
;
/** 生产日期 暂无用 */
// @JsonFormat(pattern = "yyyy-MM-dd")
@Excel
(
name
=
"生产日期"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
productionDate
;
/** 失效日期 */
// @JsonFormat(pattern = "yyyy-MM-dd")
@Excel
(
name
=
"失效日期"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
expirationDate
;
/** 库存状态 0-已出库 1-正常 字典,检索条件 */
// @Excel(name = "库存状态 0-已出库 1-正常 字典,检索条件")
private
Long
inventoryStatus
;
/** 最后入库时间 */
// @JsonFormat(pattern = "yyyy-MM-dd")
// @Excel(name = "最后入库时间", width = 30, dateFormat = "yyyy-MM-dd")
private
Date
lastInboundTime
;
/** 最后出库时间 */
// @JsonFormat(pattern = "yyyy-MM-dd")
// @Excel(name = "最后出库时间", width = 30, dateFormat = "yyyy-MM-dd")
private
Date
lastOutboundTime
;
/** 应用数据1使用0删除 删除用 */
private
Long
isUsed
;
/** 排序 */
private
Long
sortNo
;
/** 创建日期 */
private
String
createUserCode
;
/** 排序号 */
private
String
updateUserCode
;
/** 预警类型 */
private
String
alertType
;
/** 最低库存 */
private
Long
minStockLevel
;
/** 最高库存 */
private
Long
maxStockLevel
;
/** 危险类别 */
private
String
hazardId
;
/** 危险类别 */
// @Excel(name = "危险类别")
private
String
hazard
;
/** 规格型号 */
// @Excel(name = "规格型号")
private
String
specification
;
/** 计量单位 */
// @Excel(name = "计量单位")
private
String
materialUnit
;
/** 包装重量 */
// @Excel(name = "包装重量")
private
Double
packageWeight
;
/** 体积 */
private
Double
volume
;
/** 保质期天数 */
private
Integer
shelfLifeDays
;
/** 存储温度要求 */
// @Excel(name = "存储温度要求")
private
String
storageTemperature
;
/** 特殊存储要求 */
// @Excel(name = "特殊存储要求")
private
String
specialRequirements
;
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InventoryMapper.java
View file @
835ab1b5
package
com
.
ruoyi
.
inventory
.
mapper
;
import
java.util.List
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.inventory.domain.Inventory
;
import
com.ruoyi.inventory.domain.StocktakeItems
;
import
com.ruoyi.inventory.domain.TO.StocktakeItemsTo
;
import
com.ruoyi.inventory.domain.vo.InventoryExceedWarnVO
;
import
com.ruoyi.inventory.domain.vo.InventoryVo
;
import
java.util.List
;
/**
* 库存Mapper接口
...
...
@@ -100,6 +100,14 @@ public interface InventoryMapper
public
List
<
Inventory
>
selectInventoryDetailList
(
Inventory
inventory
);
/**
* 查询库存明细列表(根据物料标识及检索条件)
*
* @param inventory 库存查询条件
* @return 库存明细集合
*/
public
List
<
InventoryVo
>
selectInventoryVoList
(
Inventory
inventory
);
/**
* 统计物料库存超出预警库存数量
*
* @return 超出预警值物料信息集合
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InventoryStatisticsMapper.java
0 → 100644
View file @
835ab1b5
package
com
.
ruoyi
.
inventory
.
mapper
;
import
com.ruoyi.inventory.domain.vo.InboundOutboundStatisticsVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* 出入库统计Mapper
*/
@Mapper
public
interface
InventoryStatisticsMapper
{
/**
* 按物料汇总出入库统计
*
* @param query 查询条件
* @return 汇总结果
*/
List
<
InboundOutboundStatisticsVO
>
selectInboundOutboundStatistics
(
InboundOutboundStatisticsVO
query
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/StorageLocationsMapper.java
View file @
835ab1b5
...
...
@@ -97,4 +97,13 @@ public interface StorageLocationsMapper
* @return 库位集合
*/
List
<
StorageLocations
>
getStorageLocationsList
(
StorageLocations
storageLocations
);
/**
* 根据库位名称和仓库ID精确查询(is_used=1)
* @param locationName 库位名
* @param warehouseId 仓库ID
* @return 库位
*/
StorageLocations
selectStorageLocationsByNameAndWarehouse
(
@Param
(
"locationName"
)
String
locationName
,
@Param
(
"warehouseId"
)
String
warehouseId
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/WarehousesMapper.java
View file @
835ab1b5
...
...
@@ -79,4 +79,11 @@ public interface WarehousesMapper
*/
public
List
<
Map
<
String
,
Object
>>
getMapList
();
/**
* 根据仓库名称精确查询(仅is_used=1)
* @param name 仓库名称
* @return 仓库
*/
Warehouses
selectWarehousesByName
(
String
name
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryService.java
View file @
835ab1b5
...
...
@@ -10,6 +10,7 @@ import com.ruoyi.inventory.domain.OutboundOrderItems;
import
com.ruoyi.inventory.domain.StocktakeItems
;
import
com.ruoyi.inventory.domain.TO.StocktakeItemsTo
;
import
com.ruoyi.inventory.domain.vo.InventoryExceedWarnVO
;
import
com.ruoyi.inventory.domain.vo.InventoryVo
;
/**
* 库存Service接口
...
...
@@ -109,6 +110,7 @@ public interface IInventoryService
*/
public
List
<
Inventory
>
selectInventoryDetailList
(
Inventory
inventory
);
public
List
<
InventoryVo
>
selectInventoryVoList
(
Inventory
inventory
);
/**
* 统计库存物料超出预警值
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryStatisticsService.java
0 → 100644
View file @
835ab1b5
package
com
.
ruoyi
.
inventory
.
service
;
import
com.ruoyi.inventory.domain.vo.InboundOutboundStatisticsVO
;
import
java.util.List
;
/**
* 出入库统计 Service
*/
public
interface
IInventoryStatisticsService
{
/**
* 按物料汇总出入库统计
*
* @param query 查询条件
* @return 统计列表
*/
List
<
InboundOutboundStatisticsVO
>
selectInboundOutboundStatistics
(
InboundOutboundStatisticsVO
query
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
View file @
835ab1b5
...
...
@@ -11,6 +11,7 @@ import com.ruoyi.inventory.domain.OutboundOrderLog;
import
com.ruoyi.inventory.domain.TO.StocktakeItemsTo
;
import
com.ruoyi.inventory.domain.vo.InventoryExceedWarnVO
;
import
com.ruoyi.inventory.domain.vo.InventorySummaryVO
;
import
com.ruoyi.inventory.domain.vo.InventoryVo
;
import
com.ruoyi.inventory.mapper.OutboundOrderItemsMapper
;
import
com.ruoyi.inventory.mapper.OutboundOrderLogMapper
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -268,6 +269,12 @@ public class InventoryServiceImpl implements IInventoryService
}
@Override
public
List
<
InventoryVo
>
selectInventoryVoList
(
Inventory
inventory
)
{
return
inventoryMapper
.
selectInventoryVoList
(
inventory
);
}
@Override
public
List
<
InventoryExceedWarnVO
>
selectInventoryExceedWarnList
()
{
return
inventoryMapper
.
selectInventoryExceedWarnList
();
}
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryStatisticsServiceImpl.java
0 → 100644
View file @
835ab1b5
package
com
.
ruoyi
.
inventory
.
service
.
impl
;
import
com.ruoyi.inventory.domain.vo.InboundOutboundStatisticsVO
;
import
com.ruoyi.inventory.mapper.InventoryStatisticsMapper
;
import
com.ruoyi.inventory.service.IInventoryStatisticsService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 出入库统计 Service实现
*/
@Service
public
class
InventoryStatisticsServiceImpl
implements
IInventoryStatisticsService
{
@Autowired
private
InventoryStatisticsMapper
inventoryStatisticsMapper
;
@Override
public
List
<
InboundOutboundStatisticsVO
>
selectInboundOutboundStatistics
(
InboundOutboundStatisticsVO
query
)
{
return
inventoryStatisticsMapper
.
selectInboundOutboundStatistics
(
query
);
}
}
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
View file @
835ab1b5
差异被折叠。
点击展开。
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryStatisticsMapper.xml
0 → 100644
View file @
835ab1b5
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.ruoyi.inventory.mapper.InventoryStatisticsMapper"
>
<resultMap
id=
"InboundOutboundStatisticsResult"
type=
"com.ruoyi.inventory.domain.vo.InboundOutboundStatisticsVO"
>
<result
column=
"material_id"
property=
"materialId"
/>
<result
column=
"material_name"
property=
"materialName"
/>
<result
column=
"inbound_count"
property=
"inboundCount"
/>
<result
column=
"outbound_count"
property=
"outboundCount"
/>
<result
column=
"inbound_quantity"
property=
"inboundQuantity"
/>
<result
column=
"outbound_quantity"
property=
"outboundQuantity"
/>
<result
column=
"inbound_amount"
property=
"inboundAmount"
/>
<result
column=
"outbound_amount"
property=
"outboundAmount"
/>
<result
column=
"amount_diff"
property=
"amountDiff"
/>
</resultMap>
<select
id=
"selectInboundOutboundStatistics"
parameterType=
"com.ruoyi.inventory.domain.vo.InboundOutboundStatisticsVO"
resultMap=
"InboundOutboundStatisticsResult"
>
SELECT
t.material_id,
IFNULL(m.material_name, t.material_id) AS material_name,
SUM(t.inbound_count) AS inbound_count,
SUM(t.outbound_count) AS outbound_count,
SUM(t.inbound_quantity) AS inbound_quantity,
SUM(t.outbound_quantity) AS outbound_quantity,
SUM(t.inbound_amount) AS inbound_amount,
SUM(t.outbound_amount) AS outbound_amount,
SUM(t.inbound_amount) - SUM(t.outbound_amount) AS amount_diff
FROM (
SELECT
i.material_id,
COUNT(DISTINCT o.id) AS inbound_count,
0 AS outbound_count,
IFNULL(SUM(IFNULL(i.actual_quantity, 0)),0) AS inbound_quantity,
0 AS outbound_quantity,
IFNULL(SUM(IFNULL(i.unit_price, 0) * IFNULL(i.actual_quantity, 0)),0) AS inbound_amount,
0 AS outbound_amount
FROM inbound_order_items i
LEFT JOIN inbound_orders o ON i.inbound_order_id = o.id
LEFT JOIN warehouses w ON w.id = i.warehouse_id
LEFT JOIN materials m1 ON m1.id = i.material_id
<where>
i.is_used = 1
<if
test=
"warehouseId != null and warehouseId != ''"
>
AND i.warehouse_id = #{warehouseId}
</if>
<if
test=
"locationId != null and locationId != ''"
>
AND i.location_id = #{locationId}
</if>
<if
test=
"materialId != null and materialId != ''"
>
AND (i.material_id = #{materialId}
OR m1.material_code LIKE CONCAT('%', #{materialId}, '%')
OR m1.material_name LIKE CONCAT('%', #{materialId}, '%'))
</if>
<if
test=
"warehousesCode != null and warehousesCode != ''"
>
AND w.warehouses_code LIKE CONCAT('%', #{warehousesCode}, '%')
</if>
<if
test=
"startDate != null"
>
AND o.inbound_date
>
= #{startDate}
</if>
<if
test=
"endDate != null"
>
AND o.inbound_date
<
DATE_ADD(#{endDate}, INTERVAL 1 DAY)
</if>
</where>
GROUP BY i.material_id
UNION ALL
SELECT
oi.material_id,
0 AS inbound_count,
COUNT(DISTINCT oo.id) AS outbound_count,
0 AS inbound_quantity,
IFNULL(SUM(IFNULL(oi.actual_quantity, 0)),0) AS outbound_quantity,
0 AS inbound_amount,
IFNULL(SUM(IFNULL(oi.unit_price, 0) * IFNULL(oi.actual_quantity, 0)),0) AS outbound_amount
FROM outbound_order_items oi
LEFT JOIN outbound_orders oo ON oi.outbound_order_id = oo.id
LEFT JOIN warehouses w2 ON w2.id = oi.warehouse_id
LEFT JOIN materials m2 ON m2.id = oi.material_id
<where>
oi.is_used = 1
<if
test=
"warehouseId != null and warehouseId != ''"
>
AND oi.warehouse_id = #{warehouseId}
</if>
<if
test=
"locationId != null and locationId != ''"
>
AND oi.location_id = #{locationId}
</if>
<if
test=
"materialId != null and materialId != ''"
>
AND (oi.material_id = #{materialId}
OR m2.material_code LIKE CONCAT('%', #{materialId}, '%')
OR m2.material_name LIKE CONCAT('%', #{materialId}, '%'))
</if>
<if
test=
"warehousesCode != null and warehousesCode != ''"
>
AND w2.warehouses_code LIKE CONCAT('%', #{warehousesCode}, '%')
</if>
<if
test=
"startDate != null"
>
AND oo.inbound_date
>
= #{startDate}
</if>
<if
test=
"endDate != null"
>
AND oo.inbound_date
<
DATE_ADD(#{endDate}, INTERVAL 1 DAY)
</if>
</where>
GROUP BY oi.material_id
) t
LEFT JOIN materials m ON t.material_id = m.id
GROUP BY t.material_id, m.material_name
ORDER BY m.material_name ASC
</select>
</mapper>
ruoyi-inventory/src/main/resources/mapper/inventory/StorageLocationsMapper.xml
View file @
835ab1b5
...
...
@@ -107,6 +107,19 @@
where sl.id = #{id}
</select>
<select
id=
"selectStorageLocationsByNameAndWarehouse"
resultMap=
"StorageLocationsResult"
>
select sl.id, sl.location_code, sl.location_name, sl.warehouses_code, sl.location_type,
sl.zone_code, sl.row_code, sl.column_code, sl.layer_code, sl.capacity,
sl.volume_capacity, sl.allowed_hazard_levels, sl.allowed_category_ids,
sl.temperature_zone, sl.is_enabled, sl.is_used, sl.sort_no,
sl.create_time, sl.create_user_code, sl.update_time, sl.update_user_code, sl.warehouses_id
from storage_locations sl
where sl.is_used = 1
and sl.location_name = #{locationName}
and sl.warehouses_id = #{warehouseId}
limit 1
</select>
<!-- 关联仓库表的ID查询 -->
<select
id=
"selectStorageLocationsByIdWithWarehouses"
parameterType=
"String"
resultMap=
"StorageLocationsWithWarehousesResult"
>
select sl.id, sl.location_code, sl.location_name, sl.warehouses_code, sl.location_type,
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/WarehousesMapper.xml
View file @
835ab1b5
...
...
@@ -50,6 +50,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include
refid=
"selectWarehousesVo"
/>
where id = #{id}
</select>
<select
id=
"selectWarehousesByName"
parameterType=
"String"
resultMap=
"WarehousesResult"
>
<include
refid=
"selectWarehousesVo"
/>
where warehouses_name = #{name} and is_used = 1
limit 1
</select>
<!-- 获取仓库 的 warehouses_code 仓库编码 warehouses_name 做成字典-->
<select
id=
"getMapList"
resultType=
"java.util.Map"
>
select id, IFNULL(warehouses_name, '') as warehouses_name from warehouses where is_used = 1;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论