Skip to content

Commit c8a63c7

Browse files
committed
Merge branch 'release-rc-v4.5.6.0-43-ge59946471'
# Conflicts: # dgrv4_Gateway_serv/src/main/java/tpi/dgrv4/gateway/service/GtwIdPApproveService.java
2 parents 5bbef27 + 30a8877 commit c8a63c7

File tree

299 files changed

+42837
-42966
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

299 files changed

+42837
-42966
lines changed

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ licenseReport {
3535

3636
allprojects {
3737
group = 'tpi.dgrv4'
38-
version = 'release-rc-v4.5.6.0-34-g85e6d987c'
38+
version = 'release-rc-v4.5.6.0-43-ge59946471'
3939
apply plugin: 'io.spring.dependency-management'
4040

4141
repositories {
@@ -62,8 +62,8 @@ subprojects {
6262

6363

6464
dependencies {
65-
implementation files("${rootDir}/libsext/dgrv4_CodecUtil-v4.5.6.0-34-g85e6d987c-lib.jar")
66-
implementation files("${rootDir}/libsext/dgrv4_HttpUtil-v4.5.6.0-34-g85e6d987c-lib.jar")
65+
implementation files("${rootDir}/libsext/dgrv4_CodecUtil-v4.5.6.0-43-ge59946471-lib.jar")
66+
implementation files("${rootDir}/libsext/dgrv4_HttpUtil-v4.5.6.0-43-ge59946471-lib.jar")
6767

6868
implementation ('org.springframework.boot:spring-boot-starter-data-jpa'){
6969
exclude group: 'ch.qos.logback', module: 'logback-classic'

dgrv4_Common_lib/.settings/org.eclipse.buildship.core.prefs

Lines changed: 0 additions & 2 deletions
This file was deleted.

dgrv4_Common_lib/.settings/org.eclipse.jdt.core.prefs

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package tpi.dgrv4.common.constant;
2-
3-
/**
4-
* Auth code 階段
5-
*/
6-
public class DgrAuthCodePhase {
7-
8-
public final static String STATE = "STATE";
9-
10-
public final static String AUTH_CODE = "AUTH CODE";
11-
}
1+
package tpi.dgrv4.common.constant;
2+
3+
/**
4+
* Auth code 階段
5+
*/
6+
public class DgrAuthCodePhase {
7+
8+
public final static String STATE = "STATE";
9+
10+
public final static String AUTH_CODE = "AUTH CODE";
11+
}

dgrv4_Common_lib/src/main/java/tpi/dgrv4/common/constant/TsmpDpAaRtnCode.java

Lines changed: 500 additions & 500 deletions
Large diffs are not rendered by default.

dgrv4_Entity_lib/.settings/org.eclipse.buildship.core.prefs

Lines changed: 0 additions & 2 deletions
This file was deleted.

dgrv4_Entity_lib/.settings/org.eclipse.jdt.core.prefs

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
package tpi.dgrv4.entity.repository;
2-
3-
import java.util.List;
4-
5-
import org.springframework.data.jpa.repository.JpaRepository;
6-
import org.springframework.stereotype.Repository;
7-
8-
import tpi.dgrv4.entity.entity.DgrGtwIdpAuthCode;
9-
10-
@Repository
11-
public interface DgrGtwIdpAuthCodeDao extends JpaRepository<DgrGtwIdpAuthCode, Long> {
12-
13-
public List<DgrGtwIdpAuthCode> findByCreateUser(String createUser);
14-
15-
// AUTH_CODE 欄位為 UNIQUE
16-
public DgrGtwIdpAuthCode findFirstByAuthCode(String authCode);
17-
18-
// AUTH_CODE 欄位為 UNIQUE
19-
public DgrGtwIdpAuthCode findFirstByAuthCodeAndPhase(String authCode, String phase);
20-
}
1+
package tpi.dgrv4.entity.repository;
2+
3+
import java.util.List;
4+
5+
import org.springframework.data.jpa.repository.JpaRepository;
6+
import org.springframework.stereotype.Repository;
7+
8+
import tpi.dgrv4.entity.entity.DgrGtwIdpAuthCode;
9+
10+
@Repository
11+
public interface DgrGtwIdpAuthCodeDao extends JpaRepository<DgrGtwIdpAuthCode, Long> {
12+
13+
public List<DgrGtwIdpAuthCode> findByCreateUser(String createUser);
14+
15+
// AUTH_CODE 欄位為 UNIQUE
16+
public DgrGtwIdpAuthCode findFirstByAuthCode(String authCode);
17+
18+
// AUTH_CODE 欄位為 UNIQUE
19+
public DgrGtwIdpAuthCode findFirstByAuthCodeAndPhase(String authCode, String phase);
20+
}
Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
1-
package tpi.dgrv4.entity.repository;
2-
3-
import java.util.HashMap;
4-
import java.util.List;
5-
import java.util.Map;
6-
7-
import jakarta.persistence.EntityManager;
8-
import jakarta.persistence.PersistenceContext;
9-
import jakarta.transaction.Transactional;
10-
11-
import tpi.dgrv4.common.utils.StackTraceUtil;
12-
import tpi.dgrv4.entity.entity.SeqStore;
13-
14-
public class SeqStoreDaoImpl extends BaseDao {
15-
// add custom methods here
16-
17-
@PersistenceContext
18-
private EntityManager em;
19-
20-
@Transactional
21-
public Long nextSequence(String sequenceName, Long initial, Long increment) {
22-
Map<String, Object> params = new HashMap<>();
23-
StringBuffer sb = new StringBuffer();
24-
sb.append("select s.* from seq_store s where s.sequence_name = :sequenceName");
25-
params.put("sequenceName", sequenceName);
26-
final List<SeqStore> seqList = doNativeQuery(sb.toString(), null, params, null, SeqStore.class);
27-
params.clear();
28-
sb.setLength(0);
29-
30-
Long nextVal = null;
31-
if (seqList == null || seqList.isEmpty()) {
32-
nextVal = initial;
33-
sb.append("insert into seq_store (sequence_name, next_val) values (:sequenceName, :nextVal)");
34-
params.put("sequenceName", sequenceName);
35-
params.put("nextVal", (initial + increment));
36-
} else {
37-
SeqStore seq = seqList.get(0);
38-
final Long oldVal = seq.getNextVal();
39-
40-
// 否則 hibernate first-level cache 會造成無法更新值
41-
em.detach(seq);
42-
43-
nextVal = oldVal;
44-
sb.append("update seq_store set next_val = :nextVal where sequence_name = :sequenceName and next_val = :oldVal");
45-
params.put("nextVal", (oldVal + increment));
46-
params.put("sequenceName", sequenceName);
47-
params.put("oldVal", oldVal);
48-
}
49-
50-
int cnt = 0;
51-
try {
52-
cnt = doNativeUpdate(sb.toString(), params);
53-
if (cnt > 0) {
54-
return nextVal;
55-
}
56-
} catch (Exception e) {
57-
logger.debug(StackTraceUtil.logStackTrace(e));
58-
}
59-
return null;
60-
}
61-
62-
public List<SeqStore> queryExpiredSequence(String reqParam, String today_yyyyMMdd) {
63-
Map<String, Object> params = new HashMap<>();
64-
StringBuffer sb = new StringBuffer();
65-
sb.append(" select S");
66-
sb.append(" from SeqStore S");
67-
sb.append(" where S.sequenceName like :reqParam");
68-
sb.append(" and S.sequenceName <> :todaySequence");
69-
sb.append(" order by S.sequenceName asc");
70-
params.put("reqParam", reqParam + "-%");
71-
params.put("todaySequence", reqParam + "-" + today_yyyyMMdd);
72-
73-
return doQuery(sb.toString(), params, SeqStore.class);
74-
}
75-
1+
package tpi.dgrv4.entity.repository;
2+
3+
import java.util.HashMap;
4+
import java.util.List;
5+
import java.util.Map;
6+
7+
import jakarta.persistence.EntityManager;
8+
import jakarta.persistence.PersistenceContext;
9+
import jakarta.transaction.Transactional;
10+
11+
import tpi.dgrv4.common.utils.StackTraceUtil;
12+
import tpi.dgrv4.entity.entity.SeqStore;
13+
14+
public class SeqStoreDaoImpl extends BaseDao {
15+
// add custom methods here
16+
17+
@PersistenceContext
18+
private EntityManager em;
19+
20+
@Transactional
21+
public Long nextSequence(String sequenceName, Long initial, Long increment) {
22+
Map<String, Object> params = new HashMap<>();
23+
StringBuffer sb = new StringBuffer();
24+
sb.append("select s.* from seq_store s where s.sequence_name = :sequenceName");
25+
params.put("sequenceName", sequenceName);
26+
final List<SeqStore> seqList = doNativeQuery(sb.toString(), null, params, null, SeqStore.class);
27+
params.clear();
28+
sb.setLength(0);
29+
30+
Long nextVal = null;
31+
if (seqList == null || seqList.isEmpty()) {
32+
nextVal = initial;
33+
sb.append("insert into seq_store (sequence_name, next_val) values (:sequenceName, :nextVal)");
34+
params.put("sequenceName", sequenceName);
35+
params.put("nextVal", (initial + increment));
36+
} else {
37+
SeqStore seq = seqList.get(0);
38+
final Long oldVal = seq.getNextVal();
39+
40+
// 否則 hibernate first-level cache 會造成無法更新值
41+
em.detach(seq);
42+
43+
nextVal = oldVal;
44+
sb.append("update seq_store set next_val = :nextVal where sequence_name = :sequenceName and next_val = :oldVal");
45+
params.put("nextVal", (oldVal + increment));
46+
params.put("sequenceName", sequenceName);
47+
params.put("oldVal", oldVal);
48+
}
49+
50+
int cnt = 0;
51+
try {
52+
cnt = doNativeUpdate(sb.toString(), params);
53+
if (cnt > 0) {
54+
return nextVal;
55+
}
56+
} catch (Exception e) {
57+
logger.debug(StackTraceUtil.logStackTrace(e));
58+
}
59+
return null;
60+
}
61+
62+
public List<SeqStore> queryExpiredSequence(String reqParam, String today_yyyyMMdd) {
63+
Map<String, Object> params = new HashMap<>();
64+
StringBuffer sb = new StringBuffer();
65+
sb.append(" select S");
66+
sb.append(" from SeqStore S");
67+
sb.append(" where S.sequenceName like :reqParam");
68+
sb.append(" and S.sequenceName <> :todaySequence");
69+
sb.append(" order by S.sequenceName asc");
70+
params.put("reqParam", reqParam + "-%");
71+
params.put("todaySequence", reqParam + "-" + today_yyyyMMdd);
72+
73+
return doQuery(sb.toString(), params, SeqStore.class);
74+
}
75+
7676
}

0 commit comments

Comments
 (0)