123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- /*
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- 서버별 단문메시지 통계 조회 (ZMS00400.js)
- - Version :
- 1) : Ver.1.00.00
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- */
- /**
- * @group :
- * @ver : 2006.12.20
- * @by : 이상준
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 초기화
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize() {
- model.removeNodeset("/root/main/list/statlist");
- model.resetInstanceNode("/root/main/cond");
- model.resetInstanceNode("/root/send");
- // 현재 년도를 가져와서 2006년 부터 현재년도 까지 인스턴스를 만듬
- model.removeNodeset("/root/init/yearlist/year");
- var currentDate = getCurrentDate();
- var currentYear=parseInt(currentDate.substring(0,4));
- var currentMonth=currentDate.substring(4,6);
- model.removeNodeset("/root/init/yearlist/year");
- var cnt = 1;
- for (var i=currentYear; i>=2006; i--)
- {
- //model.makeNode("/root/init/yearlist/year["+cnt+"]");
- model.makeNode("/root/init/yearlist/year["+cnt+"]/label");
- model.makeNode("/root/init/yearlist/year["+cnt+"]/value");
- model.setValue("/root/init/yearlist/year["+cnt+"]/label", i);
- model.setValue("/root/init/yearlist/year["+cnt+"]/value", i);
- cnt++;
- }
- // 현재 월로 세팅함
- model.setValue("/root/main/cond/month",currentMonth);
- // 전송일자의 기본값을 세팅함
- var fromdd = ((getCurrentDate().toDate()).getAddDate(-2)).getDateFormat();
- var todd = getCurrentDate();
- model.setValue("/root/main/cond/fromdd", fromdd);
- model.setValue("/root/main/cond/todd", todd);
- model.refresh();
- // 조회조건 기본값 세팅
- cmb_years.select(0);
- cmb_system.select(1); // his 를 기본으로 세팅
- // 전송일자 활성화
- ipt_fromdd.disabled = false;
- ipt_todd.disabled = false;
- // 연도/월 비활성화
- cmb_years.disabled = true;
- cmb_month.disabled = true;
- // HIS 인지 구분
- if (htmlwindow != null) {
- HISSystem = new String(htmlwindow.HISSystem);
- } else {
- HISSystem = "true";
- }
- if (HISSystem == "true") {
- // his 시스템
- cap_system.visible = true;
- cmb_system.visible = true;
- }
- cmb_system.visible = true;
- }
- /**
- * @group :
- * @ver : 2006.12.20
- * @by : 이상준
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 통계정보조회
- * @return :
- * @---------------------------------------------------
- */
- function zmsfGetStatList() {
- // 전송할 send 데이터 작성
- var year = model.getValue("/root/main/cond/year");
- var month = model.getValue("/root/main/cond/month");
- var srchcond = model.getValue("/root/main/cond/srchcond");
- var fromdd = model.getValue("/root/main/cond/fromdd");
- var todd = model.getValue("/root/main/cond/todd");
- var system = model.getValue("/root/main/cond/system");
- var instcd = model.getValue("/root/main/cond/instcd");
- if (srchcond != "Y") // 전송일자일 경우
- {
- if (fromdd == "" && todd == "")
- {
- messageBox("전송일자를 ", "C001");
- return; // 리턴함
- }
- else if (fromdd > todd)
- {
- messageBox("시작일자가 종료일자보다 앞서있습니다. 수정해주십시오.", "E999");
- return;// 리턴함
- }
- else if (todd - fromdd > 10000)
- {
- messageBox("검색기간은 1년을 초과할 수 없습니다. 수정해주십시오.", "E999");
- return;// 리턴함
- }
- }
- else // 년/월일경우
- {
- // 해당월의 처음일자
- fromdd = year.toString() + month.toString() + "01";
- // 해당월의 마지막일자
- newDateObj = new Date(year, month, 0) ;
- todd = year.toString() + month.toString() + newDateObj.getDate();
- }
- //전송 할 값을 세팅
- //model.setValue("/root/send/year", year);
- //model.setValue("/root/send/month", month);
- //model.setValue("/root/send/srchcond", srchcond);
- model.setValue("/root/send/fromdd", fromdd);
- model.setValue("/root/send/todd", todd);
- model.setValue("/root/send/system", system);
- model.setValue("/root/send/instcd", instcd);
- // 서브밋
- submit("TRZMS00401");
- grd_statlist.subtotalPosition = "below";
- grd_statlist.subtotal("clear", 0, 0);
- grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("trsmcnt"), "" , "font-weight:bold;",0,"소계");
- grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("succdcnt"), "" , "font-weight:bold;",0,"소계");
- //grd_statlist.subtotal("average", grd_statlist.colRef("week"), grd_statlist.colRef("succdrate"), "" , "font-weight:bold;",0,"소계");
- grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("trsmingcnt"), "" , "font-weight:bold;",0,"소계");
- grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("trsmfailcnt"), "" , "font-weight:bold;",0,"소계");
- grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("wrongnum"), "" , "font-weight:bold;",0,"소계");
- grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("termerr"), "" , "font-weight:bold;",0,"소계");
- grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("noresp"), "" , "font-weight:bold;",0,"소계");
- grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("mreject"), "" , "font-weight:bold;",0,"소계");
- grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("retrsm"), "" , "font-weight:bold;",0,"소계");
- grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("txqexpire"), "" , "font-weight:bold;",0,"소계");
- grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("rreject"), "" , "font-weight:bold;",0,"소계");
- grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("etc"), "" , "font-weight:bold;",0,"소계");
- //var val = grd_statlist.valueMatrix(9,0) + " | "+grd_statlist.valueMatrix(9,1) + " | "+grd_statlist.valueMatrix(9,2) + " | ";
- //alert(val);
- // 소계의 전송성공율 구함
- var gridrows = grd_statlist.rows - grd_statlist.fixedRows;
- var offset = 1;
- var week;
- var total;
- var cnt;
- for(var i = grd_statlist.fixedRows; i <= gridrows ; i=i+offset){
- week = grd_statlist.valueMatrix(i,1);
- if (week == "")
- {
- total = grd_statlist.valueMatrix(i,2); // 발송전체 건수
- cnt = grd_statlist.valueMatrix(i,3); // 성공건수
- if (total==0 || cnt==0)
- {
- grd_statlist.valueMatrix(i,4) = "0%";
- }
- else
- {
- grd_statlist.valueMatrix(i,4) = (Math.round((cnt/total) * 10000) / 100) + "%";
- }
- offset = 8; // 일주일 단위로 건너뜀
- }
- }
- // 마지막 행에대한 값을 구함
- total = grd_statlist.valueMatrix(gridrows+1,2); // 발송전체 건수
- cnt = grd_statlist.valueMatrix(gridrows+1,3); // 성공건수
- if (total==0 || cnt==0)
- {
- grd_statlist.valueMatrix(gridrows+1,4) = "0%";
- }
- else
- {
- grd_statlist.valueMatrix(gridrows+1,4) = (Math.round((cnt/total) * 10000) / 100) + "%";
- }
- }
|