Browse Source

移动端-重复添加地点BUG修复

jichaobo 2 years ago
parent
commit
88b9cea281

+ 4 - 4
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanSonServiceImpl.java

@@ -360,11 +360,11 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
     @Override
     public void addSite(PatrolInspectionSite patrolInspectionSite) {
         LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
-        queryWrapper.eq(PatrolInspectionSite::getSiteNubmber,patrolInspectionSite.getSiteNubmber())
-                .eq(PatrolInspectionSite::getEnable,1);
+        queryWrapper.eq(PatrolInspectionSite::getSiteNubmber, patrolInspectionSite.getSiteNubmber())
+                .eq(PatrolInspectionSite::getEnable, 1);
         int list = patrolInspectionSiteService.count(queryWrapper);
-        if (list>0){
-            throw new BusinessException("子计划不存在地点,请联系管理人员");
+        if (list > 0) {
+            throw new BusinessException("不可重复采集地点");
         }
         patrolInspectionSite.setCreator(SecurityUtils.getUsername());
         patrolInspectionSite.setCollector(SecurityUtils.getUsername());