|
|
@@ -1,5 +1,6 @@
|
|
|
package com.nb.bus.service;
|
|
|
|
|
|
+import cn.dev33.satoken.spring.SpringMVCUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
@@ -31,8 +32,11 @@ import org.springframework.boot.CommandLineRunner;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.jdbc.BadSqlGrammarException;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.context.request.RequestContextHolder;
|
|
|
+import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
@@ -93,6 +97,10 @@ public class LocalBusHospitalService extends BaseService<BusHospitalMapper, BusH
|
|
|
|
|
|
@Override
|
|
|
public void validateBeforeUpdate(BusHospitalEntity entity) {
|
|
|
+ ServletRequestAttributes request = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
|
|
+ if(request==null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
if("1".equals(entity.getId())){
|
|
|
throw new CustomException("系统级医院,不可修改");
|
|
|
}
|
|
|
@@ -193,10 +201,12 @@ public class LocalBusHospitalService extends BaseService<BusHospitalMapper, BusH
|
|
|
saveDefaultHospital();
|
|
|
List<BusHospitalEntity> list = list();
|
|
|
list.forEach(entity -> {
|
|
|
+ entity.setScriptOnline(false);
|
|
|
nameCache.setConfig(entity.getId(),entity.getName());
|
|
|
});
|
|
|
+ this.updateBatchById(list);
|
|
|
configService.saveDefaultConfig();
|
|
|
- list.forEach(hospital->hospitalManagerRegister.refresh(hospital.getId(),true,true,true,true));
|
|
|
+ list.forEach(hospital-> hospitalManagerRegister.refresh(hospital.getId(),true,true,true,true));
|
|
|
}
|
|
|
|
|
|
|