| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import com.core.common.Cools; |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/6/18 |
| | | */ |
| | | @Data |
| | | public class LocDetlAdjustParam { |
| | | |
| | | // 库位号 |
| | |
| | | // 调整库存明细集合 |
| | | private List<LocDetlAdjust> list; |
| | | |
| | | @Data |
| | | public static class LocDetlAdjust { |
| | | |
| | | // 物料号 |
| | | private String matNo; |
| | | // 商品编号 |
| | | private String matnr; |
| | | |
| | | // 序列码 |
| | | private String batch; |
| | | |
| | | // 变更数量 |
| | | private Double count; |
| | | |
| | | public String getMatNo() { |
| | | return matNo; |
| | | } |
| | | |
| | | public void setMatNo(String matNo) { |
| | | this.matNo = matNo; |
| | | } |
| | | |
| | | public Double getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Double count) { |
| | | public LocDetlAdjust(String matnr, String batch, Double count) { |
| | | this.matnr = matnr; |
| | | this.batch = batch; |
| | | this.count = count; |
| | | } |
| | | } |
| | | |
| | | public String getLocNo() { |
| | | return locNo; |
| | | 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; |
| | | } |
| | | |
| | | public void setLocNo(String locNo) { |
| | | this.locNo = locNo; |
| | | } |
| | | |
| | | public List<LocDetlAdjust> getList() { |
| | | return list; |
| | | } |
| | | |
| | | public void setList(List<LocDetlAdjust> list) { |
| | | this.list = list; |
| | | } |
| | | |
| | | } |