@@ -156,6 +156,9 @@ | |||||
<Reference Include="System.Web.Services" /> | <Reference Include="System.Web.Services" /> | ||||
<Reference Include="System.EnterpriseServices" /> | <Reference Include="System.EnterpriseServices" /> | ||||
<Reference Include="System.Xml.Linq" /> | <Reference Include="System.Xml.Linq" /> | ||||
<Reference Include="ThoughtWorks.QRCode, Version=1.0.4778.30637, Culture=neutral, processorArchitecture=MSIL"> | |||||
<HintPath>..\packages\ThoughtWorks.QRCode.1.1.0\lib\ThoughtWorks.QRCode.dll</HintPath> | |||||
</Reference> | |||||
<Reference Include="WebGrease, Version=1.5.2.14234, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | <Reference Include="WebGrease, Version=1.5.2.14234, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||||
<HintPath>..\packages\WebGrease.1.5.2\lib\WebGrease.dll</HintPath> | <HintPath>..\packages\WebGrease.1.5.2\lib\WebGrease.dll</HintPath> | ||||
</Reference> | </Reference> | ||||
@@ -192,6 +195,8 @@ | |||||
<ItemGroup> | <ItemGroup> | ||||
<Compile Include="Bootstraper.cs" /> | <Compile Include="Bootstraper.cs" /> | ||||
<Compile Include="Modules\AnnexesApiWx.cs" /> | <Compile Include="Modules\AnnexesApiWx.cs" /> | ||||
<Compile Include="Modules\StuFreshPayFeeApi.cs" /> | |||||
<Compile Include="Modules\StuPayFeeApi.cs" /> | |||||
<Compile Include="Modules\BaseNoLoginApi.cs" /> | <Compile Include="Modules\BaseNoLoginApi.cs" /> | ||||
<Compile Include="Modules\ArrangeLessonTermAttemperApi.cs" /> | <Compile Include="Modules\ArrangeLessonTermAttemperApi.cs" /> | ||||
<Compile Include="Modules\DataSourceNoLoginApi.cs" /> | <Compile Include="Modules\DataSourceNoLoginApi.cs" /> | ||||
@@ -0,0 +1,216 @@ | |||||
using System; | |||||
using Learun.Application.Organization; | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||||
using Learun.Application.TwoDevelopment.EvaluationTeach; | |||||
using Learun.Util; | |||||
using Nancy; | |||||
using System.Collections.Generic; | |||||
using System.Drawing; | |||||
using System.IO; | |||||
using System.Linq; | |||||
using System.Security.Cryptography; | |||||
using System.Text; | |||||
using System.Web; | |||||
using System.Web.Mvc; | |||||
using Learun.Application.Base.SystemModule; | |||||
using Learun.Application.TwoDevelopment.Ask; | |||||
using Learun.Application.TwoDevelopment.ReceiveSendFeeManagement; | |||||
using Newtonsoft.Json; | |||||
using ThoughtWorks.QRCode.Codec; | |||||
namespace Learun.Application.WebApi.Modules | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创建人:数字化智慧校园-框架开发组 | |||||
/// 日 期:2018.01.04 | |||||
/// 描 述:部门管理 | |||||
/// </summary> | |||||
public class StuFreshPayFeeApi : BaseApi | |||||
{ | |||||
public StuFreshPayFeeApi() | |||||
: base("/learun/freshpayfee") | |||||
{ | |||||
Get["/getpayfeelist"] = GetPayfeeList;// 获取缴费列表 | |||||
Get["/getpayfeeinfo"] = GetPayfeeInfo;//获取缴费明细 | |||||
Post["/generateqrcode"] = PayFeeQRCode; | |||||
} | |||||
private StuInfoFreshIBLL stuInfoFreshIBLL = new StuInfoFreshBLL(); | |||||
private FinaChargesStandardIBLL finaChargesStandardIBLL = new FinaChargesStandardBLL(); | |||||
/// <summary> | |||||
/// 获取问卷 | |||||
/// </summary> | |||||
/// <param name="_"></param> | |||||
/// <returns></returns> | |||||
public Response GetPayfeeList(dynamic _) | |||||
{ | |||||
ReqPageParam parameter = this.GetReqData<ReqPageParam>(); | |||||
var data = stuInfoFreshIBLL.GetPageList(parameter.pagination, parameter.queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = parameter.pagination.total, | |||||
page = parameter.pagination.page, | |||||
records = parameter.pagination.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
public Response GetPayfeeInfo(dynamic _) | |||||
{ | |||||
string keyValue = Request.Query["keyValue"]; | |||||
int jiaoFeiYear = DateTime.Now.Year; | |||||
var StuInfoFreshData = stuInfoFreshIBLL.GetStuInfoFreshEntity(keyValue); | |||||
var stuInfoFreshFamily = stuInfoFreshIBLL.GetStuInfoFreshFamilyList(keyValue); | |||||
//当前年度缴费记录 | |||||
var FeeOrderList = stuInfoFreshIBLL.GetFeeOrderList(StuInfoFreshData.StuNo, jiaoFeiYear); | |||||
var FinaChargesStandardList = new List<FinaChargesStandardEntity>(); | |||||
FinaChargesStandardList = finaChargesStandardIBLL.GetFinaChargesStandardListByYongYou(StuInfoFreshData.StuNo, jiaoFeiYear).ToList(); | |||||
var PayFeeTotal = FinaChargesStandardList.Select(x => x.Standard).Sum(); | |||||
var jsonData = new | |||||
{ | |||||
StuInfoFreshData = StuInfoFreshData, | |||||
FinaChargesStandardList = FinaChargesStandardList, | |||||
StuInfoFreshFamilyList = stuInfoFreshFamily, | |||||
PayFeeTotal = PayFeeTotal, | |||||
YJAmount = FeeOrderList.Sum(x => x.SJAmount) | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
public class PayfeeRequest | |||||
{ | |||||
public string strEntity { get; set; } | |||||
public string detailList { get; set; } | |||||
} | |||||
/// <summary> | |||||
/// 生成缴费二维码 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public Response PayFeeQRCode(dynamic _) | |||||
{ | |||||
string keyValue = Request.Query["keyValue"]; | |||||
PayfeeRequest parameter = this.GetReqData<PayfeeRequest>(); | |||||
StuInfoFreshEntity entity = parameter.strEntity.ToObject<StuInfoFreshEntity>(); | |||||
List<StuEnrollFeeOrderDetailEntity> list = parameter.detailList.ToObject<List<StuEnrollFeeOrderDetailEntity>>(); | |||||
var model = stuInfoFreshIBLL.GetStuInfoFreshEntity(keyValue); | |||||
var imgUrl = ""; | |||||
Random ran = new Random(); | |||||
string merchantid = "105000082201406";//商户号 | |||||
string posid = "043724806";//商户柜台代码 | |||||
string branchid = "510000000";//分行代码 | |||||
string orderid = DateTime.Now.ToString("yyyyMMddhhmmss") + ran.Next(0, 100000); | |||||
string payment = entity.PayMoney.ToString(); | |||||
string curcode = "01"; | |||||
string txcode = "530550"; | |||||
string remark1 = model.StuNo; | |||||
string remark2 = "20" + model.Grade; | |||||
string returntype = "3"; | |||||
string timeout = DateTime.Now.AddMinutes(10).ToString("yyyyMMddHHmmss"); | |||||
string pub32tr2 = "40d987faa793a0a27e7a86ef020111"; | |||||
string bankURL = "https://ibsbjstar.ccb.com.cn/CCBIS/ccbMain?CCB_IBSVersion=V6"; | |||||
string tmp = "MERCHANTID=" + merchantid + "&POSID=" + posid + "&BRANCHID=" + branchid + "&ORDERID=" + orderid; | |||||
tmp += "&PAYMENT=" + payment + "&CURCODE=" + curcode + "&TXCODE=" + txcode + "&REMARK1=" + remark1; | |||||
tmp += "&REMARK2=" + remark2 + "&RETURNTYPE=" + returntype + "&TIMEOUT=" + timeout; | |||||
MD5 md5 = MD5.Create(); | |||||
string tmp1 = tmp; | |||||
tmp += "&PUB=" + pub32tr2; | |||||
byte[] buffer = Encoding.Default.GetBytes(tmp); | |||||
byte[] md5Buffer = md5.ComputeHash(buffer); | |||||
string strMd5 = ""; | |||||
//hdnOrderId.Value = orderid; | |||||
foreach (byte item in md5Buffer) | |||||
{ | |||||
strMd5 += item.ToString("x2"); | |||||
} | |||||
string url = bankURL + "&" + tmp1 + "&MAC=" + strMd5; | |||||
string reJson = HttpMethods.Post(url); | |||||
LogEntity logEntity = new LogEntity(); | |||||
logEntity.F_CategoryId = 121; | |||||
logEntity.F_ExecuteResultJson = reJson; | |||||
logEntity.WriteLog(); | |||||
//HttpConnect conn = new HttpConnect(); | |||||
//string reJson = conn.Post(url, ""); | |||||
JsonBean MemberInfoList = JsonConvert.DeserializeObject<JsonBean>(reJson); | |||||
if (MemberInfoList.SUCCESS.Equals("true")) | |||||
{ | |||||
string imgCode = HttpMethods.Post(MemberInfoList.PAYURL); | |||||
logEntity.F_CategoryId = 121; | |||||
logEntity.F_ExecuteResultJson = imgCode; | |||||
logEntity.WriteLog(); | |||||
MemberInfoList = JsonConvert.DeserializeObject<JsonBean>(imgCode); | |||||
if (MemberInfoList.SUCCESS.Equals("true")) | |||||
{ | |||||
imgUrl = CreateQRImg(MemberInfoList.QRURL, orderid); | |||||
} | |||||
} | |||||
if (!string.IsNullOrEmpty(imgUrl)) | |||||
{ | |||||
// model.PayFeeDetail = entity.PayFeeDetail; | |||||
// model.PayMoney = entity.PayMoney; | |||||
model.LoanMoney = entity.LoanMoney; | |||||
model.orderid = orderid; | |||||
stuInfoFreshIBLL.SaveFeeData(keyValue, model, list); | |||||
} | |||||
return Success(imgUrl); | |||||
} | |||||
public class JsonBean | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string SUCCESS { get; set; } | |||||
public string PAYURL { get; set; } | |||||
public string QRURL { get; set; } | |||||
} | |||||
/// <summary> | |||||
/// 生成并保存二维码图片的方法 | |||||
/// </summary> | |||||
/// <param name="str">输入的内容</param> | |||||
public string CreateQRImg(string str, string orderId) | |||||
{ | |||||
string QRCodeFile = Config.GetValue("QRCodeFile"); | |||||
Random ran = new Random(); | |||||
Bitmap bt; | |||||
str = HttpUtility.UrlDecode(str); | |||||
string enCodeString = str; | |||||
//生成设置编码实例 | |||||
QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(); | |||||
//设置二维码的规模,默认4 | |||||
qrCodeEncoder.QRCodeScale = 3; | |||||
//设置二维码的版本,默认7 | |||||
qrCodeEncoder.QRCodeVersion = 7; | |||||
//设置错误校验级别,默认中等 | |||||
qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M; | |||||
//生成二维码图片 | |||||
bt = qrCodeEncoder.Encode(enCodeString, Encoding.UTF8); | |||||
//二维码图片的名称 | |||||
string filename = orderId; | |||||
if (!DirFileHelper.IsExistFile(QRCodeFile + "/Content/images/QRCode/")) | |||||
{ | |||||
Directory.CreateDirectory(QRCodeFile + "/Content/images/QRCode/"); | |||||
} | |||||
var path = QRCodeFile + "/Content/images/QRCode/" + filename + ".jpg"; | |||||
//保存二维码图片在photos路径下 | |||||
try | |||||
{ | |||||
bt.Save(path); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
return ""; | |||||
} | |||||
//图片控件要显示的二维码图片路径 | |||||
return QRCodeFile + "/Content/images/QRCode/" + filename + ".jpg"; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,212 @@ | |||||
using System; | |||||
using Learun.Application.Organization; | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||||
using Learun.Application.TwoDevelopment.EvaluationTeach; | |||||
using Learun.Util; | |||||
using Nancy; | |||||
using System.Collections.Generic; | |||||
using System.Drawing; | |||||
using System.IO; | |||||
using System.Linq; | |||||
using System.Security.Cryptography; | |||||
using System.Text; | |||||
using System.Web; | |||||
using System.Web.Mvc; | |||||
using Learun.Application.Base.SystemModule; | |||||
using Learun.Application.TwoDevelopment.Ask; | |||||
using Learun.Application.TwoDevelopment.ReceiveSendFeeManagement; | |||||
using Newtonsoft.Json; | |||||
using ThoughtWorks.QRCode.Codec; | |||||
namespace Learun.Application.WebApi.Modules | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创建人:数字化智慧校园-框架开发组 | |||||
/// 日 期:2018.01.04 | |||||
/// 描 述:部门管理 | |||||
/// </summary> | |||||
public class StuPayFeeApi : BaseApi | |||||
{ | |||||
public StuPayFeeApi() | |||||
: base("/learun/payfee") | |||||
{ | |||||
Get["/getpayfeelist"] = GetPayfeeList;// 获取缴费列表 | |||||
Get["/getpayfeeinfo"] = GetPayfeeInfo;//获取缴费明细 | |||||
Post["/generateqrcode"] = PayFeeQRCode; | |||||
} | |||||
private StuInfoBasic_PayFeeIBLL stuInfoBasic_PayFeeIBLL = new StuInfoBasic_PayFeeBLL(); | |||||
private StuInfoBasicIBLL stuInfoBasicIbll = new StuInfoBasicBLL(); | |||||
private StuInfoFreshIBLL stuInfoFreshIBLL = new StuInfoFreshBLL(); | |||||
private FinaChargesStandardIBLL finaChargesStandardIBLL = new FinaChargesStandardBLL(); | |||||
/// <summary> | |||||
/// 获取问卷 | |||||
/// </summary> | |||||
/// <param name="_"></param> | |||||
/// <returns></returns> | |||||
public Response GetPayfeeList(dynamic _) | |||||
{ | |||||
ReqPageParam parameter = this.GetReqData<ReqPageParam>(); | |||||
var data = stuInfoBasic_PayFeeIBLL.GetPageList(parameter.pagination, parameter.queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = parameter.pagination.total, | |||||
page = parameter.pagination.page, | |||||
records = parameter.pagination.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
public Response GetPayfeeInfo(dynamic _) | |||||
{ | |||||
string keyValue = Request.Query["keyValue"]; | |||||
var stuInfoBasic_PayFeeEntity = stuInfoBasic_PayFeeIBLL.GetStuInfoBasic_PayFeeEntity(keyValue); | |||||
var StuInfoFreshData = stuInfoBasicIbll.GetStuInfoBasicEntityByStuNo(stuInfoBasic_PayFeeEntity.StuNo); | |||||
//当前年度缴费记录 | |||||
var FinaChargesStandardList = new List<FinaChargesStandardEntity>(); | |||||
FinaChargesStandardList = finaChargesStandardIBLL.GetFinaChargesStandardListByYongYou(StuInfoFreshData.StuNo, stuInfoBasic_PayFeeEntity.PayYear.Value).ToList(); | |||||
var PayFeeTotal = FinaChargesStandardList.Select(x => x.SJAmount).Sum(); | |||||
var jsonData = new | |||||
{ | |||||
StuInfoFreshData = StuInfoFreshData, | |||||
FinaChargesStandardList = FinaChargesStandardList, | |||||
PayFeeTotal = PayFeeTotal, | |||||
YJAmount = FinaChargesStandardList.Sum(x => x.PayedMoney) | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
public class PayfeeRequest | |||||
{ | |||||
public string strEntity { get; set; } | |||||
public string detailList { get; set; } | |||||
} | |||||
/// <summary> | |||||
/// 生成缴费二维码 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public Response PayFeeQRCode(dynamic _) | |||||
{ | |||||
string keyValue = Request.Query["keyValue"]; | |||||
PayfeeRequest parameter = this.GetReqData<PayfeeRequest>(); | |||||
StuInfoFreshEntity entity = parameter.strEntity.ToObject<StuInfoFreshEntity>(); | |||||
List<StuEnrollFeeOrderDetailEntity> list = parameter.detailList.ToObject<List<StuEnrollFeeOrderDetailEntity>>(); | |||||
var model = stuInfoBasic_PayFeeIBLL.GetStuInfoBasic_PayFeeEntity(keyValue); | |||||
var imgUrl = ""; | |||||
Random ran = new Random(); | |||||
string merchantid = "105000082201406";//商户号 | |||||
string posid = "043724806";//商户柜台代码 | |||||
string branchid = "510000000";//分行代码 | |||||
string orderid = DateTime.Now.ToString("yyyyMMddhhmmss") + ran.Next(0, 100000); | |||||
string payment = entity.PayMoney.ToString(); | |||||
string curcode = "01"; | |||||
string txcode = "530550"; | |||||
string remark1 = model.StuNo; | |||||
string remark2 = model.PayYear.ToString(); | |||||
string returntype = "3"; | |||||
string timeout = DateTime.Now.AddMinutes(10).ToString("yyyyMMddHHmmss"); | |||||
string pub32tr2 = "40d987faa793a0a27e7a86ef020111"; | |||||
string bankURL = "https://ibsbjstar.ccb.com.cn/CCBIS/ccbMain?CCB_IBSVersion=V6"; | |||||
string tmp = "MERCHANTID=" + merchantid + "&POSID=" + posid + "&BRANCHID=" + branchid + "&ORDERID=" + orderid; | |||||
tmp += "&PAYMENT=" + payment + "&CURCODE=" + curcode + "&TXCODE=" + txcode + "&REMARK1=" + remark1; | |||||
tmp += "&REMARK2=" + remark2 + "&RETURNTYPE=" + returntype + "&TIMEOUT=" + timeout; | |||||
MD5 md5 = MD5.Create(); | |||||
string tmp1 = tmp; | |||||
tmp += "&PUB=" + pub32tr2; | |||||
byte[] buffer = Encoding.Default.GetBytes(tmp); | |||||
byte[] md5Buffer = md5.ComputeHash(buffer); | |||||
string strMd5 = ""; | |||||
//hdnOrderId.Value = orderid; | |||||
foreach (byte item in md5Buffer) | |||||
{ | |||||
strMd5 += item.ToString("x2"); | |||||
} | |||||
string url = bankURL + "&" + tmp1 + "&MAC=" + strMd5; | |||||
string reJson = HttpMethods.Post(url); | |||||
LogEntity logEntity = new LogEntity(); | |||||
logEntity.F_CategoryId = 121; | |||||
logEntity.F_ExecuteResultJson = reJson; | |||||
logEntity.WriteLog(); | |||||
//HttpConnect conn = new HttpConnect(); | |||||
//string reJson = conn.Post(url, ""); | |||||
JsonBean MemberInfoList = JsonConvert.DeserializeObject<JsonBean>(reJson); | |||||
if (MemberInfoList.SUCCESS.Equals("true")) | |||||
{ | |||||
string imgCode = HttpMethods.Post(MemberInfoList.PAYURL); | |||||
logEntity.F_CategoryId = 121; | |||||
logEntity.F_ExecuteResultJson = imgCode; | |||||
logEntity.WriteLog(); | |||||
MemberInfoList = JsonConvert.DeserializeObject<JsonBean>(imgCode); | |||||
if (MemberInfoList.SUCCESS.Equals("true")) | |||||
{ | |||||
imgUrl = CreateQRImg(MemberInfoList.QRURL, orderid); | |||||
} | |||||
} | |||||
if (!string.IsNullOrEmpty(imgUrl)) | |||||
{ | |||||
model.orderid = orderid; | |||||
stuInfoFreshIBLL.SaveFeeData(keyValue, model, list); | |||||
} | |||||
return Success(imgUrl); | |||||
} | |||||
public class JsonBean | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string SUCCESS { get; set; } | |||||
public string PAYURL { get; set; } | |||||
public string QRURL { get; set; } | |||||
} | |||||
/// <summary> | |||||
/// 生成并保存二维码图片的方法 | |||||
/// </summary> | |||||
/// <param name="str">输入的内容</param> | |||||
public string CreateQRImg(string str, string orderId) | |||||
{ | |||||
string QRCodeFile = Config.GetValue("QRCodeFile"); | |||||
Random ran = new Random(); | |||||
Bitmap bt; | |||||
str = HttpUtility.UrlDecode(str); | |||||
string enCodeString = str; | |||||
//生成设置编码实例 | |||||
QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(); | |||||
//设置二维码的规模,默认4 | |||||
qrCodeEncoder.QRCodeScale = 3; | |||||
//设置二维码的版本,默认7 | |||||
qrCodeEncoder.QRCodeVersion = 7; | |||||
//设置错误校验级别,默认中等 | |||||
qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M; | |||||
//生成二维码图片 | |||||
bt = qrCodeEncoder.Encode(enCodeString, Encoding.UTF8); | |||||
//二维码图片的名称 | |||||
string filename = orderId; | |||||
if (!DirFileHelper.IsExistFile(QRCodeFile+"/Content/images/QRCode/")) | |||||
{ | |||||
Directory.CreateDirectory(QRCodeFile + "/Content/images/QRCode/"); | |||||
} | |||||
var path = QRCodeFile + "/Content/images/QRCode/" + filename + ".jpg"; | |||||
//保存二维码图片在photos路径下 | |||||
try | |||||
{ | |||||
bt.Save(path); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
return ""; | |||||
} | |||||
//图片控件要显示的二维码图片路径 | |||||
return QRCodeFile + "/Content/images/QRCode/" + filename + ".jpg"; | |||||
} | |||||
} | |||||
} |
@@ -36,6 +36,8 @@ namespace Learun.Application.WebApi.Modules | |||||
Get["/weixinconfig"] = GetWeixinConfig; | Get["/weixinconfig"] = GetWeixinConfig; | ||||
Post["/getweixinaccess_token"] = GetWeixinAccess_token; | Post["/getweixinaccess_token"] = GetWeixinAccess_token; | ||||
Post["/login"] = Login; | Post["/login"] = Login; | ||||
//新生首次登陆 | |||||
Post["/loginbyidcard"] = LoginByIdCard; | |||||
Get["/getweixinwebaccess_token"] = GetWeixinWebaccess_token; | Get["/getweixinwebaccess_token"] = GetWeixinWebaccess_token; | ||||
//获取ACIp | //获取ACIp | ||||
Get["/GetACIp"] = GetACIp; | Get["/GetACIp"] = GetACIp; | ||||
@@ -241,6 +243,77 @@ namespace Learun.Application.WebApi.Modules | |||||
#endregion | #endregion | ||||
} | } | ||||
private Response LoginByIdCard(dynamic _) | |||||
{ | |||||
LoginModel loginModel = this.GetReqData<LoginModel>(); | |||||
#region 内部账户验证 | |||||
UserEntity userEntity = userIbll.CheckLoginByIdCard(loginModel.username, loginModel.password); | |||||
#region 写入日志 | |||||
LogEntity logEntity = new LogEntity(); | |||||
logEntity.F_CategoryId = 1; | |||||
logEntity.F_OperateTypeId = ((int)OperationType.Login).ToString(); | |||||
logEntity.F_OperateType = EnumAttribute.GetDescription(OperationType.Login); | |||||
logEntity.F_OperateAccount = loginModel.username + "(" + userEntity.F_RealName + ")"; | |||||
logEntity.F_OperateUserId = !string.IsNullOrEmpty(userEntity.F_UserId) ? userEntity.F_UserId : loginModel.username; | |||||
logEntity.F_Module = Config.GetValue("SoftName"); | |||||
logEntity.F_Description = "移动端"; | |||||
#endregion | |||||
if (!userEntity.LoginOk)//登录失败 | |||||
{ | |||||
//写入日志 | |||||
logEntity.F_ExecuteResult = 0; | |||||
logEntity.F_ExecuteResultJson = "登录失败:" + userEntity.LoginMsg; | |||||
logEntity.WriteLog(); | |||||
return Fail(userEntity.LoginMsg); | |||||
} | |||||
else | |||||
{ | |||||
ReqParameter req = this.Bind<ReqParameter>(); | |||||
string token = OperatorHelper.Instance.AddLoginUser(userEntity.F_Account, "Learun_ADMS_6.1_App", req.loginMark, false);//写入缓存信息 | |||||
//写入日志 | |||||
logEntity.F_ExecuteResult = 1; | |||||
logEntity.F_ExecuteResultJson = "登录成功"; | |||||
logEntity.WriteLog(); | |||||
OperatorResult res = OperatorHelper.Instance.IsOnLine(token, req.loginMark); | |||||
res.userInfo.password = null; | |||||
res.userInfo.secretkey = null; | |||||
var studententity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(userEntity.F_Account); | |||||
if (studententity != null) | |||||
{ | |||||
res.userInfo.grade = studententity.Grade; | |||||
var majorinfo = majorIbll.GetCdMajorEntityByMajorNo(studententity.MajorNo); | |||||
if (majorinfo != null) | |||||
{ | |||||
res.userInfo.majorno = majorinfo.ID ?? ""; | |||||
} | |||||
} | |||||
//是否强密码验证 | |||||
bool pwd = false; | |||||
if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true" && loginModel.up == false) | |||||
{ | |||||
pwd = true; | |||||
} | |||||
else | |||||
{ | |||||
//保存用户设备号 | |||||
userIbll.UpdateWeixinOpenId(userEntity.F_UserId, loginModel.openid); | |||||
} | |||||
var jsonData = new | |||||
{ | |||||
baseinfo = res.userInfo, | |||||
post = postIBLL.GetListByPostIds(res.userInfo.postIds), | |||||
role = roleIBLL.GetListByRoleIds(res.userInfo.roleIds), | |||||
pwd = pwd | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
#endregion | |||||
} | |||||
public Response GetWeixinWebaccess_token(dynamic _) | public Response GetWeixinWebaccess_token(dynamic _) | ||||
{ | { | ||||
var entity = weChatConfigIbll.GetEnableEntity(); | var entity = weChatConfigIbll.GetEnableEntity(); | ||||
@@ -66,6 +66,7 @@ | |||||
<add key="userKey" value="14B417B0-463D-4F2B-8075-0A20EEDB773A" /> | <add key="userKey" value="14B417B0-463D-4F2B-8075-0A20EEDB773A" /> | ||||
<!-- ==================注意附件上传地址 修改到主网站部署目录下的Resource要不然飞星会报错================== --> | <!-- ==================注意附件上传地址 修改到主网站部署目录下的Resource要不然飞星会报错================== --> | ||||
<add key="AnnexesFile" value="D:\leiprojects\西昌单校区\Learun.Application.Web\Resource" /> | <add key="AnnexesFile" value="D:\leiprojects\西昌单校区\Learun.Application.Web\Resource" /> | ||||
<add key="QRCodeFile" value="D:\leiprojects\西昌单校区\Learun.Application.Web\Content" /> | |||||
<add key="ReportFile" value="~/Reports" /> | <add key="ReportFile" value="~/Reports" /> | ||||
<!-- ================== 工作流服务地址 ================== --> | <!-- ================== 工作流服务地址 ================== --> | ||||
<add key="workflowapi" value="http://localhost:8013" /> | <add key="workflowapi" value="http://localhost:8013" /> | ||||
@@ -30,6 +30,7 @@ | |||||
<package id="Oracle.ManagedDataAccess" version="12.1.24160719" targetFramework="net45" /> | <package id="Oracle.ManagedDataAccess" version="12.1.24160719" targetFramework="net45" /> | ||||
<package id="Oracle.ManagedDataAccess.EntityFramework" version="12.1.2400" targetFramework="net45" /> | <package id="Oracle.ManagedDataAccess.EntityFramework" version="12.1.2400" targetFramework="net45" /> | ||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net45" requireReinstallation="true" /> | <package id="System.ValueTuple" version="4.5.0" targetFramework="net45" requireReinstallation="true" /> | ||||
<package id="ThoughtWorks.QRCode" version="1.1.0" targetFramework="net461" /> | |||||
<package id="Unity" version="4.0.1" targetFramework="net45" /> | <package id="Unity" version="4.0.1" targetFramework="net45" /> | ||||
<package id="WebGrease" version="1.5.2" targetFramework="net45" /> | <package id="WebGrease" version="1.5.2" targetFramework="net45" /> | ||||
</packages> | </packages> |