diff --git a/BO/BO.csproj b/BO/BO.csproj index 2817f2e..4a9cfbb 100644 --- a/BO/BO.csproj +++ b/BO/BO.csproj @@ -500,6 +500,7 @@ + @@ -706,6 +707,7 @@ + diff --git a/BO/Content/file/gradeupload.xlsx b/BO/Content/file/gradeupload.xlsx new file mode 100644 index 0000000..caafe90 Binary files /dev/null and b/BO/Content/file/gradeupload.xlsx differ diff --git a/BO/Controllers/croomController.cs b/BO/Controllers/croomController.cs index 09e4d22..3cb3991 100644 --- a/BO/Controllers/croomController.cs +++ b/BO/Controllers/croomController.cs @@ -863,8 +863,8 @@ namespace NP.BO.Controllers if (vm.isexceldown == 1) { return ExportExcel( - new String[] { "No", "운영기수", "구분", "고객사", "교육장", "과정명", "시험명", "교육생", "ID", "핸드폰", "교육시작일", "교육종료일", "응시일자(제출일자)", "경과시간", "IP", "응시상태", "총점", "수료여부" }, - new String[] { "rno", "sseq", "isrebatename", "asname", "studyplacename", "cname", "exname", "username", "userid", "mobile", "leststr", "leestrExcel", "estarteend", "eseterm", "eip", "estatename", "tpoint", "iscompletename" }, + new String[] { "No", "운영기수", "구분", "고객사", "교육장", "과정명", "시험명", "교육생", "ID", "핸드폰", "교육시작일", "교육종료일", "응시일자(제출일자)", "경과시간", "IP", "응시상태", "총점", "수료여부", "점수종류" }, + new String[] { "rno", "sseq", "isrebatename", "asname", "studyplacename", "cname", "exname", "username", "userid", "mobile", "leststr", "leestrExcel", "estarteend", "eseterm", "eip", "estatename", "tpoint", "iscompletename", "isbyadminname" }, vm.LectEXes, "성적처리평가" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day, null, null, vm.excellog); } @@ -1472,6 +1472,10 @@ namespace NP.BO.Controllers } return View(vm); } - } + public ActionResult gradeupload(VMCRoom vm) + { + return View(vm); + } + } } diff --git a/BO/Views/Shared/Partial/ScdScript.cshtml b/BO/Views/Shared/Partial/ScdScript.cshtml index 0e87bda..f37eddb 100644 --- a/BO/Views/Shared/Partial/ScdScript.cshtml +++ b/BO/Views/Shared/Partial/ScdScript.cshtml @@ -38,7 +38,7 @@ } function setScd() { - capp("/acommon/GetScdForMixEdu", { cmno: selectedcmno }, "renderScd"); + capp("/acommon/GetScdForMixEdu", { cmno: selectedcmno }, "renderScd", null, null , true); } function renderScd() { var ulScd = $("#ulScd"); diff --git a/BO/Views/croom/gradeall2.cshtml b/BO/Views/croom/gradeall2.cshtml index 907f261..50de06c 100644 --- a/BO/Views/croom/gradeall2.cshtml +++ b/BO/Views/croom/gradeall2.cshtml @@ -37,6 +37,7 @@ 총점 관리 수료여부 + 점수종류 @@ -98,6 +99,9 @@ { @Html.Raw(d.iscomplete == 1 ? string.Format("{1}", d.lectno, "수료") : d.iscompletename) } + + @d.isbyadminname + } @@ -115,7 +119,7 @@
-

시험 상세결과닫기

+

시험 상세결과닫기


