Browse Source

회원탈퇴 repository 서순 변경

feature/auth
qkr7828(박재우) 2 years ago
parent
commit
abfad13101
  1. 27
      src/main/java/com/palnet/biz/api/acnt/cstmr/service/AcntCstmrService.java
  2. 2
      src/main/java/com/palnet/biz/jpa/repository/pty/PtyCstmrGroupRepository.java

27
src/main/java/com/palnet/biz/api/acnt/cstmr/service/AcntCstmrService.java

@ -274,10 +274,6 @@ public class AcntCstmrService {
}
public boolean userDelete(int cstmrSno) {
PtyCstmrBas userEntity = ptyCstmrBasRepository.findByUserGroupId(cstmrSno);
userEntity.setCstmrStatusCd("W");
userEntity.setCstmrStatusCngDt(DateUtils.nowDate());
ptyCstmrBasRepository.save(userEntity);
List<JwtGroupModel> groupInfo = jwtTokenUtil.getGroupAuthByToken();
for(JwtGroupModel group : groupInfo) {
@ -287,19 +283,30 @@ public class AcntCstmrService {
groupEntity.setUseYn("N");
ptyGroupBasRepository.save(groupEntity);
}
PtyCstmrGroup cstmrEntity = ptyCstmrGroupRepository.changeGroupJoinYn(group.getGroupId());
if(!(cstmrEntity == null)) {
cstmrEntity.setJoinYn("N");
ptyCstmrGroupRepository.save(cstmrEntity);
}
}
List<PtyCstmrGroup> AprvlEntity = ptyCstmrGroupRepository.changeGroupAprvlYn(cstmrSno);
if(!(AprvlEntity == null)) {
for(PtyCstmrGroup Aprvl : AprvlEntity) {
Aprvl.setAprvlYn("N");
Aprvl.setAprvlDt(null);
ptyCstmrGroupRepository.save(Aprvl);
}
PtyCstmrGroup cstmrEntity = ptyCstmrGroupRepository.findGroupId(group.getGroupId(), cstmrSno);
if(!(cstmrEntity == null)) {
cstmrEntity.setJoinYn("N");
ptyCstmrGroupRepository.save(cstmrEntity);
}
}
List<PtyCstmrGroup> AprvlEntity = ptyCstmrGroupRepository.changeGroupAprvlYn(cstmrSno);
for(PtyCstmrGroup Aprvl : AprvlEntity) {
Aprvl.setAprvlYn("N");
Aprvl.setAprvlDt(null);
ptyCstmrGroupRepository.save(Aprvl);
}
}
PtyCstmrBas userEntity = ptyCstmrBasRepository.findByUserGroupId(cstmrSno);
userEntity.setCstmrStatusCd("W");
userEntity.setCstmrStatusCngDt(DateUtils.nowDate());
ptyCstmrBasRepository.save(userEntity);
boolean result = true;
return result;

2
src/main/java/com/palnet/biz/jpa/repository/pty/PtyCstmrGroupRepository.java

@ -20,7 +20,7 @@ public interface PtyCstmrGroupRepository extends JpaRepository<PtyCstmrGroup, In
@Query("select p from PtyCstmrGroup p " +
"where p.groupId = :groupId " )
List<PtyCstmrGroup> changeGroupJoinYn(@Param("groupId") String groupId);
PtyCstmrGroup changeGroupJoinYn(@Param("groupId") String groupId);
@Query("select p from PtyCstmrGroup p " +
"where p.cstmrSno = :cstmrSno " )

Loading…
Cancel
Save