diff --git a/src/main/java/cokr/xit/fims/crdn/CrdnQuery.java b/src/main/java/cokr/xit/fims/crdn/CrdnQuery.java index 35bea6a8..641e6bdb 100644 --- a/src/main/java/cokr/xit/fims/crdn/CrdnQuery.java +++ b/src/main/java/cokr/xit/fims/crdn/CrdnQuery.java @@ -29,7 +29,7 @@ public class CrdnQuery extends CmmnQuery { private String crdnId; private String[] crdnIDs; private String amtDcsnCdGroupId; - private String dtlAmtDcsnCdGroupId; + private String dtlAmtDcsnGroupId; private String fileLayoutId; //날짜 @@ -417,12 +417,12 @@ public class CrdnQuery extends CmmnQuery { return self(); } - public String getDtlAmtDcsnCdGroupId() { - return ifEmpty(dtlAmtDcsnCdGroupId, () -> null); + public String getDtlAmtDcsnGroupId() { + return ifEmpty(dtlAmtDcsnGroupId, () -> null); } - public T setDtlAmtDcsnCdGroupId(String dtlAmtDcsnCdGroupId) { - this.dtlAmtDcsnCdGroupId = dtlAmtDcsnCdGroupId; + public T setDtlAmtDcsnGroupId(String dtlAmtDcsnGroupId) { + this.dtlAmtDcsnGroupId = dtlAmtDcsnGroupId; return self(); } diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java index 35342cb4..80474217 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java @@ -26,8 +26,10 @@ import cokr.xit.fims.cmmn.CrdnSttsHstry; import cokr.xit.fims.cmmn.service.bean.CrdnPayerHstryBean; import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; import cokr.xit.fims.crdn.Crdn; +import cokr.xit.fims.crdn.Team; import cokr.xit.fims.crdn.dao.CrdnInfoMapper; import cokr.xit.fims.crdn.dao.CrdnInstMapper; +import cokr.xit.fims.crdn.dao.CrdnTeamMapper; import cokr.xit.fims.crdn.dao.CrdnUpdtMapper; import cokr.xit.fims.excl.LevyExcl; import cokr.xit.fims.excl.service.bean.Excl01Bean; @@ -65,6 +67,10 @@ public class CrdnBean extends AbstractComponent { @Resource(name = "crdnUpdtMapper") private CrdnUpdtMapper crdnUpdtMapper; + @Resource(name = "crdnTeamMapper") + private CrdnTeamMapper crdnTeamMapper; + + public boolean create(Map nonQueryRequest, Crdn crdn, List fileInfoList) { if(fileInfoList != null && !fileInfoList.isEmpty()) { crdn.setAtchFileCnt(fileInfoList.size()); @@ -78,10 +84,24 @@ public class CrdnBean extends AbstractComponent { crdn.setFfnlgAmt(basicAmt[0]); crdn.setAdvntceAmt(basicAmt[1]); - //TODO : 단속팀 저장 - //if(!ifEmpty(crdn.getTeamId(), () -> "").equals("")) { - //} + //단속팀 정보 갱신 + if(!ifEmpty(crdn.getTeamId(), () -> "").equals("")) { + DataObject teamInfo = crdnTeamMapper.selectTeamInfo(crdn.getTeamId()); + + Team team = new Team(); + team.setTaskSeCd(crdn.getTaskSeCd()); + team.setSggCd(crdn.getSggCd()); + team.setTeamNm(teamInfo.string("TEAM_NM")); + team.setCrdnSeCd(crdn.getCrdnSeCd()); + team.setTeamer1(crdn.getTeamer1()); + team.setTeamer2(crdn.getTeamer2()); + team.setTeamer3(crdn.getTeamer3()); + team.setTeamer4(crdn.getTeamer4()); + + crdnStngBean.saveTeamInfo(true, team); + } + //상태코드 설정 if(ifEmpty(crdn.getCrdnSttsCd(), () -> "").equals("")){ //상태코드가 없을경우 if(ifEmpty(crdn.getCvlcptLinkYn(), () -> "").equals("Y")) { //민원연계자료일 경우 crdn.setCrdnSttsCd("01"); //초기상태 @@ -94,6 +114,7 @@ public class CrdnBean extends AbstractComponent { } } + //단속 대장 등록 boolean result = this.createLedger(crdn); if (!result) { throw new RuntimeException("단속자료 등록 중 단속자료 등록에 실패하였습니다."); diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngBean.java index 21593928..cc9a355d 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngBean.java @@ -111,7 +111,7 @@ public class CrdnStngBean extends AbstractComponent { } } - query.setDtlAmtDcsnCdGroupId("FIM056"); + query.setDtlAmtDcsnGroupId("FIM056"); if(Arrays.asList(CAR_GROUP1).contains(ffnlgCarmdlCd)) { query.setDtlAmtDcsnCd("01"); } @@ -121,7 +121,7 @@ public class CrdnStngBean extends AbstractComponent { int ffnlgCrdnAmt = Integer.parseInt(ifEmpty(globalStngMapper.selectBasicAmt(query), () -> "0")); - if(ffnlgCrdnAmt > 0 && crdn.getOvtimeYn().equals("Y")) { + if(ffnlgCrdnAmt > 0 && ifEmpty(crdn.getOvtimeYn(), ()-> "").equals("Y")) { ffnlgCrdnAmt += 10000; } @@ -169,7 +169,7 @@ public class CrdnStngBean extends AbstractComponent { if(ffnlgCarmdlCd.equals("21")) { query.setAmtDcsnCd("01"); - query.setDtlAmtDcsnCdGroupId("FIM059"); + query.setDtlAmtDcsnGroupId("FIM059"); String vltnNmtm = crdn.getVltnNmtm(); if(vltnNmtm == null || vltnNmtm.equals("") || vltnNmtm.equals("0") || vltnNmtm.equals("1")) { @@ -184,7 +184,7 @@ public class CrdnStngBean extends AbstractComponent { if(ffnlgCarmdlCd.equals("13") || ffnlgCarmdlCd.equals("14")) { query.setAmtDcsnCd("02"); - query.setDtlAmtDcsnCdGroupId("FIM058"); + query.setDtlAmtDcsnGroupId("FIM058"); //query.setDtlAmtDcsnCd(업종); // TODO : 차주 업종 } ; @@ -250,13 +250,13 @@ public class CrdnStngBean extends AbstractComponent { } /**단속팀 정보를 저장한다. - * @param teamId 단속팀 ID + * @param fromInsertCrdn 단속정보 입력 프로세스에서 호출하였는지 여부, teamId 단속팀 ID * @return 저장 여부 *
  • 저장됐으면 true
  • *
  • 그렇지 않으면 false
  • *
*/ - public boolean saveTeamInfo(Team team) { + public boolean saveTeamInfo(boolean fromInsertCrdn, Team team) { DataObject teamInfo = crdnTeamMapper.selectTeamInfoByName(team); boolean result = false; @@ -287,8 +287,10 @@ public class CrdnStngBean extends AbstractComponent { result = crdnTeamMapper.insertTeamInfo(team) == 1 ? true : false; } else { - team.setTeamId(teamInfo.string("TEAM_ID")); - result = crdnTeamMapper.updateTeamInfo(team) == 1 ? true : false; + if(!fromInsertCrdn) { + team.setTeamId(teamInfo.string("TEAM_ID")); + result = crdnTeamMapper.updateTeamInfo(team) == 1 ? true : false; + } } } else { result = crdnTeamMapper.insertTeamInfo(team) == 1 ? true : false; diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngServiceBean.java index eab232d6..73c00cee 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngServiceBean.java @@ -48,7 +48,7 @@ public class CrdnStngServiceBean extends AbstractServiceBean implements CrdnStng @Override public boolean saveTeamInfo(Team team) { - return crdnStngBean.saveTeamInfo(team); + return crdnStngBean.saveTeamInfo(false, team); } @Override diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn-team-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn-team-mapper.xml index c56ba0a5..133790f9 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn-team-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn-team-mapper.xml @@ -105,8 +105,10 @@ UPDATE TB_TEAM_INFO /* 단속팀 정보 조회(crdnTeamMapper.selectTeamInfo) */ SELECT TEAM_ID + , SGG_CD + , TASK_SE_CD , TEAM_NM + , CRDN_SE_CD , TEAMER_1 , TEAMER_2 , TEAMER_3 , TEAMER_4 + , ETC_CN FROM TB_TEAM_INFO WHERE TEAM_ID = #{teamId} diff --git a/src/main/resources/sql/mapper/fims/crdn/global-stng-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/global-stng-mapper.xml index 0c6d1b05..a6c897de 100644 --- a/src/main/resources/sql/mapper/fims/crdn/global-stng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/global-stng-mapper.xml @@ -37,8 +37,8 @@ SELECT AMT AND AMT_DCSN_CD_GROUP_ID = #{amtDcsnCdGroupId} AND AMT_DCSN_CD = #{amtDcsnCd} - - AND DTL_AMT_DCSN_CD_GROUP_ID = #{dtlAmtDcsnCdGroupId} + + AND DTL_AMT_DCSN_GROUP_ID = #{dtlAmtDcsnGroupId} AND DTL_AMT_DCSN_CD = #{dtlAmtDcsnCd}