作者 陈志颖

fix:更新任务离职人员限制

@@ -1292,13 +1292,24 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask @@ -1292,13 +1292,24 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask
1292 } 1292 }
1293 employee, err := employeeRepository.FindOne(map[string]interface{}{ 1293 employee, err := employeeRepository.FindOne(map[string]interface{}{
1294 "uid": updateTaskCommand.AssignedPerson, 1294 "uid": updateTaskCommand.AssignedPerson,
  1295 + "status": 1,
1295 }) 1296 })
1296 if err != nil { 1297 if err != nil {
1297 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 1298 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
1298 } 1299 }
1299 if employee == nil { 1300 if employee == nil {
  1301 + // 获取无效的发布人员信息
  1302 + employeeInvalid, err := employeeRepository.FindOne(map[string]interface{}{
  1303 + "uid": updateTaskCommand.AssignedPerson,
  1304 + })
  1305 + if err != nil {
  1306 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  1307 + }
  1308 + if employeeInvalid == nil {
1300 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员") 1309 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员")
1301 } 1310 }
  1311 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员:" + employeeInvalid.EmployeeInfo.EmployeeName)
  1312 + }
1302 updateData["assignedPerson"] = employee.EmployeeInfo 1313 updateData["assignedPerson"] = employee.EmployeeInfo
1303 } else { 1314 } else {
1304 updateData["assignedPerson"] = &domain.EmployeeInfo{} 1315 updateData["assignedPerson"] = &domain.EmployeeInfo{}