whyclxw
2024-09-03 00b061e3b820c6b414edfadaefbebe39eda65b01
src/main/java/com/whyc/service/DevA200TestparamService.java
@@ -76,6 +76,26 @@
        return dto;
    }
    //批量设置a200均衡仪参数
    public Object setA200ParamPl(List<A200ResDto> params) {
        Map<Integer,Object> map=new HashMap<>();
        try {
            ThreadPoolExecutor poolExecutor = ThreadPoolExecutorFactory.getPoolExecutor();
            CountDownLatch latch = new CountDownLatch(params.size());
            for (A200ResDto param:params) {
                poolExecutor.execute(() -> {
                    ResultA200Dto dto= (ResultA200Dto) setA200Param(param);
                    map.put(param.getDevId(),dto);
                    latch.countDown();
                });
            }
            latch.await(10, TimeUnit.MINUTES);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return new Response().set(1,true,"批量控制a200均衡仪");
    }
    //启动a200均衡仪放电/充电
    public Object startA200Param(int devId,int type) {
        QueryWrapper wrapper=new QueryWrapper();