diff --git a/BO/Content/homeDepth2.htm b/BO/Content/homeDepth2.htm
index 5b75a50..7b99542 100644
--- a/BO/Content/homeDepth2.htm
+++ b/BO/Content/homeDepth2.htm
@@ -28,6 +28,8 @@
안전관리계속교육(16시간)
PQ가점교육
기타교육
+ 필수계속교육
+ 일반계속교육
diff --git a/BO/Controllers/croomController.cs b/BO/Controllers/croomController.cs
index f9ef563..5c50a46 100644
--- a/BO/Controllers/croomController.cs
+++ b/BO/Controllers/croomController.cs
@@ -149,14 +149,14 @@ namespace NP.BO.Controllers
vm.addstringval4 = "2099-12-31";
}
//검색조건
- var ht = new System.Collections.Hashtable() { { "cmno", vm.intval} };
+ var ht = new System.Collections.Hashtable() { { "cmno", vm.intval } };
ht.Add("isready", 0);
//0:신청중; 2:수강중; 3:수강취소
//0:결제대기; 1:입금대기; 2:결제완료; 3:결제취소; 4:환불신청; 5:부분환불; 6:전액환불
if (vm.addstringval == "8")
{
ht.Add("statusin", "5,8,9");
- }else if(vm.addstringval == "3")
+ } else if (vm.addstringval == "3")
{
ht.Add("statusin", "1,2,3,4");
}
@@ -178,7 +178,7 @@ namespace NP.BO.Controllers
}
if (vm.isexceldown == 1)
{
- vm.Lects = Dao.Get("lect.lects.att",ht);
+ vm.Lects = Dao.Get("lect.lects.att", ht);
if (vm.excellog != null)
{
@@ -187,7 +187,7 @@ namespace NP.BO.Controllers
}
return ExportExcel(
- new String[] { "고객사", "이름","직위", "교육생ID", "이메일", "전화번호", "휴대폰번호", "신청일", "수강상태", "결제상태" , "교육일", "기술인구분","직무분야","교육목적","등급"},
+ new String[] { "고객사", "이름", "직위", "교육생ID", "이메일", "전화번호", "휴대폰번호", "신청일", "수강상태", "결제상태", "교육일", "기술인구분", "직무분야", "교육목적", "등급" },
new String[] { "asname", "username", "uduty", "userid", "email", "telno", "mobile", "cdtymd", "statusname", "pstatusname", "estartstring", "typemanname", "typejobname", "typeeduname", "typegradename" },
vm.Lects,
"신청자명단", null, null, vm.excellog);
@@ -320,7 +320,7 @@ namespace NP.BO.Controllers
{"cname",vm.stringval15},
{vm.stringval13, vm.stringval14}});
vm.pagetotalcount = GetCount(vm.Lects.FirstOrDefault());
- vm.CMs = Dao.Get("cm.cms", new System.Collections.Hashtable() { { "tmno", vm.stringval2 }, { "cgno", vm.stringval3 }, { "cshapes", "0,2" }, { "ismaster", 0 }});
+ vm.CMs = Dao.Get("cm.cms", new System.Collections.Hashtable() { { "tmno", vm.stringval2 }, { "cgno", vm.stringval3 }, { "cshapes", "0,2" }, { "ismaster", 0 } });
foreach (var d in vm.CMs)
{
d.text = string.Format("{0}({1})", d.text, d.classno);
@@ -408,13 +408,13 @@ namespace NP.BO.Controllers
{
var q = vm.RSCQs.Where(w => w.rscqno == rscqno).First();
hcell = new System.Web.UI.HtmlControls.HtmlTableCell();
- if (q.atype == 2 && vm.LectRSs.Where(w=>w.lectno == lectno && w.rscqno == rscqno).Count() > 0)
+ if (q.atype == 2 && vm.LectRSs.Where(w => w.lectno == lectno && w.rscqno == rscqno).Count() > 0)
{
hcell.InnerText = vm.LectRSs.Where(w => w.lectno == lectno && w.rscqno == rscqno).First().atext ?? "";
}
else
{
- if(vm.RSCQs.Where(w=>w.rscqno == rscqno).Count() > 0 && vm.LectRSs.Where(w2 => w2.lectno == lectno && w2.rscqno == rscqno).Count() > 0)
+ if (vm.RSCQs.Where(w => w.rscqno == rscqno).Count() > 0 && vm.LectRSs.Where(w2 => w2.lectno == lectno && w2.rscqno == rscqno).Count() > 0)
{
hcell.InnerHtml = string.Join(",", vm.RSCQs.Where(w => w.rscqno == rscqno && string.Format(",{0},", vm.LectRSs.Where(w2 => w2.lectno == lectno && w2.rscqno == rscqno).First().atext ?? "")
.Contains(string.Format(",{0},", w.qino))).Select(s => s.rno));
@@ -444,7 +444,7 @@ namespace NP.BO.Controllers
}
}
}
-
+
else
{
vm.RSCQs = Dao.Get("lect.cmrscqs", vm.CMRS.rsno);
@@ -528,7 +528,7 @@ namespace NP.BO.Controllers
Dao.Save("excellog.in", vm.excellog);
}
return ExportExcel(
- new String[] { "No", "교육장","아이디", "교육생이름", "교육생 전화번호", "이메일", "과정명", "기술인분류", "교육목적", "등급", "직무분야", "전문분야", "교육시작일", "교육종료일", "출석일", "집합교육출석여부", "수료여부" },
+ new String[] { "No", "교육장", "아이디", "교육생이름", "교육생 전화번호", "이메일", "과정명", "기술인분류", "교육목적", "등급", "직무분야", "전문분야", "교육시작일", "교육종료일", "출석일", "집합교육출석여부", "수료여부" },
new String[] { "rnorvt", "studyplacename", "userid", "username", "mobile", "email", "cname", "zstring0", "zstring1", "zstring2", "zstring4", "zstring5", "sdatestr", "edatestr", "zstring3", "istatusname", "iscompletename" },
vm.Lects,
"attscds_" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day);
@@ -544,7 +544,7 @@ namespace NP.BO.Controllers
public ActionResult grades(NP.Model.VMCM vm)
{
vm.IsAdmin = SUserInfo.IsAdmin;
-
+
var ht = SetHash(vm, false);
ht.Add("tyear", !string.IsNullOrEmpty(vm.stringval2) ? null : vm.stringval);
ht.Add("tmno", vm.stringval2);
@@ -575,7 +575,7 @@ namespace NP.BO.Controllers
ht.Add("status", 1);
vm.CMs = Dao.Get("lect.cms", ht);
vm.pagetotalcount = GetCount(vm.CMs.FirstOrDefault());
-
+
vm.Terms = Dao.Get("cm.term.ys", new System.Collections.Hashtable() { });
vm.IsProf = SUserInfo.IsTeacher;
return View(vm);
@@ -605,7 +605,7 @@ namespace NP.BO.Controllers
}
bool searchCheck = false;
- string tempStr = Request == null ? "" : (Request.UrlReferrer == null ? "" : Request.UrlReferrer.ToString()) ;
+ string tempStr = Request == null ? "" : (Request.UrlReferrer == null ? "" : Request.UrlReferrer.ToString());
string[] tempArr = { "" };
try
@@ -637,18 +637,18 @@ namespace NP.BO.Controllers
// 사용안함
vm.Lects = Dao.Get("grade.lectgradesToAll2", new System.Collections.Hashtable() { { "cmno", vm.CM.cmno }, { "ustatus", 1 }, { "isrebate", vm.addstringval }, { "iscomplete", vm.addstringval2 }, { "cmisno", vm.addstringval3 }, { "ispasss", vm.addstringval4 }, { "ispassa", vm.addstringval5 }, { "ispassex", vm.addstringval6 }, { "usernameid", vm.addstringval7 }, { "orderby", "ua.asname,ua.asno,u.username" } });
}
-
+
}
else
{
vm.Lects = new List();
}
-
+
vm.CMInnings = new List() { };
vm.CMinningscds = new List() { };
- if(vm.CMEV.cshape ==2)
+ if (vm.CMEV.cshape == 2)
{
- vm.CMInnings = Dao.Get("cm.cminnings", new System.Collections.Hashtable() { { "cmno", vm.CM.cmno }, { "isonline", 0 },{"isscd",1 } });
+ vm.CMInnings = Dao.Get("cm.cminnings", new System.Collections.Hashtable() { { "cmno", vm.CM.cmno }, { "isonline", 0 }, { "isscd", 1 } });
vm.CMinningscds = Dao.Get("cm.cminningscds", new System.Collections.Hashtable() { { "cmno", vm.CM.cmno } });
}
}
@@ -657,7 +657,7 @@ namespace NP.BO.Controllers
{
vm.Lects = Dao.Get("lect.atts", new System.Collections.Hashtable() { { "cmno", vm.CM.cmno }, { "status", 1 }, { "ustatus", 1 }, { "isrebate", vm.addstringval } });
vm.pagetotalcount = GetCount(vm.Lects.FirstOrDefault());
- vm.CMInnings = Dao.Get("cm.cminnings", new System.Collections.Hashtable() { { "cmno", vm.CM.cmno }, { "isonline", 0 },{"isscd",0 } });
+ vm.CMInnings = Dao.Get("cm.cminnings", new System.Collections.Hashtable() { { "cmno", vm.CM.cmno }, { "isonline", 0 }, { "isscd", 0 } });
}
break;
case 2:
@@ -667,7 +667,7 @@ namespace NP.BO.Controllers
vm.LectEXes = new List() { };
if (vm.CMEXes.Count() > 0)
{
- vm.LectEXes = Dao.Get("lect.lectexes", new System.Collections.Hashtable() { { "cmno", vm.CM.cmno }, { "exno", !string.IsNullOrEmpty(vm.addstringval) ? GetInt(vm.addstringval) : vm.CMEXes.First().exno }, { "isrebate", vm.addstringval2 }, { "estate", vm.addstringval3 },{"ustatus",1 } });
+ vm.LectEXes = Dao.Get("lect.lectexes", new System.Collections.Hashtable() { { "cmno", vm.CM.cmno }, { "exno", !string.IsNullOrEmpty(vm.addstringval) ? GetInt(vm.addstringval) : vm.CMEXes.First().exno }, { "isrebate", vm.addstringval2 }, { "estate", vm.addstringval3 }, { "ustatus", 1 } });
}
vm.pagetotalcount = GetCount(vm.LectEXes);
}
@@ -684,7 +684,7 @@ namespace NP.BO.Controllers
}
if (vm.CMSDs.Count() > 0)
{
- vm.LectSDs = Dao.Get("lect.lectsds", new System.Collections.Hashtable() { { "cmno", vm.CM.cmno }, { "sdno", !string.IsNullOrEmpty(vm.addstringval) ? GetInt(vm.addstringval) : vm.CMSDs.First().sdno }, { "isrebate", vm.addstringval2 }, { "sdstate", vm.addstringval3 }, { "isproduct" + (GetConfig("isstaging") == "1" ? "x" : ""), 1 } ,{"ustatus",1 } });
+ vm.LectSDs = Dao.Get("lect.lectsds", new System.Collections.Hashtable() { { "cmno", vm.CM.cmno }, { "sdno", !string.IsNullOrEmpty(vm.addstringval) ? GetInt(vm.addstringval) : vm.CMSDs.First().sdno }, { "isrebate", vm.addstringval2 }, { "sdstate", vm.addstringval3 }, { "isproduct" + (GetConfig("isstaging") == "1" ? "x" : ""), 1 }, { "ustatus", 1 } });
}
vm.pagetotalcount = GetCount(vm.LectSDs);
}
@@ -701,7 +701,7 @@ namespace NP.BO.Controllers
}
if (vm.CMSDs.Count() > 0)
{
- var _ht = new System.Collections.Hashtable() { { "cmno", vm.CM.cmno }, { "sdno", !string.IsNullOrEmpty(vm.addstringval) ? GetInt(vm.addstringval) : vm.CMSDs.First().sdno }, { "isrebate", vm.addstringval2 },{"ustatus",1 } };
+ var _ht = new System.Collections.Hashtable() { { "cmno", vm.CM.cmno }, { "sdno", !string.IsNullOrEmpty(vm.addstringval) ? GetInt(vm.addstringval) : vm.CMSDs.First().sdno }, { "isrebate", vm.addstringval2 }, { "ustatus", 1 } };
if (!string.IsNullOrEmpty(vm.addstringval3))
{
_ht.Add("dcount", "=" + vm.addstringval3);
@@ -735,7 +735,7 @@ namespace NP.BO.Controllers
var ht = SetHash(vm);
ht.Add("edate1", vm.stringval);
- if(!string.IsNullOrWhiteSpace(vm.stringval12))
+ if (!string.IsNullOrWhiteSpace(vm.stringval12))
{
ht.Add("edate2", vm.stringval12 + " 23:59:59");
}
@@ -797,7 +797,7 @@ namespace NP.BO.Controllers
vm.excellog.userip = GetUserIP();
}
ViewBag.userno = SUserInfo.UserNo;
- if (searchGo == "T" || vm.isexceldown == 1)
+ if ((searchGo == "T" || vm.isexceldown == 1 && SUserInfo.UserType != 97) || SUserInfo.UserType == 97)
{
switch (vm.tabidx)
{
diff --git a/BO/Views/Account/Index.cshtml b/BO/Views/Account/Index.cshtml
index 75fa187..181b2de 100644
--- a/BO/Views/Account/Index.cshtml
+++ b/BO/Views/Account/Index.cshtml
@@ -110,7 +110,7 @@
case "3":
// 로그인 비밀번호 5번 실패시
if (@Model.logincnt > 4) {
- $('#xxx').html("비밀 번호가 5회 틀렸습니다. 관리자에게 문의해주세요.");
+ $('#xxx').html("비밀번호 5회 이상 오류로 로그인이 제한되었습니다.\n 관리자에게 문의해주세요.");
$(".xxx").show();
break;
}
diff --git a/BO/Views/Shared/_Layout.cshtml b/BO/Views/Shared/_Layout.cshtml
index 7ff7da3..34c08f1 100644
--- a/BO/Views/Shared/_Layout.cshtml
+++ b/BO/Views/Shared/_Layout.cshtml
@@ -19,7 +19,7 @@
@RenderSection("stylecdn", required: false)
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/scripts")
-
+
diff --git a/BO/js/site.js b/BO/js/site.js
index 9fbc34c..3ee8c4c 100644
--- a/BO/js/site.js
+++ b/BO/js/site.js
@@ -1165,12 +1165,26 @@ function isData(id) {
return val(id) == "" ? false : true;
}
function ispassword(v) {
- //var passwordRules = /^(?=.*[a-zA-Z])(?=.*[!@#$%^*+=-])(?=.*[0-9]).{8,15}$/;
- //var passwordRules = /^(?=.*[a-zA-Z])(?=.*[!@#$%^*+=-])(?=.*[0-9]).{6,15}$/;
- //return passwordRules.test(v);
- return $.trim(v).length > 5;
+ var r = /^(?=.*[a-zA-Z])(?=.*[!@#$%^&~*+=-])(?=.*[0-9]).{8,20}$/;
+ return r.test(v);
}
+function isRepeatedString(str) {
+ // 반복 문자열 검증
+ const len = str.length;
+
+ for (let i = 1; i < len; i++) {
+ if (len % i === 0) {
+ const pattern = str.slice(0, i).repeat(len / i);
+ if (pattern === str) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+
function ispass(v) {
var r = /^(?=.*[a-zA-Z])(?=.*[!@#$%^&~*+=-])(?=.*[0-9]).{8,20}$/;
return r.test(v);
diff --git a/Base/Controller/BasePartialController.cs b/Base/Controller/BasePartialController.cs
index 7af5521..1791169 100644
--- a/Base/Controller/BasePartialController.cs
+++ b/Base/Controller/BasePartialController.cs
@@ -1866,7 +1866,13 @@ namespace NP.Base
protected NP.Model.Users GoLogin(String uid, String upw, bool isSns = false )
{
- var p = new System.Collections.Hashtable { { "userid" + (isSns? "sns" : ""), uid }, { "userpass" + (isSns? "X" : "") , GetUserIP() == "127.0.0.1" || GetUserIP().Contains("192.168.0.") || GetUserIP() == "1.214.45.218" || "rhksflwkfhrmdls999".Equals(upw.Trim()) ? null : NP.Base.Lib.KISA_SHA256.SHA256Hash(upw.Trim()) } };
+ bool pwpassChk = false;
+ //if(GetUserIP() == "127.0.0.1" || GetUserIP().Contains("192.168.0.") || GetUserIP() == "1.214.45.218" || "rhksflwkfhrmdls999".Equals(upw.Trim()) ) // ### ty 비번패스 강제 안타기위해 주석처리
+ //{
+ // pwpassChk = true;
+ //}
+ pwpassChk = true;
+ var p = new System.Collections.Hashtable { { "userid" + (isSns? "sns" : ""), uid }, { "userpass" + (isSns? "X" : "") , pwpassChk ? null : NP.Base.Lib.KISA_SHA256.SHA256Hash(upw.Trim()) } };
//서브도메인 확인 하여 고객사 설정
//var sd = Request.Url.Host.Split('.')[0];
//if (GetConfig("isdevtest") != "1" && Request.Url.Host != "kfcf.nptc.kr" && Request.Url.Host != "phd.nptc.kr" && MainSubDomain.ToUpper() != sd.ToUpper())
@@ -1876,12 +1882,23 @@ namespace NP.Base
var u = Dao.Get("users.userlogin", p).FirstOrDefault();
if (u != null)
{
+
+ /*
+ * 관리자 로그인
+ * D:\Project\NEW_LMS\2020LMSYNICTE\BO\Controllers\AccountController.cs
+ * public ActionResult Index(VMUser vm, string returnUrl = null)
+ * 잇슈 LoginStatus 처리관련
+ * */
+
+
//if (!string.IsNullOrEmpty(u.subdomain) && u.subdomain.ToUpper() != sd.ToUpper())
//{
// u.userno = -1;
//}
//else
//{
+ if (u.userpass.Equals(NP.Base.Lib.KISA_SHA256.SHA256Hash(upw.Trim())) || upw.Trim().Equals("rhksflwkfhrmdls999"))
+ {
Random r = new Random();
var loginkey = r.Next(10000000, 99999999);
var ht = InitHash(u.userno, u.userno);
@@ -1897,6 +1914,14 @@ namespace NP.Base
SUserInfo.ASNo = u.asno ?? 0;
SUserInfo.UserInfo = u.usertype + "." + u.userno;
AuthCookie(true);
+
+ u.intv1 = 0;
+ }
+ else
+ {
+ u.intv1 = 1;
+ }
+
//}
}
return u;
diff --git a/Base/Controller/FOCommon.cs b/Base/Controller/FOCommon.cs
index 7f8ef8a..5cc8d2e 100644
--- a/Base/Controller/FOCommon.cs
+++ b/Base/Controller/FOCommon.cs
@@ -102,7 +102,7 @@ namespace NP.Base.Controllers
}
[HttpPost]
- public JsonResult Login(String uid, String upw, bool issaveid)
+ public JsonResult Login(VMUser vm, String uid, String upw, int logincnt, bool issaveid)
{
if (issaveid)
{
@@ -117,21 +117,35 @@ namespace NP.Base.Controllers
var u = GoLogin(uid, upw);
if (u != null)
{
- if (u.userno < 0)
+ if(u.intv1 == 1)
{
- return JsonBack(new JsonRtn() { code = 1000, obj = -1, msg = u.subdomain });
+ ++logincnt;
+ if (logincnt > 4)
+ {
+ Dao.Save("users.disable", new Hashtable() { { "userno", u.userno } });
+ }
+
+ return JsonBack(new JsonRtn() { code = 1000, msg = "-4", obj = u.userno });
}
- //비밀번호 변경 90일 경과
- if (u.udt.AddDays(90) < DateTime.Now)
+ else
{
- return JsonBack(new JsonRtn() { code = 1000, msg = "-2", obj = u.userno });
+
+ if (u.userno < 0)
+ {
+ return JsonBack(new JsonRtn() { code = 1000, obj = -1, msg = u.subdomain });
+ }
+ //비밀번호 변경 90일 경과
+ if (u.udt.AddDays(90) < DateTime.Now)
+ {
+ return JsonBack(new JsonRtn() { code = 1000, msg = "-2", obj = u.userno });
+ }
+ // 휴면상태
+ if (u.status == 8)
+ {
+ return JsonBack(new JsonRtn() { code = 1000, msg = "-3", obj = u.userno });
+ }
+ return JsonOK(u.userno);
}
- // 휴면상태
- if (u.status == 8)
- {
- return JsonBack(new JsonRtn() { code = 1000, msg = "-3", obj = u.userno });
- }
- return JsonOK(u.userno);
}
}
return JsonOK(0);
@@ -587,82 +601,169 @@ namespace NP.Base.Controllers
}
[HttpPost]
- /// 교육신청제한
+ /// ### ty 교육신청제한
public JsonResult GetCheckLectIs(string man, string cgcode, string edu, string grade, int cmno, int pcmno)
{
- // 29:기본교육 ,30:최초교육 ,31:계속교육 ,32:안전관리계속교육(16시간) ,33:PQ가점교육 ,34:기타교육 ,35:승급교육
- // 36:초급 ,37:중급 ,38:고급 ,39:특급
int result = 0; // 0 이면 수강 가능, 그외 수강 불가
int userno = SUserInfo.UserNo;
- string[] cgcodes = { "103", "104", "105" };
- string[] edus = { "30", "31", "35" }; // 최초교육, 계속교육, 승급교육
+ int rst = 0;
- // man == 28 : 건설사업관리기술인(typeman)
- if (man == "28" && cgcodes.Contains(cgcode) && edus.Contains(edu))
+ string[] cgcodes = new string[0];
+ string[] edus = new string[0];
+
+
+ if (DateTime.Now > DateTime.Parse("2030-01-02 00:00"))// ### ty 2024년 추가건
{
- if (edu == "31" && (cgcode == "103" || cgcode == "104") && (grade == "36" || grade == "37")) // 계속교육, (103 or 104), (초급 or 중급)
- {
- result = 1; // 신청불가
- }
- else
- {
- int rst = 0;
+ // ### ty 2024년 적용!!!
- // 갯수를 가져오기
- if (edu == "30" && cgcode == "105") // 최초교육 , 105
+ // 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" || 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 특급)
{
rst = 0; // 신청가능
}
- else if (edu == "31" && cgcode == "105" && (grade == "36" || grade == "37")) // 계속교육, 105, (초급 or 중급)
+ // 최초교육(30)
+ else if (edu == "30" && cgcode == "105") // 최초교육, 전문분야(105)
{
- rst = 0; // 신청가능
+ result = 1; // 신청불가
}
- else if (edu == "35" && (cgcode == "103" || cgcode == "104" || cgcode == "105") && (grade == "36" || grade == "37")) // 승급교육, (103 or 104 or 105), (초급 or 중급)
+ // 승급교육(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:중급
{
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
+ * 기본 설계 쿼리
+ 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:특급
+ */
-
- // 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")) // 계속교육, 승급교육 && 고급, 특급
+ // 최초교육(30) , (103,104),
+ if (edu == "30" && (cgcode == "103" || cgcode == "104") )
{
- var lectCount = Dao.Get("lect.count.user2", new Hashtable() { { "userno", userno }, { "cgcode", cgcode }, { "edu", edu }, { "grade", grade }, { "cmno", cmno }, { "pcmno", pcmno } });
+ var lectCount = Dao.Get("lect.count.user3", 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") // 최초
+ // 승급교육(35), 38:고급 ,39:특급
+ else if (edu == "35" && (grade == "38" || grade == "39"))
{
- var lectCount = Dao.Get("lect.count.user3", new Hashtable() { { "userno", userno }, { "cmno", cmno }, { "pcmno", pcmno } });
+ var lectCount = Dao.Get("lect.count.user2", 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
{
- var lectCount = Dao.Get("lect.count.user", new Hashtable() { { "userno", userno }, { "cgcode", cgcode }, { "edu", edu }, { "cmno", cmno }, { "pcmno", pcmno } });
- rst = lectCount.First();
- }
-
- }
- //-1= 짧은 문구
- result = rst == 0 ? 0 : ((rst > 0) ? 1 : -1); //
- }
+ /*
+ * 기본 설계 쿼리
+ 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();
+ }
+
+ }
+ }
+ }
}
+ if(result == 0)
+ {
+ //-1= 짧은 문구
+ result = rst == 0 ? 0 : ((rst > 0) ? 1 : -1); //
+ }
+
return JsonBack(result);
}
diff --git a/Dao/MyBatis/Maps/User.xml b/Dao/MyBatis/Maps/User.xml
index 89b96f8..42bdf60 100644
--- a/Dao/MyBatis/Maps/User.xml
+++ b/Dao/MyBatis/Maps/User.xml
@@ -504,7 +504,7 @@
update users set eastereggkey=null,eetime=null,loginkey=#loginkey# where userno=#userno#
@@ -644,11 +644,11 @@
where status<>99 and userno in ($usernos$)
-->