소스 정리

main
이범준 1 year ago
parent 12fadbea71
commit 8f4915d8d6

@ -5,7 +5,6 @@ import java.util.Map;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.foundation.component.AbstractMapper;
/** DAO
@ -38,21 +37,4 @@ public interface Crdn05Mapper extends AbstractMapper {
*/
int removeCrdn(Map<String, Object> map);
/** .<br />
* {@link cokr.xit.fims.crdn.service.bean.Crdn05Bean#getBasicAmt(CrdnQuery)}
* @param query
* @return
*/
int selectBasicAmt(CrdnQuery query);
/** .<br />
* @param institute
* @return
*/
String selectSggCd(String institute);
default String selectSggCdForCurrentUser() {
return selectSggCd(currentUser().getInstitute());
};
}

@ -0,0 +1,28 @@
package cokr.xit.fims.crdn.dao;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.foundation.component.AbstractMapper;
@Mapper("globalStngMapper")
public interface GlobalStngMapper extends AbstractMapper {
/** .<br />
* {@link cokr.xit.fims.crdn.service.bean.CrdnStngBean#getBasicAmt(CrdnQuery)}
* @param query
* @return
*/
int selectBasicAmt(CrdnQuery query);
/** .<br />
* @param institute
* @return
*/
String selectSggCd(String institute);
default String selectSggCdForCurrentUser() {
return selectSggCd(currentUser().getInstitute());
};
}

