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
c7cf6243
Commit
c7cf6243
authored
Dec 16, 2025
by
yubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组件双击 去选框 弹窗修改高度 物料根据库存排序反显 列表id修改
parent
278338ea
全部展开
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
196 行增加
和
47 行删除
+196
-47
ruoyi-admin-vue/src/components/materialsSeletor.vue
+82
-2
ruoyi-admin-vue/src/views/inventory/locations/index.vue
+12
-12
ruoyi-admin-vue/src/views/inventory/orders/OutboundOrderFormWithItems.vue
+10
-15
ruoyi-admin/src/main/resources/application-druid.yml
+1
-1
ruoyi-common/src/main/java/com/ruoyi/common/config/WarehouseConfig.java
+2
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/OutboundOrderItems.java
+2
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/OutboundOrderItemsMapper.java
+6
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
+27
-15
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrdersServiceImpl.java
+0
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StorageLocationsServiceImpl.java
+1
-0
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
+14
-0
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrderItemsMapper.xml
+39
-0
没有找到文件。
ruoyi-admin-vue/src/components/materialsSeletor.vue
View file @
c7cf6243
...
...
@@ -56,6 +56,7 @@
</el-form-item>
</el-form>
<div
class=
"table-container"
style=
"flex: 1; min-height: 400px; max-height: 600px; overflow: auto; margin: 10px 0;"
>
<!-- 物料表格(恢复所有字段显示) -->
<el-table
ref=
"materialTable"
...
...
@@ -67,11 +68,14 @@
@
row-click=
"handleRowClick"
:select-on-indeterminate=
"false"
@
select=
"handleTableSelect"
@
row-dblclick=
"handleRowDblClick"
>
<!-- 单选模式下隐藏选择框 -->
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
v-if=
"multiple"
/>
<el-table-column
type=
"index"
label=
"序号"
align=
"center"
/>
<el-table-column
label=
"SAP物料号"
align=
"center"
prop=
"sapNo"
/>
...
...
@@ -79,7 +83,7 @@
<el-table-column
label=
"TS Code"
align=
"center"
prop=
"tsCode"
/>
<el-table-column
label=
"物料分类"
align=
"center"
prop=
"categoryCode"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
displayCategory
||
categoryMap
[
scope
.
row
.
categoryCode
]
||
scope
.
row
.
categoryCode
||
'-'
}}
{{
scope
.
row
.
displayCategory
}}
</
template
>
</el-table-column>
<el-table-column
label=
"规格型号"
align=
"center"
prop=
"specification"
/>
...
...
@@ -92,6 +96,7 @@
</
template
>
</el-table-column>
</el-table>
</div>
<!-- 分页 -->
<pagination
...
...
@@ -221,6 +226,55 @@ export default {
this
.
getList
()
},
methods
:
{
// 新增:双击行事件处理
handleRowDblClick
(
row
)
{
if
(
this
.
isSelecting
||
!
this
.
$refs
.
materialTable
)
return
this
.
isSelecting
=
true
try
{
// 单选模式下双击直接选择并关闭组件
if
(
!
this
.
multiple
)
{
// 选中当前行
this
.
$refs
.
materialTable
.
clearSelection
()
this
.
$refs
.
materialTable
.
toggleRowSelection
(
row
,
true
)
this
.
singleSelectedId
=
row
.
id
this
.
selectedRows
=
[
row
]
// 构造返回数据
const
selectedData
=
{
id
:
row
.
id
,
sapNo
:
row
.
sapNo
,
materialName
:
row
.
materialName
,
tsCode
:
row
.
tsCode
,
categoryCode
:
row
.
categoryCode
,
categoryName
:
this
.
categoryMap
[
row
.
categoryCode
]
||
row
.
categoryCode
,
specification
:
row
.
specification
,
materialUnit
:
row
.
materialUnit
,
isBatchManaged
:
row
.
isBatchManaged
}
// 触发事件
this
.
$emit
(
'input'
,
row
.
id
)
this
.
$emit
(
'change'
,
selectedData
)
this
.
$emit
(
'selection-change'
,
{
materialIds
:
[
row
.
id
],
materials
:
[
selectedData
],
names
:
[
row
.
materialName
],
categoryIds
:
[
row
.
categoryCode
||
''
]
})
// 触发关闭事件(需要父组件监听此事件并关闭弹窗)
this
.
$emit
(
'confirm'
,
selectedData
)
this
.
$emit
(
'close'
)
}
else
{
// 多选模式下双击仅切换选择状态
this
.
$refs
.
materialTable
.
toggleRowSelection
(
row
)
}
}
finally
{
this
.
isSelecting
=
false
}
},
// 恢复分类列表加载(分类名称映射)
async
getCategoryList
()
{
try
{
...
...
@@ -246,6 +300,7 @@ export default {
console
.
error
(
'获取分类列表失败:'
,
error
)
}
},
handleValueChange
(
val
)
{
if
(
this
.
isSelecting
)
return
...
...
@@ -276,6 +331,7 @@ export default {
this
.
handleValueSync
()
}
},
async
getCategoryTreeData
()
{
this
.
loadingTree
=
true
try
{
...
...
@@ -291,6 +347,7 @@ export default {
this
.
loadingTree
=
false
}
},
buildTreeData
(
list
,
parentId
=
null
)
{
return
list
.
filter
(
item
=>
parentId
===
null
...
...
@@ -306,6 +363,7 @@ export default {
:
undefined
}))
},
buildCategoryCodeToSidMap
(
treeData
)
{
treeData
.
forEach
(
node
=>
{
if
(
node
.
categoryCode
)
{
...
...
@@ -320,6 +378,7 @@ export default {
}
})
},
selectCategoryNodes
(
categoryCodes
)
{
if
(
!
this
.
$refs
.
treeComponent
||
!
this
.
$refs
.
treeComponent
.
$refs
.
tree
)
return
const
tree
=
this
.
$refs
.
treeComponent
.
$refs
.
tree
...
...
@@ -334,6 +393,7 @@ export default {
}
})
},
handleTreeClick
(
data
)
{
this
.
currentNodeId
=
data
.
sid
this
.
queryParams
.
categoryCode
=
data
.
categoryCode
...
...
@@ -341,13 +401,14 @@ export default {
this
.
queryParams
.
pageNum
=
1
this
.
getList
()
},
getList
()
{
this
.
loading
=
true
listMaterials
(
this
.
queryParams
).
then
(
response
=>
{
// 恢复所有字段映射(显示用)
this
.
materialsList
=
(
response
.
rows
||
[]).
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
||
0
this
.
$nextTick
(()
=>
{
...
...
@@ -361,6 +422,7 @@ export default {
this
.
loading
=
false
})
},
handleQuery
()
{
// 恢复分类名称查询逻辑
const
inputName
=
this
.
queryParams
.
categoryNameInput
...
...
@@ -380,6 +442,7 @@ export default {
this
.
queryParams
.
pageNum
=
1
this
.
getList
()
},
resetQuery
()
{
// 恢复所有查询参数重置
this
.
queryParams
=
{
...
...
@@ -399,6 +462,7 @@ export default {
this
.
clearSelection
()
this
.
getList
()
},
// 核心:基于 ID 的选择事件(保留所有字段返回)
handleSelectionChange
(
selection
)
{
if
(
this
.
isSelecting
||
!
this
.
$refs
.
materialTable
)
return
...
...
@@ -454,6 +518,7 @@ export default {
this
.
isSelecting
=
false
}
},
// 单选模式下的选择事件(纯 ID 逻辑,保留字段返回)
handleTableSelect
(
selection
,
row
)
{
if
(
this
.
isSelecting
||
this
.
multiple
)
return
...
...
@@ -502,6 +567,7 @@ export default {
this
.
isSelecting
=
false
}
},
// 行点击事件(纯 ID 逻辑,保留字段返回)
handleRowClick
(
row
)
{
if
(
this
.
isSelecting
||
!
this
.
$refs
.
materialTable
)
return
...
...
@@ -555,6 +621,7 @@ export default {
this
.
isSelecting
=
false
}
},
// 清空选择(纯 ID 逻辑)
clearSelection
()
{
if
(
this
.
isSelecting
||
!
this
.
$refs
.
materialTable
)
return
...
...
@@ -576,6 +643,7 @@ export default {
this
.
isSelecting
=
false
}
},
// 核心:基于 ID 的反显逻辑(保留所有字段显示)
handleValueSync
(
isRetry
=
false
)
{
if
(
this
.
loading
||
this
.
isSelecting
||
!
this
.
$refs
.
materialTable
)
return
...
...
@@ -646,6 +714,7 @@ export default {
this
.
isRetrySync
=
false
}
},
// 外部设置选中 ID 的方法
setSelectedIds
(
ids
)
{
if
(
this
.
isSelecting
)
return
...
...
@@ -665,6 +734,7 @@ export default {
this
.
isSelecting
=
false
}
},
// 获取选中物料(返回完整字段,核心为ID)
getSelectedMaterials
()
{
if
(
this
.
multiple
)
{
...
...
@@ -693,6 +763,7 @@ export default {
}
:
null
}
},
// 单选模式下设置选中 ID
setSingleSelection
(
id
)
{
if
(
this
.
isSelecting
||
this
.
multiple
)
return
...
...
@@ -758,9 +829,17 @@ export default {
}
/
deep
/
.el-table--enable-row-hover
.el-table__body
tr
:hover
>
td
{
background-color
:
#f5f7fa
;
cursor
:
pointer
;
/* 新增:鼠标悬停显示指针 */
}
/
deep
/
.el-table__fixed-right
,
/
deep
/
.el-table__fixed-left
{
pointer-events
:
auto
!important
;
}
/* 单选模式下表格行样式优化 */
/
deep
/
.el-table__body
tr
.el-table__row--striped
td
{
background-color
:
#fafafa
;
}
/
deep
/
.el-table__body
tr
.current-row
td
{
background-color
:
#e8f4fd
!important
;
}
</
style
>
\ No newline at end of file
ruoyi-admin-vue/src/views/inventory/locations/index.vue
View file @
c7cf6243
...
...
@@ -71,7 +71,7 @@
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"仓库"
prop=
"warehouseId"
>
<
!-- <
el-form-item label="仓库" prop="warehouseId">
<el-input
v-model="queryWarehouseName"
placeholder="请选择仓库"
...
...
@@ -89,7 +89,7 @@
></i>
</template>
</el-input>
</el-form-item>
</el-form-item>
-->
<el-form-item
label=
"层"
prop=
"layerCode"
>
<el-input
v-model=
"queryParams.layerCode"
...
...
@@ -230,11 +230,11 @@
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
fixed
/>
<el-table-column
label=
"库位编码"
align=
"center"
prop=
"locationCode"
width=
"120"
fixed
/>
<el-table-column
label=
"库位名称"
align=
"center"
prop=
"locationName"
width=
"150"
/>
<el-table-column
label=
"仓库"
align=
"center"
prop=
"warehousesName"
width=
"180"
>
<
!-- <
el-table-column label="仓库" align="center" prop="warehousesName" width="180">
<template slot-scope="scope">
{{ scope.row.warehousesName }}
</template>
</el-table-column>
</el-table-column>
-->
<el-table-column
label=
"库位类型"
align=
"center"
prop=
"locationType"
width=
"100"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.location_type"
:value=
"scope.row.locationType"
/>
...
...
@@ -357,7 +357,7 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item
label=
"仓库"
prop=
"warehouseId"
>
<
!-- <
el-form-item label="仓库" prop="warehouseId">
<el-input
v-model="form.warehouseName"
placeholder="请选择仓库"
...
...
@@ -375,7 +375,7 @@
></i>
</template>
</el-input>
</el-form-item>
</el-form-item>
-->
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"库位类型"
prop=
"locationType"
>
...
...
@@ -583,10 +583,10 @@
/>
<!-- 仓库选择器组件 -->
<WarehouseSelector
<
!-- <
WarehouseSelector
v-model="warehouseSelectorVisible"
@selected="handleWarehouseSelected"
/>
/>
-->
</div>
</template>
...
...
@@ -594,7 +594,7 @@
import
{
listLocations
,
getLocations
,
delLocations
,
addLocations
,
updateLocations
}
from
"@/api/inventory/locations"
import
{
listWarehouses
}
from
"@/api/inventory/warehouses"
import
materialsSeletor
from
"../../../components/materialsSeletor.vue"
import
WarehouseSelector
from
"@/views/compononents/WarehouseSelector.vue"
//
import WarehouseSelector from "@/views/compononents/WarehouseSelector.vue"
import
ImportExcel
from
"@/components/ImportExcel/index"
import
{
listMaterials
}
from
"@/api/inventory/materials"
...
...
@@ -670,9 +670,9 @@ export default {
{
required
:
true
,
message
:
'库位名称不能为空'
,
trigger
:
'blur'
},
{
min
:
1
,
max
:
100
,
message
:
'库位名称长度不能超过100个字符'
,
trigger
:
'blur'
}
],
warehouseId
:
[
{
required
:
true
,
message
:
'仓库不能为空'
,
trigger
:
'change'
}
],
//
warehouseId: [
//
{ required: true, message: '仓库不能为空', trigger: 'change' }
//
],
locationType
:
[
{
required
:
true
,
message
:
'库位类型不能为空'
,
trigger
:
'change'
}
],
...
...
ruoyi-admin-vue/src/views/inventory/orders/OutboundOrderFormWithItems.vue
View file @
c7cf6243
...
...
@@ -49,15 +49,12 @@
<div
style=
"height: 70vh; overflow: auto; padding: 0 10px;"
>
<MaterialSelector
ref=
"materialsSeletor"
@
selection-change=
"
handleMaterialSelectionChange
"
@
selection-change=
"
confirmMaterialSelect
"
:selected-material-codes=
"form.materialUuids ? [form.materialUuids] : []"
:multiple=
"false"
/>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click
.
native=
"openMaterialSelector = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click
.
native=
"confirmMaterialSelect"
>
确认选择
</el-button>
</div>
</el-dialog>
<!-- 库存信息列表 -->
...
...
@@ -335,7 +332,8 @@ export default {
selectedMaterialId
:
''
,
selectedMaterialInfo
:
null
,
currentSelectedRowId
:
null
,
isInitEcho
:
false
isInitEcho
:
false
,
openMaterialSelector
:
false
,
// 确保初始为关闭状态
};
},
computed
:
{
...
...
@@ -799,6 +797,9 @@ handleSubmit() {
},
// 修复:增强校验逻辑,增加组件存在性检查和异步同步
confirmMaterialSelect
()
{
// 标记为“用户主动操作”
this
.
isUserInitiatedSelect
=
true
;
// 1. 检查选择器组件是否存在
if
(
!
this
.
$refs
.
materialsSeletor
)
{
this
.
$message
.
error
(
'物料选择器组件加载失败,请重试'
);
...
...
@@ -821,18 +822,9 @@ handleSubmit() {
// 触发数据同步(覆盖事件未触发的场景)
this
.
handleMaterialSelectionChange
(
selectedData
);
// 4. 增强空值校验
if
(
!
this
.
selectedMaterialInfo
||
!
this
.
selectedMaterialId
)
{
this
.
$message
.
warning
(
'请选择物料后再确认'
);
return
;
}
// 5. 容错处理:确保物料ID有效
const
materialId
=
this
.
selectedMaterialInfo
.
id
||
this
.
selectedMaterialInfo
.
materialId
||
this
.
selectedMaterialInfo
.
uuid
||
''
;
if
(
!
materialId
)
{
this
.
$message
.
error
(
'选中的物料缺少有效ID,请重新选择'
);
return
;
}
// 6. 赋值并关闭弹窗
this
.
$set
(
this
.
form
,
'materialId'
,
materialId
);
...
...
@@ -844,6 +836,9 @@ handleSubmit() {
this
.
$nextTick
(()
=>
{
this
.
$refs
.
detailForm
?.
validateField
(
'materialId'
);
});
// 重置标记
this
.
isUserInitiatedSelect
=
false
;
});
}
},
...
...
ruoyi-admin/src/main/resources/application-druid.yml
View file @
c7cf6243
...
...
@@ -13,7 +13,7 @@ spring:
#username: root # 数据库用户名
#password: 'Aa123456'
#測試
url
:
jdbc:mysql://demo.docmis.cn:23500/inventory_manager?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&useSSL=false
url
:
jdbc:mysql://demo.docmis.cn:23500/inventory_manager?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&useSSL=false
&allowMultiQueries=true
username
:
root
password
:
'
!QAZ2wsx#EDC2022'
# 从库数据源
...
...
ruoyi-common/src/main/java/com/ruoyi/common/config/WarehouseConfig.java
View file @
c7cf6243
...
...
@@ -7,6 +7,6 @@ public class WarehouseConfig {
/**
* 默认出库仓库ID(核心默认值)
*/
public
static
final
String
DEFAULT_WAREHOUSE_ID
=
"
572ba484-199c-45d9-9735-610928ed5c70
"
;
public
static
final
String
DEFAULT_WAREHOUSE_ID
=
"
local
"
;
}
\ No newline at end of file
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/OutboundOrderItems.java
View file @
c7cf6243
...
...
@@ -117,7 +117,7 @@ public class OutboundOrderItems extends BaseEntity
@Excel
(
name
=
"排序号"
)
private
String
updateUserCode
;
private
String
InventoryType
;
private
int
InventoryType
;
}
\ No newline at end of file
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/OutboundOrderItemsMapper.java
View file @
c7cf6243
...
...
@@ -74,5 +74,11 @@ public interface OutboundOrderItemsMapper
public
int
batchInsertOutboundOrderItems
(
List
<
OutboundOrderItems
>
inboundOrderItems
);
public
int
batchUpdateOutboundOrderItems
(
List
<
OutboundOrderItems
>
inboundOrderItems
);
int
batchDeleteOutboundOrderItems
(
String
[]
ids
);
public
int
deleteOutboundOrderItemsByOrderId
(
String
orderId
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
View file @
c7cf6243
...
...
@@ -156,33 +156,45 @@ public class InventoryServiceImpl implements IInventoryService
}
updateInventory
(
inventory
);
// 库存操作表插入数据
createInventoryOutboundLog
(
inventory
,
outboundOrderItem
,
Long
.
valueOf
(
quantity
),
SystemUtils
.
getUserName
(),
new
Date
());
}
RefreshInventory
(
inventoryIds
);
}
return
1
;
}
private
void
createInventoryOutboundLog
(
Inventory
inventory
,
OutboundOrderItems
outboundOrderItem
,
Long
deductQty
,
String
updateUser
,
Date
updateTime
)
{
InventoryTransactions
transactions
=
new
InventoryTransactions
();
transactions
.
setId
(
IdUtils
.
simpleUUID
());
transactions
.
setTransactionType
(
2L
);
// 事务类型-出库
transactions
.
setId
(
IdUtils
.
simpleUUID
());
// 确保IdUtils工具类存在,若无则替换为UUID.randomUUID().toString()
transactions
.
setTransactionType
(
2L
);
// 事务类型-出库
transactions
.
setBatchCode
(
outboundOrderItem
.
getBatchCode
());
transactions
.
setUnitPrice
(
String
.
valueOf
(
outboundOrderItem
.
getUnitPrice
()));
transactions
.
setInventoryId
(
inventory
.
getId
());
// 库存表Id
transactions
.
setReferenceId
(
outboundOrderItem
.
getOutboundOrderId
());
//关联单号,相当于主记录-盘点主表
transactions
.
setReferenceItemId
(
outboundOrderItem
.
getId
());
// 盘点子表id
transactions
.
setReferenceId
(
outboundOrderItem
.
getOutboundOrderId
());
// 关联出库单主表ID
transactions
.
setReferenceItemId
(
outboundOrderItem
.
getId
());
// 关联出库单明细ID
transactions
.
setMaterialId
(
outboundOrderItem
.
getMaterialId
());
transactions
.
setWarehouseId
(
outboundOrderItem
.
getWarehouseId
());
transactions
.
setLocationId
(
outboundOrderItem
.
getLocationId
());
// 补充货主ID(从出库单主表查询)
OutboundOrders
outboundOrders
=
outboundOrderMapper
.
selectOutboundOrdersById
(
outboundOrderItem
.
getOutboundOrderId
());
if
(
outboundOrders
!=
null
)
{
transactions
.
setOwnerId
(
outboundOrders
.
getOwnerId
());
transactions
.
setQuantityBefore
(
Long
.
valueOf
(
quantity
));
// 变更前数量
transactions
.
setQuantityAfter
(
inventory
.
getQuantity
());
// 变更后数量
transactions
.
setQuantityChange
(
outboundOrderItem
.
getActualQuantity
());
Date
nowDate
=
new
Date
();
transactions
.
setTransactionTime
(
nowDate
);
}
// 变更前后数量
Long
beforeQty
=
Optional
.
ofNullable
(
inventory
.
getQuantity
()).
orElse
(
0L
)
+
deductQty
;
// 扣减前数量 = 扣减后 + 扣减量
transactions
.
setQuantityBefore
(
beforeQty
);
transactions
.
setQuantityAfter
(
inventory
.
getQuantity
());
// 扣减后数量
transactions
.
setQuantityChange
(
deductQty
);
// 变更量(出库为正数)
transactions
.
setTransactionTime
(
updateTime
);
transactions
.
setOperatedBy
(
updateUser
);
transactions
.
setOperatedBy
(
SystemUtils
.
getUserName
());
// 插入日志
insertInventoryTransactions
.
insertInventoryTransactions
(
transactions
);
}
RefreshInventory
(
inventoryIds
);
}
return
1
;
}
@SerialExecution
(
group
=
"inventoryRefresh"
,
fair
=
true
)
@Override
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrdersServiceImpl.java
View file @
c7cf6243
差异被折叠。
点击展开。
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StorageLocationsServiceImpl.java
View file @
c7cf6243
...
...
@@ -128,6 +128,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocations
.
setId
(
LocationsID
);
storageLocations
.
setCreateTime
(
DateUtils
.
getNowDate
());
storageLocations
.
setCreateUserCode
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
storageLocations
.
setWarehousesId
(
WarehouseConfig
.
DEFAULT_WAREHOUSE_ID
);
storageLocationsCategory
.
setLocationCode
(
LocationsID
);
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
View file @
c7cf6243
...
...
@@ -586,4 +586,17 @@ and inventory_status = '1'
group by m.id, m.material_name
order by value desc, m.material_name asc
</select>
<update
id=
"batchUpdateInventory"
>
<foreach
collection=
"list"
item=
"item"
separator=
";"
>
UPDATE inventory
<set>
quantity = #{item.quantity},
inventory_status = #{item.inventoryStatus},
update_user_code = #{item.updateBy},
update_time = #{item.updateTime}
</set>
WHERE id = #{item.id}
</foreach>
</update>
</mapper>
\ No newline at end of file
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrderItemsMapper.xml
View file @
c7cf6243
...
...
@@ -367,6 +367,9 @@
</foreach>
</update>
<delete
id=
"deleteOutboundOrderItemsByOrderId"
parameterType=
"String"
>
delete from outbound_order_items where outbound_order_id = #{orderId}
</delete>
<!-- 单条删除:逻辑删除 -->
<update
id=
"deleteOutboundOrderItemsById"
parameterType=
"String"
>
update outbound_order_items
...
...
@@ -432,4 +435,39 @@
)
</foreach>
</insert>
<update
id=
"batchUpdateOutboundOrderItems"
parameterType=
"java.util.List"
>
<foreach
collection=
"list"
item=
"item"
separator=
";"
>
UPDATE outbound_order_items
SET
inventory_id =
<if
test=
"item.inventoryId != null"
>
#{item.inventoryId}
</if><if
test=
"item.inventoryId == null"
>
null
</if>
,
material_id =
<if
test=
"item.materialId != null"
>
#{item.materialId}
</if><if
test=
"item.materialId == null"
>
null
</if>
,
batch_code =
<if
test=
"item.batchCode != null"
>
#{item.batchCode}
</if><if
test=
"item.batchCode == null"
>
null
</if>
,
warehouse_id =
<if
test=
"item.warehouseId != null"
>
#{item.warehouseId}
</if><if
test=
"item.warehouseId == null"
>
null
</if>
,
location_id =
<if
test=
"item.locationId != null"
>
#{item.locationId}
</if><if
test=
"item.locationId == null"
>
null
</if>
,
unit_price =
<if
test=
"item.unitPrice != null"
>
#{item.unitPrice}
</if><if
test=
"item.unitPrice == null"
>
null
</if>
,
planned_quantity =
<if
test=
"item.plannedQuantity != null"
>
#{item.plannedQuantity}
</if><if
test=
"item.plannedQuantity == null"
>
null
</if>
,
actual_quantity =
<if
test=
"item.actualQuantity != null"
>
#{item.actualQuantity}
</if><if
test=
"item.actualQuantity == null"
>
null
</if>
,
divisor =
<if
test=
"item.divisor != null"
>
#{item.divisor}
</if><if
test=
"item.divisor == null"
>
null
</if>
,
label_color =
<if
test=
"item.labelColor != null"
>
#{item.labelColor}
</if><if
test=
"item.labelColor == null"
>
null
</if>
,
voucher_number =
<if
test=
"item.voucherNumber != null"
>
#{item.voucherNumber}
</if><if
test=
"item.voucherNumber == null"
>
null
</if>
,
item_status =
<if
test=
"item.itemStatus != null"
>
#{item.itemStatus}
</if><if
test=
"item.itemStatus == null"
>
null
</if>
,
shipped_at =
<if
test=
"item.shippedAt != null"
>
#{item.shippedAt}
</if><if
test=
"item.shippedAt == null"
>
null
</if>
,
shipped_by =
<if
test=
"item.shippedBy != null"
>
#{item.shippedBy}
</if><if
test=
"item.shippedBy == null"
>
null
</if>
,
remark =
<if
test=
"item.remark != null"
>
#{item.remark}
</if><if
test=
"item.remark == null"
>
null
</if>
,
is_used =
<if
test=
"item.isUsed != null"
>
#{item.isUsed}
</if><if
test=
"item.isUsed == null"
>
1
</if>
,
sort_no =
<if
test=
"item.sortNo != null"
>
#{item.sortNo}
</if><if
test=
"item.sortNo == null"
>
null
</if>
,
update_time =
<if
test=
"item.updateTime != null"
>
#{item.updateTime}
</if><if
test=
"item.updateTime == null"
>
NOW()
</if>
,
update_user_code =
<if
test=
"item.updateUserCode != null"
>
#{item.updateUserCode}
</if><if
test=
"item.updateUserCode == null"
>
null
</if>
WHERE id = #{item.id}
</foreach>
</update>
<delete
id=
"batchDeleteOutboundOrderItems"
>
DELETE FROM outbound_order_items
WHERE id IN
<foreach
collection=
"array"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论