소스 정리

main
이범준 1 year ago
parent 3e850f0040
commit 71899e2d88

@ -39,5 +39,13 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic
} }
public DataObject getCivilComplaintOriginalInfo(CrdnQuery req) {
return crdn01Bean.getCivilComplaintOriginalInfo(req);
}
public boolean removeCivilComplaint(String... crdnIDs) {
return crdn01Bean.removeCivilComplaint(crdnIDs);
}
} }

@ -1,24 +1,13 @@
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 javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
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.Crdn;
import cokr.xit.fims.crdn.dao.Crdn05Mapper; import cokr.xit.fims.crdn.dao.Crdn05Mapper;
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.AbstractComponent; import cokr.xit.foundation.AbstractComponent;
import cokr.xit.foundation.UserInfo;
/** Bean /** Bean
* @author leebj * @author leebj
@ -30,34 +19,9 @@ public class Crdn05Bean extends AbstractComponent {
@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 = "crdn05Mapper") @Resource(name = "crdn05Mapper")
private Crdn05Mapper crdn05Mapper; private Crdn05Mapper crdn05Mapper;
@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;
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;
}
/** . /** .
* @param crdn * @param crdn
* @return * @return
@ -65,94 +29,7 @@ public class Crdn05Bean extends AbstractComponent {
* <li> false</li> * <li> false</li>
* </ul> * </ul>
*/ */
public boolean create(Crdn crdn) { public boolean insertCrdn(Crdn crdn) {
return crdn05Mapper.insertCrdn(crdn) == 1 ? true : false;
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 = crdn05Mapper.insertCrdn(crdn) == 1 ? true : false;
SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyyMMddHHmmss");
Date curTime = new Date();
String strCurrentDate = yyyyMMdd.format(curTime);
String strCurrentDatetime = yyyyMMddHHmmss.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;
}
} }

@ -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;
}
} }

@ -8,6 +8,7 @@ import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn06Mapper; import cokr.xit.fims.crdn.dao.Crdn06Mapper;
import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.CrdnService;
@ -91,4 +92,9 @@ public class Crdn06ServiceBean extends AbstractServiceBean implements CrdnServic
return dataObjectList; return dataObjectList;
} }
public boolean update(Crdn crdn) {
return crdn06Bean.update(crdn);
}
} }

