데이터 필터링 및 이첩취소기능 추가

dev
Kurt92 2 years ago
parent 007786e5f7
commit 903d67a243

@ -1,11 +1,15 @@
package xit.itgcms.core.managerlog.service; package xit.itgcms.core.managerlog.service;
import xit.vips.process.model.OwnerVO;
public class MngrCountVO extends MngrStatsSearchVO{ public class MngrCountVO extends MngrStatsSearchVO{
/** /**
* *
*/ */
private static final long serialVersionUID = 7933827690458807888L; private static final long serialVersionUID = 7933827690458807888L;
private OwnerVO ownerVo;
/** 날짜통계인덱스 */ /** 날짜통계인덱스 */
String cdIdx = ""; String cdIdx = "";

@ -12,7 +12,7 @@ public class Inr010501VO extends CmmnInrVO {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private PostDocVO postDocVO; private PostDocVO postDocVO;
private CmmnSendAdresVO cmmnSendAdresVO ; private CmmnSendAdresVO cmmnSendAdresVO;

@ -11,4 +11,9 @@ public interface Rev010102Service {
// public Rev010102VO findView(Rev010102VO vo); // public Rev010102VO findView(Rev010102VO vo);
public void modifyProc(Rev010102VO vo,String flag); public void modifyProc(Rev010102VO vo,String flag);
/** 2023.02.27
*
* */
public void deleteProc(Rev010102VO vo,String flag);
} }

@ -104,4 +104,53 @@ public class Rev010102ServiceImpl implements Rev010102Service {
} }
} }
/** 2023.02.27
*
* */
@Override
public void deleteProc(Rev010102VO vo,String flag) {
String user_cd =CommUtil.getMngrMemId();
for(int i=0; i<vo.getJsonArr().length(); i++) {
JSONObject jsonObj =new JSONObject();
try {
jsonObj =(JSONObject) vo.getJsonArr().get(i);
} catch (JSONException e) {
throw new RuntimeException("JsonObject get fail",e);
}
vo.convertJSONObjectToObject(jsonObj);
/*종합검사 대장자료 수정 파라미터set*/
RegistVioltVO regVO =new RegistVioltVO();
regVO.convertJSONObjectToObject(jsonObj);
regVO.setAtdrc_cd(vo.getAtdrc_cd());
regVO.setViolt_iem_cd(vo.getViolt_iem_cd());
regVO.setManage_year(vo.getManage_year());
regVO.setManage_no(vo.getManage_no());
regVO.setLast_updt_user_cd(user_cd);
regVO.setTrfntf_reflect_cn(vo.getTrfntf_reflect_cn());
/*종합검사 이첩구분 수정처리*/
if(flag.equals("reflect")) {
if(vo.getTrfntf_result().equals("2"))
throw new RuntimeException((i+1)+" 번째 자료는 이미 반송 처리된 자료입니다.");
else if(vo.getTrfntf_result().equals("4"))
throw new RuntimeException((i+1)+" 번째 자료는 이미 수신 처리된 자료입니다.");
else {
// 발송 구분 (정상자료)
regVO.setTrfntf_se_cd("0");
vipsUnitService.modifyRegistViolt(regVO);
//이첩 삭제
vipsUnitService.deleteTrfntfRegv(vo);
}
}else {
throw new RuntimeException((i+1)+" 번째 자료 삭제에 실패하였습니다.");
}
}
}
} }

@ -168,6 +168,7 @@ public class Rev010102Controller {
boolean result = false; boolean result = false;
String flag = null;
/** /**
* *
@ -175,11 +176,22 @@ public class Rev010102Controller {
switch (mode) { switch (mode) {
case "update": case "update":
vo.setJsonArr(new JSONArray(request.getParameter("jsonArr"))); vo.setJsonArr(new JSONArray(request.getParameter("jsonArr")));
String flag = request.getParameter("flag"); flag = request.getParameter("flag");
System.out.println(flag); System.out.println(flag);
rev010102Service.modifyProc(vo,flag); rev010102Service.modifyProc(vo,flag);
result = true; result = true;
break; break;
/** 2023.02.27
*
* . .
* update delete YN delete
* */
case "delete":
vo.setJsonArr(new JSONArray(request.getParameter("jsonArr")));
flag = request.getParameter("flag");
System.out.println(flag);
rev010102Service.deleteProc(vo,flag);
break;
default: default:
throw new RuntimeException("유효하지 않은 처리 요청 입니다."); throw new RuntimeException("유효하지 않은 처리 요청 입니다.");
} }

