Browse Source

2025-10-14

销售发货装箱新增盒清单功能
master
fengyuan_yang 8 months ago
parent
commit
8767289e4d
  1. 15
      src/main/java/com/gaotao/modules/boxManage/controller/BoxForNotificationController.java
  2. 11
      src/main/java/com/gaotao/modules/boxManage/dao/BoxForNotificationMapper.java
  3. 7
      src/main/java/com/gaotao/modules/boxManage/service/BoxForNotificationService.java
  4. 13
      src/main/java/com/gaotao/modules/boxManage/service/impl/BoxForNotificationServiceImpl.java
  5. 16
      src/main/java/com/gaotao/modules/outboundNotification/entity/vo/OutboundNotificationHeadVo.java
  6. 111
      src/main/resources/mapper/boxManage/BoxForNotificationMapper.xml

15
src/main/java/com/gaotao/modules/boxManage/controller/BoxForNotificationController.java

@ -156,4 +156,19 @@ public class BoxForNotificationController {
srmSupplierService.saveCaseRollList(dataList);
return R.ok();
}
/**
* 查询出库通知单主记录关联明细
* @description 用于销售发货装箱查询单独查询出库通知单主记录并关联明细
* @author AI
* @date 2025/10/14
* @param data 查询条件
* @return R
*/
@PostMapping(value="/searchOutboundNotificationWithDetail")
@ResponseBody
public R searchOutboundNotificationWithDetail(@RequestBody OutboundNotificationHeadVo data) {
List<OutboundNotificationHeadVo> rows = srmSupplierService.searchOutboundNotificationWithDetail(data);
return R.ok().put("rows", rows);
}
}

11
src/main/java/com/gaotao/modules/boxManage/dao/BoxForNotificationMapper.java

@ -30,6 +30,10 @@ public interface BoxForNotificationMapper {
@Param("site") String site,
@Param("buNo") String buNo);
List<InventoryStock> selectByRollNo2(@Param("rollNo") String rollNo,
@Param("site") String site,
@Param("buNo") String buNo);
void updateStockParentRollNo(@Param("rollNo") String rollNo,@Param("parentRollNo")String parentRollNo,@Param("site")String site,@Param("buNo")String buNo);
void addBoxRoll(SoReceiveBoxRollsData data);
@ -45,4 +49,11 @@ public interface BoxForNotificationMapper {
SoReceiveCasesData validateCaseRoll(@Param("site") String site, @Param("partNo") String partNo, @Param("rollNo") String rollNo, @Param("casesNo") String casesNo);
void saveSoReceiveCases(SoReceiveCasesData data);
void updateStockParentRollType(@Param("rollNo") String rollNo, @Param("parentRollNo") String parentRollNo, @Param("parentRollType") String parentRollType, @Param("site") String site, @Param("buNo") String buNo);
/**
* 查询出库通知单主记录关联明细
* @param data 查询条件
* @return 出库通知单主记录列表
*/
List<OutboundNotificationHeadVo> searchOutboundNotificationWithDetail(OutboundNotificationHeadVo data);
}

7
src/main/java/com/gaotao/modules/boxManage/service/BoxForNotificationService.java

@ -30,4 +30,11 @@ public interface BoxForNotificationService {
void deleteSoReceiveCasesData(SoReceiveCasesData data);
SoReceiveCasesData validateAndScanCaseRoll(SoReceiveCasesData data);
void saveCaseRollList(List<SoReceiveCasesData> dataList);
/**
* 查询出库通知单主记录关联明细
* @param data 查询条件
* @return 出库通知单主记录列表包含明细信息
*/
List<OutboundNotificationHeadVo> searchOutboundNotificationWithDetail(OutboundNotificationHeadVo data);
}

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

