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 | 42 | String sAccnutYm = (String) paramRec.get("accnut_ym"); |
| 43 | 43 | String sCprCode = (String) paramRec.get("cpr_code"); |
| 44 | 44 | String sPartCpr = (String) paramRec.get("partn_cpr"); |
| 45 | + String sDelngCrncy = (String) paramRec.get("delng_crncy"); | |
| 45 | 46 | String sConds = (String) paramRec.get("conds"); |
| 46 | - | |
| 47 | + | |
| 47 | 48 | //작업시작 |
| 48 | 49 | Map<String, Object> mParam = new HashMap<String, Object>(); |
| 49 | 50 | mParam.put("sysSe", sSysSe); |
| 50 | 51 | mParam.put("accnutYm", sAccnutYm); |
| 51 | 52 | mParam.put("conds", sConds); |
| 53 | + mParam.put("delngCrncy", sDelngCrncy); | |
| 52 | 54 | |
| 53 | 55 | //---------------------------------------------------------------------------- |
| 54 | 56 | //자기법인 데이타 가져오기 |
| ... | ... | @@ -131,7 +133,7 @@ public class MatchingExtraProcessorAuto { |
| 131 | 133 | int mtchNumber = 0; |
| 132 | 134 | String mtchSys = "AUTO"; |
| 133 | 135 | String mtchType = "EX_" + iCmbnOwnCnt + "_" + iCmbnTranCnt; |
| 134 | - String mtchTypeName = "자기(" + iCmbnOwnCnt + "건Sum), 상대(" + iCmbnTranCnt + "건Sum), 비교(금액)"; | |
| 136 | + String mtchTypeName = "자기(" + iCmbnOwnCnt + "건Sum), 상대(" + iCmbnTranCnt + "건Sum), ("+sDelngCrncy+"), 비교(금액)"; | |
| 135 | 137 | for (BigDecimal curKey : mMatchingDataOne.keySet()) { |
| 136 | 138 | if (mMatchingDataTwo.containsKey(curKey)) { |
| 137 | 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 | 40 | int mtchNumber = 0; |
| 41 | 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 | 120 | // 수익/비용 |
| 121 | 121 | for(Map curMap : retData) { |
| 122 | 122 | curMap.put("conds", "T"); |
| 123 | + log.info("Start extraJobSub Transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); | |
| 123 | 124 | jobService.extraJobSub(sJobGroup, curMap); |
| 125 | + log.info("End extraJobSub Transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); | |
| 124 | 126 | } |
| 125 | 127 | //채권/채무 |
| 126 | 128 | for(Map curMap : retData) { |
| 127 | 129 | curMap.put("conds", "B"); |
| 130 | + log.info("Start extraJobSub Balance !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); | |
| 128 | 131 | jobService.extraJobSub(sJobGroup, curMap); |
| 132 | + log.info("End extraJobSub Balance !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); | |
| 129 | 133 | } |
| 130 | 134 | |
| 131 | 135 | log.debug("End Extra Matching Job"); | ... | ... |
src/main/java/com/batch/service/JobService.java
| ... | ... | @@ -139,7 +139,7 @@ public class JobService { |
| 139 | 139 | |
| 140 | 140 | String sThreadName = Thread.currentThread().getName(); |
| 141 | 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 | 143 | log.debug("extra [" + sThreadName + "]params=" + paramRec.toString()); |
| 144 | 144 | |
| 145 | 145 | MatchingExtraProcessorAuto matchingExtraProcessorAuto = new MatchingExtraProcessorAuto(matchingInnerDelingMapper); | ... | ... |
src/main/resources/mybatis/primaryMapper/MatchingInnerDelingMapper.xml
| ... | ... | @@ -9,6 +9,7 @@ |
| 9 | 9 | , accnut_ym |
| 10 | 10 | , cpr_code |
| 11 | 11 | , partn_cpr |
| 12 | + , delng_crncy | |
| 12 | 13 | FROM |
| 13 | 14 | ( |
| 14 | 15 | SELECT |
| ... | ... | @@ -16,6 +17,7 @@ |
| 16 | 17 | , accnut_ym |
| 17 | 18 | , cpr_code |
| 18 | 19 | , partn_cpr |
| 20 | + , delng_crncy | |
| 19 | 21 | , case when count(*) > 0 then 1 else 0 end as cnt |
| 20 | 22 | FROM |
| 21 | 23 | public.batch_tbcr_inner_delng |
| ... | ... | @@ -29,12 +31,14 @@ |
| 29 | 31 | , accnut_ym |
| 30 | 32 | , cpr_code |
| 31 | 33 | , partn_cpr |
| 34 | + , delng_crncy | |
| 32 | 35 | union all |
| 33 | 36 | SELECT |
| 34 | 37 | sys_se |
| 35 | 38 | , accnut_ym |
| 36 | 39 | , partn_cpr as cpr_code |
| 37 | 40 | , cpr_code as partn_cpr |
| 41 | + , delng_crncy | |
| 38 | 42 | , case when count(*) > 0 then 1 else 0 end as cnt |
| 39 | 43 | FROM |
| 40 | 44 | public.batch_tbcr_inner_delng |
| ... | ... | @@ -48,12 +52,14 @@ |
| 48 | 52 | , accnut_ym |
| 49 | 53 | , cpr_code |
| 50 | 54 | , partn_cpr |
| 55 | + , delng_crncy | |
| 51 | 56 | ) m |
| 52 | 57 | GROUP BY |
| 53 | 58 | sys_se |
| 54 | 59 | , accnut_ym |
| 55 | 60 | , cpr_code |
| 56 | 61 | , partn_cpr |
| 62 | + , delng_crncy | |
| 57 | 63 | HAVING sum(cnt) > 1 |
| 58 | 64 | </select> |
| 59 | 65 | |
| ... | ... | @@ -67,6 +73,7 @@ |
| 67 | 73 | and accnut_ym = #{accnutYm} |
| 68 | 74 | and cpr_code = #{cprCode} |
| 69 | 75 | and partn_cpr = #{partnCpr} |
| 76 | + and delng_crncy = #{delngCrncy} | |
| 70 | 77 | <foreach collection="cond" item="item" open="" close="" separator=""> |
| 71 | 78 | and ${item} |
| 72 | 79 | </foreach> |
| ... | ... | @@ -86,6 +93,7 @@ |
| 86 | 93 | and compare_ky is not null |
| 87 | 94 | and cpr_code = #{cprCode} |
| 88 | 95 | and partn_cpr = #{partnCpr} |
| 96 | + and delng_crncy = #{delngCrncy} | |
| 89 | 97 | <foreach collection="cond" item="item" open="" close="" separator=""> |
| 90 | 98 | and ${item} |
| 91 | 99 | </foreach> |
| ... | ... | @@ -109,6 +117,7 @@ |
| 109 | 117 | and compare_ky is not null |
| 110 | 118 | and cpr_code = #{cprCode} |
| 111 | 119 | and partn_cpr = #{partnCpr} |
| 120 | + and delng_crncy = #{delngCrncy} | |
| 112 | 121 | <foreach collection="cond" item="item" open="" close="" separator=""> |
| 113 | 122 | and ${item} |
| 114 | 123 | </foreach> |
| ... | ... | @@ -411,6 +420,7 @@ |
| 411 | 420 | , sn |
| 412 | 421 | , '' as compare_ky |
| 413 | 422 | , delng_de |
| 423 | + , delng_crncy | |
| 414 | 424 | , delng_amt |
| 415 | 425 | FROM |
| 416 | 426 | public.batch_tbcr_inner_delng |
| ... | ... | @@ -419,6 +429,7 @@ |
| 419 | 429 | and accnut_ym = #{accnutYm} |
| 420 | 430 | and cpr_code = #{cprCode} |
| 421 | 431 | and partn_cpr = #{partnCpr} |
| 432 | + and delng_crncy = #{delngCrncy} | |
| 422 | 433 | and mtch_ky is null |
| 423 | 434 | <if test='conds eq "T".toString()'> |
| 424 | 435 | and dta_ty in ('11','21','41') |
| ... | ... | @@ -428,7 +439,7 @@ |
| 428 | 439 | </if> |
| 429 | 440 | and delng_amt != 0 |
| 430 | 441 | ORDER BY |
| 431 | - delng_de | |
| 442 | + delng_de, sn | |
| 432 | 443 | </select> |
| 433 | 444 | |
| 434 | 445 | <!-- 매칭작업할 데이타 가져오기 --> |
| ... | ... | @@ -439,6 +450,7 @@ |
| 439 | 450 | , sn |
| 440 | 451 | , '' as compare_ky |
| 441 | 452 | , delng_de |
| 453 | + , delng_crncy | |
| 442 | 454 | , delng_amt |
| 443 | 455 | FROM |
| 444 | 456 | public.batch_tbcr_inner_delng |
| ... | ... | @@ -447,6 +459,7 @@ |
| 447 | 459 | and accnut_ym = #{accnutYm} |
| 448 | 460 | and cpr_code = #{cprCode} |
| 449 | 461 | and partn_cpr = #{partnCpr} |
| 462 | + and delng_crncy = #{delngCrncy} | |
| 450 | 463 | and mtch_ky is null |
| 451 | 464 | <if test='conds eq "T".toString()'> |
| 452 | 465 | and dta_ty in ('12','22','42') |
| ... | ... | @@ -456,7 +469,7 @@ |
| 456 | 469 | </if> |
| 457 | 470 | and delng_amt != 0 |
| 458 | 471 | ORDER BY |
| 459 | - delng_de | |
| 472 | + delng_de, sn | |
| 460 | 473 | </select> |
| 461 | 474 | |
| 462 | 475 | <update id="setExtraResult" parameterType="map"> |
| ... | ... | @@ -503,63 +516,18 @@ |
| 503 | 516 | |
| 504 | 517 | <!-- AI 작업리스트 --> |
| 505 | 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 | 531 | </select> |
| 564 | 532 | |
| 565 | 533 | <!-- User Job Status --> | ... | ... |