Ver código fonte

Merge remote-tracking branch 'origin/master'

ljx 4 anos atrás
pai
commit
f9116c745f

+ 3 - 0
src/main/java/com/imed/costaccount/common/swagger/SwaggerConfig.java

@@ -4,6 +4,7 @@ import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrap
 import io.swagger.annotations.ApiOperation;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 import springfox.documentation.builders.ApiInfoBuilder;
 import springfox.documentation.builders.PathSelectors;
@@ -18,6 +19,8 @@ import java.util.List;
 
 import static com.google.common.collect.Lists.newArrayList;
 
+
+@Profile({"dev"})
 @Configuration
 @EnableSwagger2
 @EnableSwaggerBootstrapUI

+ 1 - 1
src/main/java/com/imed/costaccount/service/impl/RoleMenuServiceImpl.java

@@ -118,7 +118,7 @@ public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> i
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public void saveRoleMenu(RoleMenuDTO roleMenuDTO, Long hospId) {
         Long roleId = roleMenuDTO.getRoleId();
-        this.removeById(roleId);
+        this.removeById(new LambdaQueryWrapper<RoleMenu>().eq(RoleMenu::getRoleId, roleId).eq(RoleMenu::getHospId, hospId));
         List<Long> menuIds = roleMenuDTO.getMenuIds();
         if (CollUtil.isNotEmpty(menuIds)) {
             List<RoleMenu> roleMenus = menuIds.stream().map(i -> {