Commit 9aba2eb9 by zhangtw

导出货主映射

parent fb132a73
...@@ -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列表)
......
...@@ -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(完整保留) ========================
......
...@@ -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;
......
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论