@ -10,7 +10,6 @@ import com.gaotao.modules.outboundNotification.entity.vo.OutboundNotificationHea
import com.gaotao.modules.sys.entity.SysUserEntity;
import com.gaotao.modules.trans.entity.TransNoControl;
import com.gaotao.modules.trans.service.TransNoControlService;
import com.gaotao.modules.inventoryStock.dao.InventoryStockMapper;
import com.gaotao.modules.inventoryStock.entity.InventoryStock;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -117,11 +116,14 @@ public class BoxForNotificationServiceImpl implements BoxForNotificationService
throw new RuntimeException("箱子不在仓库中,无法操作");
}
// 2. 查卷状态
InventoryStock stock = boxForNotificationMapper.selectByRollNo(
List<InventoryStock> stocks = boxForNotificationMapper.selectByRollNo2(
data.getFinalRollNo(), data.getSite(), data.getBuNo());
if(stock == null) {
if(stocks.isEmpty()) {
throw new RuntimeException("卷不存在");
}
// 多个卷取第一个做校验
InventoryStock stock = stocks.get(0);
if(!"在库".equals(stock.getStatus())) {
throw new RuntimeException("卷状态不是在库,无法操作");
}
@ -335,4 +337,9 @@ public class BoxForNotificationServiceImpl implements BoxForNotificationService
boxForNotificationMapper.updateStockParentRollType(data.getRollNo(), data.getCasesNo(), "盒标签", data.getSite(), data.getBuNo());
}
}
@Override
public List<OutboundNotificationHeadVo> searchOutboundNotificationWithDetail(OutboundNotificationHeadVo data) {
return boxForNotificationMapper.searchOutboundNotificationWithDetail(data);
}
}

16
src/main/java/com/gaotao/modules/outboundNotification/entity/vo/OutboundNotificationHeadVo.java

