浏览代码

公文下发

临城职教中职
ndbs 2 年前
父节点
当前提交
7190ab39ea
共有 5 个文件被更改,包括 104 次插入63 次删除
  1. +6
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlowView.cshtml
  2. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlowView.js
  3. +12
    -6
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/Index.js
  4. +4
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config
  5. +77
    -50
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsService.cs

+ 6
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlowView.cshtml 查看文件

@@ -4,9 +4,13 @@
}

<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item" data-table="OANews">
<div class="col-xs-6 lr-form-item" data-table="OANews">
<div class="lr-form-item-title">公告标题<font face="宋体">*</font></div>
<input id="F_FullHead" readonly="readonly" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" placeholder="请输入标题" />
<input id="F_FullHead" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" placeholder="请输入标题" />
</div>
<div class="col-xs-6 lr-form-item" data-table="OANews">
<div class="lr-form-item-title">下发CMS<font face="宋体">*</font></div>
<div id="IsSend" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="OANews">
<div class="lr-form-item-title">公告类别<font face="宋体">*</font></div>


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlowView.js 查看文件

@@ -28,6 +28,11 @@ var bootstrap = function ($, learun) {
page.initData();
},
bind: function () {
$('#IsSend').lrselect({
data: [{ text: "是", value: "1" }, { text: "否", value: "0" }],
text: "text",
value: "value"
});
//公告类别
$('#F_CategoryId').lrDataItemSelect({
code: 'NoticeCategory', maxHeight: 230, select: function (item) {


+ 12
- 6
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/Index.js 查看文件

@@ -176,22 +176,28 @@
success: function (res) {
if (res.code == 200) {
if (source == "noLogin") {
window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/SSOSystem/Index";
//window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/SSOSystem/Index";
window.location.href = "/SSOSystem/Index";
} else if (source == "NoLogin") {
window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/SSOSystem/DragModelOne";
window.location.href = "SSOSystem/DragModelOne";
//window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/SSOSystem/DragModelOne";
} else {
if (res.data.pwd == true) {
if (res.data.pwdtip == true) {
window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index?pwdpwdtip=true";
window.location.href = "/Home/Index?pwdpwdtip=true";
//window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index?pwdpwdtip=true";
} else {
window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index?pwd=true";
//window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index?pwd=true";
window.location.href = "/Home/Index?pwd=true";
}
}
else {
if (res.data.pwdtip == true) {
window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index?pwdtip=true";
window.location.href = "/Home/Index?pwdtip=true";
//window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index?pwdtip=true";
} else {
window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index";
window.location.href = "/Home/Index";
//window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index";
}
//window.location.href = "/Home/Index";
}


+ 4
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config 查看文件

@@ -169,11 +169,10 @@
<add key="ForbidLoginMinutes" value="10"/>

<!--下发新闻配置-->
<add key="SiteId" value="1"/>
<add key="ChannelId" value="6"/>
<add key="SiteId" value="39"/>
<add key="ChannelId" value="49"/>
<!--秘钥-->
<add key="ApiKey" value="fafc361a-40c1-4060-8eee-ea796640c39c"/>
<!--CMS部署端口-->
<add key="Ports" value="8007"/>

<!--CMS地址-->
<add key="Ports" value="192.168.50.127:8007"/>
</appSettings>

+ 77
- 50
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsService.cs 查看文件

@@ -9,6 +9,8 @@ using Spire.Pdf.General.Render.Decode.Jpeg2000.Icc;
using static Learun.Application.OA.NewsEntity;
using Nancy.Helpers;
using System.Configuration;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace Learun.Application.OA
{
@@ -183,69 +185,24 @@ namespace Learun.Application.OA
{
try
{

var newEntity = this.BaseRepository().FindEntity<NewsEntity>(a => a.F_ProgressId == parameterProcessId);
if (null != newEntity)
{
if (status == 2)
{
newEntity.F_Status = "2";
if (newEntity.IsSend == "1") //判断是否下发
{
#region 获取配置文件

string siteId = HttpUtility.UrlEncode(ConfigurationManager.AppSettings["SiteId"]);
string channelId = HttpUtility.UrlEncode(ConfigurationManager.AppSettings["ChannelId"]);
string ApiKey = HttpUtility.UrlEncode(ConfigurationManager.AppSettings["ApiKey"]);
string ports = HttpUtility.UrlEncode(ConfigurationManager.AppSettings["Ports"]);

#endregion
SemdNewList SendNew = new SemdNewList
{
Title = newEntity.F_FullHead,
SubTitle = newEntity.F_BriefHead,
Content = newEntity.F_NewsContent,
Author = newEntity.F_AuthorName,
Source = newEntity.F_SourceName,
AddDate = DateTime.Now,
Tags = newEntity.F_TagWord,
AddUserName = newEntity.F_CreateUserName,
};
WebHeaderCollection ApiId = new WebHeaderCollection
{
{ "X-SS-API-KEY", ApiKey }
};

string responses = Util.HttpMethods.HttpPosts("http://localhost:" + ports + "/api/v1/contents/" + siteId + "/" + channelId, SendNew.ToJson(), ApiId);

#region 修改审核状态
JavaScriptSerializer Jss = new JavaScriptSerializer();
Dictionary<string, object> DicText = (Dictionary<string, object>)Jss.DeserializeObject(responses);
string Nid = DicText["id"].ToString();
AuditList AList = new AuditList();
if (Nid != null)
{
AList.siteId = siteId;
List<contents> listCon = new List<contents>();
//这里应该循环,如果多个
contents con = new contents();
con.channelId = Convert.ToInt32(channelId);
con.id = Convert.ToInt32(Nid);
listCon.Add(con);
AList.contents = listCon;
AList.reasons = "终审通过";
Util.HttpMethods.HttpPosts("http://localhost:" + ports + "/api/v1/contents/actions/check", AList.ToJson(), ApiId);
}
#endregion
}
}
else
{
newEntity.F_Status = "0";
}
}

this.BaseRepository().Update(newEntity);

if (newEntity.IsSend == "1" && status == 2)
{
Task.Run(async () => { sendNew(newEntity); });
}
}
catch (Exception ex)
{
@@ -259,5 +216,75 @@ namespace Learun.Application.OA
}
}
}

public void sendNew(NewsEntity newEntity)
{
try
{

if (newEntity.IsSend == "1") //判断是否下发
{
#region 获取配置文件

string siteId = ConfigurationManager.AppSettings["SiteId"];
string channelId = ConfigurationManager.AppSettings["ChannelId"];
string ApiKey = ConfigurationManager.AppSettings["ApiKey"];
string ports = ConfigurationManager.AppSettings["Ports"];

#endregion
SemdNewList SendNew = new SemdNewList
{
Title = newEntity.F_FullHead,
SubTitle = newEntity.F_BriefHead,
Content = newEntity.F_NewsContent,
Author = newEntity.F_AuthorName,
Source = newEntity.F_SourceName,
AddDate = DateTime.Now,
Tags = newEntity.F_TagWord,
AddUserName = newEntity.F_CreateUserName,
};
WebHeaderCollection ApiId = new WebHeaderCollection
{
{ "X-SS-API-KEY", ApiKey }
};

string responses = HttpMethods.HttpPosts("http://" + ports + "/api/v1/contents/" + siteId + "/" + channelId, SendNew.ToJson(), ApiId);

#region 修改审核状态
string Nid = JsonConvert.DeserializeObject<Root>(responses).value.id;
AuditList AList = new AuditList();
if (Nid != null)
{
AList.siteId = siteId;
List<contents> listCon = new List<contents>();
//这里应该循环,如果多个
contents con = new contents();
con.channelId = Convert.ToInt32(channelId);
con.id = Convert.ToInt32(Nid);
listCon.Add(con);
AList.contents = listCon;
//AList.reasons = "终审通过";
HttpMethods.HttpPosts("http://" + ports + "/api/v1/contents/check", AList.ToJson(), ApiId);
}
#endregion
}
}
catch (Exception ex)
{

}
}

}

public class Root
{
public RootValue value { get; set; }
}

public class RootValue
{
public string id { get; set; }
}
}

正在加载...
取消
保存