Compare commits

..

1 Commits

Author SHA1 Message Date
minkyu1128 8b94181caf fix: 민자고속도로 운영계 배포 오류 2 years ago

@ -10,7 +10,7 @@ import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy; import javax.annotation.PreDestroy;
@Slf4j @Slf4j
@Configuration //@Configuration
public class EmbeddedRedisConfig { public class EmbeddedRedisConfig {
@Value("${spring.redis.port}") @Value("${spring.redis.port}")

@ -57,7 +57,7 @@ public class RedisCacheConfig {
@Bean @Bean
public CacheManager redisCacheManager(RedisConnectionFactory redisConnectionFactory) { public CacheManager redisCacheManager(RedisConnectionFactory redisConnectionFactory) {
RedisCacheConfiguration redisCacheConfiguration = redisCacheDefaultConfiguration() RedisCacheConfiguration redisCacheConfiguration = redisCacheDefaultConfiguration()
.entryTtl(Duration.ofSeconds(CacheKey.DEFAULT_EXP_SEC)) .entryTtl(Duration.ofSeconds(CacheKey.DEFAULT_EXP_SEC))
// .computePrefixWith(CacheKeyPrefix.simple()) // .computePrefixWith(CacheKeyPrefix.simple())
; ;
@ -65,7 +65,7 @@ public class RedisCacheConfig {
return RedisCacheManager.RedisCacheManagerBuilder return RedisCacheManager.RedisCacheManagerBuilder
.fromConnectionFactory(redisConnectionFactory) .fromConnectionFactory(redisConnectionFactory)
.cacheDefaults(redisCacheConfiguration) .cacheDefaults(redisCacheConfiguration)
.withInitialCacheConfigurations(redisCacheConfigurationMap()) .withInitialCacheConfigurations(redisCacheConfigurationMap())
.build(); .build();
} }

@ -18,10 +18,6 @@ import cokr.xit.ens.modules.kkoalimtalk.domain.TmpltMngKkoAlimtalk;
import cokr.xit.ens.modules.kkoalimtalk.model.struct.TmpltMngKkoAlimtalkMapper; import cokr.xit.ens.modules.kkoalimtalk.model.struct.TmpltMngKkoAlimtalkMapper;
import cokr.xit.ens.modules.kkomydoc.domain.TmpltMngKkoMydoc; import cokr.xit.ens.modules.kkomydoc.domain.TmpltMngKkoMydoc;
import cokr.xit.ens.modules.kkomydoc.model.struct.TmpltMngKkoMydocMapper; import cokr.xit.ens.modules.kkomydoc.model.struct.TmpltMngKkoMydocMapper;
import cokr.xit.ens.modules.ktsigntalk.direct.domain.TmpltMngKtSigntalk;
import cokr.xit.ens.modules.ktsigntalk.direct.model.struct.TmpltMngKtSigntalkMapper;
import cokr.xit.ens.modules.ktsigntalk.gibis.domain.TmpltMngKtGibis;
import cokr.xit.ens.modules.ktsigntalk.gibis.model.struct.TmpltMngKtGibisMapper;
import cokr.xit.ens.modules.nvsigntalk.domain.TmpltMngNvSigntalk; import cokr.xit.ens.modules.nvsigntalk.domain.TmpltMngNvSigntalk;
import cokr.xit.ens.modules.nvsigntalk.model.struct.TmpltMngNvSigntalkMapper; import cokr.xit.ens.modules.nvsigntalk.model.struct.TmpltMngNvSigntalkMapper;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
@ -47,9 +43,7 @@ public class TmpltMngStrategyIntegration extends TmpltMngStrategyTemplate<Map<St
private final cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.TmpltMngKkoAlimtalkMapper tmpltMngKkoAlimtalkMapper; private final cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.TmpltMngKkoAlimtalkMapper tmpltMngKkoAlimtalkMapper;
private final cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.TmpltMngKkoMydocMapper tmpltMngKkoMydocMapper; private final cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.TmpltMngKkoMydocMapper tmpltMngKkoMydocMapper;
private final cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.TmpltMngNvSigntalkMapper tmpltMngNvSigntalkMapper; private final cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.TmpltMngNvSigntalkMapper tmpltMngNvSigntalkMapper;
private final cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.TmpltMngKtSigntalkMapper tmpltMngKtSigntalkMapper; // private final RedisTemplate redisTemplate;
private final cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.TmpltMngKtGibisMapper tmpltMngKtGibisMapper;
private final RedisTemplate redisTemplate;
private TmpltMngIntgrnMapper intgrnMapper = Mappers.getMapper(TmpltMngIntgrnMapper.class); private TmpltMngIntgrnMapper intgrnMapper = Mappers.getMapper(TmpltMngIntgrnMapper.class);
@ -60,12 +54,11 @@ public class TmpltMngStrategyIntegration extends TmpltMngStrategyTemplate<Map<St
@Override @Override
public Optional<TmpltMngIntgrnDTO> find(String orgCd, String tmpltCd) { public Optional<TmpltMngIntgrnDTO> find(String orgCd, String tmpltCd) {
// return tmpltMngIntgrnRepository.findDtoByOrgCdAndTmpltCd(orgCd, tmpltCd); return tmpltMngIntgrnRepository.findDtoByOrgCdAndTmpltCd(orgCd, tmpltCd);
// String key = super.pushCache(redisTemplate, orgCd, tmpltCd, tmpltMngIntgrnRepository);
String key = super.pushCache(redisTemplate, orgCd, tmpltCd, tmpltMngIntgrnRepository); // HashOperations<String, String, TmpltMngIntgrnDTO> hashOperations = redisTemplate.opsForHash();
HashOperations<String, String, TmpltMngIntgrnDTO> hashOperations = redisTemplate.opsForHash(); // return Optional.ofNullable(hashOperations.entries(KEY).get(key));
return Optional.ofNullable(hashOperations.entries(KEY).get(key));
} }
@Override @Override
@ -84,10 +77,6 @@ public class TmpltMngStrategyIntegration extends TmpltMngStrategyTemplate<Map<St
this.toMappedChildTmpltMng(dto, dto.getKkoMydoc()); this.toMappedChildTmpltMng(dto, dto.getKkoMydoc());
if (!CmmnUtil.isEmpty(dto.getNvSigntalk())) if (!CmmnUtil.isEmpty(dto.getNvSigntalk()))
this.toMappedChildTmpltMng(dto, dto.getNvSigntalk()); this.toMappedChildTmpltMng(dto, dto.getNvSigntalk());
if (!CmmnUtil.isEmpty(dto.getKtSigntalk()))
this.toMappedChildTmpltMng(dto, dto.getKtSigntalk());
if (!CmmnUtil.isEmpty(dto.getKtGibis()))
this.toMappedChildTmpltMng(dto, dto.getKtGibis());
final Validator validator = Validation.buildDefaultValidatorFactory().getValidator(); final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
Set<ConstraintViolation<TmpltMngIntgrnDTO>> list = validator.validate(dto); Set<ConstraintViolation<TmpltMngIntgrnDTO>> list = validator.validate(dto);
@ -136,16 +125,6 @@ public class TmpltMngStrategyIntegration extends TmpltMngStrategyTemplate<Map<St
TmpltMngNvSigntalk tmpltChild = mapper.toEntity(dto.getNvSigntalk()); TmpltMngNvSigntalk tmpltChild = mapper.toEntity(dto.getNvSigntalk());
tmpltMngNvSigntalkMapper.add(tmpltChild); tmpltMngNvSigntalkMapper.add(tmpltChild);
} }
if (!CmmnUtil.isEmpty(dto.getKtSigntalk())) {
TmpltMngKtSigntalkMapper mapper = Mappers.getMapper(TmpltMngKtSigntalkMapper.class);
TmpltMngKtSigntalk tmpltChild = mapper.toEntity(dto.getKtSigntalk());
tmpltMngKtSigntalkMapper.add(tmpltChild);
}
if (!CmmnUtil.isEmpty(dto.getKtGibis())) {
TmpltMngKtGibisMapper mapper = Mappers.getMapper(TmpltMngKtGibisMapper.class);
TmpltMngKtGibis tmpltChild = mapper.toEntity(dto.getKtGibis());
tmpltMngKtGibisMapper.add(tmpltChild);
}
} }
@ -154,12 +133,10 @@ public class TmpltMngStrategyIntegration extends TmpltMngStrategyTemplate<Map<St
protected void modifyProc(TmpltMngIntgrnDTO dto) { protected void modifyProc(TmpltMngIntgrnDTO dto) {
TmpltMngIntgrn tmpltMng = tmpltMngIntgrnRepository.findFetchByOrgCdAndTmpltCd(dto.getOrgCd(), dto.getTmpltCd()) TmpltMngIntgrn tmpltMng = tmpltMngIntgrnRepository.findFetchByOrgCdAndTmpltCd(dto.getOrgCd(), dto.getTmpltCd())
.orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("기관코드(%s) 및 템플릿코드(%s)가 일치하는 자료가 없습니다.", dto.getOrgCd(), dto.getTmpltCd()))); .orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("기관코드(%s) 및 템플릿코드(%s)가 일치하는 자료가 없습니다.", dto.getOrgCd(), dto.getTmpltCd())));
if (!"Y".equals(tmpltMng.getUseYn()))
throw new EnsException(EnsErrCd.ERR402, "\"미사용\" 상태의 템플릿은 수정 할 수 없습니다.");
intgrnMapper.updateFromDto(dto, tmpltMng); intgrnMapper.updateFromDto(dto, tmpltMng);
tmpltMng.setUpdId("ENS_SYS"); tmpltMng.setUpdId("ENS_SYS");
if (!CmmnUtil.isEmpty(dto.getKkoAlimtalk())) { if (!CmmnUtil.isEmpty(dto.getKkoAlimtalk())) {
TmpltMngKkoAlimtalkMapper mapper = Mappers.getMapper(TmpltMngKkoAlimtalkMapper.class); TmpltMngKkoAlimtalkMapper mapper = Mappers.getMapper(TmpltMngKkoAlimtalkMapper.class);
TmpltMngKkoAlimtalk tmpltChild = mapper.toEntity(dto.getKkoAlimtalk()); TmpltMngKkoAlimtalk tmpltChild = mapper.toEntity(dto.getKkoAlimtalk());
@ -171,7 +148,7 @@ public class TmpltMngStrategyIntegration extends TmpltMngStrategyTemplate<Map<St
tmpltMngKkoAlimtalkMapper.add(tmpltChild); tmpltMngKkoAlimtalkMapper.add(tmpltChild);
} }
} }
if (!CmmnUtil.isEmpty(dto.getKkoMydoc())) { if (!CmmnUtil.isEmpty(dto.getKkoMydoc())) {
TmpltMngKkoMydocMapper mapper = Mappers.getMapper(TmpltMngKkoMydocMapper.class); TmpltMngKkoMydocMapper mapper = Mappers.getMapper(TmpltMngKkoMydocMapper.class);
TmpltMngKkoMydoc tmpltChild = mapper.toEntity(dto.getKkoMydoc()); TmpltMngKkoMydoc tmpltChild = mapper.toEntity(dto.getKkoMydoc());
@ -183,7 +160,7 @@ public class TmpltMngStrategyIntegration extends TmpltMngStrategyTemplate<Map<St
tmpltMngKkoMydocMapper.add(tmpltChild); tmpltMngKkoMydocMapper.add(tmpltChild);
} }
} }
if (!CmmnUtil.isEmpty(dto.getNvSigntalk())) { if (!CmmnUtil.isEmpty(dto.getNvSigntalk())) {
TmpltMngNvSigntalkMapper mapper = Mappers.getMapper(TmpltMngNvSigntalkMapper.class); TmpltMngNvSigntalkMapper mapper = Mappers.getMapper(TmpltMngNvSigntalkMapper.class);
TmpltMngNvSigntalk tmpltChild = mapper.toEntity(dto.getNvSigntalk()); TmpltMngNvSigntalk tmpltChild = mapper.toEntity(dto.getNvSigntalk());
@ -195,33 +172,8 @@ public class TmpltMngStrategyIntegration extends TmpltMngStrategyTemplate<Map<St
tmpltMngNvSigntalkMapper.add(tmpltChild); tmpltMngNvSigntalkMapper.add(tmpltChild);
} }
} }
if (!CmmnUtil.isEmpty(dto.getKtSigntalk())) {
TmpltMngKtSigntalkMapper mapper = Mappers.getMapper(TmpltMngKtSigntalkMapper.class);
TmpltMngKtSigntalk tmpltChild = mapper.toEntity(dto.getKtSigntalk());
if (tmpltMngKtSigntalkMapper.findById(TmpltMngIds.builder().orgMng(dto.getOrgCd()).tmpltCd(dto.getTmpltCd()).build()).isPresent()) {
tmpltChild.setUpdId("ENS_SYS");
tmpltMngKtSigntalkMapper.modify(tmpltChild);
} else {
tmpltChild.setRegistId("ENS_SYS");
tmpltMngKtSigntalkMapper.add(tmpltChild);
}
}
if (!CmmnUtil.isEmpty(dto.getKtGibis())) {
TmpltMngKtGibisMapper mapper = Mappers.getMapper(TmpltMngKtGibisMapper.class);
TmpltMngKtGibis tmpltChild = mapper.toEntity(dto.getKtGibis());
if (tmpltMngKtGibisMapper.findById(TmpltMngIds.builder().orgMng(dto.getOrgCd()).tmpltCd(dto.getTmpltCd()).build()).isPresent()) {
tmpltChild.setUpdId("ENS_SYS");
tmpltMngKtGibisMapper.modify(tmpltChild);
} else {
tmpltChild.setRegistId("ENS_SYS");
tmpltMngKtGibisMapper.add(tmpltChild);
}
}
// super.deleteCache(redisTemplate, dto.getOrgCd(), dto.getTmpltCd());
super.deleteCache(redisTemplate, dto.getOrgCd(), dto.getTmpltCd());
} }
private void toMappedChildTmpltMng(TmpltMngIntgrnDTO dto, TmpltMngDTO childDto) { private void toMappedChildTmpltMng(TmpltMngIntgrnDTO dto, TmpltMngDTO childDto) {

@ -39,7 +39,7 @@ public class OrgMngService {
} }
@Cacheable(value = CacheKey.ORGMNG, key = "#orgCd") // @Cacheable(value = CacheKey.ORGMNG, key = "#orgCd")
public EnsResponseVO<OrgMng> find(String orgCd) { public EnsResponseVO<OrgMng> find(String orgCd) {
try { try {
return EnsResponseVO.<OrgMng>okBuilder() return EnsResponseVO.<OrgMng>okBuilder()
@ -129,7 +129,7 @@ public class OrgMngService {
} }
@CachePut(value = CacheKey.ORGMNG, key = "#dto.orgCd") // @CachePut(value = CacheKey.ORGMNG, key = "#dto.orgCd")
public EnsResponseVO modify(OrgMngDTO dto) { public EnsResponseVO modify(OrgMngDTO dto) {
try { try {
final Validator validator = Validation.buildDefaultValidatorFactory().getValidator(); final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
@ -193,7 +193,7 @@ public class OrgMngService {
} }
} }
@CacheEvict(value = CacheKey.ORGMNG, key = "#orgCd") // @CacheEvict(value = CacheKey.ORGMNG, key = "#orgCd")
public EnsResponseVO delete(String orgCd) { public EnsResponseVO delete(String orgCd) {
try { try {
OrgMng orgMng = orgMngRepository.findById(orgCd).orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("기관코드(%s)와 일치하는 자료가 없습니다.", orgCd))); OrgMng orgMng = orgMngRepository.findById(orgCd).orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("기관코드(%s)와 일치하는 자료가 없습니다.", orgCd)));

@ -29,7 +29,7 @@ public class TmpltMngService extends TmpltMngCacheSupport<TmpltMngDTO> {
private final TmpltMngRepository tmpltMngRepository; private final TmpltMngRepository tmpltMngRepository;
private final Map<String, TmpltMngStrategy> mTmpltMngStrategy; private final Map<String, TmpltMngStrategy> mTmpltMngStrategy;
private final RedisTemplate redisTemplate; // private final RedisTemplate redisTemplate;
public EnsResponseVO<List<? extends TmpltMngDTO>> findAllBySearchDTO(TmpltMngSearchDTO searchDTO, String dType) { public EnsResponseVO<List<? extends TmpltMngDTO>> findAllBySearchDTO(TmpltMngSearchDTO searchDTO, String dType) {
TmpltMngStrategy tmpltMngStrategy = mTmpltMngStrategy.get("tmpltMngStrategy_" + dType); TmpltMngStrategy tmpltMngStrategy = mTmpltMngStrategy.get("tmpltMngStrategy_" + dType);
@ -126,8 +126,8 @@ public class TmpltMngService extends TmpltMngCacheSupport<TmpltMngDTO> {
.errMsg(e.getMessage()) .errMsg(e.getMessage())
.build(); .build();
} finally { } finally {
//
super.deleteCache(redisTemplate, orgCd, tmpltCd); // super.deleteCache(redisTemplate, orgCd, tmpltCd);
} }
} }

@ -11,8 +11,6 @@ import cokr.xit.ens.modules.common.ctgy.sys.mng.model.TmpltMngSearchDTO;
import cokr.xit.ens.modules.common.ctgy.sys.mng.model.struct.TmpltMngMapper; import cokr.xit.ens.modules.common.ctgy.sys.mng.model.struct.TmpltMngMapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
@ -26,8 +24,8 @@ import java.util.stream.Collectors;
public class TmpltMngStrategyBasic extends TmpltMngStrategyTemplate<Map<String, Object>, TmpltMngDTO> { public class TmpltMngStrategyBasic extends TmpltMngStrategyTemplate<Map<String, Object>, TmpltMngDTO> {
private final OrgMngRepository orgMngRepository; private final OrgMngRepository orgMngRepository;
private final TmpltMngRepository tmpltMngRepository; private final TmpltMngRepository tmpltMngRepository;
private TmpltMngMapper tmpltMngMapper = Mappers.getMapper(TmpltMngMapper.class); private TmpltMngMapper kkoMydocMapper = Mappers.getMapper(TmpltMngMapper.class);
private final RedisTemplate redisTemplate; // private final RedisTemplate redisTemplate;
public List<TmpltMngDTO> findAll(TmpltMngSearchDTO tmpltMngSearchDTO) { public List<TmpltMngDTO> findAll(TmpltMngSearchDTO tmpltMngSearchDTO) {
return tmpltMngRepository.findAllDtoBySearchDTO(tmpltMngSearchDTO); return tmpltMngRepository.findAllDtoBySearchDTO(tmpltMngSearchDTO);
@ -35,12 +33,11 @@ public class TmpltMngStrategyBasic extends TmpltMngStrategyTemplate<Map<String,
@Override @Override
public Optional<TmpltMngDTO> find(String orgCd, String tmpltCd) { public Optional<TmpltMngDTO> find(String orgCd, String tmpltCd) {
// return tmpltMngRepository.findDtoByOrgCdAndTmpltCd(orgCd, tmpltCd); return tmpltMngRepository.findDtoByOrgCdAndTmpltCd(orgCd, tmpltCd);
// String key = super.pushCache(redisTemplate, orgCd, tmpltCd, tmpltMngRepository);
String key = super.pushCache(redisTemplate, orgCd, tmpltCd, tmpltMngRepository); // HashOperations<String, String, TmpltMngDTO> hashOperations = redisTemplate.opsForHash();
HashOperations<String, String, TmpltMngDTO> hashOperations = redisTemplate.opsForHash(); // return Optional.ofNullable(hashOperations.entries(KEY).get(key));
return Optional.ofNullable(hashOperations.entries(KEY).get(key));
} }
@Override @Override
@ -70,7 +67,7 @@ public class TmpltMngStrategyBasic extends TmpltMngStrategyTemplate<Map<String,
throw new EnsException(EnsErrCd.ERR540, String.format("이미 등록된 템플릿코드[기관코드 %s 템플릿코드 %s] 입니다.", tmpltMng.getOrgMng().getOrgCd(), tmpltMng.getTmpltCd())); throw new EnsException(EnsErrCd.ERR540, String.format("이미 등록된 템플릿코드[기관코드 %s 템플릿코드 %s] 입니다.", tmpltMng.getOrgMng().getOrgCd(), tmpltMng.getTmpltCd()));
}); });
TmpltMng tmpltMng = tmpltMngMapper.toEntity(dto); TmpltMng tmpltMng = kkoMydocMapper.toEntity(dto);
tmpltMng.setOrgMng(orgMng); tmpltMng.setOrgMng(orgMng);
tmpltMng.setRegistId("ENS_SYS"); tmpltMng.setRegistId("ENS_SYS");
tmpltMngRepository.save(tmpltMng); tmpltMngRepository.save(tmpltMng);
@ -80,12 +77,9 @@ public class TmpltMngStrategyBasic extends TmpltMngStrategyTemplate<Map<String,
protected void modifyProc(TmpltMngDTO tmpltMngDTO) { protected void modifyProc(TmpltMngDTO tmpltMngDTO) {
TmpltMng tmpltMng = tmpltMngRepository.findFetchByOrgCdAndTmpltCd((tmpltMngDTO).getOrgCd(), (tmpltMngDTO).getTmpltCd()) TmpltMng tmpltMng = tmpltMngRepository.findFetchByOrgCdAndTmpltCd((tmpltMngDTO).getOrgCd(), (tmpltMngDTO).getTmpltCd())
.orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("기관코드(%s) 및 템플릿코드(%s)가 일치하는 자료가 없습니다.", tmpltMngDTO.getOrgCd(), tmpltMngDTO.getTmpltCd()))); .orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("기관코드(%s) 및 템플릿코드(%s)가 일치하는 자료가 없습니다.", tmpltMngDTO.getOrgCd(), tmpltMngDTO.getTmpltCd())));
if(!"Y".equals(tmpltMng.getUseYn())) kkoMydocMapper.updateFromDto(tmpltMngDTO, tmpltMng);
throw new EnsException(EnsErrCd.ERR402, "\"미사용\" 상태의 템플릿은 수정 할 수 없습니다.");
tmpltMngMapper.updateFromDto(tmpltMngDTO, tmpltMng);
tmpltMng.setUpdId("ENS_SYS"); tmpltMng.setUpdId("ENS_SYS");
// super.deleteCache(redisTemplate, tmpltMngDTO.getOrgCd(), tmpltMngDTO.getTmpltCd());
super.deleteCache(redisTemplate, tmpltMngDTO.getOrgCd(), tmpltMngDTO.getTmpltCd());
} }
} }

