단속동영상파일 inf_type, inf_key 변경

main
이범준 1 year ago
parent 4964e183e6
commit 15de49ca58

@ -16,19 +16,17 @@ public class CrdnQuery extends CmmnQuery {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String view; private String view;
private String grid; private String grid;
private String inspectionDataType;
private String currentUserId; private String currentUserId;
private String currentInstitute; private String currentInstitute;
private String inspectionDataType;
private String crdnId; private String crdnId;
private String[] crdnIDs; private String[] crdnIDs;
private String vhrno; private String vhrno;
private String cvlcptPrcsPicNm; private String cvlcptPrcsPicNm;
private String schCvlcptRcptYmdFrom; private String schCvlcptRcptYmdFrom;
private String schCvlcptRcptYmdTo; private String schCvlcptRcptYmdTo;

@ -5,9 +5,11 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.assertj.core.util.Arrays;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ResourceUtils; import org.springframework.util.ResourceUtils;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -23,6 +25,7 @@ import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn01Mapper; import cokr.xit.fims.crdn.dao.Crdn01Mapper;
import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.fims.sprt.Sprt;
import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
import kr.dogfoot.hwplib.object.HWPFile; import kr.dogfoot.hwplib.object.HWPFile;
@ -146,6 +149,10 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic
List<DataObject> fileInfoList = fileService.getFileList(fileQuery); List<DataObject> fileInfoList = fileService.getFileList(fileQuery);
fileInfoList = fileInfoList.stream()
.filter(fileInfo -> fileInfo.string("MIME_TYPE").startsWith("image"))
.collect(Collectors.toList());
if(fileInfoList != null && fileInfoList.size() > 0) { if(fileInfoList != null && fileInfoList.size() > 0) {
int photoCnt = fileInfoList.size(); int photoCnt = fileInfoList.size();
int PHOTO_COUNT_PER_PAGE = 4; int PHOTO_COUNT_PER_PAGE = 4;
@ -185,24 +192,41 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic
} }
public DataObject getCivilComplaintReceiptInitialDataInfo(CrdnQuery req) { public DataObject getCivilComplaintReceiptInitialDataInfo(CrdnQuery req) {
//민원조회
DataObject dataObject = crdn01Mapper.selectCivilComplaintReceiptInitialDataInfo(req); DataObject dataObject = crdn01Mapper.selectCivilComplaintReceiptInitialDataInfo(req);
//첨부파일 조회
FileQuery fileQuery = new FileQuery(); FileQuery fileQuery = new FileQuery();
fileQuery.setInfoKeys(dataObject.string("CRDN_ID")); fileQuery.setInfoType(Crdn.INF_TYPE);
fileQuery.setInfoType("190");
List<DataObject> fileList = fileService.getFileList(fileQuery); List<DataObject> fileList = fileService.getFileList(fileQuery);
if(fileList != null && !fileList.isEmpty()) { if(fileList != null && !fileList.isEmpty()) {
dataObject.set("videoExist", "Y"); dataObject.set("fileList", fileList);
} else {
dataObject.set("videoExist", "N");
} }
//동영상 존재 여부 확인
dataObject.set("videoExist", "N");
String linkTblNm = dataObject.string("LINK_TBL_NM");
if(!linkTblNm.equals("")) {
fileQuery.setInfoType(Crdn.INF_TYPE); if(linkTblNm.equals("TB_ESB_INTERFACE")) {
fileList = fileService.getFileList(fileQuery); fileQuery.setInfoType("010");
} else if(linkTblNm.equals("TB_SAEOL")) {
fileQuery.setInfoType("020");
} else {
throw new RuntimeException("파일 조회 중 오류가 발생하였습니다.");
}
if(fileList != null && !fileList.isEmpty()) { fileQuery.setInfoKeys(dataObject.string("LINK_ID"));
dataObject.set("fileList", fileList); List<DataObject> linkFileList = fileService.getFileList(fileQuery);
if(linkFileList != null && !linkFileList.isEmpty()) {
for(int i=0; i < linkFileList.size(); i++) {
String mimeType = linkFileList.get(i).string("MIME_TYPE");
if(Arrays.asList(Sprt.VIDEO_MIME_TYPE).contains(mimeType)) {
dataObject.set("videoExist", "Y");
}
}
}
} }
return dataObject; return dataObject;

@ -11,4 +11,8 @@ import lombok.Setter;
@Setter @Setter
public class Sprt extends AbstractEntity { public class Sprt extends AbstractEntity {
public static String[] VIDEO_MIME_TYPE = {
"video/mp4", "video/webm", "video/ogg"
};
} }

@ -0,0 +1,18 @@
package cokr.xit.fims.sprt.service;
import cokr.xit.foundation.data.DataObject;
/** .
* <ul><li>{@link #getVideoInfo(SprtQuery) }</li>
* </ul>
* @author leebj
*/
public interface Sprt03Service {
/** .
* @param crdnId
* @return
*/
DataObject getVideoInfo(String crdnId);
}

@ -0,0 +1,67 @@
package cokr.xit.fims.sprt.service.bean;
import java.util.List;
import javax.annotation.Resource;
import org.assertj.core.util.Arrays;
import org.springframework.stereotype.Service;
import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.FileService;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn01Mapper;
import cokr.xit.fims.sprt.Sprt;
import cokr.xit.fims.sprt.service.Sprt03Service;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject;
/**
* @author leebj
*/
@Service("sprt03Service")
public class Sprt03ServiceBean extends AbstractServiceBean implements Sprt03Service {
@Resource(name = "crdn01Mapper")
private Crdn01Mapper crdn01Mapper;
@Resource(name="fileService")
FileService fileService;
@Override
public DataObject getVideoInfo(String crdnId) {
DataObject fileInfo = new DataObject();
CrdnQuery crdnQuery = new CrdnQuery();
crdnQuery.setCrdnId(crdnId);
DataObject cvlcptInfo = crdn01Mapper.selectCivilComplaintReceiptInitialDataInfo(crdnQuery);
String linkTblNm = cvlcptInfo.string("LINK_TBL_NM");
if(!linkTblNm.equals("")) {
FileQuery fileQuery = new FileQuery();
if(linkTblNm.equals("TB_ESB_INTERFACE")) {
fileQuery.setInfoType("010");
} else if(linkTblNm.equals("TB_SAEOL")) {
fileQuery.setInfoType("020");
} else {
throw new RuntimeException("파일 조회 중 오류가 발생하였습니다.");
}
fileQuery.setInfoKeys(cvlcptInfo.string("LINK_ID"));
List<DataObject> fileList = fileService.getFileList(fileQuery);
if(fileList != null && !fileList.isEmpty()) {
for(int i=0; i < fileList.size() ;i++) {
DataObject file = fileList.get(i);
String mimeType = file.string("MIME_TYPE");
if(Arrays.asList(Sprt.VIDEO_MIME_TYPE).contains(mimeType)){
fileInfo = file;
break;
}
}
}
}
return fileInfo;
}
}

@ -4,12 +4,12 @@ import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.assertj.core.util.Arrays;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.file.service.FileQuery; import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.FileService; import cokr.xit.base.file.service.FileService;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.sprt.service.Sprt03Service;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
public class Sprt03Controller extends ApplicationController { public class Sprt03Controller extends ApplicationController {
@ -17,10 +17,8 @@ public class Sprt03Controller extends ApplicationController {
@Resource(name="fileService") @Resource(name="fileService")
FileService fileService; FileService fileService;
public String VIDEO_INF_TYPE = "190"; @Resource(name="sprt03Service")
public String[] VIDEO_MIME_TYPE = { Sprt03Service sprt03Service;
"video/mp4", "video/webm", "video/ogg"
};
/** . /** .
* @return fims/sprt/sprt03010-main * @return fims/sprt/sprt03010-main
@ -33,20 +31,9 @@ public class Sprt03Controller extends ApplicationController {
if(crdnId != null && !crdnId.equals("")) { if(crdnId != null && !crdnId.equals("")) {
mav.addObject("crdnId", crdnId); mav.addObject("crdnId", crdnId);
DataObject file = sprt03Service.getVideoInfo(crdnId);
FileQuery fileQuery = new FileQuery(); if(!file.isEmpty()) {
fileQuery.setInfoKeys(crdnId);
fileQuery.setInfoType(VIDEO_INF_TYPE);
List<DataObject> fileList = fileService.getFileList(fileQuery);
if(fileList != null && !fileList.isEmpty()) {
for(int i=0; i < fileList.size() ;i++) {
DataObject file = fileList.get(i);
String mimeType = file.string("MIME_TYPE");
if(Arrays.asList(VIDEO_MIME_TYPE).contains(mimeType)){
mav.addObject("fileInfo", toJson(file)); mav.addObject("fileInfo", toJson(file));
break;
}
}
} }
} }

@ -350,6 +350,8 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
, C.VHCL_COLOR <!-- 차량색상 --> , C.VHCL_COLOR <!-- 차량색상 -->
, C.USE_FUEL_CD <!-- 사용 연료 코드 --> , C.USE_FUEL_CD <!-- 사용 연료 코드 -->
, C.VIN <!-- 차대번호 --> , C.VIN <!-- 차대번호 -->
, C.LINK_TBL_NM <!-- 연계 테이블 명 -->
, C.LINK_ID <!-- 연계 아이디 -->
FROM TB_CRDN C FROM TB_CRDN C
INNER JOIN TB_CRDN_CVLCPT CC ON (C.CRDN_ID = CC.CRDN_ID AND CC.DEL_YN = 'N') INNER JOIN TB_CRDN_CVLCPT CC ON (C.CRDN_ID = CC.CRDN_ID AND CC.DEL_YN = 'N')
LEFT OUTER JOIN TB_PAYER P ON (C.RTPYR_ID = P.RTPYR_ID) LEFT OUTER JOIN TB_PAYER P ON (C.RTPYR_ID = P.RTPYR_ID)

Loading…
Cancel
Save