diff --git a/OpenAuth.Repository/Models/Mapping/CommonApplyMap.cs b/OpenAuth.Repository/Models/Mapping/CommonApplyMap.cs deleted file mode 100644 index b64f34ac..00000000 --- a/OpenAuth.Repository/Models/Mapping/CommonApplyMap.cs +++ /dev/null @@ -1,66 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using System.ComponentModel.DataAnnotations.Schema; -using OpenAuth.Domain; - -namespace OpenAuth.Repository.Models.Mapping -{ - public partial class CommonApplyMap - : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration - { - public CommonApplyMap() - { - // table - ToTable("CommonApply", "dbo"); - - // keys - HasKey(t => t.Id); - - // Properties - Property(t => t.Id) - .HasColumnName("Id") - .IsRequired(); - Property(t => t.Sort) - .HasColumnName("Sort") - .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity) - .IsRequired(); - Property(t => t.ApplyTime) - .HasColumnName("ApplyTime") - .IsRequired(); - Property(t => t.Name) - .HasColumnName("Name") - .HasMaxLength(256) - .IsOptional(); - Property(t => t.Comment) - .HasColumnName("Comment") - .IsRequired(); - Property(t => t.State) - .HasColumnName("State") - .HasMaxLength(1024) - .IsRequired(); - Property(t => t.WorkflowName) - .HasColumnName("WorkflowName") - .HasMaxLength(1024) - .IsRequired(); - Property(t => t.StateName) - .HasColumnName("StateName") - .HasMaxLength(1024) - .IsOptional(); - Property(t => t.UserId) - .HasColumnName("UserId") - .IsRequired(); - Property(t => t.ControllerUserId) - .HasColumnName("ControllerUserId") - .IsOptional(); - - // Relationships - } - } -} diff --git a/OpenAuth.Repository/Models/Mapping/WFProcessInstanceMap.cs b/OpenAuth.Repository/Models/Mapping/WFProcessInstanceMap.cs index 01dfefef..835fb6ca 100644 --- a/OpenAuth.Repository/Models/Mapping/WFProcessInstanceMap.cs +++ b/OpenAuth.Repository/Models/Mapping/WFProcessInstanceMap.cs @@ -49,7 +49,6 @@ namespace OpenAuth.Repository.Models.Mapping .IsOptional(); Property(t => t.ProcessSchemeId) .HasColumnName("ProcessSchemeId") - .HasMaxLength(50) .IsRequired(); Property(t => t.SchemeType) .HasColumnName("SchemeType") diff --git a/OpenAuth.Repository/Models/Mapping/WFProcessOperationHistoryMap.cs b/OpenAuth.Repository/Models/Mapping/WFProcessOperationHistoryMap.cs index 14af0322..4cf6e399 100644 --- a/OpenAuth.Repository/Models/Mapping/WFProcessOperationHistoryMap.cs +++ b/OpenAuth.Repository/Models/Mapping/WFProcessOperationHistoryMap.cs @@ -26,7 +26,6 @@ namespace OpenAuth.Repository.Models.Mapping .IsRequired(); Property(t => t.ProcessId) .HasColumnName("ProcessId") - .HasMaxLength(50) .IsRequired(); Property(t => t.Content) .HasColumnName("Content") diff --git a/OpenAuth.Repository/Models/Mapping/WFProcessSchemeMap.cs b/OpenAuth.Repository/Models/Mapping/WFProcessSchemeMap.cs index b754f5d3..7495f0fe 100644 --- a/OpenAuth.Repository/Models/Mapping/WFProcessSchemeMap.cs +++ b/OpenAuth.Repository/Models/Mapping/WFProcessSchemeMap.cs @@ -27,9 +27,8 @@ namespace OpenAuth.Repository.Models.Mapping Property(t => t.SchemeContent) .HasColumnName("SchemeContent") .IsRequired(); - Property(t => t.WFSchemeInfoId) - .HasColumnName("WFSchemeInfoId") - .HasMaxLength(50) + Property(t => t.SchemeInfoId) + .HasColumnName("SchemeInfoId") .IsRequired(); Property(t => t.SchemeVersion) .HasColumnName("SchemeVersion") diff --git a/OpenAuth.Repository/Models/Mapping/WFProcessTransitionHistoryMap.cs b/OpenAuth.Repository/Models/Mapping/WFProcessTransitionHistoryMap.cs index 07af9b57..83b35764 100644 --- a/OpenAuth.Repository/Models/Mapping/WFProcessTransitionHistoryMap.cs +++ b/OpenAuth.Repository/Models/Mapping/WFProcessTransitionHistoryMap.cs @@ -26,7 +26,6 @@ namespace OpenAuth.Repository.Models.Mapping .IsRequired(); Property(t => t.ProcessId) .HasColumnName("ProcessId") - .HasMaxLength(50) .IsRequired(); Property(t => t.FromNodeId) .HasColumnName("fromNodeId") diff --git a/OpenAuth.Repository/Models/Mapping/WFSchemeContentMap.cs b/OpenAuth.Repository/Models/Mapping/WFSchemeContentMap.cs index 313d2f87..09050635 100644 --- a/OpenAuth.Repository/Models/Mapping/WFSchemeContentMap.cs +++ b/OpenAuth.Repository/Models/Mapping/WFSchemeContentMap.cs @@ -24,9 +24,8 @@ namespace OpenAuth.Repository.Models.Mapping Property(t => t.Id) .HasColumnName("Id") .IsRequired(); - Property(t => t.WFSchemeInfoId) - .HasColumnName("WFSchemeInfoId") - .HasMaxLength(50) + Property(t => t.SchemeInfoId) + .HasColumnName("SchemeInfoId") .IsRequired(); Property(t => t.SchemeVersion) .HasColumnName("SchemeVersion") diff --git a/OpenAuth.Repository/Models/OpenAuthDBContext.cs b/OpenAuth.Repository/Models/OpenAuthDBContext.cs index bd0559d4..cef138c0 100644 --- a/OpenAuth.Repository/Models/OpenAuthDBContext.cs +++ b/OpenAuth.Repository/Models/OpenAuthDBContext.cs @@ -29,7 +29,6 @@ namespace OpenAuth.Repository.Models public System.Data.Entity.DbSet ApplyTransitionHistories { get; set; } public System.Data.Entity.DbSet Categories { get; set; } - public System.Data.Entity.DbSet CommonApplies { get; set; } public System.Data.Entity.DbSet DicDetails { get; set; } public System.Data.Entity.DbSet DicIndices { get; set; } public System.Data.Entity.DbSet Modules { get; set; } @@ -52,7 +51,6 @@ namespace OpenAuth.Repository.Models { modelBuilder.Configurations.Add(new ApplyTransitionHistoryMap()); modelBuilder.Configurations.Add(new CategoryMap()); - modelBuilder.Configurations.Add(new CommonApplyMap()); modelBuilder.Configurations.Add(new DicDetailMap()); modelBuilder.Configurations.Add(new DicIndexMap()); modelBuilder.Configurations.Add(new ModuleMap()); diff --git a/OpenAuth.UnitTest/OpenAuth.UnitTest.csproj b/OpenAuth.UnitTest/OpenAuth.UnitTest.csproj index 63239a67..f27450a7 100644 --- a/OpenAuth.UnitTest/OpenAuth.UnitTest.csproj +++ b/OpenAuth.UnitTest/OpenAuth.UnitTest.csproj @@ -124,7 +124,6 @@ - diff --git a/OpenAuth.UnitTest/TestCommonApply.cs b/OpenAuth.UnitTest/TestCommonApply.cs deleted file mode 100644 index 93c07fdf..00000000 --- a/OpenAuth.UnitTest/TestCommonApply.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using OpenAuth.App; -using OpenAuth.App.ViewModel; -using OpenAuth.Domain; -using OpenAuth.Mvc.Models; -using OptimaJet.Workflow.Core.Persistence; -using OptimaJet.Workflow.Core.Runtime; - -namespace OpenAuth.UnitTest -{ - /// - /// 测试通用申请流程 - /// - [TestClass] - public class TestCommonApply : TestBase - { - private CommonApplyApp _app; - - public TestCommonApply() - { - _app = AutofacExt.GetFromFac(); - Mvc.AutofacExt.InitAutofac(); - } - - [TestMethod] - public void Addd() - { - var commonApply = new CommonApply - { - Id = Guid.Empty, - WorkflowName = "新建模板", - State = "", - StateName = "", - Name = "测试"+DateTime.Now.ToLongTimeString() - }; - _app.AddOrUpdate(commonApply); - - CreateWorkflowIfNotExists(commonApply.Id, commonApply.WorkflowName); - } - - - private void CreateWorkflowIfNotExists(Guid id, string schemecode) - { - if (WorkflowInit.Runtime.IsProcessExists(id)) - return; - - using (var sync = new WorkflowSync(WorkflowInit.Runtime, id)) - { - WorkflowInit.Runtime.CreateInstance(schemecode, id); - - sync.StatrtWaitingFor(new List { ProcessStatus.Initialized, ProcessStatus.Initialized }); - - sync.Wait(new TimeSpan(0, 0, 10)); - } - } - } -} diff --git a/OpenAuth.UnitTest/TestWorkflow.cs b/OpenAuth.UnitTest/TestWorkflow.cs index aba0e283..ccadd977 100644 --- a/OpenAuth.UnitTest/TestWorkflow.cs +++ b/OpenAuth.UnitTest/TestWorkflow.cs @@ -1,5 +1,8 @@ using System; +using Infrastructure; using Microsoft.VisualStudio.TestTools.UnitTesting; +using OpenAuth.App; +using OpenAuth.Domain; using OpenAuth.Domain.Service; namespace OpenAuth.UnitTest @@ -7,16 +10,32 @@ namespace OpenAuth.UnitTest [TestClass] public class TestWorkflow :TestBase { - private WorkflowService _app; + private WFSchemeService _app; + private WFRuntimeService _runApp; public TestWorkflow() { - _app = AutofacExt.GetFromFac(); + _app = AutofacExt.GetFromFac(); + _runApp = AutofacExt.GetFromFac(); } [TestMethod] public void AddForm() { var datas = _app.GetList(); } + + /// + /// 测试流程 + /// 李玉宝于2017-01-20 9:59:11 + /// + [TestMethod] + public void AddProcessInstance() + { + string name = "请假" + DateTime.Now.ToString("yy-mm-dd_HH_mm_ss"); + string str ="{\"Code\":\"请病假\",\"CustomName\":\""+name+"\",\"wfLevel1\":\"1\",\"wfLevel2\":\"2\",\"wfLevel3\":\"3\",\"Description\":\" \",\"EnabledMark\":1,\"wfLevel\":\"2\"}"; + string frmData ="{\"4fcd4c6f-eb6b-6a6d-eb4e-7948763c5bba\":\"\",\"88061dda-642e-bcdb-909b-cea2bbe5ad69\":\" \"}"; + _runApp.CreateInstance(Guid.Empty, Guid.Parse("5f0ca3df-390a-4bd7-aecb-5304bf2d191c"), str.ToObject(), frmData); + } + } } diff --git a/数据库设计关系图/OpenAuthDB.pdm b/数据库设计关系图/OpenAuthDB.pdm index f780628d..4206a93f 100644 --- a/数据库设计关系图/OpenAuthDB.pdm +++ b/数据库设计关系图/OpenAuthDB.pdm @@ -1,5 +1,5 @@ - + @@ -193,6 +193,7 @@ TrgrC12Upd=Yes TrgrC13=Yes UpdateTableStatistics=Yes UpdateColumnStatistics=Yes +DeploymentMode=REP [FolderOptions\Physical Objects\Database Generation] GenScriptName=DB.sql @@ -3275,6 +3276,7 @@ EnableTrans=No UseTerm=No EnableRequirements=No EnableFullShortcut=Yes +SynchroCode=Yes DefaultDttp= IgnoreOwner=No RebuildTrigger=Yes @@ -3965,6 +3967,7 @@ PhysOpts= [ModelOptions\Default Opts\FRMESOB<<WorkloadGroup>>] PhysOpts= +E:\测试学习\OpenAuth.Net\数据库设计关系图\OpenAuthDB.pdm 9401CEBA-B163-4ADB-AECF-03CE78C0FFF3 @@ -4058,6 +4061,8 @@ ExtendedObject_SymbolLayout=<Form>[CRLF] <StandardAttribute Name=" ELnkShowStrn=Yes ELnkShowName=Yes ExtendedLink_SymbolLayout=<Form>[CRLF] <Form Name="Center" >[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Source" >[CRLF] </Form>[CRLF] <Form Name="Destination" >[CRLF] </Form>[CRLF]</Form> +ExtDpdShowStrn=Yes +ExtendedDependency_SymbolLayout=<Form>[CRLF] <Form Name="Center" >[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Source" >[CRLF] </Form>[CRLF] <Form Name="Destination" >[CRLF] </Form>[CRLF]</Form> FileObject.Stereotype=No FileObject.DisplayName=Yes FileObject.LocationOrName=No @@ -4208,6 +4213,29 @@ Pen=1 0 128 128 255 Shadow color=192 192 192 Shadow=0 +[DisplayPreferences\Symbol\USRDEPD] +CENTERFont=新宋体,8,N +CENTERFont color=0, 0, 0 +Line style=1 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Brush color=255 255 255 +Fill Color=Yes +Brush style=1 +Brush bitmap mode=12 +Brush gradient mode=0 +Brush gradient color=118 118 118 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=2 0 128 128 255 +Shadow color=192 192 192 +Shadow=0 +OBJXSTRFont=新宋体,8,N +OBJXSTRFont color=0 0 0 + [DisplayPreferences\Symbol\FILO] OBJSTRNFont=新宋体,8,N OBJSTRNFont color=0 0 0 @@ -4416,27 +4444,6 @@ Pen=1 0 128 128 192 Shadow color=192 192 192 Shadow=0 -[DisplayPreferences\Symbol\USRDEPD] -OBJXSTRFont=新宋体,8,N -OBJXSTRFont color=0 0 0 -Line style=1 -AutoAdjustToText=Yes -Keep aspect=No -Keep center=No -Keep size=No -Brush color=255 255 255 -Fill Color=Yes -Brush style=1 -Brush bitmap mode=12 -Brush gradient mode=0 -Brush gradient color=118 118 118 -Brush background image= -Custom shape= -Custom text mode=0 -Pen=2 0 128 128 255 -Shadow color=192 192 192 -Shadow=0 - [DisplayPreferences\Symbol\Free Symbol] Free TextFont=新宋体,8,N Free TextFont color=0 0 0 @@ -6145,6 +6152,7 @@ Drop=No Administrator uniqueidentifier 1 +1 {F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={9C949EAB-FF87-446D-938C-8F03A4ABDC8E},National,4=true @@ -7678,6 +7686,7 @@ Drop=No 所属字典ID uniqueidentifier 1 +1 @@ -7987,12 +7996,12 @@ Drop=No MSSQLSRV2008 1430102304 yubaolee -1430102304 -yubaolee -file:///%_DBMS%/sqlsv2k8.xdb +1395240976 +Administrator +file:///%[XDB]%/sqlsv2k8.xdb F5C20738-B05A-4F70-BC90-9B5EB9437766 4BA9F647-DAB1-11D1-9944-006097355D9B -1341502043 +1395240976