|
|
@ -1,15 +1,25 @@
|
|
|
|
package cokr.xit.fims.crdn.service.bean;
|
|
|
|
package cokr.xit.fims.crdn.service.bean;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cokr.xit.base.file.FileInfo;
|
|
|
|
import cokr.xit.base.file.service.bean.FileBean;
|
|
|
|
import cokr.xit.base.file.service.bean.FileBean;
|
|
|
|
|
|
|
|
import cokr.xit.fims.cmmn.CrdnSttsHstry;
|
|
|
|
|
|
|
|
import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean;
|
|
|
|
|
|
|
|
import cokr.xit.fims.crdn.Crdn;
|
|
|
|
import cokr.xit.fims.crdn.CrdnQuery;
|
|
|
|
import cokr.xit.fims.crdn.CrdnQuery;
|
|
|
|
import cokr.xit.fims.crdn.dao.Crdn05Mapper;
|
|
|
|
import cokr.xit.fims.crdn.dao.Crdn05Mapper;
|
|
|
|
import cokr.xit.fims.crdn.service.CrdnService;
|
|
|
|
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.component.AbstractServiceBean;
|
|
|
|
import cokr.xit.foundation.data.DataObject;
|
|
|
|
import cokr.xit.foundation.data.DataObject;
|
|
|
|
|
|
|
|
|
|
|
@ -29,6 +39,27 @@ public class Crdn05ServiceBean extends AbstractServiceBean implements CrdnServic
|
|
|
|
@Resource(name="fileBean")
|
|
|
|
@Resource(name="fileBean")
|
|
|
|
private FileBean fileBean;
|
|
|
|
private FileBean fileBean;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource(name="excl01Bean")
|
|
|
|
|
|
|
|
private Excl01Bean excl01Bean;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@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
|
|
|
|
@Override
|
|
|
|
public List<DataObject> getCrackdownList(CrdnQuery req) {
|
|
|
|
public List<DataObject> getCrackdownList(CrdnQuery req) {
|
|
|
|
req.setCurrentUserId(currentUser().getId());
|
|
|
|
req.setCurrentUserId(currentUser().getId());
|
|
|
@ -36,5 +67,99 @@ public class Crdn05ServiceBean extends AbstractServiceBean implements CrdnServic
|
|
|
|
return crdn05Mapper.selectCrackdownList(req);
|
|
|
|
return crdn05Mapper.selectCrackdownList(req);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean create(Crdn crdn, List<FileInfo> fileInfoList) {
|
|
|
|
|
|
|
|
crdn.setAtchFileCnt(fileInfoList.size());
|
|
|
|
|
|
|
|
boolean saved = this.create(crdn);
|
|
|
|
|
|
|
|
fileInfoList.forEach(fileInfo -> fileInfo.setInfoType(Crdn.INF_TYPE).setInfoKey(crdn.getCrdnId()));
|
|
|
|
|
|
|
|
fileBean.create(fileInfoList);
|
|
|
|
|
|
|
|
return saved;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean create(Crdn crdn) {
|
|
|
|
|
|
|
|
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());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
crdn.setFfnlgAmt(basicAmt[0]);
|
|
|
|
|
|
|
|
crdn.setLevyAmt(basicAmt[0]);
|
|
|
|
|
|
|
|
crdn.setAdvntceLevyAmt(basicAmt[1]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(ifEmpty(crdn.getDoGuidance(), () -> "").equals("on")) {
|
|
|
|
|
|
|
|
crdn.setCrdnSttsCd("83");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
crdn.setCrdnSttsCd("01");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
crdn.setInstitute(UserInfo.current().getInstitute());
|
|
|
|
|
|
|
|
boolean result = crdn05Bean.insertCrdn(crdn);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
|
|
|
|
Date curTime = new Date();
|
|
|
|
|
|
|
|
String strCurrentDate = yyyyMMdd.format(curTime);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String taskDtlId = crdn.getCrdnId();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(crdn.getCrdnSttsCd().equals("83")) {
|
|
|
|
|
|
|
|
// 부과제외(TB_LEVY_EXCL) 대장 등록
|
|
|
|
|
|
|
|
Excl01 excl01 = new Excl01();
|
|
|
|
|
|
|
|
excl01.setSggCd(""); // TODO:시군구
|
|
|
|
|
|
|
|
excl01.setTaskSeCd(crdn.getTaskSeCd());
|
|
|
|
|
|
|
|
excl01.setCrdnId(crdn.getCrdnId());
|
|
|
|
|
|
|
|
excl01.setLevyExclYmd(strCurrentDate);
|
|
|
|
|
|
|
|
excl01.setLevyExclSeCd("2");
|
|
|
|
|
|
|
|
excl01.setLevyExclRsnCd("192");
|
|
|
|
|
|
|
|
excl01.setEtcCn("");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result = excl01Bean.createLevyExclusion(excl01);
|
|
|
|
|
|
|
|
if (!result) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
taskDtlId = excl01.getLevyExclId();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 단속상태이력(TB_CRDN_STTS_HSTRY) 대장 등록
|
|
|
|
|
|
|
|
CrdnSttsHstry crdnSttsHstry = new CrdnSttsHstry();
|
|
|
|
|
|
|
|
crdnSttsHstry.setCrdnId(crdn.getCrdnId());
|
|
|
|
|
|
|
|
crdnSttsHstry.setBfrSttsCd("");
|
|
|
|
|
|
|
|
crdnSttsHstry.setBfrSttsChgDt("");
|
|
|
|
|
|
|
|
crdnSttsHstry.setCrdnSttsCd(crdn.getCrdnSttsCd());
|
|
|
|
|
|
|
|
crdnSttsHstry.setTaskDtlId(taskDtlId);
|
|
|
|
|
|
|
|
crdnSttsHstry.setEtcCn("");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result = crdnSttsHstryBean.create(crdnSttsHstry);
|
|
|
|
|
|
|
|
if (!result) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|