@ -32,7 +32,7 @@ public class TmpltMngStrategyKkoAlimtalk extends TmpltMngStrategyTemplate<Map<St
private final TmpltMngRepository tmpltMngRepository; private final TmpltMngRepository tmpltMngRepository;
private final TmpltMngKkoAlimtalkRepository tmpltMngKkoAlimtalkRepository; private final TmpltMngKkoAlimtalkRepository tmpltMngKkoAlimtalkRepository;
private TmpltMngKkoAlimtalkMapper kkoAlimtalkMapper = Mappers.getMapper(TmpltMngKkoAlimtalkMapper.class); private TmpltMngKkoAlimtalkMapper kkoAlimtalkMapper = Mappers.getMapper(TmpltMngKkoAlimtalkMapper.class);
private final RedisTemplate redisTemplate; // private final RedisTemplate redisTemplate;
@Override @Override
public List<TmpltMngKkoAlimtalkDTO> findAll(TmpltMngSearchDTO tmpltMngSearchDTO) { public List<TmpltMngKkoAlimtalkDTO> findAll(TmpltMngSearchDTO tmpltMngSearchDTO) {
@ -41,12 +41,11 @@ public class TmpltMngStrategyKkoAlimtalk extends TmpltMngStrategyTemplate<Map<St
@Override @Override
public Optional<TmpltMngKkoAlimtalkDTO> find(String orgCd, String tmpltCd) { public Optional<TmpltMngKkoAlimtalkDTO> find(String orgCd, String tmpltCd) {
// return tmpltMngKkoAlimtalkRepository.findDtoByOrgCdAndTmpltCd(orgCd, tmpltCd); return tmpltMngKkoAlimtalkRepository.findDtoByOrgCdAndTmpltCd(orgCd, tmpltCd);
// String key = super.pushCache(redisTemplate, orgCd, tmpltCd, tmpltMngKkoAlimtalkRepository);
String key = super.pushCache(redisTemplate, orgCd, tmpltCd, tmpltMngKkoAlimtalkRepository); // HashOperations<String, String, TmpltMngKkoAlimtalkDTO> hashOperations = redisTemplate.opsForHash();
HashOperations<String, String, TmpltMngKkoAlimtalkDTO> hashOperations = redisTemplate.opsForHash(); // return Optional.ofNullable(hashOperations.entries(KEY).get(key));
return Optional.ofNullable(hashOperations.entries(KEY).get(key));
} }
@Override @Override
@ -93,7 +92,6 @@ public class TmpltMngStrategyKkoAlimtalk extends TmpltMngStrategyTemplate<Map<St
kkoAlimtalkMapper.updateFromDto(dto, tmpltMng); kkoAlimtalkMapper.updateFromDto(dto, tmpltMng);
tmpltMng.setUpdId("ENS_SYS"); tmpltMng.setUpdId("ENS_SYS");
// super.deleteCache(redisTemplate, dto.getOrgCd(), dto.getTmpltCd());
super.deleteCache(redisTemplate, dto.getOrgCd(), dto.getTmpltCd());
} }
} }