@ -1,13 +1,14 @@
package com.gaotao.modules.outboundNotification.entity.vo;
import com.gaotao.modules.inboundNotification.entity.InboundNotificationHeadEntity;
import com.gaotao.modules.outboundNotification.entity.OutboundNotificationHeadEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper=false)
public class OutboundNotificationHeadVo extends OutboundNotificationHeadEntity {
private String bu;
private Date startDate;
@ -16,4 +17,17 @@ public class OutboundNotificationHeadVo extends OutboundNotificationHeadEntity {
private String customerName;
private List<OutboundNotificationHeadVo> submitList;
private String[] statusArr;
// 出库单明细信息字段
private String partNo; // 物料编码
private String partDesc; // 物料名称
private String unit; // 单位
private Double requiredQty; // 要求发货数量
private String outBatchNo; // 合约号
private Double orderQty; // 销售订单数量
private String detailOutWarehouse; // 明细出库仓库
private String detailRelatedOrderNo; // 明细关联订单号
private String detailRelatedOrderLineNo; // 明细关联订单行号
private Double rollQty; // 已扫描数量
private Double unScanQty; // 未扫描数量
}

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

@ -70,13 +70,20 @@
set [status]=#{status}
where id=#{id}
</update>
<select id="selectByRollNo" resultType="InventoryStock">
<select id="selectByRollNo" resultType="com.gaotao.modules.inventoryStock.entity.InventoryStock">
SELECT *
FROM inventory_stock
WHERE roll_no = #{rollNo}
AND site = #{site}
AND bu_no = #{buNo}
</select>
<select id="selectByRollNo2" resultType="com.gaotao.modules.inventoryStock.entity.InventoryStock">
SELECT *
FROM inventory_stock
WHERE parent_roll_no = #{rollNo}
AND site = #{site}
AND bu_no = #{buNo}
</select>
<update id="updateStockParentRollNo">
@ -99,7 +106,7 @@
and bu_no = #{buNo}
</update>
<select id="searchOutboundNotificationDetail" resultType="OutboundNotificationDetailEntity">
<select id="searchOutboundNotificationDetail" resultType="com.gaotao.modules.outboundNotification.entity.OutboundNotificationDetailEntity">
select site,bu_no,order_no,part_no,part_desc,unit,required_qty,out_warehouse,out_batch_no,created_by,created_date,updated_by,
updated_date,order_qty,related_order_no,related_order_line_no
from outbound_notification_detail
@ -227,4 +234,104 @@
AND site = #{site}
AND bu_no = #{buNo}
</update>
<!-- 查询出库通知单主记录(关联明细) -->
<select id="searchOutboundNotificationWithDetail" resultType="com.gaotao.modules.outboundNotification.entity.vo.OutboundNotificationHeadVo">
SELECT
a.site,
a.bu_no as buNo,
dbo.get_bu_desc(a.site, a.bu_no) as buDesc,
a.order_no as orderNo,
a.order_type as orderType,
a.order_status as orderStatus,
a.customer_id as customerId,
c.customerName,
a.related_order_no as relatedOrderNo,
a.related_order_line_no as relatedOrderLineNo,
a.required_outbound_date as requiredOutboundDate,
a.remarks,
a.erp_order_no as erpOrderNo,
a.erp_order_line_no as erpOrderLineNo,
a.erp_order_date as erpOrderDate,
a.created_by as createdBy,
a.created_date as createdDate,
a.updated_by as updatedBy,
a.updated_date as updatedDate,
a.assigned_by as assignedBy,
a.assigned_date as assignedDate,
a.closed_by as closedBy,
a.closed_date as closedDate,
a.archived_by as archivedBy,
a.archived_date as archivedDate,
a.orderref1,
a.orderref2,
a.orderref3,
a.orderref4,
a.orderref5,
a.order_date as orderDate,
a.close_flag as closeFlag,
a.out_warehouse as outWarehouse,
a.customer_order_no as customerOrderNo,
a.show_in_query_flag as showInQueryFlag,
<!-- 关联明细信息 -->
b.part_no as partNo,
b.part_desc as partDesc,
b.unit,
b.required_qty as requiredQty,
b.out_warehouse as detailOutWarehouse,
b.out_batch_no as outBatchNo,
b.order_qty as orderQty,
b.related_order_no as detailRelatedOrderNo,
b.related_order_line_no as detailRelatedOrderLineNo,
<!-- 已扫描数量和未扫描数量 -->
ISNULL(SUM(e.roll_qty), 0) as rollQty,
CASE WHEN b.required_qty - ISNULL(SUM(e.roll_qty), 0) > 0
THEN ROUND(b.required_qty - ISNULL(SUM(e.roll_qty), 0), 3)
ELSE 0
END as unScanQty
FROM outbound_notification_head a
LEFT JOIN Customer c ON a.site = c.site AND a.customer_id = c.CustomerID
LEFT JOIN outbound_notification_detail b ON a.site = b.site AND a.bu_no = b.bu_no AND a.order_no = b.order_no
LEFT JOIN so_receive_boxes d ON b.site = d.site AND b.bu_no = d.bu_no AND b.order_no = d.order_no
LEFT JOIN so_receive_box_rolls e ON b.site = e.site AND b.bu_no = e.bu_no AND d.box_no = e.box_no AND b.part_no = e.part_no
<where>
<if test="site != null and site != ''">
AND a.site = #{site}
</if>
<if test="buNo != null and buNo != ''">
AND a.bu_no = #{buNo}
</if>
<if test="orderNo != null and orderNo != ''">
AND a.order_no LIKE '%' + #{orderNo} + '%'
</if>
<if test="orderType != null and orderType != ''">
AND a.order_type = #{orderType}
</if>
<if test="orderStatus != null and orderStatus != ''">
AND a.order_status = #{orderStatus}
</if>
<if test="customerId != null and customerId != ''">
AND a.customer_id LIKE '%' + #{customerId} + '%'
</if>
<if test="customerName != null and customerName != ''">
AND c.customerName LIKE '%' + #{customerName} + '%'
</if>
<if test="startDate != null">
AND a.required_outbound_date >= #{startDate}
</if>
<if test="endDate != null">
AND #{endDate} >= a.required_outbound_date
</if>
</where>
GROUP BY
a.site, a.bu_no, a.order_no, a.order_type, a.order_status, a.customer_id, c.customerName,
a.related_order_no, a.related_order_line_no, a.required_outbound_date, a.remarks,
a.erp_order_no, a.erp_order_line_no, a.erp_order_date, a.created_by, a.created_date,
a.updated_by, a.updated_date, a.assigned_by, a.assigned_date, a.closed_by, a.closed_date,
a.archived_by, a.archived_date, a.orderref1, a.orderref2, a.orderref3, a.orderref4, a.orderref5,
a.order_date, a.close_flag, a.out_warehouse, a.customer_order_no, a.show_in_query_flag,
b.part_no, b.part_desc, b.unit, b.required_qty, b.out_warehouse, b.out_batch_no, b.order_qty,
b.related_order_no, b.related_order_line_no
ORDER BY a.created_date DESC, b.part_no
</select>
</mapper>
Loading…
Cancel
Save