{ "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 } }, { "Name": "新预算工时", "DataValidationInfo": { "IgnoreBlank": false } } ] } ], "Commands": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "任务表", "TableValue": { "TableName": "任务平行视图", "TableValueType": 1, "BindingInfos": [ { "GUID": "8ae71a3c-cf69-473a-ae00-6751f83ffbaf", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "项目ID", "GUID": "5719fcb2-167f-46e2-a595-f2694094d3d4" }, "ColumnName": "项目ID" }, { "GUID": "2e9728f5-488a-47ea-bf17-cd9ef4cf18ac", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "项目ID", "GUID": "14189ead-62a9-4601-a206-b4ce4e6c9b79", "RelationBinding": { "RelatedTable": "项目平行视图", "RelatedColumn": "ID", "DisplayColumn": "严格模式" } }, "ColumnName": "严格模式" }, { "GUID": "80b2199d-fb04-40e5-9cec-315fbc336501", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "项目ID", "GUID": "4e99fa55-723f-48b8-955c-5595ae187aa6", "RelationBinding": { "RelatedTable": "项目平行视图", "RelatedColumn": "ID", "DisplayColumn": "项目预算工时" } }, "ColumnName": "项目预算工时" }, { "GUID": "8144b500-8d9d-4b70-be04-04188301ac21", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "项目ID", "GUID": "1366e55d-d61b-46c8-af9e-7fc4cb7a53bf", "RelationBinding": { "RelatedTable": "项目平行视图", "RelatedColumn": "ID", "DisplayColumn": "项目已分配工时" } }, "ColumnName": "项目已分配工时" }, { "GUID": "ac6d4ceb-a9b0-445d-a442-1c8066efb55a", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "项目ID", "GUID": "196e858f-ae77-4c8b-b383-8990780d75b3", "RelationBinding": { "RelatedTable": "项目平行视图", "RelatedColumn": "ID", "DisplayColumn": "工时分配方式" } }, "ColumnName": "工时分配方式" }, { "GUID": "e46119ab-e2d6-4e46-b6f6-f656d42945a5", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "任务名称", "GUID": "027d069e-aaad-494d-adfc-ce3116a4e006" }, "ColumnName": "任务名称" }, { "GUID": "27803d1a-1157-4fc5-bd29-5fb879c9c090", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "总分配工时", "GUID": "6f70bc63-6e7f-4cdb-b495-564ead523b05" }, "ColumnName": "总分配工时" }, { "GUID": "468c6d6f-2fcb-4124-b00c-c0dfd1ae8a56", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "已分配工时", "GUID": "4a2a9325-8cad-4111-b6fd-0d9cfda9ed22" }, "ColumnName": "已分配工时" }, { "GUID": "d8338b96-f7ba-4ff0-929b-c48608ee35f8", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "父任务ID", "GUID": "d91016f5-5a46-4636-8dac-33b23d21f90a" }, "ColumnName": "父任务ID" }, { "GUID": "6b521b64-8243-4b17-bf58-ab74ea5fb79e", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "父任务ID", "GUID": "982feecb-8da9-46e9-99a4-0e7a4e599de3", "RelationBinding": { "RelatedTable": "任务平行视图", "RelatedColumn": "ID", "DisplayColumn": "可分配工时" } }, "ColumnName": "父任务可分配工时" }, { "GUID": "8cea6bce-e2d8-47f4-bc65-8c5bc316a6a2", "BindingInfo": { "TableName": "任务平行视图", "ColumnName": "本任务已分配工时", "GUID": "d0b307f8-9206-4597-a5cf-4ecb4e3c27ea" }, "ColumnName": "本任务已分配工时" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务平行视图", "ColumnName": "ID", "GUID": "8ed8daac-ea2a-4392-86e2-4c91c582a7b1" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务ID" } }, "TopCount": "1" }, "ID": "21865ad1962c44d4be6d805cd19daf8f" }, { "$type": "Forguncy.Model.CatchExceptionCommand, ServerDesignerCommon", "TryCommandPart": { "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": "=任务表.工时分配方式" } }, "value": "4", "compareType": 1 }, "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "项目可分配工时", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务表.项目预算工时-任务表.项目已分配工时" }, "ID": "21e229bfb2074ecf90faf763e18d1362" }, { "$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": "=新预算工时" } }, "value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务表.本任务已分配工时" }, "compareType": 4 }, "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=\"任务已被分配消耗\"&任务表.本任务已分配工时&\"小时,修改后工时,不可低于此值。\"" }, "CustomReturns": [ { "ReturnPropertyName": "新工时", "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务表.总分配工时" } } ] } ], "ID": "274cc540-2ecd-4032-8615-50cde88a6a39" } ] }, { "$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": "dc415d50f13c4b6d910deebb8f01c7c3", "Comments": "如果没有父任务,则将项目可分配工时+任务当前的总分配工时 (相当于这个任务没有分)" } ], "ID": "a29b22a1-3a16-4819-a5a3-2e8348db48f1" }, { "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "上级剩余工时", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务表.父任务可分配工时" }, "ID": "2e69cbc7c4ef4ea889efb06c58f96f73", "Comments": "如果没有父任务,则将项目可分配工时+任务当前的总分配工时 (相当于这个任务没有分)" } ], "ID": "cf25b05b-9b46-428c-8a33-816542cbeb21" } ], "Comments": "严格模式下,根据是否有父任务来计算本次预算工时的上限" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "预算工时上限", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=上级剩余工时+任务表.总分配工时" }, "ID": "1272d321f1664c3b9ff24c5dcedb5d2e", "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": "=\"任务工时超标,无法修改,当前任务最大上线为:\"&预算工时上限&\"小时\"" }, "CustomReturns": [ { "ReturnPropertyName": "新工时" } ] } ], "ID": "848dff63-ab7f-4d6e-b558-7a64cce16605" } ] } ], "ID": "13ead9e6-b053-4a77-a117-ea8951ddda84" } ] }, { "$type": "Forguncy.Model.ServerTransactionCommand, ServerDesignerCommon", "CommandList": [ { "$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon", "TableName": "任务表", "ShowConfirm": false, "RowsToUpdate": 1, "RowsToUpdateCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务表", "ColumnName": "ID", "GUID": "36cde956-3506-4020-942d-ca6bb7016a8e" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务ID" } }, "UpdateBindingValues": [ { "BindingInfo": { "TableName": "任务表", "ColumnName": "任务预算工时", "GUID": "87d0d5c7-6093-4548-8f03-96d4714af78b" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=新预算工时" } } ], "ParamNameToSaveNewRowValue": "新任务" }, { "$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon", "TableName": "项目动态", "UpdateType": "add", "ShowConfirm": false, "UpdateBindingValues": [ { "BindingInfo": { "TableName": "项目动态", "ColumnName": "项目ID", "GUID": "0714186a-58f5-45a1-938f-d2d93c1cc690" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务表.项目ID" } }, { "BindingInfo": { "TableName": "项目动态", "ColumnName": "项目动态", "GUID": "a2cbc92d-02bb-40e4-81ce-2f9d87c7139a" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=\"调整了任务[\"&任务表.任务名称&\"]的预算工时,\"&任务表.项目预算工时&\"=>\"&新预算工时" } }, { "BindingInfo": { "TableName": "项目动态", "ColumnName": "执行人", "GUID": "616a4c98-401a-4cc1-bdcf-5f70ba8a4cc5" }, "Value": "%CurrentUser%" } ] } ] }, { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "0", "Message": "新增成功", "CustomReturns": [ { "ReturnPropertyName": "新工时", "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=新预算工时" } } ] } ], "ID": "2d04e62a-3dcf-4f77-a465-828437ab541e" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "0", "Message": "项目已设置为“不分配”工时模式,无法修改!", "CustomReturns": [ { "ReturnPropertyName": "新工时", "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务表.总分配工时" } } ] } ], "ID": "7b9cf683-17ed-4f49-bbf5-d3a39cecacba" } ] } ] }, "CatchCommandPart": { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ExceptionCode" }, "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ExceptionMessage" }, "CustomReturns": [ { "ReturnPropertyName": "新工时", "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务表.总分配工时" } } ] } ] } } ], "ReturnProperties": [ { "Name": "新工时" } ] }