개요
@@ -146,10 +150,10 @@

 
- +} +@section scripts{ + + +} \ No newline at end of file diff --git a/BO/js/site.js b/BO/js/site.js index 5920269..15a8a00 100644 --- a/BO/js/site.js +++ b/BO/js/site.js @@ -1777,7 +1777,9 @@ $(document).ready(function () { if (($(this).attr("data-click") || "") != "") { eval($(this).attr("data-click")); } - $(this).closest('.findbox').slideUp('fast'); $('#bglayer').hide(); + $(this).closest('.findbox').slideUp('fast', function () { + $('#bglayer').hide(); + }); }).on("change", ".filebox input.fileitem", function () { var _ext = $(this).attr("data-ext").toUpperCase(); if ($(this).val() != "" && _ext != "*" && _ext != "") { diff --git a/Base/Controller/ACommon.cs b/Base/Controller/ACommon.cs index 91e8fe3..6bda21b 100644 --- a/Base/Controller/ACommon.cs +++ b/Base/Controller/ACommon.cs @@ -10,6 +10,9 @@ using NP.Base.Auth; using NP.Base.ENUM; using System.Text.RegularExpressions; using Newtonsoft.Json; +using System.Reflection.Emit; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Information; +using Spring.Validation.Validators; namespace NP.Base.Controllers { @@ -1879,6 +1882,99 @@ namespace NP.Base.Controllers return JsonOK(result); } + //성적업로드검증 + case "gradeuploadbatch": + { + var lects = new Lib.ExcelToEntity(uploadfile).Read(2, 1).ToList(); + if (lects.Count() < 1) + { + return JsonBack(new JsonRtn() { code = 1, msg = "데이터가 없습니다." }); + } + else + { + int intLoop = 1; + int tot = lects.Count(); + foreach (var lect in lects) + { + lect.rno = intLoop++; + lect.pagetotalcount = tot; + lect.value = ",정상"; + lect.cname = string.Empty; + + if (string.IsNullOrEmpty(lect.userpno) || lect.userpno == "-") + { + lect.value += ",주민번호오입력"; + } + else + { + var users = Dao.Get("users.users", new Hashtable() { { "usertype", 1 }, { "status", 1 }, { "userpno", lect.userpno.Replace("-", "") } }); + if (users.Count == 1) + { + var user = users.First(); + lect.userno = user.userno; + lect.userid = user.userid; + lect.username = user.username; + } + else + { + lect.value += ",교육생불일치"; + } + } + + if (lect.stime == null) + { + lect.value += ",교육종료일오입력"; + } + else if (lect.userno == 0) + { + lect.value += ",강좌불일치"; + } + else + { + var lectexs = Dao.Get("lect.lectex.forgradeupload", new Hashtable() { { "userno", lect.userno }, { "stime", lect.stime } }); + if (lectexs.Count == 1) + { + var lectex = lectexs.First(); + if (lectex.tpoint < lect.tpoint) + { + lect.value += ",평가점수오입력(초과)"; + } + else + { + lect.cmno = lectex.cmno; + lect.cname = lectex.cname; + lect.lectno = lectex.lectno; + lect.cmino = lectex.cmino; + lect.iscomplete = lectex.iscomplete; + lect.exno = lectex.exno; + lect.exname = lectex.exname; + } + } + else + { + lect.value += ",강좌불일치"; + } + } + + if (lect.tpoint < 0 || lect.tpoint > 100) + { + lect.value += ",평가점수오입력"; + } + + lect.value = lect.value.Substring(1); + + if (!lect.value.Equals("정상")) + { + if (lect.value.Contains("정상")) + { + lect.value = lect.value.Replace("정상,", ""); + } + lect.value += " 오류"; + } + } + } + return JsonBack(new JsonRtn() { code = 1000, obj = lects }); + } } } } diff --git a/Base/Controller/ACommonCRoom.cs b/Base/Controller/ACommonCRoom.cs index 446534c..818c274 100644 --- a/Base/Controller/ACommonCRoom.cs +++ b/Base/Controller/ACommonCRoom.cs @@ -12,6 +12,7 @@ using NP.Base.ENUM; using System.Net.Http; using XPayClientNet; using NP.Base.Popbill; +using IBatisNet.DataMapper.Configuration.ResultMapping; namespace NP.Base.Controllers { @@ -2043,5 +2044,27 @@ namespace NP.Base.Controllers } return JsonOK(Dao.Save("pay.taxcancel", new Hashtable() { { "taxnos", taxnos }, { "taxno", taxno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } })); } + + /// + /// 성적업로드 + /// + /// 수강 + /// + [HttpPost] + public JsonResult GradeUploadBatch(IList lectexs) + { + var result = 0; + foreach (var lectex in lectexs) + { + var lectexsNow = Dao.Get("lect.lectex.forgradeupload", new Hashtable() { { "userno", lectex.userno }, { "lectno", lectex.lectno } }); + if (lectexsNow.Count == 1 && lectexsNow.First().tpoint >= lectex.tpoint) + { + lectex.uno = SUserInfo.UserNo; + lectex.uip = GetUserIP(); + result += Dao.Save("lect.lectex.point.byadmin", lectex) > 0 ? 1 : 0; + } + } + return JsonOK(result, true); + } } } \ No newline at end of file diff --git a/Base/Lib/Excel2Entity.cs b/Base/Lib/Excel2Entity.cs index 4d4099d..567390e 100644 --- a/Base/Lib/Excel2Entity.cs +++ b/Base/Lib/Excel2Entity.cs @@ -145,9 +145,30 @@ namespace NP.Base.Lib catch (Exception) { continue; } try - { - property.SetValue(entity, v.GetType() == property.PropertyType ? v : - Convert.ChangeType(row[propName], property.PropertyType)); + { + if (v.GetType() == property.PropertyType) + { + property.SetValue(entity, v); + } + else + { + if (property.PropertyType == typeof(DateTime?)) + { + if (DateTime.TryParse(row[propName].ToString(), out DateTime dt)) + { + property.SetValue(entity, dt); + } + else + { + property.SetValue(entity, null); + } + } + else + { + var propertyType = Nullable.GetUnderlyingType(property.PropertyType) ?? property.PropertyType; + property.SetValue(entity, Convert.ChangeType(row[propName], propertyType)); + } + } } catch (Exception) { diff --git a/Dao/MyBatis/Maps/CRoom.xml b/Dao/MyBatis/Maps/CRoom.xml index c0e5150..cda72c3 100644 --- a/Dao/MyBatis/Maps/CRoom.xml +++ b/Dao/MyBatis/Maps/CRoom.xml @@ -1842,5 +1842,6 @@ ( l.completetime is null and li.stime is not null and l.sdate < '2024-08-19 00:00:00' and li.stime is not null and li.stime < '2024-08-22 00:00:00')) + diff --git a/Dao/MyBatis/Maps/Lect.xml b/Dao/MyBatis/Maps/Lect.xml index dd754d0..209a4bf 100644 --- a/Dao/MyBatis/Maps/Lect.xml +++ b/Dao/MyBatis/Maps/Lect.xml @@ -1072,12 +1072,12 @@ ,p.payoktime,a.sdate,a.edate ,b.exno,b.exname,b.extype ,b2.cshape,b2.cname - ,c.estart,c.eend,c.eip,c.tpoint,c.recount,c.entercount,c.cblock + ,c.estart,c.eend,c.eip,c.tpoint,c.recount,c.entercount,c.cblock,c.isbyadmin ,d.username,d.userid ,e.asname ,f.cmisno,f.estart lestart,f.eend leend,f.sseq ,g.cname studyplacename - ,a.iscomplete + ,a.iscomplete ,row_number() over(order by $orderby$d.username) rno ,count(a.cdt) over() pagetotalcount ,cast(AES_DECRYPT(UNHEX(d.mobile), 'np123@!' ) as char) as mobile @@ -1147,7 +1147,7 @@ from lectex a where a.lectno=#lectno# and a.exno=#exno#; - update lectex set estart=null,eend=null,eip=null,tpoint=0,recount=recount+1,entercount=0,cblock=0 where lectno=#lectno# and exno=#exno#; + update lectex set estart=null,eend=null,eip=null,tpoint=0,recount=recount+1,entercount=0,cblock=0,isbyadmin=0 where lectno=#lectno# and exno=#exno#; update lectexq a inner join cmex b on b.exno=a.exno @@ -2704,7 +2704,44 @@ LEFT OUTER JOIN lectinning g ON g.cmino = ci.cmino AND g.lectno = l.lectno WHERE l.lectno in ($lectnos$) + + + + + + update lectex + set + ,tpoint=#tpoint# + ,isbyadmin=1 + where lectno=#lectno# and exno=#exno#; + + update lect l + inner join ( + select l.lectno, round(avg(le.tpoint),1) as avgtpoint, sum(le.tpoint) sumpoint, ce.tpoint + from lect l + inner join cmex ce on l.cmno = ce.cmno and ce.extype = 1 and ce.isdel = 0 + left outer join lectex le on l.lectno = le.lectno and ce.exno = le.exno + where l.status = 1 and l.lectno = #lectno# + group by l.lectno + )t on l.lectno = t.lectno + inner join cmev cv on l.cmno = cv.cmno + set l.exfpoint = t.avgtpoint + , l.fpoint = round((t.avgtpoint / t.tpoint * 100) * cv.final / 100,1) + , l.udt = now() + , l.uno = #uno# + , l.uip=#uip# + where l.lectno = #lectno#; + - - - + \ No newline at end of file diff --git a/Model/CM.cs b/Model/CM.cs index 8032ea6..85042a8 100644 --- a/Model/CM.cs +++ b/Model/CM.cs @@ -1447,7 +1447,7 @@ namespace NP.Model } } - public int? cmino { get; set; } + public Int64? cmino { get; set; } public int ischeck { get; set; } public String completeno { get; set; } public String post { get; set; } @@ -1510,7 +1510,18 @@ namespace NP.Model public String rbank { get; set; } public String btype { get; set; } public String eino { get; set; } + /// + /// 주민등록번호 + /// public String userpno { get; set; } + /// + /// 시험키 + /// + public int exno { get; set; } + /// + /// 시험명 + /// + public String exname { get; set; } } /// /// 자격검정시험 @@ -3280,7 +3291,7 @@ namespace NP.Model /// /// 영상 임의학습과 같이 영상 플레이 (0:불가, 1:가능) /// - public short isplay { get; set; } + public short isplay { get; set; } } [Serializable] @@ -3667,6 +3678,18 @@ namespace NP.Model } } public int ispass { get; set; } + public Int64? cmino { get; set; } + /// + /// 관리자등록여부 + /// + public int isbyadmin { get; set; } + public string isbyadminname + { + get + { + return isbyadmin == 1 ? "관리자등록" : "수강생응시"; + } + } } [Serializable] public class LectEXQ : LectEX