完成流程列表

This commit is contained in:
yubaolee 2016-09-07 16:58:08 +08:00
parent 0c82f7b8c3
commit c8dec703a7
22 changed files with 195 additions and 255 deletions

View File

@ -25,6 +25,12 @@ namespace Infrastructure
{ {
public static class ObjectHelper public static class ObjectHelper
{ {
public static T CopyTo<T>(this object source) where T:class, new()
{
var result = new T();
source.CopyTo(result);
return result;
}
public static void CopyTo<T>(this object source, T target) public static void CopyTo<T>(this object source, T target)
where T : class,new() where T : class,new()

View File

@ -0,0 +1,104 @@
using System;
using System.Linq;
using Infrastructure;
using OpenAuth.App.ViewModel;
using OpenAuth.Domain;
using OpenAuth.Domain.Interface;
namespace OpenAuth.App
{
public class CommonApplyApp
{
private IRepository<CommonApply> _repository;
private IUnitWork _unitWork;
public CommonApplyApp(IRepository<CommonApply> repository, IUnitWork unitWork)
{
_repository = repository;
_unitWork = unitWork;
}
public void AddOrUpdate(CommonApply model)
{
if (model.Id == Guid.Empty)
{
var obj = model.CopyTo<CommonApply>();
_repository.Add(obj);
}
else
{
_repository.Update(u => u.Id == model.Id, u => new CommonApply
{
UserId = model.UserId,
Name = model.Name,
});
}
}
/// <summary>
/// 更改流程状态
/// </summary>
public void ChangeState(Guid id,string state, string statename)
{
_repository.Update(u =>u.Id == id, u =>new CommonApply
{
State = state,
StateName = statename
});
}
public CommonApply Get(Guid value)
{
return _repository.FindSingle(u =>u.Id == value);
}
/// <summary>
/// 加载流程处理
/// </summary>
/// <param name="userid">用户ID</param>
/// <param name="type">inbox:待办事项/outbox:已办事项</param>
public GridData Load(Guid userid, string type, int pageCurrent, int pageSize)
{
var result = new GridData
{
pageCurrent = pageCurrent
};
if (type == "inbox") //待办事项
{
var inboxes = GetInboxProcessIds(userid);
result.total = _unitWork.Find<CommonApply>(u => inboxes.Contains(u.Id)).Count();
result.list = _unitWork.Find<CommonApply>(pageCurrent, pageSize, "Sort descending",u => inboxes.Contains(u.Id)).ToList();
}
else if (type == "outbox") //已办事项
{
IQueryable<Guid> outboxes = GetOutboxProcessIds(userid);
result.total = _unitWork.Find<CommonApply>(u => outboxes.Contains(u.Id)).Count();
result.list = _unitWork.Find<CommonApply>(pageCurrent, pageSize, "Sort descending", u => outboxes.Contains(u.Id)).ToList();
}
else //我的流程
{
result.total = _unitWork.Find<CommonApply>(u => u.UserId == userid).Count();
result.list = _unitWork.Find<CommonApply>(pageCurrent, pageSize, "Sort descending", u => u.UserId == userid).ToList();
}
return result;
}
private IQueryable<Guid> GetOutboxProcessIds(Guid userid)
{
return _unitWork.Find<ApplyTransitionHistory>(u => u.UserId == userid).Select(u => u.ApplyId);
}
private IQueryable<Guid> GetInboxProcessIds(Guid userid)
{
return _unitWork.Find<Relevance>(u =>u.Key =="ProcessUser" &&(userid == Guid.Empty || u.SecondId == userid)).Select(u =>u.FirstId);
}
public void Del(Guid id)
{
_repository.Delete(u =>u.Id == id);
}
}
}

View File

@ -1,70 +0,0 @@
using System;
using OpenAuth.App.ViewModel;
using OpenAuth.Domain;
using OpenAuth.Domain.Interface;
namespace OpenAuth.App
{
public class GoodsApplyApp
{
private IRepository<GoodsApply> _repository;
public GoodsApplyApp(IRepository<GoodsApply> repository)
{
_repository = repository;
}
public void AddOrUpdate(GoodsApply model)
{
if (model.Id == Guid.Empty)
{
_repository.Add(model);
}
else
{
_repository.Update(u => u.Id == model.Id, u => new GoodsApply
{
UserId = model.UserId,
Name = model.Name,
Number = model.Number
});
}
}
/// <summary>
/// 更改流程状态
/// </summary>
public void ChangeState(Guid id,string state, string statename)
{
_repository.Update(u =>u.Id == id, u =>new GoodsApply
{
State = state,
StateName = statename
});
}
public GoodsApply Get(Guid value)
{
return _repository.FindSingle(u =>u.Id == value);
}
public GridData Load(Guid userid, Guid parentId, int pageCurrent, int pageSize)
{
var result = new GridData
{
pageCurrent = pageCurrent
};
result.list= _repository.Find( pageCurrent, pageSize);
result.total = _repository.GetCount(null);
return result;
}
public void Del(Guid id)
{
_repository.Delete(u =>u.Id == id);
}
}
}

View File

@ -100,13 +100,13 @@
<Compile Include="SSO\SSOAuthAttribute.cs" /> <Compile Include="SSO\SSOAuthAttribute.cs" />
<Compile Include="SSO\UserAuthSession.cs" /> <Compile Include="SSO\UserAuthSession.cs" />
<Compile Include="SSO\UserAuthSessionService.cs" /> <Compile Include="SSO\UserAuthSessionService.cs" />
<Compile Include="GoodsApplyApp.cs" /> <Compile Include="CommonApplyApp.cs" />
<Compile Include="StockManagerApp.cs" /> <Compile Include="StockManagerApp.cs" />
<Compile Include="UserManagerApp.cs" /> <Compile Include="UserManagerApp.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="OrgManagerApp.cs" /> <Compile Include="OrgManagerApp.cs" />
<Compile Include="ViewModel\CommandModel.cs" /> <Compile Include="ViewModel\CommandModel.cs" />
<Compile Include="ViewModel\GoodsApplyVM.cs" /> <Compile Include="ViewModel\CommonApplyVM.cs" />
<Compile Include="ViewModel\GridData.cs" /> <Compile Include="ViewModel\GridData.cs" />
<Compile Include="ViewModel\UserWithAccessedCtrls.cs" /> <Compile Include="ViewModel\UserWithAccessedCtrls.cs" />
<Compile Include="ViewModel\ModuleElementVM.cs" /> <Compile Include="ViewModel\ModuleElementVM.cs" />

View File

@ -17,7 +17,7 @@ namespace OpenAuth.App.ViewModel
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public class GoodsApplyVM :Entity public class CommonApplyVM :Entity
{ {
/// <summary> /// <summary>
/// ///
@ -59,14 +59,14 @@ namespace OpenAuth.App.ViewModel
public Dictionary<string, string> AvailiableStates { get; set; } public Dictionary<string, string> AvailiableStates { get; set; }
public static implicit operator GoodsApplyVM(GoodsApply obj) public static implicit operator CommonApplyVM(CommonApply obj)
{ {
return obj.MapTo<GoodsApplyVM>(); return obj.MapTo<CommonApplyVM>();
} }
public static implicit operator GoodsApply(GoodsApplyVM obj) public static implicit operator CommonApply(CommonApplyVM obj)
{ {
return obj.MapTo<GoodsApply>(); return obj.MapTo<CommonApply>();
} }
} }

View File

@ -7,9 +7,9 @@ namespace OpenAuth.App
{ {
public class WorkflowInboxApp public class WorkflowInboxApp
{ {
private IRepository<WorkflowInbox> _repository; private IRepository<Relevance> _repository;
public WorkflowInboxApp(IRepository<WorkflowInbox> repository) public WorkflowInboxApp(IRepository<Relevance> repository)
{ {
_repository = repository; _repository = repository;
} }
@ -17,10 +17,10 @@ namespace OpenAuth.App
public void DeleteAllByProcess(Guid processId) public void DeleteAllByProcess(Guid processId)
{ {
_repository.Delete(u =>u.ProcessId == processId); _repository.Delete(u =>u.FirstId == processId && u.Key=="ProcessUser");
} }
public void Add(WorkflowInbox newInboxItem) public void Add(Relevance newInboxItem)
{ {
_repository.Add(newInboxItem); _repository.Add(newInboxItem);
} }

View File

@ -20,7 +20,6 @@ namespace OpenAuth.Domain
public ApplyTransitionHistory() public ApplyTransitionHistory()
{ {
this.AllowedToUserNames= string.Empty; this.AllowedToUserNames= string.Empty;
this.TransitionTime= DateTime.Now;
this.InitialState= string.Empty; this.InitialState= string.Empty;
this.DestinationState= string.Empty; this.DestinationState= string.Empty;
this.Command= string.Empty; this.Command= string.Empty;

View File

@ -13,18 +13,18 @@ using System;
namespace OpenAuth.Domain namespace OpenAuth.Domain
{ {
/// <summary> /// <summary>
/// /// 同意申请单
/// </summary> /// </summary>
public partial class GoodsApply : Entity public partial class CommonApply : Entity
{ {
public GoodsApply() public CommonApply()
{ {
this.Sort= 0; this.Sort= 0;
this.Number= 0;
this.Name= string.Empty; this.Name= string.Empty;
this.Comment= string.Empty; this.Comment= string.Empty;
this.State= string.Empty; this.State= string.Empty;
this.StateName= string.Empty; this.StateName= string.Empty;
this.ApplyTime = DateTime.Now;
} }
/// <summary> /// <summary>
@ -34,7 +34,7 @@ namespace OpenAuth.Domain
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public int Number { get; set; } public DateTime ApplyTime { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>

View File

@ -48,7 +48,7 @@
<Compile Include="DicDetail.cs" /> <Compile Include="DicDetail.cs" />
<Compile Include="DicIndex.cs" /> <Compile Include="DicIndex.cs" />
<Compile Include="Entity.cs" /> <Compile Include="Entity.cs" />
<Compile Include="GoodsApply.cs" /> <Compile Include="CommonApply.cs" />
<Compile Include="Interface\ICategoryRepository.cs" /> <Compile Include="Interface\ICategoryRepository.cs" />
<Compile Include="Interface\IModuleRepository.cs" /> <Compile Include="Interface\IModuleRepository.cs" />
<Compile Include="Interface\IOrgRepository.cs" /> <Compile Include="Interface\IOrgRepository.cs" />
@ -73,7 +73,6 @@
<Compile Include="Service\StockManagerService.cs" /> <Compile Include="Service\StockManagerService.cs" />
<Compile Include="Stock.cs" /> <Compile Include="Stock.cs" />
<Compile Include="User.cs" /> <Compile Include="User.cs" />
<Compile Include="WorkflowInbox.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -1,28 +0,0 @@
//------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a CodeSmith Template.
//
// DO NOT MODIFY contents of this file. Changes to this
// file will be lost if the code is regenerated.
// Author:Yubao Li
// </autogenerated>
//------------------------------------------------------------------------------
namespace OpenAuth.Domain
{
/// <summary>
///
/// </summary>
public partial class WorkflowInbox :Entity
{
/// <summary>
/// 工作流实体ID
/// </summary>
public System.Guid ProcessId { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public System.Guid IdentityId { get; set; }
}
}

View File

@ -1,49 +1,30 @@
//左边分类导航树 //左边分类导航树
var ztree = function () { var ztree = function () {
var url = '/OrgManager/LoadOrg'; var nodes = [
{
name: "流程处理", children: [
{ name: "我的申请",value:'me' },
{ name: "待办事项",value:'inbox' },
{ name: "已办事项",value:'outbox' }
],
value:'me'
}
];
var setting = { var setting = {
view: { selectedMulti: false }, view: { selectedMulti: false },
data: {
key: {
name: 'Name',
title: 'Name'
},
simpleData: {
enable: true,
idKey: 'Id',
pIdKey: 'ParentId',
rootPId: 'null'
}
},
callback: { callback: {
onClick: function (event, treeId, treeNode) { onClick: function (event, treeId, treeNode) {
list.reload(treeNode.Id); list.reload(treeNode.value);
} }
} }
}; };
var load = function () { var zTreeObj = $.fn.zTree.init($("#tree"), setting, nodes);
$.getJSON(url, function (json) {
var zTreeObj = $.fn.zTree.init($("#tree"), setting, json);
var firstId; //tree的第一个ID
if (json.length > 0) {
firstId = json[0].Id;
} else {
firstId = -1;
}
list.reload(firstId);
zTreeObj.expandAll(true); zTreeObj.expandAll(true);
});
};
load();
return {
reload: load
}
}(); }();
//grid列表模块 //grid列表模块
function MainGrid() { function MainGrid() {
var url = '/GoodsApplies/Load?parentId='; var url = '/CommonApplies/Load?type=';
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块 var selectedNode = 'me';
this.maingrid = $('#maingrid').datagrid({ this.maingrid = $('#maingrid').datagrid({
showToolbar: false, showToolbar: false,
filterThead: false, filterThead: false,
@ -55,18 +36,18 @@ function MainGrid() {
}, },
{ {
name: 'Name', name: 'Name',
label: '产品名称', label: '申请名称',
width: 100 width: 100
}, },
{ {
name: 'Number', name: 'Comment',
label: '产品数量', label: '产品数量',
width: 100 width: 100
}, },
{ {
name: 'StateName', name: 'StateName',
label: '当前流程', label: '流程状态',
width: 100 width: 100
}, },
{ {
@ -74,18 +55,17 @@ function MainGrid() {
hide:true hide:true
} }
], ],
dataUrl: url + selectedId, dataUrl: url + selectedNode,
fullGrid: true, fullGrid: true,
showLinenumber: true, showLinenumber: true,
showCheckboxcol: true, showCheckboxcol: true,
paging: true, paging: true,
filterMult: false, filterMult: false,
showTfoot: false, showTfoot: false
}); });
this.reload = function (id) { this.reload = function (selected) {
if (id != undefined) selectedId = id; if (selected != undefined) selectedNode = selected;
this.maingrid.datagrid('reload', { dataUrl: url + selectedId }); this.maingrid.datagrid('reload', { dataUrl: url + selectedNode });
}; };
}; };
MainGrid.prototype = new Grid(); MainGrid.prototype = new Grid();
@ -110,7 +90,7 @@ var editDlg = function () {
show(); show();
$('#Id').val(ret.Id); $('#Id').val(ret.Id);
$('#Name').val(ret.Name); $('#Name').val(ret.Name);
$('#Number').val(ret.Number); $('#Comment').val(ret.Comment);
}, },
save: function () { //编辑-->保存 save: function () { //编辑-->保存
$('#editForm').isValid(function (v) { $('#editForm').isValid(function (v) {
@ -123,7 +103,6 @@ var editDlg = function () {
return; return;
} }
list.reload(); list.reload();
ztree.reload();
} }
}); });
}); });
@ -136,7 +115,7 @@ function del() {
var selected = list.getSelectedObj(); var selected = list.getSelectedObj();
if (selected == null) return; if (selected == null) return;
$.getJSON('/GoodsApplies/Delete?Id=' + selected.Id, function (data) { $.getJSON('/CommonApplies/Delete?Id=' + selected.Id, function (data) {
if (data.statusCode == "200") { if (data.statusCode == "200") {
list.reload(); list.reload();
} }
@ -163,10 +142,10 @@ function detail() {
} }
BJUI.dialog({ BJUI.dialog({
id: 'detailDlg', id: 'detailDlg',
url: '/GoodsApplies/Detail?id=' + selected.Id, url: '/CommonApplies/Detail?id=' + selected.Id,
title: '进度详情', title: '进度详情',
width: 900, width: 900,
height: 700, height: 600,
mask:true mask:true
}); });
$(document).on('bjui.beforeCloseDialog',function(e) { $(document).on('bjui.beforeCloseDialog',function(e) {

View File

@ -15,8 +15,8 @@ function wfdesignerRedraw() {
apiurl: '/Designer/API', apiurl: '/Designer/API',
renderTo: 'wfdesigner', renderTo: 'wfdesigner',
imagefolder: '/images/', imagefolder: '/images/',
graphwidth: 800, graphwidth: 850,
graphheight: 500 graphheight: 450
}); });
if (data == undefined) { if (data == undefined) {
@ -36,7 +36,7 @@ wfdesignerRedraw();
$(function () { $(function () {
$(".btn-cmd") $(".btn-cmd")
.on("click", function () { //执行命令 .on("click", function () { //执行命令
$.post("/GoodsApplies/ExeCmd?id=" +$("#processId").val() +"&cmd=" +$(this).val() , $.post("/CommonApplies/ExeCmd?id=" +$("#processId").val() +"&cmd=" +$(this).val() ,
function (data) { function (data) {
BJUI.dialog('refresh', 'detailDlg'); BJUI.dialog('refresh', 'detailDlg');
}); });

View File

@ -13,13 +13,13 @@ using ProcessStatus = OptimaJet.Workflow.Core.Persistence.ProcessStatus;
namespace OpenAuth.Mvc.Controllers namespace OpenAuth.Mvc.Controllers
{ {
public class GoodsAppliesController : BaseController public class CommonAppliesController : BaseController
{ {
private GoodsApplyApp _app; private CommonApplyApp _app;
public GoodsAppliesController() public CommonAppliesController()
{ {
_app = AutofacExt.GetFromFac<GoodsApplyApp>(); _app = AutofacExt.GetFromFac<CommonApplyApp>();
} }
public ActionResult Index() public ActionResult Index()
@ -27,13 +27,13 @@ namespace OpenAuth.Mvc.Controllers
return View(); return View();
} }
public string Load(Guid parentId, int pageCurrent = 1, int pageSize = 30) public string Load(string type, int pageCurrent = 1, int pageSize = 30)
{ {
return JsonHelper.Instance.Serialize(_app.Load(AuthUtil.GetCurrentUser().User.Id, parentId, pageCurrent, pageSize)); return JsonHelper.Instance.Serialize(_app.Load(AuthUtil.GetCurrentUser().User.Id, type, pageCurrent, pageSize));
} }
[HttpPost] [HttpPost]
public string Edit(GoodsApply apply) public string Edit(CommonApply apply)
{ {
try try
{ {
@ -54,7 +54,7 @@ namespace OpenAuth.Mvc.Controllers
{ {
try try
{ {
GoodsApplyVM apply = _app.Get(id); CommonApplyVM apply = _app.Get(id);
apply.Commands = GetCommands(id); apply.Commands = GetCommands(id);
return View(apply); return View(apply);
} }
@ -146,7 +146,7 @@ namespace OpenAuth.Mvc.Controllers
/// <param name="id">流程实例ID</param> /// <param name="id">流程实例ID</param>
/// <param name="commandName">命令名称</param> /// <param name="commandName">命令名称</param>
/// <param name="goodsApply">申请实体</param> /// <param name="goodsApply">申请实体</param>
private void ExecuteCommand(Guid id, string commandName, GoodsApply goodsApply) private void ExecuteCommand(Guid id, string commandName, CommonApply goodsApply)
{ {
var currentUser =AuthUtil.GetCurrentUser().User.Id.ToString(); var currentUser =AuthUtil.GetCurrentUser().User.Id.ToString();

View File

@ -77,7 +77,7 @@ namespace OpenAuth.Mvc.Models
{ {
var nextState = WorkflowInit.Runtime.GetLocalizedStateName(e.ProcessId, e.ProcessInstance.CurrentState); var nextState = WorkflowInit.Runtime.GetLocalizedStateName(e.ProcessId, e.ProcessInstance.CurrentState);
var _app = AutofacExt.GetFromFac<GoodsApplyApp>(); var _app = AutofacExt.GetFromFac<CommonApplyApp>();
_app.ChangeState(e.ProcessId, e.ProcessInstance.CurrentState, nextState); _app.ChangeState(e.ProcessId, e.ProcessInstance.CurrentState, nextState);
} }
@ -94,11 +94,12 @@ namespace OpenAuth.Mvc.Models
var newActors = Runtime.GetAllActorsForDirectCommandTransitions(e.ProcessId); var newActors = Runtime.GetAllActorsForDirectCommandTransitions(e.ProcessId);
foreach (var newActor in newActors) foreach (var newActor in newActors)
{ {
var newInboxItem = new WorkflowInbox() var newInboxItem = new Relevance()
{ {
Id = Guid.NewGuid(), Id = Guid.NewGuid(),
IdentityId = new Guid(newActor), SecondId = new Guid(newActor),
ProcessId = e.ProcessId FirstId = e.ProcessId,
Key = "ProcessUser"
}; };
inboxApp.Add(newInboxItem); inboxApp.Add(newInboxItem);

View File

@ -8,7 +8,7 @@ using OptimaJet.Workflow.Core.Runtime;
namespace OpenAuth.Mvc.Models namespace OpenAuth.Mvc.Models
{ {
/// <summary> /// <summary>
/// 判断角色 /// 流程角色处理
/// </summary> /// </summary>
public class WorkflowRuleProvider : IWorkflowRuleProvider public class WorkflowRuleProvider : IWorkflowRuleProvider
{ {
@ -59,13 +59,7 @@ namespace OpenAuth.Mvc.Models
{ {
var userids = _app.GetUsersInRole(ruleName); var userids = _app.GetUsersInRole(ruleName);
if (userids == null) return null; if (userids == null) return null;
var userstrs = new List<string>(); return userids.Select(u => u.ToString());
foreach (var userid in userids)
{
userstrs.Add(userid.ToString());
}
return userstrs;
} }
} }
} }

View File

@ -155,7 +155,7 @@
<Compile Include="Controllers\CategoryManagerController.cs" /> <Compile Include="Controllers\CategoryManagerController.cs" />
<Compile Include="Controllers\DesignerController.cs" /> <Compile Include="Controllers\DesignerController.cs" />
<Compile Include="Controllers\ErrorController.cs" /> <Compile Include="Controllers\ErrorController.cs" />
<Compile Include="Controllers\GoodsAppliesController.cs" /> <Compile Include="Controllers\CommonAppliesController.cs" />
<Compile Include="Controllers\HomeController.cs" /> <Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\LoginController.cs" /> <Compile Include="Controllers\LoginController.cs" />
<Compile Include="Controllers\ModuleElementManagerController.cs" /> <Compile Include="Controllers\ModuleElementManagerController.cs" />
@ -189,7 +189,7 @@
<Content Include="BllScripts\queryString.js" /> <Content Include="BllScripts\queryString.js" />
<Content Include="BllScripts\resourceManager.js" /> <Content Include="BllScripts\resourceManager.js" />
<Content Include="BllScripts\roleManager.js" /> <Content Include="BllScripts\roleManager.js" />
<Content Include="BllScripts\goodsApply.js" /> <Content Include="BllScripts\commonApply.js" />
<Content Include="BllScripts\stockManager.js" /> <Content Include="BllScripts\stockManager.js" />
<Content Include="BllScripts\usermanager.js" /> <Content Include="BllScripts\usermanager.js" />
<Content Include="BllScripts\assignRes.js" /> <Content Include="BllScripts\assignRes.js" />
@ -736,7 +736,7 @@
<Content Include="fonts\glyphicons-halflings-regular.woff" /> <Content Include="fonts\glyphicons-halflings-regular.woff" />
<None Include="Properties\PublishProfiles\default.pubxml" /> <None Include="Properties\PublishProfiles\default.pubxml" />
<Content Include="Views\Designer\Index.cshtml" /> <Content Include="Views\Designer\Index.cshtml" />
<Content Include="Views\GoodsApplies\Detail.cshtml" /> <Content Include="Views\CommonApplies\Detail.cshtml" />
<None Include="Views\Error\NoAccess.cshtml" /> <None Include="Views\Error\NoAccess.cshtml" />
<Content Include="Views\Home\git.cshtml" /> <Content Include="Views\Home\git.cshtml" />
<Content Include="Web.config"> <Content Include="Web.config">
@ -757,7 +757,7 @@
<Content Include="Views\ResourceManager\AssignRes.cshtml" /> <Content Include="Views\ResourceManager\AssignRes.cshtml" />
<Content Include="Views\StockManager\Index.cshtml" /> <Content Include="Views\StockManager\Index.cshtml" />
<Content Include="Views\Shared\_BjuiLayout.cshtml" /> <Content Include="Views\Shared\_BjuiLayout.cshtml" />
<Content Include="Views\GoodsApplies\Index.cshtml" /> <Content Include="Views\CommonApplies\Index.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="App_Data\" /> <Folder Include="App_Data\" />

View File

@ -2,7 +2,7 @@
Layout = null; Layout = null;
} }
@using OptimaJet.Workflow.Core.Model @using OptimaJet.Workflow.Core.Model
@model OpenAuth.App.ViewModel.GoodsApplyVM @model OpenAuth.App.ViewModel.CommonApplyVM
<script src="/Scripts/jquery-ui.js"></script> <script src="/Scripts/jquery-ui.js"></script>
<link href="/Content/themes/base/jquery-ui.min.css" rel="stylesheet" /> <link href="/Content/themes/base/jquery-ui.min.css" rel="stylesheet" />
@ -25,7 +25,7 @@
@if (Model.Commands.Length > 0) @if (Model.Commands.Length > 0)
{ {
<div class="panel-body"> <div class="panel-body">
<span class="label label-default">你可以执行:</span> <span class="label label-default">下图蓝色为当前状态,你可以执行:</span>
@foreach (var cmd in Model.Commands) @foreach (var cmd in Model.Commands)
{ {
if (cmd.Classifier == TransitionClassifier.Reverse) if (cmd.Classifier == TransitionClassifier.Reverse)
@ -39,12 +39,10 @@
} }
</div> </div>
} }
<div class="panel-body">
<div id="wfdesigner"></div> <div id="wfdesigner"></div>
</div> </div>
</div> </div>
</div> </div>
</div>
<script src="/BllScripts/queryString.js"></script> <script src="/BllScripts/queryString.js"></script>
<script src="/BllScripts/processDetail.js"></script> <script src="/BllScripts/processDetail.js"></script>

View File

@ -18,21 +18,21 @@
<!--编辑对话框--> <!--编辑对话框-->
<div class="bjui-dialog hidden bjui-dialog-container" id="editDlg" data-noinit="true"> <div class="bjui-dialog hidden bjui-dialog-container" id="editDlg" data-noinit="true">
<div class="bjui-pageContent"> <div class="bjui-pageContent">
<form action="/GoodsApplies/Edit" class="pageForm" data-toggle="validate" data-reload="false" id="editForm"> <form action="/CommonApplies/Edit" class="pageForm" data-toggle="validate" data-reload="false" id="editForm">
<table class="table table-condensed table-hover"> <table class="table table-condensed table-hover">
<tbody> <tbody>
<input type="text" id="Id" name="Id" value="" class="hidden" /> <input type="text" id="Id" name="Id" value="" class="hidden" />
<tr> <tr>
<td> <td>
<label for="Name" class="control-label x120">产品名称:</label> <label for="Name" class="control-label x120">申请名称:</label>
<input type="text" id="Name" name="Name" value="" /> <input type="text" id="Name" name="Name" value="" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<label for="Number" class="control-label x120">产品数量</label> <label for="Comment" class="control-label x120">申请描述</label>
<input type="text" id="Number" name="Number" value="" /> <input type="text" id="Comment" name="Comment" value="" />
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -48,4 +48,4 @@
</div> </div>
<script src="~/BllScripts/grid.js"></script> <script src="~/BllScripts/grid.js"></script>
<script src="~/BllScripts/goodsApply.js"></script> <script src="~/BllScripts/commonApply.js"></script>

View File

@ -12,13 +12,13 @@ using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping namespace OpenAuth.Repository.Models.Mapping
{ {
public partial class GoodsApplyMap public partial class CommonApplyMap
: System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<GoodsApply> : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<CommonApply>
{ {
public GoodsApplyMap() public CommonApplyMap()
{ {
// table // table
ToTable("GoodsApply", "dbo"); ToTable("CommonApply", "dbo");
// keys // keys
HasKey(t => t.Id); HasKey(t => t.Id);
@ -31,8 +31,8 @@ namespace OpenAuth.Repository.Models.Mapping
.HasColumnName("Sort") .HasColumnName("Sort")
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity) .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
.IsRequired(); .IsRequired();
Property(t => t.Number) Property(t => t.ApplyTime)
.HasColumnName("Number") .HasColumnName("ApplyTime")
.IsRequired(); .IsRequired();
Property(t => t.Name) Property(t => t.Name)
.HasColumnName("Name") .HasColumnName("Name")

View File

@ -1,39 +0,0 @@
//------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a CodeSmith Template.
//
// DO NOT MODIFY contents of this file. Changes to this
// file will be lost if the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public partial class WorkflowInboxMap
: System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<WorkflowInbox>
{
public WorkflowInboxMap()
{
// table
ToTable("WorkflowInbox", "dbo");
// keys
HasKey(t => t.Id);
// Properties
Property(t => t.Id)
.HasColumnName("Id")
.IsRequired();
Property(t => t.ProcessId)
.HasColumnName("ProcessId")
.IsRequired();
Property(t => t.IdentityId)
.HasColumnName("IdentityId")
.IsRequired();
// Relationships
}
}
}

View File

@ -30,7 +30,7 @@ namespace OpenAuth.Repository.Models
public System.Data.Entity.DbSet<Category> Categories { get; set; } public System.Data.Entity.DbSet<Category> Categories { get; set; }
public System.Data.Entity.DbSet<DicDetail> DicDetails { get; set; } public System.Data.Entity.DbSet<DicDetail> DicDetails { get; set; }
public System.Data.Entity.DbSet<DicIndex> DicIndices { get; set; } public System.Data.Entity.DbSet<DicIndex> DicIndices { get; set; }
public System.Data.Entity.DbSet<GoodsApply> GoodsApplies { get; set; } public System.Data.Entity.DbSet<CommonApply> GoodsApplies { get; set; }
public System.Data.Entity.DbSet<Module> Modules { get; set; } public System.Data.Entity.DbSet<Module> Modules { get; set; }
public System.Data.Entity.DbSet<ModuleElement> ModuleElements { get; set; } public System.Data.Entity.DbSet<ModuleElement> ModuleElements { get; set; }
public System.Data.Entity.DbSet<Org> Orgs { get; set; } public System.Data.Entity.DbSet<Org> Orgs { get; set; }
@ -39,7 +39,6 @@ namespace OpenAuth.Repository.Models
public System.Data.Entity.DbSet<Role> Roles { get; set; } public System.Data.Entity.DbSet<Role> Roles { get; set; }
public System.Data.Entity.DbSet<Stock> Stocks { get; set; } public System.Data.Entity.DbSet<Stock> Stocks { get; set; }
public System.Data.Entity.DbSet<User> Users { get; set; } public System.Data.Entity.DbSet<User> Users { get; set; }
public System.Data.Entity.DbSet<WorkflowInbox> WorkflowInboxes { get; set; }
public DbSet<ApplyTransitionHistory> ApplyTransitionHistories { get; set; } public DbSet<ApplyTransitionHistory> ApplyTransitionHistories { get; set; }
@ -48,7 +47,7 @@ namespace OpenAuth.Repository.Models
modelBuilder.Configurations.Add(new CategoryMap()); modelBuilder.Configurations.Add(new CategoryMap());
modelBuilder.Configurations.Add(new DicDetailMap()); modelBuilder.Configurations.Add(new DicDetailMap());
modelBuilder.Configurations.Add(new DicIndexMap()); modelBuilder.Configurations.Add(new DicIndexMap());
modelBuilder.Configurations.Add(new GoodsApplyMap()); modelBuilder.Configurations.Add(new CommonApplyMap());
modelBuilder.Configurations.Add(new ModuleMap()); modelBuilder.Configurations.Add(new ModuleMap());
modelBuilder.Configurations.Add(new ModuleElementMap()); modelBuilder.Configurations.Add(new ModuleElementMap());
modelBuilder.Configurations.Add(new OrgMap()); modelBuilder.Configurations.Add(new OrgMap());
@ -57,7 +56,6 @@ namespace OpenAuth.Repository.Models
modelBuilder.Configurations.Add(new RoleMap()); modelBuilder.Configurations.Add(new RoleMap());
modelBuilder.Configurations.Add(new StockMap()); modelBuilder.Configurations.Add(new StockMap());
modelBuilder.Configurations.Add(new UserMap()); modelBuilder.Configurations.Add(new UserMap());
modelBuilder.Configurations.Add(new WorkflowInboxMap());
modelBuilder.Configurations.Add(new ApplyTransitionHistoryMap()); modelBuilder.Configurations.Add(new ApplyTransitionHistoryMap());
} }

View File

@ -56,8 +56,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Models\Mapping\ApplyTransitionHistoryMap.cs" /> <Compile Include="Models\Mapping\ApplyTransitionHistoryMap.cs" />
<Compile Include="Models\Mapping\GoodsApplyMap.cs" /> <Compile Include="Models\Mapping\CommonApplyMap.cs" />
<Compile Include="Models\Mapping\WorkflowInboxMap.cs" />
<Compile Include="UnitWork.cs" /> <Compile Include="UnitWork.cs" />
<Compile Include="BaseRepository.cs" /> <Compile Include="BaseRepository.cs" />
<Compile Include="Models\Mapping\CategoryMap.cs" /> <Compile Include="Models\Mapping\CategoryMap.cs" />