통합조회 메뉴에서 사전통지서, 고지서 출력시 발송테이블 및 발송상세테이블에 등록하는 프로세스 추가

main
이범준 8 months ago
parent 544023fb59
commit 36618ca51a

@ -519,6 +519,10 @@ public class CmmnUtil {
return "*"+rgSe1+sggCd+sndngDtlId+"*"; return "*"+rgSe1+sggCd+sndngDtlId+"*";
} }
public static Long sumByKey(List<DataObject> dataObjectList, String key) {
return dataObjectList.stream().mapToLong(i -> i.number(key).longValue()).sum();
}
public static void setBarcode(DataObject dataObject) { public static void setBarcode(DataObject dataObject) {
String recevDivCd = dataObject.string("RECEV_DIV_CD"); String recevDivCd = dataObject.string("RECEV_DIV_CD");
String sggCd = dataObject.string("SGG_CD"); String sggCd = dataObject.string("SGG_CD");

@ -1,6 +1,8 @@
package cokr.xit.fims.sprt.web; package cokr.xit.fims.sprt.web;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -46,6 +48,9 @@ import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.CrdnListMapper; import cokr.xit.fims.crdn.dao.CrdnListMapper;
import cokr.xit.fims.mngt.service.bean.FactionBean; import cokr.xit.fims.mngt.service.bean.FactionBean;
import cokr.xit.fims.mngt.service.bean.TaskBean; import cokr.xit.fims.mngt.service.bean.TaskBean;
import cokr.xit.fims.sndb.SndbQuery;
import cokr.xit.fims.sndb.Sndng;
import cokr.xit.fims.sndb.service.bean.SndngBean;
import cokr.xit.fims.sprt.Keyword; import cokr.xit.fims.sprt.Keyword;
import cokr.xit.fims.sprt.SprtQuery; import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.fims.sprt.dao.IntegrationSearchMapper; import cokr.xit.fims.sprt.dao.IntegrationSearchMapper;
@ -112,6 +117,9 @@ public class Sprt01Controller extends ApplicationController {
@Resource(name = "fileBean") @Resource(name = "fileBean")
private FileBean fileBean; private FileBean fileBean;
@Resource(name = "sndngBean")
private SndngBean sndngBean;
@Resource(name = "taskBean") @Resource(name = "taskBean")
private TaskBean taskBean; private TaskBean taskBean;
@ -673,16 +681,44 @@ public class Sprt01Controller extends ApplicationController {
/** PDF . /** PDF .
* @return PDF * @return PDF
*/ */
public ModelAndView makeAdvntcePdf(PrintOption printOption, String[] crdnIds) { public ModelAndView makeAdvntcePdf(String[] crdnIds, Sndng sndng, PrintOption printOption) {
ModelAndView mav = new ModelAndView("downloadView"); ModelAndView mav = new ModelAndView("downloadView");
SprtQuery sprtQuery = new SprtQuery();
sprtQuery.setCrdnIds(crdnIds);
List<DataObject> dataObjectList = new ArrayList<DataObject>(); List<DataObject> dataObjectList = new ArrayList<DataObject>();
if(crdnIds.length == 1 && crdnIds[0].equals("sample")) { if(crdnIds.length == 1 && crdnIds[0].equals("sample")) {
DataObject sample = new Advntce().createSampleData(); DataObject sample = new Advntce().createSampleData();
dataObjectList.add(sample); dataObjectList.add(sample);
} else { } else {
SprtQuery sprtQuery = new SprtQuery(); //발송 등록
sprtQuery.setCrdnIds(crdnIds); List<DataObject> dataObjectList0 = integrationSearchMapper.selectIntegrationDataList(sprtQuery);
SndbQuery sndbQuery = new SndbQuery();
sndbQuery.setCrdnIDs(crdnIds);
sndng.setSndngSeCd("02");
sndng.setTnocs(crdnIds.length);
sndng.setGramt(CmmnUtil.sumByKey(dataObjectList0, "FFNLG_AMT"));
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
String today = sdf.format(new Date());
sndng.setSndngYmd(today);
sndbQuery.setSggCd(sndng.getSggCd());
sndbQuery.setTaskSeCd(sndng.getTaskSeCd());
DataObject advntceYmdInfo = taskBean.getAdvntceYmdInfo(sndbQuery);
String sndngEndYmd = CmmnUtil.addDay(today, advntceYmdInfo.number("ADVNTCE_DAY_CNT").intValue());
sndng.setSndngEndYmd(sndngEndYmd);
DataObject first = dataObjectList0.get(0);
sndng.setTtlNm(first.string("TASK_SE_NM")+" "+first.string("VLTN_ARTCL")+" "+"사전통지서");
sndng.setResndYN("N");
String insertSndngResult = sndngBean.createAdvntceSndngList(sndbQuery, sndng);
if(insertSndngResult.contains("[F]")) {
throw new RuntimeException(insertSndngResult);
}
//발송 등록 후 출력대상조회
dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery); dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery);
for(int i=0; i < dataObjectList.size(); i++) { for(int i=0; i < dataObjectList.size(); i++) {
@ -768,15 +804,41 @@ public class Sprt01Controller extends ApplicationController {
/** txt, . /** txt, .
* @return * @return
*/ */
public ModelAndView makeAdvntceOutsourcing(PrintOption printOption, String[] crdnIds) { public ModelAndView makeAdvntceOutsourcing(String[] crdnIds, Sndng sndng, PrintOption printOption) {
ModelAndView mav = new ModelAndView("downloadView"); ModelAndView mav = new ModelAndView("downloadView");
String taskSeCd = "";
SprtQuery sprtQuery = new SprtQuery(); SprtQuery sprtQuery = new SprtQuery();
sprtQuery.setCrdnIds(crdnIds); sprtQuery.setCrdnIds(crdnIds);
List<DataObject> dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery);
//발송 등록
List<DataObject> dataObjectList0 = integrationSearchMapper.selectIntegrationDataList(sprtQuery);
SndbQuery sndbQuery = new SndbQuery();
sndbQuery.setCrdnIDs(crdnIds);
sndng.setSndngSeCd("02");
sndng.setTnocs(crdnIds.length);
sndng.setGramt(CmmnUtil.sumByKey(dataObjectList0, "FFNLG_AMT"));
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
String today = sdf.format(new Date());
sndng.setSndngYmd(today);
sndbQuery.setSggCd(sndng.getSggCd());
sndbQuery.setTaskSeCd(sndng.getTaskSeCd());
DataObject advntceYmdInfo = taskBean.getAdvntceYmdInfo(sndbQuery);
String sndngEndYmd = CmmnUtil.addDay(today, advntceYmdInfo.number("ADVNTCE_DAY_CNT").intValue());
sndng.setSndngEndYmd(sndngEndYmd);
DataObject first = dataObjectList0.get(0);
sndng.setTtlNm(first.string("TASK_SE_NM")+" "+first.string("VLTN_ARTCL")+" "+"사전통지서");
sndng.setResndYN("N");
String insertSndngResult = sndngBean.createAdvntceSndngList(sndbQuery, sndng);
if(insertSndngResult.contains("[F]")) {
throw new RuntimeException(insertSndngResult);
}
//발송 등록 후 출력대상조회
List<DataObject> dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery);
String taskSeCd = "";
for(int i=0; i < dataObjectList.size(); i++) { for(int i=0; i < dataObjectList.size(); i++) {
DataObject sndngDtl = integrationSearchMapper.selectLatestSndngDtlInfo(dataObjectList.get(i).string("CRDN_ID")); DataObject sndngDtl = integrationSearchMapper.selectLatestSndngDtlInfo(dataObjectList.get(i).string("CRDN_ID"));
dataObjectList.get(i).set("RG_NO",sndngDtl.string("RG_NO")); dataObjectList.get(i).set("RG_NO",sndngDtl.string("RG_NO"));
@ -848,16 +910,46 @@ public class Sprt01Controller extends ApplicationController {
/** PDF . /** PDF .
* @return PDF * @return PDF
*/ */
public ModelAndView makeNhtPdf(PrintOption printOption, String[] crdnIds) { public ModelAndView makeNhtPdf(String[] crdnIds, Sndng sndng, PrintOption printOption) {
ModelAndView mav = new ModelAndView("downloadView"); ModelAndView mav = new ModelAndView("downloadView");
SprtQuery sprtQuery = new SprtQuery();
sprtQuery.setCrdnIds(crdnIds);
List<DataObject> dataObjectList = new ArrayList<DataObject>(); List<DataObject> dataObjectList = new ArrayList<DataObject>();
if(crdnIds.length == 1 && crdnIds[0].equals("sample")) { if(crdnIds.length == 1 && crdnIds[0].equals("sample")) {
DataObject sample = new Advntce().createSampleData(); DataObject sample = new Advntce().createSampleData();
dataObjectList.add(sample); dataObjectList.add(sample);
} else { } else {
SprtQuery sprtQuery = new SprtQuery();
sprtQuery.setCrdnIds(crdnIds); //발송 등록
List<DataObject> dataObjectList0 = integrationSearchMapper.selectIntegrationDataList(sprtQuery);
SndbQuery sndbQuery = new SndbQuery();
sndbQuery.setCrdnIDs(crdnIds);
sndng.setSndngSeCd("03");
sndng.setTnocs(crdnIds.length);
sndng.setGramt(CmmnUtil.sumByKey(dataObjectList0, "FFNLG_AMT"));
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
String today = sdf.format(new Date());
sndng.setSndngYmd(today);
sndbQuery.setSggCd(sndng.getSggCd());
sndbQuery.setTaskSeCd(sndng.getTaskSeCd());
DataObject advntceYmdInfo = taskBean.getAdvntceYmdInfo(sndbQuery);
String sndngEndYmd = CmmnUtil.addDay(today, advntceYmdInfo.number("ADVNTCE_DAY_CNT").intValue());
sndng.setSndngEndYmd(sndngEndYmd);
DataObject first = dataObjectList0.get(0);
sndng.setTtlNm(first.string("TASK_SE_NM")+" "+first.string("VLTN_ARTCL")+" "+"고지서");
sndng.setResndYN("N");
String insertSndngResult = sndngBean.createAdvntceSndngList(sndbQuery, sndng);
if(insertSndngResult.contains("[F]")) {
throw new RuntimeException(insertSndngResult);
}
//발송 등록 후 출력대상조회
dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery); dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery);
for(int i=0; i < dataObjectList.size(); i++) { for(int i=0; i < dataObjectList.size(); i++) {
@ -943,15 +1035,41 @@ public class Sprt01Controller extends ApplicationController {
/** txt, . /** txt, .
* @return * @return
*/ */
public ModelAndView makeNhtOutsourcing(PrintOption printOption, String[] crdnIds) { public ModelAndView makeNhtOutsourcing(String[] crdnIds, Sndng sndng, PrintOption printOption) {
ModelAndView mav = new ModelAndView("downloadView"); ModelAndView mav = new ModelAndView("downloadView");
String taskSeCd = "";
SprtQuery sprtQuery = new SprtQuery(); SprtQuery sprtQuery = new SprtQuery();
sprtQuery.setCrdnIds(crdnIds); sprtQuery.setCrdnIds(crdnIds);
List<DataObject> dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery);
//발송 등록
List<DataObject> dataObjectList0 = integrationSearchMapper.selectIntegrationDataList(sprtQuery);
SndbQuery sndbQuery = new SndbQuery();
sndbQuery.setCrdnIDs(crdnIds);
sndng.setSndngSeCd("03");
sndng.setTnocs(crdnIds.length);
sndng.setGramt(CmmnUtil.sumByKey(dataObjectList0, "FFNLG_AMT"));
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
String today = sdf.format(new Date());
sndng.setSndngYmd(today);
sndbQuery.setSggCd(sndng.getSggCd());
sndbQuery.setTaskSeCd(sndng.getTaskSeCd());
DataObject advntceYmdInfo = taskBean.getAdvntceYmdInfo(sndbQuery);
String sndngEndYmd = CmmnUtil.addDay(today, advntceYmdInfo.number("ADVNTCE_DAY_CNT").intValue());
sndng.setSndngEndYmd(sndngEndYmd);
DataObject first = dataObjectList0.get(0);
sndng.setTtlNm(first.string("TASK_SE_NM")+" "+first.string("VLTN_ARTCL")+" "+"고지서");
sndng.setResndYN("N");
String insertSndngResult = sndngBean.createAdvntceSndngList(sndbQuery, sndng);
if(insertSndngResult.contains("[F]")) {
throw new RuntimeException(insertSndngResult);
}
//발송 등록 후 출력대상조회
List<DataObject> dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery);
String taskSeCd = "";
for(int i=0; i < dataObjectList.size(); i++) { for(int i=0; i < dataObjectList.size(); i++) {
DataObject sndngDtl = integrationSearchMapper.selectLatestSndngDtlInfo(dataObjectList.get(i).string("CRDN_ID")); DataObject sndngDtl = integrationSearchMapper.selectLatestSndngDtlInfo(dataObjectList.get(i).string("CRDN_ID"));
dataObjectList.get(i).set("RG_NO",sndngDtl.string("RG_NO")); dataObjectList.get(i).set("RG_NO",sndngDtl.string("RG_NO"));

@ -22,6 +22,7 @@ import cokr.xit.fims.mngt.Schdl;
import cokr.xit.fims.mngt.SchdlQuery; import cokr.xit.fims.mngt.SchdlQuery;
import cokr.xit.fims.mngt.Task; import cokr.xit.fims.mngt.Task;
import cokr.xit.fims.mngt.VltnQuery; import cokr.xit.fims.mngt.VltnQuery;
import cokr.xit.fims.sndb.Sndng;
import cokr.xit.fims.sprt.SprtQuery; import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.fims.stat.StatQuery; import cokr.xit.fims.stat.StatQuery;
@ -449,14 +450,14 @@ public class CmnController {
@Override @Override
@RequestMapping(name="사전통지서 pdf 파일 생성", value=METHOD_URL.makeAdvntcePdf) @RequestMapping(name="사전통지서 pdf 파일 생성", value=METHOD_URL.makeAdvntcePdf)
public ModelAndView makeAdvntcePdf(PrintOption printOption, String... crdnIds) { public ModelAndView makeAdvntcePdf(String[] crdnIds, Sndng sndng, PrintOption printOption) {
return super.makeAdvntcePdf(printOption, crdnIds); return super.makeAdvntcePdf(crdnIds, sndng, printOption);
} }
@Override @Override
@RequestMapping(name="사전통지서 외주 파일 생성", value=METHOD_URL.makeAdvntceOutsourcing) @RequestMapping(name="사전통지서 외주 파일 생성", value=METHOD_URL.makeAdvntceOutsourcing)
public ModelAndView makeAdvntceOutsourcing(PrintOption printOption, String... crdnIds) { public ModelAndView makeAdvntceOutsourcing(String[] crdnIds, Sndng sndng, PrintOption printOption) {
return super.makeAdvntceOutsourcing(printOption, crdnIds); return super.makeAdvntceOutsourcing(crdnIds, sndng, printOption);
} }
@Override @Override
@ -467,14 +468,14 @@ public class CmnController {
@Override @Override
@RequestMapping(name="고지서 pdf 파일 생성", value=METHOD_URL.makeNhtPdf) @RequestMapping(name="고지서 pdf 파일 생성", value=METHOD_URL.makeNhtPdf)
public ModelAndView makeNhtPdf(PrintOption printOption, String... crdnIds) { public ModelAndView makeNhtPdf(String[] crdnIds, Sndng sndng, PrintOption printOption) {
return super.makeNhtPdf(printOption, crdnIds); return super.makeNhtPdf(crdnIds, sndng, printOption);
} }
@Override @Override
@RequestMapping(name="고지서 외주 파일 생성", value=METHOD_URL.makeNhtOutsourcing) @RequestMapping(name="고지서 외주 파일 생성", value=METHOD_URL.makeNhtOutsourcing)
public ModelAndView makeNhtOutsourcing(PrintOption printOption, String... crdnIds) { public ModelAndView makeNhtOutsourcing(String[] crdnIds, Sndng sndng, PrintOption printOption) {
return super.makeNhtOutsourcing(printOption, crdnIds); return super.makeNhtOutsourcing(crdnIds, sndng, printOption);
} }
} }

@ -151,8 +151,9 @@ $(document).ready(function(){
var globalVariable = formFields.get(); var globalVariable = formFields.get();
var submitParam = { var submitParam = {
crdnIds : checkedCrdnIds.join(","), sggCd : MY_INFO.info.sggCd,
taskSeCd : taskSeCd taskSeCd : taskSeCd,
crdnIds : checkedCrdnIds.join(",")
}; };
var inBrowser = false; var inBrowser = false;

@ -148,8 +148,9 @@ $(document).ready(function(){
var globalVariable = formFields.get(); var globalVariable = formFields.get();
var submitParam = { var submitParam = {
crdnIds : checkedCrdnIds.join(","), sggCd : MY_INFO.info.sggCd,
taskSeCd : taskSeCd taskSeCd : taskSeCd,
crdnIds : checkedCrdnIds.join(",")
}; };
var inBrowser = false; var inBrowser = false;

Loading…
Cancel
Save