단속내역서 출력 추가

main
이범준 1 year ago
parent aa59ef40db
commit f7362cca9e

@ -5,6 +5,7 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.time.DayOfWeek;
import java.time.LocalDate;
@ -35,11 +36,21 @@ public class CmmnUtil {
return str;
}
/**
* .
* @param
* @return boolean
*/
public static boolean isNumeric(String str) {
String REGEXP_PATTERN_NUMBER = "^[\\d]*$";
return Pattern.matches(REGEXP_PATTERN_NUMBER, str);
}
/**
* .
* @param
* @return boolean
*/
public static boolean isKorean(String str) {
String REGEXP_PATTERN_KOR = "^[가-힣]*$";
return Pattern.matches(REGEXP_PATTERN_KOR, str);
@ -234,6 +245,11 @@ public class CmmnUtil {
return yyyyMMddFormat.format(cal.getTime());
}
/**
* .
* @param dateStr
* @return
*/
public static String getDayOfWeek(String dateStr) {
int y = Integer.parseInt(dateStr.substring(0,4));
int m = Integer.parseInt(dateStr.substring(4,6));
@ -243,4 +259,32 @@ public class CmmnUtil {
String dow = dayOfWeek.getDisplayName(TextStyle.SHORT, Locale.KOREAN);
return dow;
}
/**'-' ':' (yyyy-MM-dd hh:mm:ss) .
* @param dateStr '-',':'
* @return '-' ':'
*/
public static String yyyy_mm_dd_hh_mm_ss(String dateStr) {
if (dateStr == null || dateStr.equals("")) return "";
return dateStr.substring(0, 4) + "-" + dateStr.substring(4, 6) + "-" + dateStr.substring(6, 8)
+ " " + dateStr.substring(8, 10) + ":" + dateStr.substring(10, 12) + ":" + dateStr.substring(12, 14);
}
/** .
* @param str
* @return
*/
public static String addCommaToNumber(String str) {
if (str == null || str.equals("")) return "";
int number = Integer.parseInt(str);
DecimalFormat decFormat = new DecimalFormat("###,###");
return decFormat.format(number);
}
public static String addCommaToNumber(int number) {
DecimalFormat decFormat = new DecimalFormat("###,###");
return decFormat.format(number);
}
}

@ -0,0 +1,10 @@
package cokr.xit.fims.cmmn;
public class FactionUtil {
public static String getLastWord(String faction) {
String splitString[] = faction.split(" ", -1);
return splitString[splitString.length-1];
}
}

@ -34,4 +34,9 @@ public interface FactionMapper extends AbstractMapper {
*/
List<DataObject> selectAbleFactionList(Map<String, Object> params);
/** ,,,,, .<br />
* @param ID
* @return ,,,,,
*/
DataObject selectFactionInfoOfUser(String userId);
}

@ -0,0 +1,77 @@
package cokr.xit.fims.cmmn.hwp;
import java.util.ArrayList;
import kr.dogfoot.hwplib.object.HWPFile;
import kr.dogfoot.hwplib.object.bodytext.ParagraphListInterface;
import kr.dogfoot.hwplib.object.bodytext.control.Control;
import kr.dogfoot.hwplib.object.bodytext.control.ControlType;
import kr.dogfoot.hwplib.object.bodytext.control.table.Cell;
import kr.dogfoot.hwplib.object.bodytext.paragraph.Paragraph;
import kr.dogfoot.hwplib.object.bodytext.paragraph.ParagraphList;
import kr.dogfoot.hwplib.tool.objectfinder.ControlFilter;
import kr.dogfoot.hwplib.tool.paragraphadder.ParagraphAdder;
public class AddUtil {
/** .
* @param attachHWPFile , baseHWPFile
* @return
*/
public static void appendToLast(HWPFile attachHWPFile, HWPFile baseHWPFile) throws Exception {
if (attachHWPFile != null && baseHWPFile != null) {
Paragraph attachParagraph = attachHWPFile.getBodyText().getSectionList().get(0).getParagraph(0);
ParagraphListInterface baseSection = baseHWPFile.getBodyText().getSectionList().get(0);
ParagraphAdder paraAdder = new ParagraphAdder(baseHWPFile, baseSection);
paraAdder.add(attachHWPFile, attachParagraph);
}
}
/** .
* @param attachHWPFile , baseHWPFile , cell
* @return
*/
public static void insertTableInCell(HWPFile attachHWPFile, HWPFile baseHWPFile, Cell cell) throws Exception {
Paragraph attachParagraph = attachHWPFile.getBodyText().getSectionList().get(0).getParagraph(0);
boolean isEmptyCell = true;
ParagraphList cpl = cell.getParagraphList();
if(cpl.getParagraphCount() >= 1) {
ArrayList<Control> cl = cpl.getParagraph(0).getControlList();
if(cl != null && cl.size() != 0) {
ControlFilter tableFilter = (control, paragrpah, section) -> {
ControlType ct = control.getType();
if(ct.getCtrlId() == ControlType.Table.getCtrlId()) {
return true;
} else {
return false;
}
};
for(Control c : cl) {
boolean matched = tableFilter.isMatched(c, null, null);
if(matched) {
isEmptyCell = false;
}
}
}
}
if(isEmptyCell) {
cpl.deleteAllParagraphs();
}
ParagraphAdder paraAdder = new ParagraphAdder(baseHWPFile, cpl);
paraAdder.add(attachHWPFile, attachParagraph);
}
}

@ -1,23 +0,0 @@
package cokr.xit.fims.cmmn.hwp;
import kr.dogfoot.hwplib.object.HWPFile;
import kr.dogfoot.hwplib.object.bodytext.ParagraphListInterface;
import kr.dogfoot.hwplib.object.bodytext.paragraph.Paragraph;
import kr.dogfoot.hwplib.tool.paragraphadder.ParagraphAdder;
public class AddingParagraphBetweenHWPFile {
public static void fileMerge(HWPFile sourceHWPFile, HWPFile targetHWPFile) throws Exception {
if (sourceHWPFile != null && targetHWPFile != null) {
ParagraphListInterface targetFirstSection = targetHWPFile.getBodyText().getSectionList().get(0);
Paragraph sourceParagraph = sourceHWPFile.getBodyText().getSectionList().get(0).getParagraph(0);
ParagraphAdder paraAdder = new ParagraphAdder(targetHWPFile, targetFirstSection);
paraAdder.add(sourceHWPFile, sourceParagraph);
}
}
}

@ -0,0 +1,25 @@
package cokr.xit.fims.cmmn.hwp;
import java.util.ArrayList;
import kr.dogfoot.hwplib.object.HWPFile;
import kr.dogfoot.hwplib.tool.objectfinder.FieldFinder;
public class ClickHereEditor {
private HWPFile whpFile;
public ClickHereEditor(HWPFile whpFile){
this.whpFile = whpFile;
}
public void set(String clickHereName, String value) {
try {
ArrayList<String> strings = new ArrayList<String>();
strings.add(value);
FieldFinder.setClickHereText(whpFile, clickHereName, strings);
} catch (Exception e){
throw new RuntimeException("한글 문서 생성 중 오류가 발생하였습니다.");
}
}
}

@ -0,0 +1,262 @@
package cokr.xit.fims.cmmn.hwp;
import java.io.File;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.springframework.core.io.ClassPathResource;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.FactionUtil;
import cokr.xit.fims.sprt.PrintOption;
import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.data.DataFormat;
import cokr.xit.foundation.data.DataObject;
import kr.dogfoot.hwplib.object.HWPFile;
import kr.dogfoot.hwplib.object.bodytext.control.table.Cell;
import kr.dogfoot.hwplib.reader.HWPReader;
import kr.dogfoot.hwplib.tool.objectfinder.CellFinder;
import kr.dogfoot.hwplib.writer.HWPWriter;
public class PrintUtil {
private String formatType;
private String formatName;
private String formatKorName;
private String printRequestDt;
private int recordPerPartFile;
private String baseFormatFilePath;
private String attachFormatFilePath;
private UserInfo printRequestUserInfo;
private int totalPartFileCount;
public String getFormatType() {
return this.formatType;
}
public String getFormatName() {
return this.formatName;
}
public String getFormatKorName() {
return this.formatKorName;
}
public String getPrintRequestDt() {
return this.printRequestDt;
}
public UserInfo getPrintRequestUserInfo() {
return this.printRequestUserInfo;
};
public int getRecordPerPartFile() {
return this.recordPerPartFile;
}
public int getTotalPartFileCount() {
return this.totalPartFileCount;
}
public String getBaseFormatFilePath() {
return this.baseFormatFilePath;
}
public String getAttachFormatFilePath() {
return this.attachFormatFilePath;
}
public void calcTotalPartFileCount(int totalDataCount) {
if(this.formatType.equals("list")) {
if(totalDataCount <= this.recordPerPartFile) {
this.totalPartFileCount = 1;
} else {
int mod = (totalDataCount % this.recordPerPartFile);
this.totalPartFileCount = (totalDataCount - mod) / this.recordPerPartFile;
if(mod > 0) {
this.totalPartFileCount = this.totalPartFileCount + 1;
}
}
} else {
this.totalPartFileCount = totalDataCount;
}
}
public void setPrintRequestUserInfo(UserInfo printRequestUserInfo) {
this.printRequestUserInfo = printRequestUserInfo;
};
public void setting(String formatType, String formatName) {
this.formatType = formatType;
this.formatName = formatName;
SimpleDateFormat ymdhmsFormat = new SimpleDateFormat("yyyyMMddHHmmss");
this.printRequestDt = ymdhmsFormat.format(new Date());
if(!formatType.equals("list")) {
this.recordPerPartFile = 1;
} else {
switch (formatName) {
case "crdnList": {
this.recordPerPartFile = 6;
}
}
}
switch (formatName) {
case "crdnConfirm": {
this.formatKorName = "단속확인서";
this.baseFormatFilePath = "format/crdnConfirm.hwp";
this.attachFormatFilePath = "";
}
case "crdnList": {
this.formatKorName = "단속내역서";
this.baseFormatFilePath = "format/crdnList_root.hwp";
this.attachFormatFilePath = "format/crdnList_inner.hwp";
}
}
}
/** .
* @param formatFile
* @return
*/
public String newFileFromFormatFile() {
try {
InputStream baseFormatIS = new ClassPathResource(this.getBaseFormatFilePath()).getInputStream();
HWPFile baseFormatFile = HWPReader.fromInputStream(baseFormatIS);
SimpleDateFormat ymdhmsFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String currentTime = ymdhmsFormat.format(new Date());
String year = currentTime.substring(0, 4);
String month = currentTime.substring(4, 6);
String day = currentTime.substring(6, 8);
String formatFileResultRootPath = "files" + File.separator + "result" + File.separator + "print";
String formatFileResultFolderPath = formatFileResultRootPath
+ File.separator + year + File.separator + month + File.separator + day;
File formatFileResultFolder = new File(formatFileResultFolderPath);
if(!formatFileResultFolder.exists()) {
formatFileResultFolder.mkdirs();
}
String resultHwpPath = formatFileResultFolderPath + File.separator + currentTime + ".hwp";
HWPWriter.toFile(baseFormatFile, resultHwpPath);
return resultHwpPath;
} catch (Exception e){
throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다.");
}
}
/** .
* @param dataObjectList , baseFile
* @return
*/
public void setGlobalInfo(PrintOption printOption, List<DataObject> dataObjectList, HWPFile baseFile) {
int totalDataCount = dataObjectList.size();
boolean privateInfoYn = true;
if(printOption.getPrivateInfoYn() != null && printOption.getPrivateInfoYn().equals("N")) {
privateInfoYn = false;
}
if(this.formatName.equals("crdnList")){
String globalRtpyrNm = dataObjectList.get(0).string("RTPYR_NM");
String globalRtpyrNo = dataObjectList.get(0).string("RTPYR_NO");
String globalRtpyrFullAddr = dataObjectList.get(0).string("RTPYR_FULL_ADDR");
int globalTotalAmount = dataObjectList.stream().mapToInt(i -> i.number("LEVY_AMT").intValue()).sum();
//상단
ClickHereEditor baseFileEditor = new ClickHereEditor(baseFile);
baseFileEditor.set("성명", globalRtpyrNm);
if(privateInfoYn) {
baseFileEditor.set("주민번호", globalRtpyrNo);
} else {
baseFileEditor.set("주민번호", "*************");
}
baseFileEditor.set("주소", globalRtpyrFullAddr);
baseFileEditor.set("총건수", CmmnUtil.addCommaToNumber(totalDataCount));
baseFileEditor.set("총금액", CmmnUtil.addCommaToNumber(globalTotalAmount));
baseFileEditor.set("출력일시", CmmnUtil.yyyy_mm_dd_hh_mm_ss(this.printRequestDt));
String instNm = (String) this.printRequestUserInfo.getInfo().get("instNm");
instNm = FactionUtil.getLastWord(instNm);
baseFileEditor.set("발신", instNm);
}
}
/** .
* @param dataObject , baseFile
* @return
*/
public void setBySingleData(PrintOption printOption, DataObject dataObject, HWPFile baseFile) {
try {
if(this.formatType.equals("list")) {
InputStream attachFormatIS = new ClassPathResource(this.getAttachFormatFilePath()).getInputStream();
HWPFile attachFormatFile = HWPReader.fromInputStream(attachFormatIS);
ClickHereEditor attachFileEditor = new ClickHereEditor(attachFormatFile);
if(this.formatName.equals("crdnList")){
attachFileEditor.set("과태료", dataObject.string("TASK_SE_NM"));
attachFileEditor.set("시군구명", dataObject.string("SGG_NM"));
String crdnYmdTm = dataObject.string("CRDN_YMD_TM");
crdnYmdTm = CmmnUtil.yyyy_mm_dd_hh_mm_ss(crdnYmdTm);
attachFileEditor.set("단속일시", crdnYmdTm);
attachFileEditor.set("단속장소", dataObject.string("CRDN_PLC"));
attachFileEditor.set("차량번호", dataObject.string("VHRNO"));
attachFileEditor.set("대체차량번호", dataObject.string("RPM_SZR_VHRNO"));
attachFileEditor.set("고지번호", dataObject.string("GOJI_NO"));
attachFileEditor.set("금액", CmmnUtil.addCommaToNumber(dataObject.string("LEVY_AMT")));
attachFileEditor.set("가상계좌번호", dataObject.string("VR_ACTNO"));
attachFileEditor.set("전자납부번호", dataObject.string("EPAYNO"));
attachFileEditor.set("처리상태", dataObject.string("CRDN_STTS_NM"));
String crdnSttsChgDt = dataObject.string("CRDN_STTS_CHG_DT");
crdnSttsChgDt = DataFormat.yyyy_mm_dd(crdnSttsChgDt.substring(0, 8));
attachFileEditor.set("처리일자", crdnSttsChgDt);
attachFileEditor.set("납부기한", DataFormat.yyyy_mm_dd(dataObject.string("DUDT_YMD")));
attachFileEditor.set("수납일자", DataFormat.yyyy_mm_dd(dataObject.string("RCVMT_YMD")));
}
ArrayList<Cell> cellList = CellFinder.findAll(baseFile, "내부");
Cell cell = cellList.get(0);
AddUtil.insertTableInCell(attachFormatFile, baseFile, cell);
} else {
}
} catch(Exception e) {
e.printStackTrace();
throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다.");
}
}
}

@ -0,0 +1,43 @@
package cokr.xit.fims.cmmn.service.bean;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.fims.cmmn.dao.FactionMapper;
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.foundation.AbstractComponent;
import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.data.DataObject;
@Component("factionBean")
public class FactionBean extends AbstractComponent {
@Resource(name = "factionMapper")
private FactionMapper factionMapper;
@Resource(name = "globalStngMapper")
private GlobalStngMapper globalStngMapper;
@Resource(name = "userMapper")
private UserMapper userMapper;
public void initUserInfo(UserInfo userInfo) {
DataObject factionInfo = factionMapper.selectFactionInfoOfUser(userInfo.getId());
Map<String, Object> infoMap = userInfo.getInfo();
infoMap.put("sggCd", factionInfo.string("SGG_CD"));
infoMap.put("sggNm", factionInfo.string("SGG_NM"));
infoMap.put("instCd", factionInfo.string("INST_CD"));
infoMap.put("instNm", factionInfo.string("INST_NM"));
infoMap.put("deptCd", factionInfo.string("DEPT_CD"));
infoMap.put("deptNm", factionInfo.string("DEPT_NM"));
userInfo.setInfo(infoMap);
}
}

@ -23,7 +23,7 @@ import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.CrdnSttsHstry;
import cokr.xit.fims.cmmn.dao.CrdnPayerHstryMapper;
import cokr.xit.fims.cmmn.dao.CrdnSttsHstryMapper;
import cokr.xit.fims.cmmn.hwp.AddingParagraphBetweenHWPFile;
import cokr.xit.fims.cmmn.hwp.AddUtil;
import cokr.xit.fims.cmmn.hwp.InsertingImageCell;
import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean;
import cokr.xit.fims.crdn.Crdn;
@ -219,7 +219,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "왼쪽아래사진", fileInfoList.get(i+2).string("URL"));
if(i+3 < photoCnt)
InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "오른쪽아래사진", fileInfoList.get(i+3).string("URL"));
AddingParagraphBetweenHWPFile.fileMerge(attachFormatFile, resultFile);
AddUtil.appendToLast(attachFormatFile, resultFile);
}
HWPWriter.toFile(resultFile, resultHwpPath);

