Explorar o código

面辅料编辑增加参照功能

huxy %!s(int64=2) %!d(string=hai) anos
pai
achega
3a8ff490f8

+ 6 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/impl/SyPackingListFabricServiceImpl.java

@@ -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{