@ -2,12 +2,11 @@ package cokr.xit.fims.crdn.service.bean;
import javax.annotation.Resource;
import org.assertj.core.util.Arrays;
import org.springframework.stereotype.Component;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn05Mapper;
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.foundation.AbstractComponent;
/** Bean
@ -15,17 +14,13 @@ import cokr.xit.foundation.AbstractComponent;
*/
@Component("crdn05Bean")
public class Crdn05Bean extends AbstractComponent {
public static String[] SAFE_TAG_AREA = {"03","06","07"}; //안전표지구역
public static String[] CAR_GROUP1 = {"12","14","15","21"}; //승합자동차등
public static String[] CAR_GROUP2 = {"11","13"}; //승용자동차등
public static String[] CAR_GROUP3 = {"31"}; //이륜자동차등
@Resource(name = "crdn05Mapper")
private Crdn05Mapper crdn05Mapper;
@Resource(name = "globalStngMapper")
private GlobalStngMapper globalStngMapper;
/** .
* @param crdn
* @return
@ -49,125 +44,5 @@ public class Crdn05Bean extends AbstractComponent {
}
public int[] getBasicAmt(Crdn crdn) {
int[] amt = {0, 0};
String taskSeCd = crdn.getTaskSeCd();
CrdnQuery query = new CrdnQuery();
query.setTaskSeCd(crdn.getTaskSeCd());
query.setAplcnYmd(crdn.getCrdnYmd());
String ffnlgCarmdlCd = crdn.getFfnlgCarmdlCd();
if(taskSeCd.equals("PVS") || taskSeCd.equals("BPV") || taskSeCd.equals("TPV")) {
if(ifEmpty(ffnlgCarmdlCd, () -> "").equals("")) {
return amt;
}
}
if(taskSeCd.equals("PVS")) {
query.setAmtDcsnCdGroupId("FIM055");
String crdnSpareaCd = crdn.getCrdnSpareaCd();
if(Arrays.asList(SAFE_TAG_AREA).contains(crdnSpareaCd)) {
query.setAmtDcsnCd("02");
} else {
String crdnTm = crdn.getCrdnTm();
boolean workTimeYn = Integer.parseInt(crdnTm) >= 80000 && Integer.parseInt(crdnTm) <= 200000;
if(crdnSpareaCd.equals("01") && workTimeYn) {
query.setAmtDcsnCd("03");
} else if((crdnSpareaCd.equals("02") || crdnSpareaCd.equals("05")) && workTimeYn) {
query.setAmtDcsnCd("04");
} else {
query.setAmtDcsnCd("01");
}
}
query.setDtlAmtDcsnCdGroupId("FIM056");
if(Arrays.asList(CAR_GROUP1).contains(ffnlgCarmdlCd)) {
query.setDtlAmtDcsnCd("01");
}
if(Arrays.asList(CAR_GROUP2).contains(ffnlgCarmdlCd)) {
query.setDtlAmtDcsnCd("02");
}
int ffnlgAmt = crdn05Mapper.selectBasicAmt(query);
if(crdn.getOvtimeYn().equals("Y")) {
ffnlgAmt += 10000;
}
amt[0] = ffnlgAmt;
amt[1] = (int)(ffnlgAmt * 0.8);
} else if(taskSeCd.equals("BPV")) {
query.setAmtDcsnCdGroupId("FIM056");
if(Arrays.asList(CAR_GROUP1).contains(ffnlgCarmdlCd)) {
query.setAmtDcsnCd("01");
}
if(Arrays.asList(CAR_GROUP2).contains(ffnlgCarmdlCd)) {
query.setAmtDcsnCd("02");
}
if(Arrays.asList(CAR_GROUP3).contains(ffnlgCarmdlCd)) {
query.setAmtDcsnCd("03");
}
int ffnlgAmt = crdn05Mapper.selectBasicAmt(query);
amt[0] = ffnlgAmt;
amt[1] = ffnlgAmt;
} else if(taskSeCd.equals("DPV")) {
query.setAmtDcsnCdGroupId("FIM006");
query.setAmtDcsnCd(crdn.getVltnCd());
int ffnlgAmt = crdn05Mapper.selectBasicAmt(query);
amt[0] = ffnlgAmt;
amt[1] = (int)(ffnlgAmt * 0.8);
} else if(taskSeCd.equals("ECA")) {
int ffnlgAmt = crdn05Mapper.selectBasicAmt(query);
amt[0] = ffnlgAmt;
amt[1] = (int)(ffnlgAmt * 0.8);
} else if(taskSeCd.equals("TPV")) {
query.setAmtDcsnCdGroupId("FIM057");
if(ffnlgCarmdlCd.equals("21")) {
query.setAmtDcsnCd("01");
query.setDtlAmtDcsnCdGroupId("FIM059");
String vltnNmtm = crdn.getVltnNmtm();
if(vltnNmtm == null || vltnNmtm.equals("") || vltnNmtm.equals("0") || vltnNmtm.equals("1")) {
query.setDtlAmtDcsnCd("01");
} else if(vltnNmtm.equals("2")) {
query.setDtlAmtDcsnCd("02");
} else {
query.setDtlAmtDcsnCd("03");
}
}
if(ffnlgCarmdlCd.equals("13") || ffnlgCarmdlCd.equals("14")) {
query.setAmtDcsnCd("02");
query.setDtlAmtDcsnCdGroupId("FIM058");
//query.setDtlAmtDcsnCd(업종); // TODO : 차주 업종
}
int ffnlgAmt = crdn05Mapper.selectBasicAmt(query);
amt[0] = ffnlgAmt;
boolean isPenaltyAmt = (crdn.getFfnlgCarmdlCd().equals("13") || crdn.getFfnlgCarmdlCd().equals("14")); //과징금
if(isPenaltyAmt) {
amt[1] = (ffnlgAmt);
} else {
amt[1] = (int)(ffnlgAmt * 0.8);
}
}
return amt;
}
}

@ -20,6 +20,7 @@ import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn05Mapper;
import cokr.xit.fims.crdn.dao.Crdn06Mapper;
import cokr.xit.fims.crdn.dao.CrdnListMapper;
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper;
import cokr.xit.fims.cvlc.service.bean.CrdnCvlcptBean;
@ -43,9 +44,15 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
@Resource(name="crdn06Mapper")
protected Crdn06Mapper crdn06Mapper;
@Resource(name="globalStngMapper")
protected GlobalStngMapper globalStngMapper;
@Resource(name="fileBean")
private FileBean fileBean;
@Resource(name="crdnStngBean")
protected CrdnStngBean crdnStngBean;
@Resource(name="crdnCvlcptBean")
protected CrdnCvlcptBean crdnCvlcptBean;
@ -147,7 +154,7 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
}
//금액 계산
int[] basicAmt = crdn05Bean.getBasicAmt(crdn);
int[] basicAmt = crdnStngBean.getBasicAmt(crdn);
crdn.setFfnlgAmt(basicAmt[0]);
crdn.setLevyAmt(basicAmt[0]);
crdn.setAdvntceLevyAmt(basicAmt[1]);
@ -168,7 +175,7 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
}
}
String currentSggCd = crdn05Mapper.selectSggCdForCurrentUser();
String currentSggCd = globalStngMapper.selectSggCdForCurrentUser();
crdn.setSggCd(currentSggCd);
boolean result = crdn05Bean.insertCrdn(crdn);

@ -4,10 +4,13 @@ import java.util.List;
import javax.annotation.Resource;
import org.assertj.core.util.Arrays;
import org.springframework.stereotype.Component;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.CrdnTeamMapper;
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.foundation.AbstractComponent;
import cokr.xit.foundation.data.DataObject;
@ -17,9 +20,144 @@ import cokr.xit.foundation.data.DataObject;
@Component("crdnStngBean")
public class CrdnStngBean extends AbstractComponent {
public static String[] SAFE_TAG_AREA = {"03","06","07"}; //안전표지구역
public static String[] CAR_GROUP1 = {"12","14","15","21"}; //승합자동차등
public static String[] CAR_GROUP2 = {"11","13"}; //승용자동차등
public static String[] CAR_GROUP3 = {"31"}; //이륜자동차등
@Resource(name = "globalStngMapper")
private GlobalStngMapper globalStngMapper;
@Resource(name = "crdnTeamMapper")
private CrdnTeamMapper crdnTeamMapper;
/** .
* @param crdn
* @return ,
*/
public int[] getBasicAmt(Crdn crdn) {
int[] amt = {0, 0};
String taskSeCd = crdn.getTaskSeCd();
CrdnQuery query = new CrdnQuery();
query.setTaskSeCd(crdn.getTaskSeCd());
query.setAplcnYmd(crdn.getCrdnYmd());
String ffnlgCarmdlCd = crdn.getFfnlgCarmdlCd();
if(taskSeCd.equals("PVS") || taskSeCd.equals("BPV") || taskSeCd.equals("TPV")) {
if(ifEmpty(ffnlgCarmdlCd, () -> "").equals("")) {
return amt;
}
}
if(taskSeCd.equals("PVS")) {
query.setAmtDcsnCdGroupId("FIM055");
String crdnSpareaCd = crdn.getCrdnSpareaCd();
if(Arrays.asList(SAFE_TAG_AREA).contains(crdnSpareaCd)) {
query.setAmtDcsnCd("02");
} else {
String crdnTm = crdn.getCrdnTm();
boolean workTimeYn = Integer.parseInt(crdnTm) >= 80000 && Integer.parseInt(crdnTm) <= 200000;
if(crdnSpareaCd.equals("01") && workTimeYn) {
query.setAmtDcsnCd("03");
} else if((crdnSpareaCd.equals("02") || crdnSpareaCd.equals("05")) && workTimeYn) {
query.setAmtDcsnCd("04");
} else {
query.setAmtDcsnCd("01");
}
}
query.setDtlAmtDcsnCdGroupId("FIM056");
if(Arrays.asList(CAR_GROUP1).contains(ffnlgCarmdlCd)) {
query.setDtlAmtDcsnCd("01");
}
if(Arrays.asList(CAR_GROUP2).contains(ffnlgCarmdlCd)) {
query.setDtlAmtDcsnCd("02");
}
int ffnlgAmt = globalStngMapper.selectBasicAmt(query);
if(crdn.getOvtimeYn().equals("Y")) {
ffnlgAmt += 10000;
}
amt[0] = ffnlgAmt;
amt[1] = (int)(ffnlgAmt * 0.8);
} else if(taskSeCd.equals("BPV")) {
query.setAmtDcsnCdGroupId("FIM056");
if(Arrays.asList(CAR_GROUP1).contains(ffnlgCarmdlCd)) {
query.setAmtDcsnCd("01");
}
if(Arrays.asList(CAR_GROUP2).contains(ffnlgCarmdlCd)) {
query.setAmtDcsnCd("02");
}
if(Arrays.asList(CAR_GROUP3).contains(ffnlgCarmdlCd)) {
query.setAmtDcsnCd("03");
}
int ffnlgAmt = globalStngMapper.selectBasicAmt(query);
amt[0] = ffnlgAmt;
amt[1] = ffnlgAmt;
} else if(taskSeCd.equals("DPV")) {
query.setAmtDcsnCdGroupId("FIM006");
query.setAmtDcsnCd(crdn.getVltnCd());
int ffnlgAmt = globalStngMapper.selectBasicAmt(query);
amt[0] = ffnlgAmt;
amt[1] = (int)(ffnlgAmt * 0.8);
} else if(taskSeCd.equals("ECA")) {
int ffnlgAmt = globalStngMapper.selectBasicAmt(query);
amt[0] = ffnlgAmt;
amt[1] = (int)(ffnlgAmt * 0.8);
} else if(taskSeCd.equals("TPV")) {
query.setAmtDcsnCdGroupId("FIM057");
if(ffnlgCarmdlCd.equals("21")) {
query.setAmtDcsnCd("01");
query.setDtlAmtDcsnCdGroupId("FIM059");
String vltnNmtm = crdn.getVltnNmtm();
if(vltnNmtm == null || vltnNmtm.equals("") || vltnNmtm.equals("0") || vltnNmtm.equals("1")) {
query.setDtlAmtDcsnCd("01");
} else if(vltnNmtm.equals("2")) {
query.setDtlAmtDcsnCd("02");
} else {
query.setDtlAmtDcsnCd("03");
}
}
if(ffnlgCarmdlCd.equals("13") || ffnlgCarmdlCd.equals("14")) {
query.setAmtDcsnCd("02");
query.setDtlAmtDcsnCdGroupId("FIM058");
//query.setDtlAmtDcsnCd(업종); // TODO : 차주 업종
}
int ffnlgAmt = globalStngMapper.selectBasicAmt(query);
amt[0] = ffnlgAmt;
boolean isPenaltyAmt = (crdn.getFfnlgCarmdlCd().equals("13") || crdn.getFfnlgCarmdlCd().equals("14")); //과징금
if(isPenaltyAmt) {
amt[1] = (ffnlgAmt);
} else {
amt[1] = (int)(ffnlgAmt * 0.8);
}
}
return amt;
}
/** .
* @param query
* @return

@ -20,6 +20,7 @@ import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn05Mapper;
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.fims.crdn.service.CrdnStngService;
import cokr.xit.foundation.data.DataObject;
@ -39,6 +40,9 @@ public class Crdn05Controller extends ApplicationController {
@Resource(name="crdn05Mapper")
private Crdn05Mapper crdn05Mapper;
@Resource(name="globalStngMapper")
protected GlobalStngMapper globalStngMapper;
/** .
* @return fims/crdn/crdn05010-main
*/
@ -106,7 +110,7 @@ public class Crdn05Controller extends ApplicationController {
mav.addObject("VLTNList", commonCodes.get(vltnByTask));
CrdnQuery query = new CrdnQuery();
query.setSggCd(crdn05Mapper.selectSggCdForCurrentUser());
query.setSggCd(globalStngMapper.selectSggCdForCurrentUser());
query.setTaskSeCd(urlTaskSeCd);
List<DataObject> teamList = crdnStngService.getTeamList(query);

@ -12,6 +12,7 @@ import org.springframework.stereotype.Component;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn05Mapper;
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.fims.cvlc.CrdnCvlcpt;
import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper;
import cokr.xit.foundation.AbstractComponent;
@ -30,6 +31,9 @@ public class CrdnCvlcptBean extends AbstractComponent {
@Resource(name = "crdn05Mapper")
private Crdn05Mapper crdn05Mapper;
@Resource(name="globalStngMapper")
protected GlobalStngMapper globalStngMapper;
/** .
* @param crdnIDs
* @return
@ -113,7 +117,7 @@ public class CrdnCvlcptBean extends AbstractComponent {
DataObject selectCvlcptAnsWordsInfo(String taskSeCd, String ansRsnCd) {
DataObject params = new DataObject();
params.set("sggCd", crdn05Mapper.selectSggCdForCurrentUser());
params.set("sggCd", globalStngMapper.selectSggCdForCurrentUser());
params.set("taskSeCd", taskSeCd);
params.set("ansRsnCd", ansRsnCd);

@ -29,7 +29,9 @@ import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn05Mapper;
import cokr.xit.fims.crdn.dao.Crdn06Mapper;
import cokr.xit.fims.crdn.dao.CrdnInfoMapper;
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.fims.crdn.service.bean.Crdn05Bean;
import cokr.xit.fims.crdn.service.bean.CrdnStngBean;
import cokr.xit.fims.cvlc.CrdnCvlcpt;
import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper;
import cokr.xit.fims.cvlc.service.CrdnCvlcptService;
@ -53,6 +55,9 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
@Resource(name="crdnCvlcptBean")
protected CrdnCvlcptBean crdnCvlcptBean;
@Resource(name="crdnStngBean")
private CrdnStngBean crdnStngBean;
@Resource(name="crdn05Bean")
private Crdn05Bean crdn05Bean;
@ -77,6 +82,9 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
@Resource(name="crdn06Mapper")
protected Crdn06Mapper crdn06Mapper;
@Resource(name="globalStngMapper")
protected GlobalStngMapper globalStngMapper;
@Override
public List<DataObject> getCivilComplaintList(CrdnQuery query) {
List<DataObject> dataObjectList = new ArrayList<DataObject>();
@ -263,7 +271,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
@Override
public boolean updateCvlcptPrcsSe(Map<String, Object> nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn, List<FileInfo> newFileInfoList) {
boolean saved = false;
crdn.setSggCd(crdn05Mapper.selectSggCdForCurrentUser());
crdn.setSggCd(globalStngMapper.selectSggCdForCurrentUser());
DataObject crdnInfo = crdnInfoMapper.getCrdnInfo(crdn.getCrdnId());
@ -356,7 +364,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
nonQueryRequest.put("changeFileCnt", changeFileCnt);
//금액 변경
int[] basicAmt = crdn05Bean.getBasicAmt(crdn);
int[] basicAmt = crdnStngBean.getBasicAmt(crdn);
int ffnlgAmt = crdnInfo.number("FFNLG_AMT").intValue();
if(ffnlgAmt != basicAmt[0]){
nonQueryRequest.put("changeAmountYn","Y");

@ -175,29 +175,4 @@ INSERT INTO TB_CRDN_ADI (
)
</update>
<select id="selectBasicAmt" parameterType="cokr.xit.fims.crdn.CrdnQuery" resultType="int">
/* 기본금액 조회(crdn05Mapper.selectBasicAmt) */
SELECT AMT
FROM TB_AMT_INFO
WHERE USE_YN = 'Y'
AND TASK_SE_CD = #{taskSeCd}
AND BGNG_YMD <![CDATA[ <= ]]> #{aplcnYmd}
AND END_YMD <![CDATA[ >= ]]> #{aplcnYmd}
<if test="amtDcsnCdGroupId != null">
AND AMT_DCSN_CD_GROUP_ID = #{amtDcsnCdGroupId}
AND AMT_DCSN_CD = #{amtDcsnCd}
</if>
<if test="dtlAmtDcsnCdGroupId != null">
AND DTL_AMT_DCSN_CD_GROUP_ID = #{dtlAmtDcsnCdGroupId}
AND DTL_AMT_DCSN_CD = #{dtlAmtDcsnCd}
</if>
</select>
<select id="selectSggCd" parameterType="string" resultType="string">
/* 시군구코드 조회(crdn05Mapper.selectSggCd) */
SELECT SGG_CD
FROM TB_SGG_INFO
WHERE INST_CD = #{institute}
</select>
</mapper>

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.fims.crdn.dao.GlobalStngMapper">
<select id="selectBasicAmt" parameterType="cokr.xit.fims.crdn.CrdnQuery" resultType="int">
/* 기본금액 조회(crdn05Mapper.selectBasicAmt) */
SELECT AMT
FROM TB_AMT_INFO
WHERE USE_YN = 'Y'
AND TASK_SE_CD = #{taskSeCd}
AND BGNG_YMD <![CDATA[ <= ]]> #{aplcnYmd}
AND END_YMD <![CDATA[ >= ]]> #{aplcnYmd}
<if test="amtDcsnCdGroupId != null">
AND AMT_DCSN_CD_GROUP_ID = #{amtDcsnCdGroupId}
AND AMT_DCSN_CD = #{amtDcsnCd}
</if>
<if test="dtlAmtDcsnCdGroupId != null">
AND DTL_AMT_DCSN_CD_GROUP_ID = #{dtlAmtDcsnCdGroupId}
AND DTL_AMT_DCSN_CD = #{dtlAmtDcsnCd}
</if>
</select>
<select id="selectSggCd" parameterType="string" resultType="string">
/* 시군구코드 조회(crdn05Mapper.selectSggCd) */
SELECT SGG_CD
FROM TB_SGG_INFO
WHERE INST_CD = #{institute}
</select>
</mapper>
Loading…
Cancel
Save