ZMS00400.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 서버별 단문메시지 통계 조회 (ZMS00400.js)
  4. - Version :
  5. 1) : Ver.1.00.00
  6. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  7. */
  8. /**
  9. * @group :
  10. * @ver : 2006.12.20
  11. * @by : 이상준
  12. * @---------------------------------------------------
  13. * @type : function
  14. * @access : public
  15. * @desc : 초기화
  16. * @return :
  17. * @---------------------------------------------------
  18. */
  19. function fInitialize() {
  20. model.removeNodeset("/root/main/list/statlist");
  21. model.resetInstanceNode("/root/main/cond");
  22. model.resetInstanceNode("/root/send");
  23. // 현재 년도를 가져와서 2006년 부터 현재년도 까지 인스턴스를 만듬
  24. model.removeNodeset("/root/init/yearlist/year");
  25. var currentDate = getCurrentDate();
  26. var currentYear=parseInt(currentDate.substring(0,4));
  27. var currentMonth=currentDate.substring(4,6);
  28. model.removeNodeset("/root/init/yearlist/year");
  29. var cnt = 1;
  30. for (var i=currentYear; i>=2006; i--)
  31. {
  32. //model.makeNode("/root/init/yearlist/year["+cnt+"]");
  33. model.makeNode("/root/init/yearlist/year["+cnt+"]/label");
  34. model.makeNode("/root/init/yearlist/year["+cnt+"]/value");
  35. model.setValue("/root/init/yearlist/year["+cnt+"]/label", i);
  36. model.setValue("/root/init/yearlist/year["+cnt+"]/value", i);
  37. cnt++;
  38. }
  39. // 현재 월로 세팅함
  40. model.setValue("/root/main/cond/month",currentMonth);
  41. // 전송일자의 기본값을 세팅함
  42. var fromdd = ((getCurrentDate().toDate()).getAddDate(-2)).getDateFormat();
  43. var todd = getCurrentDate();
  44. model.setValue("/root/main/cond/fromdd", fromdd);
  45. model.setValue("/root/main/cond/todd", todd);
  46. model.refresh();
  47. // 조회조건 기본값 세팅
  48. cmb_years.select(0);
  49. cmb_system.select(1); // his 를 기본으로 세팅
  50. // 전송일자 활성화
  51. ipt_fromdd.disabled = false;
  52. ipt_todd.disabled = false;
  53. // 연도/월 비활성화
  54. cmb_years.disabled = true;
  55. cmb_month.disabled = true;
  56. // HIS 인지 구분
  57. if (htmlwindow != null) {
  58. HISSystem = new String(htmlwindow.HISSystem);
  59. } else {
  60. HISSystem = "true";
  61. }
  62. if (HISSystem == "true") {
  63. // his 시스템
  64. cap_system.visible = true;
  65. cmb_system.visible = true;
  66. }
  67. cmb_system.visible = true;
  68. }
  69. /**
  70. * @group :
  71. * @ver : 2006.12.20
  72. * @by : 이상준
  73. * @---------------------------------------------------
  74. * @type : function
  75. * @access : public
  76. * @desc : 통계정보조회
  77. * @return :
  78. * @---------------------------------------------------
  79. */
  80. function zmsfGetStatList() {
  81. // 전송할 send 데이터 작성
  82. var year = model.getValue("/root/main/cond/year");
  83. var month = model.getValue("/root/main/cond/month");
  84. var srchcond = model.getValue("/root/main/cond/srchcond");
  85. var fromdd = model.getValue("/root/main/cond/fromdd");
  86. var todd = model.getValue("/root/main/cond/todd");
  87. var system = model.getValue("/root/main/cond/system");
  88. var instcd = model.getValue("/root/main/cond/instcd");
  89. if (srchcond != "Y") // 전송일자일 경우
  90. {
  91. if (fromdd == "" && todd == "")
  92. {
  93. messageBox("전송일자를 ", "C001");
  94. return; // 리턴함
  95. }
  96. else if (fromdd > todd)
  97. {
  98. messageBox("시작일자가 종료일자보다 앞서있습니다. 수정해주십시오.", "E999");
  99. return;// 리턴함
  100. }
  101. else if (todd - fromdd > 10000)
  102. {
  103. messageBox("검색기간은 1년을 초과할 수 없습니다. 수정해주십시오.", "E999");
  104. return;// 리턴함
  105. }
  106. }
  107. else // 년/월일경우
  108. {
  109. // 해당월의 처음일자
  110. fromdd = year.toString() + month.toString() + "01";
  111. // 해당월의 마지막일자
  112. newDateObj = new Date(year, month, 0) ;
  113. todd = year.toString() + month.toString() + newDateObj.getDate();
  114. }
  115. //전송 할 값을 세팅
  116. //model.setValue("/root/send/year", year);
  117. //model.setValue("/root/send/month", month);
  118. //model.setValue("/root/send/srchcond", srchcond);
  119. model.setValue("/root/send/fromdd", fromdd);
  120. model.setValue("/root/send/todd", todd);
  121. model.setValue("/root/send/system", system);
  122. model.setValue("/root/send/instcd", instcd);
  123. // 서브밋
  124. submit("TRZMS00401");
  125. grd_statlist.subtotalPosition = "below";
  126. grd_statlist.subtotal("clear", 0, 0);
  127. grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("trsmcnt"), "" , "font-weight:bold;",0,"소계");
  128. grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("succdcnt"), "" , "font-weight:bold;",0,"소계");
  129. //grd_statlist.subtotal("average", grd_statlist.colRef("week"), grd_statlist.colRef("succdrate"), "" , "font-weight:bold;",0,"소계");
  130. grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("trsmingcnt"), "" , "font-weight:bold;",0,"소계");
  131. grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("trsmfailcnt"), "" , "font-weight:bold;",0,"소계");
  132. grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("wrongnum"), "" , "font-weight:bold;",0,"소계");
  133. grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("termerr"), "" , "font-weight:bold;",0,"소계");
  134. grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("noresp"), "" , "font-weight:bold;",0,"소계");
  135. grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("mreject"), "" , "font-weight:bold;",0,"소계");
  136. grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("retrsm"), "" , "font-weight:bold;",0,"소계");
  137. grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("txqexpire"), "" , "font-weight:bold;",0,"소계");
  138. grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("rreject"), "" , "font-weight:bold;",0,"소계");
  139. grd_statlist.subtotal("sum", grd_statlist.colRef("week"), grd_statlist.colRef("etc"), "" , "font-weight:bold;",0,"소계");
  140. //var val = grd_statlist.valueMatrix(9,0) + " | "+grd_statlist.valueMatrix(9,1) + " | "+grd_statlist.valueMatrix(9,2) + " | ";
  141. //alert(val);
  142. // 소계의 전송성공율 구함
  143. var gridrows = grd_statlist.rows - grd_statlist.fixedRows;
  144. var offset = 1;
  145. var week;
  146. var total;
  147. var cnt;
  148. for(var i = grd_statlist.fixedRows; i <= gridrows ; i=i+offset){
  149. week = grd_statlist.valueMatrix(i,1);
  150. if (week == "")
  151. {
  152. total = grd_statlist.valueMatrix(i,2); // 발송전체 건수
  153. cnt = grd_statlist.valueMatrix(i,3); // 성공건수
  154. if (total==0 || cnt==0)
  155. {
  156. grd_statlist.valueMatrix(i,4) = "0%";
  157. }
  158. else
  159. {
  160. grd_statlist.valueMatrix(i,4) = (Math.round((cnt/total) * 10000) / 100) + "%";
  161. }
  162. offset = 8; // 일주일 단위로 건너뜀
  163. }
  164. }
  165. // 마지막 행에대한 값을 구함
  166. total = grd_statlist.valueMatrix(gridrows+1,2); // 발송전체 건수
  167. cnt = grd_statlist.valueMatrix(gridrows+1,3); // 성공건수
  168. if (total==0 || cnt==0)
  169. {
  170. grd_statlist.valueMatrix(gridrows+1,4) = "0%";
  171. }
  172. else
  173. {
  174. grd_statlist.valueMatrix(gridrows+1,4) = (Math.round((cnt/total) * 10000) / 100) + "%";
  175. }
  176. }