diff --git a/src/main/java/cokr/xit/fims/crdn/Crdn.java b/src/main/java/cokr/xit/fims/crdn/Crdn.java index a3e6093d..401a4cef 100644 --- a/src/main/java/cokr/xit/fims/crdn/Crdn.java +++ b/src/main/java/cokr/xit/fims/crdn/Crdn.java @@ -42,11 +42,6 @@ public class Crdn extends AbstractEntity { */ private String crdnId; - /** - * 단속 ID 목록 - */ - private String[] crdnIDs; - /** * 시군구 코드 */ diff --git a/src/main/java/cokr/xit/fims/crdn/dao/Crdn01Mapper.java b/src/main/java/cokr/xit/fims/crdn/dao/Crdn01Mapper.java index c27b3161..e6675f35 100644 --- a/src/main/java/cokr/xit/fims/crdn/dao/Crdn01Mapper.java +++ b/src/main/java/cokr/xit/fims/crdn/dao/Crdn01Mapper.java @@ -1,6 +1,7 @@ package cokr.xit.fims.crdn.dao; import java.util.List; +import java.util.Map; import org.egovframe.rte.psl.dataaccess.mapper.Mapper; @@ -37,13 +38,10 @@ public interface Crdn01Mapper extends AbstractMapper { List selectCivilComplaintAnswerTargetDataList(CrdnQuery query); /** 민원 자료를 삭제한다. - * @param params 파라미터 - * + * @param params 삭제 요청 파라미터 * @return 저장된 정보수 */ - int removeCivilComplaint(Crdn crdn); + int removeCivilComplaint(Map map); /** 민원 원본을 조회한다. * @param query 민원원본 조회 조건 diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn01Bean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn01Bean.java index 8bdbebc8..008c4bdf 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn01Bean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn01Bean.java @@ -1,10 +1,14 @@ package cokr.xit.fims.crdn.service.bean; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import javax.annotation.Resource; import org.springframework.stereotype.Component; -import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.dao.Crdn01Mapper; import cokr.xit.foundation.AbstractComponent; @@ -22,10 +26,13 @@ public class Crdn01Bean extends AbstractComponent { public boolean removeCivilComplaint(String... crdnIDs) { if (isEmpty(crdnIDs)) return false; - Crdn crdn = new Crdn(); - crdn.setCrdnIDs(crdnIDs); - crdn.setRemovedBy(UserInfo.current().getId()); - return crdn01Mapper.removeCivilComplaint(crdn) == 1 ? true : false; + + Map paramMap = new HashMap(); + List crdnIdList = Arrays.asList(crdnIDs); + paramMap.put("crdnIDs", crdnIdList); + paramMap.put("removedBy", UserInfo.current().getId()); + + return crdn01Mapper.removeCivilComplaint(paramMap) == 1 ? true : false; } public DataObject getCivilComplaintOriginalInfo(CrdnQuery crdnQuery) { diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn01Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn01Controller.java index 988dd5ea..0378bfda 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn01Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn01Controller.java @@ -184,8 +184,9 @@ public class Crdn01Controller extends ApplicationController { * } */ @RequestMapping(name="민원자료 제거", value="/010/remove.do") - public ModelAndView removeCivilComplaint(Crdn crdn) { - boolean saved = crdn01Service.removeCivilComplaint(crdn.getCrdnIDs()); + public ModelAndView removeCivilComplaint(String[] IDs) { + + boolean saved = crdn01Service.removeCivilComplaint(IDs); return new ModelAndView("jsonView") .addObject("saved", saved); diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn01-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn01-mapper.xml index b0d63895..a6608cc3 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn01-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn01-mapper.xml @@ -266,7 +266,7 @@ AND (SELECT VLTN_ARTCL FROM TB_VLTN_INFO WHERE VLTN_ID = C.VLTN_ID) LIKE CONCAT( - + /* 민원자료 삭제(crdn01Mapper.removeCivilComplaint) */ UPDATE TB_CRDN SET DEL_YN = 'Y' diff --git a/src/main/webapp/resources/js/fims/framework/cmm/xitPaintwebUtil.js b/src/main/webapp/resources/js/fims/framework/cmm/xitPaintwebUtil.js deleted file mode 100644 index 8a457308..00000000 --- a/src/main/webapp/resources/js/fims/framework/cmm/xitPaintwebUtil.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * 전달받은 이미지를 base64로 인코딩한다 - * @param file - 이미지 파일 또는 이미지 URL - * @param maxWidth - 인코딩 시의 이미지 max width 사이즈 - * @returns {Promise} - */ -var readImage = () => { - let image = this.$refs.image.src - this.toBlob(image) - .then(res => { - console.log(res) - this.image = { - filename: res.name, - size: res.size, - type: res.type, - lastModified: res.lastModified - } - }) -}; - -/** - * 이미지 url을 blob 파일로 변환하여 전달한다 - * @param url - * @returns {Promise} - */ -var toBlob = (url) => { - return new Promise((resolve, reject) => { - this.base64Encode(url) - .then(res => { - let byteString = atob(res.dataUrl) - let ab = new ArrayBuffer(byteString.length) - let ia = new Uint8Array(ab) - - for (let i = 0; i < byteString.length; i++) { - ia[i] = byteString.charCodeAt(i) - } - - // write the array buffer to blob - let blob = new Blob([ab], {type: 'image/' + res.type}) - - let formData = new FormData() - formData.append('file', blob, res.name) - resolve(formData.get('file')) - }) - }) -}; - -/** - * 전달받은 이미지를 base64로 인코딩한다 - */ -var base64Encode = (url) => { - const re = new RegExp('.(gif|jpg|jpeg|tiff|png|ico)$', 'i') - let name = (/[^(/|\\)]*$/).exec(url)[0] - let type = re.test(name) ? re.exec(name)[0].replace('.', '') : 'jpg' - - return new Promise((resolve, reject) => { - let image = new Image() - - image.onload = function (event) { - let canvas = document.createElement('canvas') - // draw canvas - canvas.width = image.naturalWidth - canvas.height = image.naturalHeight - canvas.getContext('2d').drawImage(image, 0, 0) - - let dataUrl = canvas.toDataURL('image/' + type) - resolve({ - name: name, - type: type, - dataUrl: dataUrl.split(',')[1] - }) - } - image.onerror = function () { - let msg = `"${file}"을 로딩하는 데 오류가 발생하였습니다. 이미지 파일을 확인해주세요.` - alert(msg) - console.error(msg) - } - image.crossOrigin = 'anonymous'; - image.src = url - }) -} \ No newline at end of file