|
@@ -96,10 +96,10 @@ public class GgitsEtlpService {
|
|
|
initEtlp();
|
|
|
|
|
|
//교차로구성_연계, SCS_T_CON_INTLC
|
|
|
- etlpIntLc();
|
|
|
+// etlpIntLc();
|
|
|
|
|
|
//교차로이동류_연계, SCS_T_CON_INTFLOW
|
|
|
- etlpIntFlow();
|
|
|
+ etlpIntPhase();
|
|
|
|
|
|
//교차로일계획_연계, SCS_T_CON_INTDPLAN
|
|
|
etlpIntDPlan();
|
|
@@ -171,8 +171,8 @@ public class GgitsEtlpService {
|
|
|
try {
|
|
|
MDC.put("id", center.getLogKey());
|
|
|
log.info("================================================================================================>");
|
|
|
- log.info("TB_INT, SCS_T_CON_INTLC START. {}, {}, {}, {}, ETLP: {}",
|
|
|
- center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId(), this.config.isEtlpInt());
|
|
|
+ log.info("TB_INT, SCS_T_CON_INTLC START. {}, {}, {}, {}, {}, ETLP: {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId(), etlp.getQryDt(), this.config.isEtlpInt());
|
|
|
|
|
|
// this.sigMapper.initTbInt(center.getRegionCd());
|
|
|
HashMap<Integer, TbInt> intMap = new HashMap<>();
|
|
@@ -239,6 +239,97 @@ public class GgitsEtlpService {
|
|
|
log.info("<^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
|
}
|
|
|
|
|
|
+ //교차로이동류_연계, SCS_T_CON_INTFLOW
|
|
|
+ private void etlpIntPhase() {
|
|
|
+ log.info("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^>");
|
|
|
+ Elapsed elapsed = new Elapsed();
|
|
|
+ Elapsed totElapsed = new Elapsed();
|
|
|
+ log.info("TB_INT_PHASE, SCS_T_CON_INTFLOW START.");
|
|
|
+ List<HashMap<String, Object>> etlpLists = new ArrayList<>();
|
|
|
+ List<HashMap<String, Object>> lists;
|
|
|
+
|
|
|
+ for (String key : this.centerList) {
|
|
|
+ RegionCenter center = this.repo.getCenterMap().get(key);
|
|
|
+ if (center == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ TimeUtils.sleep(500);
|
|
|
+ elapsed.reset();
|
|
|
+
|
|
|
+ int invalidData = 0;
|
|
|
+ int writeCount = 0;
|
|
|
+ int currWriteCount;
|
|
|
+ Elapsed job = new Elapsed();
|
|
|
+ EtlpInfo etlp = center.getEtlpFlow();
|
|
|
+ etlp.startEtlp();
|
|
|
+
|
|
|
+ try {
|
|
|
+ MDC.put("id", center.getLogKey());
|
|
|
+ log.info("TB_INT_PHASE, SCS_T_CON_INTFLOW START. {}, {}, {}, {}, {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId(), etlp.getQryDt());
|
|
|
+
|
|
|
+ Integer dataCount = this.gitsMapper.selectScsTConIntFlowCount(center, EtlpConst.qryCountAll);
|
|
|
+ Integer etlpCount = this.gitsMapper.selectScsTConIntFlowCount(center, etlp.getQryDt());
|
|
|
+ etlp.setCount(dataCount, etlpCount);
|
|
|
+ log.info("TB_INT_PHASE, SCS_T_CON_INTFLOW .READ. {}, {}, DATA({}) ETLP({}) EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), dataCount, etlpCount, job.elapsedTimeStr());
|
|
|
+
|
|
|
+ if (etlpCount > 0) {
|
|
|
+ int pageCount = getPageCount(etlpCount);
|
|
|
+ for (int ii = 0; ii < pageCount; ii++) {
|
|
|
+ int fromSeq = (ii * this.config.getPageCount());
|
|
|
+ int toSeq = fromSeq + this.config.getPageCount();
|
|
|
+ fromSeq++;
|
|
|
+ List<TbScsTConIntFlow> result = this.gitsMapper.selectScsTConIntFlow(center, fromSeq, toSeq, etlp.getQryDt());
|
|
|
+ log.info("TB_INT_PHASE, SCS_T_CON_INTFLOW .READ. {}, {}, {}. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), String.format("%6d ~ %6d, %6d EA", fromSeq, toSeq, result.size()), job.elapsedTimeStr());
|
|
|
+ TimeUtils.sleep(500);
|
|
|
+ job.reset();
|
|
|
+
|
|
|
+ lists = new ArrayList<>();
|
|
|
+ currWriteCount = 0;
|
|
|
+ for(TbScsTConIntFlow obj: result) {
|
|
|
+ HashMap<String, Object> param = obj.toSig(center.getRegionCd());
|
|
|
+ if (!param.isEmpty()) {
|
|
|
+ lists.add(param);
|
|
|
+ if (lists.size() >= BatchDaoService.MAX_BATCH_SIZE) {
|
|
|
+ currWriteCount += this.dao.updateTbIntPhase(lists);
|
|
|
+ lists = new ArrayList<>();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ invalidData++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!lists.isEmpty()) {
|
|
|
+ currWriteCount += this.dao.updateTbIntPhase(lists);
|
|
|
+ }
|
|
|
+ writeCount += currWriteCount;
|
|
|
+ log.info("TB_INT_PHASE, SCS_T_CON_INTFLOW WRITE. {}, {}, {}. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), String.format("%6d ~ %6d, %6d EA", fromSeq, toSeq, currWriteCount), job.elapsedTimeStr());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ etlp.endEtlp(true, writeCount);
|
|
|
+ log.info("TB_INT_PHASE, SCS_T_CON_INTFLOW WRITE. {}, {}, {} EA. Invalid Data {} EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), writeCount, invalidData, elapsed.elapsedTimeStr());
|
|
|
+ log.info("-------------------------------------------------------------------------------------------------");
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ etlp.endEtlp(false, writeCount);
|
|
|
+ log.error("TB_INT_PHASE, SCS_T_CON_INTFLOW: {}, {}, Exceptions: {}", center.getRegionCd(), center.getRegionNm(), e.getMessage());
|
|
|
+ }
|
|
|
+ finally {
|
|
|
+ center.setElapsed(center.getElapsed() + elapsed.milliSeconds());
|
|
|
+ MDC.remove(center.getLogKey());
|
|
|
+ MDC.clear();
|
|
|
+ }
|
|
|
+ etlpLists.add(etlp.toSig(center.getRegionCd(), EtlpConst.etlpTableFlow));
|
|
|
+ }
|
|
|
+ updateEtlpResult(EtlpConst.etlpTableFlow, etlpLists);
|
|
|
+ log.info("TB_INT_PHASE, SCS_T_CON_INTFLOW ..END. {}", totElapsed.elapsedTimeStr());
|
|
|
+ log.info("<^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
|
+ }
|
|
|
+
|
|
|
//교차로이동류_연계, SCS_T_CON_INTFLOW
|
|
|
private void etlpIntFlow() {
|
|
|
log.info("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^>");
|
|
@@ -265,8 +356,8 @@ public class GgitsEtlpService {
|
|
|
|
|
|
try {
|
|
|
MDC.put("id", center.getLogKey());
|
|
|
- log.info("TB_INT_FLOW, SCS_T_CON_INTFLOW START. {}, {}, {}, {}",
|
|
|
- center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId());
|
|
|
+ log.info("TB_INT_FLOW, SCS_T_CON_INTFLOW START. {}, {}, {}, {}, {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId(), etlp.getQryDt());
|
|
|
|
|
|
Integer dataCount = this.gitsMapper.selectScsTConIntFlowCount(center, EtlpConst.qryCountAll);
|
|
|
Integer etlpCount = this.gitsMapper.selectScsTConIntFlowCount(center, etlp.getQryDt());
|
|
@@ -355,8 +446,8 @@ public class GgitsEtlpService {
|
|
|
|
|
|
try {
|
|
|
MDC.put("id", center.getLogKey());
|
|
|
- log.info("TB_INT_OPER_PLAN, SCS_T_CON_INTDPLAN START. {}, {}, {}, {}",
|
|
|
- center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId());
|
|
|
+ log.info("TB_INT_OPER_PLAN, SCS_T_CON_INTDPLAN START. {}, {}, {}, {}, {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId(), etlp.getQryDt());
|
|
|
|
|
|
Integer dataCount = this.gitsMapper.selectScsTConIntDPlanCount(center, EtlpConst.qryCountAll);
|
|
|
Integer etlpCount = this.gitsMapper.selectScsTConIntDPlanCount(center, etlp.getQryDt());
|
|
@@ -525,8 +616,8 @@ public class GgitsEtlpService {
|
|
|
|
|
|
try {
|
|
|
MDC.put("id", center.getLogKey());
|
|
|
- log.info("TB_INT_RESRV_PLAN, SCS_T_CON_INTFPLAN START. {}, {}, {}, {}",
|
|
|
- center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId());
|
|
|
+ log.info("TB_INT_RESRV_PLAN, SCS_T_CON_INTFPLAN START. {}, {}, {}, {}, {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId(), etlp.getQryDt());
|
|
|
|
|
|
Integer dataCount = this.gitsMapper.selectScsTConIntFPlanCount(center, EtlpConst.qryCountAll);
|
|
|
Integer etlpCount = this.gitsMapper.selectScsTConIntFPlanCount(center, etlp.getQryDt());
|
|
@@ -610,8 +701,8 @@ public class GgitsEtlpService {
|
|
|
|
|
|
try {
|
|
|
MDC.put("id", center.getLogKey());
|
|
|
- log.info("TB_INT_SIGNALMAP, SCS_T_CON_INTSIGMAP START. {}, {}, {}, {}",
|
|
|
- center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId());
|
|
|
+ log.info("TB_INT_SIGNALMAP, SCS_T_CON_INTSIGMAP START. {}, {}, {}, {}, {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId(), etlp.getQryDt());
|
|
|
|
|
|
Integer dataCount = this.gitsMapper.selectScsTConIntSigmapCount(center, EtlpConst.qryCountAll);
|
|
|
Integer etlpCount = this.gitsMapper.selectScsTConIntSigmapCount(center, etlp.getQryDt());
|