From b40926a57822b993904a33c7cccc2bb6fb1aa8ab Mon Sep 17 00:00:00 2001 From: jity7777 Date: Wed, 23 Oct 2024 03:40:50 +0000 Subject: [PATCH] =?UTF-8?q?pms:=205939,=205938=20=EB=93=B1=20=EA=B8=B0?= =?UTF-8?q?=ED=83=80=EA=B1=B4=20=ED=8F=AC=ED=95=A8=20=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Base/Controller/FOCommon.cs | 228 ++++++++++++++++------------- Dao/MyBatis/Maps/Lect.xml | 47 +++++- Dao/MyBatis/Maps/User.xml | 21 ++- FO/Views/Course/SmartSearch.cshtml | 53 ++++++- FO/Views/Home/Index.cshtml | 126 +++++++++++++--- FO/css/dev.css | 68 ++++++++- 6 files changed, 401 insertions(+), 142 deletions(-) diff --git a/Base/Controller/FOCommon.cs b/Base/Controller/FOCommon.cs index 1f02ea0..82bda9f 100644 --- a/Base/Controller/FOCommon.cs +++ b/Base/Controller/FOCommon.cs @@ -665,7 +665,103 @@ namespace NP.Base.Controllers } + // pms: 5640 적용 public int CheckUserLect(string man, string cgcode, string edu, string grade, int cmno, int pcmno, long userno) + { + int result = 0; // 1:신청불가, 0:신청가능 + int rst = 0; + + string[] cgcodes = new string[0]; + string[] edus = new string[0]; + + // 29:기본교육 ,30:최초교육 ,31:계속교육 ,32:안전관리계속교육(16시간) ,33:PQ가점교육 ,34:기타교육 ,35:승급교육 + // 36:초급 ,37:중급 ,38:고급 ,39:특급 + cgcodes = "102,103,104,105".Split(','); // 직무분야:(102), 역량강화:(103,104), 전문분야(105) + edus = "30,31,35".Split(','); // 최초교육, 계속교육, 승급교육 + + // man == 28 : 건설사업관리기술인(typeman) + if (man == "28" && cgcodes.Contains(cgcode) && edus.Contains(edu)) + { + switch(cgcode) + { + case "102": // 직무분야 + if(edu == "35" && (grade == "38" || grade == "39")) // 승급교육 && (고급 || 특급) + { + // '(역량강화 또는 전문분야) + 직무분야' 조건에 의하여 직무분야 1건이상 신청불가 + rst = Dao.Get("lect.count.user6", new Hashtable() { { "userno", userno }, { "pcmno", pcmno } }).First(); + } + break; + + case "103": // 역량강화 + case "104": + switch (edu) + { + case "30": // 최초교육 + // 1건이상 신청불가 + rst = Dao.Get("lect.count.user5", new Hashtable() { { "userno", userno }, { "cgcode", cgcode }, { "edu", edu }, { "grade", grade }, { "cmno", cmno }, { "pcmno", pcmno } }).First(); + break; + + case "31": // 계속교육 + if(grade == "36" || grade == "37") // 초급 || 중급 + { + result = 1; // 신청불가 + } + // 그외는 제한 없음 + break; + + case "35": // 승급교육 + if(grade == "38" || grade == "39") + { + // '(역량강화 또는 전문분야) + 직무분야' 조건에 의하여 역량강화 또는 전문분야중 1건이상 신청불가 + rst = Dao.Get("lect.count.user6", new Hashtable() { { "userno", userno }, { "pcmno", pcmno } }).First(); + } + // 그외는 제한 없음 + break; + } + break; + + case "105": // 전문분야 + switch(edu) + { + case "30": // 최초교육 + result = 1; // 신청불가 + break; + + case "31": // 계속교육 + if (grade == "36" || grade == "37") // 초급 || 중급 + { + result = 1; // 신청불가 + } + // 그외는 제한 없음 + break; + + case "35": // 승급교육 + if (grade == "36" || grade == "37") // 초급 || 중급 + { + result = 1; // 신청불가 + } + else + { + // '(역량강화 또는 전문분야) + 직무분야' 조건에 의하여 역량강화 또는 전문분야중 1건이상 신청불가 + rst = Dao.Get("lect.count.user6", new Hashtable() { { "userno", userno }, { "pcmno", pcmno } }).First(); + } + break; + } + break; + } + } + + if (result == 0) + { + //-1= 짧은문구, smartSearch에서 오류중 짧은문구 처리할 경우 -1를 곱하여 0이하값 만들어야함 + result = rst == 0 ? 0 : ((rst > 0) ? 1 : -1); // + } + + return result; + + } + + public int CheckUserLectOld_backukp241007(string man, string cgcode, string edu, string grade, int cmno, int pcmno, long userno) { int result = 0; int rst = 0; @@ -673,46 +769,40 @@ namespace NP.Base.Controllers string[] cgcodes = new string[0]; string[] edus = new string[0]; - if (DateTime.Now > DateTime.Parse("2030-01-02 00:00"))// ### ty 2024년 추가건이나 현재 적용대기로 전달 받음 + + // 29:기본교육 ,30:최초교육 ,31:계속교육 ,32:안전관리계속교육(16시간) ,33:PQ가점교육 ,34:기타교육 ,35:승급교육 + // 36:초급 ,37:중급 ,38:고급 ,39:특급 + cgcodes = "103,104,105".Split(','); + edus = "30,31,35".Split(','); // 최초교육, 계속교육, 승급교육 + + // man == 28 : 건설사업관리기술인(typeman) + if (man == "28" && cgcodes.Contains(cgcode) && edus.Contains(edu)) { - // ### ty 2024년 적용!!! - - // 29:기본교육 ,30:최초교육 ,31:계속교육 ,32:안전관리계속교육(16시간) ,33:PQ가점교육 ,34:기타교육 ,35:승급교육 - // 36:초급 ,37:중급 ,38:고급 ,39:특급 - cgcodes = "103,104,105".Split(','); - edus = "30,31,35,107,108".Split(','); // 최초교육, 계속교육, 승급교육 - - // man == 28 : 건설사업관리기술인(typeman) - if (man == "28" && cgcodes.Contains(cgcode) && edus.Contains(edu)) + // 계속교육(31) + if (edu == "31" && (cgcode == "103" || cgcode == "104") && (grade == "36" || grade == "37")) // 계속교육, (103 or 104), (초급 or 중급) { - // 계속교육(31) - if ((edu == "31" || edu == "107" || edu == "108") && (cgcode == "103" || cgcode == "104" || cgcode == "105") && (grade == "36" || grade == "37")) // 계속교육, (103 or 104 or 105), (초급 or 중급) - { - result = 1; // 신청불가 - } - // 계속교육(31) - else if ((edu == "31" || edu == "107" || edu == "108") && (cgcode == "103" || cgcode == "104" || cgcode == "105") && (grade == "38" || grade == "39")) // 계속교육, (103 or 104 or 105), (고급 or 특급) + result = 1; // 신청불가 + } + else + { + // 갯수를 가져오기 + // 최초교육(30) + if (edu == "30" && cgcode == "105") // 최초교육 , 105 { rst = 0; // 신청가능 } - // 최초교육(30) - else if (edu == "30" && cgcode == "105") // 최초교육, 전문분야(105) + // 계속교육(31) + else if (edu == "31" && cgcode == "105" && (grade == "36" || grade == "37")) // 계속교육, 105, (초급 or 중급) { - result = 1; // 신청불가 + rst = 0; // 신청가능 } // 승급교육(35) - else if (edu == "35" && cgcode == "105" && (grade == "36" || grade == "37")) // 최초교육, 전문분야(105), 36:초급 ,37:중급 - { - result = 1; // 신청불가 - }// 승급교육(35) - else if (edu == "35" && (cgcode == "103" || cgcode == "104") && (grade == "36" || grade == "37")) // 승급교육 , 103,104, 36:초급 ,37:중급 + else if (edu == "35" && (cgcode == "103" || cgcode == "104" || cgcode == "105") && (grade == "36" || grade == "37")) // 승급교육, (103 or 104 or 105), (초급 or 중급) { rst = 0; // 신청가능 } else { - - // 갯수를 가져오기 /* * 기본 설계 쿼리 select t5.typegrade, t5.typeman, t5.typeedu, t3.cgcode, t1.lectno, t1.userno @@ -727,94 +817,24 @@ namespace NP.Base.Controllers // 29:기본교육 ,30:최초교육 ,31:계속교육 ,32:안전관리계속교육(16시간) ,33:PQ가점교육 ,34:기타교육 ,35:승급교육 // 36:초급 ,37:중급 ,38:고급 ,39:특급 */ - // "lect.count.user2" > 103,104,105 // "lect.count.user3" > 103,104 - - // 최초교육(30) , (103,104), - if (edu == "30" && (cgcode == "103" || cgcode == "104")) + if ((edu == "31" || edu == "35") && (grade == "38" || grade == "39")) // 계속교육, 승급교육 && 고급, 특급 { - var lectCount = Dao.Get("lect.count.user3", new Hashtable() { { "userno", userno }, { "cgcode", cgcode }, { "edu", edu }, { "grade", grade }, { "cmno", cmno }, { "pcmno", pcmno } }); + var lectCount = Dao.Get("lect.count.user2", new Hashtable() { { "userno", userno }, { "cgcode", cgcode }, { "edu", edu }, { "grade", grade }, { "cmno", cmno }, { "pcmno", pcmno } }); rst = lectCount.First(); } - // 승급교육(35), 38:고급 ,39:특급 - else if (edu == "35" && (grade == "38" || grade == "39")) + else if ((cgcode == "103" || cgcode == "104") && edu == "30") // 최초 { - var lectCount = Dao.Get("lect.count.user2", new Hashtable() { { "userno", userno }, { "cmno", cmno }, { "pcmno", pcmno } }); + var lectCount = Dao.Get("lect.count.user3", new Hashtable() { { "userno", userno }, { "cmno", cmno }, { "pcmno", pcmno } }); rst = lectCount.First(); } - } - - } - } - else - { - // 29:기본교육 ,30:최초교육 ,31:계속교육 ,32:안전관리계속교육(16시간) ,33:PQ가점교육 ,34:기타교육 ,35:승급교육 - // 36:초급 ,37:중급 ,38:고급 ,39:특급 - cgcodes = "103,104,105".Split(','); - edus = "30,31,35".Split(','); // 최초교육, 계속교육, 승급교육 - - // man == 28 : 건설사업관리기술인(typeman) - if (man == "28" && cgcodes.Contains(cgcode) && edus.Contains(edu)) - { - // 계속교육(31) - if (edu == "31" && (cgcode == "103" || cgcode == "104") && (grade == "36" || grade == "37")) // 계속교육, (103 or 104), (초급 or 중급) - { - result = 1; // 신청불가 - } - else - { - // 갯수를 가져오기 - // 최초교육(30) - if (edu == "30" && cgcode == "105") // 최초교육 , 105 - { - rst = 0; // 신청가능 - } - // 계속교육(31) - else if (edu == "31" && cgcode == "105" && (grade == "36" || grade == "37")) // 계속교육, 105, (초급 or 중급) - { - rst = 0; // 신청가능 - } - // 승급교육(35) - else if (edu == "35" && (cgcode == "103" || cgcode == "104" || cgcode == "105") && (grade == "36" || grade == "37")) // 승급교육, (103 or 104 or 105), (초급 or 중급) - { - rst = 0; // 신청가능 - } else { - /* - * 기본 설계 쿼리 - select t5.typegrade, t5.typeman, t5.typeedu, t3.cgcode, t1.lectno, t1.userno - from lect t1 - inner join cm t2 on t1.cmno = t2.cmno - inner join cg t3 on t2.cgno= t3.cgno - inner join pay t4 on t1.payno = t4.payno - inner join pplog t5 on t1.cmno= t5.cmno and t1.userno = t5.userno and t4.pplno = t5.pplno - where t1.status = 1 and t4.pstatus= 1 - and t3.cgcode = 103 -- and t1.userno=82 -- 82,5,31 - - // 29:기본교육 ,30:최초교육 ,31:계속교육 ,32:안전관리계속교육(16시간) ,33:PQ가점교육 ,34:기타교육 ,35:승급교육 - // 36:초급 ,37:중급 ,38:고급 ,39:특급 - */ - // "lect.count.user2" > 103,104,105 - // "lect.count.user3" > 103,104 - if ((edu == "31" || edu == "35") && (grade == "38" || grade == "39")) // 계속교육, 승급교육 && 고급, 특급 - { - var lectCount = Dao.Get("lect.count.user2", new Hashtable() { { "userno", userno }, { "cgcode", cgcode }, { "edu", edu }, { "grade", grade }, { "cmno", cmno }, { "pcmno", pcmno } }); - rst = lectCount.First(); - } - else if ((cgcode == "103" || cgcode == "104") && edu == "30") // 최초 - { - var lectCount = Dao.Get("lect.count.user3", new Hashtable() { { "userno", userno }, { "cmno", cmno }, { "pcmno", pcmno } }); - rst = lectCount.First(); - } - else - { - var lectCount = Dao.Get("lect.count.user", new Hashtable() { { "userno", userno }, { "cgcode", cgcode }, { "edu", edu }, { "cmno", cmno }, { "pcmno", pcmno } }); - rst = lectCount.First(); - } - + var lectCount = Dao.Get("lect.count.user", new Hashtable() { { "userno", userno }, { "cgcode", cgcode }, { "edu", edu }, { "cmno", cmno }, { "pcmno", pcmno } }); + rst = lectCount.First(); } + } } } diff --git a/Dao/MyBatis/Maps/Lect.xml b/Dao/MyBatis/Maps/Lect.xml index 34d26df..0e64461 100644 --- a/Dao/MyBatis/Maps/Lect.xml +++ b/Dao/MyBatis/Maps/Lect.xml @@ -2678,8 +2678,51 @@ inner join cg t3 on t2.cgno= t3.cgno where (t1.status = 1 or t1.status = 2) and t2.isdel= 0 and t2.isuse= 1 and t2.ismaster = 0 and t1.userno = #userno# and t2.pcmno = #pcmno# - - + select max(lectCnt) * min(checkNum) + from ( + select count(t1.lectno) as lectCnt, 1 as checkNum + from lect t1 + inner join cm t2 on t1.cmno = t2.cmno + inner join cg t3 on t2.cgno= t3.cgno + inner join pay t4 on t1.payno = t4.payno + inner join pplog t5 on t1.cmno= t5.cmno and t1.userno = t5.userno and t4.pplno = t5.pplno + where (t1.status = 1 or t1.status = 2) and (t4.pstatus= 1 or t4.pstatus=22) and t3.cgcode in (103,104) and t5.typeedu = #edu# + and t1.userno = #userno# and t5.typeman = 28 + union + select 0 as lectCnt, (case when count(t1.lectno) > 0 then -1 else 1 end) as checkNum + from lect t1 + inner join cm t2 on t1.cmno = t2.cmno + inner join cg t3 on t2.cgno= t3.cgno + where (t1.status = 1 or t1.status = 2) and t2.isdel= 0 and t2.isuse= 1 and t2.ismaster = 0 and t1.userno = #userno# and t2.pcmno = #pcmno# + )t + + + + + + + + +@*신청 전 필수 확인 건설사업관리(계속교육)*@ + + +@*신청 전 필수 확인 건설사업관리(승급교육)*@ + + @section scriptsHeader{ } @@ -340,8 +393,15 @@ @*msg("전문분야을 입력하세요.");*@ $("#stringval2").focus(); return; } - - $("#indexForm").attr("action", "/Course/SmartSearch").submit(); + let sch2 = $("#sch2").val(); + let sch3 = $("#sch3").val(); + let sch4 = $("#sch4").val(); + if (sch2 == "28" && (sch3 == "31" || sch3 == "35") && (sch4 == "38" || sch4 == "39")) { + addConfirm(sch3) + } + else { + $("#indexForm").attr("action", "/Course/SmartSearch").submit(); + } }); $('.msSel span').click(function () { @@ -373,6 +433,24 @@ msg("이미 신청된 강좌입니다. 메인화면으로 이동되었습니다."); } }); + + function addConfirm(sch3) { + $("#edu" + sch3 + "ConfirmMsg").show() + } + + function addConfirmSubmit() { + let sch3 = $("#sch3").val(); + if ($("#edu" + sch3 + "Chk:checked").val() == "1") { + $("#indexForm").attr("action", "/Course/SmartSearch").submit(); + } + else { + //msg("체크박스를 체크해주시기 바랍니다.") + $("#edu" + sch3 + "ChkErr").show() + alert("체크박스를 체크해주시기 바랍니다.") + } + + } + function schIpt(num, code, name) { @@ -493,7 +571,7 @@ } if (num == 3) { - + if ($("#msSel3 > span").text() == "승급교육") { $("#msSel4 > span").text("승급 후 등급") } @@ -783,4 +861,4 @@ } } -} +} diff --git a/FO/css/dev.css b/FO/css/dev.css index 0c306cd..6075f71 100644 --- a/FO/css/dev.css +++ b/FO/css/dev.css @@ -278,4 +278,70 @@ ul.filebox a.filedel{margin-right: 5px; background-color: #fff; border: 1px soli #confirmbox { padding: 40px 10%; } -} \ No newline at end of file +} + +/*신청 전 필수 확인*/ +.mainconfirmbox { + position: fixed; + top: 50%; + text-align: center; + width: 90%; + line-height: 50px; + font-size: 18px; + z-index: 3000; + display: none; + max-width: 640px; + left: 50%; + transform: translate(-50%, -50%); +} + + .mainconfirmbox .box_bg { + background-color: #fff; + padding: 20px; + } + + .mainconfirmbox h1 { + font-size: 24px; + color: #fff; + background-color: #000; + } + + .mainconfirmbox h2 { + font-size: 20px; + color: red; + display: inline-block; + margin: 20px 0; + } + + .mainconfirmbox h2::after { + content: ''; + display: block; + width: 100%; + border: 1px solid #5e5e5e; + margin-top: -13px; + } + + .mainconfirmbox p { + font-size: 16px; + line-height: 1.5em; + font-weight: 700; + margin: 15px; + } + + .mainconfirmbox p span.red { + color: red; + } + + .mainconfirmbox p span.blue { + color: blue; + } + + .mainconfirmbox input { + margin-right: 10px; + } + + .mainconfirmbox .confirmbtnbox { + background-color: currentColor; + padding-bottom: 0; + margin-top: 0; + } \ No newline at end of file