@@ -0,0 +1,144 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<configuration> | |||
<configSections> | |||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> | |||
</configSections> | |||
<appSettings> | |||
<!-- ================== 6:即时通信参数 ================== --> | |||
<add key="IMUrl" value="http://localhost:8012" /> | |||
</appSettings> | |||
<!--日志--> | |||
<log4net> | |||
<!--根配置--> | |||
<root> | |||
<!--日志级别:可选值: ERROR > WARN > INFO > DEBUG --> | |||
<level value="ERROR" /> | |||
<level value="WARN" /> | |||
<level value="INFO" /> | |||
<level value="DEBUG" /> | |||
<appender-ref ref="ErrorLog" /> | |||
<appender-ref ref="WarnLog" /> | |||
<appender-ref ref="InfoLog" /> | |||
<appender-ref ref="DebugLog" /> | |||
</root> | |||
<!-- 错误 Error.log--> | |||
<appender name="ErrorLog" type="log4net.Appender.RollingFileAppender"> | |||
<!--目录路径,可以是相对路径或绝对路径--> | |||
<param name="File" value="C:\Learun_log" /> | |||
<!--文件名,按日期生成文件夹--> | |||
<param name="DatePattern" value="/yyyy-MM-dd/"Error.log"" /> | |||
<!--追加到文件--> | |||
<appendToFile value="true" /> | |||
<!--创建日志文件的方式,可选值:Date[日期],文件大小[Size],混合[Composite]--> | |||
<rollingStyle value="Composite" /> | |||
<!--写到一个文件--> | |||
<staticLogFileName value="false" /> | |||
<!--单个文件大小。单位:KB|MB|GB--> | |||
<maximumFileSize value="200MB" /> | |||
<!--最多保留的文件数,设为"-1"则不限--> | |||
<maxSizeRollBackups value="-1" /> | |||
<!--日志格式--> | |||
<layout type="log4net.Layout.PatternLayout"> | |||
<conversionPattern value="%message" /> | |||
</layout> | |||
<filter type="log4net.Filter.LevelRangeFilter"> | |||
<param name="LevelMin" value="ERROR" /> | |||
<param name="LevelMax" value="ERROR" /> | |||
</filter> | |||
</appender> | |||
<!-- 警告 Warn.log--> | |||
<appender name="WarnLog" type="log4net.Appender.RollingFileAppender"> | |||
<!--目录路径,可以是相对路径或绝对路径--> | |||
<param name="File" value="C:\Learun_log" /> | |||
<!--文件名,按日期生成文件夹--> | |||
<param name="DatePattern" value="/yyyy-MM-dd/"Warn.log"" /> | |||
<!--追加到文件--> | |||
<appendToFile value="true" /> | |||
<!--创建日志文件的方式,可选值:Date[日期],文件大小[Size],混合[Composite]--> | |||
<rollingStyle value="Composite" /> | |||
<!--写到一个文件--> | |||
<staticLogFileName value="false" /> | |||
<!--单个文件大小。单位:KB|MB|GB--> | |||
<maximumFileSize value="200MB" /> | |||
<!--最多保留的文件数,设为"-1"则不限--> | |||
<maxSizeRollBackups value="-1" /> | |||
<!--日志格式--> | |||
<layout type="log4net.Layout.PatternLayout"> | |||
<conversionPattern value="%message" /> | |||
</layout> | |||
<filter type="log4net.Filter.LevelRangeFilter"> | |||
<param name="LevelMin" value="WARN" /> | |||
<param name="LevelMax" value="WARN" /> | |||
</filter> | |||
</appender> | |||
<!-- 信息 Info.log--> | |||
<appender name="InfoLog" type="log4net.Appender.RollingFileAppender"> | |||
<!--目录路径,可以是相对路径或绝对路径--> | |||
<param name="File" value="C:\Learun_log" /> | |||
<!--文件名,按日期生成文件夹--> | |||
<param name="DatePattern" value="/yyyy-MM-dd/"Info.log"" /> | |||
<!--追加到文件--> | |||
<appendToFile value="true" /> | |||
<!--创建日志文件的方式,可选值:Date[日期],文件大小[Size],混合[Composite]--> | |||
<rollingStyle value="Composite" /> | |||
<!--写到一个文件--> | |||
<staticLogFileName value="false" /> | |||
<!--单个文件大小。单位:KB|MB|GB--> | |||
<maximumFileSize value="200MB" /> | |||
<!--最多保留的文件数,设为"-1"则不限--> | |||
<maxSizeRollBackups value="-1" /> | |||
<!--日志格式--> | |||
<layout type="log4net.Layout.PatternLayout"> | |||
<conversionPattern value="%message" /> | |||
</layout> | |||
<filter type="log4net.Filter.LevelRangeFilter"> | |||
<param name="LevelMin" value="INFO" /> | |||
<param name="LevelMax" value="INFO" /> | |||
</filter> | |||
</appender> | |||
<!-- 调试 Debug.log--> | |||
<appender name="DebugLog" type="log4net.Appender.RollingFileAppender"> | |||
<!--目录路径,可以是相对路径或绝对路径--> | |||
<param name="File" value="C:\Learun_log" /> | |||
<!--文件名,按日期生成文件夹--> | |||
<param name="DatePattern" value="/yyyy-MM-dd/"Debug.log"" /> | |||
<!--追加到文件--> | |||
<appendToFile value="true" /> | |||
<!--创建日志文件的方式,可选值:Date[日期],文件大小[Size],混合[Composite]--> | |||
<rollingStyle value="Composite" /> | |||
<!--写到一个文件--> | |||
<staticLogFileName value="false" /> | |||
<!--单个文件大小。单位:KB|MB|GB--> | |||
<maximumFileSize value="200MB" /> | |||
<!--最多保留的文件数,设为"-1"则不限--> | |||
<maxSizeRollBackups value="-1" /> | |||
<!--日志格式--> | |||
<layout type="log4net.Layout.PatternLayout"> | |||
<conversionPattern value="%message" /> | |||
</layout> | |||
<filter type="log4net.Filter.LevelRangeFilter"> | |||
<param name="LevelMin" value="DEBUG" /> | |||
<param name="LevelMax" value="DEBUG" /> | |||
</filter> | |||
</appender> | |||
</log4net> | |||
<startup> | |||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> | |||
</startup> | |||
<runtime> | |||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | |||
<dependentAssembly> | |||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> | |||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" /> | |||
</dependentAssembly> | |||
<dependentAssembly> | |||
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /> | |||
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" /> | |||
</dependentAssembly> | |||
</assemblyBinding> | |||
</runtime> | |||
</configuration> |
@@ -0,0 +1,120 @@ | |||
using Microsoft.AspNet.SignalR; | |||
using Microsoft.AspNet.SignalR.Hubs; | |||
using System; | |||
using System.Threading.Tasks; | |||
namespace Quanjiang.DigitalSchool.IMServerService | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创建人:陈彬彬 | |||
/// 日 期:2017.04.01 | |||
/// 描 述:即使通信服务(可供客户端调用的方法开头用小写) | |||
/// </summary> | |||
[HubName("ChatsHub")] | |||
public class Chats : Hub | |||
{ | |||
#region 重载Hub方法 | |||
/// <summary> | |||
/// 建立连接 | |||
/// </summary> | |||
/// <returns></returns> | |||
public override Task OnConnected() | |||
{ | |||
AddOnline(); | |||
return base.OnConnected(); | |||
} | |||
/// <summary> | |||
/// 断开连接 | |||
/// </summary> | |||
/// <param name="stopCalled">是否是客户端主动断开:true是,false超时断开</param> | |||
/// <returns></returns> | |||
public override Task OnDisconnected(bool stopCalled) | |||
{ | |||
RemoveOnline(); | |||
return base.OnDisconnected(stopCalled); | |||
} | |||
/// <summary> | |||
/// 重新建立连接 | |||
/// </summary> | |||
/// <returns></returns> | |||
public override Task OnReconnected() | |||
{ | |||
AddOnline(); | |||
return base.OnReconnected(); | |||
} | |||
#endregion | |||
#region 客户端操作 | |||
/// <summary> | |||
/// 添加在线用户 | |||
/// </summary> | |||
public void AddOnline() | |||
{ | |||
string clientId = Context.ConnectionId; | |||
string userId = GetUserId(); | |||
Groups.Add(clientId, userId); | |||
} | |||
/// <summary> | |||
/// 移除在线用户 | |||
/// </summary> | |||
public void RemoveOnline() | |||
{ | |||
string clientId = Context.ConnectionId; | |||
string userId = GetUserId(); | |||
Groups.Remove(clientId, userId); | |||
} | |||
/// <summary> | |||
/// 发送消息 | |||
/// </summary> | |||
/// <param name="toUserId">对方UserId</param> | |||
/// <param name="msg">消息</param> | |||
/// <param name="isSystem">是否系统消息0不是1是</param> | |||
public void SendMsg(string toUserId, string msg, int isSystem) | |||
{ | |||
string userId = GetUserId(); | |||
Clients.Group(toUserId).RevMsg(userId, msg, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), isSystem); | |||
} | |||
/// <summary> | |||
/// 发送消息 | |||
/// </summary> | |||
/// <param name="myUserId">我的UserId</param> | |||
/// <param name="toUserId">对方UserId</param> | |||
/// <param name="msg">消息</param> | |||
/// <param name="isSystem">是否系统消息0不是1是</param> | |||
public void SendMsg2(string myUserId, string toUserId, string msg, int isSystem) | |||
{ | |||
Clients.Group(toUserId).RevMsg(myUserId, msg, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), isSystem); | |||
} | |||
#endregion | |||
#region 推送消息 | |||
public void PushMessage(string msg) | |||
{ | |||
Clients.All.broadcastMessage(msg); | |||
} | |||
#endregion | |||
#region 一般公用方法 | |||
/// <summary> | |||
/// 获取登录用户Id | |||
/// </summary> | |||
/// <returns></returns> | |||
private string GetUserId() | |||
{ | |||
string userId = ""; | |||
if (Context.QueryString["userId"] != null) | |||
{ | |||
userId = Context.QueryString["userId"]; | |||
} | |||
return userId; | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,25 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.ServiceProcess; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace Quanjiang.DigitalSchool.IMServerService | |||
{ | |||
static class Program | |||
{ | |||
/// <summary> | |||
/// 应用程序的主入口点。 | |||
/// </summary> | |||
static void Main() | |||
{ | |||
ServiceBase[] ServicesToRun; | |||
ServicesToRun = new ServiceBase[] | |||
{ | |||
new QuanjiangDigitalSchollIMService() | |||
}; | |||
ServiceBase.Run(ServicesToRun); | |||
} | |||
} | |||
} |
@@ -0,0 +1,60 @@ | |||
namespace Quanjiang.DigitalSchool.IMServerService | |||
{ | |||
partial class ProjectInstaller | |||
{ | |||
/// <summary> | |||
/// 必需的设计器变量。 | |||
/// </summary> | |||
private System.ComponentModel.IContainer components = null; | |||
/// <summary> | |||
/// 清理所有正在使用的资源。 | |||
/// </summary> | |||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> | |||
protected override void Dispose(bool disposing) | |||
{ | |||
if (disposing && (components != null)) | |||
{ | |||
components.Dispose(); | |||
} | |||
base.Dispose(disposing); | |||
} | |||
#region 组件设计器生成的代码 | |||
/// <summary> | |||
/// 设计器支持所需的方法 - 不要修改 | |||
/// 使用代码编辑器修改此方法的内容。 | |||
/// </summary> | |||
private void InitializeComponent() | |||
{ | |||
this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller(); | |||
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller(); | |||
// | |||
// serviceProcessInstaller1 | |||
// | |||
this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem; | |||
this.serviceProcessInstaller1.Password = null; | |||
this.serviceProcessInstaller1.Username = null; | |||
// | |||
// serviceInstaller1 | |||
// | |||
this.serviceInstaller1.Description = "数字化智慧校园IM服务"; | |||
this.serviceInstaller1.DisplayName = "QuanjiangDigitalSchollIMService"; | |||
this.serviceInstaller1.ServiceName = "QuanjiangDigitalSchollIMService"; | |||
this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic; | |||
// | |||
// ProjectInstaller | |||
// | |||
this.Installers.AddRange(new System.Configuration.Install.Installer[] { | |||
this.serviceProcessInstaller1, | |||
this.serviceInstaller1}); | |||
} | |||
#endregion | |||
private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1; | |||
private System.ServiceProcess.ServiceInstaller serviceInstaller1; | |||
} | |||
} |
@@ -0,0 +1,19 @@ | |||
using System; | |||
using System.Collections; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Configuration.Install; | |||
using System.Linq; | |||
using System.Threading.Tasks; | |||
namespace Quanjiang.DigitalSchool.IMServerService | |||
{ | |||
[RunInstaller(true)] | |||
public partial class ProjectInstaller : System.Configuration.Install.Installer | |||
{ | |||
public ProjectInstaller() | |||
{ | |||
InitializeComponent(); | |||
} | |||
} | |||
} |
@@ -0,0 +1,129 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<root> | |||
<!-- | |||
Microsoft ResX Schema | |||
Version 2.0 | |||
The primary goals of this format is to allow a simple XML format | |||
that is mostly human readable. The generation and parsing of the | |||
various data types are done through the TypeConverter classes | |||
associated with the data types. | |||
Example: | |||
... ado.net/XML headers & schema ... | |||
<resheader name="resmimetype">text/microsoft-resx</resheader> | |||
<resheader name="version">2.0</resheader> | |||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||
<value>[base64 mime encoded serialized .NET Framework object]</value> | |||
</data> | |||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||
<comment>This is a comment</comment> | |||
</data> | |||
There are any number of "resheader" rows that contain simple | |||
name/value pairs. | |||
Each data row contains a name, and value. The row also contains a | |||
type or mimetype. Type corresponds to a .NET class that support | |||
text/value conversion through the TypeConverter architecture. | |||
Classes that don't support this are serialized and stored with the | |||
mimetype set. | |||
The mimetype is used for serialized objects, and tells the | |||
ResXResourceReader how to depersist the object. This is currently not | |||
extensible. For a given mimetype the value must be set accordingly: | |||
Note - application/x-microsoft.net.object.binary.base64 is the format | |||
that the ResXResourceWriter will generate, however the reader can | |||
read any of the formats listed below. | |||
mimetype: application/x-microsoft.net.object.binary.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.soap.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.bytearray.base64 | |||
value : The object must be serialized into a byte array | |||
: using a System.ComponentModel.TypeConverter | |||
: and then encoded with base64 encoding. | |||
--> | |||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||
<xsd:element name="root" msdata:IsDataSet="true"> | |||
<xsd:complexType> | |||
<xsd:choice maxOccurs="unbounded"> | |||
<xsd:element name="metadata"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||
<xsd:attribute name="type" type="xsd:string" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="assembly"> | |||
<xsd:complexType> | |||
<xsd:attribute name="alias" type="xsd:string" /> | |||
<xsd:attribute name="name" type="xsd:string" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="data"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="resheader"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:choice> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:schema> | |||
<resheader name="resmimetype"> | |||
<value>text/microsoft-resx</value> | |||
</resheader> | |||
<resheader name="version"> | |||
<value>2.0</value> | |||
</resheader> | |||
<resheader name="reader"> | |||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<resheader name="writer"> | |||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<metadata name="serviceProcessInstaller1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||
<value>17, 17</value> | |||
</metadata> | |||
<metadata name="serviceInstaller1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||
<value>208, 17</value> | |||
</metadata> | |||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>False</value> | |||
</metadata> | |||
</root> |
@@ -0,0 +1,36 @@ | |||
using System.Reflection; | |||
using System.Runtime.CompilerServices; | |||
using System.Runtime.InteropServices; | |||
// 有关程序集的一般信息由以下 | |||
// 控制。更改这些特性值可修改 | |||
// 与程序集关联的信息。 | |||
[assembly: AssemblyTitle("IMServerService")] | |||
[assembly: AssemblyDescription("")] | |||
[assembly: AssemblyConfiguration("")] | |||
[assembly: AssemblyCompany("")] | |||
[assembly: AssemblyProduct("IMServerService")] | |||
[assembly: AssemblyCopyright("Copyright © 2020")] | |||
[assembly: AssemblyTrademark("")] | |||
[assembly: AssemblyCulture("")] | |||
// 将 ComVisible 设置为 false 会使此程序集中的类型 | |||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 | |||
//请将此类型的 ComVisible 特性设置为 true。 | |||
[assembly: ComVisible(false)] | |||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID | |||
[assembly: Guid("e05a2b9a-a939-450f-9a44-a8b3201d055a")] | |||
// 程序集的版本信息由下列四个值组成: | |||
// | |||
// 主版本 | |||
// 次版本 | |||
// 生成号 | |||
// 修订号 | |||
// | |||
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 | |||
// 方法是按如下所示使用“*”: : | |||
// [assembly: AssemblyVersion("1.0.*")] | |||
[assembly: AssemblyVersion("1.0.0.0")] | |||
[assembly: AssemblyFileVersion("1.0.0.0")] |
@@ -0,0 +1,118 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | |||
<PropertyGroup> | |||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | |||
<ProjectGuid>{E05A2B9A-A939-450F-9A44-A8B3201D055A}</ProjectGuid> | |||
<OutputType>WinExe</OutputType> | |||
<RootNamespace>Quanjiang.DigitalSchool.IMServerService</RootNamespace> | |||
<AssemblyName>Quanjiang.DigitalSchool.IMServerService</AssemblyName> | |||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> | |||
<FileAlignment>512</FileAlignment> | |||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | |||
<Deterministic>true</Deterministic> | |||
</PropertyGroup> | |||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |||
<PlatformTarget>AnyCPU</PlatformTarget> | |||
<DebugSymbols>true</DebugSymbols> | |||
<DebugType>full</DebugType> | |||
<Optimize>false</Optimize> | |||
<OutputPath>bin\Debug\</OutputPath> | |||
<DefineConstants>DEBUG;TRACE</DefineConstants> | |||
<ErrorReport>prompt</ErrorReport> | |||
<WarningLevel>4</WarningLevel> | |||
</PropertyGroup> | |||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |||
<PlatformTarget>AnyCPU</PlatformTarget> | |||
<DebugType>pdbonly</DebugType> | |||
<Optimize>true</Optimize> | |||
<OutputPath>bin\Release\</OutputPath> | |||
<DefineConstants>TRACE</DefineConstants> | |||
<ErrorReport>prompt</ErrorReport> | |||
<WarningLevel>4</WarningLevel> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<Reference Include="Microsoft.AspNet.SignalR.Core"> | |||
<HintPath>..\packages\Microsoft.AspNet.SignalR.Core.2.2.2\lib\net45\Microsoft.AspNet.SignalR.Core.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Microsoft.Owin, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Microsoft.Owin.Cors, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Microsoft.Owin.Cors.3.1.0\lib\net45\Microsoft.Owin.Cors.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Microsoft.Owin.Diagnostics"> | |||
<HintPath>..\packages\Microsoft.Owin.Diagnostics.2.1.0\lib\net40\Microsoft.Owin.Diagnostics.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Microsoft.Owin.Host.HttpListener"> | |||
<HintPath>..\packages\Microsoft.Owin.Host.HttpListener.2.1.0\lib\net45\Microsoft.Owin.Host.HttpListener.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Microsoft.Owin.Hosting, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Microsoft.Owin.Hosting.2.1.0\lib\net45\Microsoft.Owin.Hosting.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Microsoft.Owin.Security"> | |||
<HintPath>..\packages\Microsoft.Owin.Security.2.1.0\lib\net45\Microsoft.Owin.Security.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath> | |||
</Reference> | |||
<Reference Include="System" /> | |||
<Reference Include="System.Configuration.Install" /> | |||
<Reference Include="System.Core" /> | |||
<Reference Include="System.Management" /> | |||
<Reference Include="System.Web.Cors, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Microsoft.AspNet.Cors.5.0.0\lib\net45\System.Web.Cors.dll</HintPath> | |||
</Reference> | |||
<Reference Include="System.Xml.Linq" /> | |||
<Reference Include="System.Data.DataSetExtensions" /> | |||
<Reference Include="Microsoft.CSharp" /> | |||
<Reference Include="System.Data" /> | |||
<Reference Include="System.Net.Http" /> | |||
<Reference Include="System.ServiceProcess" /> | |||
<Reference Include="System.Xml" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Compile Include="Hubs\Chats.cs" /> | |||
<Compile Include="ProjectInstaller.cs"> | |||
<SubType>Component</SubType> | |||
</Compile> | |||
<Compile Include="ProjectInstaller.Designer.cs"> | |||
<DependentUpon>ProjectInstaller.cs</DependentUpon> | |||
</Compile> | |||
<Compile Include="Service1.cs"> | |||
<SubType>Component</SubType> | |||
</Compile> | |||
<Compile Include="Service1.Designer.cs"> | |||
<DependentUpon>Service1.cs</DependentUpon> | |||
</Compile> | |||
<Compile Include="Program.cs" /> | |||
<Compile Include="Properties\AssemblyInfo.cs" /> | |||
<Compile Include="Startup1.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<None Include="App.config"> | |||
<SubType>Designer</SubType> | |||
</None> | |||
<None Include="packages.config" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<EmbeddedResource Include="ProjectInstaller.resx"> | |||
<DependentUpon>ProjectInstaller.cs</DependentUpon> | |||
</EmbeddedResource> | |||
<EmbeddedResource Include="Service1.resx"> | |||
<DependentUpon>Service1.cs</DependentUpon> | |||
</EmbeddedResource> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\Learun.Framework.Module\Learun.Log\Learun.Loger.csproj"> | |||
<Project>{d27e14dc-b68c-408d-a2e3-fdb38665ecbb}</Project> | |||
<Name>Learun.Loger</Name> | |||
</ProjectReference> | |||
<ProjectReference Include="..\Learun.Framework.Module\Learun.Util\Learun.Util\Learun.Util.csproj"> | |||
<Project>{CF8AE293-88AB-436C-9720-A8386BA5D7B7}</Project> | |||
<Name>Learun.Util</Name> | |||
</ProjectReference> | |||
</ItemGroup> | |||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | |||
</Project> |
@@ -0,0 +1,40 @@ | |||
namespace Quanjiang.DigitalSchool.IMServerService | |||
{ | |||
partial class QuanjiangDigitalSchollIMService | |||
{ | |||
/// <summary> | |||
/// 必需的设计器变量。 | |||
/// </summary> | |||
private System.ComponentModel.IContainer components = null; | |||
/// <summary> | |||
/// 清理所有正在使用的资源。 | |||
/// </summary> | |||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> | |||
protected override void Dispose(bool disposing) | |||
{ | |||
if (disposing && (components != null)) | |||
{ | |||
components.Dispose(); | |||
} | |||
base.Dispose(disposing); | |||
} | |||
#region 组件设计器生成的代码 | |||
/// <summary> | |||
/// 设计器支持所需的方法 - 不要修改 | |||
/// 使用代码编辑器修改此方法的内容。 | |||
/// </summary> | |||
private void InitializeComponent() | |||
{ | |||
// | |||
// QuanjiangDigitalSchollIMService | |||
// | |||
this.ServiceName = "QuanjiangDigitalSchollIMService"; | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,48 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Data; | |||
using System.Diagnostics; | |||
using System.Linq; | |||
using System.Reflection; | |||
using System.ServiceProcess; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Learun.Loger; | |||
using Learun.Util; | |||
using Microsoft.AspNet.SignalR; | |||
using Microsoft.Owin; | |||
using Microsoft.Owin.Cors; | |||
using Microsoft.Owin.Hosting; | |||
using Owin; | |||
[assembly: OwinStartup(typeof(Quanjiang.DigitalSchool.IMServerService.Startup1))] | |||
namespace Quanjiang.DigitalSchool.IMServerService | |||
{ | |||
public partial class QuanjiangDigitalSchollIMService : ServiceBase | |||
{ | |||
private Log log = LogFactory.GetLogger("QuanjiangDigitalSchollIMService"); | |||
public QuanjiangDigitalSchollIMService() | |||
{ | |||
InitializeComponent(); | |||
} | |||
protected override void OnStart(string[] args) | |||
{ | |||
string SignalRURI = Config.GetValue("IMUrl"); | |||
try | |||
{ | |||
WebApp.Start(SignalRURI); | |||
log.Info(new { Browser = "QuanjiangDigitalSchollIMService", Content = "服务已启动" }); | |||
} | |||
catch (Exception e) | |||
{ | |||
log.Error(new { Browser = "QuanjiangDigitalSchollIMService", Content = "服务启动异常" + e.Message+e.StackTrace }); | |||
} | |||
} | |||
protected override void OnStop() | |||
{ | |||
} | |||
} | |||
} |
@@ -0,0 +1,123 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<root> | |||
<!-- | |||
Microsoft ResX Schema | |||
Version 2.0 | |||
The primary goals of this format is to allow a simple XML format | |||
that is mostly human readable. The generation and parsing of the | |||
various data types are done through the TypeConverter classes | |||
associated with the data types. | |||
Example: | |||
... ado.net/XML headers & schema ... | |||
<resheader name="resmimetype">text/microsoft-resx</resheader> | |||
<resheader name="version">2.0</resheader> | |||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||
<value>[base64 mime encoded serialized .NET Framework object]</value> | |||
</data> | |||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||
<comment>This is a comment</comment> | |||
</data> | |||
There are any number of "resheader" rows that contain simple | |||
name/value pairs. | |||
Each data row contains a name, and value. The row also contains a | |||
type or mimetype. Type corresponds to a .NET class that support | |||
text/value conversion through the TypeConverter architecture. | |||
Classes that don't support this are serialized and stored with the | |||
mimetype set. | |||
The mimetype is used for serialized objects, and tells the | |||
ResXResourceReader how to depersist the object. This is currently not | |||
extensible. For a given mimetype the value must be set accordingly: | |||
Note - application/x-microsoft.net.object.binary.base64 is the format | |||
that the ResXResourceWriter will generate, however the reader can | |||
read any of the formats listed below. | |||
mimetype: application/x-microsoft.net.object.binary.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.soap.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.bytearray.base64 | |||
value : The object must be serialized into a byte array | |||
: using a System.ComponentModel.TypeConverter | |||
: and then encoded with base64 encoding. | |||
--> | |||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||
<xsd:element name="root" msdata:IsDataSet="true"> | |||
<xsd:complexType> | |||
<xsd:choice maxOccurs="unbounded"> | |||
<xsd:element name="metadata"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||
<xsd:attribute name="type" type="xsd:string" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="assembly"> | |||
<xsd:complexType> | |||
<xsd:attribute name="alias" type="xsd:string" /> | |||
<xsd:attribute name="name" type="xsd:string" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="data"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="resheader"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:choice> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:schema> | |||
<resheader name="resmimetype"> | |||
<value>text/microsoft-resx</value> | |||
</resheader> | |||
<resheader name="version"> | |||
<value>2.0</value> | |||
</resheader> | |||
<resheader name="reader"> | |||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<resheader name="writer"> | |||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>False</value> | |||
</metadata> | |||
</root> |
@@ -0,0 +1,35 @@ | |||
using System; | |||
using System.Threading.Tasks; | |||
using Microsoft.AspNet.SignalR; | |||
using Microsoft.Owin; | |||
using Microsoft.Owin.Cors; | |||
using Owin; | |||
[assembly: OwinStartup(typeof(Quanjiang.DigitalSchool.IMServerService.Startup1))] | |||
namespace Quanjiang.DigitalSchool.IMServerService | |||
{ | |||
public class Startup1 | |||
{ | |||
public void Configuration(IAppBuilder app) | |||
{ | |||
app.Map("/signalr", map => | |||
{ | |||
map.UseCors(CorsOptions.AllowAll); | |||
var hubConfiguration = new HubConfiguration | |||
{ | |||
// You can enable JSONP by uncommenting line below. | |||
// JSONP requests are insecure but some older browsers (and some | |||
// versions of IE) require JSONP to work cross domain | |||
EnableJSONP = true | |||
}; | |||
// Run the SignalR pipeline. We're not using MapSignalR | |||
// since this branch is already runs under the "/signalr" | |||
// path. | |||
map.RunSignalR(hubConfiguration); | |||
}); | |||
app.MapSignalR(); | |||
// 有关如何配置应用程序的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkID=316888 | |||
} | |||
} | |||
} |
@@ -0,0 +1,9 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<packages> | |||
<package id="Common.Logging" version="2.1.2" targetFramework="net461" /> | |||
<package id="Microsoft.AspNet.Cors" version="5.0.0" targetFramework="net461" /> | |||
<package id="Microsoft.Owin" version="3.1.0" targetFramework="net461" /> | |||
<package id="Microsoft.Owin.Cors" version="3.1.0" targetFramework="net461" /> | |||
<package id="Microsoft.Owin.Hosting" version="2.1.0" targetFramework="net461" /> | |||
<package id="Owin" version="1.0" targetFramework="net461" /> | |||
</packages> |
@@ -70,7 +70,7 @@ | |||
<!-- 发出邮箱设置邮箱主机 --> | |||
<add key="MailHost" value="smtp.ym.163.com" /> | |||
<!-- ================== 6:即时通信参数 ================== --> | |||
<add key="IMUrl" value="http://*:8012" /> | |||
<add key="IMUrl" value="http://localhost:8012" /> | |||
</appSettings> | |||
<!--日志--> | |||
<log4net> | |||
@@ -91,6 +91,16 @@ namespace Learun.Application.IMServer | |||
#endregion | |||
#region 推送消息 | |||
public void PushMessage(string msg) | |||
{ | |||
Clients.All.broadcastMessage(msg); | |||
} | |||
#endregion | |||
#region 一般公用方法 | |||
/// <summary> | |||
/// 获取登录用户Id | |||
@@ -0,0 +1 @@ | |||
|
@@ -0,0 +1,22 @@ | |||
<div class="lr-page lr-EducationalAdministrationLoginUserBind-page"> | |||
<div class="lr-page-tool"> | |||
<div class="lr-tool-left"> | |||
总共<span class="lr-badge lr-badge-primary">0</span>条 | |||
</div> | |||
<div class="lr-tool-right"> | |||
<div class="lr-tool-right-btn lr_multiple_search"> | |||
<i class="iconfont icon-searchlist"></i> | |||
<div class="lr-tool-right-btn-content lr-form-container"> | |||
<div class="lr-form-row"> | |||
<label>绑定账号</label> | |||
<input id="BindUserAccount" type="text"> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-page-content" id="lr_EducationalAdministrationLoginUserBind_list"></div> | |||
<div class="lr-list-addbtn" id="lr_EducationalAdministrationLoginUserBind_btn"> | |||
<i class="iconfont icon-add1"></i> | |||
</div> | |||
</div> |
@@ -0,0 +1,108 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-11-19 14:50 | |||
* 描 述:多账号绑定 | |||
*/ | |||
(function () { | |||
var begin = ''; | |||
var end = ''; | |||
var multipleData = null; | |||
var page = { | |||
grid: null, | |||
init: function ($page) { | |||
begin = ''; | |||
end = ''; | |||
multipleData = null; | |||
page.grid = $page.find('#lr_EducationalAdministrationLoginUserBind_list').lrpagination({ | |||
lclass: page.lclass, | |||
rows: 10, // 每页行数 | |||
getData: function (param, callback) {// 获取数据 param 分页参数,callback 异步回调 | |||
param.multipleData = multipleData; | |||
page.loadData(param, callback, $page); | |||
}, | |||
renderData: function (_index, _item, _$item) {// 渲染数据模板 | |||
return page.rowRender(_index, _item, _$item, $page); | |||
}, | |||
click: function (item, $item, $et) {// 列表行点击事件 | |||
if ($et.hasClass('lr-btn-danger')) { | |||
page.btnClick(item, $item, $page); | |||
} | |||
else { | |||
page.rowClick(item, $item, $page); | |||
} | |||
}, | |||
btns: page.rowBtns | |||
}); | |||
// 多条件查询 | |||
var $multiple = $page.find('.lr_multiple_search').multiplequery({ | |||
callback: function (data) { | |||
begin = ''; | |||
end = ''; | |||
multipleData = data || {}; | |||
page.grid.reload(); | |||
} | |||
}); | |||
$page.find('#lr_EducationalAdministrationLoginUserBind_btn').on('tap', function () { | |||
learun.nav.go({ path: 'EducationalAdministration/LoginUserBind/form', title: '新增', type: 'right' }); | |||
}); | |||
}, | |||
lclass: 'lr-list', | |||
loadData: function (param, callback, $page) {// 列表加载后台数据 | |||
var _postParam = { | |||
pagination: { | |||
rows: param.rows, | |||
page: param.page, | |||
sidx: 'CreateTime desc', | |||
sord: 'DESC' | |||
}, | |||
queryJson: JSON.stringify({ CreateUserId: learun.storage.get('userinfo').baseinfo.userId }) | |||
}; | |||
if (param.multipleData) { | |||
multipleData.CreateUserId = learun.storage.get('userinfo').baseinfo.userId; | |||
_postParam.queryJson = JSON.stringify(multipleData); | |||
} | |||
if (param.begin && param.end) { | |||
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end, CreateUserId: learun.storage.get('userinfo').baseinfo.userId }); | |||
} | |||
learun.httpget(config.webapi + 'learun/EducationalAdministration/LoginUserBind/pagelist', _postParam, (data) => { | |||
$page.find('.lr-badge').text('0'); | |||
if (data) { | |||
$page.find('.lr-badge').text(data.records); | |||
callback(data.rows, parseInt(data.records)); | |||
} | |||
else { | |||
callback([], 0); | |||
} | |||
}); | |||
}, | |||
rowRender: function (_index, _item, _$item, $page) {// 渲染列表行数据 | |||
_$item.addClass('lr-list-item lr-list-item-multi'); | |||
_$item.append($('<p class="lr-ellipsis"><span>绑定账号:</span></p>').dataFormatter({ value: _item.BindUserAccount })); | |||
_$item.append($('<p class="lr-ellipsis"><span>绑定时间:</span></p>').dataFormatter({ | |||
value: _item.CreateTime, | |||
type: 'datetime', | |||
dateformat: 'yyyy-MM-dd hh:mm:ss' | |||
})); | |||
return ''; | |||
}, | |||
rowClick: function (item, $item, $page) {// 列表行点击触发方法 | |||
learun.nav.go({ path: 'EducationalAdministration/LoginUserBind/form', title: '详情', type: 'right', param: { keyValue: item.Id } }); | |||
}, | |||
btnClick: function (item, $item, $page) {// 左滑按钮点击事件 | |||
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
if (_index === '1') { | |||
learun.layer.loading(true, '正在删除该笔数据'); | |||
learun.httppost(config.webapi + 'learun/EducationalAdministration/LoginUserBind/delete', item.Id, (data) => { | |||
if (data) {// 删除数据成功 | |||
page.grid.reload(); | |||
} | |||
learun.layer.loading(false); | |||
}); | |||
} | |||
}, '智慧校园提示', ['取消', '确定']); | |||
}, | |||
rowBtns: ['<a class="lr-btn-danger">删除</a>'] // 列表行左滑按钮 | |||
}; | |||
return page; | |||
})(); |
@@ -0,0 +1 @@ | |||
|
@@ -0,0 +1,12 @@ | |||
<div class="lr-form-container"> | |||
<div class="lr-form-row " data-table="LoginUserBind"> | |||
<font face="宋体">*</font> | |||
<label>绑定账号</label> | |||
<input id="BindUserAccount" type="text" isvalid="yes" checkexpession="NotNull" errormsg="绑定账号" /> | |||
</div> | |||
<div class="lr-form-row " data-table="LoginUserBind"> | |||
<font face="宋体">*</font> | |||
<label>绑定密码</label> | |||
<input id="BindUserPassword" type="text" isvalid="yes" checkexpession="NotNull" errormsg="绑定密码" /> | |||
</div> | |||
</div> |
@@ -0,0 +1,148 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-11-19 14:50 | |||
* 描 述:多账号绑定 | |||
*/ | |||
(function () { | |||
var keyValue = ''; | |||
var $header = null; | |||
var titleText = ''; | |||
var page = { | |||
isScroll: true, | |||
init: function ($page, param) { | |||
keyValue = param.keyValue; | |||
// 添加头部按钮列表 | |||
var _html = '\ | |||
<div class="lr-form-header-cancel" >取消</div>\ | |||
<div class="lr-form-header-btnlist" >\ | |||
<div class="lr-form-header-more" ><i class="iconfont icon-more" ></i></div>\ | |||
<div class="lr-form-header-edit" ><i class="iconfont icon-edit" ></i></div>\ | |||
</div>\ | |||
<div class="lr-form-header-submit" >提交</div>'; | |||
$header = $page.parents('.f-page').find('.f-page-header'); | |||
$header.append(_html); | |||
// 取消 | |||
$header.find('.lr-form-header-cancel').on('tap', function () { | |||
learun.layer.confirm('确定要退出当前编辑?', function (_index) { | |||
if (_index === '1') { | |||
if (keyValue) {// 如果是编辑状态 | |||
learun.formblur(); | |||
$header.find('.lr-form-header-cancel').hide(); | |||
$header.find('.lr-form-header-submit').hide(); | |||
$header.find('.lr-form-header-btnlist').show(); | |||
$header.find('.f-page-title').text(titleText); | |||
$page.find('.lr-form-container').setFormRead(); | |||
} | |||
else {// 如果是新增状态 关闭当前页面 | |||
learun.nav.closeCurrent(); | |||
} | |||
} | |||
}, 'learun智慧校园提示', ['取消', '确定']); | |||
}); | |||
// 编辑 | |||
$header.find('.lr-form-header-edit').on('tap', function () { | |||
$header.find('.lr-form-header-btnlist').hide(); | |||
$header.find('.lr-form-header-cancel').show(); | |||
$header.find('.lr-form-header-submit').show(); | |||
titleText = $header.find('.f-page-title').text(); | |||
$header.find('.f-page-title').text('编辑'); | |||
$page.find('.lr-form-container').setFormWrite(); | |||
}); | |||
// 更多 | |||
$header.find('.lr-form-header-more').on('tap', function () { | |||
learun.actionsheet({ | |||
id: 'more', | |||
data: [ | |||
{ | |||
text: '删除', | |||
mark: true, | |||
event: function () {// 删除当前条信息 | |||
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
if (_index === '1') { | |||
learun.layer.loading(true, '正在删除该笔数据'); | |||
learun.httppost(config.webapi + 'learun/EducationalAdministration/LoginUserBind/delete', keyValue, (data) => { | |||
learun.layer.loading(false); | |||
if (data) {// 删除数据成功 | |||
learun.nav.closeCurrent(); | |||
var prepage = learun.nav.getpage('EducationalAdministration/LoginUserBind'); | |||
prepage.grid.reload(); | |||
} | |||
}); | |||
} | |||
}, '智慧校园提示', ['取消', '确定']); | |||
} | |||
} | |||
], | |||
cancel: function () { | |||
} | |||
}); | |||
}); | |||
// 提交 | |||
$header.find('.lr-form-header-submit').on('tap', function () { | |||
// 获取表单数据 | |||
if (!$page.find('.lr-form-container').lrformValid()) { | |||
return false; | |||
} | |||
var data = $page.find('.lr-form-container').lrformGet(); | |||
data.BindUserAccount = $page.find('#BindUserAccount').val().trim(); | |||
data.BindUserPassword = $page.find('#BindUserPassword').val().trim(); | |||
data.BindUserPasswordTemp = $.md5(data.BindUserPassword); | |||
var _postData = {} | |||
_postData.keyValue = keyValue; | |||
_postData.strEntity = JSON.stringify(data); | |||
learun.layer.loading(true, '正在提交数据'); | |||
learun.httppost(config.webapi + 'learun/EducationalAdministration/LoginUserBind/save', _postData, (data) => { | |||
learun.layer.loading(false); | |||
if (data) {// 表单数据保存成功 | |||
if (keyValue) { | |||
learun.layer.toast('保存数据成功!'); | |||
learun.formblur(); | |||
$header.find('.lr-form-header-cancel').hide(); | |||
$header.find('.lr-form-header-submit').hide(); | |||
$header.find('.lr-form-header-btnlist').show(); | |||
$header.find('.f-page-title').text(titleText); | |||
$page.find('.lr-form-container').setFormRead(); | |||
} | |||
else {// 如果是 | |||
learun.nav.closeCurrent(); | |||
} | |||
var prepage = learun.nav.getpage('EducationalAdministration/LoginUserBind'); | |||
prepage.grid.reload(); | |||
} | |||
}); | |||
}); | |||
page.bind($page, param); | |||
if (keyValue) { | |||
// 添加编辑按钮 | |||
$page.find('.lr-form-container').setFormRead(); | |||
$header.find('.lr-form-header-btnlist').show(); | |||
// 获取表单数据 | |||
learun.layer.loading(true, '获取表单数据'); | |||
learun.httpget(config.webapi + 'learun/EducationalAdministration/LoginUserBind/form', keyValue, (data) => { | |||
if (data) { | |||
for (var id in data) { | |||
if (data[id].length) { | |||
$page.find('#' + id).lrgridSet(data[id]); | |||
} | |||
else { | |||
$page.find('[data-table="' + id + '"]').lrformSet(data[id]); | |||
} | |||
} | |||
} | |||
learun.layer.loading(false); | |||
}); | |||
} | |||
else { | |||
$header.find('.lr-form-header-cancel').show(); | |||
$header.find('.lr-form-header-submit').show(); | |||
} | |||
}, | |||
bind: function ($page, param) { | |||
}, destroy: function (pageinfo) { | |||
$header = null; | |||
keyValue = ''; | |||
} | |||
}; | |||
return page; | |||
})(); |
@@ -112,7 +112,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
public ActionResult AssStatusData() | |||
{ | |||
List<Ass_AssetsInfoItemEntity> data = assAssetsInfoItemIbll.GetLists("{\"a\":\"false\"}").ToList(); | |||
var list = data.GroupBy(a => a.AIIsScrap).Select(a => new { a.Key, price = a.Sum(b => b.AIAssValue), num = a.Count() }).ToList(); | |||
var list = data.GroupBy(a => a.AIASSState==2).Select(a => new { a.Key, price = a.Sum(b => b.AIAssValue), num = a.Count() }).ToList(); | |||
List<object> list2 = new List<object>(); | |||
List<String> list1 = new List<String>(); | |||
foreach (var item in list) | |||
@@ -130,7 +130,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
public ActionResult AssStatusList() | |||
{ | |||
List<Ass_AssetsInfoItemEntity> data = assAssetsInfoItemIbll.GetLists("{\"a\":\"false\"}").ToList(); | |||
var list =data.GroupBy(a => a.AIIsScrap).Select(a => new { a.Key, price = a.Sum(b => b.AIAssValue), num = a.Count() }).ToList(); | |||
var list =data.GroupBy(a => a.AIASSState == 2).Select(a => new { a.Key, price = a.Sum(b => b.AIAssValue), num = a.Count() }).ToList(); | |||
List<object> list2 = new List<object>(); | |||
foreach (var item in list) | |||
{ | |||
@@ -44,7 +44,7 @@ | |||
<input id="APrice" type="text" class="form-control" isvalid="yes" checkexpession="PositiveFloatintZero" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfo"> | |||
<div class="lr-form-item-title">库存<font face="宋体">*</font></div> | |||
<div class="lr-form-item-title">数量<font face="宋体">*</font></div> | |||
<input id="AStock" type="text" class="form-control" isvalid="yes" checkexpession="PositiveFloatint" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfo"> | |||
@@ -52,15 +52,32 @@ var bootstrap = function ($, learun) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var formInfo = $('body').lrGetFormData(); | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
strEntity: JSON.stringify(formInfo) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
if (formInfo.HasDetail == "true") { | |||
learun.layerConfirm('此操作会重新生成明细,请确认!!', | |||
function (res) { | |||
if (res) { | |||
$.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
} | |||
}) | |||
} else { | |||
$.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -60,6 +60,7 @@ var bootstrap = function ($, learun) { | |||
}); | |||
$("#lr_printBar").on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('AICode'); | |||
var AName = $('#gridtable').jfGridValue('AIASSName'); | |||
if (learun.checkrow(keyValue)) { | |||
//todo 打印标签 | |||
//$('.qrcodeTxt').html(keyValue); | |||
@@ -79,7 +80,7 @@ var bootstrap = function ($, learun) { | |||
learun.layerForm({ | |||
id: 'formcardprint', | |||
title: '打印二维码', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/QRPrint?keyValue=' + keyValue, | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/QRPrint?keyValue=' + keyValue+'&aName='+escape(AName), | |||
width: 700, | |||
height: 300, | |||
btn: null, | |||
@@ -180,7 +181,7 @@ var bootstrap = function ($, learun) { | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/GetPageList', | |||
headData: [ | |||
{ label: "明细编号", name: "AICode", width: 200, align: "left" }, | |||
@@ -301,22 +302,6 @@ var bootstrap = function ($, learun) { | |||
} | |||
}, | |||
{ label: "资产价值", name: "AIAssValue", width: 100, align: "left" }, | |||
//{ | |||
// label: "是否报废", name: "AIIsScrap", width: 100, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
// learun.clientdata.getAsync('dataItem', { | |||
// key: value, | |||
// code: 'YesOrNoBit', | |||
// callback: function (_data) { | |||
// if (_data.text) { | |||
// callback(_data.text); | |||
// } else { | |||
// callback('正常使用'); | |||
// } | |||
// } | |||
// }); | |||
// } | |||
//}, | |||
{ label: "购置日期", name: "AIAddTime", width: 100, align: "left" }, | |||
{ | |||
label: "资产分类", name: "AIASSClass", width: 100, align: "left", | |||
@@ -302,22 +302,6 @@ var bootstrap = function ($, learun) { | |||
} | |||
}, | |||
{ label: "资产价值", name: "AIAssValue", width: 100, align: "left" }, | |||
//{ | |||
// label: "是否报废", name: "AIIsScrap", width: 100, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
// learun.clientdata.getAsync('dataItem', { | |||
// key: value, | |||
// code: 'YesOrNoBit', | |||
// callback: function (_data) { | |||
// if (_data.text) { | |||
// callback(_data.text); | |||
// } else { | |||
// callback('正常使用'); | |||
// } | |||
// } | |||
// }); | |||
// } | |||
//}, | |||
{ label: "购置日期", name: "AIAddTime", width: 100, align: "left" }, | |||
{ | |||
label: "资产分类", name: "AIASSClass", width: 100, align: "left", | |||
@@ -267,22 +267,6 @@ var bootstrap = function ($, learun) { | |||
} | |||
}, | |||
{ label: "资产价值", name: "AIAssValue", width: 100, align: "left" }, | |||
{ | |||
label: "是否报废", name: "AIIsScrap", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'YesOrNoBit', | |||
callback: function (_data) { | |||
if (_data.text) { | |||
callback(_data.text); | |||
} else { | |||
callback('正常使用'); | |||
} | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "购置日期", name: "AIAddTime", width: 100, align: "left" }, | |||
{ | |||
label: "资产分类", name: "AIASSClass", width: 100, align: "left", | |||
@@ -37,7 +37,8 @@ | |||
height: 80 | |||
}); | |||
var keyValue = request('keyValue');//二维码 | |||
$('.qrcodeTxt').html(keyValue) | |||
var aName = request('aName'); | |||
$('.qrcodeTxt').html(unescape( aName)); | |||
$(function () { | |||
qrcode.makeCode(keyValue); | |||
$("#btnprint").on("click", function () { | |||
@@ -237,6 +237,7 @@ var bootstrap = function ($, learun) { | |||
} | |||
} | |||
}, | |||
{ label: "审核意见", name: "POpinion", width: 130, align: "left" }, | |||
{ | |||
label: "采购状态", name: "PStatus", width: 100, align: "left", | |||
formatter: function (cellvalue, row) { | |||
@@ -249,6 +250,7 @@ var bootstrap = function ($, learun) { | |||
} | |||
} | |||
}, | |||
{ label: "是否入库", name: "PIsInStorage", width: 130, align: "left" }, | |||
], | |||
mainId: 'PAId', | |||
isPage: true, | |||
@@ -20,7 +20,7 @@ | |||
<div id="PAITId" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_PurchaseItemApply"> | |||
<div class="lr-form-item-title">单价<font face="宋体">*</font></div> | |||
<div class="lr-form-item-title">预算单价<font face="宋体">*</font></div> | |||
<input id="PAIPrice" type="text" class="form-control" isvalid="yes" checkexpession="PositiveFloatintZero" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_PurchaseItemApply"> | |||
@@ -1,8 +1,17 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using Learun.Application.Organization; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||
using Learun.Util; | |||
using Learun.Util.Operat; | |||
using Microsoft.AspNet.SignalR.Client; | |||
using Newtonsoft.Json; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Configuration; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Threading.Tasks; | |||
using System.Web; | |||
using System.Web.Mvc; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
@@ -17,6 +26,10 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public class ArrangeLessonTermController : MvcControllerBase | |||
{ | |||
private ArrangeLessonTermIBLL arrangeLessonTermIBLL = new ArrangeLessonTermBLL(); | |||
private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL(); | |||
private UserIBLL userIbll = new UserBLL(); | |||
private WeChatConfigIBLL weChatConfigIbll = new WeChatConfigBLL(); | |||
private WeChatTempletIBLL weChatTempletIbll = new WeChatTempletBLL(); | |||
#region 视图功能 | |||
@@ -27,7 +40,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -36,7 +49,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 按条件清空排课数据 | |||
@@ -71,7 +84,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetList( string queryJson ) | |||
public ActionResult GetList(string queryJson) | |||
{ | |||
var data = arrangeLessonTermIBLL.GetList(queryJson).ToList() | |||
.OrderBy(x => x.AcademicYearNo).ThenBy(x => x.Semester).ThenBy(x => x.DeptNo).ThenBy(x => x.MajorNo).ThenBy(x => x.LessonNo).ThenBy(x => x.TeachClassNo.Replace(x.LessonName, "")).ThenBy(x => x.EmpNo).ThenBy(x => x.ClassroomNo).ThenBy(x => x.LessonDate); | |||
@@ -133,7 +146,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue,ArrangeLessonTermEntity entity) | |||
public ActionResult SaveForm(string keyValue, ArrangeLessonTermEntity entity) | |||
{ | |||
arrangeLessonTermIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
@@ -148,7 +161,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[AjaxOnly] | |||
public async Task<ActionResult> AsyncArrangeLessonData() | |||
{ | |||
var data =await arrangeLessonTermIBLL.AsyncArrangeLessonData(); | |||
var data = await arrangeLessonTermIBLL.AsyncArrangeLessonData(); | |||
return Success(data); | |||
} | |||
@@ -185,6 +198,34 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public async Task<ActionResult> AsyncArrangeLessonDataByCondition(ArrangeLessonTermEntity entity) | |||
{ | |||
var data = await arrangeLessonTermIBLL.AsyncArrangeLessonDataByCondition(entity); | |||
if (data) | |||
{ | |||
//读取信息推送管理-课表同步推送(09)的配置 | |||
var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("09"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
var title = string.Format("{0}学年第{1}学期必修课课表同步", entity.AcademicYearNo, entity.Semester); | |||
var needpostuserlist = userIbll.GetAllList().Where(m => m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师").ToList(); | |||
//微信推送 | |||
try | |||
{ | |||
PushWeixin(needpostuserlist, title); | |||
} | |||
catch (Exception e) | |||
{ | |||
} | |||
//飞星推送 | |||
await Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", LoginUserInfo.Get().userId, "课表同步", Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(title)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(title)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(title)).Substring(0, 20), "synclesson", string.Join(",", needpostuserlist.Select(m => m.F_UserId)), ""); | |||
} | |||
}); | |||
} | |||
} | |||
return Success(data); | |||
} | |||
/// <summary> | |||
@@ -194,11 +235,68 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult InitAsyncDataByCondition(ArrangeLessonTermEntity entity) | |||
public ActionResult InitAsyncDataByCondition(ArrangeLessonTermEntity entity) | |||
{ | |||
var data = arrangeLessonTermIBLL.InitAsyncDataByCondition(entity); | |||
return Success(data); | |||
} | |||
public void PushWeixin(List<UserEntity> needpostuserlist, string title) | |||
{ | |||
var WeChatConfigentity = weChatConfigIbll.GetEnableEntity(); | |||
string appid = WeChatConfigentity.APPId; | |||
string secret = WeChatConfigentity.secret; | |||
var wechatemplete = weChatTempletIbll.GetWeChatTemplateEntityByCodeConfigId(WeChatConfigentity.ID, "task"); | |||
string weixintaskurl = wechatemplete.TUrl; | |||
string weixintasktempid = wechatemplete.TempId; | |||
var responsejson = Util.HttpMethods.HttpGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret); | |||
OperateLogModel operateLogModel = new OperateLogModel(); | |||
operateLogModel.title = title; | |||
operateLogModel.type = OperationType.Other; | |||
operateLogModel.url = "ArrangeLessonTermController"; | |||
operateLogModel.sourceObjectId = "002"; | |||
operateLogModel.sourceContentJson = responsejson; | |||
OperatorHelper.Instance.WriteOperateLog(operateLogModel); | |||
foreach (UserEntity userinfo in needpostuserlist) | |||
{ | |||
if (userinfo != null && !string.IsNullOrEmpty(userinfo.OpenIdForWeixin)) | |||
{ | |||
//执行推送任务 | |||
if (!string.IsNullOrEmpty(appid) && !string.IsNullOrEmpty(secret) && !string.IsNullOrEmpty(weixintaskurl) && !string.IsNullOrEmpty(weixintasktempid)) | |||
{ | |||
if (!string.IsNullOrEmpty(responsejson)) | |||
{ | |||
var weixintokenobj = JsonConvert.DeserializeObject<dynamic>(responsejson); | |||
if (string.IsNullOrEmpty(weixintokenobj.errcode)) | |||
{ | |||
string access_token = weixintokenobj.access_token; | |||
string jsondata = "{\"touser\":\"" + userinfo.OpenIdForWeixin + "\"," + | |||
"\"template_id\":\"" + weixintasktempid + "\"," + | |||
"\"url\":\"" + weixintaskurl + "\"," + | |||
"\"data\":{" + | |||
"\"first\": {\"value\":\"您有新的课表同步\",\"color\":\"#173177\"}," + | |||
"\"keyword1\":{\"value\":\"课表同步\",\"color\":\"#173177\"}," + | |||
"\"keyword2\": {\"value\":\"" + title + "\",\"color\":\"#173177\"}," + | |||
"\"keyword3\": {\"value\":\"待查看\",\"color\":\"#173177\"}," + | |||
"\"keyword4\": {\"value\":\"您有新的课表同步【" + title + "】\",\"color\":\"#173177\"}" + | |||
"}" + | |||
"}"; | |||
string pushresult = Util.HttpMethods.HttpPost("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token, jsondata); | |||
operateLogModel.title = title; | |||
operateLogModel.type = OperationType.Other; | |||
operateLogModel.url = "ArrangeLessonTermController"; | |||
operateLogModel.sourceObjectId = "002"; | |||
operateLogModel.sourceContentJson = pushresult; | |||
OperatorHelper.Instance.WriteOperateLog(operateLogModel); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -4,6 +4,15 @@ using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
using System.Threading.Tasks; | |||
using System; | |||
using Microsoft.AspNet.SignalR.Client; | |||
using System.Configuration; | |||
using System.Web; | |||
using System.Linq; | |||
using Learun.Application.Organization; | |||
using Learun.Util.Operat; | |||
using Newtonsoft.Json; | |||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
@@ -17,6 +26,10 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public class ArrangeLessonTermOfElectiveController : MvcControllerBase | |||
{ | |||
private ArrangeLessonTermOfElectiveIBLL arrangeLessonTermOfElectiveIBLL = new ArrangeLessonTermOfElectiveBLL(); | |||
private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL(); | |||
private UserIBLL userIbll = new UserBLL(); | |||
private WeChatConfigIBLL weChatConfigIbll = new WeChatConfigBLL(); | |||
private WeChatTempletIBLL weChatTempletIbll = new WeChatTempletBLL(); | |||
#region 视图功能 | |||
@@ -165,8 +178,93 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public async Task<ActionResult> AsyncArrangeLessonDataByCondition(ArrangeLessonTermOfElectiveEntity entity) | |||
{ | |||
var data = await arrangeLessonTermOfElectiveIBLL.AsyncArrangeLessonDataByCondition(entity); | |||
if (data) | |||
{ | |||
//读取信息推送管理-课表同步推送(09)的配置 | |||
var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("09"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
var title = string.Format("{0}学年第{1}学期选修课课课表同步", entity.AcademicYearNo, entity.Semester); | |||
var needpostuserlist = userIbll.GetAllList().Where(m => m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师").ToList(); | |||
//微信推送 | |||
try | |||
{ | |||
PushWeixin(needpostuserlist, title); | |||
} | |||
catch (Exception e) | |||
{ | |||
} | |||
//飞星推送 | |||
await Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", LoginUserInfo.Get().userId, "课表同步", Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(title)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(title)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(title)).Substring(0, 20), "synclesson", string.Join(",", needpostuserlist.Select(m => m.F_UserId)), ""); | |||
} | |||
}); | |||
} | |||
} | |||
return Success(data); | |||
} | |||
public void PushWeixin(List<UserEntity> needpostuserlist, string title) | |||
{ | |||
var WeChatConfigentity = weChatConfigIbll.GetEnableEntity(); | |||
string appid = WeChatConfigentity.APPId; | |||
string secret = WeChatConfigentity.secret; | |||
var wechatemplete = weChatTempletIbll.GetWeChatTemplateEntityByCodeConfigId(WeChatConfigentity.ID, "task"); | |||
string weixintaskurl = wechatemplete.TUrl; | |||
string weixintasktempid = wechatemplete.TempId; | |||
var responsejson = Util.HttpMethods.HttpGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret); | |||
OperateLogModel operateLogModel = new OperateLogModel(); | |||
operateLogModel.title = title; | |||
operateLogModel.type = OperationType.Other; | |||
operateLogModel.url = "ArrangeLessonTermOfElectiveController"; | |||
operateLogModel.sourceObjectId = "002"; | |||
operateLogModel.sourceContentJson = responsejson; | |||
OperatorHelper.Instance.WriteOperateLog(operateLogModel); | |||
foreach (UserEntity userinfo in needpostuserlist) | |||
{ | |||
if (userinfo != null && !string.IsNullOrEmpty(userinfo.OpenIdForWeixin)) | |||
{ | |||
//执行推送任务 | |||
if (!string.IsNullOrEmpty(appid) && !string.IsNullOrEmpty(secret) && !string.IsNullOrEmpty(weixintaskurl) && !string.IsNullOrEmpty(weixintasktempid)) | |||
{ | |||
if (!string.IsNullOrEmpty(responsejson)) | |||
{ | |||
var weixintokenobj = JsonConvert.DeserializeObject<dynamic>(responsejson); | |||
if (string.IsNullOrEmpty(weixintokenobj.errcode)) | |||
{ | |||
string access_token = weixintokenobj.access_token; | |||
string jsondata = "{\"touser\":\"" + userinfo.OpenIdForWeixin + "\"," + | |||
"\"template_id\":\"" + weixintasktempid + "\"," + | |||
"\"url\":\"" + weixintaskurl + "\"," + | |||
"\"data\":{" + | |||
"\"first\": {\"value\":\"您有新的课表同步\",\"color\":\"#173177\"}," + | |||
"\"keyword1\":{\"value\":\"课表同步\",\"color\":\"#173177\"}," + | |||
"\"keyword2\": {\"value\":\"" + title + "\",\"color\":\"#173177\"}," + | |||
"\"keyword3\": {\"value\":\"待查看\",\"color\":\"#173177\"}," + | |||
"\"keyword4\": {\"value\":\"您有新的课表同步【" + title + "】\",\"color\":\"#173177\"}" + | |||
"}" + | |||
"}"; | |||
string pushresult = Util.HttpMethods.HttpPost("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token, jsondata); | |||
operateLogModel.title = title; | |||
operateLogModel.type = OperationType.Other; | |||
operateLogModel.url = "ArrangeLessonTermOfElectiveController"; | |||
operateLogModel.sourceObjectId = "002"; | |||
operateLogModel.sourceContentJson = pushresult; | |||
OperatorHelper.Instance.WriteOperateLog(operateLogModel); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -0,0 +1,170 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
using System; | |||
using Learun.Application.Organization; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-19 14:39 | |||
/// 描 述:多账号绑定 | |||
/// </summary> | |||
public class LoginUserBindController : MvcControllerBase | |||
{ | |||
private LoginUserBindIBLL loginUserBindIBLL = new LoginUserBindBLL(); | |||
private UserIBLL userIBLL = new UserBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 主页面【切换账号】 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult BindAccountIndex() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表分页数据 | |||
/// <summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = loginUserBindIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// <summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetList(string queryJson) | |||
{ | |||
var data = loginUserBindIBLL.GetList(queryJson); | |||
return Success(data); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var LoginUserBindData = loginUserBindIBLL.GetLoginUserBindEntity( keyValue ); | |||
var jsonData = new { | |||
LoginUserBind = LoginUserBindData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
loginUserBindIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
UserInfo userInfo = LoginUserInfo.Get(); | |||
LoginUserBindEntity entity = strEntity.ToObject<LoginUserBindEntity>(); | |||
if (entity.BindUserAccount == userInfo.account) | |||
{ | |||
return Fail("绑定账号不能为登录用户账号!"); | |||
} | |||
//判断账号是否已绑定 | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
var aa = loginUserBindIBLL.GetEntityByBindUserAccount(entity.BindUserAccount, userInfo.userId); | |||
if (aa != null) | |||
{ | |||
return Fail("绑定账号已存在!"); | |||
} | |||
} | |||
else | |||
{ | |||
var aa = loginUserBindIBLL.GetEntityByBindUserAccount(entity.BindUserAccount, userInfo.userId); | |||
if (aa != null && aa.Id != keyValue) | |||
{ | |||
return Fail("绑定账号已存在!"); | |||
} | |||
} | |||
//判断账号、密码是否可以登录 | |||
var model = userIBLL.CheckLogin(entity.BindUserAccount, entity.BindUserPasswordTemp); | |||
if (!model.LoginOk) | |||
{ | |||
return Fail(model.LoginMsg); | |||
} | |||
entity.BindUserId = model.F_UserId; | |||
entity.CreateUserId = userInfo.userId; | |||
entity.CreateUserName = userInfo.realName; | |||
entity.CreateTime = DateTime.Now; | |||
loginUserBindIBLL.SaveEntity(userInfo,keyValue,entity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,163 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
using System; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-20 14:53 | |||
/// 描 述:信息推送管理 | |||
/// </summary> | |||
public class Sys_InformationPushController : MvcControllerBase | |||
{ | |||
private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = sys_InformationPushIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var Sys_InformationPushData = sys_InformationPushIBLL.GetSys_InformationPushEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
Sys_InformationPush = Sys_InformationPushData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
sys_InformationPushIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
var userInfo = LoginUserInfo.Get(); | |||
Sys_InformationPushEntity entity = strEntity.ToObject<Sys_InformationPushEntity>(); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
var aa = sys_InformationPushIBLL.GetEntityByPushItem(entity.PushItem); | |||
if (aa != null) | |||
{ | |||
return Fail("推送项目已存在!"); | |||
} | |||
entity.CreateUserId = userInfo.userId; | |||
entity.CreateUserName = userInfo.realName; | |||
entity.CreateTime = DateTime.Now; | |||
} | |||
else | |||
{ | |||
var aa = sys_InformationPushIBLL.GetEntityByPushItem(entity.PushItem); | |||
if (aa != null && aa.Id != keyValue) | |||
{ | |||
return Fail("推送项目已存在!"); | |||
} | |||
entity.ModifyUserId = userInfo.userId; | |||
entity.ModifyUserName = userInfo.realName; | |||
entity.ModifyTime = DateTime.Now; | |||
} | |||
sys_InformationPushIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 开启/关闭 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DoOpen(string keyValue, bool status) | |||
{ | |||
var userInfo = LoginUserInfo.Get(); | |||
var entity = sys_InformationPushIBLL.GetSys_InformationPushEntity(keyValue); | |||
if (entity == null) | |||
{ | |||
return Fail("当前推送项目不存在!"); | |||
} | |||
entity.Status = status; | |||
entity.ModifyUserId = userInfo.userId; | |||
entity.ModifyUserName = userInfo.realName; | |||
entity.ModifyTime = DateTime.Now; | |||
sys_InformationPushIBLL.SaveEntity(keyValue, entity); | |||
return Success("操作成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,34 @@ | |||
@{ | |||
ViewBag.Title = "切换账号"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout "> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">绑定账号</div> | |||
<input id="BindUserAccount" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_login" class="btn btn-default"><i class="fa fa-plus"></i> 登录</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/LoginUserBind/BindAccountIndex.js") |
@@ -0,0 +1,59 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-11-19 14:39 | |||
* 描 述:多账号绑定 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 登录 | |||
$('#lr_login').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var account = $('#gridtable').jfGridValue('BindUserAccount'); | |||
var pwd = $('#gridtable').jfGridValue('BindUserPassword'); | |||
//安全退出;自动登录; | |||
learun.httpAsyncPost('/Login/OutLogin', {}, function (data) { | |||
window.location.href = "/Login/Index?isBindAccountLogin=1&bindUserName=" + account + "&bindUserPassword=" + pwd; | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/LoginUserBind/GetPageList', | |||
headData: [ | |||
{ label: "绑定账号", name: "BindUserAccount", width: 150, align: "left" }, | |||
], | |||
mainId: 'Id', | |||
isPage: true, | |||
sidx: 'CreateTime desc' | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.CreateUserId = learun.clientdata.get(['userinfo']).userId; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,15 @@ | |||
@{ | |||
ViewBag.Title = "多账号绑定"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-12 lr-form-item" data-table="LoginUserBind" > | |||
<div class="lr-form-item-title">绑定账号<font face="宋体">*</font></div> | |||
<input id="BindUserAccount" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="LoginUserBind" > | |||
<div class="lr-form-item-title">绑定密码<font face="宋体">*</font></div> | |||
<input id="BindUserPassword" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/LoginUserBind/Form.js") |
@@ -0,0 +1,54 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-11-19 14:39 | |||
* 描 述:多账号绑定 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/LoginUserBind/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var data = $('body').lrGetFormData(); | |||
data.BindUserAccount = $('#BindUserAccount').val().trim(); | |||
data.BindUserPassword = $('#BindUserPassword').val().trim(); | |||
data.BindUserPasswordTemp = $.md5(data.BindUserPassword); | |||
var postData = { | |||
strEntity: JSON.stringify(data) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/LoginUserBind/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,36 @@ | |||
@{ | |||
ViewBag.Title = "多账号绑定"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">绑定账号</div> | |||
<input id="BindUserAccount" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/LoginUserBind/Index.js") |
@@ -0,0 +1,90 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-11-19 14:39 | |||
* 描 述:多账号绑定 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/LoginUserBind/Form', | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/LoginUserBind/Form?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/LoginUserBind/DeleteForm', { keyValue: keyValue}, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/LoginUserBind/GetPageList', | |||
headData: [ | |||
{ label: "绑定账号", name: "BindUserAccount", width: 150, align: "left"}, | |||
{ label: "绑定时间", name: "CreateTime", width: 130, align: "left"}, | |||
], | |||
mainId:'Id', | |||
isPage: true, | |||
sidx:'CreateTime desc' | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.CreateUserId = learun.clientdata.get(['userinfo']).userId; | |||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,15 @@ | |||
@{ | |||
ViewBag.Title = "信息推送管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_InformationPush" > | |||
<div class="lr-form-item-title">推送项目<font face="宋体">*</font></div> | |||
<div id="PushItem" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_InformationPush" > | |||
<div class="lr-form-item-title">是否开启<font face="宋体">*</font></div> | |||
<div id="Status" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Sys_InformationPush/Form.js") |
@@ -0,0 +1,53 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-11-20 14:53 | |||
* 描 述:信息推送管理 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#PushItem').lrDataItemSelect({ code: 'InformationPushItem' }); | |||
$('#Status').lrDataItemSelect({ code: 'YesOrNoBit' }); | |||
$('#Status').lrselectSet("false"); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/Sys_InformationPush/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Sys_InformationPush/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,32 @@ | |||
@{ | |||
/**/ | |||
ViewBag.Title = "信息推送管理"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout "> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_open" class="btn btn-default"><i class="fa fa-plus"></i> 开启</a> | |||
<a id="lr_close" class="btn btn-default"><i class="fa fa-plus"></i> 关闭</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Sys_InformationPush/Index.js") |
@@ -0,0 +1,137 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-11-20 14:53 | |||
* 描 述:信息推送管理 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/Sys_InformationPush/Form', | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/Sys_InformationPush/Form?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Sys_InformationPush/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 开启 | |||
$('#lr_open').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var status = $('#gridtable').jfGridValue('Status'); | |||
if (status == true) { | |||
learun.alert.warning("该推送项目已开启!"); | |||
return false; | |||
} | |||
learun.layerConfirm('是否确认开启该项!', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/Sys_InformationPush/DoOpen', { keyValue: keyValue, status: true }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 关闭 | |||
$('#lr_close').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var status = $('#gridtable').jfGridValue('Status'); | |||
if (status != true) { | |||
learun.alert.warning("该推送项目暂未开启!"); | |||
return false; | |||
} | |||
learun.layerConfirm('是否确认关闭该项!', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/Sys_InformationPush/DoOpen', { keyValue: keyValue, status: false }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Sys_InformationPush/GetPageList', | |||
headData: [ | |||
{ | |||
label: "推送项目", name: "PushItem", width: 200, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'InformationPushItem', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "是否开启", name: "Status", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | |||
} | |||
}, | |||
], | |||
mainId: 'Id', | |||
isPage: true | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -15,6 +15,7 @@ using Learun.Util.Operat; | |||
using Microsoft.AspNet.SignalR.Client; | |||
using Microsoft.Owin.Logging; | |||
using Newtonsoft.Json; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
{ | |||
@@ -34,6 +35,7 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
private UserRelationIBLL userRelationIBLL = new UserRelationBLL(); | |||
private DataItemIBLL dataItemIbll = new DataItemBLL(); | |||
private DepartmentIBLL departmentIbll = new DepartmentBLL(); | |||
private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 管理页面 | |||
@@ -285,8 +287,13 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
{ | |||
entity.F_NewsContent = WebHelper.HtmlEncode(entity.F_NewsContent); | |||
noticeIBLL.SaveEntity(keyValue, entity); | |||
//推送微信 | |||
Task.Run(async () => { await DoWeixinPush(entity); }); | |||
//读取信息推送管理-通知公告推送(01)的配置 | |||
var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("01"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
//推送微信 | |||
Task.Run(async () => { await DoWeixinPush(entity); }); | |||
} | |||
if (entity.F_IsSendFX.HasValue && entity.F_IsSendFX == true) | |||
{ | |||
Task.Run(async () => | |||
@@ -310,7 +310,9 @@ namespace Learun.Application.Web.Controllers | |||
//网上办事大厅 | |||
var result3 = teachSwitchIBLL.FindFirst("ssosystem"); | |||
ViewBag.SSOSystemSwitch = result3; | |||
//微信快捷登录 | |||
var result4 = teachSwitchIBLL.FindFirst("wxloginforpc"); | |||
ViewBag.WeixinLoginSwitch = result4; | |||
//获取在线用户人数 | |||
ViewBag.OnlineUserNum = 0; | |||
var onlineUserResult = sys_UpdateRecordIBLL.GetOnlineUserNum(); | |||
@@ -788,6 +788,8 @@ | |||
<Compile Include="Areas\PersonnelManagement\Controllers\ADR_RestrictionController.cs" /> | |||
<Compile Include="Areas\PersonnelManagement\Controllers\ADR_AddApplyController.cs" /> | |||
<Compile Include="Areas\AssetManagementSystem\Controllers\Ass_AcceptanceController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\LoginUserBindController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\Sys_InformationPushController.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | |||
@@ -925,6 +927,8 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\LeaveSchoolA\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LessonInfo\FormNoMajor.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LessonInfo\IndexNoMajor.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\BindAccountIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\PracticeBase\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\PracticeBase\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\R_EnterBuilding\ClassReport.js" /> | |||
@@ -3830,6 +3834,7 @@ | |||
<Content Include="Views\LR_Content\script\lr-form.js" /> | |||
<Content Include="Views\LR_Content\script\lr-iframe-index.js" /> | |||
<Content Include="Views\LR_Content\script\lr-bootstrap.js" /> | |||
<Content Include="Views\LR_Content\script\pushmessage.js" /> | |||
<Content Include="Views\LR_Content\script\lr-im.js" /> | |||
<Content Include="Views\LR_Content\script\lr-language - 副本.js" /> | |||
<Content Include="Views\LR_Content\script\lr-language.js" /> | |||
@@ -6098,6 +6103,13 @@ | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\Index.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\Form.cshtml" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\Index.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_InformationPush\Index.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_InformationPush\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_InformationPush\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_InformationPush\Form.js" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Areas\LR_Desktop\Models\" /> | |||
@@ -6859,6 +6871,7 @@ | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AllocationItem\Form.cshtml" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AllocationItem\Index.cshtml" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\ViewForm.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\BindAccountIndex.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | |||
@@ -52,8 +52,10 @@ | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Views/Home/AdminTheme5/index.js") | |||
@Html.AppendJsFile("/Views/Login/ACLogon.js") | |||
<script> | |||
$(function() { | |||
//$(".lr-frame-tabs").css("top", "56px") | |||
}) | |||
var Ip = "@ViewBag.Ip"; | |||
var ACIp = "@ViewBag.ACIp"; | |||
var ACIp2 = "@ViewBag.ACIp2"; | |||
</script> |
@@ -74,6 +74,7 @@ var loaddfimg; | |||
_html += '<li><a href="javascript:void(0);" id="lr_cancelweixinbind_btn"><i class="fa fa-unlock"></i>解绑微信</a></li>'; | |||
_html += '<li><a href="javascript:void(0);" id="lr_schedule_btn"><i class="fa fa-calendar"></i>我的日程</a></li>'; | |||
_html += '<li><a href="javascript:void(0);" id="lr_onlineuser_btn"><i class="fa fa-user"></i>在线人员</a></li>'; | |||
_html += '<li><a href="javascript:void(0);" id="lr_loginuserbind_btn"><i class="fa fa-group"></i>切换账号</a></li>'; | |||
if (loginInfo.isSystem) { | |||
_html += '<li><a href="javascript:void(0);" id="lr_clearredis_btn"><i class="fa fa-refresh"></i>清空缓存</a></li>'; | |||
} | |||
@@ -85,6 +86,7 @@ var loaddfimg; | |||
$('#lr_userinfo_btn').on('click', page.openUserCenter); | |||
$('#lr_clearredis_btn').on('click', page.clearredis); | |||
$('#lr_onlineuser_btn').on('click', page.openOnlineUser); | |||
$('#lr_loginuserbind_btn').on('click', page.openLoginUserBind); | |||
$('#lr_cancelweixinbind_btn').on('click', page.cancelWeiXinBind); | |||
}, | |||
loginout: function () { // 安全退出 | |||
@@ -146,7 +148,17 @@ var loaddfimg; | |||
btn: null | |||
}); | |||
}, | |||
openLoginUserBind: function () { | |||
// 打开切换账号 | |||
learun.layerForm({ | |||
id: "LoginUserBindList", | |||
title: '切换账号', | |||
url: top.$.rootUrl + '/EducationalAdministration/LoginUserBind/BindAccountIndex', | |||
width: 1000, | |||
height: 600, | |||
btn: null | |||
}); | |||
}, | |||
// 全屏按钮 | |||
fullScreenInit: function () { | |||
var _html = '<div class="lr_frame_fullscreen"><a href="javascript:void(0);" id="lr_fullscreen_btn" title="全屏"><i class="fa fa-arrows-alt"></i></a></div>'; | |||
@@ -0,0 +1,75 @@ | |||
(function ($, learun) { | |||
"use strict"; | |||
learun._im = { | |||
init: function () { | |||
learun._im.registerServer(); | |||
learun._im.connect(); | |||
} | |||
// 连接服务端 | |||
, connect: function () { | |||
var loginInfo = learun.clientdata.get(['userinfo']); | |||
if (loginInfo.imOpen != 'true') { | |||
setTimeout(learun._im.connect, 10000); | |||
} | |||
$.ajax({ | |||
url: loginInfo.imUrl + "/hubs", | |||
type: "get", | |||
dataType: "text", | |||
success: function (data) { | |||
eval(data); | |||
//Set the hubs URL for the connection | |||
$.connection.hub.url = loginInfo.imUrl; | |||
$.connection.hub.qs = { "userId": loginInfo.userId }; | |||
// Declare a proxy to reference the hub. | |||
learun.imChat = $.connection.ChatsHub; | |||
learun.imChat.client.broadcastMessage = function(message) { | |||
top.layer.open({ | |||
type: 1 //此处以iframe举例 | |||
, title: '通知' | |||
, area: ['390px', '330px'] | |||
, shade: 0 | |||
, offset: 'rb' | |||
, maxmin: true | |||
, content: message | |||
, btn: null | |||
, yes: function () { | |||
$(that).click(); //此处只是为了演示,实际使用可以剔除 | |||
} | |||
, btn2: function () { | |||
layer.closeAll(); | |||
} | |||
, zIndex: layer.zIndex //重点1 | |||
, success: function (layero) { | |||
layer.setTop(layero); //重点2 | |||
} | |||
}); | |||
} | |||
if (!learun.imChat) { | |||
setTimeout(learun._im.connect, 1000); | |||
} | |||
// 连接成功后注册服务器方法 | |||
$.connection.hub.start().done(function () { | |||
//learun.imChat.server.pushMessage('123123'); | |||
}); | |||
//断开连接后 | |||
$.connection.hub.disconnected(function () { | |||
// | |||
}); | |||
}, | |||
error: function (XMLHttpRequest, textStatus, errorThrown) { | |||
isLoaded = 0; | |||
}, | |||
}); | |||
} | |||
}; | |||
$(function() { | |||
learun._im.connect(); | |||
}) | |||
})(jQuery, top.learun); |
@@ -59,7 +59,7 @@ | |||
<div class="lr-login-middle"> | |||
@if (ViewBag.WeixinLoginSwitch) | |||
{ | |||
<a href="LoginForWeixin?login=one" class="wxLogin down" title="使用微信登录"> | |||
<a href="/Login/LoginForWeixin?login=one" class="wxLogin down" title="使用微信登录"> | |||
<img src="~/Content/images/LoginPage/icon.png" alt="" /> 使用微信登录 | |||
</a> | |||
} | |||
@@ -9,8 +9,17 @@ | |||
"use strict"; | |||
var source = request('source'); | |||
var keyValue = request('keyValue'); | |||
var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录 | |||
var bindUserName = request('bindUserName');//绑定账号 | |||
var bindUserPassword = request('bindUserPassword');//绑定账号密码 | |||
var lrPage = { | |||
init: function () { | |||
//切换账号登录时:登录页赋值,触发登录事件; | |||
if (isBindAccountLogin == 1) { | |||
$("#lr_username").val(bindUserName); | |||
$("#lr_password").val(bindUserPassword); | |||
lrPage.login(); | |||
} | |||
$('#psw_change').css({ | |||
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center' | |||
@@ -158,7 +167,7 @@ | |||
} | |||
else | |||
window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index"; | |||
//window.location.href = "/Home/Index"; | |||
//window.location.href = "/Home/Index"; | |||
} | |||
} | |||
else if (res.code == 400) { | |||
@@ -31,7 +31,7 @@ | |||
} | |||
@if (ViewBag.WeixinLoginSwitch) | |||
{ | |||
<a href="LoginForWeixin?login=one" class="wxLogin down" title="使用微信登录"> | |||
<a href="/Login/LoginForWeixin?login=one" class="wxLogin down" title="使用微信登录"> | |||
<img src="~/Content/images/LoginPage/icon.png" alt="" /> 使用微信登录 | |||
</a> | |||
} | |||
@@ -9,8 +9,17 @@ | |||
"use strict"; | |||
var source = request('source'); | |||
var keyValue = request('keyValue'); | |||
var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录 | |||
var bindUserName = request('bindUserName');//绑定账号 | |||
var bindUserPassword = request('bindUserPassword');//绑定账号密码 | |||
var lrPage = { | |||
init: function () { | |||
//切换账号登录时:登录页赋值,触发登录事件; | |||
if (isBindAccountLogin == 1) { | |||
$("#lr_username").val(bindUserName); | |||
$("#lr_password").val(bindUserPassword); | |||
lrPage.login(); | |||
} | |||
$('#psw_change').css({ | |||
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center' | |||
@@ -89,7 +89,7 @@ | |||
</div> | |||
@if (ViewBag.WeixinLoginSwitch) | |||
{ | |||
<a href="LoginForWeixin?login=one" class="wxLogin" title="使用微信登录"> | |||
<a href="/Login/LoginForWeixin?login=one" class="wxLogin" title="使用微信登录"> | |||
<img src="~/Content/images/LoginPage/icon.png" alt="" /> 使用微信登录 | |||
</a> | |||
} | |||
@@ -9,8 +9,17 @@ | |||
"use strict"; | |||
var source = request('source'); | |||
var keyValue = request('keyValue'); | |||
var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录 | |||
var bindUserName = request('bindUserName');//绑定账号 | |||
var bindUserPassword = request('bindUserPassword');//绑定账号密码 | |||
var lrPage = { | |||
init: function () { | |||
//切换账号登录时:登录页赋值,触发登录事件; | |||
if (isBindAccountLogin == 1) { | |||
$("#lr_username").val(bindUserName); | |||
$("#lr_password").val(bindUserPassword); | |||
lrPage.login(); | |||
} | |||
$('#psw_change').css({ | |||
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center' | |||
@@ -66,7 +66,7 @@ | |||
<div class="bbh"> | |||
@if (ViewBag.WeixinLoginSwitch) | |||
{ | |||
<a href="LoginForWeixin?login=one" class="wxLogin" title="使用微信登录"> | |||
<a href="/Login/LoginForWeixin?login=one" class="wxLogin" title="使用微信登录"> | |||
<img src="~/Content/images/LoginPage/icon.png" alt="" /> 使用微信登录 | |||
</a> | |||
} | |||
@@ -9,8 +9,17 @@ | |||
"use strict"; | |||
var source = request('source'); | |||
var keyValue = request('keyValue'); | |||
var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录 | |||
var bindUserName = request('bindUserName');//绑定账号 | |||
var bindUserPassword = request('bindUserPassword');//绑定账号密码 | |||
var lrPage = { | |||
init: function () { | |||
//切换账号登录时:登录页赋值,触发登录事件; | |||
if (isBindAccountLogin == 1) { | |||
$("#lr_username").val(bindUserName); | |||
$("#lr_password").val(bindUserPassword); | |||
lrPage.login(); | |||
} | |||
$('#psw_change').css({ | |||
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center' | |||
@@ -86,7 +86,7 @@ | |||
</div> | |||
@if (ViewBag.WeixinLoginSwitch) | |||
{ | |||
<a href="LoginForWeixin?login=one" class="wxLogin" title="使用微信登录"> | |||
<a href="/Login/LoginForWeixin?login=one" class="wxLogin" title="使用微信登录"> | |||
<img src="~/Content/images/LoginPage/icon.png" alt="" /> 使用微信登录 | |||
</a> | |||
} | |||
@@ -9,8 +9,17 @@ | |||
"use strict"; | |||
var source = request('source'); | |||
var keyValue = request('keyValue'); | |||
var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录 | |||
var bindUserName = request('bindUserName');//绑定账号 | |||
var bindUserPassword = request('bindUserPassword');//绑定账号密码 | |||
var lrPage = { | |||
init: function () { | |||
//切换账号登录时:登录页赋值,触发登录事件; | |||
if (isBindAccountLogin == 1) { | |||
$("#lr_username").val(bindUserName); | |||
$("#lr_password").val(bindUserPassword); | |||
lrPage.login(); | |||
} | |||
$('#psw_change').css({ | |||
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center' | |||
@@ -94,7 +94,7 @@ | |||
</div> | |||
@if (ViewBag.WeixinLoginSwitch) | |||
{ | |||
<a href="LoginForWeixin?login=one" class="wxLogin" title="使用微信登录"> | |||
<a href="/Login/LoginForWeixin?login=one" class="wxLogin" title="使用微信登录"> | |||
<img src="~/Content/images/LoginPage/icon.png" alt="" /> 使用微信登录 | |||
</a> | |||
} | |||
@@ -9,8 +9,17 @@ | |||
"use strict"; | |||
var source = request('source'); | |||
var keyValue = request('keyValue'); | |||
var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录 | |||
var bindUserName = request('bindUserName');//绑定账号 | |||
var bindUserPassword = request('bindUserPassword');//绑定账号密码 | |||
var lrPage = { | |||
init: function () { | |||
//切换账号登录时:登录页赋值,触发登录事件; | |||
if (isBindAccountLogin == 1) { | |||
$("#lr_username").val(bindUserName); | |||
$("#lr_password").val(bindUserPassword); | |||
lrPage.login(); | |||
} | |||
$('#psw_change').css({ | |||
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center' | |||
@@ -66,7 +66,7 @@ | |||
</div> | |||
@if (ViewBag.WeixinLoginSwitch) | |||
{ | |||
<a href="LoginForWeixin?login=one" class="wxLogin" title="使用微信登录"> | |||
<a href="/Login/LoginForWeixin?login=one" class="wxLogin" title="使用微信登录"> | |||
<img src="~/Content/images/LoginPage/icon.png" alt="" /> 使用微信登录 | |||
</a> | |||
} | |||
@@ -9,8 +9,17 @@ | |||
"use strict"; | |||
var source = request('source'); | |||
var keyValue = request('keyValue'); | |||
var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录 | |||
var bindUserName = request('bindUserName');//绑定账号 | |||
var bindUserPassword = request('bindUserPassword');//绑定账号密码 | |||
var lrPage = { | |||
init: function () { | |||
//切换账号登录时:登录页赋值,触发登录事件; | |||
if (isBindAccountLogin == 1) { | |||
$("#lr_username").val(bindUserName); | |||
$("#lr_password").val(bindUserPassword); | |||
lrPage.login(); | |||
} | |||
$('#psw_change').css({ | |||
'background': 'url(' + $.rootUrl + '/Content/images/Login/psw0.png) no-repeat center center' | |||
@@ -45,10 +45,10 @@ | |||
</div> | |||
</div> | |||
<div class="lr-frame-main" id="lr_frame_main"> | |||
<img src="~/Content/images/iframebg.png"/> | |||
<img src="~/Content/images/iframebg.png" /> | |||
</div> | |||
<script src="~/Content/bootstrap/bootstrap.min.js"></script> | |||
<script src="~/Content/jquery/plugin/layer/layer.js"></script> | |||
<script src="~/Content/jquery/plugin/jquery.cookie.min.js"></script> | |||
@@ -75,12 +75,13 @@ | |||
"/Views/LR_Content/plugin/tree/lr-tree.js", | |||
"/Views/LR_Content/plugin/select/lr-select.js", | |||
"/Views/LR_Content/plugin/workflow/lr-workflow-api.js", | |||
"/Views/LR_Content/plugin/contextmenu/lr-contextmenu.js", | |||
"/Views/LR_Content/script/lr-im.js", | |||
"/Views/LR_Content/script/pushmessage.js", | |||
"/Views/LR_Content/script/lr-admin.js" | |||
) | |||
</body> | |||
@@ -1,7 +1,7 @@ | |||
| |||
@{ | |||
ViewBag.Title = "ListContentIndex"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<link rel="stylesheet" type="text/css" href="~/Content/news/css/common.css"> | |||
<link rel="stylesheet" type="text/css" href="~/Content/news/css/style.css"> | |||
@@ -26,6 +26,7 @@ | |||
<div class="listDotBox" id="F_NewsContent"> | |||
</div> | |||
<div id="F_NewsImage"></div> | |||
</div> | |||
</div> | |||
<div class="list_sec2s list_sec"> | |||
@@ -11,9 +11,10 @@ var bootstrap = function ($, learun) { | |||
var page = { | |||
init: function () { | |||
$('#F_NewsImage').lrUploader({ isUpload:false}); | |||
$('.warpper').lrscroll(); | |||
var item = top['dtlist' + id]; | |||
if (!!item) { | |||
if(false){// (!!item) { | |||
$("#F_FullHead").text(item.f_title); | |||
$("#F_CreateDate").text(item.f_createdate); | |||
$("#F_CreateUserName").text(item.f_createusername); | |||
@@ -26,6 +27,7 @@ var bootstrap = function ($, learun) { | |||
$("#F_CreateUserName").text(data.F_CreateUserName); | |||
$("#F_Category").text(data.F_Category); | |||
$("#F_NewsContent").html($('<div></div>').html(data.F_NewsContent)); | |||
$('#F_NewsImage').lrUploaderSet(data.F_NewsImage); | |||
}); | |||
} | |||
//阅读 | |||
@@ -43,6 +45,8 @@ var bootstrap = function ($, learun) { | |||
$('#readlist').html(html); | |||
} | |||
}); | |||
} | |||
}; | |||
page.init(); |
@@ -195,6 +195,8 @@ | |||
<Compile Include="Modules\ArrangeLessonTermAttemperApi.cs" /> | |||
<Compile Include="Modules\DataSourceNoLoginApi.cs" /> | |||
<Compile Include="Modules\AskApi.cs" /> | |||
<Compile Include="Modules\EducationalAdministration\LoginUserBindApi.cs" /> | |||
<Compile Include="Modules\PushMessageApi.cs" /> | |||
<Compile Include="Modules\EvalApi.cs" /> | |||
<Compile Include="Modules\EducationalAdministration\R_EnterBuildingApi.cs" /> | |||
<Compile Include="Modules\EducationalAdministration\R_EnterSchoolApi.cs" /> | |||
@@ -0,0 +1,154 @@ | |||
using Nancy; | |||
using Learun.Util; | |||
using System.Collections.Generic; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using Learun.Application.Organization; | |||
using System; | |||
namespace Learun.Application.WebApi | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-19 14:50 | |||
/// 描 述:多账号绑定 | |||
/// </summary> | |||
public class LoginUserBindApi : BaseApi | |||
{ | |||
private LoginUserBindIBLL loginUserBindIBLL = new LoginUserBindBLL(); | |||
private UserIBLL userIBLL = new UserBLL(); | |||
/// <summary> | |||
/// 注册接口 | |||
/// <summary> | |||
public LoginUserBindApi() | |||
: base("/Learun/EducationalAdministration/LoginUserBind") | |||
{ | |||
Get["/pagelist"] = GetPageList; | |||
Get["/list"] = GetList; | |||
Get["/form"] = GetForm; | |||
Post["/delete"] = DeleteForm; | |||
Post["/save"] = SaveForm; | |||
} | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表分页数据 | |||
/// <summary> | |||
/// <param name="_"></param> | |||
/// <returns></returns> | |||
public Response GetPageList(dynamic _) | |||
{ | |||
ReqPageParam parameter = this.GetReqData<ReqPageParam>(); | |||
var data = loginUserBindIBLL.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); | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// <summary> | |||
/// <param name="_"></param> | |||
/// <returns></returns> | |||
public Response GetList(dynamic _) | |||
{ | |||
string queryJson = this.GetReqData(); | |||
var data = loginUserBindIBLL.GetList(queryJson); | |||
return Success(data); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// <summary> | |||
/// <param name="_"></param> | |||
/// <returns></returns> | |||
public Response GetForm(dynamic _) | |||
{ | |||
string keyValue = this.GetReqData(); | |||
var LoginUserBindData = loginUserBindIBLL.GetLoginUserBindEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
LoginUserBind = LoginUserBindData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// <param name="_"></param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public Response DeleteForm(dynamic _) | |||
{ | |||
string keyValue = this.GetReqData(); | |||
loginUserBindIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="_"></param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public Response SaveForm(dynamic _) | |||
{ | |||
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>(); | |||
LoginUserBindEntity entity = parameter.strEntity.ToObject<LoginUserBindEntity>(); | |||
if (entity.BindUserAccount == userInfo.account) | |||
{ | |||
return Fail("绑定账号不能为登录用户账号!"); | |||
} | |||
//判断账号是否已绑定 | |||
if (string.IsNullOrEmpty(parameter.keyValue)) | |||
{ | |||
var aa = loginUserBindIBLL.GetEntityByBindUserAccount(entity.BindUserAccount, userInfo.userId); | |||
if (aa != null) | |||
{ | |||
return Fail("绑定账号已存在!"); | |||
} | |||
} | |||
else | |||
{ | |||
var aa = loginUserBindIBLL.GetEntityByBindUserAccount(entity.BindUserAccount, userInfo.userId); | |||
if (aa != null && aa.Id != parameter.keyValue) | |||
{ | |||
return Fail("绑定账号已存在!"); | |||
} | |||
} | |||
//判断账号、密码是否可以登录 | |||
var model = userIBLL.CheckLogin(entity.BindUserAccount, entity.BindUserPasswordTemp); | |||
if (!model.LoginOk) | |||
{ | |||
return Fail(model.LoginMsg); | |||
} | |||
entity.BindUserId = model.F_UserId; | |||
entity.CreateUserId = userInfo.userId; | |||
entity.CreateUserName = userInfo.realName; | |||
entity.CreateTime = DateTime.Now; | |||
loginUserBindIBLL.SaveEntity(this.userInfo, parameter.keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
#region 私有类 | |||
/// <summary> | |||
/// 表单实体类 | |||
/// <summary> | |||
private class ReqFormEntity | |||
{ | |||
public string keyValue { get; set; } | |||
public string strEntity { get; set; } | |||
} | |||
#endregion | |||
} | |||
} |
@@ -32,6 +32,7 @@ namespace Learun.Application.WebApi | |||
private RoleIBLL roleIBLL = new RoleBLL(); | |||
private UserRelationIBLL userRelationIBLL = new UserRelationBLL(); | |||
private UserIBLL userIBLL = new UserBLL(); | |||
private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL(); | |||
/// <summary> | |||
@@ -59,7 +60,7 @@ namespace Learun.Application.WebApi | |||
var departmentList = mpEntity.MPDepartment.Split(',').ToList(); | |||
var UserList = new List<UserEntity>(); | |||
var title = ""; | |||
foreach (var departmentId in departmentList) | |||
{ | |||
var entityList = userIBLL.GetUserByDepartmentId(departmentId).Where(a => roleUserList.Contains(a.F_UserId) && !hasUploadUsers.Contains(a.F_UserId)).ToList(); | |||
@@ -75,19 +76,40 @@ namespace Learun.Application.WebApi | |||
if (mpEntity.MPType == 0) | |||
{ | |||
title = "内控检查"; | |||
FeiXinPush(title, "nk", UserList); | |||
//读取信息推送管理-内控管理推送(06)的配置 | |||
var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("06"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
//飞星推送 | |||
FeiXinPush(title, "nk", UserList); | |||
} | |||
} | |||
else if (mpEntity.MPType == 1) | |||
{ | |||
title = "绩效跟踪"; | |||
FeiXinPush(title, "jx", UserList); | |||
//读取信息推送管理-内控管理推送(06)的配置 | |||
var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("06"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
//飞星推送 | |||
FeiXinPush(title, "jx", UserList); | |||
} | |||
} | |||
else | |||
{ | |||
title = "质量目标"; | |||
FeiXinPush(title, "zl", UserList); | |||
//读取信息推送管理-内控管理推送(06)的配置 | |||
var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("06"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
//飞星推送 | |||
FeiXinPush(title, "zl", UserList); | |||
} | |||
} | |||
} | |||
@@ -95,7 +117,7 @@ namespace Learun.Application.WebApi | |||
return Success("推送成功"); | |||
} | |||
public void FeiXinPush(string title,string code,List<UserEntity> UserList) | |||
public void FeiXinPush(string title, string code, List<UserEntity> UserList) | |||
{ | |||
//飞星推送 | |||
Task.Run(async () => | |||
@@ -104,7 +126,7 @@ namespace Learun.Application.WebApi | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", "", title+"材料上传", title, code, string.Join(",", UserList.Select(m => m.F_UserId)), ""); | |||
await hubProxy.Invoke("PushAnnouncement", "", title + "材料上传", title, code, string.Join(",", UserList.Select(m => m.F_UserId)), ""); | |||
} | |||
}); | |||
OperateLogModel operateLogModel = new OperateLogModel(); | |||
@@ -0,0 +1,61 @@ | |||
using Nancy; | |||
using Learun.Util; | |||
using System.Collections.Generic; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using static Learun.Application.WebApi.Modules.StuInfoFreshApi; | |||
using System; | |||
using System.IO; | |||
using Learun.Application.Base.SystemModule; | |||
namespace Learun.Application.WebApi | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2019-08-19 17:50 | |||
/// 描 述:教师注册 | |||
/// </summary> | |||
public class PushMessageApi : BaseNoLoginApi | |||
{ | |||
/// <summary> | |||
/// 推送消息接口 | |||
/// <summary> | |||
public PushMessageApi() | |||
: base("/Learun/adms/pushMessage") | |||
{ | |||
Get["/msg"] = PushMessage; | |||
} | |||
private Response PushMessage(dynamic _) | |||
{ | |||
string msg = this.Request.Query["msg"].ToString(); | |||
if (!string.IsNullOrEmpty(msg)) | |||
{ | |||
SendHubs.callMethod("pushMessage", msg); | |||
} | |||
return Success("成功"); | |||
} | |||
#region 获取数据 | |||
#endregion | |||
#region 私有类 | |||
/// <summary> | |||
/// 表单实体类 | |||
/// <summary> | |||
private class ReqFormEntity | |||
{ | |||
public string keyValue { get; set; } | |||
public string strEntity { get; set; } | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-19 14:39 | |||
/// 描 述:多账号绑定 | |||
/// </summary> | |||
public class LoginUserBindMap : EntityTypeConfiguration<LoginUserBindEntity> | |||
{ | |||
public LoginUserBindMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("LOGINUSERBIND"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-20 14:53 | |||
/// 描 述:信息推送管理 | |||
/// </summary> | |||
public class Sys_InformationPushMap : EntityTypeConfiguration<Sys_InformationPushEntity> | |||
{ | |||
public Sys_InformationPushMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("SYS_INFORMATIONPUSH"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -540,6 +540,8 @@ | |||
<Compile Include="PersonnelManagement\ADR_RestrictionMap.cs" /> | |||
<Compile Include="PersonnelManagement\ADR_AddApplyMap.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_AcceptanceMap.cs" /> | |||
<Compile Include="EducationalAdministration\LoginUserBindMap.cs" /> | |||
<Compile Include="EducationalAdministration\Sys_InformationPushMap.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -12,6 +12,7 @@ using Learun.Application.Base.SystemModule; | |||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||
using Microsoft.AspNet.SignalR.Client; | |||
using Newtonsoft.Json; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
namespace Learun.Application.Message | |||
{ | |||
@@ -27,9 +28,10 @@ namespace Learun.Application.Message | |||
private LR_StrategyInfoService lR_StrategyInfoService = new LR_StrategyInfoService(); | |||
private UserRelationIBLL userRelationIBLL = new UserRelationBLL(); | |||
private UserIBLL userIBLL = new UserBLL(); | |||
WeChatConfigIBLL weChatConfigIbll=new WeChatConfigBLL(); | |||
WeChatConfigIBLL weChatConfigIbll = new WeChatConfigBLL(); | |||
private WeChatTempletIBLL weChatTempletIbll = new WeChatTempletBLL(); | |||
private IMSysUserIBLL iMSysUserIBLL = new IMSysUserBLL(); | |||
private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL(); | |||
#region 获取数据 | |||
@@ -37,7 +39,7 @@ namespace Learun.Application.Message | |||
/// 获取列表数据 | |||
/// <summary> | |||
/// <returns></returns> | |||
public IEnumerable<LR_MS_StrategyInfoEntity> GetList( string queryJson ) | |||
public IEnumerable<LR_MS_StrategyInfoEntity> GetList(string queryJson) | |||
{ | |||
try | |||
{ | |||
@@ -187,7 +189,7 @@ namespace Learun.Application.Message | |||
{ | |||
try | |||
{ | |||
return lR_StrategyInfoService.ExistStrategyCode(keyValue,F_StrategyCode); | |||
return lR_StrategyInfoService.ExistStrategyCode(keyValue, F_StrategyCode); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -299,7 +301,12 @@ namespace Learun.Application.Message | |||
EmailSend(content, list); | |||
break; | |||
case "2"://微信,调用微信发送方法 | |||
PushWeixin(list,content, taskMsgEntity); | |||
//读取信息推送管理-消息策略待办事项提醒推送(07)的配置 | |||
var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("07"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
PushWeixin(list, content, taskMsgEntity); | |||
} | |||
break; | |||
case "3": //短信,调用短信发送方法 | |||
SMSSend(content, list); | |||
@@ -308,7 +315,12 @@ namespace Learun.Application.Message | |||
IMSend(content, list); | |||
break; | |||
case "5": //飞星发送 | |||
PushFeixin(list, content, taskMsgEntity); | |||
//读取信息推送管理-消息策略待办事项提醒推送(07)的配置 | |||
var informationPushEntity2 = sys_InformationPushIBLL.GetEntityByPushItem("07"); | |||
if (informationPushEntity2 != null && informationPushEntity2.Status == true) | |||
{ | |||
PushFeixin(list, content, taskMsgEntity); | |||
} | |||
break; | |||
default: | |||
break; | |||
@@ -341,7 +353,7 @@ namespace Learun.Application.Message | |||
/// <param name="content">消息内容</param> | |||
/// <param name="list">用户列表信息</param> | |||
/// <returns></returns> | |||
public void EmailSend(string content,List<UserEntity> list) | |||
public void EmailSend(string content, List<UserEntity> list) | |||
{ | |||
try | |||
{ | |||
@@ -402,14 +414,14 @@ namespace Learun.Application.Message | |||
/// <param name="needpostuserlist"></param> | |||
/// <param name="content"></param> | |||
/// <param name="taskentity"></param> | |||
public void PushWeixin(List<UserEntity> needpostuserlist,string content, NWFTaskMsgEntity taskentity) | |||
public void PushWeixin(List<UserEntity> needpostuserlist, string content, NWFTaskMsgEntity taskentity) | |||
{ | |||
try | |||
{ | |||
var WeChatConfigentity = weChatConfigIbll.GetEnableEntity(); | |||
string appid = WeChatConfigentity.APPId; | |||
string secret = WeChatConfigentity.secret; | |||
var wechatemplete = weChatTempletIbll.GetWeChatTemplateEntityByCodeConfigId(WeChatConfigentity.ID,"task"); | |||
var wechatemplete = weChatTempletIbll.GetWeChatTemplateEntityByCodeConfigId(WeChatConfigentity.ID, "task"); | |||
string weixintaskurl = wechatemplete.TUrl; | |||
string weixintasktempid = wechatemplete.TempId; | |||
var responsejson = Util.HttpMethods.HttpGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret); | |||
@@ -420,7 +432,7 @@ namespace Learun.Application.Message | |||
logEntity.F_OperateType = "weixin"; | |||
logEntity.F_OperateAccount = "system"; | |||
logEntity.F_ExecuteResult = 200; | |||
logEntity.F_ExecuteResultJson ="调取微信tokken:"+ appid+ secret+ weixintasktempid+"responsejson"+ responsejson; | |||
logEntity.F_ExecuteResultJson = "调取微信tokken:" + appid + secret + weixintasktempid + "responsejson" + responsejson; | |||
logEntity.F_Description = "PC端"; | |||
logEntity.WriteLog(); | |||
foreach (UserEntity userinfo in needpostuserlist) | |||
@@ -443,12 +455,12 @@ namespace Learun.Application.Message | |||
"\"first\": {\"value\":\"待办事项提醒\",\"color\":\"#173177\"}," + | |||
"\"keyword1\":{\"value\":\"流程待办 \",\"color\":\"#173177\"}," + | |||
"\"keyword2\": {\"value\":\"" + taskentity.F_Title + "\",\"color\":\"#173177\"}," + | |||
"\"keyword3\": {\"value\":\""+ taskentity.F_NodeName + "\",\"color\":\"#173177\"}," + | |||
"\"keyword4\": {\"value\":\""+ content+ "\",\"color\":\"#173177\"}" + | |||
"\"keyword3\": {\"value\":\"" + taskentity.F_NodeName + "\",\"color\":\"#173177\"}," + | |||
"\"keyword4\": {\"value\":\"" + content + "\",\"color\":\"#173177\"}" + | |||
"}" + | |||
"}"; | |||
string pushresult = Util.HttpMethods.HttpPost("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token, jsondata); | |||
logEntity.F_ExecuteResultJson = "推送完成:"+jsondata + pushresult; | |||
logEntity.F_ExecuteResultJson = "推送完成:" + jsondata + pushresult; | |||
logEntity.WriteLog(); | |||
} | |||
} | |||
@@ -496,7 +508,7 @@ namespace Learun.Application.Message | |||
/// <param name="list">用户列表</param> | |||
/// <returns></returns> | |||
public void SMSSend(string content, List<UserEntity> list) | |||
{ | |||
{ | |||
} | |||
/// <summary> | |||
@@ -508,7 +520,8 @@ namespace Learun.Application.Message | |||
public void IMSend(string content, List<UserEntity> list) | |||
{ | |||
List<string> userList = new List<string>(); | |||
foreach (var user in list) { | |||
foreach (var user in list) | |||
{ | |||
userList.Add(user.F_UserId); | |||
} | |||
iMSysUserIBLL.SendMsg("IMSystem", userList, content); | |||
@@ -522,7 +535,7 @@ namespace Learun.Application.Message | |||
/// 主键 | |||
/// </summary> | |||
/// <returns></returns> | |||
public string F_Id { get; set; } | |||
/// <summary> | |||
/// 流程进程主键 | |||
@@ -223,26 +223,30 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
public void ModifyStatusByProcessId(int pastatus, string processId) | |||
{ | |||
var db = this.BaseRepository().BeginTrans(); | |||
try | |||
{ | |||
var entity = this.BaseRepository().FindEntity<Ass_ScrapEntity>(a => a.SPProcessId == processId); | |||
entity.SPStatus = pastatus; | |||
this.BaseRepository().Update(entity); | |||
db.Update(entity); | |||
if (pastatus == 2) | |||
{ | |||
var listScrapItem = this.BaseRepository().FindList<Ass_ScrapItemEntity>(a => a.SPId == entity.SPID); | |||
var listScrapItem = db.FindList<Ass_ScrapItemEntity>(a => a.SPId == entity.SPID); | |||
foreach (var item in listScrapItem) | |||
{ | |||
var assInfo = this.BaseRepository().FindEntity<Ass_AssetsInfoEntity>(a => a.AId == item.AAIAId); | |||
var assInfoItem = this.BaseRepository().FindEntity<Ass_AssetsInfoItemEntity>(a => a.AId == item.AAIAId); | |||
var assInfoItem = db.FindEntity<Ass_AssetsInfoItemEntity>(a => a.AIId == item.AAIAId); | |||
var assInfo = db.FindEntity<Ass_AssetsInfoEntity>(a => a.AId == assInfoItem.AId); | |||
if (assInfoItem.AIIsInStorage == true) | |||
{ | |||
assInfoItem.AIIsInStorage = false; | |||
assInfo.AStock = assInfo.AStock - 1; | |||
if (assInfo != null) | |||
{ | |||
assInfo.AStock = assInfo.AStock - 1; | |||
db.Update(assInfo); | |||
} | |||
assInfoItem.AIASSState = 1; | |||
this.BaseRepository().Update(assInfoItem); | |||
this.BaseRepository().Update(assInfo); | |||
db.Update(assInfoItem); | |||
} | |||
@@ -250,10 +254,12 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
} | |||
} | |||
db.Commit(); | |||
} | |||
catch (Exception e) | |||
{ | |||
db.Rollback(); | |||
if (e is ExceptionEx) | |||
{ | |||
throw; | |||
@@ -229,7 +229,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
infoItem.AId = assInfoEntity.AId; | |||
infoItem.AICode = assInfoEntity.ACode + "_" + codeNum.ToString(); | |||
infoItem.AICodeNum = codeNum; | |||
infoItem.AIIsScrap = false; | |||
} | |||
this.BaseRepository().Update(assInfoItemList2); | |||
@@ -268,61 +267,61 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
entity.Modify(keyValue); | |||
db.Update(entity); | |||
//清空明细和出入明细 | |||
//var Ass_AssetsInfoItemList = db.FindList<Ass_AssetsInfoItemEntity>(m => m.AId == keyValue); | |||
//foreach (var Ass_AssetsInfoItem in Ass_AssetsInfoItemList) | |||
//{ | |||
// db.Delete<Ass_AssetsChangeItemEntity>(m => m.AIId == Ass_AssetsInfoItem.AId); | |||
// db.Delete(Ass_AssetsInfoItem); | |||
//} | |||
////新增明细 | |||
//if (entity.HasDetail == true) | |||
//{ | |||
// if (entity.AStock > 0) | |||
// { | |||
// for (int i = 0; i < entity.AStock; i++) | |||
// { | |||
// var Ass_AssetsInfoItem = new Ass_AssetsInfoItemEntity(); | |||
// Ass_AssetsInfoItem.Create(); | |||
// Ass_AssetsInfoItem.AId = entity.AId; | |||
// Ass_AssetsInfoItem.AICodeNum = i + 1; | |||
// Ass_AssetsInfoItem.AICode = entity.ACode + "_" + Ass_AssetsInfoItem.AICodeNum; | |||
// Ass_AssetsInfoItem.AIIStorageId = entity.AIIStorageId; | |||
// Ass_AssetsInfoItem.AIIStoragePosition = entity.AIIStoragePosition; | |||
// Ass_AssetsInfoItem.AIIsInStorage = true; | |||
// Ass_AssetsInfoItem.AISpecification = entity.ASpecification; | |||
// Ass_AssetsInfoItem.AIUse = entity.AUse; | |||
// db.Insert(Ass_AssetsInfoItem); | |||
// } | |||
// } | |||
// else | |||
// { | |||
// var Ass_AssetsInfoItem = new Ass_AssetsInfoItemEntity(); | |||
// Ass_AssetsInfoItem.Create(); | |||
// Ass_AssetsInfoItem.AId = entity.AId; | |||
// Ass_AssetsInfoItem.AICodeNum = 1; | |||
// Ass_AssetsInfoItem.AICode = entity.ACode + "_" + Ass_AssetsInfoItem.AICodeNum; | |||
// Ass_AssetsInfoItem.AIIStorageId = entity.AIIStorageId; | |||
// Ass_AssetsInfoItem.AIIStoragePosition = entity.AIIStoragePosition; | |||
// Ass_AssetsInfoItem.AIIsInStorage = false; | |||
// Ass_AssetsInfoItem.AISpecification = entity.ASpecification; | |||
// Ass_AssetsInfoItem.AIUse = entity.AUse; | |||
// db.Insert(Ass_AssetsInfoItem); | |||
// } | |||
//} | |||
//else | |||
//{ | |||
// var Ass_AssetsInfoItem = new Ass_AssetsInfoItemEntity(); | |||
// Ass_AssetsInfoItem.Create(); | |||
// Ass_AssetsInfoItem.AId = entity.AId; | |||
// Ass_AssetsInfoItem.AICodeNum = 1; | |||
// Ass_AssetsInfoItem.AICode = entity.ACode + "_" + Ass_AssetsInfoItem.AICodeNum; | |||
// Ass_AssetsInfoItem.AIIStorageId = entity.AIIStorageId; | |||
// Ass_AssetsInfoItem.AIIStoragePosition = entity.AIIStoragePosition; | |||
// Ass_AssetsInfoItem.AIIsInStorage = entity.AStock > 0; | |||
// Ass_AssetsInfoItem.AISpecification = entity.ASpecification; | |||
// Ass_AssetsInfoItem.AIUse = entity.AUse; | |||
// db.Insert(Ass_AssetsInfoItem); | |||
//} | |||
var Ass_AssetsInfoItemList = db.FindList<Ass_AssetsInfoItemEntity>(m => m.AId == keyValue); | |||
foreach (var Ass_AssetsInfoItem in Ass_AssetsInfoItemList) | |||
{ | |||
db.Delete<Ass_AssetsChangeItemEntity>(m => m.AIId == Ass_AssetsInfoItem.AId); | |||
db.Delete(Ass_AssetsInfoItem); | |||
} | |||
//新增明细 | |||
if (entity.HasDetail == true) | |||
{ | |||
if (entity.AStock > 0) | |||
{ | |||
for (int i = 0; i < entity.AStock; i++) | |||
{ | |||
var Ass_AssetsInfoItem = new Ass_AssetsInfoItemEntity(); | |||
Ass_AssetsInfoItem.Create(); | |||
Ass_AssetsInfoItem.AId = entity.AId; | |||
Ass_AssetsInfoItem.AICodeNum = i + 1; | |||
Ass_AssetsInfoItem.AICode = entity.ACode + "_" + Ass_AssetsInfoItem.AICodeNum; | |||
Ass_AssetsInfoItem.AIIStorageId = entity.AIIStorageId; | |||
Ass_AssetsInfoItem.AIIStoragePosition = entity.AIIStoragePosition; | |||
Ass_AssetsInfoItem.AIIsInStorage = true; | |||
Ass_AssetsInfoItem.AISpecification = entity.ASpecification; | |||
Ass_AssetsInfoItem.AIUse = entity.AUse; | |||
db.Insert(Ass_AssetsInfoItem); | |||
} | |||
} | |||
else | |||
{ | |||
var Ass_AssetsInfoItem = new Ass_AssetsInfoItemEntity(); | |||
Ass_AssetsInfoItem.Create(); | |||
Ass_AssetsInfoItem.AId = entity.AId; | |||
Ass_AssetsInfoItem.AICodeNum = 1; | |||
Ass_AssetsInfoItem.AICode = entity.ACode + "_" + Ass_AssetsInfoItem.AICodeNum; | |||
Ass_AssetsInfoItem.AIIStorageId = entity.AIIStorageId; | |||
Ass_AssetsInfoItem.AIIStoragePosition = entity.AIIStoragePosition; | |||
Ass_AssetsInfoItem.AIIsInStorage = false; | |||
Ass_AssetsInfoItem.AISpecification = entity.ASpecification; | |||
Ass_AssetsInfoItem.AIUse = entity.AUse; | |||
db.Insert(Ass_AssetsInfoItem); | |||
} | |||
} | |||
else | |||
{ | |||
var Ass_AssetsInfoItem = new Ass_AssetsInfoItemEntity(); | |||
Ass_AssetsInfoItem.Create(); | |||
Ass_AssetsInfoItem.AId = entity.AId; | |||
Ass_AssetsInfoItem.AICodeNum = 1; | |||
Ass_AssetsInfoItem.AICode = entity.ACode + "_" + Ass_AssetsInfoItem.AICodeNum; | |||
Ass_AssetsInfoItem.AIIStorageId = entity.AIIStorageId; | |||
Ass_AssetsInfoItem.AIIStoragePosition = entity.AIIStoragePosition; | |||
Ass_AssetsInfoItem.AIIsInStorage = entity.AStock > 0; | |||
Ass_AssetsInfoItem.AISpecification = entity.ASpecification; | |||
Ass_AssetsInfoItem.AIUse = entity.AUse; | |||
db.Insert(Ass_AssetsInfoItem); | |||
} | |||
} | |||
else | |||
{ | |||
@@ -277,6 +277,10 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
//读入库申请记录 | |||
var assinfoapp = db.FindEntity<Ass_AssetsInfoApplyEntity>(m => m.AAProcessId == processId); | |||
var assPurchase = db.FindEntity<Ass_PurchaseEntity>(a => a.PId == assinfoapp.PId); | |||
//通知申请人 | |||
var purchaseApplyEntity = db.FindEntity<Ass_PurchaseApplyEntity>(a => a.PAId == assPurchase.PAId); | |||
purchaseApplyEntity.PIsInStorage = "已入库"; | |||
db.Update(purchaseApplyEntity); | |||
if (null != assPurchase) | |||
{ | |||
assPurchase.PStoregeStatus = 2; | |||
@@ -316,7 +320,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
insertassinfoitem.AICodeNumJY = assinfoitem.ACode + "_" + insertassinfoitem.AICodeNum.ToString(); | |||
insertassinfoitem.AIIStorageId = assitemapp.AAIStorageId; | |||
insertassinfoitem.AIASSName = assitemapp.AAIName; | |||
insertassinfoitem.AIIsScrap = false; | |||
insertassinfoitem.AIIStoragePosition = assitemapp.AAIStoragePosition; | |||
insertassinfoitem.AIIsInStorage = true; | |||
insertassinfoitem.AISpecification = assitemapp.AAISpecification; | |||
@@ -371,7 +374,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
if (insertassinfoitem.AIIsInStorage == false) | |||
{ | |||
insertassinfoitem.AIIsInStorage = true; | |||
insertassinfoitem.AIIsScrap = false; | |||
db.Update(insertassinfoitem); | |||
} | |||
} | |||
@@ -417,7 +419,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
insertassinfoitem.AICodeNumJY = insertAss_AssetsInfo.ACode + "_" + insertassinfoitem.AICodeNum.ToString(); | |||
insertassinfoitem.AIASSName = assitemapp.AAIName; | |||
insertassinfoitem.AIIStorageId = assitemapp.AAIStorageId; | |||
insertassinfoitem.AIIsScrap = false; | |||
insertassinfoitem.AIAssType = assinfoapp.AAAssType; | |||
insertassinfoitem.AIIStoragePosition = assitemapp.AAIStoragePosition; | |||
insertassinfoitem.AIIsInStorage = true; | |||
@@ -475,7 +476,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
insertassinfoitem.AICodeNumJY = insertAss_AssetsInfo.ACode + "_" + insertassinfoitem.AICodeNum.ToString(); | |||
insertassinfoitem.AIASSName = assitemapp.AAIName; | |||
insertassinfoitem.AIIStorageId = assitemapp.AAIStorageId; | |||
insertassinfoitem.AIIsScrap = false; | |||
insertassinfoitem.AIAssType = assinfoapp.AAAssType; | |||
insertassinfoitem.AIIStoragePosition = assitemapp.AAIStoragePosition; | |||
insertassinfoitem.AIIsInStorage = true; | |||
@@ -15,37 +15,37 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// AIId | |||
/// ID | |||
/// </summary> | |||
[Column("AIID")] | |||
public string AIId { get; set; } | |||
/// <summary> | |||
/// AId | |||
/// 资产ID | |||
/// </summary> | |||
[Column("AID")] | |||
public string AId { get; set; } | |||
/// <summary> | |||
/// AICodeNum | |||
/// 编号 | |||
/// </summary> | |||
[Column("AICODENUM")] | |||
public int? AICodeNum { get; set; } | |||
/// <summary> | |||
/// AICode | |||
/// 资产明细编号 | |||
/// </summary> | |||
[Column("AICODE")] | |||
public string AICode { get; set; } | |||
/// <summary> | |||
/// AIIStorageId | |||
/// 所在库房Id | |||
/// </summary> | |||
[Column("AIISTORAGEID")] | |||
public string AIIStorageId { get; set; } | |||
/// <summary> | |||
/// AIIStoragePosition | |||
/// 所在库位 | |||
/// </summary> | |||
[Column("AIISTORAGEPOSITION")] | |||
public string AIIStoragePosition { get; set; } | |||
/// <summary> | |||
/// AIIsInStorage | |||
/// 是否在库 | |||
/// </summary> | |||
[Column("AIISINSTORAGE")] | |||
public bool? AIIsInStorage { get; set; } | |||
@@ -100,7 +100,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
[Column("AIASSCLASS")] | |||
public string AIASSClass { get; set; } | |||
/// <summary> | |||
/// 资产状态 | |||
/// 资产状态 0 正常使用 2 报废 | |||
/// </summary> | |||
[Column("AIASSSTATE")] | |||
public int? AIASSState { get; set; } | |||
@@ -209,11 +209,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// </summary> | |||
[Column("AIUSE")] | |||
public string AIUse { get; set; } | |||
/// <summary> | |||
/// 是否报废 | |||
/// </summary> | |||
[Column("AIISSCRAP")] | |||
public bool? AIIsScrap { get; set; } | |||
/// <summary> | |||
/// 资产类别 | |||
@@ -376,7 +376,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
t.AContent | |||
"); | |||
strSql.Append(" FROM Ass_AssetsInfoItem a LEFT JOIN dbo.Ass_AssetsInfo t ON a.AId=t.AId "); | |||
strSql.Append(" WHERE a.AIIsScrap<>2 "); | |||
strSql.Append(" WHERE a.AIASSState <> 2 or t.AIASSState is null "); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!aiid.IsEmpty()) | |||
@@ -39,6 +39,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
t.PActualPrice, | |||
t.PStatus, | |||
t.PStoregeStatus, | |||
t.POpinion, | |||
a.PACode | |||
"); | |||
strSql.Append(" FROM Ass_Purchase t join Ass_PurchaseApply a on t.PAId=a.PAId"); | |||
@@ -245,11 +245,11 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// </summary> | |||
/// <param name="pastatus">审核状态</param> | |||
/// <param name="processId">流程Id</param> | |||
public void ModifyPAStatusByProcessId(int pastatus, string processId) | |||
public void ModifyPAStatusByProcessId(int pastatus, string processId,string des) | |||
{ | |||
try | |||
{ | |||
ass_PurchaseApplyService.ModifyPAStatusByProcessId(pastatus, processId); | |||
ass_PurchaseApplyService.ModifyPAStatusByProcessId(pastatus, processId, des); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -79,6 +79,17 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// </summary> | |||
[Column("PASSTYPE")] | |||
public int? PAssType { get; set; } | |||
/// <summary> | |||
/// 审批意见 | |||
/// </summary> | |||
[Column("POPINION")] | |||
public string POpinion { get; set; } | |||
/// <summary> | |||
/// 是否入库 | |||
/// </summary> | |||
[Column("PISINSTORAGE")] | |||
public string PIsInStorage { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
@@ -81,7 +81,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// </summary> | |||
/// <param name="pastatus">审核状态</param> | |||
/// <param name="processId">流程Id</param> | |||
void ModifyPAStatusByProcessId(int pastatus, string processId); | |||
void ModifyPAStatusByProcessId(int pastatus, string processId,string des); | |||
#endregion | |||
@@ -321,7 +321,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// </summary> | |||
/// <param name="pastatus">审核状态</param> | |||
/// <param name="processId">流程Id</param> | |||
public void ModifyPAStatusByProcessId(int pastatus, string processId) | |||
public void ModifyPAStatusByProcessId(int pastatus, string processId,string des) | |||
{ | |||
var db = this.BaseRepository().BeginTrans(); | |||
try | |||
@@ -354,10 +354,11 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
} | |||
//更新采购申请表的审核状态 | |||
var strsql = new StringBuilder(); | |||
strsql.Append("update Ass_PurchaseApply set PAStatus=@PAStatus where PAProcessId=@PAProcessId"); | |||
strsql.Append("update Ass_PurchaseApply set PAStatus=@PAStatus,POpinion=@POpinion where PAProcessId=@PAProcessId"); | |||
var dp = new DynamicParameters(); | |||
dp.Add("PAStatus", pastatus, DbType.Int32); | |||
dp.Add("PAProcessId", processId, DbType.String); | |||
dp.Add("POpinion", des, DbType.String); | |||
this.BaseRepository("BaseDb").ExecuteBySql(strsql.ToString(), dp); | |||
db.Commit(); | |||
@@ -1,10 +1,18 @@ | |||
using Dapper; | |||
using Learun.Application.Organization; | |||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using Microsoft.AspNet.SignalR.Client; | |||
using Newtonsoft.Json; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Configuration; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using System.Web; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
@@ -174,6 +182,38 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").ExecuteBySql("update EADateArrange set CheckMark=" + checkMark + " where dm='" + keyValue + "'"); | |||
if (checkMark == 1)//审核 | |||
{ | |||
var entity = this.BaseRepository("CollegeMIS").FindEntity<EADateArrangeEntity>(keyValue); | |||
if (entity != null) | |||
{ | |||
//读取信息推送管理-教学工作安排推送(08)的配置 | |||
var informationPushEntity = this.BaseRepository().FindEntity<Sys_InformationPushEntity>(x => x.PushItem == "08"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
var needpostuserlist = this.BaseRepository().FindList<UserEntity>(m => m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师").ToList(); | |||
//微信推送 | |||
try | |||
{ | |||
PushWeixin(needpostuserlist, entity.WorkName); | |||
} | |||
catch (Exception e) | |||
{ | |||
} | |||
//飞星推送 | |||
Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", LoginUserInfo.Get().userId, entity.WorkName, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.WorkName)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.WorkName)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.WorkName)).Substring(0, 20), "eadatearrange", string.Join(",", needpostuserlist.Select(m => m.F_UserId)), ""); | |||
} | |||
}); | |||
} | |||
} | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -269,7 +309,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
//成绩录入前初始化数据 | |||
//必修课 | |||
if (string.IsNullOrEmpty(entity.LessonSortNo) ||entity.LessonSortNo=="1") | |||
if (string.IsNullOrEmpty(entity.LessonSortNo) || entity.LessonSortNo == "1") | |||
{ | |||
//dyy:20190429 | |||
string sql = @"insert into stuscore(NoticeBookNo,StuNo,DeptNo,MajorNo,ClassNo,StuName,GenderNo,AcademicYearNo,Semester,OpenLessonDeptNo,OpenLessonMajorNo,LessonNo,LessonName,LessonNameEn,TeachClassNo,LessonSortNo,StuSortNo,Grade,StudyScore,TotalStudyHour,OrdinaryScore,TermInScore,TermEndScore,OtherScore,IsInEffect,Remark,ConflictLessonNo,IsPitchOn,CheckMark,TechPlanNo,EmpNo,PartCode,ScoreRecordStyleNo,TestModeNo,zysx,TestKindNo,IsEditable,F_SchoolId) | |||
@@ -283,7 +323,7 @@ where s.CheckMark='1' | |||
) as sl | |||
where StuNo not in(Select StuNo from stuscore s where s.Academicyearno=sl.Academicyearno | |||
and s.Semester=sl.Semester and s.lessonno=sl.lessonno and s.teachclassno=sl.teachclassno and s.LessonSortNo='1' | |||
and s.Academicyearno='"+entity.AcademicYearNo+ "' and s.Semester='"+entity.Semester+ "') and sl.AcademicYearNo='"+entity.AcademicYearNo+ "' and sl.Semester='"+entity.Semester+"'"; | |||
and s.Academicyearno='" + entity.AcademicYearNo + "' and s.Semester='" + entity.Semester + "') and sl.AcademicYearNo='" + entity.AcademicYearNo + "' and sl.Semester='" + entity.Semester + "'"; | |||
BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||
//dyy:20190722 | |||
//初始化教师成绩单提交表 | |||
@@ -299,7 +339,7 @@ where s.lessonsortno='1' | |||
) as bb | |||
where bb.EmpNo not in | |||
(select a.EmpNo from EmpReportCard a where a.AcademicYearNo=bb.AcademicYearNo and a.Semester=bb.Semester and a.LessonNo=bb.LessonNo and a.ClassNo=bb.ClassNo and a.LessonSortNo=bb.LessonSortNo and a.LessonSortNo='1' | |||
and a.Academicyearno='" + entity.AcademicYearNo + "' and a.Semester='" + entity.Semester+ "') and bb.AcademicYearNo='" + entity.AcademicYearNo + "' and bb.Semester='" + entity.Semester + "' order by bb.EmpNo"; | |||
and a.Academicyearno='" + entity.AcademicYearNo + "' and a.Semester='" + entity.Semester + "') and bb.AcademicYearNo='" + entity.AcademicYearNo + "' and bb.Semester='" + entity.Semester + "' order by bb.EmpNo"; | |||
BaseRepository("CollegeMIS").ExecuteBySql(sql3); | |||
} | |||
//选修课 | |||
@@ -350,5 +390,50 @@ and a.Academicyearno='" + entity.AcademicYearNo + "' and a.Semester='" + entity. | |||
} | |||
} | |||
} | |||
public void PushWeixin(List<UserEntity> needpostuserlist, string title) | |||
{ | |||
var WeChatConfigentity = BaseRepository().FindEntity<WeChatConfigEntity>(m => m.IsEnable == true); | |||
string appid = WeChatConfigentity.APPId; | |||
string secret = WeChatConfigentity.secret; | |||
var wechatemplete = BaseRepository() | |||
.FindEntity<WeChatTemplateEntity>(m => m.WeID == WeChatConfigentity.ID && m.TCode == "task"); | |||
string weixintaskurl = wechatemplete.TUrl; | |||
string weixintasktempid = wechatemplete.TempId; | |||
var responsejson = Util.HttpMethods.HttpGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret); | |||
foreach (UserEntity userinfo in needpostuserlist) | |||
{ | |||
if (userinfo != null && !string.IsNullOrEmpty(userinfo.OpenIdForWeixin)) | |||
{ | |||
//执行推送任务 | |||
if (!string.IsNullOrEmpty(appid) && !string.IsNullOrEmpty(secret) && !string.IsNullOrEmpty(weixintaskurl) && !string.IsNullOrEmpty(weixintasktempid)) | |||
{ | |||
if (!string.IsNullOrEmpty(responsejson)) | |||
{ | |||
var weixintokenobj = JsonConvert.DeserializeObject<dynamic>(responsejson); | |||
if (string.IsNullOrEmpty(weixintokenobj.errcode)) | |||
{ | |||
string access_token = weixintokenobj.access_token; | |||
string jsondata = "{\"touser\":\"" + userinfo.OpenIdForWeixin + "\"," + | |||
"\"template_id\":\"" + weixintasktempid + "\"," + | |||
"\"url\":\"" + weixintaskurl + "\"," + | |||
"\"data\":{" + | |||
"\"first\": {\"value\":\"您有新的教学工作安排\",\"color\":\"#173177\"}," + | |||
"\"keyword1\":{\"value\":\"教学工作安排\",\"color\":\"#173177\"}," + | |||
"\"keyword2\": {\"value\":\"" + title + "\",\"color\":\"#173177\"}," + | |||
"\"keyword3\": {\"value\":\"待查看\",\"color\":\"#173177\"}," + | |||
"\"keyword4\": {\"value\":\"您有新的教学工作安排需要查看【" + title + "】\",\"color\":\"#173177\"}" + | |||
"}" + | |||
"}"; | |||
string pushresult = Util.HttpMethods.HttpPost("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token, jsondata); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,174 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-19 14:39 | |||
/// 描 述:多账号绑定 | |||
/// </summary> | |||
public class LoginUserBindBLL : LoginUserBindIBLL | |||
{ | |||
private LoginUserBindService loginUserBindService = new LoginUserBindService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表分页数据 | |||
/// <summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<LoginUserBindEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return loginUserBindService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// <summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<LoginUserBindEntity> GetList(string queryJson) | |||
{ | |||
try | |||
{ | |||
return loginUserBindService.GetList(queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取LoginUserBind表实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public LoginUserBindEntity GetLoginUserBindEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return loginUserBindService.GetLoginUserBindEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取实体 | |||
/// </summary> | |||
/// <param name="bindUserAccount">绑定账号</param> | |||
/// <param name="userId">登录用户</param> | |||
/// <returns></returns> | |||
public LoginUserBindEntity GetEntityByBindUserAccount(string bindUserAccount, string userId) | |||
{ | |||
try | |||
{ | |||
return loginUserBindService.GetEntityByBindUserAccount(bindUserAccount, userId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
loginUserBindService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public void SaveEntity(UserInfo userInfo, string keyValue, LoginUserBindEntity entity) | |||
{ | |||
try | |||
{ | |||
loginUserBindService.SaveEntity(userInfo, keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,78 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-19 14:39 | |||
/// 描 述:多账号绑定 | |||
/// </summary> | |||
public class LoginUserBindEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// Id | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 绑定用户Id | |||
/// </summary> | |||
[Column("BINDUSERID")] | |||
public string BindUserId { get; set; } | |||
/// <summary> | |||
/// 绑定用户账号 | |||
/// </summary> | |||
[Column("BINDUSERACCOUNT")] | |||
public string BindUserAccount { get; set; } | |||
/// <summary> | |||
/// 绑定用户密码 | |||
/// </summary> | |||
[Column("BINDUSERPASSWORD")] | |||
public string BindUserPassword { get; set; } | |||
/// <summary> | |||
/// 创建用户Id | |||
/// </summary> | |||
[Column("CREATEUSERID")] | |||
public string CreateUserId { get; set; } | |||
/// <summary> | |||
/// 创建用户名称 | |||
/// </summary> | |||
[Column("CREATEUSERNAME")] | |||
public string CreateUserName { get; set; } | |||
/// <summary> | |||
/// 创建时间 | |||
/// </summary> | |||
[Column("CREATETIME")] | |||
public DateTime? CreateTime { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create(UserInfo userInfo) | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue, UserInfo userInfo) | |||
{ | |||
this.Id = keyValue; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
[NotMapped] | |||
public string BindUserPasswordTemp { get; set; } | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,64 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-19 14:39 | |||
/// 描 述:多账号绑定 | |||
/// </summary> | |||
public interface LoginUserBindIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表分页数据 | |||
/// <summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<LoginUserBindEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// <summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<LoginUserBindEntity> GetList(string queryJson); | |||
/// <summary> | |||
/// 获取LoginUserBind表实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
LoginUserBindEntity GetLoginUserBindEntity(string keyValue); | |||
/// <summary> | |||
/// 获取实体 | |||
/// </summary> | |||
/// <param name="bindUserAccount">绑定账号</param> | |||
/// <param name="userId">登录用户</param> | |||
/// <returns></returns> | |||
LoginUserBindEntity GetEntityByBindUserAccount(string bindUserAccount, string userId); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
void SaveEntity(UserInfo userInfo, string keyValue, LoginUserBindEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,218 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-19 14:39 | |||
/// 描 述:多账号绑定 | |||
/// </summary> | |||
public class LoginUserBindService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表分页数据 | |||
/// <summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<LoginUserBindEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT t.* "); | |||
strSql.Append(" FROM LoginUserBind t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["BindUserAccount"].IsEmpty()) | |||
{ | |||
dp.Add("BindUserAccount", "%" + queryParam["BindUserAccount"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.BindUserAccount Like @BindUserAccount "); | |||
} | |||
if (!queryParam["CreateUserId"].IsEmpty()) | |||
{ | |||
dp.Add("CreateUserId", queryParam["CreateUserId"].ToString(), DbType.String); | |||
strSql.Append(" AND t.CreateUserId = @CreateUserId "); | |||
} | |||
return this.BaseRepository().FindList<LoginUserBindEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// <summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<LoginUserBindEntity> GetList(string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.Id, | |||
t.BindUserAccount, | |||
t.BindUserPassword | |||
"); | |||
strSql.Append(" FROM LoginUserBind t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["BindUserAccount"].IsEmpty()) | |||
{ | |||
dp.Add("BindUserAccount", "%" + queryParam["BindUserAccount"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.BindUserAccount Like @BindUserAccount "); | |||
} | |||
return this.BaseRepository().FindList<LoginUserBindEntity>(strSql.ToString(), dp); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取LoginUserBind表实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public LoginUserBindEntity GetLoginUserBindEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository().FindEntity<LoginUserBindEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取实体 | |||
/// </summary> | |||
/// <param name="bindUserAccount">绑定账号</param> | |||
/// <param name="userId">登录用户</param> | |||
/// <returns></returns> | |||
public LoginUserBindEntity GetEntityByBindUserAccount(string bindUserAccount, string userId) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository().FindEntity<LoginUserBindEntity>(x => x.BindUserAccount == bindUserAccount && x.CreateUserId == userId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository().Delete<LoginUserBindEntity>(t => t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public void SaveEntity(UserInfo userInfo, string keyValue, LoginUserBindEntity entity) | |||
{ | |||
try | |||
{ | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue, userInfo); | |||
this.BaseRepository().Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(userInfo); | |||
this.BaseRepository().Insert(entity); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -233,24 +233,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
this.BaseRepository().Insert(receiveMessageEntity); | |||
} | |||
this.BaseRepository().Commit(); | |||
//微信推送 | |||
try | |||
//读取信息推送管理-内部邮件推送(03)的配置 | |||
var informationPushEntity = this.BaseRepository().FindEntity<Sys_InformationPushEntity>(x => x.PushItem == "03"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
PushWeixin(userInfos, messageentity.TITLE); | |||
} | |||
catch (Exception e) | |||
{ | |||
} | |||
//飞星推送 | |||
Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
//微信推送 | |||
try | |||
{ | |||
PushWeixin(userInfos, messageentity.TITLE); | |||
} | |||
catch (Exception e) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", messageentity.MESSAGEID, messageentity.TITLE, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(messageentity.CONTENTS)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(messageentity.CONTENTS)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(messageentity.CONTENTS)).Substring(0, 20), "mail", string.Join(",", userInfos.Select(m => m.F_UserId)), ""); | |||
} | |||
}); | |||
//飞星推送 | |||
Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", messageentity.MESSAGEID, messageentity.TITLE, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(messageentity.CONTENTS)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(messageentity.CONTENTS)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(messageentity.CONTENTS)).Substring(0, 20), "mail", string.Join(",", userInfos.Select(m => m.F_UserId)), ""); | |||
} | |||
}); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -0,0 +1,149 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-20 14:53 | |||
/// 描 述:信息推送管理 | |||
/// </summary> | |||
public class Sys_InformationPushBLL : Sys_InformationPushIBLL | |||
{ | |||
private Sys_InformationPushService sys_InformationPushService = new Sys_InformationPushService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Sys_InformationPushEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return sys_InformationPushService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Sys_InformationPush表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Sys_InformationPushEntity GetSys_InformationPushEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return sys_InformationPushService.GetSys_InformationPushEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Sys_InformationPush表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Sys_InformationPushEntity GetEntityByPushItem(string pushItem) | |||
{ | |||
try | |||
{ | |||
return sys_InformationPushService.GetEntityByPushItem(pushItem); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
sys_InformationPushService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, Sys_InformationPushEntity entity) | |||
{ | |||
try | |||
{ | |||
sys_InformationPushService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,85 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-20 14:53 | |||
/// 描 述:信息推送管理 | |||
/// </summary> | |||
public class Sys_InformationPushEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// Id | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 推送项目 | |||
/// </summary> | |||
[Column("PUSHITEM")] | |||
public string PushItem { get; set; } | |||
/// <summary> | |||
/// 开关状态 | |||
/// </summary> | |||
[Column("STATUS")] | |||
public bool? Status { get; set; } | |||
/// <summary> | |||
/// 创建用户 | |||
/// </summary> | |||
[Column("CREATEUSERID")] | |||
public string CreateUserId { get; set; } | |||
/// <summary> | |||
/// 创建用户名称 | |||
/// </summary> | |||
[Column("CREATEUSERNAME")] | |||
public string CreateUserName { get; set; } | |||
/// <summary> | |||
/// 创建时间 | |||
/// </summary> | |||
[Column("CREATETIME")] | |||
public DateTime? CreateTime { get; set; } | |||
/// <summary> | |||
/// 编辑用户 | |||
/// </summary> | |||
[Column("MODIFYUSERID")] | |||
public string ModifyUserId { get; set; } | |||
/// <summary> | |||
/// 编辑用户名称 | |||
/// </summary> | |||
[Column("MODIFYUSERNAME")] | |||
public string ModifyUserName { get; set; } | |||
/// <summary> | |||
/// 编辑时间 | |||
/// </summary> | |||
[Column("MODIFYTIME")] | |||
public DateTime? ModifyTime { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.Id = keyValue; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,55 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-20 14:53 | |||
/// 描 述:信息推送管理 | |||
/// </summary> | |||
public interface Sys_InformationPushIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<Sys_InformationPushEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取Sys_InformationPush表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
Sys_InformationPushEntity GetSys_InformationPushEntity(string keyValue); | |||
/// <summary> | |||
/// 获取Sys_InformationPush表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
Sys_InformationPushEntity GetEntityByPushItem(string pushItem); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, Sys_InformationPushEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,170 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-20 14:53 | |||
/// 描 述:信息推送管理 | |||
/// </summary> | |||
public class Sys_InformationPushService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Sys_InformationPushEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.Id, | |||
t.PushItem, | |||
t.Status | |||
"); | |||
strSql.Append(" FROM Sys_InformationPush t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
return this.BaseRepository().FindList<Sys_InformationPushEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Sys_InformationPush表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Sys_InformationPushEntity GetSys_InformationPushEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository().FindEntity<Sys_InformationPushEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Sys_InformationPush表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Sys_InformationPushEntity GetEntityByPushItem(string pushItem) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository().FindEntity<Sys_InformationPushEntity>(x => x.PushItem == pushItem); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository().Delete<Sys_InformationPushEntity>(t => t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, Sys_InformationPushEntity entity) | |||
{ | |||
try | |||
{ | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
this.BaseRepository().Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
this.BaseRepository().Insert(entity); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -412,24 +412,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
Sys_SendFile.ReceiverId = stringBuilder.ToString().TrimEnd(','); | |||
db.Update(Sys_SendFile); | |||
db.Commit(); | |||
//微信推送 | |||
try | |||
//读取信息推送管理-公文下发推送(02)的配置 | |||
var informationPushEntity = this.BaseRepository().FindEntity<Sys_InformationPushEntity>(x => x.PushItem == "02"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
PushWeixin(teacherlist, Sys_SendFile.Title); | |||
} | |||
catch (Exception e) | |||
{ | |||
} | |||
//飞星推送 | |||
Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
//微信推送 | |||
try | |||
{ | |||
PushWeixin(teacherlist, Sys_SendFile.Title); | |||
} | |||
catch (Exception e) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", Sys_SendFile.SenderId, Sys_SendFile.Title, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)).Substring(0, 20), "sendfile", string.Join(",", teacherlist.Select(m => m.F_UserId)), ""); | |||
} | |||
}); | |||
//飞星推送 | |||
Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", Sys_SendFile.SenderId, Sys_SendFile.Title, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)).Substring(0, 20), "sendfile", string.Join(",", teacherlist.Select(m => m.F_UserId)), ""); | |||
} | |||
}); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -507,24 +513,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
Sys_ReceiveDocument.ReceiverId = stringBuilder.ToString().TrimEnd(','); | |||
db.Update(Sys_ReceiveDocument); | |||
db.Commit(); | |||
//微信推送 | |||
try | |||
//读取信息推送管理-公文下发推送(02)的配置 | |||
var informationPushEntity = this.BaseRepository().FindEntity<Sys_InformationPushEntity>(x => x.PushItem == "02"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
PushWeixin(teacherlist, Sys_ReceiveDocument.RTitle); | |||
} | |||
catch (Exception e) | |||
{ | |||
} | |||
//飞星推送 | |||
Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
//微信推送 | |||
try | |||
{ | |||
PushWeixin(teacherlist, Sys_ReceiveDocument.RTitle); | |||
} | |||
catch (Exception e) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", Sys_ReceiveDocument.SenderId, Sys_ReceiveDocument.RTitle, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_ReceiveDocument.RContent)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_ReceiveDocument.RContent)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_ReceiveDocument.RContent)).Substring(0, 20), "sendfile", string.Join(",", teacherlist.Select(m => m.F_UserId)), ""); | |||
} | |||
}); | |||
//飞星推送 | |||
Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", Sys_ReceiveDocument.SenderId, Sys_ReceiveDocument.RTitle, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_ReceiveDocument.RContent)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_ReceiveDocument.RContent)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_ReceiveDocument.RContent)).Substring(0, 20), "sendfile", string.Join(",", teacherlist.Select(m => m.F_UserId)), ""); | |||
} | |||
}); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -362,24 +362,30 @@ on a.F_UserId=b.F_UserId where b.F_ObjectId in(" + string.Join(",", ppostid) + | |||
Sys_SendFile.SendTime = DateTime.Now; | |||
db.Update(Sys_SendFile); | |||
db.Commit(); | |||
//微信推送 | |||
try | |||
//读取信息推送管理-公文下发推送(02)的配置 | |||
var informationPushEntity = this.BaseRepository().FindEntity<Sys_InformationPushEntity>(x => x.PushItem == "02"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
PushWeixin(needpostuserlist, Sys_SendFile.Title); | |||
} | |||
catch (Exception e) | |||
{ | |||
} | |||
//飞星推送 | |||
Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
//微信推送 | |||
try | |||
{ | |||
PushWeixin(needpostuserlist, Sys_SendFile.Title); | |||
} | |||
catch (Exception e) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", Sys_SendFile.SenderId, Sys_SendFile.Title, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)).Substring(0, 20), "sendfile", string.Join(",", needpostuserlist.Select(m => m.F_UserId)), ""); | |||
} | |||
}); | |||
//飞星推送 | |||
Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", Sys_SendFile.SenderId, Sys_SendFile.Title, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)).Substring(0, 20), "sendfile", string.Join(",", needpostuserlist.Select(m => m.F_UserId)), ""); | |||
} | |||
}); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -403,12 +403,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
LogEntity logEntity = new LogEntity(); | |||
logEntity.F_LogId = Guid.NewGuid().ToString(); | |||
logEntity.F_Module = "Thermography"; | |||
logEntity.F_ExecuteResultJson = "Thermography Status="+entity.Status; | |||
logEntity.F_ExecuteResultJson = "Thermography Status=" + entity.Status; | |||
logEntity.WriteLog(); | |||
//体温异常 | |||
if (entity.Status == "2") | |||
{ | |||
//微信推送 | |||
try | |||
{ | |||
var stuModel = this.BaseRepository("CollegeMIS").FindEntity<StuInfoBasicEntity>(x => x.StuNo == entity.PersonBeingMeasured); | |||
@@ -420,7 +419,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
logEntity.F_ExecuteResultJson = "Thermography stuModelStuNo=" + stuModel.StuNo; | |||
logEntity.WriteLog(); | |||
var title = string.Format("{0}({1})", stuModel.StuName, stuModel.StuNo); | |||
PushWeixin(title); | |||
//读取信息推送管理-班级自诊打卡体温异常学生推送(05)的配置 | |||
var informationPushEntity = this.BaseRepository().FindEntity<Sys_InformationPushEntity>(x => x.PushItem == "05"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
//微信推送 | |||
PushWeixin(title); | |||
} | |||
} | |||
} | |||
catch (Exception e) | |||
@@ -532,14 +538,20 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
//体温异常 | |||
if (entity.Status == "2") | |||
{ | |||
//微信推送 | |||
try | |||
{ | |||
var stuModel = db.FindEntity<StuInfoBasicEntity>(x => x.StuNo == entity.PersonBeingMeasured); | |||
if (stuModel != null) | |||
{ | |||
var title = string.Format("{0}({1})", stuModel.StuName, stuModel.StuNo); | |||
PushWeixin(title); | |||
//读取信息推送管理-班级自诊打卡体温异常学生推送(05)的配置 | |||
var informationPushEntity = this.BaseRepository().FindEntity<Sys_InformationPushEntity>(x => x.PushItem == "05"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
//微信推送 | |||
PushWeixin(title); | |||
} | |||
} | |||
} | |||
catch (Exception e) | |||
@@ -75,7 +75,12 @@ namespace Learun.Application.TwoDevelopment.EvaluationTeach | |||
strSql.Append("left join Eval_Main b on a.AcademicYearNo=b.AcademicYearNo and a.Semester=b.Semester where b.Status=1 and a.StuNo='" + queryParam["StuNo"] + "') aa "); | |||
strSql.Append("left join (select distinct b.EmpNo, b.LessonNo, b.UID from Eval_Question a left join Eval_QuestionResult b on a.QID=b.QID) bb on aa.EmpNo=bb.EmpNo and aa.LessonNo=bb.LessonNo and aa.StuNo=bb.UID "); | |||
strSql.Append("left join " + misdbname + ".dbo.EmpInfo cc on aa.EmpNo=cc.EmpNo left join " + misdbname + ".dbo.LessonInfo dd on aa.LessonNo = dd.LessonNo "); | |||
return this.BaseRepository().FindList<Eval_QuestionResultEntity>(strSql.ToString(),pagination); | |||
if (pagination != null) | |||
{ | |||
return this.BaseRepository().FindList<Eval_QuestionResultEntity>(strSql.ToString(), pagination); | |||
} | |||
else | |||
return BaseRepository().FindList<Eval_QuestionResultEntity>(strSql.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||