Parcourir la source

修改脚本数据
添加重设参数值

18339543638 il y a 11 mois
Parent
commit
618e9c6ac0

+ 7 - 2
nb-service/web-service/src/main/java/com/nb/web/service/bus/service/LocalBusHospitalService.java

@@ -38,6 +38,7 @@ import com.nb.core.exception.CustomException;
 import com.nb.web.service.system.entity.SysRole;
 import com.nb.web.service.system.service.impl.SysRoleServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.jdbc.BadSqlGrammarException;
@@ -74,6 +75,9 @@ public class LocalBusHospitalService extends BaseService<BusHospitalMapper, BusH
     @Lazy
     private LocalBusConAlarmService conAlarmService;
 
+    @Value("${spring.profiles.active}")
+    private String env;
+
     @Autowired
     @Lazy
     private SysRoleServiceImpl sysRoleService;
@@ -195,8 +199,9 @@ public class LocalBusHospitalService extends BaseService<BusHospitalMapper, BusH
                 alarmCause.setTenantId(entity.getId());
             }).collect(Collectors.toSet()));
         };
-
-        sendIotAddHospital(entity);
+        if(StrUtil.equalsAny("prod",env)){
+            sendIotAddHospital(entity);
+        }
     }
 
     private void sendIotAddHospital(BusHospitalEntity source){