fix:
1.随机资料及配件工具包,机型台数根据发运更新
This commit is contained in:
parent
ec3bb451c5
commit
13e95d97b7
@ -434,10 +434,6 @@ public class ShippingDetailsFormPlugin extends AbstractBillPlugIn implements Bef
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ("yem_es_materialinfo".equals(name)) {
|
|
||||||
extracted1();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -477,6 +473,8 @@ public class ShippingDetailsFormPlugin extends AbstractBillPlugIn implements Bef
|
|||||||
this.getView().showMessage("删除单已存在下游单,不允许删除!!!");
|
this.getView().showMessage("删除单已存在下游单,不允许删除!!!");
|
||||||
e.setCancel(true);
|
e.setCancel(true);
|
||||||
}
|
}
|
||||||
|
qtys(rowIndexs);
|
||||||
|
|
||||||
}
|
}
|
||||||
if ("yem_es_salesorder_p".equals(name)) {
|
if ("yem_es_salesorder_p".equals(name)) {
|
||||||
Boolean aseqty = aseqty(rowIndexs);
|
Boolean aseqty = aseqty(rowIndexs);
|
||||||
@ -486,6 +484,40 @@ public class ShippingDetailsFormPlugin extends AbstractBillPlugIn implements Bef
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void qtys(int[] rowIndexs) {
|
||||||
|
Map<Long, BigDecimal> map = new HashMap<>();
|
||||||
|
for (int rowIndex : rowIndexs) {
|
||||||
|
DynamicObject yemProductmodel = (DynamicObject) this.getModel().getValue("yem_productmodel", rowIndex);
|
||||||
|
BigDecimal yemQty = (BigDecimal) this.getModel().getValue("yem_qty");
|
||||||
|
if (yemProductmodel != null) {
|
||||||
|
long aLong = yemProductmodel.getLong("id");
|
||||||
|
map.merge(aLong, yemQty, (a, b) -> b.add(a));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DynamicObjectCollection yemEsSalesorderP = this.getModel().getEntryEntity("yem_es_salesorder_p");
|
||||||
|
if (!yemEsSalesorderP.isEmpty()) {
|
||||||
|
List<Integer> ints = new ArrayList<>();
|
||||||
|
for (int i = 0; i < yemEsSalesorderP.size(); i++) {
|
||||||
|
DynamicObject yemAccessorytype = yemEsSalesorderP.get(i).getDynamicObject("yem_accessorytype");
|
||||||
|
if (yemAccessorytype != null) {
|
||||||
|
long aLong = yemAccessorytype.getLong("id");
|
||||||
|
BigDecimal yemPcstype = yemAccessorytype.getBigDecimal("yem_pcstype");
|
||||||
|
if (map.get(aLong) != null) {
|
||||||
|
if (yemPcstype.compareTo(map.get(aLong)) == 0) {
|
||||||
|
ints.add(i);
|
||||||
|
} else {
|
||||||
|
this.getModel().setValue("yem_pcstype", yemPcstype.subtract(map.get(aLong)), i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int[] intArray = ints.stream().mapToInt(Integer::intValue).toArray();
|
||||||
|
if (intArray.length > 0) {
|
||||||
|
this.getModel().deleteEntryRows("yem_es_salesorder_p", intArray);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void click(EventObject evt) {
|
public void click(EventObject evt) {
|
||||||
Control source = (Control) evt.getSource();
|
Control source = (Control) evt.getSource();
|
||||||
|
Loading…
Reference in New Issue
Block a user