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
d9ba64a8
Commit
d9ba64a8
authored
Dec 03, 2025
by
yubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inventory
parent
6d104f90
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
693 行增加
和
2 行删除
+693
-2
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/InventoryController.java
+104
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/Inventory.java
+345
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InventoryMapper.java
+68
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryService.java
+63
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
+111
-0
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
+0
-0
ruoyi-inventory/src/main/resources/mapper/inventory/WarehousesMapper.xml
+2
-2
没有找到文件。
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/InventoryController.java
0 → 100644
View file @
d9ba64a8
package
com
.
ruoyi
.
inventory
.
controller
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.enums.BusinessType
;
import
com.ruoyi.inventory.domain.Inventory
;
import
com.ruoyi.inventory.service.IInventoryService
;
import
com.ruoyi.common.utils.poi.ExcelUtil
;
import
com.ruoyi.common.core.page.TableDataInfo
;
/**
* 库存Controller
*
* @author ruoyi
* @date 2025-12-03
*/
@RestController
@RequestMapping
(
"/inventory/inventory"
)
public
class
InventoryController
extends
BaseController
{
@Autowired
private
IInventoryService
inventoryService
;
/**
* 查询库存列表
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:inventory:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
Inventory
inventory
)
{
startPage
();
List
<
Inventory
>
list
=
inventoryService
.
selectInventoryList
(
inventory
);
return
getDataTable
(
list
);
}
/**
* 导出库存列表
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:inventory:export')"
)
@Log
(
title
=
"库存"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
Inventory
inventory
)
{
List
<
Inventory
>
list
=
inventoryService
.
selectInventoryList
(
inventory
);
ExcelUtil
<
Inventory
>
util
=
new
ExcelUtil
<
Inventory
>(
Inventory
.
class
);
util
.
exportExcel
(
response
,
list
,
"库存数据"
);
}
/**
* 获取库存详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:inventory:query')"
)
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
String
id
)
{
return
success
(
inventoryService
.
selectInventoryById
(
id
));
}
/**
* 新增库存
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:inventory:add')"
)
@Log
(
title
=
"库存"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
Inventory
inventory
)
{
return
toAjax
(
inventoryService
.
insertInventory
(
inventory
));
}
/**
* 修改库存
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:inventory:edit')"
)
@Log
(
title
=
"库存"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
Inventory
inventory
)
{
return
toAjax
(
inventoryService
.
updateInventory
(
inventory
));
}
/**
* 删除库存
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:inventory:remove')"
)
@Log
(
title
=
"库存"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
String
[]
ids
)
{
return
toAjax
(
inventoryService
.
deleteInventoryByIds
(
ids
));
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/Inventory.java
0 → 100644
View file @
d9ba64a8
package
com
.
ruoyi
.
inventory
.
domain
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.ruoyi.common.annotation.Excel
;
import
com.ruoyi.common.core.domain.BaseEntity
;
/**
* 库存对象 inventory
*
* @author ruoyi
* @date 2025-12-03
*/
public
class
Inventory
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 编号 */
private
String
id
;
/** 库存类别1普通2退库 */
@Excel
(
name
=
"库存类别1普通2退库"
)
private
Long
inventoryType
;
/** 入库单号 */
@Excel
(
name
=
"入库单号"
)
private
String
orderId
;
/** 物料ID 检索条件 */
@Excel
(
name
=
"物料ID 检索条件"
)
private
String
materialId
;
/** 批次ID 检索条件 */
@Excel
(
name
=
"批次ID 检索条件"
)
private
String
batchId
;
/** 库位ID 检索条件 */
@Excel
(
name
=
"库位ID 检索条件"
)
private
String
locationId
;
/** 货主ID 检索条件 */
@Excel
(
name
=
"货主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删除 删除用 */
@Excel
(
name
=
"应用数据1使用0删除 删除用"
)
private
Long
isUsed
;
/** 排序 */
@Excel
(
name
=
"排序"
)
private
Long
sortNo
;
/** 创建日期 */
@Excel
(
name
=
"创建日期"
)
private
String
createUserCode
;
/** 排序号 */
@Excel
(
name
=
"排序号"
)
private
String
updateUserCode
;
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
;
}
public
Long
getUnitWeight
()
{
return
unitWeight
;
}
public
void
setTotalWeight
(
Long
totalWeight
)
{
this
.
totalWeight
=
totalWeight
;
}
public
Long
getTotalWeight
()
{
return
totalWeight
;
}
public
void
setTotalVolume
(
Long
totalVolume
)
{
this
.
totalVolume
=
totalVolume
;
}
public
Long
getTotalVolume
()
{
return
totalVolume
;
}
public
void
setProductionDate
(
Date
productionDate
)
{
this
.
productionDate
=
productionDate
;
}
public
Date
getProductionDate
()
{
return
productionDate
;
}
public
void
setExpirationDate
(
Date
expirationDate
)
{
this
.
expirationDate
=
expirationDate
;
}
public
Date
getExpirationDate
()
{
return
expirationDate
;
}
public
void
setInventoryStatus
(
Long
inventoryStatus
)
{
this
.
inventoryStatus
=
inventoryStatus
;
}
public
Long
getInventoryStatus
()
{
return
inventoryStatus
;
}
public
void
setLastInboundTime
(
Date
lastInboundTime
)
{
this
.
lastInboundTime
=
lastInboundTime
;
}
public
Date
getLastInboundTime
()
{
return
lastInboundTime
;
}
public
void
setLastOutboundTime
(
Date
lastOutboundTime
)
{
this
.
lastOutboundTime
=
lastOutboundTime
;
}
public
Date
getLastOutboundTime
()
{
return
lastOutboundTime
;
}
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
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"inventoryType"
,
getInventoryType
())
.
append
(
"orderId"
,
getOrderId
())
.
append
(
"materialId"
,
getMaterialId
())
.
append
(
"batchId"
,
getBatchId
())
.
append
(
"locationId"
,
getLocationId
())
.
append
(
"ownerId"
,
getOwnerId
())
.
append
(
"quantity"
,
getQuantity
())
.
append
(
"lockedQuantity"
,
getLockedQuantity
())
.
append
(
"unitWeight"
,
getUnitWeight
())
.
append
(
"totalWeight"
,
getTotalWeight
())
.
append
(
"totalVolume"
,
getTotalVolume
())
.
append
(
"productionDate"
,
getProductionDate
())
.
append
(
"expirationDate"
,
getExpirationDate
())
.
append
(
"inventoryStatus"
,
getInventoryStatus
())
.
append
(
"lastInboundTime"
,
getLastInboundTime
())
.
append
(
"lastOutboundTime"
,
getLastOutboundTime
())
.
append
(
"isUsed"
,
getIsUsed
())
.
append
(
"sortNo"
,
getSortNo
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"createUserCode"
,
getCreateUserCode
())
.
append
(
"updateTime"
,
getUpdateTime
())
.
append
(
"updateUserCode"
,
getUpdateUserCode
())
.
toString
();
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InventoryMapper.java
0 → 100644
View file @
d9ba64a8
package
com
.
ruoyi
.
inventory
.
mapper
;
import
java.util.List
;
import
com.ruoyi.inventory.domain.Inventory
;
/**
* 库存Mapper接口
*
* @author ruoyi
* @date 2025-12-03
*/
public
interface
InventoryMapper
{
/**
* 查询库存
*
* @param id 库存主键
* @return 库存
*/
public
Inventory
selectInventoryById
(
String
id
);
/**
* 查询库存
*
* @param id 库存主键
* @return 库存
*/
public
Inventory
selectInventory
(
Inventory
inventory
);
/**
* 查询库存列表
*
* @param inventory 库存
* @return 库存集合
*/
public
List
<
Inventory
>
selectInventoryList
(
Inventory
inventory
);
/**
* 新增库存
*
* @param inventory 库存
* @return 结果
*/
public
int
insertInventory
(
Inventory
inventory
);
/**
* 修改库存
*
* @param inventory 库存
* @return 结果
*/
public
int
updateInventory
(
Inventory
inventory
);
/**
* 删除库存
*
* @param id 库存主键
* @return 结果
*/
public
int
deleteInventoryById
(
String
id
);
/**
* 批量删除库存
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public
int
deleteInventoryByIds
(
String
[]
ids
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryService.java
0 → 100644
View file @
d9ba64a8
package
com
.
ruoyi
.
inventory
.
service
;
import
java.util.List
;
import
com.ruoyi.inventory.domain.Inventory
;
/**
* 库存Service接口
*
* @author ruoyi
* @date 2025-12-03
*/
public
interface
IInventoryService
{
/**
* 查询库存
*
* @param id 库存主键
* @return 库存
*/
public
Inventory
selectInventoryById
(
String
id
);
/**
* 查询库存列表
*
* @param inventory 库存
* @return 库存集合
*/
public
List
<
Inventory
>
selectInventoryList
(
Inventory
inventory
);
Inventory
selectInventory
(
Inventory
inventory
);
/**
* 新增库存
*
* @param inventory 库存
* @return 结果
*/
public
int
insertInventory
(
Inventory
inventory
);
/**
* 修改库存
*
* @param inventory 库存
* @return 结果
*/
public
int
updateInventory
(
Inventory
inventory
);
/**
* 批量删除库存
*
* @param ids 需要删除的库存主键集合
* @return 结果
*/
public
int
deleteInventoryByIds
(
String
[]
ids
);
/**
* 删除库存信息
*
* @param id 库存主键
* @return 结果
*/
public
int
deleteInventoryById
(
String
id
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
0 → 100644
View file @
d9ba64a8
package
com
.
ruoyi
.
inventory
.
service
.
impl
;
import
java.util.List
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.inventory.domain.OutboundOrderLog
;
import
com.ruoyi.inventory.mapper.OutboundOrderLogMapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.ruoyi.inventory.mapper.InventoryMapper
;
import
com.ruoyi.inventory.domain.Inventory
;
import
com.ruoyi.inventory.service.IInventoryService
;
/**
* 库存Service业务层处理
*
* @author ruoyi
* @date 2025-12-03
*/
@Service
public
class
InventoryServiceImpl
implements
IInventoryService
{
@Autowired
private
InventoryMapper
inventoryMapper
;
@Autowired
private
OutboundOrderLogMapper
outboundOrderLogMapper
;
/**
* 查询库存
*
* @param id 库存主键
* @return 库存
*/
@Override
public
Inventory
selectInventoryById
(
String
id
)
{
return
inventoryMapper
.
selectInventoryById
(
id
);
}
/**
* 查询库存列表
*
* @param inventory 库存
* @return 库存
*/
@Override
public
List
<
Inventory
>
selectInventoryList
(
Inventory
inventory
)
{
return
inventoryMapper
.
selectInventoryList
(
inventory
);
}
@Override
public
Inventory
selectInventory
(
Inventory
inventory
)
{
Inventory
inventory1
=
inventoryMapper
.
selectInventory
(
inventory
);
OutboundOrderLog
outboundOrderLog
=
new
OutboundOrderLog
();
BeanUtils
.
copyProperties
(
inventory1
,
outboundOrderLog
);
inventory1
.
setLockedQuantity
(
outboundOrderLogMapper
.
selectLockedQuantity
(
outboundOrderLog
));
return
inventory1
;
}
/**
* 新增库存
*
* @param inventory 库存
* @return 结果
*/
@Override
public
int
insertInventory
(
Inventory
inventory
)
{
inventory
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
inventoryMapper
.
insertInventory
(
inventory
);
}
/**
* 修改库存
*
* @param inventory 库存
* @return 结果
*/
@Override
public
int
updateInventory
(
Inventory
inventory
)
{
inventory
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
inventoryMapper
.
updateInventory
(
inventory
);
}
/**
* 批量删除库存
*
* @param ids 需要删除的库存主键
* @return 结果
*/
@Override
public
int
deleteInventoryByIds
(
String
[]
ids
)
{
return
inventoryMapper
.
deleteInventoryByIds
(
ids
);
}
/**
* 删除库存信息
*
* @param id 库存主键
* @return 结果
*/
@Override
public
int
deleteInventoryById
(
String
id
)
{
return
inventoryMapper
.
deleteInventoryById
(
id
);
}
}
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
0 → 100644
View file @
d9ba64a8
差异被折叠。
点击展开。
ruoyi-inventory/src/main/resources/mapper/inventory/WarehousesMapper.xml
View file @
d9ba64a8
...
@@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectWarehousesList"
parameterType=
"Warehouses"
resultMap=
"WarehousesResult"
>
<select
id=
"selectWarehousesList"
parameterType=
"Warehouses"
resultMap=
"WarehousesResult"
>
<include
refid=
"selectWarehousesVo"
/>
<include
refid=
"selectWarehousesVo"
/>
<where>
where is_used=1
<if
test=
"warehousesCode != null and warehousesCode != ''"
>
and warehouses_code = #{warehousesCode}
</if>
<if
test=
"warehousesCode != null and warehousesCode != ''"
>
and warehouses_code = #{warehousesCode}
</if>
<if
test=
"warehousesName != null and warehousesName != ''"
>
and warehouses_name like concat('%', #{warehousesName}, '%')
</if>
<if
test=
"warehousesName != null and warehousesName != ''"
>
and warehouses_name like concat('%', #{warehousesName}, '%')
</if>
<if
test=
"warehouseType != null "
>
and warehouse_type = #{warehouseType}
</if>
<if
test=
"warehouseType != null "
>
and warehouse_type = #{warehouseType}
</if>
...
@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"sortNo != null "
>
and sort_no = #{sortNo}
</if>
<if
test=
"sortNo != null "
>
and sort_no = #{sortNo}
</if>
<if
test=
"createUserCode != null and createUserCode != ''"
>
and create_user_code = #{createUserCode}
</if>
<if
test=
"createUserCode != null and createUserCode != ''"
>
and create_user_code = #{createUserCode}
</if>
<if
test=
"updateUserCode != null and updateUserCode != ''"
>
and update_user_code = #{updateUserCode}
</if>
<if
test=
"updateUserCode != null and updateUserCode != ''"
>
and update_user_code = #{updateUserCode}
</if>
</where>
</select>
</select>
<select
id=
"selectWarehousesById"
parameterType=
"String"
resultMap=
"WarehousesResult"
>
<select
id=
"selectWarehousesById"
parameterType=
"String"
resultMap=
"WarehousesResult"
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论