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 String locNo;
|
|
// 调整库存明细集合
|
private List<LocDetlAdjust> list;
|
|
@Data
|
public static class LocDetlAdjust {
|
|
// 物料号
|
private String matnr;
|
|
// 序列码
|
private String batch;
|
|
// 变更数量
|
private Double count;
|
|
// 销售订单号
|
private String threeCode;
|
|
//销售订单行号
|
private String deadTime;
|
|
//料箱码
|
private String suppCode;
|
|
public LocDetlAdjust(String matnr, String batch, Double count, String threeCode, String deadTime, String suppCode) {
|
this.matnr = matnr;
|
this.batch = batch;
|
this.count = count;
|
this.threeCode = threeCode;
|
this.deadTime = deadTime;
|
this.suppCode = suppCode;
|
}
|
}
|
|
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()) && Cools.eq(adjust.getSuppCode(),copy.getSuppCode()) && Cools.eq(adjust.getThreeCode(),copy.getThreeCode()) && Cools.eq(adjust.getDeadTime(),copy.getDeadTime())) {
|
copy.setCount(copy.getCount() + adjust.getCount());
|
exit = true;
|
break;
|
}
|
}
|
if (!exit) {
|
copyList.add(new LocDetlAdjustParam.LocDetlAdjust(adjust.getMatnr(), adjust.getBatch(), adjust.getCount(), adjust.getThreeCode(), adjust.getDeadTime(),adjust.getSuppCode()));
|
}
|
}
|
list = copyList;
|
}
|
|
|
}
|