Browse Source

Merge branch 'develop' of http://gitea.palntour.com/pav/pav-be-kac.git into develop

pull/12/head
박재우 11 months ago
parent
commit
e0b83bd98d
  1. 32
      document/district_code/acmm_admsect_47_202307_gyeongsangbuk.txt
  2. 47917
      document/district_code/all/total.txt
  3. 23
      pav-server/src/main/java/com/palnet/biz/api/acnt/jwt/service/JwtService.java
  4. 5
      pav-server/src/main/java/com/palnet/biz/api/acnt/jwt/utils/JwtTokenUtil.java
  5. 2
      pav-server/src/main/java/com/palnet/biz/api/external/service/SunRiseSetService.java
  6. 26
      pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyCstmrQueryRepository.java
  7. 62
      pav-server/src/main/java/com/palnet/exec/TempAdmDistrictService.java

32
document/district_code/acmm_admsect_47_202307_gyeongsangbuk.txt

@ -717,22 +717,22 @@ L|4713025934|경상북도 경주시 외동읍 괘릉리|괘릉리||L|19950101|47
L|4713025935|경상북도 경주시 외동읍 신계리|신계리||L|19950101|4779525935|26110
L|4713025936|경상북도 경주시 외동읍 문산리|문산리||L|19950101|4779525936|26110
L|4713025937|경상북도 경주시 외동읍 북토리|북토리||L|19950101|4779525937|26110
L|4713031500|寃쎌?遺?? 寃쎌<??臾몃Т????㈃|臾몃Т????㈃||L|20210401|4713031000|26110
L|4713031521|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ ?댁?由?|?댁?由?||L|20210401|4713031021|26110
L|4713031522|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ ???由?|???由?||L|20210401|4713031022|26110
L|4713031523|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ ???由?|???由?||L|20210401|4713031023|26110
L|4713031524|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ ?≪?由?|?≪?由?||L|20210401|4713031024|26110
L|4713031525|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ 二쎌?由?|二쎌?由?||L|20210401|4713031025|26110
L|4713031526|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ 援ш만由?|援ш만由?||L|20210401|4713031026|26110
L|4713031527|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ ?⑸?由?|?⑸?由?||L|20210401|4713031027|26110
L|4713031528|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ 遊?만由?|遊?만由?||L|20210401|4713031028|26110
L|4713031529|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ 沅??由?|沅??由?||L|20210401|4713031029|26110
L|4713031530|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ ?몄?由?|?몄?由?||L|20210401|4713031030|26110
L|4713031531|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ ?⑸?由?|?⑸?由?||L|20210401|4713031031|26110
L|4713031532|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ ????━|????━||L|20210401|4713031032|26110
L|4713031533|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ ???由?|???由?||L|20210401|4713031033|26110
L|4713031534|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ ?ν?由?|?ν?由?||L|20210401|4713031034|26110
L|4713031535|寃쎌?遺?? 寃쎌<??臾몃Т????㈃ 踰?끝由?|踰?끝由?||L|20210401|4713031035|26110
L|4713031500|경상북도 경주시 문무대왕면|문무대왕면||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 어일리|어일리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 입천리|입천리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 두산리|두산리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 송전리|송전리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 죽전리|죽전리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 구길리|구길리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 용당리|용당리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 봉길리|봉길리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 권이리|권이리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 호암리|호암리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 용동리|용동리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 와읍리|와읍리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 안동리|안동리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 장항리|장항리||L|20210401|4713031000|26110
L|4713031500|경상북도 경주시 문무대왕면 범곡리|범곡리||L|20210401|4713031000|26110
L|4713032000|경상북도 경주시 양남면|양남면||L|19950101|4779532000|26110
L|4713032021|경상북도 경주시 양남면 하서리|하서리||L|19950101|4779532021|26110
L|4713032022|경상북도 경주시 양남면 수렴리|수렴리||L|19950101|4779532022|26110

47917
document/district_code/all/total.txt

File diff suppressed because it is too large Load Diff

23
pav-server/src/main/java/com/palnet/biz/api/acnt/jwt/service/JwtService.java

