‘linchangsheng’ vor 5 Monaten
Ursprung
Commit
591227462d

+ 7 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/worker/WorkerWarrantyLogic.java

@@ -108,6 +108,7 @@ public class WorkerWarrantyLogic {
                     .count() > 0) {
                 throw new RemoteServiceException(user.getNickName()+"师傅已经添加过质保金");
             }
+
             WorkerWarranty workerWarranty = new WorkerWarranty();
             workerWarranty.setWebsitId(websitUser.getWebsitId());
             workerWarranty.setWebsitName(websitUser.getWebsitName());
@@ -120,9 +121,15 @@ public class WorkerWarrantyLogic {
             workerWarranty.setMobile(user.getMobile());
             workerWarranty.setEveryAmount(everyAmount);
             workerWarranty.setShouldAmount(shouldAmount);
+
+            if (workerWarranties.stream().filter(item -> item.getMobile().equals(workerWarranty.getMobile())).count() > 0) {
+                continue;
+            }
+
             workerWarranties.add(workerWarranty);
         }
 
+
         workerWarrantyService.saveBatch(workerWarranties);
     }