Commit 406c670d5c1ace57f91a5ef15ecf1f28e1f3390f
1 parent
9c28833f
- 대상목록, 매칭목록 에 거래통화 추가 : DELNG_CRNCY
- AI 대상목록 SQL 변경
<!-- AI 작업리스트 -->
<select id="getAiReadData" parameterType="map" resultType="map">
SELECT DISTINCT sys_se
, accnut_ym
, cpr_code --자기법인
, partn_cpr --상대법인
, delng_crncy --통화유형
FROM PUBLIC.BATCH_TBCR_INNER_DELNG
WHERE SYS_SE = #{sysSe}
AND ACCNUT_YM = #{accnutYm}
AND MTCH_KY IS NULL
AND DTA_TY IN ('11','12','21','22','41','42')
AND CPR_CODE != 'OTHER'
AND PARTN_CPR != 'OTHER'
</select>
Showing
5 changed files
with
40 additions
and
64 deletions
Show diff stats
src/main/java/com/batch/config/MatchingExtraProcessorAuto.java
| @@ -42,13 +42,15 @@ public class MatchingExtraProcessorAuto { | @@ -42,13 +42,15 @@ public class MatchingExtraProcessorAuto { | ||
| 42 | String sAccnutYm = (String) paramRec.get("accnut_ym"); | 42 | String sAccnutYm = (String) paramRec.get("accnut_ym"); |
| 43 | String sCprCode = (String) paramRec.get("cpr_code"); | 43 | String sCprCode = (String) paramRec.get("cpr_code"); |
| 44 | String sPartCpr = (String) paramRec.get("partn_cpr"); | 44 | String sPartCpr = (String) paramRec.get("partn_cpr"); |
| 45 | + String sDelngCrncy = (String) paramRec.get("delng_crncy"); | ||
| 45 | String sConds = (String) paramRec.get("conds"); | 46 | String sConds = (String) paramRec.get("conds"); |
| 46 | - | 47 | + |
| 47 | //작업시작 | 48 | //작업시작 |
| 48 | Map<String, Object> mParam = new HashMap<String, Object>(); | 49 | Map<String, Object> mParam = new HashMap<String, Object>(); |
| 49 | mParam.put("sysSe", sSysSe); | 50 | mParam.put("sysSe", sSysSe); |
| 50 | mParam.put("accnutYm", sAccnutYm); | 51 | mParam.put("accnutYm", sAccnutYm); |
| 51 | mParam.put("conds", sConds); | 52 | mParam.put("conds", sConds); |
| 53 | + mParam.put("delngCrncy", sDelngCrncy); | ||
| 52 | 54 | ||
| 53 | //---------------------------------------------------------------------------- | 55 | //---------------------------------------------------------------------------- |
| 54 | //자기법인 데이타 가져오기 | 56 | //자기법인 데이타 가져오기 |
| @@ -131,7 +133,7 @@ public class MatchingExtraProcessorAuto { | @@ -131,7 +133,7 @@ public class MatchingExtraProcessorAuto { | ||
| 131 | int mtchNumber = 0; | 133 | int mtchNumber = 0; |
| 132 | String mtchSys = "AUTO"; | 134 | String mtchSys = "AUTO"; |
| 133 | String mtchType = "EX_" + iCmbnOwnCnt + "_" + iCmbnTranCnt; | 135 | String mtchType = "EX_" + iCmbnOwnCnt + "_" + iCmbnTranCnt; |
| 134 | - String mtchTypeName = "자기(" + iCmbnOwnCnt + "건Sum), 상대(" + iCmbnTranCnt + "건Sum), 비교(금액)"; | 136 | + String mtchTypeName = "자기(" + iCmbnOwnCnt + "건Sum), 상대(" + iCmbnTranCnt + "건Sum), ("+sDelngCrncy+"), 비교(금액)"; |
| 135 | for (BigDecimal curKey : mMatchingDataOne.keySet()) { | 137 | for (BigDecimal curKey : mMatchingDataOne.keySet()) { |
| 136 | if (mMatchingDataTwo.containsKey(curKey)) { | 138 | if (mMatchingDataTwo.containsKey(curKey)) { |
| 137 | List<List<Map>> llMapOne = mMatchingDataOne.get(curKey); | 139 | List<List<Map>> llMapOne = mMatchingDataOne.get(curKey); |
src/main/java/com/batch/config/MatchingItemProcessorAuto.java
| @@ -40,8 +40,10 @@ public class MatchingItemProcessorAuto implements ItemProcessor<Map, Map> { | @@ -40,8 +40,10 @@ public class MatchingItemProcessorAuto implements ItemProcessor<Map, Map> { | ||
| 40 | int mtchNumber = 0; | 40 | int mtchNumber = 0; |
| 41 | int iUpdated = 0; | 41 | int iUpdated = 0; |
| 42 | 42 | ||
| 43 | - log.debug("CustomItemProcessorA.params : " + params.toString()); | ||
| 44 | - log.debug("CustomItemProcessorA.item : " + item.get("cpr_code") + "," + item.get("partn_cpr")); | 43 | + log.info("CustomItemProcessorA.params : " + params.toString()); |
| 44 | + log.info("CustomItemProcessorA.item : " + item.toString()); | ||
| 45 | + | ||
| 46 | + params.put("delngCrncy", item.get("delng_crncy")); | ||
| 45 | 47 | ||
| 46 | //---------------------------------------------------------------------------- | 48 | //---------------------------------------------------------------------------- |
| 47 | //자기법인 업데이트 | 49 | //자기법인 업데이트 |
src/main/java/com/batch/controller/JobController.java
| @@ -120,12 +120,16 @@ public class JobController { | @@ -120,12 +120,16 @@ public class JobController { | ||
| 120 | // 수익/비용 | 120 | // 수익/비용 |
| 121 | for(Map curMap : retData) { | 121 | for(Map curMap : retData) { |
| 122 | curMap.put("conds", "T"); | 122 | curMap.put("conds", "T"); |
| 123 | + log.info("Start extraJobSub Transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); | ||
| 123 | jobService.extraJobSub(sJobGroup, curMap); | 124 | jobService.extraJobSub(sJobGroup, curMap); |
| 125 | + log.info("End extraJobSub Transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); | ||
| 124 | } | 126 | } |
| 125 | //채권/채무 | 127 | //채권/채무 |
| 126 | for(Map curMap : retData) { | 128 | for(Map curMap : retData) { |
| 127 | curMap.put("conds", "B"); | 129 | curMap.put("conds", "B"); |
| 130 | + log.info("Start extraJobSub Balance !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); | ||
| 128 | jobService.extraJobSub(sJobGroup, curMap); | 131 | jobService.extraJobSub(sJobGroup, curMap); |
| 132 | + log.info("End extraJobSub Balance !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); | ||
| 129 | } | 133 | } |
| 130 | 134 | ||
| 131 | log.debug("End Extra Matching Job"); | 135 | log.debug("End Extra Matching Job"); |
src/main/java/com/batch/service/JobService.java
| @@ -139,7 +139,7 @@ public class JobService { | @@ -139,7 +139,7 @@ public class JobService { | ||
| 139 | 139 | ||
| 140 | String sThreadName = Thread.currentThread().getName(); | 140 | String sThreadName = Thread.currentThread().getName(); |
| 141 | long startTime = System.currentTimeMillis(); | 141 | long startTime = System.currentTimeMillis(); |
| 142 | - log.info("extra [" + sThreadName + "]Job Started : " + startTime); | 142 | + log.info("extra [" + sThreadName + "]Job Started : " + startTime + "]params=" + paramRec.toString()); |
| 143 | log.debug("extra [" + sThreadName + "]params=" + paramRec.toString()); | 143 | log.debug("extra [" + sThreadName + "]params=" + paramRec.toString()); |
| 144 | 144 | ||
| 145 | MatchingExtraProcessorAuto matchingExtraProcessorAuto = new MatchingExtraProcessorAuto(matchingInnerDelingMapper); | 145 | MatchingExtraProcessorAuto matchingExtraProcessorAuto = new MatchingExtraProcessorAuto(matchingInnerDelingMapper); |
src/main/resources/mybatis/primaryMapper/MatchingInnerDelingMapper.xml
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | , accnut_ym | 9 | , accnut_ym |
| 10 | , cpr_code | 10 | , cpr_code |
| 11 | , partn_cpr | 11 | , partn_cpr |
| 12 | + , delng_crncy | ||
| 12 | FROM | 13 | FROM |
| 13 | ( | 14 | ( |
| 14 | SELECT | 15 | SELECT |
| @@ -16,6 +17,7 @@ | @@ -16,6 +17,7 @@ | ||
| 16 | , accnut_ym | 17 | , accnut_ym |
| 17 | , cpr_code | 18 | , cpr_code |
| 18 | , partn_cpr | 19 | , partn_cpr |
| 20 | + , delng_crncy | ||
| 19 | , case when count(*) > 0 then 1 else 0 end as cnt | 21 | , case when count(*) > 0 then 1 else 0 end as cnt |
| 20 | FROM | 22 | FROM |
| 21 | public.batch_tbcr_inner_delng | 23 | public.batch_tbcr_inner_delng |
| @@ -29,12 +31,14 @@ | @@ -29,12 +31,14 @@ | ||
| 29 | , accnut_ym | 31 | , accnut_ym |
| 30 | , cpr_code | 32 | , cpr_code |
| 31 | , partn_cpr | 33 | , partn_cpr |
| 34 | + , delng_crncy | ||
| 32 | union all | 35 | union all |
| 33 | SELECT | 36 | SELECT |
| 34 | sys_se | 37 | sys_se |
| 35 | , accnut_ym | 38 | , accnut_ym |
| 36 | , partn_cpr as cpr_code | 39 | , partn_cpr as cpr_code |
| 37 | , cpr_code as partn_cpr | 40 | , cpr_code as partn_cpr |
| 41 | + , delng_crncy | ||
| 38 | , case when count(*) > 0 then 1 else 0 end as cnt | 42 | , case when count(*) > 0 then 1 else 0 end as cnt |
| 39 | FROM | 43 | FROM |
| 40 | public.batch_tbcr_inner_delng | 44 | public.batch_tbcr_inner_delng |
| @@ -48,12 +52,14 @@ | @@ -48,12 +52,14 @@ | ||
| 48 | , accnut_ym | 52 | , accnut_ym |
| 49 | , cpr_code | 53 | , cpr_code |
| 50 | , partn_cpr | 54 | , partn_cpr |
| 55 | + , delng_crncy | ||
| 51 | ) m | 56 | ) m |
| 52 | GROUP BY | 57 | GROUP BY |
| 53 | sys_se | 58 | sys_se |
| 54 | , accnut_ym | 59 | , accnut_ym |
| 55 | , cpr_code | 60 | , cpr_code |
| 56 | , partn_cpr | 61 | , partn_cpr |
| 62 | + , delng_crncy | ||
| 57 | HAVING sum(cnt) > 1 | 63 | HAVING sum(cnt) > 1 |
| 58 | </select> | 64 | </select> |
| 59 | 65 | ||
| @@ -67,6 +73,7 @@ | @@ -67,6 +73,7 @@ | ||
| 67 | and accnut_ym = #{accnutYm} | 73 | and accnut_ym = #{accnutYm} |
| 68 | and cpr_code = #{cprCode} | 74 | and cpr_code = #{cprCode} |
| 69 | and partn_cpr = #{partnCpr} | 75 | and partn_cpr = #{partnCpr} |
| 76 | + and delng_crncy = #{delngCrncy} | ||
| 70 | <foreach collection="cond" item="item" open="" close="" separator=""> | 77 | <foreach collection="cond" item="item" open="" close="" separator=""> |
| 71 | and ${item} | 78 | and ${item} |
| 72 | </foreach> | 79 | </foreach> |
| @@ -86,6 +93,7 @@ | @@ -86,6 +93,7 @@ | ||
| 86 | and compare_ky is not null | 93 | and compare_ky is not null |
| 87 | and cpr_code = #{cprCode} | 94 | and cpr_code = #{cprCode} |
| 88 | and partn_cpr = #{partnCpr} | 95 | and partn_cpr = #{partnCpr} |
| 96 | + and delng_crncy = #{delngCrncy} | ||
| 89 | <foreach collection="cond" item="item" open="" close="" separator=""> | 97 | <foreach collection="cond" item="item" open="" close="" separator=""> |
| 90 | and ${item} | 98 | and ${item} |
| 91 | </foreach> | 99 | </foreach> |
| @@ -109,6 +117,7 @@ | @@ -109,6 +117,7 @@ | ||
| 109 | and compare_ky is not null | 117 | and compare_ky is not null |
| 110 | and cpr_code = #{cprCode} | 118 | and cpr_code = #{cprCode} |
| 111 | and partn_cpr = #{partnCpr} | 119 | and partn_cpr = #{partnCpr} |
| 120 | + and delng_crncy = #{delngCrncy} | ||
| 112 | <foreach collection="cond" item="item" open="" close="" separator=""> | 121 | <foreach collection="cond" item="item" open="" close="" separator=""> |
| 113 | and ${item} | 122 | and ${item} |
| 114 | </foreach> | 123 | </foreach> |
| @@ -411,6 +420,7 @@ | @@ -411,6 +420,7 @@ | ||
| 411 | , sn | 420 | , sn |
| 412 | , '' as compare_ky | 421 | , '' as compare_ky |
| 413 | , delng_de | 422 | , delng_de |
| 423 | + , delng_crncy | ||
| 414 | , delng_amt | 424 | , delng_amt |
| 415 | FROM | 425 | FROM |
| 416 | public.batch_tbcr_inner_delng | 426 | public.batch_tbcr_inner_delng |
| @@ -419,6 +429,7 @@ | @@ -419,6 +429,7 @@ | ||
| 419 | and accnut_ym = #{accnutYm} | 429 | and accnut_ym = #{accnutYm} |
| 420 | and cpr_code = #{cprCode} | 430 | and cpr_code = #{cprCode} |
| 421 | and partn_cpr = #{partnCpr} | 431 | and partn_cpr = #{partnCpr} |
| 432 | + and delng_crncy = #{delngCrncy} | ||
| 422 | and mtch_ky is null | 433 | and mtch_ky is null |
| 423 | <if test='conds eq "T".toString()'> | 434 | <if test='conds eq "T".toString()'> |
| 424 | and dta_ty in ('11','21','41') | 435 | and dta_ty in ('11','21','41') |
| @@ -428,7 +439,7 @@ | @@ -428,7 +439,7 @@ | ||
| 428 | </if> | 439 | </if> |
| 429 | and delng_amt != 0 | 440 | and delng_amt != 0 |
| 430 | ORDER BY | 441 | ORDER BY |
| 431 | - delng_de | 442 | + delng_de, sn |
| 432 | </select> | 443 | </select> |
| 433 | 444 | ||
| 434 | <!-- 매칭작업할 데이타 가져오기 --> | 445 | <!-- 매칭작업할 데이타 가져오기 --> |
| @@ -439,6 +450,7 @@ | @@ -439,6 +450,7 @@ | ||
| 439 | , sn | 450 | , sn |
| 440 | , '' as compare_ky | 451 | , '' as compare_ky |
| 441 | , delng_de | 452 | , delng_de |
| 453 | + , delng_crncy | ||
| 442 | , delng_amt | 454 | , delng_amt |
| 443 | FROM | 455 | FROM |
| 444 | public.batch_tbcr_inner_delng | 456 | public.batch_tbcr_inner_delng |
| @@ -447,6 +459,7 @@ | @@ -447,6 +459,7 @@ | ||
| 447 | and accnut_ym = #{accnutYm} | 459 | and accnut_ym = #{accnutYm} |
| 448 | and cpr_code = #{cprCode} | 460 | and cpr_code = #{cprCode} |
| 449 | and partn_cpr = #{partnCpr} | 461 | and partn_cpr = #{partnCpr} |
| 462 | + and delng_crncy = #{delngCrncy} | ||
| 450 | and mtch_ky is null | 463 | and mtch_ky is null |
| 451 | <if test='conds eq "T".toString()'> | 464 | <if test='conds eq "T".toString()'> |
| 452 | and dta_ty in ('12','22','42') | 465 | and dta_ty in ('12','22','42') |
| @@ -456,7 +469,7 @@ | @@ -456,7 +469,7 @@ | ||
| 456 | </if> | 469 | </if> |
| 457 | and delng_amt != 0 | 470 | and delng_amt != 0 |
| 458 | ORDER BY | 471 | ORDER BY |
| 459 | - delng_de | 472 | + delng_de, sn |
| 460 | </select> | 473 | </select> |
| 461 | 474 | ||
| 462 | <update id="setExtraResult" parameterType="map"> | 475 | <update id="setExtraResult" parameterType="map"> |
| @@ -503,63 +516,18 @@ | @@ -503,63 +516,18 @@ | ||
| 503 | 516 | ||
| 504 | <!-- AI 작업리스트 --> | 517 | <!-- AI 작업리스트 --> |
| 505 | <select id="getAiReadData" parameterType="map" resultType="map"> | 518 | <select id="getAiReadData" parameterType="map" resultType="map"> |
| 506 | - SELECT | ||
| 507 | - sys_se | ||
| 508 | - , accnut_ym | ||
| 509 | - , cpr_code | ||
| 510 | - , partn_cpr | ||
| 511 | - , delng_crncy | ||
| 512 | - FROM | ||
| 513 | - ( | ||
| 514 | - SELECT | ||
| 515 | - sys_se | ||
| 516 | - , accnut_ym | ||
| 517 | - , cpr_code | ||
| 518 | - , partn_cpr | ||
| 519 | - , delng_crncy | ||
| 520 | - , case when count(*) > 0 then 1 else 0 end as cnt | ||
| 521 | - FROM | ||
| 522 | - public.batch_tbcr_inner_delng | ||
| 523 | - WHERE | ||
| 524 | - sys_se = #{sysSe} | ||
| 525 | - and accnut_ym = #{accnutYm} | ||
| 526 | - and mtch_ty is null | ||
| 527 | - and dta_ty in ('11','21','31','33','35','37','41') | ||
| 528 | - GROUP BY | ||
| 529 | - sys_se | ||
| 530 | - , accnut_ym | ||
| 531 | - , cpr_code | ||
| 532 | - , partn_cpr | ||
| 533 | - , delng_crncy | ||
| 534 | - union all | ||
| 535 | - SELECT | ||
| 536 | - sys_se | ||
| 537 | - , accnut_ym | ||
| 538 | - , partn_cpr as cpr_code | ||
| 539 | - , cpr_code as partn_cpr | ||
| 540 | - , delng_crncy | ||
| 541 | - , case when count(*) > 0 then 1 else 0 end as cnt | ||
| 542 | - FROM | ||
| 543 | - public.batch_tbcr_inner_delng | ||
| 544 | - WHERE | ||
| 545 | - sys_se = #{sysSe} | ||
| 546 | - and accnut_ym = #{accnutYm} | ||
| 547 | - and mtch_ty is null | ||
| 548 | - and dta_ty in ('12','22','32','34','36','38','42') | ||
| 549 | - GROUP BY | ||
| 550 | - sys_se | ||
| 551 | - , accnut_ym | ||
| 552 | - , cpr_code | ||
| 553 | - , partn_cpr | ||
| 554 | - , delng_crncy | ||
| 555 | - ) m | ||
| 556 | - GROUP BY | ||
| 557 | - sys_se | ||
| 558 | - , accnut_ym | ||
| 559 | - , cpr_code | ||
| 560 | - , partn_cpr | ||
| 561 | - , delng_crncy | ||
| 562 | - HAVING sum(cnt) > 1 | 519 | + SELECT DISTINCT sys_se |
| 520 | + , accnut_ym | ||
| 521 | + , cpr_code --자기법인 | ||
| 522 | + , partn_cpr --상대법인 | ||
| 523 | + , delng_crncy --통화유형 | ||
| 524 | + FROM PUBLIC.BATCH_TBCR_INNER_DELNG | ||
| 525 | + WHERE SYS_SE = #{sysSe} | ||
| 526 | + AND ACCNUT_YM = #{accnutYm} | ||
| 527 | + AND MTCH_KY IS NULL | ||
| 528 | + AND DTA_TY IN ('11','12','21','22','41','42') | ||
| 529 | + AND CPR_CODE != 'OTHER' | ||
| 530 | + AND PARTN_CPR != 'OTHER' | ||
| 563 | </select> | 531 | </select> |
| 564 | 532 | ||
| 565 | <!-- User Job Status --> | 533 | <!-- User Job Status --> |