@ -15,10 +15,10 @@ import com.palnet.comn.code.ErrorCode;
import com.palnet.comn.exception.CustomException;
import com.palnet.comn.utils.EncryptUtils;
import com.palnet.comn.utils.HttpUtils;
import io.jsonwebtoken.Claims;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.Instant;
@ -217,18 +217,31 @@ public class JwtService {
* @param refreshToken
* @return
*/
public JwtRsModel findRefreshtoken(int cstmrSno, String refreshToken) {
public JwtRsModel findRefreshtoken(int cstmrSno, String refreshToken) throws Exception {
// refresh 토큰 검증 - DB에서 저장한 refresh token 비교 - 최근 로그인한 정보만 가지고 있음
/*
JwtUserModel userDetails = query.findRefreshtoken(cstmrSno, refreshToken);
if (userDetails == null) {
return null;
}
String accessToken = jwtTokenUtil.generateToken(userDetails);
*/
// refresh 토큰 검증 - refresh token의 유효성만 판단.
Claims claims = jwtTokenUtil.getAllClaimsFromToken(refreshToken);
Integer cstmrSnoByRefreshToken = claims.get("cstmrSno", Integer.class);
if(cstmrSnoByRefreshToken != cstmrSno) return null;
JwtUserModel userDetails = query.findByIdForrefreshToken(cstmrSno);
String createAccessToken = jwtTokenUtil.generateToken(userDetails);
String createRefreshToken = jwtTokenUtil.generateRefreshToken(userDetails);
this.refreshTokenSave(cstmrSno, createRefreshToken);
JwtRsModel result = new JwtRsModel();
result.setAccessToken(accessToken);
result.setRefreshToken(refreshToken);
result.setAccessToken(createAccessToken);
result.setRefreshToken(createRefreshToken);
result.setAuth(userDetails.getAuth());
result.setUserId(userDetails.getUserId());
result.setCstmrSno(userDetails.getCstmrSno());

5
pav-server/src/main/java/com/palnet/biz/api/acnt/jwt/utils/JwtTokenUtil.java

@ -51,15 +51,16 @@ public class JwtTokenUtil implements Serializable {
}
//for retrieveing any information from token we will need the secret key
private Claims getAllClaimsFromToken(String token) {
public Claims getAllClaimsFromToken(String token) {
return Jwts.parser().setSigningKey(secret).parseClaimsJws(token).getBody();
}
//check if the token has expired
// 토큰이 만료되었는지 확인한다.
private Boolean isTokenExpired(String token) {
final Date expiration = getExpirationDateFromToken(token);
// log.debug(">>>" + expiration);
// log.debug(">>>" + expiration);getExpirationDateFromToken
return expiration.before(new Date());
}

2
pav-server/src/main/java/com/palnet/biz/api/external/service/SunRiseSetService.java vendored

@ -59,7 +59,7 @@ public class SunRiseSetService {
// continue 20240201
List<String> locations = getLocation();
// LocalDate targetDate = LocalDate.now();
LocalDate targetDate = LocalDate.of(2024, 4, 1);
LocalDate targetDate = LocalDate.of(2024, 5, 1);
LocalDate end = targetDate.plusMonths(6);
List<SunRiseSetRs> sunRiseSet = new ArrayList<>();

26
pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyCstmrQueryRepository.java

@ -222,6 +222,7 @@ public class PtyCstmrQueryRepository {
.from(basEntity)
.where(builder)
.fetchFirst();
if (entity != null) {
JwtUserModel model = new JwtUserModel();
model.setAuth(entity.getAuthId());
@ -237,6 +238,31 @@ public class PtyCstmrQueryRepository {
}
}
public JwtUserModel findByIdForrefreshToken(int cstmrSno) {
QPtyCstmrBas basEntity = QPtyCstmrBas.ptyCstmrBas;
BooleanBuilder builder = new BooleanBuilder();
builder.and(basEntity.cstmrSno.eq(cstmrSno));
PtyCstmrBas entity = query.select(basEntity)
.from(basEntity)
.where(builder)
.fetchFirst();
if (entity != null) {
JwtUserModel model = new JwtUserModel();
model.setAuth(entity.getAuthId());
model.setUserId(entity.getUserId());
model.setCstmrSno(entity.getCstmrSno());
model.setCstmrStatusCd(entity.getCstmrStatusCd());
model.setUserPswd(entity.getUserPswd());
return model;
} else {
return null;
}
}
public List<AnctCstmerRlModel> list(int cstmrSno) {
QPtyCstmrBas bas = QPtyCstmrBas.ptyCstmrBas;
QPtyCstmrDtl dtl = QPtyCstmrDtl.ptyCstmrDtl;

62
pav-server/src/main/java/com/palnet/exec/TempAdmDistrictService.java

@ -50,8 +50,11 @@ public class TempAdmDistrictService {
String[] row = line.split("\\|");
String admSectGbn = row[0];
// admSectGbn가 L만 추출
if (row.length < 9) {
log.info("row length : {}::{}", row.length, line);
continue;
}
if (!"L".equals(admSectGbn)) continue;
if (row.length < 9) continue;
// log.info("row length : {}::{}", row.length, line);
// ADM_SECT_GBN|ADM_CD|ADM_SECT_NM|LOWEST_ADM_SECT_NM|DEL_YMD
// |CHG_BEF_ADM_SECT_GBN|CRE_YMD|CHG_BEF_ADM_SECT_CD|COL_ADM_SECT_CD
@ -71,7 +74,7 @@ public class TempAdmDistrictService {
}
log.info(">>> entities size : {}/{}", entities.get(0).getAdmSectNm(), entities.size());
comAdmDistrictBasRepository.saveAll(entities);
// comAdmDistrictBasRepository.saveAll(entities);
} catch (Exception e) {
log.error("error : {}||{}", e.getMessage(), file.getName());
}
@ -81,4 +84,59 @@ public class TempAdmDistrictService {
log.info(">>>> end....");
}
public static void main(String[] args) {
File directory = new File("./document/district_code");
log.info(">>> directory : {}", directory.getPath());
log.info(">>> directory : {}", directory.getAbsolutePath());
if (!directory.exists()) return;
File[] files = directory.listFiles();
for (File file : files) {
if (file.isFile()) {
try (BufferedReader br = new BufferedReader(new FileReader(file))) {
List<ComAdmDistrictBas> entities = new ArrayList<>();
// 첫줄 무시
String line = br.readLine();
String compareStr = "";
int cnt = 1;
while ((line = br.readLine()) != null) {
// log.info("line :: {}", line);
String[] row = line.split("\\|");
if(cnt == 1) {
compareStr = row[2];
cnt++;
}
if(!row[2].contains(compareStr)) {
log.info(">>> not same : {}::{}", row[1], row);
}
String admSectGbn = row[0];
// admSectGbn가 L만 추출
if (row.length < 9) continue;
if (!"L".equals(admSectGbn)) continue;
// log.info("row length : {}::{}", row.length, line);
// ADM_SECT_GBN|ADM_CD|ADM_SECT_NM|LOWEST_ADM_SECT_NM|DEL_YMD
// |CHG_BEF_ADM_SECT_GBN|CRE_YMD|CHG_BEF_ADM_SECT_CD|COL_ADM_SECT_CD
ComAdmDistrictBas entity = ComAdmDistrictBas.builder()
// .admSectGbn(row[0])
.admCd(row[1])
.admSectNm(row[2])
.lowestAdmSectNm(row[3])
.delYmd(row[4])
.chgBefAdmSectGbn(row[5])
.creYmd(row[6])
.chgBefAdmSectCd(row[7])
.colAdmSectCd(row[8])
.build();
// log.info("entity :: {}", entity);
entities.add(entity);
}
log.info(">>> entities size : {}/{}", entities.get(0).getAdmSectNm(), entities.size());
} catch (Exception e) {
log.error("error : {}||{}", e.getMessage(), file.getName());
}
}
}
}
}

Loading…
Cancel
Save