| | |
| | | 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("添加成功"); |
| | | } |
| | | |