Commit 9aba2eb9 by zhangtw

导出货主映射

parent fb132a73
......@@ -80,6 +80,7 @@ public class InboundOrdersController extends BaseController
}
return dictMap;
}
/**
* 导出入库单主列表
*/
......@@ -106,7 +107,8 @@ public class InboundOrdersController extends BaseController
if (inboundItem == null) {
continue;
}
//实体中用的id,导出数据暂时用名称
inboundItem.setOwnerId(inboundItem.getOwnerName());
// ========== 3.1 数学运算安全处理(避免除零/空值运算NPE) ==========
// 初始化默认值,避免空值运算
Double weight = inboundItem.getWeight() == null ? 0.0 : inboundItem.getWeight();
......@@ -128,28 +130,28 @@ public class InboundOrdersController extends BaseController
inboundItem.setLabelColorName(StringUtils.defaultIfBlank(labelColorName, "")); // 空值转为空字符串
// ========== 3.3 订单类型分支处理(空值保护) ==========
String orderTypeId = StringUtils.defaultIfBlank(inboundItem.getOrderTypeId(), "-");
String remark = StringUtils.defaultIfBlank(inboundItem.getRemark(), "-");
String systemNo = StringUtils.defaultIfBlank(inboundItem.getSystemNo(), "-");
String orderId = StringUtils.defaultIfBlank(inboundItem.getOrderId(), "-");
switch (orderTypeId) {
case "1":
inboundItem.setRelocation(remark);
break;
case "2":
inboundItem.setFinishedLocation(remark);
break;
case "3":
inboundItem.setRemarkTrdc(remark);
inboundItem.setFinishedSystemNo(systemNo);
inboundItem.setFinishedOrderId(orderId);
break;
// 增加默认分支,避免未匹配的情况
default:
// 可选:记录日志或设置默认值
break;
}
// String orderTypeId = StringUtils.defaultIfBlank(inboundItem.getOrderTypeId(), "-");
// String remark = StringUtils.defaultIfBlank(inboundItem.getRemark(), "-");
// String systemNo = StringUtils.defaultIfBlank(inboundItem.getSystemNo(), "-");
// String orderId = StringUtils.defaultIfBlank(inboundItem.getOrderId(), "-");
// switch (orderTypeId) {
// case "1":
// inboundItem.setRelocation(remark);
// break;
// case "2":
// inboundItem.setFinishedLocation(remark);
// break;
// case "3":
// inboundItem.setRemarkTrdc(remark);
// inboundItem.setFinishedSystemNo(systemNo);
// inboundItem.setFinishedOrderId(orderId);
// break;
// // 增加默认分支,避免未匹配的情况
// default:
// // 可选:记录日志或设置默认值
// break;
// }
}
// 4. 导出Excel(最终兜底:确保传入非null列表)
......
......@@ -135,7 +135,7 @@ public class Materials extends BaseEntity
// ======================== 仅新增这一个库存字段 ========================
/** 库存数量(关联inventory表) */
@Excel(name = "库存数量")
// @Excel(name = "库存数量",headerColor = IndexedColors.BLACK,headerBackgroundColor = IndexedColors.WHITE)
private Long stock;
// ======================== 原有所有getter/setter(完整保留) ========================
......
......@@ -70,17 +70,9 @@ public class InboundItemsTO extends BaseEntity {
@Excel(name = "仓库",headerColor = IndexedColors.BLACK,headerBackgroundColor = IndexedColors.WHITE)
private String warehouseId;
/** 库位(成品) */
@Excel(name = "目标库位(成品)",headerColor = IndexedColors.BLACK,headerBackgroundColor = IndexedColors.WHITE)
private String finishedLocation;
/** 备注(TRDC) */
@Excel(name = "备注(TRDC)",headerColor = IndexedColors.BLACK,headerBackgroundColor = IndexedColors.WHITE)
private String remarkTrdc;
/** 收货库位(正常) */
@Excel(name = "收货库位(正常)",headerColor = IndexedColors.BLACK,headerBackgroundColor = IndexedColors.WHITE)
private String relocation;
@Excel(name = "备注",headerColor = IndexedColors.BLACK,headerBackgroundColor = IndexedColors.WHITE)
private String remark;
/** 标签颜色 */
@Excel(name = "标签颜色",headerColor = IndexedColors.BLACK,headerBackgroundColor = IndexedColors.WHITE)
......@@ -106,14 +98,6 @@ public class InboundItemsTO extends BaseEntity {
@Excel(name = "系统编号",headerColor = IndexedColors.BLACK,headerBackgroundColor = IndexedColors.WHITE)
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)
private String ownerId;
......@@ -134,6 +118,8 @@ public class InboundItemsTO extends BaseEntity {
/** 编号 */
private String id;
private String ownerName;
/** 入库单号 检索条件(主表Id) */
private String inboundOrderId;
......
......@@ -332,12 +332,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ioi.divisor, ioi.actual_packages, ioi.actual_quantity,
m.total_weight, sl.location_name, ioi.warehouse_id,
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
from inbound_order_items as ioi
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 storage_locations as sl on ioi.location_id = sl.id
left join owners as o on o.id = io.owner_id
<where>
<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>
......@@ -389,6 +390,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result column="system_no" property="systemNo" />
<result column="owner_id" property="ownerId" />
<result column="owner_name" property="ownerName" />
<result column="label_quantity" property="labelQuantity" />
<result column="order_type" property="orderType" />
<result column="order_type_id" property="orderTypeId"/>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论