Files
clue/ServerCommands/任务/任务发起流程前校验.json

492 lines
21 KiB
JSON

{
"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": "4c1c012a-0ad0-4338-9430-f1b70ac7a764",
"BindingInfo": {
"TableName": "任务表",
"ColumnName": "项目ID",
"GUID": "50961c18-f454-469e-ae8f-eb11862b1148"
},
"ColumnName": "项目ID"
},
{
"GUID": "3026ea11-e179-43fe-a731-1f3acd8031cf",
"BindingInfo": {
"TableName": "任务表",
"ColumnName": "父任务ID",
"GUID": "d043ddbd-c8a3-4a31-a47e-bcdac7551398"
},
"ColumnName": "父任务ID"
},
{
"GUID": "dc74514b-fa27-45ec-b5a9-349e11ddb9fb",
"BindingInfo": {
"TableName": "任务表",
"ColumnName": "项目ID",
"GUID": "a6f8cca7-5575-4839-9365-ffebe1facca9",
"RelationBinding": {
"RelatedTable": "项目表",
"RelatedColumn": "ID",
"DisplayColumn": "ID",
"NextRelationBinding": {
"RelatedTable": "View_项目统计信息",
"RelatedColumn": "项目ID",
"DisplayColumn": "项目预算工时"
}
}
},
"ColumnName": "项目预算工时"
},
{
"GUID": "c646f8aa-9325-4c7f-9a46-94c95431c000",
"BindingInfo": {
"TableName": "任务表",
"ColumnName": "项目ID",
"GUID": "69975d40-afe9-4bc8-b156-b06f8e589350",
"RelationBinding": {
"RelatedTable": "项目表",
"RelatedColumn": "ID",
"DisplayColumn": "ID",
"NextRelationBinding": {
"RelatedTable": "View_项目统计信息",
"RelatedColumn": "项目ID",
"DisplayColumn": "已分配任务工时"
}
}
},
"ColumnName": "已分配任务工时"
},
{
"GUID": "3d5bcd8b-de08-4dab-aa99-10b672410d22",
"BindingInfo": {
"TableName": "任务表",
"ColumnName": "项目ID",
"GUID": "3256ecff-7321-48f2-9e3e-5aefeaac7b90",
"RelationBinding": {
"RelatedTable": "项目表",
"RelatedColumn": "ID",
"DisplayColumn": "项目经理"
}
},
"ColumnName": "项目经理"
},
{
"GUID": "57be8a25-ac7d-4f4c-b0cc-5fefcfdb476e",
"BindingInfo": {
"TableName": "任务表",
"ColumnName": "项目ID",
"GUID": "3b610fae-f462-4d6d-ba6e-e6b24dfce8af",
"RelationBinding": {
"RelatedTable": "项目表",
"RelatedColumn": "ID",
"DisplayColumn": "工时分配方式"
}
},
"ColumnName": "工时分配方式"
},
{
"GUID": "683595d8-69c4-47e0-8f9f-bb05e7732a15",
"BindingInfo": {
"TableName": "任务表",
"ColumnName": "任务预算工时",
"GUID": "2d53d463-1d5c-4117-aa9a-796165ad9c89"
},
"ColumnName": "任务预算工时"
},
{
"GUID": "34ff6d56-84e4-4f3f-a6f9-7528e5968792",
"BindingInfo": {
"TableName": "任务表",
"ColumnName": "项目ID",
"GUID": "b688b437-4733-4102-9763-f9dee3d372cd",
"RelationBinding": {
"RelatedTable": "项目表",
"RelatedColumn": "ID",
"DisplayColumn": "严格模式"
}
},
"ColumnName": "严格模式"
},
{
"GUID": "10ec1395-5a81-4cbc-acd8-8d1ef6996c99",
"BindingInfo": {
"TableName": "任务表",
"ColumnName": "执行者",
"GUID": "3f7a6d55-8578-48be-b14a-ba4a6e17f266"
},
"ColumnName": "执行者"
},
{
"GUID": "40f27bbb-15e6-4e5b-8b04-41454bab1753",
"BindingInfo": {
"TableName": "任务表",
"ColumnName": "任务类型",
"GUID": "050b2a2a-e802-4280-bc06-10d5e76c4e35"
},
"ColumnName": "任务类型"
},
{
"GUID": "98dd52fd-9eef-4268-9769-5bee88e24f8b",
"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": "991ad217c6604c978bfc5749b20e6e33"
},
{
"$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": "bcf16cb9-2079-423a-a1b6-33293e2f563e"
}
]
},
{
"$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": "deb73d93-205e-463a-8d34-5b5bfb1477e9"
}
]
},
{
"$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": "20c338d7-189f-4ec9-8fe0-7f69ab5ba813"
}
]
},
{
"$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": "91321071-f269-486e-8efc-434263349f4e"
}
]
},
{
"$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": "ff74d835958740a18c9a43517e5fe004"
},
{
"$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon",
"ParameterName": "层级",
"ParameterValue": "1",
"ID": "2a21b817513b444c9cb3a0316de2a9cc"
}
],
"ID": "c519e38d-63bd-4a93-a2bf-6f4b2c414c9f"
},
{
"CommandList": [
{
"$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon",
"ParameterName": "父任务",
"TableValue": {
"TableName": "任务表",
"TableValueType": 1,
"BindingInfos": [
{
"GUID": "6760dadc-d949-4b45-ae70-50c034c806de",
"BindingInfo": {
"TableName": "任务表",
"ColumnName": "层级",
"GUID": "71447dd9-ed15-40d3-8c95-35af02be1228"
},
"ColumnName": "层级"
},
{
"GUID": "eb1e2579-cb27-4219-8c94-c22b985b827f",
"BindingInfo": {
"TableName": "任务表",
"ColumnName": "任务预算工时",
"GUID": "f2ea1508-f30e-412f-a345-3ede9d6c420d"
},
"ColumnName": "任务预算工时"
},
{
"GUID": "435b9b45-862d-4a31-91e3-5b4e9ce75489",
"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": "a772fe34c2594bce9ced25c057497185"
},
{
"$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon",
"ParameterName": "预算工时上限",
"ParameterValue": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=父任务.任务预算工时-父任务.总计划工时"
},
"ID": "1f803427f50543e3bbc7d34be52ae616"
},
{
"$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon",
"ParameterName": "层级",
"ParameterValue": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=父任务.层级+1"
},
"ID": "18d496286fcd41938205ec186b6d6fb4"
}
],
"ID": "4afddd1e-6ec5-43b3-bd8a-62b9d375d848"
}
],
"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": "04713767-c4db-4ac2-a6d2-8c9fd52d435e"
}
]
}
],
"ID": "8cf18dc0-128a-476c-b041-a5be5f57bc47"
}
],
"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"
}
}
]
}
}
]
}