Merge branch 'workflow'

This commit is contained in:
yubaolee 2016-09-12 09:41:49 +08:00
commit e7aa36e83a
23 changed files with 111 additions and 42 deletions

View File

@ -53,6 +53,7 @@ function DialogList() {
var url = '/ModuleElementManager/LoadWithAccess?tId='; var url = '/ModuleElementManager/LoadWithAccess?tId=';
this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({ this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({
showToolbar: false, showToolbar: false,
loadType: 'GET',
filterThead: false, filterThead: false,
target: $(this), target: $(this),
columns: [ columns: [

View File

@ -56,6 +56,7 @@ function DialogList() {
var url = '/ResourceManager/LoadWithAccess?cId='; var url = '/ResourceManager/LoadWithAccess?cId=';
this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({ this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({
showToolbar: false, showToolbar: false,
loadType: 'GET',
filterThead: false, filterThead: false,
target: $(this), target: $(this),
columns: [ columns: [

View File

@ -17,6 +17,7 @@ function MainGrid() {
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块 var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
this.maingrid = $('#maingrid').datagrid({ this.maingrid = $('#maingrid').datagrid({
showToolbar: false, showToolbar: false,
loadType: 'GET',
filterThead: false, filterThead: false,
target: $(this), target: $(this),
columns: [ columns: [
@ -234,7 +235,7 @@ function del() {
var selected = list.getSelectedObj(); var selected = list.getSelectedObj();
if (selected == null) return; if (selected == null) return;
$.getJSON('/CategoryManager/Delete?Id=' + selected.Id, function (data) { $.post('/CategoryManager/Delete?Id=' + selected.Id, function (data) {
if (data.statusCode == "200") { if (data.statusCode == "200") {
list.reload(); list.reload();
ztree.reload(); ztree.reload();
@ -242,7 +243,7 @@ function del() {
else { else {
$(this).alertmsg('warn', data.message); $(this).alertmsg('warn', data.message);
} }
}); }, "json");
} }
//编辑 //编辑

View File

@ -27,6 +27,7 @@ function MainGrid() {
var selectedNode = 'me'; var selectedNode = 'me';
this.maingrid = $('#maingrid').datagrid({ this.maingrid = $('#maingrid').datagrid({
showToolbar: false, showToolbar: false,
loadType:'GET',
filterThead: false, filterThead: false,
target: $(this), target: $(this),
columns: [ columns: [
@ -115,14 +116,14 @@ function del() {
var selected = list.getSelectedObj(); var selected = list.getSelectedObj();
if (selected == null) return; if (selected == null) return;
$.getJSON('/CommonApplies/Delete?Id=' + selected.Id, function (data) { $.post('/CommonApplies/Delete?Id=' + selected.Id, function (data) {
if (data.statusCode == "200") { if (data.statusCode == "200") {
list.reload(); list.reload();
} }
else { else {
$(this).alertmsg('warn', data.message); $(this).alertmsg('warn', data.message);
} }
}); }, "json");
} }
//自定义的编辑按钮 //自定义的编辑按钮

View File

@ -19,6 +19,7 @@ function MainGrid() {
this.maingrid = $('#maingrid').datagrid({ this.maingrid = $('#maingrid').datagrid({
showToolbar: false, showToolbar: false,
filterThead: false, filterThead: false,
loadType: 'GET',
target: $(this), target: $(this),
columns: [ columns: [
{ {
@ -262,7 +263,7 @@ function del() {
var selected = list.getSelectedObj(); var selected = list.getSelectedObj();
if (selected == null) return; if (selected == null) return;
$.getJSON('/moduleManager/Delete?Id=' + selected.Id, function (data) { $.post('/moduleManager/Delete?Id=' + selected.Id, function (data) {
if (data.statusCode == "200") { if (data.statusCode == "200") {
list.reload(); list.reload();
ztree.reload(); ztree.reload();
@ -270,7 +271,7 @@ function del() {
else { else {
$(this).alertmsg('warn', data.message); $(this).alertmsg('warn', data.message);
} }
}); }, "json");
} }
//自定义的编辑按钮 //自定义的编辑按钮

View File

@ -48,6 +48,7 @@ function MainGrid() {
this.maingrid = $('#maingrid').datagrid({ this.maingrid = $('#maingrid').datagrid({
showToolbar: false, showToolbar: false,
filterThead: false, filterThead: false,
loadType: 'GET',
target: $(this), target: $(this),
columns: [ columns: [
{ {
@ -236,7 +237,7 @@ function del() {
var selected = list.getSelectedObj(); var selected = list.getSelectedObj();
if (selected == null) return; if (selected == null) return;
$.getJSON('/OrgManager/DelOrg?Id=' + selected.Id, function (data) { $.post('/OrgManager/DelOrg?Id=' + selected.Id, function (data) {
if (data.statusCode == "200") { if (data.statusCode == "200") {
list.reload(); list.reload();
ztree.reload(); ztree.reload();
@ -244,7 +245,7 @@ function del() {
else { else {
$(this).alertmsg('warn', data.message); $(this).alertmsg('warn', data.message);
} }
}); }, "json");
} }
//自定义的编辑按钮 //自定义的编辑按钮

View File

@ -38,8 +38,13 @@ $(function () {
.on("click", function () { //执行命令 .on("click", function () { //执行命令
$.post("/CommonApplies/ExeCmd?id=" +$("#processId").val() +"&cmd=" +$(this).val() , $.post("/CommonApplies/ExeCmd?id=" +$("#processId").val() +"&cmd=" +$(this).val() ,
function (data) { function (data) {
BJUI.dialog('refresh', 'detailDlg'); if (data.statusCode == "200") {
}); BJUI.dialog('refresh', 'detailDlg');
}
else {
$(this).alertmsg('warn', data.message);
}
},'json');
}); });
}); });

View File

@ -6,6 +6,7 @@ function MainGrid() {
this.maingrid = $('#maingrid').datagrid({ this.maingrid = $('#maingrid').datagrid({
showToolbar: false, showToolbar: false,
filterThead: false, filterThead: false,
loadType: 'GET',
target: $(this), target: $(this),
columns: [ columns: [
{ {
@ -219,7 +220,7 @@ function del() {
var selected = list.getSelectedObj(); var selected = list.getSelectedObj();
if (selected == null) return; if (selected == null) return;
$.getJSON('/ResourceManager/Delete?Id=' + selected.Id, function (data) { $.post('/ResourceManager/Delete?Id=' + selected.Id, function (data) {
if (data.statusCode == "200") { if (data.statusCode == "200") {
list.reload(); list.reload();
ztree.reload(); ztree.reload();
@ -227,7 +228,7 @@ function del() {
else { else {
$(this).alertmsg('warn', data.message); $(this).alertmsg('warn', data.message);
} }
}); }, "json");
} }
//自定义的编辑按钮 //自定义的编辑按钮

View File

@ -48,6 +48,7 @@ function MainGrid() {
this.maingrid = $('#maingrid').datagrid({ this.maingrid = $('#maingrid').datagrid({
showToolbar: false, showToolbar: false,
filterThead: false, filterThead: false,
loadType: 'GET',
target: $(this), target: $(this),
columns: [ columns: [
{ {
@ -217,7 +218,7 @@ function del() {
var selected = list.getSelectedObj(); var selected = list.getSelectedObj();
if (selected == null) return; if (selected == null) return;
$.getJSON('/RoleManager/Delete?Id=' + selected.Id, function (data) { $.post('/RoleManager/Delete?Id=' + selected.Id, function (data) {
if (data.statusCode == "200") { if (data.statusCode == "200") {
list.reload(); list.reload();
orgtree.reload(); orgtree.reload();
@ -225,7 +226,7 @@ function del() {
else { else {
$(this).alertmsg('warn', data.message); $(this).alertmsg('warn', data.message);
} }
}); }, "json");
} }
//自定义的编辑按钮 //自定义的编辑按钮

View File

@ -47,6 +47,7 @@ function MainGrid() {
this.maingrid = $('#maingrid').datagrid({ this.maingrid = $('#maingrid').datagrid({
showToolbar: false, showToolbar: false,
filterThead: false, filterThead: false,
loadType: 'GET',
target: $(this), target: $(this),
columns: [ columns: [
{ {
@ -231,7 +232,7 @@ function del() {
var selected = list.getSelectedObj(); var selected = list.getSelectedObj();
if (selected == null) return; if (selected == null) return;
$.getJSON('/StockManager/Delete?Id=' + selected.Id, function (data) { $.post('/StockManager/Delete?Id=' + selected.Id, function (data) {
if (data.statusCode == "200") { if (data.statusCode == "200") {
list.reload(); list.reload();
ztree.reload(); ztree.reload();
@ -239,7 +240,7 @@ function del() {
else { else {
$(this).alertmsg('warn', data.message); $(this).alertmsg('warn', data.message);
} }
}); }, "json");
} }
//自定义的编辑按钮 //自定义的编辑按钮

View File

@ -43,6 +43,7 @@ function UserRolesList() {
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块 var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({ this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({
showToolbar: false, showToolbar: false,
loadType: 'GET',
filterThead: false, filterThead: false,
target: $(this), target: $(this),
columns: [ columns: [

View File

@ -49,6 +49,7 @@ function MainGrid() {
showToolbar: false, showToolbar: false,
filterThead: false, filterThead: false,
target: $(this), target: $(this),
loadType: 'GET',
columns: [ columns: [
{ {
name: 'Id', name: 'Id',
@ -228,7 +229,7 @@ function del() {
var selected = list.getSelectedObj(); var selected = list.getSelectedObj();
if (selected == null) return; if (selected == null) return;
$.getJSON('/UserManager/Delete?Id=' + selected.Id, function (data) { $.post('/UserManager/Delete?Id=' + selected.Id, function (data) {
if (data.statusCode == "200") { if (data.statusCode == "200") {
list.reload(); list.reload();
maintree.reload(); maintree.reload();
@ -236,9 +237,11 @@ function del() {
else { else {
$(this).alertmsg('warn', data.message); $(this).alertmsg('warn', data.message);
} }
}); }, "json");
} }
//自定义的编辑按钮 //自定义的编辑按钮
function edit() { function edit() {
var selected = list.getSelectedObj(); var selected = list.getSelectedObj();

View File

@ -34,7 +34,7 @@ namespace OpenAuth.Mvc.Controllers
{ {
base.OnActionExecuting(filterContext); base.OnActionExecuting(filterContext);
if (!AuthUtil.CheckLogin()) return; if (!AuthUtil.CheckLogin()) return;
var controllername = Request.RequestContext.RouteData.Values["controller"].ToString().ToLower(); var controllername = Request.RequestContext.RouteData.Values["controller"].ToString().ToLower();
var actionname = filterContext.ActionDescriptor.ActionName.ToLower(); var actionname = filterContext.ActionDescriptor.ActionName.ToLower();
@ -57,13 +57,9 @@ namespace OpenAuth.Mvc.Controllers
} }
var version = ConfigurationManager.AppSettings["version"]; var version = ConfigurationManager.AppSettings["version"];
if (version == "demo") if (version == "demo" && Request.HttpMethod == "POST")
{ {
HttpPostAttribute hobbyAttr = (HttpPostAttribute)Attribute.GetCustomAttribute(function, typeof(HttpPostAttribute)); throw new HttpException(400, "演示版本,不能进行该操作,当前模块:" + controllername + "/" + actionname);
if (actionname.Contains("del") || hobbyAttr != null) //客户端提交数据
{
throw new HttpException(400, "演示版本,不能进行该操作,当前模块:" + controllername +"/" +actionname);
}
} }
} }

View File

@ -13,6 +13,10 @@ using ProcessStatus = OptimaJet.Workflow.Core.Persistence.ProcessStatus;
namespace OpenAuth.Mvc.Controllers namespace OpenAuth.Mvc.Controllers
{ {
/// <summary>
/// 通用申请流程处理
/// <para>李玉宝新增于2016-09-08 19:21:59</para>
/// </summary>
public class CommonAppliesController : BaseController public class CommonAppliesController : BaseController
{ {
private CommonApplyApp _app; private CommonApplyApp _app;

View File

@ -16,7 +16,7 @@ using WorkflowRuntime = OptimaJet.Workflow.Core.Runtime.WorkflowRuntime;
namespace OpenAuth.Mvc.Controllers namespace OpenAuth.Mvc.Controllers
{ {
public class DesignerController : Controller public class DesignerController : BaseController
{ {
public ActionResult Index(string schemeName) public ActionResult Index(string schemeName)
{ {

View File

@ -81,12 +81,14 @@ namespace OpenAuth.Mvc.Controllers
return JsonHelper.Instance.Serialize(_app.LoadForOrgAndUser(orgId, userId)); return JsonHelper.Instance.Serialize(_app.LoadForOrgAndUser(orgId, userId));
} }
[System.Web.Mvc.HttpPost]
public string AccessRoles(Guid userId, Guid[] ids) public string AccessRoles(Guid userId, Guid[] ids)
{ {
_app.AccessRole(userId, ids); _app.AccessRole(userId, ids);
return JsonHelper.Instance.Serialize(BjuiResponse); return JsonHelper.Instance.Serialize(BjuiResponse);
} }
[System.Web.Mvc.HttpPost]
public string DelAccessRoles(Guid userId, Guid[] ids) public string DelAccessRoles(Guid userId, Guid[] ids)
{ {
_app.DelAccessRole(userId, ids); _app.DelAccessRole(userId, ids);

View File

@ -1,6 +1,7 @@
using OpenAuth.Domain; using OpenAuth.Domain;
using OpenAuth.Domain.Interface; using OpenAuth.Domain.Interface;
using System; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace OpenAuth.Repository namespace OpenAuth.Repository
@ -35,20 +36,16 @@ namespace OpenAuth.Repository
/// <param name="idMaps">关联的&lt;firstId, secondId&gt;数组</param> /// <param name="idMaps">关联的&lt;firstId, secondId&gt;数组</param>
public void AddRelevance(string key, ILookup<Guid, Guid> idMaps) public void AddRelevance(string key, ILookup<Guid, Guid> idMaps)
{ {
foreach (var sameVals in idMaps) DeleteBy(key, idMaps);
{ BatchAdd((from sameVals in idMaps
foreach (var value in sameVals) from value in sameVals
select new Relevance
{ {
Add(new Relevance Key = key,
{ FirstId = sameVals.Key,
Key = key, SecondId = value,
FirstId = sameVals.Key, OperateTime = DateTime.Now
SecondId = value, }).ToArray());
OperateTime = DateTime.Now
});
}
}
Save();
} }
} }
} }

View File

@ -69,6 +69,14 @@
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MySql.Data.Entity.EF6, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.Entity.6.9.8\lib\net45\MySql.Data.Entity.EF6.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
@ -182,6 +190,7 @@
</Content> </Content>
<Content Include="Areas\SSO\Content\Site.css" /> <Content Include="Areas\SSO\Content\Site.css" />
<Content Include="Areas\SSO\Scripts\_references.js" /> <Content Include="Areas\SSO\Scripts\_references.js" />
<None Include="Properties\PublishProfiles\webapi.pubxml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj"> <ProjectReference Include="..\Infrastructure\Infrastructure.csproj">

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
您 Web 项目的发布/打包进程将使用此文件。您可以通过编辑此 MSBuild 文件
来自定义该进程的行为。若要了解与此相关的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkID=208121。
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>C:\Users\Administrator\Desktop\OpenAuth.WebApi</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
</PropertyGroup>
</Project>

View File

@ -91,6 +91,12 @@
</defaultConnectionFactory> </defaultConnectionFactory>
<providers> <providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers> <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
</provider></providers>
</entityFramework> </entityFramework>
</configuration> <system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data></configuration>

View File

@ -27,6 +27,8 @@
<package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net45" developmentDependency="true" /> <package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" /> <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Modernizr" version="2.6.2" targetFramework="net45" /> <package id="Modernizr" version="2.6.2" targetFramework="net45" />
<package id="MySql.Data" version="6.9.8" targetFramework="net45" />
<package id="MySql.Data.Entity" version="6.9.8" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="Respond" version="1.2.0" targetFramework="net45" /> <package id="Respond" version="1.2.0" targetFramework="net45" />
<package id="WebGrease" version="1.5.2" targetFramework="net45" /> <package id="WebGrease" version="1.5.2" targetFramework="net45" />

View File

@ -137,6 +137,7 @@
<Content Include="Content\Site.css" /> <Content Include="Content\Site.css" />
<Content Include="Scripts\bootstrap.js" /> <Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" /> <Content Include="Scripts\bootstrap.min.js" />
<None Include="Properties\PublishProfiles\webtest.pubxml" />
<None Include="Scripts\jquery-1.10.2.intellisense.js" /> <None Include="Scripts\jquery-1.10.2.intellisense.js" />
<Content Include="Scripts\jquery-1.10.2.js" /> <Content Include="Scripts\jquery-1.10.2.js" />
<Content Include="Scripts\jquery-1.10.2.min.js" /> <Content Include="Scripts\jquery-1.10.2.min.js" />

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
您 Web 项目的发布/打包进程将使用此文件。您可以通过编辑此 MSBuild 文件
来自定义该进程的行为。若要了解与此相关的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkID=208121。
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>C:\Users\Administrator\Desktop\OpenAuth.WebTest</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
</PropertyGroup>
</Project>