jwt 미적용으로 수정, spotlessApply 적용
This commit is contained in:
@@ -35,21 +35,36 @@ public class CommonCodeCoreService
|
||||
new EntityNotFoundException(
|
||||
"parent id 를 찾을 수 없습니다. id : " + req.getParentId()));
|
||||
|
||||
Long existsCount = commonCodeRepository.findByParentIdCodeExists(req.getParentId(), req.getCode());
|
||||
Long existsCount =
|
||||
commonCodeRepository.findByParentIdCodeExists(req.getParentId(), req.getCode());
|
||||
if (existsCount > 0) {
|
||||
throw new DuplicateKeyException("이미 등록되어 있습니다.");
|
||||
}
|
||||
|
||||
CommonCodeEntity entity =
|
||||
new CommonCodeEntity(
|
||||
req.getCode(), req.getName(), req.getDescription(), req.getOrder(), req.isUsed(), req.getProps1(), req.getProps2(), req.getProps3());
|
||||
req.getCode(),
|
||||
req.getName(),
|
||||
req.getDescription(),
|
||||
req.getOrder(),
|
||||
req.isUsed(),
|
||||
req.getProps1(),
|
||||
req.getProps2(),
|
||||
req.getProps3());
|
||||
entity.addParent(parentCommonCodeEntity);
|
||||
return commonCodeRepository.save(entity).toDto();
|
||||
}
|
||||
|
||||
CommonCodeEntity entity =
|
||||
new CommonCodeEntity(
|
||||
req.getCode(), req.getName(), req.getDescription(), req.getOrder(), req.isUsed(), req.getProps1(), req.getProps2(), req.getProps3());
|
||||
req.getCode(),
|
||||
req.getName(),
|
||||
req.getDescription(),
|
||||
req.getOrder(),
|
||||
req.isUsed(),
|
||||
req.getProps1(),
|
||||
req.getProps2(),
|
||||
req.getProps3());
|
||||
return commonCodeRepository.save(entity).toDto();
|
||||
}
|
||||
|
||||
@@ -60,7 +75,8 @@ public class CommonCodeCoreService
|
||||
.orElseThrow(() -> new EntityNotFoundException("common code 를 찾을 수 없습니다. id : " + id));
|
||||
|
||||
Long parentId = found.getParent() == null ? null : found.getParent().getId();
|
||||
Long existsCount = commonCodeRepository.findByParentIdCodeExiststoUpdate(id, parentId, req.getCode());
|
||||
Long existsCount =
|
||||
commonCodeRepository.findByParentIdCodeExiststoUpdate(id, parentId, req.getCode());
|
||||
if (existsCount > 0) {
|
||||
throw new DuplicateKeyException("이미 등록되어 있습니다.");
|
||||
}
|
||||
@@ -76,8 +92,7 @@ public class CommonCodeCoreService
|
||||
found.getDeleted(),
|
||||
req.getProps1(),
|
||||
req.getProps2(),
|
||||
req.getProps3()
|
||||
);
|
||||
req.getProps3());
|
||||
|
||||
return commonCodeRepository.save(entity).toDto();
|
||||
}
|
||||
|
||||
@@ -74,7 +74,14 @@ public class CommonCodeEntity extends CommonDateEntity {
|
||||
private String props3;
|
||||
|
||||
public CommonCodeEntity(
|
||||
String code, String name, String description, Integer order, Boolean used, String props1, String props2, String props3) {
|
||||
String code,
|
||||
String name,
|
||||
String description,
|
||||
Integer order,
|
||||
Boolean used,
|
||||
String props1,
|
||||
String props2,
|
||||
String props3) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
@@ -86,7 +93,16 @@ public class CommonCodeEntity extends CommonDateEntity {
|
||||
}
|
||||
|
||||
public CommonCodeEntity(
|
||||
Long id, String code, String name, String description, Integer order, Boolean used, Boolean deleted, String props1, String props2, String props3) {
|
||||
Long id,
|
||||
String code,
|
||||
String name,
|
||||
String description,
|
||||
Integer order,
|
||||
Boolean used,
|
||||
Boolean deleted,
|
||||
String props1,
|
||||
String props2,
|
||||
String props3) {
|
||||
this.id = id;
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
@@ -101,20 +117,19 @@ public class CommonCodeEntity extends CommonDateEntity {
|
||||
|
||||
public CommonCodeDto.Basic toDto() {
|
||||
return new CommonCodeDto.Basic(
|
||||
this.id,
|
||||
this.code,
|
||||
this.description,
|
||||
this.name,
|
||||
this.order,
|
||||
this.used,
|
||||
this.deleted,
|
||||
this.children.stream().map(CommonCodeEntity::toDto).toList(),
|
||||
super.getCreatedDate(),
|
||||
super.getModifiedDate(),
|
||||
this.props1,
|
||||
this.props2,
|
||||
this.props3
|
||||
);
|
||||
this.id,
|
||||
this.code,
|
||||
this.description,
|
||||
this.name,
|
||||
this.order,
|
||||
this.used,
|
||||
this.deleted,
|
||||
this.children.stream().map(CommonCodeEntity::toDto).toList(),
|
||||
super.getCreatedDate(),
|
||||
super.getModifiedDate(),
|
||||
this.props1,
|
||||
this.props2,
|
||||
this.props3);
|
||||
}
|
||||
|
||||
public void addParent(CommonCodeEntity parent) {
|
||||
|
||||
@@ -25,9 +25,9 @@ public class MapSheetLearnDataEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tb_map_sheet_learn_data_id_gen")
|
||||
@SequenceGenerator(
|
||||
name = "tb_map_sheet_learn_data_id_gen",
|
||||
sequenceName = "tb_map_sheet_learn_data_data_uid",
|
||||
allocationSize = 1)
|
||||
name = "tb_map_sheet_learn_data_id_gen",
|
||||
sequenceName = "tb_map_sheet_learn_data_data_uid",
|
||||
allocationSize = 1)
|
||||
@Column(name = "data_uid", nullable = false)
|
||||
private Long id;
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ public class MapSheetLearnDataGeomEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(
|
||||
strategy = GenerationType.SEQUENCE,
|
||||
generator = "tb_map_sheet_learn_data_geom_id_gen")
|
||||
strategy = GenerationType.SEQUENCE,
|
||||
generator = "tb_map_sheet_learn_data_geom_id_gen")
|
||||
@SequenceGenerator(
|
||||
name = "tb_map_sheet_learn_data_geom_id_gen",
|
||||
sequenceName = "tb_map_sheet_learn_data_geom_geom_uid",
|
||||
allocationSize = 1)
|
||||
name = "tb_map_sheet_learn_data_geom_id_gen",
|
||||
sequenceName = "tb_map_sheet_learn_data_geom_geom_uid",
|
||||
allocationSize = 1)
|
||||
@Column(name = "geo_uid", nullable = false)
|
||||
private Long id;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.kamco.cd.kamcoback.postgres.repository.code;
|
||||
import com.kamco.cd.kamcoback.code.dto.CommonCodeDto;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.CommonCodeEntity;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
@@ -99,26 +99,22 @@ public class CommonCodeRepositoryImpl implements CommonCodeRepositoryCustom {
|
||||
@Override
|
||||
public Long findByParentIdCodeExists(Long parentId, String code) {
|
||||
return queryFactory
|
||||
.select(commonCodeEntity.code.count())
|
||||
.from(commonCodeEntity)
|
||||
.where(
|
||||
commonCodeEntity.parent.id.eq(parentId),
|
||||
commonCodeEntity.code.eq(code)
|
||||
)
|
||||
.fetchOne();
|
||||
.select(commonCodeEntity.code.count())
|
||||
.from(commonCodeEntity)
|
||||
.where(commonCodeEntity.parent.id.eq(parentId), commonCodeEntity.code.eq(code))
|
||||
.fetchOne();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long findByParentIdCodeExiststoUpdate(Long id, Long parentId, String code) {
|
||||
return queryFactory
|
||||
.select(commonCodeEntity.code.count())
|
||||
.from(commonCodeEntity)
|
||||
.where(
|
||||
commonCodeEntity.parent.id.eq(parentId),
|
||||
commonCodeEntity.code.eq(code),
|
||||
commonCodeEntity.id.ne(id)
|
||||
)
|
||||
.fetchOne();
|
||||
.select(commonCodeEntity.code.count())
|
||||
.from(commonCodeEntity)
|
||||
.where(
|
||||
commonCodeEntity.parent.id.eq(parentId),
|
||||
commonCodeEntity.code.eq(code),
|
||||
commonCodeEntity.id.ne(id))
|
||||
.fetchOne();
|
||||
}
|
||||
|
||||
private List<CommonCodeEntity> findAllByIds(Set<Long> ids) {
|
||||
|
||||
Reference in New Issue
Block a user