@ -1153,7 +1153,8 @@ public class CmmnFindByCategoryServiceImpl implements CmmnFindByCategoryService{
CmmnViolCarVO vo = new CmmnViolCarVO(); CmmnViolCarVO vo = new CmmnViolCarVO();
vo.setAtdrc_cd(atdrc_cd); vo.setAtdrc_cd(atdrc_cd);
vo.setVhcle_no(item.getVHRNO().trim().replace("*", "")); vo.setVhcle_no(item.getVHRNO().trim().replace("*", ""));
vo.setOwner_no(item.getIHIDNUM().trim()); /*최정민 자망연계 샘플테이터 출력으로 인한 임시 주석*/
/*vo.setOwner_no(item.getIHIDNUM().trim());*/
vo.setOwner_nm(item.getMBER_NM().trim()); vo.setOwner_nm(item.getMBER_NM().trim());
/*============================================= /*=============================================
* 2020.02.10 * 2020.02.10
@ -1164,13 +1165,14 @@ public class CmmnFindByCategoryServiceImpl implements CmmnFindByCategoryService{
} else { } else {
vo.setRegist_de(CommonUtil.replaceToNumber(item.getINSPT_DE())); vo.setRegist_de(CommonUtil.replaceToNumber(item.getINSPT_DE()));
} }
vo.setChange_regist_de(item.getLT_REG_DE().trim().replace("*", "")); /*최정민 자망연계 샘플테이터 출력으로 인한 임시 주석*/
/*vo.setChange_regist_de(item.getLT_REG_DE().trim().replace("*", ""));
vo.setVhcle_nm(item.getCNM().trim()); vo.setVhcle_nm(item.getCNM().trim());
vo.setVhcty_nm(item.getVHCTY_NAME().trim()); vo.setVhcty_nm(item.getVHCTY_NAME().trim());
vo.setPrpos_se_cd(item.getPRPOS_NAME().trim()); vo.setPrpos_se_cd(item.getPRPOS_NAME().trim());
vo.setCargoAt(item.isCargo()?"Y":"N"); vo.setCargoAt(item.isCargo()?"Y":"N");
if(item.getEND_DAY().trim().startsWith("*")||item.getVHRNO().trim().startsWith("*")||item.getELAPSE_DAY().trim().startsWith("*")||item.getLT_REG_DE().trim().startsWith("*")) if(item.getEND_DAY().trim().startsWith("*")||item.getVHRNO().trim().startsWith("*")||item.getELAPSE_DAY().trim().startsWith("*")||item.getLT_REG_DE().trim().startsWith("*"))
vo.setWarn_at("1"); vo.setWarn_at("1");*/
String change_regist_at = null; String change_regist_at = null;
String regist_end_de = null; String regist_end_de = null;
String violt_iem_cd = null; String violt_iem_cd = null;

@ -99,6 +99,8 @@ public interface VipsUnitMapper {
public List<CmmnRevVO> findTrfntfRegv(CmmnRevSearchVO searchVO)throws SQLException; public List<CmmnRevVO> findTrfntfRegv(CmmnRevSearchVO searchVO)throws SQLException;
public int modifyTrfntfRegv(CmmnRevVO vo)throws SQLException; public int modifyTrfntfRegv(CmmnRevVO vo)throws SQLException;
public int deleteTrfntfRegv(CmmnRevVO vo)throws SQLException;
public AdstrdVO findAdstrd(AdstrdVO vo) throws SQLException; public AdstrdVO findAdstrd(AdstrdVO vo) throws SQLException;
public int addAdstrd(AdstrdVO vo) throws SQLException; public int addAdstrd(AdstrdVO vo) throws SQLException;
public int modifyAdstrd(AdstrdVO vo) throws SQLException; public int modifyAdstrd(AdstrdVO vo) throws SQLException;

@ -96,6 +96,11 @@ public interface VipsUnitService {
public List<? extends CmmnRevVO> findTrfntfRegv(CmmnRevSearchVO searchVO); public List<? extends CmmnRevVO> findTrfntfRegv(CmmnRevSearchVO searchVO);
public int modifyTrfntfRegv(CmmnRevVO vo); public int modifyTrfntfRegv(CmmnRevVO vo);
/** 2023.02.27
*
* */
public int deleteTrfntfRegv(CmmnRevVO vo);
public AdstrdVO findAdstrd(AdstrdVO vo); public AdstrdVO findAdstrd(AdstrdVO vo);
public int addAdstrd(AdstrdVO vo); public int addAdstrd(AdstrdVO vo);
public int modifyAdstrd(AdstrdVO vo); public int modifyAdstrd(AdstrdVO vo);

@ -10587,4 +10587,14 @@ public class VipsUnitServiceImpl implements VipsUnitService{
} }
} }
@Override
public int deleteTrfntfRegv(CmmnRevVO vo) {
try {
int result = vipsUnitMapper.deleteTrfntfRegv(vo);
return result;
} catch (SQLException e) {
throw new RuntimeException("(이첩대장) ERROR 삭제 中 오류 발생", e);
}
}
} }

