단속사진 삭제 추가

main
이범준 1 year ago
parent 1d177dfb7a
commit 2b3887564f

@ -22,6 +22,11 @@ public class Crdn extends AbstractEntity {
*/ */
private String[] deleteFileKeyList; private String[] deleteFileKeyList;
/**
*
*/
private int fileChgCnt;
/** /**
* *
*/ */

@ -69,4 +69,10 @@ public interface Crdn01Mapper extends AbstractMapper {
*/ */
DataObject selectCivilComplaintReceiptInitialDataInfo(CrdnQuery req); DataObject selectCivilComplaintReceiptInitialDataInfo(CrdnQuery req);
/** . TODO : mybatis
* @param crdn
* @return
*/
int saveCivilComplaint(Crdn crdn);
} }

@ -66,5 +66,12 @@ public interface Crdn06Mapper extends AbstractMapper {
List<DataObject> selectCrackdowns(CrdnQuery req); List<DataObject> selectCrackdowns(CrdnQuery req);
/** .<br />
* {@link cokr.xit.fims.crdn.service.bean.Crdn06Bean#update(Crdn)}
* @param crdn
* @return
*/
int update(Crdn crdn);
} }

@ -12,8 +12,10 @@ 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;
import cokr.xit.base.file.FileInfo;
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.file.service.bean.FileBean;
import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.hwp.AddingParagraphBetweenHWPFile; import cokr.xit.fims.cmmn.hwp.AddingParagraphBetweenHWPFile;
import cokr.xit.fims.cmmn.hwp.InsertingImageCell; import cokr.xit.fims.cmmn.hwp.InsertingImageCell;
@ -40,10 +42,16 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic
@Resource(name="crdn01Mapper") @Resource(name="crdn01Mapper")
protected Crdn01Mapper crdn01Mapper; protected Crdn01Mapper crdn01Mapper;
@Resource(name="fileBean")
private FileBean fileBean;
/** 민원관리 Bean */ /** 민원관리 Bean */
@Resource(name="crdn01Bean") @Resource(name="crdn01Bean")
protected Crdn01Bean crdn01Bean; protected Crdn01Bean crdn01Bean;
@Resource(name="crdn06Bean")
protected Crdn06Bean crdn06Bean;
@Override @Override
public List<DataObject> getCrackdownList(CrdnQuery req) { public List<DataObject> getCrackdownList(CrdnQuery req) {
@ -200,6 +208,31 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic
return dataObject; return dataObject;
} }
public boolean saveCivilComplaint(Crdn crdn, List<FileInfo> newFileInfoList) {
int fileInsertEffected = 0;
int fileDeleteEffected = 0;
if(newFileInfoList != null && !newFileInfoList.isEmpty()) {
fileInsertEffected = fileBean.create(newFileInfoList);
}
if(crdn.getDeleteFileKeyList() != null) {
fileDeleteEffected = fileBean.remove(crdn.getDeleteFileKeyList());
}
crdn.setFileChgCnt(fileInsertEffected - fileDeleteEffected);
return saveCivilComplaint(crdn);
}
public boolean saveCivilComplaint(Crdn crdn) {
//TODO : crdn01Mapper.saveCivilComplaint(crdn);
return crdn06Bean.update(crdn);
}
} }

@ -29,7 +29,7 @@ public class Crdn06Bean extends AbstractComponent {
case "tagInformationUndefinedData": case "tagInformationUndefinedData":
return crdn06Mapper.updateTagInformation(crdn) == 1 ? true : false; return crdn06Mapper.updateTagInformation(crdn) == 1 ? true : false;
default: default:
return false; //crdn06Mapper.update(crdn); return crdn06Mapper.update(crdn) == 1 ? true : false;
} }
} }

@ -1,7 +1,9 @@
package cokr.xit.fims.crdn.web; package cokr.xit.fims.crdn.web;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Stream;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -11,6 +13,9 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.FileInfo.Relation;
import cokr.xit.base.file.web.FileInfoFactory;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
@ -197,7 +202,33 @@ public class Crdn01Controller extends ApplicationController {
@RequestMapping(name="민원자료 저장", value="/020/save.do") @RequestMapping(name="민원자료 저장", value="/020/save.do")
public ModelAndView saveCivilComplaint(Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) { public ModelAndView saveCivilComplaint(Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) {
boolean saved = true;// TODO : crdn01Service.saveCivilComplaint boolean saved = false;
List<FileInfo> newFileInfoList = new ArrayList<FileInfo>();
if(newFileList != null || modifyFileList != null) {
Relation relation = new Relation();
relation.setInfoType(crdn.INF_TYPE);
relation.setInfoKey(crdn.getCrdnId());
if(newFileList != null) {
newFileInfoList = new FileInfoFactory().makeFileInfos(relation, newFileList);
}
if(modifyFileList != null) {
newFileInfoList.addAll(new FileInfoFactory().makeFileInfos(relation, modifyFileList));
if(crdn.getDeleteFileKeyList() == null) {
crdn.setDeleteFileKeyList(crdn.getModifyFileKeyList());
} else {
String[] arr1 = crdn.getDeleteFileKeyList();
String[] arr2 = crdn.getModifyFileKeyList();
String[] sumArr = Stream.of(arr1, arr2).flatMap(Stream::of).toArray(String[]::new);
crdn.setDeleteFileKeyList(sumArr);
}
}
}
saved = crdn01Service.saveCivilComplaint(crdn, newFileInfoList);
return new ModelAndView("jsonView") return new ModelAndView("jsonView")
.addObject("saved", saved); .addObject("saved", saved);

@ -461,6 +461,14 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
<include refid="selectCrackdown"/> <include refid="selectCrackdown"/>
</select> </select>
<update id="update" parameterType="cokr.xit.fims.crdn.Crdn">
/* 단속정보 수정(crdn06Mapper.update) */
UPDATE TB_CRDN
SET ATCH_FILE_CNT = ATCH_FILE_CNT + (#{fileChgCnt})
<!-- TODO : 컬럼 추가 -->
, MDFCN_DT = <include refid="utility.now" /> /* 수정일시 */
, MDFR = #{modifiedBy} /* 수정자 */
WHERE CRDN_ID = #{crdnId} /* 단속 ID */
</update>
</mapper> </mapper>

@ -36,11 +36,11 @@
placeholder="시:분:초" /> placeholder="시:분:초" />
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="vhrno--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end required"> <label for="vhrno--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
차량번호 차량번호
</label> </label>
<input type="text" id="vhrno--${pageName}" name="vhrno" data-map="VHRNO" class="form-control" <input type="text" id="vhrno--${pageName}" name="vhrno" data-map="VHRNO" class="form-control"
data-maxlengthb="30" required /> data-maxlengthb="30" />
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label for="vltnCd--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end"> <label for="vltnCd--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">

Loading…
Cancel
Save