("cr.payitems.forcheck2", string.Join(",", pis.Where(w => w.rstatus != 0).Select(s => s.pino))).ToList();
+ }
+ if (pis2.Count() == pis.Where(w => w.rstatus == 0).Count() && pis3.Count() == pis.Where(w=> w.rstatus>0).Count())
+ {
+ //가상계좌는 수동환불해야 함
+ if (p.ispg == 1 && p.ptype != 3 && p.ptype != 6 && !iscancel && pis.Where(w=>w.rstatus == 0 && w.refundamt > 0).Count() > 0)
+ {
+ try
+ {
+
+ //INIpay.SetField(ref intPInst, "oldTid", p.pgkey);//취소할 원거래번호(TID)
+ //INIpay.SetField(ref intPInst, "price", p.newrefundamt.ToString());//취소할 금액
+ //INIpay.SetField(ref intPInst, "confirm_price", (p.payamt - p.refundamt - p.newrefundamt).ToString());//이전승인금액(최초승인금액-부분취소금액)-부분취소금액
+ //
+ //if (resultcode != "00")
+ //{
+ // return JsonOK(0);
+ //}
+ //p.cancelcnt= GetInt(INIpay.GetResult(ref intPInst, "PRTC_Cnt"));//부분취소 요청횟수
+
+
+ string CST_PLATFORM = GetConfig("CST_PLATFORM");
+ string CST_MID = GetConfig("CST_MID");
+ string LGD_MID = (("test".Equals(CST_PLATFORM.Trim())) ? "t" : "") + CST_MID;
+ XPayClient xpay = new XPayClient();
+ xpay.Init(GetConfig("lgdacomConfigPath"), CST_PLATFORM);
+ xpay.Init_TX(LGD_MID);
+ xpay.Set("LGD_TXNAME", "PartialCancel");
+ xpay.Set("LGD_TID", p.pgkey);
+ xpay.Set("LGD_CANCELAMOUNT", p.newrefundamt.ToString());
+ //xpay.Set("LGD_REMAINAMOUNT", pd.RemainAmount);
+ //xpay.Set("LGD_CANCELREASON", pd.CancelReason);
+ //xpay.Set("LGD_RFACCOUNTNUM", pd.RfAccountNum);
+ //xpay.Set("LGD_RFBANKCODE", pd.RfBankCode);
+ //xpay.Set("LGD_RFCUSTOMERNAME", pd.RfCustomerName);
+ //xpay.Set("LGD_RFPHONE", pd.RfPhone);
+ xpay.Set("LGD_ENCODING", "utf-8");
+ xpay.Set("LGD_BUYERIP", Request.UserHostAddress);
+ // 이하 PG 사 연동 전문 종료
+ /*
+ * 1. 결제부분취소 요청 결과처리
+ */
+ //xpay.TX() 실행되면 실제 취소 처리가 이루어 집니다.
+ if (xpay.TX())
+ {
+
+ if ("0000".Equals(xpay.m_szResCode) || "AV11".Equals(xpay.m_szResCode))
+ {
+
+ }
+ else
+ {
+ Response.Write("취소요청이 실패하였습니다.
");
+ return JsonOK(0);
+ }
+
+ }
+ else
+ {
+ //2)API 요청 실패 화면처리
+
+ //Response.Write("결제 부분취소요청이 실패하였습니다.
");
+ //Response.Write("TX Response_code = " + xpay.m_szResCode + "
");
+ //Response.Write("TX Response_msg = " + xpay.m_szResMsg + "");
+
+ return JsonOK(0);
+ }
+ }
+ catch (Exception ex)
+ {
+ SetError(ex.Message);
+ return JsonOK(0);
+ }
+ }
+ //취소처리(db)
+ p.PIs = pis;
+ //if(prstatus != null)
+ //{
+ // Dao.Save("cr.lectchange", p);
+ // return JsonBack(new JsonRtn() { code = -1, });
+ //}
+ //수강취소/시험취소
+ foreach (var d in pis.Where(w => w.rstatus == 0 && w.refundstatus == 1))
+ {
+ if (pis2.Where(w=>w.pino == d.pino).First().ptype == 3)
+ {
+ p.pinosexamuser = p.pinosexamuser == null ? ("," + d.pino) : (p.pinosexamuser + "," + d.pino);
+ }
+ else
+ {
+ p.pinoslect = p.pinoslect == null ? ("," + d.pino) : (p.pinoslect + "," + d.pino);
+ }
+ }
+ //기환불건 상태변경 데이터
+ foreach (var d in pis.Where(w => w.rstatus != 0))
+ {
+ if (pis3.Where(w => w.pino == d.pino).First().ptype == 3)
+ {
+ p.pinosexamuser2 = p.pinosexamuser2 == null ? ("," + d.pino) : (p.pinosexamuser2 + "," + d.pino);
+ }
+ else
+ {
+ p.pinoslect2 = p.pinoslect2 == null ? ("," + d.pino) : (p.pinoslect2 + "," + d.pino);
+ }
+ }
+ if(p.pinosexamuser != null)
+ {
+ p.pinosexamuser = p.pinosexamuser.Substring(1);
+ }
+ if(p.pinoslect != null)
+ {
+ p.pinoslect = p.pinoslect.Substring(1);
+ }
+ if (p.pinosexamuser2 != null)
+ {
+ p.pinosexamuser2 = p.pinosexamuser2.Substring(1);
+ }
+ if (p.pinoslect2 != null)
+ {
+ p.pinoslect2 = p.pinoslect2.Substring(1);
+ }
+ return JsonOK(Dao.Save("cr.paycancel", p));
+ }
+ }
+ return JsonOK(0);
+ }
+ ///
+ /// 환불결과저장
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult PayRefundInfoSave(PayItem d)
+ {
+ d.uno = SUserInfo.UserNo; d.uip = GetUserIP();
+
+ return JsonOK(Dao.Save("cr.payrefundinfo.up", d));
+ }
+ ///
+ /// 세금계산서 저장
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult PayTaxSave(PayTax d)
+ {
+ d.uno = SUserInfo.UserNo; d.uip = GetUserIP();
+ if(d.iscancel != 1 && Dao.Get("cr.paytaxes",new Hashtable() { {"payno",d.payno },{"cno",d.cno } ,{"iscancel",0 },{ "nottaxno",d.taxno } }).Count() > 0)
+ {
+ return JsonBack(new JsonRtn() { code = -1 });
+ }
+ return JsonOK(Dao.Save("cr.paytax.save", d));
+ }
+
+ #region 세금계산서 임시저장(팝빌 임시저장 및 paytax.mgtkey 업데이트)
+ ///
+ /// 세금계산서 임시저장(팝빌 임시저장 및 paytax.mgtkey 업데이트)
+ ///
+ /// payTax
+ ///
+ [HttpPost]
+ public JsonResult PayTaxTempSave(PayTax payTax)
+ {
+ payTax.uno = SUserInfo.UserNo; payTax.uip = GetUserIP();
+ if (payTax.iscancel != 1 && payTax.taxdate != null && Dao.Get("cr.paytaxes", new Hashtable() { { "payno", payTax.payno }, { "cno", payTax.cno }, { "iscancel", 0 }, { "nottaxno", payTax.taxno } }).Count() > 0)
+ {
+ return JsonBack(new JsonRtn() { code = -1 });
+ }
+
+ if (string.IsNullOrEmpty(payTax.mgtkey))
+ {
+ payTax.mgtkey = Popbill.PopbillService.MakeMgtKey(Dao, payTax.taxno, payTax.taxdate.Value);
+ }
+
+ if (Dao.Save("cr.paytax.save", payTax) > 0)
+ {
+ var payItems = Dao.Get("cr.paytaxitem2", new System.Collections.Hashtable() { { "taxno", payTax.taxno } });
+
+ var result = Popbill.PopbillService.TempSave(Dao, payTax, payItems);
+ if (result.IsSuccess)
+ {
+ #region 세금계산서 상태코드 업데이트
+ var taxinvoiceInfo = PopbillService.GetTaxinvoiceInfo(payTax).Data;
+ payTax.statecode = taxinvoiceInfo.stateCode;
+ Dao.Save("cr.paytax.save", payTax);
+ #endregion
+ return JsonOK(result.Code);
+ }
+ else
+ {
+ #region 임시저장 실패시 mgtkey 미사용이면 저장값 초기화
+ var checkResult = Popbill.PopbillService.CheckMgtKeyInUse(payTax.mgtkey);
+ if (checkResult.IsSuccess)
+ {
+ if (!checkResult.IsUse)
+ {
+ payTax.mgtkey = string.Empty;
+ Dao.Save("cr.paytax.save", payTax);
+ }
+ }
+ #endregion
+ return JsonError(JSONCode.Error, result.Message, result);
+ }
+ }
+ return JsonOK(0);
+ }
+ #endregion
+
+ #region 세금계산서 발행(팝빌 발행)
+ ///
+ /// 세금계산서 발행(팝빌 발행)
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult PayTaxIssue(PayTax payTax)
+ {
+ payTax.uno = SUserInfo.UserNo; payTax.uip = GetUserIP();
+ if (payTax.iscancel != 1 && payTax.taxdate != null && Dao.Get("cr.paytaxes", new Hashtable() { { "payno", payTax.payno }, { "cno", payTax.cno }, { "iscancel", 0 }, { "nottaxno", payTax.taxno } }).Count() > 0)
+ {
+ return JsonBack(new JsonRtn() { code = -1 });
+ }
+
+ if (Dao.Save("cr.paytax.save", payTax) > 0)
+ {
+ var result = Popbill.PopbillService.Issue(payTax.mgtkey);
+ if (result.IsSuccess)
+ {
+ #region 세금계산서 상태코드 업데이트
+ var taxinvoiceInfo = PopbillService.GetTaxinvoiceInfo(payTax).Data;
+ payTax.statecode = taxinvoiceInfo.stateCode;
+ Dao.Save("cr.paytax.save", payTax);
+ #endregion
+ return JsonOK(result.Code);
+ }
+ else
+ {
+ return JsonError(JSONCode.Error, result.Message, result);
+ }
+ }
+ return JsonOK(0);
+ }
+ #endregion
+
+ #region 세금계산서 즉시발행(팝빌 발행 및 paytax.mgtkey 업데이트)
+ ///
+ /// 세금계산서 즉시발행(팝빌 발행 및 paytax.mgtkey 업데이트)
+ ///
+ /// payTax
+ ///
+ [HttpPost]
+ public JsonResult PayTaxRegistIssue(PayTax payTax)
+ {
+ payTax.uno = SUserInfo.UserNo; payTax.uip = GetUserIP();
+ if (payTax.iscancel != 1 && payTax.taxdate != null && Dao.Get("cr.paytaxes", new Hashtable() { { "payno", payTax.payno }, { "cno", payTax.cno }, { "iscancel", 0 }, { "nottaxno", payTax.taxno } }).Count() > 0)
+ {
+ return JsonBack(new JsonRtn() { code = -1 });
+ }
+
+ if (string.IsNullOrEmpty(payTax.mgtkey))
+ {
+ payTax.mgtkey = Popbill.PopbillService.MakeMgtKey(Dao,payTax.taxno, payTax.taxdate.Value);
+ }
+
+ if (Dao.Save("cr.paytax.save", payTax) > 0)
+ {
+ var payItems = Dao.Get("cr.paytaxitem2", new System.Collections.Hashtable() { { "taxno", payTax.taxno } });
+ var result = Popbill.PopbillService.RegistIssue(Dao, payTax, payItems);
+ if (result.IsSuccess)
+ {
+ #region 세금계산서 상태코드 업데이트
+ var taxinvoiceInfo = PopbillService.GetTaxinvoiceInfo(payTax).Data;
+ payTax.statecode = taxinvoiceInfo.stateCode;
+ Dao.Save("cr.paytax.save", payTax);
+ #endregion
+ return JsonOK(result.Code);
+ }
+ else
+ {
+ #region 즉시발행 실패시 mgtkey 미사용이면 저장값 초기화
+ var checkResult = Popbill.PopbillService.CheckMgtKeyInUse(payTax.mgtkey);
+ if (checkResult.IsSuccess)
+ {
+ if (!checkResult.IsUse)
+ {
+ payTax.mgtkey = string.Empty;
+ Dao.Save("cr.paytax.save", payTax);
+ }
+ }
+ #endregion
+ return JsonError(JSONCode.Error, result.Message, result);
+ }
+ }
+ return JsonOK(0);
+ }
+ #endregion
+
+ #region 세금계산서 발행취소(발행전: paytax.iscancel 상태값 변경, 발행완료: 팝빌 발행취소 및 paytax.iscancel 상태값 변경)
+ ///
+ /// 세금계산서 발행취소(발행전: paytax.iscancel 상태값 변경, 발행완료: 팝빌 발행취소 및 paytax.iscancel 상태값 변경)
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult PayTaxCancelIssue(PayTax payTax)
+ {
+ payTax.uno = SUserInfo.UserNo; payTax.uip = GetUserIP();
+ payTax.iscancel = 1;
+
+ //mgtkey 발급여부 체크
+ var nowPayTax = Dao.Get("cr.paytaxes", new Hashtable() { { "taxno", payTax.taxno } }).FirstOrDefault();
+ if (nowPayTax != null && !string.IsNullOrEmpty(nowPayTax.mgtkey))
+ {
+ payTax.mgtkey = nowPayTax.mgtkey;
+ }
+
+ if (!string.IsNullOrEmpty(payTax.mgtkey))
+ {
+ var taxinvoice = Popbill.PopbillService.GetTaxinvoice(payTax).Data;
+ if (!string.IsNullOrEmpty(taxinvoice.ntsconfirmNum))
+ {
+ var result = Popbill.PopbillService.CancelIssue(payTax.mgtkey);
+ if (result.IsSuccess)
+ {
+ #region 세금계산서 상태코드 업데이트
+ var taxinvoiceInfo = PopbillService.GetTaxinvoiceInfo(payTax).Data;
+ payTax.statecode = taxinvoiceInfo.stateCode;
+ #endregion
+ return JsonOK(Dao.Save("cr.paytax.save", payTax));
+ }
+ else
+ {
+ #region 팝빌에서 수동으로 취소한 상태면 디비 취소처리
+ var taxinvoiceInfo = PopbillService.GetTaxinvoiceInfo(payTax).Data;
+ if (taxinvoiceInfo.stateCode == 600)
+ {
+ return JsonOK(Dao.Save("cr.paytax.save", payTax));
+ }
+ #endregion
+ return JsonError(JSONCode.Error, result.Message, result);
+ }
+ }
+ else
+ {
+ return JsonOK(Dao.Save("cr.paytax.save", payTax));
+ }
+ }
+ else
+ {
+ return JsonOK(Dao.Save("cr.paytax.save", payTax));
+ }
+ }
+ #endregion
+
+ #region 세금계산서 조회(팝빌 세금계산서 인쇄 url 리턴)
+ ///
+ /// 세금계산서 조회(팝빌 세금계산서 인쇄 url 리턴)
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult PayTaxView(PayTax payTax)
+ {
+ var result = Popbill.PopbillService.GetPrintURL(payTax.mgtkey);
+ if (result.IsSuccess)
+ {
+ return JsonObj(result.Data);
+ }
+ else
+ {
+ return JsonError(JSONCode.Error, result.Message, result);
+ }
+ }
+ #endregion
+
+ [HttpPost]
+ public JsonResult SmartTaxView(String csid)
+ {
+ var Datas = new List() { };
+ var request = new SmartRequest()
+ {
+ MessageId = "kfcfkfcf" + DateTime.Now.ToString("yyyyMMddHHmmss"),
+ Signal = "DTI_STATUS",
+ RequestTime = DateTime.Now.ToString("yyyyMMddHHmmss"),
+ SendComRegno = "1048205661",
+ AuthToken = "d09OaVA0VXBsMzhnTWp3WE5SamZjRm1uQ245L3VYYjc4OWM3VG1WSlRoaz0K",
+ ServiceCode = "DTI",
+ ConversationId = new String[1] { csid }
+ };
+ System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
+ client.BaseAddress = new Uri("http://demoapi.smartbill.co.kr/");
+ client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
+ var response = client.PostAsJsonAsync("sb-api/request/", request).Result;
+ if (response.IsSuccessStatusCode)
+ {
+ var result = response.Content.ReadAsAsync().Result;
+ if ("30000".Equals(result.ResultCode))
+ {
+ var totalCount = result.ResultDataSet.Tables[0].Rows.Count;
+ if (0 < totalCount)
+ {
+ for (var i = 0; i < totalCount; i++)
+ {
+ Datas.Add(new Data()
+ {
+ strval = result.ResultDataSet.Tables[0].Rows[i].ItemArray[2].ToString(),//세금계산서 상태
+ strval2 = result.ResultDataSet.Tables[0].Rows[i].ItemArray[3].ToString(),//국세청 전송 상태
+ strval3 = result.ResultDataSet.Tables[0].Rows[i].ItemArray[4].ToString(),//국세청 전송 결과
+ strval4 = result.ResultDataSet.Tables[0].Rows[i].ItemArray[5].ToString(),//국세청 전송 일자
+ strval5 = result.ResultDataSet.Tables[0].Rows[i].ItemArray[9].ToString(),//세금계산서 작성일자
+ strval6 = result.ResultDataSet.Tables[0].Rows[i].ItemArray[10].ToString(),//세금계산서 발행일자
+ intval = GetInt(result.ResultDataSet.Tables[0].Rows[i].ItemArray[7].ToString()),//세금계산서 공급가액
+ intval2 = GetInt(result.ResultDataSet.Tables[0].Rows[i].ItemArray[8].ToString()),//세금계산서 세액
+ intval3 = GetInt(result.ResultDataSet.Tables[0].Rows[i].ItemArray[6].ToString())//세금계산서 합계금액
+ });
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[0].ToString();//참조번호
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[1].ToString();//승인번호
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[2].ToString();//세금계산서 상태
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[3].ToString();//국세청 전송 상태
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[4].ToString();//국세청 전송 결과
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[5].ToString();//국세청 전송 일자
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[6].ToString();//세금계산서 합계금액
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[7].ToString();//세금계산서 공급가액
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[8].ToString();//세금계산서 세액
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[9].ToString();//세금계산서 작성일자
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[10].ToString();//세금계산서 발행일자
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[11].ToString();//세금계산서 수정코드
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[12].ToString();//원본 세금계산서 승인번호
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[13].ToString();//매출,매입 구분
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[14].ToString();//세금계산서 유형
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[15].ToString();//거래명세서 포함 여부
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[16].ToString();//정,역 구분
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[17].ToString();//공급받는자 회원 구분
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[18].ToString();//영수,청구 구분
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[19].ToString();//공급자 회사명
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[20].ToString();//공급자 사업자번호
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[21].ToString();//공급받는자 회사명
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[22].ToString();//공급받는자 사업자번호
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[23].ToString();//수탁자 회사명
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[24].ToString();//수탁자 사업자번호
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[25].ToString();//위수탁 여부
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[26].ToString();//수정세금계산서 여부
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[27].ToString();//공급자 이메일
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[28].ToString();//공급받는자 이메일
+ //result.ResultDataSet.Tables[0].Rows[i].ItemArray[29].ToString();//수탁자 이메일
+ }
+ return JsonBack(new JsonRtn() { code = 1000, obj = Datas, msg = "" });
+ }
+ else
+ {
+ return JsonBack(new JsonRtn() { code = 1000, obj = Datas, msg = "데이터가 존재하지 않습니다." });
+ }
+ }
+ else
+ {
+ return JsonBack(new JsonRtn() { code = 1000, obj = Datas, msg = result.ResultMessage });
+ }
+ }
+ return JsonBack(new JsonRtn() { code = 1000, obj = Datas, msg = "관리자에게 문의해주세요." });
+ }
+ ///
+ /// 알림톡테스트
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult TalkTest(int scdno, String mobile, String email)
+ {
+ var masteremail = GetConfig("masteremail");
+ var senderemail = masteremail.Split(';')[0];
+ var m = new Memo() { Users = new List() { } };
+ //1~7. 온라인/혼합 출석 80% 미만, 진행평가, 최종평가, 과제, 토론, 강의평가 미참여
+ if (scdno < 8)
+ {
+ m.Users.Add(new MemoUser()
+ {
+ smstype = "A",
+ isok = 1,
+ title = "[영남건설기술교육원] 진행평가 참여 알림",
+ mobile = mobile,
+ mcontents = string.Format("영남건설기술교육원입니다.\n\n[{0}]님이 수강중인 [{1}] 강좌의 교육 종료일이 {2}일 남았습니다. 종료되기전에 서둘러 " +
+ (scdno < 3 ? "학습을 진행" : scdno == 3 ? "진행평가에" : scdno == 4 ? "최종평가에" : scdno == 5 ? "과제을 제출" : scdno == 6 ? "토론에 참여" : scdno == 7 ? "강의평가에 참여" : "-") + "해주세요.\n\n☞사이트 : https://ynicte.nptc.kr/",
+ "test", "테스트", 1)});
+ if (m.Users.Where(w => w.isok == 1).Count() > 0)
+ {
+ SaveTalk(m.Users.Where(w => w.isok == 1).ToList(), "encourage1");
+ m.Users.Clear();
+ }
+
+ m.Users.Add(new MemoUser()
+ {
+ smstype = "S",
+ isok = 1,
+ title = "[영남건설기술교육원] 진행평가 참여 알림",
+ mobile = mobile,
+ mcontents = string.Format("영남건설기술교육원입니다.\n\n[{0}]님이 수강중인 [{1}] 강좌의 교육 종료일이 {2}일 남았습니다. 종료되기전에 서둘러 " +
+ (scdno < 3 ? "학습을 진행" : scdno == 3 ? "진행평가에" : scdno == 4 ? "최종평가에" : scdno == 5 ? "과제을 제출" : scdno == 6 ? "토론에 참여" : scdno == 7 ? "강의평가에 참여" : "-") + "해주세요.\n\n☞사이트 : https://ynicte.nptc.kr/",
+ "test", "테스트", 1)
+ });
+ if (m.Users.Where(w => w.isok == 1).Count() > 0)
+ {
+ SaveSmsMulti(m.Users.Where(w => w.isok == 1).ToList());
+ m.Users.Clear();
+ }
+
+ if (IsEmail(email))
+ {
+ SendEmail(masteremail.Split(';')[1], GetInt(masteremail.Split(';')[2]), masteremail.Split(';')[3], masteremail.Split(';')[4], 999,
+ email, senderemail, "[영남건설기술교육원]", "[영남건설기술교육원] 진행평가 참여 알림",
+ string.Format("영남건설기술교육원입니다.
[{0}]님이 수강중인 [{1}] 강좌의 교육 종료일이 {2}일 남았습니다. 종료되기전에 서둘러 " +
+ (scdno < 3 ? "학습을 진행" : scdno == 3 ? "진행평가에" : scdno == 4 ? "최종평가에" : scdno == 5 ? "과제을 제출" : scdno == 6 ? "토론에 참여" : scdno == 7 ? "강의평가에 참여" : "-") + " 진행해주세요.
☞사이트 : https://ynicte.nptc.kr/",
+ "test", "테스트", 1));
+ }
+ }
+ else if (scdno == 8)//8. 오프라인 출석
+ {
+ m.Users.Add(new MemoUser()
+ {
+ smstype = "A",
+ isok = 1,
+ title = "[영남건설기술교육원] 진행평가 참여 알림",
+ mobile = mobile,
+ mcontents = string.Format("영남건설기술교육원입니다.\n\n{0}님이 신청중인 [{1}] 강좌의 교육이 [{2}]에 {3}에서 시작됩니다.\n\n☞사이트 : https://ynicte.nptc.kr/",
+ "test", "테스트", DateTime.Now.ToString("yyyy-MM-dd"),"영남건설기술교육원 대회의실")});
+ if (m.Users.Where(w => w.isok == 1).Count() > 0)
+ {
+ SaveTalk(m.Users.Where(w => w.isok == 1).ToList(), "encourage7");
+ m.Users.Clear();
+ }
+
+ m.Users.Add(new MemoUser()
+ {
+ smstype = "S",
+ isok = 1,
+ title = "[영남건설기술교육원] 진행평가 참여 알림",
+ mobile = mobile,
+ mcontents = string.Format("영남건설기술교육원입니다.\n\n{0}님이 신청중인 [{1}] 강좌의 교육이 [{2}]에 {3}에서 시작됩니다.\n\n☞사이트 : https://ynicte.nptc.kr/",
+ "test", "테스트", DateTime.Now.ToString("yyyy-MM-dd"), "영남건설기술교육원 대회의실")
+ });
+ if (m.Users.Where(w => w.isok == 1).Count() > 0)
+ {
+ SaveSmsMulti(m.Users.Where(w => w.isok == 1).ToList());
+ m.Users.Clear();
+ }
+
+ if (IsEmail(email))
+ {
+ SendEmail(masteremail.Split(';')[1], GetInt(masteremail.Split(';')[2]), masteremail.Split(';')[3], masteremail.Split(';')[4], 999, email, senderemail, "[영남건설기술교육원]", "[영남건설기술교육원] 진행평가 참여 알림",
+ string.Format("영남건설기술교육원입니다.
{0}님이 신청중인 [{1}] 강좌의 교육이 [{2}]에 {3}에서 시작됩니다.
☞사이트 : https://ynicte.nptc.kr/",
+ "test", "테스트", DateTime.Now.ToString("yyyy-MM-dd"),"영남건설기술교육원 대회의실"));
+ }
+ }
+ else if (scdno == 9)//9. 자격검정 시험
+ {
+ m.Users.Add(new MemoUser()
+ {
+ smstype = "A",
+ isok = 1,
+ title = "[영남건설기술교육원] 진행평가 참여 알림",
+ mobile = mobile,
+ mcontents = string.Format("영남건설기술교육원입니다.\n\n{0}님이 수강중인 [{1}] 자격검정이 [{2}]에 영남건설기술교육원 대회의실에서 이뤄질 예정입니다.\n\n☞사이트: https://ynicte.nptc.kr/",
+ "test", "테스트", DateTime.Now.ToString("yyyy-MM-dd HH:mm"))
+ });
+ if (m.Users.Where(w => w.isok == 1).Count() > 0)
+ {
+ SaveTalk(m.Users.Where(w => w.isok == 1).ToList(), "encourage8");
+ m.Users.Clear();
+ }
+
+ m.Users.Add(new MemoUser()
+ {
+ smstype = "S",
+ isok = 1,
+ title = "[영남건설기술교육원] 진행평가 참여 알림",
+ mobile = mobile,
+ mcontents = string.Format("영남건설기술교육원입니다.\n\n{0}님이 수강중인 [{1}] 자격검정이 [{2}]에 영남건설기술교육원 대회의실에서 이뤄질 예정입니다.\n\n☞사이트: https://ynicte.nptc.kr/",
+ "test", "테스트", DateTime.Now.ToString("yyyy-MM-dd HH:mm"))
+ });
+ if (m.Users.Where(w => w.isok == 1).Count() > 0)
+ {
+ SaveSmsMulti(m.Users.Where(w => w.isok == 1).ToList());
+ m.Users.Clear();
+ }
+
+ if (IsEmail(email))
+ {
+ SendEmail(masteremail.Split(';')[1], GetInt(masteremail.Split(';')[2]), masteremail.Split(';')[3], masteremail.Split(';')[4], 999, email, senderemail, "[영남건설기술교육원]", "[영남건설기술교육원] 진행평가 참여 알림",
+ string.Format("영남건설기술교육원입니다.
{0}님이 수강중인 [{1}] 자격검정이 [{2}]에 영남건설기술교육원 대회의실에서 이뤄질 예정입니다.
☞사이트: https://ynicte.nptc.kr/",
+ "test", "테스트", DateTime.Now.ToString("yyyy-MM-dd HH:mm")));
+ }
+ }
+ return JsonOK(1);
+ }
+ ///
+ /// 가상계좌 미수입금처리
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult PayUnPay(Int64 payno)
+ {
+ return JsonOK(Dao.Save("pay.unpay", new Hashtable() { { "payno", payno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
+ }
+ ///
+ /// 가상계좌 입금처리
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult PayABSPay(Int64 payno, int ptype)
+ {
+ return JsonOK(Dao.Save("pay.abspay", new Hashtable() { { "payno", payno }, { "ptype", ptype}, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
+ }
+ ///
+ /// 수강취소
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult PayCancelPay(Int64 payno, int userno)
+ {
+ return JsonOK(Dao.Save("pay.paycancel", new Hashtable() { { "payno", payno }, { "userno", userno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
+ }
+ ///
+ /// 미수입금처리
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult PayUnPayMoney(Int64 payno, DateTime payoktime)
+ {
+ return JsonOK(Dao.Save("pay.unpaymoney", new Hashtable() { { "payno", payno },{ "payoktime", payoktime}, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
+ }
+ ///
+ /// 수료일자 변경
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult LectTimeChange(Int64 lectno, DateTime? completetime, Int64 cshape)
+ {
+ return JsonOK(Dao.Save("lect.completetime.change", new Hashtable() { { "lectno", lectno }, { "completetime", completetime }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
+ }
+ ///
+ /// 교육일정목록
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult GetScdForMixEdu(int cmno, int iscmlects = 0)
+ {
+ var result = Dao.Get("cm.cminningscds.applyedu.admin", new System.Collections.Hashtable() { { "cmno", cmno }});
+ foreach (var item in result)
+ {
+ item.scdInfoSummary = string.Format("[{0}] {1}", item.studyplacename, item.estart.ToString("yyyy년 MM월 dd일 ddd요일 HH:mm"));
+ if (item.estart < DateTime.Now)
+ item.isEnd = true;
+ }
+
+ if (iscmlects == 1)
+ return JsonBack(result.OrderByDescending(o => o.estart));
+
+ return JsonBack(result);
+ }
+ ///
+ /// 교육일정회차목록
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult GetCmiForMixEdu(int cmno)
+ {
+ var rtn = new Hashtable();
+ rtn.Add("cmi", Dao.Get("cm.cminnings", new System.Collections.Hashtable() { { "cmno", cmno }, { "isonline", 0 }, { "isscd", 1 } }));
+ rtn.Add("cmis", Dao.Get("cm.cminningscds", new System.Collections.Hashtable() { { "cmno", cmno } }));
+ return JsonBack(rtn);
+ }
+ ///
+ /// 수강정보 교육일정 변경
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult LectScdChange(Int64 lectno, Int64 cmisno)
+ {
+ return JsonOK(Dao.Save("lect.cmisno.up", new Hashtable() { { "lectno", lectno }, { "cmisno" , cmisno} }));
+ }
+ ///
+ /// 결제신청정보변경
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult PPlogTypeChange(Int64 pplno, string typeman, string typejob, string typeedu, string typegrade)
+ {
+ return JsonOK(Dao.Save("pay.pplogtype.up", new Hashtable() { { "pplno", pplno }, { "typeman", typeman }, { "typejob", typejob }, { "typeedu", typeedu }, { "typegrade", typegrade } }));
+ }
+ ///
+ /// 과거신청이력
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult DocumnetsPast(Int64 no)
+ {
+ return JsonBack(Dao.Get("cr.documnetspast", new Hashtable() { { "no", no } }).First());
+ }
+ ///
+ /// 과거신청이력 수정
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult DocumnetsPastUpdate(Document document)
+ {
+ document.userpno = document.userpno.Replace("-", "");
+ document.uno = SUserInfo.UserNo;
+ document.uip = GetUserIP();
+ return JsonOK(Dao.Save("cr.documnetspast.up", document));
+ }
+ ///
+ /// 수료현황
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult Completion(Int64 lectno)
+ {
+ var comCodes = GetComCodes("typeman,typeedu,typegrade,typejob,studyplace");
+ var completion = Dao.Get("cr.completions", new Hashtable() { { "lectno", lectno } }).First();
+ completion.typeeduName = comCodes.Where(w => w.ccode == completion.typeedu).FirstOrDefault()?.cname;
+ completion.typegradeName = comCodes.Where(w => w.ccode == completion.typegrade).FirstOrDefault()?.cname;
+ completion.typejobName = comCodes.Where(w => w.ccode == completion.typejob).FirstOrDefault()?.cname;
+ completion.typemanName = comCodes.Where(w => w.ccode == completion.typeman).FirstOrDefault()?.cname;
+ completion.studyplaceName = comCodes.Where(w => w.ccode == completion.studyplace).FirstOrDefault()?.cname;
+ return JsonBack(completion);
+ }
+ ///
+ /// 수료현황변경
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult CompletionUpdate(Completion completion)
+ {
+ completion.uno = SUserInfo.UserNo;
+ completion.uip = GetUserIP();
+ completion.userpno = completion.userpno.Replace("-", "");
+
+ if (completion.userpno != null && completion.userpno.Length == 13)
+ {
+ switch (completion.userpno.Substring(6, 1))
+ {
+ case "1":
+ completion.birthday = "19";
+ break;
+ case "2":
+ completion.birthday = "19";
+ break;
+ case "3":
+ completion.birthday = "20";
+ break;
+ case "4":
+ completion.birthday = "20";
+ break;
+ case "5":
+ completion.birthday = "19";
+ break;
+ case "6":
+ completion.birthday = "19";
+ break;
+ case "7":
+ completion.birthday = "20";
+ break;
+ case "8":
+ completion.birthday = "20";
+ break;
+ default:
+ break;
+ }
+
+ completion.birthday += completion.userpno.Substring(0, 2) + "-" + completion.userpno.Substring(2, 2) + "-" + completion.userpno.Substring(4, 2);
+ }
+ if (completion.sdate != null)
+ {
+ completion.sdate = new DateTime(completion.sdate.Value.Year, completion.sdate.Value.Month, completion.sdate.Value.Day, 0, 0, 0);
+ }
+ if (completion.edate != null)
+ {
+ completion.edate = new DateTime(completion.edate.Value.Year, completion.edate.Value.Month, completion.edate.Value.Day, 23, 59, 59);
+ }
+
+ var check = Dao.Get("users.checkuser", new Hashtable() { { "usernonot", completion.userno }, { "mobile", completion.mobile }}).First();
+ if (check == 3)
+ {
+ return JsonError(JSONCode.Error, "이미 해당 휴대폰번호로 등록된 회원이 존재합니다.", false);
+ }
+ return JsonOK(Dao.Save("cr.completion.up", completion));
+ }
+ ///
+ /// 현금영수증 취소
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult UnTax(Int64 payno)
+ {
+ return JsonOK(Dao.Save("pay.untax", new Hashtable() { { "payno", payno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
+ }
+ ///
+ /// 세금계산서 확인 여부 변경
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult taxcheck(String taxnos,int ischeck,int? taxno)
+ {
+ if (string.IsNullOrEmpty(taxnos) && taxno == null)
+ {
+ return JsonBack(new JsonRtn() { code = 1000, obj = -1 });
+ }
+ if(Dao.Get("cr.paytax.byischeck", new Hashtable() { { "taxnos", taxnos },{"taxno",taxno }, { "ischeck",ischeck } }).FirstOrDefault() > 0)
+ {
+ return JsonBack(new JsonRtn() {code = 1000, obj = -2 });
+ }
+ return JsonOK(Dao.Save("pay.taxcheck", new Hashtable() { { "taxnos", taxnos }, { "taxno", taxno }, {"ischeck",ischeck }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
+ }
+ ///
+ /// 세금계산서 발행 취소
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public JsonResult taxcancel(String taxnos, int? taxno)
+ {
+ if (string.IsNullOrEmpty(taxnos) && taxno == null)
+ {
+ return JsonBack(new JsonRtn() { code = 1000, obj = -1 });
+ }
+ if (Dao.Get("cr.paytax.byisstate", new Hashtable() { { "taxnos", taxnos }, { "taxno", taxno }, { "state", 0 } }).FirstOrDefault() > 0)
+ {
+ return JsonBack(new JsonRtn() { code = 1000, obj = -2 });
+ }
+ return JsonOK(Dao.Save("pay.taxcancel", new Hashtable() { { "taxnos", taxnos }, { "taxno", taxno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Dao/MyBatis/Maps/Lect.xml b/Dao/MyBatis/Maps/Lect.xml
index 24c721d..edf81d7 100644
--- a/Dao/MyBatis/Maps/Lect.xml
+++ b/Dao/MyBatis/Maps/Lect.xml
@@ -803,6 +803,42 @@
order by cdt desc
+
+
+