@ -32,7 +32,7 @@ public class TmpltMngStrategyKkoMydoc extends TmpltMngStrategyTemplate<Map<Strin
private final TmpltMngRepository tmpltMngRepository; private final TmpltMngRepository tmpltMngRepository;
private final TmpltMngKkoMydocRepository tmpltMngKkoMydocRepository; private final TmpltMngKkoMydocRepository tmpltMngKkoMydocRepository;
private TmpltMngKkoMydocMapper kkoMydocMapper = Mappers.getMapper(TmpltMngKkoMydocMapper.class); private TmpltMngKkoMydocMapper kkoMydocMapper = Mappers.getMapper(TmpltMngKkoMydocMapper.class);
private final RedisTemplate redisTemplate; // private final RedisTemplate redisTemplate;
@Override @Override
public List<TmpltMngKkoMydocDTO> findAll(TmpltMngSearchDTO tmpltMngSearchDTO) { public List<TmpltMngKkoMydocDTO> findAll(TmpltMngSearchDTO tmpltMngSearchDTO) {
@ -41,12 +41,11 @@ public class TmpltMngStrategyKkoMydoc extends TmpltMngStrategyTemplate<Map<Strin
@Override @Override
public Optional<TmpltMngKkoMydocDTO> find(String orgCd, String tmpltCd) { public Optional<TmpltMngKkoMydocDTO> find(String orgCd, String tmpltCd) {
// return tmpltMngKkoMydocRepository.findDtoByOrgCdAndTmpltCd(orgCd, tmpltCd); return tmpltMngKkoMydocRepository.findDtoByOrgCdAndTmpltCd(orgCd, tmpltCd);
// String key = super.pushCache(redisTemplate, orgCd, tmpltCd, tmpltMngKkoMydocRepository);
String key = super.pushCache(redisTemplate, orgCd, tmpltCd, tmpltMngKkoMydocRepository); // HashOperations<String, String, TmpltMngKkoMydocDTO> hashOperations = redisTemplate.opsForHash();
HashOperations<String, String, TmpltMngKkoMydocDTO> hashOperations = redisTemplate.opsForHash(); // return Optional.ofNullable(hashOperations.entries(KEY).get(key));
return Optional.ofNullable(hashOperations.entries(KEY).get(key));
} }
@ -94,7 +93,6 @@ public class TmpltMngStrategyKkoMydoc extends TmpltMngStrategyTemplate<Map<Strin
kkoMydocMapper.updateFromDto(dto, tmpltMng); kkoMydocMapper.updateFromDto(dto, tmpltMng);
tmpltMng.setUpdId("ENS_SYS"); tmpltMng.setUpdId("ENS_SYS");
// super.deleteCache(redisTemplate, dto.getOrgCd(), dto.getTmpltCd());
super.deleteCache(redisTemplate, dto.getOrgCd(), dto.getTmpltCd());
} }
} }

