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