@@ -53,6 +53,8 @@ namespace OpenAuth.App
FlowInstanceOperationHistory processOperationHistoryEntity = new FlowInstanceOperationHistory
{
InstanceId = flowInstance . Id ,
CreateUserId = user . User . Id ,
CreateUserName = user . User . Name ,
Content = "<22> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> "
+ user . User . Name
+ "<22> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ̽<EFBFBD> <CCBD> ̡<EFBFBD> "
@@ -73,9 +75,11 @@ namespace OpenAuth.App
ToNodeId = wfruntime . runtimeModel . nextNodeId ,
ToNodeName = wfruntime . runtimeModel . nextNode . name ,
ToNodeType = wfruntime . runtimeModel . nextNodeType ,
TransitionSate = 0
IsFinish = wfruntime . runtimeModel . nextNodeType = = 4 ? 1 : 0 ,
TransitionSate = 0 ,
CreateUserId = user . User . Id ,
CreateUserName = user . User . Name
} ;
processTransitionHistoryEntity . IsFinish = ( processTransitionHistoryEntity . ToNodeType = = 4 ? 1 : 0 ) ;
#endregion
UnitWork . Add ( flowInstance ) ;
@@ -93,7 +97,10 @@ namespace OpenAuth.App
public bool NodeVerification ( string instanceId , bool flag , string description = "" )
{
FlowInstance flowInstance = Get ( instanceId ) ;
FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory ( ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¼
FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory
{
InstanceId = instanceId
} ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¼
FlowInstanceTransitionHistory processTransitionHistoryEntity = null ; //<2F> <> ת<EFBFBD> <D7AA> ¼
FlowRuntime wfruntime = new FlowRuntime ( flowInstance ) ;
@@ -166,15 +173,18 @@ namespace OpenAuth.App
processTransitionHistoryEntity = new FlowInstanceTransitionHistory
{
InstanceId = flowInstance . Id ,
CreateUserId = user . Id ,
CreateUserName = user . Name ,
FromNodeId = wfruntime . runtimeModel . currentNodeId ,
FromNodeName = wfruntime . runtimeModel . currentNode . name ,
FromNodeType = wfruntime . runtimeModel . currentNodeType ,
ToNodeId = wfruntime . runtimeModel . nextNodeId ,
ToNodeName = wfruntime . runtimeModel . nextNode . name ,
ToNodeType = wfruntime . runtimeModel . nextNodeType ,
IsFinish = wfruntime . runtimeModel . nextNodeType = = 4 ? 1 : 0 ,
TransitionSate = 0
} ;
processTransitionHistoryEntity . IsFinish = ( processTransitionHistoryEntity . ToNodeType = = 4 ? 1 : 0 ) ;
#endregion
break ;
@@ -204,19 +214,23 @@ namespace OpenAuth.App
processTransitionHistoryEntity = new FlowInstanceTransitionHistory
{
InstanceId = flowInstance . Id ,
CreateUserId = user . Id ,
CreateUserName = user . Name ,
FromNodeId = wfruntime . runtimeModel . currentNodeId ,
FromNodeName = wfruntime . runtimeModel . currentNode . name ,
FromNodeType = wfruntime . runtimeModel . currentNodeType ,
ToNodeId = wfruntime . runtimeModel . nextNodeId ,
ToNodeName = wfruntime . runtimeModel . nextNode . name ,
ToNodeType = wfruntime . runtimeModel . nextNodeType ,
IsFinish = wfruntime . runtimeModel . nextNodeType = = 4 ? 1 : 0 ,
TransitionSate = 0
} ;
processTransitionHistoryEntity . IsFinish = ( processTransitionHistoryEntity . ToNodeType = = 4 ? 1 : 0 ) ;
#endregion
flowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> " + wfruntime . runtimeModel . currentNode . name + "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> ͬ<EFBFBD> <CDAC> ,<2C> <> ע<EFBFBD> <D7A2> " + description ;
flowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> " + wfruntime . runtimeModel . currentNode . name
+ "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> ͬ<EFBFBD> <CDAC> ,<2C> <> ע<EFBFBD> <D7A2> " + description ;
}
else
{
@@ -224,7 +238,9 @@ namespace OpenAuth.App
tag . Taged = - 1 ;
wfruntime . MakeTagNode ( wfruntime . runtimeModel . currentNodeId , tag ) ;
flowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> " + wfruntime . runtimeModel . currentNode . name + "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> ,<2C> <> ע<EFBFBD> <D7A2> " + description ;
flowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> "
+ wfruntime . runtimeModel . currentNode . name + "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> ,<2C> <> ע<EFBFBD> <D7A2> "
+ description ;
}
}
#endregion
@@ -243,9 +259,15 @@ namespace OpenAuth.App
/// <returns></returns>
public bool NodeReject ( VerificationReq reqest )
{
var user = AuthUtil . GetCurrentUser ( ) . User ;
FlowInstance flowInstance = Get ( reqest . FlowInstanceId ) ;
FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory ( ) ;
FlowInstanceTransitionHistory processTransitionHistoryEntity = null ;
FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory
{
InstanceId = reqest . FlowInstanceId ,
CreateUserId = user . Id ,
CreateUserName = user . Name
} ;
FlowRuntime wfruntime = new FlowRuntime ( flowInstance ) ;
@@ -260,7 +282,6 @@ namespace OpenAuth.App
resnode = reqest . NodeRejectStep ;
}
var user = AuthUtil . GetCurrentUser ( ) . User ;
var tag = new Tag
{
Description = reqest . VerificationOpinion ,
@@ -280,29 +301,32 @@ namespace OpenAuth.App
flowInstance . MakerList = GetMakerList ( wfruntime . runtimeModel . nodes [ resnode ] , flowInstance . PreviousId ) ; //<2F> <> ǰ<EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> ִ<EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
#region <EFBFBD> <EFBFBD> ת <EFBFBD> <EFBFBD> ¼
processTransitionHistoryEntity = new FlowInstanceTransitionHistory
var processTransitionHistoryEntity = new FlowInstanceTransitionHistory
{
InstanceId = flowInstance . Id ,
CreateUserId = user . Id ,
CreateUserName = user . Name ,
FromNodeId = wfruntime . runtimeModel . currentNodeId ,
FromNodeName = wfruntime . runtimeModel . currentNode . name ,
FromNodeType = wfruntime . runtimeModel . currentNodeType ,
ToNodeId = wfruntime . runtimeModel . nextNodeId ,
ToNodeName = wfruntime . runtimeModel . nextNode . name ,
ToNodeType = wfruntime . runtimeModel . nextNodeType ,
IsFinish = wfruntime . runtimeModel . nextNodeType = = 4 ? 1 : 0 ,
TransitionSate = 1
} ;
//
processTransitionHistoryEntity. IsFinish = ( processTransitionHistoryEntity . ToNodeType = = 4 ? 1 : 0 ) ;
UnitWork . Add ( processTransitionHistoryEntity) ;
#endregion
}
flowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> "
+ wfruntime . runtimeModel . currentNode . name
+ "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,<2C> <> ע<EFBFBD> <D7A2> " + reqest . VerificationOpinion ;
UnitWork . Update ( flowInstance ) ;
UnitWork . Add ( flowInstanceOperationHistory ) ;
UnitWork . Add ( processTransitionHistoryEntity ) ;
UnitWork . Save ( ) ;
return true ;
@@ -361,32 +385,38 @@ namespace OpenAuth.App
/// <returns></returns>
private string GetMakerList ( FlowNode node , string processId )
{
string makerlsi t = "" ;
string makerLis t = "" ;
if ( node . setInfo = = null )
{
makerlsi t = "-1" ;
makerLis t = "-1" ;
}
else
{
if ( node . setInfo . NodeDesignate = = Setinfo . ALL_USER ) //<2F> <> <EFBFBD> г <EFBFBD> Ա
{
makerlsi t = "1" ;
makerLis t = "1" ;
}
else if ( node . setInfo . NodeDesignate = = Setinfo . SPECIAL_USER ) //ָ<> <D6B8> <EFBFBD> <EFBFBD> Ա
{
// makerlsit = GenericHelpers. ArrayToString(node. setInfo. NodeDesignateData.role, makerlsit) ;
// makerlsit = ArrwyToString(node.setInfo.NodeDesignateData.post, makerlsit);
// makerlsit = ArrwyToString(node.setInfo.NodeDesignateData.usergroup, makerlsit);
makerlsit = GenericHelpers . ArrayToString ( node . setInfo . NodeDesignateData . users , makerlsit ) ;
makerList = GenericHelpers. ArrayToString( node . setInfo. NodeDesignateData. users , makerList ) ;
if ( makerlsi t = = "" )
if ( makerLis t = = "" )
{
makerlsi t = "-1" ;
makerLis t = "-1" ;
}
}
else if ( node . setInfo . NodeDesignate = = Setinfo . SPECIAL_ROLE )
{
makerList = GenericHelpers . ArrayToString ( node . setInfo . NodeDesignateData . role , makerList ) ;
if ( makerList = = "" )
{
makerList = "-1" ;
}
}
}
return makerlsi t ;
return makerLis t ;
}
/// <summary>
@@ -419,21 +449,25 @@ namespace OpenAuth.App
{
//todo:<3A> <> <EFBFBD> <EFBFBD> /<2F> Ѱ<EFBFBD> /<2F> ҵ<EFBFBD>
var result = new TableData ( ) ;
var user = AuthUtil . GetCurrentUser ( ) ;
result . count = UnitWork . Find < FlowInstance > ( u = > u . CreateUserId = = request . userid ) . Count ( ) ;
if ( request . type = = "inbox" ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( request . type = = "wait" ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
result . data = UnitWork . Find < FlowInstance > ( request . page , request . limit , "CreateDate descending" , null ) . ToLis t( ) ;
result . count = UnitWork . Find < FlowInstance > ( u = > u . MakerList = = "1" | | u . MakerList . Contains ( user . User . Id ) ) . Coun t( ) ;
result . data = UnitWork . Find < FlowInstance > ( request . page , request . limit , "CreateDate descending" ,
u = > u . MakerList = = "1" | | u . MakerList . Contains ( user . User . Id ) ) . ToList ( ) ;
}
else if ( request . type = = "outbox " ) //<2F> Ѱ<EFBFBD> <D1B0> <EFBFBD> <EFBFBD> <EFBFBD>
else if ( request . type = = "disposed " ) //<2F> Ѱ<EFBFBD> <D1B0> <EFBFBD> <EFBFBD> <EFBFBD>
{
result . data = UnitWork . Find < FlowInstance > ( request . page , request . limit , "CreateDate descending" , null ) . ToList ( ) ;
}
else //<2F> ҵ<EFBFBD> <D2B5> <EFBFBD> <EFBFBD> <EFBFBD>
{
result . data = UnitWork . Find < FlowInstance > ( request . page , request . limit , "CreateDate descending" , null ) . ToLis t( ) ;
result . count = UnitWork . Find < FlowInstance > ( u = > u . CreateUserId = = user . User . Id ) . Coun t( ) ;
result . data = UnitWork . Find < FlowInstance > ( request . page , request . limit ,
"CreateDate descending" , u = > u . CreateUserId = = user . User . Id ) . ToList ( ) ;
}
return result ;