{ "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 }, "TestData": "2" }, { "Name": "开始日期", "DataValidationInfo": {}, "TestData": "2024-03-01" }, { "Name": "结束日期", "DataValidationInfo": {}, "TestData": "2024-03-10" }, { "Name": "执行人", "DataValidationInfo": { "IgnoreBlank": false }, "TestData": "administrator" }, { "Name": "工时数", "DataValidationInfo": { "IgnoreBlank": false }, "TestData": "40" }, { "Name": "备注", "DataValidationInfo": {}, "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": "1b1dfe53-8569-419b-9ac7-4bb4e54e5cb3" }, "ColumnName": "项目ID" }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "任务名称", "GUID": "2f0ff2cf-b0cf-49ba-99c2-9b8636152c54" }, "ColumnName": "任务名称" }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "任务预算工时", "GUID": "503e9dd2-fc8c-4426-a37f-c7d582c9577a" }, "ColumnName": "任务预算工时" }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "任务状态", "GUID": "93ff9848-29c1-4cf6-a3cd-d33eb1d033c4" }, "ColumnName": "任务状态" }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "任务状态", "GUID": "da675aa2-3619-422b-817f-eed8c7c118c7", "RelationBinding": { "RelatedTable": "任务状态", "RelatedColumn": "状态码", "DisplayColumn": "任务状态" } }, "ColumnName": "任务状态文本" }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "038a41fb-93fa-46f8-b259-87eb94cc28ad", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "严格模式" } }, "ColumnName": "严格模式" }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "f4212e88-f2aa-4d8f-8ba8-b7c518505bb7", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "项目预算工时" } }, "ColumnName": "项目预算工时" }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "31040160-fc88-459c-b67b-8621acbc0920", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "项目预算费用" } }, "ColumnName": "项目预算费用" }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "任务类型", "GUID": "f6fb60c7-0ba6-450b-9cda-28eb2412e296", "RelationBinding": { "RelatedTable": "任务类型", "RelatedColumn": "ID", "DisplayColumn": "提成系数" } }, "ColumnName": "提成系数" }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "项目ID", "GUID": "b5020b4b-8e2e-4b31-a2ac-53ca31b14b8e", "RelationBinding": { "RelatedTable": "项目表", "RelatedColumn": "ID", "DisplayColumn": "工时分配方式" } }, "ColumnName": "工时分配方式" }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "开始时间", "GUID": "0c228fe1-2060-41dc-b283-9e6de6475ddd" }, "ColumnName": "开始时间" }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "执行者", "GUID": "040c1732-e12c-49b9-8709-0d72a08f5a14" }, "ColumnName": "执行者" }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "总计划工时", "GUID": "4bdf7858-40b1-495e-be0d-109aaaf4f69f" }, "ColumnName": "总计划工时" }, { "BindingInfo": { "TableName": "任务表", "ColumnName": "总实际工时", "GUID": "8505a216-3aee-4056-affe-6c760e35c844" }, "ColumnName": "总实际工时" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务表", "ColumnName": "ID", "GUID": "6ffb7caa-1cd8-4373-b2bf-8a03556c1866" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务ID" } }, "NullFormulaValueQueryPolicy": 0, "TopCount": "1" }, "ID": "03a074c6e5a64bd38fbfd1eba61d9737" }, { "$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": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.任务预算工时" }, "compareType": 4 }, { "$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.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "项目成员", "TableValue": { "TableName": "项目成员表", "TableValueType": 1, "BindingInfos": [ { "BindingInfo": { "TableName": "项目成员表", "ColumnName": "ID", "GUID": "5b0ac4f9-25c2-4d0b-953b-8fc25f915d3b" }, "ColumnName": "ID" }, { "BindingInfo": { "TableName": "项目成员表", "ColumnName": "项目成员", "GUID": "5e5071c7-2eb0-4ea8-a5c9-d4a102f25e24" }, "ColumnName": "项目成员" }, { "BindingInfo": { "TableName": "项目成员表", "ColumnName": "默认时薪", "GUID": "d434791e-bf5a-4688-8caa-7777fe811018" }, "ColumnName": "成员时薪" }, { "BindingInfo": { "TableName": "项目成员表", "ColumnName": "岗位ID", "GUID": "0742bcd9-236d-4c48-87fb-d1f4a981a3e5", "RelationBinding": { "RelatedTable": "项目岗位", "RelatedColumn": "ID", "DisplayColumn": "默认时薪" } }, "ColumnName": "岗位时薪" }, { "BindingInfo": { "TableName": "项目成员表", "ColumnName": "项目成员", "GUID": "653b75d4-3491-4a4c-a330-00b180998295", "AttachType": { "$type": "ForguncyDataAccess.UserColumnAttachObj, ForguncyDataAccess", "UserColumnAttachType": 5, "AttachTypeTag": "默认时薪" } }, "ColumnName": "用户时薪" }, { "BindingInfo": { "TableName": "项目成员表", "ColumnName": "项目成员", "GUID": "496e2025-1b05-42b2-8858-f75e717c926f", "AttachType": { "$type": "ForguncyDataAccess.UserColumnAttachObj, ForguncyDataAccess", "UserColumnAttachType": 5, "AttachTypeTag": "负荷" } }, "ColumnName": "成员负荷" } ], "SqlCondition": { "$type": "ForguncyDataAccess.RelationSqlCondition, ForguncyDataAccess", "SubConditions": [ { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "项目成员表", "ColumnName": "项目ID", "GUID": "363b99f0-817d-4c62-aabd-a1cc3bfc8d6c" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.项目ID" } }, { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "项目成员表", "ColumnName": "项目成员", "GUID": "ee74776e-38e4-4133-98c0-520529836bdf" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=执行人" } } ] }, "NullFormulaValueQueryPolicy": 0, "TopCount": "1" }, "ID": "0099f81184974a0783333d5de705e02f" }, { "$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.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "提成系数", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.提成系数" }, "ID": "7b355b509372477787f4dc070f69c5bf" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "任务成员是否存在", "TableValue": { "TableName": "任务成员表", "TableValueType": 3, "SqlCondition": { "$type": "ForguncyDataAccess.RelationSqlCondition, ForguncyDataAccess", "SubConditions": [ { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务成员表", "ColumnName": "任务ID", "GUID": "513afd45-e476-45f0-a858-293abdb3c212" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务ID" } }, { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务成员表", "ColumnName": "参与人", "GUID": "40488a39-9df7-4064-80ab-e9f36af4a0e3" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=执行人" } } ] }, "NullFormulaValueQueryPolicy": 0 }, "ID": "dae25d13dbca4709833847e7abf40991" }, { "$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": "0" }, "CommandList": [ { "$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon", "TableName": "任务成员表", "UpdateType": "add", "ShowConfirm": false, "UpdateBindingValues": [ { "BindingInfo": { "TableName": "任务成员表", "ColumnName": "项目成员ID", "GUID": "9ad41ba8-bc38-4b80-a3e6-7b3baef78fb1" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=项目成员.ID" } }, { "BindingInfo": { "TableName": "任务成员表", "ColumnName": "项目ID", "GUID": "4969a0f4-00f4-41a1-ad82-277791beaf98" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.项目ID" } }, { "BindingInfo": { "TableName": "任务成员表", "ColumnName": "任务ID", "GUID": "1d940b10-f4ff-4dd8-8af9-e92cda35a119" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务ID" } }, { "BindingInfo": { "TableName": "任务成员表", "ColumnName": "参与人", "GUID": "b0150daf-ecd7-490f-aaa1-df618a441107" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=执行人" } } ], "ParamNameToSaveNewRowValue": "" } ], "ID": "d1633308-13e3-4d11-9fe5-d3b0c1db8aa9" } ] }, { "$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": "2", "compareType": 4 }, "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": "1" }, "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "计算开始日期", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=TODAY()" }, "ID": "b001c8aa74dd4f8382a375f3912a62da" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "计算结束日期", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=TODAY()" }, "ID": "91295edff0c44f608a14d5c9f9594f3e" } ], "ID": "b36b8605-2158-48af-9918-9445ad666320" }, { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.工时分配方式" } }, "value": "2" }, "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "计算开始日期", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=开始日期" }, "ID": "234119e808564ed7acaf62c2c6b38398" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "计算结束日期", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=结束日期" }, "ID": "727f49edcb914303adf91ed9a40e4355" } ], "ID": "f14e03df-aefb-4c10-a5b9-491c073ade52" } ], "Comments": "如果是按人分配,则把计划工时分到一天中" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "待分配工时", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=工时数" }, "ID": "e384d36ab63b4ebd80ab9bb4d389c9d6" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "分配天数", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=DATEDIF(开始日期,结束日期,\"d\")+1" }, "ID": "4fb6ad850e174b6a85aded16a0b82e91" }, { "$type": "Forguncy.Model.ServerTransactionCommand, ServerDesignerCommon", "CommandList": [ { "$type": "Forguncy.Model.LoopCommand, ServerDesignerCommon", "LoopInfo": { "$type": "Forguncy.Model.CountLoopInfo, ServerDesignerCommon", "LoopCount": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=分配天数" }, "LoopIndexParamName": "index", "LoopItemParamName": "Item" }, "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "当前日期", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=开始日期+(index-1)" }, "ID": "f631633dde2d48c39491e29455a3fb28" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "统计工时", "TableValue": { "TableName": "任务工时表", "TableValueType": 1, "BindingInfos": [ { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "总工时", "GUID": "a0006a9d-3fba-4cf5-a20a-d2a0909d5175" }, "ColumnName": "总工时" } ], "SqlCondition": { "$type": "ForguncyDataAccess.RelationSqlCondition, ForguncyDataAccess", "SubConditions": [ { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务工时表", "ColumnName": "工时日期", "GUID": "98f3f236-67bc-4db2-9af7-407e52bdcd74" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=当前日期" } }, { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务工时表", "ColumnName": "执行人", "GUID": "9a1d5408-9353-4ab0-bef4-91af355df584" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=执行人" } }, { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "任务工时表", "ColumnName": "工时类型", "GUID": "6fae6e04-e2b8-4d6c-b594-3bd02c5883d2" }, "Value": "计划" } ] }, "NullFormulaValueQueryPolicy": 0 }, "ID": "b17117425ffb4ebe8fb149578b3d52df" }, { "$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": "=index" } }, "value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=分配天数" }, "compareType": 4 }, "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "计算本次分配工时", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ROUNDUP(工时数/分配天数,1)" }, "ID": "622dd1eb09094e29b7b7201423479597" } ], "ID": "344b6468-7cc2-40f0-8179-fc194a651ceb" }, { "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "计算本次分配工时", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ROUNDUP(待分配工时,1)" }, "ID": "22bbafd761814075a115c7c935a993c0" } ], "ID": "002ddc05-eebd-41a8-b4dc-206db7f9c6fa" } ] }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "预计增加后工时", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=IF(统计工时.总工时=\"\",0,统计工时.总工时)+计算本次分配工时" }, "ID": "02c134ab677047ef9f05766105a85c57" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "执行人负荷", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=IF(OR(项目成员.成员负荷=\"\",项目成员.成员负荷=0,项目成员.成员负荷>24),24,项目成员.成员负荷)" }, "ID": "eb8fa08ae96c4c81bace7556eeea279b" }, { "$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": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=执行人负荷" }, "compareType": 5 } ], "RelationType": 1 }, "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "待分配工时", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ROUNDUP(待分配工时-计算本次分配工时,1)" }, "ID": "7ac0d2f1abf7464682eb5962f48e2868" }, { "$type": "Forguncy.Model.ServerTransactionCommand, ServerDesignerCommon", "CommandList": [ { "$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon", "TableName": "任务工时表", "UpdateType": "add", "ShowConfirm": false, "UpdateBindingValues": [ { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "项目ID", "GUID": "d25bba73-7774-4b30-9b25-78e66b663cb1" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.项目ID" } }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "任务ID", "GUID": "a57a627a-5fb0-4678-9b76-35da70121b50" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务ID" } }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "工时日期", "GUID": "cf10d3fa-8308-4d82-aa1a-24cae3e4cdd4" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=当前日期" } }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "工时类型", "GUID": "308096da-5797-4c9c-b872-6ca8fedfb98e" }, "Value": "计划" }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "执行人", "GUID": "e8894d5f-bd6e-43ee-80d6-7e617ea28f40" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=执行人" } }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "执行内容", "GUID": "cc408d25-c0b6-42b9-8907-1a5d56b0c0be" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=备注" } }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "工时", "GUID": "aa83ea70-5672-4ce4-be7c-6312ab30ba82" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=计算本次分配工时" } }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "时薪单价", "GUID": "0b60ffc6-9883-4b22-b4c1-e8b77cc439b7" }, "Value": "0" }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "提成系数", "GUID": "2d74b0e6-3b2e-48dc-a448-cb14325448b0" }, "Value": "0" }, { "BindingInfo": { "TableName": "任务工时表", "ColumnName": "时薪来源", "GUID": "129b380c-2f05-4f1f-904d-4bb4fb46bb2c" } } ] }, { "$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon", "TableName": "项目动态", "UpdateType": "add", "ShowConfirm": false, "UpdateBindingValues": [ { "BindingInfo": { "TableName": "项目动态", "ColumnName": "项目ID", "GUID": "2030c959-552e-4bd3-b1c0-db65b1a2a8f6" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=任务信息.项目ID" } }, { "BindingInfo": { "TableName": "项目动态", "ColumnName": "项目动态", "GUID": "c7ddc3f1-2e25-4688-90e2-ab52bdbc38f1" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=\"任务[\"&任务信息.任务名称&\"]增加计划工时\"&工时数&\"小时\"" } }, { "BindingInfo": { "TableName": "项目动态", "ColumnName": "执行人", "GUID": "c79cf25a-e2c3-4666-85d4-db2096a27097" }, "Value": "%CurrentUser%" } ] } ] } ], "Comments": "如果不是按人分配,且分配后的工时超过负荷,则报错", "ID": "c3f5dfcb-faa6-4c2d-8a17-adde85d84d21" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=TEXT(当前日期,\"yyyy年mm月dd\")&\"的最大工作负荷超出限制的\"&执行人负荷&\"小时,请重新提交!\"" } } ], "ID": "202ef6ff-9a09-4f5c-8bb2-7ef6a491d502" } ] } ] } ] }, { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "0", "Message": "分配计划工时成功" } ], "ID": "e0906924-644a-4215-8788-49355fe2b396" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=\"当前任务状态为[\"&任务信息.任务状态文本&\"],无法提交工时!\"" } } ], "ID": "6a1c2e67-30a0-4ba6-bbc1-f8abbbab6826" } ] } ], "ID": "e831e148-1221-4889-be49-e56123760a9b" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": "该用户不是项目成员,无法分配。" } ], "ID": "43ea55bf-2900-4251-9d3d-e64cf012b397" } ], "Comments": "如果任务成员中没有,则自动加一个" } ], "ID": "765f382f-fff9-4476-8974-21ee9a06b99c" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": "您提交的工时超过任务预算工时,请修改后重新提交" } ], "ID": "05ac18ac-9a93-4915-a3c7-78b9856a0e2d" } ] } ], "ID": "93ec914d-df3d-4199-8f33-9a9d3fa4d8bc" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": "任务不存在" } ], "ID": "f71d606b-8ac5-4886-b932-13da172a6bab" } ] } ] }, "CatchCommandPart": { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ExceptionCode" }, "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ExceptionMessage" } } ] } } ] }