crdn 엔티티 수정

main
이범준 1 year ago
parent bb6f75f7b9
commit 1bff600fd2

@ -42,11 +42,6 @@ public class Crdn extends AbstractEntity {
*/
private String crdnId;
/**
* ID
*/
private String[] crdnIDs;
/**
*
*/

@ -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<DataObject> selectCivilComplaintAnswerTargetDataList(CrdnQuery query);
/** .
* @param params
* <ul><li>"crdn" - </li>
* <li>"currentUser" - </li>
* </ul>
* @param params
* @return
*/
int removeCivilComplaint(Crdn crdn);
int removeCivilComplaint(Map<String, Object> map);
/** .
* @param query

@ -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<String, Object> paramMap = new HashMap<String, Object>();
List<String> 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) {

@ -184,8 +184,9 @@ public class Crdn01Controller extends ApplicationController {
* }</code></pre>
*/
@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);

@ -266,7 +266,7 @@ AND (SELECT VLTN_ARTCL FROM TB_VLTN_INFO WHERE VLTN_ID = C.VLTN_ID) LIKE CONCAT(
</select>
<update id="removeCivilComplaint" parameterType="cokr.xit.fims.crdn.Crdn">
<update id="removeCivilComplaint" parameterType="map">
/* 민원자료 삭제(crdn01Mapper.removeCivilComplaint) */
UPDATE TB_CRDN
SET DEL_YN = 'Y'

@ -1,81 +0,0 @@
/**
* 전달받은 이미지를 base64로 인코딩한다
* @param file - 이미지 파일 또는 이미지 URL
* @param maxWidth - 인코딩 시의 이미지 max width 사이즈
* @returns {Promise<any>}
*/
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<any>}
*/
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
})
}
Loading…
Cancel
Save