| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import com.core.common.Cools; |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | // 变更数量 |
| | | private Double count; |
| | | |
| | | public LocDetlAdjust(String matnr, String batch, Double count) { |
| | | this.matnr = matnr; |
| | | this.batch = batch; |
| | | this.count = count; |
| | | } |
| | | } |
| | | |
| | | public void integrate() { |
| | | if (Cools.isEmpty(list)) { |
| | | return; |
| | | } |
| | | List<LocDetlAdjust> copyList = new ArrayList<>(); |
| | | for (LocDetlAdjust adjust : list) { |
| | | boolean exit = false; |
| | | for (LocDetlAdjust copy : copyList) { |
| | | if (adjust.getMatnr().equals(copy.getMatnr()) && Cools.eq(adjust.getBatch(), copy.getBatch())) { |
| | | copy.setCount(copy.getCount() + adjust.getCount()); |
| | | exit = true; |
| | | break; |
| | | } |
| | | } |
| | | if (!exit) { |
| | | copyList.add(new LocDetlAdjustParam.LocDetlAdjust(adjust.getMatnr(), adjust.getBatch(), adjust.getCount())); |
| | | } |
| | | } |
| | | list = copyList; |
| | | } |
| | | |
| | | |