@ -12,8 +12,6 @@ import cokr.xit.base.code.CommonCode;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.fims.crdn.service.bean.Crdn01Bean;
import cokr.xit.fims.crdn.service.bean.Crdn01ServiceBean; import cokr.xit.fims.crdn.service.bean.Crdn01ServiceBean;
import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@ -24,11 +22,8 @@ import cokr.xit.foundation.data.DataObject;
*/ */
public class Crdn01Controller extends ApplicationController { public class Crdn01Controller extends ApplicationController {
@Resource(name="crdn01Bean")
private Crdn01Bean crdn01Bean;
@Resource(name="crdn01Service") @Resource(name="crdn01Service")
private CrdnService crdn01Service; private Crdn01ServiceBean crdn01Service;
/** . /** .
* @return fims/crdn/crdn01010-main * @return fims/crdn/crdn01010-main
@ -86,7 +81,7 @@ public class Crdn01Controller extends ApplicationController {
ModelAndView mav = new ModelAndView(json ? "jsonView" : "fims/crdn/crdn01050-info"); ModelAndView mav = new ModelAndView(json ? "jsonView" : "fims/crdn/crdn01050-info");
mav.addObject("pageName", "crdn01050-info"); mav.addObject("pageName", "crdn01050-info");
DataObject info = crdn01Bean.getCivilComplaintOriginalInfo(req); DataObject info = crdn01Service.getCivilComplaintOriginalInfo(req);
mav.addObject("cvlcptInfo", json ? info : toJson(info)); mav.addObject("cvlcptInfo", json ? info : toJson(info));
return mav; return mav;
@ -167,7 +162,7 @@ public class Crdn01Controller extends ApplicationController {
*/ */
@RequestMapping(name="민원자료 제거", value="/010/remove.do") @RequestMapping(name="민원자료 제거", value="/010/remove.do")
public ModelAndView removeCivilComplaint(Crdn crdn) { public ModelAndView removeCivilComplaint(Crdn crdn) {
boolean saved = crdn01Bean.removeCivilComplaint(crdn.getCrdnIDs()); boolean saved = crdn01Service.removeCivilComplaint(crdn.getCrdnIDs());
return new ModelAndView("jsonView") return new ModelAndView("jsonView")
.addObject("saved", saved); .addObject("saved", saved);

@ -5,7 +5,7 @@ import javax.annotation.Resource;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.bean.Crdn02ServiceBean;
/** .<br /> /** .<br />
* { }/crdn/crdn02 . * { }/crdn/crdn02 .
@ -14,7 +14,7 @@ import cokr.xit.fims.crdn.service.CrdnService;
public class Crdn02Controller extends ApplicationController { public class Crdn02Controller extends ApplicationController {
@Resource(name="crdn02Service") @Resource(name="crdn02Service")
private CrdnService crdn02Service; private Crdn02ServiceBean crdn02Service;
/** . /** .
* @return fims/crdn/crdn02010-main * @return fims/crdn/crdn02010-main

@ -17,8 +17,6 @@ import cokr.xit.base.file.web.FileInfoFactory;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.fims.crdn.service.bean.Crdn05Bean;
import cokr.xit.fims.crdn.service.bean.Crdn05ServiceBean; import cokr.xit.fims.crdn.service.bean.Crdn05ServiceBean;
/** .<br /> /** .<br />
@ -27,11 +25,8 @@ import cokr.xit.fims.crdn.service.bean.Crdn05ServiceBean;
*/ */
public class Crdn05Controller extends ApplicationController { public class Crdn05Controller extends ApplicationController {
@Resource(name="crdn05Bean")
private Crdn05Bean crdn05Bean;
@Resource(name="crdn05Service") @Resource(name="crdn05Service")
private CrdnService crdn05Service; private Crdn05ServiceBean crdn05Service;
/** . /** .
* @return fims/crdn/crdn05010-main * @return fims/crdn/crdn05010-main
@ -138,9 +133,9 @@ public class Crdn05Controller extends ApplicationController {
if(uploadFileList != null) { if(uploadFileList != null) {
List<FileInfo> fileInfoList = new FileInfoFactory().makeFileInfos(null, uploadFileList); List<FileInfo> fileInfoList = new FileInfoFactory().makeFileInfos(null, uploadFileList);
saved = crdn05Bean.create(crdn, fileInfoList); saved = crdn05Service.create(crdn, fileInfoList);
} else { } else {
saved = crdn05Bean.create(crdn); saved = crdn05Service.create(crdn);
} }
return new ModelAndView("jsonView") return new ModelAndView("jsonView")

@ -11,7 +11,6 @@ import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.CommonCode;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.fims.crdn.service.bean.Crdn06ServiceBean; import cokr.xit.fims.crdn.service.bean.Crdn06ServiceBean;
/** .<br /> /** .<br />
@ -21,7 +20,7 @@ import cokr.xit.fims.crdn.service.bean.Crdn06ServiceBean;
public class Crdn06Controller extends ApplicationController { public class Crdn06Controller extends ApplicationController {
@Resource(name="crdn06Service") @Resource(name="crdn06Service")
private CrdnService crdn06Service; private Crdn06ServiceBean crdn06Service;
/** . /** .
* @return fims/crdn/crdn06010-main * @return fims/crdn/crdn06010-main

@ -9,8 +9,7 @@ import org.springframework.web.servlet.ModelAndView;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.bean.Crdn06ServiceBean;
import cokr.xit.fims.crdn.service.bean.Crdn06Bean;
@Controller @Controller
public class DpvController { public class DpvController {
@ -31,10 +30,7 @@ public class DpvController {
@RequestMapping(name="장애인과태료업무 단속업무", value="/DPV/crdn/crdn06") @RequestMapping(name="장애인과태료업무 단속업무", value="/DPV/crdn/crdn06")
class Crdn06Controller extends cokr.xit.fims.crdn.web.Crdn06Controller { class Crdn06Controller extends cokr.xit.fims.crdn.web.Crdn06Controller {
@Resource(name="crdn06Service") @Resource(name="crdn06Service")
private CrdnService crdn06Service; private Crdn06ServiceBean crdn06Service;
@Resource(name="crdn06Bean")
private Crdn06Bean crdn06Bean;
/** .<br /> /** .<br />
* {@link Crdn06Service#getCrackdownList(CrdnQuery)} * {@link Crdn06Service#getCrackdownList(CrdnQuery)}
@ -65,10 +61,10 @@ public class DpvController {
* "saved": true, false * "saved": true, false
* }</code></pre> * }</code></pre>
*/ */
@PostMapping(name = "단속 대장 수정", value = "/030/update.do") @PostMapping(name = "표지정보 미확인 자료 수정", value = "/030/update.do")
public ModelAndView update(Crdn crdn) { public ModelAndView update(Crdn crdn) {
crdn.setUpdateInfomation("tagInformationUndefinedData"); crdn.setUpdateInfomation("tagInformationUndefinedData");
boolean saved = crdn06Bean.update(crdn); boolean saved = crdn06Service.update(crdn);
return new ModelAndView("jsonView") return new ModelAndView("jsonView")
.addObject("saved", saved); .addObject("saved", saved);
} }

Loading…
Cancel
Save