This commit is contained in:
kdh0120 2020-11-12 04:12:08 +00:00
parent c148252762
commit ccd59cc581
4 changed files with 157 additions and 3 deletions

View File

@ -287,8 +287,18 @@ namespace NP.Base.Controllers
} }
else if (type == "abs") else if (type == "abs")
{ {
var Lects1 = Dao.Get<Lect>("grade.nocompletelect", lectnos).Where(w => w.iscomplete != 1 && lectnos.Contains(w.lectno.ToString())).ToList();
return JsonOK(Dao.Save("grade.lectcomplete.abs", new Hashtable() { { "lectnos", lectnos }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } })); if (Lects1.Count() > 0)
{
lectnos = string.Join(",", Lects1.Select(s => s.lectno));
var data1 = new Lect() { lectnos = lectnos, uno = SUserInfo.UserNo, uip = GetUserIP() };
return JsonOK(Dao.Save("grade.lectcomplete.abs2", data1));
}
else
{
return JsonBack(new JsonRtn() { code = 1, msg = "이미 수료된 데이터는 다시 수료할 수 없습니다." });
}
//return JsonOK(Dao.Save("grade.lectcomplete.abs", new Hashtable() { { "lectnos", lectnos }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
} }
else if (type == "batch") else if (type == "batch")
{ {
@ -299,8 +309,20 @@ namespace NP.Base.Controllers
{ {
return JsonOK(0); return JsonOK(0);
} }
lectnos = string.Join(",", Dao.Get<Lect>("grade.nocompletelectcm", cmnos).Select(s => s.lectno));
} }
return JsonOK(Dao.Save("grade.lectcomplete", new Hashtable() { { "cmno", cmno }, { "cmnos", cmnos }, { "lectnos", lectnos }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } })); var Lects2 = Dao.Get<Lect>("grade.nocompletelect", lectnos).Where(w => w.iscomplete != 1 && lectnos.Contains(w.lectno.ToString())).ToList();
if (Lects2.Count() > 0)
{
lectnos = string.Join(",", Lects2.Select(s => s.lectno));
var data2 = new Lect() { uno = SUserInfo.UserNo, uip = GetUserIP(), cmno = Convert.ToInt32(cmno), cmnos = cmnos, lectnos = lectnos };
return JsonOK(Dao.Save("grade.lectcomplete2", new Hashtable() { { "cmno", cmno }, { "cmnos", cmnos }, { "lectnos", lectnos }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
}
else
{
return JsonBack(new JsonRtn() { code = 1, msg = "이미 수료된 데이터는 다시 수료할 수 없습니다." });
}
//return JsonOK(Dao.Save("grade.lectcomplete", new Hashtable() { { "cmno", cmno }, { "cmnos", cmnos }, { "lectnos", lectnos }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
} }
[HttpPost] [HttpPost]
public JsonResult CMInningGetForOff(Int64 cmino) public JsonResult CMInningGetForOff(Int64 cmino)

View File

@ -781,6 +781,7 @@ create table pay (
,rbankname varchar (50) ,rbankname varchar (50)
,rbankacc varbinary (200) ,rbankacc varbinary (200)
,rbankowner varchar (20) ,rbankowner varchar (20)
,pplno bigint(20)
,cdt datetime not null,cno bigint not NULL,udt datetime not null,uno bigint not NULL,uip varchar(50) not NULL ,cdt datetime not null,cno bigint not NULL,udt datetime not null,uno bigint not NULL,uip varchar(50) not NULL
,primary key(payno)); ,primary key(payno));
@ -1036,6 +1037,8 @@ create table lect (
,ispce tinyint ,ispce tinyint
,fgno2 bigint ,fgno2 bigint
,cmisno bigint null ,cmisno bigint null
,completetime datetime
,completeno varchar(50)
,cdt datetime not null,cno bigint not NULL,udt datetime not null,uno bigint not NULL,uip varchar(50) not NULL ,cdt datetime not null,cno bigint not NULL,udt datetime not null,uno bigint not NULL,uip varchar(50) not NULL
,primary key(lectno)); ,primary key(lectno));

View File

