|
|
@ -1,6 +1,5 @@
|
|
|
|
package cokr.xit.fims.cvlc.web;
|
|
|
|
package cokr.xit.fims.cvlc.web;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
@ -11,17 +10,20 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
|
import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cokr.xit.base.code.CommonCode;
|
|
|
|
import cokr.xit.base.code.CommonCode;
|
|
|
|
|
|
|
|
import cokr.xit.base.file.service.FileQuery;
|
|
|
|
|
|
|
|
import cokr.xit.base.file.service.bean.FileBean;
|
|
|
|
import cokr.xit.base.file.xls.XLSWriter;
|
|
|
|
import cokr.xit.base.file.xls.XLSWriter;
|
|
|
|
import cokr.xit.base.file.xls.XLSWriter.CellDef;
|
|
|
|
import cokr.xit.base.file.xls.XLSWriter.CellDef;
|
|
|
|
|
|
|
|
import cokr.xit.base.file.xls.XLSWriter.CommentSupport;
|
|
|
|
import cokr.xit.base.file.xls.XLSWriter.Styler;
|
|
|
|
import cokr.xit.base.file.xls.XLSWriter.Styler;
|
|
|
|
import cokr.xit.base.user.ManagedUser;
|
|
|
|
import cokr.xit.base.user.ManagedUser;
|
|
|
|
import cokr.xit.base.user.dao.UserMapper;
|
|
|
|
import cokr.xit.base.user.dao.UserMapper;
|
|
|
|
import cokr.xit.base.web.ApplicationController;
|
|
|
|
import cokr.xit.base.web.ApplicationController;
|
|
|
|
|
|
|
|
import cokr.xit.fims.cmmn.CellDecorator;
|
|
|
|
import cokr.xit.fims.cmmn.CmmnUtil;
|
|
|
|
import cokr.xit.fims.cmmn.CmmnUtil;
|
|
|
|
import cokr.xit.fims.cmmn.service.bean.StngBean;
|
|
|
|
import cokr.xit.fims.cmmn.service.bean.StngBean;
|
|
|
|
|
|
|
|
import cokr.xit.fims.crdn.Crdn;
|
|
|
|
import cokr.xit.fims.crdn.CrdnQuery;
|
|
|
|
import cokr.xit.fims.crdn.CrdnQuery;
|
|
|
|
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
|
|
|
|
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
|
|
|
|
import cokr.xit.fims.crdn.service.CrdnService;
|
|
|
|
import cokr.xit.fims.crdn.service.CrdnService;
|
|
|
@ -63,6 +65,9 @@ public class Cvlc02Controller extends ApplicationController {
|
|
|
|
@Resource(name = "stngBean")
|
|
|
|
@Resource(name = "stngBean")
|
|
|
|
private StngBean stngBean;
|
|
|
|
private StngBean stngBean;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource(name = "fileBean")
|
|
|
|
|
|
|
|
private FileBean fileBean;
|
|
|
|
|
|
|
|
|
|
|
|
/** 민원 답변 대상 자료 메인화면을 연다.
|
|
|
|
/** 민원 답변 대상 자료 메인화면을 연다.
|
|
|
|
* @return fims/cvlc/cvlc02010-main
|
|
|
|
* @return fims/cvlc/cvlc02010-main
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -95,7 +100,12 @@ public class Cvlc02Controller extends ApplicationController {
|
|
|
|
query.setSggCd(sggCd);
|
|
|
|
query.setSggCd(sggCd);
|
|
|
|
|
|
|
|
|
|
|
|
if("xls".equals(query.getDownload())) {
|
|
|
|
if("xls".equals(query.getDownload())) {
|
|
|
|
ArrayList<CellDef> cellDefs = fromJson(query.getCellDefs(), new TypeReference<ArrayList<CellDef>>() {});
|
|
|
|
List<CellDef> cellDefs = fromJson(query.getCellDefs(), CellDef.listType());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(ifEmpty(query.getIncludePhoto(), () -> "").equals("Y")) {
|
|
|
|
|
|
|
|
cellDefs.add((new CellDef()).setLabel("사진1").setWidth(18).setField("CRDN_PHOTO_PATH1"));
|
|
|
|
|
|
|
|
cellDefs.add((new CellDef()).setLabel("사진2").setWidth(18).setField("CRDN_PHOTO_PATH2"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
XLSWriter xlsx = new XLSWriter()
|
|
|
|
XLSWriter xlsx = new XLSWriter()
|
|
|
|
.setFilename("민원답변대상자료 목록.xlsx")
|
|
|
|
.setFilename("민원답변대상자료 목록.xlsx")
|
|
|
@ -107,6 +117,21 @@ public class Cvlc02Controller extends ApplicationController {
|
|
|
|
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss();
|
|
|
|
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss();
|
|
|
|
|
|
|
|
|
|
|
|
List<DataObject> list = crdnCvlcptService.getCivilComplaintList(query.setFetchSize(0));
|
|
|
|
List<DataObject> list = crdnCvlcptService.getCivilComplaintList(query.setFetchSize(0));
|
|
|
|
|
|
|
|
if(ifEmpty(query.getIncludePhoto(), () -> "").equals("Y")) {
|
|
|
|
|
|
|
|
for(DataObject crdn : list) {
|
|
|
|
|
|
|
|
String crdnId = crdn.string("CRDN_ID");
|
|
|
|
|
|
|
|
FileQuery fileQuery = new FileQuery();
|
|
|
|
|
|
|
|
fileQuery.setInfoType(Crdn.INF_TYPE);
|
|
|
|
|
|
|
|
fileQuery.setInfoKeys(crdnId);
|
|
|
|
|
|
|
|
List<DataObject> fileInfoList = fileBean.getFileList(fileQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(fileInfoList != null && fileInfoList.size() > 0) {
|
|
|
|
|
|
|
|
for(int j=0; (j < fileInfoList.size()) && (j < 2); j++) {
|
|
|
|
|
|
|
|
crdn.set("CRDN_PHOTO_PATH"+(j+1), fileInfoList.get(j).string("FILE_PATH"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> valueMap = new HashMap<String, Object>();
|
|
|
|
Map<String, Object> valueMap = new HashMap<String, Object>();
|
|
|
|
valueMap.put("접수번호", xlsx.style("CVLCPT_RCPT_NO", center));
|
|
|
|
valueMap.put("접수번호", xlsx.style("CVLCPT_RCPT_NO", center));
|
|
|
@ -127,6 +152,17 @@ public class Cvlc02Controller extends ApplicationController {
|
|
|
|
valueMap.put("차량번호", "VHRNO");
|
|
|
|
valueMap.put("차량번호", "VHRNO");
|
|
|
|
valueMap.put("서손/계고사유", xlsx.style("LEVY_EXCL_RSN_NM", center));
|
|
|
|
valueMap.put("서손/계고사유", xlsx.style("LEVY_EXCL_RSN_NM", center));
|
|
|
|
valueMap.put("특기사항", "ETC_CN");
|
|
|
|
valueMap.put("특기사항", "ETC_CN");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(ifEmpty(query.getIncludePhoto(), () -> "").equals("Y")) {
|
|
|
|
|
|
|
|
CommentSupport commentSupport = new CommentSupport(xlsx);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CellDecorator col1 = CmmnUtil.photoCellForApproval(commentSupport, "CRDN_PHOTO_PATH1");
|
|
|
|
|
|
|
|
CellDecorator col2 = CmmnUtil.photoCellForApproval(commentSupport, "CRDN_PHOTO_PATH2");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
valueMap.put("사진1", xlsx.format(col1.value()).onCell(col1.memo()));
|
|
|
|
|
|
|
|
valueMap.put("사진2", xlsx.format(col2.value()).onCell(col2.memo()));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CellDef.setValues(cellDefs, valueMap);
|
|
|
|
CellDef.setValues(cellDefs, valueMap);
|
|
|
|
|
|
|
|
|
|
|
|
xlsx.cell(0, 0)
|
|
|
|
xlsx.cell(0, 0)
|
|
|
|