{ "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": "51c6dcbf-fe8b-46d8-bfb4-191d546a0327", "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "50961c18-f454-469e-ae8f-eb11862b1148" }, "ColumnName": "项目ID" }, { "GUID": "cddf0559-1f01-4e67-b93c-bb1e34e4dcc8", "BindingInfo": { "TableName": "任务表", "ColumnName": "父任务ID", "GUID": "d043ddbd-c8a3-4a31-a47e-bcdac7551398" }, "ColumnName": "父任务ID" }, { "GUID": "cd690ee7-a6c5-4904-8bf4-713f93816b13", "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "a6f8cca7-5575-4839-9365-ffebe1facca9", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "ID", "NextRelationBinding": { "RelatedTable": "View_项目统计信息", "RelatedColumn": "项目ID", "DisplayColumn": "项目预算工时" } } }, "ColumnName": "项目预算工时" }, { "GUID": "96e79e31-b1a4-4e37-8aee-350c62261957", "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "69975d40-afe9-4bc8-b156-b06f8e589350", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "ID", "NextRelationBinding": { "RelatedTable": "View_项目统计信息", "RelatedColumn": "项目ID", "DisplayColumn": "已分配任务工时" } } }, "ColumnName": "已分配任务工时" }, { "GUID": "f0d7b2c3-9c10-4eeb-9c78-cf075c1ea8d8", "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "3256ecff-7321-48f2-9e3e-5aefeaac7b90", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "项目经理" } }, "ColumnName": "项目经理" }, { "GUID": "7685d2a7-b8b0-4fb3-a2c4-7e8388603e5b", "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "3b610fae-f462-4d6d-ba6e-e6b24dfce8af", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "工时分配方式" } }, "ColumnName": "工时分配方式" }, { "GUID": "a1ce946b-fc6c-44d0-ae82-c77c153f7cf6", "BindingInfo": { "TableName": "任务表", "ColumnName": "任务预算工时", "GUID": "2d53d463-1d5c-4117-aa9a-796165ad9c89" }, "ColumnName": "任务预算工时" }, { "GUID": "0bfff0dd-0c85-4e6e-ab5f-f1044a012c67", "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "b688b437-4733-4102-9763-f9dee3d372cd", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "严格模式" } }, "ColumnName": "严格模式" }, { "GUID": "515d2b76-c70e-4d42-8127-6a735c321162", "BindingInfo": { "TableName": "任务表", "ColumnName": "执行者", "GUID": "3f7a6d55-8578-48be-b14a-ba4a6e17f266" }, "ColumnName": "执行者" }, { "GUID": "91f6a0c9-9f8a-4b9a-9ee8-839ecdd8197f", "BindingInfo": { "TableName": "任务表", "ColumnName": "任务类型", "GUID": "050b2a2a-e802-4280-bc06-10d5e76c4e35" }, "ColumnName": "任务类型" }, { "GUID": "e9275819-440a-45b3-af94-bdaa6bc76357", "BindingInfo": { "TableName": "任务表", "ColumnName": "版本", "GUID": "1fa6cc05-da37-4315-b822-951a8b751213" }, "ColumnName": "版本" } ], "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": "4f3f746acbeb428fab74f7968f28c1a5" }, { "$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": "b646f410-c95a-4ba7-9851-2f54e22e2a71" } ] }, { "$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": "cf6d2a02-ef7f-4558-b11b-36b304d69aef" } ] }, { "$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": "928c0d81-b13b-478e-8491-57b85c6a9eee" } ] }, { "$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": "1ec91d09-a0a1-44e9-aef6-ec5bffdc1151" } ] }, { "$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": "c115c6615384449597ebf4a85443befa" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "层级", "ParameterValue": "1", "ID": "8f419b6c4a3f4fb5bcf81a653a34fefc" } ], "ID": "dc3596ec-7d37-439d-a2e5-7c9715388237" }, { "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "父任务", "TableValue": { "TableName": "任务表", "TableValueType": 1, "BindingInfos": [ { "GUID": "07e65c5c-bafd-49d7-8ae7-4616d5e13378", "BindingInfo": { "TableName": "任务表", "ColumnName": "层级", "GUID": "71447dd9-ed15-40d3-8c95-35af02be1228" }, "ColumnName": "层级" }, { "GUID": "20f3f014-e350-4182-b7c7-8c0f3b263e54", "BindingInfo": { "TableName": "任务表", "ColumnName": "任务预算工时", "GUID": "f2ea1508-f30e-412f-a345-3ede9d6c420d" }, "ColumnName": "任务预算工时" }, { "GUID": "5dbde190-261c-454b-9c78-adf11c3d695b", "BindingInfo": { "TableName": "任务表", "ColumnName": "总计划工时", "GUID": "1d7f0d26-c3c4-4fd5-9d35-d8c6775d2e75" }, "ColumnName": "总计划工时" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务表", "ColumnName": "ID", "GUID": "a11173ee-ce04-46d5-a2fe-57bac8f3d19f" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.父任务ID" } }, "NullFormulaValueQueryPolicy": 0, "TopCount": "1" }, "ID": "ffc951c1aa654907998505d60d36bc1e" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "预算工时上限", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=父任务.任务预算工时-父任务.总计划工时" }, "ID": "e8645f329ef5428084e2e9f931213182" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "层级", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=父任务.层级+1" }, "ID": "ac58e4cdd43c49fe9f9575e244e3479b" } ], "ID": "f075c288-17d1-45c4-aaf5-07a117002cbd" } ], "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": "63448099-3299-4748-ba1a-ce84dcb319e1" } ] } ], "ID": "456f791e-33d0-436a-85fd-1115f63fba0c" } ], "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" } } ] } } ] }