@ -266,6 +266,132 @@
group by a.cmno group by a.cmno
having ifnull(max(a.iscomplete),0) &lt;&gt;1 having ifnull(max(a.iscomplete),0) &lt;&gt;1
</select> </select>
<update id="grade.lectcomplete.abs2" parameterClass="lect">
update lect l
inner join (
select c.lectno,c.completeno,c.completetime
from (
select t1.*
,concat('제 ',t1.cyear,' - ',t1.code1,t1.code2,t1.code3,' - ',lpad(ifnull(t2.seqNo,0)+ t1.rno , 6, 0)) completeno
from (
select l.lectno
,date_format(l.cdt,'%Y') cyear
,pcg.cgcode code2
,case when cm.cshape = 1 then 'F' else 'N' end code1
,case when te.cremark = '1' then te.refcode
when tm.cremark in ('1','2','3','4') then tm.refcode
else '05' end code3
,case when cm.cshape = 0 then now()
when cm.cshape = 1 then cm.setime
else cs.eend end completetime
,row_number() over(partition by date_format(l.cdt,'%Y') order by l.cdt) rno
from lect l
inner join cm cm on cm.cmno = l.cmno
inner join pay p on p.payno = l.payno
left outer join pplog pl on pl.pplno = p.pplno
inner join cg cg on cg.cgno = cm.cgno
inner join cg pcg on pcg.cgno = cg.pcgno
left outer join comcode tm on tm.isuse=1 and tm.ccode = pl.typeman
left outer join comcode te on te.isuse=1 and te.ccode = pl.typeedu
left outer join cminningscd cs on cs.cmisno = pl.cmisno
where l.lectno in ($lectnos$)
) t1
left outer join (
select date_format(l.cdt, '%Y') cyear,max(substring(l.completeno, -6)) seqNo
from lect l
group by date_format(l.cdt, '%Y')
) t2 on t2.cyear = t1.cyear
) c
) b
inner join cm c on c.cmno = l.cmno
set l.uno = #uno#
,l.udt = now()
,l.cno = #uno#
,l.cdt = now()
,l.uip= #uip#
,l.iscomplete=1
,l.completetime=b.completetime
,l.completeno = b.completeno
where l.lectno = b.lectno
</update>
<update id="grade.lectcomplete2" parameterClass="hashtable">
update lect a
inner join (
<include refid="grade.query"></include>
) b on b.lectno=a.lectno
inner join (
select c.lectno,c.completeno,c.completetime
from (
select t1.*
,concat('제 ',t1.cyear,' - ',t1.code1,t1.code2,t1.code3,' - ',lpad(ifnull(t2.seqNo,0)+ t1.rno , 6, 0)) completeno
from (
select l.lectno
,date_format(l.cdt,'%Y') cyear
,pcg.cgcode code2
,case when cm.cshape = 1 then 'F' else 'N' end code1
,case when te.cremark = '1' then te.refcode
when tm.cremark in ('1','2','3','4') then tm.refcode
else '05' end code3
,case when cm.cshape = 0 then now()
when cm.cshape = 1 then cm.setime
else cs.eend end completetime
,row_number() over(partition by date_format(l.cdt,'%Y') order by l.cdt) rno
from lect l
inner join cm cm on cm.cmno = l.cmno
inner join pay p on p.payno = l.payno
left outer join pplog pl on pl.pplno = p.pplno
inner join cg cg on cg.cgno = cm.cgno
inner join cg pcg on pcg.cgno = cg.pcgno
left outer join comcode tm on tm.isuse=1 and tm.ccode = pl.typeman
left outer join comcode te on te.isuse=1 and te.ccode = pl.typeedu
left outer join cminningscd cs on cs.cmisno = pl.cmisno
where l.lectno in ($lectnos$)
) t1
left outer join (
select date_format(l.cdt, '%Y') cyear,max(substring(l.completeno, -6)) seqNo
from lect l
group by date_format(l.cdt, '%Y')
) t2 on t2.cyear = t1.cyear
) c
) c on c.lectno = a.lectno
inner join cm d on d.cmno = a.cmno
set a.udt=<include refid="sql.now"></include>,a.uno=#uno#,a.uip=#uip#
,a.iscomplete=b.ispass
,a.apoint=b.apoint
,a.mpoint=a.mpoint
,a.fpoint=b.fpoint
,a.spoint=b.spoint
,a.dpoint=b.dpoint
,a.tpoint=b.apoint+b.mpoint+b.fpoint+b.spoint+b.dpoint
,a.completetime = case when b.ispass = 1 then <include refid="sql.now"></include> else null end
,a.completeno = case when b.ispass = 1 then c.completeno else null end
where a.status=1 and a.ischanged=0 and a.lectno = c.lectno
<isNotNull property="cmno">and a.cmno = #cmno#</isNotNull>
<isNotNull property="lectno">and a.lectno = #lectno#</isNotNull>
<isNotNull property="cmnos">and a.cmno in ($cmnos$)</isNotNull>
<isNotNull property="lectnos">and a.lectno in ($lectnos$)</isNotNull>
</update>
<select id ="grade.nocompletelect" parameterClass="string" resultClass="lect">
select distinct c.lectno , b.cmno
,case when c.iscomplete = 1 then 1 else 0 end iscomplete
from lect a2
inner join cm a on a.cmno = a2.cmno
inner join cm b on b.cmno = a.cmno
inner join lect c on c.cmno = b.cmno
where c.status=1 and c.ischanged=0 and a2.lectno in ($lectnos$)
group by b.cmno,c.lectno
</select>
<select id ="grade.nocompletelectcm" parameterClass="string" resultClass="lect">
select distinct c.lectno , b.cmno
,case when c.iscomplete = 1 then 1 else 0 end iscomplete
from lect a2
inner join cm a on a.cmno = a2.cmno
inner join cm b on b.cmno = a.cmno
inner join lect c on c.cmno = b.cmno
where c.status=1 and c.ischanged=0 and a2.cmno in ($cmnos$)
group by b.cmno,c.lectno
</select>
</statements> </statements>
</sqlMap> </sqlMap>

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Security.Policy;
using System.Text; using System.Text;
namespace NP.Model namespace NP.Model
{ {
@ -1048,6 +1049,8 @@ namespace NP.Model
/// 직위 /// 직위
/// </summary> /// </summary>
public String uduty { get; set; } public String uduty { get; set; }
public String lectnos { get; set; }
public String cmnos { get; set; }
} }
/// <summary> /// <summary>
/// 자격검정시험 /// 자격검정시험