|
|
@ -1,6 +1,6 @@
|
|
|
|
package cokr.xit.fims.crdn.web;
|
|
|
|
package cokr.xit.fims.crdn.web;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
@ -9,15 +9,17 @@ import javax.annotation.Resource;
|
|
|
|
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.Crdn;
|
|
|
@ -62,6 +64,9 @@ public class Crdn06Controller extends ApplicationController {
|
|
|
|
@Resource(name="globalStngMapper")
|
|
|
|
@Resource(name="globalStngMapper")
|
|
|
|
protected GlobalStngMapper globalStngMapper;
|
|
|
|
protected GlobalStngMapper globalStngMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource(name = "fileBean")
|
|
|
|
|
|
|
|
private FileBean fileBean;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource(name = "stngBean")
|
|
|
|
@Resource(name = "stngBean")
|
|
|
|
private StngBean stngBean;
|
|
|
|
private StngBean stngBean;
|
|
|
|
|
|
|
|
|
|
|
@ -100,7 +105,12 @@ public class Crdn06Controller 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")
|
|
|
@ -111,19 +121,42 @@ public class Crdn06Controller extends ApplicationController {
|
|
|
|
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss();
|
|
|
|
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss();
|
|
|
|
|
|
|
|
|
|
|
|
List<DataObject> list = crdnService.getCrackdownList(query.setFetchSize(0));
|
|
|
|
List<DataObject> list = crdnService.getCrackdownList(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>();
|
|
|
|
|
|
|
|
valueMap.put("자료출처", xlsx.style("CRDN_INPT_SE_NM", center));
|
|
|
|
|
|
|
|
valueMap.put("위반일시", xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
|
|
|
|
|
|
|
|
valueMap.put("사진건수", xlsx.style("ATCH_FILE_CNT", center));
|
|
|
|
|
|
|
|
valueMap.put("장애차량확인", xlsx.style("PARKNG_PSBLTY_RSLT_NM", center));
|
|
|
|
|
|
|
|
valueMap.put("처리상태", xlsx.style("CRDN_STTS_NM", center));
|
|
|
|
|
|
|
|
valueMap.put("제외사유", xlsx.style("LEVY_EXCL_RSN_NM", center));
|
|
|
|
|
|
|
|
valueMap.put("제외처리일자", xlsx.format(o -> xlsx.str2date(o.get("LEVY_EXCL_YMD"))).style(dateYMD));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(
|
|
|
|
CellDef.setValues(cellDefs, valueMap);
|
|
|
|
cellDefs,
|
|
|
|
|
|
|
|
Map.of(
|
|
|
|
|
|
|
|
"자료출처", xlsx.style("CRDN_INPT_SE_NM", center),
|
|
|
|
|
|
|
|
"위반일시", xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT),
|
|
|
|
|
|
|
|
"사진건수", xlsx.style("ATCH_FILE_CNT", center),
|
|
|
|
|
|
|
|
"장애차량확인", xlsx.style("PARKNG_PSBLTY_RSLT_NM", center),
|
|
|
|
|
|
|
|
"처리상태", xlsx.style("CRDN_STTS_NM", center),
|
|
|
|
|
|
|
|
"제외사유", xlsx.style("LEVY_EXCL_RSN_NM", center),
|
|
|
|
|
|
|
|
"제외처리일자", xlsx.format(o -> xlsx.str2date(o.get("LEVY_EXCL_YMD"))).style(dateYMD)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xlsx.cell(0, 0)
|
|
|
|
xlsx.cell(0, 0)
|
|
|
|
.value("단속자료 목록", center)
|
|
|
|
.value("단속자료 목록", center)
|
|
|
|