{ "Name": "修改工时", "Enabled": true, "Triggers": [ { "$type": "Forguncy.ServerCommands.Models.PostRequestTrigger, 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 }, "TestData": "2" }, { "Name": "新日期", "DataValidationInfo": { "IgnoreBlank": false }, "TestData": "2024-03-01" }, { "Name": "新执行者", "DataValidationInfo": { "IgnoreBlank": false }, "TestData": "administrator" }, { "Name": "新工时数", "DataValidationInfo": { "IgnoreBlank": false }, "TestData": "40" }, { "Name": "新进展内容", "TestData": "测试" } ], "InvokeTriggerTestData": { "UserName": "Administrator" } } ], "Commands": [ { "$type": "Forguncy.Model.CatchExceptionCommand, ServerDesignerCommon", "TryCommandPart": { "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "报工信息", "TableValue": { "TableName": "任务工时表", "TableValueType": 1, "BindingInfos": [ { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "任务ID", "GUID": "f250f3d4-306f-4f2f-b1d3-0be7458a2623" }, "ColumnName": "任务ID" }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "工时类型", "GUID": "2309d652-ed06-48e9-bbf9-fb9583aca0ce" }, "ColumnName": "工时类型" }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "任务ID", "GUID": "09989c87-5b7e-40eb-be4c-9ba87b32b467", "RelationBinding": { "RelatedTable": "任务表", "RelatedColumn": "ID", "DisplayColumn": "任务状态" } }, "ColumnName": "任务状态" }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "任务ID", "GUID": "ec846c2f-3aa5-4484-95ef-1972503a07b3", "RelationBinding": { "RelatedTable": "任务表", "RelatedColumn": "ID", "DisplayColumn": "任务状态", "NextRelationBinding": { "RelatedTable": "任务状态", "RelatedColumn": "状态码", "DisplayColumn": "任务状态" } } }, "ColumnName": "任务状态文本" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务工时表", "ColumnName": "ID", "GUID": "cabb4369-8835-48c1-a904-84a5e39c961c" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=报工ID" } }, "NullFormulaValueQueryPolicy": 0, "TopCount": "1" }, "ID": "08a93b043f414bad996c1d2f2c516c4c" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "执行者", "TableValue": { "TableName": "用户信息视图", "TableValueType": 1, "BindingInfos": [ { "BindingInfo": { "TableName": "用户信息视图", "ColumnName": "全名", "GUID": "f0683fc3-36ac-4c4b-ab9a-dd9886a93fa5" }, "ColumnName": "全名" }, { "BindingInfo": { "TableName": "用户信息视图", "ColumnName": "负荷", "GUID": "50c4d16c-d1aa-4984-9701-89ad5d48ef41" }, "ColumnName": "负荷" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "用户信息视图", "ColumnName": "用户名", "GUID": "d1335a82-4ec2-4bd6-8097-b8cde857970b" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=新执行者" } }, "NullFormulaValueQueryPolicy": 0, "TopCount": "1" }, "ID": "62c361ee22e4405e96f2e66576c96c73" }, { "$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.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "统计时长", "TableValue": { "TableName": "任务工时表", "TableValueType": 1, "BindingInfos": [ { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "总工时", "GUID": "f3ff96b9-45fd-4ef8-b770-a8d687a57989" }, "ColumnName": "总工时" } ], "SqlCondition": { "$type": "ForguncyDataAccess.RelationSqlCondition, ForguncyDataAccess", "SubConditions": [ { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务工时表", "ColumnName": "任务ID", "GUID": "fc31ce71-9de3-410e-9bbe-e0c4f47901b4" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=报工信息.任务ID" } }, { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务工时表", "ColumnName": "执行人", "GUID": "24a62ccf-962a-4f4b-b401-6ba78e64281a" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=新执行者" } }, { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务工时表", "ColumnName": "工时类型", "GUID": "58bd9aa1-8b1f-4302-ae42-6182aa229f65" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=报工信息.工时类型" } }, { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "CompareType": 1, "ColumnBindingInfo": { "TableName": "任务工时表", "ColumnName": "ID", "GUID": "3f29fdbd-f187-451e-b7f7-964742413192" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=报工ID" } }, { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务工时表", "ColumnName": "工时日期", "GUID": "fc7683a1-dd0d-4616-852a-bd0571eb863d" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=新日期" } } ] }, "NullFormulaValueQueryPolicy": 0 }, "ID": "6f71560168554d95937ce8d8597f8d79" }, { "$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": "计划" }, "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "最大负荷", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=IF(OR(执行者.负荷=\"\",执行者.负荷=0,执行者.负荷>24),24,执行者.负荷)" }, "ID": "3315ab13956142d98db874dbb6d85684" } ], "ID": "874adf86-99b3-4d05-ba83-f3a7392422f0" }, { "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "最大负荷", "ParameterValue": "24", "ID": "8d185b9ac0734ccca2814b16b5b62eca" } ], "ID": "26ed4dcb-8918-48fb-9a3e-182863a109b0" } ] }, { "$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": "=IF(统计时长.总工时=\"\",0,统计时长.总工时)+新工时数" } }, "value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=最大负荷" }, "compareType": 5 }, "CommandList": [ { "$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon", "TableName": "任务工时表", "ShowConfirm": false, "RowsToUpdate": 1, "RowsToUpdateCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务工时表", "ColumnName": "ID", "GUID": "1a75f32d-f665-4ec1-838a-9fc3b661edf3" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=报工ID" } }, "UpdateBindingValues": [ { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "工时日期", "GUID": "a7499f28-816b-4847-aaab-35b90c7ce942" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=新日期" } }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "执行人", "GUID": "21b0cae0-c6d1-4e89-862f-1d3213e791d6" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=新执行者" } }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "执行内容", "GUID": "c8a590ce-4e0d-4794-a5f5-13042a5e27f1" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=新进展内容" } }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "工时", "GUID": "1cc7e19f-312e-48a6-9cea-f19461825e84" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=新工时数" } } ] }, { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "0", "Message": "更新成功" } ], "ID": "db78052b-f630-4b4a-b526-fea681effc86" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=\"你提交的工时超过了\"&执行者.全名&\"设置的最大负荷\"&最大负荷&\"小时\"" } } ], "ID": "caa50012-ca70-4365-a388-15c10cbaef7e" } ] } ], "ID": "644a39c8-965f-4aa3-8208-5c7d0aba82b6" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=\"当前任务状态为[\"&报工信息.任务状态文本&\"],无法修改工时!\"" } } ], "ID": "110c39a0-614b-4903-91ce-0289a3db5db2" } ] } ] }, "CatchCommandPart": { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ExceptionCode" }, "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ExceptionMessage" } } ] } } ] }