Commit c0db3aae by yubin

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/OutboundOrdersServiceImpl.java
#	ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrderItemsMapper.xml
#	ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrderLogMapper.xml
#	ruoyi-inventory/src/main/resources/mapper/inventory/OutboundOrdersMapper.xml
parents cc2295c5 4551012a
...@@ -465,10 +465,14 @@ export default { ...@@ -465,10 +465,14 @@ export default {
materialId: materialId, materialId: materialId,
outboundOrderId: this.ordersId outboundOrderId: this.ordersId
}; };
console.log('【查询库存参数】', params);
const res = await listInventoryByMaterialId(params); const res = await listInventoryByMaterialId(params);
console.log('【库存接口返回】', res);
console.log('【库存接口原始行数据】', res.rows); // 打印原始行数据
if (res.code === 200) { if (res.code === 200) {
this.inventoryList = []; this.inventoryList = [];
(res.rows || []).forEach(item => { (res.rows || []).forEach(item => {
console.log('【单条库存数据】', item); // 打印单条库存数据
const newRow = { const newRow = {
// 核心修复:优先取item.inventoryId(匹配回显字段),兼容item.id // 核心修复:优先取item.inventoryId(匹配回显字段),兼容item.id
inventoryId: item.inventoryId || item.id, inventoryId: item.inventoryId || item.id,
......
...@@ -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>
......
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
is_used = #{isUsed} is_used = #{isUsed}
</if> </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="outboundOrderId != null and outboundOrderId != ''"> and outbound_order_id = #{outboundOrderId}</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>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if> <if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
...@@ -88,7 +87,6 @@ ...@@ -88,7 +87,6 @@
<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="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>
...@@ -195,10 +193,10 @@ ...@@ -195,10 +193,10 @@
where id = #{id} where id = #{id}
</update> </update>
<!-- 单条删除:物理删除改为逻辑删除(更新is_used=0) --> <!-- 单条删除:逻辑删除 -->
<update id="deleteOutboundOrderItemsById" parameterType="String"> <update id="deleteOutboundOrderItemsById" parameterType="String">
update outbound_order_items update outbound_order_items
set is_used = 0, set is_used = 0
where id = #{id} where id = #{id}
</update> </update>
...@@ -265,10 +263,10 @@ ...@@ -265,10 +263,10 @@
ORDER BY oi.create_time DESC ORDER BY oi.create_time DESC
</select> </select>
<!-- 批量删除:物理删除改为逻辑删除 --> <!-- 批量删除:逻辑删除 -->
<update id="deleteOutboundOrderItemsByIds" parameterType="String"> <update id="deleteOutboundOrderItemsByIds" parameterType="String">
update outbound_order_items update outbound_order_items
set is_used = 0, set is_used = 0
where id in where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
<if test="itemStatus != null "> and item_status = #{itemStatus}</if> <if test="itemStatus != null "> and item_status = #{itemStatus}</if>
</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>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<if test="itemStatus != null "> and item_status = #{itemStatus}</if> <if test="itemStatus != null "> and item_status = #{itemStatus}</if>
<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>
<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)
...@@ -100,20 +100,20 @@ ...@@ -100,20 +100,20 @@
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteOutboundOrderLogById" parameterType="String"> <update id="deleteOutboundOrderLogById" parameterType="String">
update outbound_order_log set is_used=0 where id = #{id} update outbound_order_log set is_used=0 where id = #{id}
</delete> </update>
<delete id="deleteOutboundOrderLogByOrdersId" parameterType="String"> <update id="deleteOutboundOrderLogByOrdersId" parameterType="String">
update outbound_order_log set is_used=0 where order_id = #{id} update outbound_order_log set is_used=0 where order_id = #{id}
</delete> </update>
<delete id="deleteOutboundOrderLogByOrdersIds" parameterType="String"> <update id="deleteOutboundOrderLogByOrdersIds" parameterType="String">
update outbound_order_log set is_used=0 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>
</delete> </update>
<!-- 批量插入补充inventory_id --> <!-- 批量插入补充inventory_id -->
......
...@@ -176,23 +176,23 @@ ...@@ -176,23 +176,23 @@
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteOutboundOrdersById" parameterType="String"> <update id="deleteOutboundOrdersById" parameterType="String">
update outbound_orders set is_used=0 where id = #{id} update outbound_orders set is_used=0 where id = #{id}
</delete> </update>
<delete id="deleteOutboundOrdersByIds" parameterType="String"> <update id="deleteOutboundOrdersByIds" parameterType="String">
update outbound_orders set is_used=0 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>
</delete> </update>
<delete id="deleteOutboundOrderItemsByOrderIds" parameterType="String"> <update id="deleteOutboundOrderItemsByOrderIds" parameterType="String">
update outbound_order_items set is_used=0 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>
</delete> </update>
<delete id="deleteOutboundOrderItemsByOrderId" parameterType="String"> <delete id="deleteOutboundOrderItemsByOrderId" parameterType="String">
update outbound_order_items set is_used=0 where outbound_order_id = #{orderId} update outbound_order_items set is_used=0 where outbound_order_id = #{orderId}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论