Browse Source

生产订单查询

master
常熟吴彦祖 4 months ago
parent
commit
165f53fa18
  1. 4
      src/main/java/com/gaotao/modules/boxManage/data/SoReceiveBoxRollsData.java
  2. 18
      src/main/java/com/gaotao/modules/boxManage/service/impl/BoxForNotificationServiceImpl.java
  3. 5
      src/main/resources/mapper/boxManage/BoxForNotificationMapper.xml

4
src/main/java/com/gaotao/modules/boxManage/data/SoReceiveBoxRollsData.java

@ -9,4 +9,8 @@ import org.apache.ibatis.type.Alias;
@Alias("SoReceiveBoxRollsData")
public class SoReceiveBoxRollsData extends SoReceiveBoxRolls {
private Integer orderId;
private String batchNo;
private String locationId;
}

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

@ -137,12 +137,18 @@ public class BoxForNotificationServiceImpl implements BoxForNotificationService
if (!partNoMatch) {
throw new RuntimeException("该卷的物料编号与销售发货单中的物料编号不匹配");
}
// 校验批次号只要有一行partNo和batchNo都匹配即可
boolean batchNoMatch = checkPartNo.stream()
.filter(detail -> detail.getPartNo() != null && detail.getPartNo().equals(stock.getPartNo()))
.anyMatch(detail -> detail.getOutBatchNo() != null && detail.getOutBatchNo().equals(stock.getBatchNo()));
if (!batchNoMatch) {
throw new RuntimeException("该卷的批次号与销售发货单中的批次号不匹配");
if(stock.getBatchNo()==null||"".equals(stock.getBatchNo())){
throw new RuntimeException("该卷的批次号为空,无法操作");
}
//---*批号的物料可以通吃
if(!"*".equals(stock.getBatchNo())) {
// 校验批次号只要有一行partNo和batchNo都匹配即可
boolean batchNoMatch = checkPartNo.stream()
.filter(detail -> detail.getPartNo() != null && detail.getPartNo().equals(stock.getPartNo()))
.anyMatch(detail -> detail.getOutBatchNo() != null && detail.getOutBatchNo().equals(stock.getBatchNo()));
if (!batchNoMatch) {
throw new RuntimeException("该卷的批次号与销售发货单中的批次号不匹配");
}
}
// 检查箱的仓库是否为空如果为空则更新为卷的仓库如果不为空则检查是否一致
if(box.getWareHouseID()==null||"".equals(box.getWareHouseID())){

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

@ -124,9 +124,10 @@
<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
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
where a.site = #{site} and a.order_no = #{orderNo} and a.bu_no = #{buNo}
</select>
</mapper>
Loading…
Cancel
Save