Browse Source

2025-10-15

拣货出库任务通知  销售发货装箱 查询优化
master
fengyuan_yang 3 months ago
parent
commit
685df55fa5
  1. 4
      src/main/java/com/gaotao/modules/boxManage/service/impl/BoxForNotificationServiceImpl.java
  2. 40
      src/main/resources/mapper/boxManage/BoxForNotificationMapper.xml

4
src/main/java/com/gaotao/modules/boxManage/service/impl/BoxForNotificationServiceImpl.java

@ -18,6 +18,8 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
import static com.gaotao.modules.outboundNotification.service.impl.OutboundNotificationServiceImpl.convertToSQLString;
@Service @Service
public class BoxForNotificationServiceImpl implements BoxForNotificationService { public class BoxForNotificationServiceImpl implements BoxForNotificationService {
@Autowired @Autowired
@ -342,6 +344,8 @@ public class BoxForNotificationServiceImpl implements BoxForNotificationService
@Override @Override
public List<OutboundNotificationHeadVo> searchOutboundNotificationWithDetail(OutboundNotificationHeadVo data) { public List<OutboundNotificationHeadVo> searchOutboundNotificationWithDetail(OutboundNotificationHeadVo data) {
String[] arr = convertToSQLString(data.getOrderStatus()).replace("(", "").replace(")", "").replace("'", "").split(",");
data.setStatusArr(arr);
return boxForNotificationMapper.searchOutboundNotificationWithDetail(data); return boxForNotificationMapper.searchOutboundNotificationWithDetail(data);
} }
} }

40
src/main/resources/mapper/boxManage/BoxForNotificationMapper.xml

@ -23,15 +23,10 @@
from so_receive_boxes s from so_receive_boxes s
left join warehouse w on s.WareHouseID = w.WareHouseID and s.site = w.site and s.bu_no = w.bu_no left join warehouse w on s.WareHouseID = w.WareHouseID and s.site = w.site and s.bu_no = w.bu_no
<where> <where>
<if test="site != null and site != ''">
and s.site = #{site}
</if>
s.site = #{site} and s.bu_no = #{buNo}
<if test="orderNo != null and orderNo != ''"> <if test="orderNo != null and orderNo != ''">
and s.order_no = #{orderNo} and s.order_no = #{orderNo}
</if> </if>
<if test="buNo != null and buNo != ''">
and s.bu_no = #{buNo}
</if>
<if test="boxType != null and boxType != ''"> <if test="boxType != null and boxType != ''">
and s.box_type = #{boxType} and s.box_type = #{boxType}
</if> </if>
@ -155,10 +150,23 @@
</delete> </delete>
<select id="searchRollForOrderNo" resultType="SoReceiveBoxRollsData"> <select id="searchRollForOrderNo" resultType="SoReceiveBoxRollsData">
select ROW_NUMBER() OVER (ORDER BY b.received_date) orderId, b.id,b.site,b.bu_no,
b.box_no,b.final_roll_no,b.roll_qty,b.received_by,b.received_date,b.WareHouseID,b.part_no,
c.warehouse_id,c.batch_no,c.location_id
from so_receive_boxes a left join so_receive_box_rolls b on a.site = b.site and a.box_no = b.box_no and a.bu_no = b.bu_no
select
ROW_NUMBER() OVER (ORDER BY b.received_date) orderId,
b.id,
b.site,
b.bu_no,
b.box_no,
b.final_roll_no,
b.roll_qty,
b.received_by,
b.received_date,
b.WareHouseID,
b.part_no,
c.warehouse_id,
c.batch_no,
c.location_id
from so_receive_boxes a
left join so_receive_box_rolls b on a.site = b.site and a.box_no = b.box_no and a.bu_no = b.bu_no
left join inventory_stock c on b.site = c.site and b.final_roll_no = c.roll_no and b.bu_no = c.bu_no left join inventory_stock c on b.site = c.site and b.final_roll_no = c.roll_no and b.bu_no = c.bu_no
where a.site = #{site} and a.order_no = #{orderNo} and a.bu_no = #{buNo} where a.site = #{site} and a.order_no = #{orderNo} and a.bu_no = #{buNo}
</select> </select>
@ -180,12 +188,7 @@
s.bu_no as buNo s.bu_no as buNo
FROM so_receive_cases s FROM so_receive_cases s
<where> <where>
<if test="site != null and site != ''">
AND s.site = #{site}
</if>
<if test="buNo != null and buNo != ''">
AND s.bu_no = #{buNo}
</if>
s.site = #{site} AND s.bu_no = #{buNo}
<if test="notifyNo != null and notifyNo != ''"> <if test="notifyNo != null and notifyNo != ''">
AND s.NotifyNo = #{notifyNo} AND s.NotifyNo = #{notifyNo}
</if> </if>
@ -333,7 +336,10 @@
AND a.order_type = #{orderType} AND a.order_type = #{orderType}
</if> </if>
<if test="orderStatus != null and orderStatus != ''"> <if test="orderStatus != null and orderStatus != ''">
AND a.order_status = #{orderStatus}
AND a.order_status in
<foreach collection="statusArr" close=")" open="(" item="item" separator=",">
#{item}
</foreach>
</if> </if>
<if test="customerId != null and customerId != ''"> <if test="customerId != null and customerId != ''">
AND a.customer_id LIKE '%' + #{customerId} + '%' AND a.customer_id LIKE '%' + #{customerId} + '%'

Loading…
Cancel
Save