출력정보 설정 화면 추가

main
이범준 12 months ago
parent c615de89be
commit 579fdc4114

@ -19,17 +19,26 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.service.UserService;
import cokr.xit.fims.cmmn.DirectoryStructureToJson;
import cokr.xit.fims.cmmn.DirectoryStructureToJson.Node;
import cokr.xit.fims.cmmn.dao.FactionMapper;
import cokr.xit.fims.cmmn.service.bean.FactionBean;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.crdn.service.bean.ImportServiceBean;
import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.interfaces.smg.service.bean.SmgServiceBean;
@Controller
public class UserController extends cokr.xit.base.user.web.UserController<ManagedUser> {
@Resource(name="userService")
private UserService userService;
@Resource(name="factionBean")
FactionBean factionBean;
@Resource(name="factionMapper")
FactionMapper factionMapper;
@ -61,6 +70,18 @@ public class UserController extends cokr.xit.base.user.web.UserController<Manage
return mav;
}
@RequestMapping(name="내 정보 조회",value="/myInfo.do")
public ModelAndView myInfo() {
ModelAndView mav = new ModelAndView("jsonView");
UserInfo userInfo = currentUser();
factionBean.initUserInfo(userInfo);
mav.addObject("myInfo", userInfo);
return mav;
}
@RequestMapping(name="설정정보 조회",value="/stngInfo.do")
public ModelAndView getStngInfo(String type) {
ModelAndView mav = new ModelAndView("jsonView");

@ -6,16 +6,19 @@ import lombok.Setter;
@Getter
@Setter
public class DefaultOtptStng {
public DefaultOtptStng(String contentType, String otptNm, String otptBscVl){
this.contentType = contentType;
/**
*
*/
public DefaultOtptStng(String componentType, String otptNm, String descrp, String otptBscVl){
this.componentType = componentType;
this.otptNm=otptNm;
this.descrp=descrp;
this.otptBscVl=otptBscVl;
this.widthSz=0;
this.heightSz=0;
this.fontNm="gulim";
this.fontNm="gulimche";
this.fontSize=10;
this.fontColor="BLACK";
this.fontStyle="FILL";
@ -25,33 +28,52 @@ public class DefaultOtptStng {
this.unique = false;
}
/**
* A4 . 1 1 .
*/
public DefaultOtptStng a4(float leftPstn, float topPstn) {
this.a4 = new Pstn(leftPstn, topPstn);
this.unique = true;
return this;
}
/**
* . 1 1 .
*/
public DefaultOtptStng letter(float leftPstn, float topPstn) {
this.letter = new Pstn(leftPstn, topPstn);
this.unique = true;
return this;
}
/**
* .
*/
public DefaultOtptStng post() {
this.forPost = true;
return this;
}
/**
* .
*/
public DefaultOtptStng align(String type) {
this.align = type;
return this;
}
/**
* .
*/
public DefaultOtptStng size(float width, float height) {
this.widthSz = width;
this.heightSz = height;
return this;
}
/**
* .
*/
public DefaultOtptStng font(String fontNm, int fontSize, String fontColor, String fontStyle) {
this.fontNm = fontNm;
this.fontSize = fontSize;
@ -60,7 +82,9 @@ public class DefaultOtptStng {
return this;
}
/**
* x .
*/
public float getLeftPstn(String paper) {
switch (paper) {
case "01": {
@ -72,6 +96,10 @@ public class DefaultOtptStng {
}
return 0;
}
/**
* y .
*/
public float getTopPstn(String paper) {
switch (paper) {
case "01": {
@ -84,19 +112,20 @@ public class DefaultOtptStng {
return 0;
}
private String contentType;
private String otptNm;
private String otptBscVl;
private Pstn a4;
private Pstn letter;
private boolean unique;
private boolean forPost;
private float widthSz;
private float heightSz;
private String align;
private String fontNm;
private int fontSize;
private String fontColor;
private String fontStyle;
private String componentType; //컴포넌트 유형(텍스트 또는 이미지)
private String otptBscVl; //기본값
private boolean unique; //출력물 내 유일 요소 여부
private boolean forPost; //우편물 관련 요소 여부
private String descrp; //출력항목 설명
private String otptNm; //출력항목명
private Pstn a4; //A4 위치값
private Pstn letter; //레터 위치값
private float widthSz; //영역크기 길이
private float heightSz; //영역크기 높이
private String align; //텍스트정렬
private String fontNm; //글꼴명
private int fontSize; //글꼴크기
private String fontColor; //글꼴색
private String fontStyle; //글꼴스타일
}

@ -8,35 +8,89 @@ import cokr.xit.foundation.data.DataObject;
public abstract class PDFFormat {
protected List<DefaultOtptStng> defaultOtptStng = new ArrayList<DefaultOtptStng>();
protected List<DefaultOtptStng> prototypeStngs = new ArrayList<DefaultOtptStng>();
public List<DefaultOtptStng> getDefaultOtptStng(){
return this.defaultOtptStng;
/**
* .
*/
public List<DefaultOtptStng> getPrototypeStngs(){
return this.prototypeStngs;
}
public DefaultOtptStng text(String otptNm, String otptBscVl){
return new DefaultOtptStng("text", otptNm, otptBscVl);
/**
* .
*/
public List<DefaultOtptStng> getPrototypeStngs(boolean unique){
return this.prototypeStngs.stream().filter(item -> item.isUnique() == unique).toList();
}
public DefaultOtptStng image(String otptNm, String otptBscVl){
return new DefaultOtptStng("image", otptNm, otptBscVl);
/**
* .
*/
public DefaultOtptStng text(String otptNm, String descrp, String otptBscVl){
return new DefaultOtptStng("text", otptNm, descrp, otptBscVl);
}
public void add(DefaultOtptStng... defaultOtptStngs){
for(DefaultOtptStng defaultOtptStng : defaultOtptStngs) {
this.defaultOtptStng.add(defaultOtptStng);
/**
* .
*/
public DefaultOtptStng image(String otptNm, String descrp, String otptBscVl){
return new DefaultOtptStng("image", otptNm, descrp, otptBscVl);
}
/**
* .
*/
public void add(DefaultOtptStng... prototypeStngs){
for(DefaultOtptStng prototypeStng : prototypeStngs) {
this.prototypeStngs.add(prototypeStng);
}
}
public void addForPost(DefaultOtptStng... defaultOtptStngs) {
for(DefaultOtptStng defaultOtptStng : defaultOtptStngs) {
this.defaultOtptStng.add(defaultOtptStng.post());
/**
* .
*/
public void addForPost(DefaultOtptStng... prototypeStngs){
for(DefaultOtptStng prototypeStng : prototypeStngs) {
this.prototypeStngs.add(prototypeStng.post());
}
};
/**
* .
*/
public abstract String getMappingValue(String otptNm, String defaultValue, boolean forPost,
DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil);
/**
* .
*/
public abstract String getValueForPost(String otptNm, String defaultValue,
DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil);
/**
* ( , , , , ) .
*/
public void appendOtptAttribute(List<DataObject> otptStngList) {
List<DefaultOtptStng> prototypeStngs = this.getPrototypeStngs();
for(DataObject otptStng : otptStngList) {
String otptNm = (String) otptStng.get("OTPT_NM");
DefaultOtptStng prototypeStng = prototypeStngs.stream()
.filter(item -> item.getOtptNm().equals(otptNm)).toList().get(0);
otptStng.set("UNIQUE_YN", prototypeStng.isUnique() ? "Y" : "N");
otptStng.set("DESCRP", prototypeStng.getDescrp());
otptStng.set("COMPONENT_TYPE", prototypeStng.getComponentType());
otptStng.set("POST_YN", prototypeStng.isForPost() ? "Y" : "N");
}
}
/**
* .
*/
public abstract DataObject createSampleData();
}

@ -12,6 +12,7 @@ import org.apache.pdfbox.pdmodel.font.PDType0Font;
import org.apache.pdfbox.pdmodel.graphics.color.PDColor;
import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;
import org.apache.pdfbox.pdmodel.graphics.state.RenderingMode;
import org.springframework.core.io.ClassPathResource;
import cokr.xit.fims.cmmn.PrintUtil;
import cokr.xit.foundation.data.DataObject;
@ -149,7 +150,7 @@ public class PDFPrintUtil extends PrintUtil {
}
}
public float[] getPstnStng(DefaultOtptStng defaultStng, DataObject sggStng, String otptPaperSeCd) {
public float[] getPstnStng(DefaultOtptStng prototypeStng, DataObject sggStng, String otptPaperSeCd) {
if(!sggStng.string("LEFT_PSTN").equals("") && !sggStng.string("TOP_PSTN").equals("")) {
return new float[] {
sggStng.number("LEFT_PSTN").floatValue(),
@ -157,45 +158,45 @@ public class PDFPrintUtil extends PrintUtil {
};
} else {
return new float[] {
defaultStng.getLeftPstn(otptPaperSeCd),
defaultStng.getTopPstn(otptPaperSeCd)
prototypeStng.getLeftPstn(otptPaperSeCd),
prototypeStng.getTopPstn(otptPaperSeCd)
};
}
}
public PDType0Font getFontType(DefaultOtptStng defaultStng, DataObject sggStng, Map<String, PDType0Font> fontMap) {
public PDType0Font getFontType(DefaultOtptStng prototypeStng, DataObject sggStng, Map<String, PDType0Font> fontMap) {
if(sggStng != null && !sggStng.isEmpty() && !sggStng.string("FONT_NM").equals("")) {
return fontMap.get(sggStng.string("FONT_NM"));
} else {
return fontMap.get(defaultStng.getFontNm());
return fontMap.get(prototypeStng.getFontNm());
}
}
public int getFontSize(DefaultOtptStng defaultStng, DataObject sggStng) {
public int getFontSize(DefaultOtptStng prototypeStng, DataObject sggStng) {
if(!sggStng.string("FONT_SZ").equals("")) {
return sggStng.number("FONT_SZ").intValue();
} else {
return defaultStng.getFontSize();
return prototypeStng.getFontSize();
}
}
public RenderingMode getFontStyle(DefaultOtptStng defaultStng, DataObject sggStng) {
public RenderingMode getFontStyle(DefaultOtptStng prototypeStng, DataObject sggStng) {
if(!sggStng.string("FONT_STYLE").equals("")) {
return RenderingMode.valueOf(sggStng.string("FONT_STYLE"));
} else {
return RenderingMode.valueOf(defaultStng.getFontStyle());
return RenderingMode.valueOf(prototypeStng.getFontStyle());
}
}
public PDColor getFontColor(DefaultOtptStng defaultStng, DataObject sggStng) {
public PDColor getFontColor(DefaultOtptStng prototypeStng, DataObject sggStng) {
if(!sggStng.string("FONT_COLOR").equals("")) {
return PDFColors.getColor(sggStng.string("FONT_COLOR"));
} else {
return PDFColors.getColor(defaultStng.getFontColor());
return PDFColors.getColor(prototypeStng.getFontColor());
}
}
public float[] getSize(DefaultOtptStng defaultStng, DataObject sggStng) {
public float[] getSize(DefaultOtptStng prototypeStng, DataObject sggStng) {
if(!sggStng.string("WIDTH_SZ").equals("")) {
return new float[] {
sggStng.number("WIDTH_SZ").floatValue(),
@ -203,17 +204,36 @@ public class PDFPrintUtil extends PrintUtil {
};
} else {
return new float[] {
defaultStng.getWidthSz(),
defaultStng.getHeightSz()
prototypeStng.getWidthSz(),
prototypeStng.getHeightSz()
};
}
}
public String getAlign(DefaultOtptStng defaultStng, DataObject sggStng) {
public String getAlign(DefaultOtptStng prototypeStng, DataObject sggStng) {
if(!sggStng.string("TEXT_SORT").equals("")) {
return sggStng.string("TEXT_SORT");
} else {
return defaultStng.getAlign();
return prototypeStng.getAlign();
}
}
public Map<String, PDType0Font> getFontMap(PDDocument doc) {
try {
Map<String, PDType0Font> fontMap = Map.of(
"notokrBold", PDType0Font.load(doc, new ClassPathResource("fonts/notokr-bold.ttf").getInputStream()),
"gulim", PDType0Font.load(doc, new ClassPathResource("fonts/gulim.ttf").getInputStream()),
"gulimche", PDType0Font.load(doc, new ClassPathResource("fonts/gulimche.ttf").getInputStream()),
"batang", PDType0Font.load(doc, new ClassPathResource("fonts/batang.ttf").getInputStream()),
"batangche", PDType0Font.load(doc, new ClassPathResource("fonts/batangche.ttf").getInputStream()),
"dotum", PDType0Font.load(doc, new ClassPathResource("fonts/dotum.ttf").getInputStream()),
"dotumche", PDType0Font.load(doc, new ClassPathResource("fonts/dotumche.ttf").getInputStream()),
"gungsuh", PDType0Font.load(doc, new ClassPathResource("fonts/gungsuh.ttf").getInputStream()),
"gungsuhche", PDType0Font.load(doc, new ClassPathResource("fonts/gungsuhche.ttf").getInputStream())
);
return fontMap;
} catch (IOException e) {
throw new RuntimeException("글꼴 로드 오류");
}
}
}

@ -15,65 +15,73 @@ public class Advntce extends PDFFormat {
public Advntce(){
addForPost(
image("postSenderLogo","").a4(10, 0).letter(0, 0).size(0, 0),
text("postSenderInst","").a4(10, 5).letter(0, 0),
text("postSenderDept","").a4(50, 5).letter(0, 0),
text("postSenderAddr","").a4(10, 15).letter(0, 0),
text("postSenderDtlAddr","").a4(10, 25).letter(0, 0),
text("postSenderZip","").a4(10, 35).letter(0, 0),
text("postSenderTel","").a4(10, 45).letter(0, 0),
text("postSenderFax","").a4(50, 45).letter(0, 0),
image("postSenderLogo","우편물송신자로고","").a4(10, 0).letter(0, 0).size(0, 0),
text("postSenderInst","우편물송신자기관","").a4(10, 5).letter(0, 0),
text("postSenderDept","우편물송신자부서","").a4(50, 5).letter(0, 0),
text("postSenderAddr","우편물송신자주소","").a4(10, 15).letter(0, 0),
text("postSenderDtlAddr","우편물송신자상세주소","").a4(10, 25).letter(0, 0),
text("postSenderZip","우편물송신자우편번호","").a4(10, 35).letter(0, 0),
text("postSenderTel","우편물송신자전화번호","").a4(10, 45).letter(0, 0),
text("postSenderFax","우편물송신자팩스번호","").a4(50, 45).letter(0, 0),
text("postReceiverAddr","").a4(100, 40).letter(0, 0).size(90, 0).align("right"),
text("postReceiverDtlAddr","").a4(100, 50).letter(0, 0).size(90, 0).align("right"),
text("postReceiver","").a4(100, 60).letter(0, 0).size(90, 0).align("right"),
text("postReceiverZip","").a4(100, 70).letter(0, 0).size(90, 0).align("right")
text("postReceiverAddr","우편물수신자주소","").a4(100, 40).letter(0, 0).size(90, 0).align("right"),
text("postReceiverDtlAddr","우편물수신자상세주소","").a4(100, 50).letter(0, 0).size(90, 0).align("right"),
text("postReceiver","우편물수신자명","").a4(100, 60).letter(0, 0).size(90, 0).align("right"),
text("postReceiverZip","우편물수신자우편번호","").a4(100, 70).letter(0, 0).size(90, 0).align("right")
);
add(
image("background","").a4(0, 0).letter(0, 0).size(0, 0),
image("photo1","").a4(0, 0).letter(0, 0).size(0, 0),
image("photo2","").a4(0, 0).letter(0, 0).size(0, 0),
image("photo3","").a4(0, 0).letter(0, 0).size(0, 0),
image("photo4","").a4(0, 0).letter(0, 0).size(0, 0),
image("background","배경이미지","").a4(0, 0).letter(0, 0).size(0, 0),
image("photo1","단속사진1","").a4(0, 0).letter(0, 0).size(0, 0),
image("photo2","단속사진2","").a4(0, 0).letter(0, 0).size(0, 0),
image("photo3","단속사진3","").a4(0, 0).letter(0, 0).size(0, 0),
image("photo4","단속사진4","").a4(0, 0).letter(0, 0).size(0, 0),
text("rtpyrNm",""),
text("rtpyrNo",""),
text("rtpyrAddr",""),
text("rtpyrDtlAddr",""),
text("rtpyrFullAddr",""),
text("rtpyrNm","수신자명",""),
text("rtpyrNo","수신자번호",""),
text("rtpyrAddr","수신자주소",""),
text("rtpyrDtlAddr","수신자상세주소",""),
text("rtpyrFullAddr","수신자전체주소",""),
text("vhrno",""),
text("crdnYmd",""),
text("crdnYmdTm",""),
text("crdnPlc",""),
text("ffnlgCarmdlNm",""),
text("vltnArtcl",""),
text("vltnLawNm",""),
text("crdnSn",""),
text("vhrno","차량번호",""),
text("crdnYmd","단속일자",""),
text("crdnYmdTm","단속일시",""),
text("crdnPlc","단속장소",""),
text("ffnlgCarmdlNm","차종",""),
text("vltnArtcl","위반내용",""),
text("vltnLawNm","위반법령",""),
text("crdnSn","증거번호",""),
text("amt",""),
text("untilYmd",""),
text("amt","금액",""),
text("untilYmd","납부기한",""),
text("vrActno",""),
text("vrActno1",""),
text("vrActno2",""),
text("vrActno3",""),
text("vrActno4",""),
text("vrActno5",""),
text("vrActno6",""),
text("vrActno7",""),
text("vrActno8",""),
text("vrActno9",""),
text("vrActno10",""),
text("epayNo",""),
text("vrActno","대표가상계좌번호",""),
text("vrActno1","가상계좌번호1",""),
text("vrActno2","가상계좌번호2",""),
text("vrActno3","가상계좌번호3",""),
text("vrActno4","가상계좌번호4",""),
text("vrActno5","가상계좌번호5",""),
text("vrActno6","가상계좌번호6",""),
text("vrActno7","가상계좌번호7",""),
text("vrActno8","가상계좌번호8",""),
text("vrActno9","가상계좌번호9",""),
text("vrActno10","가상계좌번호10",""),
text("epayNo","전자납부번호",""),
text("otptYmd",""),
text("offcsText",""),
image("offcs","").size(20, 20)
text("otptYmd","출력일자",""),
text("otptDt","출력일시",""),
text("otptYYYY","출력년도",""),
text("otptMM","출력월",""),
text("otptDD","출력일",""),
text("offcsText","관인명",""),
image("offcs","관인이미지","").size(20, 20)
);
}
/**
* .
*/
@Override
public String getMappingValue(String otptNm, String defaultValue, boolean forPost,
DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil) {
@ -217,6 +225,9 @@ public class Advntce extends PDFFormat {
return result;
}
/**
* .
*/
@Override
public String getValueForPost(String otptNm, String defaultValue,
DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil) {
@ -263,4 +274,17 @@ public class Advntce extends PDFFormat {
return result;
}
/**
* .
*/
@Override
public DataObject createSampleData() {
DataObject dataObject = new DataObject();
dataObject.put("rtpyrNm", "홍길동");
dataObject.put("rtpyrAddr", "무슨도 무슨시 무슨구");
dataObject.put("rtpyrDtlAddr", "ㅇㅇ아파트 999호");
dataObject.put("rtpyrZip", "12345");
return dataObject;
}
}

@ -0,0 +1,62 @@
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.Component;
import cokr.xit.fims.cmmn.pdf.DefaultOtptStng;
import cokr.xit.fims.cmmn.pdf.PDFFormat;
import cokr.xit.fims.cmmn.pdf.format.Advntce;
import cokr.xit.fims.sprt.OtptStngQuery;
import cokr.xit.fims.sprt.dao.OtptStngMapper;
import cokr.xit.foundation.AbstractComponent;
import cokr.xit.foundation.data.DataObject;
@Component("otptStngBean")
public class OtptStngBean extends AbstractComponent {
@Resource(name = "otptStngMapper")
private OtptStngMapper otptStngMapper;
public Map<String, Object> getOtptStngMap(OtptStngQuery query){
Map<String,Object> otptStngMap = new HashMap<String,Object>();
PDFFormat pdfFormat = null;
switch(query.getSndngSeCd()) {
case "02" :
pdfFormat = new Advntce();
break;
}
List<DataObject> otptStngList = otptStngMapper.selectOtptStngList(query);
if(otptStngList == null) {
otptStngList = new ArrayList<DataObject>();
}
pdfFormat.appendOtptAttribute(otptStngList);
List<DefaultOtptStng> uniquePrototypeList = pdfFormat.getPrototypeStngs(true);
List<DefaultOtptStng> multiplePrototypeList = pdfFormat.getPrototypeStngs(false);
List<DataObject> uniqueDataList = otptStngList.stream().filter(item -> item.string("UNIQUE_YN").equals("Y")).toList();
List<DataObject> multipleDataList = otptStngList.stream().filter(item -> item.string("UNIQUE_YN").equals("N")).toList();
Map<String, Object> unique = new HashMap<String,Object>();
unique.put("prototypeList", uniquePrototypeList);
unique.put("dataList", uniqueDataList);
Map<String, Object> multiple = new HashMap<String,Object>();
multiple.put("prototypeList", multiplePrototypeList);
multiple.put("dataList", multipleDataList);
otptStngMap.put("unique", unique);
otptStngMap.put("multiple", multiple);
return otptStngMap;
}
}

@ -309,17 +309,7 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
PDDocument doc = new PDDocument();//pdf문서 생성
//폰트 로드
Map<String, PDType0Font> fontMap = Map.of(
"notokrBold", PDType0Font.load(doc, new ClassPathResource("fonts/notokr-bold.ttf").getInputStream()),
"gulim", PDType0Font.load(doc, new ClassPathResource("fonts/gulim.ttf").getInputStream()),
"gulimche", PDType0Font.load(doc, new ClassPathResource("fonts/gulimche.ttf").getInputStream()),
"batang", PDType0Font.load(doc, new ClassPathResource("fonts/batang.ttf").getInputStream()),
"batangche", PDType0Font.load(doc, new ClassPathResource("fonts/batangche.ttf").getInputStream()),
"dotum", PDType0Font.load(doc, new ClassPathResource("fonts/dotum.ttf").getInputStream()),
"dotumche", PDType0Font.load(doc, new ClassPathResource("fonts/dotumche.ttf").getInputStream()),
"gungsuh", PDType0Font.load(doc, new ClassPathResource("fonts/gungsuh.ttf").getInputStream()),
"gungsuhche", PDType0Font.load(doc, new ClassPathResource("fonts/gungsuhche.ttf").getInputStream())
);
Map<String, PDType0Font> fontMap = pdfPrintUtil.getFontMap(doc);
//용지 크기 설정
PDRectangle paper = null;
@ -345,7 +335,7 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
if(formatName.equals("advntce")) {
pdfFormat = new Advntce();
}
List<DefaultOtptStng> predefinedList = pdfFormat.getDefaultOtptStng();
List<DefaultOtptStng> prototypeStngList = pdfFormat.getPrototypeStngs();
otptStngQuery.setSndngSeCd(sndngSeCd);
otptStngQuery.setOtptPaperSeCd(otptPaperSeCd);
@ -368,27 +358,27 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
for(DataObject otptItemStng : otptStng) {
String otptNm = otptItemStng.string("OTPT_NM");
DefaultOtptStng predefined = predefinedList.stream()
DefaultOtptStng prototypeStng = prototypeStngList.stream()
.filter(item -> item.getOtptNm().equals(otptNm)).toList().get(0);
float[] pstn = pdfPrintUtil.getPstnStng(predefined, otptItemStng, otptPaperSeCd);
float[] size = pdfPrintUtil.getSize(predefined, otptItemStng);
float[] pstn = pdfPrintUtil.getPstnStng(prototypeStng, otptItemStng, otptPaperSeCd);
float[] size = pdfPrintUtil.getSize(prototypeStng, otptItemStng);
boolean forPost = predefined.isForPost();
String defaultValue = predefined.getOtptBscVl();
boolean forPost = prototypeStng.isForPost();
String defaultValue = prototypeStng.getOtptBscVl();
if(predefined.getContentType().equals("text")) {
String align = pdfPrintUtil.getAlign(predefined, otptItemStng);
PDType0Font font = pdfPrintUtil.getFontType(predefined, otptItemStng, fontMap);
int fontSz = pdfPrintUtil.getFontSize(predefined, otptItemStng);
RenderingMode fontStyle = pdfPrintUtil.getFontStyle(predefined, otptItemStng);
PDColor fontColor = pdfPrintUtil.getFontColor(predefined, otptItemStng);
if(prototypeStng.getComponentType().equals("text")) {
String align = pdfPrintUtil.getAlign(prototypeStng, otptItemStng);
PDType0Font font = pdfPrintUtil.getFontType(prototypeStng, otptItemStng, fontMap);
int fontSz = pdfPrintUtil.getFontSize(prototypeStng, otptItemStng);
RenderingMode fontStyle = pdfPrintUtil.getFontStyle(prototypeStng, otptItemStng);
PDColor fontColor = pdfPrintUtil.getFontColor(prototypeStng, otptItemStng);
String textValue = pdfFormat.getMappingValue(otptNm,defaultValue,forPost,dataObject,printOption,pdfPrintUtil);
pdfPrintUtil.writeText(contentStream, textValue, pstn, size[0], align, font, fontSz, fontStyle, fontColor);
} else if(predefined.getContentType().equals("image")) {
} else if(prototypeStng.getComponentType().equals("image")) {
String imagePath = pdfFormat.getMappingValue(otptNm,defaultValue,forPost,dataObject,printOption,pdfPrintUtil);

@ -17,9 +17,11 @@ 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.OtptStngQuery;
import cokr.xit.fims.sprt.PrintOption;
import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.fims.sprt.service.Sprt01Service;
import cokr.xit.fims.sprt.service.bean.OtptStngBean;
import cokr.xit.foundation.data.DataObject;
/**
@ -53,7 +55,10 @@ public class Sprt01Controller extends ApplicationController {
makeRcvmtConfirmFileFromHwpFormat = "/130/makeRcvmtConfirmFileFromHwpFormat.do",
printAdvntceMain = "/140/info.do",
makeAdvntcePdf = "/140/makeAdvntcePdf.do",
makeAdvntceOutsourcing = "/140/makeAdvntceOutsourcing.do"
makeAdvntceOutsourcing = "/140/makeAdvntceOutsourcing.do",
otptStngMain = "/200/main.do",
getOtptStngInfo = "/200/info.do"
;
}
@ -67,6 +72,9 @@ public class Sprt01Controller extends ApplicationController {
@Resource(name="userMapper")
protected UserMapper userMapper;
@Resource(name="otptStngBean")
protected OtptStngBean otptStngBean;
/** (fims/sprt/sprt01/010-main) .
*
* @return /fims/sprt/sprt01010
@ -405,4 +413,37 @@ public class Sprt01Controller extends ApplicationController {
return mav;
}
/** .
* @return
*/
public ModelAndView otptStngMain() {
ModelAndView mav = new ModelAndView("fims/sprt/sprt01200-main");
mav.addObject("pageName", "sprt01200-main");
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM054","FIM047","FIM078");
mav.addObject("FIM047List", commonCodes.get("FIM047"));
mav.addObject("FIM054List", commonCodes.get("FIM054"));
mav.addObject("FIM078List", commonCodes.get("FIM078"));
addCodes(commonCodes, mav, "FIM047", "FIM054", "FIM078");
return mav;
}
/** .
* @return
*/
public ModelAndView getOtptStngInfo(OtptStngQuery otptStngQuery) {
ModelAndView mav = new ModelAndView("jsonView");
Map<String,Object> otptStngMap = otptStngBean.getOtptStngMap(otptStngQuery);
mav.addObject("otptStngMap", otptStngMap);
return mav;
}
}

@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.sprt.OtptStngQuery;
import cokr.xit.fims.sprt.PrintOption;
import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.fims.stat.StatQuery;
@ -422,6 +423,18 @@ public class CmnController {
return super.makeAdvntceOutsourcing(printOption, crdnIds);
}
@Override
@RequestMapping(name="출력물 설정 메인 화면", value=METHOD_URL.otptStngMain)
public ModelAndView otptStngMain() {
return super.otptStngMain();
}
@Override
@RequestMapping(name="출력물 설정 정보 조회", value=METHOD_URL.getOtptStngInfo)
public ModelAndView getOtptStngInfo(OtptStngQuery otptStngQuery) {
return super.getOtptStngInfo(otptStngQuery);
}
}
@Controller

@ -10,6 +10,7 @@
<div class="float-start">
<button type="button" id="btnPrintAdvntcePdf--${pageName}" class="btn btn-info">사전통보서출력(PDF)</button>
<button type="button" id="btnPrintAdvntceOutsourcing--${pageName}" class="btn btn-info">사전통보서출력(외주파일)</button>
<button type="button" id="btnOpenOtptStng--${pageName}" class="btn btn-primary">설정</button>
</div>
</div>
</div>
@ -152,9 +153,51 @@ $(document).ready(function(){
});
}
$P.fnOpenOtptStng = () => {
var fix = "";
if($P.provided.isAllSameTask($P.crdnIds)){
var sample = $P.crdnIds[0]; //체크된것중첫번째
fix = $P.provided.getInfo(sample).TASK_SE_CD;
}
var url = wctx.url("/sprt/sprt01/200/main.do");
var dialogId = "otptStngDialog";
ajax.post({
url : url,
data : {},
success : (resp) => {
dialog.open({
id : dialogId
, title : "출력설정"
, size : "xxl"
, content : resp
, init : () => {
$("#"+dialogId).find("input[name='dialogId']").val(dialogId);
$("#"+dialogId).find("form[name='frmSearch']").find("[name='sggCd']").val(MY_INFO.info.sggCd);
if(fix != ""){
var taskSeSelectbox = $("#"+dialogId).find("form[name='frmSearch']").find("[name='taskSeCd']");
taskSeSelectbox.val(fix);
taskSeSelectbox.attr("disabled","disabled");
}
}
, onClose : () => { }
});
}
});
}
//버튼이벤트
$("#btnPrintAdvntcePdf--${pageName}").on("click", () => $P.fnMakeFile('pdf') );
$("#btnPrintAdvntceOutsourcing--${pageName}").on("click", () => $P.fnMakeFile('outsourcing') );
$("#btnOpenOtptStng--${pageName}").on("click", () => $P.fnOpenOtptStng() );
//첫번째 줄 클릭
$("#tbody--${pageName}").find("tr:eq(0)").click();

@ -0,0 +1,322 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<c:set var="prefixName" scope="request">출력설정</c:set>
<div class="d-flex flex-row justify-content-evenly">
<div class="card p-3">
<div class="row mb-3 justify-content-start">
<div class="col-md-12">
<div class="float-start">
<form id="frmSearch--${pageName}" name="frmSearch">
<input type="hidden" name="sggCd" />
업무
<select class="form-select" name="taskSeCd">
<c:forEach items="${FIM054List}" var="item">
<option value="${item.code}">${item.value}</option>
</c:forEach>
</select>
출력물
<select class="form-select" name="sndngSeCd">
<option value="02">사전통지서</option>
</select>
용지
<select class="form-select" name="otptPaperSeCd">
<c:forEach items="${FIM078List}" var="item">
<option value="${item.code}">${item.value}</option>
</c:forEach>
</select>
<button type="button" id="btnLoad--${pageName}" class="btn btn-primary">불러오기</button>
</form>
</div>
<div class="float-end">
<button type="button" id="btnSave--${pageName}" class="btn btn-primary">저장</button>
</div>
</div>
</div>
<h3 id="currentOtpt--${pageName}" class="bg-lighter" style="min-height:30px;">
</h3>
<div class="row mb-3 justify-content-start">
<div class="col-md-12">
<div class="float-start">
<button type="button" id="btnUniqueAdd--${pageName}" class="btn btn-info">추가</button>
<button type="button" id="btnUniqueDel--${pageName}" class="btn btn-info">삭제</button>
</div>
</div>
</div>
<div class="card-datatable text-nowrap mb-3">
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
<div class="table-responsive"
style="overflow-x:scroll; height:300px; overflow-y:scroll;" >
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer"
id="tableUnique--${pageName}" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr id="theadTrUnique--${pageName}">
<th style="width:200px">출력항목명</th>
<th style="width:120px">텍스트/이미지</th>
<th style="width:120px">위치(좌)</th>
<th style="width:120px">위치(상)</th>
<th style="width:120px">사이즈(좌우)</th>
<th style="width:120px">사이즈(상하)</th>
<th style="width:120px">텍스트정렬</th>
<th style="width:120px">글꼴</th>
<th style="width:120px">글꼴크기</th>
<th style="width:120px">글꼴색</th>
<th style="width:120px">글꼴스타일</th>
</tr>
</thead>
<tbody id="tbodyUnique--${pageName}">
</tbody>
<template id="foundUnique--${pageName}">
<tr data-key="{OTPT_FORM_ID}">
<td>
<input type="text" readonly />
</td>
<td>
<input type="text" readonly />
</td>
<td>
<input type="number" min="0" max="300" />
</td>
<td>
<input type="number" min="0" max="300" />
</td>
<td>
<input type="number" min="0" max="300" />
</td>
<td>
<input type="number" min="0" max="300" />
</td>
<td>
<select>
<option value="left">왼쪽</option>
<option value="center">중앙</option>
<option value="right">오른쪽</option>
</select>
</td>
<td>
<select>
<option value="gulimche">굴림체</option>
<option value="gulim">굴림</option>
<option value="batangche">바탕체</option>
<option value="batang">바탕</option>
<option value="dotumche">돋움체</option>
<option value="dotum">돋움</option>
<option value="gungsuhche">궁서체</option>
<option value="gungsuh">궁서</option>
</select>
</td>
<td>
<select>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
</select>
</td>
<td>
<select>
<option value="BLACK">검정</option>
<option value="RED">빨강</option>
<option value="ORANGE">주황</option>
<option value="YELLOW">노랑</option>
<option value="YELLOW_GREEN">연두</option>
<option value="GREEN">초록</option>
<option value="CYAN">청록</option>
<option value="BLUE">파랑</option>
<option value="VIOLET">보라</option>
<option value="MAGENTA">마젠타</option>
<option value="DEEP_PINK">짙은분홍</option>
<option value="LIGHT_GREY">밝은회색</option>
<option value="GREY">회색</option>
<option value="DARK_GREY">어두운회색</option>
<option value="WHITE">하양</option>
</select>
</td>
<td>
<select>
<option value="FILL">일반</option>
<option value="FILL_STROKE">굵게</option>
</select>
</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<div class="row mb-3 justify-content-start">
<div class="col-md-12">
<div class="float-start">
<button type="button" id="btnMultipleAdd--${pageName}" class="btn btn-info">추가</button>
<button type="button" id="btnMultipleDel--${pageName}" class="btn btn-info">삭제</button>
</div>
</div>
</div>
<div class="card-datatable text-nowrap mb-3">
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
<div class="table-responsive"
style="overflow-x:scroll; height:300px; overflow-y:scroll;" >
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer"
id="tableMultiple--${pageName}" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr id="theadTrMultiple--${pageName}">
<th style="width:200px">출력항목명</th>
<th style="width:120px">텍스트/이미지</th>
<th style="width:120px">위치(좌)</th>
<th style="width:120px">위치(상)</th>
<th style="width:120px">사이즈(좌우)</th>
<th style="width:120px">사이즈(상하)</th>
<th style="width:120px">텍스트정렬</th>
<th style="width:120px">글꼴</th>
<th style="width:120px">글꼴크기</th>
<th style="width:120px">글꼴색</th>
<th style="width:120px">글꼴스타일</th>
</tr>
</thead>
<tbody id="tbodyMultiple--${pageName}">
</tbody>
<template id="foundMultiple--${pageName}">
<tr data-key="{OTPT_FORM_ID}">
<td>
<select></select>
</td>
<td>
<input type="text" readonly />
</td>
<td>
<input type="number" min="0" max="300" />
</td>
<td>
<input type="number" min="0" max="300" />
</td>
<td>
<input type="number" min="0" max="300" />
</td>
<td>
<input type="number" min="0" max="300" />
</td>
<td>
<select>
<option value="left">왼쪽</option>
<option value="center">중앙</option>
<option value="right">오른쪽</option>
</select>
</td>
<td>
<select>
<option value="gulimche">굴림체</option>
<option value="gulim">굴림</option>
<option value="batangche">바탕체</option>
<option value="batang">바탕</option>
<option value="dotumche">돋움체</option>
<option value="dotum">돋움</option>
<option value="gungsuhche">궁서체</option>
<option value="gungsuh">궁서</option>
</select>
</td>
<td>
<select>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
</select>
</td>
<td>
<select>
<option value="BLACK">검정</option>
<option value="RED">빨강</option>
<option value="ORANGE">주황</option>
<option value="YELLOW">노랑</option>
<option value="YELLOW_GREEN">연두</option>
<option value="GREEN">초록</option>
<option value="CYAN">청록</option>
<option value="BLUE">파랑</option>
<option value="VIOLET">보라</option>
<option value="MAGENTA">마젠타</option>
<option value="DEEP_PINK">짙은분홍</option>
<option value="LIGHT_GREY">밝은회색</option>
<option value="GREY">회색</option>
<option value="DARK_GREY">어두운회색</option>
<option value="WHITE">하양</option>
</select>
</td>
<td>
<select>
<option value="FILL">일반</option>
<option value="FILL_STROKE">굵게</option>
</select>
</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<form id="frmEdit--${pageName}" name="frmEdit">
<input type="hidden" name="sggCd" />
<input type="hidden" name="taskSeCd" />
<input type="hidden" name="sndngSeCd" />
<input type="hidden" name="otptPaperSeCd" />
<input type="text" name="dialogId" hidden />
</form>
<span id="tempArea--${pageName}" hidden></span>
</div>
</div>
<script>
pageObject["${pageName}"] = {};
$(document).ready(function(){
var $P = pageObject["${pageName}"];
$P.fnLoad = () => {
var ff = new FimsFormFields("#frmSearch--${pageName}");
ajax.post({
url : wctx.url("/sprt/sprt01/200/info.do"),
data : ff.get(),
success : (resp) => {
}
});
}
$P.fnSave = () => {
}
$("#btnLoad--${pageName}").on("click", () => $P.fnLoad() );
$("#btnSave--${pageName}").on("click", () => $P.fnSave() );
});
</script>

@ -98,6 +98,15 @@
break;
}
var MY_INFO = {};
ajax.get({
url:wctx.url("/user/myInfo.do"),
data:{},
success:resp => {
MY_INFO = resp.myInfo;
}
});
${functions}
${topScript}

Loading…
Cancel
Save