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
7555bfca
Commit
7555bfca
authored
Dec 15, 2025
by
zhangtw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入校验
parent
278338ea
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
83 行增加
和
34 行删除
+83
-34
ruoyi-admin-vue/src/views/inventory/materials/index.vue
+5
-0
ruoyi-admin-vue/src/views/inventory/materials/materialsSeletor.vue
+1
-1
ruoyi-admin-vue/src/views/inventory/report_view/inventory_detail.vue
+32
-2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/inventory/InboundOrdersController.java
+0
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InboundOrdersServiceImpl.java
+8
-6
ruoyi-inventory/src/main/resources/mapper/inventory/InboundOrdersMapper.xml
+30
-24
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
+2
-0
ruoyi-inventory/src/main/resources/mapper/inventory/MaterialsMapper.xml
+5
-1
没有找到文件。
ruoyi-admin-vue/src/views/inventory/materials/index.vue
View file @
7555bfca
...
...
@@ -144,6 +144,7 @@
<el-table-column
label=
"SAP物料号"
align=
"center"
prop=
"sapNo"
width=
"150"
/>
<!-- <el-table-column label="物料编码" align="center" prop="materialCode" width="120"/> -->
<el-table-column
label=
"物料名称"
align=
"center"
prop=
"materialName"
width=
"150"
/>
<el-table-column
label=
"物料英文名称"
align=
"center"
prop=
"materialEname"
width=
"150"
/>
<el-table-column
label=
"TS Code"
align=
"center"
prop=
"tsCode"
width=
"150"
/>
<el-table-column
label=
"物料分类"
align=
"center"
prop=
"categoryCode"
>
<
template
slot-scope=
"scope"
>
...
...
@@ -298,6 +299,9 @@
<el-form-item
label=
"物料名称"
prop=
"materialName"
>
<el-input
v-model=
"form.materialName"
placeholder=
"请输入物料名称"
/>
</el-form-item>
<el-form-item
label=
"物料英文名称"
prop=
"materialEname"
>
<el-input
v-model=
"form.materialEname"
placeholder=
"请输入物料英文名称"
/>
</el-form-item>
<el-form-item
label=
"物料分类"
prop=
"categoryCode"
>
<el-select
v-model=
"form.categoryCode"
placeholder=
"请选择物料分类"
clearable
>
<el-option
...
...
@@ -444,6 +448,7 @@ export default {
id
:
null
,
materialCode
:
null
,
materialName
:
null
,
materialEname
:
null
,
sapNo
:
null
,
tsCode
:
null
,
categoryCode
:
null
,
...
...
ruoyi-admin-vue/src/views/inventory/materials/materialsSeletor.vue
View file @
7555bfca
...
...
@@ -251,7 +251,7 @@ export default {
.
filter
(
item
=>
item
.
isUsed
!==
0
&&
item
.
isUsed
!==
'0'
)
.
map
(
item
=>
({
...
item
,
displayCategory
:
this
.
categoryMap
[
item
.
categoryCode
]
||
`
${
item
.
categoryCode
}
(未匹配分类)
`
displayCategory
:
this
.
categoryMap
[
item
.
categoryCode
]
||
`
未匹配分类
`
}));
this
.
total
=
response
.
total
;
}).
finally
(()
=>
{
...
...
ruoyi-admin-vue/src/views/inventory/report_view/inventory_detail.vue
View file @
7555bfca
...
...
@@ -138,7 +138,15 @@
<el-table-column
label=
"物料名称"
align=
"center"
prop=
"materialName"
width=
"150"
/>
<el-table-column
label=
"SAP物料号"
align=
"center"
prop=
"sapNo"
width=
"120"
/>
<el-table-column
label=
"TS Code"
align=
"center"
prop=
"tsCode"
width=
"120"
/>
<el-table-column
label=
"危险类别"
align=
"center"
prop=
"hazard"
width=
"120"
/>
<el-table-column
label=
"危险类别"
align=
"center"
prop=
"hazardId"
width=
"120"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"getDictListClass('danger_type',scope.row.hazardId)"
size=
"small"
>
{{
getDictLabel
(
'danger_type'
,
scope
.
row
.
hazardId
)
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"规格型号"
align=
"center"
prop=
"specification"
width=
"120"
/>
<el-table-column
label=
"计量单位"
align=
"center"
prop=
"materialUnit"
width=
"120"
/>
<el-table-column
label=
"单位重量"
align=
"center"
prop=
"unitWeight"
width=
"120"
>
...
...
@@ -232,7 +240,15 @@
<el-table-column
label=
"物料名称"
align=
"center"
prop=
"materialName"
width=
"150"
/>
<el-table-column
label=
"SAP物料号"
align=
"center"
prop=
"sapNo"
width=
"120"
/>
<el-table-column
label=
"TS Code"
align=
"center"
prop=
"tsCode"
width=
"120"
/>
<el-table-column
label=
"危险类别"
align=
"center"
prop=
"hazard"
width=
"120"
/>
<el-table-column
label=
"危险类别"
align=
"center"
prop=
"hazardId"
width=
"120"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"getDictListClass('danger_type',scope.row.hazardId)"
size=
"small"
>
{{
getDictLabel
(
'danger_type'
,
scope
.
row
.
hazardId
)
}}
</el-tag>
</
template
>
</el-table-column>
<!-- <el-table-column label="规格型号" align="center" prop="specification" width="120" /> -->
<!-- <el-table-column label="入库单号" align="center" prop="orderId" width="150" /> -->
<el-table-column
label=
"批次"
align=
"center"
prop=
"batchId"
width=
"120"
/>
...
...
@@ -265,6 +281,7 @@ import ImportExcel from "@/components/ImportExcel"
export
default
{
name
:
"InventoryDetail"
,
dicts
:
[
'danger_type'
],
components
:
{
RightToolbar
,
PageTitle
,
...
...
@@ -333,6 +350,19 @@ export default {
this
.
getList
()
},
methods
:
{
//从表格中的值当作键获取字典lebel
getDictLabel
(
dictType
,
value
){
if
(
!
value
||
!
this
.
dict
?.
type
?.[
dictType
])
return
'-'
const
dictItem
=
this
.
dict
.
type
[
dictType
].
find
(
item
=>
item
.
value
===
value
)
return
dictItem
?.
label
||
'-'
},
//从表格中的值当作键获取字典listClass
getDictListClass
(
dictType
,
value
){
if
(
!
value
||
!
this
.
dict
?.
type
?.[
dictType
])
return
'-'
const
dictItem
=
this
.
dict
.
type
[
dictType
].
find
(
item
=>
item
.
value
===
value
)
return
dictItem
?.
label
||
'-'
},
/** 查询库存明细列表 */
getList
()
{
this
.
loading
=
true
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/inventory/InboundOrdersController.java
View file @
7555bfca
差异被折叠。
点击展开。
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InboundOrdersServiceImpl.java
View file @
7555bfca
...
...
@@ -6,6 +6,7 @@ import java.time.format.DateTimeFormatter;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.ruoyi.common.config.WarehouseConfig
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.inventory.domain.*
;
import
com.ruoyi.inventory.domain.vo.InboundMaterialTotalVO
;
...
...
@@ -408,10 +409,11 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
}
String
warehouseId
=
warehouseNameIdMap
.
get
(
warehouseName
);
if
(
StringUtils
.
isBlank
(
warehouseId
))
{
log
.
info
(
"仓库【"
+
warehouseName
+
"】不存在,可能为成品入库"
);
log
.
info
(
"仓库【"
+
warehouseName
+
"】不存在,可能暂无仓库或为成品入库,已使用默认仓库"
);
itemDO
.
setWarehouseId
(
WarehouseConfig
.
DEFAULT_WAREHOUSE_ID
);
}
else
{
itemDO
.
setWarehouseId
(
warehouseId
);
}
itemDO
.
setWarehouseId
(
warehouseId
);
// 2. 库位名称转ID
String
locationName
=
""
;
try
{
...
...
@@ -426,10 +428,10 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
String
locationId
=
storageLocationNameIdMap
.
get
(
locationName
);
if
(
StringUtils
.
isBlank
(
locationId
))
{
log
.
info
(
"库位【"
+
locationName
+
"】不存在,可能为成品入库"
);
log
.
info
(
"库位【"
+
locationName
+
"】不存在,可能暂无库位或为成品入库"
);
}
else
{
itemDO
.
setLocationId
(
locationId
);
}
itemDO
.
setLocationId
(
locationId
);
itemDOList
.
add
(
itemDO
);
}
catch
(
Exception
e
)
{
// 单个明细失败:仅统计,不影响整单
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/InboundOrdersMapper.xml
View file @
7555bfca
...
...
@@ -231,8 +231,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</insert>
<!-- 统计入库次数-->
<select
id=
"countInboundOrders"
resultType=
"int"
parameterType=
"String"
>
select count(id)
...
...
@@ -247,29 +245,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
column=
"total_money"
property=
"totalMoney"
jdbcType=
"DECIMAL"
/>
</resultMap>
<select
id=
"countInboundMaterialQuantity"
resultMap=
"InboundMaterialTotalResultMap"
parameterType=
"String"
>
select m.material_name,
COALESCE(SUM(ioi.actual_quantity), 0) as total_quantity
from materials as m
left join inbound_order_items as ioi
on m.id = ioi.material_id
left join inbound_orders as io
on io.id = ioi.inbound_order_id
and io.order_status = 2
where m.is_used = 1 and m.is_active = 1
group by m.id
order by total_quantity
SELECT t.material_name, t.total_quantity
FROM (
SELECT m.material_name,
COALESCE(SUM(ioi.actual_quantity), 0) as total_quantity
FROM materials as m
LEFT JOIN inbound_order_items as ioi ON m.id = ioi.material_id
LEFT JOIN inbound_orders as io ON io.id = ioi.inbound_order_id AND io.order_status = 2
WHERE m.is_used = 1 AND m.is_active = 1
GROUP BY m.id, m.material_name
ORDER BY total_quantity DESC
LIMIT 10
) t
ORDER BY t.total_quantity ASC;
</select>
<select
id=
"countInboundMaterialMoney"
resultMap=
"InboundMaterialTotalResultMap"
parameterType=
"String"
>
select m.material_name,
COALESCE(sum(ioi.actual_quantity * ioi.unit_price), 0) as total_money
from materials as m
left join inbound_order_items as ioi
on m.id = ioi.material_id
left join inbound_orders as io
on io.id = ioi.inbound_order_id
and io.order_status = 2
where m.is_used = 1 and m.is_active = 1
group by m.id
order by total_money
select t.material_name,t.total_money
from(
select m.material_name,
COALESCE(sum(ioi.actual_quantity * ioi.unit_price), 0) as total_money
from materials as m
left join inbound_order_items as ioi
on m.id = ioi.material_id
left join inbound_orders as io
on io.id = ioi.inbound_order_id
and io.order_status = 2
where m.is_used = 1 and m.is_active = 1
group by m.id
order by total_money desc
limit 10
) t
order by total_money asc
</select>
</mapper>
\ No newline at end of file
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
View file @
7555bfca
...
...
@@ -10,6 +10,7 @@
<result
property=
"orderId"
column=
"order_id"
/>
<result
property=
"materialId"
column=
"material_id"
/>
<result
property=
"materialName"
column=
"material_name"
/>
<result
property=
"hazardId"
column=
"hazard_id"
/>
<result
property=
"batchId"
column=
"batch_id"
/>
<result
property=
"warehousesCode"
column=
"warehouses_code"
/>
<result
property=
"warehousesName"
column=
"warehouses_name"
/>
...
...
@@ -401,6 +402,7 @@
i.order_id,
i.material_id,
m.material_name,
m.hazard_id,
i.batch_id,
i.location_id,
sl.location_name,
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/MaterialsMapper.xml
View file @
7555bfca
...
...
@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"id"
column=
"id"
/>
<result
property=
"materialCode"
column=
"material_code"
/>
<result
property=
"materialName"
column=
"material_name"
/>
<result
property=
"materialEname"
column=
"material_ename"
/>
<result
property=
"sapNo"
column=
"sap_no"
/>
<result
property=
"tsCode"
column=
"ts_code"
/>
<result
property=
"categoryCode"
column=
"category_code"
/>
...
...
@@ -36,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql
id=
"selectMaterialsVo"
>
select id, material_code, material_name, sap_no, ts_code, category_code, hazard_id, specification, material_unit, unit_weight, package_weight, total_weight, volume, shelf_life_days, storage_temperature, special_requirements, is_batch_managed, is_serial_managed, min_stock_level, max_stock_level, is_used, is_active, risk_level, sort_no, create_time, create_user_code, update_time, update_user_code from materials
select id, material_code, material_name,
material_ename,
sap_no, ts_code, category_code, hazard_id, specification, material_unit, unit_weight, package_weight, total_weight, volume, shelf_life_days, storage_temperature, special_requirements, is_batch_managed, is_serial_managed, min_stock_level, max_stock_level, is_used, is_active, risk_level, sort_no, create_time, create_user_code, update_time, update_user_code from materials
</sql>
<select
id=
"selectMaterialsList"
parameterType=
"Materials"
resultMap=
"MaterialsResult"
>
...
...
@@ -101,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"id != null"
>
id,
</if>
<if
test=
"materialCode != null"
>
material_code,
</if>
<if
test=
"materialName != null"
>
material_name,
</if>
<if
test=
"materialEname != null"
>
material_ename,
</if>
<if
test=
"sapNo != null"
>
sap_no,
</if>
<if
test=
"tsCode != null"
>
ts_code,
</if>
<if
test=
"categoryCode != null"
>
category_code,
</if>
...
...
@@ -131,6 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"id != null"
>
#{id},
</if>
<if
test=
"materialCode != null"
>
#{materialCode},
</if>
<if
test=
"materialName != null"
>
#{materialName},
</if>
<if
test=
"materialEname != null"
>
#{materialEname},
</if>
<if
test=
"sapNo != null"
>
#{sapNo},
</if>
<if
test=
"tsCode != null"
>
#{tsCode},
</if>
<if
test=
"categoryCode != null"
>
#{categoryCode},
</if>
...
...
@@ -164,6 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"materialCode != null"
>
material_code = #{materialCode},
</if>
<if
test=
"materialName != null"
>
material_name = #{materialName},
</if>
<if
test=
"materialEname != null"
>
material_ename = #{materialEname},
</if>
<if
test=
"sapNo != null"
>
sap_no = #{sapNo},
</if>
<if
test=
"tsCode != null"
>
ts_code = #{tsCode},
</if>
<if
test=
"categoryCode != null"
>
category_code = #{categoryCode},
</if>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论