{ "Name": "任务发起流程前校验", "Enabled": true, "Triggers": [ { "$type": "Forguncy.SaveLoad.PostRequestTriggerSaveData, ServerDesignerCommon", "Permission": { "PermissionData": { "$type": "Forguncy.RbacPermission.Core.Impl.ServerCommand.ServerCommandPermissionData, Forguncy.RbacPermission.Core", "permissionResource": { "$type": "Forguncy.RbacPermission.Core.Impl.ServerCommand.ServerCommandPermissionResource, Forguncy.RbacPermission.Core" }, "permissionBindings": [ { "$type": "Forguncy.RbacPermission.Core.Impl.ServerCommand.ServerCommandPermissionBinding, Forguncy.RbacPermission.Core", "roleNames": [ "FGC_LoginUser" ] } ] } }, "Parameters": [ { "Name": "任务ID", "DataValidationInfo": { "IgnoreBlank": false } } ] } ], "Commands": [ { "$type": "Forguncy.Model.CatchExceptionCommand, ServerDesignerCommon", "TryCommandPart": { "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "任务信息", "TableValue": { "TableName": "任务表", "TableValueType": 1, "BindingInfos": [ { "GUID": "f545696a-35eb-4ba7-966e-6165b2631ea9", "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "50961c18-f454-469e-ae8f-eb11862b1148" }, "ColumnName": "项目ID" }, { "GUID": "033c1005-0793-4527-86f6-c740ac54d7dc", "BindingInfo": { "TableName": "任务表", "ColumnName": "任务名称", "GUID": "753ddaa6-f324-4828-ad56-f66e0d8de234" }, "ColumnName": "任务名称" }, { "GUID": "ae271fc0-b4c3-45d2-8c25-843bb35c9d85", "BindingInfo": { "TableName": "任务表", "ColumnName": "父任务ID", "GUID": "d043ddbd-c8a3-4a31-a47e-bcdac7551398" }, "ColumnName": "父任务ID" }, { "GUID": "72820fcd-2acd-4d24-8bf0-123388c2ab5b", "BindingInfo": { "TableName": "任务表", "ColumnName": "父任务ID", "GUID": "7471e7c8-3650-42a7-b438-3a775347aef8", "RelationBinding": { "RelatedTable": "任务表", "RelatedColumn": "ID", "DisplayColumn": "任务状态" } }, "ColumnName": "父任务任务状态" }, { "GUID": "c7a73e35-dbb7-4b5b-bc10-d995fc872f33", "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "a6f8cca7-5575-4839-9365-ffebe1facca9", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "ID", "NextRelationBinding": { "RelatedTable": "View_项目统计信息", "RelatedColumn": "项目ID", "DisplayColumn": "项目预算工时" } } }, "ColumnName": "项目预算工时" }, { "GUID": "6969b599-8082-4a30-9444-27ba08043e08", "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "69975d40-afe9-4bc8-b156-b06f8e589350", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "ID", "NextRelationBinding": { "RelatedTable": "View_项目统计信息", "RelatedColumn": "项目ID", "DisplayColumn": "已分配任务工时" } } }, "ColumnName": "已分配任务工时" }, { "GUID": "b5714ec5-9660-4d97-8ec9-f6333bc5e838", "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "3256ecff-7321-48f2-9e3e-5aefeaac7b90", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "项目经理" } }, "ColumnName": "项目经理" }, { "GUID": "40e6a4ac-0999-45e7-9d08-6c0adec2a91e", "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "3b610fae-f462-4d6d-ba6e-e6b24dfce8af", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "工时分配方式" } }, "ColumnName": "工时分配方式" }, { "GUID": "e2faa23a-5fba-4627-a664-7fee287549cc", "BindingInfo": { "TableName": "任务表", "ColumnName": "任务预算工时", "GUID": "2d53d463-1d5c-4117-aa9a-796165ad9c89" }, "ColumnName": "任务预算工时" }, { "GUID": "2b5f11cd-87dc-4299-a6e5-07ac1a082d63", "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "b688b437-4733-4102-9763-f9dee3d372cd", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "严格模式" } }, "ColumnName": "严格模式" }, { "GUID": "c69bfc11-e266-4e61-9f7a-dc68a17ea092", "BindingInfo": { "TableName": "任务表", "ColumnName": "任务负责人", "GUID": "3f7a6d55-8578-48be-b14a-ba4a6e17f266" }, "ColumnName": "执行者" }, { "GUID": "6af3e8d3-4379-42bb-b62d-43a2ec075aff", "BindingInfo": { "TableName": "任务表", "ColumnName": "任务负责人", "GUID": "42d851ed-8e39-4a1d-bc06-92731c8fd223", "AttachType": { "$type": "ForguncyDataAccess.UserColumnAttachObj, ForguncyDataAccess", "UserColumnAttachType": 1 } }, "ColumnName": "任务负责人_全名" }, { "GUID": "e3b08944-6249-43fb-9158-37cbc10abcdf", "BindingInfo": { "TableName": "任务表", "ColumnName": "任务类型", "GUID": "050b2a2a-e802-4280-bc06-10d5e76c4e35" }, "ColumnName": "任务类型" }, { "GUID": "5020402d-35fe-4d89-82c7-7460745e82eb", "BindingInfo": { "TableName": "任务表", "ColumnName": "版本", "GUID": "1fa6cc05-da37-4315-b822-951a8b751213" }, "ColumnName": "版本" }, { "GUID": "1f62db51-8d14-4582-bf8b-480ef7c155e4", "BindingInfo": { "TableName": "任务表", "ColumnName": "任务状态", "GUID": "8b3ea124-961b-4d9c-8342-d06a89709702" }, "ColumnName": "任务状态" }, { "GUID": "d6e8b372-a40c-400c-b4f5-71f537318a9d", "BindingInfo": { "TableName": "任务表", "ColumnName": "流程实例ID", "GUID": "f0756ea2-7301-436d-8004-e5d0bed1ae01" }, "ColumnName": "流程实例ID" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务表", "ColumnName": "ID", "GUID": "ae5a57e8-074d-401e-9d6b-c85747f92057" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务ID" } }, "NullFormulaValueQueryPolicy": 0, "TopCount": "1" }, "ID": "b03a1cfd7eac4938992501f57ff5cc2d" }, { "$type": "Forguncy.Model.ProcessInstanceCommand, ServerDesignerCommon", "ProcessInstanceId": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.流程实例ID" }, "OperateType": 400, "ProcessInstanceName": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.任务负责人_全名&\"分配任务\"&\"[\"&任务信息.任务名称&\"]等待接收\"" } }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "ForguncyDataAccess.RelationSqlCondition, ForguncyDataAccess", "SubConditions": [ { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.父任务ID" } }, "value": "%Null%", "compareType": 1 }, { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.父任务任务状态" } }, "value": "2", "compareType": 1 } ] }, "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": "请等待父任务审批后方可发起!" } ], "ID": "abdcd957-d6e5-46d4-9572-9e3fed0c35e9" } ] }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.项目经理" } }, "value": "%Null%" }, "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": "当前项目未指定项目经理,请指定后再试" } ], "ID": "98d0fe1a-dabf-426e-9ab9-bbd52407d6fa" } ] }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.执行者" } }, "value": "%Null%" }, "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": "请指定任务执行者" } ], "ID": "374ece9e-326f-4236-85c7-7ddfb05e868b" } ] }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.任务类型" } }, "value": "%Null%" }, "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": "请指定任务类型" } ], "ID": "b9a77a62-17a9-4364-9b06-c08856687b0f" } ] }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.版本" } }, "value": "%Null%" }, "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": "请为任务指定版本" } ], "ID": "4e736f1c-d439-4d1f-a6e3-9d8001981de8" } ] }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.严格模式" } }, "value": "1" }, "CommandList": [ { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.父任务ID" } }, "value": "%Null%" }, "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "预算工时上限", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.项目预算工时-任务信息.已分配任务工时" }, "ID": "f067411d74064d7b94eaa375d9410597" } ], "ID": "5ce8861b-e3b4-40f6-b857-6df105d63ce6" }, { "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "父任务", "TableValue": { "TableName": "任务平行视图", "TableValueType": 1, "BindingInfos": [ { "GUID": "8468e5ee-2d0c-4653-b414-2845ded5b828", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "层级", "GUID": "f77e0f2d-5a46-41ee-817e-8a25586086aa" }, "ColumnName": "层级" }, { "GUID": "36f92afd-5705-417e-b76c-db3eda355d94", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "任务预算工时", "GUID": "69c38d9a-9a17-45e9-8265-7b383df92d76" }, "ColumnName": "任务预算工时" }, { "GUID": "6201715b-2e80-4961-88aa-230d8c064dac", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "子任务预算工时", "GUID": "04e49339-f18b-4166-80b6-4153098333d3" }, "ColumnName": "子任务预算工时" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务平行视图", "ColumnName": "ID", "GUID": "1203dd82-1886-4972-bf84-daa88a6926bd" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.父任务ID" } }, "NullFormulaValueQueryPolicy": 0, "TopCount": "1" }, "ID": "7bd17b4b5c814c7f97e0cdcd18390d41" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "预算工时上限", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=父任务.任务预算工时-父任务.子任务预算工时" }, "ID": "d9c75d72e3cb44e1928346d49e88b7da" } ], "ID": "4fb958b0-134a-4c34-a18f-93b81a22771e" } ], "Comments": "严格模式下,根据是否有父任务来计算本次预算工时的上限" }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=预算工时上限" } }, "value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.任务预算工时" }, "compareType": 4 }, "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=IF(任务信息.父任务ID>0,\"预算工时超标:父任务可支配计划工时不足,请修改后提交!\",\"预算工时超标:项目可只配计划工时不足,请修改后提交!\")" } } ], "ID": "40842093-b2f4-4f75-b8ab-4accb87d869e" } ] } ], "ID": "851dc9d6-5375-499f-bfed-05ec00eaa385" } ], "Comments": "校验工时情况是否通过" }, { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "0", "Message": "任务校验通过" } ] }, "CatchCommandPart": { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ExceptionCode" }, "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ExceptionMessage" } } ] } } ] }