xiangpei
2024-08-31 a5a5da73dec49c5cd23761edad8be98cde8a3b74
ycl-server/src/main/java/com/ycl/platform/service/impl/PlatformServiceImpl.java
@@ -49,18 +49,20 @@
        Date now = new Date();
        entity.setCreateTime(now);
        entity.setUpdateTime(now);
        entity.setArea(form.getAreaList().stream().collect(Collectors.joining(",")));
        baseMapper.insert(entity);
        if (! CollectionUtils.isEmpty(form.getDeployList())) {
            List<Platform> childList = form.getDeployList().stream().map(deploy -> {
                Platform child = new Platform();
                BeanUtils.copyProperties(deploy, child);
                child.setParentId(entity.getId());
                child.setCreateTime(now);
                child.setUpdateTime(now);
                return child;
            }).collect(Collectors.toList());
            this.saveBatch(childList);
        }
//        if (! CollectionUtils.isEmpty(form.getDeployList())) {
//            List<Platform> childList = form.getDeployList().stream().map(deploy -> {
//                Platform child = new Platform();
//                BeanUtils.copyProperties(deploy, child);
//                child.setPlatformName(entity.getPlatformName());
//                child.setParentId(entity.getId());
//                child.setCreateTime(now);
//                child.setUpdateTime(now);
//                return child;
//            }).collect(Collectors.toList());
//            this.saveBatch(childList);
//        }
        return Result.ok("添加成功");
    }