기본금액 조회 수정

main
이범준 1 year ago
parent bf35489b79
commit 1545cb1a6a

@ -2,9 +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.foundation.AbstractComponent;
@ -13,6 +15,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;
@ -27,4 +36,126 @@ public class Crdn05Bean extends AbstractComponent {
public boolean insertCrdn(Crdn crdn) {
return crdn05Mapper.insertCrdn(crdn) == 1 ? true : false;
}
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;
}
}

@ -18,7 +18,6 @@ import cokr.xit.fims.crdn.dao.Crdn05Mapper;
import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.fims.excl.Excl01;
import cokr.xit.fims.excl.service.bean.Excl01Bean;
import cokr.xit.fims.task.service.TaskService;
import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject;
@ -45,21 +44,6 @@ public class Crdn05ServiceBean extends AbstractServiceBean implements CrdnServic
@Resource(name="crdnSttsHstryBean")
private CrdnSttsHstryBean crdnSttsHstryBean;
@Resource(name = "pvsService")
private TaskService pvsService;
@Resource(name = "bpvService")
private TaskService bpvService;
@Resource(name = "dpvService")
private TaskService dpvService;
@Resource(name = "ecaService")
private TaskService ecaService;
@Resource(name = "tpvService")
private TaskService tpvService;
@Override
public List<DataObject> getCrackdownList(CrdnQuery req) {
req.setCurrentUserId(currentUser().getId());
@ -79,31 +63,9 @@ public class Crdn05ServiceBean extends AbstractServiceBean implements CrdnServic
if(ifEmpty(crdn.getAtchFileCnt(), () -> 0) == 0) {
crdn.setAtchFileCnt(0);
}
int[] basicAmt;
switch (crdn.getTaskSeCd()) {
case "PVS": {
basicAmt = pvsService.getBasicAmt(crdn);
break;
}
case "BPV": {
basicAmt = bpvService.getBasicAmt(crdn);
break;
}
case "DPV": {
basicAmt = dpvService.getBasicAmt(crdn);
break;
}
case "ECA": {
basicAmt = ecaService.getBasicAmt(crdn);
break;
}
case "TPV": {
basicAmt = tpvService.getBasicAmt(crdn);
break;
}
default:
throw new IllegalArgumentException("Unexpected value: " + crdn.getTaskSeCd());
}
int[] basicAmt = crdn05Bean.getBasicAmt(crdn);
crdn.setFfnlgAmt(basicAmt[0]);
crdn.setLevyAmt(basicAmt[0]);
crdn.setAdvntceLevyAmt(basicAmt[1]);

@ -1,12 +0,0 @@
package cokr.xit.fims.task.service;
import cokr.xit.fims.crdn.Crdn;
public interface TaskService {
/** .
* @param crdn
* @return / ,
*/
public int[] getBasicAmt(Crdn crdn);
}

@ -1,62 +0,0 @@
package cokr.xit.fims.task.service.bean;
import javax.annotation.Resource;
import org.assertj.core.util.Arrays;
import org.springframework.stereotype.Service;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn05Mapper;
import cokr.xit.fims.task.service.TaskService;
import cokr.xit.foundation.component.AbstractServiceBean;
/**
* @author leebj
*/
@Service("bpvService")
public class BpvServiceBean extends AbstractServiceBean implements TaskService {
public String[] CAR_GROUP1 = {"12","14","15","21"}; //승합자동차등
public String[] CAR_GROUP2 = {"11","13"}; //승용자동차등
public String[] CAR_GROUP3 = {"31"}; //이륜자동차등
@Resource(name = "crdn05Mapper")
private Crdn05Mapper crdn05Mapper;
@Override
public int[] getBasicAmt(Crdn crdn) {
int[] amt = {0, 0};
CrdnQuery query = new CrdnQuery();
query.setTaskSeCd(crdn.getTaskSeCd());
query.setAplcnYmd(crdn.getCrdnYmd());
String ffnlgCarmdlCd = crdn.getFfnlgCarmdlCd();
if(ifEmpty(ffnlgCarmdlCd, () -> "").equals("")) {
return amt;
}
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;
return amt;
}
}

@ -1,37 +0,0 @@
package cokr.xit.fims.task.service.bean;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn05Mapper;
import cokr.xit.fims.task.service.TaskService;
import cokr.xit.foundation.component.AbstractServiceBean;
/**
* @author leebj
*/
@Service("dpvService")
public class DpvServiceBean extends AbstractServiceBean implements TaskService {
@Resource(name = "crdn05Mapper")
private Crdn05Mapper crdn05Mapper;
@Override
public int[] getBasicAmt(Crdn crdn) {
int[] amt = {0, 0};
CrdnQuery query = new CrdnQuery();
query.setTaskSeCd(crdn.getTaskSeCd());
query.setAplcnYmd(crdn.getCrdnYmd());
query.setAmtDcsnCdGroupId("FIM006");
query.setAmtDcsnCd(crdn.getVltnCd());
int ffnlgAmt = crdn05Mapper.selectBasicAmt(query);
amt[0] = ffnlgAmt;
amt[1] = (int)(ffnlgAmt * 0.8);
return amt;
}
}

@ -1,34 +0,0 @@
package cokr.xit.fims.task.service.bean;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn05Mapper;
import cokr.xit.fims.task.service.TaskService;
import cokr.xit.foundation.component.AbstractServiceBean;
/**
* @author leebj
*/
@Service("ecaService")
public class EcaServiceBean extends AbstractServiceBean implements TaskService {
@Resource(name = "crdn05Mapper")
private Crdn05Mapper crdn05Mapper;
@Override
public int[] getBasicAmt(Crdn crdn) {
int[] amt = {0, 0};
CrdnQuery query = new CrdnQuery();
query.setTaskSeCd(crdn.getTaskSeCd());
query.setAplcnYmd(crdn.getCrdnYmd());
int ffnlgAmt = crdn05Mapper.selectBasicAmt(query);
amt[0] = ffnlgAmt;
amt[1] = (int)(ffnlgAmt * 0.8);
return amt;
}
}

@ -1,78 +0,0 @@
package cokr.xit.fims.task.service.bean;
import javax.annotation.Resource;
import org.assertj.core.util.Arrays;
import org.springframework.stereotype.Service;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn05Mapper;
import cokr.xit.fims.task.service.TaskService;
import cokr.xit.foundation.component.AbstractServiceBean;
/**
* @author leebj
*/
@Service("pvsService")
public class PvsServiceBean extends AbstractServiceBean implements TaskService {
public String[] SAFE_TAG_AREA = {"03","06","07"}; //안전표지구역
public String[] CAR_GROUP1 = {"12","14","15","21"}; //승합자동차등
public String[] CAR_GROUP2 = {"11","13"}; //승용자동차등
@Resource(name = "crdn05Mapper")
private Crdn05Mapper crdn05Mapper;
@Override
public int[] getBasicAmt(Crdn crdn) {
int[] amt = {0, 0};
CrdnQuery query = new CrdnQuery();
query.setTaskSeCd(crdn.getTaskSeCd());
query.setAplcnYmd(crdn.getCrdnYmd());
String ffnlgCarmdlCd = crdn.getFfnlgCarmdlCd();
if(ifEmpty(ffnlgCarmdlCd, () -> "").equals("")) {
return amt;
}
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);
return amt;
}
}

@ -1,72 +0,0 @@
package cokr.xit.fims.task.service.bean;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn05Mapper;
import cokr.xit.fims.task.service.TaskService;
import cokr.xit.foundation.component.AbstractServiceBean;
/**
* @author leebj
*/
@Service("tpvService")
public class TpvServiceBean extends AbstractServiceBean implements TaskService {
@Resource(name = "crdn05Mapper")
private Crdn05Mapper crdn05Mapper;
@Override
public int[] getBasicAmt(Crdn crdn) {
int[] amt = {0, 0};
CrdnQuery query = new CrdnQuery();
query.setTaskSeCd(crdn.getTaskSeCd());
query.setAplcnYmd(crdn.getCrdnYmd());
String ffnlgCarmdlCd = crdn.getFfnlgCarmdlCd();
if(crdn.getTaskSeCd().equals("PVS") || crdn.getTaskSeCd().equals("BPV") || crdn.getTaskSeCd().equals("TPV")) {
if(ifEmpty(ffnlgCarmdlCd, () -> "").equals("")) {
return amt;
}
}
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;
}
}
Loading…
Cancel
Save