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
c5a04317
Commit
c5a04317
authored
Dec 04, 2025
by
yubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inventory
parent
2ae44490
全部展开
显示空白字符变更
内嵌
并排
正在显示
26 个修改的文件
包含
90 行增加
和
776 行删除
+90
-776
ruoyi-admin-vue/src/views/inventory/locations/MaterialSelectComponent.vue
+0
-293
ruoyi-admin-vue/src/views/inventory/locations/index.vue
+0
-0
ruoyi-admin-vue/src/views/inventory/locations/treeComponent.vue
+0
-377
ruoyi-admin-vue/src/views/inventory/orders/index.vue
+0
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/InventoryController.java
+11
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/OutboundOrderItemsController.java
+4
-4
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/OutboundOrderItemsInventory.java
+0
-50
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/OutboundOrderLog.java
+1
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InventoryMapper.java
+4
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/MaterialsCategoryMapper.java
+7
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/MaterialsMapper.java
+8
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryService.java
+4
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IOutboundOrderItemsService.java
+3
-3
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IOutboundOrderLogService.java
+2
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InboundOrderItemsServiceImpl.java
+1
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
+7
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrderItemsServiceImpl.java
+10
-25
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrderLogServiceImpl.java
+4
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrdersServiceImpl.java
+2
-4
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StorageLocationsServiceImpl.java
+11
-8
ruoyi-inventory/src/main/resources/mapper/inventory/InboundOrdersMapper.xml
+1
-1
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
+4
-1
ruoyi-inventory/src/main/resources/mapper/inventory/MaterialsCategoryMapper.xml
+0
-1
ruoyi-inventory/src/main/resources/mapper/inventory/MaterialsMapper.xml
+5
-0
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrderLogMapper.xml
+0
-4
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrdersMapper.xml
+1
-1
没有找到文件。
ruoyi-admin-vue/src/views/inventory/locations/MaterialSelectComponent.vue
deleted
100644 → 0
View file @
2ae44490
<
template
>
<div
class=
"material-select-component"
>
<el-dialog
:title=
"title"
:visible
.
sync=
"visible"
width=
"900px"
append-to-body
>
<!-- 左右分栏布局 -->
<div
class=
"split-layout"
>
<!-- 左侧分类树 -->
<div
class=
"left-panel"
>
<TreeComponent
ref=
"treeComponent"
:tree-data=
"categoryTreeData"
:tree-props=
"treeProps"
:node-key=
"nodeKey"
:show-search=
"true"
search-placeholder=
"请输入分类名称"
:default-expand-all=
"true"
:highlight-current=
"true"
:loading=
"loadingTree"
@
node-click=
"handleCategoryChange"
>
<!-- 自定义节点内容插槽 -->
<template
#
node-content=
"
{ node, data }">
<span
class=
"custom-tree-node"
>
<span>
{{
node
.
label
}}
</span>
</span>
</
template
>
</TreeComponent>
</div>
<!-- 右侧物料列表 -->
<div
class=
"right-panel"
>
<!-- 物料列表 -->
<el-table
v-loading=
"loading"
:data=
"materialsList"
@
selection-change=
"handleSelectionChange"
:scroll-x=
"true"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"index"
label=
"序号"
align=
"center"
/>
<el-table-column
label=
"物料编码"
align=
"center"
prop=
"materialCode"
/>
<el-table-column
label=
"物料名称"
align=
"center"
prop=
"materialName"
/>
<el-table-column
label=
"SAP物料号"
align=
"center"
prop=
"sapNo"
/>
<el-table-column
label=
"规格型号"
align=
"center"
prop=
"specification"
/>
<el-table-column
label=
"计量单位"
align=
"center"
prop=
"materialUnit"
/>
</el-table>
<!-- 分页 -->
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
</div>
</div>
<!-- 底部按钮 -->
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"confirmSelection"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listMaterials
}
from
"@/api/inventory/materials"
import
{
listMaterials_category
}
from
"@/api/inventory/materials_category"
import
Pagination
from
"@/components/Pagination"
import
TreeComponent
from
'./treeComponent.vue'
export
default
{
name
:
"MaterialSelectComponent"
,
components
:
{
Pagination
,
TreeComponent
},
props
:
{
// 对话框标题
title
:
{
type
:
String
,
default
:
"选择物料"
},
// 是否显示对话框
visible
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
return
{
// 树相关数据
categoryTreeData
:
[],
treeProps
:
{
children
:
'children'
,
label
:
'label'
,
value
:
'sid'
},
nodeKey
:
'sid'
,
loadingTree
:
false
,
// 分类映射
categoryMap
:
{},
// 选中的分类
selectedCategory
:
null
,
// 加载状态
loading
:
false
,
// 总条数
total
:
0
,
// 物料列表
materialsList
:
[],
// 选中的物料
selectedMaterials
:
[],
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
categoryCode
:
null
}
}
},
watch
:
{
// 监听对话框显示状态,当显示时加载物料列表和分类树
visible
(
newVal
)
{
if
(
newVal
)
{
this
.
getCategoryTreeData
()
this
.
getList
()
}
}
},
methods
:
{
/** 获取分类树数据 */
async
getCategoryTreeData
()
{
this
.
loadingTree
=
true
try
{
// 调用物料分类列表API获取所有分类
const
response
=
await
listMaterials_category
({
pageNum
:
1
,
pageSize
:
1000
// 获取足够多的数据
})
if
(
response
.
rows
&&
response
.
rows
.
length
>
0
)
{
// 过滤掉已禁用的分类
const
activeCategories
=
response
.
rows
.
filter
(
item
=>
item
.
isUsed
!==
0
&&
item
.
isUsed
!==
'0'
)
// 构建树形结构
this
.
categoryTreeData
=
this
.
buildTreeData
(
activeCategories
)
// 构建分类映射
this
.
buildCategoryMap
(
activeCategories
)
}
}
catch
(
error
)
{
console
.
error
(
'获取分类树数据失败:'
,
error
)
}
finally
{
this
.
loadingTree
=
false
}
},
/** 构建树形结构 */
buildTreeData
(
list
,
parentId
=
null
)
{
const
result
=
list
.
filter
(
item
=>
{
if
(
parentId
===
null
)
{
// 根节点:parentId为null、0或空
return
!
item
.
parentId
||
item
.
parentId
===
0
||
item
.
parentId
===
'0'
}
else
{
// 子节点:parentId匹配
return
item
.
parentId
==
parentId
}
})
.
map
(
item
=>
{
const
children
=
this
.
buildTreeData
(
list
,
item
.
id
)
return
{
...
item
,
sid
:
String
(
item
.
id
),
label
:
item
.
categoryName
,
children
:
children
.
length
>
0
?
children
:
undefined
}
})
return
result
},
/** 构建分类映射 */
buildCategoryMap
(
categories
)
{
this
.
categoryMap
=
{}
categories
.
forEach
(
item
=>
{
this
.
categoryMap
[
item
.
id
]
=
item
.
categoryName
})
},
/** 处理分类选择变化 */
handleCategoryChange
(
data
)
{
this
.
selectedCategory
=
data
// 更新查询参数,按选中的分类筛选物料
this
.
queryParams
.
categoryCode
=
data
?
data
.
categoryCode
:
null
this
.
queryParams
.
pageNum
=
1
this
.
getList
()
},
/** 获取物料列表 */
async
getList
()
{
this
.
loading
=
true
try
{
const
response
=
await
listMaterials
(
this
.
queryParams
)
this
.
materialsList
=
response
.
rows
this
.
total
=
response
.
total
}
catch
(
error
)
{
console
.
error
(
'获取物料列表失败:'
,
error
)
}
finally
{
this
.
loading
=
false
}
},
/** 处理选择变化 */
handleSelectionChange
(
selection
)
{
this
.
selectedMaterials
=
selection
},
/** 确认选择 */
confirmSelection
()
{
// 提取选中物料的uuid和名称,用逗号隔开
const
uuids
=
this
.
selectedMaterials
.
map
(
item
=>
item
.
uuid
||
item
.
id
)
// 兼容uuid和id字段
.
join
(
','
)
const
names
=
this
.
selectedMaterials
.
map
(
item
=>
item
.
materialName
)
// 提取物料名称
.
join
(
','
)
// 触发选择确认事件,将选中的uuid和名称传递给父组件
this
.
$emit
(
'selection-confirm'
,
uuids
,
names
)
// 关闭对话框
this
.
$emit
(
'update:visible'
,
false
)
},
/** 取消选择 */
cancel
()
{
// 清空选择
this
.
selectedMaterials
=
[]
this
.
selectedCategory
=
null
this
.
queryParams
.
categoryCode
=
null
// 触发取消事件
this
.
$emit
(
'selection-cancel'
)
// 关闭对话框
this
.
$emit
(
'update:visible'
,
false
)
}
}
}
</
script
>
<
style
scoped
>
.material-select-component
{
.dialog-footer
{
text-align
:
right
;
}
.split-layout
{
display
:
flex
;
height
:
500px
;
gap
:
10px
;
.left-panel
{
width
:
250px
;
border
:
1px
solid
#e4e7ed
;
border-radius
:
4px
;
overflow
:
hidden
;
.tree-container
{
height
:
100%
;
}
}
.right-panel
{
flex
:
1
;
display
:
flex
;
flex-direction
:
column
;
.el-table
{
flex
:
1
;
overflow
:
auto
;
}
.pagination
{
margin-top
:
10px
;
}
}
}
}
</
style
>
\ No newline at end of file
ruoyi-admin-vue/src/views/inventory/locations/index.vue
View file @
c5a04317
差异被折叠。
点击展开。
ruoyi-admin-vue/src/views/inventory/locations/treeComponent.vue
deleted
100644 → 0
View file @
2ae44490
<
template
>
<div
class=
"tree-container"
:style=
"containerStyle"
>
<!-- 搜索框 -->
<div
class=
"tree-header"
v-if=
"showSearch"
>
<el-input
v-model=
"searchText"
:placeholder=
"searchPlaceholder"
clearable
size=
"small"
prefix-icon=
"el-icon-search"
@
input=
"handleSearch"
style=
"width: 100%; margin-bottom: 10px;"
/>
</div>
<!-- 树组件 -->
<div
class=
"tree-body"
:style=
"treeBodyStyle"
>
<el-tree
v-if=
"treeData && treeData.length > 0"
ref=
"treeRef"
:data=
"filteredTreeData"
:props=
"treeProps"
:node-key=
"nodeKey"
:default-expand-all=
"defaultExpandAll"
:expand-on-click-node=
"expandOnClickNode"
:highlight-current=
"highlightCurrent"
:filter-node-method=
"filterNodeMethod"
:empty-text=
"emptyText"
:style=
"treeStyle"
@
node-click=
"handleNodeClick"
@
node-expand=
"handleNodeExpand"
@
node-collapse=
"handleNodeCollapse"
@
current-change=
"handleCurrentChange"
>
<!-- 自定义节点内容插槽 -->
<template
#
default=
"
{ node, data }">
<slot
name=
"node-content"
:node=
"node"
:data=
"data"
>
<span
class=
"custom-tree-node"
>
<span>
{{
node
.
label
}}
</span>
</span>
</slot>
</
template
>
</el-tree>
<!-- 空状态 -->
<div
v-else
class=
"tree-empty"
>
<slot
name=
"empty"
>
<div
style=
"padding: 20px; text-align: center; color: #999;"
>
{{ loading ? '加载中...' : '暂无数据' }}
</div>
</slot>
</div>
</div>
</div>
</template>
<
script
>
export
default
{
name
:
'TreeComponent'
,
props
:
{
// 树数据
treeData
:
{
type
:
Array
,
default
:
()
=>
[]
},
// 树配置
treeProps
:
{
type
:
Object
,
default
:
()
=>
({
children
:
'children'
,
label
:
'label'
,
value
:
'sid'
})
},
// 节点key
nodeKey
:
{
type
:
String
,
default
:
'sid'
},
// 是否显示搜索框
showSearch
:
{
type
:
Boolean
,
default
:
true
},
// 搜索框占位符
searchPlaceholder
:
{
type
:
String
,
default
:
'请输入搜索内容'
},
// 是否默认展开所有节点
defaultExpandAll
:
{
type
:
Boolean
,
default
:
true
},
// 是否点击节点时展开
expandOnClickNode
:
{
type
:
Boolean
,
default
:
false
},
// 是否高亮当前选中节点
highlightCurrent
:
{
type
:
Boolean
,
default
:
true
},
// 容器样式
containerStyle
:
{
type
:
Object
,
default
:
()
=>
({
height
:
'100%'
,
padding
:
'10px'
})
},
// 树容器样式
treeBodyStyle
:
{
type
:
Object
,
default
:
()
=>
({
height
:
'calc(100% - 50px)'
,
overflow
:
'auto'
})
},
// 树样式
treeStyle
:
{
type
:
Object
,
default
:
()
=>
({})
},
// 空状态文本
emptyText
:
{
type
:
String
,
default
:
'暂无数据'
},
// 加载状态
loading
:
{
type
:
Boolean
,
default
:
false
},
// 初始选中的节点key
defaultSelectedKey
:
{
type
:
[
String
,
Number
],
default
:
null
}
},
data
()
{
return
{
searchText
:
''
,
filteredTreeData
:
[],
selectedNode
:
null
}
},
watch
:
{
treeData
:
{
immediate
:
true
,
handler
(
newData
)
{
this
.
filteredTreeData
=
newData
this
.
$nextTick
(()
=>
{
if
(
this
.
defaultSelectedKey
&&
this
.
$refs
.
treeRef
)
{
this
.
$refs
.
treeRef
.
setCurrentKey
(
this
.
defaultSelectedKey
)
}
})
}
},
defaultSelectedKey
:
{
immediate
:
true
,
handler
(
newKey
)
{
if
(
newKey
&&
this
.
$refs
.
treeRef
)
{
this
.
$refs
.
treeRef
.
setCurrentKey
(
newKey
)
}
}
}
},
methods
:
{
/**
* 过滤节点方法
*/
filterNodeMethod
(
value
,
data
,
node
)
{
if
(
!
value
)
return
true
const
label
=
data
[
this
.
treeProps
.
label
]
||
''
return
label
.
toLowerCase
().
includes
(
value
.
toLowerCase
())
},
/**
* 处理搜索
*/
handleSearch
(
value
)
{
this
.
$refs
.
treeRef
.
filter
(
value
)
},
/**
* 节点点击事件
*/
handleNodeClick
(
data
,
node
,
component
)
{
this
.
selectedNode
=
{
data
,
node
,
component
}
this
.
$emit
(
'node-click'
,
data
,
node
,
component
)
},
/**
* 节点展开事件
*/
handleNodeExpand
(
data
,
node
,
component
)
{
this
.
$emit
(
'node-expand'
,
data
,
node
,
component
)
},
/**
* 节点折叠事件
*/
handleNodeCollapse
(
data
,
node
,
component
)
{
this
.
$emit
(
'node-collapse'
,
data
,
node
,
component
)
},
/**
* 当前节点变化事件
*/
handleCurrentChange
(
data
,
node
)
{
this
.
$emit
(
'current-change'
,
data
,
node
)
},
/**
* 重置树结构
*/
resetTree
()
{
// 修复:使用正确的 ref 名称 treeRef
if
(
this
.
$refs
.
treeRef
)
{
this
.
$refs
.
treeRef
.
setCurrentKey
(
null
);
this
.
searchText
=
''
;
this
.
$refs
.
treeRef
.
filter
(
''
);
// 清空搜索
}
},
/**
* 设置当前选中的节点
*/
setCurrentNode
(
node
)
{
this
.
$refs
.
treeRef
.
setCurrentNode
(
node
)
},
/**
* 设置当前选中的节点key
*/
setCurrentKey
(
key
)
{
this
.
$refs
.
treeRef
.
setCurrentKey
(
key
)
},
/**
* 获取当前选中的节点
*/
getCurrentNode
()
{
return
this
.
$refs
.
treeRef
.
getCurrentNode
()
},
/**
* 获取当前选中的节点key
*/
getCurrentKey
()
{
return
this
.
$refs
.
treeRef
.
getCurrentKey
()
},
/**
* 展开指定节点
*/
expandNode
(
node
)
{
this
.
$refs
.
treeRef
.
expandNode
(
node
)
},
/**
* 折叠指定节点
*/
collapseNode
(
node
)
{
this
.
$refs
.
treeRef
.
collapseNode
(
node
)
},
/**
* 展开所有节点
*/
expandAll
()
{
this
.
$refs
.
treeRef
.
expandAll
()
},
/**
* 折叠所有节点
*/
collapseAll
()
{
this
.
$refs
.
treeRef
.
collapseAll
()
},
/**
* 更新节点数据
*/
updateKeyChildren
(
key
,
data
)
{
this
.
$refs
.
treeRef
.
updateKeyChildren
(
key
,
data
)
},
/**
* 获取节点信息
*/
getNode
(
key
)
{
return
this
.
$refs
.
treeRef
.
getNode
(
key
)
},
/**
* 移除节点
*/
remove
(
key
)
{
this
.
$refs
.
treeRef
.
remove
(
key
)
},
/**
* 追加节点数据
*/
append
(
data
,
parentNode
)
{
this
.
$refs
.
treeRef
.
append
(
data
,
parentNode
)
},
/**
* 插入节点数据
*/
insertBefore
(
data
,
refNode
)
{
this
.
$refs
.
treeRef
.
insertBefore
(
data
,
refNode
)
},
/**
* 插入节点数据后
*/
insertAfter
(
data
,
refNode
)
{
this
.
$refs
.
treeRef
.
insertAfter
(
data
,
refNode
)
}
}
}
</
script
>
<
style
scoped
>
.tree-container
{
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
}
.tree-header
{
flex-shrink
:
0
;
}
.tree-body
{
flex
:
1
;
overflow
:
auto
;
}
.custom-tree-node
{
flex
:
1
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
font-size
:
14px
;
padding-right
:
8px
;
}
.tree-empty
{
height
:
100%
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
color
:
#999
;
}
</
style
>
\ No newline at end of file
ruoyi-admin-vue/src/views/inventory/orders/index.vue
View file @
c5a04317
差异被折叠。
点击展开。
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/InventoryController.java
View file @
c5a04317
...
...
@@ -45,7 +45,17 @@ public class InventoryController extends BaseController
List
<
Inventory
>
list
=
inventoryService
.
selectInventoryList
(
inventory
);
return
getDataTable
(
list
);
}
/**
* 查询库存列表
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:inventory:list')"
)
@GetMapping
(
"/listByMaterialId"
)
public
TableDataInfo
listByMaterialId
(
String
materialId
)
{
startPage
();
List
<
Inventory
>
list
=
inventoryService
.
listByMatreialId
(
materialId
);
return
getDataTable
(
list
);
}
/**
* 导出库存列表
*/
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/OutboundOrderItemsController.java
View file @
c5a04317
...
...
@@ -17,7 +17,7 @@ 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.OutboundOrderItems
;
import
com.ruoyi.inventory.domain.OutboundOrderItemsInventory
;
import
com.ruoyi.inventory.service.IOutboundOrderItemsService
;
import
com.ruoyi.common.utils.poi.ExcelUtil
;
import
com.ruoyi.common.core.page.TableDataInfo
;
...
...
@@ -43,7 +43,7 @@ public class OutboundOrderItemsController extends BaseController
public
TableDataInfo
list
(
OutboundOrderItems
outboundOrderItems
)
{
startPage
();
List
<
OutboundOrderItems
Inventory
>
list
=
outboundOrderItemsService
.
selectOutboundOrderItemsList
(
outboundOrderItems
);
List
<
OutboundOrderItems
>
list
=
outboundOrderItemsService
.
selectOutboundOrderItemsList
(
outboundOrderItems
);
return
getDataTable
(
list
);
}
...
...
@@ -55,8 +55,8 @@ public class OutboundOrderItemsController extends BaseController
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
OutboundOrderItems
outboundOrderItems
)
{
List
<
OutboundOrderItems
Inventory
>
list
=
outboundOrderItemsService
.
selectOutboundOrderItemsList
(
outboundOrderItems
);
ExcelUtil
<
OutboundOrderItems
Inventory
>
util
=
new
ExcelUtil
<
OutboundOrderItemsInventory
>(
OutboundOrderItemsInventory
.
class
);
List
<
OutboundOrderItems
>
list
=
outboundOrderItemsService
.
selectOutboundOrderItemsList
(
outboundOrderItems
);
ExcelUtil
<
OutboundOrderItems
>
util
=
new
ExcelUtil
<
OutboundOrderItems
>(
OutboundOrderItems
.
class
);
util
.
exportExcel
(
response
,
list
,
"出库单明细数据"
);
}
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/OutboundOrderItemsInventory.java
deleted
100644 → 0
View file @
2ae44490
package
com
.
ruoyi
.
inventory
.
domain
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
/**
* 出库单明细库存DTO对象 outbound_order_items_inventory
*
* @author ruoyi
* @date 2025-12-03
*/
public
class
OutboundOrderItemsInventory
{
private
static
final
long
serialVersionUID
=
1L
;
/** 出库单明细 */
private
OutboundOrderItems
outboundOrderItems
;
/** 库存信息 */
private
Inventory
inventory
;
public
OutboundOrderItems
getOutboundOrderItems
()
{
return
outboundOrderItems
;
}
public
void
setOutboundOrderItems
(
OutboundOrderItems
outboundOrderItems
)
{
this
.
outboundOrderItems
=
outboundOrderItems
;
}
public
Inventory
getInventory
()
{
return
inventory
;
}
public
void
setInventory
(
Inventory
inventory
)
{
this
.
inventory
=
inventory
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"outboundOrderItems"
,
getOutboundOrderItems
())
.
append
(
"inventory"
,
getInventory
())
.
toString
();
}
}
\ No newline at end of file
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/OutboundOrderLog.java
View file @
c5a04317
...
...
@@ -19,7 +19,7 @@ public class OutboundOrderLog extends BaseEntity
private
String
id
;
/** 货物ID */
@Excel
(
name
=
"
货物
ID"
)
@Excel
(
name
=
"
出货单号
ID"
)
private
String
orderId
;
/** 货物ID */
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InventoryMapper.java
View file @
c5a04317
package
com
.
ruoyi
.
inventory
.
mapper
;
import
java.util.List
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.inventory.domain.Inventory
;
/**
...
...
@@ -65,4 +67,6 @@ public interface InventoryMapper
* @return 结果
*/
public
int
deleteInventoryByIds
(
String
[]
ids
);
public
List
<
Inventory
>
listByMatreialId
(
String
materialId
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/MaterialsCategoryMapper.java
View file @
c5a04317
...
...
@@ -19,6 +19,13 @@ public interface MaterialsCategoryMapper
*/
public
MaterialsCategory
selectMaterialsCategoryById
(
String
id
);
/**
* 查询物料分类
*
* @param id 物料分类主键
* @return 物料分类
*/
public
MaterialsCategory
selectMaterialsCategoryByMaterialsCode
(
String
id
);
/**
* 查询物料分类列表
*
* @param materialsCategory 物料分类
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/MaterialsMapper.java
View file @
c5a04317
...
...
@@ -23,6 +23,14 @@ public interface MaterialsMapper
public
Materials
selectMaterialsById
(
String
id
);
/**
* 查询物料
*
* @param id 物料主键
* @return 物料
*/
public
Materials
selectMaterialsByMaterialsCode
(
String
id
);
/**
* 查询物料列表
*
* @param materials 物料
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryService.java
View file @
c5a04317
package
com
.
ruoyi
.
inventory
.
service
;
import
java.util.List
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.inventory.domain.Inventory
;
/**
...
...
@@ -60,4 +62,6 @@ public interface IInventoryService
* @return 结果
*/
public
int
deleteInventoryById
(
String
id
);
public
List
<
Inventory
>
listByMatreialId
(
String
materialId
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IOutboundOrderItemsService.java
View file @
c5a04317
...
...
@@ -2,7 +2,7 @@ package com.ruoyi.inventory.service;
import
java.util.List
;
import
com.ruoyi.inventory.domain.OutboundOrderItems
;
import
com.ruoyi.inventory.domain.OutboundOrderItems
Inventory
;
import
com.ruoyi.inventory.domain.OutboundOrderItems
;
/**
* 出库单明细Service接口
...
...
@@ -18,7 +18,7 @@ public interface IOutboundOrderItemsService
* @param id 出库单明细主键
* @return 出库单明细
*/
public
OutboundOrderItems
Inventory
selectOutboundOrderItemsById
(
String
id
);
public
OutboundOrderItems
selectOutboundOrderItemsById
(
String
id
);
/**
* 查询出库单明细列表
...
...
@@ -26,7 +26,7 @@ public interface IOutboundOrderItemsService
* @param outboundOrderItems 出库单明细
* @return 出库单明细集合
*/
public
List
<
OutboundOrderItems
Inventory
>
selectOutboundOrderItemsList
(
OutboundOrderItems
outboundOrderItems
);
public
List
<
OutboundOrderItems
>
selectOutboundOrderItemsList
(
OutboundOrderItems
outboundOrderItems
);
/**
* 新增出库单明细
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IOutboundOrderLogService.java
View file @
c5a04317
...
...
@@ -35,6 +35,8 @@ public interface IOutboundOrderLogService
*/
public
int
insertOutboundOrderLog
(
OutboundOrderLog
outboundOrderLog
);
Long
selectLockedQuantity
(
OutboundOrderLog
outboundOrderLog
);
/**
* 修改出库明细子(仅用于锁定数量统计)
*
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InboundOrderItemsServiceImpl.java
View file @
c5a04317
...
...
@@ -19,7 +19,6 @@ public class InboundOrderItemsServiceImpl implements IInboundOrderItemsService
{
@Autowired
private
InboundOrderItemsMapper
inboundOrderItemsMapper
;
/**
* 查询入库单明细
*
...
...
@@ -54,6 +53,7 @@ public class InboundOrderItemsServiceImpl implements IInboundOrderItemsService
public
int
insertInboundOrderItems
(
InboundOrderItems
inboundOrderItems
)
{
inboundOrderItems
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
inboundOrderItemsMapper
.
insertInboundOrderItems
(
inboundOrderItems
);
}
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
View file @
c5a04317
...
...
@@ -85,6 +85,8 @@ public class InventoryServiceImpl implements IInventoryService
return
inventoryMapper
.
updateInventory
(
inventory
);
}
/**
* 批量删除库存
*
...
...
@@ -108,4 +110,9 @@ public class InventoryServiceImpl implements IInventoryService
{
return
inventoryMapper
.
deleteInventoryById
(
id
);
}
@Override
public
List
<
Inventory
>
listByMatreialId
(
String
materialId
)
{
return
inventoryMapper
.
listByMatreialId
(
materialId
);
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrderItemsServiceImpl.java
View file @
c5a04317
...
...
@@ -4,7 +4,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.inventory.domain.Inventory
;
import
com.ruoyi.inventory.domain.OutboundOrder
ItemsInventory
;
import
com.ruoyi.inventory.domain.OutboundOrder
Log
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -26,6 +26,9 @@ public class OutboundOrderItemsServiceImpl implements IOutboundOrderItemsService
@Autowired
private
InventoryServiceImpl
inventoryService
;
@Autowired
private
OutboundOrderLogServiceImpl
outboundOrderLogService
;
/**
* 查询出库单明细
*
...
...
@@ -33,16 +36,9 @@ public class OutboundOrderItemsServiceImpl implements IOutboundOrderItemsService
* @return 出库单明细
*/
@Override
public
OutboundOrderItems
Inventory
selectOutboundOrderItemsById
(
String
id
)
public
OutboundOrderItems
selectOutboundOrderItemsById
(
String
id
)
{
OutboundOrderItems
outboundOrderItems
=
outboundOrderItemsMapper
.
selectOutboundOrderItemsById
(
id
);
Inventory
inventory
=
new
Inventory
();
BeanUtils
.
copyProperties
(
outboundOrderItems
,
inventory
);
Inventory
inventory1
=
inventoryService
.
selectInventory
(
inventory
);
OutboundOrderItemsInventory
outboundOrderItemsInventory
=
new
OutboundOrderItemsInventory
();
outboundOrderItemsInventory
.
setOutboundOrderItems
(
outboundOrderItems
);
outboundOrderItemsInventory
.
setInventory
(
inventory1
);
return
outboundOrderItemsInventory
;
return
outboundOrderItemsMapper
.
selectOutboundOrderItemsById
(
id
);
}
/**
...
...
@@ -52,26 +48,15 @@ public class OutboundOrderItemsServiceImpl implements IOutboundOrderItemsService
* @return 出库单明细
*/
@Override
public
List
<
OutboundOrderItems
Inventory
>
selectOutboundOrderItemsList
(
OutboundOrderItems
outboundOrderItems
)
public
List
<
OutboundOrderItems
>
selectOutboundOrderItemsList
(
OutboundOrderItems
outboundOrderItems
)
{
List
<
OutboundOrderItems
>
itemsList
=
outboundOrderItemsMapper
.
selectOutboundOrderItemsList
(
outboundOrderItems
);
List
<
OutboundOrderItemsInventory
>
resultList
=
new
ArrayList
<>();
for
(
OutboundOrderItems
item
:
itemsList
)
{
Inventory
inventory
=
new
Inventory
();
BeanUtils
.
copyProperties
(
item
,
inventory
);
Inventory
inventory1
=
inventoryService
.
selectInventory
(
inventory
);
OutboundOrderItemsInventory
outboundOrderItemsInventory
=
new
OutboundOrderItemsInventory
();
outboundOrderItemsInventory
.
setOutboundOrderItems
(
item
);
outboundOrderItemsInventory
.
setInventory
(
inventory1
);
resultList
.
add
(
outboundOrderItemsInventory
);
}
return
resultList
;
return
outboundOrderItemsMapper
.
selectOutboundOrderItemsList
(
outboundOrderItems
);
}
/**
* 新增出库单明细
*
* @param outboundOrderItems
出库单明细
* @param outboundOrderItems
Inventory 出库单明细库存DTO
* @return 结果
*/
@Override
...
...
@@ -84,7 +69,7 @@ public class OutboundOrderItemsServiceImpl implements IOutboundOrderItemsService
/**
* 修改出库单明细
*
* @param outboundOrderItems
出库单明细
* @param outboundOrderItems
Inventory 出库单明细库存DTO
* @return 结果
*/
@Override
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrderLogServiceImpl.java
View file @
c5a04317
...
...
@@ -54,7 +54,10 @@ public class OutboundOrderLogServiceImpl implements IOutboundOrderLogService
{
return
outboundOrderLogMapper
.
insertOutboundOrderLog
(
outboundOrderLog
);
}
@Override
public
Long
selectLockedQuantity
(
OutboundOrderLog
outboundOrderLog
){
return
outboundOrderLogMapper
.
selectLockedQuantity
(
outboundOrderLog
);
}
/**
* 修改出库明细子(仅用于锁定数量统计)
*
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrdersServiceImpl.java
View file @
c5a04317
...
...
@@ -120,15 +120,13 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
String
id
=
outboundOrders
.
getId
();
if
(
StringUtils
.
isNotNull
(
outboundOrderItemsList
))
{
List
<
OutboundOrderItems
>
list
=
new
ArrayList
<
OutboundOrderItems
>();
for
(
OutboundOrderItems
outboundOrderItems
:
outboundOrderItemsList
)
{
outboundOrderItems
.
setOrderId
(
id
);
list
.
add
(
outboundOrderItems
);
}
if
(
l
ist
.
size
()
>
0
)
if
(
outboundOrderItemsL
ist
.
size
()
>
0
)
{
outboundOrdersMapper
.
batchOutboundOrderItems
(
l
ist
);
outboundOrdersMapper
.
batchOutboundOrderItems
(
outboundOrderItemsL
ist
);
}
}
}
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StorageLocationsServiceImpl.java
View file @
c5a04317
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.inventory.service.impl;
import
java.util.List
;
import
com.ruoyi.common.core.domain.entity.Materials
;
import
com.ruoyi.common.core.domain.entity.MaterialsCategory
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
...
...
@@ -9,6 +10,7 @@ import com.ruoyi.common.utils.bean.BeanUtils;
import
com.ruoyi.common.utils.uuid.UUID
;
import
com.ruoyi.inventory.domain.StorageLocationsCategory
;
import
com.ruoyi.inventory.mapper.MaterialsCategoryMapper
;
import
com.ruoyi.inventory.mapper.MaterialsMapper
;
import
com.ruoyi.inventory.mapper.StorageLocationsCategoryMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -30,7 +32,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
@Autowired
private
StorageLocationsCategoryMapper
storageLocationsCategoryMapper
;
@Autowired
private
Materials
CategoryMapper
materialsCategory
Mapper
;
private
Materials
Mapper
materials
Mapper
;
/**
* 查询库位
...
...
@@ -69,9 +71,10 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
if
(
storageLocations2
.
getAllowedCategoryIds
()
!=
null
&&
!
storageLocations2
.
getAllowedCategoryIds
().
isEmpty
()){
String
[]
AllowedCategoryIds
=
storageLocations2
.
getAllowedCategoryIds
().
split
(
","
);
for
(
String
AllowedCategoryId
:
AllowedCategoryIds
)
{
MaterialsCategory
materialsCategory
=
materialsCategoryMapper
.
selectMaterialsCategoryById
(
AllowedCategoryId
);
if
(
materialsCategory
!=
null
&&
materialsCategory
.
getCategoryName
()
!=
null
)
{
String
categoryName
=
materialsCategory
.
getCategoryName
().
trim
();
// 去除首尾空格
Materials
materials
=
materialsMapper
.
selectMaterialsByMaterialsCode
(
AllowedCategoryId
);
if
(
materials
!=
null
&&
materials
.
getMaterialName
()
!=
null
)
{
String
categoryName
=
materials
.
getMaterialName
().
trim
();
// 去除首尾空格
if
(
AllowedCategoryName
!=
""
)
{
AllowedCategoryName
+=
","
;
}
...
...
@@ -110,8 +113,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocationsCategory
.
setCategoryId
(
categoryId
);
storageLocationsCategory
.
setCreateTime
(
DateUtils
.
getNowDate
());
storageLocationsCategory
.
setCreateUserCode
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
Materials
Category
materialsCategory
=
materialsCategoryMapper
.
selectMaterialsCategoryById
(
categoryId
);
storageLocationsCategory
.
setCategoryName
(
materials
Category
.
getCategory
Name
());
Materials
materials
=
materialsMapper
.
selectMaterialsByMaterialsCode
(
categoryId
);
storageLocationsCategory
.
setCategoryName
(
materials
.
getMaterial
Name
());
storageLocationsCategoryMapper
.
insertStorageLocationsCategory
(
storageLocationsCategory
);
}
}
...
...
@@ -146,8 +149,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocationsCategory
.
setCategoryId
(
categoryId
);
storageLocationsCategory
.
setUpdateTime
(
DateUtils
.
getNowDate
());
storageLocationsCategory
.
setUpdateUserCode
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
Materials
Category
materialsCategory
=
materialsCategoryMapper
.
selectMaterialsCategoryById
(
categoryId
);
storageLocationsCategory
.
setCategoryName
(
materials
Category
.
getCategory
Name
());
Materials
materials
=
materialsMapper
.
selectMaterialsByMaterialsCode
(
categoryId
);
storageLocationsCategory
.
setCategoryName
(
materials
.
getMaterial
Name
());
storageLocationsCategoryMapper
.
insertStorageLocationsCategory
(
storageLocationsCategory
);
}
}
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/InboundOrdersMapper.xml
View file @
c5a04317
...
...
@@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectInboundOrdersList"
parameterType=
"InboundOrders"
resultMap=
"InboundOrdersResult"
>
<include
refid=
"selectInboundOrdersVo"
/>
<where>
<if
test=
"id != null and
id != ''"
>
and id = #{i
d}
</if>
<if
test=
"id != null and
Id != ''"
>
and id = #{I
d}
</if>
<if
test=
"systemNo != null and systemNo != ''"
>
and system_no = #{systemNo}
</if>
<if
test=
"orderTypeId != null and orderTypeId != ''"
>
and order_type_id = #{orderTypeId}
</if>
<if
test=
"batchCode != null and batchCode != ''"
>
and batch_code = #{batchCode}
</if>
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
View file @
c5a04317
...
...
@@ -90,7 +90,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include
refid=
"selectInventoryVo"
/>
where id = #{id}
</select>
<select
id=
"listByMatreialId"
parameterType=
"String"
resultMap=
"InventoryResult"
>
<include
refid=
"selectInventoryVo"
/>
where material_id = #{materialId}
</select>
<insert
id=
"insertInventory"
parameterType=
"Inventory"
>
insert into inventory
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/MaterialsCategoryMapper.xml
View file @
c5a04317
...
...
@@ -40,7 +40,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
order by sort_no asc
</select>
<insert
id=
"insertMaterialsCategory"
parameterType=
"MaterialsCategory"
>
insert into materials_category
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/MaterialsMapper.xml
View file @
c5a04317
...
...
@@ -76,6 +76,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
order by sort_no asc
</select>
<select
id=
"selectMaterialsByMaterialsCode"
parameterType=
"String"
resultMap=
"MaterialsResult"
>
<include
refid=
"selectMaterialsVo"
/>
where material_code = #{id}
order by sort_no asc
</select>
<select
id=
"selectMaterialsByCategory"
parameterType=
"String"
resultMap=
"MaterialsResult"
>
<include
refid=
"selectMaterialsVo"
/>
where category_code = #{id}
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrderLogMapper.xml
View file @
c5a04317
...
...
@@ -37,13 +37,9 @@
select ifnull(sum(actual_quantity), 0)
from outbound_order_log
<where>
<if
test=
"orderId != null and orderId != ''"
>
and order_id = #{orderId}
</if>
<if
test=
"materialId != null and materialId != ''"
>
and material_id = #{materialId}
</if>
<if
test=
"warehouseId != null and warehouseId != ''"
>
and warehouse_id = #{warehouseId}
</if>
<if
test=
"batchCode != null and batchCode != ''"
>
and batch_code = #{batchCode}
</if>
<if
test=
"actualQuantity != null "
>
and actual_quantity = #{actualQuantity}
</if>
<if
test=
"itemStatus != null "
>
and item_status = #{itemStatus}
</if>
<if
test=
"isUsed != null "
>
and is_used = #{isUsed}
</if>
</where>
</select>
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrdersMapper.xml
View file @
c5a04317
...
...
@@ -91,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select
id=
"selectOutboundOrderItemsList"
parameterType=
"String"
resultMap=
"OutboundOrderItemsResult"
>
select id, order_id, material_id, batch_
id, warehouse_id, location_id, planned_quantity, actual_quantity, planned_packages, actual_packages, divisor, label_color, voucher_number, unit_price, item_status, received_at, receiv
ed_by, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code
select id, order_id, material_id, batch_
code, warehouse_id, location_id, planned_quantity, actual_quantity, divisor, label_color, voucher_number, item_status, shipped_at, shipp
ed_by, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code
from outbound_order_items
where order_id = #{id}
</select>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论