|
@@ -136,6 +136,12 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
entity.setSyPackingListFabricId(syPackingListFabric.getId());
|
|
|
entity.setInventoryQuantity(entity.getActualDeclaredQuantity());//入库数量=实际报关数量
|
|
|
if(entity.getIsAdd()>0){//大于1就是新增数据
|
|
|
+ SyShippingDetailsItem s1 =syShippingDetailsItemMapper.selectById(entity.getSyShippingDetailsItemId());
|
|
|
+ //剩余数量-这次入库数量=新剩余数量
|
|
|
+ s1.setSurplusQuantity(s1.getSurplusQuantity().subtract(entity.getInventoryQuantity()));
|
|
|
+ //此次入库数量-剩余数量=超发数量
|
|
|
+ s1.setExcessQuantity(entity.getInventoryQuantity().subtract(s1.getSurplusQuantity()));
|
|
|
+ syShippingDetailsItemMapper.updateById(s1);
|
|
|
entity.setId(null);
|
|
|
syPackingListFabricItemMapper.insert(entity);
|
|
|
}else{
|