| | |
| | | if (!roleIds.contains("8f9ef89f6b2d4d8e9ea1fc8d2f25ce69")) { |
| | | throw new ValidationException("非编辑角色不能新增"); |
| | | } |
| | | // 判断系统是否存在重复的名称+类型+年份,如果有就不保存 |
| | | FilmWorks filmWorksByName = filmWorksMapper.getFilmWorksByName(filmWorksDTO.getNameCn(), filmWorksDTO.getType(), filmWorksDTO.getReleaseYear()); |
| | | if (!ObjectUtils.isEmpty(filmWorksByName)) { |
| | | throw new ValidationException("系统已存在名称为【" + filmWorksDTO.getNameCn() + "】,类型为【" + filmWorksDTO.getType() + "】,年份为【" + filmWorksDTO.getReleaseYear() + "】的影视作品"); |
| | | } |
| | | // 转换 |
| | | FilmWorks filmWorks = new FilmWorks(); |
| | | BeanUtils.copyProperties(filmWorksDTO, filmWorks); |
| | | filmWorks.create(); |
| | | filmWorks.setStatus(Constants.COMMON_PUBLISH_STATUS.pending_review.name()); |
| | | filmWorks.setStatus(Constants.COMMON_PUBLISH_STATUS.pending_create.name()); |
| | | filmWorksMapper.insert(filmWorks); |
| | | } |
| | | |