@ -32,7 +32,7 @@ public class TmpltMngStrategyNvSigntalk extends TmpltMngStrategyTemplate<Map<Str
private final TmpltMngRepository tmpltMngRepository; private final TmpltMngRepository tmpltMngRepository;
private final TmpltMngNvSigntalkRepository tmpltMngNvSigntalkRepository; private final TmpltMngNvSigntalkRepository tmpltMngNvSigntalkRepository;
private TmpltMngNvSigntalkMapper nvSigntalkMapper = Mappers.getMapper(TmpltMngNvSigntalkMapper.class); private TmpltMngNvSigntalkMapper nvSigntalkMapper = Mappers.getMapper(TmpltMngNvSigntalkMapper.class);
private final RedisTemplate redisTemplate; // private final RedisTemplate redisTemplate;
@Override @Override
public List<TmpltMngNvSigntalkDTO> findAll(TmpltMngSearchDTO tmpltMngSearchDTO) { public List<TmpltMngNvSigntalkDTO> findAll(TmpltMngSearchDTO tmpltMngSearchDTO) {
@ -41,12 +41,11 @@ public class TmpltMngStrategyNvSigntalk extends TmpltMngStrategyTemplate<Map<Str
@Override @Override
public Optional<TmpltMngNvSigntalkDTO> find(String orgCd, String tmpltCd) { public Optional<TmpltMngNvSigntalkDTO> find(String orgCd, String tmpltCd) {
// return tmpltMngNvSigntalkRepository.findDtoByOrgCdAndTmpltCd(orgCd, tmpltCd); return tmpltMngNvSigntalkRepository.findDtoByOrgCdAndTmpltCd(orgCd, tmpltCd);
// String key = super.pushCache(redisTemplate, orgCd, tmpltCd, tmpltMngNvSigntalkRepository);
String key = super.pushCache(redisTemplate, orgCd, tmpltCd, tmpltMngNvSigntalkRepository); // HashOperations<String, String, TmpltMngNvSigntalkDTO> hashOperations = redisTemplate.opsForHash();
HashOperations<String, String, TmpltMngNvSigntalkDTO> hashOperations = redisTemplate.opsForHash(); // return Optional.ofNullable(hashOperations.entries(KEY).get(key));
return Optional.ofNullable(hashOperations.entries(KEY).get(key));
} }
@ -94,7 +93,6 @@ public class TmpltMngStrategyNvSigntalk extends TmpltMngStrategyTemplate<Map<Str
nvSigntalkMapper.updateFromDto(dto, tmpltMng); nvSigntalkMapper.updateFromDto(dto, tmpltMng);
tmpltMng.setUpdId("ENS_SYS"); tmpltMng.setUpdId("ENS_SYS");
// super.deleteCache(redisTemplate, dto.getOrgCd(), dto.getTmpltCd());
super.deleteCache(redisTemplate, dto.getOrgCd(), dto.getTmpltCd());
} }
} }

Loading…
Cancel
Save