{ "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": "父任务ID", "DataValidationInfo": {} }, { "Name": "任务标题", "DataValidationInfo": { "IgnoreBlank": false } }, { "Name": "执行人", "DataValidationInfo": {} }, { "Name": "开始日期", "DataValidationInfo": {} }, { "Name": "结束日期", "DataValidationInfo": {} }, { "Name": "任务分组", "DataValidationInfo": {} }, { "Name": "任务类型", "DataValidationInfo": {} }, { "Name": "任务版本", "DataValidationInfo": {} }, { "Name": "预算工时", "DataValidationInfo": {} }, { "Name": "任务说明", "DataValidationInfo": {} }, { "Name": "备注", "DataValidationInfo": {} } ] } ], "Commands": [ { "$type": "Forguncy.Model.CatchExceptionCommand, ServerDesignerCommon", "TryCommandPart": { "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "项目统计", "TableValue": { "TableName": "View_项目统计信息", "TableValueType": 1, "BindingInfos": [ { "BindingInfo": { "TableName": "View_项目统计信息", "ColumnName": "项目ID", "GUID": "8be465f9-1173-4551-ba9c-8077e9e1068a", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "严格模式" } }, "ColumnName": "严格模式" }, { "BindingInfo": { "TableName": "View_项目统计信息", "ColumnName": "工时核定方式", "GUID": "ec3b7b01-920d-4ad5-9a6b-6360afbada2a" }, "ColumnName": "工时核定方式" }, { "BindingInfo": { "TableName": "View_项目统计信息", "ColumnName": "项目预算工时", "GUID": "c3f88088-ff8f-4ba4-b4b8-0b9b680f51b1" }, "ColumnName": "项目预算工时" }, { "BindingInfo": { "TableName": "View_项目统计信息", "ColumnName": "总核定工时", "GUID": "7c0f01a0-76c6-4b67-85f4-4c0e4455503e" }, "ColumnName": "总核定工时" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "View_项目统计信息", "ColumnName": "项目ID", "GUID": "f6308398-2aec-4b4a-9e2a-ec524facb605" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=项目ID" } }, "TopCount": "1" }, "ID": "4068a409eade48e59173917d96d60bf8" }, { "$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%", "compareType": 1 }, "CommandList": [ { "$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": "=项目统计.严格模式" } }, "value": "1" }, { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=预算工时" } }, "value": "0", "compareType": 2 }, { "$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": 2 } ] }, "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": "任务预算工时超标,请修改或申请新的预算。" } ], "ID": "53f4187a-3af5-4705-9047-e23ca8c51a4e" }, { "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": "1", "ID": "fc1c177d0f8146fe971c98817bc9a68d" } ], "ID": "8621eda5-c90a-4e21-bc4e-fe7f3cf5bb76" }, { "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "父任务", "TableValue": { "TableName": "任务表", "TableValueType": 1, "BindingInfos": [ { "BindingInfo": { "TableName": "任务表", "ColumnName": "层级", "GUID": "71447dd9-ed15-40d3-8c95-35af02be1228" }, "ColumnName": "层级" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务表", "ColumnName": "ID", "GUID": "a11173ee-ce04-46d5-a2fe-57bac8f3d19f" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=父任务ID" } }, "TopCount": "1" }, "ID": "a739bad14f7e43d0bfa3c64950d43eed" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "层级", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=父任务.层级+1" }, "ID": "578a03f2bc28443291e158813a67f853" } ], "ID": "608074a6-c246-4740-b2b9-22d68cbfa8d9" } ] }, { "$type": "Forguncy.Model.ServerTransactionCommand, ServerDesignerCommon", "CommandList": [ { "$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon", "TableName": "任务表", "UpdateType": "add", "ShowConfirm": false, "UpdateBindingValues": [ { "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "08af72b6-edaf-4d60-a5b9-9a416fa340e6" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=项目ID" } }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "父任务ID", "GUID": "b67853cb-e11a-45e7-a157-a39f2ed30957" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=父任务ID" } }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "任务名称", "GUID": "ae0e9518-a034-41fc-915c-77240b405ea6" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务标题" } }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "执行者", "GUID": "c982c67a-6248-442a-a585-f64fe62d2680" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=执行人" } }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "开始时间", "GUID": "32733259-ed48-485c-855b-b773522f34b7" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=开始日期" } }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "结束时间", "GUID": "190579b6-d2d8-4b11-a61c-84831351451e" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=结束日期" } }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "任务类型", "GUID": "7814d8a0-4316-4e3d-a2fb-1419c4820881" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务类型" } }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "分组ID", "GUID": "de35ab3e-835d-4cc3-b8dc-fa36e5212b69" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务分组" } }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "版本", "GUID": "4e7e93dd-43ef-4a30-ac01-6884fb764d4e" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务版本" } }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "任务说明", "GUID": "60673be5-8743-4376-a620-0710929824eb" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务说明" } }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "备注", "GUID": "e22df11a-00e2-43d3-b91f-709f94649021" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=备注" } }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "层级", "GUID": "4cd5444f-2718-4baf-aa2e-f9d6915f4e46" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=层级" } }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "任务预算工时", "GUID": "d3098515-dcd2-4140-9f49-4c1434e6f61c" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=预算工时" } }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "任务状态", "GUID": "5dd1d998-9b31-437b-acf4-6f039fb1e101" }, "Value": "0" } ], "ParamNameToSaveNewRowValue": "新任务" }, { "$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon", "TableName": "项目动态", "UpdateType": "add", "ShowConfirm": false, "UpdateBindingValues": [ { "BindingInfo": { "TableName": "项目动态", "ColumnName": "项目ID", "GUID": "2e28aac6-1fb2-46fc-a19d-ab41520eead3" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=项目ID" } }, { "BindingInfo": { "TableName": "项目动态", "ColumnName": "项目动态", "GUID": "f8082e24-0691-48e8-a425-32659221befd" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=\"新增任务[\"&任务标题&\"]\"" } }, { "BindingInfo": { "TableName": "项目动态", "ColumnName": "执行人", "GUID": "b83be749-881b-42fc-ac00-1f4a7e4004fe" }, "Value": "%CurrentUser%" } ] } ] }, { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "0", "Message": "新增成功" } ], "ID": "42ba3bd5-cbbe-4b9d-b1ad-4d3c7fddfbce" } ], "Comments": "如果任务设置了预算工时,则检测是否超标" } ], "ID": "159e6b8d-e674-41dd-97a9-0722693f416f" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": "项目不存在" } ], "ID": "9de2f0ca-80c4-4f6c-a3c9-772972beef5c" } ] } ] }, "CatchCommandPart": { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ExceptionCode" }, "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ExceptionMessage" } } ] } } ] }