shjung 2 lat temu
rodzic
commit
ea72832c2d

+ 6 - 0
src/main/java/com/its/op/service/its/facility/TbFcltSubjPartInService.java

@@ -76,7 +76,13 @@ public class TbFcltSubjPartInService {
     @Transactional
     public TbFcltSubjPartInDto deleteById(TbFcltSubjPartInKey id) {
         TbFcltSubjPartIn entity = requireOne(id);
+
         this.repo.deleteById(id);
+
+        TbFcltSubjPartDto part = this.partService.findById(id.getPartNmbr());
+        int validCnt = part.getValidCnt() - entity.getInCnt();
+        this.partService.updateValidCount(id.getPartNmbr(), validCnt);
+
         return entity.toDto();
     }
 

+ 5 - 0
src/main/java/com/its/op/service/its/facility/TbFcltSubjPartOutService.java

@@ -79,6 +79,11 @@ public class TbFcltSubjPartOutService {
     public TbFcltSubjPartOutDto deleteById(TbFcltSubjPartOutKey id) {
         TbFcltSubjPartOut entity = requireOne(id);
         this.repo.deleteById(id);
+
+        TbFcltSubjPartDto part = this.partService.findById(id.getPartNmbr());
+        int validCnt = part.getValidCnt() + entity.getOutCnt();
+        this.partService.updateValidCount(id.getPartNmbr(), validCnt);
+
         return entity.toDto();
     }