Explorar el Código

修改权限bug

523096025 hace 2 años
padre
commit
6f7faa3cd6

+ 0 - 7
huimv-admin/src/main/java/com/huimv/admin/config/ApiPrefixAutoConfiguration.java

@@ -8,13 +8,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 @Configuration
 public class ApiPrefixAutoConfiguration implements WebMvcConfigurer {
 
-    /**
-     *
-     * <p>
-     * 增加restApi前缀
-     * </p>
-     *
-     */
     @Override
     public void configurePathMatch(PathMatchConfigurer configurer) {
         configurer.addPathPrefix("/huatongApi",  c -> c.isAnnotationPresent(RestController.class));

+ 9 - 1
huimv-admin/src/main/java/com/huimv/admin/service/impl/EnvWarningThresholdServiceImpl.java

@@ -80,6 +80,7 @@ public class EnvWarningThresholdServiceImpl extends ServiceImpl<EnvWarningThresh
 
     @Override
     public Result add(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
+        String userIds = paramsMap.get("userIds");
         String farmId = paramsMap.get("farmId");
         String maxTem = paramsMap.get("maxTem");
         String minTem = paramsMap.get("minTem");
@@ -87,6 +88,13 @@ public class EnvWarningThresholdServiceImpl extends ServiceImpl<EnvWarningThresh
         String minHum = paramsMap.get("minHum");*/
         String maxNh3= paramsMap.get("maxNh3");
         String maxCo = paramsMap.get("maxCo");
+        //去掉
+       /* Integer userId = TokenSign.getMemberIdByJwtToken(httpServletRequest);
+        QueryWrapper<SysAccountMultilevel> wrapper = new QueryWrapper<>();
+        wrapper.like("pids",userId);
+        wrapper.like("farm_ids",farmId);
+        List<SysAccountMultilevel> page = accountMultilevelService.list( wrapper);
+        List<Integer> userIds = page.stream().map(SysAccountMultilevel::getId).collect(Collectors.toList());*/
 
         EnvWarningThreshold threshold = new EnvWarningThreshold();
       /*  threshold.setMaxHum(maxHum);
@@ -95,7 +103,7 @@ public class EnvWarningThresholdServiceImpl extends ServiceImpl<EnvWarningThresh
         threshold.setMinTem(minTem);
         threshold.setMaxNh3(maxNh3);
         threshold.setMaxCo(maxCo);
-        threshold.setUserIds(paramsMap.get("userIds"));
+        threshold.setUserIds(userIds);
         threshold.setFarmId(Integer.parseInt(farmId));
 
         if (Integer.parseInt(maxTem) < Integer.parseInt(minTem)) {