단속사진 등록 추가

main
이범준 1 year ago
parent d59c670ec9
commit 8031c39051

@ -10,6 +10,8 @@ import lombok.Setter;
@Getter
@Setter
public class Crdn extends AbstractEntity {
public static String INF_TYPE = "100";
/**
*
*/

@ -1,7 +1,9 @@
package cokr.xit.fims.crdn.service;
import java.util.List;
import cokr.xit.base.file.FileInfo;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
/** .
* <ul>
@ -17,6 +19,6 @@ public interface Crdn05Service extends CrdnService {
* <li> false</li>
* </ul>
*/
boolean create(Crdn crdn);
boolean create(Crdn crdn, List<FileInfo> fileInfoList);
}

@ -6,6 +6,8 @@ import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.service.Crdn05Service;
@ -21,6 +23,8 @@ public class Crdn05ServiceBean extends AbstractServiceBean implements Crdn05Serv
/** 단속 자료 등록 Bean */
@Resource(name="crdn05Bean")
protected Crdn05Bean crdn05Bean;
@Resource(name="fileBean")
private FileBean fileBean;
@Override
public List<DataObject> getCrackdownList(CrdnQuery req) {
@ -28,12 +32,15 @@ public class Crdn05ServiceBean extends AbstractServiceBean implements Crdn05Serv
}
@Override
public boolean create(Crdn crdn) {
public boolean create(Crdn crdn, List<FileInfo> fileInfoList) {
if(ifEmpty(crdn.getDoGuidance(), () -> "").equals("on")) {
}
return crdn05Bean.create(crdn);
boolean saved = crdn05Bean.create(crdn);
fileInfoList.forEach(fileInfo -> fileInfo.setInfoType(Crdn.INF_TYPE).setInfoKey(crdn.getCrdnId()));
fileBean.create(fileInfoList);
return saved;
}
}

@ -12,6 +12,8 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.web.FileInfoFactory;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.service.Crdn05Service;
@ -88,7 +90,10 @@ public class Crdn05Controller extends ApplicationController {
@PostMapping(name="단속자료 수기 등록", value="/030/create.do")
public ModelAndView createCrdnDataByManual(Crdn crdn, MultipartFile[] uploadFileList) {
boolean saved = crdn05Service.create(crdn);
List<FileInfo> fileInfoList = new FileInfoFactory().makeFileInfos(null, uploadFileList);
boolean saved = crdn05Service.create(crdn, fileInfoList);
return new ModelAndView("jsonView")
.addObject("saved", saved);

@ -4,7 +4,7 @@
<div class="d-flex flex-row justify-content-evenly">
<div class="card" style="max-width:1100px;" title="단속정보">
<form id="frm--${pageName}" class="dpv eca">
<form id="frmEdit--${pageName}" class="dpv eca">
<input name="crdnId" type="hidden" data-map="CRDN_ID" />
<input name="taskSeCd" type="hidden" value="${taskSeCd}" />
<div class="row g-1">
@ -152,8 +152,8 @@
</form>
</div>
<div class="card" style="width:400px;">
<form id="frmDummy--${pageName}" class="dpv eca" method="post" enctype="multipart/form-data">
<input type="file" id="uploadFileList--${pageName}" name="uploadFileList" multiple />
<form id="frmFile--${pageName}" class="dpv eca" method="post" enctype="multipart/form-data">
<input type="file" id="uploadFileList--${pageName}" name="uploadFileList" multiple accept="image/*" />
</form>
<div id="display--${pageName}">
@ -178,7 +178,7 @@ $(document).ready(function(){
/**************************************************************************
* DatasetControl, Dataset, FormFields
**************************************************************************/
$P.formFields = new FimsFormFields("#frm--${pageName}");
$P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.uploadSet = uploadSupport("#uploadFileList--${pageName}");
@ -198,7 +198,7 @@ $(document).ready(function(){
var item = $P.crdnControl.getCurrent("item"),
create = "added" == item.state;
var formData = new FormData(document.getElementById("frmDummy--${pageName}"));
var formData = new FormData(document.getElementById("frmFile--${pageName}"));
for(var key in info) {
var value = info[key];
formData.append(key,value);
@ -228,7 +228,7 @@ $(document).ready(function(){
};
$P.fnSave = () => {
if (!$("#frm--${pageName} input").validInputs()) return;
if (!$("#frmEdit--${pageName} input").validInputs()) return;
dialog.alert({
content:"현재 단속 정보를 저장하시겠습니까?",
@ -247,7 +247,7 @@ $(document).ready(function(){
* 초기화
**************************************************************************/
//달력 초기화
initDatepicker("frm--${pageName}");
initDatepicker("frmEdit--${pageName}");
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));

Loading…
Cancel
Save