This commit is contained in:
parent
0af9f4a8cf
commit
3309405754
|
|
@ -287,8 +287,11 @@ namespace NP.BO.Controllers
|
|||
m.Users.Add(new MemoUser()
|
||||
{
|
||||
userno = u.userno,
|
||||
uno = SUserInfo.UserNo,
|
||||
uip = GetUserIP(),
|
||||
smstype = "A",
|
||||
isok = string.IsNullOrEmpty(u.mobile) ? -1 : 1,
|
||||
title = "[영남건설기술교육원] 진행평가 참여 알림",
|
||||
mobile = (u.mobile ?? "").Replace("-", ""),
|
||||
mcontents = string.Format("영남건설기술교육원입니다.\n\n[{0}]님이 수강중인 [{1}] 강좌의 교육 종료일이 {2}일 남았습니다. 종료되기전에 서둘러 " +
|
||||
(u.scdno < 3 ? "학습을 진행" : u.scdno == 3 ? "진행평가에" : u.scdno == 4 ? "최종평가에" : u.scdno == 5 ? "과제을 제출" : u.scdno == 6 ? "토론에 참여" : u.scdno == 7 ? "강의평가에 참여" : "-") + "해주세요.\n\n☞사이트 : https://edu.kfcf.or.kr",
|
||||
|
|
@ -297,7 +300,7 @@ namespace NP.BO.Controllers
|
|||
}
|
||||
if (m.Users.Where(w => w.isok == 1).Count() > 0)
|
||||
{
|
||||
Talk(m.Users.Where(w => w.isok == 1).ToList(), "encourage1");
|
||||
SaveTalk(m.Users.Where(w => w.isok == 1).ToList(), "encourage1");
|
||||
m.Users.Clear();
|
||||
}
|
||||
var masteremail = GetConfig("masteremail");
|
||||
|
|
@ -321,6 +324,7 @@ namespace NP.BO.Controllers
|
|||
{
|
||||
userno = u.userno,
|
||||
smstype = "A",
|
||||
title = "[영남건설기술교육원] 진행평가 참여 알림",
|
||||
isok = string.IsNullOrEmpty(u.mobile) ? -1 : 1,
|
||||
mobile = (u.mobile ?? "").Replace("-", ""),
|
||||
mcontents = string.Format("영남건설기술교육원입니다.\n\n{0}님이 신청중인 [{1}] 강좌의 교육이 [{2}]에 {3}에서 시작됩니다.\n\n☞사이트 : https://edu.kfcf.or.kr",
|
||||
|
|
@ -329,7 +333,7 @@ namespace NP.BO.Controllers
|
|||
}
|
||||
if (m.Users.Where(w => w.isok == 1).Count() > 0)
|
||||
{
|
||||
Talk(m.Users.Where(w => w.isok == 1).ToList(), "encourage7");
|
||||
SaveTalk(m.Users.Where(w => w.isok == 1).ToList(), "encourage7");
|
||||
m.Users.Clear();
|
||||
}
|
||||
var masteremail = GetConfig("masteremail");
|
||||
|
|
@ -352,6 +356,7 @@ namespace NP.BO.Controllers
|
|||
{
|
||||
userno = u.userno,
|
||||
smstype = "A",
|
||||
title = "[영남건설기술교육원] 진행평가 참여 알림",
|
||||
isok = string.IsNullOrEmpty(u.mobile) ? -1 : 1,
|
||||
mobile = (u.mobile ?? "").Replace("-", ""),
|
||||
mcontents = string.Format("영남건설기술교육원입니다.\n\n{0}님이 신청중인 [{1}] 자격검정이 [{2}]에 {3}에서 이뤄질 예정입니다.\n\n☞사이트: https://edu.kfcf.or.kr",
|
||||
|
|
@ -360,7 +365,7 @@ namespace NP.BO.Controllers
|
|||
}
|
||||
if (m.Users.Where(w => w.isok == 1).Count() > 0)
|
||||
{
|
||||
Talk(m.Users.Where(w => w.isok == 1).ToList(), "encourage8");
|
||||
SaveTalk(m.Users.Where(w => w.isok == 1).ToList(), "encourage8");
|
||||
m.Users.Clear();
|
||||
}
|
||||
var masteremail = GetConfig("masteremail");
|
||||
|
|
|
|||
|
|
@ -73,9 +73,10 @@
|
|||
<add key="PAYMENT_CLASSIFICATION" value="te" />
|
||||
<add key="LGD_MERTKEY" value="e988951b7fe0b7f25ebaa07e54824365" />
|
||||
|
||||
<!--MTS SMSMMS 발신번호, 알림톡발신키-->
|
||||
<add key="mastersms" value="10d3158b52019fa6b7e5563b1e35cf8c48a8caf9" />
|
||||
<add key="mtssendnum" value="15447660" />
|
||||
<add key="mtsdb" value="Server=218.232.111.111;Database=mtsyicte;User ID=mtsyicteremote;Password=dev1@#" />
|
||||
<!--MTS SMSMMS 발신번호-->
|
||||
</appSettings>
|
||||
<common>
|
||||
<logging>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -9,6 +9,8 @@ using System.Security.Principal;
|
|||
using System.Security.Cryptography;
|
||||
using System.IO;
|
||||
using System.Web.Mail;
|
||||
using System.Web.Compilation;
|
||||
using NP.Model;
|
||||
|
||||
namespace NP.Base
|
||||
{
|
||||
|
|
@ -1231,6 +1233,34 @@ namespace NP.Base
|
|||
}
|
||||
}
|
||||
}
|
||||
public void SaveTalk(IList<NP.Model.MemoUser> Users, String tmplkey)
|
||||
{
|
||||
|
||||
IList<MemoUser> m = new List<MemoUser>() { };
|
||||
var us = Users.Where(w => w.isok == 1).ToList();
|
||||
if (us.Count() > 0)
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder("");
|
||||
for (var i = 0; i < us.Count(); i++)
|
||||
{
|
||||
var cbnum = GetConfig("mtssendnum");
|
||||
var talkkey = GetConfig("mastersms");
|
||||
var ismms = System.Text.Encoding.Default.GetBytes(us[i].mcontents).Length > 90;
|
||||
|
||||
for (var j = 0; j < us.Count(); j++)
|
||||
{
|
||||
sb.Append(string.Format(",('{0}','{1}','{2}','{3}','{4}','{5}',now(),5,'1','{6}','{7}')", talkkey, tmplkey, cbnum, us[i].mobile.Replace(" ","").Replace("-",""), us[i].title, us[i].mcontents, (ismms ? "L" : "S"), us[i].mcontents));
|
||||
}
|
||||
}
|
||||
var strConn = GetConfig("mtsdb");
|
||||
using (var conn = new MySql.Data.MySqlClient.MySqlConnection(strConn))
|
||||
{
|
||||
conn.Open();
|
||||
var cmd = new MySql.Data.MySqlClient.MySqlCommand("insert into mts_atalk_msg(tran_sender_key,tran_tmpl_cd,tran_callback,tran_phone,tran_subject,tran_msg,tran_date,tran_type,tran_status,tran_replace_type,tran_replace_msg) values" + sb.ToString().Substring(1), conn);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ using NP.Model;
|
|||
using System.Collections;
|
||||
using NP.Base.Auth;
|
||||
using NP.Base.ENUM;
|
||||
using System.Web.ModelBinding;
|
||||
|
||||
namespace NP.Base.Controllers
|
||||
{
|
||||
public partial class FOCommonController : NP.Base.BaseController
|
||||
|
|
@ -476,7 +478,18 @@ namespace NP.Base.Controllers
|
|||
return JsonBack(new JsonRtn() { code = -1 });
|
||||
}
|
||||
Dao.Insert("common.smsauth", sa);
|
||||
Dao.Insert("common.atalk.send", new Hashtable() { { "senderkey", GetConfig("mastersms").Split(';')[0] },{"method","alarm" }, { "DEST_PHONE", mobile.Replace(" ", "").Replace("-", "") }, { "SEND_PHONE", GetConfig("mastersms").Split(';')[1] },{"title","인증번호" }, { "MSG_BODY", msg },{"replace_type","S" } });
|
||||
IList<NP.Model.MemoUser> us = new List<NP.Model.MemoUser>();
|
||||
us.Add(new MemoUser()
|
||||
{
|
||||
userno = SUserInfo.UserNo,
|
||||
mobile = mobile,
|
||||
title = "인증번호",
|
||||
mcontents = msg,
|
||||
smstype = "A",
|
||||
isok = 1
|
||||
});
|
||||
SaveTalk(us, "alarm");
|
||||
//Dao.Insert("common.atalk.send", new Hashtable() { { "senderkey", GetConfig("mastersms").Split(';')[0] },{"method","alarm" }, { "DEST_PHONE", mobile.Replace(" ", "").Replace("-", "") }, { "SEND_PHONE", GetConfig("mastersms").Split(';')[1] },{"title","인증번호" }, { "MSG_BODY", msg },{"replace_type","S" } });
|
||||
return JsonOK(sa.authno);
|
||||
}
|
||||
[HttpPost]
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -36,7 +36,6 @@
|
|||
<add key="reporturl" value="http://ynicter.nptc.kr" />
|
||||
<!--<add key="masteremail" value="edu@ynicte.or.kr;mail.ynicte.or.kr;25;ynicte@ynicte.or.kr;k7758870!%" />-->
|
||||
<add key="masteremail" value="yicte@cte.or.kr;smtp.daum.net;465;yicte2020;yicte04003" />
|
||||
<add key="mastersms" value="10d3158b52019fa6b7e5563b1e35cf8c48a8caf9;15447660" />
|
||||
<add key="usessl" value="Y" />
|
||||
<add key="ssonoauth" value="Y" />
|
||||
<add key="daokey" value="ynictelms2020" />
|
||||
|
|
@ -78,7 +77,10 @@
|
|||
<add key="PAYMENT_CLASSIFICATION" value="te" />
|
||||
<add key="LGD_MERTKEY" value="e988951b7fe0b7f25ebaa07e54824365" />
|
||||
<!-- 토스페이먼츠(구LG Xpay) 결제 종료 -->
|
||||
|
||||
<add key="mastersms" value="10d3158b52019fa6b7e5563b1e35cf8c48a8caf9" />
|
||||
<add key="mtssendnum" value="15447660" />
|
||||
<add key="mtsdb" value="Server=218.232.111.111;Database=mtsyicte;User ID=mtsyicteremote;Password=dev1@#" />
|
||||
<!--MTS SMSMMS 발신번호, 알림톡발신키-->
|
||||
</appSettings>
|
||||
<!-- to see logging output in the attached debugger -->
|
||||
<common>
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ namespace NP.Model
|
|||
public String msgid { get; set; }
|
||||
public String message { get; set; }
|
||||
public String mcontents { get; set; }
|
||||
public String title { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue