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
c30de553
Commit
c30de553
authored
Dec 09, 2025
by
zhangtw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
入库物料明细统计
入库明细显示物料名bug
parent
36733eb3
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
285 行增加
和
4 行删除
+285
-4
ruoyi-admin-vue/src/api/inventory/inbound_items.js
+8
-0
ruoyi-admin-vue/src/views/inventory/inbound/details.vue
+0
-0
ruoyi-admin-vue/src/views/inventory/inbound/index.vue
+5
-0
ruoyi-admin-vue/src/views/inventory/inbound_items/index.vue
+7
-4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/inventory/InboundOrderItemsController.java
+13
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/vo/InboundDetailsVO.java
+170
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InboundOrderItemsMapper.java
+7
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInboundOrderItemsService.java
+7
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InboundOrderItemsServiceImpl.java
+6
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InboundOrdersServiceImpl.java
+1
-0
ruoyi-inventory/src/main/resources/mapper/inventory/InboundOrderItemsMapper.xml
+61
-0
没有找到文件。
ruoyi-admin-vue/src/api/inventory/inbound_items.js
View file @
c30de553
...
...
@@ -49,3 +49,11 @@ export function delInbound_items(id) {
method
:
'delete'
})
}
// 统计入库单明细
export
function
inbound_details
(){
return
request
({
url
:
'/inventory/inbound_items/details'
,
method
:
'get'
})
}
ruoyi-admin-vue/src/views/inventory/inbound/details.vue
0 → 100644
View file @
c30de553
差异被折叠。
点击展开。
ruoyi-admin-vue/src/views/inventory/inbound/index.vue
View file @
c30de553
...
...
@@ -615,6 +615,8 @@ export default {
})
this
.
open
=
true
this
.
title
=
"修改入库单"
}).
finally
(()
=>
{
this
.
inboundOrderId
=
null
})
},
/** 查看详情 */
...
...
@@ -627,6 +629,8 @@ export default {
this
.
detailForm
=
response
.
data
this
.
detailForm
.
inboundOrderId
=
id
this
.
detailOpen
=
true
}).
finally
(()
=>
{
this
.
detailForm
.
inboundOrderId
=
null
})
},
// 打开物料选择弹窗
...
...
@@ -767,6 +771,7 @@ export default {
})
}
else
{
addInbound
(
submitData
).
then
(
response
=>
{
console
.
log
(
submitData
)
this
.
$message
.
success
(
"新增成功"
)
this
.
open
=
false
this
.
getList
()
...
...
ruoyi-admin-vue/src/views/inventory/inbound_items/index.vue
View file @
c30de553
...
...
@@ -302,7 +302,7 @@ export default {
},
{
prop
:
'plannedQuantity'
,
label
:
'计划数量'
,
width
:
'100'
,
type
:
'number'
,
editable
:
true
},
{
prop
:
'actualQuantity'
,
label
:
'实际数量'
,
width
:
'100'
,
type
:
'number'
,
editable
:
true
},
{
prop
:
'plannedPackages'
,
label
:
'计划件数'
,
width
:
'100'
,
type
:
'number'
,
editable
:
true
},
//
{ prop: 'plannedPackages', label: '计划件数', width: '100', type: 'number', editable: true },
{
prop
:
'actualPackages'
,
label
:
'实际件数'
,
width
:
'100'
,
type
:
'number'
,
editable
:
true
},
{
prop
:
'divisor'
,
label
:
'约数'
,
width
:
'100'
,
type
:
'number'
,
editable
:
true
},
{
prop
:
'labelColor'
,
label
:
'标签颜色'
,
width
:
'100'
,
type
:
'select'
,
editable
:
true
},
...
...
@@ -320,6 +320,8 @@ export default {
},
data
()
{
return
{
showSearch
:
true
,
loading
:
false
,
selectedRows
:
[],
...
...
@@ -389,7 +391,6 @@ export default {
inboundOrderId
:
{
immediate
:
true
,
handler
(
newVal
)
{
console
.
log
(
'inboundOrderId 变化:'
,
newVal
)
// 核心:过滤 null/空值,只在有效时执行逻辑
if
(
!
newVal
)
return
this
.
loadRelatedData
(
newVal
)
...
...
@@ -412,9 +413,7 @@ export default {
methods
:
{
// 根据字典类型和值,获取对应的listClass(标签样式)
getDictListClass
(
dictType
,
value
)
{
console
.
log
(
value
)
const
dictList
=
this
.
dict
.
type
[
dictType
]
||
[]
console
.
log
(
dictList
)
if
(
!
value
)
return
'info'
const
dictItem
=
dictList
.
find
(
item
=>
item
.
value
===
value
+
""
)
...
...
@@ -445,7 +444,9 @@ export default {
this
.
queryParams
.
inboundOrderId
=
inboundOrderId
listInbound_itemsAndMname
(
this
.
queryParams
).
then
(
response
=>
{
this
.
displayData
=
response
.
rows
.
map
(
item
=>
({
...
item
,
materialName
:
item
.
materialName
,
editable
:
false
,
tempId
:
item
.
id
||
Date
.
now
()
+
Math
.
random
()
}))
...
...
@@ -454,6 +455,8 @@ export default {
this
.
loading
=
false
}).
catch
(()
=>
{
this
.
loading
=
false
}).
finally
(()
=>
{
})
},
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/inventory/InboundOrderItemsController.java
View file @
c30de553
...
...
@@ -5,6 +5,7 @@ import java.util.UUID;
import
javax.servlet.http.HttpServletResponse
;
import
com.ruoyi.inventory.domain.InboundOrderItems
;
import
com.ruoyi.inventory.domain.vo.InboundDetailsVO
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -131,4 +132,16 @@ public class InboundOrderItemsController extends BaseController
String
message
=
inboundOrderItemsService
.
importInboundOrderItems
(
inboundOrderItems
,
updateSupport
,
operName
);
return
success
(
message
);
}
/**
* 统计入库单物料明细
*/
@PreAuthorize
(
"@ss.hasPermi('inventory:inbound_items:list')"
)
@GetMapping
(
"/details"
)
public
TableDataInfo
itemDetails
(
InboundDetailsVO
inboundDetailsVO
)
throws
Exception
{
startPage
();
List
<
InboundDetailsVO
>
list
=
inboundOrderItemsService
.
selectInboundDetailsVOBySapNo
();
return
getDataTable
(
list
);
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/vo/InboundDetailsVO.java
0 → 100644
View file @
c30de553
package
com
.
ruoyi
.
inventory
.
domain
.
vo
;
import
com.ruoyi.common.annotation.Excel
;
import
java.util.Date
;
public
class
InboundDetailsVO
{
private
static
final
long
serialVersionUID
=
1L
;
@Excel
(
name
=
"物料sapNo"
)
private
String
materialId
;
@Excel
(
name
=
"物料名"
)
private
String
materialName
;
@Excel
(
name
=
"入库单号"
)
private
String
orderId
;
@Excel
(
name
=
"批次ID"
)
private
String
batchId
;
@Excel
(
name
=
"仓库ID"
)
private
String
warehouseId
;
@Excel
(
name
=
"库位ID"
)
private
String
locationId
;
@Excel
(
name
=
"入库数量"
)
private
Long
actualQuantity
;
@Excel
(
name
=
"件数"
)
private
Long
actualPackages
;
@Excel
(
name
=
"标签颜色"
)
private
String
labelColor
;
@Excel
(
name
=
"单价"
)
private
Double
unitPrice
;
@Excel
(
name
=
"入库物料总价"
)
private
Double
totalPrice
;
@Excel
(
name
=
"备注"
)
private
String
remark
;
@Excel
(
name
=
"入库时间"
)
private
Date
inboundDate
;
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
getOrderId
()
{
return
orderId
;
}
public
void
setOrderId
(
String
orderId
)
{
this
.
orderId
=
orderId
;
}
public
String
getBatchId
()
{
return
batchId
;
}
public
void
setBatchId
(
String
batchId
)
{
this
.
batchId
=
batchId
;
}
public
String
getWarehouseId
()
{
return
warehouseId
;
}
public
void
setWarehouseId
(
String
warehouseId
)
{
this
.
warehouseId
=
warehouseId
;
}
public
String
getLocationId
()
{
return
locationId
;
}
public
void
setLocationId
(
String
locationId
)
{
this
.
locationId
=
locationId
;
}
public
Long
getActualQuantity
()
{
return
actualQuantity
;
}
public
void
setActualQuantity
(
Long
actualQuantity
)
{
this
.
actualQuantity
=
actualQuantity
;
}
public
Long
getActualPackages
()
{
return
actualPackages
;
}
public
void
setActualPackages
(
Long
actualPackages
)
{
this
.
actualPackages
=
actualPackages
;
}
public
String
getLabelColor
()
{
return
labelColor
;
}
public
void
setLabelColor
(
String
labelColor
)
{
this
.
labelColor
=
labelColor
;
}
public
Double
getUnitPrice
()
{
return
unitPrice
;
}
public
void
setUnitPrice
(
Double
unitPrice
)
{
this
.
unitPrice
=
unitPrice
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
Double
getTotalPrice
()
{
return
totalPrice
;
}
public
void
setTotalPrice
(
Double
totalPrice
)
{
this
.
totalPrice
=
totalPrice
;
}
public
Date
getInboundDate
()
{
return
inboundDate
;
}
public
void
setInboundDate
(
Date
inboundDate
)
{
this
.
inboundDate
=
inboundDate
;
}
@Override
public
String
toString
()
{
return
"InboundDetailsVO{"
+
"sapNo='"
+
materialId
+
'\''
+
", materialName='"
+
materialName
+
'\''
+
", orderId='"
+
orderId
+
'\''
+
", batchId='"
+
batchId
+
'\''
+
", warehouseId='"
+
warehouseId
+
'\''
+
", locationId='"
+
locationId
+
'\''
+
", actualQuantity="
+
actualQuantity
+
", actualPackages="
+
actualPackages
+
", labelColor='"
+
labelColor
+
'\''
+
", unitPrice="
+
unitPrice
+
", totalPrice="
+
totalPrice
+
", remark='"
+
remark
+
'\''
+
", inboundDate="
+
inboundDate
+
'}'
;
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InboundOrderItemsMapper.java
View file @
c30de553
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.inventory.mapper;
import
java.util.List
;
import
com.ruoyi.inventory.domain.InboundOrderItems
;
import
com.ruoyi.inventory.domain.vo.InboundDetailsVO
;
/**
* 入库单明细Mapper接口
...
...
@@ -66,4 +67,10 @@ public interface InboundOrderItemsMapper
* @return 结果
*/
public
int
deleteInboundOrderItemsByIds
(
String
[]
ids
);
/**
* 统计入库单明细
* @return 结果
*/
public
List
<
InboundDetailsVO
>
selectInboundDetailsVOBySapNo
();
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInboundOrderItemsService.java
View file @
c30de553
...
...
@@ -4,6 +4,7 @@ import java.util.List;
import
com.ruoyi.common.core.domain.entity.Materials
;
import
com.ruoyi.inventory.domain.InboundOrderItems
;
import
com.ruoyi.inventory.domain.vo.InboundDetailsVO
;
/**
* 入库单明细Service接口
...
...
@@ -68,4 +69,10 @@ public interface IInboundOrderItemsService
* @return 结果
*/
public
String
importInboundOrderItems
(
List
<
InboundOrderItems
>
inboundOrderItems
,
Boolean
isUpdateSupport
,
String
operName
);
/**
* 统计入库单明细
* @return 结果
*/
public
List
<
InboundDetailsVO
>
selectInboundDetailsVOBySapNo
();
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InboundOrderItemsServiceImpl.java
View file @
c30de553
...
...
@@ -10,6 +10,7 @@ import com.ruoyi.common.exception.ServiceException;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.inventory.domain.vo.InboundDetailsVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.ruoyi.inventory.mapper.InboundOrderItemsMapper
;
...
...
@@ -173,4 +174,9 @@ public class InboundOrderItemsServiceImpl implements IInboundOrderItemsService
}
return
successMsg
.
toString
();
}
@Override
public
List
<
InboundDetailsVO
>
selectInboundDetailsVOBySapNo
()
{
return
inboundOrderItemsMapper
.
selectInboundDetailsVOBySapNo
();
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InboundOrdersServiceImpl.java
View file @
c30de553
...
...
@@ -240,6 +240,7 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
itemDO
.
setId
(
UUID
.
randomUUID
().
toString
());
itemDO
.
setMaterialId
(
vo
.
getSapNo
());
itemDO
.
setOrderId
(
orderId
);
// 关联入库单号
itemDO
.
setBatchId
(
mainDO
.
getBatchId
());
itemDO
.
setInboundOrderId
(
mainDO
.
getId
());
// 关联主表ID(核心!)
itemDO
.
setCreateBy
(
operId
);
itemDO
.
setCreateTime
(
now
);
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/InboundOrderItemsMapper.xml
View file @
c30de553
...
...
@@ -299,4 +299,64 @@
<result
property=
"inboundOrderId"
column=
"inbound_order_id"
/>
<result
property=
"materialName"
column=
"material_name"
/>
</resultMap>
<resultMap
id=
"InboundDetailsResultMap"
type=
"com.ruoyi.inventory.domain.vo.InboundDetailsVO"
>
<!-- 基础字段映射 -->
<result
column=
"material_id"
property=
"materialId"
jdbcType=
"VARCHAR"
/>
<result
column=
"material_name"
property=
"materialName"
jdbcType=
"VARCHAR"
/>
<result
column=
"order_id"
property=
"orderId"
jdbcType=
"VARCHAR"
/>
<result
column=
"batch_id"
property=
"batchId"
jdbcType=
"VARCHAR"
/>
<result
column=
"warehouse_id"
property=
"warehouseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"location_id"
property=
"locationId"
jdbcType=
"VARCHAR"
/>
<!-- 数值型字段 -->
<result
column=
"actual_quantity"
property=
"actualQuantity"
jdbcType=
"BIGINT"
/>
<result
column=
"actual_packages"
property=
"actualPackages"
jdbcType=
"BIGINT"
/>
<!-- 字符串/枚举类字段 -->
<result
column=
"label_color"
property=
"labelColor"
jdbcType=
"VARCHAR"
/>
<!-- 金额字段 -->
<result
column=
"unit_price"
property=
"unitPrice"
jdbcType=
"DOUBLE"
/>
<result
column=
"total_price"
property=
"totalPrice"
jdbcType=
"DOUBLE"
/>
<!-- 备注字段 -->
<result
column=
"remark"
property=
"remark"
jdbcType=
"VARCHAR"
/>
<!-- 日期字段(指定日期格式化) -->
<result
column=
"inbound_date"
property=
"inboundDate"
/>
</resultMap>
<select
id=
"selectInboundDetailsVOBySapNo"
resultMap=
"InboundDetailsResultMap"
>
SELECT
ioi.material_id,
ms.material_name,
ioi.order_id,
ioi.batch_id,
ioi.warehouse_id,
ioi.location_id,
SUM(ioi.actual_quantity) AS actual_quantity,
SUM(ioi.actual_packages) AS actual_packages,
ioi.label_color,
ioi.unit_price,
SUM(ioi.unit_price * ioi.actual_quantity) AS total_price,
ioi.remark,
io.inbound_date
FROM inbound_orders io
INNER JOIN inbound_order_items ioi ON io.id = ioi.inbound_order_id
INNER JOIN materials ms ON ms.sap_no = ioi.material_id
WHERE io.order_status = 2
GROUP BY
ioi.material_id,
ioi.batch_id,
ioi.warehouse_id,
ioi.location_id,
ms.material_name,
ioi.order_id,
ioi.label_color,
ioi.unit_price,
ioi.remark,
io.inbound_date
order by ioi.order_id asc,ioi.material_id asc
</select>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论