@ -55,7 +55,31 @@ public class RmiViolationCarServiceImpl implements RmiViolationCarService{
WEB_AC1_AW0_10_A_WI01PortTypeProxy proxy = new WEB_AC1_AW0_10_A_WI01PortTypeProxy(); WEB_AC1_AW0_10_A_WI01PortTypeProxy proxy = new WEB_AC1_AW0_10_A_WI01PortTypeProxy();
DS_AC1_AW0_10_A_REQUESTType requestType = this.setRequestType(cntc_info_code, charger_id, charger_nm, charger_ip, orgnzt_code, startDe, endDe, isCargo); DS_AC1_AW0_10_A_REQUESTType requestType = this.setRequestType(cntc_info_code, charger_id, charger_nm, charger_ip, orgnzt_code, startDe, endDe, isCargo);
DS_AC1_AW0_10_A_RESPONSELISTType resp = new DS_AC1_AW0_10_A_RESPONSELISTType(); DS_AC1_AW0_10_A_RESPONSELISTType resp = new DS_AC1_AW0_10_A_RESPONSELISTType();
try {
/*최정민 자망연계 샘플데이터*/
List<ViolationCarInfoVO> arrVO = new ArrayList<ViolationCarInfoVO>();
ViolationCarInfoVO vo = new ViolationCarInfoVO();
vo.setVHRNO("11가1111");
vo.setMBER_NM("가나다*상품용*");
vo.setINSPT_BEFORE_VALID_PD_ENDDE("2022-01-01 2022-03-03");
vo.setINSPT_DE("2023-01-01");
ViolationCarInfoVO vo2 = new ViolationCarInfoVO();
vo2.setVHRNO("22가2222");
vo2.setMBER_NM("다나가-상품용-");
vo2.setINSPT_BEFORE_VALID_PD_ENDDE("2022-01-01 2022-03-03");
vo2.setINSPT_DE("2023-01-01");
ViolationCarInfoVO vo3 = new ViolationCarInfoVO();
vo3.setVHRNO("33가3333");
vo3.setMBER_NM("다나가 정상자료");
vo3.setINSPT_BEFORE_VALID_PD_ENDDE("2022-01-01 2022-03-03");
vo3.setINSPT_DE("2023-01-01");
arrVO.add(vo);
arrVO.add(vo2);
arrVO.add(vo3);
/*try {
resp = proxy.SI_AC1_AW0_10_RR_A_OP(requestType); resp = proxy.SI_AC1_AW0_10_RR_A_OP(requestType);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("(자동차검사 지연/미필_연계)자동차검사 연계 中 오류가 발생하였습니다."+e.getMessage(),e); throw new RuntimeException("(자동차검사 지연/미필_연계)자동차검사 연계 中 오류가 발생하였습니다."+e.getMessage(),e);
@ -65,9 +89,9 @@ public class RmiViolationCarServiceImpl implements RmiViolationCarService{
/** *//**
* *
*/ *//*
List<ViolationCarInfoVO> arrVO = new ArrayList<ViolationCarInfoVO>(); List<ViolationCarInfoVO> arrVO = new ArrayList<ViolationCarInfoVO>();
for(DS_AC1_AW0_10_A_RESPONSEType item : resp.getRecord()) { for(DS_AC1_AW0_10_A_RESPONSEType item : resp.getRecord()) {
if(CommonUtil.isEmpty(item.getVHRNO())) if(CommonUtil.isEmpty(item.getVHRNO()))
@ -77,7 +101,7 @@ public class RmiViolationCarServiceImpl implements RmiViolationCarService{
vo.convertObjectToObject(item); vo.convertObjectToObject(item);
vo.setCargo(isCargo); vo.setCargo(isCargo);
arrVO.add(vo); arrVO.add(vo);
} }*/
return arrVO; return arrVO;
} }

@ -120,6 +120,18 @@
AND MANAGE_no = #{manage_no} AND MANAGE_no = #{manage_no}
</update> </update>
<delete id="deleteTrfntfRegv">
/** deleteTrfntfRegv */
/** 이첩대장 자료 삭제*/
DELETE FROM TB_REGIST_VIOLT_TRFNTF
WHERE SEND_ATDRC_CD =#{atdrc_cd}
AND vhcle_no = #{vhcle_no}
AND violt_iem_cd = #{violt_iem_cd}
AND MANAGE_YEAR = #{manage_year}
AND MANAGE_no = #{manage_no}
</delete>
<select id="findAdstrd" <select id="findAdstrd"
resultType="xit.vips.process.model.AdstrdVO"> resultType="xit.vips.process.model.AdstrdVO">
/** findAdstrd */ /** findAdstrd */

@ -18,6 +18,7 @@
<button type="button" id="excel_btn2" class="btn green"><img src="<c:url value="/resource/images/common/excel.png"/>" alt="NEW 엑셀저장"/>NEW 엑셀저장</button> <button type="button" id="excel_btn2" class="btn green"><img src="<c:url value="/resource/images/common/excel.png"/>" alt="NEW 엑셀저장"/>NEW 엑셀저장</button>
<button type="button" id="trfntf_submit_btn" class="btn blue">이첩 승인</button> <button type="button" id="trfntf_submit_btn" class="btn blue">이첩 승인</button>
<button type="button" id="trfntf_reflect_btn" class="btn gray" onclick="dialog()">이첩 반송</button> <button type="button" id="trfntf_reflect_btn" class="btn gray" onclick="dialog()">이첩 반송</button>
<button type="button" id="trfntf_delete_btn" class="btn red" >이첩발송취소</button>
</span> </span>
</div> </div>
<!-- //버튼 및 페이지정보 --> <!-- //버튼 및 페이지정보 -->
@ -515,6 +516,61 @@ $("#trfntf_reflect_reg_btn").click(function(){
}); });
}); });
/** 2023.02.27 최정민
* 이첩대장 삭제기능 추가
* 현재 이첩에 대한 삭제 기능이 없음. 이첩을 잘못하였을 경우 취소 할 방법이 없음.
* */
/* 이첩 발송 취소 버튼*/
$("#trfntf_delete_btn").click(function(){
if($('#div_tbody input[name="checkbox"]:checked').length ==0){
alert("자료를 선택 해주세요.");
return false;
}
var arrParam = [];
$('#div_tbody input[name="checkbox"]:checked').each(function(){
var $row = $(this).parents('tr');
var $row1 = this;
console.log('row', $row)
console.log('row1', $row1)
var param = new Object();
param.vhcle_no = $row.attr("vhcle_no");
param.valid_end_de = $row.attr("valid_end_de");
param.trfntf_result = $row.attr("trfntf_result");
param.valid_end_de = $row.attr("valid_end_de");
param.manage_year = $row.attr("manage_year");
param.manage_no = $row.attr("manage_no");
param.violt_iem_cd = $row.attr("violt_iem_cd");
param.atdrc_cd = $("#sch_atdrc_cd").val();
arrParam.push(param);
});
console.log("param check", arrParam);
// form 생성
var param = new Object();
param.mode="delete";
param.flag = "reflect";
param.trfntf_reflect_cn = $("#trfntf_reflect_cn").val();
param.jsonArr = JSON.stringify(arrParam);
var form = vips.createForm(param);
$.ajax({
type:"POST",
url: '<c:url value="/category/rev/rev0101/rev010102_proc.do"/>',
dataType:'json',
data: $(form).serialize(),
success:function(data){
alert("이첩발송이 취소되었습니다.");
fn_search();
}
});
});
/* 검색 버튼 클릭 */ /* 검색 버튼 클릭 */
$(".btn_search").click(function(){ $(".btn_search").click(function(){
$("#currentPageNo").val(1); $("#currentPageNo").val(1);

@ -273,6 +273,7 @@
<th colspan="4"> <th colspan="4">
<button type="button" id="uptAdresFromCarLink_btn" class="btn sm gray" style="margin: 5px 0;"><img src="/resource/images/common/search.png" alt="주소업데이트(자망)"/>주소업데이트(자망)</button> <button type="button" id="uptAdresFromCarLink_btn" class="btn sm gray" style="margin: 5px 0;"><img src="/resource/images/common/search.png" alt="주소업데이트(자망)"/>주소업데이트(자망)</button>
<button type="button" id="uptAdresFromJuminLink_btn" class="btn sm gray" style="margin: 5px 0;"><img src="/resource/images/common/search.png" alt="주소업데이트(주민망)"/>주소업데이트(주민망)</button> <button type="button" id="uptAdresFromJuminLink_btn" class="btn sm gray" style="margin: 5px 0;"><img src="/resource/images/common/search.png" alt="주소업데이트(주민망)"/>주소업데이트(주민망)</button>
<button type="button" id="filterData" class="btn sm gray" style="margin: 5px 0;"><img src="/resource/images/common/search.png" alt="데이터 필터링"/>데이터 필터링</button>
</th> </th>
</tr> </tr>
</tbody> </tbody>
@ -334,6 +335,41 @@
</table> </table>
</div> </div>
<!-- //대장생성처리 버튼 클릭 dialog --> <!-- //대장생성처리 버튼 클릭 dialog -->
<!-- 자료제거 버튼 클릭 dialog -->
<div id="diaRegexRemove" class="dialog" style="display: none">
<div class="grp">
<table class="tbl04">
<colgroup>
<col style="width: ;"/>
</colgroup>
<tbody>
<tr>
<td style="color: #006fbd;">
<span style="font-weight: bold;">※데이터 필터링</span>
<br/><span>- 아래 입력한 단어가 포함된 자료를 리스트에서 제외합니다.</span>
<br/><span>- ex)상품용 </span>
</td>
</tr>
<tr>
<td style="display: flex">
<select id="filterSelectBox" style="width: 100px">
</select>
<input type="text" id="filteringInput">
</td>
</tr>
</tbody>
</table>
</div>
<table>
<tr>
<th colspan="2">
<button type="button" id="filterRemove_btn" class="btn gray">적용</button>
<button type="button" id="filterReturn_btn" class="btn gray">되돌리기</button>
<button type="button" id="filterCancel_btn2" name="cancel_btn" class="btn gray">닫기</button>
</th>
</tr>
</table>
</div>
<script type="text/javascript"> <script type="text/javascript">
@ -345,6 +381,9 @@ $(document).ready(function(){
$('#sch_regist_de_begin').val('<fmt:formatDate value="${toDay}" pattern="yyyy-MM-dd" />'); $('#sch_regist_de_begin').val('<fmt:formatDate value="${toDay}" pattern="yyyy-MM-dd" />');
$('#sch_regist_de_end').val('<fmt:formatDate value="${toDay}" pattern="yyyy-MM-dd" />'); $('#sch_regist_de_end').val('<fmt:formatDate value="${toDay}" pattern="yyyy-MM-dd" />');
} }
/*데이터필터링 원본데이터*/
const copyDataSet = null;
}); });
@ -692,6 +731,8 @@ function fn_search(){
}, },
success:function(data){ success:function(data){
DATASET = data.list; DATASET = data.list;
/*데이터필터링 원본데이터 저장*/
copyDataSet = DATASET;
fn_gridDraw(data.list); fn_gridDraw(data.list);
if(!$('#checkAll').is(':checked')) if(!$('#checkAll').is(':checked'))
$('#checkAll').click(); $('#checkAll').click();
@ -866,4 +907,59 @@ function fn_gridDraw(dataset){
} }
}); });
}); });
/** 2023.03.28 최정민
* 데이터 필터링 기능 추가
* 그리드에 뿌려진 데이터를 정규식으로 검색하여 제거.
* 2023.04.03 최정민
* 들어오는 인풋데이터의 유연성을 주기 위해 정규식으로 검색하던 방식에서 문자열로 변경
*
* 해당기능 다른 페이지에서도 쓸수 있도록 공통화 진행
* 1. options 객체 = 다이얼 로그 내에 셀렉트 박스 구성
* key : view에 보여질 한글 옵션명
* value : 제거 로직에서 쓰일 attr값
* 2. obj 객체 = 다이얼로그 타이틀, 테이터셋, options에서 셋팅한 값 가져감
* obj는 수정하지 말것
* 해당 리스너를 호출한 태그 text를 title로 가져감
*
* 2023.04.07 최정민
* options 갹체체 obj 안으로 병합
* obj.options에 필터링 셀렉트박스만 정의해주면 됨.
*
* 원본데이터 되돌리기를 위하여 ready에 const copyDataSet선언, 조회후 데이터 할당하여야 한다.
* */
$('#filterData').click(function(){
let obj = {
options : {
"소유자명":"owner_nm",
"차량번호":"vhcle_no",
},
title : document.querySelector('#filterData').innerText,
data : DATASET,
copyDataSet : copyDataSet,
}
const filter = new DataFilter(obj);
/**이벤트리스너*/
//제거 버튼 클릭
document.querySelector('#filterRemove_btn').onclick = function(){
let option = document.querySelector('#filterSelectBox').value;
let param = document.querySelector('#filteringInput').value;
DATASET = filter.dataFilter(option, param);
}
//되돌리기 버튼 클릭
document.querySelector('#filterReturn_btn').onclick = function(){
DATASET = filter.dataRollBack();
}
//닫기 버튼 클릭
document.querySelector('#filterCancel_btn2').onclick = function(){
$('#diaRegexRemove').dialog('close');
}
});
</script> </script>