@ -0,0 +1,12 @@
package cokr.xit.fims.sprt;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class PrintOption {
String privateInfoYn; //개인정보표시
}

@ -1,7 +1,9 @@
package cokr.xit.fims.sprt.service;
import java.util.List;
import java.util.Map;
import cokr.xit.fims.sprt.PrintOption;
import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.foundation.data.DataObject;
@ -29,4 +31,13 @@ public interface Sprt01Service {
*/
boolean updateEtcCn(String etcCn, String... crdnIds);
/** .
* @param formatType ,formatName , printOption , crdnIds
* @return map
* <ul><li>filePath: </li>
* <li>fileName: </li>
* </ul>
*/
Map<String, String> makeFileFromHwpFormat(String formatType, String formatName, PrintOption printOption, String... crdnIds);
}

@ -1,15 +1,28 @@
package cokr.xit.fims.sprt.service.bean;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import cokr.xit.fims.cmmn.hwp.AddUtil;
import cokr.xit.fims.cmmn.hwp.PrintUtil;
import cokr.xit.fims.cmmn.service.bean.FactionBean;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.CrdnListMapper;
import cokr.xit.fims.sprt.PrintOption;
import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.fims.sprt.service.Sprt01Service;
import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject;
import kr.dogfoot.hwplib.object.HWPFile;
import kr.dogfoot.hwplib.reader.HWPReader;
import kr.dogfoot.hwplib.writer.HWPWriter;
/** .
*
@ -28,6 +41,12 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
@Resource(name="sprt01Bean")
protected Sprt01Bean sprt01Bean;
@Resource(name="factionBean")
protected FactionBean factionBean;
@Resource(name="crdnListMapper")
protected CrdnListMapper crdnListMapper;
@Override
public List<DataObject> getIntegrationDataList(SprtQuery query) {
return sprt01Bean.getIntegrationDataList(query);
@ -40,4 +59,97 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
}
@Override
public Map<String, String> makeFileFromHwpFormat(String formatType, String formatName, PrintOption printOption, String... crdnIds) {
Map<String, String> result = new HashMap<>();
PrintUtil printUtil = new PrintUtil();
printUtil.setting(formatType, formatName);
UserInfo userInfo = currentUser();
factionBean.initUserInfo(userInfo);
printUtil.setPrintRequestUserInfo(userInfo);
List<DataObject> dataObjectList = null;
if(formatName.equals("crdnList")) {
CrdnQuery query = new CrdnQuery();
query.setCrdnIDs(crdnIds);
dataObjectList = crdnListMapper.selectCrackdownList(query);
} else if(formatName.equals("crdnConfirm")) {
CrdnQuery query = new CrdnQuery();
query.setCrdnIDs(crdnIds);
dataObjectList = crdnListMapper.selectCrackdownList(query);
}
int totalDataCount = dataObjectList.size();
List<String> partFileList = new ArrayList<>();
printUtil.calcTotalPartFileCount(totalDataCount);
try {
int dataIndex = 0;
for(int partFileIndex = 0; partFileIndex < printUtil.getTotalPartFileCount(); partFileIndex++) {
//새 파일 생성
String resultHwpPath = printUtil.newFileFromFormatFile();
HWPFile resultFile = HWPReader.fromFile(resultHwpPath);
//공통사항 세팅
printUtil.setGlobalInfo(printOption, dataObjectList, resultFile);
HWPWriter.toFile(resultFile, resultHwpPath);
//데이터 건별 처리
for(int recordIndex = 0; recordIndex < printUtil.getRecordPerPartFile(); recordIndex++) {
if(dataIndex < dataObjectList.size()) {
DataObject dataObject = dataObjectList.get(dataIndex);
printUtil.setBySingleData(printOption, dataObject, resultFile);
}
if(formatType.equals("list")) {
dataIndex++;
}
}
if(!formatType.equals("list")) {
dataIndex++;
}
HWPWriter.toFile(resultFile, resultHwpPath);
partFileList.add(resultHwpPath);
}
//결과파일 병합
if(partFileList.size() >= 2) {
String basePath = partFileList.get(0);
HWPFile baseFile = HWPReader.fromFile(basePath);
for(int i=2; i <= partFileList.size();i++) {
String attachPath = partFileList.get(i-1);
HWPFile attachFile = HWPReader.fromFile(attachPath);
AddUtil.appendToLast(attachFile, baseFile);
}
HWPWriter.toFile(baseFile, basePath);
}
String downlaodFileName = printUtil.getFormatKorName()+"_"+printUtil.getPrintRequestDt()+".hwp";
result.put("fileName", downlaodFileName);
result.put("filePath", partFileList.get(0));
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다.");
}
return result;
}
}

@ -14,8 +14,10 @@ import cokr.xit.base.code.CommonCode;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.fims.sprt.Keyword;
import cokr.xit.fims.sprt.PrintOption;
import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.fims.sprt.service.Sprt01Service;
import cokr.xit.foundation.data.DataObject;
@ -43,6 +45,8 @@ public class Sprt01Controller extends ApplicationController {
inputEtcCnMain = "/100/info.do",
inputEtcCn = "/100/update.do",
printCrdnMain = "/110/info.do",
makeCrdnListFileFromHwpFormat = "/110/makeCrdnListFileFromHwpFormat.do",
makeCrdnConfirmFileFromHwpFormat = "/110/makeCrdnConfirmFileFromHwpFormat.do",
printBillMain = "/120/info.do"
;
}
@ -241,7 +245,7 @@ public class Sprt01Controller extends ApplicationController {
*/
public ModelAndView inputEtcCnMain(String... crdnIds) {
ModelAndView mav = new ModelAndView("fims/sprt/sprt01100-info");
mav.addObject("pageName", "sprt01100-info");
mav.addObject("crdnIds", toJson(crdnIds));
return mav;
@ -255,12 +259,12 @@ public class Sprt01Controller extends ApplicationController {
* "saved": true, false
* }</code></pre>
*/
public ModelAndView inputEtcCn(String etcCn, String... crdnIds) {
public ModelAndView inputEtcCn(Crdn crdn, String... crdnIds) {
ModelAndView mav = new ModelAndView("jsonView");
boolean saved = false;
saved = sprt01Service.updateEtcCn(etcCn, crdnIds);
saved = sprt01Service.updateEtcCn(crdn.getEtcCn(), crdnIds);
mav.addObject("saved", saved);
@ -273,21 +277,53 @@ public class Sprt01Controller extends ApplicationController {
*/
public ModelAndView printCrdnMain(String... crdnIds) {
ModelAndView mav = new ModelAndView("fims/sprt/sprt01110-info");
mav.addObject("pageName", "sprt01110-info");
mav.addObject("crdnIds", toJson(crdnIds));
return mav;
}
/** .
* @return hwp
*/
public ModelAndView makeCrdnListFileFromHwpFormat(String privateInfoYn, String[] crdnIds) {
Map<String,String> result = null;
String format = "crdnList";
PrintOption printOption = new PrintOption();
printOption.setPrivateInfoYn(privateInfoYn);
result = sprt01Service.makeFileFromHwpFormat("list", format, printOption ,crdnIds);
ModelAndView mav = new ModelAndView("jsonView");
mav.addAllObjects(result);
return mav;
}
/** .
* @return hwp
*/
public ModelAndView makeCrdnConfirmFileFromHwpFormat(String[] crdnIds) {
Map<String,String> result = null;
String format = "crdnConfirm";
PrintOption printOption = new PrintOption();
result = sprt01Service.makeFileFromHwpFormat("info", format, printOption, crdnIds);
ModelAndView mav = new ModelAndView("jsonView");
mav.addAllObjects(result);
return mav;
}
/**, .
*
* @return /fims/sprt/sprt01120
*/
public ModelAndView printBillMain(String... crdnIds) {
ModelAndView mav = new ModelAndView("fims/sprt/sprt01120-info");
mav.addObject("pageName", "sprt01120-info");
mav.addObject("crdnIds", toJson(crdnIds));
return mav;
}
}

@ -6,6 +6,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.fims.stat.StatQuery;
@ -356,8 +357,8 @@ public class CmnController {
@Override
@RequestMapping(name="특기사항 일괄 입력", value=METHOD_URL.inputEtcCn)
public ModelAndView inputEtcCn(String etcCn, String... crdnIds) {
return super.inputEtcCn(etcCn, crdnIds);
public ModelAndView inputEtcCn(Crdn crdn, String... crdnIds) {
return super.inputEtcCn(crdn, crdnIds);
}
@Override
@ -366,6 +367,18 @@ public class CmnController {
return super.printCrdnMain(crdnIds);
}
@Override
@RequestMapping(name="단속 내역서 한글 파일 생성", value=METHOD_URL.makeCrdnListFileFromHwpFormat)
public ModelAndView makeCrdnListFileFromHwpFormat(String privateInfoYn, String... crdnIds) {
return super.makeCrdnListFileFromHwpFormat(privateInfoYn, crdnIds);
}
@Override
@RequestMapping(name="단속 확인서 한글 파일 생성", value=METHOD_URL.makeCrdnConfirmFileFromHwpFormat)
public ModelAndView makeCrdnConfirmFileFromHwpFormat(String... crdnIds) {
return super.makeCrdnConfirmFileFromHwpFormat(crdnIds);
}
@Override
@RequestMapping(name="교부청구서,채권신고서 출력 화면", value=METHOD_URL.printBillMain)
public ModelAndView printBillMain(String... crdnIds) {

@ -47,4 +47,18 @@ FROM DUAL
</if>
</select>
<select id="selectFactionInfoOfUser" parameterType="string" resultType="dataobject">
/* 사용자의 시군구,기관,부서 조회(factionMapper.selectFactionInfoOfUser) */
SELECT S.SGG_CD
, S.SGG_NM
, U.NSTT_CD AS INST_CD
, S.INST_NM
, U.DEPT_CD
, D.DEPT_NM
FROM TB_USER U
INNER JOIN TB_SGG_INFO S ON (U.ORG_ID = S.SGG_CD)
LEFT OUTER JOIN TB_DEPT_INFO D ON (U.DEPT_CD = D.DEPT_CD)
WHERE U.USER_ID = #{userId}
</select>
</mapper>

@ -10,6 +10,7 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
, C.SGG_CD <!-- 시군구 코드 -->
, (SELECT SGG_NM FROM TB_SGG_INFO WHERE SGG_CD = C.SGG_CD) AS SGG_NM
, C.TASK_SE_CD <!-- 업무 구분 코드 -->
, (SELECT GET_CODE_NM('FIM054', C.TASK_SE_CD) FROM DUAL) AS TASK_SE_NM
, C.CRDN_REG_SE_CD <!-- 단속 등록 구분 코드 -->
, C.CRDN_INPT_SE_CD <!-- 단속 입력 구분 코드 -->
, C.LINK_TBL_NM <!-- 연계 테이블 명 -->
@ -40,6 +41,11 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
, C.OPNN_SBMSN_YN <!-- 의견 제출 여부 -->
, L.LEVY_ID <!-- 부과 ID -->
, (CONCAT(L.FYR, '-', L.LEVY_NO)) AS GOJI_NO <!-- 고지 번호 -->
, L.EPAYNO <!-- 전자납부번호 -->
, L.VR_ACTNO <!-- 가상계좌번호 -->
, (L.LEVY_PCPTAX + L.LEVY_ADAMT + L.INSPY_INT) AS LEVY_AMT <!-- 부과 금액 -->
, L.DUDT_YMD
, L.RCVMT_YMD
, C.CRDN_STTS_CD <!-- 단속 상태 코드 -->
, (SELECT GET_CODE_NM('FIM010', C.CRDN_STTS_CD) FROM DUAL) AS CRDN_STTS_NM
, C.CRDN_STTS_CHG_DT <!-- 단속 상태 변경 일시 -->
@ -85,6 +91,8 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
, LE.LEVY_EXCL_YMD <!-- 부과 제외 일자 -->
, LE.ETC_CN AS LEVY_EXCL_ETC_CN <!-- 부과 제외 기타 내용 -->
, P.RTPYR_NM <!-- 납부자명 -->
, P.RTPYR_NO <!-- 납부자번호 -->
, CONCAT(P.ADDR, ' ', P.DTL_ADDR) AS RTPYR_FULL_ADDR /* 납부자 전체 주소 */
, C.DEL_YN
, C.RGTR
, C.REG_DT
@ -104,6 +112,9 @@ WHERE C.DEL_YN = 'N'
AND C.SGG_CD = #{sggCd}
</if>
<if test="crdnId != null">AND C.CRDN_ID = #{crdnId}</if>
<if test="crdnIDs != null">
AND C.CRDN_ID IN (<foreach collection="crdnIDs" item="CRDN_ID" separator=",">#{CRDN_ID}</foreach>)
</if>
<if test="taskSeCd != null">AND C.TASK_SE_CD = #{taskSeCd}</if>
<if test="vhrno != null">AND C.VHRNO LIKE CONCAT('%', #{vhrno}, '%')</if>
<if test="crdnInptSeCd != null">AND C.CRDN_INPT_SE_CD = #{crdnInptSeCd}</if>

@ -176,7 +176,7 @@ LEFT OUTER JOIN TB_RCVMT R ON (L.LEVY_ID = R.LEVY_ID AND R.DEL_YN = 'N
<when test="item.name == 'rpmSzrVhrno'">
<choose>
<when test="item.similar != null">
AND L.RPM_SZR_VHRNO LIKE CONCAT ('%' || #{item.value} || '%')
AND L.RPM_SZR_VHRNO LIKE CONCAT ('%' , #{item.value} , '%')
</when>
<otherwise>
AND L.RPM_SZR_VHRNO = #{item.value}
@ -186,7 +186,7 @@ LEFT OUTER JOIN TB_RCVMT R ON (L.LEVY_ID = R.LEVY_ID AND R.DEL_YN = 'N
<when test="item.name == 'crdnVhrno'">
<choose>
<when test="item.similar != null">
AND C.VHRNO LIKE CONCAT ('%' || #{item.value} || '%')
AND C.VHRNO LIKE CONCAT ('%' , #{item.value} , '%')
</when>
<otherwise>
AND C.VHRNO = #{item.value}
@ -196,7 +196,7 @@ LEFT OUTER JOIN TB_RCVMT R ON (L.LEVY_ID = R.LEVY_ID AND R.DEL_YN = 'N
<when test="item.name == 'rtpyrNm'">
<choose>
<when test="item.similar != null">
AND P.RTPYR_NM LIKE CONCAT ('%' || #{item.value} || '%')
AND P.RTPYR_NM LIKE CONCAT ('%' , #{item.value} , '%')
</when>
<otherwise>
AND P.RTPYR_NM = #{item.value}
@ -226,10 +226,10 @@ LEFT OUTER JOIN TB_RCVMT R ON (L.LEVY_ID = R.LEVY_ID AND R.DEL_YN = 'N
</if>
</when>
<when test="item.name == 'rtpyrAddr'">
AND P.ADDR LIKE CONCAT ('%' || #{item.value} || '%')
AND P.ADDR LIKE CONCAT ('%' , #{item.value} , '%')
</when>
<when test="item.name == 'rtpyrDtlAddr'">
AND P.DTL_ADDR LIKE CONCAT ('%' || #{item.value} || '%')
AND P.DTL_ADDR LIKE CONCAT ('%' , #{item.value} , '%')
</when>
<when test="item.name == 'gojiNo'">
AND CONCAT(L.FYR, '-', L.LEVY_NO) = #{item.value}
@ -253,7 +253,7 @@ LEFT OUTER JOIN TB_RCVMT R ON (L.LEVY_ID = R.LEVY_ID AND R.DEL_YN = 'N
AND C.CRDN_STDG_NM = #{item.value}
</when>
<when test="item.name == 'crdnPlc'">
AND C.CRDN_PLC LIKE CONCAT ('%' || #{item.value} || '%')
AND C.CRDN_PLC LIKE CONCAT ('%' , #{item.value} , '%')
</when>
<when test="item.name == 'cvlcptListNo'">
AND CC.CVLCPT_LIST_NO = #{item.value}

@ -9,10 +9,10 @@
<div class="col-md-12">
<div class="float-start">
<button type="button" id="btnExcel--${pageName}" class="btn btn-excel">엑셀</button>
<button type="button" id="" class="btn btn-info">단속내역서출력</button>
<button type="button" id="" class="btn btn-info">단속확인서출력</button>
<button type="button" id="btnPrintCrdnList--${pageName}" class="btn btn-info">단속내역서출력</button>
<button type="button" id="btnPrintCrdnConfirm" class="btn btn-info">단속확인서출력</button>
<label>
<input type="checkbox" id="" name="" class="form-check-input"/>
<input type="checkbox" id="privateInfoYn--${pageName}" name="privateInfoYn" class="form-check-input"/>
개인정보 비공개(내역서)
</label>
</div>
@ -73,6 +73,8 @@
<form id="frmEdit--${pageName}">
<input type="text" name="dialogId" hidden />
</form>
<span id="tempArea--${pageName}" hidden></span>
</div>
</div>
@ -93,6 +95,52 @@ $(document).ready(function(){
$("#tbody--${pageName}").setCurrentRow(key);
}
//단속내역서 파일 생성
$P.fnMakeCrdnListFile = () => {
var privateInfoYn = "Y";
if($("#privateInfoYn--${pageName}").is(":checked")){
privateInfoYn = "N";
}
ajax.post({
url : wctx.url("/sprt/sprt01/110/makeCrdnListFileFromHwpFormat.do"),
data : {
crdnIds : $P.crdnIds.join(","),
privateInfoYn : privateInfoYn
},
success : resp => {
var a = document.createElement("a");
a.href = resp.filePath;
a.download = resp.fileName;
document.getElementById("tempArea--${pageName}").appendChild(a);
a.click();
document.getElementById("tempArea--${pageName}").removeChild(a);
}
});
}
$P.fnMakeCrdnConfirmFile = () => {
ajax.post({
url : wctx.url("/sprt/sprt01/110/makeCrdnConfirmFileFromHwpFormat.do"),
data : {
crdnIds : $P.crdnIds.join(",")
},
success : resp => {
var a = document.createElement("a");
a.href = resp.filePath;
a.download = resp.fileName;
document.getElementById("tempArea--${pageName}").appendChild(a);
a.click();
document.getElementById("tempArea--${pageName}").removeChild(a);
}
});
}
//버튼 이벤트
$("#btnPrintCrdnList--${pageName}").on("click", () => $P.fnMakeCrdnListFile() );
$("#btnPrintCrdnConfirm--${pageName}").on("click", () => $P.fnMakeCrdnConfirmFile() );
//첫번째 줄 클릭
$("#tbody--${pageName}").find("tr:eq(0)").click();
});

Loading…
Cancel
Save