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
1f9d9564
Commit
1f9d9564
authored
Dec 16, 2025
by
yubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组件双击 去选框 弹窗修改高度 物料根据库存排序反显 列表id修改
parent
b0192161
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
187 行增加
和
28 行删除
+187
-28
ruoyi-admin-vue/src/api/inventory/items.js
+7
-1
ruoyi-admin-vue/src/api/inventory/materials.js
+7
-0
ruoyi-admin-vue/src/components/materialsSeletor.vue
+0
-0
ruoyi-admin-vue/src/views/inventory/locations/index.vue
+0
-0
ruoyi-admin-vue/src/views/inventory/orders/OutboundOrderFormWithItems.vue
+0
-0
ruoyi-admin-vue/src/views/inventory/orders/index.vue
+23
-21
ruoyi-admin/src/main/java/com/ruoyi/web/controller/inventory/MaterialsController.java
+15
-0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/Materials.java
+19
-6
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/InventoryController.java
+3
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/OutboundOrderItemsController.java
+19
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/MaterialsMapper.java
+11
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IMaterialsService.java
+8
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
+1
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/MaterialsServiceImpl.java
+6
-0
ruoyi-inventory/src/main/resources/mapper/inventory/MaterialsMapper.xml
+68
-0
没有找到文件。
ruoyi-admin-vue/src/api/inventory/items.js
View file @
1f9d9564
...
@@ -8,7 +8,13 @@ export function listItems(query) {
...
@@ -8,7 +8,13 @@ export function listItems(query) {
params
:
query
params
:
query
})
})
}
}
export
function
listLog
(
query
)
{
return
request
({
url
:
'/inventory/items/listLog'
,
method
:
'get'
,
params
:
query
})
}
export
function
getStatistics
(
query
)
{
export
function
getStatistics
(
query
)
{
return
request
({
return
request
({
url
:
'/inventory/items/getStatistics'
,
url
:
'/inventory/items/getStatistics'
,
...
...
ruoyi-admin-vue/src/api/inventory/materials.js
View file @
1f9d9564
...
@@ -49,3 +49,10 @@ export function getMaterialsdicts() {
...
@@ -49,3 +49,10 @@ export function getMaterialsdicts() {
method
:
'get'
method
:
'get'
})
})
}
}
export
function
ListMaterialsInventory
(
query
){
return
request
({
url
:
'/inventory/materials/ListMaterialsInventory'
,
method
:
'post'
,
params
:
query
})
}
ruoyi-admin-vue/src/components/materialsSeletor.vue
View file @
1f9d9564
差异被折叠。
点击展开。
ruoyi-admin-vue/src/views/inventory/locations/index.vue
View file @
1f9d9564
差异被折叠。
点击展开。
ruoyi-admin-vue/src/views/inventory/orders/OutboundOrderFormWithItems.vue
View file @
1f9d9564
差异被折叠。
点击展开。
ruoyi-admin-vue/src/views/inventory/orders/index.vue
View file @
1f9d9564
...
@@ -3,14 +3,16 @@
...
@@ -3,14 +3,16 @@
<!-- 页面标题和操作按钮 -->
<!-- 页面标题和操作按钮 -->
<PageTitle>
<PageTitle>
<template
#
buttons
>
<template
#
buttons
>
<el-button
<el-button
type=
"primary"
type=
"primary"
plain
plain
icon=
"el-icon-plus"
icon=
"el-icon-plus"
size=
"medium"
size=
"medium"
@
click=
"handleAdd"
@
click=
"handleAdd"
v-hasPermi=
"['inventory:
orders
:add']"
v-hasPermi=
"['inventory:
inbound
:add']"
>
新增
</el-button>
>
新增
</el-button>
<el-button
<el-button
type=
"success"
type=
"success"
plain
plain
...
@@ -18,16 +20,9 @@
...
@@ -18,16 +20,9 @@
size=
"medium"
size=
"medium"
:disabled=
"single"
:disabled=
"single"
@
click=
"handleUpdate"
@
click=
"handleUpdate"
v-hasPermi=
"['inventory:
orders
:edit']"
v-hasPermi=
"['inventory:
inbound
:edit']"
>
修改
</el-button>
>
修改
</el-button>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"medium"
@
click=
"handleImport"
v-hasPermi=
"['inventory:orders:add']"
>
导入
</el-button>
<el-button
<el-button
type=
"danger"
type=
"danger"
plain
plain
...
@@ -35,15 +30,25 @@
...
@@ -35,15 +30,25 @@
size=
"medium"
size=
"medium"
:disabled=
"multiple"
:disabled=
"multiple"
@
click=
"handleDelete"
@
click=
"handleDelete"
v-hasPermi=
"['inventory:
orders
:remove']"
v-hasPermi=
"['inventory:
inbound
:remove']"
>
删除
</el-button>
>
删除
</el-button>
<el-button
type=
"warning"
plain
icon=
"el-icon-upload"
size=
"medium"
@
click=
"handleImport"
v-hasPermi=
"['inventory:inbound:import']"
>
导入
</el-button>
<el-button
<el-button
type=
"warning"
type=
"warning"
plain
plain
icon=
"el-icon-download"
icon=
"el-icon-download"
size=
"medium"
size=
"medium"
@
click=
"handleExport"
@
click=
"handleExport"
v-hasPermi=
"['inventory:
orders
:export']"
v-hasPermi=
"['inventory:
inbound
:export']"
>
导出
</el-button>
>
导出
</el-button>
</
template
>
</
template
>
</PageTitle>
</PageTitle>
...
@@ -98,10 +103,10 @@
...
@@ -98,10 +103,10 @@
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"批次
ID
"
prop=
"batchCode"
>
<el-form-item
label=
"批次
号
"
prop=
"batchCode"
>
<el-input
<el-input
v-model=
"queryParams.batchCode"
v-model=
"queryParams.batchCode"
placeholder=
"请输入批次
ID
"
placeholder=
"请输入批次
号
"
clearable
clearable
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"handleQuery"
/>
/>
...
@@ -205,7 +210,7 @@
...
@@ -205,7 +210,7 @@
<span
v-else
>
-
</span>
<span
v-else
>
-
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"批次
ID
"
align=
"center"
prop=
"batchCode"
width=
"120"
/>
<el-table-column
label=
"批次
号
"
align=
"center"
prop=
"batchCode"
width=
"120"
/>
<el-table-column
label=
"仓库"
align=
"center"
prop=
"warehouseName"
width=
"120"
>
<el-table-column
label=
"仓库"
align=
"center"
prop=
"warehouseName"
width=
"120"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
warehouseName
||
'-'
}}
{{
scope
.
row
.
warehouseName
||
'-'
}}
...
@@ -336,8 +341,8 @@
...
@@ -336,8 +341,8 @@
<
/el-row
>
<
/el-row
>
<
el
-
row
:
gutter
=
"20"
>
<
el
-
row
:
gutter
=
"20"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"批次
ID
"
prop
=
"batchCode"
>
<
el
-
form
-
item
label
=
"批次
号
"
prop
=
"batchCode"
>
<
el
-
input
v
-
model
=
"form.batchCode"
placeholder
=
"请输入批次
ID
"
:
disabled
=
"isViewDetail || formDisabled.batchCode"
/>
<
el
-
input
v
-
model
=
"form.batchCode"
placeholder
=
"请输入批次
号
"
:
disabled
=
"isViewDetail || formDisabled.batchCode"
/>
<
/el-form-item
>
<
/el-form-item
>
<
/el-col
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
col
:
span
=
"12"
>
...
@@ -420,13 +425,10 @@
...
@@ -420,13 +425,10 @@
<
/el-col
>
<
/el-col
>
<
/el-row
>
<
/el-row
>
<!--
【修改
1
】新增
materialName
展示
-->
<
div
v
-
for
=
"(group, materialId) in outboundOrderItemsGroup"
:
key
=
"materialId"
class
=
"material-group mb10"
>
<
div
v
-
for
=
"(group, materialId) in outboundOrderItemsGroup"
:
key
=
"materialId"
class
=
"material-group mb10"
>
<
div
class
=
"group-header"
style
=
"background: #f5f7fa; padding: 8px 12px; border-radius: 4px; margin-bottom: 8px;"
>
<
div
class
=
"group-header"
style
=
"background: #f5f7fa; padding: 8px 12px; border-radius: 4px; margin-bottom: 8px;"
>
<!--
【修改
2
】展示物料名称(优先取分组的
materialName
,无则用
getMaterialName
方法)
-->
<
span
style
=
"font-weight: 600; margin-right: 16px;"
>
物料:
{{
group
.
materialName
}}
<
/span
>
<
span
style
=
"font-weight: 600; margin-right: 16px;"
>
物料:
{{
group
.
materialName
}}
<
/span
>
<
span
style
=
"color: #666;"
>
明细数量:
{{
group
.
items
.
length
}}
条
<
/span
>
<
span
style
=
"color: #666;"
>
明细数量:
{{
group
.
items
.
length
}}
条
<
/span
>
<!--
仅编辑模式显示分组操作按钮
-->
<
el
-
button
<
el
-
button
type
=
"text"
type
=
"text"
size
=
"mini"
size
=
"mini"
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/inventory/MaterialsController.java
View file @
1f9d9564
...
@@ -7,6 +7,8 @@ import java.util.UUID;
...
@@ -7,6 +7,8 @@ import java.util.UUID;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
com.ruoyi.common.core.domain.entity.Materials
;
import
com.ruoyi.common.core.domain.entity.Materials
;
import
com.ruoyi.inventory.domain.Inventory
;
import
com.ruoyi.inventory.domain.OutboundOrderItems
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -45,6 +47,19 @@ public class MaterialsController extends BaseController
...
@@ -45,6 +47,19 @@ public class MaterialsController extends BaseController
}
}
/**
/**
* 查询库存列表
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:inventory:list')"
)
@PostMapping
(
"/ListMaterialsInventory"
)
public
TableDataInfo
ListMaterialsInventory
(
Materials
materials
)
{
startPage
();
List
<
Materials
>
list
=
materialsService
.
ListMaterialsInventory
(
materials
);
return
getDataTable
(
list
);
}
/**
* 导出物料列表
* 导出物料列表
*/
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:materials:export')"
)
@PreAuthorize
(
"@ss.hasPermi('inventory:materials:export')"
)
...
...
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/Materials.java
View file @
1f9d9564
...
@@ -2,16 +2,13 @@ package com.ruoyi.common.core.domain.entity;
...
@@ -2,16 +2,13 @@ package com.ruoyi.common.core.domain.entity;
import
com.ruoyi.common.annotation.Excel
;
import
com.ruoyi.common.annotation.Excel
;
import
com.ruoyi.common.core.domain.BaseEntity
;
import
com.ruoyi.common.core.domain.BaseEntity
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
/**
/**
* 物料对象 materials
* 物料对象 materials
*
*
* @author ruoyi
* @author ruoyi
* @date 2025-11-28
* @date 2025-11-28
*/
*/
public
class
Materials
extends
BaseEntity
public
class
Materials
extends
BaseEntity
{
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -38,7 +35,6 @@ public class Materials extends BaseEntity
...
@@ -38,7 +35,6 @@ public class Materials extends BaseEntity
@Excel
(
name
=
"中文描述"
)
@Excel
(
name
=
"中文描述"
)
private
String
materialName
;
private
String
materialName
;
/** 物料名称 检索条件 */
/** 物料名称 检索条件 */
@Excel
(
name
=
"英文描述"
)
@Excel
(
name
=
"英文描述"
)
private
String
materialEname
;
private
String
materialEname
;
...
@@ -136,6 +132,12 @@ public class Materials extends BaseEntity
...
@@ -136,6 +132,12 @@ public class Materials extends BaseEntity
/** 排序号 */
/** 排序号 */
private
String
updateUserCode
;
private
String
updateUserCode
;
// ======================== 仅新增这一个库存字段 ========================
/** 库存数量(关联inventory表) */
@Excel
(
name
=
"库存数量"
)
private
Long
stock
;
// ======================== 原有所有getter/setter(完整保留) ========================
public
String
getId
()
{
public
String
getId
()
{
return
id
;
return
id
;
}
}
...
@@ -386,6 +388,15 @@ public class Materials extends BaseEntity
...
@@ -386,6 +388,15 @@ public class Materials extends BaseEntity
this
.
updateUserCode
=
updateUserCode
;
this
.
updateUserCode
=
updateUserCode
;
}
}
// ======================== 仅新增库存字段的getter/setter ========================
public
Long
getStock
()
{
return
stock
;
}
public
void
setStock
(
Long
stock
)
{
this
.
stock
=
stock
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"Materials{"
+
return
"Materials{"
+
...
@@ -420,6 +431,7 @@ public class Materials extends BaseEntity
...
@@ -420,6 +431,7 @@ public class Materials extends BaseEntity
", sortNo="
+
sortNo
+
", sortNo="
+
sortNo
+
", createUserCode='"
+
createUserCode
+
'\''
+
", createUserCode='"
+
createUserCode
+
'\''
+
", updateUserCode='"
+
updateUserCode
+
'\''
+
", updateUserCode='"
+
updateUserCode
+
'\''
+
", stock="
+
stock
+
// 仅追加这一行
'}'
;
'}'
;
}
}
}
}
\ No newline at end of file
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/InventoryController.java
View file @
1f9d9564
...
@@ -99,6 +99,9 @@ public class InventoryController extends BaseController
...
@@ -99,6 +99,9 @@ public class InventoryController extends BaseController
List
<
Inventory
>
list
=
inventoryService
.
listByMatreialId
(
inventory
);
List
<
Inventory
>
list
=
inventoryService
.
listByMatreialId
(
inventory
);
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
/**
/**
* 导出库存列表
* 导出库存列表
*/
*/
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/OutboundOrderItemsController.java
View file @
1f9d9564
...
@@ -3,9 +3,11 @@ package com.ruoyi.inventory.controller;
...
@@ -3,9 +3,11 @@ package com.ruoyi.inventory.controller;
import
java.util.List
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
com.ruoyi.inventory.domain.OutboundOrderLog
;
import
com.ruoyi.inventory.domain.vo.inboundVO.InboundTemplateVO
;
import
com.ruoyi.inventory.domain.vo.inboundVO.InboundTemplateVO
;
import
com.ruoyi.inventory.domain.vo.OutboundOrdersSummaryVO
;
import
com.ruoyi.inventory.domain.vo.OutboundOrdersSummaryVO
;
import
com.ruoyi.inventory.domain.vo.OutboundTemplateVO
;
import
com.ruoyi.inventory.domain.vo.OutboundTemplateVO
;
import
com.ruoyi.inventory.service.IOutboundOrderLogService
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -39,6 +41,9 @@ public class OutboundOrderItemsController extends BaseController
...
@@ -39,6 +41,9 @@ public class OutboundOrderItemsController extends BaseController
{
{
@Autowired
@Autowired
private
IOutboundOrderItemsService
outboundOrderItemsService
;
private
IOutboundOrderItemsService
outboundOrderItemsService
;
@Autowired
private
IOutboundOrderLogService
outboundOrderLogService
;
/**
/**
* 查询出库单明细列表
* 查询出库单明细列表
...
@@ -55,6 +60,19 @@ public class OutboundOrderItemsController extends BaseController
...
@@ -55,6 +60,19 @@ public class OutboundOrderItemsController extends BaseController
* 查询出库单明细列表
* 查询出库单明细列表
*/
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:items:list')"
)
@PreAuthorize
(
"@ss.hasPermi('inventory:items:list')"
)
@GetMapping
(
"/listLog"
)
public
TableDataInfo
listLog
(
OutboundOrderItems
outboundOrderItems
)
{
startPage
();
OutboundOrderLog
outboundOrderLog
=
new
OutboundOrderLog
();
outboundOrderLog
.
setOrderId
(
outboundOrderItems
.
getOrderId
());
List
<
OutboundOrderLog
>
list
=
outboundOrderLogService
.
selectOutboundOrderLogList
(
outboundOrderLog
);
return
getDataTable
(
list
);
}
/**
* 查询出库单明细列表
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:items:list')"
)
@GetMapping
(
"/getStatistics"
)
@GetMapping
(
"/getStatistics"
)
public
TableDataInfo
getStatistics
(
OutboundOrdersSummaryVO
outboundOrderItems
)
public
TableDataInfo
getStatistics
(
OutboundOrdersSummaryVO
outboundOrderItems
)
{
{
...
@@ -146,4 +164,5 @@ public class OutboundOrderItemsController extends BaseController
...
@@ -146,4 +164,5 @@ public class OutboundOrderItemsController extends BaseController
return
toAjax
(
outboundOrderItemsService
.
deleteOutboundOrderItemsByIds
(
ids
));
return
toAjax
(
outboundOrderItemsService
.
deleteOutboundOrderItemsByIds
(
ids
));
}
}
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/MaterialsMapper.java
View file @
1f9d9564
...
@@ -4,6 +4,7 @@ import java.util.List;
...
@@ -4,6 +4,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
com.ruoyi.common.core.domain.entity.Materials
;
import
com.ruoyi.common.core.domain.entity.Materials
;
import
com.ruoyi.inventory.domain.OutboundOrderItems
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
...
@@ -41,6 +42,14 @@ public interface MaterialsMapper
...
@@ -41,6 +42,14 @@ public interface MaterialsMapper
public
List
<
Materials
>
selectMaterialsList
(
Materials
materials
);
public
List
<
Materials
>
selectMaterialsList
(
Materials
materials
);
/**
/**
* 查询物料列表
*
* @param materials 物料
* @return 物料集合
*/
public
List
<
Materials
>
selectMaterialsInventoryList
(
Materials
materials
);
/**
* 新增物料
* 新增物料
*
*
* @param materials 物料
* @param materials 物料
...
@@ -104,4 +113,6 @@ public interface MaterialsMapper
...
@@ -104,4 +113,6 @@ public interface MaterialsMapper
*/
*/
@MapKey
(
"sap_no"
)
@MapKey
(
"sap_no"
)
public
Map
<
String
,
Map
<
String
,
String
>>
selectMaterialIdAndSapMap
();
public
Map
<
String
,
Map
<
String
,
String
>>
selectMaterialIdAndSapMap
();
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IMaterialsService.java
View file @
1f9d9564
package
com
.
ruoyi
.
inventory
.
service
;
package
com
.
ruoyi
.
inventory
.
service
;
import
com.ruoyi.common.core.domain.entity.Materials
;
import
com.ruoyi.common.core.domain.entity.Materials
;
import
com.ruoyi.inventory.domain.OutboundOrderItems
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -30,6 +31,13 @@ public interface IMaterialsService
...
@@ -30,6 +31,13 @@ public interface IMaterialsService
public
List
<
Materials
>
selectMaterialsList
(
Materials
materials
);
public
List
<
Materials
>
selectMaterialsList
(
Materials
materials
);
/**
/**
* 查询物料列表
*
* @param materials 物料
* @return 物料集合
*/
public
List
<
Materials
>
ListMaterialsInventory
(
Materials
materials
);
/**
* 新增物料
* 新增物料
*
*
* @param materials 物料
* @param materials 物料
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
View file @
1f9d9564
...
@@ -55,6 +55,7 @@ public class InventoryServiceImpl implements IInventoryService
...
@@ -55,6 +55,7 @@ public class InventoryServiceImpl implements IInventoryService
return
inventoryMapper
.
selectInventoryById
(
id
);
return
inventoryMapper
.
selectInventoryById
(
id
);
}
}
/**
/**
* 查询库存列表
* 查询库存列表
*
*
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/MaterialsServiceImpl.java
View file @
1f9d9564
...
@@ -10,6 +10,7 @@ import com.ruoyi.common.exception.ServiceException;
...
@@ -10,6 +10,7 @@ import com.ruoyi.common.exception.ServiceException;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.inventory.domain.OutboundOrderItems
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.ruoyi.inventory.mapper.MaterialsMapper
;
import
com.ruoyi.inventory.mapper.MaterialsMapper
;
...
@@ -51,6 +52,11 @@ public class MaterialsServiceImpl implements IMaterialsService
...
@@ -51,6 +52,11 @@ public class MaterialsServiceImpl implements IMaterialsService
return
materialsMapper
.
selectMaterialsList
(
materials
);
return
materialsMapper
.
selectMaterialsList
(
materials
);
}
}
@Override
public
List
<
Materials
>
ListMaterialsInventory
(
Materials
materials
)
{
return
materialsMapper
.
selectMaterialsInventoryList
(
materials
);
}
/**
/**
* 新增物料
* 新增物料
*
*
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/MaterialsMapper.xml
View file @
1f9d9564
...
@@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"createUserCode"
column=
"create_user_code"
/>
<result
property=
"createUserCode"
column=
"create_user_code"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"updateUserCode"
column=
"update_user_code"
/>
<result
property=
"updateUserCode"
column=
"update_user_code"
/>
<result
property=
"stock"
column=
"stock"
/>
</resultMap>
</resultMap>
<sql
id=
"selectMaterialsVo"
>
<sql
id=
"selectMaterialsVo"
>
...
@@ -73,6 +74,73 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -73,6 +74,73 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by sort_no asc
order by sort_no asc
</select>
</select>
<select
id=
"selectMaterialsInventoryList"
parameterType=
"Materials"
resultMap=
"MaterialsResult"
>
select
m.id,
m.material_code,
m.material_name,
m.material_ename,
m.sap_no,
m.ts_code,
m.category_code,
m.hazard_id,
m.specification,
m.material_unit,
m.unit_weight,
m.package_weight,
m.total_weight,
m.volume,
m.shelf_life_days,
m.storage_temperature,
m.special_requirements,
m.is_batch_managed,
m.is_serial_managed,
m.min_stock_level,
m.max_stock_level,
IFNULL(i.quantity-locked_quantity, 0) as stock, -- 无库存时默认显示0
m.is_used,
m.is_active,
m.risk_level,
m.sort_no,
m.create_time,
m.create_user_code,
m.update_time,
m.update_user_code
from materials m
left join inventory i on m.id = i.material_id
<where>
m.is_used = 1
<if
test=
"materialCode != null and materialCode != ''"
>
and m.material_code like concat('%', #{materialCode}, '%')
</if>
<if
test=
"materialName != null and materialName != ''"
>
and m.material_name like concat('%', #{materialName}, '%')
</if>
<if
test=
"sapNo != null and sapNo != ''"
>
and m.sap_no like concat('%', #{sapNo}, '%')
</if>
<if
test=
"tsCode != null and tsCode != ''"
>
and m.ts_code like concat('%', #{tsCode}, '%')
</if>
<if
test=
"categoryCode != null and categoryCode != ''"
>
and m.category_code = #{categoryCode}
</if>
<if
test=
"hazardId != null and hazardId != ''"
>
and m.hazard_id like concat('%', #{hazardId}, '%')
</if>
<if
test=
"specification != null and specification != ''"
>
and m.specification like concat('%', #{specification}, '%')
</if>
<if
test=
"materialUnit != null and materialUnit != ''"
>
and m.material_unit like concat('%', #{materialUnit}, '%')
</if>
<if
test=
"unitWeight != null "
>
and m.unit_weight = #{unitWeight}
</if>
<if
test=
"packageWeight != null "
>
and m.package_weight = #{packageWeight}
</if>
<if
test=
"totalWeight != null "
>
and m.total_weight = #{totalWeight}
</if>
<if
test=
"volume != null "
>
and m.volume = #{volume}
</if>
<if
test=
"shelfLifeDays != null "
>
and m.shelf_life_days = #{shelfLifeDays}
</if>
<if
test=
"storageTemperature != null and storageTemperature != ''"
>
and m.storage_temperature like concat('%', #{storageTemperature}, '%')
</if>
<if
test=
"specialRequirements != null and specialRequirements != ''"
>
and m.special_requirements like concat('%', #{specialRequirements}, '%')
</if>
<if
test=
"isBatchManaged != null "
>
and m.is_batch_managed = #{isBatchManaged}
</if>
<if
test=
"isSerialManaged != null "
>
and m.is_serial_managed = #{isSerialManaged}
</if>
<if
test=
"minStockLevel != null "
>
and m.min_stock_level = #{minStockLevel}
</if>
<if
test=
"maxStockLevel != null "
>
and m.max_stock_level = #{maxStockLevel}
</if>
<if
test=
"isUsed != null "
>
and m.is_used = #{isUsed}
</if>
<if
test=
"isActive != null "
>
and m.is_active = #{isActive}
</if>
<if
test=
"riskLevel != null and riskLevel != ''"
>
and m.risk_level like concat('%', #{riskLevel}, '%')
</if>
<if
test=
"sortNo != null "
>
and m.sort_no = #{sortNo}
</if>
<if
test=
"createTime != null "
>
and m.create_time like concat('%', #{createTime}, '%')
</if>
<if
test=
"updateTime != null "
>
and m.update_time like concat('%', #{updateTime}, '%')
</if>
-- 可选:添加库存数量的查询条件(如果需要)
<if
test=
"stock != null "
>
and i.stock = #{stock}
</if>
</where>
order by stock desc
</select>
<select
id=
"selectMaterialsById"
parameterType=
"String"
resultMap=
"MaterialsResult"
>
<select
id=
"selectMaterialsById"
parameterType=
"String"
resultMap=
"MaterialsResult"
>
<include
refid=
"selectMaterialsVo"
/>
<include
refid=
"selectMaterialsVo"
/>
where id = #{id}
where id = #{id}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论