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
4551012a
Commit
4551012a
authored
Dec 09, 2025
by
yubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
出库
parent
70157266
全部展开
显示空白字符变更
内嵌
并排
正在显示
22 个修改的文件
包含
186 行增加
和
89 行删除
+186
-89
ruoyi-admin-vue/src/api/inventory/locations.js
+8
-0
ruoyi-admin-vue/src/api/inventory/materials.js
+7
-0
ruoyi-admin-vue/src/api/inventory/owners.js
+6
-0
ruoyi-admin-vue/src/api/inventory/warehouses.js
+6
-0
ruoyi-admin-vue/src/components/materialsSeletor copy.vue
+0
-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
+49
-16
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/MaterialsMapper.java
+1
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/OutboundOrderItemsMapper.java
+1
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/ReturnOrderItemsMapper.java
+0
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryService.java
+1
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
+2
-3
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrderItemsServiceImpl.java
+1
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrdersServiceImpl.java
+13
-2
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StorageLocationsServiceImpl.java
+3
-3
ruoyi-inventory/src/main/resources/mapper/inventory/InboundOrderItemsMapper.xml
+6
-6
ruoyi-inventory/src/main/resources/mapper/inventory/MaterialsMapper.xml
+2
-2
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrderItemsMapper.xml
+40
-10
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrderLogMapper.xml
+15
-20
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrdersMapper.xml
+25
-23
没有找到文件。
ruoyi-admin-vue/src/api/inventory/locations.js
View file @
4551012a
...
@@ -52,3 +52,10 @@ export function listLocationsForSelector(query) {
...
@@ -52,3 +52,10 @@ export function listLocationsForSelector(query) {
params
:
query
params
:
query
})
})
}
}
export
function
getlocationsdicts
()
{
return
request
({
url
:
'/inventory/owners/getMapList'
,
method
:
'get'
})
}
\ No newline at end of file
ruoyi-admin-vue/src/api/inventory/materials.js
View file @
4551012a
...
@@ -42,3 +42,10 @@ export function delMaterials(id) {
...
@@ -42,3 +42,10 @@ export function delMaterials(id) {
method
:
'delete'
method
:
'delete'
})
})
}
}
export
function
getMaterialsdicts
()
{
return
request
({
url
:
'/inventory/materials/getMapList'
,
method
:
'get'
})
}
ruoyi-admin-vue/src/api/inventory/owners.js
View file @
4551012a
...
@@ -42,3 +42,9 @@ export function delOwners(id) {
...
@@ -42,3 +42,9 @@ export function delOwners(id) {
method
:
'delete'
method
:
'delete'
})
})
}
}
export
function
getOwnerdicts
()
{
return
request
({
url
:
'/inventory/owners/getMapList'
,
method
:
'get'
})
}
ruoyi-admin-vue/src/api/inventory/warehouses.js
View file @
4551012a
...
@@ -51,3 +51,9 @@ export function listWarehousesForSelector(query) {
...
@@ -51,3 +51,9 @@ export function listWarehousesForSelector(query) {
params
:
query
params
:
query
})
})
}
}
export
function
getMapList
()
{
return
request
({
url
:
'/inventory/warehouses/getMapList'
,
method
:
'get'
})
}
ruoyi-admin-vue/src/components/materialsSeletor copy.vue
0 → 100644
View file @
4551012a
差异被折叠。
点击展开。
ruoyi-admin-vue/src/components/materialsSeletor.vue
View file @
4551012a
差异被折叠。
点击展开。
ruoyi-admin-vue/src/views/inventory/locations/index.vue
View file @
4551012a
差异被折叠。
点击展开。
ruoyi-admin-vue/src/views/inventory/orders/OutboundOrderFormWithItems.vue
View file @
4551012a
差异被折叠。
点击展开。
ruoyi-admin-vue/src/views/inventory/orders/index.vue
View file @
4551012a
...
@@ -373,7 +373,7 @@
...
@@ -373,7 +373,7 @@
<
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;"
>
<
span
style
=
"font-weight: 600; margin-right: 16px;"
>
物料
ID
:
{{
materialId
}}
<
/span
>
<
span
style
=
"font-weight: 600; margin-right: 16px;"
>
物料
:
{{
materialId
+
" "
+
getMaterialName
(
materialId
)
}}
<
/span
>
<
span
style
=
"color: #666;"
>
明细数量:
{{
group
.
items
.
length
}}
条
<
/span
>
<
span
style
=
"color: #666;"
>
明细数量:
{{
group
.
items
.
length
}}
条
<
/span
>
<!--
仅编辑模式显示分组操作按钮
-->
<!--
仅编辑模式显示分组操作按钮
-->
<
el
-
button
<
el
-
button
...
@@ -391,7 +391,6 @@
...
@@ -391,7 +391,6 @@
:
row
-
class
-
name
=
"(params) => rowInboundOrderItemsIndex(params, group.items)"
:
row
-
class
-
name
=
"(params) => rowInboundOrderItemsIndex(params, group.items)"
@
selection
-
change
=
"handleInboundOrderItemsSelectionChange"
@
selection
-
change
=
"handleInboundOrderItemsSelectionChange"
ref
=
"inboundOrderItems"
ref
=
"inboundOrderItems"
border
style
=
"width: 100%;"
style
=
"width: 100%;"
:
row
-
key
=
"item => item.inventoryId"
:
row
-
key
=
"item => item.inventoryId"
:
disabled
=
"isViewDetail"
:
disabled
=
"isViewDetail"
...
@@ -399,8 +398,8 @@
...
@@ -399,8 +398,8 @@
<!--
仅编辑模式显示选择列
-->
<!--
仅编辑模式显示选择列
-->
<
el
-
table
-
column
type
=
"selection"
width
=
"50"
align
=
"center"
v
-
if
=
"!isViewDetail"
/>
<
el
-
table
-
column
type
=
"selection"
width
=
"50"
align
=
"center"
v
-
if
=
"!isViewDetail"
/>
<
el
-
table
-
column
label
=
"序号"
align
=
"center"
prop
=
"index"
width
=
"50"
/>
<
el
-
table
-
column
label
=
"序号"
align
=
"center"
prop
=
"index"
width
=
"50"
/>
<
el
-
table
-
column
label
=
"物料编号"
prop
=
"materialId"
width
=
"150"
/>
<
el
-
table
-
column
label
=
"物料编号"
prop
=
"materialId"
width
=
"180"
/>
<
el
-
table
-
column
label
=
"仓库编号"
prop
=
"warehouseId"
width
=
"150"
/
>
<
!--
<
el
-
table
-
column
label
=
"仓库编号"
prop
=
"warehouseId"
width
=
"150"
/>
--
>
<
el
-
table
-
column
label
=
"库位编号"
prop
=
"locationId"
width
=
"150"
/>
<
el
-
table
-
column
label
=
"库位编号"
prop
=
"locationId"
width
=
"150"
/>
<
el
-
table
-
column
label
=
"批次编号"
prop
=
"batchCode"
width
=
"150"
/>
<
el
-
table
-
column
label
=
"批次编号"
prop
=
"batchCode"
width
=
"150"
/>
...
@@ -439,6 +438,7 @@
...
@@ -439,6 +438,7 @@
:
init
-
details
=
"getInitDetails()"
:
init
-
details
=
"getInitDetails()"
:
group
-
data
=
"currentGroupData"
:
group
-
data
=
"currentGroupData"
:
outbound
-
order
-
id
=
"form.orderId || form.outboundOrderId"
:
outbound
-
order
-
id
=
"form.orderId || form.outboundOrderId"
:
materialdicts
=
"materialdicts"
@
submit
=
"handleDetailSubmit"
@
submit
=
"handleDetailSubmit"
@
close
=
"detailDialogOpen = false"
@
close
=
"detailDialogOpen = false"
@
update
:
open
=
"detailDialogOpen = $event"
@
update
:
open
=
"detailDialogOpen = $event"
...
@@ -466,6 +466,8 @@
...
@@ -466,6 +466,8 @@
<
script
>
<
script
>
import
{
listOrders
,
getOrders
,
delOrders
,
addOrders
,
updateOrders
,
ship
}
from
"@/api/inventory/orders"
import
{
listOrders
,
getOrders
,
delOrders
,
addOrders
,
updateOrders
,
ship
}
from
"@/api/inventory/orders"
import
{
getMaterialsdicts
}
from
"@/api/inventory/materials"
import
OutboundOrderFormWithItems
from
'./OutboundOrderFormWithItems.vue'
import
OutboundOrderFormWithItems
from
'./OutboundOrderFormWithItems.vue'
import
WarehouseSelector
from
"@/views/compononents/WarehouseSelector.vue"
import
WarehouseSelector
from
"@/views/compononents/WarehouseSelector.vue"
import
LocationSelector
from
"@/views/compononents/LocationSelector.vue"
import
LocationSelector
from
"@/views/compononents/LocationSelector.vue"
...
@@ -484,6 +486,7 @@ export default {
...
@@ -484,6 +486,7 @@ export default {
}
,
}
,
data
()
{
data
()
{
return
{
return
{
materialdicts
:[],
// 添加tableKey解决tableId渲染问题
// 添加tableKey解决tableId渲染问题
tableKey
:
1
,
tableKey
:
1
,
// 遮罩层
// 遮罩层
...
@@ -600,22 +603,33 @@ export default {
...
@@ -600,22 +603,33 @@ export default {
created
()
{
created
()
{
// 延迟加载避免初始化渲染问题
// 延迟加载避免初始化渲染问题
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
getdicts
(),
this
.
getList
()
this
.
getList
()
}
)
}
)
}
,
}
,
methods
:
{
methods
:
{
// 货主选择回调
getMaterialName
(
materialId
)
{
handleOwnerSelected
(
owner
)
{
if
(
!
materialId
||
!
this
.
materialdicts
.
length
)
return
'未知物料'
;
if
(
!
owner
)
return
// 精准匹配(如果需要模糊匹配,把 === 改成 includes 即可)
if
(
this
.
ownerSelectTarget
===
'query'
)
{
const
matchItem
=
this
.
materialdicts
.
find
(
item
=>
this
.
queryParams
.
ownerId
=
owner
.
ownerId
||
owner
.
id
String
(
item
.
value
)
===
String
(
materialId
)
this
.
queryOwnerName
=
owner
.
ownerName
||
owner
.
name
);
this
.
handleQuery
()
return
matchItem
?
matchItem
.
label
:
'未知物料'
;
}
else
{
}
,
this
.
form
.
ownerId
=
owner
.
ownerId
||
owner
.
id
getdicts
(){
this
.
form
.
ownerName
=
owner
.
ownerName
||
owner
.
name
return
getMaterialsdicts
()
}
.
then
(
response
=>
{
this
.
ownerSelectorVisible
=
false
this
.
materialdicts
=
(
response
.
data
||
response
).
map
(
item
=>
({
value
:
item
.
sap_no
,
label
:
item
.
material_name
,
}
));
console
.
log
(
"物料字典数据加载成功:"
,
this
.
materialdicts
);
}
)
.
catch
(
error
=>
{
console
.
error
(
"加载物料字典失败:"
,
error
);
this
.
$message
.
error
(
"物料字典加载失败,请刷新重试"
);
}
);
}
,
}
,
// 仓库选择回调
// 仓库选择回调
handleWarehouseSelected
(
warehouse
)
{
handleWarehouseSelected
(
warehouse
)
{
...
@@ -650,6 +664,25 @@ export default {
...
@@ -650,6 +664,25 @@ export default {
this
.
ownerSelectTarget
=
target
this
.
ownerSelectTarget
=
target
this
.
ownerSelectorVisible
=
true
this
.
ownerSelectorVisible
=
true
}
,
}
,
// 货主选择回调(核心缺失方法)
handleOwnerSelected
(
owner
)
{
if
(
!
owner
)
return
if
(
this
.
ownerSelectTarget
===
'query'
)
{
this
.
queryParams
.
ownerId
=
owner
.
ownerId
||
owner
.
id
this
.
queryOwnerName
=
owner
.
ownerName
||
owner
.
name
this
.
handleQuery
()
}
else
{
this
.
form
.
ownerId
=
owner
.
ownerId
||
owner
.
id
this
.
form
.
ownerName
=
owner
.
ownerName
||
owner
.
name
// 更新明细中的默认货主(可选)
if
(
this
.
currentDetailItem
)
{
this
.
currentDetailItem
.
ownerId
=
owner
.
ownerId
||
owner
.
id
this
.
currentDetailItem
.
ownerName
=
owner
.
ownerName
||
owner
.
name
}
}
this
.
ownerSelectorVisible
=
false
}
,
// 打开仓库选择器
// 打开仓库选择器
openWarehouseSelector
(
target
=
'form'
)
{
openWarehouseSelector
(
target
=
'form'
)
{
this
.
warehouseSelectTarget
=
target
this
.
warehouseSelectTarget
=
target
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/MaterialsMapper.java
View file @
4551012a
...
@@ -30,7 +30,7 @@ public interface MaterialsMapper
...
@@ -30,7 +30,7 @@ public interface MaterialsMapper
* @param id 物料主键
* @param id 物料主键
* @return 物料
* @return 物料
*/
*/
public
List
<
Materials
>
selectMaterialsBy
MaterialsCode
(
String
id
);
public
List
<
Materials
>
selectMaterialsBy
SapNo
(
String
id
);
/**
/**
* 查询物料列表
* 查询物料列表
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/OutboundOrderItemsMapper.java
View file @
4551012a
...
@@ -65,5 +65,5 @@ public interface OutboundOrderItemsMapper
...
@@ -65,5 +65,5 @@ public interface OutboundOrderItemsMapper
* @param ids 需要删除的数据主键集合
* @param ids 需要删除的数据主键集合
* @return 结果
* @return 结果
*/
*/
public
int
deleteOutboundOrderItemsById
s
(
String
[]
ids
);
public
int
deleteOutboundOrderItemsById
(
String
[]
ids
);
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/ReturnOrderItemsMapper.java
View file @
4551012a
...
@@ -2,7 +2,6 @@ package com.ruoyi.inventory.mapper;
...
@@ -2,7 +2,6 @@ package com.ruoyi.inventory.mapper;
import
java.util.List
;
import
java.util.List
;
import
com.ruoyi.inventory.domain.ReturnOrderItems
;
import
com.ruoyi.inventory.domain.ReturnOrderItems
;
import
com.ruoyi.inventory.domain.ReturnOrders
;
import
com.ruoyi.inventory.domain.vo.ReturnOrdersSummaryVO
;
import
com.ruoyi.inventory.domain.vo.ReturnOrdersSummaryVO
;
/**
/**
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryService.java
View file @
4551012a
...
@@ -106,4 +106,5 @@ public interface IInventoryService
...
@@ -106,4 +106,5 @@ public interface IInventoryService
* @return 库存明细集合
* @return 库存明细集合
*/
*/
public
List
<
Inventory
>
selectInventoryDetailList
(
Inventory
inventory
);
public
List
<
Inventory
>
selectInventoryDetailList
(
Inventory
inventory
);
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
View file @
4551012a
...
@@ -4,11 +4,10 @@ import java.util.*;
...
@@ -4,11 +4,10 @@ import java.util.*;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.ruoyi.common.annotation.SerialExecution
;
import
com.ruoyi.common.annotation.SerialExecution
;
import
com.ruoyi.common.core.domain.entity.Materials
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.inventory.domain.OutboundOrderItems
;
import
com.ruoyi.inventory.domain.OutboundOrderItems
;
import
com.ruoyi.inventory.domain.OutboundOrderLog
;
import
com.ruoyi.inventory.domain.OutboundOrderLog
;
import
com.ruoyi.inventory.domain.
StocktakeItems
;
import
com.ruoyi.inventory.domain.
TO.StocktakeItemsTo
;
import
com.ruoyi.inventory.domain.vo.InventorySummaryVO
;
import
com.ruoyi.inventory.domain.vo.InventorySummaryVO
;
import
com.ruoyi.inventory.mapper.OutboundOrderItemsMapper
;
import
com.ruoyi.inventory.mapper.OutboundOrderItemsMapper
;
import
com.ruoyi.inventory.mapper.OutboundOrderLogMapper
;
import
com.ruoyi.inventory.mapper.OutboundOrderLogMapper
;
...
@@ -233,7 +232,7 @@ public class InventoryServiceImpl implements IInventoryService
...
@@ -233,7 +232,7 @@ public class InventoryServiceImpl implements IInventoryService
* @date 2025/12/3
* @date 2025/12/3
* @version 1.0
* @version 1.0
*/
*/
public
List
<
StocktakeItems
>
selectstocktakeItemsList
(){
public
List
<
StocktakeItems
To
>
selectstocktakeItemsList
(){
return
inventoryMapper
.
selectstocktakeItemsList
();
return
inventoryMapper
.
selectstocktakeItemsList
();
}
}
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrderItemsServiceImpl.java
View file @
4551012a
...
@@ -81,7 +81,7 @@ public class OutboundOrderItemsServiceImpl implements IOutboundOrderItemsService
...
@@ -81,7 +81,7 @@ public class OutboundOrderItemsServiceImpl implements IOutboundOrderItemsService
@Override
@Override
public
int
deleteOutboundOrderItemsByIds
(
String
[]
ids
)
public
int
deleteOutboundOrderItemsByIds
(
String
[]
ids
)
{
{
return
outboundOrderItemsMapper
.
deleteOutboundOrderItemsById
s
(
ids
);
return
outboundOrderItemsMapper
.
deleteOutboundOrderItemsById
(
ids
);
}
}
/**
/**
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrdersServiceImpl.java
View file @
4551012a
...
@@ -41,6 +41,11 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
...
@@ -41,6 +41,11 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
private
OutboundOrderLogMapper
outboundOrderLogMapper
;
private
OutboundOrderLogMapper
outboundOrderLogMapper
;
@Autowired
@Autowired
private
OwnersServiceImpl
ownersService
;
@Autowired
private
WarehousesServiceImpl
warehousesService
;
@Autowired
private
InventoryServiceImpl
inventoryService
;
private
InventoryServiceImpl
inventoryService
;
/**
/**
* 查询出库单主
* 查询出库单主
...
@@ -64,7 +69,8 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
...
@@ -64,7 +69,8 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
@Override
@Override
public
List
<
OutboundOrders
>
selectOutboundOrdersList
(
OutboundOrders
outboundOrders
)
public
List
<
OutboundOrders
>
selectOutboundOrdersList
(
OutboundOrders
outboundOrders
)
{
{
return
outboundOrdersMapper
.
selectOutboundOrdersList
(
outboundOrders
);
List
<
OutboundOrders
>
outboundOrders1
=
outboundOrdersMapper
.
selectOutboundOrdersList
(
outboundOrders
);
return
outboundOrders1
;
}
}
/**
/**
...
@@ -80,6 +86,7 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
...
@@ -80,6 +86,7 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
outboundOrders
.
setCreateTime
(
DateUtils
.
getNowDate
());
outboundOrders
.
setCreateTime
(
DateUtils
.
getNowDate
());
outboundOrders
.
setCreateBy
(
SystemUtils
.
getUserName
());
outboundOrders
.
setCreateBy
(
SystemUtils
.
getUserName
());
outboundOrders
.
setId
(
UUID
.
randomUUID
().
toString
());
outboundOrders
.
setId
(
UUID
.
randomUUID
().
toString
());
int
rows
=
outboundOrdersMapper
.
insertOutboundOrders
(
outboundOrders
);
int
rows
=
outboundOrdersMapper
.
insertOutboundOrders
(
outboundOrders
);
insertOutboundOrderItems
(
outboundOrders
);
insertOutboundOrderItems
(
outboundOrders
);
return
rows
;
return
rows
;
...
@@ -95,9 +102,12 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
...
@@ -95,9 +102,12 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
@Override
@Override
public
int
updateOutboundOrders
(
OutboundOrders
outboundOrders
)
public
int
updateOutboundOrders
(
OutboundOrders
outboundOrders
)
{
{
outboundOrders
.
setUpdateTime
(
DateUtils
.
getNowDate
());
outboundOrdersMapper
.
deleteOutboundOrderItemsByOrderId
(
outboundOrders
.
getId
());
outboundOrdersMapper
.
deleteOutboundOrderItemsByOrderId
(
outboundOrders
.
getId
());
outboundOrderLogMapper
.
deleteOutboundOrderLogByOrdersId
(
outboundOrders
.
getId
());
outboundOrderLogMapper
.
deleteOutboundOrderLogByOrdersId
(
outboundOrders
.
getId
());
outboundOrders
.
setUpdateBy
(
SystemUtils
.
getUserName
());
outboundOrders
.
setUpdateTime
(
DateUtils
.
getNowDate
());
insertOutboundOrderItems
(
outboundOrders
);
insertOutboundOrderItems
(
outboundOrders
);
return
outboundOrdersMapper
.
updateOutboundOrders
(
outboundOrders
);
return
outboundOrdersMapper
.
updateOutboundOrders
(
outboundOrders
);
}
}
...
@@ -197,6 +207,7 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
...
@@ -197,6 +207,7 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
for
(
OutboundOrderItems
items
:
outboundOrderItemsList
)
{
for
(
OutboundOrderItems
items
:
outboundOrderItemsList
)
{
OutboundOrderLog
log
=
new
OutboundOrderLog
();
OutboundOrderLog
log
=
new
OutboundOrderLog
();
BeanUtils
.
copyProperties
(
items
,
log
);
// 单个对象属性拷贝
BeanUtils
.
copyProperties
(
items
,
log
);
// 单个对象属性拷贝
log
.
setOrderId
(
items
.
getId
());
outboundOrderLogs
.
add
(
log
);
outboundOrderLogs
.
add
(
log
);
inventoryIds
.
add
(
log
.
getInventoryId
());
inventoryIds
.
add
(
log
.
getInventoryId
());
deleteOutboundOrdersById
(
items
.
getId
());
deleteOutboundOrdersById
(
items
.
getId
());
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StorageLocationsServiceImpl.java
View file @
4551012a
...
@@ -76,7 +76,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
...
@@ -76,7 +76,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
String
[]
AllowedCategoryIds
=
storageLocations2
.
getAllowedCategoryIds
().
split
(
","
);
String
[]
AllowedCategoryIds
=
storageLocations2
.
getAllowedCategoryIds
().
split
(
","
);
for
(
String
AllowedCategoryId
:
AllowedCategoryIds
)
{
for
(
String
AllowedCategoryId
:
AllowedCategoryIds
)
{
List
<
Materials
>
materials
=
materialsMapper
.
selectMaterialsBy
MaterialsCode
(
AllowedCategoryId
);
List
<
Materials
>
materials
=
materialsMapper
.
selectMaterialsBy
SapNo
(
AllowedCategoryId
);
if
(
materials
!=
null
&&
!
materials
.
isEmpty
())
{
if
(
materials
!=
null
&&
!
materials
.
isEmpty
())
{
Materials
materials1
=
materials
.
get
(
0
);
Materials
materials1
=
materials
.
get
(
0
);
...
@@ -120,7 +120,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
...
@@ -120,7 +120,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocationsCategory
.
setCategoryId
(
categoryId
);
storageLocationsCategory
.
setCategoryId
(
categoryId
);
storageLocationsCategory
.
setCreateTime
(
DateUtils
.
getNowDate
());
storageLocationsCategory
.
setCreateTime
(
DateUtils
.
getNowDate
());
storageLocationsCategory
.
setCreateUserCode
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
storageLocationsCategory
.
setCreateUserCode
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
List
<
Materials
>
materials
=
materialsMapper
.
selectMaterialsBy
MaterialsCode
(
categoryId
);
List
<
Materials
>
materials
=
materialsMapper
.
selectMaterialsBy
SapNo
(
categoryId
);
if
(
materials
!=
null
&&
!
materials
.
isEmpty
())
{
if
(
materials
!=
null
&&
!
materials
.
isEmpty
())
{
Materials
materials1
=
materials
.
get
(
0
);
Materials
materials1
=
materials
.
get
(
0
);
storageLocationsCategory
.
setCategoryName
(
materials1
.
getMaterialName
());
storageLocationsCategory
.
setCategoryName
(
materials1
.
getMaterialName
());
...
@@ -159,7 +159,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
...
@@ -159,7 +159,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocationsCategory
.
setCategoryId
(
categoryId
);
storageLocationsCategory
.
setCategoryId
(
categoryId
);
storageLocationsCategory
.
setUpdateTime
(
DateUtils
.
getNowDate
());
storageLocationsCategory
.
setUpdateTime
(
DateUtils
.
getNowDate
());
storageLocationsCategory
.
setUpdateUserCode
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
storageLocationsCategory
.
setUpdateUserCode
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
List
<
Materials
>
materials
=
materialsMapper
.
selectMaterialsBy
MaterialsCode
(
categoryId
);
List
<
Materials
>
materials
=
materialsMapper
.
selectMaterialsBy
SapNo
(
categoryId
);
if
(
materials
!=
null
&&
!
materials
.
isEmpty
())
{
if
(
materials
!=
null
&&
!
materials
.
isEmpty
())
{
Materials
materials1
=
materials
.
get
(
0
);
Materials
materials1
=
materials
.
get
(
0
);
storageLocationsCategory
.
setCategoryName
(
materials1
.
getMaterialName
());
storageLocationsCategory
.
setCategoryName
(
materials1
.
getMaterialName
());
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/InboundOrderItemsMapper.xml
View file @
4551012a
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.ruoyi.inventory.mapper.InboundOrderItemsMapper"
>
<mapper
namespace=
"com.ruoyi.inventory.mapper.InboundOrderItemsMapper"
>
<resultMap
type=
"InboundOrderItems"
id=
"InboundOrderItemsResult"
>
<resultMap
type=
"
com.ruoyi.inventory.domain.
InboundOrderItems"
id=
"InboundOrderItemsResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"orderId"
column=
"order_id"
/>
<result
property=
"orderId"
column=
"order_id"
/>
<result
property=
"materialId"
column=
"material_id"
/>
<result
property=
"materialId"
column=
"material_id"
/>
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
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, received_by, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code,inbound_order_id from inbound_order_items
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, received_by, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code,inbound_order_id from inbound_order_items
</sql>
</sql>
<select
id=
"selectInboundOrderItemsList"
parameterType=
"InboundOrderItems"
resultMap=
"InboundOrderItemsResult"
>
<select
id=
"selectInboundOrderItemsList"
parameterType=
"
com.ruoyi.inventory.domain.
InboundOrderItems"
resultMap=
"InboundOrderItemsResult"
>
<include
refid=
"selectInboundOrderItemsVo"
/>
<include
refid=
"selectInboundOrderItemsVo"
/>
<where>
<where>
<if
test=
"inboundOrderId != null and inboundOrderId != ''"
>
and inbound_order_id = #{inboundOrderId}
</if>
<if
test=
"inboundOrderId != null and inboundOrderId != ''"
>
and inbound_order_id = #{inboundOrderId}
</if>
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
<select
id=
"selectInboundOrderItemsListAndMaterialName"
<select
id=
"selectInboundOrderItemsListAndMaterialName"
parameterType=
"InboundOrderItems"
parameterType=
"
com.ruoyi.inventory.domain.
InboundOrderItems"
resultMap=
"InboundOrderItemsAndMnameResult"
>
resultMap=
"InboundOrderItemsAndMnameResult"
>
SELECT
SELECT
ii.id,
ii.id,
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
and inbound_order_id = #{inboundOrderId}
and inbound_order_id = #{inboundOrderId}
</if>
</if>
<if
test=
"orderId != null and orderId != ''"
>
<if
test=
"orderId != null and orderId != ''"
>
order_id = #{orderId}
and
order_id = #{orderId}
</if>
</if>
<if
test=
"materialId != null and materialId != ''"
>
<if
test=
"materialId != null and materialId != ''"
>
and material_id = #{materialId}
and material_id = #{materialId}
...
@@ -173,7 +173,7 @@
...
@@ -173,7 +173,7 @@
</where>
</where>
</select>
</select>
<insert
id=
"insertInboundOrderItems"
parameterType=
"InboundOrderItems"
>
<insert
id=
"insertInboundOrderItems"
parameterType=
"
com.ruoyi.inventory.domain.
InboundOrderItems"
>
insert into inbound_order_items
insert into inbound_order_items
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"id != null"
>
id,
</if>
...
@@ -231,7 +231,7 @@
...
@@ -231,7 +231,7 @@
</trim>
</trim>
</insert>
</insert>
<update
id=
"updateInboundOrderItems"
parameterType=
"InboundOrderItems"
>
<update
id=
"updateInboundOrderItems"
parameterType=
"
com.ruoyi.inventory.domain.
InboundOrderItems"
>
update inbound_order_items
update inbound_order_items
<trim
prefix=
"SET"
suffixOverrides=
","
>
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"orderId != null"
>
order_id = #{orderId},
</if>
<if
test=
"orderId != null"
>
order_id = #{orderId},
</if>
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/MaterialsMapper.xml
View file @
4551012a
...
@@ -76,9 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -76,9 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
where id = #{id}
order by sort_no asc
order by sort_no asc
</select>
</select>
<select
id=
"selectMaterialsBy
MaterialsCode
"
parameterType=
"String"
resultMap=
"MaterialsResult"
>
<select
id=
"selectMaterialsBy
SapNo
"
parameterType=
"String"
resultMap=
"MaterialsResult"
>
<include
refid=
"selectMaterialsVo"
/>
<include
refid=
"selectMaterialsVo"
/>
where
material_code
= #{id}
where
sap_no
= #{id}
order by sort_no asc
order by sort_no asc
</select>
</select>
<select
id=
"selectMaterialsByCategory"
parameterType=
"String"
resultMap=
"MaterialsResult"
>
<select
id=
"selectMaterialsByCategory"
parameterType=
"String"
resultMap=
"MaterialsResult"
>
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrderItemsMapper.xml
View file @
4551012a
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.ruoyi.inventory.mapper.OutboundOrderItemsMapper"
>
<mapper
namespace=
"com.ruoyi.inventory.mapper.OutboundOrderItemsMapper"
>
<resultMap
type=
"OutboundOrderItems"
id=
"OutboundOrderItemsResult"
>
<resultMap
type=
"OutboundOrderItems"
id=
"OutboundOrderItemsResult"
>
...
@@ -58,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -58,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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"
/>
</resultMap>
</resultMap>
<sql
id=
"selectOutboundOrderItemsVo"
>
<sql
id=
"selectOutboundOrderItemsVo"
>
select id, order_id, material_id, batch_code, warehouse_id, location_id, inventory_id, outbound_order_id, unit_price, planned_quantity, actual_quantity, divisor, label_color, voucher_number, item_status, shipped_at, shipped_by, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code from outbound_order_items
select id, order_id, material_id, batch_code, warehouse_id, location_id, inventory_id, outbound_order_id, unit_price, planned_quantity, actual_quantity, divisor, label_color, voucher_number, item_status, shipped_at, shipped_by, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code from outbound_order_items
</sql>
</sql>
...
@@ -65,6 +66,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -65,6 +66,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectOutboundOrderItemsList"
parameterType=
"OutboundOrderItems"
resultMap=
"OutboundOrderItemsResult"
>
<select
id=
"selectOutboundOrderItemsList"
parameterType=
"OutboundOrderItems"
resultMap=
"OutboundOrderItemsResult"
>
<include
refid=
"selectOutboundOrderItemsVo"
/>
<include
refid=
"selectOutboundOrderItemsVo"
/>
<where>
<where>
<if
test=
"isUsed == null"
>
is_used = 1
</if>
<if
test=
"isUsed != null"
>
is_used = #{isUsed}
</if>
<if
test=
"orderId != null and orderId != ''"
>
and order_id = #{orderId}
</if>
<if
test=
"orderId != null and orderId != ''"
>
and order_id = #{orderId}
</if>
<if
test=
"materialId != null and materialId != ''"
>
and material_id = #{materialId}
</if>
<if
test=
"materialId != null and materialId != ''"
>
and material_id = #{materialId}
</if>
<if
test=
"batchCode != null and batchCode != ''"
>
and batch_code = #{batchCode}
</if>
<if
test=
"batchCode != null and batchCode != ''"
>
and batch_code = #{batchCode}
</if>
...
@@ -79,16 +86,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -79,16 +86,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"itemStatus != null "
>
and item_status = #{itemStatus}
</if>
<if
test=
"itemStatus != null "
>
and item_status = #{itemStatus}
</if>
<if
test=
"shippedAt != null "
>
and shipped_at = #{shippedAt}
</if>
<if
test=
"shippedAt != null "
>
and shipped_at = #{shippedAt}
</if>
<if
test=
"shippedBy != null and shippedBy != ''"
>
and shipped_by = #{shippedBy}
</if>
<if
test=
"shippedBy != null and shippedBy != ''"
>
and shipped_by = #{shippedBy}
</if>
<if
test=
"isUsed != null "
>
and is_used = #{isUsed}
</if>
<if
test=
"sortNo != null "
>
and sort_no = #{sortNo}
</if>
<if
test=
"sortNo != null "
>
and sort_no = #{sortNo}
</if>
<if
test=
"createUserCode != null and createUserCode != ''"
>
and create_user_code = #{createUserCode}
</if>
<if
test=
"createUserCode != null and createUserCode != ''"
>
and create_user_code = #{createUserCode}
</if>
<if
test=
"updateUserCode != null and updateUserCode != ''"
>
and update_user_code = #{updateUserCode}
</if>
<if
test=
"updateUserCode != null and updateUserCode != ''"
>
and update_user_code = #{updateUserCode}
</if>
</where>
</where>
</select>
</select>
<!-- 单条查询:默认查使用中,若手动传isUsed则覆盖 -->
<select
id=
"selectOutboundOrderItemsById"
parameterType=
"String"
resultMap=
"OutboundOrderItemsResult"
>
<select
id=
"selectOutboundOrderItemsById"
parameterType=
"String"
resultMap=
"OutboundOrderItemsResult"
>
<include
refid=
"selectOutboundOrderItemsVo"
/>
<include
refid=
"selectOutboundOrderItemsVo"
/>
where id = #{id}
where id = #{id}
<!-- 增加is_used过滤,避免查询已逻辑删除的数据 -->
<if
test=
"isUsed == null"
>
and is_used = 1
</if>
<if
test=
"isUsed != null"
>
and is_used = #{isUsed}
</if>
</select>
</select>
<insert
id=
"insertOutboundOrderItems"
parameterType=
"OutboundOrderItems"
>
<insert
id=
"insertOutboundOrderItems"
parameterType=
"OutboundOrderItems"
>
...
@@ -112,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -112,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"shippedAt != null"
>
shipped_at,
</if>
<if
test=
"shippedAt != null"
>
shipped_at,
</if>
<if
test=
"shippedBy != null"
>
shipped_by,
</if>
<if
test=
"shippedBy != null"
>
shipped_by,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"isUsed == null"
>
is_used,
</if>
<if
test=
"isUsed != null"
>
is_used,
</if>
<if
test=
"isUsed != null"
>
is_used,
</if>
<if
test=
"sortNo != null"
>
sort_no,
</if>
<if
test=
"sortNo != null"
>
sort_no,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
...
@@ -138,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -138,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"shippedAt != null"
>
#{shippedAt},
</if>
<if
test=
"shippedAt != null"
>
#{shippedAt},
</if>
<if
test=
"shippedBy != null"
>
#{shippedBy},
</if>
<if
test=
"shippedBy != null"
>
#{shippedBy},
</if>
<if
test=
"remark != null"
>
#{remark},
</if>
<if
test=
"remark != null"
>
#{remark},
</if>
<if
test=
"isUsed == null"
>
1,
</if>
<if
test=
"isUsed != null"
>
#{isUsed},
</if>
<if
test=
"isUsed != null"
>
#{isUsed},
</if>
<if
test=
"sortNo != null"
>
#{sortNo},
</if>
<if
test=
"sortNo != null"
>
#{sortNo},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
...
@@ -177,10 +193,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -177,10 +193,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
where id = #{id}
</update>
</update>
<delete
id=
"deleteOutboundOrderItemsById"
parameterType=
"String"
>
<!-- 单条删除:逻辑删除 -->
delete from outbound_order_items where id = #{id}
<update
id=
"deleteOutboundOrderItemsById"
parameterType=
"String"
>
</delete>
update outbound_order_items
set is_used = 0
where id = #{id}
</update>
<!-- 统计查询:默认查is_used=1,支持手动传isUsed覆盖 -->
<select
id=
"selectOutboundOrderItemsStatistics"
<select
id=
"selectOutboundOrderItemsStatistics"
parameterType=
"OutboundOrderItemsStatisticsVO"
parameterType=
"OutboundOrderItemsStatisticsVO"
resultMap=
"OutboundOrderItemsStatisticsVoResult"
>
resultMap=
"OutboundOrderItemsStatisticsVoResult"
>
...
@@ -211,7 +231,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -211,7 +231,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
oi.update_user_code
oi.update_user_code
FROM outbound_order_items oi
FROM outbound_order_items oi
LEFT JOIN outbound_orders o ON oi.outbound_order_id = o.id
LEFT JOIN outbound_orders o ON oi.outbound_order_id = o.id
WHERE oi.is_used = 1
<where>
<if
test=
"isUsed == null"
>
oi.is_used = 1
</if>
<if
test=
"isUsed != null"
>
oi.is_used = #{isUsed}
</if>
<if
test=
"orderId != null and orderId != ''"
>
<if
test=
"orderId != null and orderId != ''"
>
AND o.order_id LIKE CONCAT('%', #{orderId}, '%')
AND o.order_id LIKE CONCAT('%', #{orderId}, '%')
</if>
</if>
...
@@ -233,14 +259,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -233,14 +259,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"itemStatus != null and itemStatus != ''"
>
<if
test=
"itemStatus != null and itemStatus != ''"
>
AND oi.item_status = #{itemStatus}
AND oi.item_status = #{itemStatus}
</if>
</if>
</where>
ORDER BY oi.create_time DESC
ORDER BY oi.create_time DESC
</select>
</select>
<delete
id=
"deleteOutboundOrderItemsByIds"
parameterType=
"String"
>
<!-- 批量删除:逻辑删除 -->
delete from outbound_order_items where id in
<update
id=
"deleteOutboundOrderItemsByIds"
parameterType=
"String"
>
update outbound_order_items
set is_used = 0
where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
#{id}
</foreach>
</foreach>
</
dele
te>
</
upda
te>
</mapper>
</mapper>
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrderLogMapper.xml
View file @
4551012a
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<select
id=
"selectOutboundOrderLogList"
parameterType=
"OutboundOrderLog"
resultMap=
"OutboundOrderLogResult"
>
<select
id=
"selectOutboundOrderLogList"
parameterType=
"OutboundOrderLog"
resultMap=
"OutboundOrderLogResult"
>
<include
refid=
"selectOutboundOrderLogVo"
/>
<include
refid=
"selectOutboundOrderLogVo"
/>
<where>
where is_used=1
<if
test=
"orderId != null and orderId != ''"
>
and order_id = #{orderId}
</if>
<if
test=
"orderId != null and orderId != ''"
>
and order_id = #{orderId}
</if>
<if
test=
"inventoryId != null and inventoryId != ''"
>
and inventory_id = #{inventoryId}
</if>
<if
test=
"inventoryId != null and inventoryId != ''"
>
and inventory_id = #{inventoryId}
</if>
<if
test=
"materialId != null and materialId != ''"
>
and material_id = #{materialId}
</if>
<if
test=
"materialId != null and materialId != ''"
>
and material_id = #{materialId}
</if>
...
@@ -32,34 +32,29 @@
...
@@ -32,34 +32,29 @@
<if
test=
"batchCode != null and batchCode != ''"
>
and batch_code = #{batchCode}
</if>
<if
test=
"batchCode != null and batchCode != ''"
>
and batch_code = #{batchCode}
</if>
<if
test=
"actualQuantity != null "
>
and actual_quantity = #{actualQuantity}
</if>
<if
test=
"actualQuantity != null "
>
and actual_quantity = #{actualQuantity}
</if>
<if
test=
"itemStatus != null "
>
and item_status = #{itemStatus}
</if>
<if
test=
"itemStatus != null "
>
and item_status = #{itemStatus}
</if>
<if
test=
"isUsed != null "
>
and is_used = #{isUsed}
</if>
</where>
</select>
</select>
<
select
id=
"deleteLog"
parameterType=
"OutboundOrderLog"
resultMap=
"OutboundOrderLogResult
"
>
<
update
id=
"deleteLog"
parameterType=
"OutboundOrderLog
"
>
delete from outbound_order_log
update outbound_order_log set is_used=0
<where>
<where>
<if
test=
"materialId != null and materialId != ''"
>
and material_id = #{materialId}
</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=
"warehouseId != null and warehouseId != ''"
>
and warehouse_id = #{warehouseId}
</if>
<if
test=
"batchCode != null and batchCode != ''"
>
and batch_code = #{batchCode}
</if>
<if
test=
"batchCode != null and batchCode != ''"
>
and batch_code = #{batchCode}
</if>
<if
test=
"itemStatus != null "
>
and item_status = #{itemStatus}
</if>
<if
test=
"itemStatus != null "
>
and item_status = #{itemStatus}
</if>
<!-- 补充inventory_id条件 -->
<if
test=
"inventoryId != null and inventoryId != ''"
>
and inventory_id = #{inventoryId}
</if>
<if
test=
"inventoryId != null and inventoryId != ''"
>
and inventory_id = #{inventoryId}
</if>
</where>
</where>
</
select
>
</
update
>
<!-- 修正参数错误:原#{id}改为#{inventoryId} -->
<select
id=
"selectLockedQuantityByInventory"
parameterType=
"OutboundOrderLog"
resultType=
"java.lang.Long"
>
<select
id=
"selectLockedQuantityByInventory"
parameterType=
"OutboundOrderLog"
resultType=
"java.lang.Long"
>
select ifnull(sum(actual_quantity), 0)
select ifnull(sum(actual_quantity), 0)
from outbound_order_log
from outbound_order_log
where item_status=1
where item_status=1
and is_used=1
<if
test=
"inventoryId != null and inventoryId != ''"
>
and inventory_id = #{inventoryId}
</if>
<if
test=
"inventoryId != null and inventoryId != ''"
>
and inventory_id = #{inventoryId}
</if>
</select>
</select>
<select
id=
"selectOutboundOrderLogById"
parameterType=
"String"
resultMap=
"OutboundOrderLogResult"
>
<select
id=
"selectOutboundOrderLogById"
parameterType=
"String"
resultMap=
"OutboundOrderLogResult"
>
<include
refid=
"selectOutboundOrderLogVo"
/>
<include
refid=
"selectOutboundOrderLogVo"
/>
where id = #{id}
where id = #{id}
and is_used=1
</select>
</select>
<!-- 插入语句补充inventory_id -->
<!-- 插入语句补充inventory_id -->
...
@@ -105,20 +100,20 @@
...
@@ -105,20 +100,20 @@
where id = #{id}
where id = #{id}
</update>
</update>
<
dele
te
id=
"deleteOutboundOrderLogById"
parameterType=
"String"
>
<
upda
te
id=
"deleteOutboundOrderLogById"
parameterType=
"String"
>
delete from outbound_order_log
where id = #{id}
update outbound_order_log set is_used=0
where id = #{id}
</
dele
te>
</
upda
te>
<
dele
te
id=
"deleteOutboundOrderLogByOrdersId"
parameterType=
"String"
>
<
upda
te
id=
"deleteOutboundOrderLogByOrdersId"
parameterType=
"String"
>
delete from outbound_order_log
where order_id = #{id}
update outbound_order_log set is_used=0
where order_id = #{id}
</
dele
te>
</
upda
te>
<
dele
te
id=
"deleteOutboundOrderLogByOrdersIds"
parameterType=
"String"
>
<
upda
te
id=
"deleteOutboundOrderLogByOrdersIds"
parameterType=
"String"
>
delete from outbound_order_log
where order_id in
update outbound_order_log set is_used=0
where order_id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
#{id}
</foreach>
</foreach>
</
dele
te>
</
upda
te>
<!-- 批量插入补充inventory_id -->
<!-- 批量插入补充inventory_id -->
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrdersMapper.xml
View file @
4551012a
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.ruoyi.inventory.mapper.OutboundOrdersMapper"
>
<mapper
namespace=
"com.ruoyi.inventory.mapper.OutboundOrdersMapper"
>
<resultMap
type=
"OutboundOrders"
id=
"OutboundOrdersResult"
>
<resultMap
type=
"
com.ruoyi.inventory.domain.
OutboundOrders"
id=
"OutboundOrdersResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"orderId"
column=
"order_id"
/>
<result
property=
"orderId"
column=
"order_id"
/>
<result
property=
"systemNo"
column=
"system_no"
/>
<result
property=
"systemNo"
column=
"system_no"
/>
...
@@ -27,12 +27,17 @@
...
@@ -27,12 +27,17 @@
<result
property=
"updateUserCode"
column=
"update_user_code"
/>
<result
property=
"updateUserCode"
column=
"update_user_code"
/>
</resultMap>
</resultMap>
<resultMap
id=
"OutboundOrdersOutboundOrderItemsResult"
type=
"OutboundOrders"
extends=
"OutboundOrdersResult"
>
<!-- 核心修复:删除重复的collection,只保留一个正确的关联配置 -->
<collection
property=
"outboundOrderItemsList"
ofType=
"OutboundOrderItems"
column=
"id"
select=
"selectOutboundOrderItemsList"
/>
<resultMap
id=
"OutboundOrdersOutboundOrderItemsResult"
type=
"com.ruoyi.inventory.domain.OutboundOrders"
extends=
"OutboundOrdersResult"
>
<collection
property=
"outboundOrderItemsList"
ofType=
"com.ruoyi.inventory.domain.OutboundOrderItems"
column=
"id"
select=
"selectOutboundOrderItemsList"
/>
</resultMap>
</resultMap>
<!--
修复:仅保留子表outbound_order_items的字段映射,删除错误的主表字段
-->
<!--
原主表结果映射:仅修复InboundOrderId大小写,其余完全保留
-->
<resultMap
type=
"OutboundOrderItems"
id=
"OutboundOrderItemsResult"
>
<resultMap
type=
"
com.ruoyi.inventory.domain.
OutboundOrderItems"
id=
"OutboundOrderItemsResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"orderId"
column=
"order_id"
/>
<result
property=
"orderId"
column=
"order_id"
/>
<result
property=
"materialId"
column=
"material_id"
/>
<result
property=
"materialId"
column=
"material_id"
/>
...
@@ -57,17 +62,17 @@
...
@@ -57,17 +62,17 @@
<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=
"
I
nboundOrderId"
column=
"inbound_order_id"
/>
<result
property=
"
i
nboundOrderId"
column=
"inbound_order_id"
/>
</resultMap>
</resultMap>
<!-- 以下所有代码完全保留,不做任何修改 -->
<sql
id=
"selectOutboundOrdersVo"
>
<sql
id=
"selectOutboundOrdersVo"
>
select id, order_id, system_no, order_type_id, batch_code, warehouse_id, owner_id, order_status, inbound_date, destination, total_planned_quantity, total_actual_quantity, total_packages, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code from outbound_orders
select id, order_id, system_no, order_type_id, batch_code, warehouse_id, owner_id, order_status, inbound_date, destination, total_planned_quantity, total_actual_quantity, total_packages, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code from outbound_orders
</sql>
</sql>
<select
id=
"selectOutboundOrdersList"
parameterType=
"OutboundOrders"
resultMap=
"OutboundOrdersResult"
>
<select
id=
"selectOutboundOrdersList"
parameterType=
"OutboundOrders"
resultMap=
"OutboundOrdersResult"
>
<include
refid=
"selectOutboundOrdersVo"
/>
<include
refid=
"selectOutboundOrdersVo"
/>
<where>
where is_used = 1
<if
test=
"orderId != null and orderId != ''"
>
and order_id = #{orderId}
</if>
<if
test=
"orderId != null and orderId != ''"
>
and order_id = #{orderId}
</if>
<if
test=
"systemNo != null and systemNo != ''"
>
and system_no = #{systemNo}
</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=
"orderTypeId != null and orderTypeId != ''"
>
and order_type_id = #{orderTypeId}
</if>
...
@@ -80,24 +85,21 @@
...
@@ -80,24 +85,21 @@
<if
test=
"totalPlannedQuantity != null "
>
and total_planned_quantity = #{totalPlannedQuantity}
</if>
<if
test=
"totalPlannedQuantity != null "
>
and total_planned_quantity = #{totalPlannedQuantity}
</if>
<if
test=
"totalActualQuantity != null "
>
and total_actual_quantity = #{totalActualQuantity}
</if>
<if
test=
"totalActualQuantity != null "
>
and total_actual_quantity = #{totalActualQuantity}
</if>
<if
test=
"totalPackages != null "
>
and total_packages = #{totalPackages}
</if>
<if
test=
"totalPackages != null "
>
and total_packages = #{totalPackages}
</if>
<if
test=
"isUsed != null "
>
and is_used = #{isUsed}
</if>
<if
test=
"sortNo != null "
>
and sort_no = #{sortNo}
</if>
<if
test=
"sortNo != null "
>
and sort_no = #{sortNo}
</if>
<if
test=
"createUserCode != null and createUserCode != ''"
>
and create_user_code = #{createUserCode}
</if>
<if
test=
"createUserCode != null and createUserCode != ''"
>
and create_user_code = #{createUserCode}
</if>
<if
test=
"updateUserCode != null and updateUserCode != ''"
>
and update_user_code = #{updateUserCode}
</if>
<if
test=
"updateUserCode != null and updateUserCode != ''"
>
and update_user_code = #{updateUserCode}
</if>
</where>
</select>
</select>
<select
id=
"selectOutboundOrdersById"
parameterType=
"String"
resultMap=
"OutboundOrdersOutboundOrderItemsResult"
>
<select
id=
"selectOutboundOrdersById"
parameterType=
"String"
resultMap=
"OutboundOrdersOutboundOrderItemsResult"
>
select id, order_id, system_no, order_type_id, batch_code, warehouse_id, owner_id, order_status, inbound_date, destination, total_planned_quantity, total_actual_quantity, total_packages, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code
select id, order_id, system_no, order_type_id, batch_code, warehouse_id, owner_id, order_status, inbound_date, destination, total_planned_quantity, total_actual_quantity, total_packages, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code
from outbound_orders
from outbound_orders
where id = #{id}
where id = #{id}
and is_used=1
</select>
</select>
<!-- 仅保留子表查询逻辑,字段完整且映射正确 -->
<select
id=
"selectOutboundOrderItemsList"
parameterType=
"String"
resultMap=
"OutboundOrderItemsResult"
>
<select
id=
"selectOutboundOrderItemsList"
parameterType=
"String"
resultMap=
"OutboundOrderItemsResult"
>
select id, order_id, material_id, batch_code, warehouse_id, location_id, inventory_id, outbound_order_id, unit_price, planned_quantity, actual_quantity, divisor, label_color, voucher_number, item_status, shipped_at, shipped_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, inventory_id, outbound_order_id, unit_price, planned_quantity, actual_quantity, divisor, label_color, voucher_number, item_status, shipped_at, shipped_by, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code
from outbound_order_items
from outbound_order_items
where o
rder_id = #{id}
where o
utbound_order_id = #{id} AND is_used=1
</select>
</select>
<insert
id=
"insertOutboundOrders"
parameterType=
"OutboundOrders"
>
<insert
id=
"insertOutboundOrders"
parameterType=
"OutboundOrders"
>
...
@@ -174,26 +176,26 @@
...
@@ -174,26 +176,26 @@
where id = #{id}
where id = #{id}
</update>
</update>
<
dele
te
id=
"deleteOutboundOrdersById"
parameterType=
"String"
>
<
upda
te
id=
"deleteOutboundOrdersById"
parameterType=
"String"
>
delete from outbound_orders
where id = #{id}
update outbound_orders set is_used=0
where id = #{id}
</
dele
te>
</
upda
te>
<
dele
te
id=
"deleteOutboundOrdersByIds"
parameterType=
"String"
>
<
upda
te
id=
"deleteOutboundOrdersByIds"
parameterType=
"String"
>
delete from outbound_orders
where id in
update outbound_orders set is_used=0
where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
#{id}
</foreach>
</foreach>
</
dele
te>
</
upda
te>
<
dele
te
id=
"deleteOutboundOrderItemsByOrderIds"
parameterType=
"String"
>
<
upda
te
id=
"deleteOutboundOrderItemsByOrderIds"
parameterType=
"String"
>
delete from outbound_order_items
where outbound_order_id in
update outbound_order_items set is_used=0
where outbound_order_id in
<foreach
item=
"orderId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"orderId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{orderId}
#{orderId}
</foreach>
</foreach>
</
dele
te>
</
upda
te>
<delete
id=
"deleteOutboundOrderItemsByOrderId"
parameterType=
"String"
>
<delete
id=
"deleteOutboundOrderItemsByOrderId"
parameterType=
"String"
>
delete from outbound_order_items
where outbound_order_id = #{orderId}
update outbound_order_items set is_used=0
where outbound_order_id = #{orderId}
</delete>
</delete>
<insert
id=
"batchOutboundOrderItems"
>
<insert
id=
"batchOutboundOrderItems"
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论