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
9aba2eb9
Commit
9aba2eb9
authored
Dec 24, 2025
by
zhangtw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出货主映射
parent
fb132a73
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
33 行增加
和
43 行删除
+33
-43
ruoyi-admin/src/main/java/com/ruoyi/web/controller/inventory/InboundOrdersController.java
+25
-23
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/Materials.java
+1
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/TO/InboundItemsTO.java
+4
-18
ruoyi-inventory/src/main/resources/mapper/inventory/InboundOrdersMapper.xml
+3
-1
没有找到文件。
ruoyi-admin/src/main/java/com/ruoyi/web/controller/inventory/InboundOrdersController.java
View file @
9aba2eb9
...
@@ -80,6 +80,7 @@ public class InboundOrdersController extends BaseController
...
@@ -80,6 +80,7 @@ public class InboundOrdersController extends BaseController
}
}
return
dictMap
;
return
dictMap
;
}
}
/**
/**
* 导出入库单主列表
* 导出入库单主列表
*/
*/
...
@@ -106,7 +107,8 @@ public class InboundOrdersController extends BaseController
...
@@ -106,7 +107,8 @@ public class InboundOrdersController extends BaseController
if
(
inboundItem
==
null
)
{
if
(
inboundItem
==
null
)
{
continue
;
continue
;
}
}
//实体中用的id,导出数据暂时用名称
inboundItem
.
setOwnerId
(
inboundItem
.
getOwnerName
());
// ========== 3.1 数学运算安全处理(避免除零/空值运算NPE) ==========
// ========== 3.1 数学运算安全处理(避免除零/空值运算NPE) ==========
// 初始化默认值,避免空值运算
// 初始化默认值,避免空值运算
Double
weight
=
inboundItem
.
getWeight
()
==
null
?
0.0
:
inboundItem
.
getWeight
();
Double
weight
=
inboundItem
.
getWeight
()
==
null
?
0.0
:
inboundItem
.
getWeight
();
...
@@ -128,28 +130,28 @@ public class InboundOrdersController extends BaseController
...
@@ -128,28 +130,28 @@ public class InboundOrdersController extends BaseController
inboundItem
.
setLabelColorName
(
StringUtils
.
defaultIfBlank
(
labelColorName
,
""
));
// 空值转为空字符串
inboundItem
.
setLabelColorName
(
StringUtils
.
defaultIfBlank
(
labelColorName
,
""
));
// 空值转为空字符串
// ========== 3.3 订单类型分支处理(空值保护) ==========
// ========== 3.3 订单类型分支处理(空值保护) ==========
String
orderTypeId
=
StringUtils
.
defaultIfBlank
(
inboundItem
.
getOrderTypeId
(),
"-"
);
//
String orderTypeId = StringUtils.defaultIfBlank(inboundItem.getOrderTypeId(), "-");
String
remark
=
StringUtils
.
defaultIfBlank
(
inboundItem
.
getRemark
(),
"-"
);
//
String remark = StringUtils.defaultIfBlank(inboundItem.getRemark(), "-");
String
systemNo
=
StringUtils
.
defaultIfBlank
(
inboundItem
.
getSystemNo
(),
"-"
);
//
String systemNo = StringUtils.defaultIfBlank(inboundItem.getSystemNo(), "-");
String
orderId
=
StringUtils
.
defaultIfBlank
(
inboundItem
.
getOrderId
(),
"-"
);
//
String orderId = StringUtils.defaultIfBlank(inboundItem.getOrderId(), "-");
switch
(
orderTypeId
)
{
//
switch (orderTypeId) {
case
"1"
:
//
case "1":
inboundItem
.
setRelocation
(
remark
);
//
inboundItem.setRelocation(remark);
break
;
//
break;
case
"2"
:
//
case "2":
inboundItem
.
setFinishedLocation
(
remark
);
//
inboundItem.setFinishedLocation(remark);
break
;
//
break;
case
"3"
:
//
case "3":
inboundItem
.
setRemarkTrdc
(
remark
);
//
inboundItem.setRemarkTrdc(remark);
inboundItem
.
setFinishedSystemNo
(
systemNo
);
//
inboundItem.setFinishedSystemNo(systemNo);
inboundItem
.
setFinishedOrderId
(
orderId
);
//
inboundItem.setFinishedOrderId(orderId);
break
;
//
break;
// 增加默认分支,避免未匹配的情况
//
// 增加默认分支,避免未匹配的情况
default
:
//
default:
// 可选:记录日志或设置默认值
//
// 可选:记录日志或设置默认值
break
;
//
break;
}
//
}
}
}
// 4. 导出Excel(最终兜底:确保传入非null列表)
// 4. 导出Excel(最终兜底:确保传入非null列表)
...
...
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/Materials.java
View file @
9aba2eb9
...
@@ -135,7 +135,7 @@ public class Materials extends BaseEntity
...
@@ -135,7 +135,7 @@ public class Materials extends BaseEntity
// ======================== 仅新增这一个库存字段 ========================
// ======================== 仅新增这一个库存字段 ========================
/** 库存数量(关联inventory表) */
/** 库存数量(关联inventory表) */
@Excel
(
name
=
"库存数量"
)
// @Excel(name = "库存数量",headerColor = IndexedColors.BLACK,headerBackgroundColor = IndexedColors.WHITE
)
private
Long
stock
;
private
Long
stock
;
// ======================== 原有所有getter/setter(完整保留) ========================
// ======================== 原有所有getter/setter(完整保留) ========================
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/TO/InboundItemsTO.java
View file @
9aba2eb9
...
@@ -70,17 +70,9 @@ public class InboundItemsTO extends BaseEntity {
...
@@ -70,17 +70,9 @@ public class InboundItemsTO extends BaseEntity {
@Excel
(
name
=
"仓库"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
@Excel
(
name
=
"仓库"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
private
String
warehouseId
;
private
String
warehouseId
;
/** 库位(成品) */
@Excel
(
name
=
"目标库位(成品)"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
private
String
finishedLocation
;
/** 备注(TRDC) */
/** 备注(TRDC) */
@Excel
(
name
=
"备注(TRDC)"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
@Excel
(
name
=
"备注"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
private
String
remarkTrdc
;
private
String
remark
;
/** 收货库位(正常) */
@Excel
(
name
=
"收货库位(正常)"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
private
String
relocation
;
/** 标签颜色 */
/** 标签颜色 */
@Excel
(
name
=
"标签颜色"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
@Excel
(
name
=
"标签颜色"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
...
@@ -106,14 +98,6 @@ public class InboundItemsTO extends BaseEntity {
...
@@ -106,14 +98,6 @@ public class InboundItemsTO extends BaseEntity {
@Excel
(
name
=
"系统编号"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
@Excel
(
name
=
"系统编号"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
private
String
systemNo
;
private
String
systemNo
;
/** 智观(客户订单号) */
@Excel
(
name
=
"智观(客户订单号)"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
private
String
finishedOrderId
;
/** 客户订单号/PO号 */
@Excel
(
name
=
"客户订单号/PO号"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
private
String
finishedSystemNo
;
/** 货主 */
/** 货主 */
@Excel
(
name
=
"货主"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
@Excel
(
name
=
"货主"
,
headerColor
=
IndexedColors
.
BLACK
,
headerBackgroundColor
=
IndexedColors
.
WHITE
)
private
String
ownerId
;
private
String
ownerId
;
...
@@ -134,6 +118,8 @@ public class InboundItemsTO extends BaseEntity {
...
@@ -134,6 +118,8 @@ public class InboundItemsTO extends BaseEntity {
/** 编号 */
/** 编号 */
private
String
id
;
private
String
id
;
private
String
ownerName
;
/** 入库单号 检索条件(主表Id) */
/** 入库单号 检索条件(主表Id) */
private
String
inboundOrderId
;
private
String
inboundOrderId
;
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/InboundOrdersMapper.xml
View file @
9aba2eb9
...
@@ -332,12 +332,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -332,12 +332,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ioi.divisor, ioi.actual_packages, ioi.actual_quantity,
ioi.divisor, ioi.actual_packages, ioi.actual_quantity,
m.total_weight, sl.location_name, ioi.warehouse_id,
m.total_weight, sl.location_name, ioi.warehouse_id,
ioi.label_color, ioi.voucher_number, m.storage_temperature,
ioi.label_color, ioi.voucher_number, m.storage_temperature,
m.hazard_id, io.order_id, io.system_no, io.owner_id,
m.hazard_id, io.order_id, io.system_no, io.owner_id,
o.owner_name,
ioi.label_quantity, io.order_type, io.order_type_id, ioi.remark
ioi.label_quantity, io.order_type, io.order_type_id, ioi.remark
from inbound_order_items as ioi
from inbound_order_items as ioi
left join materials as m on ioi.material_id = m.id
left join materials as m on ioi.material_id = m.id
left join inbound_orders as io on ioi.inbound_order_id = io.id
left join inbound_orders as io on ioi.inbound_order_id = io.id
left join storage_locations as sl on ioi.location_id = sl.id
left join storage_locations as sl on ioi.location_id = sl.id
left join owners as o on o.id = io.owner_id
<where>
<where>
<if
test=
"id != null and id != ''"
>
and io.id = #{id}
</if>
<if
test=
"id != null and id != ''"
>
and io.id = #{id}
</if>
<if
test=
"orderId != null and orderId != ''"
>
and io.order_id like concat('%', #{orderId}, '%')
</if>
<if
test=
"orderId != null and orderId != ''"
>
and io.order_id like concat('%', #{orderId}, '%')
</if>
...
@@ -389,6 +390,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -389,6 +390,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
column=
"system_no"
property=
"systemNo"
/>
<result
column=
"system_no"
property=
"systemNo"
/>
<result
column=
"owner_id"
property=
"ownerId"
/>
<result
column=
"owner_id"
property=
"ownerId"
/>
<result
column=
"owner_name"
property=
"ownerName"
/>
<result
column=
"label_quantity"
property=
"labelQuantity"
/>
<result
column=
"label_quantity"
property=
"labelQuantity"
/>
<result
column=
"order_type"
property=
"orderType"
/>
<result
column=
"order_type"
property=
"orderType"
/>
<result
column=
"order_type_id"
property=
"orderTypeId"
/>
<result
column=
"order_type_id"
property=
"orderTypeId"
/>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论