@ -3173,3 +3173,75 @@ function personalCheck(){
} }
} }
/** 2023.03.28
* 데이터 필터링 공통
* */
class DataFilter {
constructor(obj) {
this.obj = obj;
this.createDialog();
this.dialogOpen();
}
dialogOpen(){
$("#diaRegexRemove").dialog({
title : this.obj.title,
width : 370,
height: 190,
modal : true,
}).prev(".ui-dialog-titlebar").css("background","#515151");
}
setSelectOptions(){
let options = [];
for(const key in this.obj.options){
options.push({'value':this.obj.options[key], 'text':key});
}
return this.obj.options = options;
}
createDialog(){
this.setSelectOptions();
document.querySelector('#filterSelectBox').innerHTML='';
for(const key in this.obj.options){
let option = document.createElement("option");
option.value = this.obj.options[key].value;
option.text = this.obj.options[key].text;
document.querySelector('#filterSelectBox').append(option);
}
}
/**
* @param option : filterSelectBox > option
* @param param : filteringInput
* @returns 필터링 데이터
*/
dataFilter(option, param){
let count = 0;
let result = this.obj.data.filter((data, i)=>{
let paramLeng = this.obj.data[i][option].indexOf(param);
if(paramLeng != -1) {
console.log('걸린 데이터 : ', data[option]);
document.querySelector("tr["+option+"='"+data[option]+"']").remove();
count++
}
console.log(this.obj.data.length);
return paramLeng == -1;
})
this.obj.data=result;
if (count == 0){
alert('[' + param + '] 를 포함한 자료가 존재하지 않습니다.');
} else {
alert(count + '개의 자료를 제외하였습니다.');
}
$('#div_tbody').siblings('div.cnt_tbody').text(this.obj.data.length+' 건');
return this.obj.data;
}
dataRollBack(){
fn_gridDraw(this.obj.copyDataSet);
this.obj.data = this.obj.copyDataSet;
$('#div_tbody').siblings('div.cnt_tbody').text(this.obj.data.length+' 건');
return this.obj.copyDataSet;
}
}

Loading…
Cancel
Save